From: Ronald S. Bultje Date: Wed, 3 Jul 2013 17:09:15 +0000 (-0700) Subject: Remove unnecessary memset(best_index, 0) from trellis/optimize. X-Git-Tag: v1.3.0~941 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a73254918b7f37582a606a6621a9eb0d05abb06;p=libvpx Remove unnecessary memset(best_index, 0) from trellis/optimize. First 50 frames of bus @ 1500kbps (speed 0) goes from 2min12.6 to 2min11.6, i.e. 0.75% overall speedup. Change-Id: I67054f8146e82a02b6457c51a1c8627a937e5e1e --- diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 16d2fe955..d243fea68 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -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. */ } }