Browse code

qdm2: initialize coeff_per_sb_select from bit_rate

The value of coeff_per_sb_select depends on the bit rate, not on
sub_sampling.
Also remove the calculation of tmp, no longer needed.

Fixes tickets #1868 and #742 (only audio part)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Roberto Togni authored on 2013/04/21 06:57:18
Showing 1 changed files
... ...
@@ -1862,18 +1862,9 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
1862 1862
     if ((tmp * 2240) < avctx->bit_rate)  tmp_val = 4;
1863 1863
     s->cm_table_select = tmp_val;
1864 1864
 
1865
-    if (s->sub_sampling == 0)
1866
-        tmp = 7999;
1867
-    else
1868
-        tmp = ((-(s->sub_sampling -1)) & 8000) + 20000;
1869
-    /*
1870
-    0: 7999 -> 0
1871
-    1: 20000 -> 2
1872
-    2: 28000 -> 2
1873
-    */
1874
-    if (tmp < 8000)
1865
+    if (avctx->bit_rate <= 8000)
1875 1866
         s->coeff_per_sb_select = 0;
1876
-    else if (tmp <= 16000)
1867
+    else if (avctx->bit_rate < 16000)
1877 1868
         s->coeff_per_sb_select = 1;
1878 1869
     else
1879 1870
         s->coeff_per_sb_select = 2;