Commit 71d2f480 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '953-wrong-value-of-energy-ratio-in-masa-ext-mode' into 'main'

[nonBE] Fixes energy ratio value in MASA EXT

Closes #953

See merge request !704
parents c431eb3f 3873dec2
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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 */
+7 −0
Original line number Diff line number Diff line
@@ -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