summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_findnearmv.c
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-12-19 17:39:57 -0800
committerDmitry Kovalev <dkovalev@google.com>2013-12-19 17:39:57 -0800
commit987810ad95efd5e4057b546dd6525db97469a858 (patch)
tree14411a70d8b2a7a7f70f5e911e9a4df7095bae90 /vp9/common/vp9_findnearmv.c
parent40e173ac42581159b8a96f8a000445e1fba475af (diff)
downloadlibvpx-987810ad95efd5e4057b546dd6525db97469a858.tar
libvpx-987810ad95efd5e4057b546dd6525db97469a858.tar.gz
libvpx-987810ad95efd5e4057b546dd6525db97469a858.tar.bz2
libvpx-987810ad95efd5e4057b546dd6525db97469a858.zip
Removing vp9_findnearmv.{h, c} files.
Moving all code from that files to vp9_mvref_common.{h, c}. Change-Id: Ibc4afcb8cea6847166ff411130e93611ebe63b20
Diffstat (limited to 'vp9/common/vp9_findnearmv.c')
-rw-r--r--vp9/common/vp9_findnearmv.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/vp9/common/vp9_findnearmv.c b/vp9/common/vp9_findnearmv.c
deleted file mode 100644
index 7cdf2c1c7..000000000
--- a/vp9/common/vp9_findnearmv.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "vp9/common/vp9_findnearmv.h"
-#include "vp9/common/vp9_mvref_common.h"
-
-static void lower_mv_precision(MV *mv, int allow_hp) {
- const int use_hp = allow_hp && vp9_use_mv_hp(mv);
- if (!use_hp) {
- if (mv->row & 1)
- mv->row += (mv->row > 0 ? -1 : 1);
- if (mv->col & 1)
- mv->col += (mv->col > 0 ? -1 : 1);
- }
-}
-
-
-void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
- int_mv *mvlist, int_mv *nearest, int_mv *near) {
- int i;
- // Make sure all the candidates are properly clamped etc
- for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) {
- lower_mv_precision(&mvlist[i].as_mv, allow_hp);
- clamp_mv2(&mvlist[i].as_mv, xd);
- }
- *nearest = mvlist[0];
- *near = mvlist[1];
-}
-
-void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
- const TileInfo *const tile,
- int block, int ref, int mi_row, int mi_col,
- int_mv *nearest, int_mv *near) {
- int_mv mv_list[MAX_MV_REF_CANDIDATES];
- MODE_INFO *const mi = xd->mi_8x8[0];
- b_mode_info *bmi = mi->bmi;
- int n;
-
- assert(MAX_MV_REF_CANDIDATES == 2);
-
- vp9_find_mv_refs_idx(cm, xd, tile, mi, xd->last_mi, mi->mbmi.ref_frame[ref],
- mv_list, block, mi_row, mi_col);
-
- near->as_int = 0;
- switch (block) {
- case 0:
- nearest->as_int = mv_list[0].as_int;
- near->as_int = mv_list[1].as_int;
- break;
- case 1:
- case 2:
- nearest->as_int = bmi[0].as_mv[ref].as_int;
- for (n = 0; n < MAX_MV_REF_CANDIDATES; ++n)
- if (nearest->as_int != mv_list[n].as_int) {
- near->as_int = mv_list[n].as_int;
- break;
- }
- break;
- case 3: {
- int_mv candidates[2 + MAX_MV_REF_CANDIDATES];
- candidates[0] = bmi[1].as_mv[ref];
- candidates[1] = bmi[0].as_mv[ref];
- candidates[2] = mv_list[0];
- candidates[3] = mv_list[1];
-
- nearest->as_int = bmi[2].as_mv[ref].as_int;
- for (n = 0; n < 2 + MAX_MV_REF_CANDIDATES; ++n)
- if (nearest->as_int != candidates[n].as_int) {
- near->as_int = candidates[n].as_int;
- break;
- }
- break;
- }
- default:
- assert("Invalid block index.");
- }
-}