shithub: libvpx

Download patch

ref: bbede82f24dbe8233f5d5a9d1d2565b5a34efb4e
parent: e6ad9ab02c9914182fec83b9170c5bc86baf4102
author: Paul Wilkins <paulwilkins@google.com>
date: Wed Feb 6 08:02:53 EST 2013

Nearest / Zero Mv default entropy tweak.

Tweak to default mode context to account for the fact
that when there are no non zero motion candidates
Nearest is now the preferred mode for coding a 0,0
vector.

Also resolve duplicate function name and typos.

Change-Id: I76802788d46c84e3d1c771be216a537ab7b12817

--- a/vp9/common/vp9_modecont.c
+++ b/vp9/common/vp9_modecont.c
@@ -12,7 +12,7 @@
 #include "vp9/common/vp9_entropy.h"
 
 const int vp9_default_mode_contexts[INTER_MODE_CONTEXTS][4] = {
-  {223,     1,     1,    237},  // 0,0 best: Only candidate
+  {1,       223,   1,    237},  // 0,0 best: Only candidate
   {87,      166,   26,   219},  // 0,0 best: non zero candidates
   {89,      67,    18,   125},  // 0,0 best: non zero candidates, split
   {16,      141,   69,   226},  // strong nz candidate(s), no split
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -792,7 +792,7 @@
       }
       */
 
-      // Is the segment level skip mode enabled
+      // If the segment level skip mode enabled
       if (vp9_segfeature_active(xd, mbmi->segment_id, SEG_LVL_SKIP)) {
         mbmi->mode = ZEROMV;
       } else {
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -221,8 +221,8 @@
 //
 // The branch counts table is re-populated during the actual pack stage and in
 // the decoder to facilitate backwards update of the context.
-static void update_mode_probs(VP9_COMMON *cm,
-                              int mode_context[INTER_MODE_CONTEXTS][4]) {
+static void update_inter_mode_probs(VP9_COMMON *cm,
+                                    int mode_context[INTER_MODE_CONTEXTS][4]) {
   int i, j;
   unsigned int (*mv_ref_ct)[4][2];
 
@@ -813,7 +813,7 @@
     active_section = 3;
 #endif
 
-    // Is segment skip is not enabled code the mode.
+    // If segment skip is not enabled code the mode.
     if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) {
       if (mi->sb_type) {
         write_sb_mv_ref(bc, mode, mv_ref_p);
@@ -1871,7 +1871,13 @@
   if (pc->frame_type != KEY_FRAME) {
     int i, j;
     int new_context[INTER_MODE_CONTEXTS][4];
-    update_mode_probs(pc, new_context);
+    if (!cpi->dummy_packing) {
+      update_inter_mode_probs(pc, new_context);
+    } else {
+      // In dummy pack assume context unchanged.
+      vpx_memcpy(new_context, pc->fc.vp9_mode_contexts,
+                 sizeof(pc->fc.vp9_mode_contexts));
+    }
 
     for (i = 0; i < INTER_MODE_CONTEXTS; i++) {
       for (j = 0; j < 4; j++) {