Commit 9e19b6f6 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_986_fix_1' into 'main'

Fix for 3GPP issue 986: Stereo decoding, 16-20 kHz difference [allow regression]

See merge request !1795
parents da010366 b3c03a1f
Loading
Loading
Loading
Loading
Loading
+28 −3
Original line number Diff line number Diff line
@@ -6982,6 +6982,7 @@ void synthesise_fb_high_band_fx(
        elliptic_bpf_48k_generic_fx( excitation_in_interp3, &exp_tmp, tmp, bpf_memory, bpf_memory_Q, full_band_bpf_1_fx );
#endif
    }
    /* temp1 = sum2_f( tmp, L_FRAME48k ) + 0.001f */
    temp1 = sum2_fx_mod( tmp, L_FRAME48k );

    L_tmp = L_max( 1, fb_exc_energy ); /*Q(2*Q_fb_exc + 1)*/
@@ -6990,9 +6991,33 @@ void synthesise_fb_high_band_fx(
    tmp1 = sub( add( Q_fb_exc, Q_fb_exc ), 8 ); /* 1-9*/
    exp = sub( sub( 31, tmp1 ), exp );

    IF( element_mode != EVS_MONO )
    {
        Word16 sft, t_Q;
        Word64 P_ONE = 33; /* 0.001f in Q15 */
        move64();
        Word64 W_temp;

        t_Q = sub( shl( exp_tmp, 1 ), 8 );
        P_ONE = W_shl( P_ONE, sub( t_Q, 15 ) );

        W_temp = W_add( P_ONE, temp1 );

        sft = W_norm( W_temp );
        W_temp = W_shl( W_temp, sft );

        temp1 = W_extract_h( W_temp );
        t_Q = sub( add( t_Q, sft ), 32 );

        tmp2 = extract_h( temp1 );
        exp2 = sub( 31, t_Q );
    }
    ELSE
    {
        exp2 = norm_l( temp1 );
        tmp2 = extract_h( L_shl( temp1, exp2 ) );
        exp2 = sub( sub( 31, sub( shl( exp_tmp, 1 ), 8 ) ), exp2 ); /* in Q15 (temp1 in Q9)*/
    }

    exp = sub( exp2, exp ); /* Denormalize and substract */
    IF( GT_16( tmp2, tmp3 ) )