Commit 48589e8d authored by Debargha Mukherjee's avatar Debargha Mukherjee Committed by Gerrit Code Review

Merge "Some refactoring and cleanups of interp filter" into nextgenv2

parents 95428a59 bab2912b
......@@ -11,10 +11,10 @@ using libvpx_test::ACMRandom;
namespace {
TEST(VP10ConvolveTest, vp10_convolve8) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
INTERP_FILTER interp_filter = EIGHTTAP;
INTERP_FILTER interp_filter = EIGHTTAP_REGULAR;
InterpFilterParams filter_params =
vp10_get_interp_filter_params(interp_filter);
ptrdiff_t filter_size = filter_params.tap;
ptrdiff_t filter_size = filter_params.taps;
int filter_center = filter_size / 2 - 1;
uint8_t src[12 * 12];
int src_stride = filter_size;
......@@ -39,9 +39,9 @@ TEST(VP10ConvolveTest, vp10_convolve8) {
subpel_y_q4, y_step_q4, avg);
const int16_t* x_filter =
vp10_get_interp_filter_kernel(filter_params, subpel_x_q4);
vp10_get_interp_filter_subpel_kernel(filter_params, subpel_x_q4);
const int16_t* y_filter =
vp10_get_interp_filter_kernel(filter_params, subpel_y_q4);
vp10_get_interp_filter_subpel_kernel(filter_params, subpel_y_q4);
vpx_convolve8_c(src + src_stride * filter_center + filter_center, src_stride,
dst1, dst_stride, x_filter, 16, y_filter, 16, w, h);
......@@ -49,10 +49,10 @@ TEST(VP10ConvolveTest, vp10_convolve8) {
}
TEST(VP10ConvolveTest, vp10_convolve) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
INTERP_FILTER interp_filter = EIGHTTAP;
INTERP_FILTER interp_filter = EIGHTTAP_REGULAR;
InterpFilterParams filter_params =
vp10_get_interp_filter_params(interp_filter);
ptrdiff_t filter_size = filter_params.tap;
ptrdiff_t filter_size = filter_params.taps;
int filter_center = filter_size / 2 - 1;
uint8_t src[12 * 12];
int src_stride = filter_size;
......@@ -78,9 +78,9 @@ TEST(VP10ConvolveTest, vp10_convolve) {
subpel_x_q4, x_step_q4, subpel_y_q4, y_step_q4, avg);
const int16_t* x_filter =
vp10_get_interp_filter_kernel(filter_params, subpel_x_q4);
vp10_get_interp_filter_subpel_kernel(filter_params, subpel_x_q4);
const int16_t* y_filter =
vp10_get_interp_filter_kernel(filter_params, subpel_y_q4);
vp10_get_interp_filter_subpel_kernel(filter_params, subpel_y_q4);
int temp[12];
int dst_ref = 0;
......@@ -100,10 +100,10 @@ TEST(VP10ConvolveTest, vp10_convolve) {
TEST(VP10ConvolveTest, vp10_convolve_avg) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
INTERP_FILTER interp_filter = EIGHTTAP;
INTERP_FILTER interp_filter = EIGHTTAP_REGULAR;
InterpFilterParams filter_params =
vp10_get_interp_filter_params(interp_filter);
ptrdiff_t filter_size = filter_params.tap;
ptrdiff_t filter_size = filter_params.taps;
int filter_center = filter_size / 2 - 1;
uint8_t src0[12 * 12];
uint8_t src1[12 * 12];
......@@ -157,10 +157,10 @@ TEST(VP10ConvolveTest, vp10_convolve_avg) {
#if CONFIG_VP9_HIGHBITDEPTH
TEST(VP10ConvolveTest, vp10_highbd_convolve) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
INTERP_FILTER interp_filter = EIGHTTAP;
INTERP_FILTER interp_filter = EIGHTTAP_REGULAR;
InterpFilterParams filter_params =
vp10_get_interp_filter_params(interp_filter);
ptrdiff_t filter_size = filter_params.tap;
ptrdiff_t filter_size = filter_params.taps;
int filter_center = filter_size / 2 - 1;
uint16_t src[12 * 12];
int src_stride = filter_size;
......@@ -188,9 +188,9 @@ TEST(VP10ConvolveTest, vp10_highbd_convolve) {
subpel_x_q4, x_step_q4, subpel_y_q4, y_step_q4, avg, bd);
const int16_t* x_filter =
vp10_get_interp_filter_kernel(filter_params, subpel_x_q4);
vp10_get_interp_filter_subpel_kernel(filter_params, subpel_x_q4);
const int16_t* y_filter =
vp10_get_interp_filter_kernel(filter_params, subpel_y_q4);
vp10_get_interp_filter_subpel_kernel(filter_params, subpel_y_q4);
int temp[12];
int dst_ref = 0;
......@@ -211,10 +211,10 @@ TEST(VP10ConvolveTest, vp10_highbd_convolve) {
TEST(VP10ConvolveTest, vp10_highbd_convolve_avg) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
INTERP_FILTER interp_filter = EIGHTTAP;
INTERP_FILTER interp_filter = EIGHTTAP_REGULAR;
InterpFilterParams filter_params =
vp10_get_interp_filter_params(interp_filter);
ptrdiff_t filter_size = filter_params.tap;
ptrdiff_t filter_size = filter_params.taps;
int filter_center = filter_size / 2 - 1;
uint16_t src0[12 * 12];
uint16_t src1[12 * 12];
......
......@@ -39,8 +39,7 @@ typedef enum {
} FRAME_TYPE;
#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
#define IsInterpolatingFilter(filter) \
(vp10_filter_kernels[filter][0][SUBPEL_TAPS / 2 - 1] == 128)
#define IsInterpolatingFilter(filter) (vp10_is_interpolating_filter(filter))
#else
#define IsInterpolatingFilter(filter) (1)
#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
......
......@@ -1348,23 +1348,23 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#if CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 4
const vpx_tree_index vp10_switchable_interp_tree
[TREE_SIZE(SWITCHABLE_FILTERS)] = {
-EIGHTTAP, 2,
4, -EIGHTTAP_SHARP,
-EIGHTTAP_REGULAR, 2,
4, -MULTITAP_SHARP,
-EIGHTTAP_SMOOTH, -EIGHTTAP_SMOOTH2,
};
#elif CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5
const vpx_tree_index vp10_switchable_interp_tree
[TREE_SIZE(SWITCHABLE_FILTERS)] = {
-EIGHTTAP, 2,
-EIGHTTAP_REGULAR, 2,
4, 6,
-EIGHTTAP_SMOOTH, -EIGHTTAP_SMOOTH2,
-EIGHTTAP_SHARP, -EIGHTTAP_SHARP2,
-MULTITAP_SHARP, -MULTITAP_SHARP2,
};
#else
const vpx_tree_index vp10_switchable_interp_tree
[TREE_SIZE(SWITCHABLE_FILTERS)] = {
-EIGHTTAP, 2,
-EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP
-EIGHTTAP_REGULAR, 2,
-EIGHTTAP_SMOOTH, -MULTITAP_SHARP
};
#endif // CONFIG_EXT_INTERP
......
......@@ -32,8 +32,9 @@ DECLARE_ALIGNED(256, static const InterpKernel,
{ 0, 0, 0, 8, 120, 0, 0, 0 }
};
#if (CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5) || FILTER_12TAP
DECLARE_ALIGNED(16, static const int16_t,
sub_pel_filters_12sharp[16][12]) = {
sub_pel_filters_12sharp[SUBPEL_SHIFTS][12]) = {
// intfilt 0.8
{0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0},
{0, 1, -1, 3, -7, 127, 8, -4, 2, -1, 0, 0},
......@@ -52,10 +53,11 @@ DECLARE_ALIGNED(16, static const int16_t,
{0, 1, -2, 4, -8, 18, 124, -12, 5, -3, 1, 0},
{0, 0, -1, 2, -4, 8, 127, -7, 3, -1, 1, 0},
};
#endif
#if CONFIG_EXT_INTERP
DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8[SUBPEL_SHIFTS]) = {
#if CONFIG_EXT_INTERP
// intfilt 0.575
{0, 0, 0, 128, 0, 0, 0, 0},
{0, 1, -5, 126, 8, -3, 1, 0},
......@@ -73,30 +75,10 @@ DECLARE_ALIGNED(256, static const InterpKernel,
{0, 3, -9, 27, 118, -14, 4, -1},
{-1, 2, -6, 18, 123, -10, 3, -1},
{0, 1, -3, 8, 126, -5, 1, 0},
#else
// Lagrangian interpolation filter
{ 0, 0, 0, 128, 0, 0, 0, 0},
{ 0, 1, -5, 126, 8, -3, 1, 0},
{ -1, 3, -10, 122, 18, -6, 2, 0},
{ -1, 4, -13, 118, 27, -9, 3, -1},
{ -1, 4, -16, 112, 37, -11, 4, -1},
{ -1, 5, -18, 105, 48, -14, 4, -1},
{ -1, 5, -19, 97, 58, -16, 5, -1},
{ -1, 6, -19, 88, 68, -18, 5, -1},
{ -1, 6, -19, 78, 78, -19, 6, -1},
{ -1, 5, -18, 68, 88, -19, 6, -1},
{ -1, 5, -16, 58, 97, -19, 5, -1},
{ -1, 4, -14, 48, 105, -18, 5, -1},
{ -1, 4, -11, 37, 112, -16, 4, -1},
{ -1, 3, -9, 27, 118, -13, 4, -1},
{ 0, 2, -6, 18, 122, -10, 3, -1},
{ 0, 1, -3, 8, 126, -5, 1, 0}
#endif // CONFIG_EXT_INTERP
};
DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8sharp[SUBPEL_SHIFTS]) = {
#if CONFIG_EXT_INTERP
// intfilt 0.8
{0, 0, 0, 128, 0, 0, 0, 0},
{-1, 2, -6, 127, 9, -4, 2, -1},
......@@ -114,29 +96,9 @@ DECLARE_ALIGNED(256, static const InterpKernel,
{-2, 5, -11, 28, 119, -16, 7, -2},
{-2, 4, -7, 18, 124, -12, 5, -2},
{-1, 2, -4, 9, 127, -6, 2, -1},
#else
// DCT based filter
{0, 0, 0, 128, 0, 0, 0, 0},
{-1, 3, -7, 127, 8, -3, 1, 0},
{-2, 5, -13, 125, 17, -6, 3, -1},
{-3, 7, -17, 121, 27, -10, 5, -2},
{-4, 9, -20, 115, 37, -13, 6, -2},
{-4, 10, -23, 108, 48, -16, 8, -3},
{-4, 10, -24, 100, 59, -19, 9, -3},
{-4, 11, -24, 90, 70, -21, 10, -4},
{-4, 11, -23, 80, 80, -23, 11, -4},
{-4, 10, -21, 70, 90, -24, 11, -4},
{-3, 9, -19, 59, 100, -24, 10, -4},
{-3, 8, -16, 48, 108, -23, 10, -4},
{-2, 6, -13, 37, 115, -20, 9, -4},
{-2, 5, -10, 27, 121, -17, 7, -3},
{-1, 3, -6, 17, 125, -13, 5, -2},
{0, 1, -3, 8, 127, -7, 3, -1}
#endif // CONFIG_EXT_INTERP
};
#if CONFIG_EXT_INTERP && (SWITCHABLE_FILTERS == 4 || SWITCHABLE_FILTERS == 5)
#if SWITCHABLE_FILTERS >= 4
DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8smooth2[SUBPEL_SHIFTS]) = {
// freqmultiplier = 0.35
......@@ -178,7 +140,56 @@ DECLARE_ALIGNED(256, static const InterpKernel,
{0, 2, -12, 37, 94, 14, -9, 2},
{0, 2, -11, 31, 95, 19, -10, 2},
};
#else
#endif // SWITCHABLE_FILTERS >= 4
#if SWITCHABLE_FILTERS == 5
// Once FILTER 12TAP is resolved move the sub_pel_filters_12sharp
// filter here.
#endif
#else // CONFIG_EXT_INTERP
DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8[SUBPEL_SHIFTS]) = {
// Lagrangian interpolation filter
{ 0, 0, 0, 128, 0, 0, 0, 0},
{ 0, 1, -5, 126, 8, -3, 1, 0},
{ -1, 3, -10, 122, 18, -6, 2, 0},
{ -1, 4, -13, 118, 27, -9, 3, -1},
{ -1, 4, -16, 112, 37, -11, 4, -1},
{ -1, 5, -18, 105, 48, -14, 4, -1},
{ -1, 5, -19, 97, 58, -16, 5, -1},
{ -1, 6, -19, 88, 68, -18, 5, -1},
{ -1, 6, -19, 78, 78, -19, 6, -1},
{ -1, 5, -18, 68, 88, -19, 6, -1},
{ -1, 5, -16, 58, 97, -19, 5, -1},
{ -1, 4, -14, 48, 105, -18, 5, -1},
{ -1, 4, -11, 37, 112, -16, 4, -1},
{ -1, 3, -9, 27, 118, -13, 4, -1},
{ 0, 2, -6, 18, 122, -10, 3, -1},
{ 0, 1, -3, 8, 126, -5, 1, 0}
};
DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8sharp[SUBPEL_SHIFTS]) = {
// DCT based filter
{0, 0, 0, 128, 0, 0, 0, 0},
{-1, 3, -7, 127, 8, -3, 1, 0},
{-2, 5, -13, 125, 17, -6, 3, -1},
{-3, 7, -17, 121, 27, -10, 5, -2},
{-4, 9, -20, 115, 37, -13, 6, -2},
{-4, 10, -23, 108, 48, -16, 8, -3},
{-4, 10, -24, 100, 59, -19, 9, -3},
{-4, 11, -24, 90, 70, -21, 10, -4},
{-4, 11, -23, 80, 80, -23, 11, -4},
{-4, 10, -21, 70, 90, -24, 11, -4},
{-3, 9, -19, 59, 100, -24, 10, -4},
{-3, 8, -16, 48, 108, -23, 10, -4},
{-2, 6, -13, 37, 115, -20, 9, -4},
{-2, 5, -10, 27, 121, -17, 7, -3},
{-1, 3, -6, 17, 125, -13, 5, -2},
{0, 1, -3, 8, 127, -7, 3, -1}
};
DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8smooth[SUBPEL_SHIFTS]) = {
......@@ -202,41 +213,38 @@ DECLARE_ALIGNED(256, static const InterpKernel,
};
#endif // CONFIG_EXT_INTERP
const InterpKernel *vp10_filter_kernels[SWITCHABLE_FILTERS + 1] = {
sub_pel_filters_8,
sub_pel_filters_8smooth,
sub_pel_filters_8sharp,
#if CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 4
sub_pel_filters_8smooth2,
#elif CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5
sub_pel_filters_8smooth2,
(const InterpKernel*)sub_pel_filters_12sharp,
#endif
bilinear_filters
};
#if CONFIG_EXT_INTRA
const InterpKernel *vp10_intra_filter_kernels[INTRA_FILTERS] = {
bilinear_filters, // INTRA_FILTER_LINEAR
sub_pel_filters_8, // INTRA_FILTER_8TAP
sub_pel_filters_8sharp, // INTRA_FILTER_8TAP_SHARP
sub_pel_filters_8smooth, // INTRA_FILTER_8TAP_SMOOTH
bilinear_filters, // INTRA_FILTER_LINEAR
sub_pel_filters_8, // INTRA_FILTER_8TAP
sub_pel_filters_8sharp, // INTRA_FILTER_8TAP_SHARP
sub_pel_filters_8smooth, // INTRA_FILTER_8TAP_SMOOTH
};
#endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_INTERP
static const InterpFilterParams
vp10_interp_filter_params_list[SWITCHABLE_FILTERS + 1] = {
{(const int16_t*)sub_pel_filters_8, SUBPEL_TAPS, SUBPEL_SHIFTS},
{(const int16_t*)sub_pel_filters_8smooth, SUBPEL_TAPS, SUBPEL_SHIFTS},
{(const int16_t*)sub_pel_filters_8sharp, SUBPEL_TAPS, SUBPEL_SHIFTS},
#if CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 4
{(const int16_t*)sub_pel_filters_8smooth2, SUBPEL_TAPS, SUBPEL_SHIFTS},
#elif CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5
#if SWITCHABLE_FILTERS >= 4
{(const int16_t*)sub_pel_filters_8smooth2, SUBPEL_TAPS, SUBPEL_SHIFTS},
#endif
#if SWITCHABLE_FILTERS == 5
{(const int16_t*)sub_pel_filters_12sharp, 12, SUBPEL_SHIFTS},
#endif
{(const int16_t*)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS}
};
#else
static const InterpFilterParams
vp10_interp_filter_params_list[SWITCHABLE_FILTERS + 1] = {
{(const int16_t*)sub_pel_filters_8, SUBPEL_TAPS, SUBPEL_SHIFTS},
{(const int16_t*)sub_pel_filters_8smooth, SUBPEL_TAPS, SUBPEL_SHIFTS},
{(const int16_t*)sub_pel_filters_8sharp, SUBPEL_TAPS, SUBPEL_SHIFTS},
{(const int16_t*)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS}
};
#endif // CONFIG_EXT_INTERP
#if FILTER_12TAP
static const InterpFilterParams vp10_interp_filter_12tap = {
......@@ -252,3 +260,9 @@ InterpFilterParams vp10_get_interp_filter_params(
#endif
return vp10_interp_filter_params_list[interp_filter];
}
const int16_t *vp10_get_interp_filter_kernel(
const INTERP_FILTER interp_filter) {
return (const int16_t*)
vp10_interp_filter_params_list[interp_filter].filter_ptr;
}
......@@ -21,23 +21,20 @@
extern "C" {
#endif
#define EIGHTTAP 0
#define EIGHTTAP_REGULAR 0
#define EIGHTTAP_SMOOTH 1
#define EIGHTTAP_SHARP 2
#define MULTITAP_SHARP 2
#if CONFIG_EXT_INTERP
#define MAX_SUBPEL_TAPS 12
#define SUPPORT_NONINTERPOLATING_FILTERS 0 /* turn it on for experimentation */
#define SWITCHABLE_FILTERS 5 /* Number of switchable filters */
#if SWITCHABLE_FILTERS == 4
#define EIGHTTAP_SMOOTH2 3
#elif SWITCHABLE_FILTERS == 5
#if SWITCHABLE_FILTERS >= 4
#define EIGHTTAP_SMOOTH2 3
#define EIGHTTAP_SHARP2 4
#endif
#if SWITCHABLE_FILTERS == 5
#define MULTITAP_SHARP2 4
#endif // SWITCHABLE_FILTERS
#else
......@@ -59,8 +56,6 @@ extern "C" {
typedef uint8_t INTERP_FILTER;
extern const InterpKernel *vp10_filter_kernels[SWITCHABLE_FILTERS + 1];
#if CONFIG_EXT_INTRA
typedef enum {
INTRA_FILTER_LINEAR,
......@@ -75,15 +70,25 @@ extern const InterpKernel *vp10_intra_filter_kernels[INTRA_FILTERS];
typedef struct InterpFilterParams {
const int16_t* filter_ptr;
uint16_t tap;
uint16_t taps;
uint16_t subpel_shifts;
} InterpFilterParams;
InterpFilterParams vp10_get_interp_filter_params(
const INTERP_FILTER interp_filter);
static INLINE const int16_t* vp10_get_interp_filter_kernel(
const int16_t *vp10_get_interp_filter_kernel(
const INTERP_FILTER interp_filter);
static INLINE const int16_t* vp10_get_interp_filter_subpel_kernel(
const InterpFilterParams filter_params, const int subpel) {
return filter_params.filter_ptr + filter_params.tap * subpel;
return filter_params.filter_ptr + filter_params.taps * subpel;
}
static INLINE int vp10_is_interpolating_filter(
const INTERP_FILTER interp_filter) {
const InterpFilterParams ip = vp10_get_interp_filter_params(interp_filter);
return (ip.filter_ptr[ip.taps / 2 - 1] == 128);
}
#ifdef __cplusplus
} // extern "C"
......
......@@ -46,13 +46,13 @@ int vp10_get_pred_context_intra_interp(const MACROBLOCKD *xd) {
PREDICTION_MODE mode = left_mbmi->mode;
if (is_inter_block(left_mbmi)) {
switch (left_mbmi->interp_filter) {
case EIGHTTAP:
case EIGHTTAP_REGULAR:
left_type = INTRA_FILTER_8TAP;
break;
case EIGHTTAP_SMOOTH:
left_type = INTRA_FILTER_8TAP_SMOOTH;
break;
case EIGHTTAP_SHARP:
case MULTITAP_SHARP:
left_type = INTRA_FILTER_8TAP_SHARP;
break;
case BILINEAR:
......@@ -76,13 +76,13 @@ int vp10_get_pred_context_intra_interp(const MACROBLOCKD *xd) {
if (xd->up_available && above_mbmi->sb_type >= BLOCK_8X8) {
if (is_inter_block(above_mbmi)) {
switch (above_mbmi->interp_filter) {
case EIGHTTAP:
case EIGHTTAP_REGULAR:
above_type = INTRA_FILTER_8TAP;
break;
case EIGHTTAP_SMOOTH:
above_type = INTRA_FILTER_8TAP_SMOOTH;
break;
case EIGHTTAP_SHARP:
case MULTITAP_SHARP:
above_type = INTRA_FILTER_8TAP_SHARP;
break;
case BILINEAR:
......
......@@ -30,23 +30,26 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
int xs, int ys) {
InterpFilterParams interp_filter_params =
vp10_get_interp_filter_params(interp_filter);
if (interp_filter_params.tap == SUBPEL_TAPS) {
const InterpKernel *kernel = vp10_filter_kernels[interp_filter];
if (interp_filter_params.taps == SUBPEL_TAPS) {
const int16_t *kernel_x =
vp10_get_interp_filter_subpel_kernel(interp_filter_params, subpel_x);
const int16_t *kernel_y =
vp10_get_interp_filter_subpel_kernel(interp_filter_params, subpel_y);
#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
if (IsInterpolatingFilter(interp_filter)) {
// Interpolating filter
sf->predict[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride,
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h);
kernel_x, xs, kernel_y, ys, w, h);
} else {
sf->predict_ni[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride,
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h);
kernel_x, xs, kernel_y, ys, w, h);
}
#else
sf->predict[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride,
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h);
kernel_x, xs, kernel_y, ys, w, h);
#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
} else {
// ref > 0 means this is the second reference frame
......@@ -69,23 +72,26 @@ static INLINE void high_inter_predictor(const uint8_t *src, int src_stride,
int xs, int ys, int bd) {
InterpFilterParams interp_filter_params =
vp10_get_interp_filter_params(interp_filter);
if (interp_filter_params.tap == SUBPEL_TAPS) {
const InterpKernel *kernel = vp10_filter_kernels[interp_filter];
if (interp_filter_params.taps == SUBPEL_TAPS) {
const int16_t *kernel_x =
vp10_get_interp_filter_subpel_kernel(interp_filter_params, subpel_x);
const int16_t *kernel_y =
vp10_get_interp_filter_subpel_kernel(interp_filter_params, subpel_y);
#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
if (IsInterpolatingFilter(interp_filter)) {
// Interpolating filter
sf->highbd_predict[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride,
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h, bd);
kernel_x, xs, kernel_y, ys, w, h, bd);
} else {
sf->highbd_predict_ni[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride,
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h, bd);
kernel_x, xs, kernel_y, ys, w, h, bd);
}
#else
sf->highbd_predict[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride,
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h, bd);
kernel_x, xs, kernel_y, ys, w, h, bd);
#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
} else {
// ref > 0 means this is the second reference frame
......
......@@ -326,8 +326,9 @@ static void dr_prediction_z1(uint8_t *dst, ptrdiff_t stride, int bs,
}
} else {
if (!flags[shift]) {
const int16_t *filter = vp10_intra_filter_kernels[filter_type][shift];
vpx_convolve8_horiz(src + pad_size, 2 * bs, buf[shift], 2 * bs,
vp10_intra_filter_kernels[filter_type][shift], 16,
filter, 16,
NULL, 16, 2 * bs, 2 * bs < 16 ? 2 : 1);
flags[shift] = 1;
}
......@@ -457,9 +458,10 @@ static void dr_prediction_z3(uint8_t *dst, ptrdiff_t stride, int bs,
}
} else {
if (!flags[shift]) {
const int16_t *filter = vp10_intra_filter_kernels[filter_type][shift];
vpx_convolve8_vert(src + 4 * pad_size, 4,
buf[0] + 4 * shift, 4 * SUBPEL_SHIFTS, NULL, 16,
vp10_intra_filter_kernels[filter_type][shift], 16,
filter, 16,
2 * bs < 16 ? 4 : 4, 2 * bs);
flags[shift] = 1;
}
......
......@@ -15,14 +15,15 @@ static void convolve_horiz(const uint8_t *src, int src_stride, uint8_t *dst,
const InterpFilterParams filter_params,
const int subpel_x_q4, int x_step_q4, int avg) {
int x, y;
int filter_size = filter_params.tap;
int filter_size = filter_params.taps;
src -= filter_size / 2 - 1;
for (y = 0; y < h; ++y) {
int x_q4 = subpel_x_q4;
for (x = 0; x < w; ++x) {
const uint8_t *const src_x = &src[x_q4 >> SUBPEL_BITS];
const int16_t *x_filter =
vp10_get_interp_filter_kernel(filter_params, x_q4 & SUBPEL_MASK);
vp10_get_interp_filter_subpel_kernel(
filter_params, x_q4 & SUBPEL_MASK);
int k, sum = 0;
for (k = 0; k < filter_size; ++k) sum += src_x[k] * x_filter[k];
if (avg) {
......@@ -43,7 +44,7 @@ static void convolve_vert(const uint8_t *src, int src_stride, uint8_t *dst,
const InterpFilterParams filter_params,
const int subpel_y_q4, int y_step_q4, int avg) {
int x, y;
int filter_size = filter_params.tap;
int filter_size = filter_params.taps;
src -= src_stride * (filter_size / 2 - 1);
for (x = 0; x < w; ++x) {
......@@ -51,7 +52,8 @@ static void convolve_vert(const uint8_t *src, int src_stride, uint8_t *dst,
for (y = 0; y < h; ++y) {
const uint8_t *const src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride];
const int16_t *y_filter =
vp10_get_interp_filter_kernel(filter_params, y_q4 & SUBPEL_MASK);
vp10_get_interp_filter_subpel_kernel(
filter_params, y_q4 & SUBPEL_MASK);
int k, sum = 0;
for (k = 0; k < filter_size; ++k)
sum += src_y[k * src_stride] * y_filter[k];
......@@ -96,7 +98,7 @@ void vp10_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
const InterpFilterParams filter_params,
const int subpel_x_q4, int x_step_q4, const int subpel_y_q4,
int y_step_q4, int avg) {
int filter_size = filter_params.tap;
int filter_size = filter_params.taps;
int ignore_horiz = x_step_q4 == 16 && subpel_x_q4 == 0;
int ignore_vert = y_step_q4 == 16 && subpel_y_q4 == 0;
......@@ -104,7 +106,7 @@ void vp10_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
assert(h <= MAX_BLOCK_HEIGHT);
assert(y_step_q4 <= MAX_STEP);
assert(x_step_q4 <= MAX_STEP);
assert(filter_params.tap <= MAX_FILTER_TAP);
assert(filter_params.taps <= MAX_FILTER_TAP);
if (ignore_horiz && ignore_vert) {
convolve_copy(src, src_stride, dst, dst_stride, w, h, avg);
......@@ -140,14 +142,15 @@ static void highbd_convolve_horiz(const uint16_t *src, int src_stride,
const int subpel_x_q4, int x_step_q4, int avg,
int bd) {
int x, y;
int filter_size = filter_params.tap;
int filter_size = filter_params.taps;
src -= filter_size / 2 - 1;
for (y = 0; y < h; ++y) {
int x_q4 = subpel_x_q4;
for (x = 0; x < w; ++x) {
const uint16_t *const src_x = &src[x_q4 >> SUBPEL_BITS];
const int16_t *x_filter =
vp10_get_interp_filter_kernel(filter_params, x_q4 & SUBPEL_MASK);
vp10_get_interp_filter_subpel_kernel(
filter_params, x_q4 & SUBPEL_MASK);
int k, sum = 0;
for (k = 0; k < filter_size; ++k) sum += src_x[k] * x_filter[k];
if (avg)
......@@ -170,7 +173,7 @@ static void highbd_convolve_vert(const uint16_t *src, int src_stride,
const int subpel_y_q4, int y_step_q4, int avg,
int bd) {
int x, y;
int filter_size = filter_params.tap;
int filter_size = filter_params.taps;
src -= src_stride * (filter_size / 2 - 1);