shithub: openh264

Download patch

ref: d0d050d8e5da592100fab4244120d5889a807b84
parent: 3d47b7847d6e8a6f5c186f87d40058c839234995
author: volvet <qizh@cisco.com>
date: Fri Feb 28 08:06:49 EST 2014

refine encode plus code

--- a/codec/encoder/plus/inc/welsEncoderExt.h
+++ b/codec/encoder/plus/inc/welsEncoderExt.h
@@ -77,7 +77,7 @@
    * return: EVideoFrameType [IDR: videoFrameTypeIDR; P: videoFrameTypeP; ERROR: videoFrameTypeInvalid]
    */
   virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
-  virtual int EXTAPI EncodeFrame2 (const SSourcePicture** kppSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo);
+  virtual int EXTAPI EncodeFrameInternal (const SSourcePicture* kppSrcPicList, SFrameBSInfo* pBsInfo);
 
   /*
    * return: 0 - success; otherwise - failed;
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -506,7 +506,7 @@
   }
 
   int32_t uiFrameType = videoFrameTypeInvalid;
-  uiFrameType = EncodeFrame2 (&kpSrcPic, 1, pBsInfo);
+  uiFrameType = EncodeFrameInternal(kpSrcPic, pBsInfo);
 
 #ifdef REC_FRAME_COUNT
   ++ m_uiCountFrameNum;
@@ -522,8 +522,8 @@
 }
 
 
-int CWelsH264SVCEncoder::EncodeFrame2 (const SSourcePicture**   pSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo) {
-  if (!(pSrcPicList && m_pEncContext && m_bInitialFlag) || (nSrcPicNum<=0) ){
+int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture*  pSrcPic, SFrameBSInfo* pBsInfo) {
+  if (!(pSrcPic && m_pEncContext && m_bInitialFlag) ){
     return videoFrameTypeInvalid;
   }
 
@@ -530,7 +530,7 @@
   int32_t iFrameTypeReturned = 0;
   int32_t iFrameType = videoFrameTypeInvalid;
   XMMREG_PROTECT_STORE(CWelsH264SVCEncoder);
-  const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPicList, nSrcPicNum);
+  const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, &pSrcPic, 1);
   XMMREG_PROTECT_LOAD(CWelsH264SVCEncoder);
 
   switch (kiEncoderReturn) {
@@ -635,10 +635,10 @@
 
   ForceIntraFrame (true);
 
-  if (EncodeFrame2 (&kpSrcPic, 1,pBsInfo) != videoFrameTypeInvalid) {
+  if (EncodeFrameInternal (kpSrcPic, pBsInfo) != videoFrameTypeInvalid) {
 	iReturn = 0;
   }
- 
+
 
   // to avoid pause frame bitstream and
   // normal bitstream use different video channel.