libavcodec/mlp_parser.c File Reference

MLP parser. More...

#include "bitstream.h"
#include "parser.h"
#include "crc.h"
#include "mlp_parser.h"

Go to the source code of this file.

Data Structures

struct  MLPParseContext

Functions

static int mlp_samplerate (int in)
static int truehd_channels (int chanmap)
static uint16_t mlp_checksum16 (const uint8_t *buf, unsigned int buf_size)
 MLP uses checksums that seem to be based on the standard CRC algorithm, but not (in implementation terms, the table lookup and XOR are reversed).
int ff_mlp_read_major_sync (void *log, MLPHeaderInfo *mh, const uint8_t *buf, unsigned int buf_size)
 Read a major sync info header - contains high level information about the stream - sample rate, channel arrangement etc.
static int mlp_parse (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)

Variables

static const uint8_t mlp_quants [16]
static const uint8_t mlp_channels [32]
static const uint8_t thd_chancount [13]
static int crc_init = 0
static AVCRC crc_2D [1024]
AVCodecParser mlp_parser


Detailed Description

MLP parser.

Definition in file mlp_parser.c.


Function Documentation

int ff_mlp_read_major_sync ( void *  log,
MLPHeaderInfo mh,
const uint8_t buf,
unsigned int  buf_size 
)

Read a major sync info header - contains high level information about the stream - sample rate, channel arrangement etc.

Most of this information is not actually necessary for decoding, only for playback.

Definition at line 93 of file mlp_parser.c.

Referenced by mlp_parse().

static uint16_t mlp_checksum16 ( const uint8_t buf,
unsigned int  buf_size 
) [static]

MLP uses checksums that seem to be based on the standard CRC algorithm, but not (in implementation terms, the table lookup and XOR are reversed).

We can implement this behavior using a standard av_crc on all but the last element, then XOR that with the last element.

Definition at line 74 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

static int mlp_parse ( AVCodecParserContext s,
AVCodecContext avctx,
const uint8_t **  poutbuf,
int *  poutbuf_size,
const uint8_t buf,
int  buf_size 
) [static]

Definition at line 174 of file mlp_parser.c.

static int mlp_samplerate ( int  in  )  [static]

Definition at line 47 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

static int truehd_channels ( int  chanmap  )  [static]

Definition at line 55 of file mlp_parser.c.

Referenced by mlp_parse().


Variable Documentation

AVCRC crc_2D[1024] [static]

Definition at line 66 of file mlp_parser.c.

Referenced by mlp_checksum16().

int crc_init = 0 [static]

Definition at line 65 of file mlp_parser.c.

Referenced by mlp_checksum16().

const uint8_t mlp_channels[32] [static]

Initial value:

 {
    1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 4, 5, 6, 4, 5, 4,
    5, 6, 5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}

Definition at line 37 of file mlp_parser.c.

Referenced by mlp_parse().

Initial value:

 {
    { CODEC_ID_MLP },
    sizeof(MLPParseContext),
    NULL,
    mlp_parse,
    NULL,
}

Definition at line 301 of file mlp_parser.c.

const uint8_t mlp_quants[16] [static]

Initial value:

 {
    16, 20, 24, 0, 0, 0, 0, 0,
     0,  0,  0, 0, 0, 0, 0, 0,
}

Definition at line 32 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

const uint8_t thd_chancount[13] [static]

Initial value:

 {

     2,   1,   1,   2,   2,   2,   2,   1,   1,   2,   2,   1,   1
}

Definition at line 42 of file mlp_parser.c.

Referenced by truehd_channels().


Generated on Thu Apr 2 07:16:12 2009 for ffmpeg by  doxygen 1.5.6