Commit 667c9df1 authored by Gregory Pallone's avatar Gregory Pallone
Browse files

fix: saturation on L_add

parent 08a5c7f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1963,6 +1963,7 @@ typedef enum
#define ONE_BY_THREE_Q15                        10923    /* 1/3.f in Q15  */
#define ONE_BY_TEN_Q15                          3277     /* 1/10.f in Q15 */
#define THREE_Q21                               6291456
#define _MINUS_ONE_IN_Q31                       0x80000000

#endif
/* clang-format on */
+3 −2
Original line number Diff line number Diff line
@@ -2660,7 +2660,7 @@ static ivas_error updateMcPanGainsForMcOut(
                inputMc->panGains_fx[0][0] = ONE_IN_Q31;
                inputMc->panGains_fx[0][1] = 0;
            }
            ELSE IF( EQ_32( L_add( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ), 0 ) )
            ELSE IF( EQ_32( inputMc->nonDiegeticPanGain_fx, _MINUS_ONE_IN_Q31 ) )
            {
                inputMc->panGains_fx[0][0] = 0;
                inputMc->panGains_fx[0][1] = ONE_IN_Q31;
@@ -7013,7 +7013,8 @@ static ivas_error renderIsmToMc(
                currentPanGains_fx[0] = ONE_IN_Q31;
                currentPanGains_fx[1] = 0;
            }
            ELSE IF( EQ_32( L_add( ismInput->nonDiegeticPanGain_fx, ONE_IN_Q31 ), 0 ) )
            ELSE IF( EQ_32( ismInput->nonDiegeticPanGain_fx, _MINUS_ONE_IN_Q31 ) )

            {
                currentPanGains_fx[0] = 0;
                currentPanGains_fx[1] = ONE_IN_Q31;