Commit ca7ee9f7 authored by Manuel Jander's avatar Manuel Jander
Browse files

Add switch NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT allowing Q below 0/-1 for...

Add switch NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT allowing Q below 0/-1 for shb_speech buffers to avoid saturation. Remove Q_max[5] limit for Q_new in ivas_pre_proc. Change many scaling function to non saturating versions.
parent 6318d90e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1364,7 +1364,12 @@ void stereo_tcx_init_dec_fx(

void stereo_icBWE_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                */
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    const Word16 shb_speech_ref_fx16[],                         /* i  : SHB speech ref channel             shb_speech_ref_q*/
    const Word16 shb_speech_ref_q,                              /* i  : SHB speech ref channel Q             */
#else
    const Word16 shb_speech_ref_fx16[],                         /* i  : SHB speech ref channel             Q0*/
#endif
    Word16 shb_speech_nonref_fx_16[],                           /* i/o: SHB speech non-ref channel         shb_speech_nonref_e*/
    Word16 shb_speech_nonref_e,                                 /* i/o: SHB speech non-ref channel           */
    const Word16 *voice_factors_fx                              /* i  : voicing factors                  Q15 */
+3 −2
Original line number Diff line number Diff line
@@ -83,8 +83,9 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_FIX_ISSUE_2206
#define NONBE_FIX_ISSUE_2206_TV1
#define NONBE_FIX_ISSUE_2206                            /* FhG: Calculate st->q_inp and Q_new dynamically for all data paths instead of assuming constant values */
#define NONBE_FIX_ISSUE_2206_TV1                        /* VA/FhG: Calculate st->q_inp also considering st->mem_q decimation memory to avoid saturation */
#define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT             /* FhG: Dynamic scale of shb_speech buffers */
#define HARM_HQ_CORE_KEEP_BE                            /* hack to keep all BE after HQ core functions harmonization; pending resolving issues #2450, #2451, #2452 */
#define HQ_ALIGN_DUPLICATED_CODE                        /* Eri: Align duplicated code */
#define FIX_2467_RENAME_GSC_FUNCTION                    /* VA: basop issue 2467: Removal of unused function/table and renaming of _ivas_fx versions to default ones. */
+9 −0
Original line number Diff line number Diff line
@@ -9005,6 +9005,15 @@ void Copy_Scale_sig_32_16(
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
);

#ifdef NONBE_FIX_ISSUE_2206
void Copy_Scale_sig_32_16_nosat(
    const Word32 x[], /* i  : signal to scale input           Qx        */
    Word16 y[],       /* o  : scaled signal output            Qx        */
    const Word16 lg,  /* i  : size of x[]                     Q0        */
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
);
#endif

void Random_Fill(
    Word16 *seed,  /* i/o: random seed         */
    Word16 n,      /* i  : number of values    */
+4 −0
Original line number Diff line number Diff line
@@ -5295,7 +5295,11 @@ static void Estimate_mix_factors_fx(

    pow3 = Dot_product( shb_res_local, shb_res_local, L_FRAME16k ); /* (2*Q_shb+1) */

#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    pow3 = L_add_sat( pow3, L_shl( 21475l /*0.00001f in Q31*/, 2 * Q_shb + 1 - 31 ) ); /* (2*Q_shb+1) */
#else
    pow3 = L_add( pow3, L_shl( 21475l /*0.00001f in Q31*/, 2 * Q_shb + 1 - 31 ) ); /* (2*Q_shb+1) */
#endif
    if ( pow3 == 0 )
    {
        pow3 = 1;
+35 −0
Original line number Diff line number Diff line
@@ -1266,6 +1266,7 @@ void Copy_Scale_sig_nosat(
    Word16 i;
    Word16 tmp;

    assert( exp0 <= 15 && exp0 >= -15 );
    IF( exp0 == 0 )
    {
        FOR( i = 0; i < lg; i++ )
@@ -1452,6 +1453,40 @@ void Copy_Scale_sig_32_16(
    return;
}

#ifdef NONBE_FIX_ISSUE_2206
void Copy_Scale_sig_32_16_nosat(
    const Word32 x[], /* i  : signal to scale input           Qx        */
    Word16 y[],       /* o  : scaled signal output            Qx        */
    const Word16 lg,  /* i  : size of x[]                     Q0        */
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
)
{
    Word16 i;
    Word16 tmp;

    assert( exp0 <= 31 && exp0 >= -31 );
    tmp = add( 16, exp0 );
    IF( tmp != 0 )
    {
        FOR( i = 0; i < lg; i++ )
        {
            y[i] = round_fx_sat( L_shl_sat( x[i], tmp ) );
            move16();
        }
    }
    ELSE
    {
        FOR( i = 0; i < lg; i++ )
        {
            y[i] = round_fx_sat( x[i] );
            move16();
        }
    }

    return;
}

#endif

/*-------------------------------------------------------------------*
 * Scale_sig32
Loading