From 536ee17499aefbb7ca33946c3c15c735d50ac5dd Mon Sep 17 00:00:00 2001 From: Vitor Sessak Date: Mon, 23 Jun 2008 20:35:02 +0000 Subject: [PATCH] Move factor multiplication out of irms() Originally committed as revision 13926 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ra144.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index e43fcd1b28..4ab1e4bf5b 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -111,7 +111,7 @@ static void copy_and_dup(const int16_t *source, int16_t *target, int offset) } /** inverse root mean square */ -static int irms(const int16_t *data, int factor) +static int irms(const int16_t *data) { unsigned int i, sum = 0; @@ -121,7 +121,7 @@ static int irms(const int16_t *data, int factor) if (sum == 0) return 0; /* OOPS - division by zero */ - return (0x20000000 / (t_sqrt(sum) >> 8)) * factor; + return 0x20000000 / (t_sqrt(sum) >> 8); } static void add_wav(int n, int skip_first, int *m, const int16_t *s1, @@ -217,7 +217,7 @@ static void do_output_subblock(RA144Context *ractx, if (cba_idx) { cba_idx += BLOCKSIZE/2 - 1; copy_and_dup(ractx->adapt_cb, buffer_a, cba_idx); - m[0] = irms(buffer_a, gval) >> 12; + m[0] = (irms(buffer_a) * gval) >> 12; } else { m[0] = 0; }