From ef441cb0c892497588628cfd05b203d1a31258ea Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 2 Jun 2025 10:52:22 +0200 Subject: [PATCH] port NONBE_FIX_1075 --- lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 19 +++++++++++++++++++ lib_dec/ivas_mct_dec.c | 9 +++++++++ lib_dec/ivas_omasa_dec.c | 9 +++++++++ lib_dec/ivas_sba_dec.c | 9 +++++++++ 5 files changed, 47 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index eeecc2ef8..7acc9c857 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -210,6 +210,7 @@ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ +#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.c b/lib_dec/ivas_init_dec.c index 741a99c2a..4d3874a2c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2030,6 +2030,15 @@ ivas_error ivas_init_decoder( { return error; } +#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + if ( ( error = ivas_reverb_open( &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 ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) @@ -2075,6 +2084,16 @@ ivas_error ivas_init_decoder( { return error; } +#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + if ( ( error = ivas_reverb_open( &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.c b/lib_dec/ivas_mct_dec.c index 5d1d9fc1e..9ed8e6ee2 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1271,6 +1271,15 @@ static ivas_error ivas_mc_dec_reconfig( { return error; } +#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 924a524dd..4b8a95d4b 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -327,6 +327,15 @@ ivas_error ivas_omasa_dec_config( { return error; } +#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + if ( ( error = ivas_reverb_open( &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' */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index a50dcf348..dc42fcea4 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -502,6 +502,15 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } +#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif } /* Allocate memory for OSBA delay buffer */ -- GitLab