Loading lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,9 @@ #define SPLIT_REND_LC3PLUS /* FhG: split rendering using LC3plus codec */ #define FIX_SPLIT_REND_OPEN_ERROR_HANDLING /* adds missing error handling around ivas_split_renderer_open calls */ // #define SPLIT_REND_LC3PLUS_HBR_DBG /* Override bitrate per LC3 core */ #define SPLIT_REND_WITH_HEAD_ROT_MASA #endif #define TD_TDREND_FIX_NULLPTR_ACCESS /* FhG: avoid nullptr access in ivas_rend_TDObjRendOpen */ #define TD_REND_FIX_DIV_BY_ZERO /* FhG: avoid division by zero in sincResample fn */ Loading lib_dec/ivas_init_dec.c +46 −2 Original line number Diff line number Diff line Loading @@ -1253,6 +1253,16 @@ ivas_error ivas_init_decoder( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_renderSplitGetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->splitBinRend.splitrend.multiBinPoseData, st_ivas->hHeadTrackData->sr_pose_pred_axis ); } #endif if ( st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) { if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) Loading @@ -1265,6 +1275,27 @@ ivas_error ivas_init_decoder( { return error; } #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING error = #endif ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); #ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING if ( error != IVAS_ERR_OK ) { return error; } #endif } #endif } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { Loading Loading @@ -1639,7 +1670,13 @@ void ivas_initialize_handles_dec( st_ivas->splitBinRend.hSplitRendBits = NULL; ivas_init_split_rend_handles( &st_ivas->splitBinRend.splitrend ); #endif st_ivas->hDiracDecBin = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) { st_ivas->hDiracDecBin[i] = NULL; } #endif st_ivas->hLsSetUpConversion = NULL; st_ivas->hEFAPdata = NULL; st_ivas->hVBAPdata = NULL; Loading Loading @@ -1791,7 +1828,11 @@ void ivas_destroy_dec( #endif /* Parametric binaural renderer handle */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); #else ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); #endif /* Crend handle */ ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) Loading Loading @@ -1894,8 +1935,11 @@ void ivas_init_dec_get_num_cldfb_instances( { *numCldfbAnalyses = st_ivas->nchan_transport + 1; } #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( st_ivas->hDiracDecBin[0]->useTdDecorr ) #else if ( st_ivas->hDiracDecBin->useTdDecorr ) #endif { *numCldfbAnalyses += 2; } Loading lib_dec/ivas_ism_dec.c +8 −0 Original line number Diff line number Diff line Loading @@ -128,7 +128,11 @@ static ivas_error ivas_ism_bitrate_switching( if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL ) { /* close the parametric binaural renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); #else ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); #endif /* Open the TD Binaural renderer */ if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK ) Loading @@ -154,7 +158,11 @@ static ivas_error ivas_ism_bitrate_switching( if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM ) { /* close the parametric binaural renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); #else ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); #endif /* Open Crend Binaural renderer */ if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), Loading lib_dec/ivas_masa_dec.c +10 −1 Original line number Diff line number Diff line Loading @@ -1152,7 +1152,15 @@ ivas_error ivas_masa_dec_reconfigure( /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( st_ivas->hDiracDecBin[0] != 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[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ) != IVAS_ERR_OK ) { return error; } } #else 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 ) Loading @@ -1160,6 +1168,7 @@ ivas_error ivas_masa_dec_reconfigure( return error; } } #endif /*-----------------------------------------------------------------* * CLDFB instances Loading lib_dec/ivas_mcmasa_dec.c +20 −1 Original line number Diff line number Diff line Loading @@ -105,8 +105,11 @@ ivas_error ivas_mcmasa_dec_reconfig( { ivas_binRenderer_close( &st_ivas->hBinRenderer ); } #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( st_ivas->hDiracDecBin[0] == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) #else if ( st_ivas->hDiracDecBin == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) #endif { /* open parametric binaural renderer */ if ( st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) Loading @@ -122,24 +125,40 @@ ivas_error ivas_mcmasa_dec_reconfig( return error; } } #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA else if ( st_ivas->hDiracDecBin[0] != NULL ) #else else if ( st_ivas->hDiracDecBin != NULL ) #endif { if ( st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) { /* close unneeded renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); #else ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); #endif } else { #ifdef FIX_417_TD_DECORR_BRATE_SW /* if necessary, close/open td-decorrs */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA 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[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ) != IVAS_ERR_OK ) #else 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 ) #endif { return error; } /* regularization factor is bitrate-dependent */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA st_ivas->hDiracDecBin[0]->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); #else st_ivas->hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); #endif #else /* the decision for useTdDecorr is done in ivas_dirac_dec_init_binaural_data(). here, comparing against the same condition. */ if ( st_ivas->hDiracDecBin->useTdDecorr != ( ivas_total_brate < IVAS_48k && st_ivas->nchan_transport == 1 ) ) Loading Loading
lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,9 @@ #define SPLIT_REND_LC3PLUS /* FhG: split rendering using LC3plus codec */ #define FIX_SPLIT_REND_OPEN_ERROR_HANDLING /* adds missing error handling around ivas_split_renderer_open calls */ // #define SPLIT_REND_LC3PLUS_HBR_DBG /* Override bitrate per LC3 core */ #define SPLIT_REND_WITH_HEAD_ROT_MASA #endif #define TD_TDREND_FIX_NULLPTR_ACCESS /* FhG: avoid nullptr access in ivas_rend_TDObjRendOpen */ #define TD_REND_FIX_DIV_BY_ZERO /* FhG: avoid division by zero in sincResample fn */ Loading
lib_dec/ivas_init_dec.c +46 −2 Original line number Diff line number Diff line Loading @@ -1253,6 +1253,16 @@ ivas_error ivas_init_decoder( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_renderSplitGetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->splitBinRend.splitrend.multiBinPoseData, st_ivas->hHeadTrackData->sr_pose_pred_axis ); } #endif if ( st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) { if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) Loading @@ -1265,6 +1275,27 @@ ivas_error ivas_init_decoder( { return error; } #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING error = #endif ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); #ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING if ( error != IVAS_ERR_OK ) { return error; } #endif } #endif } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { Loading Loading @@ -1639,7 +1670,13 @@ void ivas_initialize_handles_dec( st_ivas->splitBinRend.hSplitRendBits = NULL; ivas_init_split_rend_handles( &st_ivas->splitBinRend.splitrend ); #endif st_ivas->hDiracDecBin = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) { st_ivas->hDiracDecBin[i] = NULL; } #endif st_ivas->hLsSetUpConversion = NULL; st_ivas->hEFAPdata = NULL; st_ivas->hVBAPdata = NULL; Loading Loading @@ -1791,7 +1828,11 @@ void ivas_destroy_dec( #endif /* Parametric binaural renderer handle */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); #else ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); #endif /* Crend handle */ ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) Loading Loading @@ -1894,8 +1935,11 @@ void ivas_init_dec_get_num_cldfb_instances( { *numCldfbAnalyses = st_ivas->nchan_transport + 1; } #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( st_ivas->hDiracDecBin[0]->useTdDecorr ) #else if ( st_ivas->hDiracDecBin->useTdDecorr ) #endif { *numCldfbAnalyses += 2; } Loading
lib_dec/ivas_ism_dec.c +8 −0 Original line number Diff line number Diff line Loading @@ -128,7 +128,11 @@ static ivas_error ivas_ism_bitrate_switching( if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL ) { /* close the parametric binaural renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); #else ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); #endif /* Open the TD Binaural renderer */ if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK ) Loading @@ -154,7 +158,11 @@ static ivas_error ivas_ism_bitrate_switching( if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM ) { /* close the parametric binaural renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); #else ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); #endif /* Open Crend Binaural renderer */ if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), Loading
lib_dec/ivas_masa_dec.c +10 −1 Original line number Diff line number Diff line Loading @@ -1152,7 +1152,15 @@ ivas_error ivas_masa_dec_reconfigure( /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( st_ivas->hDiracDecBin[0] != 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[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ) != IVAS_ERR_OK ) { return error; } } #else 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 ) Loading @@ -1160,6 +1168,7 @@ ivas_error ivas_masa_dec_reconfigure( return error; } } #endif /*-----------------------------------------------------------------* * CLDFB instances Loading
lib_dec/ivas_mcmasa_dec.c +20 −1 Original line number Diff line number Diff line Loading @@ -105,8 +105,11 @@ ivas_error ivas_mcmasa_dec_reconfig( { ivas_binRenderer_close( &st_ivas->hBinRenderer ); } #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA if ( st_ivas->hDiracDecBin[0] == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) #else if ( st_ivas->hDiracDecBin == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) #endif { /* open parametric binaural renderer */ if ( st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) Loading @@ -122,24 +125,40 @@ ivas_error ivas_mcmasa_dec_reconfig( return error; } } #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA else if ( st_ivas->hDiracDecBin[0] != NULL ) #else else if ( st_ivas->hDiracDecBin != NULL ) #endif { if ( st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) { /* close unneeded renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); #else ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); #endif } else { #ifdef FIX_417_TD_DECORR_BRATE_SW /* if necessary, close/open td-decorrs */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA 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[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ) != IVAS_ERR_OK ) #else 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 ) #endif { return error; } /* regularization factor is bitrate-dependent */ #ifdef SPLIT_REND_WITH_HEAD_ROT_MASA st_ivas->hDiracDecBin[0]->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); #else st_ivas->hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); #endif #else /* the decision for useTdDecorr is done in ivas_dirac_dec_init_binaural_data(). here, comparing against the same condition. */ if ( st_ivas->hDiracDecBin->useTdDecorr != ( ivas_total_brate < IVAS_48k && st_ivas->nchan_transport == 1 ) ) Loading