Update the README.cmake file : an instruction was missing to run the tests correctly.
[openjpeg.git] / libopenjpeg / fix.h
index 6ae112c9d39b9e9c20b6e9f909d295f74f9804b3..bcb2acb54c8ff9946df869bb872341297d43e2a6 100644 (file)
@@ -54,8 +54,9 @@ Multiply two fixed-precision rational numbers.
 @return Returns a * b
 */
 static INLINE int fix_mul(int a, int b) {
-    int64 temp = (int64) a * (int64) b >> 12;
-    return (int) ((temp >> 1) + (temp & 1)) ;
+    int64 temp = (int64) a * (int64) b ;
+    temp += temp & 4096;
+    return (int) (temp >> 13) ;
 }
 
 /*@}*/