Commit 07f578b1 authored by vaillancour's avatar vaillancour
Browse files

proposed fix for 725, saturation vlpc_2st_dec

parent fe75cdf5
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@
/* ##################### End NON-BE switches ########################### */
#define FIX_740_HQ_CORE_OVA // Proposed fix to solve overlap and add issue for HQ_CORE
#define FIX_746  // proposed fix to solve low bit-rate frame boundaries issues 
#define FIX_SATURATION_725  // Propose fix for saturation in AVQ

/* ################## End DEVELOPMENT switches ######################### */

+13 −1
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@
#include "options.h"
#include "prot_fx1.h"
#include "prot_fx2.h"
//#ifdef DEBUGGING  to be removed
#include <assert.h>
//#endif

void vlpc_2st_dec(
    Word16 *lsfq,       /* i/o: i:1st stage   o:1st+2nd stage   */
@@ -32,7 +35,16 @@ void vlpc_2st_dec(

    FOR (i=0; i<M; i++)
    {
        lsfq[i] = add(lsfq[i], shl(mult_r(w[i], shl(xq[i],10)),2));                         /*14Q1*1.28*/ 	move16();
#ifdef FIX_SATURATION_725
        //#ifdef DEBUGGING  to be removed
        assert( abs_s( xq[i] ) <= 32 );                                           /* If xq > 32 for IVAS, we might need a different loop implementation */
                                                                                  //#endif
        lsfq[i] = add( lsfq[i], shl( mult_r( w[i], shl_sat( xq[i], 10 ) ), 2 ) ); /*14Q1*1.28*/
        move16();
#else
        lsfq[i] = add( lsfq[i], shl( mult_r( w[i], shl( xq[i], 10 ) ), 2 ) ); /*14Q1*1.28*/
        move16();
#endif
    }

    /* reorder */