X-Git-Url: https://git.piment-noir.org/?p=deb_x265.git;a=blobdiff_plain;f=source%2FPPA%2Fppa.h;h=abb2a121c06a415f205c88bebd92ea5374cc8e9d;hp=42f43b8a5391468cb20a490233b137a8729cc932;hb=b53f7c52d8280ab63876efd6eb292c21430ac607;hpb=5c9b45285dd64723ad1dac380b98a7b1f3095674 diff --git a/source/PPA/ppa.h b/source/PPA/ppa.h index 42f43b8..abb2a12 100644 --- a/source/PPA/ppa.h +++ b/source/PPA/ppa.h @@ -21,17 +21,8 @@ * For more information, contact us at license @ x265.com. *****************************************************************************/ -#ifndef _PPA_H_ -#define _PPA_H_ - -#if !defined(ENABLE_PPA) - -#define PPA_INIT() -#define PPAStartCpuEventFunc(e) -#define PPAStopCpuEventFunc(e) -#define PPAScopeEvent(e) - -#else +#ifndef PPA_H +#define PPA_H /* declare enum list of users CPU events */ #define PPA_REGISTER_CPU_EVENT(x) x, @@ -40,32 +31,13 @@ enum PPACpuEventEnum #include "ppaCPUEvents.h" PPACpuGroupNums }; - #undef PPA_REGISTER_CPU_EVENT -#define PPA_INIT() initializePPA() -#define PPAStartCpuEventFunc(e) if (ppabase) ppabase->triggerStartEvent(ppabase->getEventId(e)) -#define PPAStopCpuEventFunc(e) if (ppabase) ppabase->triggerEndEvent(ppabase->getEventId(e)) -#define PPAScopeEvent(e) _PPAScope __scope_(e) - #include "ppaApi.h" void initializePPA(); -extern ppa::Base *ppabase; - -class _PPAScope -{ -protected: - - ppa::EventID m_id; - -public: - - _PPAScope(int e) { if (ppabase) { m_id = ppabase->getEventId(e); ppabase->triggerStartEvent(m_id); } else m_id = 0; } - ~_PPAScope() { if (ppabase) ppabase->triggerEndEvent(m_id); } -}; - -#endif // if !defined(ENABLE_PPA) +#define PPA_INIT() initializePPA() +#define PPAScopeEvent(e) ppa::ProfileScope ppaScope_(e) -#endif /* _PPA_H_ */ +#endif /* PPA_H */