summaryrefslogtreecommitdiff
path: root/vp8/encoder/pickinter.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/encoder/pickinter.c')
-rw-r--r--vp8/encoder/pickinter.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c
index b60d2419f..fac068f7a 100644
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -588,10 +588,10 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
/* adjust mvp to make sure it is within MV range */
vp8_clamp_mv(&mvp,
- best_ref_mv.as_mv.col - MAX_FULL_PEL_VAL,
- best_ref_mv.as_mv.col + MAX_FULL_PEL_VAL,
- best_ref_mv.as_mv.row - MAX_FULL_PEL_VAL,
- best_ref_mv.as_mv.row + MAX_FULL_PEL_VAL);
+ best_ref_mv.as_mv.col - (MAX_FULL_PEL_VAL<<3),
+ best_ref_mv.as_mv.col + (MAX_FULL_PEL_VAL<<3),
+ best_ref_mv.as_mv.row - (MAX_FULL_PEL_VAL<<3),
+ best_ref_mv.as_mv.row + (MAX_FULL_PEL_VAL<<3));
}
switch (this_mode)
@@ -610,7 +610,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
rate2 += rate;
distortion2 = VARIANCE_INVOKE
(&cpi->rtcd.variance, var16x16)(
- x->src.y_buffer, x->src.y_stride,
+ *(b->base_src), b->src_stride,
x->e_mbd.predictor, 16, &sse);
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
@@ -635,7 +635,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
RECON_INVOKE(&cpi->common.rtcd.recon, build_intra_predictors_mby)
(&x->e_mbd);
distortion2 = VARIANCE_INVOKE(&cpi->rtcd.variance, var16x16)
- (x->src.y_buffer, x->src.y_stride,
+ (*(b->base_src), b->src_stride,
x->e_mbd.predictor, 16, &sse);
rate2 += x->mbmode_cost[x->e_mbd.frame_type][x->e_mbd.mode_info_context->mbmi.mode];
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
@@ -681,10 +681,14 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
mvp.as_int = best_ref_mv.as_int;
}
- col_min = (best_ref_mv.as_mv.col - MAX_FULL_PEL_VAL) >>3;
- col_max = (best_ref_mv.as_mv.col + MAX_FULL_PEL_VAL) >>3;
- row_min = (best_ref_mv.as_mv.row - MAX_FULL_PEL_VAL) >>3;
- row_max = (best_ref_mv.as_mv.row + MAX_FULL_PEL_VAL) >>3;
+ col_min = (best_ref_mv.as_mv.col < 0)?(-((abs(best_ref_mv.as_mv.col))>>3) - MAX_FULL_PEL_VAL)
+ :((best_ref_mv.as_mv.col>>3) - MAX_FULL_PEL_VAL);
+ col_max = (best_ref_mv.as_mv.col < 0)?(-((abs(best_ref_mv.as_mv.col))>>3) + MAX_FULL_PEL_VAL)
+ :((best_ref_mv.as_mv.col>>3) + MAX_FULL_PEL_VAL);
+ row_min = (best_ref_mv.as_mv.row < 0)?(-((abs(best_ref_mv.as_mv.row))>>3) - MAX_FULL_PEL_VAL)
+ :((best_ref_mv.as_mv.row>>3) - MAX_FULL_PEL_VAL);
+ row_max = (best_ref_mv.as_mv.row < 0)?(-((abs(best_ref_mv.as_mv.row))>>3) + MAX_FULL_PEL_VAL)
+ :((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 )
@@ -904,6 +908,7 @@ void vp8_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_)
MB_PREDICTION_MODE mode, best_mode = DC_PRED;
int this_rd;
unsigned int sse;
+ BLOCK *b = &x->block[0];
x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME;
@@ -915,7 +920,7 @@ void vp8_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_)
RECON_INVOKE(&cpi->common.rtcd.recon, build_intra_predictors_mby)
(&x->e_mbd);
distortion = VARIANCE_INVOKE(&cpi->rtcd.variance, var16x16)
- (x->src.y_buffer, x->src.y_stride, x->e_mbd.predictor, 16, &sse);
+ (*(b->base_src), b->src_stride, x->e_mbd.predictor, 16, &sse);
rate = x->mbmode_cost[x->e_mbd.frame_type][mode];
this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion);