From c765cd1a781dbcf4ef384e69b8e01ade3cc495e9 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Tue, 15 Jul 2014 22:34:13 -0700 Subject: [PATCH] Properly handle the effective motion vector in inferred mv modes This commit allows vpxenc to properly set the effective motion vector values in the mode_info struct for inferred motion vector modes. It resolves an enc/dec mismatch issue due to the mode info struct loaded from external file has conflict effective motion vector and inferred prediction mode. Change-Id: I1f47aeaf2b92fcd4dd3d4f3644b88466495be070 --- vp9/encoder/vp9_encodeframe.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index a4f981be1..562d9ead9 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -625,6 +625,20 @@ static void mode_info_conversion(VP9_COMP *cpi, const TileInfo *const tile, } mbmi->mode = mi->bmi[3].as_mode; + } else { + switch (mbmi->mode) { + case NEARESTMV: + mbmi->mv[0].as_int = nearest_mv.as_int; + break; + case NEARMV: + mbmi->mv[0].as_int = near_mv.as_int; + break; + case ZEROMV: + mbmi->mv[0].as_int = 0; + break; + default: + break; + } } } #endif