From b42e4d79f22ee925cd138545b1d794a19642defd Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 16 Oct 2024 18:00:22 +0200 Subject: [PATCH 1/2] conflict resolution for options.h --- lib_com/options.h | 1 + lib_dec/lib_dec_fx.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index a8d6fd901..93908a861 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -186,6 +186,7 @@ #define FIX_907_MEM_UPDATE_ISSUE /* VA: fix for 907, multiples issues surrounding mem_syn_r and update of mem_syn2 when FS is changing */ #define FIX_918_WRONG_SCALING_ON_MODE_SWITCHING /* VA: Fix wrong scaling of secondary channel when switching from stereo DFT to TD */ #define FIX_924_IGF_ROUNDFX_SAT +#define FIX_930_JBM_BUFSIZE_MULT /* FhG: Fix 930, Word16 too small for apa_buffer_size */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index d59ddcfc4..19bca219f 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -3637,7 +3637,11 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( const UWord16 nTransportChannels, const UWord16 l_ts ) { +#ifdef FIX_930_JBM_BUFSIZE_MULT + Word32 apa_buffer_size; +#else Word16 apa_buffer_size; +#endif apa_buffer_size = hIvasDec->nSamplesFrame; move16(); @@ -3706,12 +3710,20 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( } } +#ifdef FIX_930_JBM_BUFSIZE_MULT + IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) +#else IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * imult1616( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) +#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); } +#ifdef FIX_930_JBM_BUFSIZE_MULT + set_zero_fx( hIvasDec->apaExecBuffer_fx, L_mult( apa_buffer_size, (Word16) nTransportChannels ) ); +#else set_zero_fx( hIvasDec->apaExecBuffer_fx, imult1616( apa_buffer_size, (Word16) nTransportChannels ) ); +#endif } } ELSE -- GitLab From 00d0aff09fb29b8a8dd82a99cb2f2e7296cb98bf Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 17 Oct 2024 16:43:09 +0530 Subject: [PATCH 2/2] Few more updates to fix issue 930 --- lib_com/prot.h | 7 ++++++- lib_com/tools_fx.c | 16 ++++++++++++++++ lib_dec/lib_dec_fx.c | 16 ++++++++++------ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/lib_com/prot.h b/lib_com/prot.h index 618057b04..a5bfa721e 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -194,7 +194,12 @@ void set_zero_fx( Word32 *vec, /* o : input vector */ const Word16 lvec /* i : length of the vector */ ); - +#ifdef FIX_930_JBM_BUFSIZE_MULT +void set_zero2_fx( + Word32 *vec, /* o : input vector */ + const Word32 lvec /* i : length of the vector */ +); +#endif void set16_zero_fx( Word16 *vec, /* o : input vector */ const Word16 lvec /* i : length of the vector */ diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index 52f8b01af..5c733b1df 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -4461,7 +4461,23 @@ void set_zero_fx( return; } +#ifdef FIX_930_JBM_BUFSIZE_MULT +void set_zero2_fx( + Word32 *vec, /* o : input vector */ + const Word32 lvec /* i : length of the vector */ +) +{ + Word32 i; + FOR( i = 0; i < lvec; i++ ) + { + *vec++ = 0; + move32(); + } + + return; +} +#endif void set16_zero_fx( Word16 *vec, /* o : input vector */ const Word16 lvec /* i : length of the vector */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 19bca219f..e75d49836 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -3637,11 +3637,7 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( const UWord16 nTransportChannels, const UWord16 l_ts ) { -#ifdef FIX_930_JBM_BUFSIZE_MULT - Word32 apa_buffer_size; -#else Word16 apa_buffer_size; -#endif apa_buffer_size = hIvasDec->nSamplesFrame; move16(); @@ -3711,7 +3707,7 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( } #ifdef FIX_930_JBM_BUFSIZE_MULT - IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) + IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) #else IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * imult1616( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) #endif @@ -3720,7 +3716,7 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( } #ifdef FIX_930_JBM_BUFSIZE_MULT - set_zero_fx( hIvasDec->apaExecBuffer_fx, L_mult( apa_buffer_size, (Word16) nTransportChannels ) ); + set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ); #else set_zero_fx( hIvasDec->apaExecBuffer_fx, imult1616( apa_buffer_size, (Word16) nTransportChannels ) ); #endif @@ -3745,11 +3741,19 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); #else free( hIvasDec->apaExecBuffer_fx ); +#ifdef FIX_930_JBM_BUFSIZE_MULT + IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) +#else IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * imult1616( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) +#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); } +#ifdef FIX_930_JBM_BUFSIZE_MULT + set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ); +#else set_zero_fx( hIvasDec->apaExecBuffer_fx, imult1616( apa_buffer_size, (Word16) nTransportChannels ) ); +#endif #endif } /* realloc apa_exe_buffer */ -- GitLab