summaryrefslogtreecommitdiff
path: root/vp8/encoder
diff options
context:
space:
mode:
authorAdrian Grange <agrange@google.com>2011-04-14 10:31:56 -0700
committerAdrian Grange <agrange@google.com>2011-04-14 10:50:00 -0700
commit8608de1c6f07b3e0b979177c0ada15f06d358ce9 (patch)
tree70b8e5658534bb9e9a3bf67385c52f6ee43dd21d /vp8/encoder
parentab48305fb6fd9483b3302a0fda6eb39628ea72b0 (diff)
downloadlibvpx-8608de1c6f07b3e0b979177c0ada15f06d358ce9.tar
libvpx-8608de1c6f07b3e0b979177c0ada15f06d358ce9.tar.gz
libvpx-8608de1c6f07b3e0b979177c0ada15f06d358ce9.tar.bz2
libvpx-8608de1c6f07b3e0b979177c0ada15f06d358ce9.zip
Fix usage of value returned by vp8_pick_intra4x4mby_modes
The value of distortion2 returned by vp8_pick_intra4x4mby_modes was being overwritten by the value returned by get16x16prederror before it was tested. Change-Id: If00e80332b272c5545c3a7e381c8041e8319b41a
Diffstat (limited to 'vp8/encoder')
-rw-r--r--vp8/encoder/pickinter.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c
index 4b3c6c632..992d7cf4e 100644
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -639,10 +639,10 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int re
switch (this_mode)
{
case B_PRED:
- distortion2 = *returndistortion; // Best so far passed in as breakout value to vp8_pick_intra4x4mby_modes
- vp8_pick_intra4x4mby_modes(IF_RTCD(&cpi->rtcd), x, &rate, &distortion2);
- rate2 += rate;
- distortion2 = VARIANCE_INVOKE(&cpi->rtcd.variance, get16x16prederror)(x->src.y_buffer, x->src.y_stride, x->e_mbd.predictor, 16, 0x7fffffff);
+ // Pass best so far to vp8_pick_intra4x4mby_modes to use as breakout
+ distortion2 = *returndistortion;
+ vp8_pick_intra4x4mby_modes(IF_RTCD(&cpi->rtcd), x,
+ &rate, &distortion2);
if (distortion2 == INT_MAX)
{
@@ -650,6 +650,11 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int re
}
else
{
+ rate2 += rate;
+ distortion2 = VARIANCE_INVOKE
+ (&cpi->rtcd.variance, get16x16prederror)(
+ x->src.y_buffer, x->src.y_stride,
+ x->e_mbd.predictor, 16, 0x7fffffff);
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
if (this_rd < best_intra_rd)