From: Jingning Han Date: Tue, 23 Feb 2016 17:25:24 +0000 (-0800) Subject: Enable context based motion vector entropy coding X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47bc2a57415d30cc1745ff8800ddbb06201bdc25;p=libvpx Enable context based motion vector entropy coding This commit enables a context based motion vector entropy coding conditioned on dynamic reference motion vector list. This (along with the previous CL) imporves the coding gains due to dynamic motion vector referencing based entropy coding: derf 0.1% hevcmr 0.2% stdhd 0.7% hevchr 0.4% No encoding time change was observed. Change-Id: I179c723844079195f6952a12582996a3ca9e9914 --- diff --git a/vp10/common/enums.h b/vp10/common/enums.h index e1f316855..6d7d08c7f 100644 --- a/vp10/common/enums.h +++ b/vp10/common/enums.h @@ -227,7 +227,7 @@ typedef enum { #define SKIP_CONTEXTS 3 #if CONFIG_REF_MV -#define NMV_CONTEXTS 2 +#define NMV_CONTEXTS 3 #define NEWMV_MODE_CONTEXTS 7 #define ZEROMV_MODE_CONTEXTS 2 diff --git a/vp10/common/mvref_common.h b/vp10/common/mvref_common.h index b3a8bebe3..bc6d82432 100644 --- a/vp10/common/mvref_common.h +++ b/vp10/common/mvref_common.h @@ -236,9 +236,11 @@ static INLINE int vp10_nmv_ctx(const uint8_t ref_mv_count, if (ref_mv_stack[0].weight > REF_CAT_LEVEL && ref_mv_count > 0) { if (abs(ref_mv_stack[0].this_mv.as_mv.row - - ref_mv_stack[0].pred_mv.as_mv.row) < 8 && - abs(ref_mv_stack[0].this_mv.as_mv.col - - ref_mv_stack[0].pred_mv.as_mv.col) < 8) + ref_mv_stack[0].pred_mv.as_mv.row) <= 4 && + abs(ref_mv_stack[0].this_mv.as_mv.col - + ref_mv_stack[0].pred_mv.as_mv.col) <= 4) + return 2; + else return 1; } return 0;