shithub: opus

Download patch

ref: b2e19ecd0cd94539ed31d394aa693b7703972d53
parent: 02dcf6aad863c40e5a8372694055ab8ee0fa23ae
author: Jean-Marc Valin <[email protected]>
date: Tue Oct 9 15:13:04 EDT 2012

copysignf() was C99-only

--- a/src/analysis.c
+++ b/src/analysis.c
@@ -123,15 +123,15 @@
    if(x2<y2){
       float den = (y2 + cB*x2) * (y2 + cC*x2);
       if (den!=0)
-         return -x*y*(y2 + cA*x2) / den + copysignf(cE,y);
+         return -x*y*(y2 + cA*x2) / den + (y<0 ? -cE : cE);
       else
-         return copysignf(cE,y);
+         return (y<0 ? -cE : cE);
    }else{
       float den = (x2 + cB*y2) * (x2 + cC*y2);
       if (den!=0)
-         return  x*y*(x2 + cA*y2) / den + copysignf(cE,y) - copysignf(cE,x*y);
+         return  x*y*(x2 + cA*y2) / den + (y<0 ? -cE : cE) - (x*y<0 ? -cE : cE);
       else
-         return copysignf(cE,y) - copysignf(cE,x*y);
+         return (y<0 ? -cE : cE) - (x*y<0 ? -cE : cE);
    }
 }