diff --git a/lib_com/options.h b/lib_com/options.h index 713943dbc36500c0e3b1b9748c3f0f2a4c3375a5..1004fabf800a48c97fa84ba6064e1a720bb902bc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -146,6 +146,7 @@ #define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */ #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_fx.c b/lib_dec/ivas_init_dec_fx.c index 1440185231b42a769bb1a905662ef804fd0f3bfe..307cd42d9b636970bff4e97f1a41ee9a0c3a6fbe 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -684,8 +684,13 @@ ivas_error ivas_dec_setup( st_ivas->nchan_transport = 1; move16(); } + #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; + move16(); +#endif st_ivas->nchan_ism = add( st_ivas->bit_stream[L_sub( res_dec, 3 )], shl( st_ivas->bit_stream[L_sub( res_dec, 2 )], 1 ) ); IF( GT_16( st_ivas->nchan_ism, 0 ) ) @@ -1018,6 +1023,17 @@ ivas_error ivas_dec_setup( } } +#ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH + test(); + IF( GT_16( st_ivas->ini_frame, 0 ) && EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) + { + st_ivas->nchan_ism = 0; + move16(); + st_ivas->ism_mode = ISM_MODE_NONE; + move16(); + } + +#endif IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { ISM_MODE last_ism_mode = st_ivas->ism_mode; diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 0f22a8b29a1ab8194cb37d050850ab36b946cf46..bbc85ee53c161de84e87c5de213669c000538194 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -191,6 +191,7 @@ ivas_error ivas_masa_decode_fx( /* re-read the number of objects, needed in case of bad frame */ st_ivas->nchan_ism = sub( 5, add( st_ivas->bit_stream[bits_per_frame - 3], shl( st_ivas->bit_stream[bits_per_frame - 2], 1 ) ) ); } + test(); IF( EQ_32( ivas_format, MASA_FORMAT ) && NE_16( st_ivas->nchan_ism, 5 ) ) { @@ -1983,6 +1984,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( ivas_masa_set_elements_fx( 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( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT @@ -2000,7 +2002,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( st_ivas->ism_mode = ISM_MODE_NONE; move16(); } - +#endif { Word16 tc_nchan_to_allocate; Word16 tc_nchan_transport;