FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
dolby_e.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "libavutil/thread.h"
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"
#include "libavutil/tx.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "dolby_e.h"
#include "kbdwin.h"

Go to the source code of this file.

Data Structures

struct  DBEGroup
 
struct  DBEChannel
 
struct  DBEDecodeContext
 

Macros

#define MAX_SEGMENTS   2
 
#define MAX_GROUPS   8
 
#define MAX_EXPONENTS   304
 
#define MAX_MANTISSAS   1024
 
#define MAX_MSTR_EXP   2
 
#define MAX_BIAS_EXP   50
 
#define OFFSET(x)   offsetof(DBEDecodeContext, x)
 
#define FLAGS   (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
 

Enumerations

enum  DBEOutputChannelOrder { CHANNEL_ORDER_DEFAULT, CHANNEL_ORDER_CODED }
 

Functions

static int skip_input (DBEContext *s, int nb_words)
 
static int parse_key (DBEContext *s)
 
static int parse_metadata_ext (DBEDecodeContext *s1)
 
static void unbias_exponents (DBEContext *s, DBEChannel *c, DBEGroup *g)
 
static int parse_exponents (DBEContext *s, DBEChannel *c)
 
static int log_add (int a, int b)
 
static void calc_lowcomp (int *msk_val)
 
static void bit_allocate (int nb_exponent, int nb_code, int fr_code, int *exp, int *bap, int fg_spc, int fg_ofs, int msk_mod, int snr_ofs)
 
static int parse_bit_alloc (DBEDecodeContext *s1, DBEChannel *c)
 
static int parse_indices (DBEContext *s, DBEChannel *c)
 
static int parse_mantissas (DBEContext *s, DBEChannel *c)
 
static int parse_channel (DBEDecodeContext *s1, int ch, int seg_id)
 
static int parse_audio (DBEDecodeContext *s1, int start, int end, int seg_id)
 
static int parse_meter (DBEDecodeContext *s1)
 
static void imdct_calc (DBEDecodeContext *s1, DBEGroup *g, float *result, float *values)
 
static void transform (DBEDecodeContext *s1, DBEChannel *c, float *history, float *output)
 
static void apply_gain (DBEDecodeContext *s, int begin, int end, float *output)
 
static int filter_frame (DBEDecodeContext *s, AVFrame *frame)
 
static int dolby_e_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold void dolby_e_flush (AVCodecContext *avctx)
 
static av_cold int dolby_e_close (AVCodecContext *avctx)
 
static av_cold void init_tables (void)
 
static av_cold int dolby_e_init (AVCodecContext *avctx)
 

Variables

static const int8_t lfe_channel_tab [MAX_PROG_CONF+1]
 
static const uint8_t ch_reorder_4 [4] = { 0, 2, 1, 3 }
 
static const uint8_t ch_reorder_6 [6] = { 0, 2, 4, 1, 3, 5 }
 
static const uint8_t ch_reorder_8 [8] = { 0, 2, 6, 4, 1, 3, 7, 5 }
 
static const uint8_t ch_reorder_n [8] = { 0, 2, 4, 6, 1, 3, 5, 7 }
 
static const uint8_t nb_groups_tab [4] = { 1, 8, 7, 1 }
 
static const uint8_t nb_mstr_exp_tab [4] = { 2, 2, 2, 1 }
 
static const uint8_t nb_mantissa_38 [38]
 
static const uint8_t nb_mantissa_44 [44]
 
static const uint8_t nb_mantissa_50 [50]
 
static const uint8_t imdct_bits_tab [3] = { 8, 9, 11 }
 
static const DBEGroup grp_tab_0 [1]
 
static const DBEGroup grp_tab_1 [8]
 
static const DBEGroup grp_tab_2 [7]
 
static const DBEGroup grp_tab_3 [1]
 
static const DBEGroup grp_tab_4 [1]
 
static const DBEGroup grp_tab_5 [8]
 
static const DBEGroup grp_tab_6 [7]
 
static const DBEGroup grp_tab_7 [1]
 
static const DBEGroup *const frm_ofs_tab [2][4]
 
static const uint8_t mantissa_size1 [16][4]
 
static const uint8_t mantissa_size2 [16][4]
 
static const float start_window [192]
 
static const float short_window2 [192]
 
static const float short_window3 [64]
 
static const uint8_t dc_code_tab [5] = { 0, 0, 0, 1, 1 }
 
static const uint8_t ht_code_tab [5] = { 0, 0, 1, 2, 2 }
 
static const uint8_t band_ofs_tab [3][4]
 
static const uint8_t band_low_tab [3] = { 9, 17, 24 }
 
static const uint16_t fast_gain_tab [8]
 
static const uint16_t slow_decay_tab [2][2] = { { 27, -1 }, { 32, 21 } }
 
static const uint16_t misc_decay_tab [3][2][2]
 
static const uint16_t fast_decay_tab [3][2][2][50]
 
static const uint16_t fast_gain_adj_tab [3][2][62]
 
static const uint16_t slow_gain_tab [3][2][50]
 
static const uint16_t hearing_thresh_tab [3][3][50]
 
static const int16_t lwc_gain_tab [11][7]
 
static const int16_t lwc_adj_tab [7]
 
static const uint8_t log_add_tab [212]
 
static const uint8_t bap_tab [64]
 
static float mantissa_tab1 [17][4]
 
static float mantissa_tab2 [17][4]
 
static float mantissa_tab3 [17][4]
 
static float exponent_tab [50]
 
static float gain_tab [1024]
 
static float window [3712]
 
static const AVOption options []
 
static const AVClass dolby_e_decoder_class
 
const FFCodec ff_dolby_e_decoder
 

Macro Definition Documentation

◆ MAX_SEGMENTS

#define MAX_SEGMENTS   2

Definition at line 35 of file dolby_e.c.

◆ MAX_GROUPS

#define MAX_GROUPS   8

Definition at line 37 of file dolby_e.c.

◆ MAX_EXPONENTS

#define MAX_EXPONENTS   304

Definition at line 38 of file dolby_e.c.

◆ MAX_MANTISSAS

#define MAX_MANTISSAS   1024

Definition at line 39 of file dolby_e.c.

◆ MAX_MSTR_EXP

#define MAX_MSTR_EXP   2

Definition at line 41 of file dolby_e.c.

◆ MAX_BIAS_EXP

#define MAX_BIAS_EXP   50

Definition at line 42 of file dolby_e.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(DBEDecodeContext, x)

Definition at line 1287 of file dolby_e.c.

◆ FLAGS

Definition at line 1288 of file dolby_e.c.

Enumeration Type Documentation

◆ DBEOutputChannelOrder

Enumerator
CHANNEL_ORDER_DEFAULT 
CHANNEL_ORDER_CODED 

Definition at line 44 of file dolby_e.c.

Function Documentation

◆ skip_input()

static int skip_input ( DBEContext s,
int  nb_words 
)
static

Definition at line 614 of file dolby_e.c.

Referenced by parse_audio(), parse_key(), parse_metadata_ext(), and parse_meter().

◆ parse_key()

static int parse_key ( DBEContext s)
static

Definition at line 626 of file dolby_e.c.

Referenced by amf_tag_skip(), and parse_audio().

◆ parse_metadata_ext()

static int parse_metadata_ext ( DBEDecodeContext s1)
static

Definition at line 638 of file dolby_e.c.

Referenced by dolby_e_decode_frame().

◆ unbias_exponents()

static void unbias_exponents ( DBEContext s,
DBEChannel c,
DBEGroup g 
)
static

Definition at line 646 of file dolby_e.c.

Referenced by parse_exponents().

◆ parse_exponents()

static int parse_exponents ( DBEContext s,
DBEChannel c 
)
static

Definition at line 663 of file dolby_e.c.

Referenced by encode_block(), and parse_channel().

◆ log_add()

static int log_add ( int  a,
int  b 
)
inlinestatic

Definition at line 682 of file dolby_e.c.

Referenced by bit_allocate(), and calc_lowcomp().

◆ calc_lowcomp()

static void calc_lowcomp ( int msk_val)
static

Definition at line 688 of file dolby_e.c.

Referenced by bit_allocate().

◆ bit_allocate()

static void bit_allocate ( int  nb_exponent,
int  nb_code,
int  fr_code,
int exp,
int bap,
int  fg_spc,
int  fg_ofs,
int  msk_mod,
int  snr_ofs 
)
static

Definition at line 721 of file dolby_e.c.

Referenced by parse_bit_alloc().

◆ parse_bit_alloc()

static int parse_bit_alloc ( DBEDecodeContext s1,
DBEChannel c 
)
static

Definition at line 770 of file dolby_e.c.

Referenced by parse_channel().

◆ parse_indices()

static int parse_indices ( DBEContext s,
DBEChannel c 
)
static

Definition at line 817 of file dolby_e.c.

Referenced by parse_channel().

◆ parse_mantissas()

static int parse_mantissas ( DBEContext s,
DBEChannel c 
)
static

Definition at line 848 of file dolby_e.c.

Referenced by parse_channel().

◆ parse_channel()

static int parse_channel ( DBEDecodeContext s1,
int  ch,
int  seg_id 
)
static

Definition at line 904 of file dolby_e.c.

Referenced by parse_audio().

◆ parse_audio()

static int parse_audio ( DBEDecodeContext s1,
int  start,
int  end,
int  seg_id 
)
static

Definition at line 955 of file dolby_e.c.

Referenced by dolby_e_decode_frame().

◆ parse_meter()

static int parse_meter ( DBEDecodeContext s1)
static

Definition at line 983 of file dolby_e.c.

Referenced by dolby_e_decode_frame().

◆ imdct_calc()

static void imdct_calc ( DBEDecodeContext s1,
DBEGroup g,
float result,
float values 
)
static

Definition at line 991 of file dolby_e.c.

Referenced by transform().

◆ transform()

static void transform ( DBEDecodeContext s1,
DBEChannel c,
float history,
float output 
)
static

Definition at line 1017 of file dolby_e.c.

Referenced by filter_frame().

◆ apply_gain()

static void apply_gain ( DBEDecodeContext s,
int  begin,
int  end,
float output 
)
static

Definition at line 1042 of file dolby_e.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( DBEDecodeContext s,
AVFrame frame 
)
static

Definition at line 1059 of file dolby_e.c.

Referenced by dolby_e_decode_frame(), ff_filter_frame(), and ff_filter_frame_framed().

◆ dolby_e_decode_frame()

static int dolby_e_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 1088 of file dolby_e.c.

◆ dolby_e_flush()

static av_cold void dolby_e_flush ( AVCodecContext avctx)
static

Definition at line 1146 of file dolby_e.c.

◆ dolby_e_close()

static av_cold int dolby_e_close ( AVCodecContext avctx)
static

Definition at line 1153 of file dolby_e.c.

◆ init_tables()

static av_cold void init_tables ( void  )
static

Definition at line 1167 of file dolby_e.c.

Referenced by dolby_e_init().

◆ dolby_e_init()

static av_cold int dolby_e_init ( AVCodecContext avctx)
static

Definition at line 1253 of file dolby_e.c.

Variable Documentation

◆ lfe_channel_tab

const int8_t lfe_channel_tab[MAX_PROG_CONF+1]
static
Initial value:
= {
5, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5
}

Definition at line 93 of file dolby_e.c.

Referenced by parse_channel().

◆ ch_reorder_4

const uint8_t ch_reorder_4[4] = { 0, 2, 1, 3 }
static

Definition at line 98 of file dolby_e.c.

Referenced by filter_frame().

◆ ch_reorder_6

const uint8_t ch_reorder_6[6] = { 0, 2, 4, 1, 3, 5 }
static

Definition at line 99 of file dolby_e.c.

Referenced by filter_frame().

◆ ch_reorder_8

const uint8_t ch_reorder_8[8] = { 0, 2, 6, 4, 1, 3, 7, 5 }
static

Definition at line 100 of file dolby_e.c.

Referenced by filter_frame().

◆ ch_reorder_n

const uint8_t ch_reorder_n[8] = { 0, 2, 4, 6, 1, 3, 5, 7 }
static

Definition at line 101 of file dolby_e.c.

Referenced by filter_frame().

◆ nb_groups_tab

const uint8_t nb_groups_tab[4] = { 1, 8, 7, 1 }
static

Definition at line 104 of file dolby_e.c.

Referenced by parse_channel().

◆ nb_mstr_exp_tab

const uint8_t nb_mstr_exp_tab[4] = { 2, 2, 2, 1 }
static

Definition at line 106 of file dolby_e.c.

Referenced by parse_channel().

◆ nb_mantissa_38

const uint8_t nb_mantissa_38[38]
static
Initial value:
= {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6,
7, 8, 9, 10, 11, 12,
}

Definition at line 108 of file dolby_e.c.

◆ nb_mantissa_44

const uint8_t nb_mantissa_44[44]
static
Initial value:
= {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 7, 7,
8, 9, 10, 11, 12, 13, 15, 16, 18, 20, 22, 25,
}

Definition at line 114 of file dolby_e.c.

◆ nb_mantissa_50

const uint8_t nb_mantissa_50[50]
static
Initial value:
= {
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3,
3, 4, 4, 5, 5, 6, 6, 7, 8, 9, 9, 10, 12, 13, 14, 16,
18, 19, 22, 24, 27, 29, 32, 36, 40, 44, 49, 54, 60, 66, 74, 82,
90, 100,
}

Definition at line 120 of file dolby_e.c.

◆ imdct_bits_tab

const uint8_t imdct_bits_tab[3] = { 8, 9, 11 }
static

Definition at line 127 of file dolby_e.c.

Referenced by dolby_e_init(), and imdct_calc().

◆ grp_tab_0

const DBEGroup grp_tab_0[1]
static
Initial value:
= {
{ 50, { 27, 23 }, 0, 0, nb_mantissa_50, 2, 0, 1152, 0, 1408, 0 },
}

Definition at line 129 of file dolby_e.c.

◆ grp_tab_1

const DBEGroup grp_tab_1[8]
static
Initial value:
= {
{ 38, { 12, 26 }, 0, 0, nb_mantissa_38, 0, 0, 192, 0, 256, 0 },
{ 38, { 12, 26 }, 38, 128, nb_mantissa_38, 0, 1, 256, 64, 448, 0 },
{ 38, { 12, 26 }, 76, 256, nb_mantissa_38, 0, 1, 256, 192, 704, 0 },
{ 38, { 12, 26 }, 114, 384, nb_mantissa_38, 0, 1, 256, 320, 0, 0 },
{ 38, { 12, 26 }, 152, 512, nb_mantissa_38, 0, 1, 256, 448, 0, 0 },
{ 38, { 12, 26 }, 190, 640, nb_mantissa_38, 0, 1, 256, 576, 0, 0 },
{ 38, { 12, 26 }, 228, 768, nb_mantissa_38, 0, 1, 256, 704, 0, 0 },
{ 38, { 12, 26 }, 266, 896, nb_mantissa_38, 0, 1, 256, 832, 0, 0 },
}

Definition at line 133 of file dolby_e.c.

◆ grp_tab_2

const DBEGroup grp_tab_2[7]
static
Initial value:
= {
{ 38, { 12, 26 }, 0, 0, nb_mantissa_38, 0, 0, 192, 0, 256, 0 },
{ 38, { 12, 26 }, 38, 128, nb_mantissa_38, 0, 1, 256, 64, 448, 0 },
{ 38, { 12, 26 }, 76, 256, nb_mantissa_38, 0, 1, 256, 192, 704, 0 },
{ 38, { 12, 26 }, 114, 384, nb_mantissa_38, 0, 1, 256, 320, 0, 0 },
{ 38, { 12, 26 }, 152, 512, nb_mantissa_38, 0, 1, 256, 448, 0, 0 },
{ 38, { 12, 26 }, 190, 640, nb_mantissa_38, 0, 1, 256, 576, 0, 0 },
{ 44, { 19, 25 }, 228, 768, nb_mantissa_44, 1, 1, 448, 704, 960, 64 },
}

Definition at line 144 of file dolby_e.c.

◆ grp_tab_3

const DBEGroup grp_tab_3[1]
static
Initial value:
= {
{ 21, { 21 }, 0, 0, nb_mantissa_50, 2, 0, 1152, 0, 1408, 0 },
}

Definition at line 154 of file dolby_e.c.

◆ grp_tab_4

const DBEGroup grp_tab_4[1]
static
Initial value:
= {
{ 50, { 27, 23 }, 0, 0, nb_mantissa_50, 2, 2, 1152, 0, 1408, 896 },
}

Definition at line 158 of file dolby_e.c.

◆ grp_tab_5

const DBEGroup grp_tab_5[8]
static
Initial value:
= {
{ 38, { 12, 26 }, 0, 0, nb_mantissa_38, 0, 1, 256, 64, 0, 0 },
{ 38, { 12, 26 }, 38, 128, nb_mantissa_38, 0, 1, 256, 192, 0, 0 },
{ 38, { 12, 26 }, 76, 256, nb_mantissa_38, 0, 1, 256, 320, 0, 0 },
{ 38, { 12, 26 }, 114, 384, nb_mantissa_38, 0, 1, 256, 448, 0, 0 },
{ 38, { 12, 26 }, 152, 512, nb_mantissa_38, 0, 1, 256, 576, 0, 0 },
{ 38, { 12, 26 }, 190, 640, nb_mantissa_38, 0, 1, 256, 704, 3008, 0 },
{ 38, { 12, 26 }, 228, 768, nb_mantissa_38, 0, 1, 256, 832, 2752, 0 },
{ 38, { 12, 26 }, 266, 896, nb_mantissa_38, 0, 2, 192, 960, 2560, 64 },
}

Definition at line 162 of file dolby_e.c.

◆ grp_tab_6

const DBEGroup grp_tab_6[7]
static
Initial value:
= {
{ 44, { 19, 25 }, 0, 0, nb_mantissa_44, 1, 1, 448, 0, 3264, 0 },
{ 38, { 12, 26 }, 44, 256, nb_mantissa_38, 0, 1, 256, 320, 0, 0 },
{ 38, { 12, 26 }, 82, 384, nb_mantissa_38, 0, 1, 256, 448, 0, 0 },
{ 38, { 12, 26 }, 120, 512, nb_mantissa_38, 0, 1, 256, 576, 0, 0 },
{ 38, { 12, 26 }, 158, 640, nb_mantissa_38, 0, 1, 256, 704, 3008, 0 },
{ 38, { 12, 26 }, 196, 768, nb_mantissa_38, 0, 1, 256, 832, 2752, 0 },
{ 38, { 12, 26 }, 234, 896, nb_mantissa_38, 0, 2, 192, 960, 2560, 64 },
}

Definition at line 173 of file dolby_e.c.

◆ grp_tab_7

const DBEGroup grp_tab_7[1]
static
Initial value:
= {
{ 21, { 21 }, 0, 0, nb_mantissa_50, 2, 2, 1152, 0, 1408, 896 },
}

Definition at line 183 of file dolby_e.c.

◆ frm_ofs_tab

const DBEGroup* const frm_ofs_tab[2][4]
static
Initial value:

Definition at line 187 of file dolby_e.c.

Referenced by parse_channel().

◆ mantissa_size1

const uint8_t mantissa_size1[16][4]
static
Initial value:
= {
{ 0, 0, 0, 0 }, { 2, 1, 1, 1 }, { 3, 2, 1, 1 }, { 4, 3, 2, 1 },
{ 5, 4, 3, 2 }, { 6, 5, 4, 3 }, { 7, 6, 5, 4 }, { 8, 7, 6, 5 },
{ 9, 8, 7, 6 }, { 10, 9, 8, 7 }, { 11, 10, 9, 8 }, { 12, 11, 10, 9 },
{ 13, 12, 11, 10 }, { 14, 13, 12, 11 }, { 15, 14, 13, 12 }, { 16, 15, 14, 13 },
}

Definition at line 192 of file dolby_e.c.

Referenced by parse_mantissas().

◆ mantissa_size2

const uint8_t mantissa_size2[16][4]
static
Initial value:
= {
{ 0, 0, 0, 0 }, { 2, 1, 2, 2 }, { 3, 2, 3, 3 }, { 4, 3, 4, 4 },
{ 5, 4, 5, 5 }, { 6, 5, 6, 6 }, { 7, 6, 7, 7 }, { 8, 7, 8, 8 },
{ 9, 8, 9, 9 }, { 10, 9, 10, 10 }, { 11, 10, 11, 11 }, { 12, 11, 12, 12 },
{ 13, 12, 13, 13 }, { 14, 13, 14, 14 }, { 15, 14, 15, 15 }, { 16, 15, 16, 16 },
}

Definition at line 199 of file dolby_e.c.

Referenced by parse_mantissas().

◆ start_window

const float start_window[192]
static

Definition at line 206 of file dolby_e.c.

Referenced by init_tables().

◆ short_window2

const float short_window2[192]
static

Definition at line 259 of file dolby_e.c.

Referenced by init_tables().

◆ short_window3

const float short_window3[64]
static
Initial value:
= {
0.00326887936450, 0.00550242900936, 0.00786846643791, 0.01045683453520,
0.01330402120132, 0.01643221072863, 0.01985798040609, 0.02359509464766,
0.02765559221954, 0.03205025893128, 0.03678884369614, 0.04188015679495,
0.04733210987781, 0.05315172583924, 0.05934513287609, 0.06591755045290,
0.07287327156378, 0.08021564389822, 0.08794705152307, 0.09606889811179,
0.10458159240070, 0.11348453632940, 0.12277611617809, 0.13245369691511,
0.14251361989876, 0.15295120402567, 0.16376075037904, 0.17493555039885,
0.18646789757072, 0.19834910260891, 0.21056951208995, 0.22311853047787,
0.23598464546683, 0.24915545655419, 0.26261770674500, 0.27635731727778,
0.29035942525136, 0.30460842402318, 0.31908800624032, 0.33378120935681,
0.34867046348260, 0.36373764140285, 0.37896411059909, 0.39433078709788,
0.40981819096657, 0.42540650327031, 0.44107562429959, 0.45680523287270,
0.47257484651351, 0.48836388230077, 0.50415171818214, 0.51991775454258,
0.53564147581496, 0.55130251191887, 0.56688069931047, 0.58235614142007,
0.59770926827271, 0.61292089506118, 0.62797227945823, 0.64284517745255,
0.65752189749349, 0.67198535273209, 0.68621911114984, 0.70020744337099,
}

Definition at line 312 of file dolby_e.c.

Referenced by init_tables().

◆ dc_code_tab

const uint8_t dc_code_tab[5] = { 0, 0, 0, 1, 1 }
static

Definition at line 331 of file dolby_e.c.

Referenced by bit_allocate().

◆ ht_code_tab

const uint8_t ht_code_tab[5] = { 0, 0, 1, 2, 2 }
static

Definition at line 333 of file dolby_e.c.

Referenced by bit_allocate().

◆ band_ofs_tab

const uint8_t band_ofs_tab[3][4]
static
Initial value:
= {
{ 12, 8, 4, 0 }, { 14, 10, 6, 0 }, { 12, 8, 4, 0 }
}

Definition at line 335 of file dolby_e.c.

Referenced by bit_allocate().

◆ band_low_tab

const uint8_t band_low_tab[3] = { 9, 17, 24 }
static

Definition at line 339 of file dolby_e.c.

Referenced by bit_allocate().

◆ fast_gain_tab

const uint16_t fast_gain_tab[8]
static
Initial value:
= {
128, 256, 384, 512, 640, 768, 896, 1024
}

Definition at line 341 of file dolby_e.c.

Referenced by bit_allocate().

◆ slow_decay_tab

const uint16_t slow_decay_tab[2][2] = { { 27, -1 }, { 32, 21 } }
static

Definition at line 345 of file dolby_e.c.

Referenced by bit_allocate().

◆ misc_decay_tab

const uint16_t misc_decay_tab[3][2][2]
static
Initial value:
= {
{ { 354, -1 }, { 425, 425 } },
{ { 266, -1 }, { 320, -1 } },
{ { 213, -1 }, { 256, -1 } }
}

Definition at line 347 of file dolby_e.c.

Referenced by bit_allocate().

◆ fast_decay_tab

const uint16_t fast_decay_tab[3][2][2][50]
static

Definition at line 353 of file dolby_e.c.

Referenced by bit_allocate().

◆ fast_gain_adj_tab

const uint16_t fast_gain_adj_tab[3][2][62]
static

Definition at line 425 of file dolby_e.c.

Referenced by bit_allocate().

◆ slow_gain_tab

const uint16_t slow_gain_tab[3][2][50]
static

Definition at line 471 of file dolby_e.c.

Referenced by bit_allocate().

◆ hearing_thresh_tab

const uint16_t hearing_thresh_tab[3][3][50]
static

Definition at line 509 of file dolby_e.c.

Referenced by bit_allocate().

◆ lwc_gain_tab

const int16_t lwc_gain_tab[11][7]
static
Initial value:
= {
{ -21, -197, -271, -466, 32767, 32767, 32767 },
{ -197, -29, -244, -271, -540, 32767, 32767 },
{ -271, -244, -29, -249, -271, -593, 32767 },
{ -466, -271, -249, -29, -251, -271, -632 },
{ -540, -271, -251, -29, -251, -271, -664 },
{ -593, -271, -251, -29, -252, -271, -690 },
{ -632, -271, -252, -29, -252, -271, -711 },
{ -664, -271, -252, -29, -252, -271, -730 },
{ -690, -271, -252, -29, -252, -271, -745 },
{ -711, -271, -252, -29, -253, -271, -759 },
{ -730, -271, -253, -29, -253, -271, -771 },
}

Definition at line 564 of file dolby_e.c.

Referenced by calc_lowcomp().

◆ lwc_adj_tab

const int16_t lwc_adj_tab[7]
static
Initial value:
= {
-192, -320, -448, -512, -448, -320, -192,
}

Definition at line 578 of file dolby_e.c.

Referenced by calc_lowcomp().

◆ log_add_tab

const uint8_t log_add_tab[212]
static
Initial value:
= {
64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 52, 51, 50,
49, 48, 47, 47, 46, 45, 44, 44, 43, 42, 41, 41, 40, 39, 38, 38,
37, 36, 36, 35, 35, 34, 33, 33, 32, 32, 31, 30, 30, 29, 29, 28,
28, 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 22, 21, 21, 21,
20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 16, 16, 16, 15, 15,
15, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11,
10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8,
7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5,
5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 0,
}

Definition at line 582 of file dolby_e.c.

Referenced by log_add().

◆ bap_tab

const uint8_t bap_tab[64]
static
Initial value:
= {
0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4,
4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8,
8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15,
}

Definition at line 599 of file dolby_e.c.

Referenced by ac3_bit_alloc_calc_bap_c(), bit_allocate(), and decode_audio_block().

◆ mantissa_tab1

float mantissa_tab1[17][4]
static

Definition at line 606 of file dolby_e.c.

Referenced by init_tables(), and parse_mantissas().

◆ mantissa_tab2

float mantissa_tab2[17][4]
static

Definition at line 607 of file dolby_e.c.

Referenced by init_tables(), and parse_mantissas().

◆ mantissa_tab3

float mantissa_tab3[17][4]
static

Definition at line 608 of file dolby_e.c.

Referenced by init_tables(), and parse_mantissas().

◆ exponent_tab

float exponent_tab[50]
static

Definition at line 609 of file dolby_e.c.

Referenced by init_tables(), and parse_mantissas().

◆ gain_tab

float gain_tab[1024]
static

Definition at line 610 of file dolby_e.c.

Referenced by apply_gain(), and init_tables().

◆ window

float window[3712]
static

Definition at line 612 of file dolby_e.c.

Referenced by init_tables(), and transform().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "channel_order", "Order in which the channels are to be exported",
OFFSET(dectx.metadata.output_channel_order), AV_OPT_TYPE_INT,
{ .i64 = CHANNEL_ORDER_DEFAULT }, 0, 1, FLAGS, "channel_order" },
{ "default", "normal libavcodec channel order", 0, AV_OPT_TYPE_CONST,
{ .i64 = CHANNEL_ORDER_DEFAULT }, .flags = FLAGS, "channel_order" },
{ "coded", "order in which the channels are coded in the bitstream",
0, AV_OPT_TYPE_CONST, { .i64 = CHANNEL_ORDER_CODED }, .flags = FLAGS, "channel_order" },
{ NULL },
}

Definition at line 1289 of file dolby_e.c.

◆ dolby_e_decoder_class

const AVClass dolby_e_decoder_class
static
Initial value:
= {
.class_name = "Dolby E decoder",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 1301 of file dolby_e.c.

◆ ff_dolby_e_decoder

const FFCodec ff_dolby_e_decoder
Initial value:
= {
.p.name = "dolby_e",
CODEC_LONG_NAME("Dolby E"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(DBEDecodeContext),
.p.priv_class = &dolby_e_decoder_class,
.init = dolby_e_init,
.close = dolby_e_close,
.flush = dolby_e_flush,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 1308 of file dolby_e.c.

grp_tab_3
static const DBEGroup grp_tab_3[1]
Definition: dolby_e.c:154
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
FLAGS
#define FLAGS
Definition: dolby_e.c:1288
dolby_e_close
static av_cold int dolby_e_close(AVCodecContext *avctx)
Definition: dolby_e.c:1153
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
dolby_e_init
static av_cold int dolby_e_init(AVCodecContext *avctx)
Definition: dolby_e.c:1253
grp_tab_0
static const DBEGroup grp_tab_0[1]
Definition: dolby_e.c:129
CHANNEL_ORDER_DEFAULT
@ CHANNEL_ORDER_DEFAULT
Definition: dolby_e.c:45
nb_mantissa_44
static const uint8_t nb_mantissa_44[44]
Definition: dolby_e.c:114
dolby_e_flush
static av_cold void dolby_e_flush(AVCodecContext *avctx)
Definition: dolby_e.c:1146
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_ID_DOLBY_E
@ AV_CODEC_ID_DOLBY_E
Definition: codec_id.h:526
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: codec.h:106
grp_tab_5
static const DBEGroup grp_tab_5[8]
Definition: dolby_e.c:162
dolby_e_decode_frame
static int dolby_e_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: dolby_e.c:1088
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
DBEDecodeContext
Definition: dolby_e.c:79
grp_tab_1
static const DBEGroup grp_tab_1[8]
Definition: dolby_e.c:133
nb_mantissa_38
static const uint8_t nb_mantissa_38[38]
Definition: dolby_e.c:108
grp_tab_2
static const DBEGroup grp_tab_2[7]
Definition: dolby_e.c:144
grp_tab_4
static const DBEGroup grp_tab_4[1]
Definition: dolby_e.c:158
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
grp_tab_6
static const DBEGroup grp_tab_6[7]
Definition: dolby_e.c:173
CHANNEL_ORDER_CODED
@ CHANNEL_ORDER_CODED
Definition: dolby_e.c:46
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
grp_tab_7
static const DBEGroup grp_tab_7[1]
Definition: dolby_e.c:183
options
static const AVOption options[]
Definition: dolby_e.c:1289
OFFSET
#define OFFSET(x)
Definition: dolby_e.c:1287
nb_mantissa_50
static const uint8_t nb_mantissa_50[50]
Definition: dolby_e.c:120
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
dolby_e_decoder_class
static const AVClass dolby_e_decoder_class
Definition: dolby_e.c:1301