From 41b7f76db14ecdfaea333e7b38eb76f657f4a81a Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 9 Feb 2015 15:29:58 -0800 Subject: [PATCH] Account for inter prediction filter rate cost in rtc mode selection Add the rate cost on inter prediction filter type to the overall rate-distortion cost in vp9_pick_mode_inter. Change-Id: I72c34017adf5220cadb3962694ee5404469fc673 --- vp9/encoder/vp9_pickmode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index 70e90b6e7..b592c784d 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -807,9 +807,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize); model_rd_for_sb_y(cpi, bsize, x, xd, &pf_rate[filter], &pf_dist[filter], &pf_var[filter], &pf_sse[filter]); - cost = RDCOST(x->rdmult, x->rddiv, - vp9_get_switchable_rate(cpi, xd) + pf_rate[filter], - pf_dist[filter]); + pf_rate[filter] += vp9_get_switchable_rate(cpi, xd); + cost = RDCOST(x->rdmult, x->rddiv, pf_rate[filter], pf_dist[filter]); pf_tx_size[filter] = mbmi->tx_size; if (cost < best_cost) { best_filter = filter; @@ -846,6 +845,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize); model_rd_for_sb_y(cpi, bsize, x, xd, &this_rdc.rate, &this_rdc.dist, &var_y, &sse_y); + this_rdc.rate += cm->interp_filter == SWITCHABLE ? + vp9_get_switchable_rate(cpi, xd) : 0; } // chroma component rate-distortion cost modeling