Commit a039cce3 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '982-masa-energy-ratio-decoding-differences' into 'main'

[NONBE] Correction of MASA energy ratios at 384kpbs

Closes #982

See merge request !725
parents 701a512d f7d3da91
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@
#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 */

#define FIX_982_WRONG_DECODED_ENERGY_RATIO      /* Nokia: Fix 982 wrong energy in EXT mode and in second direction when present */
/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+6 −0
Original line number Diff line number Diff line
@@ -4377,6 +4377,12 @@ static void create_masa_ext_out_meta_fx(
            {
                FOR( b_new = bandMap[b_old]; b_new < bandMap[b_old + 1]; b_new++ )
                {
#ifdef FIX_982_WRONG_DECODED_ENERGY_RATIO
                    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->directToTotalRatio[dir][sf][b_new] = tmp; // Q8
+11 −0
Original line number Diff line number Diff line
@@ -1725,6 +1725,16 @@ Word16 ivas_qmetadata_dec_decode_hr_384_512(
    IF( EQ_32( hQMetaData->no_directions, 2 ) )
    {
#ifdef MSAN_FIX
#ifdef FIX_982_WRONG_DECODED_ENERGY_RATIO
        FOR( b = 0; b < hQMetaData->q_direction[0].cfg.nbands; b++ )
        {
            FOR( m = 0; m < hQMetaData->q_direction[0].cfg.nblocks; m++ )
            {
                hQMetaData->q_direction[1].band_data[b].energy_ratio_fx[m] = W_round64_L( W_nrg_ratio[1][b][m] ); /*Q30*/
                move32();
            }
        }
#else
        FOR( b = 0; b < hQMetaData->q_direction[1].cfg.nbands; b++ )
        {
            FOR( m = 0; m < hQMetaData->q_direction[1].cfg.nblocks; m++ )
@@ -1733,6 +1743,7 @@ Word16 ivas_qmetadata_dec_decode_hr_384_512(
                move32();
            }
        }
#endif
#else
        FOR( b = 0; b < MASA_MAXIMUM_CODING_SUBBANDS; b++ )
        {