Commit f2a1e2ea authored by Manuel Jander's avatar Manuel Jander
Browse files

Remove possibly not needed rescaling with macros...

Remove possibly not needed rescaling with macros NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX_2549 and NONBE_FIX_2549_REMOVE_RECONFIG_RESCALE.
parent 11cd64e9
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -6089,7 +6089,12 @@ UWord16 get_indice_st(

void stereo_mdct_core_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                   */
#ifdef NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX
    Word16 new_samples[CPE_CHANNELS][L_INP],                    /* i  : new samples                       new_samples_q*/
    Word16 *new_samples_q,
#else
    Word16 new_samples[CPE_CHANNELS][L_INP],                    /* i  : new samples                       Qnew-1*/
#endif
    Word16 old_wsp[CPE_CHANNELS][L_WSP],                        /* i  : 12.8kHz weighted speech (for LTP      Qx*/
    Word16 pitch_buf_fx[CPE_CHANNELS][NB_SUBFR16k]              /* o  : floating pitch for each subframe      Q6*/
);
@@ -6136,7 +6141,12 @@ void stereo_switching_dec_fx(

void ivas_mdct_core_whitening_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                   */
#ifdef NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX
    Word16 new_samples_fx[CPE_CHANNELS][L_INP],                 /* i  : new samples                             Q_new[]-1*/
    Word16 *Q_new,                                              /* i  : new samples q                           */
#else
    Word16 new_samples_fx[CPE_CHANNELS][L_INP],                 /* i  : new samples                             */
#endif
    Word16 old_wsp_fx[CPE_CHANNELS][L_WSP],                     /* i  : 12.8kHz weighted speech (for LTP        */
    Word16 pitch_buf[CPE_CHANNELS][NB_SUBFR16k],                /* o  : floating pitch for each subframe        */
    Word32 *mdst_spectrum_long[CPE_CHANNELS],                   /* o  : buffer for MDST spectrum                */
+2 −0
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_SWB_fenv_fx2 /* FhG: Avoid overflow of SWB_fenv_fx in SWB_BWE_encoding_fx because of very small energies. */
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */
#define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT_FIX_2527    /* Fix crash from issue #2527 */
#define NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX_2549       /* FhG: Correct scale inconsistency of old_inp_16k_fx buffer scale. */
#define NONBE_FIX_2549_REMOVE_RECONFIG_RESCALE          /* FhG: Remove rescaling of audio during mode switching. */
#define FIX_FLOAT_1539_G192_FORMAT_SWITCH               /* VA/Nokia: reintroduce format switching for g192 bitstreams */
#define HARMONIZE_2499_CONFIGUREFDCNGDEC                /* FhG: basop issue 2499: harmonoize configureFdCngDec */
#define FIX_BASOP_2530_IVAS_DECISION_MAT                /* VA: Fix ambiguous usage of extract_l() */
+1 −1
Original line number Diff line number Diff line
@@ -474,7 +474,7 @@ void core_signal_analysis_high_bitrate_fx(

void core_signal_analysis_high_bitrate_ivas_fx(
#ifdef NONBE_FIX_ISSUE_2206
    const Word16 *new_samples, /*i  : *Q_new */
    const Word16 *new_samples, /*i  : *Q_new-1 */
#else
    const Word16 *new_samples, /*i : Q0 */
#endif
+16 −1
Original line number Diff line number Diff line
@@ -433,7 +433,7 @@ ivas_error ivas_core_enc_fx(
                FOR( n = 0; n < n_CoreChannels; n++ )
                {
                    st = sts[n];
#ifndef NONBE_FIX_ISSUE_2206
#ifndef NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX
                    Scale_sig( old_inp_16k_fx[n], L_INP, sub( Q1, Q_new[n] ) ); // Q0
#endif
                    IF( NE_16( st->element_mode, IVAS_CPE_DFT ) && NE_16( st->element_mode, IVAS_CPE_MDCT ) )
@@ -448,15 +448,22 @@ ivas_error ivas_core_enc_fx(
                Q_spec_old[1] = hCPE->hCoreCoder[1]->hTcxEnc->spectrum_long_e;
                move16();

#ifdef NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX
                ivas_mdct_core_whitening_enc_fx( hCPE, old_inp_16k_fx, Q_new, old_wsp_fx, pitch_buf_fx_new, hMCT->p_mdst_spectrum_long_fx[cpe_id], hMCT->tnsBits[cpe_id], hMCT->p_orig_spectrum_long_fx[cpe_id],
                                                 hMCT->tnsSize[cpe_id], hMCT->p_param[cpe_id], hMCT->hBstr, 1, hMCT->nchan_out_woLFE, mdst_spectrum_e, orig_spectrum_e );
#else
                ivas_mdct_core_whitening_enc_fx( hCPE, old_inp_16k_fx, old_wsp_fx, pitch_buf_fx_new, hMCT->p_mdst_spectrum_long_fx[cpe_id], hMCT->tnsBits[cpe_id], hMCT->p_orig_spectrum_long_fx[cpe_id],
                                                 hMCT->tnsSize[cpe_id], hMCT->p_param[cpe_id], hMCT->hBstr, 1, hMCT->nchan_out_woLFE, mdst_spectrum_e, orig_spectrum_e );
#endif

                FOR( i = 0; i < CPE_CHANNELS; i++ )
                {
                    st = sts[i];
                    Word16 nSubframes = NB_DIV;
                    move16();
#ifndef NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX
                    Scale_sig( old_inp_16k_fx[i], L_INP, sub( Q_new[i], Q1 ) ); // Q_new[n] - 1
#endif
                    if ( EQ_16( st->hTcxEnc->tcxMode, TCX_20 ) )
                    {
                        nSubframes = 1;
@@ -521,7 +528,9 @@ ivas_error ivas_core_enc_fx(
                FOR( i = 0; i < CPE_CHANNELS; i++ )
                {
                    st = sts[i];
#ifndef NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX
                    Scale_sig( old_inp_16k_fx[i], L_INP, sub( Q1, Q_new[i] ) ); // Q0
#endif

                    test();
                    IF( NE_16( st->element_mode, IVAS_CPE_DFT ) && NE_16( st->element_mode, IVAS_CPE_MDCT ) )
@@ -556,11 +565,17 @@ ivas_error ivas_core_enc_fx(
                Q_spec_old[1] = hCPE->hCoreCoder[1]->hTcxEnc->spectrum_long_e;
                move16();

#ifdef NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX
                stereo_mdct_core_enc_fx( hCPE, old_inp_16k_fx, Q_new, old_wsp_fx, pitch_buf_fx );
#else
                stereo_mdct_core_enc_fx( hCPE, old_inp_16k_fx, old_wsp_fx, pitch_buf_fx );
#endif

                FOR( i = 0; i < CPE_CHANNELS; i++ )
                {
#ifndef NONBE_FIX_ISSUE_2206_MDCT_STEREO_FIX
                    Scale_sig( old_inp_16k_fx[i], L_INP, sub( Q_new[i], Q1 ) ); // Q_new[n] - 1
#endif
                    st = sts[i];
                    IF( EQ_16( st->hTcxEnc->tcxMode, TCX_20 ) )
                    {
+6 −0
Original line number Diff line number Diff line
@@ -59,7 +59,11 @@ ivas_error ivas_corecoder_enc_reconfig_fx(
    const MC_MODE last_mc_mode        /* i  : switching between MC modes: last mode */
)
{
#ifdef NONBE_FIX_2549_REMOVE_RECONFIG_RESCALE
    Word16 n, sce_id, cpe_id;
#else
    Word16 n, sce_id, cpe_id, k, shift;
#endif
    Word16 len_inp_memory, n_CoreCoder_existing, nSCE_existing, nCPE_existing;

    Word32 input_buff_fx[MCT_MAX_BLOCKS][L_FRAME48k + NS2SA( 48000, IVAS_FB_ENC_DELAY_NS )];
@@ -221,6 +225,7 @@ ivas_error ivas_corecoder_enc_reconfig_fx(
            move16();
        }

#ifndef NONBE_FIX_2549_REMOVE_RECONFIG_RESCALE
        Word16 q_com_sce = Q15, q_com_sce32 = Q31;
        move16();
        move16();
@@ -325,6 +330,7 @@ ivas_error ivas_corecoder_enc_reconfig_fx(
                }
            }
        }
#endif

        test();
        test();
Loading