diff --git a/lib_com/fd_cng_com_fx.c b/lib_com/fd_cng_com_fx.c index fc23ea45b5513295a240ce9bf87af3f1d4950dc8..9704ba9dd15020377f750450632524de5b573e82 100644 --- a/lib_com/fd_cng_com_fx.c +++ b/lib_com/fd_cng_com_fx.c @@ -169,7 +169,7 @@ 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 ); + // set32_fx( hFdCngCom->olapBufferSynth2_fx, 0, FFTLEN ); set32_fx( hFdCngCom->exc_cng_32fx, 0, L_FRAME16k ); set16_fx( hFdCngCom->exc_cng, 0, L_FRAME16k ); diff --git a/lib_com/stat_com.h b/lib_com/stat_com.h index 0ae17b976195e3dfec27be08c5e30a47dc9d8899..8c8da8ec65212843c79211c2a67f99563fe25e14 100644 --- a/lib_com/stat_com.h +++ b/lib_com/stat_com.h @@ -370,7 +370,7 @@ typedef struct #ifndef FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING Word32 olapBufferSynth_fx[FFTLEN]; /*Q_olapBufferSynth*/ #endif - Word32 olapBufferSynth2_fx[FFTLEN]; /*Q_olapBufferSynth2*/ + // Word32 olapBufferSynth2_fx[FFTLEN]; /*Q_olapBufferSynth2*/ const Word32 *olapWinAna_fx; /* Q30 */ const Word16 *olapWinSyn_fx; /* Q15 */ diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 73ff775afed46ec7dc5e813d31ee27d0b5aa4a0c..d3d4a240fb8747330b875f7f3f67952d9a1f832f 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1635,15 +1635,15 @@ 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 ); + // set32_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, 0, st->hFdCngDec->hFdCngCom->fftlen ); } Word32 psyn_32_fx[L_FRAME16k]; Copy_Scale_sig_16_32_no_sat( psyn_fx, psyn_32_fx, st->hFdCngDec->hFdCngCom->frameSize, sub( Q6, st->Q_syn ) ); // Q6 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 + 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 } } } @@ -1731,7 +1731,7 @@ 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 ); + // set32_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, 0, st->hFdCngDec->hFdCngCom->fftlen ); } IF( hStereoCng != NULL && ( st->idchan == 0 ) ) { diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 2eab8f473a48006755fe8567e3b7485fb0497e7c..e23cccfc9abdec5d711d875944d15074a87b3db8 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1949,7 +1949,9 @@ 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 ); + // 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 ); + lerp( st->hFdCngDec->hFdCngCom->olapBufferSynth2, st->hFdCngDec->hFdCngCom->olapBufferSynth2, shl( st->L_frame, 1 ), shl( st->last_L_frame, 1 ) ); + (void) Q_olapBufferSynth2; test(); IF( LE_32( st->total_brate, SID_2k40 ) && LE_32( st->last_total_brate, SID_2k40 ) ) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 213962d4307f87e4df7eb83d21b57db2d73c8ebb..01ec28c5868033db1313427de437fbbfda1a2ea0 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -93,7 +93,7 @@ void initFdCngDec_fx( hFdCngDec->hFdCngCom->olapBufferAna = hFdCngDec->olapBufferAna; set16_fx( hFdCngDec->olapBufferSynth2, 0, FFTLEN ); hFdCngDec->hFdCngCom->olapBufferSynth2 = hFdCngDec->olapBufferSynth2; - set32_fx( hFdCngDec->hFdCngCom->olapBufferSynth2_fx, 0, FFTLEN ); + // set32_fx( hFdCngDec->hFdCngCom->olapBufferSynth2_fx, 0, FFTLEN ); /* Set some counters and flags */ @@ -4642,7 +4642,11 @@ void generate_masking_noise_ivas_fx( } ELSE { - SynthesisSTFT_fx( fftBuffer_fx, maskingNoise_fx, hFdCngCom->olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, 0, hFdCngCom, element_mode, nchan_out ); + Word32 olapBufferSynth2_fx[FFTLEN]; /*Q_olapBufferSynth2*/ + Copy_Scale_sig_16_32_no_sat( hFdCngCom->olapBufferSynth2, olapBufferSynth2_fx, FFTLEN, Q15 ); + SynthesisSTFT_fx( fftBuffer_fx, maskingNoise_fx, olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, 0, hFdCngCom, element_mode, nchan_out ); + Copy_Scale_sig_32_16( olapBufferSynth2_fx, hFdCngCom->olapBufferSynth2, FFTLEN, -Q15 ); + // SynthesisSTFT_fx( fftBuffer_fx, maskingNoise_fx, hFdCngCom->olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, 0, hFdCngCom, element_mode, nchan_out ); } *exp_out = sub( *exp_out, Q9 ); move16(); @@ -4690,7 +4694,9 @@ void generate_stereo_masking_noise_fx( { hFdCngCom = st->hFdCngDec->hFdCngCom; Copy_Scale_sig_16_32_no_sat( hStereoCng->olapBufferSynth22_fx, Ns_fx, shr( hFdCngCom->frameSize, 1 ), sub( Q6, st->Q_syn ) ); /*Q6*/ - Copy32( hFdCngCom->olapBufferSynth2_fx, Np_fx, shr( hFdCngCom->frameSize, 1 ) ); /*st->Q_syn*/ + + // Copy32( hFdCngCom->olapBufferSynth2_fx, Np_fx, shr( hFdCngCom->frameSize, 1 ) ); /*st->Q_syn*/ + Copy_Scale_sig_16_32_no_sat( hFdCngCom->olapBufferSynth2, Np_fx, shr( hFdCngCom->frameSize, 1 ), Q15 ); set32_fx( &Np_fx[( hFdCngCom->frameSize / 2 )], 0, shr( hFdCngCom->frameSize, 1 ) ); set32_fx( &Ns_fx[( hFdCngCom->frameSize / 2 )], 0, shr( hFdCngCom->frameSize, 1 ) ); @@ -4966,7 +4972,11 @@ void generate_masking_noise_lb_dirac_fx( move32(); /* Perform STFT synthesis */ - SynthesisSTFT_dirac_fx( fftBuffer, tdBuffer + n_samples_start, hFdCngCom->olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, n_samples_out_loop, hFdCngCom ); + Word32 olapBufferSynth2_fx[FFTLEN]; /*Q_olapBufferSynth2*/ + Copy_Scale_sig_16_32_no_sat( hFdCngCom->olapBufferSynth2, olapBufferSynth2_fx, FFTLEN, Q15 ); + SynthesisSTFT_dirac_fx( fftBuffer, tdBuffer + n_samples_start, olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, n_samples_out_loop, hFdCngCom ); + Copy_Scale_sig_32_16( olapBufferSynth2_fx, hFdCngCom->olapBufferSynth2, FFTLEN, -Q15 ); + // SynthesisSTFT_dirac_fx( fftBuffer, tdBuffer + n_samples_start, hFdCngCom->olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, n_samples_out_loop, hFdCngCom ); scale_sig32( tdBuffer + n_samples_start, n_samples_out_loop, Q9 ); // Q2 -> Q11 } @@ -4977,7 +4987,11 @@ void generate_masking_noise_lb_dirac_fx( set32_fx( fftBuffer, 0, hFdCngCom->fftlen ); /* Perform STFT synthesis */ - SynthesisSTFT_dirac_fx( fftBuffer, tdBuffer + n_samples_start, hFdCngCom->olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, n_samples_out_loop, hFdCngCom ); + Word32 olapBufferSynth2_fx[FFTLEN]; /*Q_olapBufferSynth2*/ + Copy_Scale_sig_16_32_no_sat( hFdCngCom->olapBufferSynth2, olapBufferSynth2_fx, FFTLEN, Q15 ); + SynthesisSTFT_dirac_fx( fftBuffer, tdBuffer + n_samples_start, olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, n_samples_out_loop, hFdCngCom ); + Copy_Scale_sig_32_16( olapBufferSynth2_fx, hFdCngCom->olapBufferSynth2, FFTLEN, -Q15 ); + // SynthesisSTFT_dirac_fx( fftBuffer, tdBuffer + n_samples_start, hFdCngCom->olapBufferSynth2_fx, hFdCngCom->olapWinSyn_fx, n_samples_out_loop, hFdCngCom ); } hFdCngCom->fftBuffer_exp = 31 - 11; move16(); diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index cdb2b6061fb3b35c2067d3e7dcc799a8ce62ce62..91a862fe3d9491194722baba0c34809d98397bea 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -874,8 +874,8 @@ void stereo_tcx_core_dec_fx( Word16 exp; Copy_Scale_sig_16_32_no_sat( signal_out_fx, signal_out_32_fx, st->hFdCngDec->hFdCngCom->frameSize, Q6 ); generate_masking_noise_ivas_fx( signal_out_32_fx, &exp, st->hFdCngDec->hFdCngCom, st->hFdCngDec->hFdCngCom->frameSize, 0, 0, 0, st->element_mode, hStereoCng, nchan_out ); - Copy_Scale_sig_32_16( signal_out_32_fx, signal_out_fx, st->hFdCngDec->hFdCngCom->frameSize, negate( exp ) ); // Q0 - Copy_Scale_sig_32_16( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, st->hFdCngDec->hFdCngCom->olapBufferSynth2, shl( st->hFdCngDec->hFdCngCom->frameSize, 1 ), -Q15 ); // Q0 + Copy_Scale_sig_32_16( signal_out_32_fx, signal_out_fx, st->hFdCngDec->hFdCngCom->frameSize, negate( exp ) ); // Q0 + // Copy_Scale_sig_32_16( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, st->hFdCngDec->hFdCngCom->olapBufferSynth2, shl( st->hFdCngDec->hFdCngCom->frameSize, 1 ), -Q15 ); // Q0 } }