comparison ra144.c @ 7101:6ee204e8d9ae libavcodec

Move code unrelated to lpc filtering out of lpc_filter()
author vitor
date Mon, 23 Jun 2008 20:05:42 +0000
parents a17b3a67a719
children 590736aa6d52
comparison
equal deleted inserted replaced
7100:a17b3a67a719 7101:6ee204e8d9ae
134 134
135 for (i=0; i < BLOCKSIZE; i++) 135 for (i=0; i < BLOCKSIZE; i++)
136 dest[i] = ((*(s1++))*v[0] + (*(s2++))*v[1] + (*(s3++))*v[2]) >> 12; 136 dest[i] = ((*(s1++))*v[0] + (*(s2++))*v[1] + (*(s3++))*v[2]) >> 12;
137 } 137 }
138 138
139 static void lpc_filter(const int16_t *lpc_coefs, const int16_t *adapt_coef, 139 static void lpc_filter(const int16_t *lpc_coefs, uint16_t *statbuf, int len)
140 uint16_t *statbuf, int len)
141 { 140 {
142 int x, i; 141 int x, i;
143 int16_t *ptr = statbuf; 142 int16_t *ptr = statbuf;
144
145 memcpy(statbuf, statbuf + 40, 20);
146 memcpy(statbuf + 10, adapt_coef, len * 2);
147 143
148 for (i=0; i<len; i++) { 144 for (i=0; i<len; i++) {
149 int sum = 0; 145 int sum = 0;
150 int new_val; 146 int new_val;
151 147
227 block = ractx->adapt_cb + BUFFERSIZE - BLOCKSIZE; 223 block = ractx->adapt_cb + BUFFERSIZE - BLOCKSIZE;
228 224
229 add_wav(gain, cba_idx, m, buffer_a, cb1_vects[cb1_idx], cb2_vects[cb2_idx], 225 add_wav(gain, cba_idx, m, buffer_a, cb1_vects[cb1_idx], cb2_vects[cb2_idx],
230 block); 226 block);
231 227
232 lpc_filter(lpc_coefs, block, ractx->curr_sblock, BLOCKSIZE); 228 memcpy(ractx->curr_sblock, ractx->curr_sblock + 40,
229 10*sizeof(*ractx->curr_sblock));
230 memcpy(ractx->curr_sblock + 10, block,
231 BLOCKSIZE*sizeof(*ractx->curr_sblock));
232
233 lpc_filter(lpc_coefs, ractx->curr_sblock, BLOCKSIZE);
233 } 234 }
234 235
235 static void int_to_int16(int16_t *out, const int *inp) 236 static void int_to_int16(int16_t *out, const int *inp)
236 { 237 {
237 int i; 238 int i;