shithub: openh264

Download patch

ref: 0279cd759726c3a9c690415f4351bac0cda8df37
parent: 2dd41096d50429cd6c90dafcb3d2f1e16d07a43b
parent: d0d050d8e5da592100fab4244120d5889a807b84
author: Licai Guo <licaguo@cisco.com>
date: Fri Feb 28 09:18:06 EST 2014

Merge pull request #367 from volvet/refine-enc-plus

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.