]> granicus.if.org Git - libvpx/commitdiff
Use the updated best rd cost for transform block search
authorJingning Han <jingning@google.com>
Tue, 15 May 2018 20:04:49 +0000 (13:04 -0700)
committerJingning Han <jingning@google.com>
Tue, 15 May 2018 21:44:04 +0000 (14:44 -0700)
The compression performance change is +/-0.01% for both speed 0/1.
Locally tested the encoding speed:

ped_1080p 150 frames speed 0
79544 b/f 41.339 dB 503072 ms ->
79566 b/f 41.338 dB 493009 ms.

speed 1
79789 b/f 41.152 dB 104583 ms ->
79770 b/f 41.153 dB 102607 ms

Change-Id: Ief200b613608643e5708cebe979982eb4a84831b

vp9/encoder/vp9_rdopt.c

index e39df033a7970dc554a4295fd80f125ec13328ed..8d7c2ee214dd90198ba125f0977beebab731833a 100644 (file)
@@ -847,7 +847,7 @@ static void choose_tx_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x, int *rate,
                               { INT64_MAX, INT64_MAX } };
   int n;
   int s0, s1;
-  int64_t best_rd = INT64_MAX;
+  int64_t best_rd = ref_best_rd;
   TX_SIZE best_tx = max_tx_size;
   int start_tx, end_tx;
   const int tx_size_ctx = get_tx_size_context(xd);
@@ -868,8 +868,8 @@ static void choose_tx_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x, int *rate,
 
   for (n = start_tx; n >= end_tx; n--) {
     const int r_tx_size = cpi->tx_size_cost[max_tx_size - 1][tx_size_ctx][n];
-    txfm_rd_in_plane(cpi, x, &r[n][0], &d[n], &s[n], &sse[n], ref_best_rd, 0,
-                     bs, n, cpi->sf.use_fast_coef_costing);
+    txfm_rd_in_plane(cpi, x, &r[n][0], &d[n], &s[n], &sse[n], best_rd, 0, bs, n,
+                     cpi->sf.use_fast_coef_costing);
     r[n][1] = r[n][0];
     if (r[n][0] < INT_MAX) {
       r[n][1] += r_tx_size;