diff ac3.c @ 4879:60603c9c89d1 libavcodec

move ac3 tables from a .h to a .c
author aurel
date Wed, 25 Apr 2007 22:12:51 +0000
parents 40f3a7f2b1fd
children b24bcdd0ae86
line wrap: on
line diff
--- a/ac3.c	Wed Apr 25 19:13:09 2007 +0000
+++ b/ac3.c	Wed Apr 25 22:12:51 2007 +0000
@@ -26,9 +26,11 @@
 
 #include "avcodec.h"
 #include "ac3.h"
-#include "ac3tab.h"
 #include "bitstream.h"
 
+static uint8_t bndtab[51];
+static uint8_t masktab[253];
+
 static inline int calc_lowcomp1(int a, int b0, int b1, int c)
 {
     if ((b0 + 256) == b1) {
@@ -70,7 +72,7 @@
         for(i=j;i<end1;i++) {
             /* logadd */
             int adr = FFMIN(FFABS(v - psd[j]) >> 1, 255);
-            v = FFMAX(v, psd[j]) + latab[adr];
+            v = FFMAX(v, psd[j]) + ff_ac3_latab[adr];
             j++;
         }
         bndpsd[k]=v;
@@ -147,7 +149,7 @@
         if (tmp > 0) {
             excite[bin] += tmp >> 2;
         }
-        mask[bin] = FFMAX(hth[bin >> s->halfratecod][s->fscod], excite[bin]);
+        mask[bin] = FFMAX(ff_ac3_hth[bin >> s->halfratecod][s->fscod], excite[bin]);
     }
 
     /* delta bit allocation */
@@ -185,10 +187,10 @@
     j = masktab[start];
     do {
         v = (FFMAX(mask[j] - snroffset - floor, 0) & 0x1FE0) + floor;
-        end1 = FFMIN(bndtab[j] + bndsz[j], end);
+        end1 = FFMIN(bndtab[j] + ff_ac3_bndsz[j], end);
         for (k = i; k < end1; k++) {
             address = av_clip((psd[i] - v) >> 5, 0, 63);
-            bap[i] = baptab[address];
+            bap[i] = ff_ac3_baptab[address];
             i++;
         }
     } while (end > bndtab[j++]);
@@ -229,7 +231,7 @@
     l = 0;
     for(i=0;i<50;i++) {
         bndtab[i] = l;
-        v = bndsz[i];
+        v = ff_ac3_bndsz[i];
         for(j=0;j<v;j++) masktab[k++]=i;
         l += v;
     }