For AAC, do not enable SBR by default

This commit is contained in:
Philippe G
2021-05-08 23:39:30 -07:00
parent d4cd400cd9
commit 7b439ae6ee
5 changed files with 14 additions and 1 deletions

View File

@@ -2,9 +2,14 @@ idf_component_register(
INCLUDE_DIRS . ./inc inc/alac inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
)
if (DEFINED AAC_ENABLE_SBR)
add_prebuilt_library(libhelix-aac lib/libhelix-aac-sbr.a )
else ()
add_prebuilt_library(libhelix-aac lib/libhelix-aac.a )
endif()
add_prebuilt_library(libmad lib/libmad.a)
add_prebuilt_library(libFLAC lib/libFLAC.a )
add_prebuilt_library(libhelix-aac lib/libhelix-aac.a )
add_prebuilt_library(libvorbisidec lib/libvorbisidec.a )
add_prebuilt_library(libogg lib/libogg.a )
add_prebuilt_library(libalac lib/libalac.a )

Binary file not shown.

Binary file not shown.

View File

@@ -37,4 +37,8 @@ else()
add_definitions(-DRESAMPLE16 -DBYTES_PER_FRAME=4)
endif()
if (DEFINED AAC_ENABLE_SBR)
add_definitions(-DAAC_ENABLE_SBR)
endif()
add_compile_options (-O3 )

View File

@@ -160,6 +160,7 @@ static int read_mp4_header(unsigned long *samplerate_p, unsigned char *channels_
info.nChans = (*ptr & 0x7f) >> 3;
*channels_p = info.nChans;
// Note that 24 bits frequencies are not handled
#if AAC_ENABLE_SBR
if (AOT == 5 || AOT == 29) {
*samplerate_p = rates[((ptr[0] & 0x03) << 1) | (ptr[1] >> 7)];
LOG_WARN("AAC stream with SBR => high CPU required (use LMS proxied mode)");
@@ -172,6 +173,9 @@ static int read_mp4_header(unsigned long *samplerate_p, unsigned char *channels_
*samplerate_p = 44100;
LOG_ERROR("AAC audio object type %d not handled", AOT);
}
#else
*samplerate_p = info.sampRateCore;
#endif
HAAC(a, SetRawBlockParams, a->hAac, 0, &info);
LOG_DEBUG("playable aac track: %u (p:%x, r:%d, c:%d, desc_len:%d)", trak, AOT, info.sampRateCore, info.nChans, desc_len);
play = trak;