From 18fba3576ec342a19338ed9a145229f2f30b66b8 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Mon, 30 Oct 2023 14:05:35 +0100 Subject: [PATCH 1/3] match function prototype with the variables used in the call. switch: FIX_888_INTERFACE_UNIFICATION --- lib_com/ivas_prot.h | 5 +++++ lib_com/options.h | 2 ++ lib_enc/ivas_dirac_enc.c | 5 +++++ lib_enc/ivas_mcmasa_enc.c | 9 +++++++++ 4 files changed, 21 insertions(+) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index a554ff3408..d1d510e8bd 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5517,8 +5517,13 @@ void lls_interp_n( void computeReferencePower_enc( const int16_t *band_grouping, /* i : Band grouping for estimation */ +#ifdef FIX_888_INTERFACE_UNIFICATION + float Cldfb_RealBuffer[][DIRAC_NO_FB_BANDS_MAX], /* i : Real part of input signal */ + float Cldfb_ImagBuffer[][DIRAC_NO_FB_BANDS_MAX], /* i : Imag part of input signal */ +#else float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i : Real part of input signal */ float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i : Imag part of input signal */ +#endif float *reference_power, /* o : Estimated power */ const int16_t enc_param_start_band, /* i : first band to process */ const int16_t num_freq_bands, /* i : Number of frequency bands */ diff --git a/lib_com/options.h b/lib_com/options.h index 54389fefef..75c3bbd0d0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,6 +154,8 @@ #define FIX_740_MASA_PREREND_VALIDITY_CHECK /* Nokia: issue 740: fix incorrect validity check in lib_rend to allow use of MASA prerenderer */ +#define FIX_888_INTERFACE_UNIFICATION /* Nokia: issues #888, #804 */ + /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 724609463b..c3536c7b35 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -531,8 +531,13 @@ static int16_t ivas_dirac_get_mono_flag( void computeReferencePower_enc( const int16_t *band_grouping, /* i : Band grouping for estimation */ +#ifdef FIX_888_INTERFACE_UNIFICATION + float Cldfb_RealBuffer[][DIRAC_NO_FB_BANDS_MAX], /* i : Real part of input signal */ + float Cldfb_ImagBuffer[][DIRAC_NO_FB_BANDS_MAX], /* i : Imag part of input signal */ +#else float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i : Real part of input signal */ float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i : Imag part of input signal */ +#endif float *reference_power, /* o : Estimated power */ const int16_t enc_param_start_band, /* i : first band to process */ const int16_t num_freq_bands, /* i : Number of frequency bands */ diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index 3df783ad05..0f9317a3e2 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -69,7 +69,11 @@ static void ivas_mcmasa_dmx( MCMASA_ENC_HANDLE hMcMasa, float *data_f[], const i static void compute_cov_mtx( float sr[MCMASA_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], float si[MCMASA_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], const int16_t freq, const int16_t N, CovarianceMatrix *COVls ); +#ifdef FIX_888_INTERFACE_UNIFICATION +static void computeIntensityVector_enc( const int16_t *band_grouping, float Cldfb_RealBuffer[FOA_CHANNELS][DIRAC_NO_FB_BANDS_MAX], float Cldfb_ImagBuffer[FOA_CHANNELS][DIRAC_NO_FB_BANDS_MAX], const int16_t enc_param_start_band, const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ); +#else static void computeIntensityVector_enc( const int16_t *band_grouping, float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], const int16_t enc_param_start_band, const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ); +#endif static void computeVerticalDiffuseness( float **buffer_intensity, const float *buffer_energy, const int16_t averaging_length, const int16_t num_freq_bands, float *diffuseness ); @@ -1459,8 +1463,13 @@ static void compute_cov_mtx( static void computeIntensityVector_enc( const int16_t *band_grouping, +#ifdef FIX_888_INTERFACE_UNIFICATION + float Cldfb_RealBuffer[FOA_CHANNELS][DIRAC_NO_FB_BANDS_MAX], + float Cldfb_ImagBuffer[FOA_CHANNELS][DIRAC_NO_FB_BANDS_MAX], +#else float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], +#endif const int16_t enc_param_start_band, /* i : first band to process */ const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ) -- GitLab From f94410dc565633cfb287fdaea51c0c4efe52b65a Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Mon, 30 Oct 2023 15:15:04 +0100 Subject: [PATCH 2/3] apply clang formaating --- lib_com/options.h | 2 +- lib_enc/ivas_dirac_enc.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 75c3bbd0d0..99f20c0c48 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,7 @@ #define FIX_740_MASA_PREREND_VALIDITY_CHECK /* Nokia: issue 740: fix incorrect validity check in lib_rend to allow use of MASA prerenderer */ -#define FIX_888_INTERFACE_UNIFICATION /* Nokia: issues #888, #804 */ +#define FIX_888_INTERFACE_UNIFICATION /* Nokia: issues #888: fix mismatch in 2D array size */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index c3536c7b35..0d05fc7fe6 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -530,7 +530,7 @@ static int16_t ivas_dirac_get_mono_flag( *-------------------------------------------------------------------------*/ void computeReferencePower_enc( - const int16_t *band_grouping, /* i : Band grouping for estimation */ + const int16_t *band_grouping, /* i : Band grouping for estimation */ #ifdef FIX_888_INTERFACE_UNIFICATION float Cldfb_RealBuffer[][DIRAC_NO_FB_BANDS_MAX], /* i : Real part of input signal */ float Cldfb_ImagBuffer[][DIRAC_NO_FB_BANDS_MAX], /* i : Imag part of input signal */ @@ -538,14 +538,14 @@ void computeReferencePower_enc( float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i : Real part of input signal */ float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i : Imag part of input signal */ #endif - float *reference_power, /* o : Estimated power */ - const int16_t enc_param_start_band, /* i : first band to process */ - const int16_t num_freq_bands, /* i : Number of frequency bands */ - const IVAS_FORMAT ivas_format, /* i : ivas_format */ - int16_t ref_power_w, /* i : use 0 if hodirac is enabled */ - const int16_t nchan_ana, /* i : number of analysis channels */ - int16_t *mono_frame_count, /* i/o: Mono Frame Count */ - int16_t *dirac_mono_flag /* i/o: Mono Flag */ + float *reference_power, /* o : Estimated power */ + const int16_t enc_param_start_band, /* i : first band to process */ + const int16_t num_freq_bands, /* i : Number of frequency bands */ + const IVAS_FORMAT ivas_format, /* i : ivas_format */ + int16_t ref_power_w, /* i : use 0 if hodirac is enabled */ + const int16_t nchan_ana, /* i : number of analysis channels */ + int16_t *mono_frame_count, /* i/o: Mono Frame Count */ + int16_t *dirac_mono_flag /* i/o: Mono Flag */ ) { int16_t brange[2]; -- GitLab From 5b21c5196c0679108fe97274c4f39a778947c5da Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Tue, 31 Oct 2023 11:48:06 +0100 Subject: [PATCH 3/3] clean-up of switch location --- lib_com/options.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 63e6ab61d9..6da0523307 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,12 +153,11 @@ #define FIX_879_USAN_ERROR_IN_MASA_DECODING /* FhG: Issue 879 : avoid arithmetic with NULL pointer in the DirAC decoder to fix USAN error */ #define FIX_740_MASA_PREREND_VALIDITY_CHECK /* Nokia: issue 740: fix incorrect validity check in lib_rend to allow use of MASA prerenderer */ #define FIX_865_MOVE_TD_DECORR /* VA: issue 865: Move ivas_td_decorr.c from lib_com to lib_rend */ +#define FIX_888_INTERFACE_UNIFICATION /* Nokia: issue #888: fix mismatch in 2D array size */ #define FIX_889_MASA_FILE_WRITER_OPEN /* Nokia: issue #889: mismatch in function definition and use */ #define FIX_890_ARRAY_SIZE /* Nokia: issue #890: mismatch in 2D array size declaration and use */ -#define FIX_888_INTERFACE_UNIFICATION /* Nokia: issues #888: fix mismatch in 2D array size */ - /* #################### End BE switches ################################## */ -- GitLab