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

Merge branch '856-overflow-with-extract_l' into 'main'

possible fix to 856, wrong usage of extract_l

See merge request !549
parents 8f6f9042 371d686b
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@


#define FIX_854_HILBERT_SCALING                 /* VA: reduce lost of precision due to unnecessary scaling, reduce a lot the 2 kHz tone */
#define FIX_856_EXTRACT_L                       /* VA: Fix undesirable wrap-around */
/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+4 −1
Original line number Diff line number Diff line
@@ -838,8 +838,11 @@ Word16 ivas_calc_tilt_bwe_fx( /* o : Tilt in Q24 */
        L_temp = L_shl( L_temp, sub( exp2, 4 ) ); // Output is expected in Q11
    }
    BASOP_SATURATE_WARNING_ON_EVS

#ifdef FIX_856_EXTRACT_L
    return extract_h( L_shl_sat( L_temp, 16 ) );
#else
    return extract_l( L_temp );
#endif
}
#endif

+4 −0
Original line number Diff line number Diff line
@@ -1584,7 +1584,11 @@ void save_synthesis_hq_fec_fx(
        Copy( st->hTcxDec->synth_history_fx + output_frame, st->hTcxDec->synth_history_fx, add( sub( output_frame, post_hq_delay ), NS2SA_FX2( st->output_Fs, PH_ECU_MEM_NS ) ) );
        FOR( Word16 i = 0; i < output_frame; i++ )
        {
#ifdef FIX_856_EXTRACT_L
            st->hTcxDec->old_synthFB_fx[sub( add( i, output_frame ), post_hq_delay )] = extract_h( L_shl_sat( output_fx[i], 16 ) );
#else
            st->hTcxDec->old_synthFB_fx[sub( add( i, output_frame ), post_hq_delay )] = extract_l( output_fx[i] );
#endif
            move16();
        }

+4 −1
Original line number Diff line number Diff line
@@ -1121,8 +1121,11 @@ void ivas_swb_tbe_dec_fx(

    /* find tilt */
    calc_tilt_bwe_fx_loc( old_syn_12k8_16k_fx, &tilt_swb_fec_32_fx, &tilt_swb_fec_fx_q, L_FRAME );
#ifdef FIX_856_EXTRACT_L
    tilt_swb_fec_fx = round_fx_sat( L_shl_sat( tilt_swb_fec_32_fx, sub( 11 + 16, tilt_swb_fec_fx_q ) ) );
#else
    tilt_swb_fec_fx = extract_l( L_shr( tilt_swb_fec_32_fx, sub( tilt_swb_fec_fx_q, 11 ) ) );

#endif
    test();
    if ( st->bfi && st->clas_dec != UNVOICED_CLAS )
    {