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

Merge branch '3gpp_issue_922_fix' into 'main'

Fix for 3GPP issue 922: Decoder crash for MC51 at 128/256/384/512kbps FER in LFE PLC

See merge request !660
parents 64cf9aaf c9c5e519
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -829,7 +829,9 @@ static void d_syn_filt_fx(
{
    Word16 i, j;
    Word32 buf_fx[LFE_PLC_LPCORD + LFE_PLC_RECLEN]; /* temporary synthesis buffer */
    Word32 s_fx, *yy_fx, temp;
    Word32 *yy_fx, temp;
    Word64 s_fx;
    Word16 tmp;
    Word16 yy_q_fx[LFE_PLC_LPCORD + LFE_PLC_RECLEN], exp1, exp2, s_q_fx, temp_q;

    yy_fx = &buf_fx[0];
@@ -852,7 +854,7 @@ static void d_syn_filt_fx(
    FOR( i = 0; i < l; i++ )
    {
        s_fx = x_fx[i];
        move32();
        move64();
        s_q_fx = Q31;
        move16();
        FOR( j = 1; j <= m; j++ )
@@ -874,20 +876,23 @@ static void d_syn_filt_fx(

            IF( LT_16( s_q_fx, temp_q ) )
            {
                s_fx = L_sub( s_fx, L_shr( temp, sub( temp_q, s_q_fx ) ) );
                s_fx = W_sub( s_fx, L_shr( temp, sub( temp_q, s_q_fx ) ) );
            }
            ELSE
            {
                s_fx = L_sub( L_shr( s_fx, sub( s_q_fx, temp_q ) ), temp );
                s_fx = W_sub( W_shr( s_fx, sub( s_q_fx, temp_q ) ), temp );
                s_q_fx = temp_q;
                move16();
            }
        }
        yy_fx[i] = s_fx;
        tmp = W_norm( s_fx );
        s_fx = W_shl( s_fx, tmp );
        s_q_fx = add( s_q_fx, tmp );
        yy_fx[i] = W_extract_h( s_fx );
        move32();
        yy_q_fx[i] = s_q_fx;
        yy_q_fx[i] = sub( s_q_fx, 32 );
        move16();
        y_fx[i] = L_shr( s_fx, sub( s_q_fx, Q5 ) );
        y_fx[i] = W_extract_l( W_shr( s_fx, sub( s_q_fx, Q5 ) ) );
        move32();
    }
    *y_q_fx = Q5;