Commit 4bd0f4f6 authored by John Koleszar's avatar John Koleszar

Remove BLOCK structure

All members can be referenced from their per-plane counterparts, and
removes assumptions about 24 blocks per macroblock.

Change-Id: I593fb0715e74cd84b48facd1c9b18c3ae1185d4b
parent 61a47da8
......@@ -973,16 +973,23 @@ static INLINE void foreach_predicted_block_uv(
}
}
static int raster_block_offset(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize,
int plane, int block) {
int plane, int block, int stride) {
const int bw = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
const int stride = 4 << bw;
const int y = 4 * (block >> bw), x = 4 * (block & ((1 << bw) - 1));
return y * stride + x;
}
static int16_t* raster_block_offset_int16(MACROBLOCKD *xd,
BLOCK_SIZE_TYPE bsize,
int plane, int block, int16_t *base) {
return base + raster_block_offset(xd, bsize, plane, block);
const int bw = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
const int stride = 4 << bw;
return base + raster_block_offset(xd, bsize, plane, block, stride);
}
static uint8_t* raster_block_offset_uint8(MACROBLOCKD *xd,
BLOCK_SIZE_TYPE bsize,
int plane, int block,
uint8_t *base, int stride) {
return base + raster_block_offset(xd, bsize, plane, block, stride);
}
#if CONFIG_CODE_ZEROGROUP
......
......@@ -13,7 +13,6 @@ struct macroblockd;
struct loop_filter_info;
/* Encoder forward decls */
struct block;
struct macroblock;
struct vp9_variance_vtable;
......@@ -592,16 +591,16 @@ specialize vp9_short_walsh8x4
#
# Motion search
#
prototype int vp9_full_search_sad "struct macroblock *x, struct block *b, 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_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"
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 block *b, 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, 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"
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 block *b, 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, 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"
specialize vp9_diamond_search_sad sse3
vp9_diamond_search_sad_sse3=vp9_diamond_search_sadx4
......
......@@ -23,13 +23,6 @@ typedef struct {
int offset;
} search_site;
typedef struct block {
uint8_t **base_src;
uint8_t **base_second_src;
int src;
int src_stride;
} BLOCK;
typedef struct {
int count;
struct {
......@@ -69,6 +62,7 @@ typedef struct {
struct macroblock_plane {
DECLARE_ALIGNED(16, int16_t, src_diff[64*64]);
DECLARE_ALIGNED(16, int16_t, coeff[64*64]);
struct buf_2d src;
// Quantizer setings
int16_t *quant;
......@@ -84,13 +78,9 @@ struct macroblock_plane {
typedef struct macroblock MACROBLOCK;
struct macroblock {
struct macroblock_plane plane[MAX_MB_PLANE];
int skip_block;
// 16 Y blocks, 4 U blocks, 4 V blocks,
BLOCK block[24];
YV12_BUFFER_CONFIG src;
MACROBLOCKD e_mbd;
int skip_block;
PARTITION_INFO *partition_info; /* work pointer */
PARTITION_INFO *pi; /* Corresponds to upper left visible macroblock */
PARTITION_INFO *pip; /* Base of allocated array */
......
......@@ -96,8 +96,8 @@ static unsigned int tt_activity_measure(VP9_COMP *cpi, MACROBLOCK *x) {
* lambda using a non-linear combination (e.g., the smallest, or second
* smallest, etc.).
*/
act = vp9_variance16x16(x->src.y_buffer, x->src.y_stride, VP9_VAR_OFFS, 0,
&sse);
act = vp9_variance16x16(x->plane[0].src.buf, x->plane[0].src.stride,
VP9_VAR_OFFS, 0, &sse);
act <<= 4;
/* If the region is flat, lower the activity some more. */
......@@ -296,12 +296,12 @@ static void build_activity_map(VP9_COMP *cpi) {
x->mb_activity_ptr++;
// adjust to the next column of source macroblocks
x->src.y_buffer += 16;
x->plane[0].src.buf += 16;
}
// adjust to the next row of mbs
x->src.y_buffer += 16 * x->src.y_stride - 16 * cm->mb_cols;
x->plane[0].src.buf += 16 * x->plane[0].src.stride - 16 * cm->mb_cols;
#if ALT_ACT_MEASURE
// extend the recon for intra prediction
......@@ -535,6 +535,26 @@ static unsigned find_seg_id(uint8_t *buf, BLOCK_SIZE_TYPE bsize,
return seg_id;
}
void vp9_setup_src_planes(MACROBLOCK *x,
const YV12_BUFFER_CONFIG *src,
int mb_row, int mb_col) {
setup_pred_plane(&x->plane[0].src,
src->y_buffer, src->y_stride,
mb_row, mb_col, NULL,
x->e_mbd.plane[0].subsampling_x,
x->e_mbd.plane[0].subsampling_y);
setup_pred_plane(&x->plane[1].src,
src->u_buffer, src->uv_stride,
mb_row, mb_col, NULL,
x->e_mbd.plane[1].subsampling_x,
x->e_mbd.plane[1].subsampling_y);
setup_pred_plane(&x->plane[2].src,
src->v_buffer, src->uv_stride,
mb_row, mb_col, NULL,
x->e_mbd.plane[2].subsampling_x,
x->e_mbd.plane[2].subsampling_y);
}
static void set_offsets(VP9_COMP *cpi,
int mb_row, int mb_col, BLOCK_SIZE_TYPE bsize) {
MACROBLOCK *const x = &cpi->mb;
......@@ -581,7 +601,7 @@ static void set_offsets(VP9_COMP *cpi,
set_mb_row_col(cm, xd, mb_row, bh, mb_col, bw);
/* set up source buffers */
setup_pred_block(&x->src, cpi->Source, mb_row, mb_col, NULL, NULL);
vp9_setup_src_planes(x, cpi->Source, mb_row, mb_col);
/* R/D setup */
x->rddiv = cpi->RDDIV;
......@@ -1272,7 +1292,7 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
vp9_init_mbmode_probs(cm);
// Copy data over into macro block data structures.
x->src = *cpi->Source;
vp9_setup_src_planes(x, cpi->Source, 0, 0);
// TODO(jkoleszar): are these initializations required?
setup_pre_planes(xd, &cm->yv12_fb[cm->ref_frame_map[cpi->lst_fb_idx]], NULL,
......@@ -1768,45 +1788,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
}
void vp9_build_block_offsets(MACROBLOCK *x) {
int block = 0;
int br, bc;
vp9_build_block_doffsets(&x->e_mbd);
for (br = 0; br < 4; br++) {
for (bc = 0; bc < 4; bc++) {
BLOCK *this_block = &x->block[block];
// this_block->base_src = &x->src.y_buffer;
// this_block->src_stride = x->src.y_stride;
// this_block->src = 4 * br * this_block->src_stride + 4 * bc;
this_block->base_src = &x->src.y_buffer;
this_block->src_stride = x->src.y_stride;
this_block->src = 4 * br * this_block->src_stride + 4 * bc;
++block;
}
}
// u blocks
for (br = 0; br < 2; br++) {
for (bc = 0; bc < 2; bc++) {
BLOCK *this_block = &x->block[block];
this_block->base_src = &x->src.u_buffer;
this_block->src_stride = x->src.uv_stride;
this_block->src = 4 * br * this_block->src_stride + 4 * bc;
++block;
}
}
// v blocks
for (br = 0; br < 2; br++) {
for (bc = 0; bc < 2; bc++) {
BLOCK *this_block = &x->block[block];
this_block->base_src = &x->src.v_buffer;
this_block->src_stride = x->src.uv_stride;
this_block->src = 4 * br * this_block->src_stride + 4 * bc;
++block;
}
}
}
static void sum_intra_stats(VP9_COMP *cpi, MACROBLOCK *x) {
......
......@@ -13,7 +13,12 @@
#define VP9_ENCODER_VP9_ENCODEFRAME_H_
struct macroblock;
struct yv12_buffer_config;
void vp9_build_block_offsets(struct macroblock *x);
void vp9_setup_src_planes(struct macroblock *x,
const struct yv12_buffer_config *src,
int mb_row, int mb_col);
#endif // VP9_ENCODER_VP9_ENCODEFRAME_H_
......@@ -42,9 +42,11 @@ 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];
BLOCK *be = &x->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);
int16_t* const src_diff =
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, ib,
x->plane[0].src_diff);
......@@ -59,7 +61,7 @@ static void encode_intra4x4block(MACROBLOCK *x, int ib) {
vp9_intra4x4_predict(&x->e_mbd, b, b->bmi.as_mode.first,
*(b->base_dst) + b->dst, b->dst_stride);
vp9_subtract_block(4, 4, src_diff, 16,
*(be->base_src) + be->src, be->src_stride,
src, x->plane[0].src.stride,
*(b->base_dst) + b->dst, b->dst_stride);
tx_type = get_tx_type_4x4(&x->e_mbd, ib);
......@@ -151,7 +153,9 @@ 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];
BLOCK *be = &x->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);
int16_t* const src_diff =
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, ib,
x->plane[0].src_diff);
......@@ -163,7 +167,7 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
*(b->base_dst) + b->dst, b->dst_stride);
// generate residual blocks
vp9_subtract_block(8, 8, src_diff, 16,
*(be->base_src) + be->src, be->src_stride,
src, x->plane[0].src.stride,
*(b->base_dst) + b->dst, b->dst_stride);
if (xd->mode_info_context->mbmi.txfm_size == TX_8X8) {
......@@ -194,7 +198,6 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
assert(idx < 16);
b = &xd->block[ib + iblock[i]];
be = &x->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,11 +239,14 @@ 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];
BLOCK *be = &x->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;
const int block = ib < 20 ? ib - 16 : ib - 20;
uint8_t* const src =
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, plane, block,
x->plane[plane].src.buf,
x->plane[plane].src.stride);
int16_t* const src_diff =
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, plane, block,
x->plane[plane].src_diff);
......@@ -251,7 +257,7 @@ static void encode_intra_uv4x4(MACROBLOCK *x, int ib, int mode) {
assert(xd->plane[1].subsampling_x == 1);
vp9_subtract_block(4, 4, src_diff, 8,
*(be->base_src) + be->src, be->src_stride,
src, x->plane[plane].src.stride,
*(b->base_dst) + b->dst, b->dst_stride);
x->fwd_txm4x4(src_diff, coeff, 16);
......
......@@ -41,9 +41,8 @@ static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize, int plane) {
const MACROBLOCKD * const xd = &x->e_mbd;
const int bw = 4 << (b_width_log2(bsize) - xd->plane[plane].subsampling_x);
const int bh = 4 << (b_height_log2(bsize) - xd->plane[plane].subsampling_y);
const uint8_t *src = plane == 0 ? x->src.y_buffer :
plane == 1 ? x->src.u_buffer : x->src.v_buffer;
const int src_stride = plane == 0 ? x->src.y_stride : x->src.uv_stride;
const uint8_t *src = x->plane[plane].src.buf;
const int src_stride = x->plane[plane].src.stride;
assert(plane < 3);
vp9_subtract_block(bh, bw,
......
......@@ -349,11 +349,10 @@ void vp9_end_first_pass(VP9_COMP *cpi) {
static void zz_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;
BLOCK *b = &x->block[0];
BLOCKD *d = &x->e_mbd.block[0];
uint8_t *src_ptr = (*(b->base_src) + b->src);
int src_stride = b->src_stride;
uint8_t *src_ptr = x->plane[0].src.buf;
int src_stride = x->plane[0].src.stride;
uint8_t *ref_ptr;
int ref_stride = d->pre_stride;
......@@ -371,7 +370,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;
BLOCK *b = &x->block[0];
BLOCKD *d = &x->e_mbd.block[0];
int num00;
......@@ -408,7 +406,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, b, d, &ref_mv_full, &tmp_mv, step_param,
tmp_err = cpi->diamond_search_sad(x, d, &ref_mv_full, &tmp_mv, step_param,
x->sadperbit16, &num00, &v_fn_ptr,
x->nmvjointcost,
x->mvcost, ref_mv);
......@@ -431,7 +429,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
if (num00)
num00--;
else {
tmp_err = cpi->diamond_search_sad(x, b, d, &ref_mv_full, &tmp_mv,
tmp_err = cpi->diamond_search_sad(x, d, &ref_mv_full, &tmp_mv,
step_param + n, x->sadperbit16,
&num00, &v_fn_ptr,
x->nmvjointcost,
......@@ -484,7 +482,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
vp9_clear_system_state(); // __asm emms;
x->src = * cpi->Source;
vp9_setup_src_planes(x, cpi->Source, 0, 0);
setup_pre_planes(xd, lst_yv12, NULL, 0, 0, NULL, NULL);
setup_dst_planes(xd, new_yv12, 0, 0);
......@@ -686,18 +684,18 @@ void vp9_first_pass(VP9_COMP *cpi) {
coded_error += (int64_t)this_error;
// adjust to the next column of macroblocks
x->src.y_buffer += 16;
x->src.u_buffer += 8;
x->src.v_buffer += 8;
x->plane[0].src.buf += 16;
x->plane[1].src.buf += 8;
x->plane[2].src.buf += 8;
recon_yoffset += 16;
recon_uvoffset += 8;
}
// adjust to the next row of mbs
x->src.y_buffer += 16 * x->src.y_stride - 16 * cm->mb_cols;
x->src.u_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols;
x->src.v_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols;
x->plane[0].src.buf += 16 * x->plane[0].src.stride - 16 * cm->mb_cols;
x->plane[1].src.buf += 8 * x->plane[1].src.stride - 8 * cm->mb_cols;
x->plane[2].src.buf += 8 * x->plane[1].src.stride - 8 * cm->mb_cols;
// extend the recon for intra prediction
vp9_extend_mb_row(new_yv12, xd->plane[0].dst.buf + 16,
......
......@@ -25,7 +25,6 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
int mb_col) {
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
BLOCK *b = &x->block[0];
BLOCKD *d = &xd->block[0];
vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16];
unsigned int best_err;
......@@ -48,7 +47,7 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
/*cpi->sf.search_method == HEX*/
best_err = vp9_hex_search(
x, b, d,
x, d,
&ref_full, dst_mv,
step_param,
x->errorperbit,
......@@ -63,7 +62,7 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
int distortion;
unsigned int sse;
best_err = cpi->find_fractional_mv_step(
x, b, d,
x, d,
dst_mv, ref_mv,
x->errorperbit, &v_fn_ptr,
NULL, NULL,
......@@ -72,7 +71,7 @@ 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, mb_row, mb_col, BLOCK_SIZE_MB16X16);
best_err = vp9_sad16x16(x->src.y_buffer, x->src.y_stride,
best_err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
INT_MAX);
......@@ -104,11 +103,6 @@ static int do_16x16_motion_search
for (n = 0; n < 16; n++) {
BLOCKD *d = &xd->block[n];
BLOCK *b = &x->block[n];
b->base_src = &x->src.y_buffer;
b->src_stride = x->src.y_stride;
b->src = x->src.y_stride * (n & 12) + (n & 3) * 4;
d->base_pre = &xd->plane[0].pre[0].buf;
d->pre_stride = xd->plane[0].pre[0].stride;
......@@ -117,7 +111,7 @@ static int do_16x16_motion_search
// Try zero MV first
// FIXME should really use something like near/nearest MV and/or MV prediction
err = vp9_sad16x16(x->src.y_buffer, x->src.y_stride,
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
INT_MAX);
dst_mv->as_int = 0;
......@@ -162,7 +156,7 @@ static int do_16x16_zerozero_search
// Try zero MV first
// FIXME should really use something like near/nearest MV and/or MV prediction
err = vp9_sad16x16(x->src.y_buffer, x->src.y_stride,
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
INT_MAX);
......@@ -190,13 +184,13 @@ static int find_best_16x16_intra
const int bhl = b_height_log2(BLOCK_SIZE_MB16X16), bh = 4 << bhl;
xd->mode_info_context->mbmi.mode = mode;
vp9_build_intra_predictors(x->src.y_buffer, x->src.y_stride,
vp9_build_intra_predictors(x->plane[0].src.buf, x->plane[0].src.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,
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride, best_err);
// find best
......@@ -233,8 +227,8 @@ static void update_mbgraph_mb_stats
VP9_COMMON *cm = &cpi->common;
// FIXME in practice we're completely ignoring chroma here
x->src.y_buffer = buf->y_buffer + mb_y_offset;
x->src.y_stride = buf->y_stride;
x->plane[0].src.buf = buf->y_buffer + mb_y_offset;
x->plane[0].src.stride = buf->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;
......
This diff is collapsed.
......@@ -37,13 +37,13 @@ void vp9_init3smotion_compensation(MACROBLOCK *x, int stride);
// Runs sequence of diamond searches in smaller steps for RD
struct VP9_COMP;
int vp9_full_pixel_diamond(struct VP9_COMP *cpi, MACROBLOCK *x, BLOCK *b,
int vp9_full_pixel_diamond(struct VP9_COMP *cpi, MACROBLOCK *x,
BLOCKD *d, int_mv *mvp_full, int step_param,
int sadpb, int further_steps, int do_refine,
vp9_variance_fn_ptr_t *fn_ptr,
int_mv *ref_mv, int_mv *dst_mv);
int vp9_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
int vp9_hex_search(MACROBLOCK *x, BLOCKD *d,
int_mv *ref_mv, int_mv *best_mv,
int search_param, int error_per_bit,
const vp9_variance_fn_ptr_t *vf,
......@@ -51,27 +51,27 @@ int vp9_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
int *mvjcost, int *mvcost[2],
int_mv *center_mv);
typedef int (fractional_mv_step_fp) (MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv
typedef int (fractional_mv_step_fp) (MACROBLOCK *x, BLOCKD *d, int_mv
*bestmv, int_mv *ref_mv, int error_per_bit, const vp9_variance_fn_ptr_t *vfp,
int *mvjcost, int *mvcost[2], int *distortion, unsigned int *sse);
extern fractional_mv_step_fp vp9_find_best_sub_pixel_step_iteratively;
extern fractional_mv_step_fp vp9_find_best_sub_pixel_step;
extern fractional_mv_step_fp vp9_find_best_half_pixel_step;
typedef int (*vp9_full_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
typedef int (*vp9_full_search_fn_t)(MACROBLOCK *x, BLOCKD *d,
int_mv *ref_mv, int sad_per_bit,
int distance, vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
int_mv *center_mv);
typedef int (*vp9_refining_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
typedef int (*vp9_refining_search_fn_t)(MACROBLOCK *x, BLOCKD *d,
int_mv *ref_mv, int sad_per_bit,
int distance,
vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
int_mv *center_mv);
typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x, BLOCKD *d,
int_mv *ref_mv, int_mv *best_mv,
int search_param, int sad_per_bit,
int *num00,
......
This diff is collapsed.
......@@ -128,15 +128,12 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
int sadpb = x->sadperbit16;
int bestsme = INT_MAX;
BLOCK *b = &x->block[0];
BLOCKD *d = &x->e_mbd.block[0];
int_mv best_ref_mv1;
int_mv best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */
// Save input state
uint8_t **base_src = b->base_src;
int src = b->src;
int src_stride = b->src_stride;
struct buf_2d src = x->plane[0].src;
uint8_t **base_pre = d->base_pre;
int pre = d->pre;
int pre_stride = d->pre_stride;
......@@ -146,9 +143,8 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
best_ref_mv1_full.as_mv.row = best_ref_mv1.as_mv.row >> 3;
// Setup frame pointers
b->base_src = &arf_frame->y_buffer;
b->src_stride = arf_frame->y_stride;
b->src = mb_offset;
x->plane[0].src.buf = arf_frame->y_buffer + mb_offset;
x->plane[0].src.stride = arf_frame->y_stride;
d->base_pre = &frame_ptr->y_buffer;
d->pre_stride = frame_ptr->y_stride;
......@@ -165,7 +161,7 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
/*cpi->sf.search_method == HEX*/
// TODO Check that the 16x16 vf & sdf are selected here
// Ignore mv costing by sending NULL pointer instead of cost arrays
bestsme = vp9_hex_search(x, b, d, &best_ref_mv1_full, &d->bmi.as_mv[0],
bestsme = vp9_hex_search(x, d, &best_ref_mv1_full, &d->bmi.as_mv[0],
step_param, sadpb, &cpi->fn_ptr[BLOCK_16X16],
NULL, NULL, NULL, NULL,
&best_ref_mv1);
......@@ -177,7 +173,7 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
int distortion;
unsigned int sse;
// Ignore mv costing by sending NULL pointer instead of cost array
bestsme = cpi->find_fractional_mv_step(x, b, d, &d->bmi.as_mv[0],
bestsme = cpi->find_fractional_mv_step(x, d, &d->bmi.as_mv[0],
&best_ref_mv1,
x->errorperbit,
&cpi->fn_ptr[BLOCK_16X16],
......@@ -187,9 +183,7 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
#endif
// Save input state
b->base_src = base_src;
b->src = src;
b->src_stride = src_stride;
x->plane[0].src = src;
d->base_pre = base_pre;
d->pre = pre;
d->pre_stride = pre_stride;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment