Commit 259d4422 authored by Hui Su's avatar Hui Su
Browse files

Remove the intra-interp experiment

This experiment uses switchable interpolation filter for intra
prediction. Current gain is too small to be useful for AV1.
May explore more for AV2 in the future.

Change-Id: I24ae8c75dc71adf6271eabdb68a81b68a0869fa2
parent 1e17d2a4
......@@ -286,18 +286,4 @@ const int16_t dr_intra_derivative[90] = {
119, 113, 108, 103, 98, 93, 88, 83, 78, 73, 68, 63, 59,
54, 49, 45, 40, 35, 31, 26, 22, 17, 13, 8, 4,
};
#if CONFIG_INTRA_INTERP
int av1_is_intra_filter_switchable(int angle) {
assert(angle > 0 && angle < 270);
if (angle % 45 == 0) return 0;
if (angle > 90 && angle < 180) {
return 1;
} else {
return ((angle < 90 ? dr_intra_derivative[angle]
: dr_intra_derivative[270 - angle]) &
0xFF) > 0;
}
}
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
......@@ -395,10 +395,6 @@ typedef struct MB_MODE_INFO {
#if CONFIG_EXT_INTRA
// The actual prediction angle is the base angle + (angle_delta * step).
int8_t angle_delta[2];
#if CONFIG_INTRA_INTERP
// To-Do (huisu): this may be replaced by interp_filter
INTRA_FILTER intra_filter;
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_INTERINTRA
......@@ -1226,11 +1222,6 @@ static const uint8_t mode_to_angle_map[] = {
0, 0,
#endif // CONFIG_SMOOTH_HV
};
#if CONFIG_INTRA_INTERP
// Returns whether filter selection is needed for a given
// intra prediction angle.
int av1_is_intra_filter_switchable(int angle);
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_DCT_ONLY
......
......@@ -2299,9 +2299,6 @@ void av1_average_tile_intra_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
#if CONFIG_EXT_DELTA_Q
AVERAGE_TILE_CDFS(delta_lf_cdf)
#endif
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
AVERAGE_TILE_CDFS(intra_filter_cdf)
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(skip_cdfs)
......
......@@ -2675,20 +2675,6 @@ static const aom_prob default_intra_lgt_prob[LGT_SIZES][INTRA_MODES] = {
static const aom_prob default_inter_lgt_prob[LGT_SIZES] = { 230, 230 };
#endif // CONFIG_LGT_FROM_PRED
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
static const aom_prob
default_intra_filter_probs[INTRA_FILTERS + 1][INTRA_FILTERS - 1] = {
{ 98, 63, 60 }, { 98, 82, 80 }, { 94, 65, 103 },
{ 49, 25, 24 }, { 72, 38, 50 },
};
const aom_tree_index av1_intra_filter_tree[TREE_SIZE(INTRA_FILTERS)] = {
-INTRA_FILTER_LINEAR, 2, -INTRA_FILTER_8TAP, 4, -INTRA_FILTER_8TAP_SHARP,
-INTRA_FILTER_8TAP_SMOOTH,
};
int av1_intra_filter_ind[INTRA_FILTERS];
int av1_intra_filter_inv[INTRA_FILTERS];
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#if CONFIG_FILTER_INTRA
static const aom_prob default_filter_intra_probs[2] = { 97, 236 };
......@@ -3754,17 +3740,6 @@ static const aom_cdf_prob
#endif // CONFIG_MRC_TX
#endif // !CONFIG_EXT_TX
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
static const aom_cdf_prob
default_intra_filter_cdf[INTRA_FILTERS + 1][CDF_SIZE(INTRA_FILTERS)] = {
{ AOM_ICDF(12544), AOM_ICDF(17521), AOM_ICDF(21095), AOM_ICDF(32768), 0 },
{ AOM_ICDF(12544), AOM_ICDF(19022), AOM_ICDF(23318), AOM_ICDF(32768), 0 },
{ AOM_ICDF(12032), AOM_ICDF(17297), AOM_ICDF(23522), AOM_ICDF(32768), 0 },
{ AOM_ICDF(6272), AOM_ICDF(8860), AOM_ICDF(11101), AOM_ICDF(32768), 0 },
{ AOM_ICDF(9216), AOM_ICDF(12712), AOM_ICDF(16629), AOM_ICDF(32768), 0 },
};
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#if CONFIG_CFL
static const aom_cdf_prob default_cfl_sign_cdf[CDF_SIZE(CFL_JOINT_SIGNS)] = {
AOM_ICDF(1892), AOM_ICDF(2229), AOM_ICDF(11464),
......@@ -6635,11 +6610,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->seg.pred_cdf, default_segment_pred_cdf);
#endif
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
av1_copy(fc->intra_filter_probs, default_intra_filter_probs);
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
av1_copy(fc->filter_intra_probs, default_filter_intra_probs);
av1_copy(fc->filter_intra_mode_cdf, default_filter_intra_mode_cdf);
......@@ -6665,9 +6635,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->skip_cdfs, default_skip_cdfs);
av1_copy(fc->intra_inter_cdf, default_intra_inter_cdf);
#endif
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
av1_copy(fc->intra_filter_cdf, default_intra_filter_cdf);
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
av1_copy(fc->seg.tree_cdf, default_seg_tree_cdf);
av1_copy(fc->tx_size_cdf, default_tx_size_cdf);
av1_copy(fc->delta_q_prob, default_delta_q_probs);
......@@ -6939,14 +6906,6 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
fc->delta_lf_prob[i] =
mode_mv_merge_probs(pre_fc->delta_lf_prob[i], counts->delta_lf[i]);
#endif // CONFIG_EXT_DELTA_Q
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
for (i = 0; i < INTRA_FILTERS + 1; ++i) {
aom_tree_merge_probs(av1_intra_filter_tree, pre_fc->intra_filter_probs[i],
counts->intra_filter[i], fc->intra_filter_probs[i]);
}
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
for (i = 0; i < PLANE_TYPES; ++i) {
fc->filter_intra_probs[i] = av1_mode_mv_merge_probs(
......
......@@ -338,11 +338,6 @@ typedef struct frame_contexts {
aom_prob supertx_prob[PARTITION_SUPERTX_CONTEXTS][TX_SIZES];
#endif // CONFIG_SUPERTX
struct segmentation_probs seg;
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
aom_prob intra_filter_probs[INTRA_FILTERS + 1][INTRA_FILTERS - 1];
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
aom_prob filter_intra_probs[PLANE_TYPES];
aom_cdf_prob filter_intra_mode_cdf[PLANE_TYPES][CDF_SIZE(FILTER_INTRA_MODES)];
......@@ -395,9 +390,6 @@ typedef struct frame_contexts {
aom_prob intra_lgt_prob[LGT_SIZES][INTRA_MODES];
aom_prob inter_lgt_prob[LGT_SIZES];
#endif // CONFIG_LGT_FROM_PRED
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
aom_cdf_prob intra_filter_cdf[INTRA_FILTERS + 1][CDF_SIZE(INTRA_FILTERS)];
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
aom_prob delta_q_prob[DELTA_Q_PROBS];
#if CONFIG_EXT_DELTA_Q
#if CONFIG_LOOPFILTER_LEVEL
......@@ -566,11 +558,6 @@ typedef struct FRAME_COUNTS {
unsigned int supertx_size[TX_SIZES];
#endif // CONFIG_SUPERTX
struct seg_counts seg;
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
unsigned int intra_filter[INTRA_FILTERS + 1][INTRA_FILTERS];
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
unsigned int filter_intra[PLANE_TYPES][2];
unsigned int filter_intra_mode[PLANE_TYPES][FILTER_INTRA_MODES];
......@@ -690,9 +677,6 @@ extern const aom_tree_index
#endif
extern const aom_tree_index
av1_palette_color_index_tree[PALETTE_SIZES][TREE_SIZE(PALETTE_COLORS)];
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
extern const aom_tree_index av1_intra_filter_tree[TREE_SIZE(INTRA_FILTERS)];
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#if CONFIG_EXT_TX
extern const aom_tree_index av1_ext_tx_tree[EXT_TX_SET_TYPES]
[TREE_SIZE(TX_TYPES)];
......
......@@ -209,17 +209,6 @@ DECLARE_ALIGNED(256, static const InterpKernel,
};
#endif // USE_EXTRA_FILTER
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
const InterpKernel *av1_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
};
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if USE_EXTRA_FILTER
static const InterpFilterParams
av1_interp_filter_params_list[SWITCHABLE_FILTERS + EXTRA_FILTERS] = {
......
......@@ -113,20 +113,6 @@ static INLINE InterpFilter av1_unswitchable_filter(InterpFilter filter) {
#define SWITCHABLE_FILTER_CONTEXTS (SWITCHABLE_FILTERS + 1)
#endif // CONFIG_DUAL_FILTER
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
typedef enum {
INTRA_FILTER_LINEAR,
INTRA_FILTER_8TAP,
INTRA_FILTER_8TAP_SHARP,
INTRA_FILTER_8TAP_SMOOTH,
INTRA_FILTERS,
} INTRA_FILTER;
extern const InterpKernel *av1_intra_filter_kernels[INTRA_FILTERS];
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
typedef struct InterpFilterParams {
const int16_t *filter_ptr;
uint16_t taps;
......
......@@ -100,54 +100,6 @@ int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
}
#endif
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
// Obtain the reference filter type from the above/left neighbor blocks.
static INTRA_FILTER get_ref_intra_filter(const MB_MODE_INFO *ref_mbmi) {
INTRA_FILTER ref_type = INTRA_FILTERS;
if (ref_mbmi->sb_type >= BLOCK_8X8) {
const PREDICTION_MODE mode = ref_mbmi->mode;
if (is_inter_block(ref_mbmi)) {
switch (av1_extract_interp_filter(ref_mbmi->interp_filters, 0)) {
case EIGHTTAP_REGULAR: ref_type = INTRA_FILTER_8TAP; break;
case EIGHTTAP_SMOOTH: ref_type = INTRA_FILTER_8TAP_SMOOTH; break;
case MULTITAP_SHARP: ref_type = INTRA_FILTER_8TAP_SHARP; break;
case BILINEAR: ref_type = INTRA_FILTERS; break;
default: break;
}
} else {
if (av1_is_directional_mode(mode, ref_mbmi->sb_type)) {
const int p_angle =
mode_to_angle_map[mode] + ref_mbmi->angle_delta[0] * ANGLE_STEP;
if (av1_is_intra_filter_switchable(p_angle)) {
ref_type = ref_mbmi->intra_filter;
}
}
}
}
return ref_type;
}
int av1_get_pred_context_intra_interp(const MACROBLOCKD *xd) {
int left_type = INTRA_FILTERS, above_type = INTRA_FILTERS;
if (xd->left_available) left_type = get_ref_intra_filter(xd->left_mbmi);
if (xd->up_available) above_type = get_ref_intra_filter(xd->above_mbmi);
if (left_type == above_type)
return left_type;
else if (left_type == INTRA_FILTERS && above_type != INTRA_FILTERS)
return above_type;
else if (left_type != INTRA_FILTERS && above_type == INTRA_FILTERS)
return left_type;
else
return INTRA_FILTERS;
}
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_PALETTE_DELTA_ENCODING
int av1_get_palette_cache(const MACROBLOCKD *const xd, int plane,
uint16_t *cache) {
......
......@@ -80,12 +80,6 @@ int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd, int dir);
int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
#endif
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
int av1_get_pred_context_intra_interp(const MACROBLOCKD *xd);
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_PALETTE_DELTA_ENCODING
// Get a list of palette base colors that are used in the above and left blocks,
// referred to as "color cache". The return value is the number of colors in the
......
......@@ -766,43 +766,9 @@ static void av1_init_intra_predictors_internal(void) {
}
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
static int intra_subpel_interp(int base, int shift, const uint8_t *ref,
int ref_start_idx, int ref_end_idx,
INTRA_FILTER filter_type) {
int val, k, idx, filter_idx = 0;
const int16_t *filter = NULL;
if (filter_type == INTRA_FILTER_LINEAR) {
val = ref[base] * (256 - shift) + ref[base + 1] * shift;
val = ROUND_POWER_OF_TWO(val, 8);
} else {
filter_idx = ROUND_POWER_OF_TWO(shift, 8 - SUBPEL_BITS);
filter = av1_intra_filter_kernels[filter_type][filter_idx];
if (filter_idx < (1 << SUBPEL_BITS)) {
val = 0;
for (k = 0; k < SUBPEL_TAPS; ++k) {
idx = base + 1 - (SUBPEL_TAPS / 2) + k;
idx = AOMMAX(AOMMIN(idx, ref_end_idx), ref_start_idx);
val += ref[idx] * filter[k];
}
val = ROUND_POWER_OF_TWO(val, FILTER_BITS);
} else {
val = ref[base + 1];
}
}
return val;
}
#endif // CONFIG_INTRA_INTERP
// Directional prediction, zone 1: 0 < angle < 90
static void dr_prediction_z1(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
const uint8_t *above, const uint8_t *left,
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
int upsample_above,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -835,13 +801,8 @@ static void dr_prediction_z1(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
for (c = 0; c < bw; ++c, base += base_inc) {
if (base < max_base_x) {
#if CONFIG_INTRA_INTERP
val = intra_subpel_interp(base, shift, above, 0, bw + bh - 1,
filter_type);
#else // CONFIG_INTRA_INTERP
val = above[base] * (256 - shift) + above[base + 1] * shift;
val = ROUND_POWER_OF_TWO(val, 8);
#endif // CONFIG_INTRA_INTERP
dst[c] = clip_pixel(val);
} else {
dst[c] = above[max_base_x];
......@@ -853,9 +814,6 @@ static void dr_prediction_z1(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
// Directional prediction, zone 2: 90 < angle < 180
static void dr_prediction_z2(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
const uint8_t *above, const uint8_t *left,
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
int upsample_above, int upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -880,23 +838,14 @@ static void dr_prediction_z2(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
for (c = 0; c < bw; ++c, base1 += base_inc_x, y -= dy) {
if (base1 >= min_base_x) {
shift1 = (x * (1 << upsample_above)) & 0xFF;
#if CONFIG_INTRA_INTERP
val =
intra_subpel_interp(base1, shift1, above, -1, bw - 1, filter_type);
#else
val = above[base1] * (256 - shift1) + above[base1 + 1] * shift1;
val = ROUND_POWER_OF_TWO(val, 8);
#endif // CONFIG_INTRA_INTERP
} else {
base2 = y >> frac_bits_y;
assert(base2 >= -(1 << upsample_left));
shift2 = (y * (1 << upsample_left)) & 0xFF;
#if CONFIG_INTRA_INTERP
val = intra_subpel_interp(base2, shift2, left, -1, bh - 1, filter_type);
#else
val = left[base2] * (256 - shift2) + left[base2 + 1] * shift2;
val = ROUND_POWER_OF_TWO(val, 8);
#endif // CONFIG_INTRA_INTERP
}
dst[c] = clip_pixel(val);
}
......@@ -906,9 +855,6 @@ static void dr_prediction_z2(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
// Directional prediction, zone 3: 180 < angle < 270
static void dr_prediction_z3(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
const uint8_t *above, const uint8_t *left,
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
int upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -934,13 +880,8 @@ static void dr_prediction_z3(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
for (r = 0; r < bh; ++r, base += base_inc) {
if (base < max_base_y) {
#if CONFIG_INTRA_INTERP
val =
intra_subpel_interp(base, shift, left, 0, bw + bh - 1, filter_type);
#else // CONFIG_INTRA_INTERP
val = left[base] * (256 - shift) + left[base + 1] * shift;
val = ROUND_POWER_OF_TWO(val, 8);
#endif // CONFIG_INTRA_INTERP
dst[r * stride + c] = clip_pixel(val);
} else {
for (; r < bh; ++r) dst[r * stride + c] = left[max_base_y];
......@@ -982,9 +923,6 @@ static INLINE int get_dy(int angle) {
static void dr_predictor(uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size,
const uint8_t *above, const uint8_t *left,
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
int upsample_above, int upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -997,27 +935,18 @@ static void dr_predictor(uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size,
if (angle > 0 && angle < 90) {
dr_prediction_z1(dst, stride, bw, bh, above, left,
#if CONFIG_INTRA_INTERP
filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
upsample_above,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
dx, dy);
} else if (angle > 90 && angle < 180) {
dr_prediction_z2(dst, stride, bw, bh, above, left,
#if CONFIG_INTRA_INTERP
filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
upsample_above, upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
dx, dy);
} else if (angle > 180 && angle < 270) {
dr_prediction_z3(dst, stride, bw, bh, above, left,
#if CONFIG_INTRA_INTERP
filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -1030,44 +959,10 @@ static void dr_predictor(uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size,
}
#if CONFIG_HIGHBITDEPTH
#if CONFIG_INTRA_INTERP
static int highbd_intra_subpel_interp(int base, int shift, const uint16_t *ref,
int ref_start_idx, int ref_end_idx,
INTRA_FILTER filter_type) {
int val, k, idx, filter_idx = 0;
const int16_t *filter = NULL;
if (filter_type == INTRA_FILTER_LINEAR) {
val = ref[base] * (256 - shift) + ref[base + 1] * shift;
val = ROUND_POWER_OF_TWO(val, 8);
} else {
filter_idx = ROUND_POWER_OF_TWO(shift, 8 - SUBPEL_BITS);
filter = av1_intra_filter_kernels[filter_type][filter_idx];
if (filter_idx < (1 << SUBPEL_BITS)) {
val = 0;
for (k = 0; k < SUBPEL_TAPS; ++k) {
idx = base + 1 - (SUBPEL_TAPS / 2) + k;
idx = AOMMAX(AOMMIN(idx, ref_end_idx), ref_start_idx);
val += ref[idx] * filter[k];
}
val = ROUND_POWER_OF_TWO(val, FILTER_BITS);
} else {
val = ref[base + 1];
}
}
return val;
}
#endif // CONFIG_INTRA_INTERP
// Directional prediction, zone 1: 0 < angle < 90
static void highbd_dr_prediction_z1(uint16_t *dst, ptrdiff_t stride, int bw,
int bh, const uint16_t *above,
const uint16_t *left,
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
int upsample_above,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -1100,13 +995,8 @@ static void highbd_dr_prediction_z1(uint16_t *dst, ptrdiff_t stride, int bw,
for (c = 0; c < bw; ++c, base += base_inc) {
if (base < max_base_x) {
#if CONFIG_INTRA_INTERP
val = highbd_intra_subpel_interp(base, shift, above, 0, bw + bh - 1,
filter_type);
#else
val = above[base] * (256 - shift) + above[base + 1] * shift;
val = ROUND_POWER_OF_TWO(val, 8);
#endif // CONFIG_INTRA_INTERP
dst[c] = clip_pixel_highbd(val, bd);
} else {
dst[c] = above[max_base_x];
......@@ -1119,9 +1009,6 @@ static void highbd_dr_prediction_z1(uint16_t *dst, ptrdiff_t stride, int bw,
static void highbd_dr_prediction_z2(uint16_t *dst, ptrdiff_t stride, int bw,
int bh, const uint16_t *above,
const uint16_t *left,
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
int upsample_above, int upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -1145,25 +1032,15 @@ static void highbd_dr_prediction_z2(uint16_t *dst, ptrdiff_t stride, int bw,
base = x >> frac_bits_x;
if (base >= min_base_x) {
shift = (x * (1 << upsample_above)) & 0xFF;
#if CONFIG_INTRA_INTERP
val = highbd_intra_subpel_interp(base, shift, above, -1, bw - 1,
filter_type);
#else
val = above[base] * (256 - shift) + above[base + 1] * shift;
val = ROUND_POWER_OF_TWO(val, 8);
#endif // CONFIG_INTRA_INTERP
} else {
x = c + 1;
y = (r << 8) - x * dy;
base = y >> frac_bits_y;
shift = (y * (1 << upsample_left)) & 0xFF;
#if CONFIG_INTRA_INTERP
val = highbd_intra_subpel_interp(base, shift, left, -1, bh - 1,
filter_type);
#else
val = left[base] * (256 - shift) + left[base + 1] * shift;
val = ROUND_POWER_OF_TWO(val, 8);
#endif // CONFIG_INTRA_INTERP
}
dst[c] = clip_pixel_highbd(val, bd);
}
......@@ -1175,9 +1052,6 @@ static void highbd_dr_prediction_z2(uint16_t *dst, ptrdiff_t stride, int bw,
static void highbd_dr_prediction_z3(uint16_t *dst, ptrdiff_t stride, int bw,
int bh, const uint16_t *above,
const uint16_t *left,
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter_type,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
int upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -1202,13 +1076,8 @@ static void highbd_dr_prediction_z3(uint16_t *dst, ptrdiff_t stride, int bw,
for (r = 0; r < bh; ++r, base += base_inc) {
if (base < max_base_y) {
#if CONFIG_INTRA_INTERP
val = highbd_intra_subpel_interp(base, shift, left, 0, bw + bh - 1,
filter_type);
#else
val = left[base] * (256 - shift) + left[base + 1] * shift;
val = ROUND_POWER_OF_TWO(val, 8);
#endif // CONFIG_INTRA_INTERP
dst[r * stride + c] = clip_pixel_highbd(val, bd);
} else {
for (; r < bh; ++r) dst[r * stride + c] = left[max_base_y];
......@@ -1221,9 +1090,6 @@ static void highbd_dr_prediction_z3(uint16_t *dst, ptrdiff_t stride, int bw,
static void highbd_dr_predictor(uint16_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint16_t *above,
const uint16_t *left,
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
int upsample_above, int upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -1236,27 +1102,18 @@ static void highbd_dr_predictor(uint16_t *dst, ptrdiff_t stride,
if (angle > 0 && angle < 90) {
highbd_dr_prediction_z1(dst, stride, bw, bh, above, left,
#if CONFIG_INTRA_INTERP
filter,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
upsample_above,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
dx, dy, bd);
} else if (angle > 90 && angle < 180) {
highbd_dr_prediction_z2(dst, stride, bw, bh, above, left,
#if CONFIG_INTRA_INTERP
filter,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
upsample_above, upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
dx, dy, bd);
} else if (angle > 180 && angle < 270) {
highbd_dr_prediction_z3(dst, stride, bw, bh, above, left,
#if CONFIG_INTRA_INTERP
filter,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -2513,11 +2370,6 @@ static void build_intra_predictors_high(
#if CONFIG_EXT_INTRA
if (is_dr_mode) {
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter = INTRA_FILTER_LINEAR;
if (plane == 0 && av1_is_intra_filter_switchable(p_angle))
filter = xd->mi[0]->mbmi.intra_filter;
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE
const int need_right = p_angle < 90;
const int need_bottom = p_angle > 180;
......@@ -2549,9 +2401,6 @@ static void build_intra_predictors_high(
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
#endif // CONFIG_INTRA_EDGE
highbd_dr_predictor(dst, dst_stride, tx_size, above_row, left_col,
#if CONFIG_INTRA_INTERP
filter,
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE_UPSAMPLE
upsample_above, upsample_left,
#endif // CONFIG_INTRA_EDGE_UPSAMPLE
......@@ -2755,11 +2604,6 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
#if CONFIG_EXT_INTRA
if (is_dr_mode) {
#if CONFIG_INTRA_INTERP
INTRA_FILTER filter = INTRA_FILTER_LINEAR;
if (plane == 0 && av1_is_intra_filter_switchable(p_angle))
filter = xd->mi[0]->mbmi.intra_filter;
#endif // CONFIG_INTRA_INTERP
#if CONFIG_INTRA_EDGE