aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc
diff options
context:
space:
mode:
Diffstat (limited to 'libAACenc')
-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
4 files changed, 31 insertions, 33 deletions
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,