From 7adb10bedf19e8117b0486177167d86f186f06f9 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Wed, 25 Apr 2007 22:12:51 +0000 Subject: move ac3 tables from a .h to a .c Originally committed as revision 8816 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ac3.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'libavcodec/ac3.c') 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> 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