Add tests

This commit is contained in:
darealshinji 2015-12-19 08:24:35 +01:00
parent c18d85fb6a
commit 8427a85d36
7 changed files with 225 additions and 192 deletions

8
.gitignore vendored
View file

@ -15,8 +15,8 @@
.deps
.dirstamp
.libs
/Makefile
/Makefile.in
Makefile
Makefile.in
/aclocal.m4
/autom4te.cache
/build-aux
@ -26,7 +26,6 @@
/configure
/kvazaar
/libtool
/libkvazaar.la
/m4
/stamp-h1
@ -41,8 +40,11 @@
configure.scan
src/kvazaar
src/libkvazaar.a
src/libkvazaar.la
src/libkvazaar.so.*
src/kvazaar.dll
src/libkvazaar.dll.a
src/libkvazaar.*.dylib
src/kvazaar.pc
tests/kvazaar_tests
tests/kvazaar_tests.trs

View file

@ -1,9 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
bin_PROGRAMS = kvazaar
lib_LTLIBRARIES = libkvazaar.la
SUBDIRS = src tests
dist_doc_DATA = COPYING CREDITS README.md
@ -13,182 +10,4 @@ EXTRA_DIST = \
docs.doxy \
greatest \
SConstruct \
tests \
tools \
src/Makefile \
src/SConscript \
src/extras/getopt.c \
src/extras/getopt.h
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = src/kvazaar.pc
include_HEADERS = \
src/kvazaar.h \
src/kvazaar_version.h
noinst_HEADERS = \
src/extras/x86inc.asm
kvazaar_SOURCES = \
src/encmain.c \
src/cli.h \
src/cli.c \
src/yuv_io.c \
src/yuv_io.h
kvazaar_LDADD = libkvazaar.la $(LIBS)
libkvazaar_la_SOURCES = \
src/bitstream.c \
src/bitstream.h \
src/cabac.c \
src/cabac.h \
src/checkpoint.c \
src/checkpoint.h \
src/config.c \
src/config.h \
src/context.c \
src/context.h \
src/cu.c \
src/cu.h \
src/encoder.c \
src/encoder.h \
src/encoderstate.c \
src/encoderstate.h \
src/encoder_state-bitstream.c \
src/encoder_state-bitstream.h \
src/encoder_state-ctors_dtors.c \
src/encoder_state-ctors_dtors.h \
src/encoder_state-geometry.c \
src/encoder_state-geometry.h \
src/filter.c \
src/filter.h \
src/global.h \
src/image.c \
src/image.h \
src/imagelist.c \
src/imagelist.h \
src/input_frame_buffer.c \
src/input_frame_buffer.h \
src/inter.c \
src/interface_main.c \
src/inter.h \
src/intra.c \
src/intra.h \
src/kvazaar.c \
src/kvazaar_internal.h \
src/nal.c \
src/nal.h \
src/rate_control.c \
src/rate_control.h \
src/rdo.c \
src/rdo.h \
src/sao.c \
src/sao.h \
src/scalinglist.c \
src/scalinglist.h \
src/search.c \
src/search.h \
src/search_inter.c \
src/search_inter.h \
src/search_intra.c \
src/search_intra.h \
src/tables.c \
src/tables.h \
src/threadqueue.c \
src/threadqueue.h \
src/threads.h \
src/transform.c \
src/transform.h \
src/videoframe.c \
src/videoframe.h \
src/strategies/altivec/picture-altivec.c \
src/strategies/altivec/picture-altivec.h \
src/strategies/generic/dct-generic.c \
src/strategies/generic/dct-generic.h \
src/strategies/generic/intra-generic.c \
src/strategies/generic/intra-generic.h \
src/strategies/generic/ipol-generic.c \
src/strategies/generic/ipol-generic.h \
src/strategies/generic/nal-generic.c \
src/strategies/generic/nal-generic.h \
src/strategies/generic/picture-generic.c \
src/strategies/generic/picture-generic.h \
src/strategies/generic/quant-generic.c \
src/strategies/generic/quant-generic.h \
src/strategies/sse2/picture-sse2.c \
src/strategies/sse2/picture-sse2.h \
src/strategies/sse41/picture-sse41.c \
src/strategies/sse41/picture-sse41.h \
src/strategies/strategies-common.h \
src/strategies/strategies-dct.c \
src/strategies/strategies-dct.h \
src/strategies/strategies-intra.c \
src/strategies/strategies-intra.h \
src/strategies/strategies-ipol.c \
src/strategies/strategies-ipol.h \
src/strategies/strategies-nal.c \
src/strategies/strategies-nal.h \
src/strategies/strategies-picture.c \
src/strategies/strategies-picture.h \
src/strategies/strategies-quant.c \
src/strategies/strategies-quant.h \
src/strategies/x86_asm/picture-x86-asm.c \
src/strategies/x86_asm/picture-x86-asm.h \
src/strategyselector.c \
src/strategyselector.h
avx2_sources = \
src/strategies/avx2/dct-avx2.c \
src/strategies/avx2/dct-avx2.h \
src/strategies/avx2/intra-avx2.c \
src/strategies/avx2/intra-avx2.h \
src/strategies/avx2/ipol-avx2.c \
src/strategies/avx2/ipol-avx2.h \
src/strategies/avx2/picture-avx2.c \
src/strategies/avx2/picture-avx2.h \
src/strategies/avx2/quant-avx2.c \
src/strategies/avx2/quant-avx2.h
libkvazaar_la_SOURCES += $(avx2_sources)
libkvazaar_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-number $(KVZ_API_VERSION)
if HAVE_PPC
src/strategies/altivec/picture-altivec.lo: CFLAGS += -maltivec
else #HAVE_PPC
if HAVE_X86
src/strategies/sse2/picture-sse2.lo: CFLAGS += -msse2
src/strategies/sse41/picture-sse41.lo: CFLAGS += -msse4.1
$(avx2_sources): CFLAGS += -mavx2
if ENABLE_ASM
libkvazaar_la_SOURCES += \
src/strategies/x86_asm/picture-x86-asm-sad.asm \
src/strategies/x86_asm/picture-x86-asm-sad.h \
src/strategies/x86_asm/picture-x86-asm-satd.asm \
src/strategies/x86_asm/picture-x86-asm-satd.h
src/strategies/x86_asm/picture-x86-asm.lo: CFLAGS += -DKVZ_COMPILE_ASM
src/strategies/x86_asm/picture-x86-asm-sad.lo: src/strategies/x86_asm/picture-x86-asm-sad.asm
src/strategies/x86_asm/picture-x86-asm-satd.lo: src/strategies/x86_asm/picture-x86-asm-satd.asm
endif #ENABLE_ASM
endif #HAVE_X86
endif #HAVE_PPC
yasm_verbose = $(yasm_verbose_@AM_V@)
yasm_verbose_ = $(yasm_verbose_@AM_DEFAULT_V@)
yasm_verbose_0 = @echo " YASM " $@;
.asm.lo:
$(yasm_verbose)$(LIBTOOL) --mode=compile $(YASM) $(ASFLAGS) $< -o $@ -prefer-non-pic 1>/dev/null
tools

6
autogen.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
git submodule init
git submodule update
mkdir -p m4
autoreconf -if

View file

@ -2,6 +2,11 @@
AC_INIT([kvazaar], m4_esyscmd([printf $(awk '/#define KVZ_VERSION/ { print $3 }' src/global.h)]))
AC_CONFIG_SRCDIR([src/encmain.c])
# Library version number
ver_major=2
ver_minor=2
ver_release=0
# not used, but it prevents configure from adding a lot of defines to the CFLAGS
AC_CONFIG_HEADERS([config.h])
@ -18,7 +23,6 @@ LT_INIT([win32-dll])
CFLAGS="-Wall -Wtype-limits -Wvla -I$srcdir/src -ftree-vectorize -fvisibility=hidden -std=gnu99 -DKVZ_DLL_EXPORTS $CFLAGS"
ASFLAGS="-I$srcdir/src/extras $ASFLAGS"
LIBS="-lm $LIBS"
@ -57,7 +61,7 @@ AS_CASE([$host_os],
ASFLAGS="$ASFLAGS -f elf$BITS"
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread -Wl,-z,noexecstack"
LIBS="$LIBS -lpthread"
LIBS="$LIBS -lrt -lpthread"
]
)
@ -88,13 +92,13 @@ AC_SUBST([ASFLAGS])
#KVZ_API_VERSION="$($AWK '/#define KVZ_API_VERSION/ { print $3 }' $srcdir/src/kvazaar_version.h)"
# use library version for sonames (specified in src/Makefile)
ver_major="$($AWK '/^VER_MAJOR/ { print $3 }' $srcdir/src/Makefile)"
ver_minor="$($AWK '/^VER_MINOR/ { print $3 }' $srcdir/src/Makefile)"
ver_release="$($AWK '/^VER_RELEASE/ { print $3 }' $srcdir/src/Makefile)"
KVZ_API_VERSION="$ver_major:$ver_minor:$ver_release"
AC_SUBST([KVZ_API_VERSION])
AC_CONFIG_FILES([Makefile src/kvazaar.pc])
AC_CONFIG_FILES([Makefile
src/Makefile
src/kvazaar.pc
tests/Makefile])
AC_OUTPUT

183
src/Makefile.am Normal file
View file

@ -0,0 +1,183 @@
bin_PROGRAMS = kvazaar
lib_LTLIBRARIES = libkvazaar.la
EXTRA_DIST = \
Makefile-old \
SConscript \
extras/getopt.c \
extras/getopt.h
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = kvazaar.pc
include_HEADERS = \
kvazaar.h \
kvazaar_version.h
noinst_HEADERS = \
extras/x86inc.asm
kvazaar_SOURCES = \
encmain.c \
cli.h \
cli.c \
yuv_io.c \
yuv_io.h
kvazaar_LDADD = libkvazaar.la $(LIBS)
libkvazaar_la_SOURCES = \
bitstream.c \
bitstream.h \
cabac.c \
cabac.h \
checkpoint.c \
checkpoint.h \
config.c \
config.h \
context.c \
context.h \
cu.c \
cu.h \
encoder.c \
encoder.h \
encoderstate.c \
encoderstate.h \
encoder_state-bitstream.c \
encoder_state-bitstream.h \
encoder_state-ctors_dtors.c \
encoder_state-ctors_dtors.h \
encoder_state-geometry.c \
encoder_state-geometry.h \
filter.c \
filter.h \
global.h \
image.c \
image.h \
imagelist.c \
imagelist.h \
input_frame_buffer.c \
input_frame_buffer.h \
inter.c \
interface_main.c \
inter.h \
intra.c \
intra.h \
kvazaar.c \
kvazaar_internal.h \
nal.c \
nal.h \
rate_control.c \
rate_control.h \
rdo.c \
rdo.h \
sao.c \
sao.h \
scalinglist.c \
scalinglist.h \
search.c \
search.h \
search_inter.c \
search_inter.h \
search_intra.c \
search_intra.h \
tables.c \
tables.h \
threadqueue.c \
threadqueue.h \
threads.h \
transform.c \
transform.h \
videoframe.c \
videoframe.h \
strategies/altivec/picture-altivec.c \
strategies/altivec/picture-altivec.h \
strategies/generic/dct-generic.c \
strategies/generic/dct-generic.h \
strategies/generic/intra-generic.c \
strategies/generic/intra-generic.h \
strategies/generic/ipol-generic.c \
strategies/generic/ipol-generic.h \
strategies/generic/nal-generic.c \
strategies/generic/nal-generic.h \
strategies/generic/picture-generic.c \
strategies/generic/picture-generic.h \
strategies/generic/quant-generic.c \
strategies/generic/quant-generic.h \
strategies/sse2/picture-sse2.c \
strategies/sse2/picture-sse2.h \
strategies/sse41/picture-sse41.c \
strategies/sse41/picture-sse41.h \
strategies/strategies-common.h \
strategies/strategies-dct.c \
strategies/strategies-dct.h \
strategies/strategies-intra.c \
strategies/strategies-intra.h \
strategies/strategies-ipol.c \
strategies/strategies-ipol.h \
strategies/strategies-nal.c \
strategies/strategies-nal.h \
strategies/strategies-picture.c \
strategies/strategies-picture.h \
strategies/strategies-quant.c \
strategies/strategies-quant.h \
strategies/x86_asm/picture-x86-asm.c \
strategies/x86_asm/picture-x86-asm.h \
strategyselector.c \
strategyselector.h
avx2_sources = \
strategies/avx2/dct-avx2.c \
strategies/avx2/dct-avx2.h \
strategies/avx2/intra-avx2.c \
strategies/avx2/intra-avx2.h \
strategies/avx2/ipol-avx2.c \
strategies/avx2/ipol-avx2.h \
strategies/avx2/picture-avx2.c \
strategies/avx2/picture-avx2.h \
strategies/avx2/quant-avx2.c \
strategies/avx2/quant-avx2.h
libkvazaar_la_SOURCES += $(avx2_sources)
libkvazaar_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-number $(KVZ_API_VERSION)
if HAVE_PPC
strategies/altivec/picture-altivec.lo: CFLAGS += -maltivec
else #HAVE_PPC
if HAVE_X86
strategies/sse2/picture-sse2.lo: CFLAGS += -msse2
strategies/sse41/picture-sse41.lo: CFLAGS += -msse4.1
$(avx2_sources): CFLAGS += -mavx2
if ENABLE_ASM
libkvazaar_la_SOURCES += \
strategies/x86_asm/picture-x86-asm-sad.asm \
strategies/x86_asm/picture-x86-asm-sad.h \
strategies/x86_asm/picture-x86-asm-satd.asm \
strategies/x86_asm/picture-x86-asm-satd.h
strategies/x86_asm/picture-x86-asm.lo: CFLAGS += -DKVZ_COMPILE_ASM
strategies/x86_asm/picture-x86-asm-sad.lo: strategies/x86_asm/picture-x86-asm-sad.asm
strategies/x86_asm/picture-x86-asm-satd.lo: strategies/x86_asm/picture-x86-asm-satd.asm
endif #ENABLE_ASM
endif #HAVE_X86
endif #HAVE_PPC
yasm_verbose = $(yasm_verbose_@AM_V@)
yasm_verbose_ = $(yasm_verbose_@AM_DEFAULT_V@)
yasm_verbose_0 = @echo " YASM " $@;
.asm.lo:
$(yasm_verbose)$(LIBTOOL) --mode=compile $(YASM) -I$(srcdir)/extras $(ASFLAGS) $< -o $@ -prefer-non-pic 1>/dev/null

19
tests/Makefile.am Normal file
View file

@ -0,0 +1,19 @@
TESTS = $(check_PROGRAMS)
check_PROGRAMS = kvazaar_tests
kvazaar_tests_SOURCES = \
dct_tests.c \
intra_sad_tests.c \
sad_tests.c \
sad_tests.h \
satd_tests.c \
satd_tests.h \
speed_tests.c \
tests_main.c \
test_strategies.c \
test_strategies.h
kvazaar_tests_CFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/src
kvazaar_tests_LDFLAGS = -static $(top_builddir)/src/libkvazaar.la $(LIBS)