vp9: Encoding cycle reduction for speed 8.

1. Skip golden non-zeromv and newmv-last for bsize >= 16x16 if the
temporal variance obtained from choose_partitioning is very low.
2. Skip horz and vert INTRA mode for speed 8.

This change works best on the clips with little noise and with some
motion (e.g. gips_motion which has > 5% speed up). PSNR drop is 1.78%
on rtc test set, no obvious visual quality regression found.

Change-Id: Ib43b5b20e67809d03c5a6890818ddff59e1fc94a
This commit is contained in:
JackyChen
2016-06-06 16:30:14 -07:00
parent 181988d372
commit f9c0587200
5 changed files with 92 additions and 22 deletions

View File

@@ -40,6 +40,14 @@ typedef struct {
int in_use;
} PRED_BUFFER;
static const int pos_shift_16x16[4][4] = {
{9, 10, 13, 14},
{11, 12, 15, 16},
{17, 18, 21, 22},
{19, 20, 23, 24}
};
static int mv_refs_rt(VP9_COMP *cpi, const VP9_COMMON *cm,
const MACROBLOCK *x,
const MACROBLOCKD *xd,
@@ -1274,6 +1282,8 @@ static INLINE int set_force_skip_low_temp_var(uint8_t *variance_low,
int mi_row, int mi_col,
BLOCK_SIZE bsize) {
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];
@@ -1299,6 +1309,19 @@ static INLINE int set_force_skip_low_temp_var(uint8_t *variance_low,
} else if ((mi_col & 0x7) && (mi_row & 0x7)) {
force_skip_low_temp_var = variance_low[8];
}
} else if (bsize == BLOCK_16X16) {
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;
// 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]];
} else if (bsize == BLOCK_16X32) {
// The row shift index for the second 16x16 block.
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]];
}
return force_skip_low_temp_var;
}
@@ -1503,6 +1526,12 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
continue;
}
if (cpi->sf.short_circuit_low_temp_var == 2 &&
force_skip_low_temp_var && ref_frame == LAST_FRAME &&
this_mode == NEWMV) {
continue;
}
if (cpi->use_svc) {
if (svc_force_zero_mode[ref_frame - 1] &&
frame_mv[this_mode][ref_frame].as_int != 0)
@@ -1842,8 +1871,9 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
inter_mode_thresh = (inter_mode_thresh << 1) + inter_mode_thresh;
}
// Perform intra prediction search, if the best SAD is above a certain
// threshold. Skip intra prediction if force_skip_low_temp_var is set.
if (!force_skip_low_temp_var && perform_intra_pred &&
// threshold.
if ((!force_skip_low_temp_var || bsize < BLOCK_32X32) &&
perform_intra_pred &&
(best_rdc.rdcost == INT64_MAX ||
(!x->skip && best_rdc.rdcost > inter_mode_thresh &&
bsize <= cpi->sf.max_intra_bsize))) {