Browse code

ac3: Remove ff_ac3_critical_band_size_tab.

It is only used to generate band_start_tab, which about the same size, at
runtime, so it's simpler just to always hardcode band_start_tab.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 24e3ad3031fa26e12d4b939f0ff0dd6e12f05ef5)

Justin Ruggles authored on 2011/01/26 05:07:06
Showing 1 changed files
... ...
@@ -28,8 +28,6 @@
28 28
 #include "ac3.h"
29 29
 #include "get_bits.h"
30 30
 
31
-#if CONFIG_HARDCODED_TABLES
32
-
33 31
 /**
34 32
  * Starting frequency coefficient bin for each critical band.
35 33
  */
... ...
@@ -41,6 +39,8 @@ static const uint8_t band_start_tab[AC3_CRITICAL_BANDS+1] = {
41 41
      79,  85, 97, 109, 121, 133, 157, 181, 205, 229, 253
42 42
 };
43 43
 
44
+#if CONFIG_HARDCODED_TABLES
45
+
44 46
 /**
45 47
  * Map each frequency coefficient bin to the critical band that contains it.
46 48
  */
... ...
@@ -70,13 +70,6 @@ static const uint8_t bin_to_band_tab[253] = {
70 70
 };
71 71
 
72 72
 #else /* CONFIG_HARDCODED_TABLES */
73
-static const uint8_t ff_ac3_critical_band_size_tab[AC3_CRITICAL_BANDS]={
74
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
75
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
76
-    3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24
77
-};
78
-
79
-static uint8_t band_start_tab[51];
80 73
 static uint8_t bin_to_band_tab[253];
81 74
 #endif
82 75
 
... ...
@@ -251,14 +244,12 @@ void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
251 251
 av_cold void ac3_common_init(void)
252 252
 {
253 253
 #if !CONFIG_HARDCODED_TABLES
254
-    /* compute bndtab and masktab from bandsz */
254
+    /* compute bin_to_band_tab from band_start_tab */
255 255
     int bin = 0, band;
256 256
     for (band = 0; band < AC3_CRITICAL_BANDS; band++) {
257
-        int band_end = bin + ff_ac3_critical_band_size_tab[band];
258
-        band_start_tab[band] = bin;
257
+        int band_end = band_start_tab[band+1];
259 258
         while (bin < band_end)
260 259
             bin_to_band_tab[bin++] = band;
261 260
     }
262
-    band_start_tab[AC3_CRITICAL_BANDS] = bin;
263 261
 #endif /* !CONFIG_HARDCODED_TABLES */
264 262
 }