Commit a11da526 authored by norvell's avatar norvell
Browse files

Merge with main

parents 6e11973d b163bc69
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@
#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS      /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */
#define FIX_1349_TNS_CRASH                              /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */
#define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING           /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms  in PhECU-PLC  */
#define FIX_1179_USAN_PHASEECU                          /* Eri: issue 1179:  better handling of 16 bit wrap around for very long(>200ms) FER-bursts   */

/* #################### End BASOP porting switches ############################ */

+30 −0
Original line number Diff line number Diff line
@@ -2330,7 +2330,11 @@ static void subst_spec_fx(
        move16();
        tmp = add( tmp, sub( Lecu, shr( sub( Lecu, Lprot ), 1 ) ) );
        tmp = sub( tmp, shr( output_frame, 1 ) );
#ifdef FIX_1179_USAN_PHASEECU
        tmp = add_sat( tmp, time_offs );
#else
        tmp = add( tmp, time_offs );
#endif
        tmp = round_fx( L_shl( L_mult0( tmp, Lprot_inv ), 4 ) ); /* 0+22+4-16=10 */

        pPlocsi = plocsi;
@@ -4525,12 +4529,20 @@ static void ivas_hq_phase_ecu_fx(
    {
        test();
        test();
#ifdef FIX_1179_USAN_PHASEECU
        if ( !( prev_bfi != 0 && *last_fec != 0 && element_mode == EVS_MONO ) )
        {
            *time_offs = 0; /* IVAS reset of offset time counter, timeoffset variable later also used to calculate burst length */
            move16();
        }
#else
        // PMT("verify condition compared to float")
        if ( !( prev_bfi != 0 && *last_fec != 0 && element_mode == EVS_MONO ) )
        {
            *time_offs = 0;
            move16();
        }
#endif

        offset = add( sub( sub( shl( output_frame, 1 ), lprot ), *time_offs ), ph_ecu_lookahead );
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
@@ -4546,7 +4558,11 @@ static void ivas_hq_phase_ecu_fx(
        test();
        IF( prev_bfi != 0 && *last_fec != 0 )
        {
#ifdef FIX_1179_USAN_PHASEECU
            *time_offs = add_sat( *time_offs, output_frame ); /* when saturation is reached, this keeps the long term muting on */
#else
            *time_offs = add( *time_offs, output_frame );
#endif
            move16();
        }
    }
@@ -4640,7 +4656,9 @@ static void hq_phase_ecu_fx(
    IF( prev_bfi == 0 || ( prev_bfi != 0 && *last_fec != 0 && ( EQ_16( *time_offs, output_frame ) ) ) )
    {
        test();
#ifndef FIX_1179_USAN_PHASEECU
        // PMT("verify condition compared to float")
#endif
        if ( !( prev_bfi != 0 && *last_fec != 0 ) )
        {
            *time_offs = 0;
@@ -4661,13 +4679,21 @@ static void hq_phase_ecu_fx(
        test();
        IF( prev_bfi != 0 && *last_fec != 0 )
        {
#ifdef FIX_1179_USAN_PHASEECU
            *time_offs = add_sat( *time_offs, output_frame );
#else
            *time_offs = add( *time_offs, output_frame );
#endif
            move16();
        }
    }
    ELSE
    {
#ifdef FIX_1179_USAN_PHASEECU
        *time_offs = add_sat( *time_offs, output_frame );
#else
        *time_offs = add( *time_offs, output_frame );
#endif
        move16();

        offset = sub( shl( output_frame, 1 ), lprot );
@@ -4687,7 +4713,11 @@ static void hq_phase_ecu_fx(
    move16();
    IF( *num_p > 0 )
    {
#ifdef FIX_1179_USAN_PHASEECU
        seed = add_sat( seed, plocs[*num_p - 1] );
#else
        seed = add( seed, plocs[*num_p - 1] );
#endif
    }

    subst_spec_fx( plocs, plocsi, num_p, *time_offs, X, mag_chg, ph_dith, old_is_transient, output_frame, &seed,