ref: 71532bd833e8aadf821731ac54f198adf82c3178
parent: b8890d11a26e65d4c81fd35155ad494e0583bb1d
author: Jean-Marc Valin <[email protected]>
date: Fri May 5 21:49:19 EDT 2017
Fix indexing
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -875,13 +875,13 @@
for (c=0;c<channels;c++) {
int i;
float lpc[LPC_ORDER];
- vorbis_lpc_from_data(x-channels*before, lpc, before, channels);
+ vorbis_lpc_from_data(x-channels*before+c, lpc, before, channels);
for (i=0;i<after;i++) {
float sum;
int j;
sum = 0;
- for (j=0;j<LPC_ORDER;j++) sum -= x[i-j-1]*lpc[j];
- x[i] = sum;
+ for (j=0;j<LPC_ORDER;j++) sum -= x[(i-j-1)*channels + c]*lpc[j];
+ x[i*channels + c] = sum;
}
}
}