From b0a8057f6735c75f5f6d27aaa0fd54904bc5632a Mon Sep 17 00:00:00 2001
From: Alex Converse <aconverse@google.com>
Date: Wed, 28 May 2014 17:11:16 -0700
Subject: [PATCH] Fix SEG_LVL_SKIP in RD inter mode selection.

* Only use ZEROMV, disalowing the intra modes that were previously
  tested.
* Score rate and distortion as zero.

Change-Id: Ifcf99e272095725f11da1dcd26bd0f850683e680
---
 vp9/encoder/vp9_rdopt.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 8e77dd05be..f8acf5b7a2 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2802,7 +2802,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
     *rate2 += vp9_get_switchable_rate(cpi);
 
   if (!is_comp_pred) {
-    if (!x->in_active_map) {
+    if (!x->in_active_map ||
+        vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) {
       if (psse)
         *psse = 0;
       *distortion = 0;
@@ -3119,9 +3120,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
   // If the segment skip feature is enabled....
   // then do nothing if the current mode is not allowed..
   if (vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)) {
-    const int inter_non_zero_mode_mask = 0x1F7F7;
-    mode_skip_mask |= inter_non_zero_mode_mask;
-    mode_skip_mask &= ~(1 << THR_ZEROMV);
+    mode_skip_mask = ~(1 << THR_ZEROMV);
     inter_mode_mask = (1 << ZEROMV);
   }
 
-- 
GitLab