Merge pull request #636 from volvet/refine_encoder_wrap
Refine encoder wrap
This commit is contained in:
commit
94cabe10d5
@ -104,7 +104,7 @@ class CWelsH264SVCEncoder : public ISVCEncoder {
|
||||
virtual int EXTAPI GetOption (ENCODER_OPTION opt_id, void* option);
|
||||
|
||||
private:
|
||||
int Initialize2 (SWelsSvcCodingParam* argv);
|
||||
int InitializeInternal (SWelsSvcCodingParam* argv);
|
||||
|
||||
sWelsEncCtx* m_pEncContext;
|
||||
|
||||
@ -130,7 +130,6 @@ class CWelsH264SVCEncoder : public ISVCEncoder {
|
||||
#endif//REC_FRAME_COUNT
|
||||
|
||||
void InitEncoder (void);
|
||||
int32_t RawData2SrcPic (const uint8_t* pSrc);
|
||||
void DumpSrcPicture (const uint8_t* pSrc);
|
||||
};
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) {
|
||||
return cmInitParaError;
|
||||
}
|
||||
|
||||
return Initialize2 (&sConfig);
|
||||
return InitializeInternal(&sConfig);
|
||||
}
|
||||
|
||||
int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) {
|
||||
@ -238,10 +238,10 @@ int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) {
|
||||
return cmInitParaError;
|
||||
}
|
||||
|
||||
return Initialize2 (&sConfig);
|
||||
return InitializeInternal(&sConfig);
|
||||
}
|
||||
|
||||
int CWelsH264SVCEncoder::Initialize2 (SWelsSvcCodingParam* pCfg) {
|
||||
int CWelsH264SVCEncoder::InitializeInternal(SWelsSvcCodingParam* pCfg) {
|
||||
if (NULL == pCfg) {
|
||||
WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n",
|
||||
pCfg);
|
||||
@ -470,37 +470,6 @@ int32_t CWelsH264SVCEncoder::Uninitialize() {
|
||||
}
|
||||
|
||||
|
||||
int32_t CWelsH264SVCEncoder::RawData2SrcPic (const uint8_t* pSrc) {
|
||||
assert (m_iSrcListSize > 0);
|
||||
|
||||
int32_t y_length = m_iMaxPicWidth * m_iMaxPicHeight;
|
||||
m_pSrcPicList[0]->pData[0] = const_cast<uint8_t*> (pSrc);
|
||||
|
||||
switch (m_iCspInternal & (~videoFormatVFlip)) {
|
||||
case videoFormatYVYU:
|
||||
case videoFormatUYVY:
|
||||
case videoFormatYUY2:
|
||||
case videoFormatRGB:
|
||||
case videoFormatBGR:
|
||||
case videoFormatBGRA:
|
||||
case videoFormatRGBA:
|
||||
case videoFormatARGB:
|
||||
case videoFormatABGR:
|
||||
m_pSrcPicList[0]->pData[1] = m_pSrcPicList[0]->pData[2] = NULL;
|
||||
break;
|
||||
case videoFormatI420:
|
||||
case videoFormatYV12:
|
||||
m_pSrcPicList[0]->pData[1] = m_pSrcPicList[0]->pData[0] + y_length;
|
||||
m_pSrcPicList[0]->pData[2] = m_pSrcPicList[0]->pData[1] + (y_length >> 2);
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SVC core encoding
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user