diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-20 20:47:46 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-20 20:47:46 +0200 |
commit | 4da42ebe4486f2960d64135395b1a9ef705d9429 (patch) | |
tree | 5e405819aa070d6313851ea324ffaf475523d02f /libavcodec/dct-test.c | |
parent | e632a430fe03dace7380c11e2bd62ea418e63abc (diff) | |
parent | 005c80b645cc6ab5f30cbc3e10ab66a15dfd107e (diff) | |
download | ffmpeg-4da42ebe4486f2960d64135395b1a9ef705d9429.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
MS Screen 1 decoder
aacdec: Fix popping channel layouts.
av_gettime: support Win32 without gettimeofday()
Use av_gettime() in various places
Move av_gettime() to libavutil
dct-test: use emms_c() from libavutil instead of duplicating it
mov: fix operator precedence bug
mathematics.h: remove a couple of math defines
Remove unnecessary inclusions of [sys/]time.h
lavf: remove unnecessary inclusions of unistd.h
bfin: libswscale: add const where appropriate to fix warnings
bfin: libswscale: remove unnecessary #includes
udp: Properly check for invalid sockets
tcp: Check the return value from getsockopt
network: Use av_strerror for getting error messages
udp: Properly print error from getnameinfo
mmst: Use AVUNERROR() to convert error codes to the right range for strerror
network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows
rtmp: Reduce the number of idle posts sent by sleeping 50ms
Conflicts:
Changelog
configure
libavcodec/aacdec.c
libavcodec/allcodecs.c
libavcodec/avcodec.h
libavcodec/dct-test.c
libavcodec/version.h
libavformat/riff.c
libavformat/udp.c
libavutil/Makefile
libswscale/bfin/yuv2rgb_bfin.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dct-test.c')
-rw-r--r-- | libavcodec/dct-test.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 45d21bf284..9ea8f09914 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -28,13 +28,13 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <sys/time.h> #include <unistd.h> #include <math.h> #include "libavutil/cpu.h" #include "libavutil/common.h" #include "libavutil/lfg.h" +#include "libavutil/time.h" #include "simple_idct.h" #include "aandcttab.h" @@ -163,13 +163,6 @@ static const struct algo idct_tab[] = { #define AANSCALE_BITS 12 -static int64_t gettime(void) -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; -} - #define NB_ITS 20000 #define NB_ITS_SPEED 50000 @@ -201,14 +194,6 @@ static void idct_mmx_init(void) DECLARE_ALIGNED(16, static DCTELEM, block)[64]; DECLARE_ALIGNED(8, static DCTELEM, block1)[64]; -static inline void mmx_emms(void) -{ -#if HAVE_MMX - if (cpu_flags & AV_CPU_FLAG_MMX) - __asm__ volatile ("emms\n\t" ::: "memory"); -#endif -} - static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng, int vals) { int i, j; @@ -287,7 +272,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c permute(block, block1, dct->format); dct->func(block); - mmx_emms(); + emms_c(); if (dct->format == SCALE_PERM) { for (i = 0; i < 64; i++) { @@ -345,16 +330,16 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c init_block(block, test, is_idct, &prng, vals); permute(block1, block, dct->format); - ti = gettime(); + ti = av_gettime(); it1 = 0; do { for (it = 0; it < NB_ITS_SPEED; it++) { memcpy(block, block1, sizeof(block)); dct->func(block); } - mmx_emms(); + emms_c(); it1 += NB_ITS_SPEED; - ti1 = gettime() - ti; + ti1 = av_gettime() - ti; } while (ti1 < 1000000); printf("%s %s: %0.1f kdct/s\n", is_idct ? "IDCT" : "DCT", dct->name, @@ -505,7 +490,7 @@ static void idct248_error(const char *name, if (!speed) return; - ti = gettime(); + ti = av_gettime(); it1 = 0; do { for (it = 0; it < NB_ITS_SPEED; it++) { @@ -513,9 +498,9 @@ static void idct248_error(const char *name, block[i] = block1[i]; idct248_put(img_dest, 8, block); } - mmx_emms(); + emms_c(); it1 += NB_ITS_SPEED; - ti1 = gettime() - ti; + ti1 = av_gettime() - ti; } while (ti1 < 1000000); printf("%s %s: %0.1f kdct/s\n", 1 ? "IDCT248" : "DCT248", name, |