ref: 2c6ddcc606aa87ca7cd89402ca811fe39a8497dd
parent: 08053edb8076b77b4c395c2a2ae6e507d9157cee
author: Jingning Han <jingning@google.com>
date: Thu Feb 27 06:41:04 EST 2014
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
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2742,7 +2742,7 @@
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 @@
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 @@
* 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
--
⑨