Loading lib_com/ivas_cov_smooth.c +37 −3 Original line number Diff line number Diff line Loading @@ -169,22 +169,36 @@ void ivas_spar_covar_smooth_enc_close( static void ivas_compute_smooth_cov( ivas_cov_smooth_state_t *hCovState, #ifndef SBA_SPAR_HARM ivas_cov_smooth_in_buf_t *pIn_buf, #endif ivas_filterbank_t *pFb, float *pCov_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *pPrior_cov_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const float fac, const int16_t start_band, const int16_t end_band ) const int16_t end_band #ifdef SBA_SPAR_HARM , const int16_t num_ch, const int16_t transient_det #endif ) { int16_t i, j, k; int16_t prev_idx = hCovState->prior_bank_idx; #ifndef SBA_SPAR_HARM int16_t num_ch = pIn_buf->num_ch; #endif float factor = 0; assert( end_band <= pFb->filterbank_num_bands ); #ifdef SBA_SPAR_HARM if ( prev_idx == -1 || transient_det == 1 ) #else if ( prev_idx == -1 || pIn_buf->reset_cov == 1 ) #endif { for ( i = 0; i < num_ch; i++ ) { Loading Loading @@ -229,22 +243,42 @@ static void ivas_compute_smooth_cov( void ivas_cov_smooth_process( ivas_cov_smooth_state_t *hCovState, /* i/o: Covariance state handle */ #ifdef SBA_SPAR_HARM float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #else ivas_cov_smooth_in_buf_t *pIn_buf, #endif ivas_filterbank_t *pFb, /* i/o: FB handle */ const int16_t start_band, const int16_t end_band ) const int16_t end_band #ifdef SBA_SPAR_HARM , const int16_t num_ch, const int16_t transient_det #endif ) { int16_t i, j; #ifndef SBA_SPAR_HARM int16_t num_ch = pIn_buf->num_ch; #endif int16_t num_bands = end_band - start_band; ivas_compute_smooth_cov( hCovState, pIn_buf, pFb, pIn_buf->cov_real, hCovState->pPrior_cov_real, 1e-20f, start_band, end_band ); #ifdef SBA_SPAR_HARM ivas_compute_smooth_cov( hCovState, pFb, cov_real, hCovState->pPrior_cov_real, 1e-20f, start_band, end_band, num_ch, transient_det ); #else ivas_compute_smooth_cov( hCovState, pFb, pIn_buf->cov_real, hCovState->pPrior_cov_real, 1e-20f, start_band, end_band, num_ch, transient_det ); #endif for ( i = 0; i < num_ch; i++ ) { for ( j = 0; j < num_ch; j++ ) { #ifdef SBA_SPAR_HARM mvr2r( &cov_real[i][j][start_band], &hCovState->pPrior_cov_real[i][j][start_band], num_bands ); #else mvr2r( &pIn_buf->cov_real[i][j][start_band], &hCovState->pPrior_cov_real[i][j][start_band], num_bands ); #endif } } Loading lib_com/ivas_prot.h +34 −1 Original line number Diff line number Diff line Loading @@ -3910,9 +3910,20 @@ void ivas_spar_md_enc_close( ivas_error ivas_spar_md_enc_process( ivas_spar_md_enc_state_t *hMdEnc, /* i/o: SPAR MD encoder handle */ const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */ #ifdef SBA_SPAR_HARM float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #else ivas_spar_md_enc_in_buf_t *pIn_buf, #endif BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */ #ifdef SBA_SPAR_HARM int16_t dtx_vad, const int16_t bwidth, const int16_t nchan_inp, #else const int16_t dtx_silence_mode, #endif const int16_t sba_order /* i : Ambisonic (SBA) order */ ); Loading Loading @@ -4048,12 +4059,25 @@ void ivas_spar_covar_enc_close( void ivas_enc_cov_handler_process( ivas_enc_cov_handler_state_t *hCovEnc, /* i/o: SPAR Covar. encoder handle */ #ifdef SBA_SPAR_HARM float **ppIn_FR_real, float **ppIn_FR_imag, float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #else ivas_enc_cov_handler_in_buf_t *pIn_buf, float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #endif ivas_filterbank_t *pFb, /* i/o: FB handle */ const int16_t start_band, const int16_t end_band ); const int16_t end_band #ifdef SBA_SPAR_HARM ,const int16_t nchan_inp, const int16_t dtx_vad, const int16_t transient_det #endif ); ivas_error ivas_spar_covar_smooth_enc_open( ivas_cov_smooth_state_t **hCovState, /* i/o: SPAR Covar. smoothing handle */ Loading @@ -4069,10 +4093,19 @@ void ivas_spar_covar_smooth_enc_close( void ivas_cov_smooth_process( ivas_cov_smooth_state_t *hCovState, /* i/o: Covariance state handle */ #ifdef SBA_SPAR_HARM float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #else ivas_cov_smooth_in_buf_t *pIn_buf, #endif ivas_filterbank_t *pFb, /* i/o: FB handle */ const int16_t start_band, const int16_t end_band #ifdef SBA_SPAR_HARM , const int16_t num_ch, const int16_t transient_det #endif ); /* Transient detector module */ Loading lib_com/ivas_spar_com.c +21 −19 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ * Static functions declaration *------------------------------------------------------------------------------------------*/ static void ivas_get_pred_coeffs( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ppPred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ppDM_Fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t start_band, const int16_t end_band, const int16_t active_w, const int16_t dtx_vad, const int16_t from_dirac ); static void ivas_reorder_array( float in_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t order[IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t start_band, const int16_t end_band ); Loading Loading @@ -448,7 +449,7 @@ int16_t ivas_get_sba_num_TCs( *-----------------------------------------------------------------------------------------*/ static void ivas_get_pred_coeffs( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ppPred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ppDM_Fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t in_chans, Loading @@ -473,7 +474,7 @@ static void ivas_get_pred_coeffs( set_zero( pPred_temp, IVAS_MAX_NUM_BANDS ); for ( k = start_band; k < end_band; k++ ) { div_factor[k] = max( 1e-20f, pppCov_mat_re[0][0][k] ); div_factor[k] = max( 1e-20f, cov_real[0][0][k] ); div_factor[k] = 1 / div_factor[k]; } Loading @@ -481,7 +482,7 @@ static void ivas_get_pred_coeffs( { for ( k = start_band; k < end_band; k++ ) { ppPred_coeffs_re[i][k] = pppCov_mat_re[i + 1][0][k] * div_factor[k]; ppPred_coeffs_re[i][k] = cov_real[i + 1][0][k] * div_factor[k]; IVAS_CALCULATE_SQ_ABS_N( ppPred_coeffs_re[i][k], abs_value ); Loading Loading @@ -519,7 +520,7 @@ static void ivas_get_pred_coeffs( { for ( k = start_band; k < end_band; k++ ) { IVAS_CALCULATE_SQ_ABS_N( pppCov_mat_re[i][0][k], abs_value ); IVAS_CALCULATE_SQ_ABS_N( cov_real[i][0][k], abs_value ); dm_alpha[k] += abs_value; } } Loading @@ -535,7 +536,7 @@ static void ivas_get_pred_coeffs( { for ( k = start_band; k < end_band; k++ ) { dm_v_re[i][k] = pppCov_mat_re[i + 1][0][k] * div_factor[k]; dm_v_re[i][k] = cov_real[i + 1][0][k] * div_factor[k]; } } Loading @@ -558,7 +559,7 @@ static void ivas_get_pred_coeffs( { float re; IVAS_RMULT_FLOAT( pppCov_mat_re[j + 1][k][b], dm_v_re[k - 1][b], re ); IVAS_RMULT_FLOAT( cov_real[j + 1][k][b], dm_v_re[k - 1][b], re ); real[j] += re; } } Loading @@ -570,7 +571,7 @@ static void ivas_get_pred_coeffs( dm_beta_re += re; } dm_w = pppCov_mat_re[0][0][b]; dm_w = cov_real[0][0][b]; den_f = max( dm_w, 1e-20f ); passive_g = dm_alpha[b] / den_f; Loading @@ -581,7 +582,7 @@ static void ivas_get_pred_coeffs( for ( k = 1; k < in_chans; k++ ) { dm_y += pppCov_mat_re[k][k][b]; dm_y += cov_real[k][k][b]; } den_f = max( dm_y, 1e-20f ); den_f = max( den_f, w_norm_fac * dm_w ); Loading Loading @@ -634,7 +635,7 @@ static void ivas_get_pred_coeffs( *-----------------------------------------------------------------------------------------*/ static void ivas_get_Wscaling_factor( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ***mixer_mat, const int16_t start_band, Loading Loading @@ -667,9 +668,9 @@ static void ivas_get_Wscaling_factor( { float Gw_sq, g_sq = 0; ivas_calc_post_pred_per_band( pppCov_mat_re, mixer_mat, num_ch, pNum_dmx[b * bands_bw], b, postpred_cov_re ); ivas_calc_post_pred_per_band( cov_real, mixer_mat, num_ch, pNum_dmx[b * bands_bw], b, postpred_cov_re ); Gw_sq = pppCov_mat_re[0][0][b] / max( postpred_cov_re[0][0], IVAS_FLT_EPS ); Gw_sq = cov_real[0][0][b] / max( postpred_cov_re[0][0], IVAS_FLT_EPS ); for ( ch = 0; ch < num_ch - 1; ch++ ) { Loading Loading @@ -861,7 +862,7 @@ static void ivas_reorder_array( *-----------------------------------------------------------------------------------------*/ static void ivas_calc_post_pred_per_band( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t num_ch, const int16_t num_dmx, Loading Loading @@ -898,7 +899,7 @@ static void ivas_calc_post_pred_per_band( temp_mat[i][j] = 0; for ( k = 0; k < num_ch; k++ ) { IVAS_RMULT_FLOAT( pppCov_mat_re[i][k][band_idx], dmx_mat_conj[k][j], tmp_re ); IVAS_RMULT_FLOAT( cov_real[i][k][band_idx], dmx_mat_conj[k][j], tmp_re ); temp_mat[i][j] += tmp_re; } } Loading Loading @@ -1239,7 +1240,7 @@ static void ivas_calc_c_coeffs_per_band( void ivas_calc_c_p_coeffs( ivas_spar_md_t *pSparMd, float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const int16_t i_ts, float ***mixer_mat, const int16_t num_ch, Loading @@ -1254,7 +1255,8 @@ void ivas_calc_c_p_coeffs( if ( num_dmx != num_ch ) { ivas_calc_post_pred_per_band( pppCov_mat_re, mixer_mat, num_ch, num_dmx, band_idx, postpred_cov_re ); ivas_calc_post_pred_per_band( cov_real, mixer_mat, num_ch, num_dmx, band_idx, postpred_cov_re ); if ( num_dmx != 1 ) { ivas_calc_c_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, num_dmx, band_idx, dtx_vad ); Loading Loading @@ -1524,7 +1526,7 @@ static int16_t ivas_is_mat_inv( *-----------------------------------------------------------------------------------------*/ void ivas_compute_spar_params( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float dm_fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t i_ts, float ***mixer_mat, Loading @@ -1542,7 +1544,7 @@ void ivas_compute_spar_params( float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; int16_t b, i, ndm; ivas_get_pred_coeffs( pppCov_mat_re, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w, dtx_vad, from_dirac ); ivas_get_pred_coeffs( cov_real, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w, dtx_vad, from_dirac ); #ifdef SPAR_HOA_DBG /*fprintf(stderr, "\n\n Prediction Coefficients:\n"); Loading Loading @@ -1573,7 +1575,7 @@ void ivas_compute_spar_params( fprintf(stderr, "\n\n");*/ #endif ivas_get_Wscaling_factor( pppCov_mat_re, pred_coeffs_re, mixer_mat, start_band, end_band, dtx_vad, num_ch, ivas_get_Wscaling_factor( cov_real, pred_coeffs_re, mixer_mat, start_band, end_band, dtx_vad, num_ch, hSparCfg->num_dmx_chans_per_band, bands_bw, active_w, pWscale ); for ( b = start_band; b < end_band; b++ ) Loading @@ -1596,7 +1598,7 @@ void ivas_compute_spar_params( if ( ndm != num_ch ) { ivas_calc_c_p_coeffs( hSparMd, pppCov_mat_re, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1, 0 ); ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1, 0 ); #ifdef SPAR_HOA_DBG /* if (b == 0) */ Loading lib_com/ivas_stat_com.h +3 −1 Original line number Diff line number Diff line Loading @@ -351,6 +351,7 @@ typedef struct ivas_cov_smooth_cfg_t } ivas_cov_smooth_cfg_t; #ifndef SBA_SPAR_HARM typedef struct ivas_cov_smooth_in_buf_t { float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Loading @@ -358,6 +359,7 @@ typedef struct ivas_cov_smooth_in_buf_t int16_t reset_cov; } ivas_cov_smooth_in_buf_t; #endif /* SPAR bitrate constant table structure */ typedef struct ivas_spar_br_table_t Loading @@ -371,7 +373,7 @@ typedef struct ivas_spar_br_table_t ivas_spar_pmx_strings_t dmx_str; int16_t active_w; int16_t tmode; int32_t evs_brs[FOA_CHANNELS][3]; int32_t evs_brs[FOA_CHANNELS][3]; // VE: rename to core_brs int16_t q_lvls[MAX_QUANT_STRATS][NUM_MD_Q_COEFS_SET]; int16_t td_ducking; int16_t agc_bits_ch_idx; /* 0-3, Indicates core-coder channel index from which AGC bits have been taken from*/ Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ #define ISM_BITRATE_SWITCHING /* Issue 115: Support for Bitrate Switching in ISM */ #define SBA_SPAR_HARM /* maintenance of the SBA SPAR functions */ /* ################## End DEVELOPMENT switches ######################### */ Loading Loading
lib_com/ivas_cov_smooth.c +37 −3 Original line number Diff line number Diff line Loading @@ -169,22 +169,36 @@ void ivas_spar_covar_smooth_enc_close( static void ivas_compute_smooth_cov( ivas_cov_smooth_state_t *hCovState, #ifndef SBA_SPAR_HARM ivas_cov_smooth_in_buf_t *pIn_buf, #endif ivas_filterbank_t *pFb, float *pCov_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *pPrior_cov_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const float fac, const int16_t start_band, const int16_t end_band ) const int16_t end_band #ifdef SBA_SPAR_HARM , const int16_t num_ch, const int16_t transient_det #endif ) { int16_t i, j, k; int16_t prev_idx = hCovState->prior_bank_idx; #ifndef SBA_SPAR_HARM int16_t num_ch = pIn_buf->num_ch; #endif float factor = 0; assert( end_band <= pFb->filterbank_num_bands ); #ifdef SBA_SPAR_HARM if ( prev_idx == -1 || transient_det == 1 ) #else if ( prev_idx == -1 || pIn_buf->reset_cov == 1 ) #endif { for ( i = 0; i < num_ch; i++ ) { Loading Loading @@ -229,22 +243,42 @@ static void ivas_compute_smooth_cov( void ivas_cov_smooth_process( ivas_cov_smooth_state_t *hCovState, /* i/o: Covariance state handle */ #ifdef SBA_SPAR_HARM float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #else ivas_cov_smooth_in_buf_t *pIn_buf, #endif ivas_filterbank_t *pFb, /* i/o: FB handle */ const int16_t start_band, const int16_t end_band ) const int16_t end_band #ifdef SBA_SPAR_HARM , const int16_t num_ch, const int16_t transient_det #endif ) { int16_t i, j; #ifndef SBA_SPAR_HARM int16_t num_ch = pIn_buf->num_ch; #endif int16_t num_bands = end_band - start_band; ivas_compute_smooth_cov( hCovState, pIn_buf, pFb, pIn_buf->cov_real, hCovState->pPrior_cov_real, 1e-20f, start_band, end_band ); #ifdef SBA_SPAR_HARM ivas_compute_smooth_cov( hCovState, pFb, cov_real, hCovState->pPrior_cov_real, 1e-20f, start_band, end_band, num_ch, transient_det ); #else ivas_compute_smooth_cov( hCovState, pFb, pIn_buf->cov_real, hCovState->pPrior_cov_real, 1e-20f, start_band, end_band, num_ch, transient_det ); #endif for ( i = 0; i < num_ch; i++ ) { for ( j = 0; j < num_ch; j++ ) { #ifdef SBA_SPAR_HARM mvr2r( &cov_real[i][j][start_band], &hCovState->pPrior_cov_real[i][j][start_band], num_bands ); #else mvr2r( &pIn_buf->cov_real[i][j][start_band], &hCovState->pPrior_cov_real[i][j][start_band], num_bands ); #endif } } Loading
lib_com/ivas_prot.h +34 −1 Original line number Diff line number Diff line Loading @@ -3910,9 +3910,20 @@ void ivas_spar_md_enc_close( ivas_error ivas_spar_md_enc_process( ivas_spar_md_enc_state_t *hMdEnc, /* i/o: SPAR MD encoder handle */ const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */ #ifdef SBA_SPAR_HARM float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #else ivas_spar_md_enc_in_buf_t *pIn_buf, #endif BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */ #ifdef SBA_SPAR_HARM int16_t dtx_vad, const int16_t bwidth, const int16_t nchan_inp, #else const int16_t dtx_silence_mode, #endif const int16_t sba_order /* i : Ambisonic (SBA) order */ ); Loading Loading @@ -4048,12 +4059,25 @@ void ivas_spar_covar_enc_close( void ivas_enc_cov_handler_process( ivas_enc_cov_handler_state_t *hCovEnc, /* i/o: SPAR Covar. encoder handle */ #ifdef SBA_SPAR_HARM float **ppIn_FR_real, float **ppIn_FR_imag, float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #else ivas_enc_cov_handler_in_buf_t *pIn_buf, float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #endif ivas_filterbank_t *pFb, /* i/o: FB handle */ const int16_t start_band, const int16_t end_band ); const int16_t end_band #ifdef SBA_SPAR_HARM ,const int16_t nchan_inp, const int16_t dtx_vad, const int16_t transient_det #endif ); ivas_error ivas_spar_covar_smooth_enc_open( ivas_cov_smooth_state_t **hCovState, /* i/o: SPAR Covar. smoothing handle */ Loading @@ -4069,10 +4093,19 @@ void ivas_spar_covar_smooth_enc_close( void ivas_cov_smooth_process( ivas_cov_smooth_state_t *hCovState, /* i/o: Covariance state handle */ #ifdef SBA_SPAR_HARM float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #else ivas_cov_smooth_in_buf_t *pIn_buf, #endif ivas_filterbank_t *pFb, /* i/o: FB handle */ const int16_t start_band, const int16_t end_band #ifdef SBA_SPAR_HARM , const int16_t num_ch, const int16_t transient_det #endif ); /* Transient detector module */ Loading
lib_com/ivas_spar_com.c +21 −19 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ * Static functions declaration *------------------------------------------------------------------------------------------*/ static void ivas_get_pred_coeffs( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ppPred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ppDM_Fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t start_band, const int16_t end_band, const int16_t active_w, const int16_t dtx_vad, const int16_t from_dirac ); static void ivas_reorder_array( float in_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t order[IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t start_band, const int16_t end_band ); Loading Loading @@ -448,7 +449,7 @@ int16_t ivas_get_sba_num_TCs( *-----------------------------------------------------------------------------------------*/ static void ivas_get_pred_coeffs( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ppPred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ppDM_Fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t in_chans, Loading @@ -473,7 +474,7 @@ static void ivas_get_pred_coeffs( set_zero( pPred_temp, IVAS_MAX_NUM_BANDS ); for ( k = start_band; k < end_band; k++ ) { div_factor[k] = max( 1e-20f, pppCov_mat_re[0][0][k] ); div_factor[k] = max( 1e-20f, cov_real[0][0][k] ); div_factor[k] = 1 / div_factor[k]; } Loading @@ -481,7 +482,7 @@ static void ivas_get_pred_coeffs( { for ( k = start_band; k < end_band; k++ ) { ppPred_coeffs_re[i][k] = pppCov_mat_re[i + 1][0][k] * div_factor[k]; ppPred_coeffs_re[i][k] = cov_real[i + 1][0][k] * div_factor[k]; IVAS_CALCULATE_SQ_ABS_N( ppPred_coeffs_re[i][k], abs_value ); Loading Loading @@ -519,7 +520,7 @@ static void ivas_get_pred_coeffs( { for ( k = start_band; k < end_band; k++ ) { IVAS_CALCULATE_SQ_ABS_N( pppCov_mat_re[i][0][k], abs_value ); IVAS_CALCULATE_SQ_ABS_N( cov_real[i][0][k], abs_value ); dm_alpha[k] += abs_value; } } Loading @@ -535,7 +536,7 @@ static void ivas_get_pred_coeffs( { for ( k = start_band; k < end_band; k++ ) { dm_v_re[i][k] = pppCov_mat_re[i + 1][0][k] * div_factor[k]; dm_v_re[i][k] = cov_real[i + 1][0][k] * div_factor[k]; } } Loading @@ -558,7 +559,7 @@ static void ivas_get_pred_coeffs( { float re; IVAS_RMULT_FLOAT( pppCov_mat_re[j + 1][k][b], dm_v_re[k - 1][b], re ); IVAS_RMULT_FLOAT( cov_real[j + 1][k][b], dm_v_re[k - 1][b], re ); real[j] += re; } } Loading @@ -570,7 +571,7 @@ static void ivas_get_pred_coeffs( dm_beta_re += re; } dm_w = pppCov_mat_re[0][0][b]; dm_w = cov_real[0][0][b]; den_f = max( dm_w, 1e-20f ); passive_g = dm_alpha[b] / den_f; Loading @@ -581,7 +582,7 @@ static void ivas_get_pred_coeffs( for ( k = 1; k < in_chans; k++ ) { dm_y += pppCov_mat_re[k][k][b]; dm_y += cov_real[k][k][b]; } den_f = max( dm_y, 1e-20f ); den_f = max( den_f, w_norm_fac * dm_w ); Loading Loading @@ -634,7 +635,7 @@ static void ivas_get_pred_coeffs( *-----------------------------------------------------------------------------------------*/ static void ivas_get_Wscaling_factor( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ***mixer_mat, const int16_t start_band, Loading Loading @@ -667,9 +668,9 @@ static void ivas_get_Wscaling_factor( { float Gw_sq, g_sq = 0; ivas_calc_post_pred_per_band( pppCov_mat_re, mixer_mat, num_ch, pNum_dmx[b * bands_bw], b, postpred_cov_re ); ivas_calc_post_pred_per_band( cov_real, mixer_mat, num_ch, pNum_dmx[b * bands_bw], b, postpred_cov_re ); Gw_sq = pppCov_mat_re[0][0][b] / max( postpred_cov_re[0][0], IVAS_FLT_EPS ); Gw_sq = cov_real[0][0][b] / max( postpred_cov_re[0][0], IVAS_FLT_EPS ); for ( ch = 0; ch < num_ch - 1; ch++ ) { Loading Loading @@ -861,7 +862,7 @@ static void ivas_reorder_array( *-----------------------------------------------------------------------------------------*/ static void ivas_calc_post_pred_per_band( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t num_ch, const int16_t num_dmx, Loading Loading @@ -898,7 +899,7 @@ static void ivas_calc_post_pred_per_band( temp_mat[i][j] = 0; for ( k = 0; k < num_ch; k++ ) { IVAS_RMULT_FLOAT( pppCov_mat_re[i][k][band_idx], dmx_mat_conj[k][j], tmp_re ); IVAS_RMULT_FLOAT( cov_real[i][k][band_idx], dmx_mat_conj[k][j], tmp_re ); temp_mat[i][j] += tmp_re; } } Loading Loading @@ -1239,7 +1240,7 @@ static void ivas_calc_c_coeffs_per_band( void ivas_calc_c_p_coeffs( ivas_spar_md_t *pSparMd, float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const int16_t i_ts, float ***mixer_mat, const int16_t num_ch, Loading @@ -1254,7 +1255,8 @@ void ivas_calc_c_p_coeffs( if ( num_dmx != num_ch ) { ivas_calc_post_pred_per_band( pppCov_mat_re, mixer_mat, num_ch, num_dmx, band_idx, postpred_cov_re ); ivas_calc_post_pred_per_band( cov_real, mixer_mat, num_ch, num_dmx, band_idx, postpred_cov_re ); if ( num_dmx != 1 ) { ivas_calc_c_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, num_dmx, band_idx, dtx_vad ); Loading Loading @@ -1524,7 +1526,7 @@ static int16_t ivas_is_mat_inv( *-----------------------------------------------------------------------------------------*/ void ivas_compute_spar_params( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float dm_fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t i_ts, float ***mixer_mat, Loading @@ -1542,7 +1544,7 @@ void ivas_compute_spar_params( float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; int16_t b, i, ndm; ivas_get_pred_coeffs( pppCov_mat_re, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w, dtx_vad, from_dirac ); ivas_get_pred_coeffs( cov_real, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w, dtx_vad, from_dirac ); #ifdef SPAR_HOA_DBG /*fprintf(stderr, "\n\n Prediction Coefficients:\n"); Loading Loading @@ -1573,7 +1575,7 @@ void ivas_compute_spar_params( fprintf(stderr, "\n\n");*/ #endif ivas_get_Wscaling_factor( pppCov_mat_re, pred_coeffs_re, mixer_mat, start_band, end_band, dtx_vad, num_ch, ivas_get_Wscaling_factor( cov_real, pred_coeffs_re, mixer_mat, start_band, end_band, dtx_vad, num_ch, hSparCfg->num_dmx_chans_per_band, bands_bw, active_w, pWscale ); for ( b = start_band; b < end_band; b++ ) Loading @@ -1596,7 +1598,7 @@ void ivas_compute_spar_params( if ( ndm != num_ch ) { ivas_calc_c_p_coeffs( hSparMd, pppCov_mat_re, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1, 0 ); ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1, 0 ); #ifdef SPAR_HOA_DBG /* if (b == 0) */ Loading
lib_com/ivas_stat_com.h +3 −1 Original line number Diff line number Diff line Loading @@ -351,6 +351,7 @@ typedef struct ivas_cov_smooth_cfg_t } ivas_cov_smooth_cfg_t; #ifndef SBA_SPAR_HARM typedef struct ivas_cov_smooth_in_buf_t { float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Loading @@ -358,6 +359,7 @@ typedef struct ivas_cov_smooth_in_buf_t int16_t reset_cov; } ivas_cov_smooth_in_buf_t; #endif /* SPAR bitrate constant table structure */ typedef struct ivas_spar_br_table_t Loading @@ -371,7 +373,7 @@ typedef struct ivas_spar_br_table_t ivas_spar_pmx_strings_t dmx_str; int16_t active_w; int16_t tmode; int32_t evs_brs[FOA_CHANNELS][3]; int32_t evs_brs[FOA_CHANNELS][3]; // VE: rename to core_brs int16_t q_lvls[MAX_QUANT_STRATS][NUM_MD_Q_COEFS_SET]; int16_t td_ducking; int16_t agc_bits_ch_idx; /* 0-3, Indicates core-coder channel index from which AGC bits have been taken from*/ Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ #define ISM_BITRATE_SWITCHING /* Issue 115: Support for Bitrate Switching in ISM */ #define SBA_SPAR_HARM /* maintenance of the SBA SPAR functions */ /* ################## End DEVELOPMENT switches ######################### */ Loading