Commit 17962ab2 authored by JackyChen's avatar JackyChen
Browse files

vp9: Code clean up for short circuit feature in low temp variance.

Change-Id: I7573a5cf0ab79abed8d124019c0ed6d9531277f9
parent 63eb2ee0
......@@ -773,9 +773,7 @@ static int choose_partitioning(VP9_COMP *cpi,
}
}
for (i = 0; i < 25; i++) {
x->variance_low[i] = 0;
}
memset(x->variance_low, 0, sizeof(x->variance_low));
if (xd->mb_to_right_edge < 0)
pixels_wide += (xd->mb_to_right_edge >> 3);
......@@ -1083,7 +1081,7 @@ static int choose_partitioning(VP9_COMP *cpi,
}
if (cpi->sf.short_circuit_low_temp_var) {
int mv_thr = cm->width > 640 ? 8 : 4;
const int mv_thr = cm->width > 640 ? 8 : 4;
// Check temporal variance for bsize >= 16x16, if LAST_FRAME was selected
// and int_pro mv is small. If the temporal variance is small set the
// variance_low flag for the block. The variance threshold can be adjusted,
......
......@@ -1278,12 +1278,12 @@ static void recheck_zeromv_after_denoising(
}
#endif // CONFIG_VP9_TEMPORAL_DENOISING
static INLINE int set_force_skip_low_temp_var(uint8_t *variance_low,
static INLINE int get_force_skip_low_temp_var(uint8_t *variance_low,
int mi_row, int mi_col,
BLOCK_SIZE bsize) {
const int i = (mi_row & 0x7) >> 1;
const int j = (mi_col & 0x7) >> 1;
int force_skip_low_temp_var = 0;
int i = (mi_row & 0x7) >> 1;
int j = (mi_col & 0x7) >> 1;
// Set force_skip_low_temp_var based on the block size and block offset.
if (bsize == BLOCK_64X64) {
force_skip_low_temp_var = variance_low[0];
......@@ -1313,15 +1313,15 @@ static INLINE int set_force_skip_low_temp_var(uint8_t *variance_low,
force_skip_low_temp_var = variance_low[pos_shift_16x16[i][j]];
} else if (bsize == BLOCK_32X16) {
// The col shift index for the second 16x16 block.
int j2 = ((mi_col + 2) & 0x7) >> 1;
const int j2 = ((mi_col + 2) & 0x7) >> 1;
// Only if each 16x16 block inside has low temporal variance.
force_skip_low_temp_var = variance_low[pos_shift_16x16[i][j]] &&
variance_low[pos_shift_16x16[i][j2]];
variance_low[pos_shift_16x16[i][j2]];
} else if (bsize == BLOCK_16X32) {
// The row shift index for the second 16x16 block.
int i2 = ((mi_row + 2) & 0x7) >> 1;
const int i2 = ((mi_row + 2) & 0x7) >> 1;
force_skip_low_temp_var = variance_low[pos_shift_16x16[i][j]] &&
variance_low[pos_shift_16x16[i2][j]];
variance_low[pos_shift_16x16[i2][j]];
}
return force_skip_low_temp_var;
}
......@@ -1473,7 +1473,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (cpi->sf.short_circuit_low_temp_var) {
force_skip_low_temp_var =
set_force_skip_low_temp_var(&x->variance_low[0], mi_row, mi_col, bsize);
get_force_skip_low_temp_var(&x->variance_low[0], mi_row, mi_col, bsize);
}
if (!((cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]) &&
......
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