rockbox/lib/rbcodec/codecs/libffmpegFLAC/README.rockbox
Solomon Peachy a98a8ce131 FLAC: Conditionally increase MAX_BLOCKSIZE to 8KB
High-frequency files increasingly use a block size of over 4608B, which
means we need larger buffers to decode them.  However, larger buffers no
longer fit in IRAM on less-capable devices, hurting performance for
"normal" file playback.

On our slowest devices (M68K and PP-based devices), this is not worth
the tradeoff as they will likely not have enough CPU oomph to decode and
downmix these files in realtime.

S5L87xx-based devices have the raw performance to do this, so we decided
to err on the side of wider file compatibility at the cost of some
performance.

All other devices are unaffected.

Change-Id: I7344cf4c8c6b7b5c14f1ea67381160665d6ece5b
2025-09-08 22:51:46 -04:00

48 lines
1.9 KiB
Text

Library: libffmpegFLAC
Imported: 2005-10-26 by Dave Chapman
This directory contains a FLAC decoder based on the flac.c (and a small
number of other files) from the ffmpeg project.
LICENSING INFORMATION
ffmpeg is licensed under the Lesser GNU General Public License and the
file flac.c is Copyright 2003 Alex Beregszaszi.
IMPORT DETAILS
The decoder is based on ffmpeg-cvs from 26 October 2005.
The file libavcodec/flac.c was renamed to decoder.c and all ffmpeg
related code was removed. It was also heavily modified to remove
debugging information and unused experiemental code.
It was also changed to provide output as 32-bit integers (with the
data left-shifted to 28 bit accuracy). The original flac.c provided
16-bit output.
In order to minimise memory usage, a small number of hard-coded limits
are present in decoder.h - mainly limiting the supported blocksize
(number of samples in a frame) to 4608. This is the default value
used by the reference FLAC encoder at all standard compression
settings. However, it is increasingly common for high-resolution/freq
files to use 8K block sizes, so on devices that can play back such
files natively and/or have sufficient processor oomph to downmix in
realtime, we use that larger limit.
TESTING
A test program is contained in the file main.c and this should compile
in any Unix-like environment using the command "make -f Makefile.test".
Running "test file.flac" will decode the audio data to a WAV file
called "test.wav" in the current directory. This has been tested with
16-bit and 24-bit mono and stereo FLAC files.
This can be used to test the accuracy of the decoder by comparing the
md5sum of the WAV file produced by this decoder with a WAV file
produced by the official libFLAC decoder.
This test program could be extended to perform an internal md5sum
calculation and comparing that against the md5sum stored in the FLAC
file's header.