FFmpeg
Macros
timer.h File Reference
#include "config.h"
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include "common.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

◆ TIMER_REPORT

#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; \
av_log(NULL, AV_LOG_ERROR, \
"%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]));\
av_log(NULL, AV_LOG_ERROR, "\n"); \
} \
}

Definition at line 76 of file timer.h.

◆ START_TIMER

#define START_TIMER

Definition at line 150 of file timer.h.

◆ STOP_TIMER

#define STOP_TIMER (   id)    { }

Definition at line 151 of file timer.h.

AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:196
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
NULL
#define NULL
Definition: coverity.c:32
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26