diff options
author | Yaowu Xu <yaowu@google.com> | 2018-11-21 01:33:50 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-11-21 01:33:50 +0000 |
commit | 06fab8cf67f63d6df013dd105a6cf3b8067e01f9 (patch) | |
tree | 2797f4c77d7cb9aee4a960e2d6f2bf0e86ed823b /vp9/encoder | |
parent | db55f19bca0e71bfcd1da59ae0ca7b62fed284ce (diff) | |
parent | 7bc2edfade3587673d695b63ca5d985a54eec1aa (diff) | |
download | libvpx-06fab8cf67f63d6df013dd105a6cf3b8067e01f9.tar libvpx-06fab8cf67f63d6df013dd105a6cf3b8067e01f9.tar.gz libvpx-06fab8cf67f63d6df013dd105a6cf3b8067e01f9.tar.bz2 libvpx-06fab8cf67f63d6df013dd105a6cf3b8067e01f9.zip |
Merge "Replace int64_t with int for rdmult"
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_rd.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/vp9/encoder/vp9_rd.c b/vp9/encoder/vp9_rd.c index be75c65ea..8323f3af4 100644 --- a/vp9/encoder/vp9_rd.c +++ b/vp9/encoder/vp9_rd.c @@ -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); } |