Permalink
Browse files

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>
  • Loading branch information...
2 parents e632a43 + 005c80b commit 4da42ebe4486f2960d64135395b1a9ef705d9429 @michaelni michaelni committed Jun 20, 2012
View
@@ -11,6 +11,7 @@ version next:
- ffprobe -show_data option
- RTMPT protocol support
- iLBC encoding/decoding via libilbc
+- Microsoft Screen 1 decoder
- showwaves filter
View
@@ -1206,7 +1206,9 @@ HAVE_LIST="
GetProcessAffinityMask
GetProcessMemoryInfo
GetProcessTimes
+ GetSystemTimeAsFileTime
getrusage
+ gettimeofday
glob
gnu_as
ibm_asm
@@ -3142,6 +3144,7 @@ check_func getaddrinfo $network_extralibs
check_func gethrtime
check_func getrusage
check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
+check_func gettimeofday
check_func inet_aton $network_extralibs
check_func isatty
check_func localtime_r
@@ -3163,6 +3166,7 @@ check_func_headers lzo/lzo1x.h lzo1x_999_compress
check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
check_func_headers windows.h GetProcessAffinityMask
check_func_headers windows.h GetProcessTimes
+check_func_headers windows.h GetSystemTimeAsFileTime
check_func_headers windows.h MapViewOfFile
check_func_headers windows.h VirtualAlloc
check_func_headers glob.h glob
View
@@ -562,6 +562,8 @@ following image formats are supported:
@item LOCO @tab @tab X
@item lossless MJPEG @tab X @tab X
@item Microsoft RLE @tab @tab X
+@item Microsoft Screen 1 @tab @tab X
+ @tab Also known as Windows Media Video V7 Screen.
@item Microsoft Video 1 @tab @tab X
@item Mimic @tab @tab X
@tab Used in MSN Messenger Webcam streams.
View
@@ -63,7 +63,6 @@
#if HAVE_SYS_RESOURCE_H
#include <sys/types.h>
-#include <sys/time.h>
#include <sys/resource.h>
#elif HAVE_GETPROCESSTIMES
#include <windows.h>
View
@@ -55,7 +55,6 @@
#include <poll.h>
#endif
#include <errno.h>
-#include <sys/time.h>
#include <time.h>
#include <sys/wait.h>
#include <signal.h>
View
@@ -327,6 +327,7 @@ OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4.o msmpeg4enc.o msmpeg4data.o \
h263dec.o h263.o ituh263dec.o \
mpeg4videodec.o
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
+OBJS-$(CONFIG_MSS1_DECODER) += mss1.o
OBJS-$(CONFIG_MSVIDEO1_DECODER) += msvideo1.o
OBJS-$(CONFIG_MSVIDEO1_ENCODER) += msvideo1enc.o elbg.o
OBJS-$(CONFIG_MSZH_DECODER) += lcldec.o
@@ -170,6 +170,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (MSMPEG4V2, msmpeg4v2);
REGISTER_ENCDEC (MSMPEG4V3, msmpeg4v3);
REGISTER_DECODER (MSRLE, msrle);
+ REGISTER_DECODER (MSS1, mss1);
REGISTER_ENCDEC (MSVIDEO1, msvideo1);
REGISTER_DECODER (MSZH, mszh);
REGISTER_DECODER (MXPEG, mxpeg);
@@ -257,6 +257,7 @@ enum CodecID {
CODEC_ID_CDXL,
CODEC_ID_XBM,
CODEC_ID_ZEROCODEC,
+ CODEC_ID_MSS1,
CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
CODEC_ID_EXR = MKBETAG('0','E','X','R'),
View
@@ -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,17 +490,17 @@ 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++) {
for (i = 0; i < 64; i++)
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,
View
@@ -27,14 +27,14 @@
#include "libavutil/mathematics.h"
#include "libavutil/lfg.h"
#include "libavutil/log.h"
+#include "libavutil/time.h"
#include "fft.h"
#if CONFIG_FFT_FLOAT
#include "dct.h"
#include "rdft.h"
#endif
#include <math.h>
#include <unistd.h>
-#include <sys/time.h>
#include <stdlib.h>
#include <string.h>
@@ -186,13 +186,6 @@ static FFTSample frandom(AVLFG *prng)
return (int16_t)av_lfg_get(prng) / 32768.0 * RANGE;
}
-static int64_t gettime(void)
-{
- struct timeval tv;
- gettimeofday(&tv,NULL);
- return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
-}
-
static int check_diff(FFTSample *tab1, FFTSample *tab2, int n, double scale)
{
int i;
@@ -430,7 +423,7 @@ int main(int argc, char **argv)
/* we measure during about 1 seconds */
nb_its = 1;
for(;;) {
- time_start = gettime();
+ time_start = av_gettime();
for (it = 0; it < nb_its; it++) {
switch (transform) {
case TRANSFORM_MDCT:
@@ -456,7 +449,7 @@ int main(int argc, char **argv)
#endif
}
}
- duration = gettime() - time_start;
+ duration = av_gettime() - time_start;
if (duration >= 1000000)
break;
nb_its *= 2;
@@ -32,6 +32,7 @@
#include "config.h"
#include "dsputil.h"
#include "libavutil/lfg.h"
+#include "libavutil/time.h"
#undef printf
@@ -58,13 +59,6 @@ static void help(void)
"test motion implementations\n");
}
-static int64_t gettime(void)
-{
- struct timeval tv;
- gettimeofday(&tv,NULL);
- return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
-}
-
#define NB_ITS 500
int dummy;
@@ -97,7 +91,7 @@ static void test_motion(const char *name,
emms_c();
/* speed test */
- ti = gettime();
+ ti = av_gettime();
d1 = 0;
for(it=0;it<NB_ITS;it++) {
for(y=0;y<HEIGHT-17;y++) {
@@ -109,7 +103,7 @@ static void test_motion(const char *name,
}
emms_c();
dummy = d1; /* avoid optimization */
- ti = gettime() - ti;
+ ti = av_gettime() - ti;
printf(" %0.0f kop/s\n",
(double)NB_ITS * (WIDTH - 16) * (HEIGHT - 16) /
Oops, something went wrong.

0 comments on commit 4da42eb

Please sign in to comment.