From: Yaowu Xu Date: Tue, 25 Aug 2015 02:09:03 +0000 (-0700) Subject: Limit new motion vector size X-Git-Tag: v1.5.0~229^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1ec3eb3263dfc265961cc6d5c13dd7be788798e;p=libvpx Limit new motion vector size This commit adds clamp of new vectors similar to the logic in RD loop. Such clamp is not necessary from the perspective of VP8 bitstream, but is added to improve ChromeCast mirroring's robustness. Change-Id: I42f6adbc60ffce283b994869364230858632d6fa --- diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c index f3443dbcc..5ce98ad25 100644 --- a/vp8/encoder/pickinter.c +++ b/vp8/encoder/pickinter.c @@ -1240,7 +1240,10 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, } mode_mv[NEWMV].as_int = d->bmi.mv.as_int; - + // The clamp below is not necessary from the perspective + // of VP8 bitstream, but is added to improve ChromeCast + // mirroring's robustness. Please do not remove. + vp8_clamp_mv2(&mode_mv[this_mode], xd); /* mv cost; */ rate2 += vp8_mv_bit_cost(&mode_mv[NEWMV], &best_ref_mv, cpi->mb.mvcost, 128); @@ -1248,7 +1251,6 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, case NEARESTMV: case NEARMV: - if (mode_mv[this_mode].as_int == 0) continue;