Formats: apply XMA scale factors in place #3783

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3783 into main
andrewpozdnakov7-jpg commented 2026-11-28 19:01:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T19:01:59Z.


Apply the XMA scale factors directly to the decoded coefficients before the inverse transform. The scale-factor bands cover the subframe, and coefficient decoding replaces those entries before the next subframe uses them. This removes the separate 512-sample workspace.

I compared 1,152 generated mono and stereo frames at four sample rates, three subframe lengths and three stereo transform patterns. All 1,053,696 PCM samples and 1,769,472 floating-point output-buffer words matched bit for bit. The optimized Windows x64 fixture's frame stack slot went from 7,240 to 5,192 bytes. The per-size median throughput ratios were 1.003x, 1.000x and 0.999x for 128, 256 and 512 samples.

The formats suite passed 46 tests with five benchmarks/reference tests ignored. Strict formats Clippy and the asset policy passed.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5543584782 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3783). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T19:01:59Z. --- Apply the XMA scale factors directly to the decoded coefficients before the inverse transform. The scale-factor bands cover the subframe, and coefficient decoding replaces those entries before the next subframe uses them. This removes the separate 512-sample workspace. I compared 1,152 generated mono and stereo frames at four sample rates, three subframe lengths and three stereo transform patterns. All 1,053,696 PCM samples and 1,769,472 floating-point output-buffer words matched bit for bit. The optimized Windows x64 fixture's frame stack slot went from 7,240 to 5,192 bytes. The per-size median throughput ratios were 1.003x, 1.000x and 0.999x for 128, 256 and 512 samples. The formats suite passed 46 tests with five benchmarks/reference tests ignored. Strict formats Clippy and the asset policy passed. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 19:06:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T19:06:48Z.


Windows CI passed on 31051ff, including both Clippy configurations and the workspace tests. All 1,053,696 generated PCM samples and 1,769,472 floating-point output-buffer words matched. The optimized Windows x64 fixture's frame stack allocation was 7,240 bytes before and 5,192 bytes after, with decoder throughput medians near 1.000x.

The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7244298385 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3783#issuecomment-7244298385). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T19:06:48Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46179016578/job/141084126134) passed on `31051ff`, including both Clippy configurations and the workspace tests. All 1,053,696 generated PCM samples and 1,769,472 floating-point output-buffer words matched. The optimized Windows x64 fixture's frame stack allocation was 7,240 bytes before and 5,192 bytes after, with decoder throughput medians near 1.000x. The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3783:upstream-pr/3783'
git switch 'upstream-pr/3783'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3783'
git switch 'upstream-pr/3783'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3783'
git switch 'upstream-pr/3783'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3783'
git switch 'main'
git merge --squash 'upstream-pr/3783'
git switch 'main'
git merge --ff-only 'upstream-pr/3783'
git switch 'main'
git merge 'upstream-pr/3783'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!3783
No description provided.