rockbox/lib/rbcodec
Michael Giacomelli 374f7c0334 flac: ARM assembly for the 64-bit LPC filter
Replaces flac_lpc_32_c, the wide predictor path every 24-bit stream
takes, and 16-bit streams encoded at high coefficient precision. The
coefficients are invariant for the whole call, but the C loop reloaded
all of them for every output sample and spilled its loop bound to the
stack on top of that. Orders 1-8 now keep every coefficient in a
register; orders 10 and 12, which is what -8 emits, get their own
unrolled loops instead of the generic chunked one. An ARMv5E kernel
using the packed 16-bit multiplies is included behind
FLAC_LPC32_NARROW_ASM, off by default: it needs bps <= 16, and only
about half the subframes of such a stream can use it.

Measured with test_codec on 24-bit/96kHz streams. At predictor order 12:
36.24 MHz on e200 (ARMv4) against 62.29 MHz before. The same file
improves from 37.65 MHz to 27.3 MHz on Clip+ (ARMv5).

Bit-exact against flac -d over four complete streams on both targets,
with and without the assembly, and the kernels are checked against an
int64_t reference across every order 1-32, qlevel 0-15 and coefficient
precision 1-15.

The rarely-executed orders stay in DRAM: the codec's IRAM window on
PP502x is nearly full and demoting them measured no cost, leaving 96
bytes free. FLAC_LPC32_NO_IRAM demotes the whole filter.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: Icd8bd298973b9f5c26c103af8adf47b03489d69f
2026-10-05 12:19:09 -04:00
..
codecs flac: ARM assembly for the 64-bit LPC filter 2026-10-05 12:19:09 -04:00
dsp dsp: Add missing .type <symbol>, %function to arm asm 2026-09-19 21:18:30 -04:00
metadata Add "rbfs" prefix to native filesystem functions 2026-09-17 16:22:31 -04:00
test warble: zero the mp3entry before reading metadata 2026-09-28 16:35:14 -04:00
platform.h firmware: refactor CACHEALIGN_BITS/SIZE defines 2026-03-06 14:49:00 +00:00
rbcodec.make rbcodec: Force use of -O2 for dsp code 2025-09-06 08:44:32 -04:00
rbcodecconfig-example.h Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
rbcodecplatform-unix.h Add "rbfs" prefix to native filesystem functions 2026-09-17 16:22:31 -04:00
SOURCES rbcodec dsp: Move dsp_sample_io_configure() to its own file 2022-12-22 17:20:14 -05:00