37 16, 20, 24, 0, 0, 0, 0, 0,
38 0, 0, 0, 0, 0, 0, 0, 0,
42 1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 4, 5, 6, 4, 5, 4,
43 5, 6, 5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
68 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
73 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1
97 return (in & 8 ? 44100 : 48000) << (in & 7) ;
104 for (i = 0; i < 13; i++)
115 for (i = 0; i < 13; i++)
116 layout |=
thd_layout[i] * ((chanmap >> i) & 1);
129 int ratebits, channel_arrangement;
160 channel_arrangement =
get_bits(gb, 5);
173 channel_arrangement =
get_bits(gb, 5);
179 channel_arrangement =
get_bits(gb, 13);
220 const uint8_t **poutbuf,
int *poutbuf_size,
221 const uint8_t *buf,
int buf_size)
236 for (i = 0; i < buf_size; i++) {
238 if ((mp->
pc.
state & 0xfffffffe) == 0xf8726fba &&
265 if (mp->
pc.
index + buf_size < 2) {
285 sync_present = (
AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba;
294 parity_bits ^= buf[p++];
295 parity_bits ^= buf[p++];
297 if (i < 0 || buf[p-2] & 0x80) {
298 parity_bits ^= buf[p++];
299 parity_bits ^= buf[p++];
303 if ((((parity_bits >> 4) ^ parity_bits) & 0xF) != 0xF) {
345 *poutbuf_size = buf_size;
struct MLPParseContext MLPParseContext
#define AV_CH_TOP_FRONT_RIGHT
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_CH_LAYOUT_SURROUND
uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size)
static void skip_bits_long(GetBitContext *s, int n)
#define AV_CH_TOP_FRONT_LEFT
#define AV_CH_TOP_FRONT_CENTER
#define AV_CH_LOW_FREQUENCY_2
#define AV_CH_LAYOUT_4POINT0
int duration
Duration of the current frame.
#define AV_CH_SURROUND_DIRECT_RIGHT
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#define AV_CH_LAYOUT_STEREO
static uint64_t truehd_layout(int chanmap)
#define AV_CH_LAYOUT_5POINT0
enum AVSampleFormat sample_fmt
audio sample format
static const uint64_t thd_layout[13]
#define AV_CH_LOW_FREQUENCY
static int mlp_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static int get_bits_count(const GetBitContext *s)
bitstream reader API header.
static const uint8_t mlp_channels[32]
AVCodecParser ff_mlp_parser
#define AV_CH_LAYOUT_5POINT1
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
static int truehd_channels(int chanmap)
int overread_index
the index into ParseContext.buffer of the overread bytes
void av_log(void *avcl, int level, const char *fmt,...)
uint64_t channel_layout
Audio channel layout.
void ff_parse_close(AVCodecParserContext *s)
int bit_rate
the average bitrate
audio channel layout utility functions
int overread
the number of bytes which where irreversibly read from the next frame
#define AV_CH_FRONT_LEFT_OF_CENTER
#define AV_CH_FRONT_CENTER
#define AV_CH_FRONT_RIGHT_OF_CENTER
static const uint8_t mlp_quants[16]
int sample_rate
samples per second
static int mlp_samplerate(int in)
main external API structure.
uint32_t state
contains the last few bytes in MSB order
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
#define AV_CH_BACK_CENTER
#define AVERROR_INVALIDDATA
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...
int channels
number of audio channels
av_cold void ff_mlp_init_crc(void)
#define AV_CH_SURROUND_DIRECT_LEFT
#define AV_CH_FRONT_RIGHT
static const uint8_t thd_chancount[13]
#define AV_CH_LAYOUT_MONO
static av_cold int mlp_init(AVCodecParserContext *s)
static const uint64_t mlp_layout[32]
if(!(ptr_align%ac->ptr_align)&&samples_align >=aligned_len)