Remove unnecessary memset(best_index, 0) from trellis/optimize.
authorRonald S. Bultje <rbultje@google.com>
Wed, 3 Jul 2013 17:09:15 +0000 (10:09 -0700)
committerRonald S. Bultje <rbultje@google.com>
Mon, 8 Jul 2013 23:22:39 +0000 (16:22 -0700)
First 50 frames of bus @ 1500kbps (speed 0) goes from 2min12.6 to
2min11.6, i.e. 0.75% overall speedup.

Change-Id: I67054f8146e82a02b6457c51a1c8627a937e5e1e

vp9/encoder/vp9_encodemb.c

index 16d2fe9..d243fea 100644 (file)
@@ -188,7 +188,6 @@ static void optimize_b(VP9_COMMON *const cm, MACROBLOCK *mb,
   if (mb->e_mbd.mode_info_context->mbmi.ref_frame[0] == INTRA_FRAME)
     rdmult = (rdmult * 9) >> 4;
   rddiv = mb->rddiv;
-  memset(best_index, 0, sizeof(best_index));
   /* Initialize the sentinel node of the trellis. */
   tokens[eob][0].rate = 0;
   tokens[eob][0].error = 0;
@@ -318,6 +317,7 @@ static void optimize_b(VP9_COMMON *const cm, MACROBLOCK *mb,
             mb->token_costs[tx_size][type][ref][1][band][0][t1];
         tokens[next][1].token = ZERO_TOKEN;
       }
+      best_index[i][0] = best_index[i][1] = 0;
       /* Don't update next, because we didn't add a new node. */
     }
   }