From b33022b5a50bb2e3b71d1fe9c158abfedf443be2 Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 22 Oct 2024 13:20:50 +1100 Subject: [PATCH 1/2] fix for 3by3 matrix inverse computaiton when det is negative --- lib_com/ivas_spar_com.c | 4 ++++ lib_com/options.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index 5496768821..caf723574b 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -1257,7 +1257,11 @@ static void ivas_calc_mat_inv( int16_t sign = 1; ivas_calc_mat_det( dbl_in_re, dim, &det_re ); +#ifdef NONBE_FIX_XXX_SBA_DET_MAT_INV_3BY3 + det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : 1 / min( det_re, -IVAS_DBL_EPS ); +#else det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : min( det_re, -IVAS_DBL_EPS ); +#endif for ( i = 0; i < dim; i++ ) { diff --git a/lib_com/options.h b/lib_com/options.h index e4c1c04bdb..630e4d34a2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,6 +174,9 @@ /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ + +#define NONBE_FIX_XXX_SBA_DET_MAT_INV_3BY3 /*Dolby: issue xxx: fix for inverse of det < 0*/ + /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -- GitLab From 682c312d08bfacb4e2a6f2395f6ff521fd2c5f23 Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 28 Oct 2024 22:00:02 +1100 Subject: [PATCH 2/2] add the actual issue number in the switch --- lib_com/ivas_spar_com.c | 2 +- lib_com/options.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index caf723574b..d8ec6d0ff5 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -1257,7 +1257,7 @@ static void ivas_calc_mat_inv( int16_t sign = 1; ivas_calc_mat_det( dbl_in_re, dim, &det_re ); -#ifdef NONBE_FIX_XXX_SBA_DET_MAT_INV_3BY3 +#ifdef NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3 det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : 1 / min( det_re, -IVAS_DBL_EPS ); #else det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : min( det_re, -IVAS_DBL_EPS ); diff --git a/lib_com/options.h b/lib_com/options.h index f2251dd1e2..2c63a56b11 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -178,7 +178,7 @@ /* #################### Start NON-BE switches ############################ */ -#define NONBE_FIX_XXX_SBA_DET_MAT_INV_3BY3 /*Dolby: issue xxx: fix for inverse of det < 0*/ +#define NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3 /*Dolby: issue 1213: fix for inverse of det < 0*/ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -- GitLab