diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 0f7de84bab..f886d28d95 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -47,7 +47,7 @@ OBJS= bitstream.o \ HEADERS = avcodec.h opt.h OBJS-$(CONFIG_AASC_DECODER) += aasc.o -OBJS-$(CONFIG_AC3_ENCODER) += ac3enc.o ac3.o +OBJS-$(CONFIG_AC3_ENCODER) += ac3enc.o ac3tab.o ac3.o OBJS-$(CONFIG_ALAC_DECODER) += alac.o OBJS-$(CONFIG_ASV1_DECODER) += asv1.o OBJS-$(CONFIG_ASV1_ENCODER) += asv1.o @@ -273,7 +273,7 @@ OBJS-$(CONFIG_XVID) += xvidff.o xvid_rc.o OBJS-$(CONFIG_AAC_PARSER) += parser.o -OBJS-$(CONFIG_AC3_PARSER) += parser.o ac3.o +OBJS-$(CONFIG_AC3_PARSER) += parser.o ac3tab.o OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs.o parser.o OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsubdec.o OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsubdec.o 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