Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: source/libvpx/vp9/common/vp9_findnearmv.c

Issue 23600008: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/common/vp9_findnearmv.h ('k') | source/libvpx/vp9/common/vp9_idct.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/common/vp9_findnearmv.c
===================================================================
--- source/libvpx/vp9/common/vp9_findnearmv.c (revision 219822)
+++ source/libvpx/vp9/common/vp9_findnearmv.c (working copy)
@@ -8,18 +8,16 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <limits.h>
-
#include "vp9/common/vp9_findnearmv.h"
#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)) {
- if (mv->as_mv.row & 1)
- mv->as_mv.row += (mv->as_mv.row > 0 ? -1 : 1);
- if (mv->as_mv.col & 1)
- mv->as_mv.col += (mv->as_mv.col > 0 ? -1 : 1);
+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);
}
}
@@ -31,8 +29,8 @@
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], xd->allow_high_precision_mv);
- clamp_mv2(&mvlist[i], xd);
+ lower_mv_precision(&mvlist[i].as_mv, xd->allow_high_precision_mv);
+ clamp_mv2(&mvlist[i].as_mv, xd);
}
*nearest = mvlist[0];
*near = mvlist[1];
@@ -41,19 +39,18 @@
void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
int_mv *dst_nearest,
int_mv *dst_near,
- int block_idx, int ref_idx) {
+ int block_idx, int ref_idx,
+ int mi_row, int mi_col) {
int_mv dst_list[MAX_MV_REF_CANDIDATES];
int_mv mv_list[MAX_MV_REF_CANDIDATES];
- MODE_INFO *mi = xd->mode_info_context;
- MB_MODE_INFO *const mbmi = &mi->mbmi;
+ MODE_INFO *const mi = xd->mode_info_context;
assert(ref_idx == 0 || ref_idx == 1);
assert(MAX_MV_REF_CANDIDATES == 2); // makes code here slightly easier
- vp9_find_mv_refs_idx(cm, xd, xd->mode_info_context,
- xd->prev_mode_info_context,
- mbmi->ref_frame[ref_idx],
- mv_list, cm->ref_frame_sign_bias, block_idx);
+ vp9_find_mv_refs_idx(cm, xd, mi, xd->prev_mode_info_context,
+ mi->mbmi.ref_frame[ref_idx],
+ mv_list, block_idx, mi_row, mi_col);
dst_list[1].as_int = 0;
if (block_idx == 0) {
« no previous file with comments | « source/libvpx/vp9/common/vp9_findnearmv.h ('k') | source/libvpx/vp9/common/vp9_idct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698