Commit f32fa45c authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Cleaning up vp9_get_pred_context_single_ref_p1()."

parents 4a1a7919 724fefb4
...@@ -218,27 +218,25 @@ int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) { ...@@ -218,27 +218,25 @@ int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
} else { // inter/inter } else { // inter/inter
const int above_has_second = has_second_ref(above_mbmi); const int above_has_second = has_second_ref(above_mbmi);
const int left_has_second = has_second_ref(left_mbmi); const int left_has_second = has_second_ref(left_mbmi);
const MV_REFERENCE_FRAME above0 = above_mbmi->ref_frame[0];
const MV_REFERENCE_FRAME above1 = above_mbmi->ref_frame[1];
const MV_REFERENCE_FRAME left0 = left_mbmi->ref_frame[0];
const MV_REFERENCE_FRAME left1 = left_mbmi->ref_frame[1];
if (above_has_second && left_has_second) { if (above_has_second && left_has_second) {
pred_context = 1 + (above_mbmi->ref_frame[0] == LAST_FRAME || pred_context = 1 + (above0 == LAST_FRAME || above1 == LAST_FRAME ||
above_mbmi->ref_frame[1] == LAST_FRAME || left0 == LAST_FRAME || left1 == LAST_FRAME);
left_mbmi->ref_frame[0] == LAST_FRAME ||
left_mbmi->ref_frame[1] == LAST_FRAME);
} else if (above_has_second || left_has_second) { } else if (above_has_second || left_has_second) {
const MV_REFERENCE_FRAME rfs = !above_has_second ? const MV_REFERENCE_FRAME rfs = !above_has_second ? above0 : left0;
above_mbmi->ref_frame[0] : left_mbmi->ref_frame[0]; const MV_REFERENCE_FRAME crf1 = above_has_second ? above0 : left0;
const MV_REFERENCE_FRAME crf1 = above_has_second ? const MV_REFERENCE_FRAME crf2 = above_has_second ? above1 : left1;
above_mbmi->ref_frame[0] : left_mbmi->ref_frame[0];
const MV_REFERENCE_FRAME crf2 = above_has_second ?
above_mbmi->ref_frame[1] : left_mbmi->ref_frame[1];
if (rfs == LAST_FRAME) if (rfs == LAST_FRAME)
pred_context = 3 + (crf1 == LAST_FRAME || crf2 == LAST_FRAME); pred_context = 3 + (crf1 == LAST_FRAME || crf2 == LAST_FRAME);
else else
pred_context = (crf1 == LAST_FRAME || crf2 == LAST_FRAME); pred_context = (crf1 == LAST_FRAME || crf2 == LAST_FRAME);
} else { } else {
pred_context = 2 * (above_mbmi->ref_frame[0] == LAST_FRAME) + pred_context = 2 * (above0 == LAST_FRAME) + 2 * (left0 == LAST_FRAME);
2 * (left_mbmi->ref_frame[0] == LAST_FRAME);
} }
} }
} else if (has_above || has_left) { // one edge available } else if (has_above || has_left) { // one edge available
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment