From 136ea33d0415948685970c3ab6f8b2811d385df4 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 5 Dec 2022 13:02:20 +0100 Subject: [PATCH 1/2] fixed another SVD NaN problem, this time from rounding errors in calculation Cproto_diag --- lib_dec/ivas_mc_param_dec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index d4a4fa5168..5f1f705a65 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1613,6 +1613,17 @@ static void ivas_param_mc_get_mixing_matrices( matrix_product( proto_matrix_ptr, nY_band, nX, 0, Cx, nX, nX, 0, mat_mult_buffer1 ); 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 */ -- GitLab From 9531055704b6e7a1874dfc7c421c8cc96034aec3 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 5 Dec 2022 13:47:36 +0100 Subject: [PATCH 2/2] fix clang-format problem --- lib_dec/ivas_mc_param_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 5f1f705a65..90dee22031 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1613,7 +1613,7 @@ static void ivas_param_mc_get_mixing_matrices( matrix_product( proto_matrix_ptr, nY_band, nX, 0, Cx, nX, nX, 0, mat_mult_buffer1 ); 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++ ) -- GitLab