From 2c6ddcc606aa87ca7cd89402ca811fe39a8497dd Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Thu, 27 Feb 2014 11:41:04 -0800 Subject: [PATCH] Cosmetic change mbmi->ref_frame to refs In handle_inter_mode, the reference frames are set in refs buffer. One can use refs buffer directly to avoid redundant fetch. Change-Id: I811d408cae52dcd5e053dd4bfe69550eb6a2ff56 --- vp9/encoder/vp9_rdopt.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 76d7777dc..3a423953a 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -2742,7 +2742,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, frame_mv[refs[0]].as_int == 0 && !vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP) && (num_refs == 1 || frame_mv[refs[1]].as_int == 0)) { - int rfc = mbmi->mode_context[mbmi->ref_frame[0]]; + int rfc = mbmi->mode_context[refs[0]]; int c1 = cost_mv_ref(cpi, NEARMV, rfc); int c2 = cost_mv_ref(cpi, NEARESTMV, rfc); int c3 = cost_mv_ref(cpi, ZEROMV, rfc); @@ -2757,17 +2757,17 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, assert(this_mode == ZEROMV); if (num_refs == 1) { if ((c3 >= c2 && - mode_mv[NEARESTMV][mbmi->ref_frame[0]].as_int == 0) || + mode_mv[NEARESTMV][refs[0]].as_int == 0) || (c3 >= c1 && - mode_mv[NEARMV][mbmi->ref_frame[0]].as_int == 0)) + mode_mv[NEARMV][refs[0]].as_int == 0)) return INT64_MAX; } else { if ((c3 >= c2 && - mode_mv[NEARESTMV][mbmi->ref_frame[0]].as_int == 0 && - mode_mv[NEARESTMV][mbmi->ref_frame[1]].as_int == 0) || + mode_mv[NEARESTMV][refs[0]].as_int == 0 && + mode_mv[NEARESTMV][refs[1]].as_int == 0) || (c3 >= c1 && - mode_mv[NEARMV][mbmi->ref_frame[0]].as_int == 0 && - mode_mv[NEARMV][mbmi->ref_frame[1]].as_int == 0)) + mode_mv[NEARMV][refs[0]].as_int == 0 && + mode_mv[NEARMV][refs[1]].as_int == 0)) return INT64_MAX; } } @@ -2798,8 +2798,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, * are only three options: Last/Golden, ARF/Last or Golden/ARF, or in other * words if you present them in that order, the second one is always known * if the first is known */ - *rate2 += cost_mv_ref(cpi, this_mode, - mbmi->mode_context[mbmi->ref_frame[0]]); + *rate2 += cost_mv_ref(cpi, this_mode, mbmi->mode_context[refs[0]]); if (!(*mode_excluded)) *mode_excluded = is_comp_pred ? cm->reference_mode == SINGLE_REFERENCE -- 2.40.0