Commit 92a897ba authored by jbr's avatar jbr

simplify coefficient decoding

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9884 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 15458a2d
...@@ -495,13 +495,11 @@ static int get_transform_coeffs_ch(AC3DecodeContext *ctx, int ch_index, mant_gro ...@@ -495,13 +495,11 @@ static int get_transform_coeffs_ch(AC3DecodeContext *ctx, int ch_index, mant_gro
case 0: case 0:
if (!dithflag) { if (!dithflag) {
coeffs[i] = 0; coeffs[i] = 0;
continue;
} }
else { else {
coeffs[i] = (av_random(&ctx->dith_state) & 0xFFFF) * scale_factors[exps[i]]; coeffs[i] = (av_random(&ctx->dith_state) & 0xFFFF) * LEVEL_MINUS_3DB;
coeffs[i] *= LEVEL_MINUS_3DB;
continue;
} }
break;
case 1: case 1:
if (m->l3ptr > 2) { if (m->l3ptr > 2) {
...@@ -511,8 +509,8 @@ static int get_transform_coeffs_ch(AC3DecodeContext *ctx, int ch_index, mant_gro ...@@ -511,8 +509,8 @@ static int get_transform_coeffs_ch(AC3DecodeContext *ctx, int ch_index, mant_gro
m->l3_quantizers[2] = l3_quantizers_3[gcode]; m->l3_quantizers[2] = l3_quantizers_3[gcode];
m->l3ptr = 0; m->l3ptr = 0;
} }
coeffs[i] = m->l3_quantizers[m->l3ptr++] * scale_factors[exps[i]]; coeffs[i] = m->l3_quantizers[m->l3ptr++];
continue; break;
case 2: case 2:
if (m->l5ptr > 2) { if (m->l5ptr > 2) {
...@@ -522,12 +520,12 @@ static int get_transform_coeffs_ch(AC3DecodeContext *ctx, int ch_index, mant_gro ...@@ -522,12 +520,12 @@ static int get_transform_coeffs_ch(AC3DecodeContext *ctx, int ch_index, mant_gro
m->l5_quantizers[2] = l5_quantizers_3[gcode]; m->l5_quantizers[2] = l5_quantizers_3[gcode];
m->l5ptr = 0; m->l5ptr = 0;
} }
coeffs[i] = m->l5_quantizers[m->l5ptr++] * scale_factors[exps[i]]; coeffs[i] = m->l5_quantizers[m->l5ptr++];
continue; break;
case 3: case 3:
coeffs[i] = l7_quantizers[get_bits(gb, 3)] * scale_factors[exps[i]]; coeffs[i] = l7_quantizers[get_bits(gb, 3)];
continue; break;
case 4: case 4:
if (m->l11ptr > 1) { if (m->l11ptr > 1) {
...@@ -536,17 +534,18 @@ static int get_transform_coeffs_ch(AC3DecodeContext *ctx, int ch_index, mant_gro ...@@ -536,17 +534,18 @@ static int get_transform_coeffs_ch(AC3DecodeContext *ctx, int ch_index, mant_gro
m->l11_quantizers[1] = l11_quantizers_2[gcode]; m->l11_quantizers[1] = l11_quantizers_2[gcode];
m->l11ptr = 0; m->l11ptr = 0;
} }
coeffs[i] = m->l11_quantizers[m->l11ptr++] * scale_factors[exps[i]]; coeffs[i] = m->l11_quantizers[m->l11ptr++];
continue; break;
case 5: case 5:
coeffs[i] = l15_quantizers[get_bits(gb, 4)] * scale_factors[exps[i]]; coeffs[i] = l15_quantizers[get_bits(gb, 4)];
continue; break;
default: default:
coeffs[i] = (get_sbits(gb, qntztab[tbap]) << (16 - qntztab[tbap])) * scale_factors[exps[i]]; coeffs[i] = get_sbits(gb, qntztab[tbap]) << (16 - qntztab[tbap]);
continue; break;
} }
coeffs[i] *= scale_factors[exps[i]];
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment