Commit c36f78b0 authored by Jingning Han's avatar Jingning Han
Browse files

Use frame index directly in get_chessboard_index

The get_chessboard_index() used to call the entire VP9_COMMON
struct pointer to retrieve the chessboard pattern index. This cl
makes it call the frame index directly.

Change-Id: I3cad9d209ea2e77a358085a04fe1ff0ddec5ba03
parent 4ba92dc5
...@@ -1836,7 +1836,7 @@ static void auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile, ...@@ -1836,7 +1836,7 @@ static void auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile,
BLOCK_SIZE max_size = BLOCK_8X8; BLOCK_SIZE max_size = BLOCK_8X8;
int bsl = mi_width_log2(BLOCK_64X64); int bsl = mi_width_log2(BLOCK_64X64);
const int search_range_ctrl = (((mi_row + mi_col) >> bsl) + const int search_range_ctrl = (((mi_row + mi_col) >> bsl) +
get_chessboard_index(cm)) % 2; get_chessboard_index(cm->current_video_frame)) & 0x1;
// Trap case where we do not have a prediction. // Trap case where we do not have a prediction.
if (search_range_ctrl && if (search_range_ctrl &&
(left_in_image || above_in_image || cm->frame_type != KEY_FRAME)) { (left_in_image || above_in_image || cm->frame_type != KEY_FRAME)) {
......
...@@ -551,8 +551,8 @@ static INLINE void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd, ...@@ -551,8 +551,8 @@ static INLINE void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd,
: 0]; : 0];
} }
static INLINE int get_chessboard_index(const VP9_COMMON *cm) { static INLINE int get_chessboard_index(const int frame_index) {
return cm->current_video_frame % 2; return frame_index & 0x1;
} }
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -394,7 +394,8 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -394,7 +394,8 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
INTERP_FILTER filter_ref = cm->interp_filter; INTERP_FILTER filter_ref = cm->interp_filter;
int bsl = mi_width_log2(bsize); int bsl = mi_width_log2(bsize);
const int pred_filter_search = cm->interp_filter == SWITCHABLE ? const int pred_filter_search = cm->interp_filter == SWITCHABLE ?
(((mi_row + mi_col) >> bsl) + get_chessboard_index(cm)) % 2 : 0; (((mi_row + mi_col) >> bsl) +
get_chessboard_index(cm->current_video_frame)) & 0x1 : 0;
int const_motion[MAX_REF_FRAMES] = { 0 }; int const_motion[MAX_REF_FRAMES] = { 0 };
int bh = num_4x4_blocks_high_lookup[bsize] << 2; int bh = num_4x4_blocks_high_lookup[bsize] << 2;
int bw = num_4x4_blocks_wide_lookup[bsize] << 2; int bw = num_4x4_blocks_wide_lookup[bsize] << 2;
......
...@@ -2025,7 +2025,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2025,7 +2025,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int bsl = mi_width_log2_lookup[bsize]; int bsl = mi_width_log2_lookup[bsize];
int pred_filter_search = cpi->sf.cb_pred_filter_search ? int pred_filter_search = cpi->sf.cb_pred_filter_search ?
(((mi_row + mi_col) >> bsl)) & 0x01 : 0; (((mi_row + mi_col) >> bsl) +
get_chessboard_index(cm->current_video_frame)) & 0x1 : 0;
if (pred_filter_search) { if (pred_filter_search) {
INTERP_FILTER af = SWITCHABLE, lf = SWITCHABLE; INTERP_FILTER af = SWITCHABLE, lf = SWITCHABLE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment