Loading lib_com/ivas_prot.h +11 −0 Original line number Diff line number Diff line Loading @@ -3440,10 +3440,21 @@ void ivas_dirac_dec( const int16_t i_sf ); #ifdef FIX_417_TD_DECORR_BRATE_SW ivas_error ivas_td_decorr_reconfig_dec( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate, /* i : total IVAS bitrate */ const int16_t nchan_transport, /* i : number of transport channels */ const int32_t output_Fs, /* i : output sampling rate */ ivas_td_decorr_state_t **hTdDecorr, /* i/o: TD decorrelator handle */ uint16_t *useTdDecorr /* i/o: TD decorrelator flag */ ); #else ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ ); #endif void computeDiffuseness_mdft( float **buffer_intensity[DIRAC_NUM_DIMS], Loading lib_com/ivas_td_decorr.c +102 −3 Original line number Diff line number Diff line Loading @@ -87,12 +87,111 @@ static const float ivas_three_pow_frac[IVAS_MAX_DECORR_APD_SECTIONS] = { }; #ifdef FIX_417_TD_DECORR_BRATE_SW #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) #endif /*------------------------------------------------------------------------------------------* * Local functions declaration *------------------------------------------------------------------------------------------*/ static int16_t ivas_get_APD_filt_orders( const int16_t num_out_chans, const int32_t output_Fs, int16_t *APD_filt_orders ); static ivas_error ivas_td_decorr_init( ivas_td_decorr_state_t *hTdDecorr, const int16_t num_out_chans, const int16_t ducking_flag ); static void ivas_td_decorr_init( ivas_td_decorr_state_t *hTdDecorr, const int16_t num_out_chans, const int16_t ducking_flag ); #ifdef FIX_417_TD_DECORR_BRATE_SW /*------------------------------------------------------------------------- * ivas_td_decorr_reconfig_dec() * * Allocate and initialize time domain decorrelator handle *------------------------------------------------------------------------*/ ivas_error ivas_td_decorr_reconfig_dec( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate, /* i : total IVAS bitrate */ const int16_t nchan_transport, /* i : number of transport channels */ const int32_t output_Fs, /* i : output sampling rate */ ivas_td_decorr_state_t **hTdDecorr, /* i/o: TD decorrelator handle */ uint16_t *useTdDecorr /* i/o: TD decorrelator flag */ ) { uint16_t useTdDecorr_new; ivas_error error; useTdDecorr_new = 0; if ( ivas_format == SBA_FORMAT ) { if ( nchan_transport == 1 ) { useTdDecorr_new = 1; } } else if ( ivas_format == MASA_FORMAT ) { if ( ( ivas_total_brate < IVAS_48k && nchan_transport == 1 ) || ivas_total_brate < MASA_STEREO_MIN_BITRATE ) { useTdDecorr_new = 1; } } else if ( ivas_format == MC_FORMAT ) { if ( ivas_total_brate < IVAS_48k && nchan_transport == 1 ) { useTdDecorr_new = 1; } } if ( *useTdDecorr != useTdDecorr_new ) { *useTdDecorr = useTdDecorr_new; if ( *useTdDecorr ) { if ( ivas_total_brate >= IVAS_13k2 && ivas_format == SBA_FORMAT ) { if ( *hTdDecorr == NULL ) { if ( ( error = ivas_td_decorr_dec_open( hTdDecorr, output_Fs, 3, 1 ) ) != IVAS_ERR_OK ) { return error; } } if ( ivas_total_brate < IVAS_24k4 ) { ( *hTdDecorr )->pTrans_det->duck_mult_fac = IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR; } else { ( *hTdDecorr )->pTrans_det->duck_mult_fac = IVAS_TDET_DUCK_MULT_FAC_PARA_BIN; } } else { if ( *hTdDecorr == NULL ) { if ( ( error = ivas_td_decorr_dec_open( hTdDecorr, output_Fs, 3, 0 ) ) != IVAS_ERR_OK ) { return error; } } else { ivas_td_decorr_init( *hTdDecorr, 3, 0 ); } } } else { ivas_td_decorr_dec_close( hTdDecorr ); } } return IVAS_ERR_OK; } #endif /*------------------------------------------------------------------------- Loading Loading @@ -275,7 +374,7 @@ static int16_t ivas_get_APD_filt_orders( * TD decorr Initialisation function *-----------------------------------------------------------------------------------------*/ static ivas_error ivas_td_decorr_init( static void ivas_td_decorr_init( ivas_td_decorr_state_t *hTdDecorr, const int16_t num_out_chans, const int16_t ducking_flag ) Loading @@ -295,7 +394,7 @@ static ivas_error ivas_td_decorr_init( } } return IVAS_ERR_OK; return; } Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -170,7 +170,7 @@ #define FIX_401_DIRAC_RENDERER_META_READ_INDICES /* Nokia: Issue 401: Fix metadata reading indices in DirAC renderer. */ #define FIX_406_IVAS_POSITION /* Eri: Issue 406: Unify IVAS_POSITION to use IVAS_VECTOR3 instead */ #define REND_DEBUGGING_REVISION /* VA: encapsulate rendering debugging options with DEBUGGING */ #define FIX_417_TD_DECORR_BRATE_SW /* VA: Issue 417: fix incorrect use of TD decorrelator in bitrate switching */ /* ################## End DEVELOPMENT switches ######################### */ Loading lib_dec/ivas_masa_dec.c +27 −0 Original line number Diff line number Diff line Loading @@ -1093,6 +1093,9 @@ ivas_error ivas_masa_dec_reconfigure( uint16_t *bit_stream; Decoder_State **sts; int32_t ivas_total_brate, last_ivas_total_brate; #ifdef FIX_417_TD_DECORR_BRATE_SW int16_t nchan_transport_old, numCldfbAnalyses_old, numCldfbSyntheses_old; #endif ivas_error error; error = IVAS_ERR_OK; Loading @@ -1100,6 +1103,11 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; #ifdef FIX_417_TD_DECORR_BRATE_SW nchan_transport_old = st_ivas->nchan_transport; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); #endif /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ Loading Loading @@ -1157,6 +1165,25 @@ ivas_error ivas_masa_dec_reconfigure( } } #ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ if ( st_ivas->hDiracDecBin != NULL ) { if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) { return error; } } /*-----------------------------------------------------------------* * Set-up MASA coding elements and bitrates *-----------------------------------------------------------------*/ #endif ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp ); return error; Loading lib_dec/ivas_mct_dec.c +26 −1 Original line number Diff line number Diff line Loading @@ -1046,6 +1046,8 @@ static ivas_error ivas_mc_dec_reconfig( return error; } #ifndef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * CLDFB instances *-----------------------------------------------------------------*/ Loading @@ -1054,7 +1056,7 @@ static ivas_error ivas_mc_dec_reconfig( { return error; } #endif /*-----------------------------------------------------------------* * Allocate the LFE handle that is coded seperately after the allocation of the core coders *-----------------------------------------------------------------*/ Loading Loading @@ -1244,5 +1246,28 @@ static ivas_error ivas_mc_dec_reconfig( #endif } #ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ if ( st_ivas->hDiracDecBin != NULL ) { if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) { return error; } } /*-----------------------------------------------------------------* * CLDFB instances *-----------------------------------------------------------------*/ if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, nchan_transport_old, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) { return error; } #endif return error; } Loading
lib_com/ivas_prot.h +11 −0 Original line number Diff line number Diff line Loading @@ -3440,10 +3440,21 @@ void ivas_dirac_dec( const int16_t i_sf ); #ifdef FIX_417_TD_DECORR_BRATE_SW ivas_error ivas_td_decorr_reconfig_dec( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate, /* i : total IVAS bitrate */ const int16_t nchan_transport, /* i : number of transport channels */ const int32_t output_Fs, /* i : output sampling rate */ ivas_td_decorr_state_t **hTdDecorr, /* i/o: TD decorrelator handle */ uint16_t *useTdDecorr /* i/o: TD decorrelator flag */ ); #else ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ ); #endif void computeDiffuseness_mdft( float **buffer_intensity[DIRAC_NUM_DIMS], Loading
lib_com/ivas_td_decorr.c +102 −3 Original line number Diff line number Diff line Loading @@ -87,12 +87,111 @@ static const float ivas_three_pow_frac[IVAS_MAX_DECORR_APD_SECTIONS] = { }; #ifdef FIX_417_TD_DECORR_BRATE_SW #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) #endif /*------------------------------------------------------------------------------------------* * Local functions declaration *------------------------------------------------------------------------------------------*/ static int16_t ivas_get_APD_filt_orders( const int16_t num_out_chans, const int32_t output_Fs, int16_t *APD_filt_orders ); static ivas_error ivas_td_decorr_init( ivas_td_decorr_state_t *hTdDecorr, const int16_t num_out_chans, const int16_t ducking_flag ); static void ivas_td_decorr_init( ivas_td_decorr_state_t *hTdDecorr, const int16_t num_out_chans, const int16_t ducking_flag ); #ifdef FIX_417_TD_DECORR_BRATE_SW /*------------------------------------------------------------------------- * ivas_td_decorr_reconfig_dec() * * Allocate and initialize time domain decorrelator handle *------------------------------------------------------------------------*/ ivas_error ivas_td_decorr_reconfig_dec( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate, /* i : total IVAS bitrate */ const int16_t nchan_transport, /* i : number of transport channels */ const int32_t output_Fs, /* i : output sampling rate */ ivas_td_decorr_state_t **hTdDecorr, /* i/o: TD decorrelator handle */ uint16_t *useTdDecorr /* i/o: TD decorrelator flag */ ) { uint16_t useTdDecorr_new; ivas_error error; useTdDecorr_new = 0; if ( ivas_format == SBA_FORMAT ) { if ( nchan_transport == 1 ) { useTdDecorr_new = 1; } } else if ( ivas_format == MASA_FORMAT ) { if ( ( ivas_total_brate < IVAS_48k && nchan_transport == 1 ) || ivas_total_brate < MASA_STEREO_MIN_BITRATE ) { useTdDecorr_new = 1; } } else if ( ivas_format == MC_FORMAT ) { if ( ivas_total_brate < IVAS_48k && nchan_transport == 1 ) { useTdDecorr_new = 1; } } if ( *useTdDecorr != useTdDecorr_new ) { *useTdDecorr = useTdDecorr_new; if ( *useTdDecorr ) { if ( ivas_total_brate >= IVAS_13k2 && ivas_format == SBA_FORMAT ) { if ( *hTdDecorr == NULL ) { if ( ( error = ivas_td_decorr_dec_open( hTdDecorr, output_Fs, 3, 1 ) ) != IVAS_ERR_OK ) { return error; } } if ( ivas_total_brate < IVAS_24k4 ) { ( *hTdDecorr )->pTrans_det->duck_mult_fac = IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR; } else { ( *hTdDecorr )->pTrans_det->duck_mult_fac = IVAS_TDET_DUCK_MULT_FAC_PARA_BIN; } } else { if ( *hTdDecorr == NULL ) { if ( ( error = ivas_td_decorr_dec_open( hTdDecorr, output_Fs, 3, 0 ) ) != IVAS_ERR_OK ) { return error; } } else { ivas_td_decorr_init( *hTdDecorr, 3, 0 ); } } } else { ivas_td_decorr_dec_close( hTdDecorr ); } } return IVAS_ERR_OK; } #endif /*------------------------------------------------------------------------- Loading Loading @@ -275,7 +374,7 @@ static int16_t ivas_get_APD_filt_orders( * TD decorr Initialisation function *-----------------------------------------------------------------------------------------*/ static ivas_error ivas_td_decorr_init( static void ivas_td_decorr_init( ivas_td_decorr_state_t *hTdDecorr, const int16_t num_out_chans, const int16_t ducking_flag ) Loading @@ -295,7 +394,7 @@ static ivas_error ivas_td_decorr_init( } } return IVAS_ERR_OK; return; } Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -170,7 +170,7 @@ #define FIX_401_DIRAC_RENDERER_META_READ_INDICES /* Nokia: Issue 401: Fix metadata reading indices in DirAC renderer. */ #define FIX_406_IVAS_POSITION /* Eri: Issue 406: Unify IVAS_POSITION to use IVAS_VECTOR3 instead */ #define REND_DEBUGGING_REVISION /* VA: encapsulate rendering debugging options with DEBUGGING */ #define FIX_417_TD_DECORR_BRATE_SW /* VA: Issue 417: fix incorrect use of TD decorrelator in bitrate switching */ /* ################## End DEVELOPMENT switches ######################### */ Loading
lib_dec/ivas_masa_dec.c +27 −0 Original line number Diff line number Diff line Loading @@ -1093,6 +1093,9 @@ ivas_error ivas_masa_dec_reconfigure( uint16_t *bit_stream; Decoder_State **sts; int32_t ivas_total_brate, last_ivas_total_brate; #ifdef FIX_417_TD_DECORR_BRATE_SW int16_t nchan_transport_old, numCldfbAnalyses_old, numCldfbSyntheses_old; #endif ivas_error error; error = IVAS_ERR_OK; Loading @@ -1100,6 +1103,11 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; #ifdef FIX_417_TD_DECORR_BRATE_SW nchan_transport_old = st_ivas->nchan_transport; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); #endif /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ Loading Loading @@ -1157,6 +1165,25 @@ ivas_error ivas_masa_dec_reconfigure( } } #ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ if ( st_ivas->hDiracDecBin != NULL ) { if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) { return error; } } /*-----------------------------------------------------------------* * Set-up MASA coding elements and bitrates *-----------------------------------------------------------------*/ #endif ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp ); return error; Loading
lib_dec/ivas_mct_dec.c +26 −1 Original line number Diff line number Diff line Loading @@ -1046,6 +1046,8 @@ static ivas_error ivas_mc_dec_reconfig( return error; } #ifndef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * CLDFB instances *-----------------------------------------------------------------*/ Loading @@ -1054,7 +1056,7 @@ static ivas_error ivas_mc_dec_reconfig( { return error; } #endif /*-----------------------------------------------------------------* * Allocate the LFE handle that is coded seperately after the allocation of the core coders *-----------------------------------------------------------------*/ Loading Loading @@ -1244,5 +1246,28 @@ static ivas_error ivas_mc_dec_reconfig( #endif } #ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ if ( st_ivas->hDiracDecBin != NULL ) { if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) { return error; } } /*-----------------------------------------------------------------* * CLDFB instances *-----------------------------------------------------------------*/ if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, nchan_transport_old, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) { return error; } #endif return error; }