FFmpeg
Macros | Functions | Variables
ac3dec_data.c File Reference
#include "ac3dec_data.h"
#include "libavutil/thread.h"

Go to the source code of this file.

Macros

#define SYMMETRIC_DEQUANT(code, levels)   (((code - (levels >> 1)) * (1 << 24)) / levels)
 Symmetrical Dequantization reference: Section 7.3.3 Expansion of Mantissas for Symmetrical Quantization Tables 7.19 to 7.23. More...
 

Functions

static int symmetric_dequant (int code, int levels)
 
static av_cold void ac3_init_static (void)
 
av_cold void ff_ac3_init_static (void)
 

Variables

const uint8_t ff_ac3_ungroup_3_in_5_bits_tab [32][3]
 Table used to ungroup 3 values stored in 5 bits. More...
 
uint8_t ff_ac3_ungroup_3_in_7_bits_tab [128][3]
 table for ungrouping 3 values in 7 bits. More...
 
const int ff_ac3_bap3_mantissas [7+1]
 Ungrouped mantissa tables; the extra entry is padding to avoid range checks. More...
 
const int ff_ac3_bap5_mantissas [15+1]
 Table 7.23. More...
 
int ff_ac3_bap1_mantissas [32][3]
 tables for ungrouping mantissas More...
 
int ff_ac3_bap2_mantissas [128][3]
 
int ff_ac3_bap4_mantissas [128][2]
 
const uint8_t ff_ac3_quantization_tab [16]
 Quantization table: levels for symmetric. More...
 
const uint8_t ff_ac3_default_coeffs [8][5][2]
 Table for default stereo downmixing coefficients reference: Section 7.8.2 Downmixing Into Two Channels. More...
 
const uint8_t ff_eac3_hebap_tab [64]
 
const uint8_t ff_eac3_default_spx_band_struct [17]
 Table E2.15 Default Spectral Extension Banding Structure. More...
 
const float ff_eac3_gain_levels_lfe [32]
 Adjustments in dB gain (LFE, +10 to -21 dB) More...
 

Detailed Description

Tables taken directly from the AC-3 spec or derived from it.

Definition in file ac3dec_data.c.

Macro Definition Documentation

◆ SYMMETRIC_DEQUANT

#define SYMMETRIC_DEQUANT (   code,
  levels 
)    (((code - (levels >> 1)) * (1 << 24)) / levels)

Symmetrical Dequantization reference: Section 7.3.3 Expansion of Mantissas for Symmetrical Quantization Tables 7.19 to 7.23.

Definition at line 57 of file ac3dec_data.c.

Function Documentation

◆ symmetric_dequant()

static int symmetric_dequant ( int  code,
int  levels 
)
inlinestatic

Definition at line 99 of file ac3dec_data.c.

Referenced by ac3_init_static().

◆ ac3_init_static()

static av_cold void ac3_init_static ( void  )
static

Definition at line 104 of file ac3dec_data.c.

Referenced by ff_ac3_init_static().

◆ ff_ac3_init_static()

av_cold void ff_ac3_init_static ( void  )

Definition at line 134 of file ac3dec_data.c.

Referenced by ac3_decode_init(), and ac3_float_tables_init().

Variable Documentation

◆ ff_ac3_ungroup_3_in_5_bits_tab

const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3]
Initial value:
= {
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 1, 0 },
{ 0, 1, 1 }, { 0, 1, 2 }, { 0, 2, 0 }, { 0, 2, 1 },
{ 0, 2, 2 }, { 1, 0, 0 }, { 1, 0, 1 }, { 1, 0, 2 },
{ 1, 1, 0 }, { 1, 1, 1 }, { 1, 1, 2 }, { 1, 2, 0 },
{ 1, 2, 1 }, { 1, 2, 2 }, { 2, 0, 0 }, { 2, 0, 1 },
{ 2, 0, 2 }, { 2, 1, 0 }, { 2, 1, 1 }, { 2, 1, 2 },
{ 2, 2, 0 }, { 2, 2, 1 }, { 2, 2, 2 }, { 3, 0, 0 },
{ 3, 0, 1 }, { 3, 0, 2 }, { 3, 1, 0 }, { 3, 1, 1 }
}

Table used to ungroup 3 values stored in 5 bits.

Used by bap=1 mantissas and GAQ. ff_ac3_ungroup_3_in_5_bits_tab[i] = { i/9, (i%9)/3, (i%9)%3 }

Definition at line 35 of file ac3dec_data.c.

Referenced by ac3_init_static(), and ff_eac3_decode_transform_coeffs_aht_ch().

◆ ff_ac3_ungroup_3_in_7_bits_tab

uint8_t ff_ac3_ungroup_3_in_7_bits_tab[128][3]

table for ungrouping 3 values in 7 bits.

used for exponents and bap=2 mantissas

Definition at line 50 of file ac3dec_data.c.

Referenced by ac3_init_static(), and decode_exponents().

◆ ff_ac3_bap3_mantissas

const int ff_ac3_bap3_mantissas[7+1]
Initial value:

Ungrouped mantissa tables; the extra entry is padding to avoid range checks.

Table 7.21

Definition at line 64 of file ac3dec_data.c.

Referenced by ac3_decode_transform_coeffs_ch().

◆ ff_ac3_bap5_mantissas

const int ff_ac3_bap5_mantissas[15+1]
Initial value:

Table 7.23.

Definition at line 76 of file ac3dec_data.c.

Referenced by ac3_decode_transform_coeffs_ch().

◆ ff_ac3_bap1_mantissas

int ff_ac3_bap1_mantissas[32][3]

tables for ungrouping mantissas

Definition at line 94 of file ac3dec_data.c.

Referenced by ac3_decode_transform_coeffs_ch(), and ac3_init_static().

◆ ff_ac3_bap2_mantissas

int ff_ac3_bap2_mantissas[128][3]

Definition at line 95 of file ac3dec_data.c.

Referenced by ac3_decode_transform_coeffs_ch(), and ac3_init_static().

◆ ff_ac3_bap4_mantissas

int ff_ac3_bap4_mantissas[128][2]

Definition at line 96 of file ac3dec_data.c.

Referenced by ac3_decode_transform_coeffs_ch(), and ac3_init_static().

◆ ff_ac3_quantization_tab

const uint8_t ff_ac3_quantization_tab[16]
Initial value:
= {
0, 3, 5, 7, 11, 15,
5, 6, 7, 8, 9, 10, 11, 12, 14, 16
}

Quantization table: levels for symmetric.

bits for asymmetric. reference: Table 7.18 Mapping of bap to Quantizer

Definition at line 144 of file ac3dec_data.c.

Referenced by ac3_decode_transform_coeffs_ch().

◆ ff_ac3_default_coeffs

const uint8_t ff_ac3_default_coeffs[8][5][2]
Initial value:
= {
{ { 2, 7 }, { 7, 2 }, },
{ { 4, 4 }, },
{ { 2, 7 }, { 7, 2 }, },
{ { 2, 7 }, { 5, 5 }, { 7, 2 }, },
{ { 2, 7 }, { 7, 2 }, { 6, 6 }, },
{ { 2, 7 }, { 5, 5 }, { 7, 2 }, { 8, 8 }, },
{ { 2, 7 }, { 7, 2 }, { 6, 7 }, { 7, 6 }, },
{ { 2, 7 }, { 5, 5 }, { 7, 2 }, { 6, 7 }, { 7, 6 }, },
}

Table for default stereo downmixing coefficients reference: Section 7.8.2 Downmixing Into Two Channels.

Definition at line 153 of file ac3dec_data.c.

Referenced by set_downmix_coeffs().

◆ ff_eac3_hebap_tab

const uint8_t ff_eac3_hebap_tab[64]
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 8,
8, 8, 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, 16,
16, 16, 16, 17, 17, 17, 17, 18, 18, 18,
18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
19, 19, 19, 19,
}

Definition at line 164 of file ac3dec_data.c.

Referenced by decode_audio_block().

◆ ff_eac3_default_spx_band_struct

const uint8_t ff_eac3_default_spx_band_struct[17]
Initial value:
=
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }

Table E2.15 Default Spectral Extension Banding Structure.

Definition at line 177 of file ac3dec_data.c.

Referenced by spx_strategy().

◆ ff_eac3_gain_levels_lfe

const float ff_eac3_gain_levels_lfe[32]
Initial value:
= {
3.162275, 2.818382, 2.511886, 2.238719, 1.995261, 1.778278, 1.584893,
1.412536, 1.258924, 1.122018, 1.000000, 0.891251, 0.794328, 0.707946,
0.630957, 0.562341, 0.501187, 0.446683, 0.398107, 0.354813, 0.316227,
0.281838, 0.251188, 0.223872, 0.199526, 0.177828, 0.158489, 0.141253,
0.125892, 0.112201, 0.100000, 0.089125
}

Adjustments in dB gain (LFE, +10 to -21 dB)

Definition at line 181 of file ac3dec_data.c.

Referenced by ac3_decode_frame().

SYMMETRIC_DEQUANT
#define SYMMETRIC_DEQUANT(code, levels)
Symmetrical Dequantization reference: Section 7.3.3 Expansion of Mantissas for Symmetrical Quantizati...
Definition: ac3dec_data.c:57