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

refine encode plus code
This commit is contained in:
Licai Guo 2014-02-28 14:18:06 +08:00
commit 0279cd7597
2 changed files with 7 additions and 7 deletions

View File

@ -77,7 +77,7 @@ class CWelsH264SVCEncoder : public ISVCEncoder {
* return: EVideoFrameType [IDR: videoFrameTypeIDR; P: videoFrameTypeP; ERROR: videoFrameTypeInvalid] * return: EVideoFrameType [IDR: videoFrameTypeIDR; P: videoFrameTypeP; ERROR: videoFrameTypeInvalid]
*/ */
virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo); 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; * return: 0 - success; otherwise - failed;

View File

@ -506,7 +506,7 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn
} }
int32_t uiFrameType = videoFrameTypeInvalid; int32_t uiFrameType = videoFrameTypeInvalid;
uiFrameType = EncodeFrame2 (&kpSrcPic, 1, pBsInfo); uiFrameType = EncodeFrameInternal(kpSrcPic, pBsInfo);
#ifdef REC_FRAME_COUNT #ifdef REC_FRAME_COUNT
++ m_uiCountFrameNum; ++ m_uiCountFrameNum;
@ -522,15 +522,15 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn
} }
int CWelsH264SVCEncoder::EncodeFrame2 (const SSourcePicture** pSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo) { int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFrameBSInfo* pBsInfo) {
if (!(pSrcPicList && m_pEncContext && m_bInitialFlag) || (nSrcPicNum<=0) ){ if (!(pSrcPic && m_pEncContext && m_bInitialFlag) ){
return videoFrameTypeInvalid; return videoFrameTypeInvalid;
} }
int32_t iFrameTypeReturned = 0; int32_t iFrameTypeReturned = 0;
int32_t iFrameType = videoFrameTypeInvalid; int32_t iFrameType = videoFrameTypeInvalid;
XMMREG_PROTECT_STORE(CWelsH264SVCEncoder); 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); XMMREG_PROTECT_LOAD(CWelsH264SVCEncoder);
switch (kiEncoderReturn) { switch (kiEncoderReturn) {
@ -635,7 +635,7 @@ int CWelsH264SVCEncoder::PauseFrame (const SSourcePicture* kpSrcPic, SFrameBSInf
ForceIntraFrame (true); ForceIntraFrame (true);
if (EncodeFrame2 (&kpSrcPic, 1,pBsInfo) != videoFrameTypeInvalid) { if (EncodeFrameInternal (kpSrcPic, pBsInfo) != videoFrameTypeInvalid) {
iReturn = 0; iReturn = 0;
} }