Merged the enhanced_interp experiment.
Found and fixed a bug in the include files framework, whereby
certain encoder files were still using the old INTERP_EXTEND
value of 3 instead of 4. The thresholds for mv range mcomp.c
need a small adjustment to prevent crashes.
The results are more or less unchanged.
Change-Id: Iac5008390f1efc97ce1102fbb5f8989c847fb579
"
EXPERIMENT_LIST="
csm
- enhanced_interp
featureupdates
high_precision_mv
sixteenth_subpel_uv
comp_intra_pred
superblocks
- newintramodes
pred_filter
lossless
hybridtransform
{
SIXTAP = 0,
BILINEAR = 1,
-#if CONFIG_ENHANCED_INTERP
EIGHTTAP = 2,
EIGHTTAP_SHARP = 3,
#if CONFIG_SWITCHABLE_INTERP
SWITCHABLE /* should be the last one */
#endif
-#endif
} INTERPOLATIONFILTERTYPE;
#if 0//CONFIG_SWITCHABLE_INTERP
#endif /* SUBPEL_SHIFTS==16 */
};
-#if CONFIG_ENHANCED_INTERP
-
#define FILTER_ALPHA 0
#define FILTER_ALPHA_SHARP 1
-DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_8[SUBPEL_SHIFTS][2 * INTERP_EXTEND]) = {
+DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_8[SUBPEL_SHIFTS][8]) = {
+
#if SUBPEL_SHIFTS==16
#if FILTER_ALPHA == 0
/* Lagrangian interpolation filter */
#endif /* SUBPEL_SHIFTS==16 */
};
-DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_8s[SUBPEL_SHIFTS][2 * INTERP_EXTEND]) = {
+DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_8s[SUBPEL_SHIFTS][8]) = {
#if SUBPEL_SHIFTS==16
#if FILTER_ALPHA_SHARP == 1
/* dct based filter */
{-1, 3, -6, 17, 125, -13, 5, -2},
{0, 1, -3, 8, 127, -7, 3, -1}
#elif FILTER_ALPHA_SHARP == 75
+ /* alpha = 0.75 */
{0, 0, 0, 128, 0, 0, 0, 0},
{-1, 2, -6, 126, 9, -3, 2, -1},
{-1, 4, -11, 123, 18, -7, 3, -1},
#endif /* FILTER_ALPHA_SHARP */
#else /* SUBPEL_SHIFTS==16 */
#if FILTER_ALPHA_SHARP == 1
+ /* dct based filter */
{0, 0, 0, 128, 0, 0, 0, 0},
{-2, 5, -13, 125, 17, -6, 3, -1},
{-4, 9, -20, 115, 37, -13, 6, -2},
{-2, 6, -13, 37, 115, -20, 9, -4},
{-1, 3, -6, 17, 125, -13, 5, -2}
#elif FILTER_ALPHA_SHARP == 75
+ /* alpha = 0.75 */
{0, 0, 0, 128, 0, 0, 0, 0},
{-1, 4, -11, 123, 18, -7, 3, -1},
{-2, 7, -19, 113, 38, -13, 6, -2},
#endif /* SUBPEL_SHIFTS==16 */
};
-#endif // CONFIG_ENHANCED_INTERP
-
DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_6[SUBPEL_SHIFTS][6]) = {
#if SUBPEL_SHIFTS==16
{0, 0, 128, 0, 0, 0},
16, 16, 16, 16, VFilter);
}
-#if CONFIG_ENHANCED_INTERP
-
#undef Interp_Extend
#define Interp_Extend 4
16, 16, 16, 16, VFilter);
}
-#endif /* CONFIG_ENHANCED_INTERP */
-
/****************************************************************************
*
* ROUTINE : filter_block2d_bil_first_pass
vp8_comp_intra_uv4x4_predict;
#endif
-#if CONFIG_ENHANCED_INTERP
rtcd->subpix.eighttap16x16 = vp8_eighttap_predict16x16_c;
rtcd->subpix.eighttap8x8 = vp8_eighttap_predict8x8_c;
rtcd->subpix.eighttap_avg16x16 = vp8_eighttap_predict_avg16x16_c;
rtcd->subpix.eighttap_avg4x4_sharp = vp8_eighttap_predict_avg4x4_sharp_c;
rtcd->subpix.eighttap8x4_sharp = vp8_eighttap_predict8x4_sharp_c;
rtcd->subpix.eighttap4x4_sharp = vp8_eighttap_predict_sharp_c;
-#endif
+
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_c;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_c;
rtcd->subpix.sixtap_avg16x16 = vp8_sixtap_predict_avg16x16_c;
xd->subpixel_predict_avg16x16 = SUBPIX_INVOKE(
&cm->rtcd.subpix, sixtap_avg16x16);
}
-#if CONFIG_ENHANCED_INTERP
else if (mcomp_filter_type == EIGHTTAP
#if CONFIG_SWITCHABLE_INTERP
||
xd->subpixel_predict_avg16x16 = SUBPIX_INVOKE(
&cm->rtcd.subpix, eighttap_avg16x16_sharp);
}
-#endif
else {
xd->subpixel_predict = SUBPIX_INVOKE(
&cm->rtcd.subpix, bilinear4x4);
#endif
extern prototype_subpixel_predict(vp8_subpix_sixtap_avg4x4);
-#if CONFIG_ENHANCED_INTERP
#ifndef vp8_subpix_eighttap16x16
#define vp8_subpix_eighttap16x16 vp8_eighttap_predict16x16_c
#endif
#define vp8_subpix_eighttap_avg4x4_sharp vp8_eighttap_predict_avg4x4_sharp_c
#endif
extern prototype_subpixel_predict(vp8_subpix_eighttap_avg4x4_sharp);
-#endif /* CONFIG_ENAHNCED_INTERP */
#ifndef vp8_subpix_bilinear16x16
#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_c
typedef prototype_subpixel_predict((*vp8_subpix_fn_t));
typedef struct {
-#if CONFIG_ENHANCED_INTERP
vp8_subpix_fn_t eighttap16x16;
vp8_subpix_fn_t eighttap8x8;
vp8_subpix_fn_t eighttap_avg16x16;
vp8_subpix_fn_t eighttap_avg4x4_sharp;
vp8_subpix_fn_t eighttap8x4_sharp;
vp8_subpix_fn_t eighttap4x4_sharp;
-#endif
vp8_subpix_fn_t sixtap16x16;
vp8_subpix_fn_t sixtap8x8;
vp8_subpix_fn_t sixtap_avg16x16;
rtcd->recon.copy8x4 = vp8_copy_mem8x4_mmx;
rtcd->recon.copy16x16 = vp8_copy_mem16x16_mmx;
-#if CONFIG_ENHANCED_INTERP == 0 && CONFIG_HIGH_PRECISION_MV == 0 && CONFIG_SIXTEENTH_SUBPEL_UV == 0
+ /* Disabled due to unsupported enhanced interpolation/high_prec mv
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_mmx;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_mmx;
rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_mmx;
rtcd->subpix.sixtap4x4 = vp8_sixtap_predict4x4_mmx;
-#endif
+ */
rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_mmx;
rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_mmx;
rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_mmx;
// rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_sse2;
-#if CONFIG_ENHANCED_INTERP == 0 && CONFIG_HIGH_PRECISION_MV == 0 && CONFIG_SIXTEENTH_SUBPEL_UV == 0
+ /* Disabled due to unsupported enhanced interpolation/high_prec mv
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_sse2;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_sse2;
rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_sse2;
-#endif
+ */
rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_sse2;
rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_sse2;
#if HAVE_SSSE3
if (flags & HAS_SSSE3) {
-#if CONFIG_ENHANCED_INTERP == 0 && CONFIG_HIGH_PRECISION_MV == 0 && CONFIG_SIXTEENTH_SUBPEL_UV == 0
+ /* Disabled due to unsupported enhanced interpolation/high_prec mv
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_ssse3;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_ssse3;
rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_ssse3;
rtcd->subpix.sixtap4x4 = vp8_sixtap_predict4x4_ssse3;
rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_ssse3;
rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_ssse3;
-#endif
+ */
/* these are disable because of unsupported diagonal pred modes
rtcd->recon.build_intra_predictors_mbuv =
} else {
if (!pc->use_bilinear_mc_filter)
-#if CONFIG_ENHANCED_INTERP
pc->mcomp_filter_type = EIGHTTAP;
-#else
- pc->mcomp_filter_type = SIXTAP;
-#endif
else
pc->mcomp_filter_type = BILINEAR;
- /* To enable choice of different interploation filters */
+ /* To enable choice of different interpolation filters */
vp8_setup_interp_filters(xd, pc->mcomp_filter_type, pc);
}
/* Is high precision mv allowed */
xd->allow_high_precision_mv = (unsigned char)vp8_read_bit(bc);
#endif
-#if CONFIG_ENHANCED_INTERP
// Read the type of subpel filter to use
#if CONFIG_SWITCHABLE_INTERP
if (vp8_read_bit(bc)) {
}
/* To enable choice of different interploation filters */
vp8_setup_interp_filters(xd, pc->mcomp_filter_type, pc);
-#endif
}
pc->refresh_entropy_probs = vp8_read_bit(bc);
// Signal whether to allow high MV precision
vp8_write_bit(bc, (xd->allow_high_precision_mv) ? 1 : 0);
#endif
-#if CONFIG_ENHANCED_INTERP
#if CONFIG_SWITCHABLE_INTERP
if (pc->mcomp_filter_type == SWITCHABLE) {
/* Check to see if only one of the filters is actually used */
if (pc->mcomp_filter_type != SWITCHABLE)
#endif /* CONFIG_SWITCHABLE_INTERP */
vp8_write_literal(bc, (pc->mcomp_filter_type), 2);
-#endif /* CONFIG_ENHANCED_INTERP */
}
vp8_write_bit(bc, pc->refresh_entropy_probs);
int buf_r1, buf_r2, buf_c1, buf_c2;
// Clamping to avoid out-of-range data access
- buf_r1 = ((bestmv->as_mv.row - INTERP_EXTEND) < x->mv_row_min) ? (bestmv->as_mv.row - x->mv_row_min) : INTERP_EXTEND;
- buf_r2 = ((bestmv->as_mv.row + INTERP_EXTEND) > x->mv_row_max) ? (x->mv_row_max - bestmv->as_mv.row) : INTERP_EXTEND;
- buf_c1 = ((bestmv->as_mv.col - INTERP_EXTEND) < x->mv_col_min) ? (bestmv->as_mv.col - x->mv_col_min) : INTERP_EXTEND;
- buf_c2 = ((bestmv->as_mv.col + INTERP_EXTEND) > x->mv_col_max) ? (x->mv_col_max - bestmv->as_mv.col) : INTERP_EXTEND;
+ buf_r1 = ((bestmv->as_mv.row - INTERP_EXTEND) < x->mv_row_min) ?
+ (bestmv->as_mv.row - x->mv_row_min) : INTERP_EXTEND - 1;
+ buf_r2 = ((bestmv->as_mv.row + INTERP_EXTEND) > x->mv_row_max) ?
+ (x->mv_row_max - bestmv->as_mv.row) : INTERP_EXTEND - 1;
+ buf_c1 = ((bestmv->as_mv.col - INTERP_EXTEND) < x->mv_col_min) ?
+ (bestmv->as_mv.col - x->mv_col_min) : INTERP_EXTEND - 1;
+ buf_c2 = ((bestmv->as_mv.col + INTERP_EXTEND) > x->mv_col_max) ?
+ (x->mv_col_max - bestmv->as_mv.col) : INTERP_EXTEND - 1;
y_stride = 32;
/* Copy to intermediate buffer before searching. */
extern const int vp8_gf_interval_table[101];
-#if CONFIG_ENHANCED_INTERP
-#define SEARCH_BEST_FILTER 0 /* to search for best filter */
+#define SEARCH_BEST_FILTER 0 /* to search exhaustively for
+ best filter */
#define RESET_FOREACH_FILTER 0 /* whether to reset the encoder state
- * before trying each new filter */
-#define SHARP_FILTER_QTHRESH 0 /* Q threshold for 8-tap sharp filter */
-#endif
+ before trying each new filter */
+#define SHARP_FILTER_QTHRESH 0 /* Q threshold for 8-tap sharp filter */
+
#if CONFIG_HIGH_PRECISION_MV
-#define ALTREF_HIGH_PRECISION_MV 1 /* whether to use high precision mv for altref computation */
-#define HIGH_PRECISION_MV_QTHRESH 200 /* Q threshold for use of high precision mv
- * Choose a very high value for now so
- * that HIGH_PRECISION is always chosen */
+#define ALTREF_HIGH_PRECISION_MV 1 /* whether to use high precision mv
+ for altref computation */
+#define HIGH_PRECISION_MV_QTHRESH 200 /* Q threshold for use of high precision
+ mv. Choose a very high value for
+ now so that HIGH_PRECISION is always
+ chosen */
#endif
#if CONFIG_INTERNAL_STATS
sf->first_step = 0;
sf->max_step_search_steps = MAX_MVSEARCH_STEPS;
-#if CONFIG_ENHANCED_INTERP
sf->search_best_filter = SEARCH_BEST_FILTER;
-#endif
break;
case 1:
#if CONFIG_PRED_FILTER
cpi->cq_target_quality = cpi->oxcf.cq_level;
if (!cm->use_bilinear_mc_filter)
-#if CONFIG_ENHANCED_INTERP
cm->mcomp_filter_type = EIGHTTAP;
-#else
- cm->mcomp_filter_type = SIXTAP;
-#endif
else
cm->mcomp_filter_type = BILINEAR;
int loop_size_estimate = 0;
-#if CONFIG_ENHANCED_INTERP
SPEED_FEATURES *sf = &cpi->sf;
#if RESET_FOREACH_FILTER
int q_low0;
int mcomp_filters = sizeof(mcomp_filters_to_search) / sizeof(*mcomp_filters_to_search);
int mcomp_filter_index = 0;
INT64 mcomp_filter_cost[4];
-#endif
// Clear down mmx registers to allow floating point in what follows
vp8_clear_system_state();
loop_count = 0;
-#if CONFIG_HIGH_PRECISION_MV || CONFIG_ENHANCED_INTERP
if (cm->frame_type != KEY_FRAME) {
-#if CONFIG_ENHANCED_INTERP
/* TODO: Decide this more intelligently */
if (sf->search_best_filter) {
cm->mcomp_filter_type = mcomp_filters_to_search[0];
(Q < SHARP_FILTER_QTHRESH ? EIGHTTAP_SHARP : EIGHTTAP);
#endif
}
-#endif
#if CONFIG_HIGH_PRECISION_MV
/* TODO: Decide this more intelligently */
xd->allow_high_precision_mv = (Q < HIGH_PRECISION_MV_QTHRESH);
#endif
}
-#endif
#if CONFIG_POSTPROC
vp8_write_yuv_frame(cpi->Source);
#endif
-#if CONFIG_ENHANCED_INTERP && RESET_FOREACH_FILTER
+#if RESET_FOREACH_FILTER
if (sf->search_best_filter) {
q_low0 = q_low;
q_high0 = q_high;
if (cpi->is_src_frame_alt_ref)
Loop = FALSE;
-#if CONFIG_ENHANCED_INTERP && CONFIG_SWITCHABLE_INTERP
+#if CONFIG_SWITCHABLE_INTERP
if (cm->frame_type != KEY_FRAME &&
!sf->search_best_filter &&
cm->mcomp_filter_type == SWITCHABLE) {
}
#endif
-#if CONFIG_ENHANCED_INTERP
if (Loop == FALSE && cm->frame_type != KEY_FRAME && sf->search_best_filter) {
if (mcomp_filter_index < mcomp_filters) {
INT64 err = vp8_calc_ss_err(cpi->Source,
#endif
}
}
-#endif /* CONFIG_ENHANCED_INTERP */
if (Loop == TRUE) {
loop_count++;
int optimize_coefficients;
int no_skip_block4x4_search;
int improved_mv_pred;
-#if CONFIG_ENHANCED_INTERP
int search_best_filter;
-#endif
} SPEED_FEATURES;
if (flags & HAS_NEON)
#endif
{
+#if VP8BORDERINPIXELS == 32
vp8_yv12_extend_frame_borders_ptr = vp8_yv12_extend_frame_borders_neon;
vp8_yv12_copy_frame_yonly_ptr = vp8_yv12_copy_frame_yonly_neon;
vp8_yv12_copy_frame_ptr = vp8_yv12_copy_frame_neon;
+#endif
}
#endif
}
#ifndef YV12_CONFIG_H
#define YV12_CONFIG_H
+
+#include "vpx_config.h"
+
#ifdef __cplusplus
extern "C"
{
#define VP7BORDERINPIXELS 48
-#if CONFIG_ENHANCED_INTERP
#define VP8BORDERINPIXELS 64
#define INTERP_EXTEND 4
-#else
-#define VP8BORDERINPIXELS 32
-#define INTERP_EXTEND 3
-#endif
/*************************************
For INT_YUV: