diff options
author | James Almer <jamrial@gmail.com> | 2024-05-31 09:38:27 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2024-05-31 13:36:02 -0300 |
commit | e0db1f51d6ddf9eb2c1314c23d063a29255b607a (patch) | |
tree | 7f0b3e6afd401245134a94c7b79d54a35f3c4ba0 /libavcodec/lpc.c | |
parent | 2f184aa89be8b92846cbbec3407a88ec7862358b (diff) | |
download | ffmpeg-e0db1f51d6ddf9eb2c1314c23d063a29255b607a.tar.gz |
avcodec/lpc: account for odd len values
Reviewed-by: RĂ©mi Denis-Courmont <remi@remlab.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/lpc.c')
-rw-r--r-- | libavcodec/lpc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c index dfd6114690..e793e54038 100644 --- a/libavcodec/lpc.c +++ b/libavcodec/lpc.c @@ -120,9 +120,8 @@ static void lpc_compute_autocorr_c(const double *data, ptrdiff_t len, int lag, if(j==lag){ double sum = 1.0; - for(i=j-1; i<len; i+=2){ - sum += data[i ] * data[i-j ] - + data[i+1] * data[i-j+1]; + for(i=j-1; i<len; i++){ + sum += data[i] * data[i-j]; } autoc[j] = sum; } |