shithub: openh264

Download patch

ref: ca2436bb5e11655f64fb546f5273b787da537eea
parent: 827c7b2aef972a4723359cac43d95384a9cedf5c
author: lyao2 <lyao2@LYAO2-WS01.cisco.com>
date: Tue Dec 16 05:32:44 EST 2014

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