shithub: libvpx

Download patch

ref: e562c71783d303bab7f9d6a9852db3debec3f865
parent: 8c1dce86e813d0c45dbb50270d026b579d23de0c
parent: 1e9e9ce2dcef43677887292df115e5160809ed62
author: Ronald S. Bultje <[email protected]>
date: Tue Sep 15 21:53:44 EDT 2015

Merge "vp10: fix entropy counts for the hp bit."

--- a/vp10/common/entropymv.c
+++ b/vp10/common/entropymv.c
@@ -161,17 +161,19 @@
   }
 }
 
-void vp10_inc_mv(const MV *mv, nmv_context_counts *counts) {
+void vp10_inc_mv(const MV *mv, nmv_context_counts *counts, const int usehp) {
   if (counts != NULL) {
     const MV_JOINT_TYPE j = vp10_get_mv_joint(mv);
     ++counts->joints[j];
 
     if (mv_joint_vertical(j)) {
-      inc_mv_component(mv->row, &counts->comps[0], 1, 1);
+      inc_mv_component(mv->row, &counts->comps[0], 1,
+                       !CONFIG_MISC_FIXES || usehp);
     }
 
     if (mv_joint_horizontal(j)) {
-      inc_mv_component(mv->col, &counts->comps[1], 1, 1);
+      inc_mv_component(mv->col, &counts->comps[1], 1,
+                       !CONFIG_MISC_FIXES || usehp);
     }
   }
 }
--- a/vp10/common/entropymv.h
+++ b/vp10/common/entropymv.h
@@ -124,7 +124,7 @@
   nmv_component_counts comps[2];
 } nmv_context_counts;
 
-void vp10_inc_mv(const MV *mv, nmv_context_counts *mvctx);
+void vp10_inc_mv(const MV *mv, nmv_context_counts *mvctx, const int usehp);
 
 #ifdef __cplusplus
 }  // extern "C"
--- a/vp10/decoder/decodemv.c
+++ b/vp10/decoder/decodemv.c
@@ -294,7 +294,7 @@
   if (mv_joint_horizontal(joint_type))
     diff.col = read_mv_component(r, &ctx->comps[1], use_hp);
 
-  vp10_inc_mv(&diff, counts);
+  vp10_inc_mv(&diff, counts, use_hp);
 
   mv->row = ref->row + diff.row;
   mv->col = ref->col + diff.col;
--- a/vp10/encoder/encodemv.c
+++ b/vp10/encoder/encodemv.c
@@ -239,7 +239,7 @@
     const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[i]][0].as_mv;
     const MV diff = {mvs[i].as_mv.row - ref->row,
                      mvs[i].as_mv.col - ref->col};
-    vp10_inc_mv(&diff, counts);
+    vp10_inc_mv(&diff, counts, vp10_use_mv_hp(ref));
   }
 }