FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
timer.h File Reference

high precision timer, useful to profile code More...

#include "config.h"
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include "log.h"

Go to the source code of this file.

Macros

#define TIMER_REPORT(id, tdiff)
 
#define START_TIMER
 
#define STOP_TIMER(id)   { }
 

Detailed Description

high precision timer, useful to profile code

Definition in file timer.h.

Macro Definition Documentation

#define TIMER_REPORT (   id,
  tdiff 
)
Value:
{ \
static uint64_t tsum = 0; \
static int tcount = 0; \
static int tskip_count = 0; \
static int thistogram[32] = {0}; \
thistogram[av_log2(tdiff)]++; \
if (tcount < 2 || \
(tdiff) < 8 * tsum / tcount || \
(tdiff) < 2000) { \
tsum += (tdiff); \
tcount++; \
} else \
tskip_count++; \
if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
int i; \
"%7"PRIu64" " FF_TIMER_UNITS " in %s,%8d runs,%7d skips", \
tsum * 10 / tcount, id, tcount, tskip_count); \
for (i = 0; i < 32; i++) \
av_log(NULL, AV_LOG_VERBOSE, " %2d", av_log2(2*thistogram[i]));\
} \
}
#define NULL
Definition: coverity.c:32
int av_log2(unsigned v)
Definition: intmath.c:26
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:192
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
int
if(ret< 0)
Definition: vf_mcdeint.c:279
for(j=16;j >0;--j)

Definition at line 73 of file timer.h.

#define START_TIMER

Definition at line 137 of file timer.h.

Referenced by dct_quantize_refine(), and main().

#define STOP_TIMER (   id)    { }

Definition at line 138 of file timer.h.

Referenced by dct_quantize_refine(), and main().