aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-27 21:31:24 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-11-01 21:23:04 -0400
commit97f5dd1d84d2352450093a696869433b6c85db9a (patch)
treed78439576a2ce6fa339b7d3ae3c800c51edb8742
parent615b2a2cf5e93bc8701944b136891973aab84579 (diff)
downloadffmpeg-97f5dd1d84d2352450093a696869433b6c85db9a.tar.gz
g726: don't pass index to g726_reset()
calculate it from c->code_size instead.
-rw-r--r--libavcodec/g726.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 4bba3b5f17..f14958a55d 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -270,11 +270,11 @@ static int16_t g726_decode(G726Context* c, int I)
return av_clip(re_signal << 2, -0xffff, 0xffff);
}
-static av_cold int g726_reset(G726Context* c, int index)
+static av_cold int g726_reset(G726Context *c)
{
int i;
- c->tbls = G726Tables_pool[index];
+ c->tbls = G726Tables_pool[c->code_size - 2];
for (i=0; i<2; i++) {
c->sr[i].mant = 1<<5;
c->pk[i] = 1;
@@ -327,7 +327,7 @@ static av_cold int g726_encode_init(AVCodecContext *avctx)
avctx->bit_rate = c->code_size * avctx->sample_rate;
avctx->bits_per_coded_sample = c->code_size;
- g726_reset(c, c->code_size - 2);
+ g726_reset(c);
avctx->coded_frame = avcodec_alloc_frame();
if (!avctx->coded_frame)
@@ -423,7 +423,7 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Invalid number of bits %d\n", c->code_size);
return AVERROR(EINVAL);
}
- g726_reset(c, c->code_size - 2);
+ g726_reset(c);
avctx->sample_fmt = AV_SAMPLE_FMT_S16;