Loading lib_com/ivas_cnst.h +0 −2 Original line number Diff line number Diff line Loading @@ -1069,10 +1069,8 @@ typedef enum #define IVAS_ACTIVEW_DM_F_SCALE_VLBR 0.25f #define IVAS_SPAR_FOA_DFLT_FREQ_PER_CHAN 24000 #ifdef FIX_SBA_VANISHING_RESIDUAL #define IVAS_SPAR_DYN_ACTIVEW_THRESH (0.0039f) #define IVAS_SPAR_SIDE_CH_DYN_ACTIVEW_THRESH (32.0f) #endif #define MAX_QUANT_STRATS 3 #define MAX_CODING_STRATS 3 Loading lib_com/ivas_fb_mixer.c +0 −23 Original line number Diff line number Diff line Loading @@ -594,9 +594,6 @@ void ivas_fb_mixer_get_windowed_fr( * * FB Mixer cross fading *-----------------------------------------------------------------------------------------*/ #ifndef FIX_SBA_VANISHING_RESIDUAL static #endif void ivas_fb_mixer_cross_fading( IVAS_FB_MIXER_HANDLE hFbMixer, Loading @@ -605,10 +602,8 @@ static float *pMdft_out_new, const int16_t ch, const int16_t frame_len #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t cf_offset #endif ) { int16_t k, fade_start_offset, fade_end_offset; Loading @@ -620,29 +615,17 @@ static for ( k = 0; k < fade_start_offset; k++ ) { #ifdef FIX_SBA_VANISHING_RESIDUAL ppOut_pcm[ch][k] = pMdft_out_old[k + cf_offset]; #else ppOut_pcm[ch][k] = pMdft_out_old[k + frame_len]; #endif } for ( k = fade_start_offset; k < fade_end_offset; k++ ) { #ifdef FIX_SBA_VANISHING_RESIDUAL ppOut_pcm[ch][k] = pMdft_out_new[k + cf_offset] * hFbMixer->pFilterbank_cross_fade[k - fade_start_offset] + pMdft_out_old[k + cf_offset] * ( 1.0f - hFbMixer->pFilterbank_cross_fade[k - fade_start_offset] ); #else ppOut_pcm[ch][k] = pMdft_out_new[k + frame_len] * hFbMixer->pFilterbank_cross_fade[k - fade_start_offset] + pMdft_out_old[k + frame_len] * ( 1.0f - hFbMixer->pFilterbank_cross_fade[k - fade_start_offset] ); #endif } for ( k = fade_end_offset; k < frame_len; k++ ) { #ifdef FIX_SBA_VANISHING_RESIDUAL ppOut_pcm[ch][k] = pMdft_out_new[k + cf_offset]; #else ppOut_pcm[ch][k] = pMdft_out_new[k + frame_len]; #endif } } else Loading @@ -651,11 +634,7 @@ static for ( k = 0; k < frame_len; k++ ) { #ifdef FIX_SBA_VANISHING_RESIDUAL ppOut_pcm[ch][k] = pMdft_out_new[k + cf_offset]; #else ppOut_pcm[ch][k] = pMdft_out_new[k + frame_len]; #endif } } Loading Loading @@ -746,10 +725,8 @@ void ivas_fb_mixer_process( } ivas_fb_mixer_cross_fading( hFbMixer, ppOut_pcm, pMdft_out[0], pMdft_out[1], ch, frame_len #ifdef FIX_SBA_VANISHING_RESIDUAL , frame_len #endif ); } Loading lib_com/ivas_prot.h +0 −22 Original line number Diff line number Diff line Loading @@ -114,7 +114,6 @@ ivas_error ivas_spar_md_enc_init const int16_t sba_order /* i : Ambisonic (SBA) order */ ); #ifdef FIX_SBA_VANISHING_RESIDUAL int16_t ivas_spar_get_activeW_flag( ivas_enc_cov_handler_state_t *hCovEnc, float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], Loading @@ -124,7 +123,6 @@ int16_t ivas_spar_get_activeW_flag( const int16_t nchan_transport, int16_t *res_ind, const int16_t *dmx_order); #endif ivas_error ivas_sba_enc_reconfigure( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ Loading Loading @@ -3536,11 +3534,9 @@ void ivas_dirac_param_est_enc( const IVAS_FORMAT ivas_format , const int16_t hodirac_flag, const int16_t nchan_fb_in #ifdef FIX_527_SBA_MONO_INPUT , int16_t *mono_frame_count, int16_t *dirac_mono_flag #endif ); Loading Loading @@ -4557,14 +4553,10 @@ ivas_error ivas_spar_md_enc_process( const int16_t nchan_inp, const int16_t sba_order, /* i : Ambisonic (SBA) order */ float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i : prior mixer_matrix */ #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag /* i : flag to indicate dynamic active W*/ #endif #ifdef FIX_527_SBA_MONO_INPUT , const int16_t dirac_mono_flag /* i : flag to indicate mono only mode in SBA*/ #endif ); void ivas_compute_spar_params( Loading @@ -4583,10 +4575,8 @@ void ivas_compute_spar_params( ivas_spar_md_t *hSparMd, float *pWscale, const int16_t from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ); void ivas_create_fullr_dmx_mat( Loading @@ -4610,10 +4600,8 @@ void ivas_calc_c_p_coeffs( const int16_t band_idx, const int16_t dtx_vad, const int16_t compute_p_flag #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ); void ivas_get_spar_md_from_dirac( Loading @@ -4632,10 +4620,8 @@ void ivas_get_spar_md_from_dirac( , const uint8_t useLowerRes, const int16_t active_w_vlbr #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ); /*! r: number of MD subframes */ Loading Loading @@ -4700,10 +4686,8 @@ void ivas_spar_to_dirac( const int16_t dtx_vad, /* i : DTX frame flag */ const int16_t num_bands_out, /* i : number of output bands */ const int16_t bw /* i : band joining factor */ #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag /* i : dynamic active W flag */ #endif ); void ivas_spar_update_md_hist( Loading Loading @@ -4763,14 +4747,12 @@ void ivas_enc_cov_handler_process( const int16_t dtx_vad, const int16_t transient_det[2], const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] #ifdef FIX_SBA_VANISHING_RESIDUAL , int16_t *res_ind, const int16_t *remix_order, int16_t *dyn_active_w_flag, const int16_t nchan_transport, const int16_t is_sba #endif ); ivas_error ivas_spar_covar_smooth_enc_open( Loading Loading @@ -5734,11 +5716,9 @@ void computeReferencePower_enc( const IVAS_FORMAT ivas_format, /* i : ivas_format */ int16_t ref_power_w, /* i : use 0 if hodirac is enabled */ const int16_t nchan_ana /* i : number of analysis channels */ #ifdef FIX_527_SBA_MONO_INPUT , int16_t *mono_frame_count, int16_t *dirac_mono_flag #endif ); ivas_error ivas_mono_dmx_renderer_open( Loading Loading @@ -6299,7 +6279,6 @@ void ivas_fb_mixer_get_in_out_mapping( int16_t in_out_mixer_map[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i/o: mixing mapping */ ); #ifdef FIX_SBA_VANISHING_RESIDUAL void ivas_fb_mixer_cross_fading( IVAS_FB_MIXER_HANDLE hFbMixer, float **ppOut_pcm, Loading @@ -6309,7 +6288,6 @@ void ivas_fb_mixer_cross_fading( const int16_t frame_len, const int16_t cf_offset ); #endif /*! r: number of spectral bands */ int16_t ivas_get_num_bands_from_bw_idx( Loading lib_com/ivas_qmetadata_com.c +0 −2 Original line number Diff line number Diff line Loading @@ -149,9 +149,7 @@ ivas_error ivas_qmetadata_allocate_memory( { set_zero( hQMetaData->q_direction[dir].band_data[j].elevation, MAX_PARAM_SPATIAL_SUBFRAMES ); set_zero( hQMetaData->q_direction[dir].band_data[j].azimuth, MAX_PARAM_SPATIAL_SUBFRAMES ); #ifdef FIX_527_SBA_MONO_INPUT set_zero( hQMetaData->q_direction[dir].band_data[j].energy_ratio, MAX_PARAM_SPATIAL_SUBFRAMES ); #endif } } Loading lib_com/ivas_spar_com.c +0 −58 Original line number Diff line number Diff line Loading @@ -78,20 +78,16 @@ 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 active_w_vlbr, const int16_t dtx_vad, const int16_t from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag, const int16_t res_ind #endif ); 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 ); static void ivas_get_Wscaling_factor( float *pppCov_mat_re[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, const int16_t end_band, const int16_t dtx_vad, const int16_t num_ch, const int16_t *pNum_dmx, const int16_t bands_bw, const int16_t active_w, const int16_t active_w_vlbr, float *pWscale #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ); static void ivas_calc_post_pred_per_band( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t num_ch, const int16_t num_dmx, const int16_t band_idx, float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH] ); Loading Loading @@ -474,11 +470,9 @@ static void ivas_get_pred_coeffs( const int16_t active_w_vlbr, const int16_t dtx_vad, const int16_t from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag, const int16_t res_ind #endif ) { int16_t i, j, k, b; Loading Loading @@ -534,7 +528,6 @@ static void ivas_get_pred_coeffs( float real[IVAS_SPAR_MAX_CH - 1], dm_beta_re = 0, dm_g[IVAS_MAX_NUM_BANDS]; float dm_f_local, dm_w, dm_y, DM_F[IVAS_MAX_NUM_BANDS]; float num_f, den_f, passive_g; #ifdef FIX_SBA_VANISHING_RESIDUAL float activew_quad_thresh, g_th_sq; if ( dyn_active_w_flag == 1 ) { Loading @@ -545,9 +538,6 @@ static void ivas_get_pred_coeffs( activew_quad_thresh = IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH; } g_th_sq = activew_quad_thresh * activew_quad_thresh; #else float g_th_sq = IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH * IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH; #endif set_zero( dm_alpha, IVAS_MAX_NUM_BANDS ); Loading Loading @@ -611,7 +601,6 @@ static void ivas_get_pred_coeffs( den_f = max( dm_w, 1e-20f ); passive_g = dm_alpha[b] / den_f; #ifdef FIX_SBA_VANISHING_RESIDUAL if ( dyn_active_w_flag == 1 ) { dm_alpha[b] = 0.0f; Loading @@ -623,14 +612,9 @@ static void ivas_get_pred_coeffs( dm_v_re[res_ind - 1][b] = 1.0f; passive_g = activew_quad_thresh; } #endif #ifdef FIX_SBA_VANISHING_RESIDUAL if ( passive_g < activew_quad_thresh ) #else if ( passive_g < IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH ) #endif { /*linear activeW*/ dm_y = 0; Loading @@ -655,11 +639,7 @@ static void ivas_get_pred_coeffs( /* quadratic activeW */ #ifdef FIX_SBA_VANISHING_RESIDUAL num_f = ( dm_beta_re - ( 2 * dm_alpha[b] * activew_quad_thresh ) ); #else num_f = ( dm_beta_re - ( 2 * dm_alpha[b] * IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH ) ); #endif sqrt_val = 4 * dm_alpha[b] * dm_alpha[b] * g_th_sq; sqrt_val += dm_beta_re * dm_beta_re; Loading @@ -669,11 +649,7 @@ static void ivas_get_pred_coeffs( den_f = 2 * dm_beta_re * g_th_sq; den_f = max( den_f, 1e-20f ); #ifdef FIX_SBA_VANISHING_RESIDUAL dm_g[b] = activew_quad_thresh; #else dm_g[b] = IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH; #endif DM_F[b] = ( dm_g[b] * num_f ) / den_f; } } Loading Loading @@ -712,10 +688,8 @@ static void ivas_get_Wscaling_factor( const int16_t active_w, const int16_t active_w_vlbr, float *pWscale #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ) { int16_t b, ch; Loading @@ -735,11 +709,7 @@ static void ivas_get_Wscaling_factor( { pWscale[b] = 1; #ifdef FIX_SBA_VANISHING_RESIDUAL if ( ( active_w == 1 ) && ( dyn_active_w_flag == 0 ) ) #else if ( ( active_w == 1 ) && ( pNum_dmx[b * bands_bw] == 1 ) ) #endif { float Gw_sq, g_sq = 0; Loading Loading @@ -1290,15 +1260,11 @@ void ivas_calc_c_p_coeffs( const int16_t band_idx, const int16_t dtx_vad, const int16_t compute_p_flag #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ) { #ifdef FIX_SBA_VANISHING_RESIDUAL int16_t i, j; #endif float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; if ( num_dmx != num_ch ) Loading @@ -1310,7 +1276,6 @@ void ivas_calc_c_p_coeffs( ivas_calc_c_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, num_dmx, band_idx, dtx_vad ); } #ifdef FIX_SBA_VANISHING_RESIDUAL if ( dyn_active_w_flag ) { for ( i = 0; i < num_ch - num_dmx; i++ ) Loading @@ -1321,13 +1286,11 @@ void ivas_calc_c_p_coeffs( } } } #endif if ( compute_p_flag == 1 ) { ivas_calc_p_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, dtx_vad, num_dmx, band_idx ); } #ifdef FIX_SBA_VANISHING_RESIDUAL if ( dyn_active_w_flag ) { for ( i = num_dmx; i < num_ch; i++ ) Loading @@ -1335,7 +1298,6 @@ void ivas_calc_c_p_coeffs( pSparMd->band_coeffs[band_idx + i_ts * IVAS_MAX_NUM_BANDS].P_re[i - num_dmx] = 0; } } #endif } return; Loading Loading @@ -1588,10 +1550,8 @@ void ivas_compute_spar_params( ivas_spar_md_t *hSparMd, float *pWscale, const int16_t from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ) { float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; Loading @@ -1600,11 +1560,9 @@ void ivas_compute_spar_params( ivas_get_pred_coeffs( cov_real, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w, active_w_vlbr, dtx_vad, from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , dyn_active_w_flag, hSparMd->res_ind #endif ); ivas_create_fullr_dmx_mat( pred_coeffs_re, dm_fv_re, mixer_mat, num_ch, start_band, end_band, active_w, hSparCfg ); Loading @@ -1613,10 +1571,8 @@ void ivas_compute_spar_params( hSparCfg->num_dmx_chans_per_band, bands_bw, active_w, active_w_vlbr, pWscale #ifdef FIX_SBA_VANISHING_RESIDUAL , dyn_active_w_flag #endif ); for ( b = start_band; b < end_band; b++ ) Loading @@ -1640,10 +1596,8 @@ void ivas_compute_spar_params( if ( ndm != num_ch ) { ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1 #ifdef FIX_SBA_VANISHING_RESIDUAL , dyn_active_w_flag #endif ); #ifdef SPAR_HOA_DBG Loading Loading @@ -1695,10 +1649,8 @@ void ivas_get_spar_md_from_dirac( float Wscale_d[IVAS_MAX_NUM_BANDS], const uint8_t useLowerRes, const int16_t active_w_vlbr #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ) { int16_t num_ch, band, i, j; Loading @@ -1713,9 +1665,7 @@ void ivas_get_spar_md_from_dirac( float **ppMixer_mat[IVAS_MAX_FB_MIXER_OUT_CH]; float *pMixer_mat[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]; float en_ratio_fac, diff_norm_order1, diff_norm_order2, diff_norm_order3; #ifdef FIX_SBA_VANISHING_RESIDUAL int16_t active_w; #endif int16_t ndm, foa_ch, hoa2_ch; float P_dir_fact[IVAS_SPAR_MAX_CH - 1]; Loading Loading @@ -1969,22 +1919,14 @@ void ivas_get_spar_md_from_dirac( } #endif #ifdef FIX_SBA_VANISHING_RESIDUAL active_w = ( dyn_active_w_flag == 1 ) || ( hSpar_md_cfg->active_w == 1 ); #endif ivas_compute_spar_params( pCov_real, dm_fv_re, i_ts, ppMixer_mat, start_band, end_band, dtx_vad, num_ch, 1, #ifdef FIX_SBA_VANISHING_RESIDUAL active_w, #else hSpar_md_cfg->active_w, #endif active_w_vlbr, hSpar_md_cfg, hSpar_md, Wscale, 1 #ifdef FIX_SBA_VANISHING_RESIDUAL , dyn_active_w_flag #endif ); if ( mixer_mat != NULL ) Loading Loading
lib_com/ivas_cnst.h +0 −2 Original line number Diff line number Diff line Loading @@ -1069,10 +1069,8 @@ typedef enum #define IVAS_ACTIVEW_DM_F_SCALE_VLBR 0.25f #define IVAS_SPAR_FOA_DFLT_FREQ_PER_CHAN 24000 #ifdef FIX_SBA_VANISHING_RESIDUAL #define IVAS_SPAR_DYN_ACTIVEW_THRESH (0.0039f) #define IVAS_SPAR_SIDE_CH_DYN_ACTIVEW_THRESH (32.0f) #endif #define MAX_QUANT_STRATS 3 #define MAX_CODING_STRATS 3 Loading
lib_com/ivas_fb_mixer.c +0 −23 Original line number Diff line number Diff line Loading @@ -594,9 +594,6 @@ void ivas_fb_mixer_get_windowed_fr( * * FB Mixer cross fading *-----------------------------------------------------------------------------------------*/ #ifndef FIX_SBA_VANISHING_RESIDUAL static #endif void ivas_fb_mixer_cross_fading( IVAS_FB_MIXER_HANDLE hFbMixer, Loading @@ -605,10 +602,8 @@ static float *pMdft_out_new, const int16_t ch, const int16_t frame_len #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t cf_offset #endif ) { int16_t k, fade_start_offset, fade_end_offset; Loading @@ -620,29 +615,17 @@ static for ( k = 0; k < fade_start_offset; k++ ) { #ifdef FIX_SBA_VANISHING_RESIDUAL ppOut_pcm[ch][k] = pMdft_out_old[k + cf_offset]; #else ppOut_pcm[ch][k] = pMdft_out_old[k + frame_len]; #endif } for ( k = fade_start_offset; k < fade_end_offset; k++ ) { #ifdef FIX_SBA_VANISHING_RESIDUAL ppOut_pcm[ch][k] = pMdft_out_new[k + cf_offset] * hFbMixer->pFilterbank_cross_fade[k - fade_start_offset] + pMdft_out_old[k + cf_offset] * ( 1.0f - hFbMixer->pFilterbank_cross_fade[k - fade_start_offset] ); #else ppOut_pcm[ch][k] = pMdft_out_new[k + frame_len] * hFbMixer->pFilterbank_cross_fade[k - fade_start_offset] + pMdft_out_old[k + frame_len] * ( 1.0f - hFbMixer->pFilterbank_cross_fade[k - fade_start_offset] ); #endif } for ( k = fade_end_offset; k < frame_len; k++ ) { #ifdef FIX_SBA_VANISHING_RESIDUAL ppOut_pcm[ch][k] = pMdft_out_new[k + cf_offset]; #else ppOut_pcm[ch][k] = pMdft_out_new[k + frame_len]; #endif } } else Loading @@ -651,11 +634,7 @@ static for ( k = 0; k < frame_len; k++ ) { #ifdef FIX_SBA_VANISHING_RESIDUAL ppOut_pcm[ch][k] = pMdft_out_new[k + cf_offset]; #else ppOut_pcm[ch][k] = pMdft_out_new[k + frame_len]; #endif } } Loading Loading @@ -746,10 +725,8 @@ void ivas_fb_mixer_process( } ivas_fb_mixer_cross_fading( hFbMixer, ppOut_pcm, pMdft_out[0], pMdft_out[1], ch, frame_len #ifdef FIX_SBA_VANISHING_RESIDUAL , frame_len #endif ); } Loading
lib_com/ivas_prot.h +0 −22 Original line number Diff line number Diff line Loading @@ -114,7 +114,6 @@ ivas_error ivas_spar_md_enc_init const int16_t sba_order /* i : Ambisonic (SBA) order */ ); #ifdef FIX_SBA_VANISHING_RESIDUAL int16_t ivas_spar_get_activeW_flag( ivas_enc_cov_handler_state_t *hCovEnc, float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], Loading @@ -124,7 +123,6 @@ int16_t ivas_spar_get_activeW_flag( const int16_t nchan_transport, int16_t *res_ind, const int16_t *dmx_order); #endif ivas_error ivas_sba_enc_reconfigure( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ Loading Loading @@ -3536,11 +3534,9 @@ void ivas_dirac_param_est_enc( const IVAS_FORMAT ivas_format , const int16_t hodirac_flag, const int16_t nchan_fb_in #ifdef FIX_527_SBA_MONO_INPUT , int16_t *mono_frame_count, int16_t *dirac_mono_flag #endif ); Loading Loading @@ -4557,14 +4553,10 @@ ivas_error ivas_spar_md_enc_process( const int16_t nchan_inp, const int16_t sba_order, /* i : Ambisonic (SBA) order */ float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i : prior mixer_matrix */ #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag /* i : flag to indicate dynamic active W*/ #endif #ifdef FIX_527_SBA_MONO_INPUT , const int16_t dirac_mono_flag /* i : flag to indicate mono only mode in SBA*/ #endif ); void ivas_compute_spar_params( Loading @@ -4583,10 +4575,8 @@ void ivas_compute_spar_params( ivas_spar_md_t *hSparMd, float *pWscale, const int16_t from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ); void ivas_create_fullr_dmx_mat( Loading @@ -4610,10 +4600,8 @@ void ivas_calc_c_p_coeffs( const int16_t band_idx, const int16_t dtx_vad, const int16_t compute_p_flag #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ); void ivas_get_spar_md_from_dirac( Loading @@ -4632,10 +4620,8 @@ void ivas_get_spar_md_from_dirac( , const uint8_t useLowerRes, const int16_t active_w_vlbr #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ); /*! r: number of MD subframes */ Loading Loading @@ -4700,10 +4686,8 @@ void ivas_spar_to_dirac( const int16_t dtx_vad, /* i : DTX frame flag */ const int16_t num_bands_out, /* i : number of output bands */ const int16_t bw /* i : band joining factor */ #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag /* i : dynamic active W flag */ #endif ); void ivas_spar_update_md_hist( Loading Loading @@ -4763,14 +4747,12 @@ void ivas_enc_cov_handler_process( const int16_t dtx_vad, const int16_t transient_det[2], const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] #ifdef FIX_SBA_VANISHING_RESIDUAL , int16_t *res_ind, const int16_t *remix_order, int16_t *dyn_active_w_flag, const int16_t nchan_transport, const int16_t is_sba #endif ); ivas_error ivas_spar_covar_smooth_enc_open( Loading Loading @@ -5734,11 +5716,9 @@ void computeReferencePower_enc( const IVAS_FORMAT ivas_format, /* i : ivas_format */ int16_t ref_power_w, /* i : use 0 if hodirac is enabled */ const int16_t nchan_ana /* i : number of analysis channels */ #ifdef FIX_527_SBA_MONO_INPUT , int16_t *mono_frame_count, int16_t *dirac_mono_flag #endif ); ivas_error ivas_mono_dmx_renderer_open( Loading Loading @@ -6299,7 +6279,6 @@ void ivas_fb_mixer_get_in_out_mapping( int16_t in_out_mixer_map[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i/o: mixing mapping */ ); #ifdef FIX_SBA_VANISHING_RESIDUAL void ivas_fb_mixer_cross_fading( IVAS_FB_MIXER_HANDLE hFbMixer, float **ppOut_pcm, Loading @@ -6309,7 +6288,6 @@ void ivas_fb_mixer_cross_fading( const int16_t frame_len, const int16_t cf_offset ); #endif /*! r: number of spectral bands */ int16_t ivas_get_num_bands_from_bw_idx( Loading
lib_com/ivas_qmetadata_com.c +0 −2 Original line number Diff line number Diff line Loading @@ -149,9 +149,7 @@ ivas_error ivas_qmetadata_allocate_memory( { set_zero( hQMetaData->q_direction[dir].band_data[j].elevation, MAX_PARAM_SPATIAL_SUBFRAMES ); set_zero( hQMetaData->q_direction[dir].band_data[j].azimuth, MAX_PARAM_SPATIAL_SUBFRAMES ); #ifdef FIX_527_SBA_MONO_INPUT set_zero( hQMetaData->q_direction[dir].band_data[j].energy_ratio, MAX_PARAM_SPATIAL_SUBFRAMES ); #endif } } Loading
lib_com/ivas_spar_com.c +0 −58 Original line number Diff line number Diff line Loading @@ -78,20 +78,16 @@ 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 active_w_vlbr, const int16_t dtx_vad, const int16_t from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag, const int16_t res_ind #endif ); 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 ); static void ivas_get_Wscaling_factor( float *pppCov_mat_re[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, const int16_t end_band, const int16_t dtx_vad, const int16_t num_ch, const int16_t *pNum_dmx, const int16_t bands_bw, const int16_t active_w, const int16_t active_w_vlbr, float *pWscale #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ); static void ivas_calc_post_pred_per_band( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t num_ch, const int16_t num_dmx, const int16_t band_idx, float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH] ); Loading Loading @@ -474,11 +470,9 @@ static void ivas_get_pred_coeffs( const int16_t active_w_vlbr, const int16_t dtx_vad, const int16_t from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag, const int16_t res_ind #endif ) { int16_t i, j, k, b; Loading Loading @@ -534,7 +528,6 @@ static void ivas_get_pred_coeffs( float real[IVAS_SPAR_MAX_CH - 1], dm_beta_re = 0, dm_g[IVAS_MAX_NUM_BANDS]; float dm_f_local, dm_w, dm_y, DM_F[IVAS_MAX_NUM_BANDS]; float num_f, den_f, passive_g; #ifdef FIX_SBA_VANISHING_RESIDUAL float activew_quad_thresh, g_th_sq; if ( dyn_active_w_flag == 1 ) { Loading @@ -545,9 +538,6 @@ static void ivas_get_pred_coeffs( activew_quad_thresh = IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH; } g_th_sq = activew_quad_thresh * activew_quad_thresh; #else float g_th_sq = IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH * IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH; #endif set_zero( dm_alpha, IVAS_MAX_NUM_BANDS ); Loading Loading @@ -611,7 +601,6 @@ static void ivas_get_pred_coeffs( den_f = max( dm_w, 1e-20f ); passive_g = dm_alpha[b] / den_f; #ifdef FIX_SBA_VANISHING_RESIDUAL if ( dyn_active_w_flag == 1 ) { dm_alpha[b] = 0.0f; Loading @@ -623,14 +612,9 @@ static void ivas_get_pred_coeffs( dm_v_re[res_ind - 1][b] = 1.0f; passive_g = activew_quad_thresh; } #endif #ifdef FIX_SBA_VANISHING_RESIDUAL if ( passive_g < activew_quad_thresh ) #else if ( passive_g < IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH ) #endif { /*linear activeW*/ dm_y = 0; Loading @@ -655,11 +639,7 @@ static void ivas_get_pred_coeffs( /* quadratic activeW */ #ifdef FIX_SBA_VANISHING_RESIDUAL num_f = ( dm_beta_re - ( 2 * dm_alpha[b] * activew_quad_thresh ) ); #else num_f = ( dm_beta_re - ( 2 * dm_alpha[b] * IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH ) ); #endif sqrt_val = 4 * dm_alpha[b] * dm_alpha[b] * g_th_sq; sqrt_val += dm_beta_re * dm_beta_re; Loading @@ -669,11 +649,7 @@ static void ivas_get_pred_coeffs( den_f = 2 * dm_beta_re * g_th_sq; den_f = max( den_f, 1e-20f ); #ifdef FIX_SBA_VANISHING_RESIDUAL dm_g[b] = activew_quad_thresh; #else dm_g[b] = IVAS_LIN_ACTIVEW_QUAD_ACTIVEW_THRESH; #endif DM_F[b] = ( dm_g[b] * num_f ) / den_f; } } Loading Loading @@ -712,10 +688,8 @@ static void ivas_get_Wscaling_factor( const int16_t active_w, const int16_t active_w_vlbr, float *pWscale #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ) { int16_t b, ch; Loading @@ -735,11 +709,7 @@ static void ivas_get_Wscaling_factor( { pWscale[b] = 1; #ifdef FIX_SBA_VANISHING_RESIDUAL if ( ( active_w == 1 ) && ( dyn_active_w_flag == 0 ) ) #else if ( ( active_w == 1 ) && ( pNum_dmx[b * bands_bw] == 1 ) ) #endif { float Gw_sq, g_sq = 0; Loading Loading @@ -1290,15 +1260,11 @@ void ivas_calc_c_p_coeffs( const int16_t band_idx, const int16_t dtx_vad, const int16_t compute_p_flag #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ) { #ifdef FIX_SBA_VANISHING_RESIDUAL int16_t i, j; #endif float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; if ( num_dmx != num_ch ) Loading @@ -1310,7 +1276,6 @@ void ivas_calc_c_p_coeffs( ivas_calc_c_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, num_dmx, band_idx, dtx_vad ); } #ifdef FIX_SBA_VANISHING_RESIDUAL if ( dyn_active_w_flag ) { for ( i = 0; i < num_ch - num_dmx; i++ ) Loading @@ -1321,13 +1286,11 @@ void ivas_calc_c_p_coeffs( } } } #endif if ( compute_p_flag == 1 ) { ivas_calc_p_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, dtx_vad, num_dmx, band_idx ); } #ifdef FIX_SBA_VANISHING_RESIDUAL if ( dyn_active_w_flag ) { for ( i = num_dmx; i < num_ch; i++ ) Loading @@ -1335,7 +1298,6 @@ void ivas_calc_c_p_coeffs( pSparMd->band_coeffs[band_idx + i_ts * IVAS_MAX_NUM_BANDS].P_re[i - num_dmx] = 0; } } #endif } return; Loading Loading @@ -1588,10 +1550,8 @@ void ivas_compute_spar_params( ivas_spar_md_t *hSparMd, float *pWscale, const int16_t from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ) { float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; Loading @@ -1600,11 +1560,9 @@ void ivas_compute_spar_params( ivas_get_pred_coeffs( cov_real, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w, active_w_vlbr, dtx_vad, from_dirac #ifdef FIX_SBA_VANISHING_RESIDUAL , dyn_active_w_flag, hSparMd->res_ind #endif ); ivas_create_fullr_dmx_mat( pred_coeffs_re, dm_fv_re, mixer_mat, num_ch, start_band, end_band, active_w, hSparCfg ); Loading @@ -1613,10 +1571,8 @@ void ivas_compute_spar_params( hSparCfg->num_dmx_chans_per_band, bands_bw, active_w, active_w_vlbr, pWscale #ifdef FIX_SBA_VANISHING_RESIDUAL , dyn_active_w_flag #endif ); for ( b = start_band; b < end_band; b++ ) Loading @@ -1640,10 +1596,8 @@ void ivas_compute_spar_params( if ( ndm != num_ch ) { ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1 #ifdef FIX_SBA_VANISHING_RESIDUAL , dyn_active_w_flag #endif ); #ifdef SPAR_HOA_DBG Loading Loading @@ -1695,10 +1649,8 @@ void ivas_get_spar_md_from_dirac( float Wscale_d[IVAS_MAX_NUM_BANDS], const uint8_t useLowerRes, const int16_t active_w_vlbr #ifdef FIX_SBA_VANISHING_RESIDUAL , const int16_t dyn_active_w_flag #endif ) { int16_t num_ch, band, i, j; Loading @@ -1713,9 +1665,7 @@ void ivas_get_spar_md_from_dirac( float **ppMixer_mat[IVAS_MAX_FB_MIXER_OUT_CH]; float *pMixer_mat[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]; float en_ratio_fac, diff_norm_order1, diff_norm_order2, diff_norm_order3; #ifdef FIX_SBA_VANISHING_RESIDUAL int16_t active_w; #endif int16_t ndm, foa_ch, hoa2_ch; float P_dir_fact[IVAS_SPAR_MAX_CH - 1]; Loading Loading @@ -1969,22 +1919,14 @@ void ivas_get_spar_md_from_dirac( } #endif #ifdef FIX_SBA_VANISHING_RESIDUAL active_w = ( dyn_active_w_flag == 1 ) || ( hSpar_md_cfg->active_w == 1 ); #endif ivas_compute_spar_params( pCov_real, dm_fv_re, i_ts, ppMixer_mat, start_band, end_band, dtx_vad, num_ch, 1, #ifdef FIX_SBA_VANISHING_RESIDUAL active_w, #else hSpar_md_cfg->active_w, #endif active_w_vlbr, hSpar_md_cfg, hSpar_md, Wscale, 1 #ifdef FIX_SBA_VANISHING_RESIDUAL , dyn_active_w_flag #endif ); if ( mixer_mat != NULL ) Loading