summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-06-08 10:58:36 -0700
committerCode Review <code-review@webmproject.org>2011-06-08 10:58:36 -0700
commit9e4df2bcf5db94c292b57eabf4baf6fb046bee9b (patch)
tree97b4792a63327756b1abf6bde3c4411d6ced1d6c
parent254a7483e585fd3756470f68b1163f9114f1749f (diff)
parent91907e0bf445e63e24257296248d96396cdeb731 (diff)
downloadlibvpx-9e4df2bcf5db94c292b57eabf4baf6fb046bee9b.tar
libvpx-9e4df2bcf5db94c292b57eabf4baf6fb046bee9b.tar.gz
libvpx-9e4df2bcf5db94c292b57eabf4baf6fb046bee9b.tar.bz2
libvpx-9e4df2bcf5db94c292b57eabf4baf6fb046bee9b.zip
Merge "vp8_pick_intra_mode: correct returned rate"
-rw-r--r--vp8/encoder/pickinter.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c
index 021ab7fb2..b1dddd756 100644
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -972,7 +972,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
void vp8_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_)
{
int error4x4, error16x16 = INT_MAX;
- int rate, distortion, best_distortion;
+ int rate, best_rate = 0, distortion, best_distortion;
MB_PREDICTION_MODE mode, best_mode = DC_PRED;
int this_rd;
@@ -995,6 +995,7 @@ void vp8_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_)
error16x16 = this_rd;
best_mode = mode;
best_distortion = distortion;
+ best_rate = rate;
}
}
x->e_mbd.mode_info_context->mbmi.mode = best_mode;
@@ -1002,7 +1003,10 @@ void vp8_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_)
error4x4 = pick_intra4x4mby_modes(IF_RTCD(&cpi->rtcd), x, &rate,
&best_distortion);
if (error4x4 < error16x16)
+ {
x->e_mbd.mode_info_context->mbmi.mode = B_PRED;
+ best_rate = rate;
+ }
- *rate_ = rate;
+ *rate_ = best_rate;
}