mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Codecs: mp4: Disable SBR decoding for PP5002 - PP5022 platforms
Includes ipod video (5G) and earlier models, sansa c200 and others players not capable to decode AAC-HE. Allows to play backward compatible files as AAC-LC. Change-Id: Ic9f5c0f255d9a4308c3414d402f8f27f4328ca94
This commit is contained in:
parent
fc65bdab4e
commit
4cd65b9d97
7 changed files with 27 additions and 8 deletions
|
@ -300,3 +300,7 @@ clear_settings_on_hold
|
|||
#if defined(HAVE_PERCEPTUAL_VOLUME)
|
||||
perceptual_volume
|
||||
#endif
|
||||
|
||||
#if defined(CODEC_AAC_SBR_DEC)
|
||||
codec_aac_he
|
||||
#endif
|
||||
|
|
|
@ -601,6 +601,10 @@ Lyre prototype 1 */
|
|||
//#error "unknown hwardware platform!"
|
||||
#endif
|
||||
|
||||
#if !(CONFIG_CPU >= PP5002 && CONFIG_CPU <= PP5022) && CODEC_SIZE >= 0x80000
|
||||
#define CODEC_AAC_SBR_DEC
|
||||
#endif
|
||||
|
||||
#ifdef __PCTOOL__
|
||||
#undef CONFIG_CPU
|
||||
#define CONFIG_CPU 0
|
||||
|
|
|
@ -135,9 +135,11 @@ extern "C" {
|
|||
#undef ERROR_RESILIENCE
|
||||
#endif
|
||||
|
||||
#if CODEC_SIZE >= 0x80000
|
||||
#ifdef CODEC_AAC_SBR_DEC
|
||||
#define SBR_DEC
|
||||
//#define SBR_LOW_POWER /* Does not work yet in rockbox. */
|
||||
#endif
|
||||
#if CODEC_SIZE >= 0x80000
|
||||
#define PS_DEC
|
||||
#endif
|
||||
|
||||
|
|
|
@ -850,9 +850,13 @@ uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics,
|
|||
#if (defined(PS_DEC) || defined(DRM_PS))
|
||||
if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0))
|
||||
{
|
||||
uint8_t ele = hDecoder->fr_ch_ele;
|
||||
uint8_t ch = sce->channel;
|
||||
uint16_t frame_size = (hDecoder->sbr_alloced[ele]) ? 2 : 1;
|
||||
uint16_t frame_size =
|
||||
#ifdef SBR_DEC
|
||||
(hDecoder->sbr_alloced[hDecoder->fr_ch_ele]) ? 2 : 1;
|
||||
#else
|
||||
1;
|
||||
#endif
|
||||
frame_size *= hDecoder->frameLength*sizeof(real_t);
|
||||
|
||||
memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size);
|
||||
|
|
|
@ -93,11 +93,13 @@ bool get_aac_metadata(int fd, struct mp3entry *entry)
|
|||
break;
|
||||
}
|
||||
entry->bitrate = (unsigned int)((total * entry->frequency / frames + 64000) / 128000);
|
||||
#ifdef CODEC_AAC_SBR_DEC
|
||||
if (entry->frequency <= 24000)
|
||||
{
|
||||
entry->frequency <<= 1;
|
||||
entry->needs_upsampling_correction = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -349,7 +349,10 @@ static bool read_mp4_esds(int fd, struct mp3entry* id3, uint32_t* size)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CODEC_AAC_SBR_DEC
|
||||
//SBR_DEC is disabled so disable sbr implicit signalling
|
||||
sbr_signaled = true;
|
||||
#endif
|
||||
if (!sbr && !sbr_signaled && id3->frequency <= 24000)
|
||||
{
|
||||
/* As stated in libfaad/mp4.c AudioSpecificConfig2:
|
||||
|
|
|
@ -86,10 +86,10 @@
|
|||
& \fname{.adx}
|
||||
& Encrypted ADX is not supported.\\
|
||||
Advanced Audio Coding
|
||||
& \fname{.m4a}, \fname{.m4b}, \fname{.mp4}, \fname{.rm}, \fname{.ra}, \fname{.rmvb}
|
||||
\nopt{clipv1,c200v2}{
|
||||
& \fname{.aac}, \fname{.m4a}, \fname{.m4b}, \fname{.mp4}, \fname{.rm}, \fname{.ra}, \fname{.rmvb}
|
||||
\opt{codec_aac_he}{
|
||||
& Supports AAC-LC, -HEv1, and -HEv2 profiles\\}
|
||||
\opt{clipv1,c200v2}{ % low memory targets (CODEC_SIZE <= 512 KB)
|
||||
\nopt{codec_aac_he}{ % low memory (CODEC_SIZE <= 512 KB) or slow cpu targets
|
||||
& Supports AAC-LC profile\\}
|
||||
MPEG audio
|
||||
& \fname{.mpa}, \fname{.mpga}, \fname{.mp1}, \fname{.mp2}, \fname{.mp3}
|
||||
|
@ -122,7 +122,7 @@
|
|||
& \\
|
||||
\end{rbtabular}
|
||||
|
||||
\note{AAC-HE profiles might not play in realtime on all devices due to CPU
|
||||
\note{AAC-HE profiles \opt{codec_aac_he}{might not play in realtime on all devices}\nopt{codec_aac_he}{are disabled on this device} due to CPU
|
||||
performance requirements.}
|
||||
|
||||
\subsection{Lossless Codecs}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue