diff --git a/lib_com/gs_gains_fx.c b/lib_com/gs_gains_fx.c index 87aa64ec8c2de2ebcd9a6f74a617b06d2381ab79..55ced4ea07c8547ec30c4de4d4776754c9158ade 100644 --- a/lib_com/gs_gains_fx.c +++ b/lib_com/gs_gains_fx.c @@ -1193,45 +1193,55 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequenc *--------------------------------------------------------------------------------------*/ idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 ); VDQ_vec_fx( y_gainQ_fx, YGain_mean_LR_fx, YGain_dic1_LR_fx, idx_g_fx, 3 ); +#ifdef FIX_2312_CONDITION_MISSING_GSC_DEC_LR + IF( !( coder_type == INACTIVE && st_fx->tdm_LRTD_flag == 0 && EQ_16( st_fx->idchan, 1 ) ) || GT_32( st_fx->core_brate, GSC_LRES_GAINQ_LIMIT ) ) + { +#endif + idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 ); + VDQ_vec_fx( y_gainQ_fx + 3, YGain_mean_LR_fx + 3, YGain_dic2_LR_fx, idx_g_fx, 4 ); - idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 ); - VDQ_vec_fx( y_gainQ_fx + 3, YGain_mean_LR_fx + 3, YGain_dic2_LR_fx, idx_g_fx, 4 ); - - /*----------------------------------------------------------------------* - * Interpolation of the last 4 Q bands to create bands 8-16 - * And scaling - *----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------* + * Interpolation of the last 4 Q bands to create bands 8-16 + * And scaling + *----------------------------------------------------------------------*/ - idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 ); + idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 ); - VDQ_vec_fx( y_gainQ_fx + 7, YGain_mean_LR_fx + 7, YGain_dic3_LR_fx, idx_g_fx, 5 ); + VDQ_vec_fx( y_gainQ_fx + 7, YGain_mean_LR_fx + 7, YGain_dic3_LR_fx, idx_g_fx, 5 ); - Copy( y_gainQ_fx + 8, y_gain_tmp3_fx, 4 ); - set16_fx( y_gainQ_fx + 12, 0, 4 ); + Copy( y_gainQ_fx + 8, y_gain_tmp3_fx, 4 ); + set16_fx( y_gainQ_fx + 12, 0, 4 ); - fft_rel_fx( y_gainQ_fx + 8, 4, 2 ); + fft_rel_fx( y_gainQ_fx + 8, 4, 2 ); - y_gainQ_fx[15] = y_gainQ_fx[11]; - move16(); - y_gainQ_fx[11] = 0; - move16(); - ifft_rel_fx( y_gainQ_fx + 8, 8, 3 ); - FOR( i = 8; i < 16; i++ ) - { - y_gainQ_fx[i] = round_fx( L_shl( L_mult( y_gainQ_fx[i], 23101 ), 1 ) ); /*Q12 */ + y_gainQ_fx[15] = y_gainQ_fx[11]; + move16(); + y_gainQ_fx[11] = 0; + move16(); + ifft_rel_fx( y_gainQ_fx + 8, 8, 3 ); + FOR( i = 8; i < 16; i++ ) + { + y_gainQ_fx[i] = round_fx( L_shl( L_mult( y_gainQ_fx[i], 23101 ), 1 ) ); /*Q12 */ + move16(); + } + /*----------------------------------------------------------------------* + * Copy the true Q values in the specific bands + *----------------------------------------------------------------------*/ + y_gainQ_fx[8] = y_gain_tmp3_fx[0]; /*Q12*/ + move16(); + y_gainQ_fx[10] = y_gain_tmp3_fx[1]; /*Q12*/ + move16(); + y_gainQ_fx[12] = y_gain_tmp3_fx[2]; /*Q12*/ move16(); + y_gainQ_fx[14] = y_gain_tmp3_fx[3]; /*Q12*/ + move16(); +#ifdef FIX_2312_CONDITION_MISSING_GSC_DEC_LR } - /*----------------------------------------------------------------------* - * Copy the true Q values in the specific bands - *----------------------------------------------------------------------*/ - y_gainQ_fx[8] = y_gain_tmp3_fx[0]; /*Q12*/ - move16(); - y_gainQ_fx[10] = y_gain_tmp3_fx[1]; /*Q12*/ - move16(); - y_gainQ_fx[12] = y_gain_tmp3_fx[2]; /*Q12*/ - move16(); - y_gainQ_fx[14] = y_gain_tmp3_fx[3]; /*Q12*/ - move16(); + ELSE + { + set16_fx( y_gainQ_fx + 3, 0, MBANDS_GN16k - 3 ); + } +#endif } ELSE { diff --git a/lib_com/options.h b/lib_com/options.h index 7c094c8fc83796ab6ddb78ef062b3a77ba8a4617..52131a213f87ffab54e9980864f23802b0680ca8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -138,6 +138,7 @@ #define FIX_2257_INCR_GUARD_BITS /* FhG: take correct rendering frame-size into account for guard-bits calculation */ #define FIX_2297_SBA_SCALING_32KHZ /* VA: basop issue 2297: Fix scaling factor before the SBA decoder for output_Fs = 32 or 16 */ #define FIX_2315_AGC_MEMORY_RESET /* VA: basop issue 2315: fix reset of the AGC memory */ +#define FIX_2312_CONDITION_MISSING_GSC_DEC_LR /* VA: basop issue 2297: addition of condition missing in the GSC gain decoder at low-rate */ /* ##################### End NON-BE switches ########################### */