[FFmpeg-cvslog] r15393 - trunk/libavcodec/ra288.c
michael
subversion
Wed Sep 24 00:49:22 CEST 2008
Author: michael
Date: Wed Sep 24 00:49:22 2008
New Revision: 15393
Log:
Factorize lpc code slightly.
Modified:
trunk/libavcodec/ra288.c
Modified: trunk/libavcodec/ra288.c
==============================================================================
--- trunk/libavcodec/ra288.c (original)
+++ trunk/libavcodec/ra288.c Wed Sep 24 00:49:22 2008
@@ -79,12 +79,6 @@ static void decode(RA288Context *ractx,
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,
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++)
More information about the ffmpeg-cvslog
mailing list