shithub: openh264

Download patch

ref: c1255451d71a34f1ced734ae86211e3c94d8ceeb
parent: 106d13d26c46267bbdf73f34ce22a318e4afa414
author: Karina <[email protected]>
date: Mon Jun 6 13:06:56 EDT 2016

use the correct frametype in statistics info

--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -574,21 +574,16 @@
   int32_t iMaxDid = m_pEncContext->pSvcParam->iSpatialLayerNum - 1;
   SLayerBSInfo*  pLayerInfo = &pBsInfo->sLayerInfo[0];
   for (int32_t iDid = 0; iDid <= iMaxDid; iDid++) {
-    EVideoFrameType eFrameType = pBsInfo->eFrameType;
+    EVideoFrameType eFrameType = videoFrameTypeSkip;
     int32_t kiCurrentFrameSize = 0;
-    if (pBsInfo->eFrameType == videoFrameTypeSkip) {
-      eFrameType = videoFrameTypeSkip;
-    } else {
-      for (int32_t iLayerNum = 0; iLayerNum < pBsInfo->iLayerNum; iLayerNum++) {
-        pLayerInfo = &pBsInfo->sLayerInfo[iLayerNum];
-        if ((pLayerInfo->uiLayerType == VIDEO_CODING_LAYER) && (pLayerInfo->uiSpatialId == iDid)) {
-          eFrameType = pLayerInfo->eFrameType;
-          for (int32_t iNalIdx = 0; iNalIdx < pLayerInfo->iNalCount; iNalIdx++) {
-            kiCurrentFrameSize += pLayerInfo->pNalLengthInByte[iNalIdx];
-          }
+    for (int32_t iLayerNum = 0; iLayerNum < pBsInfo->iLayerNum; iLayerNum++) {
+      pLayerInfo = &pBsInfo->sLayerInfo[iLayerNum];
+      if ((pLayerInfo->uiLayerType == VIDEO_CODING_LAYER) && (pLayerInfo->uiSpatialId == iDid)) {
+        eFrameType = pLayerInfo->eFrameType;
+        for (int32_t iNalIdx = 0; iNalIdx < pLayerInfo->iNalCount; iNalIdx++) {
+          kiCurrentFrameSize += pLayerInfo->pNalLengthInByte[iNalIdx];
         }
       }
-
     }
     SEncoderStatistics* pStatistics = & (m_pEncContext->sEncoderStatistics[iDid]);
 
@@ -1065,7 +1060,8 @@
     if (m_pWelsTrace) {
       WelsTraceCallback callback = * ((WelsTraceCallback*)pOption);
       m_pWelsTrace->SetTraceCallback (callback);
-      WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_TRACE_CALLBACK callback = %p.",
+      WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
+               "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_TRACE_CALLBACK callback = %p.",
                callback);
     }
   }