shithub: openh264

Download patch

ref: 3943119a68f716ddd69087e4301beb52a716c8ab
parent: 0279cd759726c3a9c690415f4351bac0cda8df37
parent: 4808eca022be4fd6c48e9bbadaf88db941fc34a8
author: huili2 <[email protected]>
date: Fri Feb 28 10:39:52 EST 2014

Merge pull request #370 from volvet/develop_b

refine welsEncoderEncodeExt

--- a/codec/encoder/core/inc/extern.h
+++ b/codec/encoder/core/inc/extern.h
@@ -88,15 +88,11 @@
  * \brief	core svc encoding process
  *
  * \param	h			sWelsEncCtx*, encoder context
- * \param	dst			FrameBSInfo*
- * \param	pSrc			SSourcePicture* for need_ds = true or SSourcePicture** for need_ds = false
- * \param	kiConfiguredLayerNum	=1 in case need_ds = true or >1 in case need_ds = false
- * \param	need_ds		Indicate whether need down sampling desired
- *						[NO in picture list case, YES in console aplication based]
+ * \param	pFbi			FrameBSInfo*
+ * \param	kpSrcPic		Source picture
  * \return	EFrameType (WELS_FRAME_TYPE_IDR/WELS_FRAME_TYPE_I/WELS_FRAME_TYPE_P)
  */
-int32_t WelsEncoderEncodeExt (sWelsEncCtx*, void* pDst, const SSourcePicture** kppSrcList,
-                              const int32_t kiConfiguredLayerNum);
+int32_t WelsEncoderEncodeExt (sWelsEncCtx*, SFrameBSInfo * pFbi, const SSourcePicture* kpSrcPic);
 
 int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst);
 
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3060,16 +3060,11 @@
  * \brief	core svc encoding process
  *
  * \pParam	pCtx			sWelsEncCtx*, encoder context
- * \pParam	pDst			FrameBSInfo*
- * \pParam	pSrc			SSourcePicture* for need_ds = true or SSourcePicture** for need_ds = false
- * \pParam	iConfiguredLayerNum	=1 in case need_ds = true or >1 in case need_ds = false
- * \pParam	need_ds		Indicate whether need down sampling desired
- *						[NO in picture list case, YES in console aplication based]
+ * \pParam	pFbi			FrameBSInfo*
+ * \pParam	pSrcPic			Source Picture
  * \return	EFrameType (WELS_FRAME_TYPE_IDR/WELS_FRAME_TYPE_I/WELS_FRAME_TYPE_P)
  */
-int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePicture** ppSrcList,
-                              const int32_t iConfiguredLayerNum) {
-  SFrameBSInfo* pFbi					= (SFrameBSInfo*)pDst;
+int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSourcePicture* pSrcPic) {
   SLayerBSInfo* pLayerBsInfo					= &pFbi->sLayerInfo[0];
   SWelsSvcCodingParam* pSvcParam	= pCtx->pSvcParam;
   SSpatialPicIndex* pSpatialIndexMap = &pCtx->sSpatialIndexMap[0];
@@ -3108,7 +3103,7 @@
   pFbi->iLayerNum	= 0;	// for initialization
 
   // perform csc/denoise/downsample/padding, generate spatial layers
-  iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, ppSrcList, iConfiguredLayerNum);
+  iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, &pSrcPic, 1);
   if (iSpatialNum < 1) {	// skip due to temporal layer settings (different frame rate)
     ++ pCtx->iCodingIndex;
     pFbi->eOutputFrameType = WELS_FRAME_TYPE_SKIP;
--- 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 EncodeFrameInternal (const SSourcePicture* kppSrcPicList, SFrameBSInfo* pBsInfo);
+  virtual int        EncodeFrameInternal (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
 
   /*
    * return: 0 - success; otherwise - failed;
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -530,7 +530,7 @@
   int32_t iFrameTypeReturned = 0;
   int32_t iFrameType = videoFrameTypeInvalid;
   XMMREG_PROTECT_STORE(CWelsH264SVCEncoder);
-  const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, &pSrcPic, 1);
+  const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPic);
   XMMREG_PROTECT_LOAD(CWelsH264SVCEncoder);
 
   switch (kiEncoderReturn) {