aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/apedec.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-31 14:57:04 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-11-10 10:25:47 -0500
commitad17207b517508c95aa9bd1f67e7beb6d09af52f (patch)
tree6b3dd962412814379780e3921ebe47f6466d8845 /libavcodec/apedec.c
parent59f4d1b8bb4eacfb5b678eda93c1fa30b7823cb4 (diff)
downloadffmpeg-ad17207b517508c95aa9bd1f67e7beb6d09af52f.tar.gz
apedec: remove unneeded entropy decoder normalization.
The decoder already skips data at the end of the packet without this. Also remove 2 APEContext fields that were only used for the end-of-frame normalization.
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r--libavcodec/apedec.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index e9069031ad..0619358dad 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -140,8 +140,6 @@ typedef struct APEContext {
uint32_t CRC; ///< frame CRC
int frameflags; ///< frame flags
- int currentframeblocks; ///< samples (per channel) in current frame
- int blocksdecoded; ///< count of decoded samples in current frame
APEPredictor predictor; ///< predictor used for final reconstruction
int32_t decoded0[BLOCKS_PER_LOOP]; ///< decoded data for the first channel
@@ -457,8 +455,6 @@ static void entropy_decode(APEContext *ctx, int blockstodecode, int stereo)
int32_t *decoded0 = ctx->decoded0;
int32_t *decoded1 = ctx->decoded1;
- ctx->blocksdecoded = blockstodecode;
-
if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
/* We are pure silence, just memset the output buffer. */
memset(decoded0, 0, blockstodecode * sizeof(int32_t));
@@ -470,9 +466,6 @@ static void entropy_decode(APEContext *ctx, int blockstodecode, int stereo)
*decoded1++ = ape_decode_value(ctx, &ctx->riceX);
}
}
-
- if (ctx->blocksdecoded == ctx->currentframeblocks)
- range_dec_normalize(ctx); /* normalize to use up all bytes */
}
static int init_entropy_decoder(APEContext *ctx)
@@ -492,9 +485,6 @@ static int init_entropy_decoder(APEContext *ctx)
ctx->frameflags = bytestream_get_be32(&ctx->ptr);
}
- /* Keep a count of the blocks decoded in this frame */
- ctx->blocksdecoded = 0;
-
/* Initialize the rice structs */
ctx->riceX.k = 10;
ctx->riceX.ksum = (1 << ctx->riceX.k) * 16;
@@ -873,7 +863,7 @@ static int ape_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %u.\n", nblocks);
return AVERROR_INVALIDDATA;
}
- s->currentframeblocks = s->samples = nblocks;
+ s->samples = nblocks;
memset(s->decoded0, 0, sizeof(s->decoded0));
memset(s->decoded1, 0, sizeof(s->decoded1));