shithub: openh264

Download patch

ref: 2c69638773e0e9ef3167a3fe641173afe0e1d426
parent: 812b57c7043dac250d4dc599fda2cc9b1d251fde
parent: ca2436bb5e11655f64fb546f5273b787da537eea
author: sijchen <sijchen@cisco.com>
date: Tue Dec 16 06:51:18 EST 2014

Merge pull request #1633 from lyao2/avg_qp2

add average QP in statistics

--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -596,6 +596,7 @@
   float fAverageFrameRate;                     ///< the average frame rate in, calculate since encoding starts, supposed that the input timestamp is in unit of ms
   float fLatestFrameRate;                      ///< the frame rate in, in the last second, supposed that the input timestamp is in unit of ms (? useful for checking BR, but is it easy to calculate?
   unsigned int uiBitRate;                      ///< sendrate in Bits per second, calculated within the set time-window
+  unsigned int uiAverageFrameQP;                    ///< the average QP of last encoded frame
 
   unsigned int uiInputFrameCount;              ///< number of frames
   unsigned int uiSkippedFrameCount;            ///< number of frames
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -603,6 +603,7 @@
   }
   pStatistics->fLatestFrameRate = m_pEncContext->pWelsSvcRc->fLatestFrameRate; //TODO: finish the calculation in RC
   pStatistics->uiBitRate = m_pEncContext->pWelsSvcRc->iActualBitRate; //TODO: finish the calculation in RC
+  pStatistics->uiAverageFrameQP = m_pEncContext->pWelsSvcRc->iAverageFrameQp;
 
   if (videoFrameTypeIDR == eFrameType || videoFrameTypeI == eFrameType) {
     pStatistics->uiIDRSentNum ++;
@@ -631,11 +632,11 @@
 
       WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
                "EncoderStatistics: %dx%d, SpeedInMs: %f, fAverageFrameRate=%f, \
-               LastFrameRate=%f, LatestBitRate=%d, uiInputFrameCount=%d, uiSkippedFrameCount=%d, \
+               LastFrameRate=%f, LatestBitRate=%d, LastFrameQP=%d, uiInputFrameCount=%d, uiSkippedFrameCount=%d, \
                uiResolutionChangeTimes=%d, uIDRReqNum=%d, uIDRSentNum=%d, uLTRSentNum=NA",
                pStatistics->uiWidth, pStatistics->uiHeight,
                pStatistics->fAverageFrameSpeedInMs, pStatistics->fAverageFrameRate,
-               pStatistics->fLatestFrameRate, pStatistics->uiBitRate,
+               pStatistics->fLatestFrameRate, pStatistics->uiBitRate, pStatistics->uiAverageFrameQP,
                pStatistics->uiInputFrameCount, pStatistics->uiSkippedFrameCount,
                pStatistics->uiResolutionChangeTimes, pStatistics->uiIDRReqNum, pStatistics->uiIDRSentNum);
       //TODO: the following statistics will be calculated and added later