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.
Patch attached.
>From e384c30349177bc792d070cb9c9a24fb6ac66950 Mon Sep 17 00:00:00 2001 From: Lynne <d...@lynne.ee> Date: Sat, 9 Jan 2021 09:05:18 +0100 Subject: [PATCH v2 2/5] ac3enc: do not clip coefficients after transforms 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 | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c index de6eba71d8..4f1e181e0b 100644 --- a/libavcodec/ac3enc_template.c +++ b/libavcodec/ac3enc_template.c @@ -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); -- 2.30.0.rc2
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".