int *mvcost_hp[2] = { &dummy_cost_hp[mv_max_hp + 1], &dummy_cost_hp[mv_max_hp + 1] };
int *mvsadcost_hp[2] = { &dummy_cost_hp[mv_max_hp + 1], &dummy_cost_hp[mv_max_hp + 1] };
- int col_min = (ref_mv->as_mv.col >> 3) - MAX_FULL_PEL_VAL + ((ref_mv->as_mv.col & 7) ? 1 : 0);
- int row_min = (ref_mv->as_mv.row >> 3) - MAX_FULL_PEL_VAL + ((ref_mv->as_mv.row & 7) ? 1 : 0);
- int col_max = (ref_mv->as_mv.col >> 3) + MAX_FULL_PEL_VAL;
- int row_max = (ref_mv->as_mv.row >> 3) + MAX_FULL_PEL_VAL;
int tmp_col_min = x->mv_col_min;
int tmp_col_max = x->mv_col_max;
int tmp_row_min = x->mv_row_min;
further_steps = 0;
}
- /* 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;
- if (x->mv_col_max > col_max)
- x->mv_col_max = col_max;
- if (x->mv_row_min < row_min)
- x->mv_row_min = row_min;
- if (x->mv_row_max > row_max)
- x->mv_row_max = row_max;
+ vp8_clamp_mv_min_max(x, ref_mv);
ref_full.as_mv.col = ref_mv->as_mv.col >> 3;
ref_full.as_mv.row = ref_mv->as_mv.row >> 3;
*/
+#include "vp8/encoder/onyx_int.h"
#include "mcomp.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/config.h"
static int mv_mode_cts [4] [2];
#endif
+void vp8_clamp_mv_min_max(MACROBLOCK *x, int_mv *ref_mv) {
+ int col_min = (ref_mv->as_mv.col >> 3) - MAX_FULL_PEL_VAL +
+ ((ref_mv->as_mv.col & 7) ? 1 : 0);
+ int row_min = (ref_mv->as_mv.row >> 3) - MAX_FULL_PEL_VAL +
+ ((ref_mv->as_mv.row & 7) ? 1 : 0);
+ int col_max = (ref_mv->as_mv.col >> 3) + MAX_FULL_PEL_VAL;
+ int row_max = (ref_mv->as_mv.row >> 3) + MAX_FULL_PEL_VAL;
+
+ /* 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;
+ if (x->mv_col_max > col_max)
+ x->mv_col_max = col_max;
+ if (x->mv_row_min < row_min)
+ x->mv_row_min = row_min;
+ if (x->mv_row_max > row_max)
+ x->mv_row_max = row_max;
+}
+
int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2],
int Weight, int ishp) {
// MV costing is based on the distribution of vectors in the previous frame
#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1) // Max full pel mv specified in 1 pel units
#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) // Maximum size of the first step in full pel units
+extern void vp8_clamp_mv_min_max(MACROBLOCK *x, int_mv *ref_mv);
extern int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2],
int Weight, int ishp);
extern void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride);
*sp = MAX_MVSEARCH_STEPS - 1 - step;
}
-static void clamp_mv_min_max(MACROBLOCK *x, int_mv *best_ref_mv) {
- int col_min = (best_ref_mv->as_mv.col >> 3) - MAX_FULL_PEL_VAL + ((best_ref_mv->as_mv.col & 7) ? 1 : 0);
- int row_min = (best_ref_mv->as_mv.row >> 3) - MAX_FULL_PEL_VAL + ((best_ref_mv->as_mv.row & 7) ? 1 : 0);
- int col_max = (best_ref_mv->as_mv.col >> 3) + MAX_FULL_PEL_VAL;
- int row_max = (best_ref_mv->as_mv.row >> 3) + MAX_FULL_PEL_VAL;
-
- /* 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;
- if (x->mv_col_max > col_max)
- x->mv_col_max = col_max;
- if (x->mv_row_min < row_min)
- x->mv_row_min = row_min;
- if (x->mv_row_max > row_max)
- x->mv_row_max = row_max;
-}
-
static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
int_mv *best_ref_mv, int_mv *second_best_ref_mv, int64_t best_rd,
int *mdcounts, int *returntotrate,
int tmp_row_min = x->mv_row_min;
int tmp_row_max = x->mv_row_max;
- clamp_mv_min_max(x, best_ref_mv);
+ vp8_clamp_mv_min_max(x, best_ref_mv);
/* Get 8x8 result */
bsi.sv_mvp[0].as_int = bsi.mvs[0].as_int;
int tmp_row_min = x->mv_row_min;
int tmp_row_max = x->mv_row_max;
- clamp_mv_min_max(x, &best_ref_mv);
+ vp8_clamp_mv_min_max(x, &best_ref_mv);
if (!saddone) {
vp8_cal_sad(cpi, xd, x, recon_yoffset, &near_sadidx[0]);