shithub: openh264

Download patch

ref: 3343b1996b797ffbf497b44210c3b14604897d05
parent: 34b7f38e94b57ff17c5030aee3694a3b56e90e51
parent: 6c5b22ceff5bca88bf44996a8c25a7007dbb978e
author: Ethan Hugg <ethanhugg@gmail.com>
date: Thu Feb 13 09:35:37 EST 2014

Merge pull request #285 from volvet/develop_b

remove duplicated function

--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -954,28 +954,7 @@
     pSrcV += iSrcStrideUV;
   }
 }
-//vp's padding
-void  VPpadding (uint8_t* pSrcPtr, int32_t iCurWidth, int32_t iTargetWidth, int32_t iCurHeight, int32_t iTargetHeight,
-                 int32_t iStride, uint8_t uiStuffValue) {
-  uint8_t* pTmp;
-  if (iTargetWidth > iCurWidth) {
-    pTmp = pSrcPtr + iCurWidth;
-    for (int32_t i = 0; i < iCurHeight; i++) {
-      WelsMemset (pTmp, uiStuffValue, iTargetWidth - iCurWidth);
-      pTmp += iStride;
-    }
-  }
 
-  if (iTargetHeight > iCurHeight) {
-    pTmp = pSrcPtr + iCurHeight * iStride;
-    for (int32_t i = iCurHeight; i < iTargetHeight; i++) {
-      WelsMemset (pTmp, uiStuffValue, iTargetWidth);
-      pTmp += iStride;
-    }
-  }
-}
-
-
 void  CWelsPreProcess::WelsMoveMemoryWrapper (SWelsSvcCodingParam* pSvcParam, SPicture* pDstPic,
     const SSourcePicture* kpSrc,
     const int32_t kiTargetWidth, const int32_t kiTargetHeight) {
@@ -1037,15 +1016,7 @@
 
     //in VP Process
     if (kiTargetWidth > iSrcWidth || kiTargetHeight > iSrcHeight) {
-      const int32_t kiTargetWidthC  = (kiTargetWidth >> 1);
-      const int32_t kiTargetHeightC = (kiTargetHeight >> 1);
-      const int32_t kiSrcWidthC        = (iSrcWidth >> 1);
-      const int32_t kiSrcHeightC       = (iSrcHeight >> 1);
-
-      // padding pDstPic I420
-      VPpadding ((uint8_t*)pDstY, iSrcWidth, kiTargetWidth, iSrcHeight, kiTargetHeight, kiDstStrideY, 0);
-      VPpadding ((uint8_t*)pDstU, kiSrcWidthC, kiTargetWidthC, kiSrcHeightC, kiTargetHeightC, kiDstStrideUV, 0x80);
-      VPpadding ((uint8_t*)pDstV, kiSrcWidthC, kiTargetWidthC, kiSrcHeightC, kiTargetHeightC, kiDstStrideUV, 0x80);
+      Padding(pDstY, pDstU, pDstV, kiDstStrideY, kiDstStrideUV, iSrcWidth, kiTargetWidth, iSrcHeight, kiTargetHeight);
     }
   }