shithub: libvpx

Download patch

ref: 03b6f5f8e31464e031eef734406d3ff7499c49ed
parent: f16cf9fbccdb86d352dd80c21dd4b01891c5822a
parent: c3a9247e09bd74f65c36d12333f5061535158a93
author: Hui Su <[email protected]>
date: Tue Apr 26 15:12:09 EDT 2016

Merge "VP9: adjust trellis quant optimization RD parameters"

--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -62,8 +62,7 @@
   int16_t       qc;
 } vp9_token_state;
 
-// TODO(huisu): experiment to find optimal RD numbers.
-static const int plane_rd_mult[PLANE_TYPES] = { 4, 2 };
+static const int plane_rd_mult[REF_TYPES][PLANE_TYPES] ={ {10, 6}, {8, 7}, };
 
 #define UPDATE_RD_COST()\
 {\
@@ -110,7 +109,8 @@
   const int16_t *const scan = so->scan;
   const int16_t *const nb = so->neighbors;
   int next = eob, sz = 0;
-  int64_t rdmult = mb->rdmult * plane_rd_mult[type], rddiv = mb->rddiv;
+  const int64_t rdmult = (mb->rdmult * plane_rd_mult[ref][type]) >> 1;
+  const int64_t rddiv = mb->rddiv;
   int64_t rd_cost0, rd_cost1;
   int rate0, rate1, error0, error1;
   int16_t t0, t1;
@@ -126,9 +126,6 @@
   assert(eob <= default_eob);
 
   /* Now set up a Viterbi trellis to evaluate alternative roundings. */
-  if (!ref)
-    rdmult = (rdmult * 9) >> 4;
-
   /* Initialize the sentinel node of the trellis. */
   tokens[eob][0].rate = 0;
   tokens[eob][0].error = 0;