ref: 7255ff9b85dcf06ee2f522b57389cae8f55f0afd
parent: cfc6dc8db310894493d984faa49801dcb6261b05
author: Marco Paniconi <marpan@google.com>
date: Fri Apr 6 05:17:46 EDT 2018
vp9-svc: Hybrid search on spatial layers whose base is key. For spatial layers whose base is a key frame, i.e., when svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame = 1, allow for hybrid search, similar to what we do on key frames. For small blocks (<= 8x8) rd-based intra search will be used, otherwise non-rd pick mode is used. Feature is controlled by nonrd_keyframe, which is set to 1 for now on non-base spatial layers, so this change has currently no effect. Small change only when inter-layer prediction is off, as we now call vp9_pick_intra_mode instead of vp9_pick_inter_mode on key frame. But this change is very small/insignificant. Change-Id: I5372470f720812926ebbe6c4ce68c04336ce0bdd
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -3717,6 +3717,24 @@
vp9_pick_intra_mode(cpi, x, rd_cost, bsize, ctx);
}
+static void hybrid_search_svc_baseiskey(VP9_COMP *cpi, MACROBLOCK *const x,
+ RD_COST *rd_cost, BLOCK_SIZE bsize,
+ PICK_MODE_CONTEXT *ctx,
+ TileDataEnc *tile_data, int mi_row,
+ int mi_col) {
+ if (!cpi->sf.nonrd_keyframe && bsize <= BLOCK_8X8) {
+ vp9_rd_pick_intra_mode_sb(cpi, x, rd_cost, bsize, ctx, INT64_MAX);
+ } else {
+ if (cpi->svc.disable_inter_layer_pred == INTER_LAYER_PRED_OFF)
+ vp9_pick_intra_mode(cpi, x, rd_cost, bsize, ctx);
+ else if (bsize >= BLOCK_8X8)
+ vp9_pick_inter_mode(cpi, x, tile_data, mi_row, mi_col, rd_cost, bsize,
+ ctx);
+ else
+ vp9_pick_inter_mode_sub8x8(cpi, x, mi_row, mi_col, rd_cost, bsize, ctx);
+ }
+}
+
static void nonrd_pick_sb_modes(VP9_COMP *cpi, TileDataEnc *tile_data,
MACROBLOCK *const x, int mi_row, int mi_col,
RD_COST *rd_cost, BLOCK_SIZE bsize,
@@ -3749,6 +3767,9 @@
if (cm->frame_type == KEY_FRAME)
hybrid_intra_mode_search(cpi, x, rd_cost, bsize, ctx);
+ else if (cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)
+ hybrid_search_svc_baseiskey(cpi, x, rd_cost, bsize, ctx, tile_data, mi_row,
+ mi_col);
else if (segfeature_active(&cm->seg, mi->segment_id, SEG_LVL_SKIP))
set_mode_info_seg_skip(x, cm->tx_mode, rd_cost, bsize);
else if (bsize >= BLOCK_8X8)
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -531,6 +531,9 @@
sf->limit_newmv_early_exit = 1;
if (!cpi->use_svc) sf->bias_golden = 1;
}
+ // Keep nonrd_keyframe = 1 for non-base spatial layers to prevent
+ // increase in encoding time.
+ if (cpi->use_svc && cpi->svc.spatial_layer_id > 0) sf->nonrd_keyframe = 1;
}
if (speed >= 6) {