diff --git a/lib_com/options.h b/lib_com/options.h index 0f23d808276c5d29a53d9809219a2a43c0a73d18..b57b579cba4ab8d1c74c54e4ac8e6c686e13a644 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -117,6 +117,7 @@ #define NONBE_FIX_2237_ZERO_CURR_NOISE_PROBLEM /* FhG: Modify sum of hTonalMDCTConc->curr_noise_nrg to avoid inaccurate zero */ +#define NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES /* Dolby: Fix basop issue 1967 */ /* ################### End FIXES switches ########################### */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index aad249425e950f8799bb041a3f06feded53d57e3..5f86d8752d38ffaae29feacc74912ef9e9e04fc2 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -3975,8 +3975,8 @@ void decoder_tcx_ivas_fx( Word16 synthFB_fx[], Word16 *synth_q, #else - Word16 synth_fx[], // Q_syn - Word16 synthFB_fx[], // Q_syn + Word16 synth_fx[], // Q_syn + Word16 synthFB_fx[], // Q_syn #endif const Word16 bfi, const Word16 frame_cnt, @@ -4048,8 +4048,12 @@ void decoder_tcx_ivas_fx( decoder_tcx_tns_fx( st, L_frame_glob, L_spec, L_frame, L_frameTCX, x_fx, fUseTns, &tnsData, bfi, frame_cnt, 0, NULL ); - Scale_sig32( x_fx, N_MAX, sub( x_e, 20 ) ); // Scaling x_fx to Q11 + Scale_sig32( x_fx, N_MAX, sub( x_e, 20 ) ); // Scaling x_fx to Q11 +#ifdef NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES + Scale_sig( xn_buf_fx, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX, -( Q14 - 2 ) ); // Scaling xn_buf_fx to Q(-2) +#else Scale_sig( xn_buf_fx, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX, sub( st->Q_syn, 14 ) ); // Scaling xn_buf_fx to Q_syn +#endif x_e = sub( 31, 11 ); IF( st->igf != 0 ) @@ -5658,7 +5662,11 @@ void decoder_tcx_imdct_fx( generate_masking_noise_mdct_ivas_fx( x_fx, &x_e, st->hFdCngDec->hFdCngCom ); FOR( Word16 ind = 0; ind < L_frame; ind++ ) { +#ifdef NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES + x_fx[ind] = L_shl( x_fx[ind], sub( 31, add( x_e, q_x ) ) ); // q_x +#else x_fx[ind] = L_shr( x_fx[ind], sub( 31, add( x_e, q_x ) ) ); // q_x +#endif } }