aboutsummaryrefslogtreecommitdiff
path: root/lib/libmpeg2/test
diff options
context:
space:
mode:
authortheuni <theuni-nospam-@xbmc.org>2011-01-24 16:05:21 -0500
committertheuni <theuni-nospam-@xbmc.org>2011-01-24 16:05:21 -0500
commitc51b1189e3d5353e842991f5859ddcea0f73e426 (patch)
treeef2cb8a6184699aa614f3655dca4ce661cdc108e /lib/libmpeg2/test
parentbe61ebdc9e897fe40c6f371111724de79ddee8d5 (diff)
Merged cptspiff's code-reshuffle branch.
Squashed commit due to build breakage during code-reshuffle history. Conflicts: xbmc/Util.cpp xbmc/cdrip/CDDARipper.cpp xbmc/filesystem/Directory.cpp xbmc/filesystem/File.cpp
Diffstat (limited to 'lib/libmpeg2/test')
-rw-r--r--lib/libmpeg2/test/Makefile.am2
-rw-r--r--lib/libmpeg2/test/Makefile.in422
-rw-r--r--lib/libmpeg2/test/README33
-rwxr-xr-xlib/libmpeg2/test/compile58
-rwxr-xr-xlib/libmpeg2/test/globals35
-rwxr-xr-xlib/libmpeg2/test/regression73
-rw-r--r--lib/libmpeg2/test/tek-52589
-rw-r--r--lib/libmpeg2/test/tek-62589
-rw-r--r--lib/libmpeg2/test/tests80
9 files changed, 881 insertions, 0 deletions
diff --git a/lib/libmpeg2/test/Makefile.am b/lib/libmpeg2/test/Makefile.am
new file mode 100644
index 0000000000..479905e575
--- /dev/null
+++ b/lib/libmpeg2/test/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST = regression tests tek-525 tek-625 compile globals
+TESTS = regression compile globals
diff --git a/lib/libmpeg2/test/Makefile.in b/lib/libmpeg2/test/Makefile.in
new file mode 100644
index 0000000000..87a38ce2ad
--- /dev/null
+++ b/lib/libmpeg2/test/Makefile.in
@@ -0,0 +1,422 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ compile
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/cflags.m4 \
+ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/keywords.m4 \
+ $(top_srcdir)/m4/nonpic.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AR = @AR@
+ARCH_OPT_CFLAGS = @ARCH_OPT_CFLAGS@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBVO_CFLAGS = @LIBVO_CFLAGS@
+LIBVO_LIBS = @LIBVO_LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPT_CFLAGS = @OPT_CFLAGS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SDLCONFIG = @SDLCONFIG@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = regression tests tek-525 tek-625 compile globals
+TESTS = regression compile globals
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+ clean-libtool distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lib/libmpeg2/test/README b/lib/libmpeg2/test/README
new file mode 100644
index 0000000000..8cddee6b77
--- /dev/null
+++ b/lib/libmpeg2/test/README
@@ -0,0 +1,33 @@
+Please do use these tests if you do some libmpeg2 changes.
+
+* get the official suite of mpeg2 torture tests at
+http://libmpeg2.sourceforge.net/files/mpeg2dec-streams.tar.gz
+
+or using SVN :
+
+# svn co svn://svn.videolan.org/libmpeg2/streams
+
+(OK, I did some reorganization work on the archive, so it is not really the
+official suite anymore)
+
+Then,
+
+* extract this archive at the same level as your mpeg2dec directory :
+ in your working directory you should have subdirectories mpeg2dec
+ and streams.
+
+* or, extract this archive where you want, but change the first line
+ of the "tests" file to reflect that location. Do _not_ remove the
+ pound (#) sign at the beginning of the line.
+
+Now run test/regression <test> <idct>
+
+<test> is the name of the test suite you want to use. For the official
+mpeg video conformance tests, just use "tests".
+
+<idct> is the type of IDCT you are using. If your machine supports MMX,
+choose "mmx". If your machine uses the c idct, choose "c"
+
+That's it...
+
+walken
diff --git a/lib/libmpeg2/test/compile b/lib/libmpeg2/test/compile
new file mode 100755
index 0000000000..2c2e8fc4e9
--- /dev/null
+++ b/lib/libmpeg2/test/compile
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+if test x"$srcdir" != x""; then
+ builddir="." # running from make check, but it does not define that
+else
+ srcdir=`echo "$0" | sed s,[^/]*$,,`
+ test "$srcdir" = "$0" && srcdir=.
+ test -z "$srcdir" && srcdir=.
+ builddir="$srcdir" # running manually, have to assume
+fi
+
+srcdir=`cd $srcdir;pwd`
+builddir=`cd $builddir;pwd`
+
+basedir=".."
+cd $srcdir; if [ ! -d $basedir -o ! -f $basedir/src/mpeg2dec.c -o \
+ ! -f $basedir/mpeg2dec-*.tar.gz ]; then
+ cd ..; if [ ! -d $basedir -o ! -f $basedir/src/mpeg2dec.c -o \
+ ! -f $basedir/mpeg2dec-*.tar.gz ]; then
+ exit 77
+ fi
+fi
+basedir=`cd $basedir;pwd`
+
+cd $builddir
+rm -fr compile_test
+
+for compiler in cc gcc gcc272 gcc-2.95 gcc-3.0 gcc-3.1 gcc-3.2 gcc-3.3 \
+ gcc-3.4 gcc-4.0 gcc-4.1 gcc-4.2 c89 \
+ c++ g++ g++-2.95 g++-3.0 g++-3.1 g++-3.2 g++-3.3 g++-3.4 \
+ g++-4.0 g++-4.1 g++-4.2 \
+ ccmalloc-gcc bgcc checkergcc tendracc icc \
+ i586-mingw32msvc-gcc; do
+ compiler_path=`which $compiler`
+ if test x"$compiler_path" = x""; then continue; fi
+
+ mkdir compile_test
+ cd compile_test; tar xzpf $basedir/mpeg2dec-*.tar.gz; cd mpeg2dec-*
+ case "$compiler" in
+ i586-mingw32msvc-gcc)
+ opts="--host=i586-mingw32msvc --enable-warnings --disable-sdl"
+ if test -f "/usr/local/opt/ddraw/ddraw.h"; then
+ opts="$opts --with-directx=/usr/local/opt/ddraw"
+ fi;;
+ c89) opts="";;
+ ccmalloc-gcc) opts="--enable-warnings --enable-debug";;
+ tcc-*) opts="--enable-warnings --disable-sdl";;
+ checkergcc) opts="--disable-largefile";;
+ gcc272|*-2.95) opts="";;
+ *) opts="--enable-warnings";;
+ esac
+ error=1; CC=$compiler ./configure $opts && make && error=0
+ if test x"$error" != x"0"; then exit 1; fi
+ cd ../..
+ rm -fr compile_test
+done
+
+exit 0
diff --git a/lib/libmpeg2/test/globals b/lib/libmpeg2/test/globals
new file mode 100755
index 0000000000..d79efac2aa
--- /dev/null
+++ b/lib/libmpeg2/test/globals
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+if test x"$srcdir" != x""; then
+ builddir="." # running from make check, but it does not define that
+else
+ srcdir=`echo "$0" | sed s,[^/]*$,,`
+ test "$srcdir" = "$0" && srcdir=.
+ test -z "$srcdir" && srcdir=.
+ builddir="$srcdir" # running manually, have to assume
+fi
+
+srcdir=`cd $srcdir;pwd`
+builddir=`cd $builddir;pwd`
+
+error=0
+
+bad_globals=`nm -g --defined-only $builddir/../libmpeg2/*.o |\
+ awk '{if ($3) print $3}' | grep -v '^_\?mpeg2_'`
+
+if test x"$bad_globals" != x""; then
+ echo BAD GLOBAL SYMBOLS:
+ for s in $bad_globals; do echo $s; done
+ error=1
+fi
+
+bad_globals=`nm -g --defined-only $builddir/../libmpeg2/convert/*.o |\
+ awk '{if ($3) print $3}' | grep -v '^_\?mpeg2convert_'`
+
+if test x"$bad_globals" != x""; then
+ echo BAD GLOBAL SYMBOLS:
+ for s in $bad_globals; do echo $s; done
+ error=1
+fi
+
+exit $error
diff --git a/lib/libmpeg2/test/regression b/lib/libmpeg2/test/regression
new file mode 100755
index 0000000000..802d11cc31
--- /dev/null
+++ b/lib/libmpeg2/test/regression
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+if test x"$srcdir" != x""; then
+ builddir="." # running from make check, but it does not define that
+else
+ srcdir=`echo "$0" | sed 's,[^/]*$,,'`
+ test "$srcdir" = "$0" && srcdir=.
+ test -z "$srcdir" && srcdir=.
+ builddir="$srcdir" # running manually, have to assume
+fi
+
+srcdir=`cd $srcdir;pwd`
+builddir=`cd $builddir;pwd`
+
+testfile="$srcdir/tests"
+if [ $# -ge 1 ]; then testfile="$1"; fi
+
+dirs=`cut -d '#' -f 1 $testfile`
+
+basedir=`head -n 1 $testfile | awk '{print $2}'`
+cd $srcdir; if [ ! -d $basedir ]; then
+ cd ..; if [ ! -d $basedir ]; then exit 77; fi # for make distcheck
+fi
+basedir=`cd $basedir;pwd`
+
+# choose between c_md5 and mmx_md5 (based on the idct you use)
+md5=c.md5
+accel="-c"
+if [ $# -ge 2 -a x"$2" != x"c" ]; then md5="$2.md5"; accel=""; fi
+
+cd $builddir
+error=0
+
+rm -fr data
+mkdir data
+cd data
+
+mpeg2dec="../../src/mpeg2dec"; if [ ! -x $mpeg2dec ]; then
+ if [ -x ../../vc++/Release/mpeg2dec.exe ]; then
+ mpeg2dec="../../vc++/Release/mpeg2dec.exe"
+ basedir=`echo "$basedir" | sed "s,/cygdrive/\(.\)/,\1:/,"`
+ elif [ -x ../../vc++/Debug/mpeg2dec.exe ]; then
+ mpeg2dec="../../vc++/Debug/mpeg2dec.exe"
+ basedir=`echo "$basedir" | sed "s,/cygdrive/\(.\)/,\1:/,"`
+ else
+ echo "Can not find mpeg2dec executable"; exit 1
+ fi
+fi
+
+for dir in $dirs; do
+ if [ -f $basedir/$dir/stream ]; then
+ echo $dir
+ $mpeg2dec -vvvv $accel -o md5 $basedir/$dir/stream >dump 2>&1 >md5
+ if [ ! -f $basedir/$dir/$md5 ]; then
+ echo MISSING FILE $dir/$md5
+ elif [ ! -f $basedir/$dir/IGNORE-MD5 ]; then
+ diff -wu md5 $basedir/$dir/$md5 || error=1
+ fi
+ if [ ! -f $basedir/$dir/dump ]; then
+ echo MISSING FILE $dir/dump
+ else
+ sed '1d' dump | diff -wu - $basedir/$dir/dump || error=1
+ fi
+ rm -f md5 dump core
+ else
+ echo missing file $dir/stream
+ fi
+done
+
+cd ..
+rmdir data
+
+exit $error
diff --git a/lib/libmpeg2/test/tek-525 b/lib/libmpeg2/test/tek-525
new file mode 100644
index 0000000000..033536d686
--- /dev/null
+++ b/lib/libmpeg2/test/tek-525
@@ -0,0 +1,89 @@
+#basedir ../../streams/tek/525
+
+100b/015 # OK
+100b/040 # OK
+100b/060 # OK
+100b/080 # OK
+100b/120 # OK
+#100b/180 # FAIL - 4:2:2 chroma
+#100b/400 # FAIL - 4:2:2 chroma
+
+bbc3/015 # OK
+bbc3/040 # OK
+bbc3/060 # OK
+bbc3/080 # OK
+bbc3/120 # OK
+#bbc3/180 # FAIL - 4:2:2 chroma
+#bbc3/400 # FAIL - 4:2:2 chroma
+
+cact/015 # OK
+cact/040 # OK
+cact/060 # OK
+cact/080 # OK
+cact/120 # OK
+#cact/180 # FAIL - 4:2:2 chroma
+#cact/400 # FAIL - 4:2:2 chroma
+
+flwr/015 # OK
+flwr/040 # OK
+flwr/060 # OK
+flwr/080 # OK
+flwr/120 # OK
+#flwr/180 # FAIL - 4:2:2 chroma
+#flwr/400 # FAIL - 4:2:2 chroma
+
+mobl/015 # OK
+mobl/040 # OK
+mobl/060 # OK
+mobl/080 # OK
+mobl/120 # OK
+#mobl/180 # FAIL - 4:2:2 chroma
+#mobl/400 # FAIL - 4:2:2 chroma
+
+mulb/015 # OK
+mulb/040 # OK
+mulb/060 # OK
+mulb/080 # OK
+mulb/120 # OK
+#mulb/180 # FAIL - 4:2:2 chroma
+#mulb/400 # FAIL - 4:2:2 chroma
+
+pulb/015 # OK
+pulb/040 # OK
+pulb/060 # OK
+pulb/080 # OK
+pulb/120 # OK
+#pulb/180 # FAIL - 4:2:2 chroma
+#pulb/400 # FAIL - 4:2:2 chroma
+
+susi/015 # OK
+susi/040 # OK
+susi/060 # OK
+susi/080 # OK
+susi/120 # OK
+#susi/180 # FAIL - 4:2:2 chroma
+#susi/400 # FAIL - 4:2:2 chroma
+
+tens/015 # OK
+tens/040 # OK
+tens/060 # OK
+tens/080 # OK
+tens/120 # OK
+#tens/180 # FAIL - 4:2:2 chroma
+#tens/400 # FAIL - 4:2:2 chroma
+
+time/015 # OK
+time/040 # OK
+time/060 # OK
+time/080 # OK
+time/120 # OK
+#time/180 # FAIL - 4:2:2 chroma
+#time/400 # FAIL - 4:2:2 chroma
+
+v700/015 # OK
+v700/040 # OK
+v700/060 # OK
+v700/080 # OK
+v700/120 # OK
+#v700/180 # FAIL - 4:2:2 chroma
+#v700/400 # FAIL - 4:2:2 chroma
diff --git a/lib/libmpeg2/test/tek-625 b/lib/libmpeg2/test/tek-625
new file mode 100644
index 0000000000..48f111997f
--- /dev/null
+++ b/lib/libmpeg2/test/tek-625
@@ -0,0 +1,89 @@
+#basedir ../../streams/tek/625
+
+100b/015 # OK
+100b/040 # OK
+100b/060 # OK
+100b/080 # OK
+100b/120 # OK
+#100b/180 # FAIL - 4:2:2 chroma
+#100b/400 # FAIL - 4:2:2 chroma
+
+bbc3/015 # OK
+bbc3/040 # OK
+bbc3/060 # OK
+bbc3/080 # OK
+bbc3/120 # OK
+#bbc3/180 # FAIL - 4:2:2 chroma
+#bbc3/400 # FAIL - 4:2:2 chroma
+
+cact/015 # OK
+cact/040 # OK
+cact/060 # OK
+cact/080 # OK
+cact/120 # OK
+#cact/180 # FAIL - 4:2:2 chroma
+#cact/400 # FAIL - 4:2:2 chroma
+
+flwr/015 # OK
+flwr/040 # OK
+flwr/060 # OK
+flwr/080 # OK
+flwr/120 # OK
+#flwr/180 # FAIL - 4:2:2 chroma
+#flwr/400 # FAIL - 4:2:2 chroma
+
+mobl/015 # OK
+mobl/040 # OK
+mobl/060 # OK
+mobl/080 # OK
+mobl/120 # OK
+#mobl/180 # FAIL - 4:2:2 chroma
+#mobl/400 # FAIL - 4:2:2 chroma
+
+mulb/015 # OK
+mulb/040 # OK
+mulb/060 # OK
+mulb/080 # OK
+mulb/120 # OK
+#mulb/180 # FAIL - 4:2:2 chroma
+#mulb/400 # FAIL - 4:2:2 chroma
+
+pulb/015 # OK
+pulb/040 # OK
+pulb/060 # OK
+pulb/080 # OK
+pulb/120 # OK
+#pulb/180 # FAIL - 4:2:2 chroma
+#pulb/400 # FAIL - 4:2:2 chroma
+
+susi/015 # OK
+susi/040 # OK
+susi/060 # OK
+susi/080 # OK
+susi/120 # OK
+#susi/180 # FAIL - 4:2:2 chroma
+#susi/400 # FAIL - 4:2:2 chroma
+
+tens/015 # OK
+tens/040 # OK
+tens/060 # OK
+tens/080 # OK
+tens/120 # OK
+#tens/180 # FAIL - 4:2:2 chroma
+#tens/400 # FAIL - 4:2:2 chroma
+
+time/015 # OK
+time/040 # OK
+time/060 # OK
+time/080 # OK
+time/120 # OK
+#time/180 # FAIL - 4:2:2 chroma
+#time/400 # FAIL - 4:2:2 chroma
+
+v700/015 # OK
+v700/040 # OK
+v700/060 # OK
+v700/080 # OK
+v700/120 # OK
+#v700/180 # FAIL - 4:2:2 chroma
+#v700/400 # FAIL - 4:2:2 chroma
diff --git a/lib/libmpeg2/test/tests b/lib/libmpeg2/test/tests
new file mode 100644
index 0000000000..ed3d8cfade
--- /dev/null
+++ b/lib/libmpeg2/test/tests
@@ -0,0 +1,80 @@
+#basedir ../../streams
+
+teracom/teracom_vlc4 # OK - test all VLC tables
+att/att_mismatch # OK - IDCT accuracy
+compcore/ccm1 # OK - IDCT overflow
+tek/Tek-5-long # OK - all macroblock types
+tek/Tek-5.2 # OK - all macroblock types
+ccett/mcp10ccett # OK - MC accuracy
+tcela/tcela-17-dots # OK - long-range motion vectors
+ti/TI_c1_2 # OK - field MC, interp
+lep/bits_conf_lep_11 # OK - parser performance
+sony/sony-ct1 # OK - field pictures, parsing flags
+sony/sony-ct2 # OK - field pictures, parsing flags
+sony/sony-ct3 # OK - field pictures, parsing flags
+sony/sony-ct4 # OK - field pictures, parsing flags
+hhi/hhi_burst_long # OK - field pictures, burst
+hhi/hhi_burst_short # OK - field pictures, burst
+tcela/tcela-10-killer # OK - field pictures, 16x8 MC bandwidth
+tcela/tcela-8-fp-dp # OK - field pictures, DMV MC bandwidth
+tcela/tcela-9-fp-dp # OK - field pictures, DMV MC bandwidth
+tcela/tcela-16-matrices # OK - mpeg1 - quant matrixes transposition
+tcela/tcela-19-wide # OK - mpeg1 - wide picture size
+tcela/tcela-18-d-pict # OK - mpeg1 - D pictures
+mei/MEI.stream16.long # OK - mpeg1
+mei/MEI.stream16v2 # OK - mpeg1
+ibm/ibm-bw-v3 # OK - DMV, decoder bandwidth, skipped MB
+tcela/tcela-14-bff-dp # OK - DMV bottom first, MC bandwidth
+tcela/tcela-14-bff-dp-short # OK - DMV bottom first, MC bandwidth
+nokia/nokia6-60 # OK - DMV, MC bandwidth
+nokia/nokia6 # OK - DMV, MC bandwidth
+nokia/nokia_7 # OK - DMV, MC bandwidth
+ntr/ntr_skipped_v3 # OK - DMV, low delay, skipped pictures
+toshiba/toshiba_DPall-0 # OK - DMV, MC bandwidth
+gi/gi4 # OK - intra dc precision, MC bandwidth
+gi/gi6 # OK - intra dc precision, MC bandwidth
+gi/gi7 # OK - intra dc precision, MC bandwidth
+gi/gi_9 # OK - intra dc precision, MC bandwidth
+gi/gi_from_tape # OK - intra dc precision, MC bandwidth
+mei/mei.2conftest.4f # OK - vbv buffer size
+mei/mei.2conftest.60f.new # OK - vbv buffer size
+tceh/tceh_conf2 # OK - vbv buffer size
+tcela/tcela-6-slices # OK - short slices
+tcela/tcela-7-slices # OK - short slices
+tcela/tcela-15-stuffing # OK - huge amounts of stuffing
+
+# 4:2:2 profile test suite
+422-profile/Tek6-422-bigBpic-long # OK - 4:2:2
+422-profile/Tek6-422-bigBpic # OK - 4:2:2
+422-profile/Tek7-422-smallSlices-long # OK - 4:2:2 - 4 quant matrix
+422-profile/Tek7-422-smallSlices # OK - 4:2:2 - 4 quant matrix
+422-profile/Tek8-422-16x8inBpics-long # OK - 4:2:2 - 4 quant matrix
+422-profile/Tek8-422-16x8inBpics # OK - 4:2:2 - 4 quant matrix
+422-profile/hhi_burst_422-long # OK - 4:2:2 - 4 quant matrix
+422-profile/hhi_burst_422 # OK - 4:2:2 - 4 quant matrix
+422-profile/ibm_dp_intra_422 # OK - 4:2:2
+422-profile/sony_422_id01-1 # OK - 4:2:2 - 4 quant matrix
+422-profile/sony_422_id03-1 # OK - 4:2:2 - 4 quant matrix
+422-profile/sony_422_id13-1 # OK - 4:2:2 - 4 quant matrix
+422-profile/Tek9-422-uniformVLC-long # IGNORE - 4:2:2 - IDCT overflow
+422-profile/Tek9-422-uniformVLC # IGNORE - 4:2:2 - IDCT overflow
+
+# The twilight zone streams are not part of the official mpeg2 test suite
+twilight_zone/walken/chroma_444 # OK - 4:4:4 chroma format
+twilight_zone/walken/mpeg1_full_pix # OK - mpeg1 full pixel MC
+twilight_zone/walken/mpeg1_stuffing # OK - mpeg1 macroblk stuffing
+twilight_zone/walken/mpeg1_start_slice # IGNORE - bad slice start mba
+twilight_zone/walken/mpeg1_slice # IGNORE - general slice struct
+twilight_zone/walken/repeat_sequence_bitrate # OK - variable bitrate value
+twilight_zone/walken/repeat_sequence_aspect # OK - variable aspect ratio
+twilight_zone/walken/progressive_12x12 # OK - progressive sequence
+twilight_zone/walken/interlaced_12x12 # OK - nonprogressive sequence
+twilight_zone/walken/very_high # OK - very high picture
+twilight_zone/walken/very_wide # OK - very wide picture
+twilight_zone/anonymous/anonymous # OK
+twilight_zone/chromatic/chroma_dct_type-1 # OK
+twilight_zone/tcela/tcela-12 # OK - IDCT drift - see 7.4.4
+twilight_zone/mei/MEI.stream17.long # OK - different img sizes
+twilight_zone/mei/MEI2.stream17 # OK - different img sizes
+twilight_zone/tcela/tcela-11v2 # IGNORE - IDCT overflow
+# We're actually doing better than the reference decoder on tcela-11v2