Merge pull request #483 from volvet/develop_b

use large/medium/similar to define scene change result
This commit is contained in:
Licai Guo 2014-03-17 16:32:31 +08:00
commit fc4e0cacec
3 changed files with 10 additions and 10 deletions

View File

@ -605,7 +605,7 @@ void CWelsPreProcess::BilateralDenoising (SPicture* pSrc, const int32_t kiWidth,
bool CWelsPreProcess::DetectSceneChange (SPicture* pCurPicture, SPicture* pRefPicture) {
bool bSceneChangeFlag = false;
int32_t iMethodIdx = METHOD_SCENE_CHANGE_DETECTION;
SSceneChangeResult sSceneChangeDetectResult = {0};
SSceneChangeResult sSceneChangeDetectResult = { SIMILAR_SCENE };
SPixMap sSrcPixMap = {0};
SPixMap sRefPixMap = {0};
@ -627,7 +627,7 @@ bool CWelsPreProcess::DetectSceneChange (SPicture* pCurPicture, SPicture* pRefPi
int32_t iRet = m_pInterfaceVp->Process (iMethodIdx, &sSrcPixMap, &sRefPixMap);
if (iRet == 0) {
m_pInterfaceVp->Get (iMethodIdx, (void*)&sSceneChangeDetectResult);
bSceneChangeFlag = sSceneChangeDetectResult.bSceneChangeFlag ? true : false;
bSceneChangeFlag = (sSceneChangeDetectResult.eSceneChangeIdc == LARGE_CHANGED_SCENE) ? true : false;
}
return bSceneChangeFlag;

View File

@ -136,16 +136,16 @@ typedef enum {
// Algorithm parameters define
//-----------------------------------------------------------------//
typedef struct {
int bSceneChangeFlag; // 0:false ; 1:true
} SSceneChangeResult;
typedef enum {
SIMILAR_SCENE, //similar scene
SIMILAR_SCENE, //similar scene
MEDIUM_CHANGED_SCENE, //medium changed scene
LARGE_CHANGED_SCENE, //large changed scene
LARGE_CHANGED_SCENE, //large changed scene
} ESceneChangeIdc;
typedef struct {
ESceneChangeIdc eSceneChangeIdc; // SIMILAR_SCENE, MEDIUM_CHANGED_SCENE, LARGE_CHANGED_SCENE
} SSceneChangeResult;
typedef struct {
unsigned char* pCurY; // Y data of current frame
unsigned char* pRefY; // Y data of pRef frame for diff calc

View File

@ -81,7 +81,7 @@ EResult CSceneChangeDetection::Process (int32_t iType, SPixMap* pSrcPixMap, SPix
iRefRowStride = pRefPixMap->iStride[0] << 3;
iCurRowStride = pSrcPixMap->iStride[0] << 3;
m_sSceneChangeParam.bSceneChangeFlag = 0;
m_sSceneChangeParam.eSceneChangeIdc = SIMILAR_SCENE;
for (int32_t j = 0; j < iBlock8x8Height; j ++) {
pRefTmp = pRefY;
@ -101,7 +101,7 @@ EResult CSceneChangeDetection::Process (int32_t iType, SPixMap* pSrcPixMap, SPix
}
if (iMotionBlockNum >= iSceneChangeThreshold) {
m_sSceneChangeParam.bSceneChangeFlag = 1;
m_sSceneChangeParam.eSceneChangeIdc = LARGE_CHANGED_SCENE;
}
eReturn = RET_SUCCESS;