Skip to content

Commit 08f5ff0

Browse files
committed
Make IMDCT scaling a bit more conservative
Fixes 2941f08
1 parent c0eb2ca commit 08f5ff0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

celt/mdct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void clt_mdct_backward_c(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_sca
294294
maxval = MAX32(maxval, ABS32(in[i*stride]));
295295
sumval = ADD32_ovflw(sumval, ABS32(SHR32(in[i*stride],11)));
296296
}
297-
pre_shift = IMAX(0, 29-celt_ilog2(1+SHR32(maxval,2)*3));
297+
pre_shift = IMAX(0, 29-celt_zlog2(1+maxval));
298298
/* Worst-case where all the energy goes to a single sample. */
299299
post_shift = IMAX(0, 19-celt_ilog2(ABS32(sumval)));
300300
post_shift = IMIN(post_shift, pre_shift);

0 commit comments

Comments
 (0)