libavcodec/mlp.h File Reference

#include <stdint.h>
#include "avcodec.h"

Go to the source code of this file.

Data Structures

struct  FilterParams
 filter data More...
struct  ChannelParams
 sample data coding information More...

Defines

#define MAX_CHANNELS   16
 Maximum number of channels that can be decoded.
#define MAX_MATRICES   15
 Maximum number of matrices used in decoding; most streams have one matrix per output channel, but some rematrix a channel (usually 0) more than once.
#define MAX_SUBSTREAMS   2
 Maximum number of substreams that can be decoded.
#define MAX_SAMPLERATE   192000
 maximum sample frequency seen in files
#define MAX_BLOCKSIZE   (40 * (MAX_SAMPLERATE / 48000))
 maximum number of audio samples within one access unit
#define MAX_BLOCKSIZE_POW2   (64 * (MAX_SAMPLERATE / 48000))
 next power of two greater than MAX_BLOCKSIZE
#define NUM_FILTERS   2
 number of allowed filters
#define MAX_FILTER_ORDER   8
 The maximum number of taps in either the IIR or FIR filter; I believe MLP actually specifies the maximum order for IIR filters as four, and that the sum of the orders of both filters must be <= 8.
#define END_OF_STREAM   0xd234d234
 Code that signals end of a stream.
#define FIR   0
#define IIR   1

Functions

uint8_t ff_mlp_checksum8 (const uint8_t *buf, unsigned int buf_size)
 MLP uses checksums that seem to be based on the standard CRC algorithm, but are not (in implementation terms, the table lookup and XOR are reversed).
uint16_t ff_mlp_checksum16 (const uint8_t *buf, unsigned int buf_size)
uint8_t ff_mlp_restart_checksum (const uint8_t *buf, unsigned int bit_size)
 Calculate an 8-bit checksum over a restart header -- a non-multiple-of-8 number of bits, starting two bits into the first byte of buf.
uint8_t ff_mlp_calculate_parity (const uint8_t *buf, unsigned int buf_size)
 XOR together all the bytes of a buffer.
void ff_mlp_init_crc (void)
static uint8_t xor_32_to_8 (uint32_t value)
 XOR four bytes into one.

Variables

const uint8_t ff_mlp_huffman_tables [3][18][2]
 Tables defining the Huffman codes.


Define Documentation

#define END_OF_STREAM   0xd234d234

Code that signals end of a stream.

Definition at line 60 of file mlp.h.

Referenced by read_access_unit().

#define FIR   0

#define IIR   1

Definition at line 63 of file mlp.h.

Referenced by filter_channel(), read_decoding_params(), and read_restart_header().

#define MAX_BLOCKSIZE   (40 * (MAX_SAMPLERATE / 48000))

maximum number of audio samples within one access unit

Definition at line 46 of file mlp.h.

#define MAX_BLOCKSIZE_POW2   (64 * (MAX_SAMPLERATE / 48000))

next power of two greater than MAX_BLOCKSIZE

Definition at line 48 of file mlp.h.

Referenced by read_major_sync().

#define MAX_CHANNELS   16

Maximum number of channels that can be decoded.

Definition at line 30 of file mlp.h.

#define MAX_FILTER_ORDER   8

The maximum number of taps in either the IIR or FIR filter; I believe MLP actually specifies the maximum order for IIR filters as four, and that the sum of the orders of both filters must be <= 8.

Definition at line 57 of file mlp.h.

Referenced by filter_channel(), and read_filter_params().

#define MAX_MATRICES   15

Maximum number of matrices used in decoding; most streams have one matrix per output channel, but some rematrix a channel (usually 0) more than once.

Definition at line 35 of file mlp.h.

#define MAX_SAMPLERATE   192000

maximum sample frequency seen in files

Definition at line 43 of file mlp.h.

Referenced by read_major_sync().

#define MAX_SUBSTREAMS   2

Maximum number of substreams that can be decoded.

This could also be set higher, but I haven't seen any examples with more than two.

Definition at line 40 of file mlp.h.

Referenced by mlp_decode_init(), read_access_unit(), and read_major_sync().

#define NUM_FILTERS   2

number of allowed filters

Definition at line 51 of file mlp.h.

Referenced by filter_channel().


Function Documentation

uint8_t ff_mlp_calculate_parity ( const uint8_t *  buf,
unsigned int  buf_size 
)

XOR together all the bytes of a buffer.

Does this belong in dspcontext?

Definition at line 94 of file mlp.c.

Referenced by read_access_unit().

uint16_t ff_mlp_checksum16 ( const uint8_t *  buf,
unsigned int  buf_size 
)

Definition at line 59 of file mlp.c.

Referenced by ff_mlp_read_major_sync().

uint8_t ff_mlp_checksum8 ( const uint8_t *  buf,
unsigned int  buf_size 
)

MLP uses checksums that seem to be based on the standard CRC algorithm, but are 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 68 of file mlp.c.

Referenced by read_access_unit().

void ff_mlp_init_crc ( void   ) 

Definition at line 49 of file mlp.c.

Referenced by init_static(), and mlp_init().

uint8_t ff_mlp_restart_checksum ( const uint8_t *  buf,
unsigned int  bit_size 
)

Calculate an 8-bit checksum over a restart header -- a non-multiple-of-8 number of bits, starting two bits into the first byte of buf.

Definition at line 75 of file mlp.c.

Referenced by read_restart_header().

static uint8_t xor_32_to_8 ( uint32_t  value  )  [inline, static]

XOR four bytes into one.

Definition at line 112 of file mlp.h.

Referenced by ff_mlp_calculate_parity(), and read_restart_header().


Variable Documentation

const uint8_t ff_mlp_huffman_tables[3][18][2]

Tables defining the Huffman codes.

There are three entropy coding methods used in MLP (four if you count "none" as a method). These use the same sequences for codes starting with 00 or 01, but have different codes starting with 1.

Definition at line 28 of file mlp.c.

Referenced by init_static().


Generated on Fri Oct 26 02:35:43 2012 for FFmpeg by  doxygen 1.5.8