Lines Matching +full:- +full:i
1 /* libFLAC - Free Lossless Audio Codec library
2 * Copyright (C) 2000-2009 Josh Coalson
3 * Copyright (C) 2011-2014 Xiph.Org Foundation
9 * - Redistributions of source code must retain the above copyright
12 * - Redistributions in binary form must reproduce the above copyright
16 * - Neither the name of the Xiph.org Foundation nor the names of its
69 unsigned i; in FLAC__lpc_window_data() local
70 for(i = 0; i < data_len; i++) in FLAC__lpc_window_data()
71 out[i] = in[i] * window[i]; in FLAC__lpc_window_data()
79 unsigned i; in FLAC__lpc_compute_autocorrelation()
86 * for(i = 0; i < data_len; i++) in FLAC__lpc_compute_autocorrelation()
87 * data[i] -= mean; in FLAC__lpc_compute_autocorrelation()
91 while(lag--) { in FLAC__lpc_compute_autocorrelation()
92 for(i = lag, d = 0.0; i < data_len; i++) in FLAC__lpc_compute_autocorrelation()
93 d += data[i] * data[i - lag]; in FLAC__lpc_compute_autocorrelation()
104 const unsigned limit = data_len - lag; in FLAC__lpc_compute_autocorrelation()
118 for(coeff = 0; coeff < data_len - sample; coeff++) in FLAC__lpc_compute_autocorrelation()
125 unsigned i, j; in FLAC__lpc_compute_lp_coefficients() local
135 for(i = 0; i < *max_order; i++) { in FLAC__lpc_compute_lp_coefficients()
137 r = -autoc[i+1]; in FLAC__lpc_compute_lp_coefficients()
138 for(j = 0; j < i; j++) in FLAC__lpc_compute_lp_coefficients()
139 r -= lpc[j] * autoc[i-j]; in FLAC__lpc_compute_lp_coefficients()
143 lpc[i]=r; in FLAC__lpc_compute_lp_coefficients()
144 for(j = 0; j < (i>>1); j++) { in FLAC__lpc_compute_lp_coefficients()
146 lpc[j] += r * lpc[i-1-j]; in FLAC__lpc_compute_lp_coefficients()
147 lpc[i-1-j] += r * tmp; in FLAC__lpc_compute_lp_coefficients()
149 if(i & 1) in FLAC__lpc_compute_lp_coefficients()
152 err *= (1.0 - r * r); in FLAC__lpc_compute_lp_coefficients()
155 for(j = 0; j <= i; j++) in FLAC__lpc_compute_lp_coefficients()
156 lp_coeff[i][j] = (FLAC__real)(-lpc[j]); /* negate FIR filter coeff to get predictor coeff */ in FLAC__lpc_compute_lp_coefficients()
157 error[i] = err; in FLAC__lpc_compute_lp_coefficients()
161 *max_order = i+1; in FLAC__lpc_compute_lp_coefficients()
169 unsigned i; in FLAC__lpc_quantize_coefficients() local
176 /* drop one bit for the sign; from here on out we consider only |lp_coeff[i]| */ in FLAC__lpc_quantize_coefficients()
177 precision--; in FLAC__lpc_quantize_coefficients()
179 qmin = -qmax; in FLAC__lpc_quantize_coefficients()
180 qmax--; in FLAC__lpc_quantize_coefficients()
182 /* calc cmax = max( |lp_coeff[i]| ) */ in FLAC__lpc_quantize_coefficients()
184 for(i = 0; i < order; i++) { in FLAC__lpc_quantize_coefficients()
185 const FLAC__double d = fabs(lp_coeff[i]); in FLAC__lpc_quantize_coefficients()
191 /* => coefficients are all 0, which means our constant-detect didn't work */ in FLAC__lpc_quantize_coefficients()
195 const int max_shiftlimit = (1 << (FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN-1)) - 1; in FLAC__lpc_quantize_coefficients()
196 const int min_shiftlimit = -max_shiftlimit - 1; in FLAC__lpc_quantize_coefficients()
200 log2cmax--; in FLAC__lpc_quantize_coefficients()
201 *shift = (int)precision - log2cmax - 1; in FLAC__lpc_quantize_coefficients()
212 for(i = 0; i < order; i++) { in FLAC__lpc_quantize_coefficients()
213 error += lp_coeff[i] * (1 << *shift); in FLAC__lpc_quantize_coefficients()
218 …ax %d>%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmax,*shift,cmax,precision+1,i,lp_coeff[i]); in FLAC__lpc_quantize_coefficients()
220 …in %d<%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmin,*shift,cmax,precision+1,i,lp_coeff[i]); in FLAC__lpc_quantize_coefficients()
226 error -= q; in FLAC__lpc_quantize_coefficients()
227 qlp_coeff[i] = q; in FLAC__lpc_quantize_coefficients()
235 const int nshift = -(*shift); in FLAC__lpc_quantize_coefficients()
241 for(i = 0; i < order; i++) { in FLAC__lpc_quantize_coefficients()
242 error += lp_coeff[i] / (1 << nshift); in FLAC__lpc_quantize_coefficients()
246 …ax %d>%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmax,*shift,cmax,precision+1,i,lp_coeff[i]); in FLAC__lpc_quantize_coefficients()
248 …in %d<%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmin,*shift,cmax,precision+1,i,lp_coeff[i]); in FLAC__lpc_quantize_coefficients()
254 error -= q; in FLAC__lpc_quantize_coefficients()
255 qlp_coeff[i] = q; in FLAC__lpc_quantize_coefficients()
272 unsigned i, j; in FLAC__lpc_compute_residual_from_qlp_coefficients() local
278 for(i=0;i<order;i++) in FLAC__lpc_compute_residual_from_qlp_coefficients()
279 fprintf(stderr,", q[%u]=%d",i,qlp_coeff[i]); in FLAC__lpc_compute_residual_from_qlp_coefficients()
284 for(i = 0; i < data_len; i++) { in FLAC__lpc_compute_residual_from_qlp_coefficients()
289 sum += qlp_coeff[j] * (*(--history)); in FLAC__lpc_compute_residual_from_qlp_coefficients()
291 if(sumo > 2147483647ll || sumo < -2147483648ll) in FLAC__lpc_compute_residual_from_qlp_coefficients()
292 …lpc_compute_residual_from_qlp_coefficients: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%" PRId64 "\n",… in FLAC__lpc_compute_residual_from_qlp_coefficients()
294 *(residual++) = *(data++) - (sum >> lp_quantization); in FLAC__lpc_compute_residual_from_qlp_coefficients()
298 for(i = 0; i < data_len; i++) { in FLAC__lpc_compute_residual_from_qlp_coefficients()
301 sum += qlp_coeff[j] * data[i-j-1]; in FLAC__lpc_compute_residual_from_qlp_coefficients()
302 residual[i] = data[i] - (sum >> lp_quantization); in FLAC__lpc_compute_residual_from_qlp_coefficients()
308 int i;
323 for(i = 0; i < (int)data_len; i++) {
325 sum += qlp_coeff[11] * data[i-12];
326 sum += qlp_coeff[10] * data[i-11];
327 sum += qlp_coeff[9] * data[i-10];
328 sum += qlp_coeff[8] * data[i-9];
329 sum += qlp_coeff[7] * data[i-8];
330 sum += qlp_coeff[6] * data[i-7];
331 sum += qlp_coeff[5] * data[i-6];
332 sum += qlp_coeff[4] * data[i-5];
333 sum += qlp_coeff[3] * data[i-4];
334 sum += qlp_coeff[2] * data[i-3];
335 sum += qlp_coeff[1] * data[i-2];
336 sum += qlp_coeff[0] * data[i-1];
337 residual[i] = data[i] - (sum >> lp_quantization);
341 for(i = 0; i < (int)data_len; i++) {
343 sum += qlp_coeff[10] * data[i-11];
344 sum += qlp_coeff[9] * data[i-10];
345 sum += qlp_coeff[8] * data[i-9];
346 sum += qlp_coeff[7] * data[i-8];
347 sum += qlp_coeff[6] * data[i-7];
348 sum += qlp_coeff[5] * data[i-6];
349 sum += qlp_coeff[4] * data[i-5];
350 sum += qlp_coeff[3] * data[i-4];
351 sum += qlp_coeff[2] * data[i-3];
352 sum += qlp_coeff[1] * data[i-2];
353 sum += qlp_coeff[0] * data[i-1];
354 residual[i] = data[i] - (sum >> lp_quantization);
360 for(i = 0; i < (int)data_len; i++) {
362 sum += qlp_coeff[9] * data[i-10];
363 sum += qlp_coeff[8] * data[i-9];
364 sum += qlp_coeff[7] * data[i-8];
365 sum += qlp_coeff[6] * data[i-7];
366 sum += qlp_coeff[5] * data[i-6];
367 sum += qlp_coeff[4] * data[i-5];
368 sum += qlp_coeff[3] * data[i-4];
369 sum += qlp_coeff[2] * data[i-3];
370 sum += qlp_coeff[1] * data[i-2];
371 sum += qlp_coeff[0] * data[i-1];
372 residual[i] = data[i] - (sum >> lp_quantization);
376 for(i = 0; i < (int)data_len; i++) {
378 sum += qlp_coeff[8] * data[i-9];
379 sum += qlp_coeff[7] * data[i-8];
380 sum += qlp_coeff[6] * data[i-7];
381 sum += qlp_coeff[5] * data[i-6];
382 sum += qlp_coeff[4] * data[i-5];
383 sum += qlp_coeff[3] * data[i-4];
384 sum += qlp_coeff[2] * data[i-3];
385 sum += qlp_coeff[1] * data[i-2];
386 sum += qlp_coeff[0] * data[i-1];
387 residual[i] = data[i] - (sum >> lp_quantization);
395 for(i = 0; i < (int)data_len; i++) {
397 sum += qlp_coeff[7] * data[i-8];
398 sum += qlp_coeff[6] * data[i-7];
399 sum += qlp_coeff[5] * data[i-6];
400 sum += qlp_coeff[4] * data[i-5];
401 sum += qlp_coeff[3] * data[i-4];
402 sum += qlp_coeff[2] * data[i-3];
403 sum += qlp_coeff[1] * data[i-2];
404 sum += qlp_coeff[0] * data[i-1];
405 residual[i] = data[i] - (sum >> lp_quantization);
409 for(i = 0; i < (int)data_len; i++) {
411 sum += qlp_coeff[6] * data[i-7];
412 sum += qlp_coeff[5] * data[i-6];
413 sum += qlp_coeff[4] * data[i-5];
414 sum += qlp_coeff[3] * data[i-4];
415 sum += qlp_coeff[2] * data[i-3];
416 sum += qlp_coeff[1] * data[i-2];
417 sum += qlp_coeff[0] * data[i-1];
418 residual[i] = data[i] - (sum >> lp_quantization);
424 for(i = 0; i < (int)data_len; i++) {
426 sum += qlp_coeff[5] * data[i-6];
427 sum += qlp_coeff[4] * data[i-5];
428 sum += qlp_coeff[3] * data[i-4];
429 sum += qlp_coeff[2] * data[i-3];
430 sum += qlp_coeff[1] * data[i-2];
431 sum += qlp_coeff[0] * data[i-1];
432 residual[i] = data[i] - (sum >> lp_quantization);
436 for(i = 0; i < (int)data_len; i++) {
438 sum += qlp_coeff[4] * data[i-5];
439 sum += qlp_coeff[3] * data[i-4];
440 sum += qlp_coeff[2] * data[i-3];
441 sum += qlp_coeff[1] * data[i-2];
442 sum += qlp_coeff[0] * data[i-1];
443 residual[i] = data[i] - (sum >> lp_quantization);
451 for(i = 0; i < (int)data_len; i++) {
453 sum += qlp_coeff[3] * data[i-4];
454 sum += qlp_coeff[2] * data[i-3];
455 sum += qlp_coeff[1] * data[i-2];
456 sum += qlp_coeff[0] * data[i-1];
457 residual[i] = data[i] - (sum >> lp_quantization);
461 for(i = 0; i < (int)data_len; i++) {
463 sum += qlp_coeff[2] * data[i-3];
464 sum += qlp_coeff[1] * data[i-2];
465 sum += qlp_coeff[0] * data[i-1];
466 residual[i] = data[i] - (sum >> lp_quantization);
472 for(i = 0; i < (int)data_len; i++) {
474 sum += qlp_coeff[1] * data[i-2];
475 sum += qlp_coeff[0] * data[i-1];
476 residual[i] = data[i] - (sum >> lp_quantization);
480 for(i = 0; i < (int)data_len; i++)
481 residual[i] = data[i] - ((qlp_coeff[0] * data[i-1]) >> lp_quantization);
487 for(i = 0; i < (int)data_len; i++) {
490 case 32: sum += qlp_coeff[31] * data[i-32];
491 case 31: sum += qlp_coeff[30] * data[i-31];
492 case 30: sum += qlp_coeff[29] * data[i-30];
493 case 29: sum += qlp_coeff[28] * data[i-29];
494 case 28: sum += qlp_coeff[27] * data[i-28];
495 case 27: sum += qlp_coeff[26] * data[i-27];
496 case 26: sum += qlp_coeff[25] * data[i-26];
497 case 25: sum += qlp_coeff[24] * data[i-25];
498 case 24: sum += qlp_coeff[23] * data[i-24];
499 case 23: sum += qlp_coeff[22] * data[i-23];
500 case 22: sum += qlp_coeff[21] * data[i-22];
501 case 21: sum += qlp_coeff[20] * data[i-21];
502 case 20: sum += qlp_coeff[19] * data[i-20];
503 case 19: sum += qlp_coeff[18] * data[i-19];
504 case 18: sum += qlp_coeff[17] * data[i-18];
505 case 17: sum += qlp_coeff[16] * data[i-17];
506 case 16: sum += qlp_coeff[15] * data[i-16];
507 case 15: sum += qlp_coeff[14] * data[i-15];
508 case 14: sum += qlp_coeff[13] * data[i-14];
509 case 13: sum += qlp_coeff[12] * data[i-13];
510 sum += qlp_coeff[11] * data[i-12];
511 sum += qlp_coeff[10] * data[i-11];
512 sum += qlp_coeff[ 9] * data[i-10];
513 sum += qlp_coeff[ 8] * data[i- 9];
514 sum += qlp_coeff[ 7] * data[i- 8];
515 sum += qlp_coeff[ 6] * data[i- 7];
516 sum += qlp_coeff[ 5] * data[i- 6];
517 sum += qlp_coeff[ 4] * data[i- 5];
518 sum += qlp_coeff[ 3] * data[i- 4];
519 sum += qlp_coeff[ 2] * data[i- 3];
520 sum += qlp_coeff[ 1] * data[i- 2];
521 sum += qlp_coeff[ 0] * data[i- 1];
523 residual[i] = data[i] - (sum >> lp_quantization);
532 unsigned i, j; in FLAC__lpc_compute_residual_from_qlp_coefficients_wide() local
538 for(i=0;i<order;i++) in FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
539 fprintf(stderr,", q[%u]=%d",i,qlp_coeff[i]); in FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
544 for(i = 0; i < data_len; i++) { in FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
548 sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history)); in FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
550 …AC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, sum=%" PRId64 "\n", i, (sum >… in FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
553 if(FLAC__bitmath_silog2_wide((FLAC__int64)(*data) - (sum >> lp_quantization)) > 32) { in FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
554 …de: OVERFLOW, i=%u, data=%d, sum=%" PRId64 ", residual=%" PRId64 "\n", i, *data, (int64_t)(sum >> … in FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
557 *(residual++) = *(data++) - (FLAC__int32)(sum >> lp_quantization); in FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
562 int i;
577 for(i = 0; i < (int)data_len; i++) {
579 sum += qlp_coeff[11] * (FLAC__int64)data[i-12];
580 sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
581 sum += qlp_coeff[9] * (FLAC__int64)data[i-10];
582 sum += qlp_coeff[8] * (FLAC__int64)data[i-9];
583 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
584 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
585 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
586 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
587 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
588 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
589 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
590 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
591 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
595 for(i = 0; i < (int)data_len; i++) {
597 sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
598 sum += qlp_coeff[9] * (FLAC__int64)data[i-10];
599 sum += qlp_coeff[8] * (FLAC__int64)data[i-9];
600 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
601 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
602 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
603 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
604 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
605 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
606 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
607 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
608 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
614 for(i = 0; i < (int)data_len; i++) {
616 sum += qlp_coeff[9] * (FLAC__int64)data[i-10];
617 sum += qlp_coeff[8] * (FLAC__int64)data[i-9];
618 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
619 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
620 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
621 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
622 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
623 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
624 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
625 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
626 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
630 for(i = 0; i < (int)data_len; i++) {
632 sum += qlp_coeff[8] * (FLAC__int64)data[i-9];
633 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
634 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
635 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
636 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
637 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
638 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
639 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
640 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
641 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
649 for(i = 0; i < (int)data_len; i++) {
651 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
652 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
653 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
654 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
655 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
656 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
657 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
658 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
659 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
663 for(i = 0; i < (int)data_len; i++) {
665 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
666 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
667 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
668 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
669 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
670 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
671 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
672 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
678 for(i = 0; i < (int)data_len; i++) {
680 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
681 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
682 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
683 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
684 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
685 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
686 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
690 for(i = 0; i < (int)data_len; i++) {
692 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
693 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
694 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
695 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
696 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
697 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
705 for(i = 0; i < (int)data_len; i++) {
707 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
708 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
709 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
710 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
711 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
715 for(i = 0; i < (int)data_len; i++) {
717 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
718 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
719 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
720 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
726 for(i = 0; i < (int)data_len; i++) {
728 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
729 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
730 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
734 for(i = 0; i < (int)data_len; i++)
735 … residual[i] = data[i] - (FLAC__int32)((qlp_coeff[0] * (FLAC__int64)data[i-1]) >> lp_quantization);
741 for(i = 0; i < (int)data_len; i++) {
744 case 32: sum += qlp_coeff[31] * (FLAC__int64)data[i-32];
745 case 31: sum += qlp_coeff[30] * (FLAC__int64)data[i-31];
746 case 30: sum += qlp_coeff[29] * (FLAC__int64)data[i-30];
747 case 29: sum += qlp_coeff[28] * (FLAC__int64)data[i-29];
748 case 28: sum += qlp_coeff[27] * (FLAC__int64)data[i-28];
749 case 27: sum += qlp_coeff[26] * (FLAC__int64)data[i-27];
750 case 26: sum += qlp_coeff[25] * (FLAC__int64)data[i-26];
751 case 25: sum += qlp_coeff[24] * (FLAC__int64)data[i-25];
752 case 24: sum += qlp_coeff[23] * (FLAC__int64)data[i-24];
753 case 23: sum += qlp_coeff[22] * (FLAC__int64)data[i-23];
754 case 22: sum += qlp_coeff[21] * (FLAC__int64)data[i-22];
755 case 21: sum += qlp_coeff[20] * (FLAC__int64)data[i-21];
756 case 20: sum += qlp_coeff[19] * (FLAC__int64)data[i-20];
757 case 19: sum += qlp_coeff[18] * (FLAC__int64)data[i-19];
758 case 18: sum += qlp_coeff[17] * (FLAC__int64)data[i-18];
759 case 17: sum += qlp_coeff[16] * (FLAC__int64)data[i-17];
760 case 16: sum += qlp_coeff[15] * (FLAC__int64)data[i-16];
761 case 15: sum += qlp_coeff[14] * (FLAC__int64)data[i-15];
762 case 14: sum += qlp_coeff[13] * (FLAC__int64)data[i-14];
763 case 13: sum += qlp_coeff[12] * (FLAC__int64)data[i-13];
764 sum += qlp_coeff[11] * (FLAC__int64)data[i-12];
765 sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
766 sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10];
767 sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9];
768 sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8];
769 sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7];
770 sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6];
771 sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5];
772 sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4];
773 sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3];
774 sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2];
775 sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1];
777 residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
789 unsigned i, j; in FLAC__lpc_restore_signal() local
795 for(i=0;i<order;i++) in FLAC__lpc_restore_signal()
796 fprintf(stderr,", q[%u]=%d",i,qlp_coeff[i]); in FLAC__lpc_restore_signal()
801 for(i = 0; i < data_len; i++) { in FLAC__lpc_restore_signal()
806 sum += qlp_coeff[j] * (*(--history)); in FLAC__lpc_restore_signal()
808 if(sumo > 2147483647ll || sumo < -2147483648ll) in FLAC__lpc_restore_signal()
809 …fprintf(stderr,"FLAC__lpc_restore_signal: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%" PRId64 "\n",i,… in FLAC__lpc_restore_signal()
815 for(i = 0; i < data_len; i++) { in FLAC__lpc_restore_signal()
818 sum += qlp_coeff[j] * data[i-j-1]; in FLAC__lpc_restore_signal()
819 data[i] = residual[i] + (sum >> lp_quantization); in FLAC__lpc_restore_signal()
825 int i;
840 for(i = 0; i < (int)data_len; i++) {
842 sum += qlp_coeff[11] * data[i-12];
843 sum += qlp_coeff[10] * data[i-11];
844 sum += qlp_coeff[9] * data[i-10];
845 sum += qlp_coeff[8] * data[i-9];
846 sum += qlp_coeff[7] * data[i-8];
847 sum += qlp_coeff[6] * data[i-7];
848 sum += qlp_coeff[5] * data[i-6];
849 sum += qlp_coeff[4] * data[i-5];
850 sum += qlp_coeff[3] * data[i-4];
851 sum += qlp_coeff[2] * data[i-3];
852 sum += qlp_coeff[1] * data[i-2];
853 sum += qlp_coeff[0] * data[i-1];
854 data[i] = residual[i] + (sum >> lp_quantization);
858 for(i = 0; i < (int)data_len; i++) {
860 sum += qlp_coeff[10] * data[i-11];
861 sum += qlp_coeff[9] * data[i-10];
862 sum += qlp_coeff[8] * data[i-9];
863 sum += qlp_coeff[7] * data[i-8];
864 sum += qlp_coeff[6] * data[i-7];
865 sum += qlp_coeff[5] * data[i-6];
866 sum += qlp_coeff[4] * data[i-5];
867 sum += qlp_coeff[3] * data[i-4];
868 sum += qlp_coeff[2] * data[i-3];
869 sum += qlp_coeff[1] * data[i-2];
870 sum += qlp_coeff[0] * data[i-1];
871 data[i] = residual[i] + (sum >> lp_quantization);
877 for(i = 0; i < (int)data_len; i++) {
879 sum += qlp_coeff[9] * data[i-10];
880 sum += qlp_coeff[8] * data[i-9];
881 sum += qlp_coeff[7] * data[i-8];
882 sum += qlp_coeff[6] * data[i-7];
883 sum += qlp_coeff[5] * data[i-6];
884 sum += qlp_coeff[4] * data[i-5];
885 sum += qlp_coeff[3] * data[i-4];
886 sum += qlp_coeff[2] * data[i-3];
887 sum += qlp_coeff[1] * data[i-2];
888 sum += qlp_coeff[0] * data[i-1];
889 data[i] = residual[i] + (sum >> lp_quantization);
893 for(i = 0; i < (int)data_len; i++) {
895 sum += qlp_coeff[8] * data[i-9];
896 sum += qlp_coeff[7] * data[i-8];
897 sum += qlp_coeff[6] * data[i-7];
898 sum += qlp_coeff[5] * data[i-6];
899 sum += qlp_coeff[4] * data[i-5];
900 sum += qlp_coeff[3] * data[i-4];
901 sum += qlp_coeff[2] * data[i-3];
902 sum += qlp_coeff[1] * data[i-2];
903 sum += qlp_coeff[0] * data[i-1];
904 data[i] = residual[i] + (sum >> lp_quantization);
912 for(i = 0; i < (int)data_len; i++) {
914 sum += qlp_coeff[7] * data[i-8];
915 sum += qlp_coeff[6] * data[i-7];
916 sum += qlp_coeff[5] * data[i-6];
917 sum += qlp_coeff[4] * data[i-5];
918 sum += qlp_coeff[3] * data[i-4];
919 sum += qlp_coeff[2] * data[i-3];
920 sum += qlp_coeff[1] * data[i-2];
921 sum += qlp_coeff[0] * data[i-1];
922 data[i] = residual[i] + (sum >> lp_quantization);
926 for(i = 0; i < (int)data_len; i++) {
928 sum += qlp_coeff[6] * data[i-7];
929 sum += qlp_coeff[5] * data[i-6];
930 sum += qlp_coeff[4] * data[i-5];
931 sum += qlp_coeff[3] * data[i-4];
932 sum += qlp_coeff[2] * data[i-3];
933 sum += qlp_coeff[1] * data[i-2];
934 sum += qlp_coeff[0] * data[i-1];
935 data[i] = residual[i] + (sum >> lp_quantization);
941 for(i = 0; i < (int)data_len; i++) {
943 sum += qlp_coeff[5] * data[i-6];
944 sum += qlp_coeff[4] * data[i-5];
945 sum += qlp_coeff[3] * data[i-4];
946 sum += qlp_coeff[2] * data[i-3];
947 sum += qlp_coeff[1] * data[i-2];
948 sum += qlp_coeff[0] * data[i-1];
949 data[i] = residual[i] + (sum >> lp_quantization);
953 for(i = 0; i < (int)data_len; i++) {
955 sum += qlp_coeff[4] * data[i-5];
956 sum += qlp_coeff[3] * data[i-4];
957 sum += qlp_coeff[2] * data[i-3];
958 sum += qlp_coeff[1] * data[i-2];
959 sum += qlp_coeff[0] * data[i-1];
960 data[i] = residual[i] + (sum >> lp_quantization);
968 for(i = 0; i < (int)data_len; i++) {
970 sum += qlp_coeff[3] * data[i-4];
971 sum += qlp_coeff[2] * data[i-3];
972 sum += qlp_coeff[1] * data[i-2];
973 sum += qlp_coeff[0] * data[i-1];
974 data[i] = residual[i] + (sum >> lp_quantization);
978 for(i = 0; i < (int)data_len; i++) {
980 sum += qlp_coeff[2] * data[i-3];
981 sum += qlp_coeff[1] * data[i-2];
982 sum += qlp_coeff[0] * data[i-1];
983 data[i] = residual[i] + (sum >> lp_quantization);
989 for(i = 0; i < (int)data_len; i++) {
991 sum += qlp_coeff[1] * data[i-2];
992 sum += qlp_coeff[0] * data[i-1];
993 data[i] = residual[i] + (sum >> lp_quantization);
997 for(i = 0; i < (int)data_len; i++)
998 data[i] = residual[i] + ((qlp_coeff[0] * data[i-1]) >> lp_quantization);
1004 for(i = 0; i < (int)data_len; i++) {
1007 case 32: sum += qlp_coeff[31] * data[i-32];
1008 case 31: sum += qlp_coeff[30] * data[i-31];
1009 case 30: sum += qlp_coeff[29] * data[i-30];
1010 case 29: sum += qlp_coeff[28] * data[i-29];
1011 case 28: sum += qlp_coeff[27] * data[i-28];
1012 case 27: sum += qlp_coeff[26] * data[i-27];
1013 case 26: sum += qlp_coeff[25] * data[i-26];
1014 case 25: sum += qlp_coeff[24] * data[i-25];
1015 case 24: sum += qlp_coeff[23] * data[i-24];
1016 case 23: sum += qlp_coeff[22] * data[i-23];
1017 case 22: sum += qlp_coeff[21] * data[i-22];
1018 case 21: sum += qlp_coeff[20] * data[i-21];
1019 case 20: sum += qlp_coeff[19] * data[i-20];
1020 case 19: sum += qlp_coeff[18] * data[i-19];
1021 case 18: sum += qlp_coeff[17] * data[i-18];
1022 case 17: sum += qlp_coeff[16] * data[i-17];
1023 case 16: sum += qlp_coeff[15] * data[i-16];
1024 case 15: sum += qlp_coeff[14] * data[i-15];
1025 case 14: sum += qlp_coeff[13] * data[i-14];
1026 case 13: sum += qlp_coeff[12] * data[i-13];
1027 sum += qlp_coeff[11] * data[i-12];
1028 sum += qlp_coeff[10] * data[i-11];
1029 sum += qlp_coeff[ 9] * data[i-10];
1030 sum += qlp_coeff[ 8] * data[i- 9];
1031 sum += qlp_coeff[ 7] * data[i- 8];
1032 sum += qlp_coeff[ 6] * data[i- 7];
1033 sum += qlp_coeff[ 5] * data[i- 6];
1034 sum += qlp_coeff[ 4] * data[i- 5];
1035 sum += qlp_coeff[ 3] * data[i- 4];
1036 sum += qlp_coeff[ 2] * data[i- 3];
1037 sum += qlp_coeff[ 1] * data[i- 2];
1038 sum += qlp_coeff[ 0] * data[i- 1];
1040 data[i] = residual[i] + (sum >> lp_quantization);
1049 unsigned i, j; in FLAC__lpc_restore_signal_wide() local
1055 for(i=0;i<order;i++) in FLAC__lpc_restore_signal_wide()
1056 fprintf(stderr,", q[%u]=%d",i,qlp_coeff[i]); in FLAC__lpc_restore_signal_wide()
1061 for(i = 0; i < data_len; i++) { in FLAC__lpc_restore_signal_wide()
1065 sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history)); in FLAC__lpc_restore_signal_wide()
1067 …fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, sum=%" PRId64 "\n", i, (sum >> lp_q… in FLAC__lpc_restore_signal_wide()
1071 …derr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, residual=%d, sum=%" PRId64 ", data=%" PRId64 … in FLAC__lpc_restore_signal_wide()
1079 int i;
1094 for(i = 0; i < (int)data_len; i++) {
1096 sum += qlp_coeff[11] * (FLAC__int64)data[i-12];
1097 sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
1098 sum += qlp_coeff[9] * (FLAC__int64)data[i-10];
1099 sum += qlp_coeff[8] * (FLAC__int64)data[i-9];
1100 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
1101 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
1102 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
1103 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
1104 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1105 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1106 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1107 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1108 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1112 for(i = 0; i < (int)data_len; i++) {
1114 sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
1115 sum += qlp_coeff[9] * (FLAC__int64)data[i-10];
1116 sum += qlp_coeff[8] * (FLAC__int64)data[i-9];
1117 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
1118 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
1119 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
1120 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
1121 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1122 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1123 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1124 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1125 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1131 for(i = 0; i < (int)data_len; i++) {
1133 sum += qlp_coeff[9] * (FLAC__int64)data[i-10];
1134 sum += qlp_coeff[8] * (FLAC__int64)data[i-9];
1135 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
1136 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
1137 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
1138 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
1139 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1140 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1141 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1142 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1143 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1147 for(i = 0; i < (int)data_len; i++) {
1149 sum += qlp_coeff[8] * (FLAC__int64)data[i-9];
1150 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
1151 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
1152 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
1153 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
1154 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1155 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1156 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1157 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1158 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1166 for(i = 0; i < (int)data_len; i++) {
1168 sum += qlp_coeff[7] * (FLAC__int64)data[i-8];
1169 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
1170 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
1171 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
1172 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1173 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1174 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1175 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1176 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1180 for(i = 0; i < (int)data_len; i++) {
1182 sum += qlp_coeff[6] * (FLAC__int64)data[i-7];
1183 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
1184 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
1185 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1186 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1187 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1188 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1189 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1195 for(i = 0; i < (int)data_len; i++) {
1197 sum += qlp_coeff[5] * (FLAC__int64)data[i-6];
1198 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
1199 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1200 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1201 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1202 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1203 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1207 for(i = 0; i < (int)data_len; i++) {
1209 sum += qlp_coeff[4] * (FLAC__int64)data[i-5];
1210 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1211 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1212 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1213 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1214 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1222 for(i = 0; i < (int)data_len; i++) {
1224 sum += qlp_coeff[3] * (FLAC__int64)data[i-4];
1225 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1226 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1227 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1228 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1232 for(i = 0; i < (int)data_len; i++) {
1234 sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
1235 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1236 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1237 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1243 for(i = 0; i < (int)data_len; i++) {
1245 sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
1246 sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
1247 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1251 for(i = 0; i < (int)data_len; i++)
1252 … data[i] = residual[i] + (FLAC__int32)((qlp_coeff[0] * (FLAC__int64)data[i-1]) >> lp_quantization);
1258 for(i = 0; i < (int)data_len; i++) {
1261 case 32: sum += qlp_coeff[31] * (FLAC__int64)data[i-32];
1262 case 31: sum += qlp_coeff[30] * (FLAC__int64)data[i-31];
1263 case 30: sum += qlp_coeff[29] * (FLAC__int64)data[i-30];
1264 case 29: sum += qlp_coeff[28] * (FLAC__int64)data[i-29];
1265 case 28: sum += qlp_coeff[27] * (FLAC__int64)data[i-28];
1266 case 27: sum += qlp_coeff[26] * (FLAC__int64)data[i-27];
1267 case 26: sum += qlp_coeff[25] * (FLAC__int64)data[i-26];
1268 case 25: sum += qlp_coeff[24] * (FLAC__int64)data[i-25];
1269 case 24: sum += qlp_coeff[23] * (FLAC__int64)data[i-24];
1270 case 23: sum += qlp_coeff[22] * (FLAC__int64)data[i-23];
1271 case 22: sum += qlp_coeff[21] * (FLAC__int64)data[i-22];
1272 case 21: sum += qlp_coeff[20] * (FLAC__int64)data[i-21];
1273 case 20: sum += qlp_coeff[19] * (FLAC__int64)data[i-20];
1274 case 19: sum += qlp_coeff[18] * (FLAC__int64)data[i-19];
1275 case 18: sum += qlp_coeff[17] * (FLAC__int64)data[i-18];
1276 case 17: sum += qlp_coeff[16] * (FLAC__int64)data[i-17];
1277 case 16: sum += qlp_coeff[15] * (FLAC__int64)data[i-16];
1278 case 15: sum += qlp_coeff[14] * (FLAC__int64)data[i-15];
1279 case 14: sum += qlp_coeff[13] * (FLAC__int64)data[i-14];
1280 case 13: sum += qlp_coeff[12] * (FLAC__int64)data[i-13];
1281 sum += qlp_coeff[11] * (FLAC__int64)data[i-12];
1282 sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
1283 sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10];
1284 sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9];
1285 sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8];
1286 sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7];
1287 sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6];
1288 sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5];
1289 sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4];
1290 sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3];
1291 sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2];
1292 sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1];
1294 data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
1326 ….0) { /* error should not be negative but can happen due to inadequate floating-point resolution */ in FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale()
1336 …unsigned order, indx, best_index; /* 'index' the index into lpc_error; index==order-1 since lpc_er… in FLAC__lpc_compute_best_order()
1345 best_bits = (unsigned)(-1); in FLAC__lpc_compute_best_order()
1348 …th_error_scale(lpc_error[indx], error_scale) * (FLAC__double)(total_samples - order) + (FLAC__doub… in FLAC__lpc_compute_best_order()
1355 return best_index+1; /* +1 since indx of lpc_error[] is order-1 */ in FLAC__lpc_compute_best_order()