projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5eb765e
)
optimized ticker_tick() if num is big - please test it (should reduce CPU usage ...
author
Fabrice Bellard
<fabrice@bellard.org>
Tue, 11 Jun 2002 13:23:09 +0000
(13:23 +0000)
committer
Fabrice Bellard
<fabrice@bellard.org>
Tue, 11 Jun 2002 13:23:09 +0000
(13:23 +0000)
Originally committed as revision 681 to svn://svn.ffmpeg.org/ffmpeg/trunk
libav/tick.h
patch
|
blob
|
history
diff --git
a/libav/tick.h
b/libav/tick.h
index
46bd865
..
8a8e42b
100644
(file)
--- a/
libav/tick.h
+++ b/
libav/tick.h
@@
-22,10
+22,20
@@
static inline int ticker_tick(Ticker *tick, int num)
int n = num * tick->div;
tick->value += num * tick->mod;
+#if 1
+ if (tick->value > 0) {
+ n += (tick->value / tick->inrate);
+ tick->value = tick->value % tick->inrate;
+ if (tick->value > 0) {
+ tick->value -= tick->inrate;
+ n++;
+ }
+ }
+#else
while (tick->value > 0) {
tick->value -= tick->inrate;
n++;
}
-
+#endif
return n;
}