[trunk] Speed-up opj_int_fix_mul by removing unneeded operation
authorMatthieu Darbois <mayeut@users.noreply.github.com>
Sat, 13 Dec 2014 10:27:21 +0000 (10:27 +0000)
committerMatthieu Darbois <mayeut@users.noreply.github.com>
Sat, 13 Dec 2014 10:27:21 +0000 (10:27 +0000)
Update  issue 220

src/lib/openjp2/opj_intmath.h

index dc89895301f8a63e585d3504fdb681c25e2b9074..f35e40ab007dfe03ad05a0a3e938a4506f640332 100644 (file)
@@ -166,7 +166,7 @@ Multiply two fixed-precision rational numbers.
 */
 static INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b) {
     OPJ_INT64 temp = (OPJ_INT64) a * (OPJ_INT64) b ;
-    temp += temp & 4096;
+    temp += 4096;
     return (OPJ_INT32) (temp >> 13) ;
 }