Commit ff1ae7f7 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

Prevent using uninitialized value in RD decision

INT64_MAX may be assigned as RDCOST when RDCSOST computation is skipped
for speed, this commit to prevent INT64_MAX from being used as real
RDCOST in transform size decision.

Change-Id: I89a945134191bbdea1f1431ade70424ac079eaac
parent fe533c97
...@@ -3093,8 +3093,12 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -3093,8 +3093,12 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd), 0); vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd), 0);
*returndist = dist_y + dist_uv; *returndist = dist_y + dist_uv;
if (cpi->sf.tx_size_search_method == USE_FULL_RD) if (cpi->sf.tx_size_search_method == USE_FULL_RD)
for (i = 0; i < TX_MODES; i++) for (i = 0; i < TX_MODES; i++) {
ctx->tx_rd_diff[i] = tx_cache[i] - tx_cache[cm->tx_mode]; if (tx_cache[i] < INT64_MAX && tx_cache[cm->tx_mode] < INT64_MAX)
ctx->tx_rd_diff[i] = tx_cache[i] - tx_cache[cm->tx_mode];
else
ctx->tx_rd_diff[i] = 0;
}
} }
ctx->mic = *xd->this_mi; ctx->mic = *xd->this_mi;
......
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