aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-05-11 18:47:16 +0000
committerAlexander Strange <astrange@ithinksw.com>2008-05-11 18:47:16 +0000
commit1d46ba661c8f067f17109554fbe56e923be6d6eb (patch)
tree684ad074383d0178da2ca1dfcb7d36f7867e57a6 /libavcodec
parent0d493edd0b9531c655243d0c97d95e914be812be (diff)
downloadffmpeg-1d46ba661c8f067f17109554fbe56e923be6d6eb.tar.gz
Simplify do_voice().
Patch by Vitor Sessak (vitor1001 gmail com) Originally committed as revision 13124 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ra144.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index 7f13b1b1ab..80ecba636b 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -106,28 +106,21 @@ static int t_sqrt(unsigned int x)
static void do_voice(int *a1, int *a2)
{
int buffer[10];
- int *b1, *b2;
+ int *b1 = buffer;
+ int *b2 = a2;
int x, y;
- int *ptr;
-
- b1 = buffer;
- b2 = a2;
for (x=0; x < 10; x++) {
- b1[x] = (*a1) << 4;
+ b1[x] = a1[x] << 4;
+
+ for (y=0; y < x; y++)
+ b1[y] = ((a1[x] * (b2[x-y-1])) >> 12) + b2[y];
- if(x > 0) {
- ptr = b2 + x;
- for (y=0; y <= x - 1; y++)
- b1[y] = (((*a1) * (*(--ptr))) >> 12) + b2[y];
- }
FFSWAP(int *, b1, b2);
- a1++;
}
- ptr = a2 + 10;
- while (ptr > a2)
- (*a2++) >>= 4;
+ for (x=0; x < 10; x++)
+ a2[x] >>= 4;
}