aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2007-07-19 00:50:31 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2007-07-19 00:50:31 +0000
commit0ce668015fa6a6f467db9541b08aac8720ad3978 (patch)
treea8389533b18d0d543b9157520f56822658231835 /libavcodec/ac3dec.c
parentd24ce947ca25e97c894348e09f11289f1180212a (diff)
downloadffmpeg-0ce668015fa6a6f467db9541b08aac8720ad3978.tar.gz
remove portions of bit allocation which are no longer needed since they are shared with the encoder
Originally committed as revision 9747 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index eaf669285a..7af8a91640 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -39,9 +39,6 @@
#include "dsputil.h"
#include "random.h"
-static uint8_t bndtab[51];
-static uint8_t masktab[253];
-
static const int nfchans_tbl[8] = { 2, 1, 2, 3, 3, 4, 4, 5 };
/* table for exponent to scale_factor mapping
@@ -49,8 +46,6 @@ static const int nfchans_tbl[8] = { 2, 1, 2, 3, 3, 4, 4, 5 };
*/
static float scale_factors[25];
-static int16_t psdtab[25];
-
static int8_t exp_1[128];
static int8_t exp_2[128];
static int8_t exp_3[128];
@@ -272,22 +267,7 @@ static void generate_quantizers_table_3(int16_t quantizers[], int level, int len
*/
static void ac3_tables_init(void)
{
- int i, j, k, l, v;
- /* compute bndtab and masktab from bandsz */
- k = 0;
- l = 0;
- for(i=0;i<50;i++) {
- bndtab[i] = l;
- v = ff_ac3_bndsz[i];
- for(j=0;j<v;j++) masktab[k++]=i;
- l += v;
- }
- masktab[253] = masktab[254] = masktab[255] = 0;
- bndtab[50] = 0;
-
- /* PSD Table For Mapping Exponents To PSD. */
- for (i = 0; i < 25; i++)
- psdtab[i] = 3072 - (i << 7);
+ int i, j, v;
/* Exponent Decoding Tables */
for (i = 0; i < 5; i++) {
@@ -583,22 +563,6 @@ static void do_bit_allocation(AC3DecodeContext *ctx, int chnl)
}
}
-/* Check if snroffsets are zero. */
-static int is_snr_offsets_zero(AC3DecodeContext *ctx)
-{
- int i;
-
- if ((ctx->csnroffst) || (ctx->cplinu && ctx->cplfsnroffst) ||
- (ctx->lfeon && ctx->lfefsnroffst))
- return 0;
-
- for (i = 0; i < ctx->nfchans; i++)
- if (ctx->fsnroffst[i])
- return 0;
-
- return 1;
-}
-
typedef struct { /* grouped mantissas for 3-level 5-leve and 11-level quantization */
int16_t l3_quantizers[3];
int16_t l5_quantizers[3];
@@ -1674,12 +1638,6 @@ static int ac3_parse_audio_block(AC3DecodeContext * ctx)
}
if (bit_alloc_flags) {
- if (is_snr_offsets_zero(ctx)) {
- memset(ctx->cplbap, 0, sizeof (ctx->cplbap));
- memset(ctx->lfebap, 0, sizeof (ctx->lfebap));
- for (i = 0; i < nfchans; i++)
- memset(ctx->bap[i], 0, sizeof(ctx->bap[i]));
- } else {
/* set bit allocation parameters */
ctx->bit_alloc_params.fscod = ctx->fscod;
ctx->bit_alloc_params.halfratecod = 0;
@@ -1698,7 +1656,6 @@ static int ac3_parse_audio_block(AC3DecodeContext * ctx)
do_bit_allocation(ctx, i);
if (ctx->lfeon && (bit_alloc_flags & 32))
do_bit_allocation(ctx, 6);
- }
}
if (get_bits1(gb)) { /* unused dummy data */