Commit 94cf4285 authored by sbsarac's avatar sbsarac
Browse files

Merge branch 'main' into 1053-reverb-reconfiguration-runtime-aeid-file-tests

parents e97c0019 e433c88c
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3039,7 +3039,11 @@ 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                   */
+2 −0
Original line number Diff line number Diff line
@@ -173,6 +173,8 @@

#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT   /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/
#define REVERT_ZERO_FLUSH_TRESH                               /* FhG: issue 1069: revert threshold value introduced with !1518 due to significant complexity increase*/ 
#define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC            /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/

/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+35 −4
Original line number Diff line number Diff line
@@ -197,13 +197,27 @@ 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];
@@ -238,12 +252,29 @@ 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++ )
    {
        inv_mdst_spectrum[ch][0] = powerSpecMsInv[ch][0] = powerSpecMsInv_long_cpe0[ch];
        inv_mdst_spectrum[ch][1] = powerSpecMsInv[ch][1] = powerSpecMsInv_long_cpe0[ch] + N_TCX10_MAX;
        inv_spectrum[ch][0] = inv_spectrum_long_cpe0[ch];
        inv_spectrum[ch][1] = inv_spectrum_long_cpe0[ch] + N_TCX10_MAX;
        powerSpec[ch] = powerSpec_long_cpe0[ch];
    }

    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];
        inv_mdst_spectrum[ch][1] = powerSpecMsInv[ch][1] = powerSpecMsInv_long[ch] + N_TCX10_MAX;
        inv_spectrum[ch][0] = inv_spectrum_long[ch];
        inv_spectrum[ch][1] = inv_spectrum_long[ch] + N_TCX10_MAX;
        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++ )

lib_enc/ivas_mct_enc_mct.c

100755 → 100644
+8 −4
Original line number Diff line number Diff line
@@ -817,7 +817,11 @@ 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               */