@@ -202,7 +202,7 @@ inline int bfi(int width, int offset, int src2, int src3)
202202 return ((src2 << offset) & bitmask) | (src3 & ~bitmask);
203203}
204204
205- class CpuDepthPacketProcessorImpl
205+ class CpuDepthPacketProcessorImpl : public WithPerfLogging
206206{
207207public:
208208 Mat<uint16_t > p0_table0, p0_table1, p0_table2;
@@ -214,11 +214,6 @@ class CpuDepthPacketProcessorImpl
214214 float trig_table1[512 *424 ][6 ];
215215 float trig_table2[512 *424 ][6 ];
216216
217- double timing_acc;
218- double timing_acc_n;
219-
220- Timer timer;
221-
222217 bool enable_bilateral_filter, enable_edge_filter;
223218 DepthPacketProcessor::Parameters params;
224219
@@ -231,34 +226,12 @@ class CpuDepthPacketProcessorImpl
231226 newIrFrame ();
232227 newDepthFrame ();
233228
234- timing_acc = 0.0 ;
235- timing_acc_n = 0.0 ;
236-
237229 enable_bilateral_filter = true ;
238230 enable_edge_filter = true ;
239231
240232 flip_ptables = true ;
241233 }
242234
243- void startTiming ()
244- {
245- timer.start ();
246- }
247-
248- void stopTiming ()
249- {
250- timing_acc += timer.stop ();
251- timing_acc_n += 1.0 ;
252-
253- if (timing_acc_n >= 100.0 )
254- {
255- double avg = (timing_acc / timing_acc_n);
256- LOG_INFO << " [CpuDepthPacketProcessor] avg. time: " << (avg * 1000 ) << " ms -> ~" << (1.0 /avg) << " Hz" ;
257- timing_acc = 0.0 ;
258- timing_acc_n = 0.0 ;
259- }
260- }
261-
262235 void newIrFrame ()
263236 {
264237 ir_frame = new Frame (512 , 424 , 4 );
@@ -975,7 +948,7 @@ void CpuDepthPacketProcessor::process(const DepthPacket &packet)
975948 impl_->newDepthFrame ();
976949 }
977950
978- impl_->stopTiming ();
951+ impl_->stopTiming (LOG_INFO );
979952}
980953
981954} /* namespace libfreenect2 */
0 commit comments