#include <stdio.h>
#include <limits.h>
#include <math.h>
+#include "vp8/common/findnearmv.h"
#ifdef ENTROPY_STATS
static int mv_ref_ct [31] [4] [2];
unsigned char *what = (*(b->base_src) + b->src);
int what_stride = b->src_stride;
int in_what_stride = d->pre_stride;
- int br = ref_mv->as_mv.row, bc = ref_mv->as_mv.col;
+ int br, bc;
int_mv this_mv;
unsigned int bestsad = 0x7fffffff;
unsigned int thissad;
fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
+ // adjust ref_mv to make sure it is within MV range
+ vp8_clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
+ br = ref_mv->as_mv.row;
+ bc = ref_mv->as_mv.col;
+
// Work out the start point for the search
base_offset = (unsigned char *)(*(d->base_pre) + d->pre);
this_offset = base_offset + (br * (d->pre_stride)) + bc;
int best_site = 0;
int last_site = 0;
- int ref_row = ref_mv->as_mv.row;
- int ref_col = ref_mv->as_mv.col;
+ int ref_row;
+ int ref_col;
int this_row_offset;
int this_col_offset;
search_site *ss;
fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
+ vp8_clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
+ ref_row = ref_mv->as_mv.row;
+ ref_col = ref_mv->as_mv.col;
*num00 = 0;
-
best_mv->as_mv.row = ref_row;
best_mv->as_mv.col = ref_col;
int best_site = 0;
int last_site = 0;
- int ref_row = ref_mv->as_mv.row;
- int ref_col = ref_mv->as_mv.col;
+ int ref_row;
+ int ref_col;
int this_row_offset;
int this_col_offset;
search_site *ss;
fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
+ vp8_clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
+ ref_row = ref_mv->as_mv.row;
+ ref_col = ref_mv->as_mv.col;
*num00 = 0;
best_mv->as_mv.row = ref_row;
best_mv->as_mv.col = ref_col;
mvp_full.as_mv.col = mvp.as_mv.col>>3;
mvp_full.as_mv.row = mvp.as_mv.row>>3;
- /* adjust mvp to make sure it is within MV range */
- vp8_clamp_mv(&mvp_full, col_min, col_max, row_min, row_max);
-
// Get intersection of UMV window and valid MV window to reduce # of checks in diamond search.
if (x->mv_col_min < col_min )
x->mv_col_min = col_min;