| Index: source/libvpx/vpx_ports/vpx_timer.h
|
| ===================================================================
|
| --- source/libvpx/vpx_ports/vpx_timer.h (revision 172621)
|
| +++ source/libvpx/vpx_ports/vpx_timer.h (working copy)
|
| @@ -32,65 +32,61 @@
|
| /* timersub is not provided by msys at this time. */
|
| #ifndef timersub
|
| #define timersub(a, b, result) \
|
| - do { \
|
| - (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
|
| - (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
|
| - if ((result)->tv_usec < 0) { \
|
| - --(result)->tv_sec; \
|
| - (result)->tv_usec += 1000000; \
|
| - } \
|
| - } while (0)
|
| + do { \
|
| + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
|
| + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
|
| + if ((result)->tv_usec < 0) { \
|
| + --(result)->tv_sec; \
|
| + (result)->tv_usec += 1000000; \
|
| + } \
|
| + } while (0)
|
| #endif
|
| #endif
|
|
|
|
|
| -struct vpx_usec_timer
|
| -{
|
| +struct vpx_usec_timer {
|
| #if defined(_WIN32)
|
| - LARGE_INTEGER begin, end;
|
| + LARGE_INTEGER begin, end;
|
| #else
|
| - struct timeval begin, end;
|
| + struct timeval begin, end;
|
| #endif
|
| };
|
|
|
|
|
| static void
|
| -vpx_usec_timer_start(struct vpx_usec_timer *t)
|
| -{
|
| +vpx_usec_timer_start(struct vpx_usec_timer *t) {
|
| #if defined(_WIN32)
|
| - QueryPerformanceCounter(&t->begin);
|
| + QueryPerformanceCounter(&t->begin);
|
| #else
|
| - gettimeofday(&t->begin, NULL);
|
| + gettimeofday(&t->begin, NULL);
|
| #endif
|
| }
|
|
|
|
|
| static void
|
| -vpx_usec_timer_mark(struct vpx_usec_timer *t)
|
| -{
|
| +vpx_usec_timer_mark(struct vpx_usec_timer *t) {
|
| #if defined(_WIN32)
|
| - QueryPerformanceCounter(&t->end);
|
| + QueryPerformanceCounter(&t->end);
|
| #else
|
| - gettimeofday(&t->end, NULL);
|
| + gettimeofday(&t->end, NULL);
|
| #endif
|
| }
|
|
|
|
|
| static int64_t
|
| -vpx_usec_timer_elapsed(struct vpx_usec_timer *t)
|
| -{
|
| +vpx_usec_timer_elapsed(struct vpx_usec_timer *t) {
|
| #if defined(_WIN32)
|
| - LARGE_INTEGER freq, diff;
|
| + LARGE_INTEGER freq, diff;
|
|
|
| - diff.QuadPart = t->end.QuadPart - t->begin.QuadPart;
|
| + diff.QuadPart = t->end.QuadPart - t->begin.QuadPart;
|
|
|
| - QueryPerformanceFrequency(&freq);
|
| - return diff.QuadPart * 1000000 / freq.QuadPart;
|
| + QueryPerformanceFrequency(&freq);
|
| + return diff.QuadPart * 1000000 / freq.QuadPart;
|
| #else
|
| - struct timeval diff;
|
| + struct timeval diff;
|
|
|
| - timersub(&t->end, &t->begin, &diff);
|
| - return diff.tv_sec * 1000000 + diff.tv_usec;
|
| + timersub(&t->end, &t->begin, &diff);
|
| + return diff.tv_sec * 1000000 + diff.tv_usec;
|
| #endif
|
| }
|
|
|
| @@ -101,9 +97,8 @@
|
| #define timersub(a, b, result)
|
| #endif
|
|
|
| -struct vpx_usec_timer
|
| -{
|
| - void *dummy;
|
| +struct vpx_usec_timer {
|
| + void *dummy;
|
| };
|
|
|
| static void
|
| @@ -113,7 +108,9 @@
|
| vpx_usec_timer_mark(struct vpx_usec_timer *t) { }
|
|
|
| static long
|
| -vpx_usec_timer_elapsed(struct vpx_usec_timer *t) { return 0; }
|
| +vpx_usec_timer_elapsed(struct vpx_usec_timer *t) {
|
| + return 0;
|
| +}
|
|
|
| #endif /* CONFIG_OS_SUPPORT */
|
|
|
|
|