diff options
author | sdeng <sdeng@google.com> | 2019-05-31 15:11:53 -0700 |
---|---|---|
committer | sdeng <sdeng@google.com> | 2019-06-01 15:12:39 -0700 |
commit | 6cf62dcf8a560e6a5c1025c9b7bcd7ca2f923d56 (patch) | |
tree | 4c2143df1fd7a0c9743d34f325ab44dca7b610e0 /vp9/encoder/vp9_rd.c | |
parent | 5cfaf561d9928261f3ff49d744239cc0dcf877b9 (diff) | |
download | libvpx-6cf62dcf8a560e6a5c1025c9b7bcd7ca2f923d56.tar libvpx-6cf62dcf8a560e6a5c1025c9b7bcd7ca2f923d56.tar.gz libvpx-6cf62dcf8a560e6a5c1025c9b7bcd7ca2f923d56.tar.bz2 libvpx-6cf62dcf8a560e6a5c1025c9b7bcd7ca2f923d56.zip |
Update rdcost using the rd_mult in current block
This CL is a preparation for implementing hierarchical SSIM rdmult scaling.
There is very little impact on metrics and speed:
avg_psnr ovr_psnr ssim
midres 0.009 0.009 0.015
perf stat -e instructions:u ./vpxenc park_joy_480p.y4m --limit=50
with this cl: 317,722,808,461
before: 317,700,108,619
Change-Id: I7b1d1482ac69f7bc87065a93223a0274bcbe8ce3
Diffstat (limited to 'vp9/encoder/vp9_rd.c')
-rw-r--r-- | vp9/encoder/vp9_rd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_rd.c b/vp9/encoder/vp9_rd.c index 3e38799fd..2a02c10e8 100644 --- a/vp9/encoder/vp9_rd.c +++ b/vp9/encoder/vp9_rd.c @@ -69,6 +69,14 @@ int64_t vp9_calculate_rd_cost(int mult, int div, int rate, int64_t dist) { } return -RDCOST(mult, div, -rate, -dist); } +void vp9_rd_cost_update(int mult, int div, RD_COST *rd_cost) { + if (rd_cost->rate < INT_MAX && rd_cost->dist < INT64_MAX) { + rd_cost->rdcost = + vp9_calculate_rd_cost(mult, div, rd_cost->rate, rd_cost->dist); + } else { + vp9_rd_cost_reset(rd_cost); + } +} // The baseline rd thresholds for breaking out of the rd loop for // certain modes are assumed to be based on 8x8 blocks. |