From: Yaowu Xu Date: Tue, 27 Sep 2016 17:13:33 +0000 (-0700) Subject: Remove an intermediate variable X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=439286a6c5e52f03bc30338c37a0aa5798afa057;p=libvpx Remove an intermediate variable This commit changes to use function parameter "len" directly. Change-Id: I072d165aeca59cfbbcf52c9be3c2a91e3191b980 --- diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c index b4994dc84..f7d63f1b2 100644 --- a/av1/common/mvref_common.c +++ b/av1/common/mvref_common.c @@ -17,12 +17,9 @@ static uint8_t add_ref_mv_candidate( const MODE_INFO *const candidate_mi, const MB_MODE_INFO *const candidate, const MV_REFERENCE_FRAME rf[2], uint8_t *refmv_count, CANDIDATE_MV *ref_mv_stack, const int use_hp, int len, int block, int col) { - const int weight = len; int index = 0, ref; int newmv_count = 0; - assert(2 * weight < REF_CAT_LEVEL); - if (rf[1] == NONE) { // single reference frame for (ref = 0; ref < 2; ++ref) { @@ -33,14 +30,14 @@ static uint8_t add_ref_mv_candidate( for (index = 0; index < *refmv_count; ++index) if (ref_mv_stack[index].this_mv.as_int == this_refmv.as_int) break; - if (index < *refmv_count) ref_mv_stack[index].weight += 2 * weight; + if (index < *refmv_count) ref_mv_stack[index].weight += 2 * len; // Add a new item to the list. if (index == *refmv_count) { ref_mv_stack[index].this_mv = this_refmv; ref_mv_stack[index].pred_mv = get_sub_block_pred_mv(candidate_mi, ref, col, block); - ref_mv_stack[index].weight = 2 * weight; + ref_mv_stack[index].weight = 2 * len; ++(*refmv_count); #if CONFIG_EXT_INTER @@ -59,14 +56,14 @@ static uint8_t add_ref_mv_candidate( for (index = 0; index < *refmv_count; ++index) if (ref_mv_stack[index].this_mv.as_int == this_refmv.as_int) break; - if (index < *refmv_count) ref_mv_stack[index].weight += weight; + if (index < *refmv_count) ref_mv_stack[index].weight += len; // Add a new item to the list. if (index == *refmv_count) { ref_mv_stack[index].this_mv = this_refmv; ref_mv_stack[index].pred_mv = get_sub_block_pred_mv(candidate_mi, ref, col, alt_block); - ref_mv_stack[index].weight = weight; + ref_mv_stack[index].weight = len; ++(*refmv_count); #if CONFIG_EXT_INTER @@ -94,13 +91,13 @@ static uint8_t add_ref_mv_candidate( (ref_mv_stack[index].comp_mv.as_int == this_refmv[1].as_int)) break; - if (index < *refmv_count) ref_mv_stack[index].weight += 2 * weight; + if (index < *refmv_count) ref_mv_stack[index].weight += 2 * len; // Add a new item to the list. if (index == *refmv_count) { ref_mv_stack[index].this_mv = this_refmv[0]; ref_mv_stack[index].comp_mv = this_refmv[1]; - ref_mv_stack[index].weight = 2 * weight; + ref_mv_stack[index].weight = 2 * len; ++(*refmv_count); #if CONFIG_EXT_INTER @@ -124,13 +121,13 @@ static uint8_t add_ref_mv_candidate( ref_mv_stack[index].comp_mv.as_int == this_refmv[1].as_int) break; - if (index < *refmv_count) ref_mv_stack[index].weight += weight; + if (index < *refmv_count) ref_mv_stack[index].weight += len; // Add a new item to the list. if (index == *refmv_count) { ref_mv_stack[index].this_mv = this_refmv[0]; ref_mv_stack[index].comp_mv = this_refmv[1]; - ref_mv_stack[index].weight = weight; + ref_mv_stack[index].weight = len; ++(*refmv_count); #if CONFIG_EXT_INTER