Commit 86915654 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Removing subpix_fn_table struct.

We don't use different filter kernels for x and y, it is always one kernel
for both directions.

Change-Id: Iefcbb02ec74bf46ea20d9dca672a3efd5d631517
parent f9f936b8
......@@ -252,7 +252,7 @@ typedef struct macroblockd {
/* Inverse transform function pointers. */
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;
......
......@@ -35,11 +35,6 @@ typedef enum {
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);
extern const interp_kernel vp9_bilinear_filters[SUBPEL_SHIFTS];
......
......@@ -69,13 +69,11 @@ static void inter_predictor(const uint8_t *src, int src_stride,
const int subpel_y,
const struct scale_factors *sf,
int w, int h, int ref,
const struct subpix_fn_table *subpix,
const interp_kernel *kernel,
int xs, int ys) {
sf->predict[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride,
subpix->filter_x[subpel_x], xs,
subpix->filter_y[subpel_y], ys,
w, h);
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h);
}
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 struct scale_factors *sf,
int w, int h, int ref,
const struct subpix_fn_table *subpix,
const interp_kernel *kernel,
enum mv_precision precision,
int x, int y) {
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);
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) {
......@@ -198,7 +196,8 @@ static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
+ (scaled_mv.col >> SUBPEL_BITS);
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,
subpel_y, sf, w, h, ref, &xd->subpix, xs, ys);
subpel_y, sf, w, h, ref, xd->interp_kernel, xs, ys);
}
}
......
......@@ -18,7 +18,6 @@
extern "C" {
#endif
struct subpix_fn_table;
void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize);
......@@ -36,7 +35,7 @@ void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
const MV *mv_q3,
const struct scale_factors *sf,
int w, int h, int do_avg,
const struct subpix_fn_table *subpix,
const interp_kernel *kernel,
enum mv_precision precision,
int x, int y);
......
......@@ -421,8 +421,7 @@ static void decode_modes_b(VP9_COMMON *const cm, MACROBLOCKD *const xd,
if (has_second_ref(mbmi))
set_ref(cm, xd, 1, mi_row, mi_col);
xd->subpix.filter_x = xd->subpix.filter_y =
vp9_get_interp_kernel(mbmi->interp_filter);
xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
// Prediction
vp9_dec_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
......
......@@ -37,10 +37,9 @@ void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter,
set_ref_ptrs(cm, xd, -1, -1);
}
xd->subpix.filter_x = xd->subpix.filter_y =
vp9_get_interp_kernel(filter == SWITCHABLE ? EIGHTTAP : filter);
assert(((intptr_t)xd->subpix.filter_x & 0xff) == 0);
xd->interp_kernel = vp9_get_interp_kernel(filter == SWITCHABLE ? EIGHTTAP
: filter);
assert(((intptr_t)xd->interp_kernel & 0xff) == 0);
}
void vp9_subtract_block_c(int rows, int cols,
......
......@@ -1517,8 +1517,8 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
vp9_build_inter_predictor(pre, pd->pre[ref].stride,
dst, pd->dst.stride,
&mi->bmi[i].as_mv[ref].as_mv,
&xd->block_refs[ref]->sf,
width, height, ref, &xd->subpix, MV_PRECISION_Q3,
&xd->block_refs[ref]->sf, width, height, ref,
xd->interp_kernel, MV_PRECISION_Q3,
mi_col * 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,
&xd->block_refs[!id]->sf,
pw, ph, 0,
&xd->subpix, MV_PRECISION_Q3,
xd->interp_kernel, MV_PRECISION_Q3,
mi_col * MI_SIZE, mi_row * MI_SIZE);
// Compound motion search on first ref frame.
......
......@@ -60,7 +60,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
scale,
16, 16,
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,
&pred[256], uv_block_size,
......@@ -68,7 +68,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
scale,
uv_block_size, uv_block_size,
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,
&pred[512], uv_block_size,
......@@ -76,7 +76,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
scale,
uv_block_size, uv_block_size,
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,
......
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