diff options
Diffstat (limited to 'libSBRenc/src')
-rw-r--r-- | libSBRenc/src/bit_sbr.cpp | 6 | ||||
-rw-r--r-- | libSBRenc/src/ps_bitenc.cpp | 36 | ||||
-rw-r--r-- | libSBRenc/src/ps_encode.cpp | 16 | ||||
-rw-r--r-- | libSBRenc/src/sbr_encoder.cpp | 7 |
4 files changed, 32 insertions, 33 deletions
diff --git a/libSBRenc/src/bit_sbr.cpp b/libSBRenc/src/bit_sbr.cpp index 963aeff..9200e01 100644 --- a/libSBRenc/src/bit_sbr.cpp +++ b/libSBRenc/src/bit_sbr.cpp @@ -2,7 +2,7 @@ /* ----------------------------------------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. +© Copyright 1995 - 2015 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -283,9 +283,7 @@ void sbrEncoder_GetHeader(SBR_ENCODER *sbrEncoder, INT element_index, int fSendHeaders) { - int bits; - - bits = encodeSbrHeaderData (&sbrEncoder->sbrElement[element_index]->sbrHeaderData, hBs); + encodeSbrHeaderData (&sbrEncoder->sbrElement[element_index]->sbrHeaderData, hBs); if (fSendHeaders == 0) { /* Prevent header being embedded into the SBR payload. */ diff --git a/libSBRenc/src/ps_bitenc.cpp b/libSBRenc/src/ps_bitenc.cpp index b1fe12e..420ea15 100644 --- a/libSBRenc/src/ps_bitenc.cpp +++ b/libSBRenc/src/ps_bitenc.cpp @@ -2,7 +2,7 @@ /* ----------------------------------------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. +© Copyright 1995 - 2015 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -261,21 +261,23 @@ static const UINT opdDeltaTime_Code[] = 0x00000001, 0x00000002, 0x00000001, 0x00000007, 0x00000006, 0000000000, 0x00000002, 0x00000003 }; -static const INT psBands[] = +static INT getNoBands(const INT mode) { - PS_BANDS_COARSE, - PS_BANDS_MID -}; - -static INT getNoBands(PS_RESOLUTION mode) -{ - if(mode>=6) - return 0; + INT noBands = 0; - if(mode>=3) - mode = (PS_RESOLUTION)(mode-3); + switch (mode) { + case 0: case 3: /* coarse */ + noBands = PS_BANDS_COARSE; + break; + case 1: case 4: /* mid */ + noBands = PS_BANDS_MID; + break; + case 2: case 5: /* fine not supported */ + default: /* coarse as default */ + noBands = PS_BANDS_COARSE; + } - return psBands[mode]; + return noBands; } static INT getIIDRes(INT iidMode) @@ -524,7 +526,7 @@ static INT encodeIpdOpd(HANDLE_PS_OUT psOut, bitCnt += FDKsbrEnc_EncodeIpd( hBitBuf, psOut->ipd[env], ipdLast, - getNoBands((PS_RESOLUTION)psOut->iidMode), + getNoBands(psOut->iidMode), psOut->deltaIPD[env], &error); @@ -532,7 +534,7 @@ static INT encodeIpdOpd(HANDLE_PS_OUT psOut, bitCnt += FDKsbrEnc_EncodeOpd( hBitBuf, psOut->opd[env], opdLast, - getNoBands((PS_RESOLUTION)psOut->iidMode), + getNoBands(psOut->iidMode), psOut->deltaOPD[env], &error ); } @@ -661,7 +663,7 @@ INT FDKsbrEnc_WritePSBitstream(const HANDLE_PS_OUT psOut, bitCnt += FDKsbrEnc_EncodeIid( hBitBuf, psOut->iid[env], iidLast, - getNoBands((PS_RESOLUTION)psOut->iidMode), + getNoBands(psOut->iidMode), (PS_IID_RESOLUTION)getIIDRes(psOut->iidMode), psOut->deltaIID[env], &error ); @@ -677,7 +679,7 @@ INT FDKsbrEnc_WritePSBitstream(const HANDLE_PS_OUT psOut, bitCnt += FDKsbrEnc_EncodeIcc( hBitBuf, psOut->icc[env], iccLast, - getNoBands((PS_RESOLUTION)psOut->iccMode), + getNoBands(psOut->iccMode), psOut->deltaICC[env], &error); diff --git a/libSBRenc/src/ps_encode.cpp b/libSBRenc/src/ps_encode.cpp index 2ae2788..fec39e8 100644 --- a/libSBRenc/src/ps_encode.cpp +++ b/libSBRenc/src/ps_encode.cpp @@ -2,7 +2,7 @@ /* ----------------------------------------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. +© Copyright 1995 - 2015 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -149,21 +149,21 @@ typedef enum { static const FIXP_DBL iidQuant_fx[15] = { - 0xce000000, 0xdc000000, 0xe4000000, 0xec000000, 0xf2000000, 0xf8000000, 0xfc000000, 0x00000000, - 0x04000000, 0x08000000, 0x0e000000, 0x14000000, 0x1c000000, 0x24000000, 0x32000000 + (FIXP_DBL)0xce000000, (FIXP_DBL)0xdc000000, (FIXP_DBL)0xe4000000, (FIXP_DBL)0xec000000, (FIXP_DBL)0xf2000000, (FIXP_DBL)0xf8000000, (FIXP_DBL)0xfc000000, (FIXP_DBL)0x00000000, + (FIXP_DBL)0x04000000, (FIXP_DBL)0x08000000, (FIXP_DBL)0x0e000000, (FIXP_DBL)0x14000000, (FIXP_DBL)0x1c000000, (FIXP_DBL)0x24000000, (FIXP_DBL)0x32000000 }; static const FIXP_DBL iidQuantFine_fx[31] = { - 0x9c000001, 0xa6000001, 0xb0000001, 0xba000001, 0xc4000000, 0xce000000, 0xd4000000, 0xda000000, - 0xe0000000, 0xe6000000, 0xec000000, 0xf0000000, 0xf4000000, 0xf8000000, 0xfc000000, 0x00000000, - 0x04000000, 0x08000000, 0x0c000000, 0x10000000, 0x14000000, 0x1a000000, 0x20000000, 0x26000000, - 0x2c000000, 0x32000000, 0x3c000000, 0x45ffffff, 0x4fffffff, 0x59ffffff, 0x63ffffff + (FIXP_DBL)0x9c000001, (FIXP_DBL)0xa6000001, (FIXP_DBL)0xb0000001, (FIXP_DBL)0xba000001, (FIXP_DBL)0xc4000000, (FIXP_DBL)0xce000000, (FIXP_DBL)0xd4000000, (FIXP_DBL)0xda000000, + (FIXP_DBL)0xe0000000, (FIXP_DBL)0xe6000000, (FIXP_DBL)0xec000000, (FIXP_DBL)0xf0000000, (FIXP_DBL)0xf4000000, (FIXP_DBL)0xf8000000, (FIXP_DBL)0xfc000000, (FIXP_DBL)0x00000000, + (FIXP_DBL)0x04000000, (FIXP_DBL)0x08000000, (FIXP_DBL)0x0c000000, (FIXP_DBL)0x10000000, (FIXP_DBL)0x14000000, (FIXP_DBL)0x1a000000, (FIXP_DBL)0x20000000, (FIXP_DBL)0x26000000, + (FIXP_DBL)0x2c000000, (FIXP_DBL)0x32000000, (FIXP_DBL)0x3c000000, (FIXP_DBL)0x45ffffff, (FIXP_DBL)0x4fffffff, (FIXP_DBL)0x59ffffff, (FIXP_DBL)0x63ffffff }; static const FIXP_DBL iccQuant[8] = { - 0x7fffffff, 0x77ef9d7f, 0x6babc97f, 0x4ceaf27f, 0x2f0ed3c0, 0x00000000, 0xb49ba601, 0x80000000 + (FIXP_DBL)0x7fffffff, (FIXP_DBL)0x77ef9d7f, (FIXP_DBL)0x6babc97f, (FIXP_DBL)0x4ceaf27f, (FIXP_DBL)0x2f0ed3c0, (FIXP_DBL)0x00000000, (FIXP_DBL)0xb49ba601, (FIXP_DBL)0x80000000 }; static FDK_PSENC_ERROR InitPSData( diff --git a/libSBRenc/src/sbr_encoder.cpp b/libSBRenc/src/sbr_encoder.cpp index 464c013..221aecd 100644 --- a/libSBRenc/src/sbr_encoder.cpp +++ b/libSBRenc/src/sbr_encoder.cpp @@ -2,7 +2,7 @@ /* ----------------------------------------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. +© Copyright 1995 - 2015 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -103,7 +103,7 @@ amm-info@iis.fraunhofer.de #define SBRENCODER_LIB_VL0 3 #define SBRENCODER_LIB_VL1 3 -#define SBRENCODER_LIB_VL2 4 +#define SBRENCODER_LIB_VL2 6 @@ -170,7 +170,6 @@ getSbrTuningTableIndex(UINT bitrate, /*! the total bitrate in bits/sec */ { int i, bitRateClosestLowerIndex=-1, bitRateClosestUpperIndex=-1, found = 0; UINT bitRateClosestUpper = 0, bitRateClosestLower=DISTANCE_CEIL_VALUE; - int isforThisCodec=0; #define isForThisCore(i) \ ( ( sbrTuningTable[i].coreCoder == CODEC_AACLD && core == AOT_ER_AAC_ELD ) || \ @@ -854,7 +853,7 @@ FDKsbrEnc_EnvEncodeFrame(HANDLE_SBR_ENCODER hEnvEncoder, int clearOutput /*!< Do not consider any input signal */ ) { - HANDLE_SBR_ELEMENT hSbrElement = hEnvEncoder->sbrElement[iElement]; + HANDLE_SBR_ELEMENT hSbrElement = NULL; FDK_CRCINFO crcInfo; INT crcReg; INT ch; |