ref: 25b77e2569d2984107ed5f864b04328fbb477f1a
parent: 5d86f3886d7d2edda7fd80faf6e735ea3a796ae6
author: Dmitry Kovalev <dkovalev@google.com>
date: Fri Aug 2 11:26:32 EDT 2013
Changing function arg type from int_mv* to MV*. Change-Id: Ic878d31df2ce783a2c9a8c4bc9ed301ec8ffe25e
--- a/vp9/common/vp9_reconinter.c
+++ b/vp9/common/vp9_reconinter.c
@@ -197,14 +197,14 @@
void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
- const int_mv *src_mv,
+ const MV *src_mv,
const struct scale_factors *scale,
int w, int h, int weight,
const struct subpix_fn_table *subpix,
enum mv_precision precision) {
const MV32 mv = precision == MV_PRECISION_Q4
- ? scale->scale_mv_q4(&src_mv->as_mv, scale)
- : scale->scale_mv_q3_to_q4(&src_mv->as_mv, scale);
+ ? scale->scale_mv_q4(src_mv, scale)
+ : scale->scale_mv_q3_to_q4(src_mv, scale);
const int subpel_x = mv.col & 15;
const int subpel_y = mv.row & 15;
@@ -336,7 +336,7 @@
vp9_build_inter_predictor(pre, pre_stride,
dst, arg->dst_stride[plane],
- &clamped_mv, &xd->scale_factor[which_mv],
+ &clamped_mv.as_mv, &xd->scale_factor[which_mv],
4 << pred_w, 4 << pred_h, which_mv,
&xd->subpix, MV_PRECISION_Q4);
}
--- a/vp9/common/vp9_reconinter.h
+++ b/vp9/common/vp9_reconinter.h
@@ -39,7 +39,7 @@
void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
- const int_mv *mv_q3,
+ const MV *mv_q3,
const struct scale_factors *scale,
int w, int h, int do_avg,
const struct subpix_fn_table *subpix,
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1670,9 +1670,11 @@
ENTROPY_CONTEXT *tl) {
int k;
MACROBLOCKD *xd = &x->e_mbd;
- BLOCK_SIZE_TYPE bsize = xd->mode_info_context->mbmi.sb_type;
- const int width = plane_block_width(bsize, &xd->plane[0]);
- const int height = plane_block_height(bsize, &xd->plane[0]);
+ struct macroblockd_plane *const pd = &xd->plane[0];
+ MODE_INFO *const mi = xd->mode_info_context;
+ const BLOCK_SIZE_TYPE bsize = mi->mbmi.sb_type;
+ const int width = plane_block_width(bsize, pd);
+ const int height = plane_block_height(bsize, pd);
int idx, idy;
const int src_stride = x->plane[0].src.stride;
uint8_t* const src = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, i,
@@ -1682,39 +1684,33 @@
x->plane[0].src_diff);
int16_t* coeff = BLOCK_OFFSET(x->plane[0].coeff, 16, i);
uint8_t* const pre = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, i,
- xd->plane[0].pre[0].buf,
- xd->plane[0].pre[0].stride);
+ pd->pre[0].buf,
+ pd->pre[0].stride);
uint8_t* const dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, i,
- xd->plane[0].dst.buf,
- xd->plane[0].dst.stride);
+ pd->dst.buf,
+ pd->dst.stride);
int64_t thisdistortion = 0, thissse = 0;
int thisrate = 0;
- vp9_build_inter_predictor(pre,
- xd->plane[0].pre[0].stride,
- dst,
- xd->plane[0].dst.stride,
- &xd->mode_info_context->bmi[i].as_mv[0],
+ vp9_build_inter_predictor(pre, pd->pre[0].stride,
+ dst, pd->dst.stride,
+ &mi->bmi[i].as_mv[0].as_mv,
&xd->scale_factor[0],
- width, height, 0, &xd->subpix,
- MV_PRECISION_Q3);
+ width, height, 0, &xd->subpix, MV_PRECISION_Q3);
- if (xd->mode_info_context->mbmi.ref_frame[1] > 0) {
+ if (mi->mbmi.ref_frame[1] > 0) {
uint8_t* const second_pre =
raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, i,
- xd->plane[0].pre[1].buf,
- xd->plane[0].pre[1].stride);
- vp9_build_inter_predictor(second_pre, xd->plane[0].pre[1].stride,
- dst, xd->plane[0].dst.stride,
- &xd->mode_info_context->bmi[i].as_mv[1],
+ pd->pre[1].buf, pd->pre[1].stride);
+ vp9_build_inter_predictor(second_pre, pd->pre[1].stride,
+ dst, pd->dst.stride,
+ &mi->bmi[i].as_mv[1].as_mv,
&xd->scale_factor[1],
- width, height, 1,
- &xd->subpix, MV_PRECISION_Q3);
+ width, height, 1, &xd->subpix, MV_PRECISION_Q3);
}
- vp9_subtract_block(height, width, src_diff, 8,
- src, src_stride,
- dst, xd->plane[0].dst.stride);
+ vp9_subtract_block(height, width, src_diff, 8, src, src_stride,
+ dst, pd->dst.stride);
k = i;
for (idy = 0; idy < height / 4; ++idy) {
@@ -1727,9 +1723,8 @@
coeff = BLOCK_OFFSET(x->plane[0].coeff, 16, k);
x->fwd_txm4x4(src_diff, coeff, 16);
x->quantize_b_4x4(x, k, DCT_DCT, 16);
- thisdistortion += vp9_block_error(coeff,
- BLOCK_OFFSET(xd->plane[0].dqcoeff,
- k, 16), 16, &ssz);
+ thisdistortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, k, 16),
+ 16, &ssz);
thissse += ssz;
thisrate += cost_coeffs(x, 0, k, PLANE_TYPE_Y_WITH_DC,
ta + (k & 1),
@@ -2653,7 +2648,7 @@
vp9_build_inter_predictor(ref_yv12[!id].buf,
ref_yv12[!id].stride,
second_pred, pw,
- &frame_mv[refs[!id]],
+ &frame_mv[refs[!id]].as_mv,
&xd->scale_factor[!id],
pw, ph, 0,
&xd->subpix, MV_PRECISION_Q3);
--- a/vp9/encoder/vp9_temporal_filter.c
+++ b/vp9/encoder/vp9_temporal_filter.c
@@ -40,10 +40,7 @@
int mv_col,
uint8_t *pred) {
const int which_mv = 0;
- int_mv mv;
-
- mv.as_mv.row = mv_row;
- mv.as_mv.col = mv_col;
+ MV mv = { mv_row, mv_col };
vp9_build_inter_predictor(y_mb_ptr, stride,
&pred[0], 16,
--
⑨