From 9197219a73bd58d411df3c44461dcbd1d9806a4b Mon Sep 17 00:00:00 2001 From: marc emerit Date: Mon, 27 Jan 2025 14:41:36 +0100 Subject: [PATCH] fix issue 1229 --- lib_com/options.h | 2 ++ lib_util/hrtf_file_reader.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index e58555dfe..c156a37bf 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -127,4 +127,6 @@ #define FIX_ISSUE_1185 /* Ittiam: Fix for issue 1185: Assertion in ivas_dirac_dec_binaural_internal_fx() for crash in decoder in fft30_with_cmplx_data()*/ #define FIX_ISSUE_1209 /* Ittiam: Fix for issue 1209: Assertion exit in BASOP encoder (stereo_dmx_evs)*/ #define IVAS_ISSUE_1188_EVS_CRASH /* Ittiam: Fix for issue 1188: Issue due to ASAN */ +#define FIX_ISSUE_1229 /* Orange : FIX_ISSUE_1209: Fx Decoder output differs between HRTF from ROM and from file */ + #endif diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 3410ada71..442b2cc89 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -37,6 +37,10 @@ #include "prot_fx.h" #include "ivas_prot.h" #include "ivas_prot_fx.h" +#ifdef FIX_ISSUE_1229 +#include +#endif + /*---------------------------------------------------------------------* * Local structures @@ -958,7 +962,11 @@ static ivas_error create_HRTF_from_rawdata( float *tmp, temp_buf[1]; tmp = temp_buf; memcpy( tmp, hrtf_data_rptr, sizeof( float ) ); +#ifdef FIX_ISSUE_1229 + pOut_to_bin_wptr_fx[l] = (Word32) roundf( *tmp * ONE_IN_Q29 ); +#else pOut_to_bin_wptr_fx[l] = (Word32) ( *tmp * ONE_IN_Q29 ); +#endif hrtf_data_rptr += sizeof( float ); } // hrtf_data_rptr += mem_size; @@ -990,7 +998,11 @@ static ivas_error create_HRTF_from_rawdata( float *tmp, temp_buf[1]; tmp = temp_buf; memcpy( tmp, hrtf_data_rptr, sizeof( float ) ); +#ifdef FIX_ISSUE_1229 + pOut_to_bin_wptr_fx[l] = (Word32) roundf( *tmp * ONE_IN_Q29 ); +#else pOut_to_bin_wptr_fx[l] = (Word32) ( *tmp * ONE_IN_Q29 ); +#endif hrtf_data_rptr += sizeof( float ); } // hrtf_data_rptr += mem_size; @@ -1027,7 +1039,11 @@ static ivas_error create_HRTF_from_rawdata( float *tmp, temp_buf[1]; tmp = temp_buf; memcpy( tmp, hrtf_data_rptr, sizeof( float ) ); +#ifdef FIX_ISSUE_1229 + pOut_to_bin_wptr_fx[l] = (Word32) roundf( *tmp * ONE_IN_Q31 ); +#else pOut_to_bin_wptr_fx[l] = (Word32) ( *tmp * ONE_IN_Q29 ); +#endif hrtf_data_rptr += sizeof( float ); } // hrtf_data_rptr += mem_size; @@ -1057,7 +1073,11 @@ static ivas_error create_HRTF_from_rawdata( float *tmp, temp_buf[1]; tmp = temp_buf; memcpy( tmp, hrtf_data_rptr, sizeof( float ) ); +#ifdef FIX_ISSUE_1229 + pOut_to_bin_wptr_fx[l] = (Word32) roundf( *tmp * ONE_IN_Q31 ); +#else pOut_to_bin_wptr_fx[l] = (Word32) ( *tmp * ONE_IN_Q29 ); +#endif hrtf_data_rptr += sizeof( float ); } // hrtf_data_rptr += mem_size; -- GitLab