]> granicus.if.org Git - libvpx/commitdiff
Make ref_mv_idx syntax context dependent on block distance only
authorJingning Han <jingning@google.com>
Wed, 5 Oct 2016 16:08:44 +0000 (09:08 -0700)
committerJingning Han <jingning@google.com>
Wed, 5 Oct 2016 16:09:00 +0000 (09:09 -0700)
This allows the hardware decoder to start decoding ref_mv_idx
syntax prior to the sorting stage and hide the latency of entropy
decoding. The compression performance change is about 0.01% level.

Change-Id: I86b34f31f6c99a36ae2780416175cc0bd90ff492

av1/common/mvref_common.h

index b6a5e22764c33ab2dbcb92c36193b4f6054e3fff..b5e7094c2c70d8e3a54109ce1cda589cb203fcd5 100644 (file)
@@ -431,24 +431,16 @@ static INLINE int16_t av1_mode_context_analyzer(
 static INLINE uint8_t av1_drl_ctx(const CANDIDATE_MV *ref_mv_stack,
                                   int ref_idx) {
   if (ref_mv_stack[ref_idx].weight >= REF_CAT_LEVEL &&
-      ref_mv_stack[ref_idx + 1].weight >= REF_CAT_LEVEL) {
-    if (ref_mv_stack[ref_idx].weight == ref_mv_stack[ref_idx + 1].weight)
-      return 0;
-    else
-      return 1;
-  }
+      ref_mv_stack[ref_idx + 1].weight >= REF_CAT_LEVEL)
+    return 0;
 
   if (ref_mv_stack[ref_idx].weight >= REF_CAT_LEVEL &&
       ref_mv_stack[ref_idx + 1].weight < REF_CAT_LEVEL)
     return 2;
 
   if (ref_mv_stack[ref_idx].weight < REF_CAT_LEVEL &&
-      ref_mv_stack[ref_idx + 1].weight < REF_CAT_LEVEL) {
-    if (ref_mv_stack[ref_idx].weight == ref_mv_stack[ref_idx + 1].weight)
-      return 3;
-    else
-      return 4;
-  }
+      ref_mv_stack[ref_idx + 1].weight < REF_CAT_LEVEL)
+    return 3;
 
   return 0;
 }