rockbox/lib/rbcodec/codecs/libffmpegFLAC
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
..
arm.h flac: ARM assembly for the 64-bit LPC filter 2026-10-05 12:19:09 -04:00
arm.S flac: ARM assembly for the 64-bit LPC filter 2026-10-05 12:19:09 -04:00
bitstream.h flac: Fix build on Cowon D2. 2025-09-09 08:09:45 -04:00
coldfire.h Add codecs to librbcodec. 2012-04-25 22:13:20 +02:00
coldfire.S chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
COPYING Add codecs to librbcodec. 2012-04-25 22:13:20 +02:00
decoder.c flac: ARM assembly for the 64-bit LPC filter 2026-10-05 12:19:09 -04:00
decoder.h FLAC: Conditionally increase MAX_BLOCKSIZE to 8KB 2025-09-08 22:51:46 -04:00
golomb.h flac: decode residuals that use all 32 bits 2026-09-30 08:24:15 -04:00
libffmpegFLAC.make chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
README Add codecs to librbcodec. 2012-04-25 22:13:20 +02:00
README.rockbox FLAC: Conditionally increase MAX_BLOCKSIZE to 8KB 2025-09-08 22:51:46 -04:00
shndec.c Add codecs to librbcodec. 2012-04-25 22:13:20 +02:00
shndec.h Add codecs to librbcodec. 2012-04-25 22:13:20 +02:00
SOURCES codecs: disable incompatible ARM assembly for Cortex-M 2025-04-19 13:00:17 -04:00

FFmpeg README
-------------

1) Documentation
----------------

* Read the documentation in the doc/ directory.

2) Licensing
------------

* Read the file COPYING. ffmpeg and the associated libraries EXCEPT
  liba52 and libpostproc are licensed under the Lesser GNU General
  Public License. 

* liba52 and libpostproc are distributed under the GNU General Public
  License and their compilation and use is optional in ffmpeg.

Fabrice Bellard.