Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
9c0d823a
Commit
9c0d823a
authored
Sep 02, 2017
by
Clément Bœsch
Committed by
Clément Bœsch
Sep 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/timer.h: factor out timer report
This commit is meant to reduce the diff in the following one.
parent
e0d56f09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
timer.h
libavutil/timer.h
+15
-12
No files found.
libavutil/timer.h
View file @
9c0d823a
...
...
@@ -60,23 +60,17 @@
# define FF_TIMER_UNITS "UNITS"
#endif
#ifdef AV_READ_TIME
#define START_TIMER \
uint64_t tend; \
uint64_t tstart = AV_READ_TIME(); \
#define STOP_TIMER(id) \
tend = AV_READ_TIME(); \
#define TIMER_REPORT(id, tdiff) \
{ \
static uint64_t tsum = 0; \
static int tcount = 0; \
static int tskip_count = 0; \
static int thistogram[32] = {0}; \
thistogram[av_log2(t
end - tstart)]++;
\
if (tcount < 2
||
\
tend - tstart < 8 * tsum / tcount ||
\
tend - tstart < 2000) {
\
tsum
+= tend - tstart;
\
thistogram[av_log2(t
diff)]++;
\
if (tcount < 2
||
\
(tdiff) < 8 * tsum / tcount ||
\
(tdiff) < 2000) {
\
tsum
+= (tdiff);
\
tcount++; \
} else \
tskip_count++; \
...
...
@@ -90,6 +84,15 @@
av_log(NULL, AV_LOG_ERROR, "\n"); \
} \
}
#ifdef AV_READ_TIME
#define START_TIMER \
uint64_t tend; \
uint64_t tstart = AV_READ_TIME(); \
#define STOP_TIMER(id) \
tend = AV_READ_TIME(); \
TIMER_REPORT(id, tend - tstart)
#else
#define START_TIMER
#define STOP_TIMER(id) { }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment