Commit 64348d9f authored by Jingning Han's avatar Jingning Han Committed by Gerrit Code Review
Browse files

Fix mode index use case in vp9_pick_inter_mode

This improves coding performance of speed -5 and -6 by 0.6%,
respectively.

Change-Id: Ic5a7746a88c73285f0b14333d35dc16b02152c25
parent f7b46d8c
...@@ -604,6 +604,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -604,6 +604,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) { for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) {
int rate_mv = 0; int rate_mv = 0;
int mode_rd_thresh; int mode_rd_thresh;
int mode_index = mode_idx[ref_frame][INTER_OFFSET(this_mode)];
if (const_motion[ref_frame] && this_mode == NEARMV) if (const_motion[ref_frame] && this_mode == NEARMV)
continue; continue;
...@@ -611,10 +612,9 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -611,10 +612,9 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (!(cpi->sf.inter_mode_mask[bsize] & (1 << this_mode))) if (!(cpi->sf.inter_mode_mask[bsize] & (1 << this_mode)))
continue; continue;
mode_rd_thresh = mode_rd_thresh = rd_threshes[mode_index];
rd_threshes[mode_idx[ref_frame][INTER_OFFSET(this_mode)]];
if (rd_less_than_thresh(best_rdc.rdcost, mode_rd_thresh, if (rd_less_than_thresh(best_rdc.rdcost, mode_rd_thresh,
rd_thresh_freq_fact[this_mode])) rd_thresh_freq_fact[mode_index]))
continue; continue;
if (this_mode == NEWMV) { if (this_mode == NEWMV) {
...@@ -837,12 +837,12 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -837,12 +837,12 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (is_inter_block(mbmi)) if (is_inter_block(mbmi))
vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact, vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact,
cpi->sf.adaptive_rd_thresh, bsize, cpi->sf.adaptive_rd_thresh, bsize,
mode_idx[ref_frame][INTER_OFFSET(mbmi->mode)]); mode_idx[best_ref_frame][INTER_OFFSET(mbmi->mode)]);
else else
vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact, vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact,
cpi->sf.adaptive_rd_thresh, bsize, cpi->sf.adaptive_rd_thresh, bsize,
mode_idx[ref_frame][mbmi->mode]); mode_idx[INTRA_FRAME][mbmi->mode]);
*rd_cost = best_rdc; *rd_cost = best_rdc;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment