]> git.sesse.net Git - ffmpeg/commitdiff
ac3enc: do not clip coefficients after transforms
authorLynne <dev@lynne.ee>
Sat, 9 Jan 2021 08:05:18 +0000 (09:05 +0100)
committerLynne <dev@lynne.ee>
Thu, 14 Jan 2021 00:44:17 +0000 (01:44 +0100)
In either encoder, its impossible for the coefficients to go past 25 bits
right after the MDCT. Our MDCT is numerically stable.
For the floating point encoder, in case a NaN is contained, lrintf() will
raise a floating point exception during the conversion.

libavcodec/ac3enc_template.c

index de6eba71d88977dddeee11a5562bbc30bba19b23..4f1e181e0b4c6c8635cefff61f1e61c603c1ed17 100644 (file)
@@ -383,9 +383,6 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
 
     apply_mdct(s);
 
-    clip_coefficients(&s->adsp, s->blocks[0].mdct_coef[1],
-                      AC3_MAX_COEFS * s->num_blocks * s->channels);
-
     s->cpl_on = s->cpl_enabled;
     ff_ac3_compute_coupling_strategy(s);