From 8245ba2cfc8732519f5c2b050013394a39fa1f0d Mon Sep 17 00:00:00 2001 From: Andrea Eichenseer Date: Thu, 3 Aug 2023 00:53:36 +0200 Subject: [PATCH 1/2] Improve EXT output for ParamISM, switch FIX_663_PARAM_ISM_EXT. --- lib_com/options.h | 2 +- lib_dec/ivas_ism_param_dec.c | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4d5c6a066a..610b61441d 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -215,7 +215,7 @@ #define FIX_625_IDX_OOB /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ - +#define FIX_663_PARAM_ISM_EXT /* FhG: Issue 663: ParamISM EXT output improvement */ /* ################## End BE DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index b64c52bc71..fe36d5a1f2 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -839,6 +839,7 @@ void ivas_param_ism_dec( } } +#ifndef FIX_663_PARAM_ISM_EXT for ( i = 0; i < nchan_transport; i++ ) { for ( j = 0; j < nchan_out_woLFE; j++ ) @@ -853,6 +854,30 @@ void ivas_param_ism_dec( } } } +#else + assert( nchan_transport == 2 ); /* to do: remove */ + for ( j = 0; j < nchan_out_woLFE; j++ ) + { + if ( hDirAC->azimuth_values[j] > 0.0f ) + { + hDirAC->hParamIsmRendering->proto_matrix[j] = 1.0f; + hDirAC->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 0.0f; + } + else + { + if ( hDirAC->azimuth_values[j] < 0.0f ) + { + hDirAC->hParamIsmRendering->proto_matrix[j] = 0.0f; + hDirAC->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 1.0f; + } + else /* == 0.0f */ + { + hDirAC->hParamIsmRendering->proto_matrix[j] = 0.5f; + hDirAC->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 0.5f; + } + } + } +#endif } /* Energy Compensation */ @@ -1193,6 +1218,7 @@ void ivas_param_ism_dec_digest_tc( } } +#ifndef FIX_663_PARAM_ISM_EXT for ( i = 0; i < nchan_transport; i++ ) { for ( j = 0; j < nchan_out_woLFE; j++ ) @@ -1207,6 +1233,30 @@ void ivas_param_ism_dec_digest_tc( } } } +#else + assert( nchan_transport == 2 ); /* to do: remove */ + for ( j = 0; j < nchan_out_woLFE; j++ ) + { + if ( hDirAC->azimuth_values[j] > 0.0f ) + { + hDirAC->hParamIsmRendering->proto_matrix[j] = 1.0f; + hDirAC->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 0.0f; + } + else + { + if ( hDirAC->azimuth_values[j] < 0.0f ) + { + hDirAC->hParamIsmRendering->proto_matrix[j] = 0.0f; + hDirAC->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 1.0f; + } + else /* == 0.0f */ + { + hDirAC->hParamIsmRendering->proto_matrix[j] = 0.5f; + hDirAC->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 0.5f; + } + } + } +#endif } /* Energy Compensation */ -- GitLab From 7dd0c3f510f4a1366cf5da9cbf76a911b2948189 Mon Sep 17 00:00:00 2001 From: Andrea Eichenseer Date: Fri, 4 Aug 2023 12:31:01 +0200 Subject: [PATCH 2/2] Clean up asserts. --- lib_dec/ivas_ism_param_dec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index fe36d5a1f2..06283748dc 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -855,7 +855,6 @@ void ivas_param_ism_dec( } } #else - assert( nchan_transport == 2 ); /* to do: remove */ for ( j = 0; j < nchan_out_woLFE; j++ ) { if ( hDirAC->azimuth_values[j] > 0.0f ) @@ -1234,7 +1233,6 @@ void ivas_param_ism_dec_digest_tc( } } #else - assert( nchan_transport == 2 ); /* to do: remove */ for ( j = 0; j < nchan_out_woLFE; j++ ) { if ( hDirAC->azimuth_values[j] > 0.0f ) -- GitLab