ref: 1e112bce3745b2ed0ee1ca4d8b6d0489ac447250
parent: e8655d49f51412050f41027acb43aa2c88c81094
parent: ae0215f9450f63453ed05f708ff42f7017b2858f
author: Marco Paniconi <[email protected]>
date: Mon May 1 17:04:51 EDT 2017
Merge "vp9: SVC: Early exit on golden ref in non-rd pickmode."
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1163,8 +1163,8 @@
{ ALTREF_FRAME, NEARMV }, { ALTREF_FRAME, NEWMV }
};
static const REF_MODE ref_mode_set_svc[RT_INTER_MODES] = {
- { LAST_FRAME, ZEROMV }, { GOLDEN_FRAME, ZEROMV },
- { LAST_FRAME, NEARESTMV }, { LAST_FRAME, NEARMV },
+ { LAST_FRAME, ZEROMV }, { LAST_FRAME, NEARESTMV },
+ { LAST_FRAME, NEARMV }, { GOLDEN_FRAME, ZEROMV },
{ GOLDEN_FRAME, NEARESTMV }, { GOLDEN_FRAME, NEARMV },
{ LAST_FRAME, NEWMV }, { GOLDEN_FRAME, NEWMV }
};
@@ -1481,6 +1481,8 @@
int use_golden_nonzeromv = 1;
int force_skip_low_temp_var = 0;
int skip_ref_find_pred[4] = { 0 };
+ unsigned int sse_zeromv_normalized = UINT_MAX;
+ unsigned int thresh_svc_skip_golden = 500;
#if CONFIG_VP9_TEMPORAL_DENOISING
VP9_PICKMODE_CTX_DEN ctx_den;
int64_t zero_last_cost_orig = INT64_MAX;
@@ -1637,6 +1639,12 @@
if (ref_frame > usable_ref_frame) continue;
if (skip_ref_find_pred[ref_frame]) continue;
+ // For SVC, skip the golden (spatial) reference search if sse of zeromv_last
+ // is below threshold.
+ if (cpi->use_svc && ref_frame == GOLDEN_FRAME &&
+ sse_zeromv_normalized < thresh_svc_skip_golden)
+ continue;
+
if (sf->short_circuit_flat_blocks && x->source_variance == 0 &&
this_mode != NEARESTMV) {
continue;
@@ -1914,6 +1922,12 @@
rd_computed = 1;
model_rd_for_sb_y(cpi, bsize, x, xd, &this_rdc.rate, &this_rdc.dist,
&var_y, &sse_y);
+ }
+ // Save normalized sse (between current and last frame) for (0, 0) motion.
+ if (cpi->use_svc && ref_frame == LAST_FRAME &&
+ frame_mv[this_mode][ref_frame].as_int == 0) {
+ sse_zeromv_normalized =
+ sse_y >> (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]);
}
}