Commit fbc6a70c authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC

parent 818a3b00
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -3039,11 +3039,7 @@ void mctStereoIGF_enc(
    MCT_ENC_HANDLE hMCT,                                        /* i/o: MCT encoder structure                   */
    Encoder_State **sts,                                        /* i/o: encoder state structure                 */
    float *orig_spectrum[MCT_MAX_CHANNELS][NB_DIV],             /* i  : MDCT spectrum for ITF                   */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC 
    float *powerSpec[MCT_MAX_CHANNELS],                         /* i/o: MDCT^2 + MDST^2 spectrum,or estimate    */
#else
    float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k],              /* i/o: MDCT^2 + MDST^2 spectrum,or estimate    */
#endif
    float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV],            /* i  : same as above but for inverse spect.    */
    float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV],              /* i  : inverse spectrum                        */
    const int16_t sp_aud_decision0[MCT_MAX_CHANNELS]            /* i  : speech audio decision                   */
+0 −1
Original line number Diff line number Diff line
@@ -169,7 +169,6 @@
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC            /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/
#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING             /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */
#define NONBE_1131_ACELP_OOB                                  /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */

+0 −16
Original line number Diff line number Diff line
@@ -197,27 +197,17 @@ void ivas_mct_core_enc(
    int16_t i, cpe_id, n, nAvailBits;
    int16_t nCPE;
    float *orig_spectrum[MCT_MAX_CHANNELS][2]; /* Pointers to MDCT output for a short block (L/R) */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    float powerSpecMsInv_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS];
    float inv_spectrum_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS];
    float powerSpec_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS];
    float powerSpec_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k];
    float inv_spectrum_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k];   /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */
    float powerSpecMsInv_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k]; /* MS inv power spectrum, also inverse MDST spectrum */
#else
    float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k];
    float powerSpecMsInv_long[MCT_MAX_CHANNELS][L_FRAME48k]; /* MS inv power spectrum, also inverse MDST spectrum */
#endif
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    float *powerSpec[MCT_MAX_CHANNELS];
#endif
    float *powerSpecMsInv[MCT_MAX_CHANNELS][2];
    float *inv_mdst_spectrum[MCT_MAX_CHANNELS][2];
    float *inv_spectrum[MCT_MAX_CHANNELS][2];
    float *mdst_spectrum[MCT_MAX_CHANNELS][2];
#ifndef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    float inv_spectrum_long[MCT_MAX_CHANNELS][L_FRAME48k]; /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */
#endif
    int16_t total_side_bits;
    int16_t chBitRatios[MCT_MAX_CHANNELS];
    Encoder_State *sts[MCT_MAX_CHANNELS];
@@ -252,7 +242,6 @@ void ivas_mct_core_enc(
        nCPE++;
    }

#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    /* point first CPE channels to longer buffers where switching from ACELP to TCX may occur in SBA with DTX (total memory saving)*/
    for ( ch = 0; ch < CPE_CHANNELS; ch++ )
    {
@@ -264,17 +253,12 @@ void ivas_mct_core_enc(
    }

    for ( ch = CPE_CHANNELS; ch < nChannels; ch++ )
#else
    for ( ch = 0; ch < nChannels; ch++ )
#endif
    {
        inv_mdst_spectrum[ch][0] = powerSpecMsInv[ch][0] = powerSpecMsInv_long[ch - CPE_CHANNELS];
        inv_mdst_spectrum[ch][1] = powerSpecMsInv[ch][1] = powerSpecMsInv_long[ch - CPE_CHANNELS] + N_TCX10_MAX;
        inv_spectrum[ch][0] = inv_spectrum_long[ch - CPE_CHANNELS];
        inv_spectrum[ch][1] = inv_spectrum_long[ch - CPE_CHANNELS] + N_TCX10_MAX;
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
        powerSpec[ch] = powerSpec_long[ch - CPE_CHANNELS];
#endif
    }

    for ( cpe_id = 0, i = 0; cpe_id < nCPE; cpe_id++ )
+0 −4
Original line number Diff line number Diff line
@@ -817,11 +817,7 @@ void mctStereoIGF_enc(
    MCT_ENC_HANDLE hMCT,                       /* i/o: MCT encoder structure               */
    Encoder_State **sts,                       /* i/o: encoder state structure             */
    float *orig_spectrum[MCT_MAX_CHANNELS][2], /* i  : MDCT spectrum for ITF               */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/
#else
    float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/
#endif
    float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i  : same as above but for inverse spect.*/
    float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV],   /* i  : inverse spectrum                    */
    const int16_t sp_aud_decision0[MCT_MAX_CHANNELS] /* i  : speech audio decision               */