diff --git a/lib/rbcodec/codecs/libffmpegFLAC/README.rockbox b/lib/rbcodec/codecs/libffmpegFLAC/README.rockbox index 850cdfcb7d..14404665cb 100644 --- a/lib/rbcodec/codecs/libffmpegFLAC/README.rockbox +++ b/lib/rbcodec/codecs/libffmpegFLAC/README.rockbox @@ -25,8 +25,10 @@ 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. - +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 @@ -39,7 +41,7 @@ called "test.wav" in the current directory. This has been tested with 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. +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 diff --git a/lib/rbcodec/codecs/libffmpegFLAC/bitstream.h b/lib/rbcodec/codecs/libffmpegFLAC/bitstream.h index 159766e980..824991f57d 100644 --- a/lib/rbcodec/codecs/libffmpegFLAC/bitstream.h +++ b/lib/rbcodec/codecs/libffmpegFLAC/bitstream.h @@ -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 diff --git a/lib/rbcodec/codecs/libffmpegFLAC/decoder.h b/lib/rbcodec/codecs/libffmpegFLAC/decoder.h index 856bf65066..7d9d8953dd 100644 --- a/lib/rbcodec/codecs/libffmpegFLAC/decoder.h +++ b/lib/rbcodec/codecs/libffmpegFLAC/decoder.h @@ -4,7 +4,9 @@ #include "bitstream.h" #define MAX_CHANNELS 7 /* Maximum supported channels, only left/right will be played back */ +#ifndef MAX_BLOCKSIZE #define MAX_BLOCKSIZE 4608 /* Maxsize in samples of one uncompressed frame */ +#endif #define MAX_FRAMESIZE 65536 /* Maxsize in bytes of one compressed frame */ #define MIN_FRAME_SIZE 11 /* smallest valid FLAC frame possible */ diff --git a/manual/appendix/file_formats.tex b/manual/appendix/file_formats.tex index dd12993d36..ae3f321646 100644 --- a/manual/appendix/file_formats.tex +++ b/manual/appendix/file_formats.tex @@ -146,7 +146,10 @@ & Linear PCM 8/16/24/32 bit, IEEE float 32/64 bit, ITU-T G.711 a-law/$\mu$-law\\ Free Lossless Audio & \fname{.flac} - & Supports multichannel playback including downmixing to stereo.\\ + & Multichannel and/or high-resolution files will be downmixed to 16-bit stereo. + \opt{ipod,iriverh10,sansaclip,sansam200v4,sansac200v2,iriverh100,iriverh300,iaudiox5,iaudiom5,iaudiom3,mpiohd200,mpiphd300}{ + \nopt{ipodnano2g,ipod6g}{Due to resource constraints, files with large block sizes are not supported, and realtime playback may not be possible where downmixing is necessary.}} + \\ Apple Lossless & \fname{.m4a}, \fname{.mp4} & \\