[FFmpeg-soc] [soc]: r3967 - in wmapro: wma3.h wma3data.h wma3dec.c

faust3 subversion at mplayerhq.hu
Sat Jan 17 13:19:08 CET 2009


Author: faust3
Date: Sat Jan 17 13:19:08 2009
New Revision: 3967

Log:
scale factor vlc table naming cleanup

Modified:
   wmapro/wma3.h
   wmapro/wma3data.h
   wmapro/wma3dec.c

Modified: wmapro/wma3.h
==============================================================================
--- wmapro/wma3.h	Sat Jan 17 13:06:51 2009	(r3966)
+++ wmapro/wma3.h	Sat Jan 17 13:19:08 2009	(r3967)
@@ -31,8 +31,7 @@
 #define MAX_BANDS     29             //< max number of scale factor bands
 #define VLCBITS 9
 
-#define EXPVLCBITS 8
-#define EXPMAX ((19+EXPVLCBITS-1)/EXPVLCBITS)
+#define SCALEVLCBITS 8
 
 /* size of blocks defines taken from wma.h*/
 #define BLOCK_MIN_BITS 7
@@ -115,7 +114,7 @@ typedef struct WMA3DecodeContext {
     int              cValidBarkBand;
     int*              rgiBarkIndex;
 
-    VLC              exp_vlc;
+    VLC              sf_vlc;
     VLC              vec4_vlc;
     VLC              vec2_vlc;
     VLC              vec1_vlc;

Modified: wmapro/wma3data.h
==============================================================================
--- wmapro/wma3data.h	Sat Jan 17 13:06:51 2009	(r3966)
+++ wmapro/wma3data.h	Sat Jan 17 13:19:08 2009	(r3967)
@@ -32,9 +32,9 @@ static const uint16_t ff_wma3_critical_f
 };
 
 
-#define FF_WMA3_SCALE_SIZE 121
-#define FF_WMA3_SCALE_MAXBITS 19
-static const uint32_t ff_wma3_scale_huffcodes[FF_WMA3_SCALE_SIZE] = {
+#define FF_WMA3_HUFF_SCALE_SIZE 121
+#define FF_WMA3_HUFF_SCALE_MAXBITS 19
+static const uint32_t ff_wma3_scale_huffcodes[FF_WMA3_HUFF_SCALE_SIZE] = {
     0x0E639, 0x0E6C2, 0x0E6C1, 0x0E6C0, 0x0E63F, 0x0E63E, 0x0E63D, 0x0E63C,
     0x0E63B, 0x0E63A, 0x0E638, 0x0E637, 0x0E636, 0x0E635, 0x0E634, 0x0E632,
     0x0E633, 0x0E620, 0x0737B, 0x0E610, 0x0E611, 0x0E612, 0x0E613, 0x0E614,
@@ -53,7 +53,7 @@ static const uint32_t ff_wma3_scale_huff
     0x0E6F5,
 };
 
-static const uint8_t ff_wma3_scale_huffbits[FF_WMA3_SCALE_SIZE] = {
+static const uint8_t ff_wma3_scale_huffbits[FF_WMA3_HUFF_SCALE_SIZE] = {
     19, 19, 19, 19, 19, 19, 19, 19,
     19, 19, 19, 19, 19, 19, 19, 19,
     19, 19, 18, 19, 19, 19, 19, 19,

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Sat Jan 17 13:06:51 2009	(r3966)
+++ wmapro/wma3dec.c	Sat Jan 17 13:19:08 2009	(r3967)
@@ -109,7 +109,7 @@ static av_cold int wma3_decode_end(AVCod
         av_free(s->default_decorrelation_matrix);
     }
 
-    free_vlc(&s->exp_vlc);
+    free_vlc(&s->sf_vlc);
     free_vlc(&s->coef_vlc[0]);
     free_vlc(&s->coef_vlc[1]);
     free_vlc(&s->vec4_vlc);
@@ -212,7 +212,7 @@ static av_cold int wma3_decode_init(AVCo
         return -1;
     }
 
-    init_vlc(&s->exp_vlc, EXPVLCBITS, FF_WMA3_SCALE_SIZE,
+    init_vlc(&s->sf_vlc, SCALEVLCBITS, FF_WMA3_HUFF_SCALE_SIZE,
                  ff_wma3_scale_huffbits, 1, 1,
                  ff_wma3_scale_huffcodes, 4, 4, 0);
 
@@ -886,7 +886,7 @@ static int wma_decode_scale_factors(WMA3
                 int i;
                 s->channel[c].scale_factor_step = get_bits(gb,2) + 1;
                 for(i=0;i<s->cValidBarkBand;i++){
-                    int val = get_vlc2(gb, s->exp_vlc.table, EXPVLCBITS, EXPMAX); //dpcm coded
+                    int val = get_vlc2(gb, s->sf_vlc.table, SCALEVLCBITS, ((FF_WMA3_HUFF_SCALE_MAXBITS+SCALEVLCBITS-1)/SCALEVLCBITS)); //dpcm coded
                     if(!i)
                         s->channel[c].scale_factors[i] = 45 / s->channel[c].scale_factor_step + val - 60;
                     else



More information about the FFmpeg-soc mailing list