summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-05-21 16:43:05 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-05-21 16:43:05 +0000
commitbf6497e9113918df157bd5789d5326e5ef8bb455 (patch)
treed26f065a857182b5d8bc07196a08092815f706f9
parentc7666095fae221b3f25ca05d46b3150c67f2b7f6 (diff)
Simplify add_wav()
Originally committed as revision 13214 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/ra144.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index 5bc4827ac1..d85d7198e3 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -129,30 +129,21 @@ static int irms(const short *data, int factor)
static void add_wav(int n, int f, int m1, int m2, int m3, const short *s1,
const short *s2, const short *s3, short *dest)
{
- int a, b, c, i;
+ int a = 0;
+ int b, c, i;
const short *ptr, *ptr2;
ptr = wavtable1 + n * 9;
ptr2 = wavtable2 + n * 9;
- if (f != 0)
- a = ((*ptr) * m1) >> ((*ptr2) + 1);
- else
- a = 0;
+ if (f)
+ a = (ptr[0] * m1) >> (ptr2[0] + 1);
- ptr++;
- ptr2++;
- b = ((*ptr) * m2) >> ((*ptr2) + 1);
- ptr++;
- ptr2++;
- c = ((*ptr) * m3) >> ((*ptr2) + 1);
+ b = (ptr[1] * m2) >> (ptr2[1] + 1);
+ c = (ptr[2] * m3) >> (ptr2[2] + 1);
- if (f != 0)
for (i=0; i < BLOCKSIZE; i++)
dest[i] = ((*(s1++)) * a + (*(s2++)) * b + (*(s3++)) * c) >> 12;
- else
- for (i=0; i < BLOCKSIZE; i++)
- dest[i] = ((*(s2++)) * b + (*(s3++)) * c) >> 12;
}