Commit ac22bb6f authored by John Koleszar's avatar John Koleszar Committed by Gerrit Code Review
Browse files

Merge changes I7ff2fa72,I7907230d into experimental

* changes:
  Remove BLOCKD structure
  Remove destination pointers from BLOCKD
parents 80fadb26 bb41ab4a
......@@ -278,14 +278,6 @@ typedef struct {
union b_mode_info bmi[16];
} MODE_INFO;
typedef struct blockd {
uint8_t **base_dst;
int dst;
int dst_stride;
// union b_mode_info bmi;
} BLOCKD;
struct scale_factors {
int x_num;
int x_den;
......@@ -339,9 +331,6 @@ struct macroblockd_plane {
typedef struct macroblockd {
struct macroblockd_plane plane[MAX_MB_PLANE];
/* 16 Y blocks, 4 U, 4 V, each with 16 entries. */
BLOCKD block[24];
struct scale_factors scale_factor[2];
struct scale_factors scale_factor_uv[2];
......@@ -743,7 +732,6 @@ static TX_TYPE get_tx_type_16x16(const MACROBLOCKD *xd, int ib) {
return tx_type;
}
void vp9_build_block_doffsets(MACROBLOCKD *xd);
void vp9_setup_block_dptrs(MACROBLOCKD *xd);
static TX_SIZE get_uv_tx_size(const MACROBLOCKD *xd) {
......
......@@ -11,51 +11,6 @@
#include "vp9/common/vp9_blockd.h"
typedef enum {
PRED = 0,
DEST = 1
} BLOCKSET;
static void setup_block(BLOCKD *b, uint8_t **base, uint8_t **base2,
int stride, int offset, BLOCKSET bs) {
if (bs == DEST) {
b->dst_stride = stride;
b->dst = offset;
b->base_dst = base;
}
}
static void setup_macroblock(MACROBLOCKD *mb, BLOCKSET bs) {
BLOCKD *blockd = mb->block;
uint8_t **y, **u, **v, **y2, **u2, **v2;
int i, stride;
if (bs == DEST) {
y = &mb->plane[0].dst.buf;
u = &mb->plane[1].dst.buf;
v = &mb->plane[2].dst.buf;
y2 = NULL;
u2 = NULL;
v2 = NULL;
}
// luma
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->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);
setup_block(&blockd[i + 4], v, v2, stride, offset, bs);
}
}
void vp9_setup_block_dptrs(MACROBLOCKD *mb) {
int i;
......@@ -65,8 +20,3 @@ void vp9_setup_block_dptrs(MACROBLOCKD *mb) {
mb->plane[i].subsampling_y = !!i;
}
}
void vp9_build_block_doffsets(MACROBLOCKD *mb) {
// handle the destination pitch features
setup_macroblock(mb, DEST);
}
......@@ -611,37 +611,31 @@ void vp9_build_intra_predictors_sbuv_s(MACROBLOCKD *xd,
}
void vp9_intra8x8_predict(MACROBLOCKD *xd,
BLOCKD *b,
int block4x4_idx,
int mode,
uint8_t *predictor, int pre_stride) {
const int block4x4_idx = (b - xd->block);
const int block_idx = (block4x4_idx >> 2) | !!(block4x4_idx & 2);
const int have_top = (block_idx >> 1) || xd->up_available;
const int have_left = (block_idx & 1) || xd->left_available;
const int have_right = !(block_idx & 1) || xd->right_available;
vp9_build_intra_predictors(*(b->base_dst) + b->dst,
b->dst_stride, predictor, pre_stride,
vp9_build_intra_predictors(predictor, pre_stride,
predictor, pre_stride,
mode, 8, 8, have_top, have_left,
have_right);
}
void vp9_intra_uv4x4_predict(MACROBLOCKD *xd,
BLOCKD *b,
int block4x4_idx,
int mode,
uint8_t *predictor, int pre_stride) {
const int block_idx = (b - xd->block) & 3;
const int block_idx = block4x4_idx & 3;
const int have_top = (block_idx >> 1) || xd->up_available;
const int have_left = (block_idx & 1) || xd->left_available;
const int have_right = !(block_idx & 1) || xd->right_available;
vp9_build_intra_predictors(*(b->base_dst) + b->dst,
b->dst_stride, predictor, pre_stride,
vp9_build_intra_predictors(predictor, pre_stride,
predictor, pre_stride,
mode, 4, 4, have_top, have_left,
have_right);
}
/* TODO: try different ways of use Y-UV mode correlation
Current code assumes that a uv 4x4 block use same mode
as corresponding Y 8x8 area
*/
......@@ -18,7 +18,8 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
int stride, int n,
int tx, int ty);
B_PREDICTION_MODE vp9_find_bpred_context(MACROBLOCKD *xd, BLOCKD *x);
B_PREDICTION_MODE vp9_find_bpred_context(MACROBLOCKD *xd, int block,
uint8_t *ptr, int stride);
#if CONFIG_COMP_INTERINTRA_PRED
void vp9_build_interintra_predictors(MACROBLOCKD *xd,
......
......@@ -147,12 +147,10 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
}
#endif
B_PREDICTION_MODE vp9_find_bpred_context(MACROBLOCKD *xd, BLOCKD *x) {
const int block_idx = x - xd->block;
B_PREDICTION_MODE vp9_find_bpred_context(MACROBLOCKD *xd, int block_idx,
uint8_t *ptr, int stride) {
const int have_top = (block_idx >> 2) || xd->up_available;
const int have_left = (block_idx & 3) || xd->left_available;
uint8_t *ptr = *(x->base_dst) + x->dst;
int stride = x->dst_stride;
int tx = have_left ? 4 : 0;
int ty = have_top ? 4 : 0;
if (!have_left && !have_top)
......@@ -162,12 +160,11 @@ B_PREDICTION_MODE vp9_find_bpred_context(MACROBLOCKD *xd, BLOCKD *x) {
#endif
void vp9_intra4x4_predict(MACROBLOCKD *xd,
BLOCKD *x,
int block_idx,
int b_mode,
uint8_t *predictor,
int ps) {
int i, r, c;
const int block_idx = x - xd->block;
const int have_top = (block_idx >> 2) || xd->up_available;
const int have_left = (block_idx & 3) || xd->left_available;
const int have_right = (block_idx & 3) != 3 || xd->right_available;
......@@ -182,8 +179,8 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
*/
if (have_left) {
uint8_t *left_ptr = *(x->base_dst) + x->dst - 1;
const int stride = x->dst_stride;
uint8_t *left_ptr = predictor - 1;
const int stride = ps;
left[0] = left_ptr[0 * stride];
left[1] = left_ptr[1 * stride];
......@@ -194,7 +191,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
}
if (have_top) {
uint8_t *above_ptr = *(x->base_dst) + x->dst - x->dst_stride;
uint8_t *above_ptr = predictor - ps;
top_left = have_left ? above_ptr[-1] : 127;
above[0] = above_ptr[0];
......@@ -213,10 +210,10 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
uint8_t *above_right = above_ptr + 4;
if (xd->sb_index == 3 && (xd->mb_index & 1))
above_right -= 32 * x->dst_stride;
above_right -= 32 * ps;
if (xd->mb_index == 3)
above_right -= 16 * x->dst_stride;
above_right -= (block_idx & ~3) * x->dst_stride;
above_right -= 16 * ps;
above_right -= (block_idx & ~3) * ps;
/* use a more distant above-right (from closest available top-right
* corner), but with a "localized DC" (similar'ish to TM-pred):
......
......@@ -8,7 +8,6 @@ cat <<EOF
#include "vp9/common/vp9_enums.h"
struct loop_filter_info;
struct blockd;
struct macroblockd;
struct loop_filter_info;
......@@ -95,13 +94,13 @@ specialize vp9_build_intra_predictors_sby_s
prototype void vp9_build_intra_predictors_sbuv_s "struct macroblockd *x, enum BLOCK_SIZE_TYPE bsize"
specialize vp9_build_intra_predictors_sbuv_s
prototype void vp9_intra4x4_predict "struct macroblockd *xd, struct blockd *x, int b_mode, uint8_t *predictor, int pre_stride"
prototype void vp9_intra4x4_predict "struct macroblockd *xd, int block, int b_mode, uint8_t *predictor, int pre_stride"
specialize vp9_intra4x4_predict;
prototype void vp9_intra8x8_predict "struct macroblockd *xd, struct blockd *x, int b_mode, uint8_t *predictor, int pre_stride"
prototype void vp9_intra8x8_predict "struct macroblockd *xd, int block, int b_mode, uint8_t *predictor, int pre_stride"
specialize vp9_intra8x8_predict;
prototype void vp9_intra_uv4x4_predict "struct macroblockd *xd, struct blockd *x, int b_mode, uint8_t *predictor, int pre_stride"
prototype void vp9_intra_uv4x4_predict "struct macroblockd *xd, int block, int b_mode, uint8_t *predictor, int pre_stride"
specialize vp9_intra_uv4x4_predict;
if [ "$CONFIG_VP9_DECODER" = "yes" ]; then
......@@ -591,16 +590,16 @@ specialize vp9_short_walsh8x4
#
# Motion search
#
prototype int vp9_full_search_sad "struct macroblock *x, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv, int n"
prototype int vp9_full_search_sad "struct macroblock *x, union int_mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv, int n"
specialize vp9_full_search_sad sse3 sse4_1
vp9_full_search_sad_sse3=vp9_full_search_sadx3
vp9_full_search_sad_sse4_1=vp9_full_search_sadx8
prototype int vp9_refining_search_sad "struct macroblock *x, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
prototype int vp9_refining_search_sad "struct macroblock *x, union int_mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
specialize vp9_refining_search_sad sse3
vp9_refining_search_sad_sse3=vp9_refining_search_sadx4
prototype int vp9_diamond_search_sad "struct macroblock *x, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
prototype int vp9_diamond_search_sad "struct macroblock *x, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
specialize vp9_diamond_search_sad sse3
vp9_diamond_search_sad_sse3=vp9_diamond_search_sadx4
......
......@@ -250,12 +250,14 @@ static void decode_8x8(MACROBLOCKD *xd) {
int ib = vp9_i8x8_block[i];
int idx = (ib & 0x02) ? (ib + 2) : ib;
int16_t *q = BLOCK_OFFSET(xd->plane[0].qcoeff, idx, 16);
uint8_t *dst = *(xd->block[ib].base_dst) + xd->block[ib].dst;
uint8_t* const dst =
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
xd->plane[0].dst.buf,
xd->plane[0].dst.stride);
int stride = xd->plane[0].dst.stride;
if (mode == I8X8_PRED) {
BLOCKD *b = &xd->block[ib];
int i8x8mode = xd->mode_info_context->bmi[ib].as_mode.first;
vp9_intra8x8_predict(xd, b, i8x8mode, dst, stride);
vp9_intra8x8_predict(xd, ib, i8x8mode, dst, stride);
}
tx_type = get_tx_type_8x8(xd, ib);
vp9_iht_add_8x8_c(tx_type, q, dst, stride, xd->plane[0].eobs[idx]);
......@@ -270,21 +272,25 @@ static void decode_8x8(MACROBLOCKD *xd) {
int i;
for (i = 0; i < 4; i++) {
int ib = vp9_i8x8_block[i];
BLOCKD *b = &xd->block[ib];
int i8x8mode = xd->mode_info_context->bmi[ib].as_mode.first;
uint8_t* dst;
b = &xd->block[16 + i];
vp9_intra_uv4x4_predict(xd, b, i8x8mode, *(b->base_dst) + b->dst,
b->dst_stride);
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 1, i,
xd->plane[1].dst.buf,
xd->plane[1].dst.stride);
vp9_intra_uv4x4_predict(xd, 16 + i, i8x8mode,
dst, xd->plane[1].dst.stride);
xd->itxm_add(BLOCK_OFFSET(xd->plane[1].qcoeff, i, 16),
*(b->base_dst) + b->dst, b->dst_stride,
dst, xd->plane[1].dst.stride,
xd->plane[1].eobs[i]);
b = &xd->block[20 + i];
vp9_intra_uv4x4_predict(xd, b, i8x8mode, *(b->base_dst) + b->dst,
b->dst_stride);
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 2, i,
xd->plane[2].dst.buf,
xd->plane[1].dst.stride);
vp9_intra_uv4x4_predict(xd, 20 + i, i8x8mode,
dst, xd->plane[1].dst.stride);
xd->itxm_add(BLOCK_OFFSET(xd->plane[2].qcoeff, i, 16),
*(b->base_dst) + b->dst, b->dst_stride,
dst, xd->plane[1].dst.stride,
xd->plane[2].eobs[i]);
}
} else if (mode == SPLITMV) {
......@@ -302,14 +308,16 @@ static void decode_8x8(MACROBLOCKD *xd) {
}
static INLINE void dequant_add_y(MACROBLOCKD *xd, TX_TYPE tx_type, int idx) {
BLOCKD *const b = &xd->block[idx];
struct macroblockd_plane *const y = &xd->plane[0];
uint8_t* const dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, idx,
xd->plane[0].dst.buf,
xd->plane[0].dst.stride);
if (tx_type != DCT_DCT) {
vp9_iht_add_c(tx_type, BLOCK_OFFSET(y->qcoeff, idx, 16),
*(b->base_dst) + b->dst, b->dst_stride, y->eobs[idx]);
dst, xd->plane[0].dst.stride, y->eobs[idx]);
} else {
xd->itxm_add(BLOCK_OFFSET(y->qcoeff, idx, 16), *(b->base_dst) + b->dst,
b->dst_stride, y->eobs[idx]);
xd->itxm_add(BLOCK_OFFSET(y->qcoeff, idx, 16),
dst, xd->plane[0].dst.stride, y->eobs[idx]);
}
}
......@@ -323,39 +331,48 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd, vp9_reader *r) {
int ib = vp9_i8x8_block[i];
const int iblock[4] = {0, 1, 4, 5};
int j;
BLOCKD *b = &xd->block[ib];
uint8_t* dst;
int i8x8mode = xd->mode_info_context->bmi[ib].as_mode.first;
vp9_intra8x8_predict(xd, b, i8x8mode, *(b->base_dst) + b->dst,
b->dst_stride);
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
xd->plane[0].dst.buf,
xd->plane[0].dst.stride);
vp9_intra8x8_predict(xd, ib, i8x8mode, dst, xd->plane[0].dst.stride);
for (j = 0; j < 4; j++) {
tx_type = get_tx_type_4x4(xd, ib + iblock[j]);
dequant_add_y(xd, tx_type, ib + iblock[j]);
}
b = &xd->block[16 + i];
vp9_intra_uv4x4_predict(xd, b, i8x8mode, *(b->base_dst) + b->dst,
b->dst_stride);
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 1, i,
xd->plane[1].dst.buf,
xd->plane[1].dst.stride);
vp9_intra_uv4x4_predict(xd, 16 + i, i8x8mode,
dst, xd->plane[1].dst.stride);
xd->itxm_add(BLOCK_OFFSET(xd->plane[1].qcoeff, i, 16),
*(b->base_dst) + b->dst, b->dst_stride,
dst, xd->plane[1].dst.stride,
xd->plane[1].eobs[i]);
b = &xd->block[20 + i];
vp9_intra_uv4x4_predict(xd, b, i8x8mode, *(b->base_dst) + b->dst,
b->dst_stride);
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 2, i,
xd->plane[2].dst.buf,
xd->plane[2].dst.stride);
vp9_intra_uv4x4_predict(xd, 20 + i, i8x8mode,
dst, xd->plane[1].dst.stride);
xd->itxm_add(BLOCK_OFFSET(xd->plane[2].qcoeff, i, 16),
*(b->base_dst) + b->dst, b->dst_stride,
dst, xd->plane[1].dst.stride,
xd->plane[2].eobs[i]);
}
} else if (mode == I4X4_PRED) {
for (i = 0; i < 16; i++) {
BLOCKD *b = &xd->block[i];
int b_mode = xd->mode_info_context->bmi[i].as_mode.first;
uint8_t* dst;
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, i,
xd->plane[0].dst.buf,
xd->plane[0].dst.stride);
#if CONFIG_NEWBINTRAMODES
xd->mode_info_context->bmi[i].as_mode.context =
vp9_find_bpred_context(xd, b);
vp9_find_bpred_context(xd, i, dst, xd->plane[0].dst.stride);
if (!xd->mode_info_context->mbmi.mb_skip_coeff)
vp9_decode_coefs_4x4(pbi, xd, r, PLANE_TYPE_Y_WITH_DC, i);
#endif
vp9_intra4x4_predict(xd, b, b_mode, *(b->base_dst) + b->dst,
b->dst_stride);
vp9_intra4x4_predict(xd, i, b_mode, dst, xd->plane[0].dst.stride);
tx_type = get_tx_type_4x4(xd, i);
dequant_add_y(xd, tx_type, i);
}
......@@ -1554,7 +1571,6 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
vp9_setup_intra_recon(new_fb);
vp9_setup_block_dptrs(xd);
vp9_build_block_doffsets(xd);
// clear out the coeff buffer
vpx_memset(xd->plane[0].qcoeff, 0, sizeof(xd->plane[0].qcoeff));
......
......@@ -1779,7 +1779,6 @@ void vp9_encode_frame(VP9_COMP *cpi) {
}
void vp9_build_block_offsets(MACROBLOCK *x) {
vp9_build_block_doffsets(&x->e_mbd);
}
static void sum_intra_stats(VP9_COMP *cpi, MACROBLOCK *x) {
......
......@@ -41,12 +41,14 @@ int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred) {
}
static void encode_intra4x4block(MACROBLOCK *x, int ib) {
BLOCKD *b = &x->e_mbd.block[ib];
MACROBLOCKD * const xd = &x->e_mbd;
TX_TYPE tx_type;
uint8_t* const src =
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
x->plane[0].src.buf, x->plane[0].src.stride);
uint8_t* const dst =
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
xd->plane[0].dst.buf, xd->plane[0].dst.stride);
int16_t* const src_diff =
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, ib,
x->plane[0].src_diff);
......@@ -59,15 +61,15 @@ static void encode_intra4x4block(MACROBLOCK *x, int ib) {
#if CONFIG_NEWBINTRAMODES
xd->mode_info_context->bmi[ib].as_mode.context =
vp9_find_bpred_context(&x->e_mbd, b);
vp9_find_bpred_context(&x->e_mbd, ib, dst, xd->plane[0].dst.stride);
#endif
vp9_intra4x4_predict(&x->e_mbd, b,
vp9_intra4x4_predict(&x->e_mbd, ib,
xd->mode_info_context->bmi[ib].as_mode.first,
*(b->base_dst) + b->dst, b->dst_stride);
dst, xd->plane[0].dst.stride);
vp9_subtract_block(4, 4, src_diff, 16,
src, x->plane[0].src.stride,
*(b->base_dst) + b->dst, b->dst_stride);
dst, xd->plane[0].dst.stride);
tx_type = get_tx_type_4x4(&x->e_mbd, ib);
if (tx_type != DCT_DCT) {
......@@ -83,8 +85,7 @@ static void encode_intra4x4block(MACROBLOCK *x, int ib) {
diff, 32);
}
vp9_recon_b(*(b->base_dst) + b->dst, diff,
*(b->base_dst) + b->dst, b->dst_stride);
vp9_recon_b(dst, diff, dst, xd->plane[0].dst.stride);
}
void vp9_encode_intra4x4mby(MACROBLOCK *mb) {
......@@ -157,7 +158,6 @@ void vp9_encode_intra16x16mbuv(VP9_COMMON *const cm, MACROBLOCK *x) {
void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
MACROBLOCKD *xd = &x->e_mbd;
BLOCKD *b = &xd->block[ib];
uint8_t* const src =
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
x->plane[0].src.buf, x->plane[0].src.stride);
......@@ -167,16 +167,19 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
int16_t* const diff =
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, ib,
xd->plane[0].diff);
uint8_t* const dst =
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
xd->plane[0].dst.buf, xd->plane[0].dst.stride);
const int iblock[4] = {0, 1, 4, 5};
int i;
TX_TYPE tx_type;
vp9_intra8x8_predict(xd, b, xd->mode_info_context->bmi[ib].as_mode.first,
*(b->base_dst) + b->dst, b->dst_stride);
vp9_intra8x8_predict(xd, ib, xd->mode_info_context->bmi[ib].as_mode.first,
dst, xd->plane[0].dst.stride);
// generate residual blocks
vp9_subtract_block(8, 8, src_diff, 16,
src, x->plane[0].src.stride,
*(b->base_dst) + b->dst, b->dst_stride);
dst, xd->plane[0].dst.stride);
if (xd->mode_info_context->mbmi.txfm_size == TX_8X8) {
int idx = (ib & 0x02) ? (ib + 2) : ib;
......@@ -207,7 +210,6 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
xd->plane[0].diff);
assert(idx < 16);
b = &xd->block[ib + iblock[i]];
tx_type = get_tx_type_4x4(xd, ib + iblock[i]);
if (tx_type != DCT_DCT) {
vp9_short_fht4x4(src_diff, coeff, 16, tx_type);
......@@ -236,9 +238,11 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
int16_t* const diff =
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, ib + iblock[i],
xd->plane[0].diff);
b = &xd->block[ib + iblock[i]];
vp9_recon_b_c(*(b->base_dst) + b->dst, diff, *(b->base_dst) + b->dst,
b->dst_stride);
uint8_t* const dst =
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib + iblock[i],
xd->plane[0].dst.buf,
xd->plane[0].dst.stride);
vp9_recon_b_c(dst, diff, dst, xd->plane[0].dst.stride);
}
}
......@@ -251,7 +255,6 @@ void vp9_encode_intra8x8mby(MACROBLOCK *x) {
static void encode_intra_uv4x4(MACROBLOCK *x, int ib, int mode) {
MACROBLOCKD * const xd = &x->e_mbd;
BLOCKD *b = &x->e_mbd.block[ib];
int16_t * const dqcoeff = MB_SUBBLOCK_FIELD(xd, dqcoeff, ib);
int16_t* const coeff = MB_SUBBLOCK_FIELD(x, coeff, ib);
const int plane = ib < 20 ? 1 : 2;
......@@ -266,23 +269,26 @@ static void encode_intra_uv4x4(MACROBLOCK *x, int ib, int mode) {
int16_t* const diff =
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, plane, block,
xd->plane[plane].diff);
uint8_t* const dst =
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, plane, block,
xd->plane[plane].dst.buf,
xd->plane[plane].dst.stride);
assert(ib >= 16 && ib < 24);
vp9_intra_uv4x4_predict(&x->e_mbd, b, mode,
*(b->base_dst) + b->dst, b->dst_stride);
vp9_intra_uv4x4_predict(&x->e_mbd, ib, mode,
dst, xd->plane[plane].dst.stride);
assert(xd->plane[1].subsampling_x == 1);
vp9_subtract_block(4, 4, src_diff, 8,
src, x->plane[plane].src.stride,
*(b->base_dst) + b->dst, b->dst_stride);
dst, xd->plane[plane].dst.stride);
x->fwd_txm4x4(src_diff, coeff, 16);
x->quantize_b_4x4(x, ib, DCT_DCT, 16);
vp9_inverse_transform_b_4x4(&x->e_mbd, xd->plane[plane].eobs[block],
dqcoeff, diff, 16);
vp9_recon_uv_b_c(*(b->base_dst) + b->dst, diff, *(b->base_dst) + b->dst,
b->dst_stride);
vp9_recon_uv_b_c(dst, diff, dst, xd->plane[plane].dst.stride);
}
void vp9_encode_intra8x8mbuv(MACROBLOCK *x) {
......
......@@ -363,7 +363,6 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
YV12_BUFFER_CONFIG *recon_buffer,
int *best_motion_err, int recon_yoffset) {
MACROBLOCKD *const xd = &x->e_mbd;
BLOCKD *d = &x->e_mbd.block[0];
int num00;
int_mv tmp_mv;
......@@ -399,7 +398,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
tmp_mv.as_int = 0;
ref_mv_full.as_mv.col = ref_mv->as_mv.col >> 3;
ref_mv_full.as_mv.row = ref_mv->as_mv.row >> 3;
tmp_err = cpi->diamond_search_sad(x, d, &ref_mv_full, &tmp_mv, step_param,
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv, step_param,
x->sadperbit16, &num00, &v_fn_ptr,
x->nmvjointcost,
x->mvcost, ref_mv);
......@@ -422,7 +421,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
if (num00)
num00--;
else {
tmp_err = cpi->diamond_search_sad(x, d, &ref_mv_full, &tmp_mv,
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv,
step_param + n, x->sadperbit16,
&num00, &v_fn_ptr,
x->nmvjointcost,
......
......@@ -25,11 +25,9 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
int mb_col) {
MACROBLOCK *const x = &cpi->mb;