From 0b562b2d3d3ab7ca1958cd0c3c8cf137c8ddca11 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev <dkovalev@google.com> Date: Thu, 18 Jul 2013 15:12:46 -0700 Subject: [PATCH] Using VP9_REF_NO_SCALE instead of (1 << VP9_REF_SCALE_SHIFT). Change-Id: Ide58a74d31ff948319445a6337d2c05e98720e34 --- vp9/common/vp9_blockd.h | 2 +- vp9/encoder/vp9_rdopt.c | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index 079597504b..d0fc1d963a 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -169,7 +169,7 @@ enum mv_precision { }; #define VP9_REF_SCALE_SHIFT 14 -#define VP9_REF_NO_SCALE 16384 +#define VP9_REF_NO_SCALE (1 << VP9_REF_SCALE_SHIFT) struct scale_factors { int x_scale_fp; // horizontal fixed point scale factor diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index f62f2486f9..7845529840 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -2360,8 +2360,8 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, // Further refinement that is encode side only to test the top few candidates // in full and choose the best as the centre point for subsequent searches. // The current implementation doesn't support scaling. - if (scale[frame_type].x_scale_fp == (1 << VP9_REF_SCALE_SHIFT) && - scale[frame_type].y_scale_fp == (1 << VP9_REF_SCALE_SHIFT)) + if (scale[frame_type].x_scale_fp == VP9_REF_NO_SCALE && + scale[frame_type].y_scale_fp == VP9_REF_NO_SCALE) mv_pred(cpi, x, yv12_mb[frame_type][0].buf, yv12->y_stride, frame_type, block_size); } @@ -3354,18 +3354,14 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, // TODO(jingning, jkoleszar): scaling reference frame not supported for // SPLITMV. if (mbmi->ref_frame[0] > 0 && - (scale_factor[mbmi->ref_frame[0]].x_scale_fp != - (1 << VP9_REF_SCALE_SHIFT) || - scale_factor[mbmi->ref_frame[0]].y_scale_fp != - (1 << VP9_REF_SCALE_SHIFT)) && + (scale_factor[mbmi->ref_frame[0]].x_scale_fp != VP9_REF_NO_SCALE || + scale_factor[mbmi->ref_frame[0]].y_scale_fp != VP9_REF_NO_SCALE) && this_mode == SPLITMV) continue; if (mbmi->ref_frame[1] > 0 && - (scale_factor[mbmi->ref_frame[1]].x_scale_fp != - (1 << VP9_REF_SCALE_SHIFT) || - scale_factor[mbmi->ref_frame[1]].y_scale_fp != - (1 << VP9_REF_SCALE_SHIFT)) && + (scale_factor[mbmi->ref_frame[1]].x_scale_fp != VP9_REF_NO_SCALE || + scale_factor[mbmi->ref_frame[1]].y_scale_fp != VP9_REF_NO_SCALE) && this_mode == SPLITMV) continue; -- GitLab