shithub: openh264

Download patch

ref: 53c14dccf0b24a7d42009ebbde5c7094fa4f59d6
parent: a0b0866597bce121bdace210916274d0a9e63c4e
parent: 3025c58a67078e909ebc0ac79df5e8d768690707
author: sijchen <[email protected]>
date: Fri Nov 21 09:01:43 EST 2014

Merge pull request #1545 from ruil2/add_traces

add some traces

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -494,7 +494,8 @@
       pLayerParam = & (pParam->sSpatialLayers[i]);
       fRatio = pLayerParam->iSpatialBitrate / (static_cast<float> (iOrigTotalBitrate));
       pLayerParam->iSpatialBitrate = static_cast<int32_t> (pParam->iTargetBitrate * fRatio);
-      if ( UNSPECIFIED_BIT_RATE != pLayerParam->iMaxSpatialBitrate && pLayerParam->iSpatialBitrate > pLayerParam->iMaxSpatialBitrate ) {
+      if (UNSPECIFIED_BIT_RATE != pLayerParam->iMaxSpatialBitrate
+          && pLayerParam->iSpatialBitrate > pLayerParam->iMaxSpatialBitrate) {
         WelsLog (pLogCtx, WELS_LOG_WARNING,
                  "WelsEncoderApplyBitRate(), iSpatialBitrate(%d) > iMaxSpatialBitrate(%d) at Layer %d, limiting iSpatialBitrate to iMaxSpatialBitrate!",
                  pLayerParam->iSpatialBitrate, pLayerParam->iMaxSpatialBitrate, iLayer);
@@ -503,7 +504,8 @@
     }
   } else {
     SSpatialLayerConfig* pLayerParam = & (pParam->sSpatialLayers[iLayer]);
-    if ( UNSPECIFIED_BIT_RATE != pLayerParam->iMaxSpatialBitrate && pLayerParam->iSpatialBitrate > pLayerParam->iMaxSpatialBitrate ) {
+    if (UNSPECIFIED_BIT_RATE != pLayerParam->iMaxSpatialBitrate
+        && pLayerParam->iSpatialBitrate > pLayerParam->iMaxSpatialBitrate) {
       WelsLog (pLogCtx, WELS_LOG_WARNING,
                "WelsEncoderApplyBitRate(), iSpatialBitrate(%d) > iMaxSpatialBitrate(%d) at Layer %d, limiting iSpatialBitrate to iMaxSpatialBitrate!",
                pLayerParam->iSpatialBitrate, pLayerParam->iMaxSpatialBitrate, iLayer);
@@ -3087,8 +3089,8 @@
   if (iSpatialNum < 1) {	// skip due to temporal layer settings (different frame rate)
     ++ pCtx->iCodingIndex;
     pFbi->eFrameType = videoFrameTypeSkip;
-    WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld",
-             pSrcPic->uiTimeStamp);
+    WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, Frame type =%d",
+             pSrcPic->uiTimeStamp, pFbi->eFrameType);
     return ENC_RETURN_SUCCESS;
   }
 
@@ -3095,8 +3097,8 @@
   eFrameType = DecideFrameType (pCtx, iSpatialNum);
   if (eFrameType == videoFrameTypeSkip) {
     pFbi->eFrameType = eFrameType;
-    WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld",
-             pSrcPic->uiTimeStamp);
+    WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, Frame type =%d",
+             pSrcPic->uiTimeStamp, pFbi->eFrameType);
     return ENC_RETURN_SUCCESS;
   }
 
@@ -3103,8 +3105,8 @@
   //loop each layer to check if have skip frame when RC and frame skip enable
   if (CheckFrameSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType, pSrcPic->uiTimeStamp)) {
     pFbi->eFrameType = videoFrameTypeSkip;
-    WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld",
-             pSrcPic->uiTimeStamp);
+    WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, Frame type =%d",
+             pSrcPic->uiTimeStamp, pFbi->eFrameType);
     return ENC_RETURN_SUCCESS;
   }
   InitFrameCoding (pCtx, eFrameType);
@@ -3701,8 +3703,9 @@
   pFbi->iLayerNum			= iLayerNum;
   pFbi->iSubSeqId = GetSubSequenceId (pCtx, eFrameType);
 
-  WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerNum = %d,iSubSeqId = %d", iLayerNum,
-           pFbi->iSubSeqId);
+  WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerNum = %d,iSubSeqId = %d,iFrameSize = %d",
+           iLayerNum,
+           pFbi->iSubSeqId, iFrameSize);
   for (int32_t i = 0; i < iLayerNum; i++)
     WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d", i,
              pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount);