summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-06-23 20:05:42 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-06-23 20:05:42 +0000
commitd5d3536dcb94417335380bb7c3c8014c668f95be (patch)
treef04a27d6b15b3466029ce32a0a262510e10eef95
parent5983d1c480b589e97770a11237a47d93b2a0e804 (diff)
Move code unrelated to lpc filtering out of lpc_filter()
Originally committed as revision 13915 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/ra144.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index e6895cec44..43a84615dd 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -136,15 +136,11 @@ static void add_wav(int n, int skip_first, int *m, const int16_t *s1,
dest[i] = ((*(s1++))*v[0] + (*(s2++))*v[1] + (*(s3++))*v[2]) >> 12;
}
-static void lpc_filter(const int16_t *lpc_coefs, const int16_t *adapt_coef,
- uint16_t *statbuf, int len)
+static void lpc_filter(const int16_t *lpc_coefs, uint16_t *statbuf, int len)
{
int x, i;
int16_t *ptr = statbuf;
- memcpy(statbuf, statbuf + 40, 20);
- memcpy(statbuf + 10, adapt_coef, len * 2);
-
for (i=0; i<len; i++) {
int sum = 0;
int new_val;
@@ -229,7 +225,12 @@ static void do_output_subblock(RA144Context *ractx,
add_wav(gain, cba_idx, m, buffer_a, cb1_vects[cb1_idx], cb2_vects[cb2_idx],
block);
- lpc_filter(lpc_coefs, block, ractx->curr_sblock, BLOCKSIZE);
+ memcpy(ractx->curr_sblock, ractx->curr_sblock + 40,
+ 10*sizeof(*ractx->curr_sblock));
+ memcpy(ractx->curr_sblock + 10, block,
+ BLOCKSIZE*sizeof(*ractx->curr_sblock));
+
+ lpc_filter(lpc_coefs, ractx->curr_sblock, BLOCKSIZE);
}
static void int_to_int16(int16_t *out, const int *inp)