summaryrefslogtreecommitdiff
path: root/libavcodec/ac3.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2007-04-25 22:12:51 +0000
committerAurelien Jacobs <aurel@gnuage.org>2007-04-25 22:12:51 +0000
commit7adb10bedf19e8117b0486177167d86f186f06f9 (patch)
tree41fe29a30c8da82aea8b53413e9f0ef0826d9010 /libavcodec/ac3.c
parentad8b8abce401962932442a93d371d684004bf6b0 (diff)
move ac3 tables from a .h to a .c
Originally committed as revision 8816 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3.c')
-rw-r--r--libavcodec/ac3.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/ac3.c b/libavcodec/ac3.c
index eeb60d78f8..e55f7d86a2 100644
--- a/libavcodec/ac3.c
+++ b/libavcodec/ac3.c
@@ -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 @@ void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd,
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 @@ void ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *bndpsd,
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 @@ void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
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 @@ void ac3_common_init(void)
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;
}