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);
}
......@@ -250,15 +250,15 @@ static void decode_16x16(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_16x16(xd, 0);
vp9_dequant_iht_add_16x16_c(tx_type, xd->plane[0].qcoeff,
xd->block[0].dequant, xd->dst.y_buffer,
xd->dst.y_stride, xd->plane[0].eobs[0]);
xd->block[0].dequant, xd->plane[0].dst.buf,
xd->plane[0].dst.stride, xd->plane[0].eobs[0]);
vp9_dequant_idct_add_8x8(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->dst.u_buffer, xd->dst.uv_stride,
xd->plane[1].dst.buf, xd->plane[1].dst.stride,
xd->plane[1].eobs[0]);
vp9_dequant_idct_add_8x8(xd->plane[2].qcoeff, xd->block[20].dequant,
xd->dst.v_buffer, xd->dst.uv_stride,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
xd->plane[2].eobs[0]);
}
......@@ -275,7 +275,7 @@ static void decode_8x8(MACROBLOCKD *xd) {
int16_t *q = BLOCK_OFFSET(xd->plane[0].qcoeff, idx, 16);
int16_t *dq = xd->block[0].dequant;
uint8_t *dst = *(xd->block[ib].base_dst) + xd->block[ib].dst;
int stride = xd->dst.y_stride;
int stride = xd->plane[0].dst.stride;
if (mode == I8X8_PRED) {
BLOCKD *b = &xd->block[ib];
int i8x8mode = b->bmi.as_mode.first;
......@@ -287,8 +287,8 @@ static void decode_8x8(MACROBLOCKD *xd) {
}
} else {
vp9_dequant_idct_add_y_block_8x8(xd->plane[0].qcoeff,
xd->block[0].dequant, xd->dst.y_buffer,
xd->dst.y_stride, xd);
xd->block[0].dequant, xd->plane[0].dst.buf,
xd->plane[0].dst.stride, xd);
}
// chroma
......@@ -315,16 +315,16 @@ static void decode_8x8(MACROBLOCKD *xd) {
}
} else if (mode == SPLITMV) {
xd->itxm_add_uv_block(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->dst.u_buffer, xd->dst.uv_stride, xd->plane[1].eobs);
xd->plane[1].dst.buf, xd->plane[1].dst.stride, xd->plane[1].eobs);
xd->itxm_add_uv_block(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->dst.v_buffer, xd->dst.uv_stride, xd->plane[2].eobs);
xd->plane[2].dst.buf, xd->plane[1].dst.stride, xd->plane[2].eobs);
} else {
vp9_dequant_idct_add_8x8(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->dst.u_buffer, xd->dst.uv_stride,
xd->plane[1].dst.buf, xd->plane[1].dst.stride,
xd->plane[1].eobs[0]);
vp9_dequant_idct_add_8x8(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->dst.v_buffer, xd->dst.uv_stride,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
xd->plane[2].eobs[0]);
}
}
......@@ -396,27 +396,27 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd, vp9_reader *r) {
#endif
vp9_build_intra_predictors_sbuv_s(xd, BLOCK_SIZE_MB16X16);
xd->itxm_add_uv_block(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->dst.u_buffer, xd->dst.uv_stride, xd->plane[1].eobs);
xd->plane[1].dst.buf, xd->plane[1].dst.stride, xd->plane[1].eobs);
xd->itxm_add_uv_block(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->dst.v_buffer, xd->dst.uv_stride, xd->plane[2].eobs);
xd->plane[2].dst.buf, xd->plane[1].dst.stride, xd->plane[2].eobs);
} else if (mode == SPLITMV || get_tx_type_4x4(xd, 0) == DCT_DCT) {
xd->itxm_add_y_block(xd->plane[0].qcoeff,
xd->block[0].dequant,
xd->dst.y_buffer, xd->dst.y_stride, xd);
xd->plane[0].dst.buf, xd->plane[0].dst.stride, xd);
xd->itxm_add_uv_block(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->dst.u_buffer, xd->dst.uv_stride, xd->plane[1].eobs);
xd->plane[1].dst.buf, xd->plane[1].dst.stride, xd->plane[1].eobs);
xd->itxm_add_uv_block(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->dst.v_buffer, xd->dst.uv_stride, xd->plane[2].eobs);
xd->plane[2].dst.buf, xd->plane[1].dst.stride, xd->plane[2].eobs);
} else {
for (i = 0; i < 16; i++) {
tx_type = get_tx_type_4x4(xd, i);
dequant_add_y(xd, tx_type, i);
}
xd->itxm_add_uv_block(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->dst.u_buffer, xd->dst.uv_stride,
xd->plane[1].dst.buf, xd->plane[1].dst.stride,
xd->plane[1].eobs);
xd->itxm_add_uv_block(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->dst.v_buffer, xd->dst.uv_stride,
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
xd->plane[2].eobs);
}
}
......@@ -430,10 +430,11 @@ static INLINE void decode_sby_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
for (n = 0; n < y_count; n++) {
const int x_idx = n & (bw - 1);
const int y_idx = n >> bwl;
const int y_offset = (y_idx * 32) * mb->dst.y_stride + (x_idx * 32);
const int y_offset = (y_idx * 32) * mb->plane[0].dst.stride + (x_idx * 32);
vp9_dequant_idct_add_32x32(BLOCK_OFFSET(mb->plane[0].qcoeff, n, 1024),
mb->block[0].dequant ,
mb->dst.y_buffer + y_offset, mb->dst.y_stride,
mb->plane[0].dst.buf + y_offset,
mb->plane[0].dst.stride,
mb->plane[0].eobs[n * 64]);
}
}
......@@ -446,15 +447,18 @@ static INLINE void decode_sbuv_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
for (n = 0; n < uv_count; n++) {
const int x_idx = n & (bw - 1);
const int y_idx = n >> (bwl - 1);
const int uv_offset = (y_idx * 32) * mb->dst.uv_stride + (x_idx * 32);
const int uv_offset = (y_idx * 32) * mb->plane[1].dst.stride +
(x_idx * 32);
vp9_dequant_idct_add_32x32(BLOCK_OFFSET(mb->plane[1].qcoeff, n, 1024),
mb->block[16].dequant,
mb->dst.u_buffer + uv_offset,
mb->dst.uv_stride, mb->plane[1].eobs[n * 64]);
mb->plane[1].dst.buf + uv_offset,
mb->plane[1].dst.stride,
mb->plane[1].eobs[n * 64]);
vp9_dequant_idct_add_32x32(BLOCK_OFFSET(mb->plane[2].qcoeff, n, 1024),
mb->block[20].dequant,
mb->dst.v_buffer + uv_offset,
mb->dst.uv_stride, mb->plane[2].eobs[n * 64]);
mb->plane[2].dst.buf + uv_offset,
mb->plane[1].dst.stride,
mb->plane[2].eobs[n * 64]);
}
}
......@@ -467,14 +471,14 @@ static INLINE void decode_sby_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
for (n = 0; n < y_count; n++) {
const int x_idx = n & (bw - 1);
const int y_idx = n >> bwl;
const int y_offset = (y_idx * 16) * mb->dst.y_stride + (x_idx * 16);
const int y_offset = (y_idx * 16) * mb->plane[0].dst.stride + (x_idx * 16);
const TX_TYPE tx_type = get_tx_type_16x16(mb,
(y_idx * (4 * bw) + x_idx) * 4);
vp9_dequant_iht_add_16x16_c(tx_type,
BLOCK_OFFSET(mb->plane[0].qcoeff, n, 256),
mb->block[0].dequant,
mb->dst.y_buffer + y_offset,
mb->dst.y_stride,
mb->plane[0].dst.buf + y_offset,
mb->plane[0].dst.stride,
mb->plane[0].eobs[n * 16]);
}
}
......@@ -490,14 +494,16 @@ static INLINE void decode_sbuv_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
for (n = 0; n < uv_count; n++) {
const int x_idx = n & (bw - 1);
const int y_idx = n >> (bwl - 1);
const int uv_offset = (y_idx * 16) * mb->dst.uv_stride + (x_idx * 16);
const int uv_offset = (y_idx * 16) * mb->plane[1].dst.stride + (x_idx * 16);
vp9_dequant_idct_add_16x16(BLOCK_OFFSET(mb->plane[1].qcoeff, n, 256),
mb->block[16].dequant,
mb->dst.u_buffer + uv_offset, mb->dst.uv_stride,
mb->plane[1].dst.buf + uv_offset,
mb->plane[1].dst.stride,
mb->plane[1].eobs[n * 16]);
vp9_dequant_idct_add_16x16(BLOCK_OFFSET(mb->plane[2].qcoeff, n, 256),
mb->block[20].dequant,
mb->dst.v_buffer + uv_offset, mb->dst.uv_stride,
mb->plane[2].dst.buf + uv_offset,
mb->plane[1].dst.stride,
mb->plane[2].eobs[n * 16]);
}
}
......@@ -512,14 +518,15 @@ static INLINE void decode_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
for (n = 0; n < y_count; n++) {
const int x_idx = n & (bw - 1);
const int y_idx = n >> bwl;
const int y_offset = (y_idx * 8) * xd->dst.y_stride + (x_idx * 8);
const int y_offset = (y_idx * 8) * xd->plane[0].dst.stride + (x_idx * 8);
const TX_TYPE tx_type = get_tx_type_8x8(xd,
(y_idx * (2 * bw) + x_idx) * 2);
vp9_dequant_iht_add_8x8_c(tx_type,
BLOCK_OFFSET(xd->plane[0].qcoeff, n, 64),
xd->block[0].dequant,
xd->dst.y_buffer + y_offset, xd->dst.y_stride,
xd->plane[0].dst.buf + y_offset,
xd->plane[0].dst.stride,
xd->plane[0].eobs[n * 4]);
}
}
......@@ -534,14 +541,16 @@ static INLINE void decode_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
for (n = 0; n < uv_count; n++) {
const int x_idx = n & (bw - 1);
const int y_idx = n >> (bwl - 1);
const int uv_offset = (y_idx * 8) * xd->dst.uv_stride + (x_idx * 8);
const int uv_offset = (y_idx * 8) * xd->plane[1].dst.stride + (x_idx * 8);
vp9_dequant_idct_add_8x8(BLOCK_OFFSET(xd->plane[1].qcoeff, n, 64),
xd->block[16].dequant,
xd->dst.u_buffer + uv_offset, xd->dst.uv_stride,
xd->plane[1].dst.buf + uv_offset,
xd->plane[1].dst.stride,
xd->plane[1].eobs[n * 4]);
vp9_dequant_idct_add_8x8(BLOCK_OFFSET(xd->plane[2].qcoeff, n, 64),
xd->block[20].dequant,
xd->dst.v_buffer + uv_offset, xd->dst.uv_stride,
xd->plane[2].dst.buf + uv_offset,
xd->plane[1].dst.stride,
xd->plane[2].eobs[n * 4]);
}
}
......@@ -555,18 +564,19 @@ static INLINE void decode_sby_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
for (n = 0; n < y_count; n++) {
const int x_idx = n & (bw - 1);
const int y_idx = n >> bwl;
const int y_offset = (y_idx * 4) * xd->dst.y_stride + (x_idx * 4);
const int y_offset = (y_idx * 4) * xd->plane[0].dst.stride + (x_idx * 4);
const TX_TYPE tx_type = get_tx_type_4x4(xd, n);
if (tx_type == DCT_DCT) {
xd->itxm_add(BLOCK_OFFSET(xd->plane[0].qcoeff, n, 16),
xd->block[0].dequant,
xd->dst.y_buffer + y_offset, xd->dst.y_stride,
xd->plane[0].dst.buf + y_offset, xd->plane[0].dst.stride,
xd->plane[0].eobs[n]);
} else {
vp9_dequant_iht_add_c(tx_type,
BLOCK_OFFSET(xd->plane[0].qcoeff, n, 16),
xd->block[0].dequant, xd->dst.y_buffer + y_offset,
xd->dst.y_stride, xd->plane[0].eobs[n]);
xd->block[0].dequant,
xd->plane[0].dst.buf