37 float **plevel_table, uint16_t **pint_table,
42 const uint32_t *table_codes = vlc_table->
huffcodes;
43 const uint16_t *levels_table = vlc_table->
levels;
44 uint16_t *run_table, *level_table, *int_table;
46 int i, l, j, k,
level;
59 l = levels_table[k++];
60 for (j = 0; j < l; j++) {
62 level_table[i] =
level;
63 flevel_table[i] =
level;
68 *prun_table = run_table;
69 *plevel_table = flevel_table;
70 *pint_table = int_table;
78 float bps1, high_freq;
105 nb = ((flags2 >> 3) & 3) + 1;
122 if (sample_rate1 >= 44100)
123 sample_rate1 = 44100;
124 else if (sample_rate1 >= 22050)
125 sample_rate1 = 22050;
126 else if (sample_rate1 >= 16000)
127 sample_rate1 = 16000;
128 else if (sample_rate1 >= 11025)
129 sample_rate1 = 11025;
130 else if (sample_rate1 >= 8000)
147 if (sample_rate1 == 44100) {
151 high_freq = high_freq * 0.4;
152 }
else if (sample_rate1 == 22050) {
155 else if (bps1 >= 0.72)
156 high_freq = high_freq * 0.7;
158 high_freq = high_freq * 0.6;
159 }
else if (sample_rate1 == 16000) {
161 high_freq = high_freq * 0.5;
163 high_freq = high_freq * 0.3;
164 }
else if (sample_rate1 == 11025)
165 high_freq = high_freq * 0.7;
166 else if (sample_rate1 == 8000) {
168 high_freq = high_freq * 0.5;
172 high_freq = high_freq * 0.65;
175 high_freq = high_freq * 0.75;
177 high_freq = high_freq * 0.6;
179 high_freq = high_freq * 0.5;
182 av_dlog(s->
avctx,
"version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
185 av_dlog(s->
avctx,
"bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
187 av_dlog(s->
avctx,
"use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
192 int a,
b, pos, lpos, k, block_len, i, j,
n;
204 for (i = 0; i < 25; i++) {
207 pos = ((block_len * 2 *
a) + (b >> 1)) / b;
211 if (pos >= block_len) {
232 for (i = 0; i <
n; i++)
238 for (i = 0; i < 25; i++) {
241 pos = ((block_len * 2 *
a) + (b << 1)) / (4 * b);
247 if (pos >= block_len)
263 for (i = 0; i <
n; i++) {
268 if (start < s->high_band_start[k])
277 tprintf(s->
avctx,
"%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ",
326 norm = (1.0 / (
float) (1LL << 31)) * sqrt(3) * s->
noise_mult;
341 if (avctx->sample_rate >= 32000) {
344 else if (bps1 < 1.16)
347 s->coef_vlcs[0] = &
coef_vlcs[coef_vlc_table * 2];
348 s->coef_vlcs[1] = &
coef_vlcs[coef_vlc_table * 2 + 1];
350 &
s->int_table[0],
s->coef_vlcs[0]);
352 &
s->int_table[1],
s->coef_vlcs[1]);
361 else if (total_gain < 32)
363 else if (total_gain < 40)
365 else if (total_gain < 45)
383 for (i = 0; i < 2; i++) {
432 VLC *vlc,
const float *level_table,
433 const uint16_t *run_table,
int version,
435 int block_len,
int frame_len_bits,
438 int code,
level, sign;
439 const uint32_t *ilvl = (
const uint32_t *) level_table;
440 uint32_t *iptr = (uint32_t *) ptr;
441 const unsigned int coef_mask = block_len - 1;
442 for (; offset < num_coefs; offset++) {
446 offset += run_table[code];
448 iptr[offset & coef_mask] = ilvl[code] ^ sign << 31;
449 }
else if (code == 1) {
458 offset +=
get_bits(gb, frame_len_bits);
466 "broken escape sequence\n");
469 offset +=
get_bits(gb, frame_len_bits) + 4;
475 ptr[offset & coef_mask] = (level ^ sign) - sign;
479 if (offset > num_coefs) {