23 #ifndef AVCODEC_QDM2_TABLEGEN_H
24 #define AVCODEC_QDM2_TABLEGEN_H
30 #define SOFTCLIP_THRESHOLD 27600
31 #define HARDCLIP_THRESHOLD 35716
33 #if CONFIG_HARDCODED_TABLES
34 #define softclip_table_init()
35 #define rnd_table_init()
36 #define init_noise_samples()
37 #include "libavcodec/qdm2_tables.h"
48 float delta = 1.0 / -dfl;
50 softclip_table[i] = SOFTCLIP_THRESHOLD - ((
int)(sin((
float)i * delta) * dfl) & 0x0000FFFF);
58 uint64_t random_seed = 0;
59 float delta = 1.0 / 16384.0;
60 for(i = 0; i < 4096 ;i++) {
61 random_seed = random_seed * 214013 + 2531011;
62 noise_table[i] = (delta * (float)(((
int32_t)random_seed >> 16) & 0x00007FFF)- 1.0) * 1.3;
65 for (i = 0; i < 256 ;i++) {
68 for (j = 0; j < 5 ;j++) {
74 for (i = 0; i < 128 ;i++) {
77 for (j = 0; j < 3 ;j++) {
88 unsigned random_seed = 0;
89 float delta = 1.0 / 16384.0;
90 for (i = 0; i < 128;i++) {
91 random_seed = random_seed * 214013 + 2531011;
92 noise_samples[i] = (delta * (float)((random_seed >> 16) & 0x00007fff) - 1.0);