shithub: libvpx

Download patch

ref: 06fab8cf67f63d6df013dd105a6cf3b8067e01f9
parent: db55f19bca0e71bfcd1da59ae0ca7b62fed284ce
parent: 7bc2edfade3587673d695b63ca5d985a54eec1aa
author: Yaowu Xu <yaowu@google.com>
date: Tue Nov 20 20:33:50 EST 2018

Merge "Replace int64_t with int for rdmult"

--- 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);
 }