diff --git a/lib_com/options.h b/lib_com/options.h index 7872de13b305e2d78690a1d335f4f5ca8b96cf31..8bf694322df0dc5d683401d41c6dd66e145fbd6a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,6 +166,7 @@ #define NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST /* FhG: address issue 1037 */ #define FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI /* FhG: move setting of pointers for parameter decoding so they are skipped in lost frames when they are not needed */ #define NONBE_FIX_1056_ISM_RATE_SWITCH /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */ +#define NONBE_FIX_1075 /* FhG: fix segfault for bitrate switching + BINAURAL_ROOM_REVERB output in MC */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 80cad2c96a8f5f364015ad4be30307e67fd29997..8b9d77e38f2f872c873ba90188988ef39b73afea 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -2411,6 +2411,15 @@ ivas_error ivas_init_decoder_fx( SrcSpatial_p->q_Pos_p = Q31; move16(); } +#ifdef NONBE_FIX_1075 + IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + { + IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) + { + return error; + } + } +#endif /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) @@ -2527,6 +2536,15 @@ ivas_error ivas_init_decoder_fx( SrcSpatial_p->q_Pos_p = Q31; move16(); } +#ifdef NONBE_FIX_1075 + IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + { + IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) + { + return error; + } + } +#endif } } diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 9b622bdcd5f7432bd0c67fb00b4fa1933158dfae..d15d6c5740efe8351f9fecc8d1c70488323b890f 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1571,6 +1571,15 @@ static ivas_error ivas_mc_dec_reconfig_fx( { return error; } +#ifdef NONBE_FIX_1075 + IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + { + IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) + { + return error; + } + } +#endif IF( EQ_16( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { IF( ( error = ivas_rend_initCrendWrapper( &st_ivas->hCrendWrapper, 1 ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 642e9af40d805a4e0129dab6bd00afe0980360b4..08da97c579c9c82258ee831cf3e36d1df0956187 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -692,135 +692,142 @@ ivas_error ivas_omasa_dec_config_fx( IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { /* Allocate TD renderer for the objects in DISC mode */ - IF( st_ivas->hBinRendererTd == NULL ) - { - IF( NE_32( ( error = ivas_td_binaural_open_fx( st_ivas, SrcInd, num_src ) ), IVAS_ERR_OK ) ) - { + IF( st_ivas->hBinRendererTd == NULL ){ + IF( NE_32( ( error = ivas_td_binaural_open_fx( st_ivas, SrcInd, num_src ) ), IVAS_ERR_OK ) ){ return error; - } - } - - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) - { - return error; - } - } - ELSE - { - /* TD renderer handle */ - test(); - IF( st_ivas->hBinRendererTd != NULL && EQ_16( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM, TRUE ) ) - { - ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); - - st_ivas->hHrtfTD = NULL; - } - - /* ISM renderer handle + ISM data handle */ - ivas_omasa_separate_object_renderer_close( st_ivas ); - } - } - - IF( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) ) - { - IF( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_RECONFIGURE ) ), IVAS_ERR_OK ) ) - { - return error; } - - test(); - test(); - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) +#ifdef NONBE_FIX_1075 + IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) { return error; } } - ELSE - { - /* ISM renderer handle + ISM data handle */ - ivas_omasa_separate_object_renderer_close( st_ivas ); - } +#endif } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT - IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ) + + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) { - /* Allocate 'hIsmRendererData' handle */ - error = ivas_omasa_combine_separate_ism_with_masa_open_fx( st_ivas ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } + return error; } - - IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) + } + ELSE + { + /* TD renderer handle */ + test(); + IF( st_ivas->hBinRendererTd != NULL && EQ_16( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM, TRUE ) ) { - DIRAC_CONFIG_FLAG common_rend_config_flag; - IF( st_ivas->hSpatParamRendCom == NULL ) - { - common_rend_config_flag = DIRAC_OPEN; - } - ELSE - { - common_rend_config_flag = DIRAC_RECONFIGURE; - } - move32(); - - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - error = ivas_omasa_render_objects_from_mix_open_fx( st_ivas ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } + ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); - error = ivas_spat_hSpatParamRendCom_config_fx( &st_ivas->hSpatParamRendCom, - common_rend_config_flag, 0, - st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs, 0, 0 ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } + st_ivas->hHrtfTD = NULL; } -#endif - /*-----------------------------------------------------------------* - * TD Decorrelator - *-----------------------------------------------------------------*/ - IF( st_ivas->hDiracDecBin[0] != NULL ) - { - IF( NE_32( ( 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; - } - } + /* ISM renderer handle + ISM data handle */ + ivas_omasa_separate_object_renderer_close( st_ivas ); + } +} - /*-----------------------------------------------------------------* - * CLDFB instances - *-----------------------------------------------------------------*/ +IF( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) ) +{ + IF( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_RECONFIGURE ) ), IVAS_ERR_OK ) ) + { + return error; + } - IF( NE_32( ( error = ivas_cldfb_dec_reconfig_fx( st_ivas, 2, numCldfbAnalyses_old, numCldfbSyntheses_old ) ), IVAS_ERR_OK ) ) + test(); + test(); + IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) + { + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) { return error; } + } + ELSE + { + /* ISM renderer handle + ISM data handle */ + ivas_omasa_separate_object_renderer_close( st_ivas ); + } +} +#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT +IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ) +{ + /* Allocate 'hIsmRendererData' handle */ + error = ivas_omasa_combine_separate_ism_with_masa_open_fx( st_ivas ); + move32(); + IF( NE_32( error, IVAS_ERR_OK ) ) + { + return error; + } +} - /*-----------------------------------------------------------------* - * floating-point output audio buffers - *-----------------------------------------------------------------*/ +IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) +{ + DIRAC_CONFIG_FLAG common_rend_config_flag; + IF( st_ivas->hSpatParamRendCom == NULL ) + { + common_rend_config_flag = DIRAC_OPEN; + } + ELSE + { + common_rend_config_flag = DIRAC_RECONFIGURE; + } + move32(); - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) - { - return error; - } + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + error = ivas_omasa_render_objects_from_mix_open_fx( st_ivas ); + move32(); + IF( NE_32( error, IVAS_ERR_OK ) ) + { + return error; } - return IVAS_ERR_OK; + error = ivas_spat_hSpatParamRendCom_config_fx( &st_ivas->hSpatParamRendCom, + common_rend_config_flag, 0, + st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs, 0, 0 ); + move32(); + IF( NE_32( error, IVAS_ERR_OK ) ) + { + return error; + } +} +#endif +/*-----------------------------------------------------------------* + * TD Decorrelator + *-----------------------------------------------------------------*/ + +IF( st_ivas->hDiracDecBin[0] != NULL ) +{ + IF( NE_32( ( 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; + } +} + +/*-----------------------------------------------------------------* + * CLDFB instances + *-----------------------------------------------------------------*/ + +IF( NE_32( ( error = ivas_cldfb_dec_reconfig_fx( st_ivas, 2, numCldfbAnalyses_old, numCldfbSyntheses_old ) ), IVAS_ERR_OK ) ) +{ + return error; +} + +/*-----------------------------------------------------------------* + * floating-point output audio buffers + *-----------------------------------------------------------------*/ + +nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); +IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) +{ + return error; +} +} + +return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index 1e58959d58beaa0bd0ecdf71ee104b67622f79f1..744c9c14e3b721f1544eec74d3117d91d2f60cef 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -564,6 +564,15 @@ ivas_error ivas_sba_dec_reconfigure_fx( { return error; } +#ifdef NONBE_FIX_1075 + IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + { + IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) + { + return error; + } + } +#endif } }