diff options
Diffstat (limited to 'libAACenc/src')
| -rw-r--r-- | libAACenc/src/aacenc.cpp | 7 | ||||
| -rw-r--r-- | libAACenc/src/aacenc.h | 2 | ||||
| -rw-r--r-- | libAACenc/src/aacenc_lib.cpp | 20 | ||||
| -rw-r--r-- | libAACenc/src/aacenc_tns.cpp | 2 | ||||
| -rw-r--r-- | libAACenc/src/bandwidth.cpp | 2 | ||||
| -rw-r--r-- | libAACenc/src/psy_const.h | 1 | ||||
| -rw-r--r-- | libAACenc/src/transform.h | 2 | 
7 files changed, 13 insertions, 23 deletions
diff --git a/libAACenc/src/aacenc.cpp b/libAACenc/src/aacenc.cpp index 28ba895..29e588f 100644 --- a/libAACenc/src/aacenc.cpp +++ b/libAACenc/src/aacenc.cpp @@ -558,6 +558,13 @@ AAC_ENCODER_ERROR FDKaacEnc_Initialize(HANDLE_AAC_ENC      hAacEnc,    qcInit.channelMapping      = &hAacEnc->channelMapping;    qcInit.sceCpe              = 0; +  if ((config->bitrateMode>=1) && (config->bitrateMode<=5)) { +      qcInit.averageBits     = (averageBitsPerFrame+7)&~7; +      qcInit.bitRes          = MIN_BUFSIZE_PER_EFF_CHAN*cm->nChannelsEff; +      qcInit.maxBits         = MIN_BUFSIZE_PER_EFF_CHAN*cm->nChannelsEff; +      qcInit.minBits         = 0; +  } +  else    {        int maxBitres;        qcInit.averageBits     = (averageBitsPerFrame+7)&~7; diff --git a/libAACenc/src/aacenc.h b/libAACenc/src/aacenc.h index 3b27483..c4e1ecb 100644 --- a/libAACenc/src/aacenc.h +++ b/libAACenc/src/aacenc.h @@ -113,7 +113,7 @@ typedef enum {    /* initialization errors */    aac_enc_init_error_start      = 0x2000,    AAC_ENC_INVALID_HANDLE        = 0x2020,             /*!< The handle passed to the function call was invalid (probably NULL).        */ -  AAC_ENC_INVALID_FRAME_LENGTH  = 0x2080,             /*!< Invalid frame length (must be 1024 or 960).                                */ +  AAC_ENC_INVALID_FRAME_LENGTH  = 0x2080,             /*!< Invalid frame length.                                                      */    AAC_ENC_INVALID_N_CHANNELS    = 0x20e0,             /*!< Invalid amount of audio input channels.                                    */    AAC_ENC_INVALID_SFB_TABLE     = 0x2140,             /*!< Internal encoder error.                                                    */ diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp index 7b3f271..2f95ab1 100644 --- a/libAACenc/src/aacenc_lib.cpp +++ b/libAACenc/src/aacenc_lib.cpp @@ -98,7 +98,7 @@ amm-info@iis.fraunhofer.de  /* Encoder library info */  #define AACENCODER_LIB_VL0 3  #define AACENCODER_LIB_VL1 4 -#define AACENCODER_LIB_VL2 0 +#define AACENCODER_LIB_VL2 1  #define AACENCODER_LIB_TITLE "AAC Encoder"  #define AACENCODER_LIB_BUILD_DATE __DATE__  #define AACENCODER_LIB_BUILD_TIME __TIME__ @@ -506,7 +506,7 @@ INT aacEncoder_LimitBitrate(      bitRate = FDKmin(576000*nChannels, bitRate);      /*bitRate = FDKmax(0*nChannels, bitRate);*/    } -   +    /* Limit bit rate in respect to the core coder */    bitRate = FDKaacEnc_LimitBitrate( @@ -535,7 +535,7 @@ INT aacEncoder_LimitBitrate(      aacEncDistributeSbrBits(&cm, sbrElInfo, bitRate);      for (e=0; e<cm.nElements; e++) -    {  +    {        INT sbrElementBitRateIn, sbrBitRateOut;        if (cm.elInfo[e].elType != ID_SCE && cm.elInfo[e].elType != ID_CPE) { @@ -632,18 +632,7 @@ 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 && hAacConfig->framelength != 960) { -            return AACENC_INVALID_CONFIG; -          } -          break; -      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) { +          if (hAacConfig->framelength != 1024) {              return AACENC_INVALID_CONFIG;            }            break; @@ -1573,7 +1562,6 @@ AACENC_ERROR aacEncoder_SetParam(                  }                case AOT_AAC_LC:                case AOT_MP2_AAC_LC: -              case AOT_ER_AAC_LC:                case AOT_ER_AAC_LD:                case AOT_ER_AAC_ELD:                  if (!(hAacEncoder->encoder_modis & (ENC_MODE_FLAG_AAC))) { diff --git a/libAACenc/src/aacenc_tns.cpp b/libAACenc/src/aacenc_tns.cpp index 8f30a39..9a0edd4 100644 --- a/libAACenc/src/aacenc_tns.cpp +++ b/libAACenc/src/aacenc_tns.cpp @@ -281,7 +281,6 @@ static INT getTnsMaxBands(    int maxBandsTabSize = 0;    switch (granuleLength) { -    case 960:      case 1024:        pMaxBandsTab = tnsMaxBandsTab1024;        maxBandsTabSize = sizeof(tnsMaxBandsTab1024)/sizeof(TNS_MAX_TAB_ENTRY); @@ -404,7 +403,6 @@ AAC_ENCODER_ERROR FDKaacEnc_InitTnsConfiguration(INT bitRate,    tC->lpcStopLine    = pC->sfbOffset[tC->lpcStopBand];    switch (granuleLength) { -    case 960:      case 1024:        /* TNS start line: skip lower MDCT lines to prevent artifacts due to filter mismatch */        tC->lpcStartBand[LOFILT]   = (blockType == SHORT_WINDOW) ? 0 : ((sampleRate < 18783) ? 4 : 8); diff --git a/libAACenc/src/bandwidth.cpp b/libAACenc/src/bandwidth.cpp index b2b8851..da9b850 100644 --- a/libAACenc/src/bandwidth.cpp +++ b/libAACenc/src/bandwidth.cpp @@ -204,7 +204,6 @@ static INT GetBandwidthEntry(    INT bwTabSize = 0;    switch (frameLength) { -    case 960:      case 1024:        pBwTab = bandWidthTable;        bwTabSize = sizeof(bandWidthTable)/sizeof(BANDWIDTH_TAB); @@ -253,7 +252,6 @@ static INT GetBandwidthEntry(            chanBitRate < pBwTab[i+1].chanBitRate)        {          switch (frameLength) { -          case 960:            case 1024:              bandwidth = (entryNo==0)                ? pBwTab[i].bandWidthMono diff --git a/libAACenc/src/psy_const.h b/libAACenc/src/psy_const.h index 42bef79..d9c9f43 100644 --- a/libAACenc/src/psy_const.h +++ b/libAACenc/src/psy_const.h @@ -98,7 +98,6 @@ amm-info@iis.fraunhofer.de  #define FRAME_MAXLEN_SHORT    ((1024)/TRANS_FAC)  #define FRAME_LEN_SHORT_128   ((1024)/TRANS_FAC) -#define FRAME_LEN_SHORT_120   (FRAME_LEN_LONG_960/TRANS_FAC)  /* Filterbank type*/  enum FB_TYPE { diff --git a/libAACenc/src/transform.h b/libAACenc/src/transform.h index ab7a14f..5053174 100644 --- a/libAACenc/src/transform.h +++ b/libAACenc/src/transform.h @@ -105,7 +105,7 @@ amm-info@iis.fraunhofer.de   *        LONG_WINDOW, START_WINDOW, SHORT_WINDOW or STOP_WINDOW.   * \param windowShape index indicating the window slope type to be used.   *        Values allowed are either SINE_WINDOW or KBD_WINDOW. - * \param frameLength length of the block. Either 1024 or 960. + * \param frameLength length of the block.   * \param mdctData_e pointer to an INT where the exponent of the frequency   *        domain output data is stored into.   * \return 0 in case of success, non-zero in case of error (inconsistent parameters).  | 
