diff --git a/lib_com/options.h b/lib_com/options.h index 819f2a42f0cad20d36fff06df04d7abdda08c2de..f1023d3b6c7400fafb909ad5dd88186b8fea789f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -193,6 +193,8 @@ #define FIX_930_JBM_BUFSIZE_MULT /* FhG: Fix 930, Word16 too small for apa_buffer_size */ #define NONBE_FIX_943_PORT_1208_DFT_STEREO_PLC_BURST /* Ericsson: BASOP Issue 943, Float Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */ #define FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; needs corresponding fix in floating point */ +#define FIX_953_WRONG_ENERGY_RATIO_MASA_EXT /* Nok: Fix 953 wrong energy ratio value after shift and cast to Word8 */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 13e970f85fcc6e5ab670952c19be8a14b9b72195..f3962ced2a3efcbfbfdca4f241eceaca993276e5 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -4438,6 +4438,13 @@ static void create_masa_ext_out_meta_fx( move16(); FOR( dir = 0; dir < numDirections; dir++ ) { +#ifdef FIX_953_WRONG_ENERGY_RATIO_MASA_EXT + /* todo: not optimal, but less invasive */ + IF( EQ_32( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], ONE_IN_Q30 ) ) + { + hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf]--; + } +#endif UWord8 tmp = (UWord8) L_shr( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], Q30 - 8 ); // Q8 move16(); extOutMeta->diffuseToTotalRatio[sf][b_new] = (UWord8) sub( extOutMeta->diffuseToTotalRatio[sf][b_new], tmp ); // Q8