Commit f810517b authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_SP2A

parent bea6d163
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1531,9 +1531,7 @@ typedef enum _DCTTYPE
#define TOD_NSPEC                           80                      /* number of spectral bins of the tonal detector */
#define TOD_THR_MASS                        0.86f                   /* initial value for the adaptive threshold of the tonal detector */
#define P2A_FACT                            0.9f                    /* long-term averaging factor for peak-to-average ratio */
#ifdef FIX_SP2A
#define THR_P2A_HIGH                        95.0f                   /* higher threshold to detect strongly peaky signals at low bitrates*/
#endif
#define THR_P2A                             80.0f                   /* lower threshold to detect strongly peaky signals at higher bitrates */

/*----------------------------------------------------------------------------------*
+0 −1
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@



#define FIX_SP2A                                        /* VA: Issue 412: Adjust threshold for the S_p2a feature in the tonal detector */

#define FIX_413_SBA_DTX                                 /* Dlb: Fix for issue 413, SBA DTX CNG in 2TC mode*/
#define FIX_417_TD_DECORR_BRATE_SW                      /* VA: Issue 417: fix incorrect use of TD decorrelator in bitrate switching */
+0 −8
Original line number Diff line number Diff line
@@ -1828,9 +1828,7 @@ void ivas_smc_mode_selection(
    float ton;
    int16_t i;
    float S_p2a, S_max, S_ave;
#ifdef FIX_SP2A
    float thr_sp2a;
#endif

    SP_MUS_CLAS_HANDLE hSpMusClas = st->hSpMusClas;

@@ -1861,7 +1859,6 @@ void ivas_smc_mode_selection(
    S_ave = sum_f( st->hSpMusClas->tod_lt_Bin_E, TOD_NSPEC ) / TOD_NSPEC;
    S_p2a = S_max - S_ave;

#ifdef FIX_SP2A
    if ( element_brate <= IVAS_16k4 )
    {
        thr_sp2a = THR_P2A_HIGH;
@@ -1870,14 +1867,9 @@ void ivas_smc_mode_selection(
    {
        thr_sp2a = THR_P2A;
    }
#endif

    /* initial 3-way selection of coding modes (ACELP/GSC/TCX) */
#ifdef FIX_SP2A
    if ( relE > -10.0f && ( S_p2a > thr_sp2a || ton > hSpMusClas->tod_thr_lt ) )
#else
    if ( relE > -10.0f && ( S_p2a > THR_P2A || ton > hSpMusClas->tod_thr_lt ) )
#endif
    {
        /* select TCX to encode extremely peaky signals or strongly tonal signals */
        st->sp_aud_decision1 = 1;