Commit 1434f769 authored by Jingning Han's avatar Jingning Han
Browse files

Skip ref frame mode search conditioned on predicted mv residuals

This commit makes the RTC coding mode to conditionally skip the
reference frame mode search, when the predicted motion vector of
the current reference frame gives more than two times sum of
absolute difference compared to that of other reference frames.

It reduces the runtim by 1% - 4% for speed -5 and -6. The average
compression performance is improved by about 0.1% in both settings.

It is of particular benefit to light change scenarios. The
compression performance of test clip mmmovingvga.y4m is improved by
6.39% and 15.69% at high bit rates for speed -5 and -6, respectively.

Speed -5
vidyo1 16555 b/f, 40.818 dB, 12422 ms ->
       16552 b/f, 40.804 dB, 12100 ms

nik    33211 b/f, 39.138 dB, 11341 ms ->
       33228 b/f, 39.139 dB, 11023 ms

mmmoving 33263 b/f, 40.935 dB, 13508 ms ->
         33256 b/f, 41.068 dB, 12861 ms

Speed -6
vidyo1 16541 b/f, 40.227 dB, 8437 ms ->
       16540 b/f, 40.220 dB, 8216 ms

nik    33272 b/f, 38.399 dB, 7610 ms ->
       33267 b/f, 38.414 dB, 7490 ms

mmmoving 33255 b/f, 40.555 dB, 7523 ms ->
         33257 b/f, 40.975 dB, 7493 ms

Change-Id: Id2aef76ef74a3cba5e9a82a83b792144948c6a91
parent 7e119e29
......@@ -518,6 +518,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
PRED_BUFFER *this_mode_pred = NULL;
const int pixels_in_block = bh * bw;
int reuse_inter_pred = cpi->sf.reuse_inter_pred_sby && ctx->pred_pixel_ready;
int ref_frame_skip_mask = 0;
if (reuse_inter_pred) {
int i;
......@@ -563,7 +564,6 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
mbmi->segment_id = segment_id;
for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) {
PREDICTION_MODE this_mode;
x->pred_mv_sad[ref_frame] = INT_MAX;
frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
frame_mv[ZEROMV][ref_frame].as_int = 0;
......@@ -572,6 +572,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
int_mv *const candidates = mbmi->ref_mvs[ref_frame];
const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf;
vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col,
sf, sf);
......@@ -592,8 +593,23 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
vp9_mv_pred(cpi, x, yv12_mb[ref_frame][0].buf, yv12->y_stride,
ref_frame, bsize);
} else {
continue;
ref_frame_skip_mask |= (1 << ref_frame);
}
}
for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) {
PREDICTION_MODE this_mode;
int i = (ref_frame == LAST_FRAME) ? GOLDEN_FRAME : LAST_FRAME;
if (!(cpi->ref_frame_flags & flag_list[ref_frame]))
continue;
if (cpi->ref_frame_flags & flag_list[i])
if (x->pred_mv_sad[ref_frame] > (x->pred_mv_sad[i] << 1))
ref_frame_skip_mask |= (1 << ref_frame);
if (ref_frame_skip_mask & (1 << ref_frame))
continue;
// Select prediction reference frames.
xd->plane[0].pre[0] = yv12_mb[ref_frame][0];
......
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