History

fix the different threshold between camera and screen

sijchen committed 12 years ago

Commit 7fb59d01 parent f8ca91f1 file · +13 −3Browse files

Showing the changes to codec/processing/src (1 of 1 file). Show all

Unified · Split

codec/processing/src/scenechangedetection/SceneChangeDetection.h+13−3
@@ -50,8 +50,9 @@ · 49 unmodified lines
5050 #include "common.h"
5151
5252 #define HIGH_MOTION_BLOCK_THRESHOLD 320
53−#define SCENE_CHANGE_MOTION_RATIO_LARGE 0.85f
53+#define SCENE_CHANGE_MOTION_RATIO_LARGE_VIDEO 0.85f
5454 #define SCENE_CHANGE_MOTION_RATIO_MEDIUM 0.50f
55+#define SCENE_CHANGE_MOTION_RATIO_LARGE_SCREEN 0.80f
5556
5657 WELSVP_NAMESPACE_BEGIN
5758
@@ -81,6 +82,9 @@ class CSceneChangeDetectorVideo { · 23 unmodified lines
8182 m_pfSad = WelsProcessingSampleSad8x8_neon;
8283 }
8384 #endif
85+
86+ m_fSceneChangeMotionRatioLarge = SCENE_CHANGE_MOTION_RATIO_LARGE_VIDEO;
87+ m_fSceneChangeMotionRatioMedium = SCENE_CHANGE_MOTION_RATIO_MEDIUM;
8488 }
8589 virtual ~CSceneChangeDetectorVideo() {
8690 }
@@ -106,15 +110,21 @@ class CSceneChangeDetectorVideo { · 19 unmodified lines
106110 pCurY += iCurRowStride;
107111 }
108112 }
113+ float GetSceneChangeMotionRatioLarge() const { return m_fSceneChangeMotionRatioLarge; }
114+ float GetSceneChangeMotionRatioMedium() const { return m_fSceneChangeMotionRatioMedium; }
109115 protected:
110116 SadFuncPtr m_pfSad;
111117 SSceneChangeResult& m_sParam;
118+ float m_fSceneChangeMotionRatioLarge;
119+ float m_fSceneChangeMotionRatioMedium;
112120 };
113121
114122 class CSceneChangeDetectorScreen : public CSceneChangeDetectorVideo {
115123 public:
116124 CSceneChangeDetectorScreen (SSceneChangeResult& sParam, int32_t iCpuFlag) : CSceneChangeDetectorVideo (sParam,
117125 iCpuFlag) {
126+ m_fSceneChangeMotionRatioLarge = SCENE_CHANGE_MOTION_RATIO_LARGE_SCREEN;
127+ m_fSceneChangeMotionRatioMedium = SCENE_CHANGE_MOTION_RATIO_MEDIUM;
118128 }
119129 virtual ~CSceneChangeDetectorScreen() {
120130 }
@@ -195,9 +205,9 @@ class CSceneChangeDetection : public IStrategy { · 74 unmodified lines
195205
196206 int32_t iBlock8x8Num = m_sLocalParam.iBlock8x8Width * m_sLocalParam.iBlock8x8Height;
197207 int32_t iSceneChangeThresholdLarge = WelsStaticCast (int32_t,
198− SCENE_CHANGE_MOTION_RATIO_LARGE * iBlock8x8Num + 0.5f + PESN);
208+ m_cDetector.GetSceneChangeMotionRatioLarge() * iBlock8x8Num + 0.5f + PESN);
199209 int32_t iSceneChangeThresholdMedium = WelsStaticCast (int32_t,
200− SCENE_CHANGE_MOTION_RATIO_MEDIUM * iBlock8x8Num + 0.5f + PESN);
210+ m_cDetector.GetSceneChangeMotionRatioMedium() * iBlock8x8Num + 0.5f + PESN);
201211
202212 m_sSceneChangeParam.iMotionBlockNum = 0;
203213 m_sSceneChangeParam.iFrameComplexity = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t