Commit 4e9b4a15 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

changed mode_context update strategy

Previously, the mode context is always udpated based on stats of current
frame, when there is no count, 50% is used for both left and right branch.
However, it is observed that with such strategy, a small count or no count
at all can skew the probability distribution significantly. This commmit
changed the mode_context update strategy to prevent small counts from
skewing the probability distributions.

Tests on derf set showed a small gain:  .06% in psnr and .09% in ssim

Change-Id: Ic812e64ae5f70251c170b0717f7b7fa587055488
parent 5920b520
......@@ -442,17 +442,13 @@ void vp8_update_mode_context(VP8_COMMON *pc)
int this_prob;
int count = mv_ref_ct[j][i][0] + mv_ref_ct[j][i][1];
if (count)
/* preventing rare occurances from skewing the probs */
if (count>=4)
this_prob = 256 * mv_ref_ct[j][i][0] / count;
this_prob = 128;
this_prob = this_prob? (this_prob<255?this_prob:255):1;
if (this_prob == 0)
this_prob = 1;
if (this_prob == 256)
this_prob = 255;
mode_context[j][i] = this_prob;
this_prob = this_prob? (this_prob<255?this_prob:255):1;
mode_context[j][i] = this_prob;
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