ref: 923c30a174637af6bc0c3732082b74ed35c71160
parent: 357495c2dfd6c13b2b39ce02041c7203fdcd9ee6
author: Dmitry Kovalev <dkovalev@google.com>
date: Thu Jun 5 14:17:54 EDT 2014
Removing chessboard_index from SPEED_FEATURES. This is not a speed feature, adding inline function instead. Change-Id: Ia48c41802eec9e92cf990339d724097279695c9a
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1872,8 +1872,8 @@
BLOCK_SIZE min_size = BLOCK_32X32;
BLOCK_SIZE max_size = BLOCK_8X8;
int bsl = mi_width_log2_lookup[BLOCK_64X64];
- int search_range_ctrl = (((mi_row + mi_col) >> bsl) +
- cpi->sf.chessboard_index) & 0x01;
+ const int search_range_ctrl = (((mi_row + mi_col) >> bsl) +
+ get_chessboard_index(cm)) % 2;
// Trap case where we do not have a prediction.
if (search_range_ctrl &&
(left_in_image || above_in_image || cm->frame_type != KEY_FRAME)) {
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -630,6 +630,10 @@
: 0];
}
+static INLINE int get_chessboard_index(const VP9_COMMON *cm) {
+ return cm->current_video_frame % 2;
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -220,8 +220,8 @@
int mode_idx[MB_MODE_COUNT] = {0};
INTERP_FILTER filter_ref = SWITCHABLE;
int bsl = mi_width_log2_lookup[bsize];
- int pred_filter_search = (((mi_row + mi_col) >> bsl) +
- cpi->sf.chessboard_index) & 0x01;
+ const int pred_filter_search = (((mi_row + mi_col) >> bsl) +
+ get_chessboard_index(cm)) % 2;
x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH;
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -261,7 +261,6 @@
sf->use_nonrd_pick_mode = 1;
sf->search_method = FAST_DIAMOND;
sf->allow_skip_recode = 0;
- sf->chessboard_index = cm->current_video_frame & 0x01;
}
if (speed >= 6) {
--- a/vp9/encoder/vp9_speed_features.h
+++ b/vp9/encoder/vp9_speed_features.h
@@ -283,9 +283,6 @@
// encoding process for RTC.
int partition_check;
- // Chessboard pattern index
- int chessboard_index;
-
// Use finer quantizer in every other few frames that run variable block
// partition type search.
int force_frame_boost;