summaryrefslogtreecommitdiffstats
path: root/libAACenc/src/aacenc_lib.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-14 17:32:17 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-14 17:32:17 +0100
commitee7be955947a0a591f42641419bf4a88953a77fb (patch)
treeef422756ae45ec9db4280bb0585f66a7beca72ef /libAACenc/src/aacenc_lib.cpp
parent2f29dd48d02d402169246e3c7f9256869817392a (diff)
downloadfdk-aac-dabplus-ee7be955947a0a591f42641419bf4a88953a77fb.tar.gz
fdk-aac-dabplus-ee7be955947a0a591f42641419bf4a88953a77fb.tar.bz2
fdk-aac-dabplus-ee7be955947a0a591f42641419bf4a88953a77fb.zip
Apply piratfm's first commit
It's the patch from commit e969ea8 AAC960 works now. All modes: LC/SBR/PS. Only for DAB+, not DRM. without the copyright headers that create a ton of merge conficts
Diffstat (limited to 'libAACenc/src/aacenc_lib.cpp')
-rw-r--r--libAACenc/src/aacenc_lib.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp
index 95c08b3..392a0a6 100644
--- a/libAACenc/src/aacenc_lib.cpp
+++ b/libAACenc/src/aacenc_lib.cpp
@@ -428,13 +428,16 @@ static void FDKaacEnc_MapConfig(
/* Map virtual aot to transport aot. */
switch (hAacConfig->audioObjectType) {
case AOT_MP2_AAC_LC:
+ case AOT_DABPLUS_AAC_LC:
transport_AOT = AOT_AAC_LC;
break;
case AOT_MP2_SBR:
+ case AOT_DABPLUS_SBR:
transport_AOT = AOT_SBR;
cc->flags |= CC_SBR;
break;
case AOT_MP2_PS:
+ case AOT_DABPLUS_PS:
transport_AOT = AOT_PS;
cc->flags |= CC_SBR;
break;
@@ -758,7 +761,7 @@ INT aacEncoder_LimitBitrate(
*
* \hAacEncoder Internal encoder config which is to be updated
* \param config User provided config (public struct)
- * \return ´returns always AAC_ENC_OK
+ * \return �returns always AAC_ENC_OK
*/
static
AACENC_ERROR FDKaacEnc_AdjustEncSettings(HANDLE_AACENCODER hAacEncoder,
@@ -798,10 +801,33 @@ AACENC_ERROR FDKaacEnc_AdjustEncSettings(HANDLE_AACENCODER hAacEncoder,
case AOT_PS:
config->userTpType = (config->userTpType!=TT_UNKNOWN) ? config->userTpType : TT_MP4_ADTS;
hAacConfig->framelength = (config->userFramelength!=(UINT)-1) ? config->userFramelength : 1024;
- if (hAacConfig->framelength != 1024) {
+ if (hAacConfig->framelength != 1024 && hAacConfig->framelength != 960) {
return AACENC_INVALID_CONFIG;
}
break;
+ case AOT_DABPLUS_SBR:
+ case AOT_DABPLUS_PS:
+ hAacConfig->syntaxFlags |= ((config->userSbrEnabled) ? AC_SBR_PRESENT : 0);
+ case AOT_DABPLUS_AAC_LC:
+ config->userTpType = (config->userTpType!=TT_UNKNOWN) ? config->userTpType : TT_MP4_RAW;
+ hAacConfig->framelength = (config->userFramelength!=(UINT)-1) ? config->userFramelength : 960;
+ if (hAacConfig->framelength != 960) {
+ return AACENC_INVALID_CONFIG;
+ }
+ break;
+#if 0
+ case AOT_ER_AAC_LC:
+ hAacConfig->epConfig = 0;
+ hAacConfig->syntaxFlags |= AC_ER;
+ hAacConfig->syntaxFlags |= ((config->userErTools & 0x1) ? AC_ER_VCB11 : 0);
+ hAacConfig->syntaxFlags |= ((config->userErTools & 0x2) ? AC_ER_HCR : 0);
+ config->userTpType = (config->userTpType!=TT_UNKNOWN) ? config->userTpType : TT_MP4_LOAS;
+ hAacConfig->framelength = (config->userFramelength!=(UINT)-1) ? config->userFramelength : 1024;
+ if (hAacConfig->framelength != 1024 && hAacConfig->framelength != 960) {
+ return AACENC_INVALID_CONFIG;
+ }
+ break;
+#endif
case AOT_ER_AAC_LD:
hAacConfig->epConfig = 0;
hAacConfig->syntaxFlags |= AC_ER|AC_LD;
@@ -1748,6 +1774,7 @@ AACENC_ERROR aacEncGetLibInfo(LIB_INFO *info)
/* Capability flags */
info[i].flags = 0
| CAPF_AAC_1024 | CAPF_AAC_LC
+ | CAPF_AAC_960
| CAPF_AAC_512
| CAPF_AAC_480
| CAPF_AAC_DRC
@@ -1780,18 +1807,22 @@ AACENC_ERROR aacEncoder_SetParam(
/* check if AOT matches the allocated modules */
switch ( value ) {
case AOT_PS:
+ case AOT_DRM_SBR: // Added mfeilen
+ case AOT_DABPLUS_PS:
case AOT_MP2_PS:
if (!(hAacEncoder->encoder_modis & (ENC_MODE_FLAG_PS))) {
err = AACENC_INVALID_CONFIG;
goto bail;
}
case AOT_SBR:
+ case AOT_DABPLUS_SBR:
case AOT_MP2_SBR:
if (!(hAacEncoder->encoder_modis & (ENC_MODE_FLAG_SBR))) {
err = AACENC_INVALID_CONFIG;
goto bail;
}
case AOT_AAC_LC:
+ case AOT_DABPLUS_AAC_LC:
case AOT_MP2_AAC_LC:
case AOT_ER_AAC_LD:
case AOT_ER_AAC_ELD:
@@ -1899,6 +1930,7 @@ AACENC_ERROR aacEncoder_SetParam(
if (settings->userFramelength != value) {
switch (value) {
case 1024:
+ case 960:
case 512:
case 480:
settings->userFramelength = value;