rockbox/lib
Michael Giacomelli 8667af5cd7 atrac3: fix gain compensation at adjacent gain points
applyVariableGain() applied the constant gain before a gain point
in a do-while loop, so at least eight samples of it, even when
there are none: when the point is at the start of the block or
follows straight after the previous one. Every later gain point in
the block was then eight samples late. This came in with the loop
unrolling of 51a8be1a0f.

Use a while loop, as ffmpeg does.

Checked with perfsim (Sansa e200v1 build) against ffmpeg's decode.
Over the whole of atrac3_lp2_132.oma the SNR goes from 45 to 51 dB
and the worst frame from 14 to 21 dB; the right channel of a joint
stereo RM file goes from 37 to 54 dB. What is left is a noise floor
near -72 dBFS in every frame, from the 2 fractional bits the
decoder works with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 21:56:47 -04:00
..
arm_support chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
fixedpoint chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
libsetjmp libsetjmp: fix unpredictable behavior warning on ARM Cortex-M 2025-04-19 11:24:01 -04:00
microtar chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
mipsunwinder chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rbcodec atrac3: fix gain compensation at adjacent gain points 2026-10-06 21:56:47 -04:00
skin_parser skin_parser: Fix regression in 0d5afa6d 2026-07-05 19:12:25 -04:00
tlsf chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
unwarminder chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
utf8proc utf8proc: Add utf8proc for normalizing UTF-8 strings 2026-03-01 08:26:00 -05:00