23 #ifndef AVCODEC_QDM2_TABLEGEN_H
24 #define AVCODEC_QDM2_TABLEGEN_H
31 #define SOFTCLIP_THRESHOLD 27600
32 #define HARDCLIP_THRESHOLD 35716
34 #if CONFIG_HARDCODED_TABLES
35 #define softclip_table_init()
36 #define rnd_table_init()
37 #define init_noise_samples()
38 #define qdm2_init_vlc()
39 #include "libavcodec/qdm2_tables.h"
50 float delta = 1.0 / -dfl;
52 softclip_table[i] = SOFTCLIP_THRESHOLD - ((
int)(sin((
float)i * delta) * dfl) & 0x0000FFFF);
60 uint64_t random_seed = 0;
61 float delta = 1.0 / 16384.0;
62 for(i = 0; i < 4096 ;i++) {
63 random_seed = random_seed * 214013 + 2531011;
64 noise_table[i] = (delta * (float)(((
int32_t)random_seed >> 16) & 0x00007FFF)- 1.0) * 1.3;
67 for (i = 0; i < 256 ;i++) {
70 for (j = 0; j < 5 ;j++) {
76 for (i = 0; i < 128 ;i++) {
79 for (j = 0; j < 3 ;j++) {
90 unsigned random_seed = 0;
91 float delta = 1.0 / 16384.0;
92 for (i = 0; i < 128;i++) {
93 random_seed = random_seed * 214013 + 2531011;
94 noise_samples[i] = (delta * (float)((random_seed >> 16) & 0x00007fff) - 1.0);
113 0,260,566,598,894,1166,1230,1294,1678,1950,2214,2278,2310,2570,2834,3124,3448,3838,
144 init_vlc(&fft_level_exp_alt_vlc, 8, 28,
150 fft_level_exp_vlc.
table_allocated = qdm2_vlc_offs[5] - qdm2_vlc_offs[4];
167 init_vlc(&fft_stereo_phase_vlc, 6, 9,
172 vlc_tab_tone_level_idx_hi1.
table =
176 init_vlc(&vlc_tab_tone_level_idx_hi1, 8, 20,
181 vlc_tab_tone_level_idx_mid.
table =
185 init_vlc(&vlc_tab_tone_level_idx_mid, 8, 24,
190 vlc_tab_tone_level_idx_hi2.
table =
194 init_vlc(&vlc_tab_tone_level_idx_hi2, 8, 24,
200 vlc_tab_type30.
table_allocated = qdm2_vlc_offs[11] - qdm2_vlc_offs[10];
207 vlc_tab_type34.
table_allocated = qdm2_vlc_offs[12] - qdm2_vlc_offs[11];
213 vlc_tab_fft_tone_offset[0].
table =
217 init_vlc(&vlc_tab_fft_tone_offset[0], 8, 23,
222 vlc_tab_fft_tone_offset[1].
table =
226 init_vlc(&vlc_tab_fft_tone_offset[1], 8, 28,
231 vlc_tab_fft_tone_offset[2].
table =
235 init_vlc(&vlc_tab_fft_tone_offset[2], 8, 32,
240 vlc_tab_fft_tone_offset[3].
table =
244 init_vlc(&vlc_tab_fft_tone_offset[3], 8, 35,
249 vlc_tab_fft_tone_offset[4].
table =
253 init_vlc(&vlc_tab_fft_tone_offset[4], 8, 38,
static const uint16_t vlc_tab_tone_level_idx_mid_huffcodes[24]
static const uint8_t vlc_tab_level_huffbits[24]
static VLC vlc_tab_tone_level_idx_hi2
static const uint8_t vlc_tab_type34_huffbits[10]
static const uint8_t fft_level_exp_alt_huffbits[28]
static const uint16_t vlc_tab_fft_tone_offset_0_huffcodes[23]
static const uint8_t fft_stereo_phase_huffbits[9]
static float noise_table[4096+20]
static VLC fft_stereo_exp_vlc
static VLC vlc_tab_type30
Macro definitions for various function/variable attributes.
#define SOFTCLIP_THRESHOLD
static const uint8_t vlc_tab_tone_level_idx_hi2_huffbits[24]
static const uint16_t vlc_tab_fft_tone_offset_1_huffcodes[28]
static const uint8_t vlc_tab_run_huffbits[6]
static const uint8_t vlc_tab_tone_level_idx_mid_huffbits[24]
static const uint8_t vlc_tab_type30_huffbits[9]
static const uint8_t fft_stereo_exp_huffbits[7]
static av_cold void qdm2_init_vlc(void)
static VLC fft_level_exp_vlc
static av_cold void rnd_table_init(void)
static uint8_t random_dequant_type24[128][3]
static const uint8_t vlc_tab_fft_tone_offset_4_huffbits[38]
#define init_vlc(vlc, nb_bits, nb_codes,bits, bits_wrap, bits_size,codes, codes_wrap, codes_size,flags)
static VLC vlc_tab_tone_level_idx_mid
static const uint16_t vlc_tab_level_huffcodes[24]
VLC TABLES.
static const uint16_t vlc_tab_fft_tone_offset_4_huffcodes[38]
static VLC vlc_tab_tone_level_idx_hi1
static VLC fft_level_exp_alt_vlc
static const uint8_t vlc_tab_run_huffcodes[6]
static const uint8_t vlc_tab_fft_tone_offset_1_huffbits[28]
static float noise_samples[128]
static const uint16_t fft_level_exp_alt_huffcodes[28]
FFT TABLES.
static const uint8_t vlc_tab_diff_huffbits[37]
static VLC fft_stereo_phase_vlc
static const uint16_t vlc_tab_tone_level_idx_hi1_huffcodes[20]
static uint8_t random_dequant_index[256][5]
static uint16_t softclip_table[HARDCLIP_THRESHOLD-SOFTCLIP_THRESHOLD+1]
static VLC vlc_tab_fft_tone_offset[5]
static const uint8_t fft_stereo_exp_huffcodes[7]
static const uint16_t vlc_tab_fft_tone_offset_2_huffcodes[32]
#define HARDCLIP_THRESHOLD
static const uint8_t vlc_tab_type34_huffcodes[10]
static av_cold void softclip_table_init(void)
static const uint8_t vlc_tab_fft_tone_offset_0_huffbits[23]
static const uint8_t fft_stereo_phase_huffcodes[9]
static const uint16_t vlc_tab_tone_level_idx_hi2_huffcodes[24]
static const uint16_t vlc_tab_fft_tone_offset_3_huffcodes[35]
static VLC_TYPE qdm2_table[3838][2]
#define INIT_VLC_USE_NEW_STATIC
static const uint8_t vlc_tab_fft_tone_offset_2_huffbits[32]
static const uint16_t vlc_tab_diff_huffcodes[37]
static const uint8_t vlc_tab_tone_level_idx_hi1_huffbits[20]
VLC_TYPE(* table)[2]
code, bits
static const uint8_t vlc_tab_type30_huffcodes[9]
static const uint8_t fft_level_exp_huffbits[20]
static const uint16_t qdm2_vlc_offs[]
static const uint8_t vlc_tab_fft_tone_offset_3_huffbits[35]
static const uint16_t fft_level_exp_huffcodes[20]
static av_cold void init_noise_samples(void)
static VLC vlc_tab_type34