]> granicus.if.org Git - libvpx/commitdiff
firstpass.c: correct casting around gf_group_bits
authorJames Zern <jzern@google.com>
Thu, 28 Feb 2013 23:45:29 +0000 (15:45 -0800)
committerJames Zern <jzern@google.com>
Thu, 28 Feb 2013 23:45:29 +0000 (15:45 -0800)
gf_group_bits is int64_t remove casts to int.

Change-Id: I3b4225905041fac9af9fdfcbcb6f1c357ea4b593

vp8/encoder/firstpass.c
vp9/encoder/vp9_firstpass.c

index 0ecaf4c49695853b8b1f433c10bc16b223ee5aa0..433726df604c9732252a6477eb2f4b1b23289fed 100644 (file)
@@ -2118,17 +2118,17 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
         (cpi->twopass.kf_group_error_left > 0))
     {
         cpi->twopass.gf_group_bits =
-            (int)((double)cpi->twopass.kf_group_bits *
-                  (gf_group_err / (double)cpi->twopass.kf_group_error_left));
+            (int64_t)(cpi->twopass.kf_group_bits *
+                      (gf_group_err / cpi->twopass.kf_group_error_left));
     }
     else
         cpi->twopass.gf_group_bits = 0;
 
-    cpi->twopass.gf_group_bits = (int)(
+    cpi->twopass.gf_group_bits =
         (cpi->twopass.gf_group_bits < 0)
             ? 0
             : (cpi->twopass.gf_group_bits > cpi->twopass.kf_group_bits)
-                ? cpi->twopass.kf_group_bits : cpi->twopass.gf_group_bits);
+                ? cpi->twopass.kf_group_bits : cpi->twopass.gf_group_bits;
 
     /* Clip cpi->twopass.gf_group_bits based on user supplied data rate
      * variability limit (cpi->oxcf.two_pass_vbrmax_section)
@@ -2450,7 +2450,7 @@ void vp8_second_pass(VP8_COMP *cpi)
          */
         if (cpi->oxcf.error_resilient_mode)
         {
-            cpi->twopass.gf_group_bits = (int)cpi->twopass.kf_group_bits;
+            cpi->twopass.gf_group_bits = cpi->twopass.kf_group_bits;
             cpi->twopass.gf_group_error_left =
                                   (int)cpi->twopass.kf_group_error_left;
             cpi->baseline_gf_interval = cpi->twopass.frames_to_key;
index e8525d471a85a897906ad7fd9b56691dc4df3a28..8df6c20a75f726f7ff47fa737fd128e9fc997f21 100644 (file)
@@ -1695,8 +1695,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
   if ((cpi->twopass.kf_group_bits > 0) &&
       (cpi->twopass.kf_group_error_left > 0)) {
     cpi->twopass.gf_group_bits =
-      (int)((double)cpi->twopass.kf_group_bits *
-            (gf_group_err / cpi->twopass.kf_group_error_left));
+      (int64_t)(cpi->twopass.kf_group_bits *
+                (gf_group_err / cpi->twopass.kf_group_error_left));
   } else
     cpi->twopass.gf_group_bits = 0;