Commit 800a0b9f authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Modify the exponent of hFdCngCom->olapBufferSynth2 before calling...

Modify the exponent of hFdCngCom->olapBufferSynth2 before calling SynthesisSTFT_fx and add a switch macro.
parent a378ed19
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -169,7 +169,9 @@ void initFdCngCom(
#ifndef FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING
    set32_fx( hFdCngCom->olapBufferSynth_fx, 0, FFTLEN );
#endif
    // set32_fx( hFdCngCom->olapBufferSynth2_fx, 0, FFTLEN );
#ifndef FIX_REMOVE_SYNTH2_FX
    set32_fx( hFdCngCom->olapBufferSynth2_fx, 0, FFTLEN );
#endif
    set32_fx( hFdCngCom->exc_cng_32fx, 0, L_FRAME16k );
    set16_fx( hFdCngCom->exc_cng, 0, L_FRAME16k );

+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@
#define HARM_2456_APPLY_SCALE                           /* FhG basop issue 2456: Harmonize apply_scale_ind(), apply_scale_ivas_fx() */
#define HARM_2454_TCX_RES_Q_SPEC                        /* FhG: harmonization of tcx_res_Q_spec_fx() and tcx_res_Q_spec_ivas_fx() */
#define FIX_FLOAT_1535_ARI_RES_Q_CLEANUP                /* FhG: remove dead code from tcx_ari_res_Q_spec() */

#define FIX_REMOVE_SYNTH2_FX
/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
+3 −1
Original line number Diff line number Diff line
@@ -370,7 +370,9 @@ typedef struct
#ifndef FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING
    Word32 olapBufferSynth_fx[FFTLEN]; /*Q_olapBufferSynth*/
#endif
    // Word32 olapBufferSynth2_fx[FFTLEN]; /*Q_olapBufferSynth2*/
#ifndef FIX_REMOVE_SYNTH2_FX
    Word32 olapBufferSynth2_fx[FFTLEN]; /*Q_olapBufferSynth2*/
#endif

    const Word32 *olapWinAna_fx; /* Q30 */
    const Word16 *olapWinSyn_fx; /* Q15 */
+11 −3
Original line number Diff line number Diff line
@@ -1635,7 +1635,9 @@ ivas_error acelp_core_dec_fx(
                                IF( NE_16( st->element_mode, last_element_mode ) )
                                {
                                    set16_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2, 0, st->hFdCngDec->hFdCngCom->fftlen );
                                    // set32_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, 0, st->hFdCngDec->hFdCngCom->fftlen );
#ifndef FIX_REMOVE_SYNTH2_FX
                                    set32_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, 0, st->hFdCngDec->hFdCngCom->fftlen );
#endif
                                }

                                Word32 psyn_32_fx[L_FRAME16k];
@@ -1643,7 +1645,11 @@ ivas_error acelp_core_dec_fx(
                                generate_masking_noise_ivas_fx( psyn_32_fx, &exp, st->hFdCngDec->hFdCngCom, st->hFdCngDec->hFdCngCom->frameSize, 0, 0, 0, st->element_mode, hStereoCng, nchan_out );

                                Copy_Scale_sig_32_16( psyn_32_fx, psyn_fx, st->hFdCngDec->hFdCngCom->frameSize, sub( st->Q_syn, exp ) ); // Q = st->Q_syn
                                // Copy_Scale_sig_32_16( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, st->hFdCngDec->hFdCngCom->olapBufferSynth2, shl( st->hFdCngDec->hFdCngCom->frameSize, 1 ), -Q15 ); // Q0
#ifdef FIX_REMOVE_SYNTH2_FX
                                Scale_sig( st->hFdCngDec->hFdCngCom->olapBufferSynth2, shl( st->hFdCngDec->hFdCngCom->frameSize, 1 ), Q1 );
#else
                                Copy_Scale_sig_32_16( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, st->hFdCngDec->hFdCngCom->olapBufferSynth2, shl( st->hFdCngDec->hFdCngCom->frameSize, 1 ), -Q15 ); // Q0
#endif
                            }
                        }
                    }
@@ -1731,7 +1737,9 @@ ivas_error acelp_core_dec_fx(
                IF( st->idchan == 0 )
                {
                    set16_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2, 0, st->hFdCngDec->hFdCngCom->fftlen );
                    // set32_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, 0, st->hFdCngDec->hFdCngCom->fftlen );
#ifndef FIX_REMOVE_SYNTH2_FX
                    set32_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, 0, st->hFdCngDec->hFdCngCom->fftlen );
#endif
                }
                IF( hStereoCng != NULL && ( st->idchan == 0 ) )
                {
+4 −2
Original line number Diff line number Diff line
@@ -1949,10 +1949,12 @@ ivas_error core_switching_pre_dec_fx(
            }
            ELSE
            {
                // L_lerp_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, shl( st->L_frame, 1 ), shl( st->last_L_frame, 1 ), Q_olapBufferSynth2 );
#ifdef FIX_REMOVE_SYNTH2_FX
                lerp( st->hFdCngDec->hFdCngCom->olapBufferSynth2, st->hFdCngDec->hFdCngCom->olapBufferSynth2, shl( st->L_frame, 1 ), shl( st->last_L_frame, 1 ) );
                (void) Q_olapBufferSynth2;

#else
                L_lerp_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, shl( st->L_frame, 1 ), shl( st->last_L_frame, 1 ), Q_olapBufferSynth2 );
#endif
                test();
                IF( LE_32( st->total_brate, SID_2k40 ) && LE_32( st->last_total_brate, SID_2k40 ) )
                {
Loading