shithub: libvpx

Download patch

ref: 7bc2edfade3587673d695b63ca5d985a54eec1aa
parent: 1e58bdb41d886be6246f85913b2cd5ec6aae57bd
author: Yaowu Xu <yaowu@google.com>
date: Mon Nov 19 12:19:18 EST 2018

Replace int64_t with int for rdmult

No need for the upgrade to int64_t

Change-Id: I8331839c00718a0a987257772357be72b40e19be

--- a/vp9/encoder/vp9_rd.c
+++ b/vp9/encoder/vp9_rd.c
@@ -201,7 +201,8 @@
   return rdmult > 0 ? rdmult : 1;
 }
 
-static int modulate_rdmult(const VP9_COMP *cpi, int64_t rdmult) {
+static int modulate_rdmult(const VP9_COMP *cpi, int rdmult) {
+  int64_t rdmult_64 = rdmult;
   if (cpi->oxcf.pass == 2 && (cpi->common.frame_type != KEY_FRAME)) {
     const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
     const FRAME_UPDATE_TYPE frame_type = gf_group->update_type[gf_group->index];
@@ -210,21 +211,21 @@
                               : cpi->rc.gfu_boost;
     const int boost_index = VPXMIN(15, (gfu_boost / 100));
 
-    rdmult = (rdmult * rd_frame_type_factor[frame_type]) >> 7;
-    rdmult += ((rdmult * rd_boost_factor[boost_index]) >> 7);
+    rdmult_64 = (rdmult_64 * rd_frame_type_factor[frame_type]) >> 7;
+    rdmult_64 += ((rdmult_64 * rd_boost_factor[boost_index]) >> 7);
   }
-  return (int)rdmult;
+  return (int)rdmult_64;
 }
 
 int vp9_compute_rd_mult(const VP9_COMP *cpi, int qindex) {
-  int64_t rdmult = vp9_compute_rd_mult_based_on_qindex(cpi, qindex);
+  int rdmult = vp9_compute_rd_mult_based_on_qindex(cpi, qindex);
   return modulate_rdmult(cpi, rdmult);
 }
 
 int vp9_get_adaptive_rdmult(const VP9_COMP *cpi, double beta) {
-  int64_t rdmult =
+  int rdmult =
       vp9_compute_rd_mult_based_on_qindex(cpi, cpi->common.base_qindex);
-  rdmult = (int64_t)((double)rdmult / beta);
+  rdmult = (int)((double)rdmult / beta);
   rdmult = rdmult > 0 ? rdmult : 1;
   return modulate_rdmult(cpi, rdmult);
 }