You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/lpc: Fix lpc_apply_welch_window_c() for odd len
Also removes assert this fixes an assertion failure on non-x86 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -37,13 +37,19 @@ static void lpc_apply_welch_window_c(const int32_t *data, int len,
|
|||||||
double w;
|
double w;
|
||||||
double c;
|
double c;
|
||||||
|
|
||||||
/* The optimization in commit fa4ed8c does not support odd len.
|
|
||||||
* If someone wants odd len extend that change. */
|
|
||||||
av_assert2(!(len & 1));
|
|
||||||
|
|
||||||
n2 = (len >> 1);
|
n2 = (len >> 1);
|
||||||
c = 2.0 / (len - 1.0);
|
c = 2.0 / (len - 1.0);
|
||||||
|
|
||||||
|
if (len & 1) {
|
||||||
|
for(i=0; i<n2; i++) {
|
||||||
|
w = c - i - 1.0;
|
||||||
|
w = 1.0 - (w * w);
|
||||||
|
w_data[i] = data[i] * w;
|
||||||
|
w_data[len-1-i] = data[len-1-i] * w;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
w_data+=n2;
|
w_data+=n2;
|
||||||
data+=n2;
|
data+=n2;
|
||||||
for(i=0; i<n2; i++) {
|
for(i=0; i<n2; i++) {
|
||||||
|
Reference in New Issue
Block a user