Loading lib_com/ivas_fb_mixer.c +134 −81 Original line number Diff line number Diff line Loading @@ -52,7 +52,11 @@ static void ivas_get_ld_fb_resp( float **ppIdeal_FRs_re, float **ppIdeal_FRs_im, static int16_t ivas_fb_mixer_get_band_diff_non48k( const int32_t sampling_rate, const float delay_ms ); static const float *ivas_get_cheby_ramp( const int16_t delay ); static void ivas_get_hanning_win( const int16_t len, float *pH_win ); #ifdef SBA_BR_SWITCHING_CLEAN_UP static ivas_error ivas_filterbank_setup( IVAS_FB_MIXER_HANDLE hFbMixer, const int32_t sampling_rate, const int16_t spar_reconfig_flag ); #else static ivas_error ivas_filterbank_setup( IVAS_FB_MIXER_HANDLE hFbMixer, const int32_t sampling_rate ); #endif static ivas_error ivas_fb_mixer_get_window( const int16_t fade_len, const int32_t sampling_rate, const float **pWindow ); Loading Loading @@ -175,6 +179,10 @@ ivas_error ivas_FB_mixer_open( IVAS_FB_MIXER_HANDLE *hFbMixer_out, /* i/o: FB mixer handle */ const int32_t sampling_rate, /* i : sampling rate */ IVAS_FB_CFG *fb_cfg /* i : FB config. handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ) { IVAS_FB_MIXER_HANDLE hFbMixer; Loading @@ -185,8 +193,11 @@ ivas_error ivas_FB_mixer_open( error = IVAS_ERR_OK; frame_len = (int16_t) ( sampling_rate / FRAMES_PER_SEC ); #ifdef SBA_BR_SWITCHING_CLEAN_UP hFbMixer = *hFbMixer_out; if ( !spar_reconfig_flag ) { #endif if ( ( hFbMixer = (IVAS_FB_MIXER_HANDLE) malloc( sizeof( IVAS_FB_MIXER_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); Loading @@ -203,6 +214,9 @@ ivas_error ivas_FB_mixer_open( { hFbMixer->pFb = NULL; } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif if ( fb_cfg->active_w_mixing == -1 ) { num_chs_alloc = 0; Loading Loading @@ -274,7 +288,10 @@ ivas_error ivas_FB_mixer_open( } } } #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif if ( fb_cfg->num_out_chans > 0 ) { const int16_t *pActive_bins_per_band, *pActive_bins_per_band_abs, *pStart_offset, *pStart_offset_abs; Loading Loading @@ -323,10 +340,15 @@ ivas_error ivas_FB_mixer_open( /* ignore all the deeper filter bank stuff for now */ hFbMixer->num_diff_bands = 0; } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif hFbMixer->fb_cfg = fb_cfg; #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_filterbank_setup( hFbMixer, sampling_rate, spar_reconfig_flag ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_filterbank_setup( hFbMixer, sampling_rate ) ) != IVAS_ERR_OK ) #endif { return error; } Loading @@ -346,6 +368,10 @@ ivas_error ivas_FB_mixer_open( void ivas_FB_mixer_close( IVAS_FB_MIXER_HANDLE *hFbMixer_in, /* i/o: FB mixer handle */ const int32_t sampling_rate /* i : sampling rate in Hz */ #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ) { IVAS_FB_MIXER_HANDLE hFbMixer; Loading Loading @@ -404,7 +430,10 @@ void ivas_FB_mixer_close( free( hFbMixer->prior_mixer[0][0] ); hFbMixer->prior_mixer[0][0] = NULL; } #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif if ( fb_cfg->num_out_chans > 0 ) { num_bands = hFbMixer->pFb->filterbank_num_bands; Loading Loading @@ -433,21 +462,35 @@ void ivas_FB_mixer_close( } } } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif if ( hFbMixer->pFb != NULL ) { free( hFbMixer->pFb ); hFbMixer->pFb = NULL; } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif if ( hFbMixer->fb_cfg != NULL ) { free( hFbMixer->fb_cfg ); hFbMixer->fb_cfg = NULL; } #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif free( hFbMixer ); hFbMixer = NULL; #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif } return; Loading Loading @@ -1014,7 +1057,12 @@ static void ivas_get_active_bins( static ivas_error ivas_filterbank_setup( IVAS_FB_MIXER_HANDLE hFbMixer, const int32_t sampling_rate ) const int32_t sampling_rate #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ) { int16_t i, j; const float *pAll_fb_fr[2]; Loading Loading @@ -1053,7 +1101,10 @@ static ivas_error ivas_filterbank_setup( hFbMixer->cross_fade_end_offset = pCfg->fade_len + pCfg->pcm_offset; hFbMixer->cross_fade_start_offset = hFbMixer->cross_fade_end_offset - pCfg->fade_len; hFbMixer->ana_window_offset = pCfg->fb_latency + pCfg->pcm_offset; #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif if ( ( error = ivas_fb_mixer_get_window( pCfg->fb_latency, sampling_rate, &( hFbMixer->pAna_window ) ) ) != IVAS_ERR_OK ) { return error; Loading @@ -1063,7 +1114,9 @@ static ivas_error ivas_filterbank_setup( { return error; } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif if ( pCfg->num_out_chans > 0 ) { ivas_filterbank_t *pFb = hFbMixer->pFb; Loading lib_com/ivas_prot.h +8 −0 Original line number Diff line number Diff line Loading @@ -5316,11 +5316,19 @@ ivas_error ivas_FB_mixer_open( IVAS_FB_MIXER_HANDLE *hFbMixer, /* i/o: FB mixer handle */ const int32_t sampling_rate, /* i : sampling rate */ IVAS_FB_CFG *fb_cfg /* i : FB config. handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ); void ivas_FB_mixer_close( IVAS_FB_MIXER_HANDLE *hFbMixer, /* i/o: FB mixer handle */ const int32_t sampling_rate /* i : sampling rate in Hz */ #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ); void ivas_fb_mixer_pcm_ingest( Loading lib_dec/ivas_spar_decoder.c +8 −0 Original line number Diff line number Diff line Loading @@ -116,7 +116,11 @@ ivas_error ivas_spar_dec_open( fb_cfg->remix_order = remix_order_set[hSpar->hMdDec->spar_md_cfg.remix_unmix_order]; /* FB mixer handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &hSpar->hFbMixer, output_Fs, fb_cfg, spar_reconfig_flag ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_FB_mixer_open( &hSpar->hFbMixer, output_Fs, fb_cfg ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -217,7 +221,11 @@ void ivas_spar_dec_close( ivas_spar_td_decorr_dec_close( &hSpar->hTdDecorr ); /* FB mixer handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP ivas_FB_mixer_close( &hSpar->hFbMixer, output_Fs, spar_reconfig_flag ); #else ivas_FB_mixer_close( &hSpar->hFbMixer, output_Fs ); #endif #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { Loading lib_enc/ivas_dirac_enc.c +8 −0 Original line number Diff line number Diff line Loading @@ -104,7 +104,11 @@ ivas_error ivas_dirac_enc_open( return error; } /* Allocate and initialize FB mixer handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -238,7 +242,11 @@ void ivas_dirac_enc_close( if ( hDirAC->hFbMixer != NULL ) { #ifdef SBA_BR_SWITCHING_CLEAN_UP ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs, 0 ); #else ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); #endif } for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) Loading lib_enc/ivas_ism_param_enc.c +8 −0 Original line number Diff line number Diff line Loading @@ -281,7 +281,11 @@ ivas_error ivas_param_ism_enc_open( } /* Allocate and initialize FB mixer handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -322,7 +326,11 @@ void ivas_param_ism_enc_close( const int32_t input_Fs /* i : input sampling_rate */ ) { #ifdef SBA_BR_SWITCHING_CLEAN_UP ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs, 0 ); #else ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); #endif if ( hDirAC->hParamIsm != NULL ) { Loading Loading
lib_com/ivas_fb_mixer.c +134 −81 Original line number Diff line number Diff line Loading @@ -52,7 +52,11 @@ static void ivas_get_ld_fb_resp( float **ppIdeal_FRs_re, float **ppIdeal_FRs_im, static int16_t ivas_fb_mixer_get_band_diff_non48k( const int32_t sampling_rate, const float delay_ms ); static const float *ivas_get_cheby_ramp( const int16_t delay ); static void ivas_get_hanning_win( const int16_t len, float *pH_win ); #ifdef SBA_BR_SWITCHING_CLEAN_UP static ivas_error ivas_filterbank_setup( IVAS_FB_MIXER_HANDLE hFbMixer, const int32_t sampling_rate, const int16_t spar_reconfig_flag ); #else static ivas_error ivas_filterbank_setup( IVAS_FB_MIXER_HANDLE hFbMixer, const int32_t sampling_rate ); #endif static ivas_error ivas_fb_mixer_get_window( const int16_t fade_len, const int32_t sampling_rate, const float **pWindow ); Loading Loading @@ -175,6 +179,10 @@ ivas_error ivas_FB_mixer_open( IVAS_FB_MIXER_HANDLE *hFbMixer_out, /* i/o: FB mixer handle */ const int32_t sampling_rate, /* i : sampling rate */ IVAS_FB_CFG *fb_cfg /* i : FB config. handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ) { IVAS_FB_MIXER_HANDLE hFbMixer; Loading @@ -185,8 +193,11 @@ ivas_error ivas_FB_mixer_open( error = IVAS_ERR_OK; frame_len = (int16_t) ( sampling_rate / FRAMES_PER_SEC ); #ifdef SBA_BR_SWITCHING_CLEAN_UP hFbMixer = *hFbMixer_out; if ( !spar_reconfig_flag ) { #endif if ( ( hFbMixer = (IVAS_FB_MIXER_HANDLE) malloc( sizeof( IVAS_FB_MIXER_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); Loading @@ -203,6 +214,9 @@ ivas_error ivas_FB_mixer_open( { hFbMixer->pFb = NULL; } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif if ( fb_cfg->active_w_mixing == -1 ) { num_chs_alloc = 0; Loading Loading @@ -274,7 +288,10 @@ ivas_error ivas_FB_mixer_open( } } } #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif if ( fb_cfg->num_out_chans > 0 ) { const int16_t *pActive_bins_per_band, *pActive_bins_per_band_abs, *pStart_offset, *pStart_offset_abs; Loading Loading @@ -323,10 +340,15 @@ ivas_error ivas_FB_mixer_open( /* ignore all the deeper filter bank stuff for now */ hFbMixer->num_diff_bands = 0; } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif hFbMixer->fb_cfg = fb_cfg; #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_filterbank_setup( hFbMixer, sampling_rate, spar_reconfig_flag ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_filterbank_setup( hFbMixer, sampling_rate ) ) != IVAS_ERR_OK ) #endif { return error; } Loading @@ -346,6 +368,10 @@ ivas_error ivas_FB_mixer_open( void ivas_FB_mixer_close( IVAS_FB_MIXER_HANDLE *hFbMixer_in, /* i/o: FB mixer handle */ const int32_t sampling_rate /* i : sampling rate in Hz */ #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ) { IVAS_FB_MIXER_HANDLE hFbMixer; Loading Loading @@ -404,7 +430,10 @@ void ivas_FB_mixer_close( free( hFbMixer->prior_mixer[0][0] ); hFbMixer->prior_mixer[0][0] = NULL; } #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif if ( fb_cfg->num_out_chans > 0 ) { num_bands = hFbMixer->pFb->filterbank_num_bands; Loading Loading @@ -433,21 +462,35 @@ void ivas_FB_mixer_close( } } } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif if ( hFbMixer->pFb != NULL ) { free( hFbMixer->pFb ); hFbMixer->pFb = NULL; } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif if ( hFbMixer->fb_cfg != NULL ) { free( hFbMixer->fb_cfg ); hFbMixer->fb_cfg = NULL; } #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif free( hFbMixer ); hFbMixer = NULL; #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif } return; Loading Loading @@ -1014,7 +1057,12 @@ static void ivas_get_active_bins( static ivas_error ivas_filterbank_setup( IVAS_FB_MIXER_HANDLE hFbMixer, const int32_t sampling_rate ) const int32_t sampling_rate #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ) { int16_t i, j; const float *pAll_fb_fr[2]; Loading Loading @@ -1053,7 +1101,10 @@ static ivas_error ivas_filterbank_setup( hFbMixer->cross_fade_end_offset = pCfg->fade_len + pCfg->pcm_offset; hFbMixer->cross_fade_start_offset = hFbMixer->cross_fade_end_offset - pCfg->fade_len; hFbMixer->ana_window_offset = pCfg->fb_latency + pCfg->pcm_offset; #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { #endif if ( ( error = ivas_fb_mixer_get_window( pCfg->fb_latency, sampling_rate, &( hFbMixer->pAna_window ) ) ) != IVAS_ERR_OK ) { return error; Loading @@ -1063,7 +1114,9 @@ static ivas_error ivas_filterbank_setup( { return error; } #ifdef SBA_BR_SWITCHING_CLEAN_UP } #endif if ( pCfg->num_out_chans > 0 ) { ivas_filterbank_t *pFb = hFbMixer->pFb; Loading
lib_com/ivas_prot.h +8 −0 Original line number Diff line number Diff line Loading @@ -5316,11 +5316,19 @@ ivas_error ivas_FB_mixer_open( IVAS_FB_MIXER_HANDLE *hFbMixer, /* i/o: FB mixer handle */ const int32_t sampling_rate, /* i : sampling rate */ IVAS_FB_CFG *fb_cfg /* i : FB config. handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ); void ivas_FB_mixer_close( IVAS_FB_MIXER_HANDLE *hFbMixer, /* i/o: FB mixer handle */ const int32_t sampling_rate /* i : sampling rate in Hz */ #ifdef SBA_BR_SWITCHING_CLEAN_UP , const int16_t spar_reconfig_flag #endif ); void ivas_fb_mixer_pcm_ingest( Loading
lib_dec/ivas_spar_decoder.c +8 −0 Original line number Diff line number Diff line Loading @@ -116,7 +116,11 @@ ivas_error ivas_spar_dec_open( fb_cfg->remix_order = remix_order_set[hSpar->hMdDec->spar_md_cfg.remix_unmix_order]; /* FB mixer handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &hSpar->hFbMixer, output_Fs, fb_cfg, spar_reconfig_flag ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_FB_mixer_open( &hSpar->hFbMixer, output_Fs, fb_cfg ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -217,7 +221,11 @@ void ivas_spar_dec_close( ivas_spar_td_decorr_dec_close( &hSpar->hTdDecorr ); /* FB mixer handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP ivas_FB_mixer_close( &hSpar->hFbMixer, output_Fs, spar_reconfig_flag ); #else ivas_FB_mixer_close( &hSpar->hFbMixer, output_Fs ); #endif #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { Loading
lib_enc/ivas_dirac_enc.c +8 −0 Original line number Diff line number Diff line Loading @@ -104,7 +104,11 @@ ivas_error ivas_dirac_enc_open( return error; } /* Allocate and initialize FB mixer handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -238,7 +242,11 @@ void ivas_dirac_enc_close( if ( hDirAC->hFbMixer != NULL ) { #ifdef SBA_BR_SWITCHING_CLEAN_UP ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs, 0 ); #else ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); #endif } for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) Loading
lib_enc/ivas_ism_param_enc.c +8 −0 Original line number Diff line number Diff line Loading @@ -281,7 +281,11 @@ ivas_error ivas_param_ism_enc_open( } /* Allocate and initialize FB mixer handle */ #ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -322,7 +326,11 @@ void ivas_param_ism_enc_close( const int32_t input_Fs /* i : input sampling_rate */ ) { #ifdef SBA_BR_SWITCHING_CLEAN_UP ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs, 0 ); #else ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); #endif if ( hDirAC->hParamIsm != NULL ) { Loading