Commit d12376aa authored by John Koleszar's avatar John Koleszar

Move dst to per-plane MACROBLOCKD data

First in a series of commits moving the framebuffers pointers to
per-plane data, so that they can be indexed numerically rather than
by name.

Change-Id: I6e0d60fd4d51e6375c384eb7321776564df21775
parent 9ec0f658
......@@ -338,6 +338,11 @@ struct scale_factors {
enum { MAX_MB_PLANE = 3 };
struct buf_2d {
uint8_t *buf;
int stride;
};
struct mb_plane {
DECLARE_ALIGNED(16, int16_t, qcoeff[64 * 64]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[64 * 64]);
......@@ -346,6 +351,8 @@ struct mb_plane {
PLANE_TYPE plane_type;
int subsampling_x;
int subsampling_y;
struct buf_2d dst;
struct buf_2d pre[2];
};
#define BLOCK_OFFSET(x, i, n) ((x) + (i) * (n))
......@@ -366,7 +373,6 @@ typedef struct macroblockd {
YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */
YV12_BUFFER_CONFIG second_pre;
YV12_BUFFER_CONFIG dst;
struct scale_factors scale_factor[2];
struct scale_factors scale_factor_uv[2];
......
......@@ -36,9 +36,9 @@ static void setup_macroblock(MACROBLOCKD *mb, BLOCKSET bs) {
int i, stride;
if (bs == DEST) {
y = &mb->dst.y_buffer;
u = &mb->dst.u_buffer;
v = &mb->dst.v_buffer;
y = &mb->plane[0].dst.buf;
u = &mb->plane[1].dst.buf;
v = &mb->plane[2].dst.buf;
y2 = NULL;
u2 = NULL;
......@@ -54,14 +54,14 @@ static void setup_macroblock(MACROBLOCKD *mb, BLOCKSET bs) {
}
// luma
stride = mb->dst.y_stride;
stride = mb->plane[0].dst.stride;
for (i = 0; i < 16; ++i) {
const int offset = (i >> 2) * 4 * stride + (i & 3) * 4;
setup_block(&blockd[i], y, y2, stride, offset, bs);
}
// chroma
stride = mb->dst.uv_stride;
stride = mb->plane[1].dst.stride;
for (i = 16; i < 20; i++) {
const int offset = ((i - 16) >> 1) * 4 * stride + (i & 1) * 4;
setup_block(&blockd[i], u, u2, stride, offset, bs);
......
......@@ -53,8 +53,8 @@ void vp9_recon2b_c(uint8_t *pred_ptr, int16_t *diff_ptr, uint8_t *dst_ptr,
void vp9_recon_sby_c(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
const int bw = 16 << mb_width_log2(bsize), bh = 16 << mb_height_log2(bsize);
int x, y;
const int stride = mb->dst.y_stride;
uint8_t *dst = mb->dst.y_buffer;
const int stride = mb->plane[0].dst.stride;
uint8_t *dst = mb->plane[0].dst.buf;
const int16_t *diff = mb->plane[0].diff;
for (y = 0; y < bh; y++) {
......@@ -70,9 +70,9 @@ void vp9_recon_sbuv_c(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bhl = mb_height_log2(bsize);
const int bw = 8 << bwl, bh = 8 << bhl;
int x, y;
const int stride = mb->dst.uv_stride;
uint8_t *u_dst = mb->dst.u_buffer;
uint8_t *v_dst = mb->dst.v_buffer;
const int stride = mb->plane[1].dst.stride;
uint8_t *u_dst = mb->plane[1].dst.buf;
uint8_t *v_dst = mb->plane[2].dst.buf;
const int16_t *u_diff = mb->plane[1].diff;
const int16_t *v_diff = mb->plane[2].diff;
......
......@@ -614,11 +614,11 @@ void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd,
void vp9_build_inter_predictors_sb(MACROBLOCKD *xd,
int mb_row, int mb_col,
BLOCK_SIZE_TYPE bsize) {
uint8_t *const y = xd->dst.y_buffer;
uint8_t *const u = xd->dst.u_buffer;
uint8_t *const v = xd->dst.v_buffer;
const int y_stride = xd->dst.y_stride;
const int uv_stride = xd->dst.uv_stride;
uint8_t *const y = xd->plane[0].dst.buf;
uint8_t *const u = xd->plane[1].dst.buf;
uint8_t *const v = xd->plane[2].dst.buf;
const int y_stride = xd->plane[0].dst.stride;
const int uv_stride = xd->plane[1].dst.stride;
vp9_build_inter_predictors_sby(xd, y, y_stride, mb_row, mb_col, bsize);
vp9_build_inter_predictors_sbuv(xd, u, v, uv_stride, mb_row, mb_col, bsize);
......@@ -670,8 +670,8 @@ static void clamp_mv_to_umv_border(MV *mv, const MACROBLOCKD *xd) {
static int64_t get_consistency_metric(MACROBLOCKD *xd,
uint8_t *tmp_y, int tmp_ystride) {
int block_size = 16 << xd->mode_info_context->mbmi.sb_type;
uint8_t *rec_y = xd->dst.y_buffer;
int rec_ystride = xd->dst.y_stride;
uint8_t *rec_y = xd->plane[0].dst.buf;
int rec_ystride = xd->plane[0].dst.stride;
int64_t metric = 0;
int i;
if (xd->up_available) {
......@@ -1182,11 +1182,11 @@ void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd,
void vp9_build_inter_predictors_sb(MACROBLOCKD *mb,
int mb_row, int mb_col,
BLOCK_SIZE_TYPE bsize) {
uint8_t *const y = mb->dst.y_buffer;
uint8_t *const u = mb->dst.u_buffer;
uint8_t *const v = mb->dst.v_buffer;
const int y_stride = mb->dst.y_stride;
const int uv_stride = mb->dst.uv_stride;
uint8_t *const y = mb->plane[0].dst.buf;
uint8_t *const u = mb->plane[1].dst.buf;
uint8_t *const v = mb->plane[2].dst.buf;
const int y_stride = mb->plane[0].dst.stride;
const int uv_stride = mb->plane[1].dst.stride;
vp9_build_inter_predictors_sby(mb, y, y_stride, mb_row, mb_col, bsize);
vp9_build_inter_predictors_sbuv(mb, u, v, uv_stride, mb_row, mb_col, bsize);
......@@ -1233,9 +1233,9 @@ void vp9_build_inter_predictors_mb(MACROBLOCKD *xd,
/*encoder only*/
void vp9_build_inter4x4_predictors_mbuv(MACROBLOCKD *xd,
int mb_row, int mb_col) {
uint8_t *const u = xd->dst.u_buffer;
uint8_t *const v = xd->dst.v_buffer;
const int uv_stride = xd->dst.uv_stride;
uint8_t *const u = xd->plane[1].dst.buf;
uint8_t *const v = xd->plane[2].dst.buf;
const int uv_stride = xd->plane[1].dst.stride;
vp9_build_inter_predictors_sbuv(xd, u, v, uv_stride, mb_row, mb_col,
BLOCK_SIZE_MB16X16);
......
......@@ -83,8 +83,39 @@ static int scaled_buffer_offset(int x_offset,
int y_offset,
int stride,
const struct scale_factors *scale) {
return scale->scale_value_y(y_offset, scale) * stride +
scale->scale_value_x(x_offset, scale);
if (scale)
return scale->scale_value_y(y_offset, scale) * stride +
scale->scale_value_x(x_offset, scale);
return y_offset * stride + x_offset;
}
static void setup_pred_plane(struct buf_2d *dst,
uint8_t *src, int stride,
int mb_row, int mb_col,
const struct scale_factors *scale,
int subsampling_x, int subsampling_y) {
const int x = (16 * mb_col) >> subsampling_x;
const int y = (16 * mb_row) >> subsampling_y;
dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
dst->stride = stride;
}
// TODO(jkoleszar): audit all uses of this that don't set mb_row, mb_col
static void setup_dst_planes(MACROBLOCKD *xd,
const YV12_BUFFER_CONFIG *src,
int mb_row, int mb_col) {
setup_pred_plane(&xd->plane[0].dst,
src->y_buffer, src->y_stride,
mb_row, mb_col, NULL,
xd->plane[0].subsampling_x, xd->plane[0].subsampling_y);
setup_pred_plane(&xd->plane[1].dst,
src->u_buffer, src->uv_stride,
mb_row, mb_col, NULL,
xd->plane[1].subsampling_x, xd->plane[1].subsampling_y);
setup_pred_plane(&xd->plane[2].dst,
src->v_buffer, src->uv_stride,
mb_row, mb_col, NULL,
xd->plane[2].subsampling_x, xd->plane[2].subsampling_y);
}
static void setup_pred_block(YV12_BUFFER_CONFIG *dst,
......
......@@ -609,7 +609,7 @@ void vp9_build_interintra_16x16_predictors_mby(MACROBLOCKD *xd,
int ystride) {
uint8_t intrapredictor[256];
vp9_build_intra_predictors(
xd->dst.y_buffer, xd->dst.y_stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
intrapredictor, 16,
xd->mode_info_context->mbmi.interintra_mode, 16, 16,
xd->up_available, xd->left_available, xd->right_available);
......@@ -624,12 +624,12 @@ void vp9_build_interintra_16x16_predictors_mbuv(MACROBLOCKD *xd,
uint8_t uintrapredictor[64];
uint8_t vintrapredictor[64];
vp9_build_intra_predictors(
xd->dst.u_buffer, xd->dst.uv_stride,
xd->plane[1].dst.buf, xd->plane[1].dst.stride,
uintrapredictor, 8,
xd->mode_info_context->mbmi.interintra_uv_mode, 8, 8,
xd->up_available, xd->left_available, xd->right_available);
vp9_build_intra_predictors(
xd->dst.v_buffer, xd->dst.uv_stride,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
vintrapredictor, 8,
xd->mode_info_context->mbmi.interintra_uv_mode, 8, 8,
xd->up_available, xd->left_available, xd->right_available);
......@@ -644,7 +644,7 @@ void vp9_build_interintra_32x32_predictors_sby(MACROBLOCKD *xd,
int ystride) {
uint8_t intrapredictor[1024];
vp9_build_intra_predictors(
xd->dst.y_buffer, xd->dst.y_stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
intrapredictor, 32,
xd->mode_info_context->mbmi.interintra_mode, 32, 32,
xd->up_available, xd->left_available, xd->right_available);
......@@ -659,12 +659,12 @@ void vp9_build_interintra_32x32_predictors_sbuv(MACROBLOCKD *xd,
uint8_t uintrapredictor[256];
uint8_t vintrapredictor[256];
vp9_build_intra_predictors(
xd->dst.u_buffer, xd->dst.uv_stride,
xd->plane[1].dst.buf, xd->plane[1].dst.stride,
uintrapredictor, 16,
xd->mode_info_context->mbmi.interintra_uv_mode, 16, 16,
xd->up_available, xd->left_available, xd->right_available);
vp9_build_intra_predictors(
xd->dst.v_buffer, xd->dst.uv_stride,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
vintrapredictor, 16,
xd->mode_info_context->mbmi.interintra_uv_mode, 16, 16,
xd->up_available, xd->left_available, xd->right_available);
......@@ -689,7 +689,7 @@ void vp9_build_interintra_64x64_predictors_sby(MACROBLOCKD *xd,
int ystride) {
uint8_t intrapredictor[4096];
const int mode = xd->mode_info_context->mbmi.interintra_mode;
vp9_build_intra_predictors(xd->dst.y_buffer, xd->dst.y_stride,
vp9_build_intra_predictors(xd->plane[0].dst.buf, xd->plane[0].dst.stride,
intrapredictor, 64, mode, 64, 64,
xd->up_available, xd->left_available,
xd->right_available);
......@@ -704,11 +704,11 @@ void vp9_build_interintra_64x64_predictors_sbuv(MACROBLOCKD *xd,
uint8_t uintrapredictor[1024];
uint8_t vintrapredictor[1024];
const int mode = xd->mode_info_context->mbmi.interintra_uv_mode;
vp9_build_intra_predictors(xd->dst.u_buffer, xd->dst.uv_stride,
vp9_build_intra_predictors(xd->plane[1].dst.buf, xd->plane[1].dst.stride,
uintrapredictor, 32, mode, 32, 32,
xd->up_available, xd->left_available,
xd->right_available);
vp9_build_intra_predictors(xd->dst.v_buffer, xd->dst.uv_stride,
vp9_build_intra_predictors(xd->plane[2].dst.buf, xd->plane[1].dst.stride,
vintrapredictor, 32, mode, 32, 32,
xd->up_available, xd->left_available,
xd->right_available);
......@@ -734,8 +734,8 @@ void vp9_build_intra_predictors_sby_s(MACROBLOCKD *xd,
const int bwl = b_width_log2(bsize), bw = 4 << bwl;
const int bhl = b_height_log2(bsize), bh = 4 << bhl;
vp9_build_intra_predictors(xd->dst.y_buffer, xd->dst.y_stride,
xd->dst.y_buffer, xd->dst.y_stride,
vp9_build_intra_predictors(xd->plane[0].dst.buf, xd->plane[0].dst.stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
xd->mode_info_context->mbmi.mode,
bw, bh,
xd->up_available, xd->left_available,
......@@ -747,13 +747,13 @@ void vp9_build_intra_predictors_sbuv_s(MACROBLOCKD *xd,
const int bwl = b_width_log2(bsize) - 1, bw = 4 << bwl;
const int bhl = b_height_log2(bsize) - 1, bh = 4 << bhl;
vp9_build_intra_predictors(xd->dst.u_buffer, xd->dst.uv_stride,
xd->dst.u_buffer, xd->dst.uv_stride,
vp9_build_intra_predictors(xd->plane[1].dst.buf, xd->plane[1].dst.stride,
xd->plane[1].dst.buf, xd->plane[1].dst.stride,
xd->mode_info_context->mbmi.uv_mode,
bw, bh, xd->up_available,
xd->left_available, xd->right_available);
vp9_build_intra_predictors(xd->dst.v_buffer, xd->dst.uv_stride,
xd->dst.v_buffer, xd->dst.uv_stride,
vp9_build_intra_predictors(xd->plane[2].dst.buf, xd->plane[1].dst.stride,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
xd->mode_info_context->mbmi.uv_mode,
bw, bh, xd->up_available,
xd->left_available, xd->right_available);
......
......@@ -35,7 +35,7 @@ static void build_intra_predictors_mbuv_x86(MACROBLOCKD *xd,
build_intra_pred_mbuv_fn_t ho_fn) {
int mode = xd->mode_info_context->mbmi.uv_mode;
build_intra_pred_mbuv_fn_t fn;
int src_stride = xd->dst.uv_stride;
int src_stride = xd->plane[1].dst.stride;
switch (mode) {
case V_PRED:
......@@ -68,34 +68,34 @@ static void build_intra_predictors_mbuv_x86(MACROBLOCKD *xd,
return;
}
fn(dst_u, dst_stride, xd->dst.u_buffer, src_stride);
fn(dst_v, dst_stride, xd->dst.v_buffer, src_stride);
fn(dst_u, dst_stride, xd->plane[1].dst.buf, src_stride);
fn(dst_v, dst_stride, xd->plane[2].dst.buf, src_stride);
}
void vp9_build_intra_predictors_mbuv_sse2(MACROBLOCKD *xd) {
build_intra_predictors_mbuv_x86(xd, xd->dst.u_buffer,
xd->dst.v_buffer, xd->dst.uv_stride,
build_intra_predictors_mbuv_x86(xd, xd->plane[1].dst.buf,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
vp9_intra_pred_uv_tm_sse2,
vp9_intra_pred_uv_ho_mmx2);
}
void vp9_build_intra_predictors_mbuv_ssse3(MACROBLOCKD *xd) {
build_intra_predictors_mbuv_x86(xd, xd->dst.u_buffer,
xd->dst.v_buffer, xd->dst.uv_stride,
build_intra_predictors_mbuv_x86(xd, xd->plane[1].dst.buf,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
vp9_intra_pred_uv_tm_ssse3,
vp9_intra_pred_uv_ho_ssse3);
}
void vp9_build_intra_predictors_mbuv_s_sse2(MACROBLOCKD *xd) {
build_intra_predictors_mbuv_x86(xd, xd->dst.u_buffer,
xd->dst.v_buffer, xd->dst.uv_stride,
build_intra_predictors_mbuv_x86(xd, xd->plane[1].dst.buf,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
vp9_intra_pred_uv_tm_sse2,
vp9_intra_pred_uv_ho_mmx2);
}
void vp9_build_intra_predictors_mbuv_s_ssse3(MACROBLOCKD *xd) {
build_intra_predictors_mbuv_x86(xd, xd->dst.u_buffer,
xd->dst.v_buffer, xd->dst.uv_stride,
build_intra_predictors_mbuv_x86(xd, xd->plane[1].dst.buf,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
vp9_intra_pred_uv_tm_ssse3,
vp9_intra_pred_uv_ho_ssse3);
}
This diff is collapsed.
......@@ -278,7 +278,7 @@ static void build_activity_map(VP9_COMP *cpi) {
// for each macroblock col in image
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {
#if ALT_ACT_MEASURE
xd->dst.y_buffer = new_yv12->y_buffer + recon_yoffset;
xd->plane[0].dst.buf = new_yv12->y_buffer + recon_yoffset;
xd->left_available = (mb_col != 0);
recon_yoffset += 16;
#endif
......@@ -305,8 +305,8 @@ static void build_activity_map(VP9_COMP *cpi) {
#if ALT_ACT_MEASURE
// extend the recon for intra prediction
vp9_extend_mb_row(new_yv12, xd->dst.y_buffer + 16,
xd->dst.u_buffer + 8, xd->dst.v_buffer + 8);
vp9_extend_mb_row(new_yv12, xd->plane[0].dst.buf + 16,
xd->plane[1].dst.buf + 8, xd->plane[2].dst.buf + 8);
#endif
}
......@@ -565,9 +565,7 @@ static void set_offsets(VP9_COMP *cpi,
xd->prev_mode_info_context = cm->prev_mi + idx_str;
// Set up destination pointers
setup_pred_block(&xd->dst,
&cm->yv12_fb[dst_fb_idx],
mb_row, mb_col, NULL, NULL);
setup_dst_planes(xd, &cm->yv12_fb[dst_fb_idx], mb_row, mb_col);
/* Set up limit values for MV components to prevent them from
* extending beyond the UMV borders assuming 16x16 block size */
......@@ -1244,7 +1242,7 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
// Copy data over into macro block data structures.
x->src = *cpi->Source;
xd->pre = cm->yv12_fb[cm->ref_frame_map[cpi->lst_fb_idx]];
xd->dst = cm->yv12_fb[cm->new_fb_idx];
setup_dst_planes(xd, &cm->yv12_fb[cm->new_fb_idx], 0, 0);
// set up frame for intra coded blocks
vp9_setup_intra_recon(&cm->yv12_fb[cm->new_fb_idx]);
......@@ -2131,11 +2129,11 @@ static void encode_macroblock(VP9_COMP *cpi, TOKENEXTRA **t,
#if CONFIG_COMP_INTERINTRA_PRED
if (xd->mode_info_context->mbmi.second_ref_frame == INTRA_FRAME) {
vp9_build_interintra_16x16_predictors_mb(xd,
xd->dst.y_buffer,
xd->dst.u_buffer,
xd->dst.v_buffer,
xd->dst.y_stride,
xd->dst.uv_stride);
xd->plane[0].dst.buf,
xd->plane[1].dst.buf,
xd->plane[2].dst.buf,
xd->plane[0].dst.stride,
xd->plane[1].dst.stride);
}
#endif
}
......@@ -2173,21 +2171,21 @@ static void encode_macroblock(VP9_COMP *cpi, TOKENEXTRA **t,
printf("final y\n");
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++)
printf("%3d ", xd->dst.y_buffer[i * xd->dst.y_stride + j]);
printf("%3d ", xd->plane[0].dst.buf[i * xd->plane[0].dst.stride + j]);
printf("\n");
}
printf("\n");
printf("final u\n");
for (i = 0; i < 8; i++) {
for (j = 0; j < 8; j++)
printf("%3d ", xd->dst.u_buffer[i * xd->dst.uv_stride + j]);
printf("%3d ", xd->plane[1].dst.buf[i * xd->plane[1].dst.stride + j]);
printf("\n");
}
printf("\n");
printf("final v\n");
for (i = 0; i < 8; i++) {
for (j = 0; j < 8; j++)
printf("%3d ", xd->dst.v_buffer[i * xd->dst.uv_stride + j]);
printf("%3d ", xd->plane[2].dst.buf[i * xd->plane[1].dst.stride + j]);
printf("\n");
}
fflush(stdout);
......@@ -2245,13 +2243,13 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t,
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *src = x->src.y_buffer;
uint8_t *dst = xd->dst.y_buffer;
uint8_t *dst = xd->plane[0].dst.buf;
const uint8_t *usrc = x->src.u_buffer;
uint8_t *udst = xd->dst.u_buffer;
uint8_t *udst = xd->plane[1].dst.buf;
const uint8_t *vsrc = x->src.v_buffer;
uint8_t *vdst = xd->dst.v_buffer;
int src_y_stride = x->src.y_stride, dst_y_stride = xd->dst.y_stride;
int src_uv_stride = x->src.uv_stride, dst_uv_stride = xd->dst.uv_stride;
uint8_t *vdst = xd->plane[2].dst.buf;
int src_y_stride = x->src.y_stride, dst_y_stride = xd->plane[0].dst.stride;
int src_uv_stride = x->src.uv_stride, dst_uv_stride = xd->plane[1].dst.stride;
int n;
MODE_INFO *mi = x->e_mbd.mode_info_context;
unsigned int segment_id = mi->mbmi.segment_id;
......
......@@ -88,7 +88,7 @@ void vp9_encode_intra16x16mby(VP9_COMMON *const cm, MACROBLOCK *x) {
vp9_build_intra_predictors_sby_s(xd, BLOCK_SIZE_MB16X16);
vp9_subtract_sby_s_c(x->src_diff,
x->src.y_buffer, x->src.y_stride,
xd->dst.y_buffer, xd->dst.y_stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
BLOCK_SIZE_MB16X16);
switch (tx_size) {
......@@ -125,7 +125,8 @@ void vp9_encode_intra16x16mbuv(VP9_COMMON *const cm, MACROBLOCK *x) {
vp9_build_intra_predictors_sbuv_s(xd, BLOCK_SIZE_MB16X16);
vp9_subtract_sbuv_s_c(x->src_diff,
x->src.u_buffer, x->src.v_buffer, x->src.uv_stride,
xd->dst.u_buffer, xd->dst.v_buffer, xd->dst.uv_stride,
xd->plane[1].dst.buf, xd->plane[2].dst.buf,
xd->plane[1].dst.stride,
BLOCK_SIZE_MB16X16);
switch (tx_size) {
......
......@@ -107,11 +107,12 @@ void vp9_subtract_sbuv_s_c(int16_t *diff, const uint8_t *usrc,
static void subtract_mb(MACROBLOCK *x) {
MACROBLOCKD *xd = &x->e_mbd;
vp9_subtract_sby_s_c(x->src_diff, x->src.y_buffer, x->src.y_stride,
xd->dst.y_buffer, xd->dst.y_stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
BLOCK_SIZE_MB16X16);
vp9_subtract_sbuv_s_c(x->src_diff, x->src.u_buffer, x->src.v_buffer,
x->src.uv_stride,
xd->dst.u_buffer, xd->dst.v_buffer, xd->dst.uv_stride,
xd->plane[1].dst.buf, xd->plane[2].dst.buf,
xd->plane[1].dst.stride,
BLOCK_SIZE_MB16X16);
}
......@@ -913,10 +914,11 @@ void vp9_encode_inter16x16(VP9_COMMON *const cm, MACROBLOCK *x,
void vp9_encode_inter16x16y(MACROBLOCK *x, int mb_row, int mb_col) {
MACROBLOCKD *xd = &x->e_mbd;
vp9_build_inter_predictors_sby(xd, xd->dst.y_buffer, xd->dst.y_stride,
vp9_build_inter_predictors_sby(xd, xd->plane[0].dst.buf,
xd->plane[0].dst.stride,
mb_row, mb_col, BLOCK_SIZE_MB16X16);
vp9_subtract_sby_s_c(x->src_diff, x->src.y_buffer, x->src.y_stride,
xd->dst.y_buffer, xd->dst.y_stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
BLOCK_SIZE_MB16X16);
vp9_transform_sby_4x4(x, BLOCK_SIZE_MB16X16);
......
......@@ -32,6 +32,8 @@
#include "vp9/common/vp9_entropymv.h"
#include "vp9/encoder/vp9_encodemv.h"
#include "./vpx_scale_rtcd.h"
// TODO(jkoleszar): for setup_dst_planes
#include "vp9/common/vp9_reconinter.h"
#define OUTPUT_FPF 0
......@@ -484,7 +486,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
x->src = * cpi->Source;
xd->pre = *lst_yv12;
xd->dst = *new_yv12;
setup_dst_planes(xd, new_yv12, 0, 0);
x->partition_info = x->pi;
......@@ -533,9 +535,9 @@ void vp9_first_pass(VP9_COMP *cpi) {
int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row);
set_mb_col(cm, xd, mb_col, 1 << mb_height_log2(BLOCK_SIZE_MB16X16));
xd->dst.y_buffer = new_yv12->y_buffer + recon_yoffset;
xd->dst.u_buffer = new_yv12->u_buffer + recon_uvoffset;
xd->dst.v_buffer = new_yv12->v_buffer + recon_uvoffset;
xd->plane[0].dst.buf = new_yv12->y_buffer + recon_yoffset;
xd->plane[1].dst.buf = new_yv12->u_buffer + recon_uvoffset;
xd->plane[2].dst.buf = new_yv12->v_buffer + recon_uvoffset;
xd->left_available = (mb_col != 0);
// do intra 16x16 prediction
......@@ -700,8 +702,8 @@ void vp9_first_pass(VP9_COMP *cpi) {
x->src.v_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols;
// extend the recon for intra prediction
vp9_extend_mb_row(new_yv12, xd->dst.y_buffer + 16,
xd->dst.u_buffer + 8, xd->dst.v_buffer + 8);
vp9_extend_mb_row(new_yv12, xd->plane[0].dst.buf + 16,
xd->plane[1].dst.buf + 8, xd->plane[2].dst.buf + 8);
vp9_clear_system_state(); // __asm emms;
}
......
......@@ -71,10 +71,12 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
}
vp9_set_mbmode_and_mvs(x, NEWMV, dst_mv);
vp9_build_inter_predictors_sby(xd, xd->dst.y_buffer, xd->dst.y_stride,
vp9_build_inter_predictors_sby(xd, xd->plane[0].dst.buf,
xd->plane[0].dst.stride,
mb_row, mb_col, BLOCK_SIZE_MB16X16);
best_err = vp9_sad16x16(x->src.y_buffer, x->src.y_stride,
xd->dst.y_buffer, xd->dst.y_stride, INT_MAX);
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
INT_MAX);
/* restore UMV window */
x->mv_col_min = tmp_col_min;
......@@ -189,13 +191,13 @@ static int find_best_16x16_intra
xd->mode_info_context->mbmi.mode = mode;
vp9_build_intra_predictors(x->src.y_buffer, x->src.y_stride,
xd->dst.y_buffer, xd->dst.y_stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
xd->mode_info_context->mbmi.mode,
bw, bh,
xd->up_available, xd->left_available,
xd->right_available);
err = vp9_sad16x16(x->src.y_buffer, x->src.y_stride,
xd->dst.y_buffer, xd->dst.y_stride, best_err);
xd->plane[0].dst.buf, xd->plane[0].dst.stride, best_err);
// find best
if (err < best_err) {
......@@ -234,8 +236,8 @@ static void update_mbgraph_mb_stats
x->src.y_buffer = buf->y_buffer + mb_y_offset;
x->src.y_stride = buf->y_stride;
xd->dst.y_buffer = cm->yv12_fb[cm->new_fb_idx].y_buffer + mb_y_offset;
xd->dst.y_stride = cm->yv12_fb[cm->new_fb_idx].y_stride;
xd->plane[0].dst.buf = cm->yv12_fb[cm->new_fb_idx].y_buffer + mb_y_offset;
xd->plane[0].dst.stride = cm->yv12_fb[cm->new_fb_idx].y_stride;
// do intra 16x16 prediction
intra_error = find_best_16x16_intra(cpi, buf, mb_y_offset,
......@@ -303,9 +305,9 @@ static void update_mbgraph_frame_stats
x->mv_row_max = (cm->mb_rows - 1) * 16 + VP9BORDERINPIXELS
- 16 - VP9_INTERP_EXTEND;
xd->up_available = 0;
xd->dst.y_stride = buf->y_stride;
xd->plane[0].dst.stride = buf->y_stride;
xd->pre.y_stride = buf->y_stride;
xd->dst.uv_stride = buf->uv_stride;
xd->plane[1].dst.stride = buf->uv_stride;
xd->mode_info_context = &mi_local;
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) {
......
This diff is collapsed.
Markdown is supported
0% or