summaryrefslogtreecommitdiff
path: root/vp9/common
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-08-02 16:27:05 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-08-02 16:27:05 -0700
commita6adc82e784e960b74d65dbfd342a907ac8e506b (patch)
tree6c57052cf26e5f56142008f1e3023538846f117b /vp9/common
parentd4e020c4b1fc92b6babbde44bbe14bb4d9d1515c (diff)
parent86053d3ae23dfeecf263f14d83be5f5432476094 (diff)
downloadlibvpx-a6adc82e784e960b74d65dbfd342a907ac8e506b.tar
libvpx-a6adc82e784e960b74d65dbfd342a907ac8e506b.tar.gz
libvpx-a6adc82e784e960b74d65dbfd342a907ac8e506b.tar.bz2
libvpx-a6adc82e784e960b74d65dbfd342a907ac8e506b.zip
Merge "Cleanups around allow_high_precision_mv flag."
Diffstat (limited to 'vp9/common')
-rw-r--r--vp9/common/vp9_entropymv.c6
-rw-r--r--vp9/common/vp9_findnearmv.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/vp9/common/vp9_entropymv.c b/vp9/common/vp9_entropymv.c
index 4080f8c34..6cfc34697 100644
--- a/vp9/common/vp9_entropymv.c
+++ b/vp9/common/vp9_entropymv.c
@@ -198,7 +198,7 @@ static unsigned int adapt_probs(unsigned int i,
}
-void vp9_adapt_mv_probs(VP9_COMMON *cm, int usehp) {
+void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) {
int i, j;
FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
@@ -207,7 +207,7 @@ void vp9_adapt_mv_probs(VP9_COMMON *cm, int usehp) {
nmv_context *pre_ctx = &pre_fc->nmvc;
nmv_context_counts *cts = &cm->counts.mv;
- vp9_counts_process(cts, usehp);
+ vp9_counts_process(cts, allow_hp);
adapt_probs(0, vp9_mv_joint_tree, ctx->joints, pre_ctx->joints, cts->joints);
@@ -229,7 +229,7 @@ void vp9_adapt_mv_probs(VP9_COMMON *cm, int usehp) {
adapt_probs(0, vp9_mv_fp_tree, ctx->comps[i].fp, pre_ctx->comps[i].fp,
cts->comps[i].fp);
- if (usehp) {
+ if (allow_hp) {
ctx->comps[i].class0_hp = adapt_prob(pre_ctx->comps[i].class0_hp,
cts->comps[i].class0_hp);
ctx->comps[i].hp = adapt_prob(pre_ctx->comps[i].hp, cts->comps[i].hp);
diff --git a/vp9/common/vp9_findnearmv.c b/vp9/common/vp9_findnearmv.c
index d056dffc9..3af8b8d21 100644
--- a/vp9/common/vp9_findnearmv.c
+++ b/vp9/common/vp9_findnearmv.c
@@ -14,8 +14,9 @@
#include "vp9/common/vp9_mvref_common.h"
#include "vp9/common/vp9_sadmxn.h"
-static void lower_mv_precision(int_mv *mv, int usehp) {
- if (!usehp || !vp9_use_mv_hp(&mv->as_mv)) {
+static void lower_mv_precision(int_mv *mv, int allow_hp) {
+ const int use_hp = allow_hp && vp9_use_mv_hp(&mv->as_mv);
+ if (!use_hp) {
if (mv->as_mv.row & 1)
mv->as_mv.row += (mv->as_mv.row > 0 ? -1 : 1);
if (mv->as_mv.col & 1)