diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-07-04 15:32:04 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-07-04 15:32:04 +0000 |
commit | 12ea267bca00af666d10d241f767db926a89607b (patch) | |
tree | 14bff4a253f240912862f67c86da1b14d3e329d9 | |
parent | 8a3227968cbf0c8de07268cab5c07feaf39dd902 (diff) | |
download | ffmpeg-12ea267bca00af666d10d241f767db926a89607b.tar.gz |
Simplify
Originally committed as revision 14065 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ra288.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 43686d80bf..355a7ab8eb 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -38,7 +38,7 @@ typedef struct { } Real288_internal; /* Decode and produce output */ -static void decode(Real288_internal *glob, int amp_coef, int cb_coef) +static void decode(Real288_internal *glob, float gain, int cb_coef) { unsigned int x, y; float f; @@ -56,8 +56,6 @@ static void decode(Real288_internal *glob, int amp_coef, int cb_coef) glob->sb[x] = sum; } - f = amptable[amp_coef]; - /* convert log and do rms */ for (sum=32, x=10; x--; sum -= glob->pr2[x] * glob->lhist[x]); @@ -66,7 +64,7 @@ static void decode(Real288_internal *glob, int amp_coef, int cb_coef) else if (sum > 60) sum = 60; - sumsum = exp(sum * 0.1151292546497) * f; /* pow(10.0,sum/20)*f */ + sumsum = exp(sum * 0.1151292546497) * gain; /* pow(10.0,sum/20)*f */ for (sum=0, x=5; x--;) { buffer[x] = codetable[cb_coef][x] * sumsum; @@ -223,10 +221,10 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data, init_get_bits(&gb, buf, avctx->block_align * 8); for (x=0; x < 32; x++) { - int amp_coef = get_bits(&gb, 3); + float gain = amptable[get_bits(&gb, 3)]; int cb_coef = get_bits(&gb, 6 + (x&1)); glob->phasep = (glob->phase = x & 7) * 5; - decode(glob, amp_coef, cb_coef); + decode(glob, gain, cb_coef); for (y=0; y<5; *(out++) = 8 * glob->output[glob->phasep+(y++)]); |