Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVCODEC_MLP_H
00023 #define AVCODEC_MLP_H
00024
00025 #include <stdint.h>
00026
00027 #include "avcodec.h"
00028
00030 #define MAX_MATRIX_CHANNEL_MLP 5
00031 #define MAX_MATRIX_CHANNEL_TRUEHD 7
00032
00036 #define MAX_CHANNELS 8
00037
00041 #define MAX_MATRICES_MLP 6
00042 #define MAX_MATRICES_TRUEHD 8
00043 #define MAX_MATRICES 8
00044
00048 #define MAX_SUBSTREAMS 3
00049
00051 #define MAX_RATEFACTOR 4
00052
00053 #define MAX_SAMPLERATE (MAX_RATEFACTOR * 48000)
00054
00056 #define MAX_BLOCKSIZE (40 * MAX_RATEFACTOR)
00057
00058 #define MAX_BLOCKSIZE_POW2 (64 * MAX_RATEFACTOR)
00059
00061 #define NUM_FILTERS 2
00062
00064 #define MAX_FIR_ORDER 8
00065 #define MAX_IIR_ORDER 4
00066
00068 #define END_OF_STREAM 0xd234d234
00069
00070 #define FIR 0
00071 #define IIR 1
00072
00074 typedef struct {
00075 uint8_t order;
00076 uint8_t shift;
00077
00078 int32_t state[MAX_FIR_ORDER];
00079 } FilterParams;
00080
00082 typedef struct {
00083 FilterParams filter_params[NUM_FILTERS];
00084 int32_t coeff[NUM_FILTERS][MAX_FIR_ORDER];
00085
00086 int16_t huff_offset;
00087 int32_t sign_huff_offset;
00088 uint8_t codebook;
00089 uint8_t huff_lsbs;
00090 } ChannelParams;
00091
00097 extern const uint8_t ff_mlp_huffman_tables[3][18][2];
00098
00104 uint8_t ff_mlp_checksum8 (const uint8_t *buf, unsigned int buf_size);
00105 uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size);
00106
00110 uint8_t ff_mlp_restart_checksum(const uint8_t *buf, unsigned int bit_size);
00111
00115 uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size);
00116
00117 void ff_mlp_init_crc(void);
00118
00120 static inline uint8_t xor_32_to_8(uint32_t value)
00121 {
00122 value ^= value >> 16;
00123 value ^= value >> 8;
00124 return value;
00125 }
00126
00127 #endif