vp10: fix entropy counts for the hp bit.
The counts didn't take usehp into account, which means that if the
scope of the refmv is too large for the hp bit to be coded, the value
(always 1) is still included in the stats. Therefore, the final
counts will not reflect the entropy of the coded bits, but rather the
entropy of the combination of coded bits and the implied value (which
is always 1). Fix that by only including counts if the hp bit is
actually coded.
See issue 1060.
Change-Id: I19a3adda4a8662a05f08a9e58d7e56ff979be11e
diff --git a/vp10/common/entropymv.c b/vp10/common/entropymv.c
index ebf7a07..6b99606 100644
--- 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);
}
}
}