30 {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
31 {0x04, 3}, {0x05, 3}, {0x06, 3}, {0x07, 3},
32 {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
34 {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
36 {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
38 {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
40 {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
45 { 0x01, 0x01, 0x00, 0x1f }, { 0x03, 0x02, 0x00, 0x1b },
46 { 0x07, 0x02, 0x01, 0x1f }, { 0x0F, 0x02, 0x02, 0x19 },
47 { 0x07, 0x02, 0x01, 0x03 }, { 0x0F, 0x02, 0x02, 0x1f },
48 { 0x1F, 0x02, 0x03, 0x01 }, { 0x07, 0x02, 0x01, 0x1a },
49 { 0x0F, 0x02, 0x02, 0x1f }, { 0x1F, 0x02, 0x03, 0x18 },
50 { 0x0F, 0x02, 0x02, 0x02 }, { 0x1F, 0x02, 0x03, 0x1f },
51 { 0x3F, 0x02, 0x04, 0x00 }, { 0x0F, 0x03, 0x01, 0x1f },
52 { 0x1F, 0x03, 0x02, 0x18 }, { 0x0F, 0x03, 0x01, 0x02 },
53 { 0x1F, 0x03, 0x02, 0x1f }, { 0x3F, 0x03, 0x03, 0x00 },
54 { 0x1F, 0x04, 0x01, 0x01 }, { 0x1F, 0x04, 0x01, 0x18 },
55 { 0x3F, 0x04, 0x02, 0x00 },
67 #define CRC_TABLE_SIZE 257
69 #define CRC_TABLE_SIZE 1024
90 crc ^=
AV_RL16(buf + buf_size - 2);
97 checksum ^= buf[buf_size-1];
104 int num_bytes = (bit_size + 2) / 8;
106 int crc =
crc_1D[buf[0] & 0x3f];
108 crc ^= buf[num_bytes - 1];
110 for (i = 0; i < ((bit_size + 2) & 7); i++) {
114 crc ^= (buf[num_bytes] >> (7 - i)) & 1;
122 uint32_t scratch = 0;
123 const uint8_t *buf_end = buf + buf_size;
125 for (; ((intptr_t) buf & 3) && buf < buf_end; buf++)
127 for (; buf < buf_end - 3; buf += 4)
128 scratch ^= *((
const uint32_t*)
buf);
132 for (; buf < buf_end; buf++)
#define AV_CH_LAYOUT_4POINT1
#define AV_CH_LAYOUT_SURROUND
uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size)
const uint8_t ff_mlp_huffman_tables[3][18][2]
Tables defining the Huffman codes.
#define AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_STEREO
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
const uint64_t ff_mlp_channel_layouts[12]
static uint8_t xor_32_to_8(uint32_t value)
XOR four bytes into one.
static AVCRC crc_1D[CRC_TABLE_SIZE]
Public header for CRC hash function implementation.
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
Initialize a CRC table.
uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size)
XOR together all the bytes of a buffer.
#define AV_CH_LAYOUT_QUAD
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...
const ChannelInformation ff_mlp_ch_info[21]
Tables defining channel information.
#define AV_CH_LAYOUT_3POINT1
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
static volatile int checksum
#define AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_LAYOUT_5POINT0_BACK
#define AV_CH_LAYOUT_2POINT1
static AVCRC crc_63[CRC_TABLE_SIZE]
av_cold void ff_mlp_init_crc(void)
#define AV_CH_LAYOUT_MONO
static AVCRC crc_2D[CRC_TABLE_SIZE]
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 implementatio...