Commit 8ae3df8c authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ltv_crash_fix_10dB_omasa_1' into 'main'

LTV crash fix for 10dB OMASA stream, guard bit update in TonalComponentDetection

See merge request !498
parents 9ed6fea2 b411f301
Loading
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1221,18 +1221,16 @@ enum

#define MASA_TRANSP_BITS                        1
#define NO_BITS_MASA_ISM_NO_OBJ                 2
#ifdef IVAS_FLOAT_FIXED
#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL
#define MASA2TOTAL_THR                          0.9799999f
#else
#define MASA2TOTAL_THR                          0.98f
#endif
#ifdef IVAS_FLOAT_FIXED
#define MASA2TOTAL_THR_Q30                      1052266987 // 0.98f in Q30
//Maximum error in float to fixed conversion : 0.005%
//Assuming the accuracy of 99.995%
//New value = 99.995 / 100 * 0.98 = 0.979951
#else
#define MASA2TOTAL_THR                          0.98f
#endif
#define BITS_MASA2TOTTAL_DCT0                   6
#define STEP_M2T                                0.1f
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@
#define NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING         /* VA: Add fix point bit allocation for special GSC mode such that float and fixed point have the same final bit allocation */
#define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE         /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */
#define NON_BE_FIX_807_MASA_DTX_BRSW                     /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */
#define FIX_BASOP_812_NAN_COHSNR                        /* FhG: BASOP issue 812: fix nan values in sparse frames for cohSNR value in ITD estimation*/

/* #################### End FIXES switches ############################ */

+4 −0
Original line number Diff line number Diff line
@@ -114,6 +114,10 @@ void ivas_DetectTonalComponents_fx(
        move32();
    }

    /* Guard bit */
    lastMDCTSpect_exp = add( lastMDCTSpect_exp, 1 );
    scale_sig32( pScaledMdctSpectrum, nSamples, -1 );

    /* Find peak candidates in the last frame. */
    findCandidates( nSamples, pScaledMdctSpectrum, lastMDCTSpect_exp, thresholdModification, floorPowerSpectrum );

+15 −0
Original line number Diff line number Diff line
@@ -8762,6 +8762,9 @@ void ivas_omasa_decode_masa_to_total(
    float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS],
        dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS];
    int16_t n_streams, len_stream;
#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL
    int32_t int_tmp;
#endif

    /* Setup coding parameters */
    n_streams = 1;
@@ -8816,6 +8819,10 @@ void ivas_omasa_decode_masa_to_total(
        {
            masa_to_total_energy_ratio[i][j] = max( 0.0f, q_dct_data[k] );
            masa_to_total_energy_ratio[i][j] = min( 1.0f, masa_to_total_energy_ratio[i][j] );
#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL
            int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] );
            masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD );
#endif
            k++;
        }
    }
@@ -8827,6 +8834,10 @@ void ivas_omasa_decode_masa_to_total(
            for ( j = 0; j < nbands; j++ )
            {
                masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[0][j];
#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL
                int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] );
                masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD );
#endif
            }
        }
    }
@@ -8838,6 +8849,10 @@ void ivas_omasa_decode_masa_to_total(
            for ( i = 0; i < nblocks; i++ )
            {
                masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[i][0];
#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL
                int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] );
                masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD );
#endif
            }
        }
    }
+12 −1
Original line number Diff line number Diff line
@@ -3395,7 +3395,18 @@ void stereo_dft_enc_compute_itd(
    }

    /*calculate total cohSNR for frame in dB*/
#ifdef FIX_BASOP_812_NAN_COHSNR
    if ( mEr > 1.0f )
    {
#endif
        cohSNR = 20 * log10f( mEr );
#ifdef FIX_BASOP_812_NAN_COHSNR
    }
    else
    {
        cohSNR = 0;
    }
#endif

    /* collect UNCLR classifier parameters */
    {