1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Solomon Peachy 2025-09-08 21:09:12 -04:00
parent ebe961a2a8
commit a98a8ce131
4 changed files with 18 additions and 14 deletions

View file

@ -19,22 +19,13 @@
#endif
#if (CONFIG_CPU == MCF5250) || (CONFIG_CPU == PP5022) || \
(CONFIG_CPU == PP5024) || (CONFIG_CPU == S5L8702)
(CONFIG_CPU == PP5024)
#define ICODE_ATTR_FLAC ICODE_ATTR
#define IBSS_ATTR_FLAC IBSS_ATTR
/* Enough IRAM to move additional data to it. */
#define IBSS_ATTR_FLAC_LARGE_IRAM IBSS_ATTR
#define IBSS_ATTR_FLAC_XLARGE_IRAM
#define IBSS_ATTR_FLAC_XXLARGE_IRAM
#elif (CONFIG_CPU == S5L8700) || (CONFIG_CPU == S5L8701)
#define ICODE_ATTR_FLAC ICODE_ATTR
#define IBSS_ATTR_FLAC IBSS_ATTR
/* Enough IRAM to move even more additional data to it. */
#define IBSS_ATTR_FLAC_LARGE_IRAM IBSS_ATTR
#define IBSS_ATTR_FLAC_XLARGE_IRAM IBSS_ATTR
#define IBSS_ATTR_FLAC_XXLARGE_IRAM
#else
#define ICODE_ATTR_FLAC ICODE_ATTR
#define IBSS_ATTR_FLAC IBSS_ATTR
@ -44,6 +35,12 @@
#define IBSS_ATTR_FLAC_XXLARGE_IRAM
#endif
#if (ARCH == ARCH_M68K) || defined(CPU_PP) || MEMORYSIZE <= 2
#define MAX_BLOCKSIZE 4608
#else
#define MAX_BLOCKSIZE 8192
#endif
/* Endian conversion routines for standalone compilation */
#ifdef BUILD_STANDALONE
#ifdef BUILD_BIGENDIAN