MCPcopy Create free account
hub / github.com/cirquit/trdrop / process

Method process

trdrop_c/trdrop_c/FPSPreTask.h:64–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 // interface methods
63 public:
64 void process(const cv::Mat & prev, const cv::Mat & cur, const size_t currentFrameIndex, const size_t vix) {
65 bool equal = false;
66
67 if (pixelDifference > 0){
68 equal = trdrop::algorithm::are_equal_with<int>(prev, cur, pixelDifference);
69 }
70 else {
71 equal = trdrop::algorithm::are_equal<uchar*>(prev, cur);
72 }
73 static std::mutex mutex;
74 std::lock_guard<std::mutex> lock(mutex);
75
76 size_t localIndex = currentFrameIndex % windowSize;
77 isDifferentFrame[vix][localIndex] = equal ? 0.0 : 1.0;
78
79 fpsTaskData.fps[vix] = std::accumulate(isDifferentFrame[vix].begin(), isDifferentFrame[vix].end(), 0.0);
80 fpsTaskData.duplicateFrame[vix] = equal;
81 fpsTaskData.fps_unprocessed = isDifferentFrame;
82
83 result = EitherSD(RightD(fpsTaskData));
84#if _TR_DEBUG
85 std::cout << "DEBUG: FPSPreTask - finished for video " << vix << '\n';
86#endif
87
88
89 }
90
91 // public member
92 public:

Callers

nothing calls this directly

Calls 3

are_equal<uchar*>Function · 0.85
beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected