From f47e40b53fe61ee2690cba68b430f3f8604a528c Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 21 Aug 2025 10:14:24 +0200 Subject: [PATCH] port MR --- lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 14 ++++++++++++++ lib_dec/ivas_masa_dec.c | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0283dc7b2..0ddc31495 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -213,6 +213,7 @@ #define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ #define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ #define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ +#define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 944263844..02e763001 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -601,8 +601,12 @@ ivas_error ivas_dec_setup( { st_ivas->nchan_transport = 1; } + #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* this should be non-zero if original input format was MASA_ISM_FORMAT */ +#ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH + st_ivas->ism_mode = ISM_MODE_NONE; +#endif st_ivas->nchan_ism = st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 3] + 2 * st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 2]; if ( st_ivas->nchan_ism > 0 ) @@ -621,6 +625,7 @@ ivas_error ivas_dec_setup( { st_ivas->nchan_ism = 1; } + /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 and the corresponding bit is not used here*/ #else /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ @@ -635,6 +640,7 @@ ivas_error ivas_dec_setup( element_mode_flag = 1; } #endif + if ( st_ivas->ini_frame > 0 ) { /* reconfigure in case a change of operation mode is detected */ @@ -873,6 +879,14 @@ ivas_error ivas_dec_setup( } } +#ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH + if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == MASA_FORMAT ) + { + st_ivas->nchan_ism = 0; + st_ivas->ism_mode = ISM_MODE_NONE; + } + +#endif if ( st_ivas->ivas_format == ISM_FORMAT ) { ISM_MODE last_ism_mode = st_ivas->ism_mode; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 408318a34..7778551b5 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1517,6 +1517,7 @@ ivas_error ivas_masa_dec_reconfigure( ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); +#ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH if ( st_ivas->ivas_format == MASA_FORMAT ) { @@ -1532,7 +1533,7 @@ ivas_error ivas_masa_dec_reconfigure( #endif st_ivas->ism_mode = ISM_MODE_NONE; } - +#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_transport; -- GitLab