Commit 6b25501b authored by Scott LaVarnway's avatar Scott LaVarnway

Using int_mv instead of MV

The compiler produces better assembly when using int_mv
for assignments.  The compiler shifts and ors the two 16bit
values when assigning MV.

Change-Id: I52ce4bc2bfbfaf3f1151204b2f21e1e0654f960f
parent 6ed81fa5
......@@ -140,11 +140,7 @@ typedef enum
typedef struct
{
B_PREDICTION_MODE mode;
union
{
int as_int;
MV as_mv;
} mv;
int_mv mv;
} B_MODE_INFO;
......@@ -161,11 +157,7 @@ typedef struct
{
MB_PREDICTION_MODE mode, uv_mode;
MV_REFERENCE_FRAME ref_frame;
union
{
int as_int;
MV as_mv;
} mv;
int_mv mv;
unsigned char partitioning;
unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
......
......@@ -25,9 +25,9 @@ void vp8_find_near_mvs
(
MACROBLOCKD *xd,
const MODE_INFO *here,
MV *nearest,
MV *nearby,
MV *best_mv,
int_mv *nearest,
int_mv *nearby,
int_mv *best_mv,
int cnt[4],
int refframe,
int *ref_frame_sign_bias
......@@ -131,13 +131,14 @@ void vp8_find_near_mvs
near_mvs[CNT_INTRA] = near_mvs[CNT_NEAREST];
/* Set up return values */
*best_mv = near_mvs[0].as_mv;
*nearest = near_mvs[CNT_NEAREST].as_mv;
*nearby = near_mvs[CNT_NEAR].as_mv;
vp8_clamp_mv(nearest, xd);
vp8_clamp_mv(nearby, xd);
vp8_clamp_mv(best_mv, xd); /*TODO: move this up before the copy*/
best_mv->as_int = near_mvs[0].as_int;
nearest->as_int = near_mvs[CNT_NEAREST].as_int;
nearby->as_int = near_mvs[CNT_NEAR].as_int;
//TODO: move clamp outside findnearmv
vp8_clamp_mv2(nearest, xd);
vp8_clamp_mv2(nearby, xd);
vp8_clamp_mv2(best_mv, xd);
}
vp8_prob *vp8_mv_ref_probs(
......
......@@ -17,11 +17,6 @@
#include "modecont.h"
#include "treecoder.h"
typedef union
{
unsigned int as_int;
MV as_mv;
} int_mv; /* facilitates rapid equality tests */
static void mv_bias(int refmb_ref_frame_sign_bias, int refframe, int_mv *mvp, const int *ref_frame_sign_bias)
{
......@@ -39,24 +34,48 @@ static void mv_bias(int refmb_ref_frame_sign_bias, int refframe, int_mv *mvp, co
#define LEFT_TOP_MARGIN (16 << 3)
#define RIGHT_BOTTOM_MARGIN (16 << 3)
static void vp8_clamp_mv(MV *mv, const MACROBLOCKD *xd)
static void vp8_clamp_mv2(int_mv *mv, const MACROBLOCKD *xd)
{
if (mv->as_mv.col < (xd->mb_to_left_edge - LEFT_TOP_MARGIN))
mv->as_mv.col = xd->mb_to_left_edge - LEFT_TOP_MARGIN;
else if (mv->as_mv.col > xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN)
mv->as_mv.col = xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN;
if (mv->as_mv.row < (xd->mb_to_top_edge - LEFT_TOP_MARGIN))
mv->as_mv.row = xd->mb_to_top_edge - LEFT_TOP_MARGIN;
else if (mv->as_mv.row > xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN)
mv->as_mv.row = xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN;
}
static void vp8_clamp_mv(int_mv *mv, int mb_to_left_edge, int mb_to_right_edge,
int mb_to_top_edge, int mb_to_bottom_edge)
{
mv->as_mv.col = (mv->as_mv.col < mb_to_left_edge) ?
mb_to_left_edge : mv->as_mv.col;
mv->as_mv.col = (mv->as_mv.col > mb_to_right_edge) ?
mb_to_right_edge : mv->as_mv.col;
mv->as_mv.row = (mv->as_mv.row < mb_to_top_edge) ?
mb_to_top_edge : mv->as_mv.row;
mv->as_mv.row = (mv->as_mv.row > mb_to_bottom_edge) ?
mb_to_bottom_edge : mv->as_mv.row;
}
static unsigned int vp8_check_mv_bounds(int_mv *mv, int mb_to_left_edge,
int mb_to_right_edge, int mb_to_top_edge,
int mb_to_bottom_edge)
{
if (mv->col < (xd->mb_to_left_edge - LEFT_TOP_MARGIN))
mv->col = xd->mb_to_left_edge - LEFT_TOP_MARGIN;
else if (mv->col > xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN)
mv->col = xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN;
if (mv->row < (xd->mb_to_top_edge - LEFT_TOP_MARGIN))
mv->row = xd->mb_to_top_edge - LEFT_TOP_MARGIN;
else if (mv->row > xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN)
mv->row = xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN;
unsigned int need_to_clamp;
need_to_clamp = (mv->as_mv.col < mb_to_left_edge) ? 1 : 0;
need_to_clamp |= (mv->as_mv.col > mb_to_right_edge) ? 1 : 0;
need_to_clamp |= (mv->as_mv.row < mb_to_top_edge) ? 1 : 0;
need_to_clamp |= (mv->as_mv.row > mb_to_bottom_edge) ? 1 : 0;
return need_to_clamp;
}
void vp8_find_near_mvs
(
MACROBLOCKD *xd,
const MODE_INFO *here,
MV *nearest, MV *nearby, MV *best,
int_mv *nearest, int_mv *nearby, int_mv *best,
int near_mv_ref_cts[4],
int refframe,
int *ref_frame_sign_bias
......
......@@ -11,6 +11,7 @@
#ifndef __INC_MV_H
#define __INC_MV_H
#include "vpx/vpx_integer.h"
typedef struct
{
......@@ -18,4 +19,10 @@ typedef struct
short col;
} MV;
typedef union
{
uint32_t as_int;
MV as_mv;
} int_mv; /* facilitates faster equality tests and copies */
#endif
......@@ -283,12 +283,11 @@ static void mb_mode_mv_init(VP8D_COMP *pbi)
static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
int mb_row, int mb_col)
{
const MV Zero = { 0, 0};
vp8_reader *const bc = & pbi->bc;
MV_CONTEXT *const mvc = pbi->common.fc.mvc;
const int mis = pbi->common.mode_info_stride;
MV *const mv = & mbmi->mv.as_mv;
int_mv *const mv = & mbmi->mv;
int mb_to_left_edge;
int mb_to_right_edge;
int mb_to_top_edge;
......@@ -325,7 +324,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
{
int rct[4];
vp8_prob mv_ref_p [VP8_MVREFS-1];
MV nearest, nearby, best_mv;
int_mv nearest, nearby, best_mv;
if (vp8_read(bc, pbi->prob_last))
{
......@@ -349,8 +348,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
do /* for each subset j */
{
B_MODE_INFO bmi;
MV *const mv = & bmi.mv.as_mv;
int k; /* first block in subset j */
int mv_contz;
k = vp8_mbsplit_offset[s][j];
......@@ -360,27 +357,27 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
switch (bmi.mode = (B_PREDICTION_MODE) sub_mv_ref(bc, vp8_sub_mv_ref_prob2 [mv_contz])) /*pc->fc.sub_mv_ref_prob))*/
{
case NEW4X4:
read_mv(bc, mv, (const MV_CONTEXT *) mvc);
mv->row += best_mv.row;
mv->col += best_mv.col;
read_mv(bc, &bmi.mv.as_mv, (const MV_CONTEXT *) mvc);
bmi.mv.as_mv.row += best_mv.as_mv.row;
bmi.mv.as_mv.col += best_mv.as_mv.col;
#ifdef VPX_MODE_COUNT
vp8_mv_cont_count[mv_contz][3]++;
#endif
break;
case LEFT4X4:
*mv = vp8_left_bmi(mi, k)->mv.as_mv;
bmi.mv.as_int = vp8_left_bmi(mi, k)->mv.as_int;
#ifdef VPX_MODE_COUNT
vp8_mv_cont_count[mv_contz][0]++;
#endif
break;
case ABOVE4X4:
*mv = vp8_above_bmi(mi, k, mis)->mv.as_mv;
bmi.mv.as_int = vp8_above_bmi(mi, k, mis)->mv.as_int;
#ifdef VPX_MODE_COUNT
vp8_mv_cont_count[mv_contz][1]++;
#endif
break;
case ZERO4X4:
*mv = Zero;
bmi.mv.as_int = 0;
#ifdef VPX_MODE_COUNT
vp8_mv_cont_count[mv_contz][2]++;
#endif
......@@ -389,10 +386,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
break;
}
mbmi->need_to_clamp_mvs |= (mv->col < mb_to_left_edge) ? 1 : 0;
mbmi->need_to_clamp_mvs |= (mv->col > mb_to_right_edge) ? 1 : 0;
mbmi->need_to_clamp_mvs |= (mv->row < mb_to_top_edge) ? 1 : 0;
mbmi->need_to_clamp_mvs |= (mv->row > mb_to_bottom_edge) ? 1 : 0;
mbmi->need_to_clamp_mvs = vp8_check_mv_bounds(&bmi.mv,
mb_to_left_edge,
mb_to_right_edge,
mb_to_top_edge,
mb_to_bottom_edge);
{
/* Fill (uniform) modes, mvs of jth subset.
......@@ -414,72 +412,62 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
while (++j < num_p);
}
*mv = mi->bmi[15].mv.as_mv;
mv->as_int = mi->bmi[15].mv.as_int;
break; /* done with SPLITMV */
case NEARMV:
*mv = nearby;
mv->as_int = nearby.as_int;
/* Clip "next_nearest" so that it does not extend to far out of image */
mv->col = (mv->col < mb_to_left_edge) ? mb_to_left_edge : mv->col;
mv->col = (mv->col > mb_to_right_edge) ? mb_to_right_edge : mv->col;
mv->row = (mv->row < mb_to_top_edge) ? mb_to_top_edge : mv->row;
mv->row = (mv->row > mb_to_bottom_edge) ? mb_to_bottom_edge : mv->row;
vp8_clamp_mv(mv, mb_to_left_edge, mb_to_right_edge,
mb_to_top_edge, mb_to_bottom_edge);
goto propagate_mv;
case NEARESTMV:
*mv = nearest;
mv->as_int = nearest.as_int;
/* Clip "next_nearest" so that it does not extend to far out of image */
mv->col = (mv->col < mb_to_left_edge) ? mb_to_left_edge : mv->col;
mv->col = (mv->col > mb_to_right_edge) ? mb_to_right_edge : mv->col;
mv->row = (mv->row < mb_to_top_edge) ? mb_to_top_edge : mv->row;
mv->row = (mv->row > mb_to_bottom_edge) ? mb_to_bottom_edge : mv->row;
vp8_clamp_mv(mv, mb_to_left_edge, mb_to_right_edge,
mb_to_top_edge, mb_to_bottom_edge);
goto propagate_mv;
case ZEROMV:
*mv = Zero;
mv->as_int = 0;
goto propagate_mv;
case NEWMV:
read_mv(bc, mv, (const MV_CONTEXT *) mvc);
mv->row += best_mv.row;
mv->col += best_mv.col;
read_mv(bc, &mv->as_mv, (const MV_CONTEXT *) mvc);
mv->as_mv.row += best_mv.as_mv.row;
mv->as_mv.col += best_mv.as_mv.col;
/* Don't need to check this on NEARMV and NEARESTMV modes
* since those modes clamp the MV. The NEWMV mode does not,
* so signal to the prediction stage whether special
* handling may be required.
*/
mbmi->need_to_clamp_mvs = (mv->col < mb_to_left_edge) ? 1 : 0;
mbmi->need_to_clamp_mvs |= (mv->col > mb_to_right_edge) ? 1 : 0;
mbmi->need_to_clamp_mvs |= (mv->row < mb_to_top_edge) ? 1 : 0;
mbmi->need_to_clamp_mvs |= (mv->row > mb_to_bottom_edge) ? 1 : 0;
mbmi->need_to_clamp_mvs = vp8_check_mv_bounds(mv,
mb_to_left_edge,
mb_to_right_edge,
mb_to_top_edge,
mb_to_bottom_edge);
propagate_mv: /* same MV throughout */
{
/*int i=0;
do
{
mi->bmi[i].mv.as_mv = *mv;
}
while( ++i < 16);*/
mi->bmi[0].mv.as_mv = *mv;
mi->bmi[1].mv.as_mv = *mv;
mi->bmi[2].mv.as_mv = *mv;
mi->bmi[3].mv.as_mv = *mv;
mi->bmi[4].mv.as_mv = *mv;
mi->bmi[5].mv.as_mv = *mv;
mi->bmi[6].mv.as_mv = *mv;
mi->bmi[7].mv.as_mv = *mv;
mi->bmi[8].mv.as_mv = *mv;
mi->bmi[9].mv.as_mv = *mv;
mi->bmi[10].mv.as_mv = *mv;
mi->bmi[11].mv.as_mv = *mv;
mi->bmi[12].mv.as_mv = *mv;
mi->bmi[13].mv.as_mv = *mv;
mi->bmi[14].mv.as_mv = *mv;
mi->bmi[15].mv.as_mv = *mv;
mi->bmi[ 0].mv.as_int =
mi->bmi[ 1].mv.as_int =
mi->bmi[ 2].mv.as_int =
mi->bmi[ 3].mv.as_int =
mi->bmi[ 4].mv.as_int =
mi->bmi[ 5].mv.as_int =
mi->bmi[ 6].mv.as_int =
mi->bmi[ 7].mv.as_int =
mi->bmi[ 8].mv.as_int =
mi->bmi[ 9].mv.as_int =
mi->bmi[10].mv.as_int =
mi->bmi[11].mv.as_int =
mi->bmi[12].mv.as_int =
mi->bmi[13].mv.as_int =
mi->bmi[14].mv.as_int =
mi->bmi[15].mv.as_int = mv->as_int;
}
break;
default:;
......@@ -494,7 +482,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
int j = 0;
do
{
mi->bmi[j].mv.as_mv = Zero;
mi->bmi[j].mv.as_int = 0;
}
while (++j < 16);
......
......@@ -799,12 +799,12 @@ static void write_sub_mv_ref
static void write_mv
(
vp8_writer *w, const MV *mv, const MV *ref, const MV_CONTEXT *mvc
vp8_writer *w, const MV *mv, const int_mv *ref, const MV_CONTEXT *mvc
)
{
MV e;
e.row = mv->row - ref->row;
e.col = mv->col - ref->col;
e.row = mv->row - ref->as_mv.row;
e.col = mv->col - ref->as_mv.col;
vp8_encode_motion_vector(w, &e, mvc);
}
......@@ -957,7 +957,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
}
else /* inter coded */
{
MV best_mv;
int_mv best_mv;
vp8_prob mv_ref_p [VP8_MVREFS-1];
vp8_write(w, 1, cpi->prob_intra_coded);
......@@ -971,7 +971,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
}
{
MV n1, n2;
int_mv n1, n2;
int ct[4];
vp8_find_near_mvs(xd, m, &n1, &n2, &best_mv, ct, rf, cpi->common.ref_frame_sign_bias);
......
......@@ -1342,8 +1342,8 @@ int vp8cx_encode_inter_macroblock
}
else
{
MV best_ref_mv;
MV nearest, nearby;
int_mv best_ref_mv;
int_mv nearest, nearby;
int mdcounts[4];
int ref_fb_idx;
......@@ -1371,15 +1371,15 @@ int vp8cx_encode_inter_macroblock
{
if (xd->block[i].bmi.mode == NEW4X4)
{
cpi->MVcount[0][mv_max+((xd->block[i].bmi.mv.as_mv.row - best_ref_mv.row) >> 1)]++;
cpi->MVcount[1][mv_max+((xd->block[i].bmi.mv.as_mv.col - best_ref_mv.col) >> 1)]++;
cpi->MVcount[0][mv_max+((xd->block[i].bmi.mv.as_mv.row - best_ref_mv.as_mv.row) >> 1)]++;
cpi->MVcount[1][mv_max+((xd->block[i].bmi.mv.as_mv.col - best_ref_mv.as_mv.col) >> 1)]++;
}
}
}
else if (xd->mode_info_context->mbmi.mode == NEWMV)
{
cpi->MVcount[0][mv_max+((xd->block[0].bmi.mv.as_mv.row - best_ref_mv.row) >> 1)]++;
cpi->MVcount[1][mv_max+((xd->block[0].bmi.mv.as_mv.col - best_ref_mv.col) >> 1)]++;
cpi->MVcount[0][mv_max+((xd->block[0].bmi.mv.as_mv.row - best_ref_mv.as_mv.row) >> 1)]++;
cpi->MVcount[1][mv_max+((xd->block[0].bmi.mv.as_mv.col - best_ref_mv.as_mv.col) >> 1)]++;
}
if (!x->skip)
......
......@@ -39,7 +39,7 @@
extern void vp8_build_block_offsets(MACROBLOCK *x);
extern void vp8_setup_block_ptrs(MACROBLOCK *x);
extern void vp8cx_frame_init_quantizer(VP8_COMP *cpi);
extern void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, MV *mv);
extern void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv);
extern void vp8_alloc_compressor_data(VP8_COMP *cpi);
//#define GFQ_ADJUSTMENT (40 + ((15*Q)/10))
......@@ -423,14 +423,17 @@ static void zz_motion_search( VP8_COMP *cpi, MACROBLOCK * x, YV12_BUFFER_CONFIG
VARIANCE_INVOKE(IF_RTCD(&cpi->rtcd.variance), mse16x16) ( src_ptr, src_stride, ref_ptr, ref_stride, (unsigned int *)(best_motion_err));
}
static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x, MV *ref_mv, MV *best_mv, YV12_BUFFER_CONFIG *recon_buffer, int *best_motion_err, int recon_yoffset )
static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x,
int_mv *ref_mv, MV *best_mv,
YV12_BUFFER_CONFIG *recon_buffer,
int *best_motion_err, int recon_yoffset )
{
MACROBLOCKD *const xd = & x->e_mbd;
BLOCK *b = &x->block[0];
BLOCKD *d = &x->e_mbd.block[0];
int num00;
MV tmp_mv = {0, 0};
int_mv tmp_mv;
int tmp_err;
int step_param = 3; //3; // Dont search over full range for first pass
......@@ -446,6 +449,7 @@ static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x, MV *ref_mv, M
xd->pre.y_buffer = recon_buffer->y_buffer + recon_yoffset;
// Initial step/diamond search centred on best mv
tmp_mv.as_int = 0;
tmp_err = cpi->diamond_search_sad(x, b, d, ref_mv, &tmp_mv, step_param, x->errorperbit, &num00, &v_fn_ptr, x->mvcost, ref_mv);
if ( tmp_err < INT_MAX-new_mv_mode_penalty )
tmp_err += new_mv_mode_penalty;
......@@ -453,8 +457,8 @@ static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x, MV *ref_mv, M
if (tmp_err < *best_motion_err)
{
*best_motion_err = tmp_err;
best_mv->row = tmp_mv.row;
best_mv->col = tmp_mv.col;
best_mv->row = tmp_mv.as_mv.row;
best_mv->col = tmp_mv.as_mv.col;
}
// Further step/diamond searches as necessary
......@@ -476,8 +480,8 @@ static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x, MV *ref_mv, M
if (tmp_err < *best_motion_err)
{
*best_motion_err = tmp_err;
best_mv->row = tmp_mv.row;
best_mv->col = tmp_mv.col;
best_mv->row = tmp_mv.as_mv.row;
best_mv->col = tmp_mv.as_mv.col;
}
}
}
......@@ -510,7 +514,9 @@ void vp8_first_pass(VP8_COMP *cpi)
int sum_in_vectors = 0;
MV zero_ref_mv = {0, 0};
int_mv zero_ref_mv;
zero_ref_mv.as_int = 0;
vp8_clear_system_state(); //__asm emms;
......@@ -602,7 +608,7 @@ void vp8_first_pass(VP8_COMP *cpi)
// Test last reference frame using the previous best mv as the
// starting point (best reference) for the search
first_pass_motion_search(cpi, x, &best_ref_mv.as_mv,
first_pass_motion_search(cpi, x, &best_ref_mv,
&d->bmi.mv.as_mv, lst_yv12,
&motion_error, recon_yoffset);
......@@ -666,7 +672,7 @@ void vp8_first_pass(VP8_COMP *cpi)
d->bmi.mv.as_mv.row <<= 3;
d->bmi.mv.as_mv.col <<= 3;
this_error = motion_error;
vp8_set_mbmode_and_mvs(x, NEWMV, &d->bmi.mv.as_mv);
vp8_set_mbmode_and_mvs(x, NEWMV, &d->bmi.mv);
vp8_encode_inter16x16y(IF_RTCD(&cpi->rtcd), x);
sum_mvr += d->bmi.mv.as_mv.row;
sum_mvr_abs += abs(d->bmi.mv.as_mv.row);
......
This diff is collapsed.
......@@ -26,7 +26,7 @@ extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]);
#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) // Maximum size of the first step in full pel units
extern void print_mode_context(void);
extern int vp8_mv_bit_cost(MV *mv, MV *ref, int *mvcost[2], int Weight);
extern int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int Weight);
extern void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride);
extern void vp8_init3smotion_compensation(MACROBLOCK *x, int stride);
......@@ -36,20 +36,21 @@ extern int vp8_hex_search
MACROBLOCK *x,
BLOCK *b,
BLOCKD *d,
MV *ref_mv,
MV *best_mv,
int_mv *ref_mv,
int_mv *best_mv,
int search_param,
int error_per_bit,
int *num00,
const vp8_variance_fn_ptr_t *vf,
int *mvsadcost[2],
int *mvcost[2],
MV *center_mv
int_mv *center_mv
);
typedef int (fractional_mv_step_fp)
(MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *bestmv, MV *ref_mv,
int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2], int *distortion, unsigned int *sse);
(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *bestmv, int_mv *ref_mv,
int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2],
int *distortion, unsigned int *sse);
extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively;
extern fractional_mv_step_fp vp8_find_best_sub_pixel_step;
extern fractional_mv_step_fp vp8_find_best_half_pixel_step;
......@@ -61,12 +62,12 @@ extern fractional_mv_step_fp vp8_skip_fractional_mv_step;
MACROBLOCK *x, \
BLOCK *b, \
BLOCKD *d, \
MV *ref_mv, \
int_mv *ref_mv, \
int error_per_bit, \
int distance, \
vp8_variance_fn_ptr_t *fn_ptr, \
int *mvcost[2], \
MV *center_mv \
int_mv *center_mv \
)
#define prototype_refining_search_sad(sym)\
......@@ -75,12 +76,12 @@ extern fractional_mv_step_fp vp8_skip_fractional_mv_step;
MACROBLOCK *x, \
BLOCK *b, \
BLOCKD *d, \
MV *ref_mv, \
int_mv *ref_mv, \
int error_per_bit, \
int distance, \
vp8_variance_fn_ptr_t *fn_ptr, \
int *mvcost[2], \
MV *center_mv \
int_mv *center_mv \
)
#define prototype_diamond_search_sad(sym)\
......@@ -89,14 +90,14 @@ extern fractional_mv_step_fp vp8_skip_fractional_mv_step;
MACROBLOCK *x, \
BLOCK *b, \
BLOCKD *d, \
MV *ref_mv, \
MV *best_mv, \
int_mv *ref_mv, \
int_mv *best_mv, \
int search_param, \
int error_per_bit, \
int *num00, \
vp8_variance_fn_ptr_t *fn_ptr, \
int *mvcost[2], \
MV *center_mv \
int_mv *center_mv \
)
#if ARCH_X86 || ARCH_X86_64
......
This diff is collapsed.
This diff is collapsed.
......@@ -25,7 +25,7 @@ extern void vp8_mv_pred
VP8_COMP *cpi,
MACROBLOCKD *xd,
const MODE_INFO *here,
MV *mvp,
int_mv *mvp,
int refframe,
int *ref_frame_sign_bias,
int *sr,
......
......@@ -157,7 +157,7 @@ static int vp8_temporal_filter_find_matching_mb_c
BLOCK *b = &x->block[0];
BLOCKD *d = &x->e_mbd.block[0];
MV best_ref_mv1 = {0,0};
int_mv best_ref_mv1;
int *mvcost[2] = { &dummy_cost[mv_max+1], &dummy_cost[mv_max+1] };
int *mvsadcost[2] = { &dummy_cost[mv_max+1], &dummy_cost[mv_max+1] };
......@@ -170,6 +170,8 @@ static int vp8_temporal_filter_find_matching_mb_c
int pre = d->pre;
int pre_stride = d->pre_stride;
best_ref_mv1.as_int = 0;
// Setup frame pointers
b->base_src = &arf_frame->y_buffer;
b->src_stride = arf_frame->y_stride;
......@@ -196,7 +198,7 @@ static int vp8_temporal_filter_find_matching_mb_c
/*cpi->sf.search_method == HEX*/
// TODO Check that the 16x16 vf & sdf are selected here
bestsme = vp8_hex_search(x, b, d,
&best_ref_mv1, &d->bmi.mv.as_mv,
&best_ref_mv1, &d->bmi.mv,
step_param,
sadpb/*x->errorperbit*/,
&num00, &cpi->fn_ptr[BLOCK_16X16],
......@@ -209,7 +211,7 @@ static int vp8_temporal_filter_find_matching_mb_c
int distortion;
unsigned int sse;
bestsme = cpi->find_fractional_mv_step(x, b, d,
&d->bmi.mv.as_mv, &best_ref_mv1,
&d->bmi.mv, &best_ref_mv1,
x->errorperbit, &cpi->fn_ptr[BLOCK_16X16],
mvcost, &distortion, &sse);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment