Loading lib_com/env_stab.c +7 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ #include "prot.h" #include "rom_com.h" #include "wmc_auto.h" #ifdef FIX_594_STL_INCLUDE #include "stl.h" #endif #ifdef DEBUGGING #include "assert.h" #endif Loading Loading @@ -92,8 +95,12 @@ float env_stability( #ifdef BASOP_NOGLOB Overflow = 0; env_delta = shl_o( *mem_env_delta, 1, &Overflow ); #else #ifdef FIX_595_SHL_NOGLOB env_delta = shl( *mem_env_delta, 1 ); #else env_delta = shl_o( *mem_env_delta, 1 ); #endif #endif } else Loading lib_com/ifft_rel.c +4 −0 Original line number Diff line number Diff line Loading @@ -229,7 +229,11 @@ void ifft_rel( *-----------------------------------------------------------------*/ idx = fft256_read_indexes; #ifdef FIX_622_SILENCE_USAN_WARNING xi0 = &temp[0] - 1; #else xi0 = temp - 1; #endif if ( n == 128 ) { for ( i = 0; i < n; i++ ) Loading lib_com/ivas_cnst.h +5 −0 Original line number Diff line number Diff line Loading @@ -887,7 +887,12 @@ enum fea_names #define MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE 3 typedef enum { #ifdef FIX_619_ADD_UNDEF_VAL_FOR_CONCEALMENT_MODE NOISE_GEN_MODE_UNDEF = -1, EQUAL_CORES = 0, #else EQUAL_CORES, #endif TCX10_IN_0_TCX20_IN_1, TCX20_IN_0_TCX10_IN_1, } TONALMDCTCONC_NOISE_GEN_MODE; Loading lib_com/ivas_cov_smooth.c +87 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ #include "prot.h" #define BAND_SMOOTH_REST_START_IDX ( 2 ) #ifndef CODE_CLEAN_UP_DIRAC /*-----------------------------------------------------------------------------------------* * Function ivas_set_up_cov_smoothing() * Loading Loading @@ -138,7 +139,93 @@ static void ivas_set_up_cov_smoothing( return; } #else /*-----------------------------------------------------------------------------------------* * Function ivas_calculate_update_factor() * * To calculate the update factor *-----------------------------------------------------------------------------------------*/ static float ivas_calculate_update_factor( float *p_bin_to_band, int16_t active_bins ) { float update_factor_temp = 0.0f; int16_t k; for ( k = 0; k < active_bins; k++ ) { update_factor_temp += p_bin_to_band[k]; } return update_factor_temp; } /*-----------------------------------------------------------------------------------------* * Function ivas_calculate_smoothning_factor() * * To calculate the Smoothning factor *-----------------------------------------------------------------------------------------*/ static void ivas_calculate_smoothning_factor( float *Smoothing_factor, float update_factor, const int16_t min_pool_size, const float max_update_rate, const COV_SMOOTHING_TYPE smooth_mode, const int32_t ivas_total_brate, int16_t j ) { float smooth_fact; *Smoothing_factor = update_factor / min_pool_size; if ( smooth_mode != COV_SMOOTH_MC ) { if ( ivas_total_brate < IVAS_24k4 ) { smooth_fact = 0.5f; } else { smooth_fact = 0.75f; } *Smoothing_factor *= ( j + 1 ) * smooth_fact; } if ( *Smoothing_factor > max_update_rate ) { *Smoothing_factor = max_update_rate; } } /*-----------------------------------------------------------------------------------------* * Function ivas_set_up_cov_smoothing() * * Setup for covariance smoothing *-----------------------------------------------------------------------------------------*/ static void ivas_set_up_cov_smoothing( ivas_cov_smooth_state_t *hCovState, ivas_filterbank_t *pFb, const float max_update_rate, const int16_t min_pool_size, const COV_SMOOTHING_TYPE smooth_mode, /* i : flag multichannel vs SPAR */ const int32_t ivas_total_brate ) { int16_t j; float update_factor; if ( smooth_mode == COV_SMOOTH_MC ) { for ( j = 0; j < pFb->filterbank_num_bands; j++ ) { int16_t active_bins = pFb->fb_bin_to_band.pFb_active_bins_per_band[j]; update_factor = ivas_calculate_update_factor( pFb->fb_bin_to_band.pFb_bin_to_band[j], active_bins ); ivas_calculate_smoothning_factor( &hCovState->pSmoothing_factor[j], update_factor, min_pool_size, max_update_rate, smooth_mode, ivas_total_brate, j ); } } else { for ( j = 0; j < pFb->filterbank_num_bands; j++ ) { float *p_bin_to_band = pFb->fb_bin_to_band.pp_short_stride_bin_to_band[j]; int16_t active_bins = pFb->fb_bin_to_band.p_short_stride_num_bins_per_band[j]; update_factor = ivas_calculate_update_factor( p_bin_to_band, active_bins ); ivas_calculate_smoothning_factor( &hCovState->pSmoothing_factor[j], update_factor, min_pool_size, max_update_rate, smooth_mode, ivas_total_brate, j ); } } hCovState->prior_bank_idx = -1; } #endif /*------------------------------------------------------------------------- * ivas_spar_covar_smooth_enc_open() Loading lib_com/ivas_prot.h +32 −2 Original line number Diff line number Diff line Loading @@ -4252,6 +4252,10 @@ void ivas_sba_mix_matrix_determiner( const int16_t bfi, /* i : BFI flag */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame /* i : output frame length */ #ifdef VLBR_20MS_MD , const int16_t num_md_sub_frames /* i : number of subframes in mixing matrix */ #endif ); /* AGC */ Loading Loading @@ -4525,8 +4529,11 @@ void ivas_calc_c_p_coeffs( const int16_t num_dmx, const int16_t band_idx, const int16_t dtx_vad, const int16_t compute_p_flag, const int16_t compute_p_flag #ifndef FIX_280_PLANAR_CP , const int16_t planarCP #endif ); void ivas_get_spar_md_from_dirac( Loading @@ -4551,7 +4558,23 @@ void ivas_get_spar_md_from_dirac( int16_t ivas_get_spar_dec_md_num_subframes( const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int32_t ivas_total_brate /* i : IVAS total bitrate */ #ifdef VLBR_20MS_MD , const int32_t ivas_last_active_brate /* i : IVAS last active bitrate */ #endif ); #ifdef VLBR_20MS_MD ivas_error ivas_spar_md_dec_matrix_open( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t num_channels, /* i : number of internal channels */ const int16_t num_md_sub_frames ); void ivas_spar_md_dec_matrix_close( ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ const int16_t num_channels ); /* i : number of internal channels */ #endif ivas_error ivas_spar_md_dec_open( ivas_spar_md_dec_state_t **hMdDec_out, /* i/o: SPAR MD decoder handle */ Loading @@ -4559,6 +4582,10 @@ ivas_error ivas_spar_md_dec_open( const int16_t num_channels, /* i : number of internal channels */ const int16_t sba_order, /* i : SBA order */ const int16_t sid_format /* i : SID format */ #ifdef VLBR_20MS_MD , const int32_t last_active_ivas_total_brate /* i : IVAS last active bitrate */ #endif ); void ivas_spar_md_dec_close( Loading Loading @@ -4995,8 +5022,11 @@ void ivas_copy_band_coeffs_idx_to_arr( const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, const ivas_coeffs_type_t coeff_type, const ivas_coeffs_type_t coeff_type #ifndef FIX_280_PLANAR_CP , const int16_t planarCP #endif ); void ivas_clear_band_coeffs( Loading Loading
lib_com/env_stab.c +7 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ #include "prot.h" #include "rom_com.h" #include "wmc_auto.h" #ifdef FIX_594_STL_INCLUDE #include "stl.h" #endif #ifdef DEBUGGING #include "assert.h" #endif Loading Loading @@ -92,8 +95,12 @@ float env_stability( #ifdef BASOP_NOGLOB Overflow = 0; env_delta = shl_o( *mem_env_delta, 1, &Overflow ); #else #ifdef FIX_595_SHL_NOGLOB env_delta = shl( *mem_env_delta, 1 ); #else env_delta = shl_o( *mem_env_delta, 1 ); #endif #endif } else Loading
lib_com/ifft_rel.c +4 −0 Original line number Diff line number Diff line Loading @@ -229,7 +229,11 @@ void ifft_rel( *-----------------------------------------------------------------*/ idx = fft256_read_indexes; #ifdef FIX_622_SILENCE_USAN_WARNING xi0 = &temp[0] - 1; #else xi0 = temp - 1; #endif if ( n == 128 ) { for ( i = 0; i < n; i++ ) Loading
lib_com/ivas_cnst.h +5 −0 Original line number Diff line number Diff line Loading @@ -887,7 +887,12 @@ enum fea_names #define MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE 3 typedef enum { #ifdef FIX_619_ADD_UNDEF_VAL_FOR_CONCEALMENT_MODE NOISE_GEN_MODE_UNDEF = -1, EQUAL_CORES = 0, #else EQUAL_CORES, #endif TCX10_IN_0_TCX20_IN_1, TCX20_IN_0_TCX10_IN_1, } TONALMDCTCONC_NOISE_GEN_MODE; Loading
lib_com/ivas_cov_smooth.c +87 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ #include "prot.h" #define BAND_SMOOTH_REST_START_IDX ( 2 ) #ifndef CODE_CLEAN_UP_DIRAC /*-----------------------------------------------------------------------------------------* * Function ivas_set_up_cov_smoothing() * Loading Loading @@ -138,7 +139,93 @@ static void ivas_set_up_cov_smoothing( return; } #else /*-----------------------------------------------------------------------------------------* * Function ivas_calculate_update_factor() * * To calculate the update factor *-----------------------------------------------------------------------------------------*/ static float ivas_calculate_update_factor( float *p_bin_to_band, int16_t active_bins ) { float update_factor_temp = 0.0f; int16_t k; for ( k = 0; k < active_bins; k++ ) { update_factor_temp += p_bin_to_band[k]; } return update_factor_temp; } /*-----------------------------------------------------------------------------------------* * Function ivas_calculate_smoothning_factor() * * To calculate the Smoothning factor *-----------------------------------------------------------------------------------------*/ static void ivas_calculate_smoothning_factor( float *Smoothing_factor, float update_factor, const int16_t min_pool_size, const float max_update_rate, const COV_SMOOTHING_TYPE smooth_mode, const int32_t ivas_total_brate, int16_t j ) { float smooth_fact; *Smoothing_factor = update_factor / min_pool_size; if ( smooth_mode != COV_SMOOTH_MC ) { if ( ivas_total_brate < IVAS_24k4 ) { smooth_fact = 0.5f; } else { smooth_fact = 0.75f; } *Smoothing_factor *= ( j + 1 ) * smooth_fact; } if ( *Smoothing_factor > max_update_rate ) { *Smoothing_factor = max_update_rate; } } /*-----------------------------------------------------------------------------------------* * Function ivas_set_up_cov_smoothing() * * Setup for covariance smoothing *-----------------------------------------------------------------------------------------*/ static void ivas_set_up_cov_smoothing( ivas_cov_smooth_state_t *hCovState, ivas_filterbank_t *pFb, const float max_update_rate, const int16_t min_pool_size, const COV_SMOOTHING_TYPE smooth_mode, /* i : flag multichannel vs SPAR */ const int32_t ivas_total_brate ) { int16_t j; float update_factor; if ( smooth_mode == COV_SMOOTH_MC ) { for ( j = 0; j < pFb->filterbank_num_bands; j++ ) { int16_t active_bins = pFb->fb_bin_to_band.pFb_active_bins_per_band[j]; update_factor = ivas_calculate_update_factor( pFb->fb_bin_to_band.pFb_bin_to_band[j], active_bins ); ivas_calculate_smoothning_factor( &hCovState->pSmoothing_factor[j], update_factor, min_pool_size, max_update_rate, smooth_mode, ivas_total_brate, j ); } } else { for ( j = 0; j < pFb->filterbank_num_bands; j++ ) { float *p_bin_to_band = pFb->fb_bin_to_band.pp_short_stride_bin_to_band[j]; int16_t active_bins = pFb->fb_bin_to_band.p_short_stride_num_bins_per_band[j]; update_factor = ivas_calculate_update_factor( p_bin_to_band, active_bins ); ivas_calculate_smoothning_factor( &hCovState->pSmoothing_factor[j], update_factor, min_pool_size, max_update_rate, smooth_mode, ivas_total_brate, j ); } } hCovState->prior_bank_idx = -1; } #endif /*------------------------------------------------------------------------- * ivas_spar_covar_smooth_enc_open() Loading
lib_com/ivas_prot.h +32 −2 Original line number Diff line number Diff line Loading @@ -4252,6 +4252,10 @@ void ivas_sba_mix_matrix_determiner( const int16_t bfi, /* i : BFI flag */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame /* i : output frame length */ #ifdef VLBR_20MS_MD , const int16_t num_md_sub_frames /* i : number of subframes in mixing matrix */ #endif ); /* AGC */ Loading Loading @@ -4525,8 +4529,11 @@ void ivas_calc_c_p_coeffs( const int16_t num_dmx, const int16_t band_idx, const int16_t dtx_vad, const int16_t compute_p_flag, const int16_t compute_p_flag #ifndef FIX_280_PLANAR_CP , const int16_t planarCP #endif ); void ivas_get_spar_md_from_dirac( Loading @@ -4551,7 +4558,23 @@ void ivas_get_spar_md_from_dirac( int16_t ivas_get_spar_dec_md_num_subframes( const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int32_t ivas_total_brate /* i : IVAS total bitrate */ #ifdef VLBR_20MS_MD , const int32_t ivas_last_active_brate /* i : IVAS last active bitrate */ #endif ); #ifdef VLBR_20MS_MD ivas_error ivas_spar_md_dec_matrix_open( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t num_channels, /* i : number of internal channels */ const int16_t num_md_sub_frames ); void ivas_spar_md_dec_matrix_close( ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ const int16_t num_channels ); /* i : number of internal channels */ #endif ivas_error ivas_spar_md_dec_open( ivas_spar_md_dec_state_t **hMdDec_out, /* i/o: SPAR MD decoder handle */ Loading @@ -4559,6 +4582,10 @@ ivas_error ivas_spar_md_dec_open( const int16_t num_channels, /* i : number of internal channels */ const int16_t sba_order, /* i : SBA order */ const int16_t sid_format /* i : SID format */ #ifdef VLBR_20MS_MD , const int32_t last_active_ivas_total_brate /* i : IVAS last active bitrate */ #endif ); void ivas_spar_md_dec_close( Loading Loading @@ -4995,8 +5022,11 @@ void ivas_copy_band_coeffs_idx_to_arr( const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, const ivas_coeffs_type_t coeff_type, const ivas_coeffs_type_t coeff_type #ifndef FIX_280_PLANAR_CP , const int16_t planarCP #endif ); void ivas_clear_band_coeffs( Loading