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 FF_TIMER_UNITS   "UNITS"
 
#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

◆ FF_TIMER_UNITS

#define FF_TIMER_UNITS   "UNITS"

Definition at line 88 of file timer.h.

◆ 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 91 of file timer.h.

◆ START_TIMER

#define START_TIMER

Definition at line 165 of file timer.h.

◆ STOP_TIMER

#define STOP_TIMER (   id)    { }

Definition at line 166 of file timer.h.

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