summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2014-07-22 16:32:20 -0700
committerJingning Han <jingning@google.com>2014-07-22 16:49:03 -0700
commit54ad09586c0deb26e7d305623dff78e200fdadef (patch)
tree63df43062ac1c2f63fb02f300e2ed52a1b5376ea /vp9
parent5de6114e8fc708b8230f75745e0c58aed7ac05ff (diff)
downloadlibvpx-54ad09586c0deb26e7d305623dff78e200fdadef.tar
libvpx-54ad09586c0deb26e7d305623dff78e200fdadef.tar.gz
libvpx-54ad09586c0deb26e7d305623dff78e200fdadef.tar.bz2
libvpx-54ad09586c0deb26e7d305623dff78e200fdadef.zip
Enable chessboard inter prediction filter type search
This commit enables a chessboard pattern prediction filter type search scheme for rate-distortion optimization speed-up. For the inferred motion vector modes, the encoder can re-use its above/left neighbor blocks' prediction filter type and skip a full test on all possible filter types. Such operation is turned on/off alternatively in a chessboard manner. It is turned on in speed 3. For test clip pedestrian 1080p, the runtime is reduced from 231500 ms -> 221700 ms. The compression performance is changed: derf: -0.147% yt: -0.134% hd: -0.079% stdhd: -0.220% Change-Id: I1912f278e7576c2dc632688e3ad7a257410c605a
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_rdopt.c16
-rw-r--r--vp9/encoder/vp9_speed_features.c2
-rw-r--r--vp9/encoder/vp9_speed_features.h3
3 files changed, 18 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index cdc79345b..03a3c36f4 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2040,7 +2040,18 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
uint8_t *orig_dst[MAX_MB_PLANE];
int orig_dst_stride[MAX_MB_PLANE];
int rs = 0;
- INTERP_FILTER best_filter = cm->interp_filter;
+ INTERP_FILTER best_filter = SWITCHABLE;
+
+ int bsl = mi_width_log2_lookup[bsize];
+ int pred_filter_search = cpi->sf.cb_pred_filter_search ?
+ (((mi_row + mi_col) >> bsl)) & 0x01 : 0;
+
+ if (pred_filter_search && this_mode != NEWMV) {
+ if (xd->up_available)
+ best_filter = xd->mi[-xd->mi_stride]->mbmi.interp_filter;
+ else if (xd->left_available)
+ best_filter = xd->mi[-1]->mbmi.interp_filter;
+ }
if (is_comp_pred) {
if (frame_mv[refs[0]].as_int == INVALID_MV ||
@@ -2124,10 +2135,9 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
rd_opt->filter_cache[i] = INT64_MAX;
if (cm->interp_filter != BILINEAR) {
- best_filter = EIGHTTAP;
if (x->source_variance < cpi->sf.disable_filter_search_var_thresh) {
best_filter = EIGHTTAP;
- } else {
+ } else if (best_filter == SWITCHABLE) {
int newbest;
int tmp_rate_sum = 0;
int64_t tmp_dist_sum = 0;
diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c
index 8fb4aa566..7315dd454 100644
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -116,6 +116,7 @@ static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
sf->adaptive_pred_interp_filter = 0;
+ sf->cb_pred_filter_search = 1;
sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
sf->last_partitioning_redo_frequency = 3;
@@ -332,6 +333,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->use_lp32x32fdct = 0;
sf->adaptive_motion_search = 0;
sf->adaptive_pred_interp_filter = 0;
+ sf->cb_pred_filter_search = 0;
sf->use_quant_fp = 0;
sf->reference_masking = 0;
sf->partition_search_type = SEARCH_PARTITION;
diff --git a/vp9/encoder/vp9_speed_features.h b/vp9/encoder/vp9_speed_features.h
index bdbbe5888..929acaf3e 100644
--- a/vp9/encoder/vp9_speed_features.h
+++ b/vp9/encoder/vp9_speed_features.h
@@ -283,6 +283,9 @@ typedef struct SPEED_FEATURES {
// was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected.
int adaptive_pred_interp_filter;
+ // Chessboard pattern prediction filter type search
+ int cb_pred_filter_search;
+
// Fast quantization process path
int use_quant_fp;