Merge "Removing subpix_fn_table struct."

This commit is contained in:
Dmitry Kovalev
2014-01-27 10:42:42 -08:00
committed by Gerrit Code Review
8 changed files with 19 additions and 28 deletions

View File

@@ -252,7 +252,7 @@ typedef struct macroblockd {
/* Inverse transform function pointers. */ /* Inverse transform function pointers. */
void (*itxm_add)(const int16_t *input, uint8_t *dest, int stride, int eob); void (*itxm_add)(const int16_t *input, uint8_t *dest, int stride, int eob);
struct subpix_fn_table subpix; const interp_kernel *interp_kernel;
int corrupted; int corrupted;

View File

@@ -35,11 +35,6 @@ typedef enum {
typedef int16_t interp_kernel[SUBPEL_TAPS]; typedef int16_t interp_kernel[SUBPEL_TAPS];
struct subpix_fn_table {
const interp_kernel *filter_x;
const interp_kernel *filter_y;
};
const interp_kernel *vp9_get_interp_kernel(INTERP_FILTER filter); const interp_kernel *vp9_get_interp_kernel(INTERP_FILTER filter);
extern const interp_kernel vp9_bilinear_filters[SUBPEL_SHIFTS]; extern const interp_kernel vp9_bilinear_filters[SUBPEL_SHIFTS];

View File

@@ -69,13 +69,11 @@ static void inter_predictor(const uint8_t *src, int src_stride,
const int subpel_y, const int subpel_y,
const struct scale_factors *sf, const struct scale_factors *sf,
int w, int h, int ref, int w, int h, int ref,
const struct subpix_fn_table *subpix, const interp_kernel *kernel,
int xs, int ys) { int xs, int ys) {
sf->predict[subpel_x != 0][subpel_y != 0][ref]( sf->predict[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride, src, src_stride, dst, dst_stride,
subpix->filter_x[subpel_x], xs, kernel[subpel_x], xs, kernel[subpel_y], ys, w, h);
subpix->filter_y[subpel_y], ys,
w, h);
} }
void vp9_build_inter_predictor(const uint8_t *src, int src_stride, void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
@@ -83,7 +81,7 @@ void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
const MV *src_mv, const MV *src_mv,
const struct scale_factors *sf, const struct scale_factors *sf,
int w, int h, int ref, int w, int h, int ref,
const struct subpix_fn_table *subpix, const interp_kernel *kernel,
enum mv_precision precision, enum mv_precision precision,
int x, int y) { int x, int y) {
const int is_q4 = precision == MV_PRECISION_Q4; const int is_q4 = precision == MV_PRECISION_Q4;
@@ -96,7 +94,7 @@ void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
src += (mv.row >> SUBPEL_BITS) * src_stride + (mv.col >> SUBPEL_BITS); src += (mv.row >> SUBPEL_BITS) * src_stride + (mv.col >> SUBPEL_BITS);
inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y,
sf, w, h, ref, subpix, sf->x_step_q4, sf->y_step_q4); sf, w, h, ref, kernel, sf->x_step_q4, sf->y_step_q4);
} }
static INLINE int round_mv_comp_q4(int value) { static INLINE int round_mv_comp_q4(int value) {
@@ -198,7 +196,8 @@ static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
+ (scaled_mv.col >> SUBPEL_BITS); + (scaled_mv.col >> SUBPEL_BITS);
inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride, inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride,
subpel_x, subpel_y, sf, w, h, ref, &xd->subpix, xs, ys); subpel_x, subpel_y, sf, w, h, ref, xd->interp_kernel,
xs, ys);
} }
} }
@@ -367,7 +366,7 @@ static void dec_build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
} }
inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x, inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x,
subpel_y, sf, w, h, ref, &xd->subpix, xs, ys); subpel_y, sf, w, h, ref, xd->interp_kernel, xs, ys);
} }
} }

View File

@@ -18,7 +18,6 @@
extern "C" { extern "C" {
#endif #endif
struct subpix_fn_table;
void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col, void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize); BLOCK_SIZE bsize);
@@ -36,7 +35,7 @@ void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
const MV *mv_q3, const MV *mv_q3,
const struct scale_factors *sf, const struct scale_factors *sf,
int w, int h, int do_avg, int w, int h, int do_avg,
const struct subpix_fn_table *subpix, const interp_kernel *kernel,
enum mv_precision precision, enum mv_precision precision,
int x, int y); int x, int y);

View File

@@ -421,8 +421,7 @@ static void decode_modes_b(VP9_COMMON *const cm, MACROBLOCKD *const xd,
if (has_second_ref(mbmi)) if (has_second_ref(mbmi))
set_ref(cm, xd, 1, mi_row, mi_col); set_ref(cm, xd, 1, mi_row, mi_col);
xd->subpix.filter_x = xd->subpix.filter_y = xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
vp9_get_interp_kernel(mbmi->interp_filter);
// Prediction // Prediction
vp9_dec_build_inter_predictors_sb(xd, mi_row, mi_col, bsize); vp9_dec_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);

View File

@@ -37,10 +37,9 @@ void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter,
set_ref_ptrs(cm, xd, -1, -1); set_ref_ptrs(cm, xd, -1, -1);
} }
xd->subpix.filter_x = xd->subpix.filter_y = xd->interp_kernel = vp9_get_interp_kernel(filter == SWITCHABLE ? EIGHTTAP
vp9_get_interp_kernel(filter == SWITCHABLE ? EIGHTTAP : filter); : filter);
assert(((intptr_t)xd->interp_kernel & 0xff) == 0);
assert(((intptr_t)xd->subpix.filter_x & 0xff) == 0);
} }
void vp9_subtract_block_c(int rows, int cols, void vp9_subtract_block_c(int rows, int cols,

View File

@@ -1517,8 +1517,8 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
vp9_build_inter_predictor(pre, pd->pre[ref].stride, vp9_build_inter_predictor(pre, pd->pre[ref].stride,
dst, pd->dst.stride, dst, pd->dst.stride,
&mi->bmi[i].as_mv[ref].as_mv, &mi->bmi[i].as_mv[ref].as_mv,
&xd->block_refs[ref]->sf, &xd->block_refs[ref]->sf, width, height, ref,
width, height, ref, &xd->subpix, MV_PRECISION_Q3, xd->interp_kernel, MV_PRECISION_Q3,
mi_col * MI_SIZE + 4 * (i % 2), mi_col * MI_SIZE + 4 * (i % 2),
mi_row * MI_SIZE + 4 * (i / 2)); mi_row * MI_SIZE + 4 * (i / 2));
} }
@@ -2536,7 +2536,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
&frame_mv[refs[!id]].as_mv, &frame_mv[refs[!id]].as_mv,
&xd->block_refs[!id]->sf, &xd->block_refs[!id]->sf,
pw, ph, 0, pw, ph, 0,
&xd->subpix, MV_PRECISION_Q3, xd->interp_kernel, MV_PRECISION_Q3,
mi_col * MI_SIZE, mi_row * MI_SIZE); mi_col * MI_SIZE, mi_row * MI_SIZE);
// Compound motion search on first ref frame. // Compound motion search on first ref frame.

View File

@@ -60,7 +60,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
scale, scale,
16, 16, 16, 16,
which_mv, which_mv,
&xd->subpix, MV_PRECISION_Q3, x, y); xd->interp_kernel, MV_PRECISION_Q3, x, y);
vp9_build_inter_predictor(u_mb_ptr, uv_stride, vp9_build_inter_predictor(u_mb_ptr, uv_stride,
&pred[256], uv_block_size, &pred[256], uv_block_size,
@@ -68,7 +68,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
scale, scale,
uv_block_size, uv_block_size, uv_block_size, uv_block_size,
which_mv, which_mv,
&xd->subpix, mv_precision_uv, x, y); xd->interp_kernel, mv_precision_uv, x, y);
vp9_build_inter_predictor(v_mb_ptr, uv_stride, vp9_build_inter_predictor(v_mb_ptr, uv_stride,
&pred[512], uv_block_size, &pred[512], uv_block_size,
@@ -76,7 +76,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
scale, scale,
uv_block_size, uv_block_size, uv_block_size, uv_block_size,
which_mv, which_mv,
&xd->subpix, mv_precision_uv, x, y); xd->interp_kernel, mv_precision_uv, x, y);
} }
void vp9_temporal_filter_apply_c(uint8_t *frame1, void vp9_temporal_filter_apply_c(uint8_t *frame1,