From 0083bfbade299825e876db1c8cbb6e04ba6168f4 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 21 Dec 2023 20:23:02 +0530 Subject: [PATCH 1/2] Warning fixes for EVS changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [x] Few of the warnings are fixed. Includes few changes to BASOP function parameter datatypes. [x] Tested for EVS "26444_ce0_da0_e60_f40_g50-TestSeq_BASOP_26442" bit exactness with EVS fixed code.   978 out of 979 bit exact. One stream bit-inexactness to be debugged. [x] With EVS_FLOAT, one file additional failure observed with pytest as compared to previous version. --- Workspace_msvc/lib_debug.vcxproj | 2 +- lib_com/bits_alloc_fx.c | 22 +++++++++++----------- lib_com/bitstream.c | 8 ++++---- lib_com/complex_basop.c | 4 ++-- lib_com/complex_basop.h | 4 ++-- lib_com/enh64.c | 2 +- lib_com/enh64.h | 2 +- lib_com/hq_tools_fx.c | 2 +- lib_com/igf_base_fx.c | 10 +++++----- lib_com/options.h | 5 ++++- lib_com/prot_fx2.h | 16 ++++++++-------- lib_dec/core_dec_init_fx.c | 3 ++- lib_dec/dec_LPD_fx.c | 4 ++-- lib_dec/dec_acelp_tcx_main_fx.c | 2 +- lib_dec/dec_tcx_fx.c | 8 ++++---- lib_dec/igf_scf_dec_fx.c | 4 ++-- lib_dec/pitch_extr_fx.c | 2 +- lib_dec/stat_dec.h | 8 ++++---- lib_dec/tonalMDCTconcealment_fx.c | 4 ++-- lib_dec/waveadjust_fec_dec_fx.c | 2 +- 20 files changed, 59 insertions(+), 55 deletions(-) diff --git a/Workspace_msvc/lib_debug.vcxproj b/Workspace_msvc/lib_debug.vcxproj index bef619b8f..929dd72a8 100644 --- a/Workspace_msvc/lib_debug.vcxproj +++ b/Workspace_msvc/lib_debug.vcxproj @@ -57,7 +57,7 @@ Disabled ..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;DEBUGGING;DBG_WAV_WRITER;$(Macros);%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;DBG_WAV_WRITER;$(Macros);%(PreprocessorDefinitions) false EnableFastChecks diff --git a/lib_com/bits_alloc_fx.c b/lib_com/bits_alloc_fx.c index 6e7e49ed0..d5c292aba 100644 --- a/lib_com/bits_alloc_fx.c +++ b/lib_com/bits_alloc_fx.c @@ -44,7 +44,7 @@ typedef enum */ void BITS_ALLOC_init_config_acelp( const Word32 bit_rate, - const Word8 narrowBand, + const Word16 narrowBand, const Word16 nb_subfr, ACELP_config *pConfigAcelp /*o: configuration structure of ACELP*/ ) @@ -499,11 +499,11 @@ static ivas_error acelp_FCB_allocator( #if defined DEBUGGING if (cdbk < 0 && coder_type != TRANSITION) { - return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too low bit-budget for fixed innovation codebook (frame = %d). Exiting! \n", frame); + return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too low bit-budget for fixed innovation codebook (frame = %d). Exiting! \n"); } if ((L_subfr == L_SUBFR && cdbk >= ACELP_FIXED_CDK_NB) || (L_subfr == 2 * L_SUBFR && fcb_table(cdbk, L_subfr) == 128 /*stop value*/)) { - return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too high bit-budget for fixed innovation codebook (frame = %d). Exiting! \n", frame); + return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too high bit-budget for fixed innovation codebook (frame = %d). Exiting! \n"); } #endif @@ -646,12 +646,12 @@ ivas_error config_acelp1( #if defined DEBUGGING if (((core_brate_inp < 5900 && coder_type > UNVOICED) && !(core_brate_inp < MIN_TC_BRATE && coder_type == TRANSITION)) && !(idchan > 0 && element_mode == IVAS_CPE_TD) && !(element_mode == IVAS_SCE && tdm_low_rate_mode)) { - return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too low bitrate (%d bps) for ACELP@12k8 in frame %d. Exiting!\n", core_brate_inpI, frame); + return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too low bitrate (%d bps) for ACELP@12k8 in frame %d. Exiting!\n", core_brate_inpI); } if (core_brate_inp > ACELP_12k8_HIGH_LIMIT && core == ACELP_CORE) { - return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too high bitrate (%d bps) for ACELP@12k8 in frame %d. Exiting!\n", core_brate_inpI, frame); + return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too high bitrate (%d bps) for ACELP@12k8 in frame %d. Exiting!\n", core_brate_inpI); } #endif } @@ -662,7 +662,7 @@ ivas_error config_acelp1( #if defined DEBUGGING if (core_brate_inp < ACELP_16k_LOW_LIMIT && core == ACELP_CORE) { - return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too low bitrate (%d bps) for ACELP@16k in frame %d. Exiting!\n", core_brate_inpI, frame); + return IVAS_ERROR(IVAS_ERR_INTERNAL_FATAL, "Error: Too low bitrate (%d bps) for ACELP@16k in frame %d. Exiting!\n", core_brate_inpI); } #endif } @@ -1183,7 +1183,7 @@ ivas_error config_acelp1( i = s_min(i, 13); #ifdef DEBUG_MODE_TD if (i < 0) - IVAS_ERROR(IVAS_ERR_INTERNAL, "ERROR::: UC negative index should not happen at frame %d\n", frame); + IVAS_ERROR(IVAS_ERR_INTERNAL, "ERROR::: UC negative index should not happen at frame %d\n"); #endif i = s_max(i, 0); /* If i == 0-> random noise generator will be used as FCB */ set16_fx(acelp_cfg->fixed_cdk_index, i, NB_SUBFR); @@ -1222,7 +1222,7 @@ ivas_error config_acelp1( else /* No FCB */ { #if defined DEBUGGING - IVAS_ERROR(IVAS_ERR_INTERNAL, "WARNING!!!, No bit allocated to FCB, check frame %d\n", frame); + IVAS_ERROR(IVAS_ERR_INTERNAL, "WARNING!!!, No bit allocated to FCB, check frame %d\n"); #endif acelp_cfg->fixed_cdk_index[0] = -1; acelp_cfg->fixed_cdk_index[1] = -1; @@ -1378,7 +1378,7 @@ ivas_error config_acelp1( else if (flag_hardcoded && core == ACELP_CORE && bits != 0) { #if defined DEBUGGING - IVAS_ERROR(IVAS_ERR_INTERNAL, "ERROR: bit-budget incorrect (%d bits) in frame %d.\n", (Word32)bits, frame); + IVAS_ERROR(IVAS_ERR_INTERNAL, "ERROR: bit-budget incorrect (%d bits) in frame %d.\n", (Word32)bits); #endif } else if (bits > 0 && !(coder_type == UNVOICED && tdm_low_rate_mode == 1 && element_mode == IVAS_CPE_TD)) @@ -1444,7 +1444,7 @@ ivas_error config_acelp1( #if defined DEBUGGING if (idchan > 0 && bits > 0 && (coder_type > UNVOICED || tdm_low_rate_mode == 0)) { - IVAS_ERROR(IVAS_ERR_INTERNAL, "WARNING !! Unused bits in secondary channel at frame %d\n", frame); + IVAS_ERROR(IVAS_ERR_INTERNAL, "WARNING !! Unused bits in secondary channel at frame %d\n"); } #endif } @@ -1472,7 +1472,7 @@ ivas_error config_acelp1( else if (bits < 0 && !(coder_type == UNVOICED && tdm_low_rate_mode == 1 && element_mode == IVAS_CPE_TD)) { #if defined DEBUGGING - IVAS_ERROR(IVAS_ERR_INTERNAL, "ERROR: bit-budget incorrect (%d bits) in frame %d.\n", (Word32)bits, frame); + IVAS_ERROR(IVAS_ERR_INTERNAL, "ERROR: bit-budget incorrect (%d bits) in frame %d.\n", (Word32)bits); #endif } } diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index e99454c93..b863ec344 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -862,7 +862,7 @@ ivas_error check_ind_list_limits( } else { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted in frame %d! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", frame, hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits ); + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted in frame %d! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits ); } } @@ -893,7 +893,7 @@ ivas_error push_indice( /* check the limits of the list of indices */ if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK ) { - return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n", frame ); + return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n" ); } /* find the location in the list of indices based on ID */ @@ -1013,7 +1013,7 @@ ivas_error push_next_bits( /* check the limits of the list of indices */ if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK ) { - return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame ); + return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n" ); } ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; @@ -1029,7 +1029,7 @@ ivas_error push_next_bits( /* check the limits of the list of indices */ if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK ) { - return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame ); + return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n" ); } ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; diff --git a/lib_com/complex_basop.c b/lib_com/complex_basop.c index 3a65d65a6..b63d76cc7 100644 --- a/lib_com/complex_basop.c +++ b/lib_com/complex_basop.c @@ -32,7 +32,7 @@ extern int currCounter; /* ================================ New Complex Basops ========================= */ -cmplx CL_shr (cmplx inp, Word32 shift_val) { +cmplx CL_shr (cmplx inp, Word16 shift_val) { cmplx out; out.re = L_shr (inp.re, shift_val); out.im = L_shr (inp.im, shift_val); @@ -44,7 +44,7 @@ cmplx CL_shr (cmplx inp, Word32 shift_val) { return out; } -cmplx CL_shl (cmplx inp, Word32 shift_val) { +cmplx CL_shl (cmplx inp, Word16 shift_val) { cmplx out; out.re = L_shl (inp.re, shift_val); out.im = L_shl (inp.im, shift_val); diff --git a/lib_com/complex_basop.h b/lib_com/complex_basop.h index c3deb1455..3c1a8f715 100644 --- a/lib_com/complex_basop.h +++ b/lib_com/complex_basop.h @@ -34,8 +34,8 @@ typedef struct |___________________________________________________________________________| */ -cmplx CL_shr (cmplx inp, Word32 shift_val); -cmplx CL_shl (cmplx inp, Word32 shift_val); +cmplx CL_shr (cmplx inp, Word16 shift_val); +cmplx CL_shl (cmplx inp, Word16 shift_val); cmplx CL_add (cmplx inp1, cmplx inp2); cmplx CL_sub (cmplx inp1, cmplx inp2); cmplx CL_scale (cmplx x, Word16 y); diff --git a/lib_com/enh64.c b/lib_com/enh64.c index 95d844cb1..db1c8ee64 100644 --- a/lib_com/enh64.c +++ b/lib_com/enh64.c @@ -1062,7 +1062,7 @@ Word64 W_msu_16_16 (Word64 L64_var1, Word16 var2, Word16 var3) { | range : 0x8000 0000 <= L_result <= 0x7fff 0000. | |___________________________________________________________________________| */ -Word32 W_shl_sat_l (Word64 L64_var, Word32 n) { +Word32 W_shl_sat_l (Word64 L64_var, Word16 n) { Word32 L_result; Word64 d_var_64; diff --git a/lib_com/enh64.h b/lib_com/enh64.h index 9364c250d..6c0b82393 100644 --- a/lib_com/enh64.h +++ b/lib_com/enh64.h @@ -42,7 +42,7 @@ Word64 W_deposit32_h (Word32 L_var1); Word32 W_sat_l (Word64 L64_var); Word32 W_sat_m (Word64 L64_var); -Word32 W_shl_sat_l (Word64 L64_var, Word32 n); +Word32 W_shl_sat_l (Word64 L64_var, Word16 n); Word32 W_extract_l (Word64 L64_var1); Word32 W_extract_h (Word64 L64_var1); diff --git a/lib_com/hq_tools_fx.c b/lib_com/hq_tools_fx.c index f4154c3ed..48021070d 100644 --- a/lib_com/hq_tools_fx.c +++ b/lib_com/hq_tools_fx.c @@ -937,7 +937,7 @@ void harm_bwe_fx( #ifdef DEBUGGING else { - PMT("VERIFY if this really matches IVAS float") + //PMT("VERIFY if this really matches IVAS float") } #endif tmp1 = s_max(tmp1, 16384); diff --git a/lib_com/igf_base_fx.c b/lib_com/igf_base_fx.c index 4bd7ec7a4..35564ffff 100644 --- a/lib_com/igf_base_fx.c +++ b/lib_com/igf_base_fx.c @@ -1054,14 +1054,14 @@ Word16 IGFCommonFuncsIGFGetCFTables( const Word16 bwidth, /* i : audio bandwidth */ const Word16 element_mode, /* i : element mode */ const Word16 rf_mode, /* i : flag to signal the RF mode */ - const Word16** cf_se00, /* o : CF table for t == 0 and f == 0 */ - const Word16** cf_se01, /* o : CF table for t == 0 and f == 1 */ + const uint16_t** cf_se00, /* o : CF table for t == 0 and f == 0 */ + const uint16_t** cf_se01, /* o : CF table for t == 0 and f == 1 */ Word16* cf_off_se01, /* o : offset for CF table above */ - const Word16** cf_se02, /* o : CF tables for t == 0 and f >= 2 */ + const uint16_t** cf_se02, /* o : CF tables for t == 0 and f >= 2 */ const Word16** cf_off_se02, /* o : offsets for CF tables above */ - const Word16** cf_se10, /* o : CF table for t == 1 and f == 0 */ + const uint16_t** cf_se10, /* o : CF table for t == 1 and f == 0 */ Word16* cf_off_se10, /* o : offset for CF table above */ - const Word16** cf_se11, /* o : CF tables for t == 1 and f >= 1 */ + const uint16_t** cf_se11, /* o : CF tables for t == 1 and f >= 1 */ const Word16** cf_off_se11 /* o : offsets for CF tables above */ ) { diff --git a/lib_com/options.h b/lib_com/options.h index 13c4c11a1..0dae2c6ae 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -36,7 +36,10 @@ #ifndef OPTIONS_H #define OPTIONS_H - +#define DEBUGGING /*allows message printed out during run time */ +#ifdef DEBUGGING +#include "debug.h" +#endif /* clang-format off */ /* ################### Start compiler switches ######################## */ diff --git a/lib_com/prot_fx2.h b/lib_com/prot_fx2.h index 56b80d1a5..37708c0f6 100644 --- a/lib_com/prot_fx2.h +++ b/lib_com/prot_fx2.h @@ -3800,7 +3800,7 @@ void cldfb_reset_memory(HANDLE_CLDFB_FILTER_BANK hs); /* i/o: cldfb handle //bits_alloc.c from IVAS void BITS_ALLOC_init_config_acelp( const Word32 bit_rate, - const Word8 narrowBand, + const Word16 narrowBand, const Word16 nb_subfr, ACELP_config *pConfigAcelp /*o: configuration structure of ACELP*/ ); @@ -4661,14 +4661,14 @@ Word16 IGFCommonFuncsIGFGetCFTables( const Word16 bwidth, /* i : audio bandwidth */ const Word16 element_mode, /* i : element mode */ const Word16 rf_mode, /* i : flag to signal the RF mode */ - const Word16** cf_se00, /* o : CF table for t == 0 and f == 0 */ - const Word16** cf_se01, /* o : CF table for t == 0 and f == 1 */ + const uint16_t** cf_se00, /* o : CF table for t == 0 and f == 0 */ + const uint16_t** cf_se01, /* o : CF table for t == 0 and f == 1 */ Word16* cf_off_se01, /* o : offset for CF table above */ - const Word16** cf_se02, /* o : CF tables for t == 0 and f >= 2 */ + const uint16_t** cf_se02, /* o : CF tables for t == 0 and f >= 2 */ const Word16** cf_off_se02, /* o : offsets for CF tables above */ - const Word16** cf_se10, /* o : CF table for t == 1 and f == 0 */ + const uint16_t** cf_se10, /* o : CF table for t == 1 and f == 0 */ Word16* cf_off_se10, /* o : offset for CF table above */ - const Word16** cf_se11, /* o : CF tables for t == 1 and f >= 1 */ + const uint16_t** cf_se11, /* o : CF tables for t == 1 and f >= 1 */ const Word16** cf_off_se11 /* o : offsets for CF tables above */ ); //ari_fx.c @@ -5065,7 +5065,7 @@ void TonalMDCTConceal_InsertNoise( const TonalMDCTConcealPtr hTonalMDCTConc, /*IN */ Word32* mdctSpectrum, /*OUT*/ Word16* mdctSpectrum_exp, /*OUT*/ - const Word8 tonalConcealmentActive, + const Word16 tonalConcealmentActive, Word16* pSeed, /*IN/OUT*/ const Word16 tiltCompFactor, Word16 crossfadeGain, @@ -5283,7 +5283,7 @@ void TonalMDCTConceal_Apply( Word16 /* int*/ pit_max, /* i: Maximum pitch lag */ /*Q0 */ Word16 /*float*/ *mem_pitch_gain, /* i: pitch gain [0] is the most recent subfr gain */ /*Q0*/ Word16 /* int*/ limitation, - Word8 /*short*/ plc_use_future_lag, /* i: */ /*Q0 */ + Word16 /*short*/ plc_use_future_lag, /* i: */ /*Q0 */ Word16 /*short*/ *extrapolationFailed, /* o: flag if extrap decides not to change the pitch *//*Q0 */ Word16 nb_subfr /* i: number of ACELP subframes */ ); diff --git a/lib_dec/core_dec_init_fx.c b/lib_dec/core_dec_init_fx.c index b1d4d8300..f9d8aabd3 100644 --- a/lib_dec/core_dec_init_fx.c +++ b/lib_dec/core_dec_init_fx.c @@ -258,7 +258,8 @@ void open_decoder_LPD( { if ((st->hTECDec = (TEC_DEC_HANDLE)malloc(sizeof(TEC_DEC_DATA))) == NULL) { - return (IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TEC\n")); + //return (IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TEC\n")); + assert(0); } } else diff --git a/lib_dec/dec_LPD_fx.c b/lib_dec/dec_LPD_fx.c index afa4a82a0..8d532ea11 100644 --- a/lib_dec/dec_LPD_fx.c +++ b/lib_dec/dec_LPD_fx.c @@ -389,7 +389,7 @@ void decoder_LPD( xsfBase = PlcGetLsfBase (st->lpcQuantization, (Word16)st->narrowBand, st->sr_core); dlpc_bfi( st->L_frame,xsfnew_uw,st->lsfold_uw,st->last_good_fx,st->nbLostCmpt,st->mem_MA_fx,st->mem_AR_fx, - &(st->stab_fac_fx), st->lsf_adaptive_mean_fx, st->numlpc, st->lsf_cng, st->plcBackgroundNoiseUpdated, st->lsf_q_cng, st->old_lsf_q_cng, xsfBase, (Word8)st->tcxonly); + &(st->stab_fac_fx), st->lsf_adaptive_mean_fx, st->numlpc, st->lsf_cng, (Word8)st->plcBackgroundNoiseUpdated, st->lsf_q_cng, st->old_lsf_q_cng, xsfBase, (Word8)st->tcxonly); hTcxDec->envWeighted = 0; move16(); @@ -954,7 +954,7 @@ void decoder_LPD( { if(!bfi) { - st->plcInfo.nbLostCmpt = L_deposit_l(0); + st->plcInfo.nbLostCmpt = (int16_t)L_deposit_l(0); } IF (st->core == 0) diff --git a/lib_dec/dec_acelp_tcx_main_fx.c b/lib_dec/dec_acelp_tcx_main_fx.c index 5ba4c53d3..4120f7c5c 100644 --- a/lib_dec/dec_acelp_tcx_main_fx.c +++ b/lib_dec/dec_acelp_tcx_main_fx.c @@ -361,7 +361,7 @@ Word16 dec_acelp_tcx_frame( { /* Copy back parameters from previous frame, because there is a high risk they are corrupt * DO concealment with configuration used in previous frame */ - st->m_frame_type = m_frame_type; + st->m_frame_type = (uint8_t)m_frame_type; move16(); st->bwidth = bwidth; move16(); diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 076abe402..278317290 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -1776,7 +1776,7 @@ static void IMDCT(Word32 *x, Word16 x_e, move16(); tmp3 = st->last_core_bfi; move16(); - tmp8 = st->last_is_cng; + tmp8 = (Word8)st->last_is_cng; move16(); IF (w > 0) { @@ -1947,7 +1947,7 @@ static void IMDCT(Word32 *x, Word16 x_e, shl(L_win,1), tmp_offset, st->last_core_bfi, - st->last_is_cng, + (Word8)st->last_is_cng, fullbandScale ); @@ -1976,7 +1976,7 @@ static void IMDCT(Word32 *x, Word16 x_e, move16(); } - tmp8 = st->last_is_cng; + tmp8 = (Word8)st->last_is_cng; move16(); if (frame_cnt > 0) { @@ -2087,7 +2087,7 @@ static void IMDCT(Word32 *x, Word16 x_e, tmp3 = st->last_core_bfi; move16(); - tmp8 = st->last_is_cng; + tmp8 = (Word8)st->last_is_cng; move16(); tcx_windowing_synthesis_current_frame( xn_buf, tcx_aldo_window_2, diff --git a/lib_dec/igf_scf_dec_fx.c b/lib_dec/igf_scf_dec_fx.c index fc732cc89..23ac1c958 100644 --- a/lib_dec/igf_scf_dec_fx.c +++ b/lib_dec/igf_scf_dec_fx.c @@ -91,7 +91,7 @@ static Word16 arith_decode_bits_fx( static Word16 arith_decode_residual_fx( IGFSCFDEC_INSTANCE_HANDLE hPrivateData, /* i/o: instance handle */ Decoder_State *st, /* i/o: pointer to decoder state */ - const Word16 *cumulativeFrequencyTable, /* i: cumulative frequency table to be used */ + const UWord16 *cumulativeFrequencyTable, /* i: cumulative frequency table to be used */ Word16 tableOffset /* i: offset used to align the table */ ) { @@ -101,7 +101,7 @@ static Word16 arith_decode_residual_fx( /* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */ - val = ari_decode_14bits_s27_ext(st, &hPrivateData->acState, (const UWord16*) cumulativeFrequencyTable); + val = ari_decode_14bits_s27_ext(st, &hPrivateData->acState, cumulativeFrequencyTable); /* meaning of the values of val: */ /* esc_{0} IGF_MIN_ENC_SEPARATE ... IGF_MAX_ENC_SEPARATE esc_{IGF_SYMBOLS_IN_TABLE - 1} */ diff --git a/lib_dec/pitch_extr_fx.c b/lib_dec/pitch_extr_fx.c index 0a2e3751b..c45be91f7 100644 --- a/lib_dec/pitch_extr_fx.c +++ b/lib_dec/pitch_extr_fx.c @@ -38,7 +38,7 @@ void pitch_pred_linear_fit( Word16 /* int*/ pit_max, /* i: Maximum pitch lag */ /*Q0 */ Word16 /*float*/ *mem_pitch_gain, /* i: pitch gain [0] is the most recent subfr gain */ /*Q14*/ Word16 /* int*/ limitation, - Word8 /*short*/ plc_use_future_lag, /* i: */ /*Q0 */ + Word16 /*short*/ plc_use_future_lag, /* i: */ /*Q0 */ Word16 /*short*/ *extrapolationFailed,/* o: flag if extrap decides not to change the pitch */ /*Q0 */ Word16 nb_subfr /* i: number of ACELP subframes*/ ) diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 8281b3fba..ed67d2e3e 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -291,9 +291,9 @@ typedef struct typedef struct { uint16_t numIndexes; - Word16 indexOfTonalPeak[MAX_NUMBER_OF_IDX]; - Word16 lowerIndex[MAX_NUMBER_OF_IDX]; - Word16 upperIndex[MAX_NUMBER_OF_IDX]; + uint16_t indexOfTonalPeak[MAX_NUMBER_OF_IDX]; + uint16_t lowerIndex[MAX_NUMBER_OF_IDX]; + uint16_t upperIndex[MAX_NUMBER_OF_IDX]; Float32 phaseDiff_float[MAX_NUMBER_OF_IDX]; /* This one can be stored with 16 bits in range 0..2*PI */ @@ -303,7 +303,7 @@ typedef struct typedef struct { - uint16_t numIndexes; + Word16 numIndexes; Word16 indexOfTonalPeak[MAX_NUMBER_OF_IDX]; Word16 lowerIndex[MAX_NUMBER_OF_IDX]; Word16 upperIndex[MAX_NUMBER_OF_IDX]; diff --git a/lib_dec/tonalMDCTconcealment_fx.c b/lib_dec/tonalMDCTconcealment_fx.c index 81d81bbf8..3117d1427 100644 --- a/lib_dec/tonalMDCTconcealment_fx.c +++ b/lib_dec/tonalMDCTconcealment_fx.c @@ -285,7 +285,7 @@ TONALMDCTCONCEAL_ERROR TonalMDCTConceal_UpdateState(TonalMDCTConcealPtr hTonalMD IF (badBlock) { - newBlockIsValid = hTonalMDCTConc->lastBlockData.blockIsValid; + newBlockIsValid = (Word8)hTonalMDCTConc->lastBlockData.blockIsValid; move16(); } ELSE @@ -767,7 +767,7 @@ void TonalMDCTConceal_InsertNoise( const TonalMDCTConcealPtr hTonalMDCTConc, /*IN */ Word32* mdctSpectrum, /*OUT*/ Word16* mdctSpectrum_exp, /*OUT*/ - const Word8 tonalConcealmentActive, + const Word16 tonalConcealmentActive, Word16* pSeed, /*IN/OUT*/ const Word16 tiltCompFactor, Word16 crossfadeGain, diff --git a/lib_dec/waveadjust_fec_dec_fx.c b/lib_dec/waveadjust_fec_dec_fx.c index ee4940797..ba1a91687 100644 --- a/lib_dec/waveadjust_fec_dec_fx.c +++ b/lib_dec/waveadjust_fec_dec_fx.c @@ -804,7 +804,7 @@ void concealment_init_x(Word16 N, void *_plcInfo) move16(); plcInfo->subframe_fx = 0; move16(); - plcInfo->nbLostCmpt = L_deposit_l(0); + plcInfo->nbLostCmpt = (int16_t)L_deposit_l(0); plcInfo->seed = 21845; move16(); -- GitLab From 0b745908a104ef1b20c281ef9b9ac394347bf4b8 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 21 Dec 2023 21:00:37 +0530 Subject: [PATCH 2/2] Linux build fix --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0dae2c6ae..93565a3d7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -36,7 +36,7 @@ #ifndef OPTIONS_H #define OPTIONS_H -#define DEBUGGING /*allows message printed out during run time */ +//#define DEBUGGING /*allows message printed out during run time */ #ifdef DEBUGGING #include "debug.h" #endif -- GitLab