diff --git a/lib_com/options.h b/lib_com/options.h index 9bdfec8eed7b1ea500cf8a1848fecf391006e3b9..02242424154b9a8c65e3b9ce734d67e873276ff1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -188,6 +188,7 @@ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ #define NONBE_FIX_1208_DFT_STEREO_PLC_BURST /* Ericsson: Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */ #define FIX_1206_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */ +#define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index a7262093c0177c0755751553061da72b9bb2927c..fa737acfaa388efe3780fb04f083e8ef7d7eeda8 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -572,6 +572,9 @@ ivas_error ivas_dec_setup( } /* 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 ) @@ -589,6 +592,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*/ st_ivas->nchan_transport = 2; element_mode_flag = 1; @@ -832,6 +836,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 49ee7753f31733f486489d1b987cf0f86fe8ebec..26732a868b7407b0e07e2dac35ebafb2bd664a38 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -151,7 +151,7 @@ ivas_error ivas_masa_decode( { if ( !( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { -#ifdef FIX_HRTF_LOAD +#if ( defined FIX_HRTF_LOAD || defined NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH ) if ( ivas_format == MASA_FORMAT ) { /* re-read the number of objects, needed in case of bad frame */ @@ -1490,6 +1490,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 ) { if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) @@ -1501,6 +1502,7 @@ ivas_error ivas_masa_dec_reconfigure( st_ivas->ism_mode = ISM_MODE_NONE; } +#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_transport; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 5611f70fba6c62b04d45ea532e1594f3f84d20ac..c28ceb430d31e9405224a2dd9e99ec34f7cd5983 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1146,11 +1146,13 @@ ivas_error IVAS_DEC_ReadFormat( // st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200 +#ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH if ( st_ivas->ivas_format == MASA_FORMAT ) { st_ivas->nchan_ism = 0; // ToDo: temporary hack to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1199 } +#endif if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &st_ivas->hIntSetup, mc_mode_old, ism_mode_old, &hIvasDec->nSamplesFlushed, pcm_type_API_to_internal( hIvasDec->pcmType ), hIvasDec->flushbuffer ) ) != IVAS_ERR_OK )