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
50#include "common.h"50#include "common.h"
51 51
52#define HIGH_MOTION_BLOCK_THRESHOLD 32052#define HIGH_MOTION_BLOCK_THRESHOLD 320
53#define SCENE_CHANGE_MOTION_RATIO_LARGE 0.85f53#define SCENE_CHANGE_MOTION_RATIO_LARGE_VIDEO 0.85f
54#define SCENE_CHANGE_MOTION_RATIO_MEDIUM 0.50f54#define SCENE_CHANGE_MOTION_RATIO_MEDIUM 0.50f
55#define SCENE_CHANGE_MOTION_RATIO_LARGE_SCREEN 0.80f
55 56
56WELSVP_NAMESPACE_BEGIN57WELSVP_NAMESPACE_BEGIN
57 58
@@ -81,6 +82,9 @@ class CSceneChangeDetectorVideo { · 23 unmodified lines
81 m_pfSad = WelsProcessingSampleSad8x8_neon;82 m_pfSad = WelsProcessingSampleSad8x8_neon;
82 }83 }
83#endif84#endif
85
86 m_fSceneChangeMotionRatioLarge = SCENE_CHANGE_MOTION_RATIO_LARGE_VIDEO;
87 m_fSceneChangeMotionRatioMedium = SCENE_CHANGE_MOTION_RATIO_MEDIUM;
84 }88 }
85 virtual ~CSceneChangeDetectorVideo() {89 virtual ~CSceneChangeDetectorVideo() {
86 }90 }
@@ -106,15 +110,21 @@ class CSceneChangeDetectorVideo { · 19 unmodified lines
106 pCurY += iCurRowStride;110 pCurY += iCurRowStride;
107 }111 }
108 }112 }
113 float GetSceneChangeMotionRatioLarge() const { return m_fSceneChangeMotionRatioLarge; }
114 float GetSceneChangeMotionRatioMedium() const { return m_fSceneChangeMotionRatioMedium; }
109 protected:115 protected:
110 SadFuncPtr m_pfSad;116 SadFuncPtr m_pfSad;
111 SSceneChangeResult& m_sParam;117 SSceneChangeResult& m_sParam;
118 float m_fSceneChangeMotionRatioLarge;
119 float m_fSceneChangeMotionRatioMedium;
112};120};
113 121
114class CSceneChangeDetectorScreen : public CSceneChangeDetectorVideo {122class CSceneChangeDetectorScreen : public CSceneChangeDetectorVideo {
115 public:123 public:
116 CSceneChangeDetectorScreen (SSceneChangeResult& sParam, int32_t iCpuFlag) : CSceneChangeDetectorVideo (sParam,124 CSceneChangeDetectorScreen (SSceneChangeResult& sParam, int32_t iCpuFlag) : CSceneChangeDetectorVideo (sParam,
117 iCpuFlag) {125 iCpuFlag) {
126 m_fSceneChangeMotionRatioLarge = SCENE_CHANGE_MOTION_RATIO_LARGE_SCREEN;
127 m_fSceneChangeMotionRatioMedium = SCENE_CHANGE_MOTION_RATIO_MEDIUM;
118 }128 }
119 virtual ~CSceneChangeDetectorScreen() {129 virtual ~CSceneChangeDetectorScreen() {
120 }130 }
@@ -195,9 +205,9 @@ class CSceneChangeDetection : public IStrategy { · 74 unmodified lines
195 205
196 int32_t iBlock8x8Num = m_sLocalParam.iBlock8x8Width * m_sLocalParam.iBlock8x8Height;206 int32_t iBlock8x8Num = m_sLocalParam.iBlock8x8Width * m_sLocalParam.iBlock8x8Height;
197 int32_t iSceneChangeThresholdLarge = WelsStaticCast (int32_t,207 int32_t iSceneChangeThresholdLarge = WelsStaticCast (int32_t,
198 SCENE_CHANGE_MOTION_RATIO_LARGE * iBlock8x8Num + 0.5f + PESN);208 m_cDetector.GetSceneChangeMotionRatioLarge() * iBlock8x8Num + 0.5f + PESN);
199 int32_t iSceneChangeThresholdMedium = WelsStaticCast (int32_t,209 int32_t iSceneChangeThresholdMedium = WelsStaticCast (int32_t,
200 SCENE_CHANGE_MOTION_RATIO_MEDIUM * iBlock8x8Num + 0.5f + PESN);210 m_cDetector.GetSceneChangeMotionRatioMedium() * iBlock8x8Num + 0.5f + PESN);
201 211
202 m_sSceneChangeParam.iMotionBlockNum = 0;212 m_sSceneChangeParam.iMotionBlockNum = 0;
203 m_sSceneChangeParam.iFrameComplexity = 0;213 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