Add bias instead of -32 or 0, as is done in g.722.1
authorRamiro Polla <ramiro.polla@gmail.com>
Wed, 9 May 2007 22:00:08 +0000 (22:00 +0000)
committerRamiro Polla <ramiro.polla@gmail.com>
Wed, 9 May 2007 22:00:08 +0000 (22:00 +0000)
Originally committed as revision 8957 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/cook.c

index 5235d8d..0493dcc 100644 (file)
@@ -438,7 +438,7 @@ static void categorize(COOKContext *q, int* quant_index_table,
             index=-1;
             for (i=0 ; i<q->total_subbands ; i++){
                 if (exp_index1[i] < 7) {
             index=-1;
             for (i=0 ; i<q->total_subbands ; i++){
                 if (exp_index1[i] < 7) {
-                    v = (-2*exp_index1[i]) - quant_index_table[i] - 32;
+                    v = (-2*exp_index1[i]) - quant_index_table[i] + bias;
                     if ( v >= max) {
                         max = v;
                         index = i;
                     if ( v >= max) {
                         max = v;
                         index = i;
@@ -455,7 +455,7 @@ static void categorize(COOKContext *q, int* quant_index_table,
             index=-1;
             for (i=0 ; i<q->total_subbands ; i++){
                 if(exp_index2[i] > 0){
             index=-1;
             for (i=0 ; i<q->total_subbands ; i++){
                 if(exp_index2[i] > 0){
-                    v = (-2*exp_index2[i])-quant_index_table[i];
+                    v = (-2*exp_index2[i])-quant_index_table[i]+bias;
                     if ( v < min) {
                         min = v;
                         index = i;
                     if ( v < min) {
                         min = v;
                         index = i;