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;
106 nb = ((flags2 >> 3) & 3) + 1;
123 if (sample_rate1 >= 44100)
124 sample_rate1 = 44100;
125 else if (sample_rate1 >= 22050)
126 sample_rate1 = 22050;
127 else if (sample_rate1 >= 16000)
128 sample_rate1 = 16000;
129 else if (sample_rate1 >= 11025)
130 sample_rate1 = 11025;
131 else if (sample_rate1 >= 8000)
148 if (sample_rate1 == 44100) {
152 high_freq = high_freq * 0.4;
153 }
else if (sample_rate1 == 22050) {
156 else if (bps1 >= 0.72)
157 high_freq = high_freq * 0.7;
159 high_freq = high_freq * 0.6;
160 }
else if (sample_rate1 == 16000) {
162 high_freq = high_freq * 0.5;
164 high_freq = high_freq * 0.3;
165 }
else if (sample_rate1 == 11025)
166 high_freq = high_freq * 0.7;
167 else if (sample_rate1 == 8000) {
169 high_freq = high_freq * 0.5;
173 high_freq = high_freq * 0.65;
176 high_freq = high_freq * 0.75;
178 high_freq = high_freq * 0.6;
180 high_freq = high_freq * 0.5;
183 av_dlog(s->
avctx,
"version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
186 av_dlog(s->
avctx,
"bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
188 av_dlog(s->
avctx,
"use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
193 int a,
b, pos, lpos, k, block_len, i, j,
n;
205 for (i = 0; i < 25; i++) {
208 pos = ((block_len * 2 *
a) + (b >> 1)) / b;
212 if (pos >= block_len) {
233 for (i = 0; i <
n; i++)
239 for (i = 0; i < 25; i++) {
242 pos = ((block_len * 2 *
a) + (b << 1)) / (4 * b);
248 if (pos >= block_len)
264 for (i = 0; i <
n; i++) {
269 if (start < s->high_band_start[k])
278 tprintf(s->
avctx,
"%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ",
327 norm = (1.0 / (
float) (1LL << 31)) * sqrt(3) * s->
noise_mult;
338 if (avctx->sample_rate >= 32000) {
341 else if (bps1 < 1.16)
344 s->coef_vlcs[0] = &
coef_vlcs[coef_vlc_table * 2];
345 s->coef_vlcs[1] = &
coef_vlcs[coef_vlc_table * 2 + 1];
347 &
s->int_table[0],
s->coef_vlcs[0]);
349 &
s->int_table[1],
s->coef_vlcs[1]);
358 else if (total_gain < 32)
360 else if (total_gain < 40)
362 else if (total_gain < 45)
380 for (i = 0; i < 2; i++) {
428 VLC *vlc,
const float *level_table,
429 const uint16_t *run_table,
int version,
431 int block_len,
int frame_len_bits,
434 int code,
level, sign;
435 const uint32_t *ilvl = (
const uint32_t *) level_table;
436 uint32_t *iptr = (uint32_t *) ptr;
437 const unsigned int coef_mask = block_len - 1;
438 for (; offset < num_coefs; offset++) {
442 offset += run_table[code];
444 iptr[offset & coef_mask] = ilvl[code] ^ sign << 31;
445 }
else if (code == 1) {
454 offset +=
get_bits(gb, frame_len_bits);
462 "broken escape sequence\n");
465 offset +=
get_bits(gb, frame_len_bits) + 4;
471 ptr[offset & coef_mask] = (level ^ sign) - sign;
475 if (offset > num_coefs) {