[FFmpeg-soc] [soc]: r1816 - in eac3: ac3dec_data.c ac3dec_data.h eac3dec.c

jbr subversion at mplayerhq.hu
Thu Jan 10 06:24:33 CET 2008


Author: jbr
Date: Thu Jan 10 06:24:33 2008
New Revision: 1816

Log:
add test code to generate spectral extension attenuation table at runtime

Modified:
   eac3/ac3dec_data.c
   eac3/ac3dec_data.h
   eac3/eac3dec.c

Modified: eac3/ac3dec_data.c
==============================================================================
--- eac3/ac3dec_data.c	(original)
+++ eac3/ac3dec_data.c	Thu Jan 10 06:24:33 2008
@@ -1123,45 +1123,6 @@ const uint8_t ff_eac3_defspxbndstrc[17] 
 const uint8_t ff_eac3_defecplbndstrc[22] =
 {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1};
 
-
-/**
- * Table E3.14 Spectral Extension Attenuation Table
- */
-const float ff_eac3_spxattentab[32][3] = {
-    {0.954841604, 0.911722489, 0.870550563},
-    {0.911722489, 0.831237896, 0.757858283},
-    {0.870550563, 0.757858283, 0.659753955},
-    {0.831237896, 0.690956440, 0.574349177},
-    {0.793700526, 0.629960525, 0.500000000},
-    {0.757858283, 0.574349177, 0.435275282},
-    {0.723634619, 0.523647061, 0.378929142},
-    {0.690956440, 0.477420802, 0.329876978},
-    {0.659753955, 0.435275282, 0.287174589},
-    {0.629960525, 0.396850263, 0.250000000},
-    {0.601512518, 0.361817309, 0.217637641},
-    {0.574349177, 0.329876978, 0.189464571},
-    {0.548412490, 0.300756259, 0.164938489},
-    {0.523647061, 0.274206245, 0.143587294},
-    {0.500000000, 0.250000000, 0.125000000},
-    {0.477420802, 0.227930622, 0.108818820},
-    {0.455861244, 0.207809474, 0.094732285},
-    {0.435275282, 0.189464571, 0.082469244},
-    {0.415618948, 0.172739110, 0.071793647},
-    {0.396850263, 0.157490131, 0.062500000},
-    {0.378929142, 0.143587294, 0.054409410},
-    {0.361817309, 0.130911765, 0.047366143},
-    {0.345478220, 0.119355200, 0.041234622},
-    {0.329876978, 0.108818820, 0.035896824},
-    {0.314980262, 0.099212566, 0.031250000},
-    {0.300756259, 0.090454327, 0.027204705},
-    {0.287174589, 0.082469244, 0.023683071},
-    {0.274206245, 0.075189065, 0.020617311},
-    {0.261823531, 0.068551561, 0.017948412},
-    {0.250000000, 0.062500000, 0.015625000},
-    {0.238710401, 0.056982656, 0.013602353},
-    {0.227930622, 0.051952369, 0.011841536}
-};
-
 /**
  * Table of bin locations for rematrixing bands
  * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions

Modified: eac3/ac3dec_data.h
==============================================================================
--- eac3/ac3dec_data.h	(original)
+++ eac3/ac3dec_data.h	Thu Jan 10 06:24:33 2008
@@ -34,7 +34,6 @@ extern const uint8_t ff_eac3_frm_expstr[
 extern const uint8_t ff_eac3_default_cpl_band_struct[18];
 extern const uint8_t ff_eac3_defspxbndstrc[17];
 extern const uint8_t ff_eac3_defecplbndstrc[22];
-extern const float   ff_eac3_spxattentab[32][3];
 
 extern const uint8_t ff_ac3_rematrix_band_tab[5];
 

Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c	(original)
+++ eac3/eac3dec.c	Thu Jan 10 06:24:33 2008
@@ -38,6 +38,13 @@ static float idct_cos_tab[6][5];
 
 static int gaq_ungroup_tab[32][3];
 
+#if TEST_SPX
+/**
+ * Table E3.14 Spectral Extension Attenuation Table
+ */
+static float spx_attenuation_tab[32][3];
+#endif
+
 void ff_eac3_log_missing_feature(AVCodecContext *avctx, const char *log){
     av_log(avctx, AV_LOG_ERROR, "%s is not implemented. If you want to help, "
             "update your FFmpeg version to the newest one from SVN. If the "
@@ -1232,4 +1239,17 @@ void ff_eac3_tables_init(void) {
         gaq_ungroup_tab[i][1] = (i % 9) / 3;
         gaq_ungroup_tab[i][2] = i % 3;
     }
+
+#if TEST_SPX
+    {
+    int j;
+    /* initialize spectral extension attenuation table */
+    for (j = 0; j < 3; j++) {
+        for (i = 0; i < 32; i++) {
+            spx_attenuation_tab[i][j] = pow(2.0, (i+1.0)*(j+1.0)/-15.0);
+            av_log(NULL, AV_LOG_DEBUG, "spxattentab[%d][%d] = %1.9f\n", j, i, spx_attenuation_tab[i][j]);
+        }
+    }
+    }
+#endif
 }



More information about the FFmpeg-soc mailing list