]> granicus.if.org Git - libvpx/commitdiff
get_prob(): rationalize int types
authorJames Zern <jzern@google.com>
Fri, 24 Feb 2017 23:36:52 +0000 (15:36 -0800)
committerJames Zern <jzern@google.com>
Fri, 24 Feb 2017 23:36:52 +0000 (15:36 -0800)
promote the unsigned int calculation to uint64_t rather than int64_t for
type consistency

Change-Id: Ic34dee1dc707d9faf6a3ae250bfe39b60bef3438

vpx_dsp/prob.h

index 5656ddbab4dc82c02eeb26e8a1494c6b3419f978..f1cc0eaa105b0d5288a9f1c88174d5a850aa53d6 100644 (file)
@@ -48,7 +48,7 @@ typedef const vpx_tree_index vpx_tree[];
 static INLINE vpx_prob get_prob(unsigned int num, unsigned int den) {
   assert(den != 0);
   {
-    const int p = (int)(((int64_t)num * 256 + (den >> 1)) / den);
+    const int p = (int)(((uint64_t)num * 256 + (den >> 1)) / den);
     // (p > 255) ? 255 : (p < 1) ? 1 : p;
     const int clipped_prob = p | ((255 - p) >> 23) | (p == 0);
     return (vpx_prob)clipped_prob;