Index: source/libvpx/vp9/common/vp9_entropymv.c |
=================================================================== |
--- source/libvpx/vp9/common/vp9_entropymv.c (revision 207479) |
+++ source/libvpx/vp9/common/vp9_entropymv.c (working copy) |
@@ -114,7 +114,7 @@ |
return c; |
} |
-int vp9_use_nmv_hp(const MV *ref) { |
+int vp9_use_mv_hp(const MV *ref) { |
return (abs(ref->row) >> 3) < COMPANDED_MVREF_THRESH && |
(abs(ref->col) >> 3) < COMPANDED_MVREF_THRESH; |
} |
@@ -123,54 +123,50 @@ |
return mv_class_base(c) + offset; |
} |
-static void increment_nmv_component_count(int v, |
- nmv_component_counts *mvcomp, |
- int incr, |
- int usehp) { |
- assert (v != 0); /* should not be zero */ |
- mvcomp->mvcount[MV_MAX + v] += incr; |
+static void inc_mv_component_count(int v, nmv_component_counts *comp_counts, |
+ int incr) { |
+ assert (v != 0); |
+ comp_counts->mvcount[MV_MAX + v] += incr; |
} |
-static void increment_nmv_component(int v, |
- nmv_component_counts *mvcomp, |
- int incr, |
- int usehp) { |
+static void inc_mv_component(int v, nmv_component_counts *comp_counts, |
+ int incr, int usehp) { |
int s, z, c, o, d, e, f; |
if (!incr) |
return; |
assert (v != 0); /* should not be zero */ |
s = v < 0; |
- mvcomp->sign[s] += incr; |
+ comp_counts->sign[s] += incr; |
z = (s ? -v : v) - 1; /* magnitude - 1 */ |
c = vp9_get_mv_class(z, &o); |
- mvcomp->classes[c] += incr; |
+ comp_counts->classes[c] += incr; |
d = (o >> 3); /* int mv data */ |
f = (o >> 1) & 3; /* fractional pel mv data */ |
e = (o & 1); /* high precision mv data */ |
if (c == MV_CLASS_0) { |
- mvcomp->class0[d] += incr; |
+ comp_counts->class0[d] += incr; |
} else { |
int i; |
int b = c + CLASS0_BITS - 1; // number of bits |
for (i = 0; i < b; ++i) |
- mvcomp->bits[i][((d >> i) & 1)] += incr; |
+ comp_counts->bits[i][((d >> i) & 1)] += incr; |
} |
/* Code the fractional pel bits */ |
if (c == MV_CLASS_0) { |
- mvcomp->class0_fp[d][f] += incr; |
+ comp_counts->class0_fp[d][f] += incr; |
} else { |
- mvcomp->fp[f] += incr; |
+ comp_counts->fp[f] += incr; |
} |
/* Code the high precision bit */ |
if (usehp) { |
if (c == MV_CLASS_0) { |
- mvcomp->class0_hp[e] += incr; |
+ comp_counts->class0_hp[e] += incr; |
} else { |
- mvcomp->hp[e] += incr; |
+ comp_counts->hp[e] += incr; |
} |
} |
} |
@@ -197,8 +193,8 @@ |
int v; |
vpx_memset(mvcomp->sign, 0, sizeof(nmv_component_counts) - sizeof(mvcomp->mvcount)); |
for (v = 1; v <= MV_MAX; v++) { |
- increment_nmv_component(-v, mvcomp, mvcomp->mvcount[MV_MAX - v], usehp); |
- increment_nmv_component( v, mvcomp, mvcomp->mvcount[MV_MAX + v], usehp); |
+ inc_mv_component(-v, mvcomp, mvcomp->mvcount[MV_MAX - v], usehp); |
+ inc_mv_component( v, mvcomp, mvcomp->mvcount[MV_MAX + v], usehp); |
} |
} |
@@ -206,12 +202,12 @@ |
int usehp) { |
const MV_JOINT_TYPE j = vp9_get_mv_joint(mv); |
mvctx->joints[j]++; |
- usehp = usehp && vp9_use_nmv_hp(ref); |
+ usehp = usehp && vp9_use_mv_hp(ref); |
if (mv_joint_vertical(j)) |
- increment_nmv_component_count(mv->row, &mvctx->comps[0], 1, usehp); |
+ inc_mv_component_count(mv->row, &mvctx->comps[0], 1); |
if (mv_joint_horizontal(j)) |
- increment_nmv_component_count(mv->col, &mvctx->comps[1], 1, usehp); |
+ inc_mv_component_count(mv->col, &mvctx->comps[1], 1); |
} |
static void adapt_prob(vp9_prob *dest, vp9_prob prep, unsigned int ct[2]) { |
@@ -332,7 +328,7 @@ |
} |
-void vp9_adapt_nmv_probs(VP9_COMMON *cm, int usehp) { |
+void vp9_adapt_mv_probs(VP9_COMMON *cm, int usehp) { |
int i, j; |
#ifdef MV_COUNT_TESTING |
printf("joints count: "); |