Replace int64_t with int for rdmult
authorYaowu Xu <yaowu@google.com>
Tue, 20 Nov 2018 01:19:18 +0000 (17:19 -0800)
committerYaowu Xu <yaowu@google.com>
Tue, 20 Nov 2018 17:40:50 +0000 (09:40 -0800)
No need for the upgrade to int64_t

Change-Id: I8331839c00718a0a987257772357be72b40e19be

vp9/encoder/vp9_rd.c

index be75c65..8323f3a 100644 (file)
@@ -201,7 +201,8 @@ int vp9_compute_rd_mult_based_on_qindex(const VP9_COMP *cpi, int qindex) {
   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 @@ static int modulate_rdmult(const VP9_COMP *cpi, int64_t rdmult) {
                               : 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);
 }