From 19214a475b231d96c04211635443dcd07c6b87ab Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Fri, 27 Oct 2023 16:12:29 +0530 Subject: [PATCH] Resolving linux compilation warnings in SPAR module --- lib_com/options.h | 2 +- lib_enc/ivas_front_vad.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 54389fefef..64f02d191e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,7 +153,7 @@ #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 RESOLVE_SBA_COMPILE_WARNINGS /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index 52c3b8cd45..28353d7691 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -351,13 +351,26 @@ ivas_error front_vad_spar( const int16_t input_frame /* i : input frame length */ ) { +#ifndef RESOLVE_SBA_COMPILE_WARNINGS FRONT_VAD_ENC_HANDLE hFrontVad; +#else + FRONT_VAD_ENC_HANDLE hfront_vad[CPE_CHANNELS]; + FRONT_VAD_ENC_HANDLE hFrontVad; +#endif float input[L_FRAME48k]; int16_t vad_flag_dtx[1]; float fr_bands[1][2 * NB_BANDS]; +#ifndef RESOLVE_SBA_COMPILE_WARNINGS float Etot[1]; +#else + float Etot[CPE_CHANNELS]; +#endif float lf_E[1][2 * VOIC_BINS]; +#ifndef RESOLVE_SBA_COMPILE_WARNINGS int16_t localVAD_HE_SAD[1]; +#else + int16_t localVAD_HE_SAD[CPE_CHANNELS]; +#endif int16_t vad_hover_flag[1]; float band_energies[2 * NB_BANDS]; int16_t high_lpn_flag; @@ -387,7 +400,12 @@ ivas_error front_vad_spar( push_wmops( "front_vad_SPAR" ); error = IVAS_ERR_OK; +#ifndef RESOLVE_SBA_COMPILE_WARNINGS hFrontVad = hSpar->hFrontVad; +#else + hfront_vad[0] = hSpar->hFrontVad; + hFrontVad = hfront_vad[0]; +#endif st = hSpar->hCoreCoderVAD; if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_total_brate <= SBA_DTX_BITRATE_THRESHOLD ) @@ -466,8 +484,11 @@ ivas_error front_vad_spar( ivas_smc_gmm( st, NULL, localVAD_HE_SAD[0], Etot[0], lsp_new, cor_map_sum, epsP, PS, non_staX, relE, &high_lpn_flag, flag_spitch ); /* long-term energy update */ +#ifndef RESOLVE_SBA_COMPILE_WARNINGS long_enr( st, -1, localVAD_HE_SAD[0], high_lpn_flag, &hFrontVad, 1, localVAD_HE_SAD, Etot ); - +#else + long_enr( st, -1, localVAD_HE_SAD[0], high_lpn_flag, hfront_vad, 1, localVAD_HE_SAD, Etot ); +#endif /* increase ini_frame counter */ hFrontVad->ini_frame = min( hFrontVad->ini_frame + 1, MAX_FRAME_COUNTER ); st->ini_frame = hFrontVad->ini_frame; -- GitLab