aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-09-23 22:49:22 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-09-23 22:49:22 +0000
commit571bbaf81490997218cb74eb0a0e69ae24cbe85e (patch)
treed792068243d062966863f88d75c9e693fea4044e
parentb6bd726843c647e01b91c1c8cfa00f3ecb83960c (diff)
downloadffmpeg-571bbaf81490997218cb74eb0a0e69ae24cbe85e.tar.gz
Factorize lpc code slightly.
Originally committed as revision 15393 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/ra288.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 1f177b5f5d..c56718a521 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -79,12 +79,6 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
memmove(ractx->sp_hist + 70, ractx->sp_hist + 75, 36*sizeof(*block));
- for (i=0; i < 5; i++) {
- block[i] = 0.;
- for (j=0; j < 36; j++)
- block[i] -= block[i-1-j]*ractx->sp_lpc[j];
- }
-
/* block 46 of G.728 spec */
sum = 32.;
for (i=0; i < 10; i++)
@@ -108,9 +102,13 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
gain_block[9] = 10 * log10(sum) - 32;
- for (i=1; i < 5; i++)
- for (j=i-1; j >= 0; j--)
- buffer[i] -= ractx->sp_lpc[i-j-1] * buffer[j];
+ for (i=0; i < 5; i++) {
+ block[i] = 0;
+ for (j=0; j < 36; j++)
+ block[i] -= block[i-1-j]*ractx->sp_lpc[j];
+ for (j=0; j < i; j++)
+ buffer[i] -= buffer[i-1-j]*ractx->sp_lpc[j];
+ }
/* output */
for (i=0; i < 5; i++)