]> granicus.if.org Git - libvpx/commitdiff
Adjust optimize_b RD parameters
authorhui su <huisu@google.com>
Mon, 18 Apr 2016 17:10:58 +0000 (10:10 -0700)
committerhui su <huisu@google.com>
Tue, 19 Apr 2016 16:54:08 +0000 (09:54 -0700)
Coding gain:
lowres  0.44%
midres  0.24%
hdres   0.32%

Change-Id: Ie558203b2b2bf5c16cd49b114df3d696c4f35049

vp10/encoder/encodemb.c

index b636e6193525b854d7b07cdd39c3a5fe275b36c0..54d8a0f5b14a9798deb08c119103762f4512307a 100644 (file)
@@ -65,7 +65,7 @@ typedef struct vp10_token_state {
 } vp10_token_state;
 
 // TODO(jimbankoski): 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] ={ {9, 7}, {7, 5}, };
 
 #define UPDATE_RD_COST()\
 {\
@@ -114,7 +114,8 @@ static int optimize_b(MACROBLOCK *mb, int plane, int block,
   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;
@@ -128,13 +129,9 @@ static int optimize_b(MACROBLOCK *mb, int plane, int block,
 
   assert((!type && !plane) || (type && plane));
   assert(eob <= default_eob);
-
   mul = 1 << get_tx_scale(xd, tx_type, tx_size);
 
   /* 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;