From 5bec78dd61a312f99561950f9235f8e1f96518cd Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 1 Dec 2023 13:37:02 +0100 Subject: [PATCH 1/2] fix unused-variable warnigns with DEBUGGING disabled --- lib_dec/ACcontextMapping_dec.c | 10 ++++++++++ lib_enc/ivas_qmetadata_enc.c | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib_dec/ACcontextMapping_dec.c b/lib_dec/ACcontextMapping_dec.c index 5139106d9f..f4818648cf 100644 --- a/lib_dec/ACcontextMapping_dec.c +++ b/lib_dec/ACcontextMapping_dec.c @@ -348,7 +348,9 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( int16_t lastnz, n; uint16_t r; int16_t resQBits; +#ifdef DEBUGGING int16_t rest_bits; +#endif int16_t nt_half; int16_t nbbits_m2; int16_t bits_tups; /* No. of bits for coding the no. of tuples */ @@ -425,7 +427,9 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( rc_uni_dec_init( &rc_st_dec, &st->bit_stream[st->next_bit_pos], nbbits ); /* (nbbits + 30) entries are read by the decoder */ nbbits_m2 = nbbits; +#ifdef DEBUGGING rest_bits = -nbbits_m2; +#endif /* Main Loop through the 2-tuples */ for ( k = 0; k < lastnz; k += 2 ) @@ -484,11 +488,13 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( a += a1 << lev; b += b1 << lev; +#ifdef DEBUGGING /* Add 2 LSB bits per bit-plane */ rest_bits += 2 * lev; /* Sign bits */ rest_bits += min( a, 1 ); rest_bits += min( b, 1 ); +#endif /* Update bitstream pointer */ st->next_bit_pos = start_bit_pos + bits_tups + rc_uni_dec_virtual_finish( &rc_st_dec ); @@ -571,7 +577,9 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( rc_uni_dec_init( &rc_st_dec, &st->bit_stream[st->next_bit_pos], nbbits ); /* (nbbits + 30) entries are read by the decoder */ nbbits_m2 = nbbits; +#ifdef DEBUGGING rest_bits = -nbbits_m2; +#endif t = 0; s = 0; @@ -624,11 +632,13 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( a += a1 << lev; b += b1 << lev; +#ifdef DEBUGGING /* Add 2 LSB bits per bit-plane */ rest_bits += 2 * lev; /* Sign bits */ rest_bits += min( a, 1 ); rest_bits += min( b, 1 ); +#endif /* Update bitstream pointer */ st->next_bit_pos = start_bit_pos + bits_tups + rc_uni_dec_virtual_finish( &rc_st_dec ); diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 0be2dc62d8..9592a3db7e 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -3772,12 +3772,15 @@ static ivas_error requantize_direction_EC_3( /* gradually increase the bits following the performance of the EC layer*/ int16_t j, k; int16_t use_vq; - int16_t diff, allowed_bits, nbits, last_j; + int16_t diff, allowed_bits, last_j; int16_t no_subframes, start_band; float st[MAX_PARAM_SPATIAL_SUBFRAMES], ct[MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t *bits_dir0; +#ifdef DEBUGGING + int16_t nbits; nbits = 0; +#endif no_subframes = q_direction->cfg.nblocks; start_band = q_direction->cfg.start_band; @@ -3808,7 +3811,9 @@ static ivas_error requantize_direction_EC_3( else /* 2D */ { diff = 0; +#ifdef DEBUGGING nbits = 0; +#endif for ( j = start_band; j < coding_subbands; j++ ) { bits_dir0 = (int16_t *) q_direction->band_data[j].bits_sph_idx; @@ -3834,11 +3839,19 @@ static ivas_error requantize_direction_EC_3( if ( q_direction->cfg.mc_ls_setup != MC_LS_SETUP_INVALID ) { +#ifdef DEBUGGING nbits += truncGR0_chan( azimuth_orig[j], q_direction->band_data[j].azimuth, q_direction->band_data[j].azimuth_index, no_subframes, allowed_bits, st, ct ); +#else + truncGR0_chan( azimuth_orig[j], q_direction->band_data[j].azimuth, q_direction->band_data[j].azimuth_index, no_subframes, allowed_bits, st, ct ); +#endif } else { +#ifdef DEBUGGING nbits += truncGR0( azimuth_orig[j], q_direction->band_data[j].azimuth, q_direction->band_data[j].azimuth_index, no_subframes, allowed_bits, st, ct ); +#else + truncGR0( azimuth_orig[j], q_direction->band_data[j].azimuth, q_direction->band_data[j].azimuth_index, no_subframes, allowed_bits, st, ct ); +#endif } if ( allowed_bits <= no_subframes + 1 ) @@ -3865,7 +3878,11 @@ static ivas_error requantize_direction_EC_3( &q_direction->band_data[j].azimuth_index[k], q_direction->cfg.mc_ls_setup ); q_direction->band_data[j].elevation_index[k] = 0; } +#ifdef DEBUGGING nbits += write_fixed_rate_direction( hMetaData, q_direction, j, no_subframes ); +#else + write_fixed_rate_direction( hMetaData, q_direction, j, no_subframes ); +#endif } } } -- GitLab From 1b5aa1e33e6707b4b1012786b394f2d77c452f7f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 5 Dec 2023 08:39:54 +0100 Subject: [PATCH 2/2] resolve outstanding unused varialbles --- lib_dec/ACcontextMapping_dec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/ACcontextMapping_dec.c b/lib_dec/ACcontextMapping_dec.c index f4818648cf..5ea080a9d1 100644 --- a/lib_dec/ACcontextMapping_dec.c +++ b/lib_dec/ACcontextMapping_dec.c @@ -349,10 +349,10 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( uint16_t r; int16_t resQBits; #ifdef DEBUGGING + int16_t nbbits_m2; int16_t rest_bits; #endif int16_t nt_half; - int16_t nbbits_m2; int16_t bits_tups; /* No. of bits for coding the no. of tuples */ set_s( x, 0, nt ); @@ -426,8 +426,8 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( /* Initialize range decoder */ rc_uni_dec_init( &rc_st_dec, &st->bit_stream[st->next_bit_pos], nbbits ); /* (nbbits + 30) entries are read by the decoder */ - nbbits_m2 = nbbits; #ifdef DEBUGGING + nbbits_m2 = nbbits; rest_bits = -nbbits_m2; #endif @@ -576,8 +576,8 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( /* Initialize range decoder */ rc_uni_dec_init( &rc_st_dec, &st->bit_stream[st->next_bit_pos], nbbits ); /* (nbbits + 30) entries are read by the decoder */ - nbbits_m2 = nbbits; #ifdef DEBUGGING + nbbits_m2 = nbbits; rest_bits = -nbbits_m2; #endif -- GitLab