From 36eccef9c4aa049295de8d8c6cbcecf93efb5e0e Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 9 Oct 2023 16:37:40 +0200 Subject: [PATCH] issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS(); under FIX_820_DOUBLE_PREC_MACROS --- lib_com/ivas_prot.h | 10 +++++++++- lib_com/options.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 5656733f5f..0f363eceda 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4679,11 +4679,19 @@ void ivas_td_decorr_APD_iir_filter( out1_re = ( in1_re * in2_re ) - ( in1_im * in2_im ); MAC(1); MULT(1); \ out1_im = ( in1_re * in2_im ) + ( in2_re * in1_im ); MAC(1); MULT(1); +#ifdef FIX_820_DOUBLE_PREC_MACROS +#define IVAS_CALCULATE_ABS( re, im, out ) \ + out = sqrtf( ( re * re ) + ( im * im ) ); MAC(1); MULT(1); SQRT(1); + +#define IVAS_CALCULATE_RABS( re, out ) \ + out = sqrtf( re * re ); MULT(1); SQRT(1); +#else #define IVAS_CALCULATE_ABS( re, im, out ) \ out = (float) sqrt( ( re * re ) + ( im * im ) ); MAC(1); MULT(1); SQRT(1); #define IVAS_CALCULATE_RABS( re, out ) \ - out = (float) sqrt( re * re ); MULT(1); SQRT(1); + out = (float) sqrt( re * re ); MULT(1); SQRT(1);#endif +#endif #define IVAS_CALCULATE_SQ_ABS( re, im, out ) \ out = (float) ( ( re * re ) + ( im * im ) ); MAC(1); MULT(1); diff --git a/lib_com/options.h b/lib_com/options.h index 89f4a28754..2d8e62d905 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,7 @@ #define FIX_818_DOUBLE_PREC_KERNEL_SW /* FhG: Issue 818: Avoid double precision in kernel switching */ #define FIX_822_REFACTOR_BIN_REVERB_OPEN /* Nokia: Addresses first step of issue 822 by refactoring ivas_binaural_reverb_open */ #define FIX_847_OUTPUT_PCM_BUFFER /* VA: issue 847: Allocate decoder output PCM buffer dynamically */ - +#define FIX_820_DOUBLE_PREC_MACROS /* VA: issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS() */ /* #################### End BE switches ################################## */ -- GitLab