ref: a57094c15292f157db4555a4ce579cedf2cf6c69
parent: 1d167fe7d69af0303ccd9488705d2c94dfc04857
author: Martin Storsjö <[email protected]>
date: Tue Apr 8 07:09:53 EDT 2014
Remove the now unused intermediate code for loading the VP library dynamically
--- a/codec/encoder/core/inc/wels_preprocess.h
+++ b/codec/encoder/core/inc/wels_preprocess.h
@@ -114,21 +114,6 @@
uint8_t *pVaaBlockStaticIdc[16];//real memory,
}SVAAFrameInfoExt;
-class CWelsLib {
- public:
- CWelsLib (sWelsEncCtx* pEncCtx);
- virtual ~CWelsLib();
-
- int32_t CreateIface (IWelsVP** ppInterfaceVp);
- int32_t DestroyIface (IWelsVP* pInterfaceVp);
-
- protected:
- void* QueryFunction (const char* pName);
-
- private:
- void* m_pInterface[2];
-};
-
class CWelsPreProcess {
public:
CWelsPreProcess (sWelsEncCtx* pEncCtx);
@@ -184,7 +169,6 @@
Scaled_Picture m_sScaledPicture;
SPicture* m_pLastSpatialPicture[MAX_DEPENDENCY_LAYER][2];
IWelsVP* m_pInterfaceVp;
- CWelsLib* m_pEncLib;
sWelsEncCtx* m_pEncCtx;
bool m_bInitDone;
uint8_t m_uiSpatialLayersInTemporal[MAX_DEPENDENCY_LAYER];
--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -42,8 +42,6 @@
//***** entry API declaration ************************************************************************//
-typedef EResult (* pfnCreateVpInterface) (void**, int);
-typedef EResult (* pfnDestroyVpInterface) (void*, int);
int32_t WelsInitScaledPic (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPic, CMemoryAlign* pMemoryAlign);
bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPic);
@@ -66,49 +64,6 @@
}
-//***************************************************************************************************//
-CWelsLib::CWelsLib (sWelsEncCtx* pEncCtx) {
- m_pInterface[0] = m_pInterface[1] = NULL;
-}
-
-CWelsLib::~CWelsLib() {
-}
-
-void* CWelsLib::QueryFunction (const char* pName) {
- void* pFunc = NULL;
-
- return pFunc;
-}
-
-int32_t CWelsLib::CreateIface (IWelsVP** ppInterfaceVp) {
- *ppInterfaceVp = NULL;
- pfnCreateVpInterface pCreateVpInterface = NULL;
- pfnDestroyVpInterface pDestroyVpInterface = NULL;
-
- pCreateVpInterface = CreateVpInterface;
- pDestroyVpInterface = DestroyVpInterface;
-
- m_pInterface[0] = (void*)pCreateVpInterface;
- m_pInterface[1] = (void*)pDestroyVpInterface;
-
- if (m_pInterface[0] && m_pInterface[1])
- pCreateVpInterface ((void**)ppInterfaceVp, WELSVP_INTERFACE_VERION);
-
- return (*ppInterfaceVp) ? 0 : 1;
-}
-
-int32_t CWelsLib::DestroyIface (IWelsVP* pInterfaceVp) {
- if (pInterfaceVp) {
- pfnDestroyVpInterface pDestroyVpInterface = (pfnDestroyVpInterface) m_pInterface[1];
- if (pDestroyVpInterface) {
- pDestroyVpInterface (pInterfaceVp, WELSVP_INTERFACE_VERION);
- } else {
- }
- }
-
- return 0;
-}
-
/***************************************************************************
*
* implement of the interface
@@ -117,7 +72,6 @@
CWelsPreProcess::CWelsPreProcess (sWelsEncCtx* pEncCtx) {
m_pInterfaceVp = NULL;
- m_pEncLib = NULL;
m_bInitDone = false;
m_pEncCtx = pEncCtx;
memset (&m_sScaledPicture, 0, sizeof (m_sScaledPicture));
@@ -132,12 +86,8 @@
}
int32_t CWelsPreProcess::WelsPreprocessCreate() {
- if (m_pEncLib == NULL && m_pInterfaceVp == NULL) {
- m_pEncLib = new CWelsLib (m_pEncCtx);
- if (!m_pEncLib)
- goto exit;
-
- m_pEncLib->CreateIface (&m_pInterfaceVp);
+ if (m_pInterfaceVp == NULL) {
+ CreateVpInterface ((void**) &m_pInterfaceVp, WELSVP_INTERFACE_VERION);
if (!m_pInterfaceVp)
goto exit;
} else
@@ -151,11 +101,8 @@
}
int32_t CWelsPreProcess::WelsPreprocessDestroy() {
- if (m_pEncLib) {
- m_pEncLib->DestroyIface (m_pInterfaceVp);
- m_pInterfaceVp = NULL;
- WelsSafeDelete (m_pEncLib);
- }
+ DestroyVpInterface (m_pInterfaceVp, WELSVP_INTERFACE_VERION);
+ m_pInterfaceVp = NULL;
return 0;
}