diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index d4a4fa5168e4cedb5d041ded42303ccd2f40ef30..90dee220315ec1007285d97e5512e9b0d40e99e7 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1614,6 +1614,17 @@ static void ivas_param_mc_get_mixing_matrices( matrix_product_diag( mat_mult_buffer1, nY_band, nX, 0, proto_matrix_ptr, nY_band, nX, 1, Cproto_diag ); +#ifdef FIX_I220_PARAMMC_CPROTO + /* make sure we have no negative entries in Cproto_diag due to rounding errors */ + for ( ch_idx1 = 0; ch_idx1 < nY_band; ch_idx1++ ) + { + if ( Cproto_diag[ch_idx1] < 0.0f ) + { + Cproto_diag[ch_idx1] = 0.0f; + } + } +#endif + /* Computing the mixing matrices */ /* bands with decorr */