Skip to content

fix: saturate eSBR QMF synthesis output - #134

Open
HansKeksnascher wants to merge 1 commit into
ittiam-systems:mainfrom
HansKeksnascher:fix/esbr-qmf-saturation
Open

HansKeksnascher wants to merge 1 commit into
ittiam-systems:mainfrom
HansKeksnascher:fix/esbr-qmf-saturation

Conversation

@HansKeksnascher

Copy link
Copy Markdown

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.

  • generic C (32+64), armv7 C (32), armv8 C (32): ixheaac_sat64_32()
  • armv7 asm (64): VSHRN.S64 -> VQSHRN.S64

Found decoding a full-scale HE-AAC stream on x86_64; matches ffmpeg/faad after.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant