From b2ba1e64b2a7fe83319029fe0f785f883ec9bdb3 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 29 May 2023 08:32:38 +0200 Subject: [PATCH 1/4] Fixes under FIX_507_WARNINGS --- lib_com/fine_gain_bits.c | 6 ++++++ lib_com/hq_tools.c | 4 ++++ lib_com/options.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib_com/fine_gain_bits.c b/lib_com/fine_gain_bits.c index c4c5ce3fca..bc4eb47902 100644 --- a/lib_com/fine_gain_bits.c +++ b/lib_com/fine_gain_bits.c @@ -101,7 +101,9 @@ int16_t assign_gain_bits( int16_t *Rcalc /* o : Bit budget for shape quantizer (Q3) */ ) { +#ifndef FIX_507_WARNINGS int16_t subband_cnt; +#endif int16_t gain_bits_tot; int16_t i; @@ -116,14 +118,18 @@ int16_t assign_gain_bits( } /* Re-adjust bit budget for gain quantization */ +#ifndef FIX_507_WARNINGS subband_cnt = 0; +#endif gain_bits_tot = 0; *Rcalc = 0; for ( i = 0; i < BANDS; i++ ) { if ( Rk[i] > 0 ) { +#ifndef FIX_507_WARNINGS subband_cnt++; +#endif Rk[i] -= gain_bits_array[i] * 8; gain_bits_tot += gain_bits_array[i]; *Rcalc += Rk[i]; diff --git a/lib_com/hq_tools.c b/lib_com/hq_tools.c index 0008cb957c..2364d8179c 100644 --- a/lib_com/hq_tools.c +++ b/lib_com/hq_tools.c @@ -1228,7 +1228,9 @@ int16_t calc_nor_delta_hf( int16_t i; int16_t ynrm_t[44], normqlg2_t[44]; int16_t delta, max_delta, min_delta, bitsforDelta, add_bits_denv; +#ifndef FIX_507_WARNINGS int16_t temp_num = 0; +#endif max_delta = -100; calc_norm( t_audio, ynrm_t, normqlg2_t, 0, nb_sfm, sfmsize, sfm_start ); @@ -1290,7 +1292,9 @@ int16_t calc_nor_delta_hf( ynrm[i] += delta; add_bits_denv += bitsforDelta; +#ifndef FIX_507_WARNINGS temp_num++; +#endif } } diff --git a/lib_com/options.h b/lib_com/options.h index dccc11cf17..eb348c7364 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -220,7 +220,7 @@ #define FIX_483 /* FhG: fix issue 483, division by zero in nois_est */ #define FIX_483b /* FhG: fix issue 483, uninitialized values in ivas_mct_core_enc */ - +#define FIX_507_WARNINGS /* FhG/Eri/Dlb/VA: Issue 507, Warnings on MacOS */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ -- GitLab From 57b457c22f28775270ee8e79df1b5a79d816ea81 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 29 May 2023 08:54:42 +0200 Subject: [PATCH 2/4] Renamed FIX_507_WARNINGS to FIX_506_WARNINGS --- lib_com/fine_gain_bits.c | 6 +++--- lib_com/hq_tools.c | 4 ++-- lib_com/options.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_com/fine_gain_bits.c b/lib_com/fine_gain_bits.c index bc4eb47902..b87de6d4d4 100644 --- a/lib_com/fine_gain_bits.c +++ b/lib_com/fine_gain_bits.c @@ -101,7 +101,7 @@ int16_t assign_gain_bits( int16_t *Rcalc /* o : Bit budget for shape quantizer (Q3) */ ) { -#ifndef FIX_507_WARNINGS +#ifndef FIX_506_WARNINGS int16_t subband_cnt; #endif int16_t gain_bits_tot; @@ -118,7 +118,7 @@ int16_t assign_gain_bits( } /* Re-adjust bit budget for gain quantization */ -#ifndef FIX_507_WARNINGS +#ifndef FIX_506_WARNINGS subband_cnt = 0; #endif gain_bits_tot = 0; @@ -127,7 +127,7 @@ int16_t assign_gain_bits( { if ( Rk[i] > 0 ) { -#ifndef FIX_507_WARNINGS +#ifndef FIX_506_WARNINGS subband_cnt++; #endif Rk[i] -= gain_bits_array[i] * 8; diff --git a/lib_com/hq_tools.c b/lib_com/hq_tools.c index 2364d8179c..f7fef380d7 100644 --- a/lib_com/hq_tools.c +++ b/lib_com/hq_tools.c @@ -1228,7 +1228,7 @@ int16_t calc_nor_delta_hf( int16_t i; int16_t ynrm_t[44], normqlg2_t[44]; int16_t delta, max_delta, min_delta, bitsforDelta, add_bits_denv; -#ifndef FIX_507_WARNINGS +#ifndef FIX_506_WARNINGS int16_t temp_num = 0; #endif @@ -1292,7 +1292,7 @@ int16_t calc_nor_delta_hf( ynrm[i] += delta; add_bits_denv += bitsforDelta; -#ifndef FIX_507_WARNINGS +#ifndef FIX_506_WARNINGS temp_num++; #endif } diff --git a/lib_com/options.h b/lib_com/options.h index eb348c7364..5843723247 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -220,7 +220,7 @@ #define FIX_483 /* FhG: fix issue 483, division by zero in nois_est */ #define FIX_483b /* FhG: fix issue 483, uninitialized values in ivas_mct_core_enc */ -#define FIX_507_WARNINGS /* FhG/Eri/Dlb/VA: Issue 507, Warnings on MacOS */ +#define FIX_506_WARNINGS /* FhG/Eri/Dlb/VA: Issue 508, Warnings on MacOS */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ -- GitLab From 237fc9fb1dd3bfbba28a84ec606af2befb0cbc30 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Tue, 30 May 2023 06:49:49 +0200 Subject: [PATCH 3/4] 506 Warning fixes --- lib_com/ivas_prot.h | 6 ++++++ lib_dec/ivas_mc_paramupmix_dec.c | 25 ++++++++++++++++++++++++- lib_enc/ivas_mc_paramupmix_enc.c | 4 ++++ lib_enc/ivas_mct_enc.c | 8 ++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 556daf327b..f0ffc94679 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3948,9 +3948,15 @@ void ivas_mc_paramupmix_dec( float output_f[][L_FRAME48k] /* i/o: synthesized core-coder transport channels/DirAC output */ ); +#ifdef FIX_506_WARNINGS +int16_t ivas_mc_paramupmix_enc_getNumTransportChannels( + void +); +#else int16_t ivas_mc_paramupmix_getNumTransportChannels( void ); +#endif ivas_error ivas_mc_paramupmix_dec_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 346868ab6a..c53fb5280c 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -66,6 +66,10 @@ static void dequant_beta( int16_t nv, int16_t ivStart, QUANT_TYPE quant_type, in static void get_ec_data( Decoder_State *st, PAR_TYPE parType, QUANT_TYPE quant_type, int16_t nParBand, int16_t parBandStart, int32_t *parQ, int32_t *alphaQEnv, float ab[IVAS_MAX_NUM_BANDS] ); +#ifdef FIX_506_WARNINGS +static int16_t ivas_mc_paramupmix_dec_getNumTransportChannels( void ); +#endif + /*------------------------------------------------------------------------- * ivas_mc_paramupmix_dec_read_BS() * @@ -288,6 +292,7 @@ void ivas_mc_paramupmix_dec( return; } +#ifndef FIX_506_WARNINGS /*------------------------------------------------------------------------- * ivas_mc_paramupmix_getNumTransportChannels() * @@ -299,6 +304,7 @@ int16_t ivas_mc_paramupmix_getNumTransportChannels() nchan_transport = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS; /* 5.1.2 */ return nchan_transport; } +#endif /*------------------------------------------------------------------------- * ivas_mc_paramupmix_dec_open() @@ -328,8 +334,11 @@ ivas_error ivas_mc_paramupmix_dec_open( } output_Fs = st_ivas->hDecoderConfig->output_Fs; hMCParamUpmix->first_frame = 1; - +#ifdef FIX_506_WARNINGS + st_ivas->nchan_transport = ivas_mc_paramupmix_dec_getNumTransportChannels(); +#else st_ivas->nchan_transport = ivas_mc_paramupmix_getNumTransportChannels(); +#endif nchan_transport = st_ivas->nchan_transport; switch ( nchan_transport ) @@ -691,3 +700,17 @@ static void get_ec_data( dequant_beta( nParBand, parBandStart, quant_type, alphaQEnv, parQ, ab ); } } + +#ifdef FIX_506_WARNINGS +/*------------------------------------------------------------------------- + * ivas_mc_paramupmix_getNumTransportChannels() + * + * + *------------------------------------------------------------------------*/ +static int16_t ivas_mc_paramupmix_dec_getNumTransportChannels( void ) +{ + int16_t nchan_transport; + nchan_transport = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS; /* 5.1.2 */ + return nchan_transport; +} +#endif diff --git a/lib_enc/ivas_mc_paramupmix_enc.c b/lib_enc/ivas_mc_paramupmix_enc.c index 0d5f69d800..657f210d3b 100644 --- a/lib_enc/ivas_mc_paramupmix_enc.c +++ b/lib_enc/ivas_mc_paramupmix_enc.c @@ -359,7 +359,11 @@ void ivas_mc_paramupmix_enc_close( *------------------------------------------------------------------------*/ /* r : number of IVAS transport channels */ +#ifdef FIX_506_WARNINGS +int16_t ivas_mc_paramupmix_enc_getNumTransportChannels( void ) +#else int16_t ivas_mc_paramupmix_getNumTransportChannels() +#endif { int16_t nchan_transport; diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index af743deaa1..4fdbabc570 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -317,7 +317,11 @@ ivas_error create_mct_enc( } else if ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { +#ifdef FIX_506_WARNINGS + hMCT->nchan_out_woLFE = ivas_mc_paramupmix_enc_getNumTransportChannels(); +#else hMCT->nchan_out_woLFE = ivas_mc_paramupmix_getNumTransportChannels(); +#endif } else if ( ivas_format == SBA_FORMAT ) { @@ -429,7 +433,11 @@ ivas_error mct_enc_reconfigure( } else if ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { +#ifdef FIX_506_WARNINGS + hMCT->nchan_out_woLFE = ivas_mc_paramupmix_enc_getNumTransportChannels(); +#else hMCT->nchan_out_woLFE = ivas_mc_paramupmix_getNumTransportChannels(); +#endif } else if ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC ) { -- GitLab From 3e9efdf6a58e48f0715e67aeff2915dd57656526 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 31 May 2023 10:06:32 +0200 Subject: [PATCH 4/4] remove variable that is set but never read to fix warning --- lib_enc/ivas_mdct_core_enc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index edc9ea1e50..58034e349f 100644 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -581,7 +581,6 @@ void ivas_mdct_core_whitening_enc( int16_t n, ch, nSubframes, L_subframe, L_subframeTCX, tcx_subframe_coded_lines; float A_q[CPE_CHANNELS][NB_DIV][M + 1]; int16_t sns_vq_indices[CPE_CHANNELS * NB_DIV * SNS_MSVQ_NSTAGES_TCX10]; - int16_t nbits_sns; int16_t sns_stereo_mode[NB_DIV]; int16_t idx; int16_t param_lpc[CPE_CHANNELS][NPRM_LPC_NEW]; @@ -908,7 +907,7 @@ void ivas_mdct_core_whitening_enc( if ( !mct_on && sts[0]->sr_core == 25600 && ( ( hCPE->element_brate == IVAS_48k || hCPE->element_brate == IVAS_64k ) ) ) { - nbits_sns = quantize_sns( scf, scf_q, sts, sns_vq_indices, zero_side_flag, sns_stereo_mode ); + quantize_sns( scf, scf_q, sts, sns_vq_indices, zero_side_flag, sns_stereo_mode ); } else { @@ -1091,7 +1090,6 @@ void ivas_mdct_core_whitening_enc( *--------------------------------------------------------------------------------*/ if ( !mct_on && sts[0]->sr_core == 25600 && ( ( hCPE->element_brate == IVAS_48k || hCPE->element_brate == IVAS_64k ) ) ) { - nbits_sns = 0; idx = 0; if ( sts[0]->core == sts[1]->core ) @@ -1102,7 +1100,6 @@ void ivas_mdct_core_whitening_enc( for ( n = 0; n < nSubframes; ++n ) { push_next_indice( hBstr, sns_stereo_mode[n], 1 ); - nbits_sns++; sts[0]->side_bits_frame_channel++; } @@ -1112,7 +1109,6 @@ void ivas_mdct_core_whitening_enc( if ( sns_stereo_mode[n] == SNS_STEREO_MODE_MS ) { push_next_indice( hBstr, zero_side_flag[n], 1 ); - nbits_sns++; sts[0]->side_bits_frame_channel++; } } -- GitLab