annotate x86/timer.h @ 726:5d344280a1f8 libavutil

cosmetics: Rename prn variable to prng (Pseudo Random Number Generator).
author diego
date Fri, 10 Apr 2009 17:23:38 +0000
parents fa8c9944568f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
718
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
1 /*
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
2 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
3 *
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
4 * This file is part of FFmpeg.
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
5 *
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
10 *
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
14 * Lesser General Public License for more details.
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
15 *
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
19 */
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
20
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
21 #ifndef AVUTIL_X86_TIMER_H
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
22 #define AVUTIL_X86_TIMER_H
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
23
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
24 #include <stdint.h>
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
25
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
26 #define AV_READ_TIME read_time
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
27
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
28 static inline uint64_t read_time(void)
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
29 {
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
30 uint32_t a, d;
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
31 __asm__ volatile("rdtsc" : "=a" (a), "=d" (d));
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
32 return ((uint64_t)d << 32) + a;
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
33 }
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
34
fa8c9944568f Split libavutil/timer.h per architecture
mru
parents:
diff changeset
35 #endif /* AVUTIL_X86_TIMER_H */