From 49c24646a94f60cb9214836d1b246a695eb8f4de Mon Sep 17 00:00:00 2001 From: sijchen Date: Fri, 17 Jan 2014 13:55:03 +0800 Subject: [PATCH] fix the range of SAD --- codec/encoder/core/inc/svc_motion_estimate.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codec/encoder/core/inc/svc_motion_estimate.h b/codec/encoder/core/inc/svc_motion_estimate.h index 074257de..9626b9b1 100644 --- a/codec/encoder/core/inc/svc_motion_estimate.h +++ b/codec/encoder/core/inc/svc_motion_estimate.h @@ -50,15 +50,15 @@ namespace WelsSVCEnc { #define BASE_MV_MB_NMB ((2*(MV_RANGE+ITERATIVE_TIMES)/MB_WIDTH_LUMA)-1) union SadPredISatdUnit { -uint16_t uiSadPred; -uint16_t uiSatd; //reuse the sad_pred as a temp satd pData +uint32_t uiSadPred; +uint32_t uiSatd; //reuse the sad_pred as a temp satd pData }; typedef struct TagWelsME { /* input */ uint16_t* pMvdCost; union SadPredISatdUnit uSadPredISatd; //reuse the sad_pred as a temp pData -uint16_t uiSadCost; //used by ME and RC -uint16_t uiSatdCost; /* satd + lm * nbits */ +uint32_t uiSadCost; //used by ME and RC //max SAD should be max_delta*size+lambda*mvdsize = 255*256+91*33*2 = 65280 + 6006 = 71286 > (2^16)-1 = 65535 +uint32_t uiSatdCost; /* satd + lm * nbits */ uint8_t uiPixel; /* PIXEL_WxH */ uint8_t uiReserved;