fix: saturate eSBR QMF synthesis output - #134
Open
HansKeksnascher wants to merge 1 commit into
Open
HansKeksnascher wants to merge 1 commit into
HansKeksnascher wants to merge 1 commit into
Conversation
ixheaacd_esbr_qmfsyn64_winadd() and ixheaacd_esbr_qmfsyn32_winadd() in the generic C and ARMv7 paths cast (syn_out >> 31) straight to WORD32. The WORD64 accumulator can exceed WORD32 range on a full-scale sample, so the cast wraps it to a negative spike instead of clipping - audible as crackling / overdrive on loud material. The ARMv8 64-band implementation already does the saturating narrowing with ixheaac_sat64_32(). Apply the same to the generic C, ARMv7 C and ARMv8 32-band variants, and use VQSHRN.S64 instead of VSHRN.S64 in the ARMv7 assembly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sample_buffer[ch_fac*k] = (WORD32)(syn_out >> 31) wraps on full-scale samples (syn_out>>31 exceeds 2^31), giving a negative spike instead of clipping.
ARMv8 64-band already uses ixheaac_sat64_32(); the rest don't.
Found decoding a full-scale HE-AAC stream on x86_64; matches ffmpeg/faad after.