# HG changeset patch # User astrange # Date 1210531636 0 # Node ID 781bfad6e40e06899c1e89a9be9ae6782209b7f2 # Parent 2f505f532aa8a96827a7b5ff8628787c74ef9815 Simplify do_voice(). Patch by Vitor Sessak (vitor1001 gmail com) diff -r 2f505f532aa8 -r 781bfad6e40e ra144.c --- a/ra144.c Sun May 11 18:43:11 2008 +0000 +++ b/ra144.c Sun May 11 18:47:16 2008 +0000 @@ -106,28 +106,21 @@ 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; }