shithub: openh264

Download patch

ref: ae508b9724f26808166f06d9b689d51cf6326a12
parent: 2d4cbcf060f1251c56dd3054bd9ee0a987673500
author: Karina <ruil2@cisco.com>
date: Thu Feb 4 05:25:03 EST 2016

fix error width and height issue

--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -315,8 +315,6 @@
       int32_t iPicturePos               = m_uiSpatialLayersInTemporal[iDependencyId] - 1;
       Scaled_Picture*  pScaledPicture = &m_sScaledPicture;
 
-      int32_t iSrcWidth                 = pSvcParam->SUsedPicRect.iWidth;
-      int32_t iSrcHeight                = pSvcParam->SUsedPicRect.iHeight;
       int32_t iTargetWidth              = pDlayerParam->iVideoWidth;
       int32_t iTargetHeight             = pDlayerParam->iVideoHeight;
 
@@ -323,6 +321,8 @@
       SPicture* pSrcPic                 = (pSpatialIndexMap + iMaxDid)->pSrc;; // large
       SPicture* pDstPic                 = m_pSpatialPic[iDependencyId][iPicturePos]; // small
 
+      int32_t iSrcWidth                 = pSrcPic->iWidthInPixel;
+      int32_t iSrcHeight                = pSrcPic->iHeightInPixel;
       int32_t iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId];
       int32_t iShrinkHeight = pScaledPicture->iScaledHeight[iDependencyId];
       DownsamplePadding (pSrcPic, pDstPic, iSrcWidth, iSrcHeight, iShrinkWidth, iShrinkHeight, iTargetWidth, iTargetHeight,
@@ -384,7 +384,6 @@
   }
   DownsamplePadding (pSrcPic, pDstPic, iSrcWidth, iSrcHeight, iShrinkWidth, iShrinkHeight, iTargetWidth, iTargetHeight,
                      false);
-
   if (pSvcParam->bEnableSceneChangeDetect && !pCtx->pVaa->bIdrPeriodFlag) {
     if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) {
       pCtx->pVaa->eSceneChangeIdc = (pDlayerParamInternal->bEncCurFrmAsIdrFlag ? LARGE_CHANGED_SCENE :