29 16, 20, 24, 0, 0, 0, 0, 0,
30 0, 0, 0, 0, 0, 0, 0, 0,
34 1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 4, 5, 6, 4, 5, 4,
35 5, 6, 5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
60 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
65 int has_extension, extensions = 0;
70 if (
AV_RB32(buf) == 0xf8726fba) {
71 has_extension = buf[25] & 1;
73 extensions = buf[26] >> 4;
74 size += 2 + extensions * 2;
88 int ratebits, channel_arrangement, header_size;
94 if (header_size < 0 || gb->size_in_bits < header_size << 3) {
109 mh->header_size = header_size;
111 if (
mh->stream_type == 0xbb) {
121 mh->channel_arrangement=
122 channel_arrangement =
get_bits(gb, 5);
124 mh->channel_layout_mlp =
mlp_layout[channel_arrangement];
125 }
else if (
mh->stream_type == 0xba) {
126 mh->group1_bits = 24;
131 mh->group2_samplerate = 0;
135 mh->channel_modifier_thd_stream0 =
get_bits(gb, 2);
136 mh->channel_modifier_thd_stream1 =
get_bits(gb, 2);
138 mh->channel_arrangement=
139 channel_arrangement =
get_bits(gb, 5);
143 mh->channel_modifier_thd_stream2 =
get_bits(gb, 2);
145 channel_arrangement =
get_bits(gb, 13);
151 mh->access_unit_size = 40 << (ratebits & 7);
152 mh->access_unit_size_pow2 = 64 << (ratebits & 7);
158 mh->peak_bitrate = (
get_bits(gb, 15) *
mh->group1_samplerate + 8) >> 4;
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
audio channel layout utility functions
bitstream reader API header.
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int get_bits_count(const GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_CH_LAYOUT_QUAD
#define AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_SURROUND
#define AV_CH_LAYOUT_5POINT0_BACK
#define AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_LOW_FREQUENCY
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size)
static int mlp_get_major_sync_size(const uint8_t *buf, int bufsize)
static const uint8_t mlp_quants[16]
static const uint8_t mlp_channels[32]
static const uint64_t mlp_layout[32]
int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
Read a major sync info header - contains high level information about the stream - sample rate,...
static int truehd_channels(int chanmap)
static int mlp_samplerate(int in)
static uint64_t truehd_layout(int chanmap)
static volatile int checksum