diff options
Diffstat (limited to 'vp9/encoder/vp9_rdopt.c')
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index cce9746a2..29fafc08b 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -3051,7 +3051,6 @@ static void estimate_ref_frame_costs(VP9_COMP *cpi, int segment_id, unsigned int int pred_flag; int pred_ctx; int i; - int tot_count; vp9_prob pred_prob, new_pred_prob; int seg_ref_active; @@ -3075,13 +3074,8 @@ static void estimate_ref_frame_costs(VP9_COMP *cpi, int segment_id, unsigned int // Predict probability for current frame based on stats so far pred_ctx = vp9_get_pred_context(cm, xd, PRED_REF); - tot_count = cpi->ref_pred_count[pred_ctx][0] + cpi->ref_pred_count[pred_ctx][1]; - if (tot_count) { - new_pred_prob = - (cpi->ref_pred_count[pred_ctx][0] * 255 + (tot_count >> 1)) / tot_count; - new_pred_prob += !new_pred_prob; - } else - new_pred_prob = 128; + new_pred_prob = get_binary_prob(cpi->ref_pred_count[pred_ctx][0], + cpi->ref_pred_count[pred_ctx][1]); // Get the set of probabilities to use if prediction fails mod_refprobs = cm->mod_refprobs[pred_ref]; |