Commit 9a4e175a authored by James Zern's avatar James Zern
Browse files

filter_block_plane: reuse some constants

+ light const application
+ limit scope of params to build_lfi

Change-Id: I1031c556aec160a690921dc10e7aa8a707f43ecd
parent b09d37af
......@@ -117,9 +117,9 @@ static void loop_filter_frame_init(VP9_COMMON *const cm, MACROBLOCKD *const xd,
}
}
static int build_lfi(const VP9_COMMON *cm, const MB_MODE_INFO *mbmi,
struct loop_filter_info *lfi) {
const loop_filter_info_n *const lfi_n = &cm->lf_info;
static int build_lfi(const loop_filter_info_n *const lfi_n,
const MB_MODE_INFO *const mbmi,
struct loop_filter_info *const lfi) {
const int seg = mbmi->segment_id;
const int ref = mbmi->ref_frame[0];
const int mode = lfi_n->mode_lf_lut[mbmi->mode];
......@@ -230,13 +230,13 @@ static void filter_selectively_horiz(uint8_t *s, int pitch,
}
}
static void filter_block_plane(VP9_COMMON *cm, MACROBLOCKD *xd,
static void filter_block_plane(VP9_COMMON *const cm, MACROBLOCKD *const xd,
int plane, int mi_row, int mi_col) {
const int ss_x = xd->plane[plane].subsampling_x;
const int ss_y = xd->plane[plane].subsampling_y;
const int row_step = 1 << xd->plane[plane].subsampling_y;
const int col_step = 1 << xd->plane[plane].subsampling_x;
struct buf_2d * const dst = &xd->plane[plane].dst;
const int row_step = 1 << ss_x;
const int col_step = 1 << ss_y;
struct buf_2d *const dst = &xd->plane[plane].dst;
uint8_t* const dst0 = dst->buf;
unsigned int mask_16x16[MI_BLOCK_SIZE] = {0};
unsigned int mask_8x8[MI_BLOCK_SIZE] = {0};
......@@ -244,8 +244,8 @@ static void filter_block_plane(VP9_COMMON *cm, MACROBLOCKD *xd,
unsigned int mask_4x4_int[MI_BLOCK_SIZE] = {0};
struct loop_filter_info lfi[MI_BLOCK_SIZE][MI_BLOCK_SIZE];
int r, c;
MODE_INFO *mi = xd->mode_info_context;
int row_step_stride = cm->mode_info_stride * row_step;
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) {
unsigned int mask_16x16_c = 0;
......@@ -271,8 +271,7 @@ static void filter_block_plane(VP9_COMMON *cm, MACROBLOCKD *xd,
const int skip_border_4x4_r = ss_y && mi_row + r == cm->mi_rows - 1;
// Filter level can vary per MI
if (!build_lfi(cm, &mi[c].mbmi,
lfi[r] + (c >> xd->plane[plane].subsampling_x)))
if (!build_lfi(&cm->lf_info, &mi[c].mbmi, lfi[r] + (c >> ss_x)))
continue;
// Build masks based on the transform size of each block
......
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