return (cm->mb_cols + 3) & ~3;
}
-// TODO(debargha): merge the two functions
-static void set_mb_row(VP9_COMMON *cm, MACROBLOCKD *xd,
- int mb_row, int block_size) {
+static void set_mb_row_col(VP9_COMMON *cm, MACROBLOCKD *xd,
+ int mb_row, int bh,
+ int mb_col, int bw) {
xd->mb_to_top_edge = -((mb_row * 16) << 3);
- xd->mb_to_bottom_edge = ((cm->mb_rows - block_size - mb_row) * 16) << 3;
-
- // Are edges available for intra prediction?
- xd->up_available = (mb_row != 0);
-}
-
-static void set_mb_col(VP9_COMMON *cm, MACROBLOCKD *xd,
- int mb_col, int block_size) {
+ xd->mb_to_bottom_edge = ((cm->mb_rows - bh - mb_row) * 16) << 3;
xd->mb_to_left_edge = -((mb_col * 16) << 3);
- xd->mb_to_right_edge = ((cm->mb_cols - block_size - mb_col) * 16) << 3;
+ xd->mb_to_right_edge = ((cm->mb_cols - bw - mb_col) * 16) << 3;
// Are edges available for intra prediction?
+ xd->up_available = (mb_row != 0);
xd->left_available = (mb_col > cm->cur_tile_mb_col_start);
- xd->right_available = (mb_col + block_size < cm->cur_tile_mb_col_end);
+ xd->right_available = (mb_col + bw < cm->cur_tile_mb_col_end);
}
static int get_mb_row(const MACROBLOCKD *xd) {
// Distance of Mb to the various image edges.
// These specified to 8th pel as they are always compared to MV values
// that are in 1/8th pel units
- set_mb_row(cm, xd, mb_row, bh);
- set_mb_col(cm, xd, mb_col, bw);
+ set_mb_row_col(cm, xd, mb_row, bh, mb_col, bw);
mb_to_top_edge = xd->mb_to_top_edge - LEFT_TOP_MARGIN;
mb_to_bottom_edge = xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN;
// Distance of Mb to the various image edges. These are specified to 8th pel
// as they are always compared to values that are in 1/8th pel units
- set_mb_row(cm, xd, mb_row, bh);
- set_mb_col(cm, xd, mb_col, bw);
+ set_mb_row_col(cm, xd, mb_row, bh, mb_col, bw);
xd->plane[0].dst.buf = dst_fb->y_buffer + recon_yoffset;
xd->plane[1].dst.buf = dst_fb->u_buffer + recon_uvoffset;
// These specified to 8th pel as they are always compared to MV
// values that are in 1/8th pel units
- set_mb_row(pc, xd, mb_row, bh);
- set_mb_col(pc, xd, mb_col, bw);
+ set_mb_row_col(pc, xd, mb_row, bh, mb_col, bw);
#ifdef ENTROPY_STATS
active_section = 9;
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
xd->mode_info_context = m;
- set_mb_row(&cpi->common, xd, mb_row, 1 << mb_height_log2(m->mbmi.sb_type));
- set_mb_col(&cpi->common, xd, mb_col, 1 << mb_width_log2(m->mbmi.sb_type));
+ set_mb_row_col(&cpi->common, xd, mb_row,
+ 1 << mb_height_log2(m->mbmi.sb_type),
+ mb_col, 1 << mb_width_log2(m->mbmi.sb_type));
if (cm->frame_type == KEY_FRAME) {
write_mb_modes_kf(cpi, m, bc,
cm->mb_rows - mb_row, cm->mb_cols - mb_col);
// Set up distance of MB to edge of frame in 1/8th pel units
assert(!(mb_col & (bw - 1)) && !(mb_row & (bh - 1)));
- set_mb_row(cm, xd, mb_row, bh);
- set_mb_col(cm, xd, mb_col, bw);
+ 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);
x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16)
+ (VP9BORDERINPIXELS - 16);
- set_mb_row(cm, xd, mb_row, 1 << mb_height_log2(BLOCK_SIZE_MB16X16));
-
// for each macroblock col in image
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {
int this_error;
int gf_motion_error = INT_MAX;
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));
+ set_mb_row_col(cm, xd,
+ mb_row, 1 << mb_height_log2(BLOCK_SIZE_MB16X16),
+ mb_col, 1 << mb_height_log2(BLOCK_SIZE_MB16X16));
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;
const int segment_id = mi->mbmi.segment_id;
xd->mode_info_context = mi;
- set_mb_row(cm, xd, mb_row, bh);
- set_mb_col(cm, xd, mb_col, bw);
+ set_mb_row_col(cm, xd, mb_row, bh, mb_col, bw);
// Count the number of hits on each segment with no prediction
no_pred_segcounts[segment_id]++;