Go to the documentation of this file.
27 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 8, 1, 2, 3, 3, 4, 5, 6, 1, 2, 3, 4, 1, 1
31 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 8, 8
35 0, 42965, 43008, 44800, 53706, 53760
40 if (nb_words >
s->input_size) {
44 s->input += nb_words *
s->word_bytes;
45 s->input_size -= nb_words;
52 const uint8_t *
key =
s->input;
63 const uint8_t *
src =
s->input;
64 uint8_t *
dst =
s->buffer;
70 if (nb_words >
s->input_size) {
76 switch (
s->word_bits) {
78 for (
i = 0;
i < nb_words;
i++,
src += 2,
dst += 2)
83 for (
i = 0;
i < nb_words;
i++,
src += 3)
88 for (
i = 0;
i < nb_words;
i++,
src += 3,
dst += 3)
92 av_unreachable(
"ff_dolby_e_parse_header() only sets 16, 20, 24 and errors out otherwise");
101 int hdr,
ret,
key, mtd_size;
107 if ((hdr & 0xfffffe) == 0x7888e) {
109 }
else if ((hdr & 0xffffe0) == 0x788e0) {
111 }
else if ((hdr & 0xfffe00) == 0x78e00) {
119 s->word_bytes =
s->word_bits + 7 >> 3;
120 s->input = buf +
s->word_bytes;
121 s->input_size = buf_size /
s->word_bytes - 1;
122 s->key_present = hdr >> 24 -
s->word_bits & 1;
161 for (
int i = 0;
i <
header->nb_channels;
i++)
167 for (
int i = 0;
i <
header->nb_channels;
i++) {
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static int get_bits_left(GetBitContext *gb)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static int skip_input(DBEContext *s, int nb_words)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define u(width, name, range_min, range_max)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static const uint8_t nb_channels_tab[MAX_PROG_CONF+1]
#define av_unreachable(msg)
Asserts that are used as compiler optimization hints depending upon ASSERT_LEVEL and NBDEBUG.
int ff_dolby_e_parse_header(DBEContext *s, const uint8_t *buf, int buf_size)
Initialize DBEContext and parse Dolby E metadata.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static const uint8_t header[24]
static void skip_bits1(GetBitContext *s)
#define i(width, name, range_min, range_max)
static int parse_key(DBEContext *s)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static const uint16_t sample_rate_tab[16]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
int ff_dolby_e_convert_input(DBEContext *s, int nb_words, int key)
Use the provided key to transform the input into data (put into s->buffer) suitable for further proce...
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
static const uint8_t nb_programs_tab[MAX_PROG_CONF+1]