From 6cf62dcf8a560e6a5c1025c9b7bcd7ca2f923d56 Mon Sep 17 00:00:00 2001 From: sdeng Date: Fri, 31 May 2019 15:11:53 -0700 Subject: 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 --- vp9/encoder/vp9_rd.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vp9/encoder/vp9_rd.c') 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. -- cgit v1.2.3