From 181aa3d7fd6687f7b80d3a3e83239d11332a2347 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 17 Dec 2018 16:49:09 -0800 Subject: [PATCH] Localize x->encode_breakout setup to non-rd mode search The breakout speed feature is currently only used by the non-rd mode search path. Localize it to simplify set_offset() logic. Change-Id: I27e7519c987a7caac2e4bd6be0ede1b9c8320e55 --- vp9/encoder/vp9_encodeframe.c | 3 --- vp9/encoder/vp9_pickmode.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 98343f0d2..e6ba0b644 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -240,11 +240,8 @@ static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile, mi->segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col); } vp9_init_plane_quantizers(cpi, x); - - x->encode_breakout = cpi->segment_encode_breakout[mi->segment_id]; } else { mi->segment_id = 0; - x->encode_breakout = cpi->encode_breakout; } // required by vp9_append_sub8x8_mvs_for_idx() and vp9_find_best_ref_mvs() diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index babfe4a33..a3240513f 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -898,6 +898,7 @@ static void encode_breakout_test( // Skipping threshold for dc. unsigned int thresh_dc; int motion_low = 1; + if (cpi->use_svc && ref_frame == GOLDEN_FRAME) return; if (mi->mv[0].as_mv.row > 64 || mi->mv[0].as_mv.row < -64 || mi->mv[0].as_mv.col > 64 || mi->mv[0].as_mv.col < -64) @@ -1703,6 +1704,10 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, init_best_pickmode(&best_pickmode); + x->encode_breakout = seg->enabled + ? cpi->segment_encode_breakout[mi->segment_id] + : cpi->encode_breakout; + x->source_variance = UINT_MAX; if (cpi->sf.default_interp_filter == BILINEAR) { best_pickmode.best_pred_filter = BILINEAR; -- 2.40.0