Skip to content

sbr: fix parameter resolution in VBR mode and transient normalization - #178

Merged
fabiangreffrath merged 1 commit into
knik0:masterfrom
nschimme:fix-sbr
Aug 25, 2026
Merged

sbr: fix parameter resolution in VBR mode and transient normalization#178
fabiangreffrath merged 1 commit into
knik0:masterfrom
nschimme:fix-sbr

Conversation

@nschimme

Copy link
Copy Markdown
Contributor

These are correctness fixes. Neutral performance.

When running in VBR quality mode (-q), hEncoder->config.bitRate is 0, causing SbrUpdate() to default to low amplitude and coarse frequency resolutions (bs_amp_res = 0, dk = 2). Derive an effective nominal stream bitrate from quantqual when bitRate is 0 so HE-AAC uses fine resolution parameters.

Also update SbrAnalyze() to normalize transientStrength using the total slot count (num_slots) rather than the decimated count (sampled), preventing transient strength scaling artifacts during decimation.

When running in VBR quality mode (-q), hEncoder->config.bitRate is 0,
causing SbrUpdate() to default to low amplitude and coarse frequency
resolutions (bs_amp_res = 0, dk = 2). Derive an effective nominal stream
bitrate from quantqual when bitRate is 0 so HE-AAC uses fine resolution
parameters.

Also update SbrAnalyze() to normalize transientStrength using the total
slot count (num_slots) rather than the decimated count (sampled), preventing
transient strength scaling artifacts during decimation.
@fabiangreffrath
fabiangreffrath merged commit ccb84c1 into knik0:master Aug 25, 2026
7 checks passed
@nschimme
nschimme deleted the fix-sbr branch August 28, 2026 15:39
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.

2 participants