shithub: openh264

Download patch

ref: 10dfb2670bbf3df00e0124e2a301bee2ffdd22ca
parent: 22bec095072d00e53df92eec7c51362ff594572d
author: Karina <ruil2@cisco.com>
date: Thu Mar 24 10:17:47 EDT 2016

fix skip frames statistics issue

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3797,6 +3797,7 @@
 #endif//_DEBUG
   pCtx->iEncoderError = ENC_RETURN_SUCCESS;
   pCtx->bCurFrameMarkedAsSceneLtr = false;
+  pFbi->eFrameType = videoFrameTypeSkip;
   pFbi->iLayerNum = 0; // for initialization
   pFbi->uiTimeStamp = GetTimestampForRc (pSrcPic->uiTimeStamp, pCtx->uiLastTimestamp, pCtx->pSvcParam->sSpatialLayers[pCtx->pSvcParam->iSpatialLayerNum - 1].fFrameRate);
   for (int32_t iNalIdx = 0; iNalIdx < MAX_LAYER_NUM_OF_FRAME; iNalIdx++) {
@@ -3811,7 +3812,6 @@
   if (iSpatialNum < 1) {
     // ++ pCtx->iCodingIndex;
     pLayerBsInfo->eFrameType = videoFrameTypeSkip;
-    pFbi->eFrameType = videoFrameTypeSkip;
     WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
              "[Rc] Frame timestamp = %lld, skip one frame due to preprocessing return (temporal layer settings or else), continual skipped %d frames",
              pSrcPic->uiTimeStamp, pCtx->iContinualSkipFrames);
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -574,7 +574,7 @@
   int32_t iMaxDid = m_pEncContext->pSvcParam->iSpatialLayerNum - 1;
   SLayerBSInfo*  pLayerInfo = &pBsInfo->sLayerInfo[0];
   for (int32_t iDid = 0; iDid <= iMaxDid; iDid++) {
-    EVideoFrameType eFrameType = videoFrameTypeInvalid;
+    EVideoFrameType eFrameType = pBsInfo->eFrameType;
     int32_t kiCurrentFrameSize = 0;
     if (pBsInfo->eFrameType == videoFrameTypeSkip) {
       eFrameType = videoFrameTypeSkip;