summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorAlpha Lam <hclam@google.com>2011-08-31 11:43:00 +0100
committerAlpha Lam <hclam@google.com>2011-08-31 14:06:55 +0100
commit0e05f2c6c96e5b46ff67ddb7deff740275da4b3d (patch)
tree7271de66c90adb43cbd857ced369100a32d2113d /vp8
parent2f964bac26340746d4e40f69cff61074770b81ba (diff)
downloadlibvpx-0e05f2c6c96e5b46ff67ddb7deff740275da4b3d.tar
libvpx-0e05f2c6c96e5b46ff67ddb7deff740275da4b3d.tar.gz
libvpx-0e05f2c6c96e5b46ff67ddb7deff740275da4b3d.tar.bz2
libvpx-0e05f2c6c96e5b46ff67ddb7deff740275da4b3d.zip
Skip computation of distortion in vp8_pick_inter_mode if active_map is used
If a block is marked to be inactive then set distortion to 0. Change-Id: Ib415f19642a2ff7b5cf5cfaedd60ebbd79732272
Diffstat (limited to 'vp8')
-rw-r--r--vp8/encoder/pickinter.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c
index 9cdaf7d53..bfac3fa8f 100644
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -775,6 +775,15 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
x->e_mbd.mode_info_context->mbmi.mv.as_int =
mode_mv[this_mode].as_int;
+ /* Exit early and don't compute the distortion if this macroblock is marked inactive. */
+ if (cpi->active_map_enabled && x->active_ptr[0] == 0)
+ {
+ sse = 0;
+ distortion2 = 0;
+ x->skip = 1;
+ break;
+ }
+
if((this_mode != NEWMV) ||
!(have_subp_search) || cpi->common.full_pixel==1)
distortion2 = get_inter_mbpred_error(x,
@@ -783,11 +792,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
- if (cpi->active_map_enabled && x->active_ptr[0] == 0)
- {
- x->skip = 1;
- }
- else if (sse < x->encode_breakout)
+ if (sse < x->encode_breakout)
{
// Check u and v to make sure skip is ok
int sse2 = 0;