filter_block_plane: remove MACROBLOCKD param

replace with direct use of the plane and MODE_INFO

Change-Id: Icce57bc398a6e3607aedde0573d977e192040696
This commit is contained in:
James Zern
2013-07-19 14:16:07 -07:00
parent b775081283
commit de012cec4f

View File

@@ -228,13 +228,16 @@ static void filter_selectively_horiz(uint8_t *s, int pitch,
} }
} }
static void filter_block_plane(VP9_COMMON *const cm, MACROBLOCKD *const xd, static void filter_block_plane(VP9_COMMON *const cm,
int plane, int mi_row, int mi_col) { struct macroblockd_plane *const plane,
const int ss_x = xd->plane[plane].subsampling_x; const MODE_INFO *mi,
const int ss_y = xd->plane[plane].subsampling_y; int mi_row, int mi_col) {
const int ss_x = plane->subsampling_x;
const int ss_y = plane->subsampling_y;
const int row_step = 1 << ss_x; const int row_step = 1 << ss_x;
const int col_step = 1 << ss_y; const int col_step = 1 << ss_y;
struct buf_2d *const dst = &xd->plane[plane].dst; const int row_step_stride = cm->mode_info_stride * row_step;
struct buf_2d *const dst = &plane->dst;
uint8_t* const dst0 = dst->buf; uint8_t* const dst0 = dst->buf;
unsigned int mask_16x16[MI_BLOCK_SIZE] = {0}; unsigned int mask_16x16[MI_BLOCK_SIZE] = {0};
unsigned int mask_8x8[MI_BLOCK_SIZE] = {0}; unsigned int mask_8x8[MI_BLOCK_SIZE] = {0};
@@ -243,9 +246,6 @@ static void filter_block_plane(VP9_COMMON *const cm, MACROBLOCKD *const xd,
struct loop_filter_info lfi[MI_BLOCK_SIZE][MI_BLOCK_SIZE]; struct loop_filter_info lfi[MI_BLOCK_SIZE][MI_BLOCK_SIZE];
int r, c; int r, c;
const MODE_INFO *mi = xd->mode_info_context;
const int row_step_stride = cm->mode_info_stride * row_step;
for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += row_step) { for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += row_step) {
unsigned int mask_16x16_c = 0; unsigned int mask_16x16_c = 0;
unsigned int mask_8x8_c = 0; unsigned int mask_8x8_c = 0;
@@ -264,7 +264,8 @@ static void filter_block_plane(VP9_COMMON *const cm, MACROBLOCKD *const xd,
const int block_edge_above = b_height_log2(mi[c].mbmi.sb_type) ? const int block_edge_above = b_height_log2(mi[c].mbmi.sb_type) ?
!(r & ((1 << (b_height_log2(mi[c].mbmi.sb_type)-1)) - 1)) : 1; !(r & ((1 << (b_height_log2(mi[c].mbmi.sb_type)-1)) - 1)) : 1;
const int skip_this_r = skip_this && !block_edge_above; const int skip_this_r = skip_this && !block_edge_above;
const TX_SIZE tx_size = plane ? get_uv_tx_size(&mi[c].mbmi) const TX_SIZE tx_size = (plane->plane_type == PLANE_TYPE_UV)
? get_uv_tx_size(&mi[c].mbmi)
: mi[c].mbmi.txfm_size; : mi[c].mbmi.txfm_size;
const int skip_border_4x4_c = ss_x && mi_col + c == cm->mi_cols - 1; const int skip_border_4x4_c = ss_x && mi_col + c == cm->mi_cols - 1;
const int skip_border_4x4_r = ss_y && mi_row + r == cm->mi_rows - 1; const int skip_border_4x4_r = ss_y && mi_row + r == cm->mi_rows - 1;
@@ -349,6 +350,7 @@ static void filter_block_plane(VP9_COMMON *const cm, MACROBLOCKD *const xd,
void vp9_loop_filter_frame(VP9_COMMON *cm, MACROBLOCKD *xd, void vp9_loop_filter_frame(VP9_COMMON *cm, MACROBLOCKD *xd,
int frame_filter_level, int y_only) { int frame_filter_level, int y_only) {
const int num_planes = y_only ? 1 : MAX_MB_PLANE;
int mi_row, mi_col; int mi_row, mi_col;
// Initialize the loop filter for this frame. // Initialize the loop filter for this frame.
@@ -361,9 +363,8 @@ void vp9_loop_filter_frame(VP9_COMMON *cm, MACROBLOCKD *xd,
int plane; int plane;
setup_dst_planes(xd, cm->frame_to_show, mi_row, mi_col); setup_dst_planes(xd, cm->frame_to_show, mi_row, mi_col);
for (plane = 0; plane < (y_only ? 1 : MAX_MB_PLANE); plane++) { for (plane = 0; plane < num_planes; ++plane) {
xd->mode_info_context = mi + mi_col; filter_block_plane(cm, &xd->plane[plane], mi + mi_col, mi_row, mi_col);
filter_block_plane(cm, xd, plane, mi_row, mi_col);
} }
} }
} }