diff options
Diffstat (limited to 'debian/transcode/transcode-1.1.7/testsuite')
26 files changed, 7846 insertions, 0 deletions
diff --git a/debian/transcode/transcode-1.1.7/testsuite/Makefile.am b/debian/transcode/transcode-1.1.7/testsuite/Makefile.am new file mode 100644 index 00000000..2c66727d --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/Makefile.am @@ -0,0 +1,143 @@ +# # Process this file with automake to produce Makefile.in. + +EXTRA_DIST = \ + newtest.pl test.pl \ + test-tcmodchain.sh test-cfg-filelist.sh + +AM_CPPFLAGS = \ + $(PTHREAD_CFLAGS) \ + -DMOD_PATH=\"$(MOD_PATH)\" \ + -DPROF_PATH=\"$(PROF_PATH)\" \ + -DFBUF_TEST \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + $(DLDARWIN_CFLAGS) \ + $(XIO_CFLAGS) + +if HAVE_PVM3 +PVM3_TEST = test-pvmparser +endif + +noinst_PROGRAMS = \ + test-acmemcpy \ + test-acmemcpy-speed \ + test-average \ + test-bufalloc \ + test-cfg-filelist \ + test-export-profile \ + test-framecode \ + test-framealloc \ + test-imgconvert \ + test-iodir \ + test-mangle-cmdline \ + $(PVM3_TEST) \ + test-ratiocodes \ + test-resize-values \ + test-tclist \ + test-tclog \ + test-tcglob \ + test-tcmodule \ + test-tcmoduleinfo \ + test-tcstrdup + +test_acmemcpy_SOURCES = test-acmemcpy.c +test_acmemcpy_LDADD = $(ACLIB_LIBS) + +test_acmemcpy_speed_SOURCES = test-acmemcpy-speed.c +test_acmemcpy_speed_LDADD = $(ACLIB_LIBS) + +test_average_SOURCES = test-average.c +test_average_LDADD = $(ACLIB_LIBS) + +test_bufalloc_SOURCES = test-bufalloc.c +test_bufalloc_LDADD = $(LIBTC_LIBS) + +test_framealloc_SOURCES = test-framealloc.c +test_framealloc_LDADD = $(LIBTC_LIBS) + +test_framecode_SOURCES = test-framecode.c +test_framecode_LDADD = $(LIBTC_LIBS) + +test_imgconvert_SOURCES = test-imgconvert.c +test_imgconvert_LDADD = $(ACLIB_LIBS) + +test_cfg_filelist_SOURCES = test-cfg-filelist.c +test_cfg_filelist_LDADD = $(LIBTC_LIBS) + +test_iodir_SOURCES = test-iodir.c +test_iodir_LDADD = $(LIBTC_LIBS) + +test_ratiocodes_SOURCES = test-ratiocodes.c +test_ratiocodes_LDADD = $(LIBTC_LIBS) + +test_tclist_SOURCES = test-tclist.c +test_tclist_LDADD = $(LIBTC_LIBS) + +test_tclog_SOURCES = test-tclog.c +test_tclog_LDADD = $(LIBTC_LIBS) + +test_tcglob_SOURCES = test-tcglob.c +test_tcglob_LDADD = $(LIBTC_LIBS) + +test_tcmodule_SOURCES = test-tcmodule.c +test_tcmodule_LDADD = $(LIBTC_LIBS) +test_tcmodule_LDFLAGS = -export-dynamic + +test_tcmoduleinfo_SOURCES = test-tcmoduleinfo.c +test_tcmoduleinfo_LDADD = $(LIBTC_LIBS) + +test_tcstrdup_SOURCES = test-tcstrdup.c +test_tcstrdup_LDADD = $(LIBTC_LIBS) + +test_mangle_cmdline_SOURCES = test-mangle-cmdline.c +test_mangle_cmdline_LDADD = $(LIBTC_LIBS) + +test_export_profile_SOURCES = test-export-profile.c ../src/export_profile.c +test_export_profile_LDADD = $(LIBTC_LIBS) + +test_pvmparser_SOURCES = test-pvmparser.c ../pvm3/pvm_parser.c +test_pvmparser_CFLAGS = $(PVM3_CFLAGS) -I../pvm3/ +test_pvmparser_LDADD = $(LIBTC_LIBS) $(PVM3_LIBS) + +test_resize_values_SOURCES = test-resize-values.c +test_resize_values_LDADD = $(LIBTC_LIBS) + +# Avoid warnings on intentional empty strings in test-tclog +test-tclog$(EXEEXT): CFLAGS := $(CFLAGS) -Wno-format-zero-length +# Automake interprets that line as a rule overriding the default, +# so put the default back +test-tclog$(EXEEXT): $(test_tclog_OBJECTS) $(test_tclog_DEPENDENCIES) + @rm -f test-tclog$(EXEEXT) + $(LINK) $(test_tclog_LDFLAGS) $(test_tclog_OBJECTS) $(test_tclog_LDADD) $(LIBS) + + +### Targets to run the tests + +.PHONY: test-low test-high test-all + +# Low-level tests for specific routines or functionality +LOWTESTS = test-acmemcpy test-bufalloc test-average test-framealloc \ + test-framecode test-imgconvert test-iodir test-ratiocodes \ + test-resize-values test-tcmoduleinfo test-tcstrdup +test-low: $(LOWTESTS) + ./test-acmemcpy + ./test-average + ./test-bufalloc + ./test-framealloc + ./test-framecode + ./test-imgconvert -C -v + ./test-iodir + ./test-mangle-cmdline + ./test-ratiocodes + ./test-resize-values + ./test-tcmoduleinfo + ./test-tcstrdup + +# High-level tests for transcode as a whole +# FIXME xvid broken? +test-high: newtest.pl test-tcmodchain.sh + perl newtest.pl -T'-y xvid4' + bash test-tchmodchain.sh + +# Run all tests +test-all: test-low test-high diff --git a/debian/transcode/transcode-1.1.7/testsuite/Makefile.in b/debian/transcode/transcode-1.1.7/testsuite/Makefile.in new file mode 100644 index 00000000..3e4339f7 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/Makefile.in @@ -0,0 +1,885 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + +# # Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@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@ +target_triplet = @target@ +noinst_PROGRAMS = test-acmemcpy$(EXEEXT) test-acmemcpy-speed$(EXEEXT) \ + test-average$(EXEEXT) test-bufalloc$(EXEEXT) \ + test-cfg-filelist$(EXEEXT) test-export-profile$(EXEEXT) \ + test-framecode$(EXEEXT) test-framealloc$(EXEEXT) \ + test-imgconvert$(EXEEXT) test-iodir$(EXEEXT) \ + test-mangle-cmdline$(EXEEXT) $(am__EXEEXT_1) \ + test-ratiocodes$(EXEEXT) test-resize-values$(EXEEXT) \ + test-tclist$(EXEEXT) test-tclog$(EXEEXT) test-tcglob$(EXEEXT) \ + test-tcmodule$(EXEEXT) test-tcmoduleinfo$(EXEEXT) \ + test-tcstrdup$(EXEEXT) +subdir = testsuite +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@HAVE_PVM3_TRUE@am__EXEEXT_1 = test-pvmparser$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +am_test_acmemcpy_OBJECTS = test-acmemcpy.$(OBJEXT) +test_acmemcpy_OBJECTS = $(am_test_acmemcpy_OBJECTS) +am__DEPENDENCIES_1 = +test_acmemcpy_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_acmemcpy_speed_OBJECTS = test-acmemcpy-speed.$(OBJEXT) +test_acmemcpy_speed_OBJECTS = $(am_test_acmemcpy_speed_OBJECTS) +test_acmemcpy_speed_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_average_OBJECTS = test-average.$(OBJEXT) +test_average_OBJECTS = $(am_test_average_OBJECTS) +test_average_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_bufalloc_OBJECTS = test-bufalloc.$(OBJEXT) +test_bufalloc_OBJECTS = $(am_test_bufalloc_OBJECTS) +test_bufalloc_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_cfg_filelist_OBJECTS = test-cfg-filelist.$(OBJEXT) +test_cfg_filelist_OBJECTS = $(am_test_cfg_filelist_OBJECTS) +test_cfg_filelist_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_export_profile_OBJECTS = test-export-profile.$(OBJEXT) \ + export_profile.$(OBJEXT) +test_export_profile_OBJECTS = $(am_test_export_profile_OBJECTS) +test_export_profile_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_framealloc_OBJECTS = test-framealloc.$(OBJEXT) +test_framealloc_OBJECTS = $(am_test_framealloc_OBJECTS) +test_framealloc_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_framecode_OBJECTS = test-framecode.$(OBJEXT) +test_framecode_OBJECTS = $(am_test_framecode_OBJECTS) +test_framecode_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_imgconvert_OBJECTS = test-imgconvert.$(OBJEXT) +test_imgconvert_OBJECTS = $(am_test_imgconvert_OBJECTS) +test_imgconvert_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_iodir_OBJECTS = test-iodir.$(OBJEXT) +test_iodir_OBJECTS = $(am_test_iodir_OBJECTS) +test_iodir_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_mangle_cmdline_OBJECTS = test-mangle-cmdline.$(OBJEXT) +test_mangle_cmdline_OBJECTS = $(am_test_mangle_cmdline_OBJECTS) +test_mangle_cmdline_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_pvmparser_OBJECTS = test_pvmparser-test-pvmparser.$(OBJEXT) \ + test_pvmparser-pvm_parser.$(OBJEXT) +test_pvmparser_OBJECTS = $(am_test_pvmparser_OBJECTS) +test_pvmparser_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +test_pvmparser_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_pvmparser_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_test_ratiocodes_OBJECTS = test-ratiocodes.$(OBJEXT) +test_ratiocodes_OBJECTS = $(am_test_ratiocodes_OBJECTS) +test_ratiocodes_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_resize_values_OBJECTS = test-resize-values.$(OBJEXT) +test_resize_values_OBJECTS = $(am_test_resize_values_OBJECTS) +test_resize_values_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_tcglob_OBJECTS = test-tcglob.$(OBJEXT) +test_tcglob_OBJECTS = $(am_test_tcglob_OBJECTS) +test_tcglob_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_tclist_OBJECTS = test-tclist.$(OBJEXT) +test_tclist_OBJECTS = $(am_test_tclist_OBJECTS) +test_tclist_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_tclog_OBJECTS = test-tclog.$(OBJEXT) +test_tclog_OBJECTS = $(am_test_tclog_OBJECTS) +test_tclog_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_tcmodule_OBJECTS = test-tcmodule.$(OBJEXT) +test_tcmodule_OBJECTS = $(am_test_tcmodule_OBJECTS) +test_tcmodule_DEPENDENCIES = $(am__DEPENDENCIES_1) +test_tcmodule_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(test_tcmodule_LDFLAGS) $(LDFLAGS) -o $@ +am_test_tcmoduleinfo_OBJECTS = test-tcmoduleinfo.$(OBJEXT) +test_tcmoduleinfo_OBJECTS = $(am_test_tcmoduleinfo_OBJECTS) +test_tcmoduleinfo_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_tcstrdup_OBJECTS = test-tcstrdup.$(OBJEXT) +test_tcstrdup_OBJECTS = $(am_test_tcstrdup_OBJECTS) +test_tcstrdup_DEPENDENCIES = $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_acmemcpy_SOURCES) $(test_acmemcpy_speed_SOURCES) \ + $(test_average_SOURCES) $(test_bufalloc_SOURCES) \ + $(test_cfg_filelist_SOURCES) $(test_export_profile_SOURCES) \ + $(test_framealloc_SOURCES) $(test_framecode_SOURCES) \ + $(test_imgconvert_SOURCES) $(test_iodir_SOURCES) \ + $(test_mangle_cmdline_SOURCES) $(test_pvmparser_SOURCES) \ + $(test_ratiocodes_SOURCES) $(test_resize_values_SOURCES) \ + $(test_tcglob_SOURCES) $(test_tclist_SOURCES) \ + $(test_tclog_SOURCES) $(test_tcmodule_SOURCES) \ + $(test_tcmoduleinfo_SOURCES) $(test_tcstrdup_SOURCES) +DIST_SOURCES = $(test_acmemcpy_SOURCES) $(test_acmemcpy_speed_SOURCES) \ + $(test_average_SOURCES) $(test_bufalloc_SOURCES) \ + $(test_cfg_filelist_SOURCES) $(test_export_profile_SOURCES) \ + $(test_framealloc_SOURCES) $(test_framecode_SOURCES) \ + $(test_imgconvert_SOURCES) $(test_iodir_SOURCES) \ + $(test_mangle_cmdline_SOURCES) $(test_pvmparser_SOURCES) \ + $(test_ratiocodes_SOURCES) $(test_resize_values_SOURCES) \ + $(test_tcglob_SOURCES) $(test_tclist_SOURCES) \ + $(test_tclog_SOURCES) $(test_tcmodule_SOURCES) \ + $(test_tcmoduleinfo_SOURCES) $(test_tcstrdup_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +A52_CFLAGS = @A52_CFLAGS@ +A52_LIBS = @A52_LIBS@ +ACLIB_LIBS = @ACLIB_LIBS@ +ACLOCAL = @ACLOCAL@ +ALTIVEC_CFLAGS = @ALTIVEC_CFLAGS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVILIB_LIBS = @AVILIB_LIBS@ +AWK = @AWK@ +BSDAV_CFLAGS = @BSDAV_CFLAGS@ +BSDAV_LIBS = @BSDAV_LIBS@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXCPP = @CXXCPP@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLDARWIN_CFLAGS = @DLDARWIN_CFLAGS@ +DLDARWIN_LIBS = @DLDARWIN_LIBS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FAAC_CFLAGS = @FAAC_CFLAGS@ +FAAC_LIBS = @FAAC_LIBS@ +FGREP = @FGREP@ +FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ +FREETYPE2_LIBS = @FREETYPE2_LIBS@ +GREP = @GREP@ +IBP_LIBS = @IBP_LIBS@ +ICONV_CFLAGS = @ICONV_CFLAGS@ +ICONV_LIBS = @ICONV_LIBS@ +IMAGEMAGICK_CFLAGS = @IMAGEMAGICK_CFLAGS@ +IMAGEMAGICK_LIBS = @IMAGEMAGICK_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBAVCODEC_CFLAGS = @LIBAVCODEC_CFLAGS@ +LIBAVCODEC_LIBS = @LIBAVCODEC_LIBS@ +LIBAVFORMAT_CFLAGS = @LIBAVFORMAT_CFLAGS@ +LIBAVFORMAT_LIBS = @LIBAVFORMAT_LIBS@ +LIBDVDREAD_CFLAGS = @LIBDVDREAD_CFLAGS@ +LIBDVDREAD_LIBS = @LIBDVDREAD_LIBS@ +LIBDV_CFLAGS = @LIBDV_CFLAGS@ +LIBDV_LIBS = @LIBDV_LIBS@ +LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@ +LIBJPEG_LIBS = @LIBJPEG_LIBS@ +LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@ +LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@ +LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@ +LIBMPEG2_LIBS = @LIBMPEG2_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBPOSTPROC_CFLAGS = @LIBPOSTPROC_CFLAGS@ +LIBPOSTPROC_LIBS = @LIBPOSTPROC_LIBS@ +LIBQUICKTIME_CFLAGS = @LIBQUICKTIME_CFLAGS@ +LIBQUICKTIME_LIBS = @LIBQUICKTIME_LIBS@ +LIBS = @LIBS@ +LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@ +LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@ +LIBTC_LIBS = @LIBTC_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@ +LIBV4L2_LIBS = @LIBV4L2_LIBS@ +LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@ +LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_LIBS = @LZO_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MJPEGTOOLS_CFLAGS = @MJPEGTOOLS_CFLAGS@ +MJPEGTOOLS_LIBS = @MJPEGTOOLS_LIBS@ +MKDIR_P = @MKDIR_P@ +MOD_PATH = @MOD_PATH@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PATH_TO_AWK = @PATH_TO_AWK@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROF_PATH = @PROF_PATH@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +PVM3_CFLAGS = @PVM3_CFLAGS@ +PVM3_LIBS = @PVM3_LIBS@ +PVM3_PVMGS = @PVM3_PVMGS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIMD_FLAGS = @SIMD_FLAGS@ +STRIP = @STRIP@ +THEORA_CFLAGS = @THEORA_CFLAGS@ +THEORA_LIBS = @THEORA_LIBS@ +USE_DLDARWIN = @USE_DLDARWIN@ +VERSION = @VERSION@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WAVLIB_LIBS = @WAVLIB_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XIO_CFLAGS = @XIO_CFLAGS@ +XIO_LIBS = @XIO_LIBS@ +XMKMF = @XMKMF@ +XVID_CFLAGS = @XVID_CFLAGS@ +XVID_LIBS = @XVID_LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +a52_config = @a52_config@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +bsdav_config = @bsdav_config@ +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@ +faac_config = @faac_config@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +iconv_config = @iconv_config@ +imagemagick_config = @imagemagick_config@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +lame_config = @lame_config@ +libdir = @libdir@ +libdvdread_config = @libdvdread_config@ +libexecdir = @libexecdir@ +libjpeg_config = @libjpeg_config@ +libjpegmmx_config = @libjpegmmx_config@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lzo_config = @lzo_config@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pvm3_config = @pvm3_config@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +x_includes = @x_includes@ +x_libraries = @x_libraries@ +xvid_config = @xvid_config@ +EXTRA_DIST = \ + newtest.pl test.pl \ + test-tcmodchain.sh test-cfg-filelist.sh + +AM_CPPFLAGS = \ + $(PTHREAD_CFLAGS) \ + -DMOD_PATH=\"$(MOD_PATH)\" \ + -DPROF_PATH=\"$(PROF_PATH)\" \ + -DFBUF_TEST \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + $(DLDARWIN_CFLAGS) \ + $(XIO_CFLAGS) + +@HAVE_PVM3_TRUE@PVM3_TEST = test-pvmparser +test_acmemcpy_SOURCES = test-acmemcpy.c +test_acmemcpy_LDADD = $(ACLIB_LIBS) +test_acmemcpy_speed_SOURCES = test-acmemcpy-speed.c +test_acmemcpy_speed_LDADD = $(ACLIB_LIBS) +test_average_SOURCES = test-average.c +test_average_LDADD = $(ACLIB_LIBS) +test_bufalloc_SOURCES = test-bufalloc.c +test_bufalloc_LDADD = $(LIBTC_LIBS) +test_framealloc_SOURCES = test-framealloc.c +test_framealloc_LDADD = $(LIBTC_LIBS) +test_framecode_SOURCES = test-framecode.c +test_framecode_LDADD = $(LIBTC_LIBS) +test_imgconvert_SOURCES = test-imgconvert.c +test_imgconvert_LDADD = $(ACLIB_LIBS) +test_cfg_filelist_SOURCES = test-cfg-filelist.c +test_cfg_filelist_LDADD = $(LIBTC_LIBS) +test_iodir_SOURCES = test-iodir.c +test_iodir_LDADD = $(LIBTC_LIBS) +test_ratiocodes_SOURCES = test-ratiocodes.c +test_ratiocodes_LDADD = $(LIBTC_LIBS) +test_tclist_SOURCES = test-tclist.c +test_tclist_LDADD = $(LIBTC_LIBS) +test_tclog_SOURCES = test-tclog.c +test_tclog_LDADD = $(LIBTC_LIBS) +test_tcglob_SOURCES = test-tcglob.c +test_tcglob_LDADD = $(LIBTC_LIBS) +test_tcmodule_SOURCES = test-tcmodule.c +test_tcmodule_LDADD = $(LIBTC_LIBS) +test_tcmodule_LDFLAGS = -export-dynamic +test_tcmoduleinfo_SOURCES = test-tcmoduleinfo.c +test_tcmoduleinfo_LDADD = $(LIBTC_LIBS) +test_tcstrdup_SOURCES = test-tcstrdup.c +test_tcstrdup_LDADD = $(LIBTC_LIBS) +test_mangle_cmdline_SOURCES = test-mangle-cmdline.c +test_mangle_cmdline_LDADD = $(LIBTC_LIBS) +test_export_profile_SOURCES = test-export-profile.c ../src/export_profile.c +test_export_profile_LDADD = $(LIBTC_LIBS) +test_pvmparser_SOURCES = test-pvmparser.c ../pvm3/pvm_parser.c +test_pvmparser_CFLAGS = $(PVM3_CFLAGS) -I../pvm3/ +test_pvmparser_LDADD = $(LIBTC_LIBS) $(PVM3_LIBS) +test_resize_values_SOURCES = test-resize-values.c +test_resize_values_LDADD = $(LIBTC_LIBS) + +# Low-level tests for specific routines or functionality +LOWTESTS = test-acmemcpy test-bufalloc test-average test-framealloc \ + test-framecode test-imgconvert test-iodir test-ratiocodes \ + test-resize-values test-tcmoduleinfo test-tcstrdup + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(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 ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu testsuite/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu testsuite/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 +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +test-acmemcpy$(EXEEXT): $(test_acmemcpy_OBJECTS) $(test_acmemcpy_DEPENDENCIES) + @rm -f test-acmemcpy$(EXEEXT) + $(LINK) $(test_acmemcpy_OBJECTS) $(test_acmemcpy_LDADD) $(LIBS) +test-acmemcpy-speed$(EXEEXT): $(test_acmemcpy_speed_OBJECTS) $(test_acmemcpy_speed_DEPENDENCIES) + @rm -f test-acmemcpy-speed$(EXEEXT) + $(LINK) $(test_acmemcpy_speed_OBJECTS) $(test_acmemcpy_speed_LDADD) $(LIBS) +test-average$(EXEEXT): $(test_average_OBJECTS) $(test_average_DEPENDENCIES) + @rm -f test-average$(EXEEXT) + $(LINK) $(test_average_OBJECTS) $(test_average_LDADD) $(LIBS) +test-bufalloc$(EXEEXT): $(test_bufalloc_OBJECTS) $(test_bufalloc_DEPENDENCIES) + @rm -f test-bufalloc$(EXEEXT) + $(LINK) $(test_bufalloc_OBJECTS) $(test_bufalloc_LDADD) $(LIBS) +test-cfg-filelist$(EXEEXT): $(test_cfg_filelist_OBJECTS) $(test_cfg_filelist_DEPENDENCIES) + @rm -f test-cfg-filelist$(EXEEXT) + $(LINK) $(test_cfg_filelist_OBJECTS) $(test_cfg_filelist_LDADD) $(LIBS) +test-export-profile$(EXEEXT): $(test_export_profile_OBJECTS) $(test_export_profile_DEPENDENCIES) + @rm -f test-export-profile$(EXEEXT) + $(LINK) $(test_export_profile_OBJECTS) $(test_export_profile_LDADD) $(LIBS) +test-framealloc$(EXEEXT): $(test_framealloc_OBJECTS) $(test_framealloc_DEPENDENCIES) + @rm -f test-framealloc$(EXEEXT) + $(LINK) $(test_framealloc_OBJECTS) $(test_framealloc_LDADD) $(LIBS) +test-framecode$(EXEEXT): $(test_framecode_OBJECTS) $(test_framecode_DEPENDENCIES) + @rm -f test-framecode$(EXEEXT) + $(LINK) $(test_framecode_OBJECTS) $(test_framecode_LDADD) $(LIBS) +test-imgconvert$(EXEEXT): $(test_imgconvert_OBJECTS) $(test_imgconvert_DEPENDENCIES) + @rm -f test-imgconvert$(EXEEXT) + $(LINK) $(test_imgconvert_OBJECTS) $(test_imgconvert_LDADD) $(LIBS) +test-iodir$(EXEEXT): $(test_iodir_OBJECTS) $(test_iodir_DEPENDENCIES) + @rm -f test-iodir$(EXEEXT) + $(LINK) $(test_iodir_OBJECTS) $(test_iodir_LDADD) $(LIBS) +test-mangle-cmdline$(EXEEXT): $(test_mangle_cmdline_OBJECTS) $(test_mangle_cmdline_DEPENDENCIES) + @rm -f test-mangle-cmdline$(EXEEXT) + $(LINK) $(test_mangle_cmdline_OBJECTS) $(test_mangle_cmdline_LDADD) $(LIBS) +test-pvmparser$(EXEEXT): $(test_pvmparser_OBJECTS) $(test_pvmparser_DEPENDENCIES) + @rm -f test-pvmparser$(EXEEXT) + $(test_pvmparser_LINK) $(test_pvmparser_OBJECTS) $(test_pvmparser_LDADD) $(LIBS) +test-ratiocodes$(EXEEXT): $(test_ratiocodes_OBJECTS) $(test_ratiocodes_DEPENDENCIES) + @rm -f test-ratiocodes$(EXEEXT) + $(LINK) $(test_ratiocodes_OBJECTS) $(test_ratiocodes_LDADD) $(LIBS) +test-resize-values$(EXEEXT): $(test_resize_values_OBJECTS) $(test_resize_values_DEPENDENCIES) + @rm -f test-resize-values$(EXEEXT) + $(LINK) $(test_resize_values_OBJECTS) $(test_resize_values_LDADD) $(LIBS) +test-tcglob$(EXEEXT): $(test_tcglob_OBJECTS) $(test_tcglob_DEPENDENCIES) + @rm -f test-tcglob$(EXEEXT) + $(LINK) $(test_tcglob_OBJECTS) $(test_tcglob_LDADD) $(LIBS) +test-tclist$(EXEEXT): $(test_tclist_OBJECTS) $(test_tclist_DEPENDENCIES) + @rm -f test-tclist$(EXEEXT) + $(LINK) $(test_tclist_OBJECTS) $(test_tclist_LDADD) $(LIBS) +test-tcmodule$(EXEEXT): $(test_tcmodule_OBJECTS) $(test_tcmodule_DEPENDENCIES) + @rm -f test-tcmodule$(EXEEXT) + $(test_tcmodule_LINK) $(test_tcmodule_OBJECTS) $(test_tcmodule_LDADD) $(LIBS) +test-tcmoduleinfo$(EXEEXT): $(test_tcmoduleinfo_OBJECTS) $(test_tcmoduleinfo_DEPENDENCIES) + @rm -f test-tcmoduleinfo$(EXEEXT) + $(LINK) $(test_tcmoduleinfo_OBJECTS) $(test_tcmoduleinfo_LDADD) $(LIBS) +test-tcstrdup$(EXEEXT): $(test_tcstrdup_OBJECTS) $(test_tcstrdup_DEPENDENCIES) + @rm -f test-tcstrdup$(EXEEXT) + $(LINK) $(test_tcstrdup_OBJECTS) $(test_tcstrdup_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_profile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-acmemcpy-speed.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-acmemcpy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-average.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-bufalloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cfg-filelist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-export-profile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-framealloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-framecode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-imgconvert.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iodir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mangle-cmdline.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ratiocodes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-resize-values.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tcglob.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tclist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tclog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tcmodule.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tcmoduleinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tcstrdup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_pvmparser-pvm_parser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_pvmparser-test-pvmparser.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +export_profile.o: ../src/export_profile.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_profile.o -MD -MP -MF $(DEPDIR)/export_profile.Tpo -c -o export_profile.o `test -f '../src/export_profile.c' || echo '$(srcdir)/'`../src/export_profile.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_profile.Tpo $(DEPDIR)/export_profile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/export_profile.c' object='export_profile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_profile.o `test -f '../src/export_profile.c' || echo '$(srcdir)/'`../src/export_profile.c + +export_profile.obj: ../src/export_profile.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_profile.obj -MD -MP -MF $(DEPDIR)/export_profile.Tpo -c -o export_profile.obj `if test -f '../src/export_profile.c'; then $(CYGPATH_W) '../src/export_profile.c'; else $(CYGPATH_W) '$(srcdir)/../src/export_profile.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_profile.Tpo $(DEPDIR)/export_profile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/export_profile.c' object='export_profile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_profile.obj `if test -f '../src/export_profile.c'; then $(CYGPATH_W) '../src/export_profile.c'; else $(CYGPATH_W) '$(srcdir)/../src/export_profile.c'; fi` + +test_pvmparser-test-pvmparser.o: test-pvmparser.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pvmparser_CFLAGS) $(CFLAGS) -MT test_pvmparser-test-pvmparser.o -MD -MP -MF $(DEPDIR)/test_pvmparser-test-pvmparser.Tpo -c -o test_pvmparser-test-pvmparser.o `test -f 'test-pvmparser.c' || echo '$(srcdir)/'`test-pvmparser.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_pvmparser-test-pvmparser.Tpo $(DEPDIR)/test_pvmparser-test-pvmparser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-pvmparser.c' object='test_pvmparser-test-pvmparser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pvmparser_CFLAGS) $(CFLAGS) -c -o test_pvmparser-test-pvmparser.o `test -f 'test-pvmparser.c' || echo '$(srcdir)/'`test-pvmparser.c + +test_pvmparser-test-pvmparser.obj: test-pvmparser.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pvmparser_CFLAGS) $(CFLAGS) -MT test_pvmparser-test-pvmparser.obj -MD -MP -MF $(DEPDIR)/test_pvmparser-test-pvmparser.Tpo -c -o test_pvmparser-test-pvmparser.obj `if test -f 'test-pvmparser.c'; then $(CYGPATH_W) 'test-pvmparser.c'; else $(CYGPATH_W) '$(srcdir)/test-pvmparser.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_pvmparser-test-pvmparser.Tpo $(DEPDIR)/test_pvmparser-test-pvmparser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-pvmparser.c' object='test_pvmparser-test-pvmparser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pvmparser_CFLAGS) $(CFLAGS) -c -o test_pvmparser-test-pvmparser.obj `if test -f 'test-pvmparser.c'; then $(CYGPATH_W) 'test-pvmparser.c'; else $(CYGPATH_W) '$(srcdir)/test-pvmparser.c'; fi` + +test_pvmparser-pvm_parser.o: ../pvm3/pvm_parser.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pvmparser_CFLAGS) $(CFLAGS) -MT test_pvmparser-pvm_parser.o -MD -MP -MF $(DEPDIR)/test_pvmparser-pvm_parser.Tpo -c -o test_pvmparser-pvm_parser.o `test -f '../pvm3/pvm_parser.c' || echo '$(srcdir)/'`../pvm3/pvm_parser.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_pvmparser-pvm_parser.Tpo $(DEPDIR)/test_pvmparser-pvm_parser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../pvm3/pvm_parser.c' object='test_pvmparser-pvm_parser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pvmparser_CFLAGS) $(CFLAGS) -c -o test_pvmparser-pvm_parser.o `test -f '../pvm3/pvm_parser.c' || echo '$(srcdir)/'`../pvm3/pvm_parser.c + +test_pvmparser-pvm_parser.obj: ../pvm3/pvm_parser.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pvmparser_CFLAGS) $(CFLAGS) -MT test_pvmparser-pvm_parser.obj -MD -MP -MF $(DEPDIR)/test_pvmparser-pvm_parser.Tpo -c -o test_pvmparser-pvm_parser.obj `if test -f '../pvm3/pvm_parser.c'; then $(CYGPATH_W) '../pvm3/pvm_parser.c'; else $(CYGPATH_W) '$(srcdir)/../pvm3/pvm_parser.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_pvmparser-pvm_parser.Tpo $(DEPDIR)/test_pvmparser-pvm_parser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../pvm3/pvm_parser.c' object='test_pvmparser-pvm_parser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pvmparser_CFLAGS) $(CFLAGS) -c -o test_pvmparser-pvm_parser.obj `if test -f '../pvm3/pvm_parser.c'; then $(CYGPATH_W) '../pvm3/pvm_parser.c'; else $(CYGPATH_W) '$(srcdir)/../pvm3/pvm_parser.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +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 "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 +check: check-am +all-am: Makefile $(PROGRAMS) +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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags 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-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Avoid warnings on intentional empty strings in test-tclog +test-tclog$(EXEEXT): CFLAGS := $(CFLAGS) -Wno-format-zero-length +# Automake interprets that line as a rule overriding the default, +# so put the default back +test-tclog$(EXEEXT): $(test_tclog_OBJECTS) $(test_tclog_DEPENDENCIES) + @rm -f test-tclog$(EXEEXT) + $(LINK) $(test_tclog_LDFLAGS) $(test_tclog_OBJECTS) $(test_tclog_LDADD) $(LIBS) + +### Targets to run the tests + +.PHONY: test-low test-high test-all +test-low: $(LOWTESTS) + ./test-acmemcpy + ./test-average + ./test-bufalloc + ./test-framealloc + ./test-framecode + ./test-imgconvert -C -v + ./test-iodir + ./test-mangle-cmdline + ./test-ratiocodes + ./test-resize-values + ./test-tcmoduleinfo + ./test-tcstrdup + +# High-level tests for transcode as a whole +# FIXME xvid broken? +test-high: newtest.pl test-tcmodchain.sh + perl newtest.pl -T'-y xvid4' + bash test-tchmodchain.sh + +# Run all tests +test-all: test-low test-high + +# 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/debian/transcode/transcode-1.1.7/testsuite/newtest.pl b/debian/transcode/transcode-1.1.7/testsuite/newtest.pl new file mode 100644 index 00000000..c84f762d --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/newtest.pl @@ -0,0 +1,1540 @@ +#!/usr/bin/perl -w +# +# Simple test suite for transcode +# Written by Andrew Church <achurch@achurch.org> +# +# This file is part of transcode, a video stream processing tool. +# transcode is free software, distributable under the terms of the GNU +# General Public License (version 2 or later). See the file COPYING +# for details. + +use POSIX; # for floor() and ceil() + +use constant CSP_YUV => 1; +use constant CSP_RGB => 2; +use constant WIDTH => 704; +use constant HEIGHT => 576; +use constant NFRAMES => 3; + +my $IN_AVI = "in.avi"; +my $OUT_AVI = "out.avi"; +my $STDOUT_LOG = "stdout.log"; +my $STDERR_LOG = "stderr.log"; +my $TMPDIR = undef; + +my @Tests = (); # array of test names in order to run +my %Tests = (); # data for tests (key is test name) + +my $Verbose = 0; # let transcode write to stdout/stderr instead of logs +my $KeepTemp = 0; # keep temporary directory/files around? +my $ListTests = 0; # list available tests instead of running them? +my $AccelMode = ""; # acceleration flags for transcode +my %TestsToRun = (); # user-specified list of tests to run +my @TestsToSkip = (); # user-specified list of tests to assume passed +my %VideoData; # for saving raw output data to compare against + +######## +# Initialization +&init(); + +######## +# First make sure that -x raw -y raw works, and get an AVI in transcode's +# output format for comparison purposes +&add_test("raw/raw (YUV)", [], + "Test input/output using raw YUV420P data", + \&test_raw_raw, CSP_YUV); +&add_test("raw/raw (RGB)", [], + "Test input/output using raw RGB data", + \&test_raw_raw, CSP_RGB); +# Alias for both of the above +&add_test("raw", ["raw/raw (YUV)", "raw/raw (RGB)"], + "Test input/output using raw data (all colorspaces)"); + +# Test colorspace conversion +&add_test("raw/raw (YUV->RGB)", ["raw"], + "Test colorspace conversion from YUV420P to RGB", + \&test_raw_raw_csp, CSP_YUV, CSP_RGB); +&add_test("raw/raw (RGB->YUV)", ["raw"], + "Test colorspace conversion from RGB to YUV420P", + \&test_raw_raw_csp, CSP_RGB, CSP_YUV); +&add_test("raw-csp", ["raw", "raw/raw (YUV->RGB)", "raw/raw (RGB->YUV)"], + "Test colorspace conversion"); + +# Test import_ffmpeg on test video +&add_test("-x ffmpeg (raw)", ["raw"], + "Test input of raw data using import_ffmpeg", + \&test_import, "ffmpeg", \$VideoData{&CSP_YUV}, CSP_YUV); + +# Test various export modules by running their output through ffmpeg +&add_test("-y ffmpeg", ["-x ffmpeg (raw)"], + "Test output using export_ffmpeg", + \&test_export_x_ffmpeg, "ffmpeg", CSP_YUV, "mpeg4"); +&add_test("-y xvid4", ["-x ffmpeg (raw)"], + "Test output using export_xvid4", + \&test_export_x_ffmpeg, "xvid4", CSP_YUV); + +#X# # Test the PPM export module +#X# &add_test("-y ppm", ["raw"], +#X# "Test output using export_ppm", +#X# \&test_export_ppm); + +# Test the core video operations + +@csplist = (); +@vidcore_tests = ("-j", "-I", "-X", "-B", "-Z", "-Y", "-r", "-z", + "-l", "-k", "-K", "-G", "-C"); + +foreach $cspset ([CSP_YUV,"yuv","YUV420P"], [CSP_RGB,"rgb","RGB24"]) { + + my ($cspid,$csp,$cspname) = @$cspset; + push @csplist, $csp; + + &add_test("-j N:$csp", ["raw"], + "Test -j with one parameter ($cspname)", + \&test_vidcore, $cspid, ["-j", "10", + \&vidcore_crop, 10, 0, 10, 0]); + &add_test("-j N,N:$csp", ["raw"], + "Test -j with two parameters ($cspname)", + \&test_vidcore, $cspid, ["-j", "10,20", + \&vidcore_crop, 10, 20, 10, 20]); + &add_test("-j N,N,N:$csp", ["raw"], + "Test -j with three parameters ($cspname)", + \&test_vidcore, $cspid, ["-j", "10,20,30", + \&vidcore_crop, 10, 20, 30, 20]); + &add_test("-j N,N,N,N:$csp", ["raw"], + "Test -j with four parameters ($cspname)", + \&test_vidcore, $cspid, ["-j", "10,20,30,40", + \&vidcore_crop, 10, 20, 30, 40]); + &add_test("-j -N,-N,-N,-N:$csp", ["raw"], + "Test -j with padding ($cspname)", + \&test_vidcore, $cspid, ["-j", "-10,-20,-30,-40", + \&vidcore_crop, -10, -20, -30, -40]); + &add_test("-j N,-N,N,-N:$csp", ["raw"], + "Test -j with V crop / H pad ($cspname)", + \&test_vidcore, $cspid, ["-j", "10,-20,30,-40", + \&vidcore_crop, 10, -20, 30, -40]); + &add_test("-j -N,N,-N,N:$csp", ["raw"], + "Test -j with V pad / H crop ($cspname)", + \&test_vidcore, $cspid, ["-j", "-10,20,-30,40", + \&vidcore_crop, -10, 20, -30, 40]); + &add_test("-j:$csp", + ["-j N:$csp", "-j N,N:$csp", "-j N,N,N:$csp", "-j N,N,N,N:$csp", + "-j -N,-N,-N,-N:$csp", "-j N,-N,N,-N:$csp", + "-j -N,N,-N,N:$csp"], + "Test -j ($cspname)"); + + &add_test("-I 1:$csp", ["raw"], + "Test -I in interpolation mode ($cspname)", + \&test_vidcore, $cspid, ["-I", "1", + \&vidcore_deint_interpolate]); + &add_test("-I 3:$csp", ["raw"], + "Test -I in drop-field-and-zoom mode ($cspname)", + \&test_vidcore, $cspid, ["-I", "3", + \&vidcore_deint_dropzoom]); + &add_test("-I 4:$csp", ["raw"], + "Test -I in drop-field mode ($cspname)", + \&test_vidcore, $cspid, ["-I", "4", + \&vidcore_deint_dropfield]); + &add_test("-I 5:$csp", ["raw"], + "Test -I in linear-blend mode ($cspname)", + \&test_vidcore, $cspid, ["-I", "5", + \&vidcore_deint_linear_blend]); + &add_test("-I:$csp", ["-I 1:$csp", "-I 3:$csp", "-I 4:$csp", "-I 5:$csp"], + "Test -I ($cspname)"); + + # Be careful with values here! Truncation by accelerated rescale() + # during vertical resize can cause false errors (cases where the byte + # value is off by 1 because rounding went the other way). -X 6 seems + # to be safe. + &add_test("-X y:$csp", ["raw"], + "Test -X with height only ($cspname)", + \&test_vidcore, $cspid, ["-X", "6", + \&vidcore_resize, 6*32, 0]); + &add_test("-X 0,x:$csp", ["raw"], + "Test -X with width only ($cspname)", + \&test_vidcore, $cspid, ["-X", "0,11", + \&vidcore_resize, 0, 11*32]); + &add_test("-X y,x:$csp", ["raw"], + "Test -X with width and height ($cspname)", + \&test_vidcore, $cspid, ["-X", "6,11", + \&vidcore_resize, 6*32, 11*32]); + &add_test("-X y,x,M:$csp", ["raw"], + "Test -X with width, height, and multiplier ($cspname)", + \&test_vidcore, $cspid, ["-X", "24,44,8", + \&vidcore_resize, 24*8, 44*8]); + &add_test("-X:$csp", + ["-X y:$csp", "-X 0,x:$csp", "-X y,x:$csp", "-X y,x,M:$csp"], + "Test -X ($cspname)"); + + &add_test("-B y:$csp", ["raw"], + "Test -B with height only ($cspname)", + \&test_vidcore, $cspid, ["-B", "6", + \&vidcore_resize, -6*32, 0]); + &add_test("-B 0,x:$csp", ["raw"], + "Test -B with width only ($cspname)", + \&test_vidcore, $cspid, ["-B", "0,11", + \&vidcore_resize, 0, -11*32]); + &add_test("-B y,x:$csp", ["raw"], + "Test -B with width and height ($cspname)", + \&test_vidcore, $cspid, ["-B", "6,11", + \&vidcore_resize, -6*32, -11*32]); + &add_test("-B y,x,M:$csp", ["raw"], + "Test -B with width, height, and multiplier ($cspname)", + \&test_vidcore, $cspid, ["-B", "24,44,8", + \&vidcore_resize, -24*8, -44*8]); + &add_test("-B:$csp", + ["-B y:$csp", "-B 0,x:$csp", "-B y,x:$csp", "-B y,x,M:$csp"], + "Test -B ($cspname)"); + + &add_test("-Z WxH,fast:$csp", ["raw"], + "Test -Z (fast mode) ($cspname)", + \&test_vidcore, $cspid, ["-Z", + ((WIDTH-11*32)."x".(HEIGHT+6*32).",fast"), + \&vidcore_resize, 6*32, -11*32]); + &add_test("-Z WxH:$csp", ["raw"], + "Test -Z (slow mode) ($cspname)", + \&test_vidcore, $cspid, ["-Z", ((WIDTH-76)."x".(HEIGHT+76)), + \&vidcore_zoom, WIDTH-76, HEIGHT+76]); + &add_test("-Z:$csp", ["-Z WxH,fast:$csp", "-Z WxH:$csp"], + "Test -Z ($cspname)"); + + &add_test("-Y N:$csp", ["raw"], + "Test -Y with one parameter ($cspname)", + \&test_vidcore, $cspid, ["-Y", "10", + \&vidcore_crop, 10, 0, 10, 0]); + &add_test("-Y N,N:$csp", ["raw"], + "Test -Y with two parameters ($cspname)", + \&test_vidcore, $cspid, ["-Y", "10,20", + \&vidcore_crop, 10, 20, 10, 20]); + &add_test("-Y N,N,N:$csp", ["raw"], + "Test -Y with three parameters ($cspname)", + \&test_vidcore, $cspid, ["-Y", "10,20,30", + \&vidcore_crop, 10, 20, 30, 20]); + &add_test("-Y N,N,N,N:$csp", ["raw"], + "Test -Y with four parameters ($cspname)", + \&test_vidcore, $cspid, ["-Y", "10,20,30,40", + \&vidcore_crop, 10, 20, 30, 40]); + &add_test("-Y -N,-N,-N,-N:$csp", ["raw"], + "Test -Y with padding ($cspname)", + \&test_vidcore, $cspid, ["-Y", "-10,-20,-30,-40", + \&vidcore_crop, -10, -20, -30, -40]); + &add_test("-Y N,-N,N,-N:$csp", ["raw"], + "Test -Y with V crop / H pad ($cspname)", + \&test_vidcore, $cspid, ["-Y", "10,-20,30,-40", + \&vidcore_crop, 10, -20, 30, -40]); + &add_test("-Y -N,N,-N,N:$csp", ["raw"], + "Test -Y with V pad / H crop ($cspname)", + \&test_vidcore, $cspid, ["-Y", "-10,20,-30,40", + \&vidcore_crop, -10, 20, -30, 40]); + &add_test("-Y:$csp", + ["-Y N:$csp", "-Y N,N:$csp", "-Y N,N,N:$csp", "-Y N,N,N,N:$csp", + "-Y -N,-N,-N,-N:$csp", "-Y N,-N,N,-N:$csp", + "-Y -N,N,-N,N:$csp"], + "Test -Y ($cspname)"); + + &add_test("-r n:$csp", ["raw"], + "Test -r with one parameter ($cspname)", + \&test_vidcore, $cspid, ["-r", "2", \&vidcore_reduce, 2, 2]); + &add_test("-r y,x:$csp", ["raw"], + "Test -r with two parameters ($cspname)", + \&test_vidcore, $cspid, ["-r", "2,5", \&vidcore_reduce, 2, 5]); + &add_test("-r y,1:$csp", ["raw"], + "Test -r with width reduction == 1 ($cspname)", + \&test_vidcore, $cspid, ["-r", "2,1", \&vidcore_reduce, 2, 1]); + &add_test("-r 1,x:$csp", ["raw"], + "Test -r with height reduction == 1 ($cspname)", + \&test_vidcore, $cspid, ["-r", "1,5", \&vidcore_reduce, 1, 5]); + &add_test("-r 1,1:$csp", ["raw"], + "Test -r with width/height reduction == 1 (no-op) ($cspname)", + \&test_vidcore, $cspid, ["-r", "1,1"]); + &add_test("-r:$csp", ["-r n:$csp", "-r y,x:$csp", "-r y,1:$csp", + "-r 1,x:$csp", "-r 1,1:$csp"], + "Test -r ($cspname)"); + + &add_test("-z:$csp", ["raw"], + "Test -z ($cspname)", + \&test_vidcore, $cspid, ["-z", undef, \&vidcore_flip_v]), + &add_test("-l:$csp", ["raw"], + "Test -l ($cspname)", + \&test_vidcore, $cspid, ["-l", undef, \&vidcore_flip_h]), + &add_test("-k:$csp", ["raw"], + "Test -k ($cspname)", + \&test_vidcore, $cspid, ["-k", undef, \&vidcore_rgbswap]), + &add_test("-K:$csp", ["raw"], + "Test -K ($cspname)", + \&test_vidcore, $cspid, ["-K", undef, \&vidcore_grayscale]), + &add_test("-G:$csp", ["raw"], + "Test -G ($cspname)", + \&test_vidcore, $cspid, ["-G", "1.2", + \&vidcore_gamma_adjust, 1.2]), + &add_test("-C:$csp", ["raw"], + "Test -C ($cspname)", + \&test_vidcore, $cspid, ["-C", "3", + \&vidcore_antialias, 1/3, 1/2], + ["--antialias_para", ((1/3).",".(1/2))]), + + &add_test("vidcore:$csp", [map {"$_:$csp"} @vidcore_tests], + "Test all video core operations ($cspname)"); + +} # for each colorspace + +foreach $test (@vidcore_tests) { + &add_test($test, [map {"$test:$_"} @csplist], + "Test $test (all colorspaces)"); +} + +&add_test("vidcore", [map {"vidcore:$_"} @csplist], + "Test all video core operations (all colorspaces)"); + +######## +# Run all (or specified) tests +my $exitcode = 0; +if (!$ListTests) { + foreach $test (@TestsToSkip) { + $Tests{$test}{'run'} = 1; + $Tests{$test}{'succeeded'} = 1; + } + foreach $test (@Tests) { + $exitcode ||= !&run_test($test) if !%TestsToRun || $TestsToRun{$test}; + } +} + +######## +# Finished, clean up +&cleanup(); +exit $exitcode; + +########################################################################### +########################################################################### + +# Initialization + +sub init +{ + for (my $i = 0; $i < @ARGV; $i++) { + if ($ARGV[$i] =~ /^(--(.*)|-(.)(.*))/) { + my $option = $2 ? "--$2" : "-$3"; + my $optval = $4; + if ($option eq "-h" || $option eq "--help") { + print STDERR "Usage: $0 [-kvl] [-a accel] [-t test [-t test...]]\n"; + print STDERR " -k: don't delete temporary directory\n"; + print STDERR " -v: verbose (transcode output to stdout/stderr\n"; + print STDERR " -l: list tests available\n"; + print STDERR " -a: specify acceleration types (transcode --accel)\n"; + print STDERR " -t: specify test(s) to run\n"; + print STDERR " -T: specify test(s) to assume passed\n"; + exit 0; + } elsif ($option eq "-k") { + $KeepTemp = 1; + } elsif ($option eq "-v") { + $Verbose = 1; + } elsif ($option eq "-l") { + $ListTests = 1; + } elsif ($option eq "-a") { + $optval = $ARGV[++$i] if $optval eq ""; + $AccelMode = $optval; + } elsif ($option eq "-t") { + $optval = $ARGV[++$i] if $optval eq ""; + $TestsToRun{$optval} = 1; + } elsif ($option eq "-T") { + $optval = $ARGV[++$i] if $optval eq ""; + push @TestsToSkip, $optval; + } else { + &fatal("Invalid option `$option' ($0 -h for help)"); + } + } + } + + $TMPDIR = $ENV{'TMPDIR'} || "/tmp"; + $TMPDIR .= "/tctest.$$"; + mkdir $TMPDIR, 0700 or &fatal("mkdir($TMPDIR): $!"); + print STDERR "Using temporary directory $TMPDIR\n"; +} + +########################################################################### + +# Cleanup + +sub cleanup +{ + if (!$KeepTemp && $TMPDIR && -d $TMPDIR) { + foreach $file ("$IN_AVI","$OUT_AVI","$STDOUT_LOG","$STDERR_LOG") { + if (-f "$TMPDIR/$file") { + unlink "$TMPDIR/$file" + or print STDERR "unlink($TMPDIR/$file): $!\n"; + } + } + rmdir $TMPDIR or print STDERR "rmdir($TMPDIR): $!\n"; + } +} + +########################################################################### + +# Fatal error (plus cleanup)--use this instead of die + +sub fatal +{ + print STDERR "$_[0]\n"; + &cleanup(); + exit(-1); +} + +########################################################################### + +# Run transcode with the given input file and arguments, and return the +# contents of the output file. Returns undef if transcode exits with an +# error or the output file does not exist. + +sub transcode +{ + my ($indata,@args) = @_; + my $outdata; + local *F; + local $/ = undef; + + if ($AccelMode) { + push @args, "--accel", $AccelMode; + } + push @args, "--zoom_filter", "triangle"; + open F, ">$TMPDIR/$IN_AVI" or &fatal("create $TMPDIR/$IN_AVI: $!"); + syswrite(F, $indata) == length($indata) or &fatal("write $TMPDIR/$IN_AVI: $!"); + close F; + my $pid = fork(); + &fatal("fork(): $!") if !defined($pid); + if (!$pid) { + open STDIN, "</dev/null"; + open STDOUT, ">$TMPDIR/$STDOUT_LOG" if !$Verbose; + open STDERR, ">$TMPDIR/$STDERR_LOG" if !$Verbose; + @args = ("transcode", "-i", "$TMPDIR/$IN_AVI", + "-o", "$TMPDIR/$OUT_AVI", @args); + print join(" ",@args)."\n" if $Verbose; + exec @args or die; + } + &fatal("waitpid($pid): $!") if !waitpid($pid,0); + return undef if $? != 0; + if (open(F, "<$TMPDIR/$OUT_AVI")) { + $outdata = <F>; + close F; + return $outdata; + } + my @files = glob("$TMPDIR/$OUT_AVI*"); + if (@files) { + my $outdata = ""; + foreach $file (@files) { + if (!open(F, "<$file")) { + print STDERR "$file: $!\n"; + return undef; + } + $outdata .= <F>; + close F; + unlink $file if !$KeepTemp; + } + } + return undef; +} + +########################################################################### + +# Add a test to the global list of tests. Pass the test name in $name, the +# the list of dependent tests (array reference) in $deps, a description of +# the test in $desc, the function to call in $func, and any parameters to +# the function in @args. The function should return undef for success or +# an error message (string) for failure. +# +# If $func and @args are omitted, the test becomes an "alias" for all tests +# it depends on; when run, its dependencies are executed but nothing is +# done for the test itself. + +sub add_test +{ + my ($name, $deps, $desc, $func, @args) = @_; + $Tests{$name} = {deps => $deps, func => $func, args => [@args], run => 0}; + push @Tests, $name; + printf "%20s | %s\n", $name, $desc if $ListTests; +} + +########################################################################### + +# Run a transcode test (including any dependencies) and print the result. +# Pass the test name in $name. Returns 1 if the test succeeded, 0 if it +# (or any dependencies) failed. + +sub run_test +{ + my ($name) = @_; + my $result; + local $| = 1; + + if (!$Tests{$name}) { + print "$name... NOT FOUND (bug in script?)\n"; + $Tests{$name}{'run'} = 1; + $Tests{$name}{'succeeded'} = 0; + return 0; + } + if (!$Tests{$name}{'run'}) { + if ($Tests{$name}{'recurse'}) { + $result = "dependency loop in test script"; + } else { + $Tests{$name}{'recurse'}++; + foreach $dep (@{$Tests{$name}{'deps'}}) { + my $res2 = &run_test($dep); + if (!$res2) { + $result = "dependency `$dep' failed" if !defined($result); + } + } + $Tests{$name}{'recurse'}--; + } + my $func = $Tests{$name}{'func'}; + my $args = $Tests{$name}{'args'}; + if ($func) { + print "$name... "; + if (!defined($result)) { + $result = &$func(@$args); + } + } + $Tests{$name}{'run'} = 1; + if (defined($result)) { + print "FAILED ($result)\n" if $func; + $Tests{$name}{'succeeded'} = 0; + } else { + print "ok\n" if $func; + $Tests{$name}{'succeeded'} = 1; + } + } + return $Tests{$name}{'succeeded'}; +} + +########################################################################### +########################################################################### + +# Various tests. + +########################################################################### + +# Test "-x raw,null -y raw,null", to ensure raw input and output works. +# Pass a CSP_* constant in $csp. The output frame will be stored in +# $VideoData{$csp}. + +sub test_raw_raw +{ + my ($csp) = @_; + + my $raw_in = &gen_raw_avi(WIDTH, HEIGHT, NFRAMES, $csp); + my $i = index($raw_in, "movi00db"); # find first frame + &fatal("***BUG*** can't find frame in test input") if $i < 0; + my $raw_frame = substr($raw_in, $i+4, + 8+unpack("V",substr($raw_in,$i+8,4))); + my @colorspace_args = (); + push @colorspace_args, "-V", "rgb24" if $csp == CSP_RGB; + $VideoData{$csp} = &transcode($raw_in, "-x", "raw,null", "-y", + "raw,null", @colorspace_args); + return "transcode failed" if !$VideoData{$csp}; + $i = index($VideoData{$csp}, "movi00db"); + return "can't find any frames in output file" if $i < 0; + return "bad output data" + if (substr($VideoData{$csp}, $i+4, length($raw_frame)*NFRAMES) + ne $raw_frame x NFRAMES); + return undef; +} + +########################################################################### + +# Test raw input/output with colorspace conversion. + +sub test_raw_raw_csp +{ + my ($csp_in, $csp_out) = @_; + + my $data = $VideoData{$csp_in}; + &fatal("***BUG*** missing input data for CSP $csp_in") if !$data; + &fatal("***BUG*** missing output data for CSP $csp_out") + if !$VideoData{$csp_out}; + my $outcsp_arg = $csp_out==CSP_RGB ? "rgb" : "i420"; + my @colorspace_args = (); + push @colorspace_args, "-V", "rgb24" if $csp_in == CSP_RGB; + $data = &transcode($data, "-x", "raw,null", "-y", "raw,null", + "-F", $outcsp_arg, @colorspace_args); + return "transcode failed" if !$data; + return "bad output data" if $data ne $VideoData{$csp_out}; + return undef; +} + +########################################################################### + +# Test a generic video import module. Pass the module name (with any +# parameters) in $vimport_mod, and a CSP_* colorspace constant in $csp +# (this is the target colorspace to be used by transcode). + +sub test_import +{ + my ($vimport_mod, $dataref, $csp) = @_; + + &fatal("***BUG*** missing output data for CSP $csp") + if !$VideoData{$csp}; + my @colorspace_args = (); + push @colorspace_args, "-V", "rgb24" if $csp == CSP_RGB; + $data = &transcode($$dataref, "-x", "$vimport_mod,null", "-y", "raw,null", + @colorspace_args); + return "transcode failed" if !$data; + return "bad output data" if $data ne $VideoData{$csp}; + return undef; +} + +########################################################################### + +# Test a generic video export module, by running the output back through +# -x ffmpeg. Pass the module name (with any parameters) in $vexport_mod, a +# CSP_* colorspace constant in $csp, + +sub test_export_x_ffmpeg +{ + my ($vexport_mod, $csp, $F_arg) = @_; + + my $csp_data = $VideoData{$csp}; + &fatal("***BUG*** missing input data for CSP $csp") if !$csp_data; + my @extra_args = (); + push @extra_args, "-F", $F_arg if defined($F_arg); + my @colorspace_args = (); + push @colorspace_args, "-V", "rgb24" if $csp == CSP_RGB; + my $export_data = &transcode($csp_data, "-x", "raw,null", "-y", + "$vexport_mod,null", @extra_args, + @colorspace_args); + return "transcode (export) failed" if !$export_data; + my $import_data = &transcode($export_data, "-x", "ffmpeg,null", "-y", + "raw,null", @colorspace_args); + return "transcode (import) failed" if !$import_data; + return "bad data" if $import_data ne $VideoData{$csp}; + return undef; +} + +########################################################################### + +# Test one or more video core operations. Each parameter is a reference to +# an array containing, in the following order: +# * The transcode command-line option, e.g. "-j" +# * The parameter to the option, or undef if there is no parameter +# * The function (vidcore_* below) that implements the transformation +# (can be omitted if no transformation should be executed) +# * Parameters to the function, if any +# The operations are assumed to be performed by transcode in the order they +# are passed to this function. + +sub test_vidcore +{ + my $colorspace = shift @_; + my @cmdline = ("-x", "raw,null", "-y", "raw,null"); + push @cmdline, "-V", "rgb24" if $colorspace == CSP_RGB; + my $bpp = $colorspace==CSP_RGB ? 24 : 12; # total bits per pixel + + # Diagonalize the test frame, to try and catch more bugs + if (!$vidcore_in_frame{$colorspace}) { + my $frame = $colorspace==CSP_RGB ? &gen_rgb_frame(WIDTH,HEIGHT) + : &gen_yuv_frame(WIDTH,HEIGHT); + my $Bpp = $colorspace==CSP_RGB ? 3 : 1; + my $Bp2 = $Bpp*2; + for (my $y = 2; $y < HEIGHT; $y += 2) { + $frame = substr($frame, 0, $y*WIDTH*$Bpp) + . substr($frame, $y*WIDTH*$Bpp-$Bp2, $Bp2) + . substr($frame, $y*WIDTH*$Bpp, + (HEIGHT-$y)*WIDTH*$Bpp-$Bp2) + . substr($frame, HEIGHT*WIDTH*$Bpp); + } + if ($colorspace == CSP_YUV) { + my $ofs = HEIGHT*WIDTH*$Bpp; + my $w2 = int(WIDTH/2); + my $h2 = int(HEIGHT/2); + for (my $y = 1; $y < $h2; $y++) { + $frame = substr($frame, 0, $ofs+$y*$w2) + . substr($frame, $ofs+$y*$w2-1, 1) + . substr($frame, $ofs+$y*$w2, ($h2-$y)*$w2-1) + . substr($frame, $ofs+$h2*$w2); + } + $ofs += $h2*$w2*$Bpp; + for (my $y = 1; $y < $h2; $y++) { + $frame = substr($frame, 0, $ofs+$y*$w2) + . substr($frame, $ofs+$y*$w2-1, 1) + . substr($frame, $ofs+$y*$w2, ($h2-$y)*$w2-1); + } + } + $vidcore_in_frame{$colorspace} = $frame; + } + + # Generate command line and expected output frame + my $out_frame = $vidcore_in_frame{$colorspace}; + my $out_w = WIDTH; + my $out_h = HEIGHT; + foreach $op (@_) { + push @cmdline, $$op[0]; + push @cmdline, $$op[1] if defined($$op[1]); + if ($$op[2]) { + if (!&{$$op[2]}($colorspace, \$out_frame, \$out_w, \$out_h, + @$op[3..$#$op])) { + return "Video operation for $$op[0] not implemented"; + } + if (length($out_frame) != $out_w * $out_h * $bpp / 8) { + return "Video operation for $$op[0] gave wrong size result" + . " (tester bug)"; + } + } + } + + # Run transcode + my $in_avi = &gen_raw_avi(WIDTH, HEIGHT, NFRAMES, $colorspace, + $vidcore_in_frame{$colorspace}); + my $out_avi = &transcode($in_avi, @cmdline); + + # Check output data + my $pos = index($out_avi, "movi00db"); + $pos += 4 if $pos >= 0; + for (my $i = 0; $i < NFRAMES; $i++) { + if ($pos < 0) { + return "Can't find video data in transcode output"; + } + my $len = unpack("V", substr($out_avi, $pos+4, 4)); + if ($len != length($out_frame)) { + return "Video frame has bad size ($len, expected " + . length($out_frame) . ")"; + } + if (substr($out_avi, $pos+8, $len) ne $out_frame) { +#open F,">/tmp/t";print F $out_frame;close F;open F,">/tmp/u";print F substr($out_avi,$pos+8,$len);close F; + return "Incorrect data in video frame"; + } + $pos = index($out_avi, "00db", $pos+8+$len); + } + return undef; +} + +################ + +# -j/-Y +sub vidcore_crop +{ + my ($csp, $frameref, $widthref, $heightref, + $top, $left, $bottom, $right) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + my $black = $csp==-2 ? "\x80" : "\0"; + + if ($csp == CSP_YUV) { + my $w2 = int($$widthref/2); + my $h2 = int($$heightref/2); + my $Y = substr($$frameref, 0, $$widthref*$$heightref); + my $U = substr($$frameref, $$widthref*$$heightref, $w2*$h2); + my $V = substr($$frameref, $$widthref*$$heightref + $w2*$h2, $w2*$h2); + return 0 if !&vidcore_crop(-1, \$Y, $widthref, $heightref, + $top, $left, $bottom, $right); + my $wdummy = $w2; + my $hdummy = $h2; + return 0 if !&vidcore_crop(-2, \$U, \$wdummy, \$hdummy, + int($top/2), int($left/2), + int($bottom/2), int($right/2)); + return 0 if !&vidcore_crop(-2, \$V, \$w2, \$h2, + int($top/2), int($left/2), + int($bottom/2), int($right/2)); + $$frameref = $Y . $U . $V; + return 1; + } + + if ($top > 0) { + $$frameref = substr($$frameref, $top*$$widthref*$Bpp); + } elsif ($top < 0) { + $$frameref = ($black x (-$top*$$widthref*$Bpp)) . $$frameref; + } + $$heightref -= $top; + if ($bottom > 0) { + $$frameref = substr($$frameref, 0, + ($$heightref-$bottom)*$$widthref*$Bpp); + } elsif ($bottom < 0) { + $$frameref .= $black x (-$bottom*$$widthref*$Bpp); + } + $$heightref -= $bottom; + my $newframe = ""; + for (my $y = 0; $y < $$heightref; $y++) { + my $row = substr($$frameref, $y*$$widthref*$Bpp, $$widthref*$Bpp); + if ($left > 0) { + $row = substr($row, $left*$Bpp); + } elsif ($left < 0) { + $row = ($black x (-$left*$Bpp)) . $row; + } + if ($right > 0) { + $row = substr($row, 0, length($row) - $right*$Bpp); + } elsif ($right < 0) { + $row .= $black x (-$right*$Bpp); + } + $newframe .= $row; + } + $$widthref -= $left + $right; + $$frameref = $newframe; + return 1; +} + +################ + +# -I 1 +sub vidcore_deint_interpolate +{ + my ($csp, $frameref, $widthref, $heightref) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + my $Bpl = $$widthref * $Bpp; + + my $newframe = ""; + for (my $y = 0; $y < $$heightref; $y++) { + if ($y%2 == 0) { + $newframe .= substr($$frameref, $y*$Bpl, $Bpl); + } elsif ($y == $$heightref-1) { + $newframe .= substr($$frameref, ($y-1)*$Bpl, $Bpl); + } else { + for (my $x = 0; $x < $Bpl; $x++) { + my $c1 = ord(substr($$frameref, ($y-1)*$Bpl+$x, 1)); + my $c2 = ord(substr($$frameref, ($y+1)*$Bpl+$x, 1)); + $newframe .= chr(int(($c1+$c2+1)/2)); + } + } + } + $newframe .= substr($$frameref, $$heightref*$Bpl); + $$frameref = $newframe; + return 1; +} + + +# -I 3 +sub vidcore_deint_dropzoom +{ + my ($csp, $frameref, $widthref, $heightref) = @_; + + my $oldheight = $$heightref; + &vidcore_deint_dropfield($csp, $frameref, $widthref, $heightref); + return &vidcore_zoom($csp, $frameref, $widthref, $heightref, $$widthref, + $oldheight); +} + + +# -I 4 +sub vidcore_deint_dropfield +{ + my ($csp, $frameref, $widthref, $heightref) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + my $Bpl = $$widthref*$Bpp; + + my $newframe = ""; + for (my $y = 0; $y < int($$heightref/2); $y++) { + $newframe .= substr($$frameref, ($y*2)*$Bpl, $Bpl); + } + if ($csp == CSP_YUV) { + my $ofs = $$widthref * $$heightref; + $Bpl = int($Bpl/2); + for (my $y = 0; $y < int($$heightref/2/2); $y++) { + $newframe .= substr($$frameref, $ofs + ($y*2)*$Bpl, $Bpl); + } + $ofs += int($$widthref/2) * int($$heightref/2); + for (my $y = 0; $y < int($$heightref/2/2); $y++) { + $newframe .= substr($$frameref, $ofs + ($y*2)*$Bpl, $Bpl); + } + } + $$frameref = $newframe; + $$heightref = int($$heightref/2); + return 1; +} + + +# -I 5 +sub vidcore_deint_linear_blend +{ + my ($csp, $frameref, $widthref, $heightref) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + my $Bpl = $$widthref * $Bpp; + + my $evenframe = ""; + for (my $y = 0; $y < $$heightref; $y++) { + if ($y%2 == 0) { + $evenframe .= substr($$frameref, $y*$Bpl, $Bpl); + } elsif ($y == $$heightref-1) { + $evenframe .= substr($$frameref, ($y-1)*$Bpl, $Bpl); + } else { + for (my $x = 0; $x < $Bpl; $x++) { + my $c1 = ord(substr($$frameref, ($y-1)*$Bpl+$x, 1)); + my $c2 = ord(substr($$frameref, ($y+1)*$Bpl+$x, 1)); + $evenframe .= chr(int(($c1+$c2+1)/2)); + } + } + } + + my $oddframe = ""; + for (my $y = 0; $y < $$heightref; $y++) { + if ($y%2 == 1) { + $oddframe .= substr($$frameref, $y*$Bpl, $Bpl); + } elsif ($y == 0) { + $oddframe .= substr($$frameref, ($y+1)*$Bpl, $Bpl); + } elsif ($y == $$heightref-1) { + $oddframe .= substr($$frameref, ($y-1)*$Bpl, $Bpl); + } else { + for (my $x = 0; $x < $Bpl; $x++) { + my $c1 = ord(substr($$frameref, ($y-1)*$Bpl+$x, 1)); + my $c2 = ord(substr($$frameref, ($y+1)*$Bpl+$x, 1)); + $oddframe .= chr(int(($c1+$c2+1)/2)); + } + } + } + + my $newframe = ""; + for (my $i = 0; $i < $$heightref*$Bpl; $i++) { + my $c1 = ord(substr($evenframe, $i, 1)); + my $c2 = ord(substr($oddframe, $i, 1)); + $newframe .= chr(int(($c1+$c2+1)/2)); + } + $newframe .= substr($$frameref, $$heightref*$Bpl); + + $$frameref = $newframe; + return 1; +} + +################ + +# -B/-X +sub vidcore_resize +{ + my ($csp, $frameref, $widthref, $heightref, $resize_h, $resize_w) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + my $mult = $csp==-2 ? 4 : 8; + + if ($csp == CSP_YUV) { + my $w2 = int($$widthref/2); + my $h2 = int($$heightref/2); + my $Y = substr($$frameref, 0, $$widthref*$$heightref); + my $U = substr($$frameref, $$widthref*$$heightref, $w2*$h2); + my $V = substr($$frameref, $$widthref*$$heightref + $w2*$h2, $w2*$h2); + return 0 if !&vidcore_resize(-1, \$Y, $widthref, $heightref, + $resize_h, $resize_w); + my $wdummy = $w2; + my $hdummy = $h2; + return 0 if !&vidcore_resize(-2, \$U, \$wdummy, \$hdummy, + int($resize_h/2), int($resize_w/2)); + return 0 if !&vidcore_resize(-2, \$V, \$w2, \$h2, + int($resize_h/2), int($resize_w/2)); + $$frameref = $Y . $U . $V; + return 1; + } + + my $newframe = $$frameref; + + if ($resize_h) { + my $Bpl = $$widthref*$Bpp; + my $new_h = $$heightref + $resize_h; + my $ratio = $$heightref / $new_h; + my $oldy_block = int($$heightref/$mult); + my $y_block = int($new_h/$mult); + my (@source, @weight1, @weight2); + for (my $i = 0; $i < $y_block; $i++) { + my $oldi = $i * $$heightref / $new_h; + $source[$i] = int($oldi); + if ($oldi+1 >= $oldy_block || $oldi + $ratio < $source[$i]+1) { + $weight1[$i] = 65536; + $weight2[$i] = 0; + } else { + my $temp = ((int($oldi)+1) - $oldi) / $ratio * (3.14159265358979323846264338327950/2); + $weight1[$i] = int(65536 * sin($temp)*sin($temp) + 0.5); + $weight2[$i] = 65536 - $weight1[$i]; + } + } + $newframe = ""; + for (my $y = 0; $y < $new_h; $y++) { + my $block = int($y / $y_block); + my $i = $y % $y_block; + my $oldy = $block * $oldy_block + $source[$i]; + if ($weight1[$i] == 0x10000) { + $newframe .= substr($$frameref, $oldy*$Bpl, $Bpl); + } else { + for (my $x = 0; $x < $Bpl; $x++) { + my $c1 = ord(substr($$frameref, $oldy*$Bpl+$x, 1)); + my $c2 = ord(substr($$frameref, ($oldy+1)*$Bpl+$x, 1)); + my $c = $c1*$weight1[$i] + $c2*$weight2[$i] + 32768; + $newframe .= chr($c>>16); + } + } + } + $$frameref = $newframe; + $$heightref = $new_h; + } + + if ($resize_w) { + my $new_w = $$widthref + $resize_w; + my $ratio = $$widthref / $new_w; + my $oldx_block = int($$widthref/$mult); + my $x_block = int($new_w/$mult); + my (@source, @weight1, @weight2); + for (my $i = 0; $i < $x_block; $i++) { + my $oldi = $i * $$widthref / $new_w; + $source[$i] = int($oldi); + if ($oldi+1 >= $oldx_block || $oldi + $ratio < $source[$i]+1) { + $weight1[$i] = 65536; + $weight2[$i] = 0; + } else { + my $temp = ((int($oldi)+1) - $oldi) / $ratio * (3.14159265358979323846264338327950/2); + $weight1[$i] = int(65536 * sin($temp)*sin($temp) + 0.5); + $weight2[$i] = 65536 - $weight1[$i]; + } + } + $newframe = ""; + for (my $block = 0; $block < $$heightref * $mult; $block++) { + my $y = int($block/$mult); + for (my $i = 0; $i < $x_block; $i++) { + my $oldx = ($block%$mult) * $oldx_block + $source[$i]; + if ($weight1[$i] == 0x10000) { + $newframe .= substr($$frameref, ($y*$$widthref+$oldx)*$Bpp, + $Bpp); + } else { + for (my $j = 0; $j < $Bpp; $j++) { + my $c1 = ord(substr($$frameref, + ($y*$$widthref+$oldx)*$Bpp+$j, + 1)); + my $c2 = ord(substr($$frameref, + ($y*$$widthref+$oldx+1)*$Bpp+$j, + 1)); + my $c = $c1*$weight1[$i] + $c2*$weight2[$i] + 32768; + $newframe .= chr($c>>16); + } + } + } + } + $$frameref = $newframe; + $$widthref = $new_w; + } + + return 1; +} + +################ + +# -Z (slow) +# Implemented using triangle filter +sub vidcore_zoom +{ + my ($csp, $frameref, $widthref, $heightref, $newwidth, $newheight) = @_; + my $Bpp = $csp<0 ? -$csp : $csp==CSP_RGB ? 3 : 1; + my $Bpl = $$widthref*$Bpp; + + if ($csp == CSP_YUV) { + my $w2 = int($$widthref/2); + my $h2 = int($$heightref/2); + my $Y = substr($$frameref, 0, $$widthref*$$heightref); + my $U = substr($$frameref, $$widthref*$$heightref, $w2*$h2); + my $V = substr($$frameref, $$widthref*$$heightref + $w2*$h2, $w2*$h2); + return 0 if !&vidcore_zoom(-1, \$Y, $widthref, $heightref, + $newwidth, $newheight); + my $wdummy = $w2; + my $hdummy = $h2; + return 0 if !&vidcore_zoom(-1, \$U, \$wdummy, \$hdummy, + int($newwidth/2), int($newheight/2)); + return 0 if !&vidcore_zoom(-1, \$V, \$w2, \$h2, + int($newwidth/2), int($newheight/2)); + $$frameref = $Y . $U . $V; + return 1; + } + + my @x_contrib = (); + my $xscale = $newwidth / $$widthref; + my $fscale = ($xscale<1 ? 1/$xscale : 1); + my $fwidth = 1.0 * $fscale; + for (my $x = 0; $x < $newwidth*$Bpp; $x++) { + my $center = int($x/$Bpp) / $xscale; + my $left = ceil($center - $fwidth); + my $right = floor($center + $fwidth); + my @contrib = (); + for (my $i = $left; $i <= $right; $i++) { + my $weight = ($i-$center) / $fscale; + $weight = (1 - abs($weight)) / $fscale; + $weight = 0 if $weight < 0; + my $n = $i; + $n = -$n if $n < 0; + $n = ($$widthref-$n) + $$widthref - 1 if $n >= $$widthref; + push @contrib, $n*$Bpp + ($x%$Bpp), int($weight*65536); + } + push @x_contrib, [@contrib]; + } + + my @y_contrib = (); + my $yscale = $newheight / $$heightref; + $fscale = ($yscale<0 ? 1/$yscale : 1); + $fwidth = 1.0 * $fscale; + for (my $y = 0; $y < $newheight; $y++) { + my $center = $y / $yscale; + my $left = ceil($center - $fwidth); + my $right = floor($center + $fwidth); + my @contrib = (); + for (my $i = $left; $i <= $right; $i++) { + my $weight = ($i-$center) / $fscale; + $weight = (1 - abs($weight)) / $fscale; + $weight = 0 if $weight < 0; + my $n = $i; + $n = -$n if $n < 0; + $n = ($$heightref-$n) + $$heightref - 1 if $n >= $$heightref; + push @contrib, $n, int($weight*65536); + } + push @y_contrib, [@contrib]; + } + + my $tmpframe = ""; + for (my $y = 0; $y < $$heightref; $y++) { + use integer; + my @pixels = unpack("C*", substr($$frameref, $y*$Bpl, $Bpl)); + for (my $x = 0; $x < $newwidth*$Bpp; $x++) { + my $weight = 0x8000; + for (my $i = 0; $i < @{$x_contrib[$x]}; $i += 2) { + $weight += $pixels[$x_contrib[$x][$i]] * $x_contrib[$x][$i+1]; + } + $weight >>= 16; + $weight = 0 if $weight < 0; + $weight = 255 if $weight > 255; + $tmpframe .= chr($weight); + } + } + + my @tmpframe = (); + $Bpl = $newwidth*$Bpp; + for (my $y = 0; $y < $$heightref; $y++) { + push @tmpframe, [unpack("C*", substr($tmpframe, $y*$Bpl, $Bpl))]; + } + + my $newframe = ""; + for (my $y = 0; $y < $newheight; $y++) { + use integer; + for (my $x = 0; $x < $newwidth*$Bpp; $x++) { + my $weight = 0x8000; + for (my $i = 0; $i < @{$y_contrib[$y]}; $i += 2) { + $weight += $tmpframe[$y_contrib[$y][$i]][$x] * $y_contrib[$y][$i+1]; + } + $weight >>= 16; + $weight = 0 if $weight < 0; + $weight = 255 if $weight > 255; + $newframe .= chr($weight); + } + } + + $$frameref = $newframe; + $$widthref = $newwidth; + $$heightref = $newheight; + return 1; +} + +################ + +# -r +sub vidcore_reduce +{ + my ($csp, $frameref, $widthref, $heightref, $reduce_h, $reduce_w) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + + my $newframe = ""; + for (my $y = 0; $y < int($$heightref/$reduce_h); $y++) { + for (my $x = 0; $x < int($$widthref/$reduce_w); $x++) { + $newframe .= substr($$frameref, (($y*$reduce_h)*$$widthref + +($x*$reduce_w))*$Bpp, $Bpp); + } + } + if ($csp == CSP_YUV) { + my $ofs = $$widthref * $$heightref; + for (my $y = 0; $y < int($$heightref/2/$reduce_h); $y++) { + for (my $x = 0; $x < int($$widthref/2/$reduce_w); $x++) { + $newframe .= substr($$frameref, + $ofs + (($y*$reduce_h)*int($$widthref/2) + +($x*$reduce_w)), 1); + } + } + $ofs += int($$widthref/2) * int($$heightref/2); + for (my $y = 0; $y < int($$heightref/2/$reduce_h); $y++) { + for (my $x = 0; $x < int($$widthref/2/$reduce_w); $x++) { + $newframe .= substr($$frameref, + $ofs + (($y*$reduce_h)*int($$widthref/2) + +($x*$reduce_w)), 1); + } + } + } + $$frameref = $newframe; + $$widthref = int($$widthref / $reduce_w); + $$heightref = int($$heightref / $reduce_h); + return 1; +} + +################ + +# -z +sub vidcore_flip_v +{ + my ($csp, $frameref, $widthref, $heightref) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + my $Bpl = $$widthref * $Bpp; + + my $newframe = ""; + for (my $y = $$heightref-1; $y >= 0; $y--) { + $newframe .= substr($$frameref, $y*$Bpl, $Bpl); + } + if ($csp == CSP_YUV) { + my $ofs = $$widthref * $$heightref; + $Bpl = int($Bpl/2); + for (my $y = int($$heightref/2)-1; $y >= 0; $y--) { + $newframe .= substr($$frameref, $ofs + $y*$Bpl, $Bpl); + } + $ofs += int($$heightref/2) * $Bpl; + for (my $y = int($$heightref/2)-1; $y >= 0; $y--) { + $newframe .= substr($$frameref, $ofs + $y*$Bpl, $Bpl); + } + } + $$frameref = $newframe; + return 1; +} + +################ + +# -l +sub vidcore_flip_h +{ + my ($csp, $frameref, $widthref, $heightref) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + + my $newframe = ""; + for (my $y = 0; $y < $$heightref; $y++) { + for (my $x = $$widthref-1; $x >= 0; $x--) { + $newframe .= substr($$frameref, ($y*$$widthref+$x)*$Bpp, $Bpp); + } + } + if ($csp == CSP_YUV) { + my $ofs = $$widthref * $$heightref; + my $Bpl = int($$widthref/2); + for (my $y = 0; $y < int($$heightref/2) * 2; $y++) { + for (my $x = $Bpl-1; $x >= 0; $x--) { + $newframe .= substr($$frameref, $ofs+($y*$Bpl+$x), 1); + } + } + } + $$frameref = $newframe; + return 1; +} + +################ + +# -k +sub vidcore_rgbswap +{ + my ($csp, $frameref, $widthref, $heightref) = @_; + + my $newframe = ""; + if ($csp == CSP_RGB) { + for (my $i = 0; $i < $$widthref*$$heightref; $i++) { + $newframe .= substr($$frameref, $i*3+2, 1); + $newframe .= substr($$frameref, $i*3+1, 1); + $newframe .= substr($$frameref, $i*3 , 1); + } + } elsif ($csp == CSP_YUV) { + my $Ysize = $$widthref * $$heightref; + my $UVsize = int($$widthref/2) * int($$heightref/2); + $newframe = substr($$frameref, 0, $Ysize) + . substr($$frameref, $Ysize+$UVsize, $UVsize) + . substr($$frameref, $Ysize, $UVsize); + } else { + return 0; + } + $$frameref = $newframe; + return 1; +} + +################ + +# -K +sub vidcore_grayscale +{ + my ($csp, $frameref, $widthref, $heightref) = @_; + + my $newframe = ""; + if ($csp == CSP_RGB) { + for (my $i = 0; $i < $$widthref * $$heightref; $i++) { + my $r = ord(substr($$frameref, $i*3 , 1)); + my $g = ord(substr($$frameref, $i*3+1, 1)); + my $b = ord(substr($$frameref, $i*3+2, 1)); + my $c = (19595*$r + 38470*$g + 7471*$b + 32768) >> 16; + $newframe .= chr($c) x 3; + } + } elsif ($csp == CSP_YUV) { + $newframe = substr($$frameref, 0, $$widthref * $$heightref) + . ("\x80" x (int($$widthref/2) * int($$heightref/2) * 2)); + } else { + return 0; + } + $$frameref = $newframe; + return 1; +} + +################ + +# -G +sub vidcore_gamma_adjust +{ + my ($csp, $frameref, $widthref, $heightref, $gamma) = @_; + my $Bpp = ($csp==CSP_RGB ? 3 : 1); + + my @table = (); + for (my $i = 0; $i < 256; $i++) { + $table[$i] = int((($i/255)**$gamma) * 255); + } + + my $newframe = ""; + for (my $i = 0; $i < $$widthref*$$heightref*$Bpp; $i++) { + $newframe .= chr($table[ord(substr($$frameref, $i, 1))]); + } + if ($csp != CSP_RGB) { + $newframe .= substr($$frameref, $$widthref*$$heightref*$Bpp); + } + $$frameref = $newframe; + return 1; +} + +################ + +# -C +sub vidcore_antialias +{ + my ($csp, $frameref, $widthref, $heightref, $aa_weight, $aa_bias) = @_; + my $Bpp = $csp==CSP_RGB ? 3 : 1; + my $Bpl = $$widthref * $Bpp; + my (@table_c, @table_x, @table_y, @table_d); + + for (my $i = 0; $i < 256; $i++) { + $table_c[$i] = int($i * $aa_weight * 65536); + $table_x[$i] = int($i * $aa_bias * (1-$aa_weight)/4 * 65536); + $table_y[$i] = int($i * (1-$aa_bias) * (1-$aa_weight)/4 * 65536); + $table_d[$i] = int(($table_x[$i] + $table_y[$i] + 1) / 2); + } + + my $newframe = substr($$frameref, 0, $Bpl); + for (my $y = 1; $y < $$heightref-1; $y++) { + $newframe .= substr($$frameref, $y*$Bpl, $Bpp); + for (my $x = 1; $x < $$widthref-1; $x++) { + my $UL = substr($$frameref, (($y-1)*$$widthref+($x-1))*$Bpp, $Bpp); + my $U = substr($$frameref, (($y-1)*$$widthref+($x ))*$Bpp, $Bpp); + my $UR = substr($$frameref, (($y-1)*$$widthref+($x+1))*$Bpp, $Bpp); + my $L = substr($$frameref, (($y )*$$widthref+($x-1))*$Bpp, $Bpp); + my $C = substr($$frameref, (($y )*$$widthref+($x ))*$Bpp, $Bpp); + my $R = substr($$frameref, (($y )*$$widthref+($x+1))*$Bpp, $Bpp); + my $DL = substr($$frameref, (($y+1)*$$widthref+($x-1))*$Bpp, $Bpp); + my $D = substr($$frameref, (($y+1)*$$widthref+($x ))*$Bpp, $Bpp); + my $DR = substr($$frameref, (($y+1)*$$widthref+($x+1))*$Bpp, $Bpp); + if ((&SAME($L,$U) && &DIFF($L,$D) && &DIFF($L,$R)) + || (&SAME($L,$D) && &DIFF($L,$U) && &DIFF($L,$R)) + || (&SAME($R,$U) && &DIFF($R,$D) && &DIFF($R,$L)) + || (&SAME($R,$D) && &DIFF($R,$U) && &DIFF($R,$L)) + ) { + for (my $i = 0; $i < $Bpp; $i++) { + my $c = $table_d[ord(substr($UL,$i,1))] + + $table_y[ord(substr($U ,$i,1))] + + $table_d[ord(substr($UR,$i,1))] + + $table_x[ord(substr($L ,$i,1))] + + $table_c[ord(substr($C ,$i,1))] + + $table_x[ord(substr($R ,$i,1))] + + $table_d[ord(substr($DL,$i,1))] + + $table_y[ord(substr($D ,$i,1))] + + $table_d[ord(substr($DR,$i,1))] + + 32768; + $newframe .= chr($c>>16); + } + } else { + $newframe .= $C; + } + } + $newframe .= substr($$frameref, $y*$Bpl+($Bpl-$Bpp), $Bpp); + } + $newframe .= substr($$frameref, ($$heightref-1)*$Bpl, $Bpl); + if ($csp != CSP_RGB) { + $newframe .= substr($$frameref, $$widthref*$$heightref*$Bpp); + } + $$frameref = $newframe; + return 1; +} + +sub SAME { + my @pixel1 = unpack("C*", $_[0]); + my @pixel2 = unpack("C*", $_[1]); + my $diff = 0; + for (my $i = 0; $i < @pixel1; $i++) { + my $thisdiff = abs($pixel2[$i] - $pixel1[$i]); + $diff = $thisdiff if $diff < $thisdiff; + } + return $diff < 25; +} + +sub DIFF { return !&SAME(@_); } + +########################################################################### +########################################################################### + +# Video data generation. + +########################################################################### + +sub gen_raw_avi +{ + my ($width,$height,$nframes,$csp,$frame) = @_; + + if (!defined($frame)) { + $frame = $csp==CSP_RGB ? &gen_rgb_frame($width,$height) + : &gen_yuv_frame($width,$height); + } + my $frame_chunk = "00db" . pack("V", length($frame)) . $frame; + my $movi = + "LIST" . + pack("V", 4 + length($frame_chunk)*$nframes) . + "movi" . + ($frame_chunk x $nframes); + + my $strl = + "LIST" . + pack("V", 0x74) . + "strl" . + "strh" . + pack("V", 0x38) . + "vids" . + ($csp==CSP_RGB ? "RGB " : "I420") . + pack("V", 0) . + pack("V", 0) . + pack("V", 0) . + pack("V", 1) . # frame rate denominator + pack("V", 25) . # frame rate numerator + pack("V", 0) . + pack("V", $nframes) . + pack("V", length($frame)) . + pack("V", 0) . + pack("V", 0) . + pack("V", 0) . + pack("V", 0) . + "strf" . + pack("V", 0x28) . + pack("V", 0x28) . + pack("V", $width) . + pack("V", $height) . + pack("vv", 1, 24) . # planes and bits per pixel, in theory + ($csp==CSP_RGB ? "RGB " : "I420") . + pack("V", $width*$height*3) . # image size, in theory + pack("V", 0) . + pack("V", 0) . + pack("V", 0) . + pack("V", 0); + + my $hdrl = + "LIST" . + pack("V", 0x44 + length($strl)) . + "hdrl" . + "avih" . + pack("V", 0x38) . + pack("V", 1/25 * 1000000) . # microseconds per frame + pack("V", 0) . + pack("V", 0) . + pack("V", 0x100) . # AVIF_ISINTERLEAVED + pack("V", $nframes) . + pack("V", 0) . + pack("V", 1) . # number of streams + pack("V", 0) . + pack("V", $width) . + pack("V", $height) . + pack("V", 0) . + pack("V", 0) . + pack("V", 0) . + pack("V", 0) . + $strl; + + return + "RIFF" . + pack("V", 4 + length($hdrl) + length($movi)) . + "AVI " . + $hdrl . + $movi; +} + +########################################################################### + +# The test frame uses the following colors: +# RGB (253,0,1) YUV (81,91,239) +# RGB (2,255,1) YUV (145,54,35) +# RGB (2,0,255) YUV (41,240,111) +# RGB (0,0,0) YUV (16,128,128) (exact conversion) +# RGB (85,85,85) YUV (89,128,128) (exact conversion) +# RGB (170,170,170) YUV (162,128,128) (exact conversion) +# RGB (255,255,255) YUV (235,128,128) (exact conversion) +# which were chosen because they can be converted accurately between RGB +# and YUV colorspaces with 8 bits per component, assuming rounding. + +sub gen_yuv_frame +{ + my ($width,$height) = @_; + + # Size of a vertical color bar (1/4 of the frame, multiple of 16 pixels) + my $barsize = int($width/64) * 16; + # Size of the black/gray/white bar (everything remaining) + my $whitesize = $width - 3*$barsize; + # Height of top 3 sections (1/4 of the frame, multiple of 16 pixels) + my $height1 = int($height/64) * 16; + # Height of the bottom section (everything remaining) + my $height2 = $height - 3*$height1; + + # Color bar part of Y rows + my $Yright = chr(81)x$barsize . chr(145)x$barsize . chr(41)x$barsize; + # Y rows (shades of gray from black to white on the right) + my $Yrow0 = chr( 16)x$whitesize . $Yright; + my $Yrow1 = chr( 89)x$whitesize . $Yright; + my $Yrow2 = chr(162)x$whitesize . $Yright; + my $Yrow3 = chr(235)x$whitesize . $Yright; + # U and V rows + my $Urow = chr(128) x (($width-$barsize*3)/2) . + chr( 91) x ($barsize/2) . + chr( 54) x ($barsize/2) . + chr(240) x ($barsize/2); + my $Vrow = chr(128) x (($width-$barsize*3)/2) . + chr(239) x ($barsize/2) . + chr( 35) x ($barsize/2) . + chr(111) x ($barsize/2); + + # Y plane + my $Y = $Yrow0 x $height1 . $Yrow1 x $height1 . $Yrow2 x $height1 . + $Yrow3 x $height2; + # U and V planes + my $U = $Urow x ($height/2); + my $V = $Vrow x ($height/2); + + # Final frame + return $Y.$U.$V; +} + + +sub gen_rgb_frame +{ + my ($width,$height) = @_; + + # Size of a vertical color bar (1/4 of the frame, multiple of 16 pixels) + my $barsize = int($width/64) * 16; + # Size of the black/gray/white bar (everything remaining) + my $whitesize = $width - 3*$barsize; + # Height of top 3 sections (1/4 of the frame, multiple of 16 pixels) + my $height1 = int($height/64) * 16; + # Height of the bottom section (everything remaining) + my $height2 = $height - 3*$height1; + + # Color bar part of one row + my $color = (chr(253).chr(0).chr(1)) x $barsize . + (chr(2).chr(255).chr(1)) x $barsize . + (chr(2).chr(0).chr(255)) x $barsize; + # Full rows (shades of gray from black to white on the right) + my $row0 = chr(0)x($whitesize*3) . $color; + my $row1 = chr(85)x($whitesize*3) . $color; + my $row2 = chr(170)x($whitesize*3) . $color; + my $row3 = chr(255)x($whitesize*3) . $color; + + # Final frame + return $row0 x $height1 . + $row1 x $height1 . + $row2 x $height1 . + $row3 x $height2; +} + +########################################################################### + +# Local variables: +# indent-tabs-mode: nil +# End: +# +# vim: expandtab shiftwidth=4: diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-acmemcpy-speed.c b/debian/transcode/transcode-1.1.7/testsuite/test-acmemcpy-speed.c new file mode 100644 index 00000000..dabef87f --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-acmemcpy-speed.c @@ -0,0 +1,279 @@ +/*compile-command +set -x +gcc -O3 -g -I. -I.. "$0" -DARCH_X86 +exit $? +*/ + +/* + * test-acmemcpy-speed.c - time all accelerated memcpy() implementations + * Written by Andrew Church <achurch@achurch.org> + * + * This file is part of transcode, a video stream processing tool. + * transcode is free software, distributable under the terms of the GNU + * General Public License (version 2 or later). See the file COPYING + * for details. + */ + +#include "config.h" + +#define _GNU_SOURCE /* for strsignal */ +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> +#include <setjmp.h> +#include <signal.h> +#include <sys/time.h> + +#define ac_memcpy local_ac_memcpy /* to avoid clash with libac.a */ +#define ac_memcpy_init local_ac_memcpy_init /* to avoid clash with libac.a */ +#include "aclib/ac.h" + +/* Include memcpy.c directly to get access to the particular implementations */ +#include "../aclib/memcpy.c" +#undef ac_memcpy +/* Make sure all names are available, to simplify function table */ +#if !defined(ARCH_X86) || !defined(HAVE_ASM_MMX) +# define memcpy_mmx memcpy +#endif +#if !defined(ARCH_X86) || !defined(HAVE_ASM_SSE) +# define memcpy_sse memcpy +#endif +#if !defined(ARCH_X86_64) || !defined(HAVE_ASM_SSE2) +# define memcpy_amd64 memcpy +#endif + +/* Default copy size and test length */ +#define DEF_BLOCKSIZE 0x10000 +#define DEF_TESTTIME 2000 /* milliseconds */ + +/*************************************************************************/ + +static void *old_SIGSEGV = NULL, *old_SIGILL = NULL, *old_SIGVTALRM = NULL; +static sigjmp_buf env; + + +static void sighandler(int sig) +{ + if (sig != SIGVTALRM) + printf("*** %s\n", strsignal(sig)); + siglongjmp(env, sig); +} + +static void set_signals(void) +{ + old_SIGSEGV = signal(SIGSEGV , sighandler); + old_SIGILL = signal(SIGILL , sighandler); + old_SIGVTALRM = signal(SIGVTALRM, sighandler); +} + +static void clear_signals(void) +{ + signal(SIGSEGV , old_SIGSEGV ); + signal(SIGILL , old_SIGILL ); + signal(SIGVTALRM, old_SIGVTALRM); +} + +/*************************************************************************/ + +/* align1 and align2 are 0..63 */ +static void testit(void *(*func)(void *, const void *, size_t), int size, + int align1, int align2, int msec, uint64_t *iterations) +{ + char *chunk1, *chunk1_base; + char *chunk2, *chunk2_base; + int sig; + volatile uint64_t iter = 0; + + chunk1_base = malloc(size+128); + chunk2_base = malloc(size+128); + chunk1 = (char *)(((long)chunk1_base+63) & -64) + align1; + chunk2 = (char *)(((long)chunk2_base+63) & -64) + align2; + memset(chunk1, 0x11, size); + memset(chunk2, 0x22, size); + + set_signals(); + if ((sig = sigsetjmp(env, 1)) != 0) { + if (sig == SIGVTALRM) + *iterations = iter; + else + *iterations = 0; + } else { + struct itimerval timer; + + timer.it_interval.tv_sec = 0; + timer.it_interval.tv_usec = 0; + timer.it_value.tv_sec = msec/1000; + timer.it_value.tv_usec = msec%1000; + if (setitimer(ITIMER_VIRTUAL, &timer, NULL) < 0) { + perror("setitimer"); + exit(1); + } + for (;;) { + (*func)(chunk2, chunk1, size); + iter++; + } + } + clear_signals(); + + free(chunk1_base); + free(chunk2_base); +} + +/*************************************************************************/ + +/* Turn presence/absence of #define into a number */ +#if defined(ARCH_X86) +# define defined_ARCH_X86 1 +#else +# define defined_ARCH_X86 0 +#endif +#if defined(ARCH_X86_64) +# define defined_ARCH_X86_64 1 +#else +# define defined_ARCH_X86_64 0 +#endif +#if defined(HAVE_ASM_MMX) +# define defined_HAVE_ASM_MMX 1 +#else +# define defined_HAVE_ASM_MMX 0 +#endif +#if defined(HAVE_ASM_SSE) +# define defined_HAVE_ASM_SSE 1 +#else +# define defined_HAVE_ASM_SSE 0 +#endif +#if defined(HAVE_ASM_SSE2) +# define defined_HAVE_ASM_SSE2 1 +#else +# define defined_HAVE_ASM_SSE2 0 +#endif + +/* List of routines to test, NULL-terminated */ +static struct { + const char *name; /* centered in 5 chars */ + int arch_ok; /* defined(ARCH_xxx) */ + int acflags; /* required ac_cpuinfo() flags */ + void *(*func)(void *, const void *, size_t); +} testfuncs[] = { + { "libc ", 1, + 0, memcpy }, + { " mmx ", defined_ARCH_X86 && defined_HAVE_ASM_MMX, + AC_MMX, memcpy_mmx }, + { " sse ", defined_ARCH_X86 && defined_HAVE_ASM_SSE, + AC_CMOVE|AC_SSE, memcpy_sse }, + { "amd64", defined_ARCH_X86_64 && defined_HAVE_ASM_SSE2, + AC_CMOVE|AC_SSE2, memcpy_amd64 }, + { NULL } +}; + +/* Alignments/sizes to test */ +static struct { + int align1, align2; +} tests[] = { + { 0, 0 }, + { 0, 1 }, + { 0, 4 }, + { 0, 8 }, + { 0, 63 }, + { 1, 0 }, + { 1, 1 }, + { 1, 4 }, + { 1, 8 }, + { 1, 63 }, + { 4, 0 }, + { 4, 1 }, + { 8, 0 }, + { 8, 1 }, + { 63, 0 }, + { 63, 1 }, + { 0, 0 }, + { 0, 1 }, + { 0, 4 }, + { 0, 8 }, + { 0, 63 }, + { 1, 0 }, + { 1, 1 }, + { 1, 4 }, + { 1, 8 }, + { 1, 63 }, + { -1, -1 } +}; + +int main(int argc, char *argv[]) +{ + int size = DEF_BLOCKSIZE, testtime = DEF_TESTTIME; + int ch, i; + + while ((ch = getopt(argc, argv, "hs:t:")) != EOF) { + if (ch == 's') { + size = atoi(optarg); + } else if (ch == 't') { + testtime = atoi(optarg); + } else { + usage: + fprintf(stderr, + "Usage: %s [-s blocksize] [-t msec-per-test]\n" + "Defaults: -s %d -t %d\n", + argv[0], DEF_BLOCKSIZE, DEF_TESTTIME); + return 1; + } + } + if (size <= 0 || testtime <= 0) + goto usage; + + for (i = 0; testfuncs[i].name; i++) { + if ((ac_cpuinfo() & testfuncs[i].acflags) != testfuncs[i].acflags) + testfuncs[i].arch_ok = 0; + } + + printf("Size: %d msec/test: %d Table entries in MB/s\n", + size, testtime); + printf("Align "); + for (i = 0; testfuncs[i].name; i++) { + if (testfuncs[i].arch_ok) + printf("|%s", testfuncs[i].name); + } + printf("\n------"); + for (i = 0; testfuncs[i].name; i++) { + if (testfuncs[i].arch_ok) + printf("+-----"); + } + printf("\n"); + + for (i = 0; tests[i].align1 >= 0; i++) { + int j; + printf("%2d/%2d ", tests[i].align1, tests[i].align2); + fflush(stdout); + for (j = 0; testfuncs[j].name; j++) { + if (testfuncs[j].arch_ok) { + uint64_t iterations; + testit(testfuncs[j].func, size, + tests[i].align1, tests[i].align2, testtime, + &iterations); + if (iterations == 0) + printf("|-ERR-"); + else + printf("|%5d", + (int)(iterations*size*1000 / testtime / (1<<20))); + fflush(stdout); + } + } + printf("\n"); + } + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-acmemcpy.c b/debian/transcode/transcode-1.1.7/testsuite/test-acmemcpy.c new file mode 100644 index 00000000..8d3eede2 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-acmemcpy.c @@ -0,0 +1,271 @@ +/*compile-command +set -x +gcc -O3 -g -I. -I.. "$0" -DARCH_X86 +exit $? +*/ + +/* + * test-acmemcpy.c - test accelerated memcpy() implementations to check + * that they work with all alignments and sizes + * Written by Andrew Church <achurch@achurch.org> + * + * This file is part of transcode, a video stream processing tool. + * transcode is free software, distributable under the terms of the GNU + * General Public License (version 2 or later). See the file COPYING + * for details. + */ + +#define _GNU_SOURCE /* for strsignal */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> +#include <setjmp.h> +#include <signal.h> +#include <sys/time.h> +#include <sys/resource.h> + +#include "config.h" + +#define ac_memcpy local_ac_memcpy /* to avoid clash with libac.a */ +#define ac_memcpy_init local_ac_memcpy_init /* to avoid clash with libac.a */ +#include "aclib/ac.h" + +/* Include memcpy.c directly to get access to the particular implementations */ +#include "../aclib/memcpy.c" +#undef ac_memcpy +/* Make sure all names are available, to simplify function table */ +#if !defined(ARCH_X86) || !defined(HAVE_ASM_MMX) +# define memcpy_mmx memcpy +#endif +#if !defined(ARCH_X86) || !defined(HAVE_ASM_SSE) +# define memcpy_sse memcpy +#endif +#if !defined(ARCH_X86_64) || !defined(HAVE_ASM_SSE2) +# define memcpy_amd64 memcpy +#endif + +/* Constant `spill' value for tests */ +static const int SPILL = 8; + +/*************************************************************************/ + +static void *old_SIGSEGV = NULL, *old_SIGILL = NULL; +static sigjmp_buf env; + + +static void sighandler(int sig) +{ + printf("*** %s\n", strsignal(sig)); + siglongjmp(env, 1); +} + +static void set_signals(void) +{ + old_SIGSEGV = signal(SIGSEGV, sighandler); + old_SIGILL = signal(SIGILL , sighandler); +} + +static void clear_signals(void) +{ + signal(SIGSEGV, old_SIGSEGV); + signal(SIGILL , old_SIGILL ); +} + +/*************************************************************************/ + +/* Test the given function with the given data size. Print error + * information if verbose is nonzero. Performs tests on all alignments + * from 0 through block-1, and checks that `spill' bytes on either side of + * the target region are not affected. `block' is assumed to be a power + * of 2. */ + +static int testit(void *(*func)(void *, const void *, size_t), + int size, int block, int spill, int verbose) +{ + char *chunk1, *chunk1_base, *chunk1_copy; + char *chunk2, *chunk2_base, *chunk2_test; + int align1, align2, result; + + chunk1_base = malloc(size + block-1); + chunk1_copy = malloc(size + block-1); + chunk2_base = malloc(size + block-1 + spill*2); + chunk2_test = malloc(size + spill*2); + memset(chunk1_base, 0x11, size + block-1); + memset(chunk1_copy, 0x11, size + block-1); + memset(chunk2_test, 0x22, size + spill*2); + memset(chunk2_test + spill, 0x11, size); + + result = 1; + for (align1 = 0; align1 < block-1; align1++) { + for (align2 = 0; align2 < block-1; align2++) { + chunk1 = chunk1_base + align1; + chunk2 = chunk2_base + spill + align2; + memset(chunk2-spill, 0x22, size+spill*2); + set_signals(); + if (sigsetjmp(env, 1)) { + result = 0; + } else { + (*func)(chunk2, chunk1, size); + result = (memcmp(chunk2-spill, chunk2_test, size+spill*2) == 0 + && memcmp(chunk1_base, chunk1_copy, size+block-1)==0); + } + clear_signals(); + if (!result) { + if (verbose) { + printf("FAILED: size=%d align1=%d align2=%d\n", + size, align1, align2); + } + /* Just in case */ + memset(chunk1_base, 0x11, size+block-1); + } + } + } + + free(chunk1_base); + free(chunk1_copy); + free(chunk2_base); + free(chunk2_test); + return result; +} + +/*************************************************************************/ + +/* Turn presence/absence of #define into a number */ +#if defined(ARCH_X86) +# define defined_ARCH_X86 1 +#else +# define defined_ARCH_X86 0 +#endif +#if defined(ARCH_X86_64) +# define defined_ARCH_X86_64 1 +#else +# define defined_ARCH_X86_64 0 +#endif +#if defined(HAVE_ASM_MMX) +# define defined_HAVE_ASM_MMX 1 +#else +# define defined_HAVE_ASM_MMX 0 +#endif +#if defined(HAVE_ASM_SSE) +# define defined_HAVE_ASM_SSE 1 +#else +# define defined_HAVE_ASM_SSE 0 +#endif +#if defined(HAVE_ASM_SSE2) +# define defined_HAVE_ASM_SSE2 1 +#else +# define defined_HAVE_ASM_SSE2 0 +#endif + +/* List of routines to test, NULL-terminated */ +static struct { + const char *name; + int arch_ok; /* defined(ARCH_xxx), etc. */ + int acflags; /* required ac_cpuinfo() flags */ + void *(*func)(void *, const void *, size_t); +} testfuncs[] = { + { "mmx", defined_ARCH_X86 && defined_HAVE_ASM_MMX, + AC_MMX, memcpy_mmx }, + { "sse", defined_ARCH_X86 && defined_HAVE_ASM_SSE, + AC_CMOVE|AC_SSE, memcpy_sse }, + { "amd64", defined_ARCH_X86_64 && defined_HAVE_ASM_SSE2, + AC_CMOVE|AC_SSE2, memcpy_amd64 }, + { NULL } +}; + +/* List of sizes to test, min==0 terminated */ +static struct { + const char *name; /* Function to limit this test to, or NULL for all */ + int min, max; /* Size range (inclusive) */ + int block; /* Block alignment */ +} testvals[] = { + /* Test all small block sizes, with alignments 0..7 (for amd64's movq) */ + {NULL, 1, 63, 8}, + /* Test up to 2 medium blocks plus small sizes (MMX=64, SSE=8, SSE2=16) */ + {"mmx", 64, 191, 64}, + {"sse", 64, 71, 64}, + {"amd64", 64, 79, 64}, + /* Test large block size plus up to 2 cache lines minus 1 */ + {"sse", 0x10040, 0x100BF, 64}, + {"amd64", 0x38000, 0x3807F, 64}, + /* End of list */ + {NULL,0,0} +}; + +int main(int argc, char *argv[]) +{ + int verbose = 1; + int ch, i, failed; + + while ((ch = getopt(argc, argv, "hqv")) != EOF) { + if (ch == 'q') { + verbose = 0; + } else if (ch == 'v') { + verbose = 2; + } else { + fprintf(stderr, + "Usage: %s [-q | -v]\n" + "-q: quiet (don't print test names)\n" + "-v: verbose (print each block size as processed)\n", + argv[0]); + return 1; + } + } + + failed = 0; + for (i = 0; testfuncs[i].name; i++) { + int j; + int thisfailed = 0; + if (verbose > 0) { + printf("%s: ", testfuncs[i].name); + fflush(stdout); + } + if (!testfuncs[i].arch_ok) { + printf("WARNING: unable to test (wrong architecture or not" + " compiled in)\n"); + continue; + } + if ((ac_cpuinfo() & testfuncs[i].acflags) != testfuncs[i].acflags) { + printf("WARNING: unable to test (no support in CPU)\n"); + continue; + } + for (j = 0; testvals[j].min > 0; j++) { + int size; + if (testvals[j].name + && strcmp(testvals[j].name, testfuncs[i].name) != 0) + continue; + for (size = testvals[j].min; size <= testvals[j].max; size++) { + if (verbose >= 2) { + printf("%-10d\b\b\b\b\b\b\b\b\b\b", size); + fflush(stdout); + } + if (!testit(testfuncs[i].func, size, testvals[j].block, + SPILL, verbose)) + thisfailed = 1; + } /* for each size */ + } /* for each size range */ + if (thisfailed) { + /* FAILED message printed by testit() */ + failed = 1; + } else { + if (verbose > 0) + printf("ok\n"); + } + } /* for each function */ + + return failed ? 1 : 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-average.c b/debian/transcode/transcode-1.1.7/testsuite/test-average.c new file mode 100644 index 00000000..a3a9ffab --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-average.c @@ -0,0 +1,741 @@ +/* + * test-average.c - test all aclib average() implementations + * Written by Andrew Church <achurch@achurch.org> + * + * This file is part of transcode, a video stream processing tool. + * transcode is free software, distributable under the terms of the GNU + * General Public License (version 2 or later). See the file COPYING + * for details. + */ + +#define _GNU_SOURCE /* for strsignal */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> +#include <setjmp.h> +#include <signal.h> +#include <sys/time.h> +#include <sys/resource.h> + +#include "config.h" + +#define ac_average local_ac_average /* to avoid clash with libac.a */ +#define ac_average_init local_ac_average_init +#include "aclib/ac.h" + +/* Include average.c directly for access to the particular implementations */ +#include "../aclib/average.c" +#undef ac_average +/* Make sure all names are available, to simplify function table */ +#if !defined(ARCH_X86) || !defined(HAVE_ASM_MMX) +# define average_mmx average +#endif +#if !defined(ARCH_X86) || !defined(HAVE_ASM_SSE) +# define average_sse average +#endif +#if !defined(HAVE_ASM_SSE2) +# define average_sse2 average +#endif + +/* Constant `spill' value for tests */ +static const int SPILL = 8; + +/*************************************************************************/ + +static void *old_SIGSEGV = NULL, *old_SIGILL = NULL; +static sigjmp_buf env; + + +static void sighandler(int sig) +{ + printf("*** %s\n", strsignal(sig)); + siglongjmp(env, 1); +} + +static void set_signals(void) +{ + old_SIGSEGV = signal(SIGSEGV, sighandler); + old_SIGILL = signal(SIGILL , sighandler); +} + +static void clear_signals(void) +{ + signal(SIGSEGV, old_SIGSEGV); + signal(SIGILL , old_SIGILL ); +} + +/*************************************************************************/ + +/* Test the given function with the given data. Prints error information + * if `verbose' is nonzero. Checks that `spill' bytes on either side of + * the the target region are not affected. */ + +static int testit(void (*func)(const uint8_t *, const uint8_t *, uint8_t *, int), + const uint8_t *data1, const uint8_t *data2, + int size, int spill, int verbose) +{ + const int block = 8; /* FIXME: MMX/SSE assume aligned data */ + uint8_t *result_base, *result; + int failed; + int i; + + result_base = malloc(size + spill*2 + block-1); + result = result_base + spill; + if ((uintptr_t)result % block != 0) { + result += block - ((uintptr_t)result % block); + } + + if (spill > 0) { + memset(result - spill, 0x11, spill); + memset(result + size, 0x11, spill); + } + failed = 0; + set_signals(); + if (sigsetjmp(env, 1)) { + failed = 1; + } else { + (*func)(data1, data2, result, size); + for (i = 0; i < size; i++) { + const uint8_t expect = (data1[i] + data2[i] + 1) / 2; + if (result[i] != expect) { + if (verbose) { + fprintf(stderr, "Bad result at byte %d (expected 0x%02X," + " got 0x%02X)\n", i, expect, result[i]); + } + failed = 1; + break; + } + } + for (i = 0; i < spill; i++) { + if (result[-spill + i] != 0x11) { + if (verbose) { + fprintf(stderr, "Overrun at offset %d\n", -spill + i); + } + failed = 1; + break; + } + if (result[size + i] != 0x11) { + if (verbose) { + fprintf(stderr, "Overrun at offset %d\n", size + i); + } + failed = 1; + break; + } + } + } + clear_signals(); + + return !failed; +} + +/*************************************************************************/ + +/* Turn presence/absence of #define into a number */ +#if defined(ARCH_X86) +# define defined_ARCH_X86 1 +#else +# define defined_ARCH_X86 0 +#endif +#if defined(HAVE_ASM_MMX) +# define defined_HAVE_ASM_MMX 1 +#else +# define defined_HAVE_ASM_MMX 0 +#endif +#if defined(HAVE_ASM_SSE) +# define defined_HAVE_ASM_SSE 1 +#else +# define defined_HAVE_ASM_SSE 0 +#endif +#if defined(HAVE_ASM_SSE2) +# define defined_HAVE_ASM_SSE2 1 +#else +# define defined_HAVE_ASM_SSE2 0 +#endif + +/* List of routines to test, NULL-terminated */ +static struct { + const char *name; + int arch_ok; /* defined(ARCH_xxx), etc. */ + int acflags; /* required ac_cpuinfo() flags */ + void (*func)(const uint8_t *, const uint8_t *, uint8_t *, int); +} testfuncs[] = { + { "mmx", defined_ARCH_X86 && defined_HAVE_ASM_MMX, + AC_MMX, average_mmx }, + { "sse", defined_ARCH_X86 && defined_HAVE_ASM_SSE, + AC_SSE, average_sse }, + { "sse2", defined_HAVE_ASM_SSE2, + AC_SSE2, average_sse2 }, + { NULL } +}; + +/* List of tests, size==0 terminated */ +static struct { + int size; /* Size in bytes */ + const uint8_t *data1, *data2; /* Data for function (NULL: autogenerate) */ +} testvals[] = { + { 1, "\x00", "\x00"}, + { 1, "\x00", "\x01"}, + { 1, "\x00", "\x02"}, + { 1, "\x00", "\x03"}, + { 1, "\x01", "\x00"}, + { 1, "\x01", "\x01"}, + { 1, "\x01", "\x02"}, + { 1, "\x01", "\x03"}, + { 1, "\x02", "\x00"}, + { 1, "\x02", "\x01"}, + { 1, "\x02", "\x02"}, + { 1, "\x02", "\x03"}, + { 1, "\x03", "\x00"}, + { 1, "\x03", "\x01"}, + { 1, "\x03", "\x02"}, + { 1, "\x03", "\x03"}, + { 1, "\x7F", "\x7F"}, + { 1, "\x7F", "\x80"}, + { 1, "\x7F", "\xFE"}, + { 1, "\x7F", "\xFF"}, + { 1, "\x80", "\x7F"}, + { 1, "\x80", "\x80"}, + { 1, "\x80", "\xFE"}, + { 1, "\x80", "\xFF"}, + { 1, "\xFE", "\x7F"}, + { 1, "\xFE", "\x80"}, + { 1, "\xFE", "\xFE"}, + { 1, "\xFE", "\xFF"}, + { 1, "\xFF", "\x7F"}, + { 1, "\xFF", "\x80"}, + { 1, "\xFF", "\xFE"}, + { 1, "\xFF", "\xFF"}, + + { 7, NULL, NULL}, + + { 8,"\x00\x00\x00\x00\x00\x00\x00\x00","\x00\x00\x00\x00\x00\x00\x00\x00"}, + { 8,"\x00\x00\x00\x00\x00\x00\x00\x00","\x01\x01\x01\x01\x01\x01\x01\x01"}, + { 8,"\x00\x00\x00\x00\x00\x00\x00\x00","\x02\x02\x02\x02\x02\x02\x02\x02"}, + { 8,"\x00\x00\x00\x00\x00\x00\x00\x00","\x03\x03\x03\x03\x03\x03\x03\x03"}, + { 8,"\x01\x01\x01\x01\x01\x01\x01\x01","\x00\x00\x00\x00\x00\x00\x00\x00"}, + { 8,"\x01\x01\x01\x01\x01\x01\x01\x01","\x01\x01\x01\x01\x01\x01\x01\x01"}, + { 8,"\x01\x01\x01\x01\x01\x01\x01\x01","\x02\x02\x02\x02\x02\x02\x02\x02"}, + { 8,"\x01\x01\x01\x01\x01\x01\x01\x01","\x03\x03\x03\x03\x03\x03\x03\x03"}, + { 8,"\x02\x02\x02\x02\x02\x02\x02\x02","\x00\x00\x00\x00\x00\x00\x00\x00"}, + { 8,"\x02\x02\x02\x02\x02\x02\x02\x02","\x01\x01\x01\x01\x01\x01\x01\x01"}, + { 8,"\x02\x02\x02\x02\x02\x02\x02\x02","\x02\x02\x02\x02\x02\x02\x02\x02"}, + { 8,"\x02\x02\x02\x02\x02\x02\x02\x02","\x03\x03\x03\x03\x03\x03\x03\x03"}, + { 8,"\x03\x03\x03\x03\x03\x03\x03\x03","\x00\x00\x00\x00\x00\x00\x00\x00"}, + { 8,"\x03\x03\x03\x03\x03\x03\x03\x03","\x01\x01\x01\x01\x01\x01\x01\x01"}, + { 8,"\x03\x03\x03\x03\x03\x03\x03\x03","\x02\x02\x02\x02\x02\x02\x02\x02"}, + { 8,"\x03\x03\x03\x03\x03\x03\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03"}, + { 8,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F","\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + { 8,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F","\x80\x80\x80\x80\x80\x80\x80\x80"}, + { 8,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F","\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + { 8,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F","\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + { 8,"\x80\x80\x80\x80\x80\x80\x80\x80","\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + { 8,"\x80\x80\x80\x80\x80\x80\x80\x80","\x80\x80\x80\x80\x80\x80\x80\x80"}, + { 8,"\x80\x80\x80\x80\x80\x80\x80\x80","\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + { 8,"\x80\x80\x80\x80\x80\x80\x80\x80","\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + { 8,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE","\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + { 8,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE","\x80\x80\x80\x80\x80\x80\x80\x80"}, + { 8,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE","\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + { 8,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE","\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + { 8,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF","\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + { 8,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF","\x80\x80\x80\x80\x80\x80\x80\x80"}, + { 8,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF","\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + { 8,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF","\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + { 8, NULL, NULL}, /* Check that differing bytes in each 8-byte unit are + * handled properly */ + + {15, NULL, NULL}, + + {31, NULL, NULL}, + + {32,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}, + {32,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"}, + {32,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02"}, + {32,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"}, + {32,"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}, + {32,"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"}, + {32,"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02"}, + {32,"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"}, + {32,"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}, + {32,"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"}, + {32,"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02", + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02"}, + {32,"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02", + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"}, + {32,"\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}, + {32,"\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"}, + {32,"\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02"}, + {32,"\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"}, + {32,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F", + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + {32,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F", + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"}, + {32,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F", + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + {32,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F", + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + {32,"\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80", + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + {32,"\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80", + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"}, + {32,"\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80", + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + {32,"\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80", + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + {32,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + {32,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"}, + {32,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + {32,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + {32,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + {32,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"}, + {32,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + {32,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + + {32, NULL, NULL}, + + {63, NULL, NULL}, + + {64,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}, + {64,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"}, + {64,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02"}, + {64,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"}, + {64,"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}, + {64,"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"}, + {64,"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02"}, + {64,"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"}, + {64,"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}, + {64,"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"}, + {64,"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02", + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02"}, + {64,"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02", + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"}, + {64,"\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}, + {64,"\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"}, + {64,"\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" + "\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02"}, + {64,"\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"}, + {64,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F", + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + {64,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F", + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"}, + {64,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F", + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + {64,"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F", + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + {64,"\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80", + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + {64,"\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80", + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"}, + {64,"\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80", + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + {64,"\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80", + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + {64,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + {64,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"}, + {64,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + {64,"\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE", + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + {64,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F" + "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F"}, + {64,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80" + "\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"}, + {64,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE" + "\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE\xFE"}, + {64,"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"}, + + {127, NULL, NULL}, + + /* End of list */ + {0} +}; + +int main(int argc, char *argv[]) +{ + int verbose = 1; + int ch, i, failed; + + while ((ch = getopt(argc, argv, "hqv")) != EOF) { + if (ch == 'q') { + verbose = 0; + } else if (ch == 'v') { + verbose = 2; + } else { + fprintf(stderr, + "Usage: %s [-q | -v]\n" + "-q: quiet (don't print test names)\n" + "-v: verbose (print each block size as processed)\n", + argv[0]); + return 1; + } + } + + failed = 0; + for (i = 0; testfuncs[i].name; i++) { + int j; + int thisfailed = 0; + if (verbose > 0) { + printf("%s: ", testfuncs[i].name); + fflush(stdout); + } + if (!testfuncs[i].arch_ok) { + printf("WARNING: unable to test (wrong architecture or not" + " compiled in)\n"); + continue; + } + if ((ac_cpuinfo() & testfuncs[i].acflags) != testfuncs[i].acflags) { + printf("WARNING: unable to test (no support in CPU)\n"); + continue; + } + for (j = 0; testvals[j].size > 0; j++) { + const int size = testvals[j].size; + if (verbose >= 2) { + printf("%-10d\b\b\b\b\b\b\b\b\b\b", size); + fflush(stdout); + } + uint8_t *data1 = malloc(size), *data2 = malloc(size); + if (testvals[j].data1) { + memcpy(data1, testvals[j].data1, size); + } else { + int k; + for (k = 0; k < size; k++) { + data1[k] = k & 0xFF; + } + } + if (testvals[j].data2) { + memcpy(data2, testvals[j].data2, size); + } else { + int k; + for (k = 0; k < size; k++) { + data2[k] = (k*2+1) & 0xFF; + } + } + if (!testit(testfuncs[i].func, data1, data2, size, SPILL, + verbose) + ) { + thisfailed = 1; + } + free(data1); + free(data2); + } /* for each size */ + if (thisfailed) { + if (verbose > 0) { + fprintf(stderr, "FAILED\n"); + } + failed = 1; + } else { + if (verbose > 0) { + printf("ok\n"); + } + } + } /* for each function */ + + return failed ? 1 : 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-bufalloc.c b/debian/transcode/transcode-1.1.7/testsuite/test-bufalloc.c new file mode 100644 index 00000000..437429f3 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-bufalloc.c @@ -0,0 +1,110 @@ +/* + * test-bufalloc.c -- testsuite for tc_*bufalloc* family (tc_functions.c) + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> + +#include "config.h" +#include "libtc/libtc.h" + +#ifndef PACKAGE +#define PACKAGE __FILE__ +#endif + +#define MY_PAGE_SZ (4096) +#define HOW_MUCH (144000) +#define BIG_SIZE (64*1024*1024) + +static int test_alloc(int size) +{ + int ret = 0; + uint8_t *mem = tc_bufalloc(size); + + if (mem == NULL) { + tc_error("test_alloc(%i): FAILED (mem == NULL)", size); + ret = 1; + } else { + tc_info("test_alloc(%i): PASSED", size); + ret = 1; + } + tc_buffree(mem); + return ret; +} + +static int test_alloc_memset(int size) +{ + int ret = 0; + uint8_t *mem = tc_bufalloc(size); + + if (mem == NULL) { + tc_error("test_alloc_memset(%i): FAILED (mem == NULL)", size); + ret = 1; + } else { + memset(mem, 0, size); + tc_info("test_alloc_memset(%i): PASSED", size); + ret = 1; + } + tc_buffree(mem); + return ret; +} + +int main(void) +{ + test_alloc(0); + test_alloc(1); + test_alloc(MY_PAGE_SZ); + test_alloc(MY_PAGE_SZ-1); + test_alloc(MY_PAGE_SZ+1); + test_alloc(HOW_MUCH); + test_alloc(HOW_MUCH-1); + test_alloc(HOW_MUCH+1); + test_alloc(BIG_SIZE); + test_alloc(BIG_SIZE-1); + test_alloc(BIG_SIZE+1); + + test_alloc_memset(0); + test_alloc_memset(1); + test_alloc_memset(MY_PAGE_SZ); + test_alloc_memset(MY_PAGE_SZ-1); + test_alloc_memset(MY_PAGE_SZ+1); + test_alloc_memset(HOW_MUCH); + test_alloc_memset(HOW_MUCH-1); + test_alloc_memset(HOW_MUCH+1); + test_alloc_memset(BIG_SIZE); + test_alloc_memset(BIG_SIZE-1); + test_alloc_memset(BIG_SIZE+1); + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-cfg-filelist.c b/debian/transcode/transcode-1.1.7/testsuite/test-cfg-filelist.c new file mode 100644 index 00000000..fc348583 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-cfg-filelist.c @@ -0,0 +1,69 @@ +/* + * test-cfg-filelist.c -- testsuite for module_*_config_list family; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2007-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> + +#include "config.h" +#include "libtc/libtc.h" +#include "libtc/cfgfile.h" + + +int main(int argc, char *argv[]) +{ + TCConfigList *list = NULL; + const char *filename = NULL, *section = NULL; + + if (argc != 3) { + fprintf(stderr, "(%s) usage: %s cfgfile section\n", __FILE__, argv[0]); + exit(1); + } + filename = argv[1]; + section = argv[2]; + + libtc_init(NULL, NULL); /* XXX: dirty! */ + tc_set_config_dir(""); /* XXX: dirty? */ + list = module_read_config_list(filename, section, __FILE__); + if (!list) { + fprintf(stderr, "unable to scan '%s'\n", filename); + exit(1); + } else { + module_print_config_list(list, section, "test"); + module_free_config_list(list, 0); + } + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-cfg-filelist.sh b/debian/transcode/transcode-1.1.7/testsuite/test-cfg-filelist.sh new file mode 100755 index 00000000..a2fb573e --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-cfg-filelist.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +# test-cfg-filelist.sh -- frontend for configuration file testsuite. +# autogenerates test data. +# (C) 2007-2010 - Francesco Romani <fromani -at- gmail -dot- com> +# +# This file is part of transcode, a video stream processing tool. +# +# transcode is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# transcode is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +REF="$( tempfile -p tclst -s .cfg )" +NEW="$( tempfile -p tclst -s .cfg )" +PROG="./test-cfg-filelist" +if [ -n "$1" ]; then + PROG="$1" +fi + + +function makelist() { + echo "[$1]" + for F in "$1"/*; do + echo "$F" + done +} + +function testit() { + makelist "$1" >> "$REF" + "$PROG" "$REF" "$1" 2>&1 | sed 's/^\[test\]\ //g' >> "$NEW" + if diff -q "$REF" "$NEW" &> /dev/null ; then + printf "%-24s OK\n" "($1)" + else + printf "%-24s FAILED -> see ($REF|$NEW)\n" "($1)" + return 1 + fi + return 0 +} + +export "TRANSCODE_LOG_NO_COLOR=1" + +DIRS="/usr /boot /usr/bin /usr/lib" +I=0 +J=0 +for DIR in $DIRS; do + if testit $DIR; then + let J=$J+1 + else + break + fi + let I=$I+1 +done +#rm -f "$REF" "$NEW" + +echo "test succesfull/runned = $J/$I" diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-export-profile.c b/debian/transcode/transcode-1.1.7/testsuite/test-export-profile.c new file mode 100644 index 00000000..fb0bb56b --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-export-profile.c @@ -0,0 +1,148 @@ +/* + * test-export-profile.c -- testsuite for new export profiles code; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> + +#include "config.h" +#include "transcode.h" +#include "export_profile.h" +#include "libtc/libtc.h" + +#define VIDEO_LOG_FILE "mpeg4.log" +#define AUDIO_LOG_FILE "pcm.log" + +#define VIDEO_CODEC "yuv420p" +#define AUDIO_CODEC "pcm" + +int verbose = TC_STATS; + +static vob_t vob = { + .verbose = TC_STATS, + + .has_video = 1, + .has_audio = 1, + + /* some sane settings, mostly identical to transcode's ones */ + .fps = PAL_FPS, + .ex_fps = PAL_FPS, + .im_v_width = PAL_W, + .ex_v_width = PAL_W, + .im_v_height= PAL_H, + .ex_v_height= PAL_H, + + .im_v_codec = CODEC_YUV, + .im_a_codec = CODEC_PCM, + .ex_v_codec = CODEC_YUV, + .ex_a_codec = CODEC_PCM, + + .im_frc = 3, + .ex_frc = 3, + + .a_rate = RATE, + .a_chan = CHANNELS, + .a_bits = BITS, + .a_vbr = AVBR, + + .mod_path = MOD_PATH, + + .video_in_file = "/dev/zero", + .audio_in_file = "/dev/zero", + .video_out_file = "/dev/null", + .audio_out_file = "/dev/null", + .audiologfile = AUDIO_LOG_FILE, + + .mp3bitrate = ABITRATE, + .mp3quality = AQUALITY, + .mp3mode = AMODE, + .mp3frequency = RATE, + + .divxlogfile = VIDEO_LOG_FILE, + .divxmultipass = VMULTIPASS, + .divxbitrate = VBITRATE, + .divxkeyframes = VKEYFRAMES, + .divxcrispness = VCRISPNESS, + + .a_leap_frame = TC_LEAP_FRAME, + .a_leap_bytes = 0, + + .export_attributes= TC_EXPORT_ATTRIBUTE_NONE, +}; + +#define PRINT(field,fmt) \ + printf(" %s=" fmt "\n", #field, vob.field); + +#define GET_MODULE(mod) ((mod) != NULL) ?(mod) :"null" + +int main(int argc, char *argv[]) +{ + const TCExportInfo *info = NULL; + char *amod = "null"; + char *vmod = "null"; + char *mmod = "null"; + int ret = 0; + + ret = tc_setup_export_profile(&argc, &argv); + if (ret < 0) { + /* error, so bail out */ + return 1; + } + printf("parsed: %i profiles\n", ret); + + info = tc_load_export_profile(); + amod = GET_MODULE(info->audio.module); + vmod = GET_MODULE(info->video.module); + mmod = GET_MODULE(info->mplex.module); + tc_export_profile_to_vob(info, &vob); + + PRINT(divxbitrate, "%i"); + PRINT(video_max_bitrate, "%i"); + PRINT(mp3bitrate, "%i"); + PRINT(mp3frequency, "%i"); + PRINT(divxkeyframes, "%i"); + PRINT(encode_fields, "%i"); + PRINT(ex_frc, "%i"); + PRINT(ex_v_codec, "%x"); + PRINT(ex_a_codec, "%x"); + PRINT(zoom_width, "%i"); + PRINT(zoom_height, "%i"); + + printf("video module=%s\n", vmod); + printf("audio module=%s\n", amod); + printf("mplex module=%s\n", mmod); + + tc_cleanup_export_profile(); + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-framealloc.c b/debian/transcode/transcode-1.1.7/testsuite/test-framealloc.c new file mode 100644 index 00000000..2383803c --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-framealloc.c @@ -0,0 +1,209 @@ +/* + * test-framealloc.c -- testsuite for frame allocation functions. + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> + +#include "config.h" +#include "libtc/libtc.h" +#include "libtc/tcframes.h" +#include "src/tc_defaults.h" +#include "src/framebuffer.h" + +#ifndef PACKAGE +#define PACKAGE __FILE__ +#endif + +static int format[] = { CODEC_RGB, CODEC_YUV422, CODEC_YUV }; /* old breed */ +static const char *strfmt[] = { "rgb24", "yuv422p", "yuv420p" }; + +static int test_alloc_vid(int w, int h, int fmtid, int part) +{ + int ret = 0; + int fmt = format[fmtid]; + vframe_list_t *vptr = tc_new_video_frame(w, h, fmt, part); + + if (vptr != NULL && vptr->video_size >= (w * h * 3 / 2)) { + ret = 1; + } + tc_del_video_frame(vptr); + + if (ret) { + tc_info("testing frame (simple): width=%i height=%i format=%s partial=%s -> OK", + w, h, strfmt[fmtid], (part) ?"yes" :"no"); + } else { + tc_warn("testing frame (simple): width=%i height=%i format=%s partial=%s -> FAILED", + w, h, strfmt[fmtid], (part) ?"yes" :"no"); + } + return ret; +} + +static int test_alloc_aud(double rate, double fps, int chans, int bits) +{ + int ret = 0; + aframe_list_t *aptr = tc_new_audio_frame(rate/fps, chans, bits); + + if (aptr != NULL) { + int as = ((rate/fps) * chans * bits/8); + if (aptr->audio_size >= as - 2) { + ret = 1; + } + } + tc_del_audio_frame(aptr); + + if (ret) { + tc_info("testing frame (simple): samples=%.0f/%.3f channels=%i bits=%i -> OK", + rate, fps, chans, bits); + } else { + tc_warn("testing frame (simple): samples=%.0f/%.3f channels=%i bits=%i -> FAILED", + rate, fps, chans, bits); + } + return ret; +} + + +static int test_alloc_memset_vid(int w, int h, int fmtid, int part) +{ + int ret = 0; + int fmt = format[fmtid]; + vframe_list_t *vptr = tc_new_video_frame(w, h, fmt, part); + + if (vptr != NULL && vptr->video_size >= (w * h * 3 / 2)) { + memset(vptr->video_buf, 'A', vptr->video_size); + if (!part) { + memset(vptr->video_buf2, 'B', vptr->video_size); + } + ret = 1; + } + tc_del_video_frame(vptr); + + if (ret) { + tc_info("testing frame (memset): width=%i height=%i format=%s partial=%s -> OK", + w, h, strfmt[fmtid], (part) ?"yes" :"no"); + } else { + tc_warn("testing frame (memset): width=%i height=%i format=%s partial=%s -> FAILED", + w, h, strfmt[fmtid], (part) ?"yes" :"no"); + } + return ret; +} + +static int test_alloc_memset_aud(double rate, double fps, int chans, int bits) +{ + int ret = 0; + aframe_list_t *aptr = tc_new_audio_frame(rate/fps, chans, bits); + + if (aptr != NULL) { + int as = ((rate/fps) * chans * bits/8); + if (aptr->audio_size >= as - 2) { + memset(aptr->audio_buf, 'A', aptr->audio_size); + ret = 1; + } + } + tc_del_audio_frame(aptr); + + if (ret) { + tc_info("testing frame (memset): samples=%.0f/%.3f channels=%i bits=%i -> OK", + rate, fps, chans, bits); + } else { + tc_warn("testing frame (memset): samples=%.0f/%.3f channels=%i bits=%i -> FAILED", + rate, fps, chans, bits); + } + return ret; +} + + +#define LEN(a) (sizeof(a)/sizeof((a)[0])) + +int main(void) +{ + int width[] = { 128, 320, 576, 640, 960, 1024, 1280, 2048 }; + int height[] = { 96, 240, 240, 480, 560, 768, 800, 1536 }; + int w, h, f; + + double fps[] = { 24000.0/1001.0, 24000.0/1000.0, 25000.0/1000.0, + 30000.0/1001.0, 30000.0/1000.0, 50000.0/1000.0 }; + double rate[] = { 16000.0, 22500.0, 24000.0, 32000.0, 44100.0, 48000.0 }; + int channels[] = { 1, 2 }; + int bits[] = { 8, 16 }; + int F, r, c, b; + + int runned = 0, succesfull = 0; + + for (f = 0; f < LEN(format); f++) { + for (w = 0; w < LEN(width); w++) { + for (h = 0; h < LEN(height); h++) { + succesfull += test_alloc_vid(width[w], height[h], f, 0); + succesfull += test_alloc_vid(width[w], height[h], f, 1); + runned += 2; + } + } + } + + for (F = 0; F < LEN(fps); F++) { + for (r = 0; r < LEN(rate); r++) { + for (c = 0; c < LEN(channels); c++) { + for (b = 0; b < LEN(bits); b++) { + succesfull += test_alloc_aud(rate[r], fps[F], channels[c], bits[b]); + runned++; + } + } + } + } + + for (f = 0; f < LEN(format); f++) { + for (w = 0; w < LEN(width); w++) { + for (h = 0; h < LEN(height); h++) { + succesfull += test_alloc_memset_vid(width[w], height[h], f, 0); + succesfull += test_alloc_memset_vid(width[w], height[h], f, 1); + runned += 2; + } + } + } + + for (F = 0; F < LEN(fps); F++) { + for (r = 0; r < LEN(rate); r++) { + for (c = 0; c < LEN(channels); c++) { + for (b = 0; b < LEN(bits); b++) { + succesfull += test_alloc_memset_aud(rate[r], fps[F], channels[c], bits[b]); + runned++; + } + } + } + } + + tc_info("test summary: %i tests runned, %i succesfully", + runned, succesfull); + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-framecode.c b/debian/transcode/transcode-1.1.7/testsuite/test-framecode.c new file mode 100644 index 00000000..557e43c6 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-framecode.c @@ -0,0 +1,524 @@ +/* + * test-framecode.c -- test tclib framecode handling + * Written by Andrew Church <achurch@achurch.org> + * + * This file is part of transcode, a video stream processing tool. + * transcode is free software, distributable under the terms of the GNU + * General Public License (version 2 or later). See the file COPYING + * for details. + */ + +/* We define our own dummy free() for testing, so avoid string.h declaring + * it over us */ +#define free string_h_free +#include <string.h> +#undef free + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <errno.h> +#include <limits.h> +#include <math.h> + +#include "libtc/framecode.h" + +/* Global verbosity level (0: silent, 1: test list, 2: debug info) */ +static int verbose = 1; + +/*************************************************************************/ + +/* Fake free() function, to enable testing of free_fc_time(). */ + +#define FREED_POINTER ((struct fc_time *)1) + +void free(void *fct); /* prototype, to avoid warnings */ +void free(void *fct) +{ + ((struct fc_time *)fct)->next = FREED_POINTER; +} + +/*************************************************************************/ + +/* Helper routines for test_new_fc_time_from_string() to extract an integer + * or a framecode from a string and advance the string pointer. Both + * routines return nonzero on success, zero on failure. */ + +static int get_uint(char **sptr, unsigned int *valptr) +{ + char *s = *sptr; + unsigned long lval; + + if (*s < '0' || *s > '9') + return 0; + errno = 0; + lval = strtoul(s, sptr, 10); + if (errno == ERANGE +#if ULONG_MAX > UINT_MAX + || lval > UINT_MAX +#endif + ) { + return 0; + } + *valptr = (unsigned int)lval; + return 1; +} + +static int get_fc(char **sptr, unsigned int *frameptr, double fps) +{ + char *s = *sptr; + unsigned int frame, temp; + int is_time = 0; + + if (!get_uint(&s, &frame)) + return 0; + if (*s == ':') { + is_time = 1; + s++; + if (!get_uint(&s, &temp)) + return 0; + frame = frame*60 + temp; + if (*s == ':') { + s++; + if (!get_uint(&s, &temp)) + return 0; + frame = frame*60 + temp; + } + } + if (*s == '.' || is_time) { + frame = (unsigned int)floor(frame * fps); + } + if (*s == '.') { + s++; + if (!get_uint(&s, &temp)) + return 0; + frame += temp; + } + *sptr = s; + *frameptr = frame; + return 1; +} + +/*************************************************************************/ +/*************************************************************************/ + +/* Check that new_fc_time properly clears the fields of the allocated + * fc_time structure. */ + +static int test_new_fc_time(void) +{ + struct fc_time *fct; + + fct = new_fc_time(); + return fct->next == NULL + && fct->fps == 0.0 + && fct->stepf == 0 + && fct->vob_offset == 0 + && fct->sh == 0 + && fct->sm == 0 + && fct->ss == 0 + && fct->sf == 0 + && fct->stf == 0 + && fct->eh == 0 + && fct->em == 0 + && fct->es == 0 + && fct->ef == 0 + && fct->etf == 0; +} + +/*************************************************************************/ + +/* Check that free_fc_time() properly frees all elements in a list. */ + +static int test_free_fc_time(void) +{ + struct fc_time fct1, fct2, fct3; + + fct1.next = &fct2; + fct2.next = &fct3; + fct3.next = NULL; + free_fc_time(&fct1); + return fct1.next == FREED_POINTER + && fct2.next == FREED_POINTER + && fct3.next == FREED_POINTER; +} + +/*************************************************************************/ + +/* Check that set_fc_time with the given parameters sets the fields of the + * fc_time structure properly. */ + +static int test_set_fc_time(int start, int end, double fps) +{ + struct fc_time fct; + + fct.next = NULL; + fct.fps = fps; + fct.stepf = 0; + fct.vob_offset = 0; + fct.sh = fct.sm = fct.ss = fct.sf = fct.stf = ~0; + fct.eh = fct.em = fct.es = fct.ef = fct.etf = ~0; + set_fc_time(&fct, start, end); + if (verbose >= 2) { + printf("[%d->%u:%u:%u.%u|%u - %d->%u:%u:%u.%u|%u @ %.1f] ", + start, fct.sh, fct.sm, fct.ss, fct.sf, fct.stf, + end, fct.eh, fct.em, fct.es, fct.ef, fct.etf, + fps); + } + return fct.sh == (int)floor(start/fps) / 3600 + && fct.sm == (int)floor(start/fps) / 60 % 60 + && fct.ss == (int)floor(start/fps) % 60 + && fct.sf == floor(start - ((int)floor(start/fps))*fps) + && fct.stf == start + && fct.eh == (int)floor(end/fps) / 3600 + && fct.em == (int)floor(end/fps) / 60 % 60 + && fct.es == (int)floor(end/fps) % 60 + && fct.ef == floor(end - ((int)floor(end/fps))*fps) + && fct.etf == end; +} + +/*************************************************************************/ + +/* Check that fc_time_contains properly determines whether a given frame + * number is contained in a list of up to three fc_time structures. When + * testing with less than three fc_time structures, use -1 for the start + * and end values as follows: + * Two structures -> test(frame, fps, start1, end1, start2, end2, -1, -1) + * One structure -> test(frame, fps, start1, end1, -1, -1, -1, -1) + * Assumes that set_fc_time() works correctly. */ + +static int test_fc_time_contains(int frame, double fps, + int start1, int end1, + int start2, int end2, + int start3, int end3) +{ + struct fc_time fct1, fct2, fct3; + int expected; /* Do we expect it to be found or not? */ + int result; /* What we actually got out of the function */ + + fct1.next = NULL; + fct1.fps = fps; + fct1.stepf = 0; + fct1.vob_offset = 0; + fct2.next = NULL; + fct2.fps = fps; + fct2.stepf = 0; + fct2.vob_offset = 0; + fct3.next = NULL; + fct3.fps = fps; + fct3.stepf = 0; + fct3.vob_offset = 0; + + set_fc_time(&fct1, start1, end1); + expected = (frame >= start1 && frame < end1); + if (start2 >= 0 && end2 >= 0) { + fct1.next = &fct2; + set_fc_time(&fct2, start2, end2); + expected |= (frame >= start2 && frame < end2); + if (start3 >= 0 && end3 >= 0) { + fct2.next = &fct3; + set_fc_time(&fct3, start3, end3); + expected |= (frame >= start3 && frame < end3); + } + } + + result = fc_time_contains(&fct1, frame); + return (expected && result) || (!expected && !result); +} + +/*************************************************************************/ + +/* Check that new_fc_time_from_string() properly parses the given string. + * Assumes that new_fc_time() and set_fc_time() work correctly. */ + +static int test_new_fc_time_from_string(const char *string, + const char *separator, + double fps) +{ + struct fc_time *fctret, *fctexpect, *tail, *fct; + char strsave[1000], *s; + + if (strlen(string) > sizeof(strsave)-1) { + fprintf(stderr, "*** test_new_fc_time_from_string(): string too long" + " (max %u chars)\n", (unsigned int)sizeof(strsave)-1); + return 0; + } + + /* Call the function itself */ + fctret = new_fc_time_from_string(string, separator, fps, + verbose>=2 ? 1 : -1); + + /* Figure out what we're supposed to get; if we're supposed to get an + * error, return success or failure at that point */ + fctexpect = tail = NULL; + snprintf(strsave, sizeof(strsave), "%s", string); + for (s = strtok(strsave,separator); s; s = strtok(NULL,separator)) { + unsigned int start = 0, end = 0, stepf = 1; + if (!get_fc(&s, &start, fps) + || *s++ != '-' + || !get_fc(&s, &end, fps) + ) { + return fctret == NULL; + } + if (*s == '/') { + s++; + if (!get_uint(&s, &stepf)) + return fctret == NULL; + } + if (*s) + return fctret == NULL; + fct = new_fc_time(); + if (!fct) { + fprintf(stderr, "*** Out of memory\n"); + exit(-1); + } + fct->fps = fps; + fct->stepf = stepf; + set_fc_time(fct, start, end); + if (!fctexpect) { + fctexpect = fct; + } else { + tail->next = fct; + } + tail = fct; + } + + /* Compare the returned list against the expected one */ + for (fct = fctexpect; fct; fct = fct->next) { + if (verbose >= 2) { + printf("\n[[%u:%u:%u.%u|%u - %u:%u:%u.%u|%u / %u @ %.1f]]" + "\n<<%u:%u:%u.%u|%u - %u:%u:%u.%u|%u / %u @ (%d)>>\n", + fct->sh, fct->sm, fct->ss, fct->sf, fct->stf, + fct->eh, fct->em, fct->es, fct->ef, fct->etf, + fct->stepf, fct->fps, + fctret->sh, fctret->sm, fctret->ss, fctret->sf, fctret->stf, + fctret->eh, fctret->em, fctret->es, fctret->ef, fctret->etf, + fctret->stepf, (fctret->fps == fct->fps)); + } + if (!fctret + || fctret->fps != fct->fps + || fctret->stepf != fct->stepf + || fctret->sh != fct->sh + || fctret->sm != fct->sm + || fctret->ss != fct->ss + || fctret->sf != fct->sf + || fctret->stf != fct->stf + || fctret->eh != fct->eh + || fctret->em != fct->em + || fctret->es != fct->es + || fctret->ef != fct->ef + || fctret->etf != fct->etf + ) { + return 0; + } + fctret = fctret->next; + } + + /* Everything succeeded */ + return 1; +} + +/*************************************************************************/ +/*************************************************************************/ + +/* Helper macro to print a test name and result status, and set the + * `failed' variable to nonzero if the test failed. Usage: + * DO_TEST("name", test_function(param1,param2)); + * The test function is assumed to return a true value for success, a + * false value for failure (the return type does not matter). + */ +#define DO_TEST(name,test) do { \ + if (verbose > 0) { \ + printf("%s... ", (name)); \ + fflush(stdout); \ + } \ + if (test) { \ + if (verbose > 0) \ + printf("ok\n"); \ + } else { \ + if (verbose > 0) \ + printf("FAILED\n"); \ + failed = 1; \ + } \ +} while (0) + +/* Shorthand for test_new_fc_time_from_string() */ +#define DO_TEST_FC_STRING(str) \ + DO_TEST("new_fc_time_from_string(" str ")", \ + test_new_fc_time_from_string(str, ",", 10.0)) + +/*************************************************************************/ + +/* Main program. */ + +int main(int argc, char *argv[]) +{ + int failed = 0; + int opt; + + /* Option processing */ + while ((opt = getopt(argc, argv, "hqv")) != EOF) { + if (opt == 'q') { + verbose = 0; + } else if (opt == 'v') { + verbose = 2; + } else { + fprintf(stderr, + "Usage: %s [-q | -v]\n" + "-q: quiet (don't print list of tests)\n" + "-v: verbose (print debugging info)\n", argv[0]); + return 1; + } + } + + /* Check that new_fc_time properly clears fields. */ + DO_TEST("new_fc_time", test_new_fc_time()); + + /* Check that free_fc_time properly frees a multi-struct list. */ + DO_TEST("free_fc_time", test_free_fc_time()); + + /* Check set_fc_time() using various frame ranges and fps. + * First check simple frame counts within the first second; then + * move on to values that require splitting between H/M/S/F; and + * finally check that rounding of fractional frames (downward) is + * performed correctly. */ + DO_TEST("set_fc_time(0-1/10)", test_set_fc_time(0, 1, 10)); + DO_TEST("set_fc_time(1-2/10)", test_set_fc_time(1, 2, 10)); + DO_TEST("set_fc_time(0-10/10)", test_set_fc_time(0, 10, 10)); + DO_TEST("set_fc_time(10-20/10)", test_set_fc_time(10, 20, 10)); + DO_TEST("set_fc_time(0-600/10)", test_set_fc_time(0, 600, 10)); + DO_TEST("set_fc_time(600-1200/10)", test_set_fc_time(600, 1200, 10)); + DO_TEST("set_fc_time(0-36000/10)", test_set_fc_time(0, 36000, 10)); + DO_TEST("set_fc_time(36000-72000/10)", test_set_fc_time(36000,72000,10)); + DO_TEST("set_fc_time(0-37234/10)", test_set_fc_time(0, 37234, 10)); + DO_TEST("set_fc_time(37234-74468/10)", test_set_fc_time(37234,74468,10)); + DO_TEST("set_fc_time(0-10/8.8)", test_set_fc_time(0, 10, 8.8)); + DO_TEST("set_fc_time(10-20/8.8)", test_set_fc_time(10, 20, 8.8)); + DO_TEST("set_fc_time(0-10/8.2)", test_set_fc_time(0, 10, 8.2)); + DO_TEST("set_fc_time(10-20/8.2)", test_set_fc_time(10, 20, 8.2)); + + /* Everything from here on down depends on set_fc_time() (and on + * new_fc_time() in the case of new_fc_time_from_string()), so abort + * now if we've failed somewhere. */ + if (failed) { + fprintf(stderr, "*** Aborting due to test failures.\n"); + return 1; + } + + /* Test various cases with fc_time_contains(): + * A: 1 less than the starting frame in a large range + * B: Equal to the starting frame in a large range + * C: Midway between the starting and ending frames in a large range + * D: 1 less than the ending frame in a large range + * E: Equal to the ending frame in a large range + * F: 1 less than the only frame in a 1-frame range + * G: Equal to the only frame in a 1-frame range + * H: 1 more than the only frame in a 1-frame range + * for various types of lists: + * 1: Only one fc_time in the list (first structure) + * 2: The second of a list of 2 fc_times (last structure) + * 3: The second of a list of 3 fc_times (middle structure) + */ + DO_TEST("fc_time_contains(1A)", + test_fc_time_contains( 9, 10.0, 10, 20, -1, -1, -1, -1)); + DO_TEST("fc_time_contains(1B)", + test_fc_time_contains(10, 10.0, 10, 20, -1, -1, -1, -1)); + DO_TEST("fc_time_contains(1C)", + test_fc_time_contains(15, 10.0, 10, 20, -1, -1, -1, -1)); + DO_TEST("fc_time_contains(1D)", + test_fc_time_contains(19, 10.0, 10, 20, -1, -1, -1, -1)); + DO_TEST("fc_time_contains(1E)", + test_fc_time_contains(20, 10.0, 10, 20, -1, -1, -1, -1)); + DO_TEST("fc_time_contains(1F)", + test_fc_time_contains( 9, 10.0, 10, 11, -1, -1, -1, -1)); + DO_TEST("fc_time_contains(1G)", + test_fc_time_contains(10, 10.0, 10, 11, -1, -1, -1, -1)); + DO_TEST("fc_time_contains(1H)", + test_fc_time_contains(11, 10.0, 10, 11, -1, -1, -1, -1)); + DO_TEST("fc_time_contains(2A)", + test_fc_time_contains( 9, 10.0, 1, 2, 10, 20, -1, -1)); + DO_TEST("fc_time_contains(2B)", + test_fc_time_contains(10, 10.0, 1, 2, 10, 20, -1, -1)); + DO_TEST("fc_time_contains(2C)", + test_fc_time_contains(15, 10.0, 1, 2, 10, 20, -1, -1)); + DO_TEST("fc_time_contains(2D)", + test_fc_time_contains(19, 10.0, 1, 2, 10, 20, -1, -1)); + DO_TEST("fc_time_contains(2E)", + test_fc_time_contains(20, 10.0, 1, 2, 10, 20, -1, -1)); + DO_TEST("fc_time_contains(2F)", + test_fc_time_contains( 9, 10.0, 1, 2, 10, 11, -1, -1)); + DO_TEST("fc_time_contains(2G)", + test_fc_time_contains(10, 10.0, 1, 2, 10, 11, -1, -1)); + DO_TEST("fc_time_contains(2H)", + test_fc_time_contains(11, 10.0, 1, 2, 10, 11, -1, -1)); + DO_TEST("fc_time_contains(3A)", + test_fc_time_contains( 9, 10.0, 1, 2, 10, 20, 30, 40)); + DO_TEST("fc_time_contains(3B)", + test_fc_time_contains(10, 10.0, 1, 2, 10, 20, 30, 40)); + DO_TEST("fc_time_contains(3C)", + test_fc_time_contains(15, 10.0, 1, 2, 10, 20, 30, 40)); + DO_TEST("fc_time_contains(3D)", + test_fc_time_contains(19, 10.0, 1, 2, 10, 20, 30, 40)); + DO_TEST("fc_time_contains(3E)", + test_fc_time_contains(20, 10.0, 1, 2, 10, 20, 30, 40)); + DO_TEST("fc_time_contains(3F)", + test_fc_time_contains( 9, 10.0, 1, 2, 10, 11, 30, 40)); + DO_TEST("fc_time_contains(3G)", + test_fc_time_contains(10, 10.0, 1, 2, 10, 11, 30, 40)); + DO_TEST("fc_time_contains(3H)", + test_fc_time_contains(11, 10.0, 1, 2, 10, 11, 30, 40)); + + /* See whether new_fc_time_from_string() works with a simple string */ + DO_TEST_FC_STRING("10-20"); + DO_TEST_FC_STRING("10-20/3"); + /* Try some invalid variations */ + DO_TEST_FC_STRING("10-"); + DO_TEST_FC_STRING("-20"); + DO_TEST_FC_STRING("10-20/"); + DO_TEST_FC_STRING("a-20"); + DO_TEST_FC_STRING("10-b"); + DO_TEST_FC_STRING("10a-20"); + DO_TEST_FC_STRING("10-20b"); + DO_TEST_FC_STRING("10-20/c"); + DO_TEST_FC_STRING("10-20/30c"); + /* Try with multiple entries */ + DO_TEST_FC_STRING("10-20,30-40"); + DO_TEST_FC_STRING(",10-20,,30-40,"); // extra commas should be ignored + DO_TEST_FC_STRING("10-20,30-40/5,60-70"); + DO_TEST_FC_STRING("10-20,30-40b,50-60"); + /* Try timecodes instead of frames */ + DO_TEST_FC_STRING("1.0-20"); + DO_TEST_FC_STRING("10-2.0"); + DO_TEST_FC_STRING("1:1-2000"); + DO_TEST_FC_STRING("1-2:2"); + DO_TEST_FC_STRING("1:08-2000"); // make sure it doesn't try to parse octal + DO_TEST_FC_STRING("10-2:08"); + DO_TEST_FC_STRING("1:1:1-200000"); + DO_TEST_FC_STRING("10-2:2:2"); + DO_TEST_FC_STRING("1:1:1.1-200000"); + DO_TEST_FC_STRING("10-2:2:2.2"); + DO_TEST_FC_STRING("1:1:1.1-200000/3"); + DO_TEST_FC_STRING("10-2:2:2.2/3"); + /* Test invalid timecodes as well */ + DO_TEST_FC_STRING("1:1:1:1-200000"); + DO_TEST_FC_STRING("10-2:2:2:2"); + DO_TEST_FC_STRING("1.1.1-200000"); + DO_TEST_FC_STRING("10-2.2.2"); + DO_TEST_FC_STRING("1:1:1.1.1-200000"); + DO_TEST_FC_STRING("10-2:2:2.2.2"); + + /* All done, exit with appropriate status */ + return failed ? 1 : 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-imgconvert.c b/debian/transcode/transcode-1.1.7/testsuite/test-imgconvert.c new file mode 100644 index 00000000..c63e7fa0 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-imgconvert.c @@ -0,0 +1,453 @@ +/* + * test-imgconvert.c - test/time image conversion routines + * Written by Andrew Church <achurch@achurch.org> + * + * This file is part of transcode, a video stream processing tool. + * transcode is free software, distributable under the terms of the GNU + * General Public License (version 2 or later). See the file COPYING + * for details. + */ + +#define WIDTH 768 /* Maximum/default width */ +#define HEIGHT 512 /* Maximum/default height */ +#define ITERATIONS 50 /* Minimum # of iterations */ +#define MINTIME 100 /* Minimum msec to iterate */ + +/*************************************************************************/ + +#define _GNU_SOURCE + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <setjmp.h> +#include <signal.h> +#include <sys/time.h> +#include <sys/resource.h> + +#include "config.h" +#include "aclib/ac.h" +#include "aclib/imgconvert.h" + +static void *old_SIGSEGV, *old_SIGILL; +static int sigsave; +static sigjmp_buf env; + +/* Order of formats to test, with name strings */ +static struct { + ImageFormat fmt; + const char *name; + int width_unit, height_unit; /* minimum meaningful unit in X and Y */ + int disabled; +} fmtlist[] = { + { IMG_YUV420P, "420P", 2, 2 }, + { IMG_YV12, "YV12", 2, 2, 1 }, /* disabled by default */ + { IMG_YUV411P, "411P", 4, 1 }, + { IMG_YUV422P, "422P", 2, 1 }, + { IMG_YUV444P, "444P", 1, 1 }, + { IMG_YUY2, "YUY2", 2, 1 }, + { IMG_UYVY, "UYVY", 2, 1 }, + { IMG_YVYU, "YVYU", 2, 1 }, + { IMG_Y8, " Y8 ", 1, 1 }, + { IMG_RGB24, "RGB ", 1, 1 }, + { IMG_BGR24, "BGR ", 1, 1 }, + { IMG_RGBA32, "RGBA", 1, 1 }, + { IMG_ABGR32, "ABGR", 1, 1 }, + { IMG_ARGB32, "ARGB", 1, 1 }, + { IMG_BGRA32, "BGRA", 1, 1 }, + { IMG_GRAY8, "GRAY", 1, 1 }, + { IMG_NONE, NULL } +}; + +/*************************************************************************/ + +static void sighandler(int sig) +{ + sigsave = sig; + siglongjmp(env, 1); +} + +static void set_signals(void) +{ + old_SIGSEGV = signal(SIGSEGV, sighandler); + old_SIGILL = signal(SIGILL , sighandler); +} + +static void clear_signals(void) +{ + signal(SIGSEGV, old_SIGSEGV); + signal(SIGILL , old_SIGILL ); +} + +/* Return value: >=0 is time/iteration in usec, <0 is error + * -1: unknown error + * -2: ac_init(0) failed + * -3: ac_init(accel) failed + * -4: ac_imgconvert(0) failed + * -5: ac_imgconvert(accel) failed + * -6: compare failed + * -7: SIGSEGV + * -8: SIGILL + * If `check' is nonzero, just checks for accuracy and returns error or 0. + */ +static int testit(uint8_t *srcimage, ImageFormat srcfmt, ImageFormat destfmt, + int width, int height, int accel, int verbose, int check) +{ + static __attribute__((aligned(16))) uint8_t srcbuf[WIDTH*HEIGHT*4], + destbuf[WIDTH*HEIGHT*4], cmpbuf[WIDTH*HEIGHT*4]; + uint8_t *src[3], *dest[3]; + long long tdiff; + unsigned long long start, stop; + struct rusage ru; + int i, icnt; + + memset(cmpbuf, 0, sizeof(cmpbuf)); + memset(destbuf, 0, sizeof(destbuf)); + + sigsave = 0; + set_signals(); + if (sigsetjmp(env, 1)) { + clear_signals(); + return sigsave==SIGILL ? -8 : -7; + } + + if (!ac_init(0)) + return -2; + ac_memcpy(srcbuf, srcimage, sizeof(srcbuf)); + src[0] = srcbuf; + if (IS_YUV_FORMAT(srcfmt)) + YUV_INIT_PLANES(src, srcbuf, srcfmt, width, height); + dest[0] = cmpbuf; + if (IS_YUV_FORMAT(destfmt)) + YUV_INIT_PLANES(dest, cmpbuf, destfmt, width, height); + if (!ac_imgconvert(src, srcfmt, dest, destfmt, width, height)) + return -4; + + if (!ac_init(accel)) + return -3; + // currently src can get destroyed--see img_yuv_mixed.c + ac_memcpy(srcbuf, srcimage, sizeof(srcbuf)); + dest[0] = destbuf; + if (IS_YUV_FORMAT(destfmt)) + YUV_INIT_PLANES(dest, destbuf, destfmt, width, height); + if (!ac_imgconvert(src, srcfmt, dest, destfmt, width, height)) + return -5; + + tdiff = 0; + for (i = 0; i < sizeof(destbuf); i++) { + int diff = (int)destbuf[i] - (int)cmpbuf[i]; + if (diff < -1 || diff > 1) { + if (verbose) { + fprintf(stderr, "*** compare error: at %d (want=%d have=%d)\n", + i, cmpbuf[i], destbuf[i]); + } + return -6; + } + tdiff += diff*diff; + } + if (tdiff >= width*height/2) { + if (verbose) { + fprintf(stderr, + "*** compare error: total difference too great (%lld)\n", + tdiff); + } + return -6; + } + + if (check) + return 0; + + getrusage(RUSAGE_SELF, &ru); + start = ru.ru_utime.tv_sec * 1000000ULL + ru.ru_utime.tv_usec; + icnt = 0; + do { + for (i = 0; i < ITERATIONS; i++) + ac_imgconvert(src, srcfmt, dest, destfmt, width, height); + getrusage(RUSAGE_SELF, &ru); + stop = ru.ru_utime.tv_sec * 1000000ULL + ru.ru_utime.tv_usec; + icnt += ITERATIONS; + } while (stop-start < MINTIME*1000); + + clear_signals(); + return (stop-start + icnt/2) / icnt; +} + +/*************************************************************************/ + +/* Check all routines, and return 1 (no failures) or 0 (some failures) */ + +#define TRYIT(w,h) \ + if (testit(srcimage, fmtlist[i].fmt, fmtlist[j].fmt, \ + (w), (h), accel, 1, 1) < -5 \ + ) { \ + printf("FAILED: %s -> %s @ %dx%d\n", \ + fmtlist[i].name, fmtlist[j].name, (w), (h)); \ + failures++; \ + } + +static int checkall(uint8_t *srcimage, int accel, const char *name) +{ + int i, j; + int failures = 0; + + for (i = 0; fmtlist[i].fmt != IMG_NONE; i++) { + for (j = 0; fmtlist[j].fmt != IMG_NONE; j++) { + int oldfail = failures; + int width_unit = fmtlist[i].width_unit; + int height_unit = fmtlist[i].height_unit; + if (fmtlist[j].width_unit > width_unit) + width_unit = fmtlist[j].width_unit; + if (fmtlist[j].height_unit > height_unit) + height_unit = fmtlist[j].height_unit; + if (name) { + printf("%s/%s-%s...", name, fmtlist[i].name, fmtlist[j].name); + fflush(stdout); + } + TRYIT(WIDTH, HEIGHT); + TRYIT(WIDTH-width_unit, HEIGHT); + TRYIT(WIDTH, HEIGHT-height_unit); + TRYIT(WIDTH-width_unit, HEIGHT-height_unit); + if (name && failures == oldfail) + printf("ok\n"); + } + } + if (failures) { + if (name) + printf("%s: %d conversions failed.\n", name, failures); + return 0; + } else { + if (name) + printf("%s: All conversions succeeded.\n", name); + return 1; + } +} + +/*************************************************************************/ + +static const char *accel_flags(int accel) +{ + static char buf[1000]; + snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s%s", + !accel ? " none" : "", + (accel & AC_IA32ASM ) ? " ia32asm" : "", + (accel & AC_AMD64ASM) ? " amd64asm" : "", + (accel & AC_CMOVE ) ? " cmove" : "", + (accel & AC_MMX ) ? " mmx" : "", + (accel & AC_MMXEXT ) ? " mmxext" : "", + (accel & AC_3DNOW ) ? " 3dnow" : "", + (accel & AC_SSE ) ? " sse" : "", + (accel & AC_SSE2 ) ? " sse2" : "", + (accel & AC_SSE3 ) ? " sse3" : ""); + return buf; +} + + +int main(int argc, char **argv) +{ + static uint8_t srcbuf[WIDTH*HEIGHT*4]; + int check = 0, accel = 0, compare = 0, verbose = 0, width = WIDTH, + height = HEIGHT; + int i, j; + + while (argc > 1) { + if (strcmp(argv[--argc],"-h") == 0) { + fprintf(stderr, +"Usage: %s [-C] [-c] [-v] [=fmt-name[,fmt-name...]] [@WIDTHxHEIGHT] [accel-name...]\n", + argv[0]); + fprintf(stderr, +"-C: check all testable accelerated routines and exit with success/failure\n" +"-c: compare with non-accelerated versions and report percentage speedup\n" +"-v: verbose (report details of comparison failures; with -C, print test names)\n" +"=: select formats to test\n" +" fmt-name can be:"); + for (i = 0; fmtlist[i].fmt != IMG_NONE; i++) { + char buf[16], *s; + snprintf(buf, sizeof(buf), "%s", fmtlist[i].name); + while (*buf && buf[strlen(buf)-1]==' ') + buf[strlen(buf)-1] = 0; + s = buf + strspn(buf," "); + fprintf(stderr," %s", s); + } + fprintf(stderr, "\n"); + fprintf(stderr, "@: set image size (default/max %dx%d)\n", + WIDTH, HEIGHT); + fprintf(stderr, "accel-name can be ia32asm, amd64asm, cmove, mmx, ...\n"); + return 0; + } + if (strcmp(argv[argc],"-C") == 0) + check = 1; + else if (strcmp(argv[argc],"-c") == 0) + compare = 1; + else if (strcmp(argv[argc],"-v") == 0) + verbose = 1; + else if (strcmp(argv[argc],"ia32asm") == 0) + accel |= AC_IA32ASM; + else if (strcmp(argv[argc],"amd64asm") == 0) + accel |= AC_AMD64ASM; + else if (strcmp(argv[argc],"cmove") == 0) + accel |= AC_CMOVE; + else if (strcmp(argv[argc],"mmx") == 0) + accel |= AC_MMX; + else if (strcmp(argv[argc],"mmxext") == 0) + accel |= AC_MMXEXT; + else if (strcmp(argv[argc],"3dnow") == 0) + accel |= AC_3DNOW; + else if (strcmp(argv[argc],"3dnowext") == 0) + accel |= AC_3DNOWEXT; + else if (strcmp(argv[argc],"sse") == 0) + accel |= AC_SSE; + else if (strcmp(argv[argc],"sse2") == 0) + accel |= AC_SSE2; + else if (strcmp(argv[argc],"sse3") == 0) + accel |= AC_SSE3; + else if (argv[argc][0] == '=') { + char *s = argv[argc]+1; + for (i = 0; fmtlist[i].fmt != IMG_NONE; i++) { + fmtlist[i].disabled = 1; + } + for (s = strtok(s,","); s; s = strtok(NULL,",")) { + for (i = 0; fmtlist[i].fmt != IMG_NONE; i++) { + const char *t = fmtlist[i].name; + int l; + while (*t == ' ') + t++; + l = strlen(t); + while (l > 1 && t[l-1] == ' ') + l--; + if (strlen(s) == l && memcmp(s,t,l) == 0) { + fmtlist[i].disabled = 0; + break; + } + } + if (fmtlist[i].fmt == IMG_NONE) { + fprintf(stderr, "Unknown image format `%s'\n", s); + fprintf(stderr, "`%s -h' for help.\n", argv[0]); + return 1; + } + } + } else if (argv[argc][0] == '@') { + if (sscanf(argv[argc]+1, "%dx%d", &width, &height) != 2 + || width <= 0 || height <= 0 + ) { + fprintf(stderr, "Invalid image size `%s'\n", argv[argc]+1); + fprintf(stderr, "`%s -h' for help.\n", argv[0]); + return 1; + } + if (width > WIDTH || height > HEIGHT) { + fprintf(stderr, "Image size too large (max %dx%d)\n", + WIDTH, HEIGHT); + fprintf(stderr, "`%s -h' for help.\n", argv[0]); + return 1; + } + } else { + fprintf(stderr, "Unknown accel type `%s'\n", argv[argc]); + fprintf(stderr, "`%s -h' for help.\n", argv[0]); + return 1; + } + } + if (accel) { + if (accel & ~ac_cpuinfo()) { + fprintf(stderr, "Unavailable accel type(s):%s\n", + accel_flags(accel & ~ac_cpuinfo())); + fprintf(stderr, "Supported on this machine:%s\n", + accel_flags(ac_cpuinfo())); + return 1; + } + } else { + accel = ac_cpuinfo(); + } + + srandom(0); /* to give a standard "image" */ + for (i = 0; i < sizeof(srcbuf); i++) + srcbuf[i] = random(); + + if (check) { + if (ac_cpuinfo() & (AC_IA32ASM | AC_AMD64ASM)) { + if (!checkall(srcbuf, AC_IA32ASM | AC_AMD64ASM, + verbose ? "asm" : NULL)) + return 1; + } + if (ac_cpuinfo() & AC_MMX) { + if (!checkall(srcbuf, AC_IA32ASM | AC_AMD64ASM | AC_MMX, + verbose ? "mmx" : NULL)) + return 1; + } + if (ac_cpuinfo() & AC_SSE2) { + if (!checkall(srcbuf, AC_IA32ASM | AC_AMD64ASM | AC_CMOVE + | AC_MMX | AC_SSE | AC_SSE2, + verbose ? "sse2" : NULL)) + return 1; + } + return 0; + } + + printf("Acceleration flags:%s\n", accel_flags(accel)); + if (compare) + printf("Units: conversions/time (unaccelerated = 100)\n\n"); + else + printf("Units: conversions/sec (frame size: %dx%d)\n\n", width, height); + printf(" |"); + for (i = 0; fmtlist[i].fmt != IMG_NONE; i++) { + if (!fmtlist[i].disabled) + printf("%-4s|", fmtlist[i].name); + } + printf("\n----+"); + for (i = 0; fmtlist[i].fmt != IMG_NONE; i++) { + if (!fmtlist[i].disabled) + printf("----+"); + } + printf("\n"); + + for (i = 0; fmtlist[i].fmt != IMG_NONE; i++) { + if (fmtlist[i].disabled) + continue; + printf("%-4s|", fmtlist[i].name); + fflush(stdout); + for (j = 0; fmtlist[j].fmt != IMG_NONE; j++) { + if (fmtlist[j].disabled) + continue; + int res = testit(srcbuf, fmtlist[i].fmt, fmtlist[j].fmt, + width, height, accel, verbose, 0); + switch (res) { + case -1: + case -2: + case -3: + case -4: + case -5: printf("----|"); break; + case -6: printf("BAD |"); break; + case -7: printf("SEGV|"); break; + case -8: printf("ILL |"); break; + default: + if (compare) { + int res0 = testit(srcbuf, fmtlist[i].fmt, + fmtlist[j].fmt, width, height, + 0, 0, 0); + if (res0 < 0) + printf("****|"); + else + printf("%4d|", (100*res0 + res/2) / res); + } else { + printf("%4d|", (1000000+res/2)/res); + } + break; + } + fflush(stdout); + } + printf("\n"); + } + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-iodir.c b/debian/transcode/transcode-1.1.7/testsuite/test-iodir.c new file mode 100644 index 00000000..177ede53 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-iodir.c @@ -0,0 +1,140 @@ +/* + * test-iodir.c -- testsuite for TCDirList* family; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> + +#include "config.h" +#include "libtc/libtc.h" +#include "libtc/iodir.h" + + +// typical use case #1 + +static int test_simple_scan(void) +{ + TCDirList dir; + int ret; + const char *pc = NULL; + + tc_info("test_simple_scan:"); + + ret = tc_dirlist_open(&dir, "/", 0); + if (ret != 0) { + tc_error("tc_dirlist_open(\"/\") failed"); + } + + while ((pc = tc_dirlist_scan(&dir)) != NULL) { + printf("%s\n", pc); + } + printf("file count: %i\n", tc_dirlist_file_count(&dir)); + + tc_dirlist_close(&dir); + + return 0; +} + +// typical use case #2 + +static int test_sortbuf_scan(void) +{ + TCDirList dir; + int ret, i, j; + const char *pc = NULL; + + tc_info("test_sortbuf_scan:"); + + ret = tc_dirlist_open(&dir, "/", 1); + if (ret != 0) { + tc_error("tc_dirlist_open(\"/\") failed"); + } + + i = tc_dirlist_file_count(&dir); + printf("file count: %i\n", i); + + while ((pc = tc_dirlist_scan(&dir)) != NULL) { + printf("%s\n", pc); + } + j = tc_dirlist_file_count(&dir); + printf("file count: %i\n", j); + + if (i != j) { + tc_error("missed some files in sortbuf()"); + } + + tc_dirlist_close(&dir); + + return 0; +} + +// some misc expected failures + +static int test_expected_failures(void) +{ + TCDirList dir; + int ret; + + tc_info("test_expected_failures: (no output means all clean)"); + + ret = tc_dirlist_open(&dir, "/proc/self/cmdline", 0); + if (ret == 0) { + tc_error("tc_dirlist_open(\"/proc/self/cmdline\") succeded"); + } + + ret = tc_dirlist_open(&dir, "/proc/self/cmdline", 1); + if (ret == 0) { + tc_error("tc_dirlist_open(\"/proc/self/cmdline\", sorted) succeded"); + } + + ret = tc_dirlist_open(&dir, "/inexistent", 0); + if (ret == 0) { + tc_error("tc_dirlist_open(\"/inexistent\") succeded"); + } + + ret = tc_dirlist_open(&dir, "/inexistent", 1); + if (ret == 0) { + tc_error("tc_dirlist_open(\"/inexistent\", sorted) succeded"); + } + return 0; +} + +int main(void) +{ + test_simple_scan(); + test_sortbuf_scan(); + test_expected_failures(); + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-mangle-cmdline.c b/debian/transcode/transcode-1.1.7/testsuite/test-mangle-cmdline.c new file mode 100644 index 00000000..4f70a3c4 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-mangle-cmdline.c @@ -0,0 +1,154 @@ +/* + * test-mangle-cmdline -- testsuite for tc_mangle_cmdline() function; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "config.h" + +#define _GNU_SOURCE 1 +#define MAX_OPTS (32) + +#include "libtc/libtc.h" +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <assert.h> + + + +#define DUMP_OPTS(AC, AV) do { \ + int i = 0; \ + printf("argc=%i\n", (AC)); \ + for (i = 0; i < (AC); i++) { \ + printf("argv[%i] = %s\n", i, (AV)[i]); \ + } \ +} while (0) + + +static int in_set(const char *val, const char **val_set, int set_len) +{ + int i = 0; + + for (i = 0; i < set_len; i++) { + if (!strcmp(val_set[i], val)) { + return 1; + } + } + return 0; +} + +static int test_mangle_option(int argc, char **argv, const char *option, int hasval) +{ + int ac = argc, i = 0, ret; + char *av[MAX_OPTS]; + const char *useless = NULL; + + assert(argc <= MAX_OPTS); + + for (i = 0; i < argc; i++) { + av[i] = argv[i]; + } + ret = tc_mangle_cmdline(&argc, &argv, option, (hasval) ?(&useless) :NULL); + tc_info("mangling: %i", ret); + if (ret != 0) { + DUMP_OPTS(argc, argv); + if (ac != argc) { + tc_warn("missing argument (argc not changed)"); + return 1; + } + for (i = 0; i < argc; i++) { + if (av[i] != argv[i] + || strcmp(av[i], argv[i]) != 0) { + tc_warn("argument diversion (%s VS %s @ %i)", av[i], argv[i], i); + return 1; + } + } + if (!in_set(option, (const char **)argv, argc)) { + tc_warn("option still present"); + return 1; + } + } else { + int na = ac - ((hasval) ?2 :1); + DUMP_OPTS(argc, argv); + if (na != argc) { + tc_warn("argument number mismatch (expected %i|got %i)", na, argc); + return 1; + } + if (in_set(option, (const char **)argv, argc)) { + tc_warn("option still present"); + return 1; + } + for (i = 0; i < ac; i++) { + if (!in_set(argv[i], (const char **)av, ac)) { + tc_warn("missing argument: %s", argv[i]); + return 1; + } + } + } + return 0; +} + +#define TEST_OPT(OPT, HASVAL) do { \ + char *argv[] = { "testprogram", "-c", "-v", "-A", "1", \ + "--foo", "bar", "--baz", "-t" }; \ + int argc = 9; \ + int ret = 0; \ + \ + tc_info("TEST BEGINS HERE ==================================="); \ + puts("base commandline:"); \ + DUMP_OPTS(argc, argv); \ + \ + puts("removing " OPT ": "); \ + ret = test_mangle_option(argc, argv, OPT, HASVAL); \ + if (ret) { \ + tc_warn("test with %s: FAILED", OPT); \ + err++; \ + } else { \ + tc_info("test with %s: ok", OPT); \ + } \ + tc_info("TEST ENDS HERE ====================================="); \ +} while (0) + + +int main(void) +{ + int err = 0; + + TEST_OPT("-c", TC_FALSE); + TEST_OPT("-v", TC_FALSE); + TEST_OPT("-A", TC_TRUE); + TEST_OPT("--baz", TC_FALSE); + TEST_OPT("--foo", TC_TRUE); + + return (err > 0) ?1 :0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-pvmparser.c b/debian/transcode/transcode-1.1.7/testsuite/test-pvmparser.c new file mode 100644 index 00000000..611c94bc --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-pvmparser.c @@ -0,0 +1,65 @@ +/* + * test-pvmparser -- testsuite for PVM3 configuration parser; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2007-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +#include "config.h" +#include "libtc/libtc.h" +#include "libtc/cfgfile.h" + +#include "pvm3/pvm_parser.h" + + +int main(int argc, char *argv[]) +{ + int full = TC_FALSE; + pvm_config_env *env = NULL; + + if (argc != 2) { + fprintf(stderr, "(%s) usage: %s pvm.cfg\n", __FILE__, argv[0]); + exit(1); + } + if (argc == 3 && !strcmp(argv[2], "full")) { + full = TC_TRUE; + } + env = pvm_parser_open(argv[1], TC_TRUE, full); + + pvm_parser_close(); + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-ratiocodes.c b/debian/transcode/transcode-1.1.7/testsuite/test-ratiocodes.c new file mode 100644 index 00000000..f0a2ddd0 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-ratiocodes.c @@ -0,0 +1,266 @@ +/* + * test-ratiocodes.c -- testsuite for to/from ratio utility conversion + * functions. Everyone feel free to add more tests + * and improve existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> + +#include "config.h" +#include "tc_defaults.h" +#include "libtc/libtc.h" +#include "libtc/ratiocodes.h" + +#ifndef PACKAGE +#define PACKAGE __FILE__ +#endif + +#define DELTA (0.0005) + +static int test_autoloop_from_fps(double fps) +{ + int ret = 0, frc; + double myfps; + + ret = tc_frc_code_from_value(&frc, fps); + if (ret == TC_NULL_MATCH) { + tc_log_warn(PACKAGE, "from_fps: failed conversion_from for fps=%f", + fps); + return 1; + } + + ret = tc_frc_code_to_value(frc, &myfps); + if (ret == TC_NULL_MATCH) { + tc_log_warn(PACKAGE, "from_fps: failed conversion_to for fps=%f", + fps); + return 2; + } + + if (myfps - DELTA < fps && fps < myfps + DELTA) { + tc_log_msg(PACKAGE, "from_fps: test for fps=%f -> OK", + fps); + } else { + tc_log_warn(PACKAGE, "from_fps: test for fps=%f -> FAILED (%f)", + fps, myfps); + ret = -1; + } + return ret; +} + +static int test_autoloop_to_fps(int frc) +{ + int ret = 0, myfrc; + double fps; + + ret = tc_frc_code_to_value(frc, &fps); + if (ret == TC_NULL_MATCH) { + tc_log_warn(PACKAGE, "to_fps: failed conversion_to for frc=%i", + frc); + return 1; + } + + ret = tc_frc_code_from_value(&myfrc, fps); + if (ret == TC_NULL_MATCH) { + tc_log_warn(PACKAGE, "to_fps: failed conversion_from for frc=%i", + frc); + return 2; + } + + if (frc == myfrc) { + tc_log_msg(PACKAGE, "to_fps: test for frc=%i -> OK", frc); + } else { + tc_log_warn(PACKAGE, "to_fps: test for frc=%i -> FAILED (%i)", + frc, myfrc); + ret = -1; + } + return ret; +} + +static int test_autoloop_to_ratio(int dom, int code) +{ + int ret = 0, mycode; + TCPair pair; + + ret = tc_code_to_ratio(dom, code, &pair.a, &pair.b); + if (ret == TC_NULL_MATCH) { + tc_log_warn(PACKAGE, "to_ratio: failed conversion_to for " + "code=%i (dom=%i)", code, dom); + return 1; + } + + ret = tc_code_from_ratio(dom, &mycode, pair.a, pair.b); + if (ret == TC_NULL_MATCH) { + tc_log_warn(PACKAGE, "to_ratio: failed conversion_from for " + "code=%i (dom=%i)", code, dom); + return 2; + } + + if (code == mycode) { + tc_log_msg(PACKAGE, "to_ratio: test for code=%i (dom=%i) -> OK", + code, dom); + } else { + tc_log_warn(PACKAGE, "to_ratio: test for code=%i (dom=%i) -> FAILED" + " (%i)", code, dom, mycode); + ret = -1; + } + return ret; +} + +static int test_autoloop_from_ratio(int dom, TCPair pair) +{ + int ret = 0, code; + TCPair mypair; + + ret = tc_code_from_ratio(dom, &code, pair.a, pair.b); + if (ret == TC_NULL_MATCH) { + tc_log_warn(PACKAGE, "from_ratio: failed conversion_from for " + "ratio=%i/%i (dom=%i)", pair.a, pair.b, dom); + return 2; + } + + ret = tc_code_to_ratio(dom, code, &mypair.a, &mypair.b); + if (ret == TC_NULL_MATCH) { + tc_log_warn(PACKAGE, "from_ratio: failed conversion_to for " + "ratio=%i/%i (dom=%i)", pair.a, pair.b, dom); + return 1; + } + + if (pair.a == mypair.a && pair.b == mypair.b) { + tc_log_msg(PACKAGE, "from_ratio: test for ratio=%i/%i (dom=%i)" + " -> OK", pair.a, pair.b, dom); + } else { + tc_log_warn(PACKAGE, "from_ratio: test for ratio=%i/%i (dom=%i)" + " -> FAILED (%i/%i)", pair.a, pair.b, dom, + mypair.a, mypair.b); + ret = -1; + } + return ret; +} + + +struct p_struct { + int code; + TCPair ratio; +}; + +/* intentionally random order */ +static const struct p_struct frc_ratios[] = { + { 0, { 0 , 0 } }, + { 10, { 5000, 1000 } }, + { 4, { 30000, 1001 } }, + { 2, { 24000, 1000 } }, + { 3, { 25000, 1000 } }, + { 9, { 1000, 1000 } }, + { 6, { 50000, 1000 } }, + { 11, { 10000, 1000 } }, + { 5, { 30000, 1000 } }, + { 8, { 60000, 1000 } }, + { 1, { 24000, 1001 } }, + { 12, { 12000, 1000 } }, + { 7, { 60000, 1001 } }, + { 13, { 15000, 1000 } }, +}; + +/* intentionally random order */ +static const struct p_struct asr_ratios[] = { + { 2, { 4, 3 } }, + { 3, { 16, 9 } }, + { 1, { 1, 1 } }, + { 0, { 0, 0 } }, + { 4, { 221, 100 } }, +}; + +/* intentionally random order */ +static const struct p_struct par_ratios[] = { + { 3, { 1000, 1100 } }, + { 0, { 1, 1 } }, + { 5, { 4000, 3300 } }, + { 4, { 1600, 1100 } }, + { 2, { 1200, 1100 } }, +}; + + +struct fr_struct { + int frc; + double fps; +}; + +/* + * testing frc/fps pairs, picked not-so-randomly, but + * intentionally left in random order here + */ +static const struct fr_struct fps_pairs[] = { + { 7, (2*NTSC_VIDEO) }, + { 8, 60.0 }, + { 1, NTSC_FILM }, + { 4, NTSC_VIDEO }, + { 0, 0.0 }, + { 13, 15 }, + { 3, 25.0 }, +// { 15, 0 }, +// known issue: aliasing isn't handled properly +}; + + +#define TABLE_LEN(tab) (sizeof((tab))/sizeof((tab)[0])) + +int main(void) +{ + int i = 0; + + tc_log_info(PACKAGE, "testing frc <=> fps ..."); + for (i = 0; i < TABLE_LEN(fps_pairs); i++) { + test_autoloop_from_fps(fps_pairs[i].fps); + test_autoloop_to_fps(fps_pairs[i].frc); + } + + tc_log_info(PACKAGE, "testing frc <=> ratio ..."); + for (i = 0; i < TABLE_LEN(frc_ratios); i++) { + test_autoloop_from_ratio(TC_FRC_CODE, frc_ratios[i].ratio); + test_autoloop_to_ratio(TC_FRC_CODE, frc_ratios[i].code); + } + + tc_log_info(PACKAGE, "testing asr <=> ratio ..."); + for (i = 0; i < TABLE_LEN(asr_ratios); i++) { + test_autoloop_from_ratio(TC_ASR_CODE, asr_ratios[i].ratio); + test_autoloop_to_ratio(TC_ASR_CODE, asr_ratios[i].code); + } + + tc_log_info(PACKAGE, "testing par <=> ratio ..."); + for (i = 0; i < TABLE_LEN(par_ratios); i++) { + test_autoloop_from_ratio(TC_PAR_CODE, par_ratios[i].ratio); + test_autoloop_to_ratio(TC_PAR_CODE, par_ratios[i].code); + } + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-resize-values.c b/debian/transcode/transcode-1.1.7/testsuite/test-resize-values.c new file mode 100644 index 00000000..d9677abc --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-resize-values.c @@ -0,0 +1,145 @@ +/* + * test-resize-values.c -- testsuite for tc_compute_fast_resize_values + * (tc_functions.c); everyone feel free to add + * more tests and improve existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "libtc/libtc.h" +#include "src/transcode.h" +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +typedef struct res_ { + int width; + int height; +} Resolution; + + +typedef struct testcase_ { + Resolution old; + Resolution new; + int retcode; +} TestCase; + +static TestCase tests[] = { + { { 720, 576 }, { 720, 576 }, 0 }, + { { 720, 480 }, { 720, 480 }, 0 }, + { { 720, 576 }, { 720, 480 }, 0 }, + { { 720, 480 }, { 720, 576 }, 0 }, + { { 720, 576 }, { 352, 288 }, 0 }, + { { 352, 288 }, { 720, 576 }, 0 }, + { { 720, 480 }, { 352, 240 }, 0 }, + { { 352, 240 }, { 720, 480 }, 0 }, + { { 720, 576 }, { 640, 480 }, 0 }, + { { 640, 480 }, { 720, 576 }, 0 }, + { { 720, 576 }, { 1024, 768 }, 0 }, + { { 1024, 768 }, { 720, 576 }, 0 }, + { { 722, 576 }, { 720, 576 }, -1 }, + { { 720, 576 }, { 722, 576 }, -1 }, + { { 718, 576 }, { 720, 576 }, -1 }, + { { 720, 576 }, { 718, 576 }, -1 }, + { { 720, 578 }, { 720, 576 }, -1 }, + { { 720, 576 }, { 720, 578 }, -1 }, + { { 720, 572 }, { 720, 576 }, -1 }, + { { 720, 576 }, { 720, 572 }, -1 }, + { { 720, 576 }, { 1024, 480 }, 0 }, + { { 1024, 480 }, { 720, 576 }, 0 }, + { { 720, 480 }, { 480, 576 }, 0 }, + { { 480, 576 }, { 720, 480 }, 0 }, +}; + +#define TEST_COUNT (sizeof(tests)/sizeof(tests[0])) + +static int do_single_test(const TestCase *test, vob_t *vob, int strict) +{ + int ret; + /* cleanup */ + vob->resize1_mult = 0; + vob->resize2_mult = 0; + vob->hori_resize1 = 0; + vob->hori_resize2 = 0; + vob->vert_resize1 = 0; + vob->vert_resize2 = 0; + /* setup test values */ + vob->ex_v_width = test->old.width; + vob->ex_v_height = test->old.height; + vob->zoom_width = test->new.width; + vob->zoom_height = test->new.height; + + ret = tc_compute_fast_resize_values(vob, strict); + + if (ret == test->retcode) { + tc_log_info(__FILE__, "%ix%i -> %ix%i (-B %i,%i,%i | -X %i,%i,%i)" + " expect %s got %s -> OK!", + test->old.width, test->old.height, + test->new.width, test->new.height, + vob->vert_resize1, vob->hori_resize1, vob->resize1_mult, + vob->vert_resize2, vob->hori_resize2, vob->resize2_mult, + (ret == 0) ?"SUCCESS" :"FAILURE", + (test->retcode == 0) ?"SUCCESS" :"FAILURE"); + } else { + tc_log_warn(__FILE__, "%ix%i -> %ix%i (-B %i,%i,%i | -X %i,%i,%i)" + " expect %s got %s -> BAD!!", + test->old.width, test->old.height, + test->new.width, test->new.height, + vob->vert_resize1, vob->hori_resize1, vob->resize1_mult, + vob->vert_resize2, vob->hori_resize2, vob->resize2_mult, + (ret == 0) ?"SUCCESS" :"FAILURE", + (test->retcode == 0) ?"SUCCESS" :"FAILURE"); + } + return (ret == test->retcode) ?0 :1; +} + +int main(int argc, char *argv[]) +{ + int failed = 0, i = 0, strict = TC_FALSE; + vob_t *vob = tc_zalloc(sizeof(vob_t)); + + if (vob == NULL) { + return EXIT_FAILURE; + } + + if (argc > 1 && !strcmp(argv[1], "strict")) { + strict = TC_TRUE; + } + + for (i = 0; i < TEST_COUNT; i++) { + failed += do_single_test(&tests[i], vob, strict); + } + + tc_free(vob); + tc_log_info(__FILE__, "test summary: %i tests, %i failed", + (int)TEST_COUNT, failed); + return (failed == 0) ?EXIT_SUCCESS :EXIT_FAILURE; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "hugeouhugeup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ + diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-tcglob.c b/debian/transcode/transcode-1.1.7/testsuite/test-tcglob.c new file mode 100644 index 00000000..b2780887 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-tcglob.c @@ -0,0 +1,63 @@ +/* + * test-tcglob.c -- testsuite for TCDirList* family; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> + +#include "config.h" +#include "libtc/libtc.h" +#include "libtc/tcglob.h" + + +int main(int argc, char *argv[]) +{ + TCGlob *g = NULL; + const char *pc = NULL; + + if (argc != 2) { + tc_error("usage: %s pattern_to_glob", argv[0]); + } + + g = tc_glob_open(argv[1], 0); + if (!g) { + tc_error("glob open error"); + } + while ((pc = tc_glob_next(g)) != NULL) { + puts(pc); + } + tc_glob_close(g); + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-tclist.c b/debian/transcode/transcode-1.1.7/testsuite/test-tclist.c new file mode 100644 index 00000000..7212474c --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-tclist.c @@ -0,0 +1,295 @@ +/* + * test-tclist.c -- testsuite for TCList* family; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2008-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> + +#include "config.h" +#include "libtc/libtc.h" +#include "libtc/tclist.h" + + +/*************************************************************************/ + +#define TC_TEST_BEGIN(NAME, CACHED) \ +static int tclist_ ## NAME ## _test(void) \ +{ \ + const char *TC_TEST_name = # NAME ; \ + const char *TC_TEST_errmsg = ""; \ + int TC_TEST_step = -1; \ + \ + TCList L; \ + \ + tc_log_info(__FILE__, "running test: [%s]", # NAME); \ + if (tc_list_init(&L, (CACHED)) == TC_OK) { + + +#define TC_TEST_END \ + if (tc_list_fini(&L) != TC_OK) { \ + return 1; \ + } \ + return 0; \ + } \ +TC_TEST_failure: \ + if (TC_TEST_step != -1) { \ + tc_log_warn(__FILE__, "FAILED test [%s] at step %i", TC_TEST_name, TC_TEST_step); \ + } \ + tc_log_warn(__FILE__, "FAILED test [%s] NOT verified: %s", TC_TEST_name, TC_TEST_errmsg); \ + return 1; \ +} + +#define TC_TEST_SET_STEP(STEP) do { \ + TC_TEST_step = (STEP); \ +} while (0) + +#define TC_TEST_UNSET_STEP do { \ + TC_TEST_step = -1; \ +} while (0) + +#define TC_TEST_IS_TRUE(EXPR) do { \ + int err = (EXPR); \ + if (!err) { \ + TC_TEST_errmsg = # EXPR ; \ + goto TC_TEST_failure; \ + } \ +} while (0) + + +#define TC_RUN_TEST(NAME) \ + errors += tclist_ ## NAME ## _test() + + +/*************************************************************************/ + +enum { + UNCACHED = 0, + CACHED = 1 +}; + +TC_TEST_BEGIN(U_just_init, UNCACHED) + TC_TEST_IS_TRUE(tc_list_size(&L) == 0); +TC_TEST_END + +TC_TEST_BEGIN(U_append, UNCACHED) + long num = 42; + TC_TEST_IS_TRUE(tc_list_append(&L, &num) == TC_OK); + TC_TEST_IS_TRUE(tc_list_size(&L) == 1); +TC_TEST_END + +TC_TEST_BEGIN(U_append_get, UNCACHED) + long num = 42, *res; + TC_TEST_IS_TRUE(tc_list_append(&L, &num) == TC_OK); + TC_TEST_IS_TRUE(tc_list_size(&L) == 1); + res = tc_list_get(&L, 0); + TC_TEST_IS_TRUE(&num == res); +TC_TEST_END + +TC_TEST_BEGIN(U_prepend_get, UNCACHED) + long num = 42, *res; + TC_TEST_IS_TRUE(tc_list_prepend(&L, &num) == TC_OK); + TC_TEST_IS_TRUE(tc_list_size(&L) == 1); + res = tc_list_get(&L, 0); + TC_TEST_IS_TRUE(&num == res); +TC_TEST_END + +TC_TEST_BEGIN(U_appendN_get, UNCACHED) + long *res, nums[] = { 23, 42, 18, 75, 73, 99, 14, 29 }; + int i = 0, len = sizeof(nums)/sizeof(nums[0]); + for (i = 0; i < len; i++) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(tc_list_append(&L, &(nums[i])) == TC_OK); + } + TC_TEST_UNSET_STEP; + TC_TEST_IS_TRUE(tc_list_size(&L) == len); + res = tc_list_get(&L, 0); + TC_TEST_IS_TRUE(&(nums[0]) == res); +TC_TEST_END + +TC_TEST_BEGIN(U_prependN_get, UNCACHED) + long *res, nums[] = { 23, 42, 18, 75, 73, 99, 14, 29 }; + int i = 0, len = sizeof(nums)/sizeof(nums[0]); + for (i = 0; i < len; i++) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(tc_list_prepend(&L, &(nums[i])) == TC_OK); + } + TC_TEST_UNSET_STEP; + TC_TEST_IS_TRUE(tc_list_size(&L) == len); + res = tc_list_get(&L, 0); + TC_TEST_IS_TRUE(&(nums[len-1]) == res); +TC_TEST_END + +TC_TEST_BEGIN(U_appendN_getN, UNCACHED) + long *res, nums[] = { 23, 42, 18, 75, 73, 99, 14, 29 }; + int i = 0, len = sizeof(nums)/sizeof(nums[0]); + for (i = 0; i < len; i++) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(tc_list_append(&L, &(nums[i])) == TC_OK); + } + TC_TEST_UNSET_STEP; + TC_TEST_IS_TRUE(tc_list_size(&L) == len); + for (i = 0; i < len; i++) { + res = tc_list_get(&L, i); + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(&(nums[i]) == res); + } +TC_TEST_END + +TC_TEST_BEGIN(U_prependN_getN, UNCACHED) + long *res, nums[] = { 23, 42, 18, 75, 73, 99, 14, 29 }; + int i = 0, len = sizeof(nums)/sizeof(nums[0]); + for (i = 0; i < len; i++) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(tc_list_prepend(&L, &(nums[i])) == TC_OK); + } + TC_TEST_UNSET_STEP; + TC_TEST_IS_TRUE(tc_list_size(&L) == len); + for (i = 0; i < len; i++) { + res = tc_list_get(&L, i); + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(&(nums[len-1-i]) == res); + } +TC_TEST_END + +TC_TEST_BEGIN(U_appendN_getN_Rev, UNCACHED) + long *res, nums[] = { 23, 42, 18, 75, 73, 99, 14, 29 }; + int i = 0, len = sizeof(nums)/sizeof(nums[0]); + for (i = 0; i < len; i++) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(tc_list_append(&L, &(nums[i])) == TC_OK); + } + TC_TEST_UNSET_STEP; + TC_TEST_IS_TRUE(tc_list_size(&L) == len); + for (i = 0; i < len; i++) { + res = tc_list_get(&L, -1-i); + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(&(nums[len-1-i]) == res); + } +TC_TEST_END + + +TC_TEST_BEGIN(U_prependN_getN_Rev, UNCACHED) + long *res, nums[] = { 23, 42, 18, 75, 73, 99, 14, 29 }; + int i = 0, len = sizeof(nums)/sizeof(nums[0]); + for (i = 0; i < len; i++) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(tc_list_prepend(&L, &(nums[i])) == TC_OK); + } + TC_TEST_UNSET_STEP; + TC_TEST_IS_TRUE(tc_list_size(&L) == len); + for (i = 0; i < len; i++) { + res = tc_list_get(&L, -1-i); + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(&(nums[i]) == res); + } +TC_TEST_END + +TC_TEST_BEGIN(U_appendN_popN_First, UNCACHED) + long *res, nums[] = { 23, 42, 18, 75, 73, 99, 14, 29 }; + int i = 0, len = sizeof(nums)/sizeof(nums[0]); + for (i = 0; i < len; i++) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(tc_list_append(&L, &(nums[i])) == TC_OK); + } + TC_TEST_UNSET_STEP; + i = 0; + TC_TEST_IS_TRUE(len == tc_list_size(&L)); + while (tc_list_size(&L)) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE((len - i) == tc_list_size(&L)); + res = tc_list_pop(&L, 0); + TC_TEST_IS_TRUE(&(nums[i]) == res); + i++; + } + TC_TEST_UNSET_STEP; + TC_TEST_IS_TRUE(0 == tc_list_size(&L)); +TC_TEST_END + +TC_TEST_BEGIN(U_appendN_popN_Last, UNCACHED) + long *res, nums[] = { 23, 42, 18, 75, 73, 99, 14, 29 }; + int i = 0, len = sizeof(nums)/sizeof(nums[0]); + for (i = 0; i < len; i++) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE(tc_list_append(&L, &(nums[i])) == TC_OK); + } + TC_TEST_UNSET_STEP; + i = 0; + TC_TEST_IS_TRUE(len == tc_list_size(&L)); + while (tc_list_size(&L)) { + TC_TEST_SET_STEP(i); + TC_TEST_IS_TRUE((len - i) == tc_list_size(&L)); + res = tc_list_pop(&L, -1); + TC_TEST_IS_TRUE(&(nums[len-1-i]) == res); + i++; + } + TC_TEST_UNSET_STEP; + TC_TEST_IS_TRUE(0 == tc_list_size(&L)); +TC_TEST_END + + + + +/*************************************************************************/ + +static int test_list_all(void) +{ + int errors = 0; + + TC_RUN_TEST(U_just_init); + TC_RUN_TEST(U_append); + TC_RUN_TEST(U_append_get); + TC_RUN_TEST(U_prepend_get); + TC_RUN_TEST(U_appendN_get); + TC_RUN_TEST(U_prependN_get); + TC_RUN_TEST(U_appendN_getN); + TC_RUN_TEST(U_prependN_getN); + TC_RUN_TEST(U_appendN_getN_Rev); + TC_RUN_TEST(U_prependN_getN_Rev); + TC_RUN_TEST(U_appendN_popN_First); + TC_RUN_TEST(U_appendN_popN_Last); + + return errors; +} + +int main(void) +{ + int errors = test_list_all(); + + putchar('\n'); + tc_log_info(__FILE__, "test summary: %i error%s (%s)", + errors, + (errors > 1) ?"s" :"", + (errors > 0) ?"FAILED" :"PASSED"); + return (errors > 0) ?1 :0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-tclog.c b/debian/transcode/transcode-1.1.7/testsuite/test-tclog.c new file mode 100644 index 00000000..d3e57568 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-tclog.c @@ -0,0 +1,126 @@ +/* + * test-tclog.c -- testsuite for tc_*log* family (tc_functions.c); + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "config.h" + +#define _GNU_SOURCE 1 + +#include "libtc/libtc.h" +#include <stdlib.h> +#include <stdio.h> + +#define TC_MSG_BUF_SIZE (256) /* ripped from libtc/tc_functions.c */ +#define HUGE_MSG_SIZE (TC_MSG_BUF_SIZE * 2) +#define STD_MSG_SIZE (64) +#define TINY_MSG_SIZE (4) + +int main(void) +{ + int i = 0; + char huge[HUGE_MSG_SIZE] = { '\0' }; + char std[STD_MSG_SIZE] = { '\0' }; + char tiny[TINY_MSG_SIZE] = { '\0' }; + + for (i = 0; i < HUGE_MSG_SIZE - 1; i++) { + huge[i] = 'H'; + } + for (i = 0; i < STD_MSG_SIZE - 1; i++) { + std[i] = 'S'; + } + for (i = 0; i < TINY_MSG_SIZE - 1; i++) { + tiny[i] = 'T'; + } + + fprintf(stderr, "round 1: NULL (begin)\n"); + tc_log_msg(NULL, NULL); + tc_log_info(NULL, NULL); + tc_log_warn(NULL, NULL); + tc_log_error(NULL, NULL); + fprintf(stderr, "round 1: NULL (end)\n"); + + fprintf(stderr, "round 2: empty (begin)\n"); + tc_log_msg("", ""); + tc_log_info("", ""); + tc_log_warn("", ""); + tc_log_error("", ""); + fprintf(stderr, "round 2: empty (end)\n"); + + fprintf(stderr, "round 3: NULL + empty (begin)\n"); + tc_log_msg("", NULL); + tc_log_msg(NULL, ""); + tc_log_info("", NULL); + tc_log_info(NULL, ""); + tc_log_warn("", NULL); + tc_log_warn(NULL, ""); + tc_log_error("", NULL); + tc_log_error(NULL, ""); + fprintf(stderr, "round 3: NULL + empty (end)\n"); + + fprintf(stderr, "round 9: larger than life (begin)\n"); + tc_log_msg(huge, "%s%s%s%s", huge, huge, huge, huge); + tc_log_info(huge, "%s%s%s%s", huge, huge, huge, huge); + tc_log_warn(huge, "%s%s%s%s", huge, huge, huge, huge); + tc_log_error(huge, "%s%s%s%s", huge, huge, huge, huge); + fprintf(stderr, "round 9: larger than life (end)\n"); + + fprintf(stderr, "round 10: multiline (begin)\n"); + tc_log_msg("multiline", "%s:\n" + "line number 1, nothing particular here\n" + "line number 2, nothing particular here\n" + "line number 3, nothing particular here\n" + "line number 4, nothing particular here\n", + "multiline"); + tc_log_info("multiline", "%s:\n" + "line number 1, nothing particular here\n" + "line number 2, nothing particular here\n" + "line number 3, nothing particular here\n" + "line number 4, nothing particular here\n", + "multiline"); + tc_log_warn("multiline", "%s:\n" + "line number 1, nothing particular here\n" + "line number 2, nothing particular here\n" + "line number 3, nothing particular here\n" + "line number 4, nothing particular here\n", + "multiline"); + tc_log_error("multiline", "%s:\n" + "line number 1, nothing particular here\n" + "line number 2, nothing particular here\n" + "line number 3, nothing particular here\n" + "line number 4, nothing particular here\n", + "multiline"); + fprintf(stderr, "round 10: multiline (end)\n"); + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "hugeouhugeup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-tcmodchain.sh b/debian/transcode/transcode-1.1.7/testsuite/test-tcmodchain.sh new file mode 100755 index 00000000..3502c8c7 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-tcmodchain.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# +# test-tcmodchain.sh -- modules compatibility testsuite. +# (C) 2007-2010 - Francesco Romani <fromani -at- gmail -dot- com> +# +# This file is part of transcode, a video stream processing tool. +# +# transcode is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# transcode is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# FIXME: default args, + +# get program path, if given +TCMODCHAIN="tcmodchain" +if [ -n "$1" ]; then + TCMODCHAIN="$1" +fi + +if [ ! -x "$TCMODCHAIN" ]; then + echo "missing tcmodchain program, test aborted" 1>&2 + exit 1 +fi + +# test helper + +# $1, $2 -> modules +# $3, expected return code +function check_test() { + if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then + echo "bad test parameters (skipped)" 1>&2 + return 1 + fi + $TCMODCHAIN -C $1 $2 -d 0 # silent operation + local RET="$?" + if [ "$RET" == "$3" ]; then + printf "testing check (%16s) with (%16s) | OK\n" $1 $2 + else + printf "testing check (%16s) with (%16s) | >> FAILED << [exp=%i|got=%i]\n" $1 $2 $3 $RET + fi + return $RET +} + +# $1, $2 -> modules +# $3, expected result list +function list_test() { + if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then + echo "bad test parameters (skipped)" 1>&2 + return 1 + fi + local GOT=$( $TCMODCHAIN -L $1 $2 | sort | tr '\n' ' ' | sed s/\ $//g ) + if [ "$GOT" == "$3" ]; then + printf "testing list (%16s) with (%16s) | OK\n" $1 $2 + else + printf "testing list (%16s) with (%16s) | >> FAILED <<\n" $1 $2 + printf " expected=\"%s\"" $3 + printf " received=\"%s\"" $GOT + fi + return $RET +} + + + +## `check' (-C) tests first +# +check_test "encode:null" "multiplex:null" 0 +check_test "encode:copy" "multiplex:null" 0 +check_test "encode:xvid" "multiplex:null" 0 +check_test "encode:x264" "multiplex:null" 0 +check_test "encode:lame" "multiplex:null" 0 +check_test "encode:faac" "multiplex:null" 0 +check_test "encode:lzo" "multiplex:null" 0 +# +check_test "encode:null" "multiplex:raw" 0 +check_test "encode:copy" "multiplex:raw" 0 +check_test "encode:xvid" "multiplex:raw" 0 +check_test "encode:x264" "multiplex:raw" 0 +check_test "encode:lame" "multiplex:raw" 0 +check_test "encode:faac" "multiplex:raw" 0 +check_test "encode:lzo" "multiplex:raw" 0 +# +check_test "encode:null" "multiplex:avi" 0 +check_test "encode:copy" "multiplex:avi" 0 +check_test "encode:xvid" "multiplex:avi" 0 +check_test "encode:x264" "multiplex:avi" 0 +check_test "encode:lame" "multiplex:avi" 0 +check_test "encode:faac" "multiplex:avi" 0 +check_test "encode:lzo" "multiplex:avi" 0 +# +# see manpage for return code meaning +check_test "encode:null" "multiplex:y4m" 0 +check_test "encode:copy" "multiplex:y4m" 0 +check_test "encode:xvid" "multiplex:y4m" 3 +check_test "encode:x264" "multiplex:y4m" 3 +check_test "encode:lame" "multiplex:y4m" 3 +check_test "encode:faac" "multiplex:y4m" 3 +check_test "encode:lzo" "multiplex:y4m" 3 +# +## `check' (-L) tests then +# +list_test "encode:*" "multiplex:null" "copy faac lame lzo null x264 xvid" +list_test "encode:*" "multiplex:raw" "copy faac lame lzo null x264 xvid" +list_test "encode:*" "multiplex:avi" "copy faac lame lzo null x264 xvid" +list_test "encode:*" "multiplex:y4m" "copy null" +# +list_test "encode:copy" "multiplex:*" "avi null raw y4m" +list_test "encode:faac" "multiplex:*" "avi null raw" +list_test "encode:lame" "multiplex:*" "avi null raw" +list_test "encode:lzo" "multiplex:*" "avi null raw" +list_test "encode:null" "multiplex:*" "avi null raw y4m" +list_test "encode:x264" "multiplex:*" "avi null raw" +list_test "encode:xvid" "multiplex:*" "avi null raw" diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-tcmodule.c b/debian/transcode/transcode-1.1.7/testsuite/test-tcmodule.c new file mode 100644 index 00000000..b955695a --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-tcmodule.c @@ -0,0 +1,404 @@ +/* + * test-tcmodule.c -- testsuite for tcmodule functions; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include <stdio.h> +#include <stdlib.h> + +#include "config.h" +#include "transcode.h" +#include "libtc/libtc.h" +#include "libtc/tcmodule-core.h" + +int verbose = TC_QUIET; +int err; + +static vob_t *vob = NULL; + +static TCFactory factory; + +// dependencies +vob_t *tc_get_vob(void) { return vob; } + + +void aframe_copy(aframe_list_t *dst, const aframe_list_t *src, int copy_data) { ; } +void vframe_copy(vframe_list_t *dst, const vframe_list_t *src, int copy_data) { ; } + +// partial line length: I don't bother with full line length, +// it's just a naif padding +#define ADJUST_TO_COL 60 +static void test_result_helper(const char *name, int ret, int expected) +{ + char spaces[ADJUST_TO_COL] = { ' ' }; + size_t slen = strlen(name); + int i = 0, padspace = ADJUST_TO_COL - slen; + + if (padspace > 0) { + // do a bit of padding to let the output looks more nice + for (i = 0; i < padspace; i++) { + spaces[i] = ' '; + } + } + + if (ret != expected) { + tc_log_error(__FILE__, "'%s'%s%sFAILED%s (%i|%i)", + name, spaces, COL_RED, COL_GRAY, + ret, expected); + } else { + tc_log_info(__FILE__, "'%s'%s%sOK%s", + name, spaces, COL_GREEN, COL_GRAY); + } +} + + +static int test_bad_init(const char *modpath) +{ + factory = tc_new_module_factory("", 0); + err = (factory == NULL) ?-1 :0; + + test_result_helper("bad_init::init", err, -1); + return 0; +} + +static int test_init_fini(const char *modpath) +{ + factory = tc_new_module_factory(modpath, 0); + err = (factory == NULL) ?-1 :0; + + test_result_helper("init_fini::init", err, 0); + test_result_helper("init_fini::fini", tc_del_module_factory(factory), 0); + return 0; +} + +static int test_bad_create(const char *modpath) +{ + TCModule module = NULL; + factory = tc_new_module_factory(modpath, verbose); + err = (factory == NULL) ?-1 :0; + + test_result_helper("bad_create::init", err, 0); + module = tc_new_module(factory, "inexistent", "inexistent", 0); + if (module != NULL) { + tc_log_error(__FILE__, "loaded inexistent module?!?!"); + } + test_result_helper("bad_create::fini", tc_del_module_factory(factory), 0); + return 0; +} + +static int test_create(const char *modpath) +{ + TCModule module = NULL; + factory = tc_new_module_factory(modpath, verbose); + err = (factory == NULL) ?-1 :0; + + test_result_helper("create::init", err, 0); + module = tc_new_module(factory, "filter", "null", 0); + if (module == NULL) { + tc_log_error(__FILE__, "can't load filter_null"); + } else { + test_result_helper("create::check", + tc_compare_modules(module, + module), + 1); + test_result_helper("create::instances", + tc_instance_count(factory), + 1); + test_result_helper("create::descriptors", + tc_plugin_count(factory), + 1); + tc_del_module(factory, module); + } + test_result_helper("create::fini", tc_del_module_factory(factory), 0); + return 0; +} + +static int test_double_create(const char *modpath) +{ + TCModule module1 = NULL, module2 = NULL; + factory = tc_new_module_factory(modpath, verbose); + err = (factory == NULL) ?-1 :0; + + test_result_helper("double_create::init", err, 0); + module1 = tc_new_module(factory, "filter", "null", TC_VIDEO); + if (module1 == NULL) { + tc_log_error(__FILE__, "can't load filter_null (1)"); + } + module2 = tc_new_module(factory, "filter", "null", TC_AUDIO); + if (module2 == NULL) { + tc_log_error(__FILE__, "can't load filter_null (1)"); + } + + test_result_helper("double_create::check", + tc_compare_modules(module1, module2), + 0); + test_result_helper("double_create::instances", + tc_instance_count(factory), + 2); + test_result_helper("double_create::descriptors", + tc_plugin_count(factory), + 1); + if (module1) { + tc_del_module(factory, module1); + } + if (module2) { + tc_del_module(factory, module2); + } + test_result_helper("double_create::fini", tc_del_module_factory(factory), 0); + return 0; +} + +#define HOW_MUCH_STRESS (512) // at least 32, 2 to let the things work +static int test_stress_create(const char *modpath) +{ + TCModule module[HOW_MUCH_STRESS]; + int i, equality; + factory = tc_new_module_factory(modpath, verbose); + err = (factory == NULL) ?-1 :0; + + test_result_helper("stress_create::init", err, 0); + + for (i = 0; i < HOW_MUCH_STRESS; i++) { + module[i] = tc_new_module(factory, "filter", "null", TC_VIDEO); + if (module[i] == NULL) { + tc_log_error(__FILE__, "can't load filter_null (%i)", i); + break; + } + } + + test_result_helper("stress_create::create", i, HOW_MUCH_STRESS); + if (HOW_MUCH_STRESS != i) { + tc_log_error(__FILE__, "halted with i = %i (limit = %i)", + i, HOW_MUCH_STRESS); + return 1; + } + + // note that we MUST start from 1 + for (i = 1; i < HOW_MUCH_STRESS; i++) { + equality = tc_compare_modules(module[i-1], module[i]); + if (equality != 0) { + tc_log_error(__FILE__, "diversion! %i | %i", i-1, i); + break; + } + } + + test_result_helper("stress_create::check", i, HOW_MUCH_STRESS); + if (HOW_MUCH_STRESS != i) { + tc_log_error(__FILE__, "halted with i = %i (limit = %i)", + i, HOW_MUCH_STRESS); + return 1; + } + + test_result_helper("stress_create::instances", + tc_instance_count(factory), + HOW_MUCH_STRESS); + test_result_helper("stress_create::descriptors", + tc_plugin_count(factory), 1); + + + for (i = 0; i < HOW_MUCH_STRESS; i++) { + tc_del_module(factory, module[i]); + } + + test_result_helper("stress_create::instances (postnuke)", + tc_instance_count(factory), 0); + test_result_helper("stress_create::descriptors (postnuke)", + tc_plugin_count(factory), 0); + + + test_result_helper("stress_create::fini", tc_del_module_factory(factory), 0); + + return 0; +} + +static int test_stress_load(const char *modpath) +{ + TCModule module; + int i, breakage = 0, instances = 0, descriptors = 0; + factory = tc_new_module_factory(modpath, verbose); + err = (factory == NULL) ?-1 :0; + + test_result_helper("stress_load::init", err, 0); + + for (i = 0; i < HOW_MUCH_STRESS; i++) { + module = tc_new_module(factory, "filter", "null", TC_VIDEO); + if (module == NULL) { + tc_log_error(__FILE__, "can't load filter_null (%i)", i); + break; + } + + instances = tc_instance_count(factory); + if(instances != 1) { + tc_log_error(__FILE__, "wrong instance count: %i, expected %i\n", + instances, 1); + breakage = 1; + break; + } + + descriptors = tc_plugin_count(factory); + if(descriptors != 1) { + tc_log_error(__FILE__, "wrong descriptor count: %i, expected %i\n", + descriptors, 1); + breakage = 1; + break; + } + + tc_del_module(factory, module); + + instances = tc_instance_count(factory); + if(instances != 0) { + tc_log_error(__FILE__, "wrong instance count (postnuke): %i, expected %i\n", + instances, 0); + breakage = 1; + break; + } + + descriptors = tc_plugin_count(factory); + if(descriptors != 0) { + tc_log_error(__FILE__, "wrong descriptor count (postnuke): %i, expected %i\n", + descriptors, 0); + breakage = 1; + break; + } + } + + test_result_helper("stress_load::check", breakage, 0); + test_result_helper("stress_load::fini", tc_del_module_factory(factory), 0); + + return 0; +} + +static int test_load_filter_encode(const char *modpath) +{ + TCModule module1 = NULL, module2 = NULL; + factory = tc_new_module_factory(modpath, verbose); + err = (factory == NULL) ?-1 :0; + + test_result_helper("load_filter_encode::init", err, 0); + module1 = tc_new_module(factory, "filter", "null", TC_AUDIO); + if (module1 == NULL) { + tc_log_error(__FILE__, "can't load filter_null (1)"); + } + module2 = tc_new_module(factory, "encode", "null", TC_VIDEO); + if (module2 == NULL) { + tc_log_error(__FILE__, "can't load encode_null (1)"); + } + + test_result_helper("load_filter_encode::check", + tc_compare_modules(module1, module2), + -1); + test_result_helper("load_filter_encode::instances", + tc_instance_count(factory), + 2); + test_result_helper("load_filter_encode::descriptors", + tc_plugin_count(factory), + 2); + if (module1) { + tc_del_module(factory, module1); + } + if (module2) { + tc_del_module(factory, module2); + } + test_result_helper("load_filter_encode::fini", tc_del_module_factory(factory), 0); + return 0; +} + +static int test_load_encode_multiplex(const char *modpath) +{ + TCModule module1 = NULL, module2 = NULL; + factory = tc_new_module_factory(modpath, verbose); + err = (factory == NULL) ?-1 :0; + + test_result_helper("load_encode_multiplex::init", err, 0); + module1 = tc_new_module(factory, "encode", "null", TC_VIDEO); + if (module1 == NULL) { + tc_log_error(__FILE__, "can't load encode_null (1)"); + } + module2 = tc_new_module(factory, "multiplex", "null", TC_VIDEO|TC_AUDIO); + if (module2 == NULL) { + tc_log_error(__FILE__, "can't load multiplex_null (1)"); + } + + test_result_helper("load_encode_multiplex::check", + tc_compare_modules(module1, module2), + -1); + test_result_helper("load_encode_multiplex::instances", + tc_instance_count(factory), + 2); + test_result_helper("load_encode_multiplex::descriptors", + tc_plugin_count(factory), + 2); + if (module1) { + tc_del_module(factory, module1); + } + if (module2) { + tc_del_module(factory, module2); + } + test_result_helper("load_encode_multiplex::fini", tc_del_module_factory(factory), 0); + return 0; +} + +int main(int argc, char* argv[]) +{ + if(argc != 2) { + fprintf(stderr, "usage: %s /module/path\n", argv[0]); + exit(1); + } + + vob = tc_zalloc(sizeof(vob_t)); + + putchar('\n'); + test_bad_init(argv[1]); + putchar('\n'); + test_init_fini(argv[1]); + putchar('\n'); + test_bad_create(argv[1]); + putchar('\n'); + test_create(argv[1]); + putchar('\n'); + test_double_create(argv[1]); + putchar('\n'); + test_stress_create(argv[1]); + putchar('\n'); + test_stress_load(argv[1]); + putchar('\n'); + test_load_filter_encode(argv[1]); + putchar('\n'); + test_load_encode_multiplex(argv[1]); + + tc_free(vob); + + return 0; +} + +#include "static_optstr.h" + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-tcmoduleinfo.c b/debian/transcode/transcode-1.1.7/testsuite/test-tcmoduleinfo.c new file mode 100644 index 00000000..28512045 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-tcmoduleinfo.c @@ -0,0 +1,241 @@ +/* + * test-tcmoduleinfo.c -- testsuite for tcmoduleinfo* functions; + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + + +#include "src/transcode.h" +#include "libtc/tcmodule-info.h" +#include "libtc/tccodecs.h" + +static const TCCodecID empty_codecs[] = { TC_CODEC_ERROR }; +static TCModuleInfo empty = { + TC_MODULE_FEATURE_NONE, + TC_MODULE_FLAG_NONE, + "", + "", + "", + empty_codecs, + empty_codecs +}; + +static const TCCodecID pass_enc_codecs[] = { TC_CODEC_ANY, TC_CODEC_ERROR }; +static TCModuleInfo pass_enc = { + TC_MODULE_FEATURE_ENCODE | TC_MODULE_FEATURE_VIDEO + | TC_MODULE_FEATURE_AUDIO | TC_MODULE_FEATURE_EXTRA, + TC_MODULE_FLAG_RECONFIGURABLE, + "encode_pass.so", + "0.0.1 (2005-11-14)", + "accepts everything, outputs verbatim", + pass_enc_codecs, + pass_enc_codecs +}; + +static const TCCodecID fake_pcm_codecs[] = { TC_CODEC_PCM, TC_CODEC_ERROR }; +static TCModuleInfo fake_wav_mplex = { + TC_MODULE_FEATURE_MULTIPLEX | TC_MODULE_FEATURE_AUDIO, + TC_MODULE_FLAG_RECONFIGURABLE, + "mplex_wav.so", + "0.0.1 (2006-06-11)", + "accepts pcm, writes wav (fake!)", + fake_pcm_codecs, + empty_codecs +}; + +static const TCCodecID fake_yuv_codecs[] = { TC_CODEC_YUV420P, TC_CODEC_ERROR }; +static TCModuleInfo fake_y4m_mplex = { + TC_MODULE_FEATURE_MULTIPLEX | TC_MODULE_FEATURE_VIDEO, + TC_MODULE_FLAG_RECONFIGURABLE, + "mplex_y4m.so", + "0.0.1 (2006-06-11)", + "accepts yuv420p, writes YUV4MPEG2 (fake!)", + fake_yuv_codecs, + empty_codecs +}; + + +static const TCCodecID fake_mplex_codecs[] = { TC_CODEC_ANY, TC_CODEC_ERROR }; +static TCModuleInfo fake_mplex = { + TC_MODULE_FEATURE_MULTIPLEX | TC_MODULE_FEATURE_VIDEO + | TC_MODULE_FEATURE_AUDIO | TC_MODULE_FEATURE_EXTRA, + TC_MODULE_FLAG_RECONFIGURABLE, + "mplex_null.so", + "0.0.1 (2005-11-14)", + "accepts and discards everything", + fake_mplex_codecs, + empty_codecs +}; + +static const TCCodecID pcm_pass_codecs[] = { TC_CODEC_PCM, TC_CODEC_ERROR }; +static TCModuleInfo pcm_pass = { + TC_MODULE_FEATURE_ENCODE | TC_MODULE_FEATURE_AUDIO, + TC_MODULE_FLAG_RECONFIGURABLE, + "encode_pcm.so", + "0.0.1 (2006-03-11)", + "passthrough pcm", + pcm_pass_codecs, + pcm_pass_codecs +}; + +static const TCCodecID yuv_pass_codecs[] = { TC_CODEC_YUV420P, TC_CODEC_ERROR }; +static TCModuleInfo yuv_pass = { + TC_MODULE_FEATURE_ENCODE | TC_MODULE_FEATURE_VIDEO, + TC_MODULE_FLAG_RECONFIGURABLE, + "encode_yuv.so", + "0.0.1 (2006-03-11)", + "passthrough yuv", + yuv_pass_codecs, + yuv_pass_codecs +}; + +static const TCCodecID fake_mpeg_codecs_in[] = { TC_CODEC_YUV420P, TC_CODEC_ERROR }; +static const TCCodecID fake_mpeg_codecs_out[] = { TC_CODEC_MPEG1VIDEO, TC_CODEC_MPEG2VIDEO, TC_CODEC_XVID, TC_CODEC_ERROR }; +static TCModuleInfo fake_mpeg_enc = { + TC_MODULE_FEATURE_ENCODE | TC_MODULE_FEATURE_VIDEO, + TC_MODULE_FLAG_NONE, + "encode_mpeg.so", + "0.0.1 (2005-11-14)", + "fake YUV420P -> MPEG video encoder", + fake_mpeg_codecs_in, + fake_mpeg_codecs_out +}; + +static const TCCodecID fake_vorbis_codecs_in[] = { TC_CODEC_PCM, TC_CODEC_ERROR }; +static const TCCodecID fake_vorbis_codecs_out[] = { TC_CODEC_VORBIS, TC_CODEC_ERROR }; +static TCModuleInfo fake_vorbis_enc = { + TC_MODULE_FEATURE_ENCODE | TC_MODULE_FEATURE_AUDIO, + TC_MODULE_FLAG_NONE, + "encode_vorbis.so", + "0.0.1 (2005-11-14)", + "fake PCM -> Vorbis audio encoder", + fake_vorbis_codecs_in, + fake_vorbis_codecs_out +}; + +static const TCCodecID fake_avi_codecs_in[] = { + TC_CODEC_MPEG1VIDEO, TC_CODEC_XVID, TC_CODEC_YUV420P, + TC_CODEC_MP3, TC_CODEC_PCM, + TC_CODEC_ERROR +}; +static TCModuleInfo fake_avi_mplex = { + TC_MODULE_FEATURE_MULTIPLEX | TC_MODULE_FEATURE_VIDEO + | TC_MODULE_FEATURE_AUDIO, + TC_MODULE_FLAG_NONE, + "mplex_avi.so", + "0.0.1 (2005-11-14)", + "fakes an AVI muxer", + fake_avi_codecs_in, + empty_codecs + }; + + +static int test_match_helper(int codec, + const TCModuleInfo *m1, + const TCModuleInfo *m2, + int expected) +{ + int match = tc_module_info_match(codec, m1, m2); + int err = 0; +#ifdef VERBOSE + const char *str = tc_codec_to_string(codec); + + tc_log_msg(__FILE__, "codec: %s (0x%x)", str, codec); +#endif + if (match != expected) { + tc_log_error(__FILE__, "'%s' <-%c-> '%s' FAILED", + m1->name, + (expected == 1) ?'-' :'!', + m2->name); + err = 1; + } else { + tc_log_info(__FILE__, "'%s' <-%c-> '%s' OK", + m1->name, + (expected == 1) ?'-' :'!', + m2->name); + } + return err; +} + +static int test_module_match(void) +{ + int errors = 0; + + errors += test_match_helper(TC_CODEC_ANY, &empty, &empty, 0); + errors += test_match_helper(TC_CODEC_ANY, &empty, &fake_mpeg_enc, 0); + errors += test_match_helper(TC_CODEC_ANY, &fake_mpeg_enc, &empty, 0); + + errors += test_match_helper(TC_CODEC_ANY, &pass_enc, &fake_mplex, 1); + errors += test_match_helper(TC_CODEC_ANY, &pass_enc, &fake_avi_mplex, 1); + errors += test_match_helper(TC_CODEC_ANY, &pcm_pass, &fake_avi_mplex, 1); + errors += test_match_helper(TC_CODEC_PCM, &pass_enc, &fake_avi_mplex, 1); + +// this is tricky. Should fail since there are two *encoders* chained +// and this make no sense *in our current architecture*. +// but from tcmoduleinfo infrastructure POV, it make perfectly sense (yet) +// since encoders involved have compatible I/O capabilties, so it doesn't fail. +// errors += test_match_helper(TC_CODEC_ANY, &pass_enc, &fake_mpeg_enc, 0); + + errors += test_match_helper(TC_CODEC_MPEG2VIDEO, &fake_mpeg_enc, &fake_vorbis_enc, 0); + errors += test_match_helper(TC_CODEC_ANY, &fake_mpeg_enc, &fake_mplex, 1); + errors += test_match_helper(TC_CODEC_MPEG1VIDEO, &fake_mpeg_enc, &fake_mplex, 1); + errors += test_match_helper(TC_CODEC_ANY, &fake_mpeg_enc, &fake_avi_mplex, 1); + errors += test_match_helper(TC_CODEC_MPEG1VIDEO, &fake_mpeg_enc, &fake_avi_mplex, 1); + errors += test_match_helper(TC_CODEC_XVID, &fake_mpeg_enc, &fake_avi_mplex, 1); + + errors += test_match_helper(TC_CODEC_VORBIS, &fake_vorbis_enc, &fake_mpeg_enc, 0); + errors += test_match_helper(TC_CODEC_VORBIS, &fake_vorbis_enc, &fake_mplex, 1); + errors += test_match_helper(TC_CODEC_VORBIS, &fake_vorbis_enc, &fake_avi_mplex, 0); + + errors += test_match_helper(TC_CODEC_PCM, &pcm_pass, &fake_wav_mplex, 1); + errors += test_match_helper(TC_CODEC_PCM, &pcm_pass, &fake_y4m_mplex, 0); + errors += test_match_helper(TC_CODEC_MPEG1VIDEO, &fake_mpeg_enc, &fake_wav_mplex, 0); + + errors += test_match_helper(TC_CODEC_YUV420P, &yuv_pass, &fake_y4m_mplex, 1); + errors += test_match_helper(TC_CODEC_YUV420P, &yuv_pass, &fake_wav_mplex, 0); + errors += test_match_helper(TC_CODEC_YUV420P, &yuv_pass, &fake_avi_mplex, 1); + errors += test_match_helper(TC_CODEC_YUV420P, &yuv_pass, &fake_mplex, 1); + + return errors; +} + +int main(void) +{ + int errors = test_module_match(); + + putchar('\n'); + tc_log_info(__FILE__, "test summary: %i error%s (%s)", + errors, + (errors > 1) ?"s" :"", + (errors > 0) ?"FAILED" :"PASSED"); + return (errors > 0) ?1 :0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test-tcstrdup.c b/debian/transcode/transcode-1.1.7/testsuite/test-tcstrdup.c new file mode 100644 index 00000000..3347a4ff --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test-tcstrdup.c @@ -0,0 +1,126 @@ +/* + * test-tcstrdup.c -- testsuite for tc_*strdup* family (tc_functions.c); + * everyone feel free to add more tests and improve + * existing ones. + * (C) 2006-2010 - Francesco Romani <fromani -at- gmail -dot- com> + * + * This file is part of transcode, a video stream processing tool. + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "config.h" + +#define _GNU_SOURCE 1 + +#include "libtc/libtc.h" +#include <stdlib.h> +#include <stdio.h> + +// test case 1 + +#define TEST_STRING "testing tc_str*dup()" + +static int test_strdup(void) +{ + const char *s1 = TEST_STRING; + char *s2 = NULL, *s3 = NULL; + + tc_info("test_strdup() begin"); + + s2 = strdup(s1); + s3 = tc_strdup(s1); + + if (strlen(s1) != strlen(s2)) { + tc_error("string length mismatch: '%s' '%s'", s1, s2); + } + if (strlen(s1) != strlen(s3)) { + tc_error("string length mismatch: '%s' '%s'", s1, s3); + } + if (strlen(s2) != strlen(s3)) { + tc_error("string length mismatch: '%s' '%s'", s2, s3); + } + + if (strcmp(s1, s2) != 0) { + tc_error("string mismatch: '%s' '%s'", s1, s2); + } + if (strcmp(s1, s3) != 0) { + tc_error("string mismatch: '%s' '%s'", s1, s3); + } + if (strcmp(s2, s3) != 0) { + tc_error("string mismatch: '%s' '%s'", s2, s3); + } + + free(s2); + tc_free(s3); + + tc_info("test_strdup() end"); + return 0; +} + +static int test_strndup(size_t n) +{ + const char *s1 = TEST_STRING; + char *s2 = NULL, *s3 = NULL; + + tc_info("test_strndup(%lu) begin", (unsigned long)n); + + s2 = malloc(n+1); + if (n > 0) { + strncpy(s2, s1, n); + } + s2[n] = 0; + s3 = tc_strndup(s1, n); + + if (strlen(s2) != strlen(s3)) { + tc_error("string length mismatch: '%s' '%s'", s2, s3); + } + + if (strcmp(s2, s3) != 0) { + tc_error("string mismatch: '%s' '%s'", s2, s3); + } + + free(s2); + tc_free(s3); + + tc_info("test_strndup() end"); + return 0; +} + +int main(void) +{ + test_strdup(); + + test_strndup(0); + test_strndup(1); + test_strndup(5); + + test_strndup(strlen(TEST_STRING)-2); + test_strndup(strlen(TEST_STRING)-1); + + return 0; +} + +/*************************************************************************/ + +/* + * Local variables: + * c-file-style: "stroustrup" + * c-file-offsets: ((case-label . *) (statement-case-intro . *)) + * indent-tabs-mode: nil + * End: + * + * vim: expandtab shiftwidth=4: + */ diff --git a/debian/transcode/transcode-1.1.7/testsuite/test.pl b/debian/transcode/transcode-1.1.7/testsuite/test.pl new file mode 100644 index 00000000..3f59faa5 --- /dev/null +++ b/debian/transcode/transcode-1.1.7/testsuite/test.pl @@ -0,0 +1,264 @@ +#!/usr/bin/perl -w + +# dependencies: perl ImageMagick mjpegtools + +my($testdir) = "transcode-test"; +my($frames) = 5; + +my(%testdata) = +( + import => + { + }, + + export => + { + ppm => + { + "" => + { + yuv => + { + "output000000.ppm" => "2d366b437ced6b4b82ddab406cfc272d", + "output000001.ppm" => "a744069a2eaf23f3441a838c5748a746", + "output000002.ppm" => "4ba2a5195b2c53eb6228f702394d1166", + "output000003.ppm" => "f4324b1d944d4541948cd8d0221a8c89", + "output000004.ppm" => "f01e6f29b62abf96f0ef58ba34328fa5" + }, + + rgb => + { + "output000000.ppm" => "415f11d450796f2a0c181b4fe2bba462", + "output000001.ppm" => "920db15b73c796c31b11dade8e802a1c", + "output000002.ppm" => "c0dbe650840584e222df6de880debe1d", + "output000003.ppm" => "f0fa9f76d284f3082ffdb2d4790de300", + "output000004.ppm" => "bfd12d139827eab1974a8b32f871d5d2" + } + } + }, + + ffmpeg => + { + "mpeg2" => + { + yuv => + { + "output.m2v" => "58a158043a2ed9dce23c5892af4fe39d" + }, + + rgb => + { + "output.m2v" => "af88136aaa2e5c69a1cd418e15d6ef0f" + } + }, + + "mpeg4" => + { + yuv => + { + "output" => "350c502d87ed9e4a3bb8c1567f8cdc3e" + }, + + rgb => + { + "output" => "6026db8ebfdefccbdc5f4c37f5ac3938" + } + } + } + }, + + filter => + { + } +); + +sub checkfiles($ $ $ $) +{ + my($type, $module, $codec, $mode) = @_; + my($file, $fsfile, $file1, $sum, $sum1, $result); + + $result = 0; + + for $file (sort(keys(%{$testdata{$type}{$module}{$codec}{$mode}}))) + { + $fsfile = "$module-$codec-$mode-$file"; + + printf(" Checking file %s: ", $file); + + if(! -f $fsfile) + { + printf("FAILED (file not found)\n"); + $result = 1; + next; + } + + $sum = $testdata{$type}{$module}{$codec}{$mode}{$file}; + + ($sum1, $file1) = split(" ", qx[md5sum $fsfile]); + + if($sum ne $sum1) + { + printf("FAILED (bad checksum) [%s != %s]\n", $sum, $sum1); + $result= 1; + next; + } + + printf("OK\n"); + } + + return($result); +} + +sub testmodule($ $ $ $ $ $ $) +{ + my($type, $import_module, $import_file, $export_module, $export_file, $mode, $codec) = @_; + my($cmdline, $fsfile); + + $fsfile = "$export_module-$codec-$mode-$export_file"; + + if($type ne "filter") + { + $cmdline = "transcode -H 0 -c 0-5 -i $import_file -x $import_module,null -o $fsfile -y $export_module,null >> log 2>&1"; + } + else + { + return(1); + } + + $cmdline .= " -V rgb24" if($mode eq "rgb"); + $cmdline .= " -F $codec" if(defined($codec) && $codec ne ""); + + open(my($fd), ">>log"); + printf $fd (">>> $cmdline\n"); + close($fd); + + return(1) if(system($cmdline)); + + return(0); +} + +sub main($) +{ + my($frame, $name, @allnames, @report); + my($module, $mode, $sum, $result); + my($import_module, $import_file, $export_module, $export_file); + + mkdir($testdir); + chdir($testdir); + + unlink("log"); + + if(! -f "testimg.ppm") + { + printf("Generating base testimage\n"); + if(system(q[convert xc:black -resize 720x576! \ + -fill red -draw "rectangle 0,0,213,480" \ + -fill green -draw "rectangle 214,0,426,480" \ + -fill blue -draw "rectangle 427,0,640,480" \ + -fill white -font "-*-helvetica-bold-r-*-*-24-*-*-*-*-*-*-1" \ + -fill white -draw "text 100,240 'RED'" \ + -draw "text 313,240 'GREEN'" \ + -draw "text 526,240 'BLUE'" -quality 100 testimg.ppm >> log 2>&1])) + { + die("convert"); + } + } + + for($frame = 0; $frame < $frames; $frame++) + { + $name = sprintf("testframe-%3.3d.ppm", $frame); + + if(! -f $name) + { + printf("Generating test frame $name\n"); + + if(system(q[convert xc:black -resize 720x576! \ + -fill red -draw "rectangle 0,0,213,480" \ + -fill green -draw "rectangle 214,0,426,480" \ + -fill blue -draw "rectangle 427,0,640,480" \ + -fill white -font "-*-helvetica-bold-r-*-*-24-*-*-*-*-*-*-1" \ + -fill white -draw "text 100,240 'RED'" \ + -draw "text 313,240 'GREEN'" \ + -draw "text 526,240 'BLUE'" \ + -draw "text 300,400] . qq['Frame #$frame'" ] . + qq[-format ppm $name >> log 2>&1])) + { + die("convert"); + } + } + + push(@allnames, $name); + } + + if(! -f "testmovie.yuv4mpeg") + { + printf("Generating test movie\n"); + + if(system("cat " . join(" ", @allnames) . " | ppmtoy4m -F 25:1 -A 59:54 -I t -L -S 420mpeg2 > testmovie.yuv4mpeg 2>> log")) + { + die("ppmtoy4m"); + } + } + + if(qx[md5sum testmovie.yuv4mpeg 2>> log] !~ /^485df9fc04b510eb9d09af1d0b445307\b/) + { + die("testmovie.yuv4mpeg md5sum incorrect"); + } + + for $type (sort(keys(%testdata))) + { + for $module (sort(keys(%{$testdata{$type}}))) + { + for $codec (sort(keys(%{$testdata{$type}{$module}}))) + { + for $mode (sort(keys(%{$testdata{$type}{$module}{$codec}}))) + { + printf("Testing %s_%s in %s mode\n", $type, $module, $mode); + + if($type eq "import") + { + $import_module = $module; + $import_file = "testmovie.$import_module"; + $export_module = "yuv4mpeg"; + $export_file = "output"; + } + else + { + if($type eq "export") + { + $import_module = "yuv4mpeg"; + $import_file = "testmovie.yuv4mpeg"; + $export_module = $module; + $export_file = "output"; + } + else + { + # filter + } + } + + $result = testmodule($type, $import_module, $import_file, $export_module, $export_file, $mode, $codec); + $result = checkfiles($type, $module, $codec, $mode) if(!$result); + push(@report, sprintf("%-16.16s %8.8s %4.4s %6.6s", $type . "_" . $module, $codec, $mode, $result ? "FAILED" : "OK")); + } + } + } + } + + printf("\n"); + printf("%-16.16s %8.8s %-4.4s %-6.6s\n", "module", "codec", "mode", "result"); + printf("%s %s %s %s\n", "-" x 16, "-" x 8, "-" x 4, "-" x 6); + printf(join("\n", @report)); + printf("\n%s\n", "-" x 37); + + open(my($fd), ">>log"); + printf $fd ("\n"); + printf $fd ("%-16.16s %8.8s %-4.4s %-6.6s\n", "module", "codec", "mode", "result"); + printf $fd ("%s %s %s %s\n", "-" x 16, "-" x 8, "-" x 4, "-" x 6); + printf $fd (join("\n", @report)); + printf $fd ("\n%s\n", "-" x 37); + close($fd); + +} + +exit(main(%ARGV)); |
