Lines Matching refs:lpc
25 #include "lpc.h"
71 LPCContext lpc[MAX_CHANNELS];
136 s->lpc[ch].lpc_order = opt_order;
137 s->lpc[ch].lpc_quant = shift[opt_order-1];
138 memcpy(s->lpc[ch].lpc_coeff, coefs[opt_order-1], opt_order*sizeof(int));
223 LPCContext lpc = s->lpc[ch];
225 if(lpc.lpc_order == 31) {
236 if(lpc.lpc_order > 0) {
242 for(i=1;i<=lpc.lpc_order;i++)
245 // perform lpc on remaining samples
246 for(i = lpc.lpc_order + 1; i < s->avctx->frame_size; i++) {
247 int sum = 1 << (lpc.lpc_quant - 1), res_val, j;
249 for (j = 0; j < lpc.lpc_order; j++) {
250 sum += (samples[lpc.lpc_order-j] - samples[0]) *
251 lpc.lpc_coeff[j];
254 sum >>= lpc.lpc_quant;
256 residual[i] = (samples[lpc.lpc_order+1] - sum) << (32 - s->write_sample_size) >>
261 int index = lpc.lpc_order - 1;
265 int val = samples[0] - samples[lpc.lpc_order - index];
271 lpc.lpc_coeff[index] -= sign;
273 res_val -= ((val >> lpc.lpc_quant) *
274 (lpc.lpc_order - index));
344 put_bits(&s->pbctx, 4, s->lpc[i].lpc_quant);
347 put_bits(&s->pbctx, 5, s->lpc[i].lpc_order);
349 for(j=0;j<s->lpc[i].lpc_order;j++) {
350 put_sbits(&s->pbctx, 16, s->lpc[i].lpc_coeff[j]);
354 // apply lpc and entropy coding to audio samples