summaryrefslogtreecommitdiff
path: root/vp8/common
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2012-05-14 17:39:42 -0700
committerRonald S. Bultje <rbultje@google.com>2012-05-15 15:32:44 -0700
commit0b8a95a0b2e3451b79cfbc6bc629c779d9915762 (patch)
tree480a9f744a4d368efcf1f31e6f8055fdda3269f5 /vp8/common
parentc5ddb7f0160ff9e2b8f2f67491fe27947e709923 (diff)
downloadlibvpx-0b8a95a0b2e3451b79cfbc6bc629c779d9915762.tar
libvpx-0b8a95a0b2e3451b79cfbc6bc629c779d9915762.tar.gz
libvpx-0b8a95a0b2e3451b79cfbc6bc629c779d9915762.tar.bz2
libvpx-0b8a95a0b2e3451b79cfbc6bc629c779d9915762.zip
Rewrite reference frame costing in the RD loop.
I now see I didn't write a very long description, so let's do it here then. We took a pretty big quality hit (0.1-0.2%) from my recent fix of the inversion of arguments to vp8_cost_bit() in the RD reference frame costing. I looked into it and basically the costing prevented us from switching reference frames. This is of course silly, since each frame codes its own prob_intra_coded, so using last frame cost indications as a limiting factor can never be right. Here, I've rewritten that code to estimate costings based partially on statistics from progress on current frame encoding. Overall, this gives us a ~0.2%-0.3% improvement over what we had previously before my argument-inversion-fix, and thus about ~0.4% over current git (on derf-set), and a little more (0.5-1.0%) on HD/STD-HD/YT. Change-Id: I79ebd4ccec4d6edbf0e152d9590d103ba2747775
Diffstat (limited to 'vp8/common')
-rw-r--r--vp8/common/pred_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vp8/common/pred_common.c b/vp8/common/pred_common.c
index 0e01e6c8a..f7222a7ec 100644
--- a/vp8/common/pred_common.c
+++ b/vp8/common/pred_common.c
@@ -277,7 +277,7 @@ void calc_ref_probs( int * count, vp8_prob * probs )
tot_count = count[0] + count[1] + count[2] + count[3];
if ( tot_count )
{
- probs[0] = (vp8_prob)((count[0] * 255) / tot_count);
+ probs[0] = (vp8_prob)((count[0] * 255 + (tot_count >> 1)) / tot_count);
probs[0] += !probs[0];
}
else
@@ -286,7 +286,7 @@ void calc_ref_probs( int * count, vp8_prob * probs )
tot_count -= count[0];
if ( tot_count )
{
- probs[1] = (vp8_prob)((count[1] * 255) / tot_count);
+ probs[1] = (vp8_prob)((count[1] * 255 + (tot_count >> 1)) / tot_count);
probs[1] += !probs[1];
}
else
@@ -295,7 +295,7 @@ void calc_ref_probs( int * count, vp8_prob * probs )
tot_count -= count[1];
if ( tot_count )
{
- probs[2] = (vp8_prob)((count[2] * 255) / tot_count);
+ probs[2] = (vp8_prob)((count[2] * 255 + (tot_count >> 1)) / tot_count);
probs[2] += !probs[2];
}
else