summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encodeframe.c
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-04-06 09:17:46 -0700
committerMarco Paniconi <marpan@google.com>2018-04-06 11:36:48 -0700
commit7255ff9b85dcf06ee2f522b57389cae8f55f0afd (patch)
tree9f412aa0378cd800463d3740db271a578cb38cfa /vp9/encoder/vp9_encodeframe.c
parentcfc6dc8db310894493d984faa49801dcb6261b05 (diff)
downloadlibvpx-7255ff9b85dcf06ee2f522b57389cae8f55f0afd.tar
libvpx-7255ff9b85dcf06ee2f522b57389cae8f55f0afd.tar.gz
libvpx-7255ff9b85dcf06ee2f522b57389cae8f55f0afd.tar.bz2
libvpx-7255ff9b85dcf06ee2f522b57389cae8f55f0afd.zip
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
Diffstat (limited to 'vp9/encoder/vp9_encodeframe.c')
-rw-r--r--vp9/encoder/vp9_encodeframe.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 164643558..a283d92a8 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -3717,6 +3717,24 @@ static void hybrid_intra_mode_search(VP9_COMP *cpi, MACROBLOCK *const x,
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 @@ static void nonrd_pick_sb_modes(VP9_COMP *cpi, TileDataEnc *tile_data,
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)