From 581aee001e3628f21d1e59ae626a362cd7e9e05b Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Tue, 3 Feb 2015 17:50:48 -0800 Subject: [PATCH] Move tx_mode decision logic into select_tx_mode() Change-Id: I7f8f78c33eb3f33344b029a27bda320f4d68c577 --- vp9/encoder/vp9_encodeframe.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 1e669f4a5..776e1fec6 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -2749,6 +2749,10 @@ static MV_REFERENCE_FRAME get_frame_type(const VP9_COMP *cpi) { static TX_MODE select_tx_mode(const VP9_COMP *cpi, MACROBLOCKD *const xd) { if (xd->lossless) return ONLY_4X4; + if (cpi->common.frame_type == KEY_FRAME && + cpi->sf.use_nonrd_pick_mode && + cpi->sf.partition_search_type == VAR_BASED_PARTITION) + return ALLOW_16X16; if (cpi->sf.tx_size_search_method == USE_LARGESTALL) return ALLOW_32X32; else if (cpi->sf.tx_size_search_method == USE_FULL_RD|| @@ -3684,13 +3688,6 @@ static void encode_frame_internal(VP9_COMP *cpi) { cm->uv_dc_delta_q == 0 && cm->uv_ac_delta_q == 0; - cm->tx_mode = select_tx_mode(cpi, xd); - if (cm->frame_type == KEY_FRAME && - cpi->sf.use_nonrd_pick_mode && - cpi->sf.partition_search_type == VAR_BASED_PARTITION) { - cm->tx_mode = ALLOW_16X16; - } - #if CONFIG_VP9_HIGHBITDEPTH if (cm->use_highbitdepth) x->fwd_txm4x4 = xd->lossless ? vp9_highbd_fwht4x4 : vp9_highbd_fdct4x4; @@ -3708,6 +3705,8 @@ static void encode_frame_internal(VP9_COMP *cpi) { cm->lf.filter_level = 0; } + cm->tx_mode = select_tx_mode(cpi, xd); + vp9_frame_init_quantizer(cpi); vp9_initialize_rd_consts(cpi); -- 2.40.0