aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.bp32
-rw-r--r--Android.mk60
-rw-r--r--libAACdec/src/aacdecoder_lib.cpp19
-rw-r--r--libAACdec/src/block.cpp3
-rw-r--r--libAACdec/src/rvlcconceal.cpp4
-rw-r--r--libAACenc/src/aacenc_lib.cpp2
-rw-r--r--libAACenc/src/adj_thr.cpp2
-rw-r--r--libAACenc/src/metadata_compressor.cpp50
-rw-r--r--libAACenc/src/metadata_main.cpp10
-rw-r--r--libFDK/src/FDK_tools_rom.cpp4
-rw-r--r--libFDK/src/dct.cpp16
-rw-r--r--libFDK/src/fixpoint_math.cpp50
-rw-r--r--libMpegTPDec/src/tpdec_asc.cpp23
-rw-r--r--libPCMutils/src/pcmutils_lib.cpp4
-rw-r--r--libSBRdec/src/env_calc.cpp2
-rw-r--r--libSBRdec/src/env_extr.cpp3
-rw-r--r--libSBRdec/src/sbr_rom.cpp2
-rw-r--r--libSBRenc/src/sbr_encoder.cpp6
18 files changed, 138 insertions, 154 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..75fe8af
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,32 @@
+cc_library_static {
+ name: "libFraunhoferAAC",
+ srcs: [
+ "libAACdec/src/*.cpp",
+ "libAACenc/src/*.cpp",
+ "libPCMutils/src/*.cpp",
+ "libFDK/src/*.cpp",
+ "libSYS/src/*.cpp",
+ "libMpegTPDec/src/*.cpp",
+ "libMpegTPEnc/src/*.cpp",
+ "libSBRdec/src/*.cpp",
+ "libSBRenc/src/*.cpp",
+ ],
+ cflags: [
+ "-Wno-sequence-point",
+ "-Wno-extra",
+ "-Wno-#warnings",
+ "-Wno-constant-logical-operand",
+ "-Wno-self-assign",
+ ],
+ export_include_dirs: [
+ "libAACdec/include",
+ "libAACenc/include",
+ "libPCMutils/include",
+ "libFDK/include",
+ "libSYS/include",
+ "libMpegTPDec/include",
+ "libMpegTPEnc/include",
+ "libSBRdec/include",
+ "libSBRenc/include",
+ ],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 4c28670..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-aacdec_sources := $(sort $(wildcard $(LOCAL_PATH)/libAACdec/src/*.cpp))
-aacdec_sources := $(aacdec_sources:$(LOCAL_PATH)/libAACdec/src/%=%)
-
-aacenc_sources := $(sort $(wildcard $(LOCAL_PATH)/libAACenc/src/*.cpp))
-aacenc_sources := $(aacenc_sources:$(LOCAL_PATH)/libAACenc/src/%=%)
-
-pcmutils_sources := $(sort $(wildcard $(LOCAL_PATH)/libPCMutils/src/*.cpp))
-pcmutils_sources := $(pcmutils_sources:$(LOCAL_PATH)/libPCMutils/src/%=%)
-
-fdk_sources := $(sort $(wildcard $(LOCAL_PATH)/libFDK/src/*.cpp))
-fdk_sources := $(fdk_sources:$(LOCAL_PATH)/libFDK/src/%=%)
-
-sys_sources := $(sort $(wildcard $(LOCAL_PATH)/libSYS/src/*.cpp))
-sys_sources := $(sys_sources:$(LOCAL_PATH)/libSYS/src/%=%)
-
-mpegtpdec_sources := $(sort $(wildcard $(LOCAL_PATH)/libMpegTPDec/src/*.cpp))
-mpegtpdec_sources := $(mpegtpdec_sources:$(LOCAL_PATH)/libMpegTPDec/src/%=%)
-
-mpegtpenc_sources := $(sort $(wildcard $(LOCAL_PATH)/libMpegTPEnc/src/*.cpp))
-mpegtpenc_sources := $(mpegtpenc_sources:$(LOCAL_PATH)/libMpegTPEnc/src/%=%)
-
-sbrdec_sources := $(sort $(wildcard $(LOCAL_PATH)/libSBRdec/src/*.cpp))
-sbrdec_sources := $(sbrdec_sources:$(LOCAL_PATH)/libSBRdec/src/%=%)
-
-sbrenc_sources := $(sort $(wildcard $(LOCAL_PATH)/libSBRenc/src/*.cpp))
-sbrenc_sources := $(sbrenc_sources:$(LOCAL_PATH)/libSBRenc/src/%=%)
-
-LOCAL_SRC_FILES := \
- $(aacdec_sources:%=libAACdec/src/%) \
- $(aacenc_sources:%=libAACenc/src/%) \
- $(pcmutils_sources:%=libPCMutils/src/%) \
- $(fdk_sources:%=libFDK/src/%) \
- $(sys_sources:%=libSYS/src/%) \
- $(mpegtpdec_sources:%=libMpegTPDec/src/%) \
- $(mpegtpenc_sources:%=libMpegTPEnc/src/%) \
- $(sbrdec_sources:%=libSBRdec/src/%) \
- $(sbrenc_sources:%=libSBRenc/src/%)
-
-LOCAL_CFLAGS += -Wno-sequence-point -Wno-extra
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/libAACdec/include \
- $(LOCAL_PATH)/libAACenc/include \
- $(LOCAL_PATH)/libPCMutils/include \
- $(LOCAL_PATH)/libFDK/include \
- $(LOCAL_PATH)/libSYS/include \
- $(LOCAL_PATH)/libMpegTPDec/include \
- $(LOCAL_PATH)/libMpegTPEnc/include \
- $(LOCAL_PATH)/libSBRdec/include \
- $(LOCAL_PATH)/libSBRenc/include
-
-
-LOCAL_CPPFLAGS += -std=c++98
-
-LOCAL_MODULE:= libFraunhoferAAC
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp
index 8863da5..50efb0f 100644
--- a/libAACdec/src/aacdecoder_lib.cpp
+++ b/libAACdec/src/aacdecoder_lib.cpp
@@ -791,36 +791,29 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(
const UINT flags)
{
AAC_DECODER_ERROR ErrorStatus;
- INT layer;
- INT nBits;
- INT interleaved = self->outputInterleaved;
- HANDLE_FDK_BITSTREAM hBs;
int fTpInterruption = 0; /* Transport originated interruption detection. */
int fTpConceal = 0; /* Transport originated concealment. */
- INT_PCM *pTimeData = NULL;
- INT timeDataSize = 0;
-
if (self == NULL) {
return AAC_DEC_INVALID_HANDLE;
}
-
- pTimeData = self->pcmOutputBuffer;
- timeDataSize = sizeof(self->pcmOutputBuffer)/sizeof(*self->pcmOutputBuffer);
+ INT interleaved = self->outputInterleaved;
+ INT_PCM *pTimeData = self->pcmOutputBuffer;
+ INT timeDataSize = sizeof(self->pcmOutputBuffer)/sizeof(*self->pcmOutputBuffer);
if (flags & AACDEC_INTR) {
self->streamInfo.numLostAccessUnits = 0;
}
- hBs = transportDec_GetBitstream(self->hInput, 0);
+ HANDLE_FDK_BITSTREAM hBs = transportDec_GetBitstream(self->hInput, 0);
/* Get current bits position for bitrate calculation. */
- nBits = FDKgetValidBits(hBs);
+ INT nBits = FDKgetValidBits(hBs);
if (! (flags & (AACDEC_CONCEAL | AACDEC_FLUSH) ) )
{
TRANSPORTDEC_ERROR err;
- for(layer = 0; layer < self->nrOfLayers; layer++)
+ for(INT layer = 0; layer < self->nrOfLayers; layer++)
{
err = transportDec_ReadAccessUnit(self->hInput, layer);
if (err != TRANSPORTDEC_OK) {
diff --git a/libAACdec/src/block.cpp b/libAACdec/src/block.cpp
index 2965fa6..a19284e 100644
--- a/libAACdec/src/block.cpp
+++ b/libAACdec/src/block.cpp
@@ -329,8 +329,7 @@ AAC_DECODER_ERROR CBlock_ReadSectionData(HANDLE_FDK_BITSTREAM bs,
}
pNumLinesInSec[numLinesInSecIdx] = BandOffsets[top] - BandOffsets[band];
numLinesInSecIdx++;
- if (
- (sect_cb == BOOKSCL) )
+ if (sect_cb == BOOKSCL)
{
return AAC_DEC_INVALID_CODE_BOOK;
} else {
diff --git a/libAACdec/src/rvlcconceal.cpp b/libAACdec/src/rvlcconceal.cpp
index ae6b4da..cf33dd5 100644
--- a/libAACdec/src/rvlcconceal.cpp
+++ b/libAACdec/src/rvlcconceal.cpp
@@ -459,7 +459,7 @@ void BidirectionalEstimation_UseScfOfPrevFrameAsReference (
break;
case NOISE_HCB:
- if ( (pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousCodebook[bnds]==NOISE_HCB) ) {
+ if ( pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousCodebook[bnds]==NOISE_HCB ) {
commonMin = FDKmin(pAacDecoderChannelInfo->pComData->overlay.aac.aRvlcScfFwd[bnds],pAacDecoderChannelInfo->pComData->overlay.aac.aRvlcScfBwd[bnds]);
pAacDecoderChannelInfo->pDynData->aScaleFactor[bnds] = FDKmin(commonMin, pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousScaleFactor[bnds]);
} else {
@@ -669,7 +669,7 @@ void PredictiveInterpolation (
break;
case NOISE_HCB:
- if ( (pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousCodebook[bnds]==NOISE_HCB) ) {
+ if ( pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousCodebook[bnds]==NOISE_HCB ) {
commonMin = FDKmin(pAacDecoderChannelInfo->pComData->overlay.aac.aRvlcScfFwd[bnds],pAacDecoderChannelInfo->pComData->overlay.aac.aRvlcScfBwd[bnds]);
pAacDecoderChannelInfo->pDynData->aScaleFactor[bnds] = FDKmin(commonMin, pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousScaleFactor[bnds]);
}
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp
index 2845177..64445b9 100644
--- a/libAACenc/src/aacenc_lib.cpp
+++ b/libAACenc/src/aacenc_lib.cpp
@@ -1037,7 +1037,7 @@ static AACENC_ERROR aacEncInit(HANDLE_AACENCODER hAacEncoder,
}
/* Clear input buffer */
- if ( (InitFlags == AACENC_INIT_ALL) ) {
+ if ( InitFlags == AACENC_INIT_ALL ) {
FDKmemclear(hAacEncoder->inputBuffer, sizeof(INT_PCM)*hAacEncoder->nMaxAacChannels*INPUTBUFFER_SIZE);
}
diff --git a/libAACenc/src/adj_thr.cpp b/libAACenc/src/adj_thr.cpp
index a79a9ae..09584f4 100644
--- a/libAACenc/src/adj_thr.cpp
+++ b/libAACenc/src/adj_thr.cpp
@@ -958,7 +958,7 @@ static FIXP_DBL FDKaacEnc_calcChaosMeasure(PSY_OUT_CHANNEL *psyOutChannel,
CalcInvLdData( (((CalcLdData(frameFormFactor)>>1) -
(CalcLdData(frameEnergy)>>(2+1))) -
(fMultDiv2(FL2FXCONST_DBL(0.75f),CalcLdData((FIXP_DBL)frameNLines<<(DFRACT_BITS-1-SCALE_NLINES))) -
- (((FIXP_DBL)(SCALE_FORM_FAC-SCALE_NRGS_SQRT4+FORM_FAC_SHIFT-(SCALE_NLINES_P34))<<(DFRACT_BITS-1-LD_DATA_SHIFT))>>1))
+ (((FIXP_DBL)(-((-SCALE_FORM_FAC+SCALE_NRGS_SQRT4-FORM_FAC_SHIFT+SCALE_NLINES_P34) << (DFRACT_BITS-1-LD_DATA_SHIFT))))>>1))
)<<1 );
} else {
diff --git a/libAACenc/src/metadata_compressor.cpp b/libAACenc/src/metadata_compressor.cpp
index 876de57..68a64ae 100644
--- a/libAACenc/src/metadata_compressor.cpp
+++ b/libAACenc/src/metadata_compressor.cpp
@@ -193,36 +193,36 @@ struct DRC_COMP {
* Profile tables.
*/
static const FIXP_DBL tabMaxBoostThr[] = {
- (FIXP_DBL)(-43<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-53<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-55<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-65<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-50<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-40<<METADATA_FRACT_BITS)
+ (FIXP_DBL)(int)((unsigned)-43<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-53<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-55<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-65<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-50<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-40<<METADATA_FRACT_BITS)
};
static const FIXP_DBL tabBoostThr[] = {
- (FIXP_DBL)(-31<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-41<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-31<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-41<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-31<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-31<<METADATA_FRACT_BITS)
+ (FIXP_DBL)(int)((unsigned)-31<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-41<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-31<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-41<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-31<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-31<<METADATA_FRACT_BITS)
};
static const FIXP_DBL tabEarlyCutThr[] = {
- (FIXP_DBL)(-26<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-21<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-26<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-21<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-26<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-20<<METADATA_FRACT_BITS)
+ (FIXP_DBL)(int)((unsigned)-26<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-21<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-26<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-21<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-26<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-20<<METADATA_FRACT_BITS)
};
static const FIXP_DBL tabCutThr[] = {
- (FIXP_DBL)(-16<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-11<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-16<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-21<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-16<<METADATA_FRACT_BITS),
- (FIXP_DBL)(-10<<METADATA_FRACT_BITS)
+ (FIXP_DBL)(int)((unsigned)-16<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-11<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-16<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-21<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-16<<METADATA_FRACT_BITS),
+ (FIXP_DBL)(int)((unsigned)-10<<METADATA_FRACT_BITS)
};
static const FIXP_DBL tabMaxCutThr[] = {
(FIXP_DBL)(4<<METADATA_FRACT_BITS),
@@ -576,7 +576,7 @@ INT FDK_DRC_Generator_Initialize(
drcComp->channels = channelMapping.nChannels;
/* Init states. */
- drcComp->smoothLevel[0] = drcComp->smoothLevel[1] = (FIXP_DBL)(-135<<METADATA_FRACT_BITS);
+ drcComp->smoothLevel[0] = drcComp->smoothLevel[1] = (FIXP_DBL)(int)((unsigned)-135<<METADATA_FRACT_BITS);
FDKmemclear(drcComp->smoothGain, sizeof(drcComp->smoothGain));
FDKmemclear(drcComp->holdCnt, sizeof(drcComp->holdCnt));
diff --git a/libAACenc/src/metadata_main.cpp b/libAACenc/src/metadata_main.cpp
index e920793..90f8f4e 100644
--- a/libAACenc/src/metadata_main.cpp
+++ b/libAACenc/src/metadata_main.cpp
@@ -488,14 +488,12 @@ static FDK_METADATA_ERROR ProcessCompressor(
{
FDK_METADATA_ERROR err = METADATA_OK;
- INT dynrng, compr;
- DRC_PROFILE profileDrc = convertProfile(pMetadata->mpegDrc.drc_profile);
- DRC_PROFILE profileComp = convertProfile(pMetadata->etsiAncData.comp_profile);
-
if ( (pMetadata==NULL) || (hDrcComp==NULL) ) {
err = METADATA_INVALID_HANDLE;
return err;
}
+ DRC_PROFILE profileDrc = convertProfile(pMetadata->mpegDrc.drc_profile);
+ DRC_PROFILE profileComp = convertProfile(pMetadata->etsiAncData.comp_profile);
/* first, check if profile is same as last frame
* otherwise, update setup */
@@ -511,8 +509,8 @@ static FDK_METADATA_ERROR ProcessCompressor(
}
/* in case of embedding external values, copy this now (limiter may overwrite them) */
- dynrng = decodeDynrng(pMetadata->mpegDrc.dyn_rng_ctl[0], pMetadata->mpegDrc.dyn_rng_sgn[0]);
- compr = decodeCompr(pMetadata->etsiAncData.compression_value);
+ INT dynrng = decodeDynrng(pMetadata->mpegDrc.dyn_rng_ctl[0], pMetadata->mpegDrc.dyn_rng_sgn[0]);
+ INT compr = decodeCompr(pMetadata->etsiAncData.compression_value);
/* Call compressor */
if (FDK_DRC_Generator_Calc(hDrcComp,
diff --git a/libFDK/src/FDK_tools_rom.cpp b/libFDK/src/FDK_tools_rom.cpp
index 29e37f2..f9121d1 100644
--- a/libFDK/src/FDK_tools_rom.cpp
+++ b/libFDK/src/FDK_tools_rom.cpp
@@ -1260,9 +1260,9 @@ const FIXP_WTP * FDKgetWindowSlope(int length, int shape)
#define QTCFL(x) FL2FXCONST_SGL(x)
#define QTC(x) FX_DBL2FXCONST_SGL(x)
#else
-#define QFC(x) (x)
+#define QFC(x) ((FIXP_DBL)(x))
#define QTCFL(x) FL2FXCONST_DBL(x)
-#define QTC(x) (x)
+#define QTC(x) ((FIXP_DBL)(x))
#endif /* ARCH_PREFER_MULT_32x16 */
#ifndef LOW_POWER_SBR_ONLY
diff --git a/libFDK/src/dct.cpp b/libFDK/src/dct.cpp
index 3c755bd..1e5b93e 100644
--- a/libFDK/src/dct.cpp
+++ b/libFDK/src/dct.cpp
@@ -324,12 +324,12 @@ void dct_IV(FIXP_DBL *pDat,
{
FIXP_DBL *RESTRICT pDat_0 = &pDat[0];
FIXP_DBL *RESTRICT pDat_1 = &pDat[L - 2];
- register int i;
+ int i;
/* 29 cycles on ARM926 */
for (i = 0; i < M-1; i+=2,pDat_0+=2,pDat_1-=2)
{
- register FIXP_DBL accu1,accu2,accu3,accu4;
+ FIXP_DBL accu1,accu2,accu3,accu4;
accu1 = pDat_1[1]; accu2 = pDat_0[0];
accu3 = pDat_0[1]; accu4 = pDat_1[0];
@@ -342,7 +342,7 @@ void dct_IV(FIXP_DBL *pDat,
}
if (M&1)
{
- register FIXP_DBL accu1,accu2;
+ FIXP_DBL accu1,accu2;
accu1 = pDat_1[1]; accu2 = pDat_0[0];
@@ -363,7 +363,7 @@ void dct_IV(FIXP_DBL *pDat,
{
FIXP_DBL *RESTRICT pDat_0 = &pDat[0];
FIXP_DBL *RESTRICT pDat_1 = &pDat[L - 2];
- register FIXP_DBL accu1,accu2,accu3,accu4;
+ FIXP_DBL accu1,accu2,accu3,accu4;
int idx, i;
/* Sin and Cos values are 0.0f and 1.0f */
@@ -450,12 +450,12 @@ void dst_IV(FIXP_DBL *pDat,
FIXP_DBL *RESTRICT pDat_0 = &pDat[0];
FIXP_DBL *RESTRICT pDat_1 = &pDat[L - 2];
- register int i;
+ int i;
/* 34 cycles on ARM926 */
for (i = 0; i < M-1; i+=2,pDat_0+=2,pDat_1-=2)
{
- register FIXP_DBL accu1,accu2,accu3,accu4;
+ FIXP_DBL accu1,accu2,accu3,accu4;
accu1 = pDat_1[1]; accu2 = -pDat_0[0];
accu3 = pDat_0[1]; accu4 = -pDat_1[0];
@@ -468,7 +468,7 @@ void dst_IV(FIXP_DBL *pDat,
}
if (M&1)
{
- register FIXP_DBL accu1,accu2;
+ FIXP_DBL accu1,accu2;
accu1 = pDat_1[1]; accu2 = -pDat_0[0];
@@ -488,7 +488,7 @@ void dst_IV(FIXP_DBL *pDat,
{
FIXP_DBL *RESTRICT pDat_0;
FIXP_DBL *RESTRICT pDat_1;
- register FIXP_DBL accu1,accu2,accu3,accu4;
+ FIXP_DBL accu1,accu2,accu3,accu4;
int idx, i;
pDat_0 = &pDat[0];
diff --git a/libFDK/src/fixpoint_math.cpp b/libFDK/src/fixpoint_math.cpp
index 30283ff..1bf9366 100644
--- a/libFDK/src/fixpoint_math.cpp
+++ b/libFDK/src/fixpoint_math.cpp
@@ -322,31 +322,31 @@ LNK_SECTION_CODE_L1 FIXP_DBL CalcInvLdData(FIXP_DBL x)
LNK_SECTION_CONSTDATA_L1
static const FIXP_DBL ldIntCoeff[] = {
- 0x80000001, 0x00000000, 0x02000000, 0x032b8034, 0x04000000, 0x04a4d3c2, 0x052b8034, 0x059d5da0,
- 0x06000000, 0x06570069, 0x06a4d3c2, 0x06eb3a9f, 0x072b8034, 0x0766a009, 0x079d5da0, 0x07d053f7,
- 0x08000000, 0x082cc7ee, 0x08570069, 0x087ef05b, 0x08a4d3c2, 0x08c8ddd4, 0x08eb3a9f, 0x090c1050,
- 0x092b8034, 0x0949a785, 0x0966a009, 0x0982809d, 0x099d5da0, 0x09b74949, 0x09d053f7, 0x09e88c6b,
- 0x0a000000, 0x0a16bad3, 0x0a2cc7ee, 0x0a423162, 0x0a570069, 0x0a6b3d79, 0x0a7ef05b, 0x0a92203d,
- 0x0aa4d3c2, 0x0ab7110e, 0x0ac8ddd4, 0x0ada3f60, 0x0aeb3a9f, 0x0afbd42b, 0x0b0c1050, 0x0b1bf312,
- 0x0b2b8034, 0x0b3abb40, 0x0b49a785, 0x0b584822, 0x0b66a009, 0x0b74b1fd, 0x0b82809d, 0x0b900e61,
- 0x0b9d5da0, 0x0baa708f, 0x0bb74949, 0x0bc3e9ca, 0x0bd053f7, 0x0bdc899b, 0x0be88c6b, 0x0bf45e09,
- 0x0c000000, 0x0c0b73cb, 0x0c16bad3, 0x0c21d671, 0x0c2cc7ee, 0x0c379085, 0x0c423162, 0x0c4caba8,
- 0x0c570069, 0x0c6130af, 0x0c6b3d79, 0x0c7527b9, 0x0c7ef05b, 0x0c88983f, 0x0c92203d, 0x0c9b8926,
- 0x0ca4d3c2, 0x0cae00d2, 0x0cb7110e, 0x0cc0052b, 0x0cc8ddd4, 0x0cd19bb0, 0x0cda3f60, 0x0ce2c97d,
- 0x0ceb3a9f, 0x0cf39355, 0x0cfbd42b, 0x0d03fda9, 0x0d0c1050, 0x0d140ca0, 0x0d1bf312, 0x0d23c41d,
- 0x0d2b8034, 0x0d3327c7, 0x0d3abb40, 0x0d423b08, 0x0d49a785, 0x0d510118, 0x0d584822, 0x0d5f7cff,
- 0x0d66a009, 0x0d6db197, 0x0d74b1fd, 0x0d7ba190, 0x0d82809d, 0x0d894f75, 0x0d900e61, 0x0d96bdad,
- 0x0d9d5da0, 0x0da3ee7f, 0x0daa708f, 0x0db0e412, 0x0db74949, 0x0dbda072, 0x0dc3e9ca, 0x0dca258e,
- 0x0dd053f7, 0x0dd6753e, 0x0ddc899b, 0x0de29143, 0x0de88c6b, 0x0dee7b47, 0x0df45e09, 0x0dfa34e1,
- 0x0e000000, 0x0e05bf94, 0x0e0b73cb, 0x0e111cd2, 0x0e16bad3, 0x0e1c4dfb, 0x0e21d671, 0x0e275460,
- 0x0e2cc7ee, 0x0e323143, 0x0e379085, 0x0e3ce5d8, 0x0e423162, 0x0e477346, 0x0e4caba8, 0x0e51daa8,
- 0x0e570069, 0x0e5c1d0b, 0x0e6130af, 0x0e663b74, 0x0e6b3d79, 0x0e7036db, 0x0e7527b9, 0x0e7a1030,
- 0x0e7ef05b, 0x0e83c857, 0x0e88983f, 0x0e8d602e, 0x0e92203d, 0x0e96d888, 0x0e9b8926, 0x0ea03232,
- 0x0ea4d3c2, 0x0ea96df0, 0x0eae00d2, 0x0eb28c7f, 0x0eb7110e, 0x0ebb8e96, 0x0ec0052b, 0x0ec474e4,
- 0x0ec8ddd4, 0x0ecd4012, 0x0ed19bb0, 0x0ed5f0c4, 0x0eda3f60, 0x0ede8797, 0x0ee2c97d, 0x0ee70525,
- 0x0eeb3a9f, 0x0eef69ff, 0x0ef39355, 0x0ef7b6b4, 0x0efbd42b, 0x0effebcd, 0x0f03fda9, 0x0f0809cf,
- 0x0f0c1050, 0x0f10113b, 0x0f140ca0, 0x0f18028d, 0x0f1bf312, 0x0f1fde3d, 0x0f23c41d, 0x0f27a4c0,
- 0x0f2b8034
+ (FIXP_DBL)0x80000001, (FIXP_DBL)0x00000000, (FIXP_DBL)0x02000000, (FIXP_DBL)0x032b8034, (FIXP_DBL)0x04000000, (FIXP_DBL)0x04a4d3c2, (FIXP_DBL)0x052b8034, (FIXP_DBL)0x059d5da0,
+ (FIXP_DBL)0x06000000, (FIXP_DBL)0x06570069, (FIXP_DBL)0x06a4d3c2, (FIXP_DBL)0x06eb3a9f, (FIXP_DBL)0x072b8034, (FIXP_DBL)0x0766a009, (FIXP_DBL)0x079d5da0, (FIXP_DBL)0x07d053f7,
+ (FIXP_DBL)0x08000000, (FIXP_DBL)0x082cc7ee, (FIXP_DBL)0x08570069, (FIXP_DBL)0x087ef05b, (FIXP_DBL)0x08a4d3c2, (FIXP_DBL)0x08c8ddd4, (FIXP_DBL)0x08eb3a9f, (FIXP_DBL)0x090c1050,
+ (FIXP_DBL)0x092b8034, (FIXP_DBL)0x0949a785, (FIXP_DBL)0x0966a009, (FIXP_DBL)0x0982809d, (FIXP_DBL)0x099d5da0, (FIXP_DBL)0x09b74949, (FIXP_DBL)0x09d053f7, (FIXP_DBL)0x09e88c6b,
+ (FIXP_DBL)0x0a000000, (FIXP_DBL)0x0a16bad3, (FIXP_DBL)0x0a2cc7ee, (FIXP_DBL)0x0a423162, (FIXP_DBL)0x0a570069, (FIXP_DBL)0x0a6b3d79, (FIXP_DBL)0x0a7ef05b, (FIXP_DBL)0x0a92203d,
+ (FIXP_DBL)0x0aa4d3c2, (FIXP_DBL)0x0ab7110e, (FIXP_DBL)0x0ac8ddd4, (FIXP_DBL)0x0ada3f60, (FIXP_DBL)0x0aeb3a9f, (FIXP_DBL)0x0afbd42b, (FIXP_DBL)0x0b0c1050, (FIXP_DBL)0x0b1bf312,
+ (FIXP_DBL)0x0b2b8034, (FIXP_DBL)0x0b3abb40, (FIXP_DBL)0x0b49a785, (FIXP_DBL)0x0b584822, (FIXP_DBL)0x0b66a009, (FIXP_DBL)0x0b74b1fd, (FIXP_DBL)0x0b82809d, (FIXP_DBL)0x0b900e61,
+ (FIXP_DBL)0x0b9d5da0, (FIXP_DBL)0x0baa708f, (FIXP_DBL)0x0bb74949, (FIXP_DBL)0x0bc3e9ca, (FIXP_DBL)0x0bd053f7, (FIXP_DBL)0x0bdc899b, (FIXP_DBL)0x0be88c6b, (FIXP_DBL)0x0bf45e09,
+ (FIXP_DBL)0x0c000000, (FIXP_DBL)0x0c0b73cb, (FIXP_DBL)0x0c16bad3, (FIXP_DBL)0x0c21d671, (FIXP_DBL)0x0c2cc7ee, (FIXP_DBL)0x0c379085, (FIXP_DBL)0x0c423162, (FIXP_DBL)0x0c4caba8,
+ (FIXP_DBL)0x0c570069, (FIXP_DBL)0x0c6130af, (FIXP_DBL)0x0c6b3d79, (FIXP_DBL)0x0c7527b9, (FIXP_DBL)0x0c7ef05b, (FIXP_DBL)0x0c88983f, (FIXP_DBL)0x0c92203d, (FIXP_DBL)0x0c9b8926,
+ (FIXP_DBL)0x0ca4d3c2, (FIXP_DBL)0x0cae00d2, (FIXP_DBL)0x0cb7110e, (FIXP_DBL)0x0cc0052b, (FIXP_DBL)0x0cc8ddd4, (FIXP_DBL)0x0cd19bb0, (FIXP_DBL)0x0cda3f60, (FIXP_DBL)0x0ce2c97d,
+ (FIXP_DBL)0x0ceb3a9f, (FIXP_DBL)0x0cf39355, (FIXP_DBL)0x0cfbd42b, (FIXP_DBL)0x0d03fda9, (FIXP_DBL)0x0d0c1050, (FIXP_DBL)0x0d140ca0, (FIXP_DBL)0x0d1bf312, (FIXP_DBL)0x0d23c41d,
+ (FIXP_DBL)0x0d2b8034, (FIXP_DBL)0x0d3327c7, (FIXP_DBL)0x0d3abb40, (FIXP_DBL)0x0d423b08, (FIXP_DBL)0x0d49a785, (FIXP_DBL)0x0d510118, (FIXP_DBL)0x0d584822, (FIXP_DBL)0x0d5f7cff,
+ (FIXP_DBL)0x0d66a009, (FIXP_DBL)0x0d6db197, (FIXP_DBL)0x0d74b1fd, (FIXP_DBL)0x0d7ba190, (FIXP_DBL)0x0d82809d, (FIXP_DBL)0x0d894f75, (FIXP_DBL)0x0d900e61, (FIXP_DBL)0x0d96bdad,
+ (FIXP_DBL)0x0d9d5da0, (FIXP_DBL)0x0da3ee7f, (FIXP_DBL)0x0daa708f, (FIXP_DBL)0x0db0e412, (FIXP_DBL)0x0db74949, (FIXP_DBL)0x0dbda072, (FIXP_DBL)0x0dc3e9ca, (FIXP_DBL)0x0dca258e,
+ (FIXP_DBL)0x0dd053f7, (FIXP_DBL)0x0dd6753e, (FIXP_DBL)0x0ddc899b, (FIXP_DBL)0x0de29143, (FIXP_DBL)0x0de88c6b, (FIXP_DBL)0x0dee7b47, (FIXP_DBL)0x0df45e09, (FIXP_DBL)0x0dfa34e1,
+ (FIXP_DBL)0x0e000000, (FIXP_DBL)0x0e05bf94, (FIXP_DBL)0x0e0b73cb, (FIXP_DBL)0x0e111cd2, (FIXP_DBL)0x0e16bad3, (FIXP_DBL)0x0e1c4dfb, (FIXP_DBL)0x0e21d671, (FIXP_DBL)0x0e275460,
+ (FIXP_DBL)0x0e2cc7ee, (FIXP_DBL)0x0e323143, (FIXP_DBL)0x0e379085, (FIXP_DBL)0x0e3ce5d8, (FIXP_DBL)0x0e423162, (FIXP_DBL)0x0e477346, (FIXP_DBL)0x0e4caba8, (FIXP_DBL)0x0e51daa8,
+ (FIXP_DBL)0x0e570069, (FIXP_DBL)0x0e5c1d0b, (FIXP_DBL)0x0e6130af, (FIXP_DBL)0x0e663b74, (FIXP_DBL)0x0e6b3d79, (FIXP_DBL)0x0e7036db, (FIXP_DBL)0x0e7527b9, (FIXP_DBL)0x0e7a1030,
+ (FIXP_DBL)0x0e7ef05b, (FIXP_DBL)0x0e83c857, (FIXP_DBL)0x0e88983f, (FIXP_DBL)0x0e8d602e, (FIXP_DBL)0x0e92203d, (FIXP_DBL)0x0e96d888, (FIXP_DBL)0x0e9b8926, (FIXP_DBL)0x0ea03232,
+ (FIXP_DBL)0x0ea4d3c2, (FIXP_DBL)0x0ea96df0, (FIXP_DBL)0x0eae00d2, (FIXP_DBL)0x0eb28c7f, (FIXP_DBL)0x0eb7110e, (FIXP_DBL)0x0ebb8e96, (FIXP_DBL)0x0ec0052b, (FIXP_DBL)0x0ec474e4,
+ (FIXP_DBL)0x0ec8ddd4, (FIXP_DBL)0x0ecd4012, (FIXP_DBL)0x0ed19bb0, (FIXP_DBL)0x0ed5f0c4, (FIXP_DBL)0x0eda3f60, (FIXP_DBL)0x0ede8797, (FIXP_DBL)0x0ee2c97d, (FIXP_DBL)0x0ee70525,
+ (FIXP_DBL)0x0eeb3a9f, (FIXP_DBL)0x0eef69ff, (FIXP_DBL)0x0ef39355, (FIXP_DBL)0x0ef7b6b4, (FIXP_DBL)0x0efbd42b, (FIXP_DBL)0x0effebcd, (FIXP_DBL)0x0f03fda9, (FIXP_DBL)0x0f0809cf,
+ (FIXP_DBL)0x0f0c1050, (FIXP_DBL)0x0f10113b, (FIXP_DBL)0x0f140ca0, (FIXP_DBL)0x0f18028d, (FIXP_DBL)0x0f1bf312, (FIXP_DBL)0x0f1fde3d, (FIXP_DBL)0x0f23c41d, (FIXP_DBL)0x0f27a4c0,
+ (FIXP_DBL)0x0f2b8034
};
diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp
index 96a1b35..e80d0e5 100644
--- a/libMpegTPDec/src/tpdec_asc.cpp
+++ b/libMpegTPDec/src/tpdec_asc.cpp
@@ -118,7 +118,9 @@ int CProgramConfig_IsValid ( const CProgramConfig *pPce )
/*
* Read the extension for height info.
- * return 0 if successfull or -1 if the CRC failed.
+ * return 0 if successfull,
+ * -1 if the CRC failed,
+ * -2 if invalid HeightInfo.
*/
static
int CProgramConfig_ReadHeightExt(
@@ -146,15 +148,21 @@ int CProgramConfig_ReadHeightExt(
for (i=0; i < pPce->NumFrontChannelElements; i++)
{
- pPce->FrontElementHeightInfo[i] = (UCHAR) FDKreadBits(bs,2);
+ if ((pPce->FrontElementHeightInfo[i] = (UCHAR) FDKreadBits(bs,2)) >= PC_NUM_HEIGHT_LAYER) {
+ err = -2; /* height information is out of the valid range */
+ }
}
for (i=0; i < pPce->NumSideChannelElements; i++)
{
- pPce->SideElementHeightInfo[i] = (UCHAR) FDKreadBits(bs,2);
+ if ((pPce->SideElementHeightInfo[i] = (UCHAR) FDKreadBits(bs,2)) >= PC_NUM_HEIGHT_LAYER) {
+ err = -2; /* height information is out of the valid range */
+ }
}
for (i=0; i < pPce->NumBackChannelElements; i++)
{
- pPce->BackElementHeightInfo[i] = (UCHAR) FDKreadBits(bs,2);
+ if ((pPce->BackElementHeightInfo[i] = (UCHAR) FDKreadBits(bs,2)) >= PC_NUM_HEIGHT_LAYER) {
+ err = -2; /* height information is out of the valid range */
+ }
}
FDKbyteAlign(bs, alignmentAnchor);
@@ -163,6 +171,13 @@ int CProgramConfig_ReadHeightExt(
/* CRC failed */
err = -1;
}
+ if (err!=0) {
+ /* Reset whole height information in case an error occured during parsing. The return
+ value ensures that pPce->isValid is set to 0 and implicit channel mapping is used. */
+ FDKmemclear(pPce->FrontElementHeightInfo, sizeof(pPce->FrontElementHeightInfo));
+ FDKmemclear(pPce->SideElementHeightInfo, sizeof(pPce->SideElementHeightInfo));
+ FDKmemclear(pPce->BackElementHeightInfo, sizeof(pPce->BackElementHeightInfo));
+ }
}
else {
/* No valid extension data found -> restore the initial bitbuffer state */
diff --git a/libPCMutils/src/pcmutils_lib.cpp b/libPCMutils/src/pcmutils_lib.cpp
index e6ac3ff..9303d16 100644
--- a/libPCMutils/src/pcmutils_lib.cpp
+++ b/libPCMutils/src/pcmutils_lib.cpp
@@ -88,7 +88,9 @@ amm-info@iis.fraunhofer.de
expansion in the PCM time domain.
*******************************************************************************/
+#ifndef __linux__
#include <log/log.h>
+#endif
#include "pcmutils_lib.h"
#include "genericStds.h"
@@ -2079,7 +2081,9 @@ PCMDMX_ERROR pcmDmx_ApplyFrame (
}
}
if (ch != numInChannels) {
+#ifndef __linux__
ALOGE("b/23876444");
+#endif
return PCMDMX_INVALID_ARGUMENT;
}
diff --git a/libSBRdec/src/env_calc.cpp b/libSBRdec/src/env_calc.cpp
index fa5330a..73bd7ba 100644
--- a/libSBRdec/src/env_calc.cpp
+++ b/libSBRdec/src/env_calc.cpp
@@ -2031,7 +2031,7 @@ static void adjustTimeSlotHQ(
FIXP_SGL direct_ratio = /*FL2FXCONST_SGL(1.0f) */ (FIXP_SGL)MAXVAL_SGL - smooth_ratio;
int index = *ptrPhaseIndex;
UCHAR harmIndex = *ptrHarmIndex;
- register int freqInvFlag = (lowSubband & 1);
+ int freqInvFlag = (lowSubband & 1);
FIXP_DBL sineLevel;
int shift;
diff --git a/libSBRdec/src/env_extr.cpp b/libSBRdec/src/env_extr.cpp
index dacd951..4d53a13 100644
--- a/libSBRdec/src/env_extr.cpp
+++ b/libSBRdec/src/env_extr.cpp
@@ -904,6 +904,9 @@ static const FRAME_INFO v_frame_info4_8 = { 0, 4, {0, 2, 4, 6, 8}, {1, 1, 1, 1},
break;
default:
FDK_ASSERT(0);
+ /* in case assertion checks are disabled, force a definite memory fault at first access */
+ pTable = NULL;
+ break;
}
/* look number of envelopes in table */
diff --git a/libSBRdec/src/sbr_rom.cpp b/libSBRdec/src/sbr_rom.cpp
index c48ce35..4f2cc48 100644
--- a/libSBRdec/src/sbr_rom.cpp
+++ b/libSBRdec/src/sbr_rom.cpp
@@ -1185,7 +1185,7 @@ const FIXP_DBL Alphas[NO_ICC_LEVELS] = {
#define FL2FXCONST_PS FL2FXCONST_SGL
#else
#define FIXP_PS FIXP_DBL
-#define FXP_CAST
+#define FXP_CAST(x) ((FIXP_DBL)(x))
#define FL2FXCONST_PS FL2FXCONST_DBL
#endif
diff --git a/libSBRenc/src/sbr_encoder.cpp b/libSBRenc/src/sbr_encoder.cpp
index 90b19cf..71aab78 100644
--- a/libSBRenc/src/sbr_encoder.cpp
+++ b/libSBRenc/src/sbr_encoder.cpp
@@ -1939,13 +1939,13 @@ INT sbrEncoder_Init(
- if ( (aot==AOT_PS) ) {
+ if ( aot==AOT_PS ) {
usePs = 1;
}
- if ( (aot==AOT_ER_AAC_ELD) ) {
+ if ( aot==AOT_ER_AAC_ELD ) {
lowDelay = 1;
}
- else if ( (aot==AOT_ER_AAC_LD) ) {
+ else if ( aot==AOT_ER_AAC_LD ) {
error = 1;
goto bail;
}