Commit b26190ce authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC

parent 48583fcc
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -3415,11 +3415,7 @@ void mctStereoIGF_enc_fx(
    Encoder_State **sts,                                 /* i/o: encoder state structure                    */
    Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2],       /* i  : MDCT spectrum for ITF                      */
    Word16 q_origSpec,                                   /* i  : Q for MDCT spectrum                        */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    Word32 *powerSpec[MCT_MAX_CHANNELS],                 /* i/o: MDCT^2 + MDST^2 spectrum,or estimate       */
#else
    Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k],   /* i/o: MDCT^2 + MDST^2 spectrum,or estimate       */
#endif
    Word16 q_powerSpec[MCT_MAX_CHANNELS],                /* i  : Q for powSpec_fx                           */
    Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i  : same as powerSpec_fx but for inverse spect.*/
    Word16 *q_powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV],  /* i  : Q for powSpecMsInv_fx                      */
+0 −1
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@
/* #################### Start BASOP porting switches ############################ */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
#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_1052_SBA_EXT_FIX                      /* VA: SBA external output support fix - do not overwrite "output_config" parameter */

#define FIX_1129_EXT_REND_OUTPUT_HIGH                   /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */
+0 −44
Original line number Diff line number Diff line
@@ -233,39 +233,23 @@ void ivas_mct_core_enc_fx(
    Word16 i, cpe_id, n, nAvailBits;
    Word16 nCPE;
    Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2]; /* Pointers to MDCT output for a short block (L/R) */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    Word32 powerSpecMsInv_long_cpe0_fx[CPE_CHANNELS][L_FRAME_PLUS];
    Word32 inv_spectrum_long_cpe0_fx[CPE_CHANNELS][L_FRAME_PLUS];
    Word32 powerSpec_long_cpe0_fx[CPE_CHANNELS][L_FRAME_PLUS];
    Word32 powerSpec_long_fx[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k];
    Word32 inv_spectrum_long_fx[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k];   /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */
    Word32 powerSpecMsInv_long_fx[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k]; /* MS inv power spectrum, also inverse MDST spectrum */
#else
    Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k];
#endif
    Word16 exp_powerSpec[MCT_MAX_CHANNELS][N_MAX + L_MDCT_OVLP_MAX];
    Word32 mdst_fx;
#ifndef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    Word32 powerSpecMsInv_long_fx[MCT_MAX_CHANNELS][L_FRAME48k]; /* MS inv power spectrum, also inverse MDST spectrum */
#endif
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    Word32 *powerSpec_fx[MCT_MAX_CHANNELS];
#endif
    Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][2];
    Word32 *inv_mdst_spectrum_fx[MCT_MAX_CHANNELS][2];
    Word32 *inv_spectrum_fx[MCT_MAX_CHANNELS][2];
    Word32 *mdst_spectrum_fx[MCT_MAX_CHANNELS][2] = { { NULL } };
#ifndef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    Word32 inv_spectrum_long_fx[MCT_MAX_CHANNELS][L_FRAME48k]; /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */
#endif
    Word16 total_side_bits;
    Word16 chBitRatios[MCT_MAX_CHANNELS];
    Word16 q_powSpec[MCT_MAX_CHANNELS], q_spec, q_origSpec, tmp_s;
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    Word16 tmp_q_powSpec[L_FRAME_PLUS], tmp_q_powSpecInv[MCT_MAX_CHANNELS][L_FRAME_PLUS], *tmp_q_psi[MCT_MAX_CHANNELS][2];
#else
    Word16 tmp_q_powSpec[L_FRAME48k], tmp_q_powSpecInv[MCT_MAX_CHANNELS][L_FRAME48k], *tmp_q_psi[MCT_MAX_CHANNELS][2];
#endif
    Word64 W_tmp;
    Encoder_State *sts[MCT_MAX_CHANNELS];
    Encoder_State *st;
@@ -290,7 +274,6 @@ void ivas_mct_core_enc_fx(
        nCPE = add( nCPE, 1 );
    }

#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++ )
    {
@@ -344,33 +327,6 @@ void ivas_mct_core_enc_fx(
    }

    set16_fx( tmp_q_powSpec, 63, L_FRAME_PLUS );
#else
    FOR( ch = 0; ch < MCT_MAX_CHANNELS; ch++ )
    {
        set32_fx( powerSpecMsInv_long_fx[ch], 0, L_FRAME48k );
        q_powSpec[ch] = 0;
        move16();
        set16_fx( exp_powerSpec[ch], 0, N_MAX + L_MDCT_OVLP_MAX );
    }
    FOR( ch = 0; ch < nChannels; ch++ )
    {
        set32_fx( inv_spectrum_long_fx[ch], 0, L_FRAME48k );
        set32_fx( powerSpec_fx[ch], 0, L_FRAME48k );           // tmp_q_powSpec
        set32_fx( powerSpecMsInv_long_fx[ch], 0, L_FRAME48k ); // tmp_q_powSpecInv

        inv_mdst_spectrum_fx[ch][0] = powerSpecMsInv_fx[ch][0] = powerSpecMsInv_long_fx[ch];
        inv_mdst_spectrum_fx[ch][1] = powerSpecMsInv_fx[ch][1] = powerSpecMsInv_long_fx[ch] + N_TCX10_MAX;
        set16_fx( tmp_q_powSpecInv[ch], 63, L_FRAME48k );

        tmp_q_psi[ch][0] = tmp_q_powSpecInv[ch];
        tmp_q_psi[ch][1] = &tmp_q_powSpecInv[ch][N_TCX10_MAX];

        inv_spectrum_fx[ch][0] = inv_spectrum_long_fx[ch];
        inv_spectrum_fx[ch][1] = inv_spectrum_long_fx[ch] + N_TCX10_MAX;
    }

    set16_fx( tmp_q_powSpec, 63, L_FRAME48k );
#endif

    FOR( ( cpe_id = 0, i = 0 ); cpe_id < nCPE; cpe_id++ )
    {
+0 −4
Original line number Diff line number Diff line
@@ -983,11 +983,7 @@ void mctStereoIGF_enc_fx(
    Encoder_State **sts,                           /* i/o: encoder state structure                    */
    Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2], /* i  : MDCT spectrum for ITF                      */
    Word16 q_origSpec,                             /* i  : Q for MDCT spectrum                        */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    Word32 *powerSpec_fx[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate       */
#else
    Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate       */
#endif
    Word16 q_powerSpec[MCT_MAX_CHANNELS],                /* i  : Q for powSpec_fx                           */
    Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i  : same as powerSpec_fx but for inverse spect.*/
    Word16 *q_powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV],  /* i  : Q for powSpecMsInv_fx                      */