Fix compiling AVX2 strategies.

Option -mavx2 was omitted when compiling AVX2 strategies. This commit
moves strategies to convenience libraries so that their compilation
flags can be easily set and adds -mavx2 to CFLAGS of the AVX2 library.
This commit is contained in:
Arttu Ylä-Outinen 2016-01-20 10:59:15 +02:00
parent 8060e2f6ec
commit d452709795
2 changed files with 41 additions and 29 deletions

15
.gitignore vendored
View file

@ -33,21 +33,20 @@ Makefile.in
/stamp-h1 /stamp-h1
# Other files # Other files
*.exe *.a
*.o
*.lo
*.d *.d
*.dll
*.dylib
*.exe
*.la
*.lo
*.o
*.log *.log
.kdev4 .kdev4
configure.scan configure.scan
src/kvazaar src/kvazaar
src/libkvazaar.a
src/libkvazaar.la
src/libkvazaar.so.* src/libkvazaar.so.*
src/kvazaar.dll
src/libkvazaar.dll.a
src/libkvazaar.*.dylib
src/kvazaar.pc src/kvazaar.pc
tests/kvazaar_tests tests/kvazaar_tests
tests/kvazaar_tests.trs tests/kvazaar_tests.trs

View file

@ -1,4 +1,3 @@
bin_PROGRAMS = kvazaar bin_PROGRAMS = kvazaar
lib_LTLIBRARIES = libkvazaar.la lib_LTLIBRARIES = libkvazaar.la
@ -18,6 +17,11 @@ include_HEADERS = \
noinst_HEADERS = \ noinst_HEADERS = \
extras/x86inc.asm extras/x86inc.asm
noinst_LTLIBRARIES = \
libaltivec.la \
libavx2.la \
libsse2.la \
libsse41.la
kvazaar_SOURCES = \ kvazaar_SOURCES = \
encmain.c \ encmain.c \
@ -91,8 +95,6 @@ libkvazaar_la_SOURCES = \
transform.h \ transform.h \
videoframe.c \ videoframe.c \
videoframe.h \ videoframe.h \
strategies/altivec/picture-altivec.c \
strategies/altivec/picture-altivec.h \
strategies/generic/dct-generic.c \ strategies/generic/dct-generic.c \
strategies/generic/dct-generic.h \ strategies/generic/dct-generic.h \
strategies/generic/intra-generic.c \ strategies/generic/intra-generic.c \
@ -105,10 +107,6 @@ libkvazaar_la_SOURCES = \
strategies/generic/picture-generic.h \ strategies/generic/picture-generic.h \
strategies/generic/quant-generic.c \ strategies/generic/quant-generic.c \
strategies/generic/quant-generic.h \ 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-common.h \
strategies/strategies-dct.c \ strategies/strategies-dct.c \
strategies/strategies-dct.h \ strategies/strategies-dct.h \
@ -127,7 +125,20 @@ libkvazaar_la_SOURCES = \
strategyselector.c \ strategyselector.c \
strategyselector.h strategyselector.h
avx2_sources = \ libkvazaar_la_LIBADD = \
libaltivec.la \
libavx2.la \
libsse2.la \
libsse41.la
libkvazaar_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-number $(KVZ_API_VERSION)
libaltivec_la_SOURCES = \
strategies/altivec/picture-altivec.c \
strategies/altivec/picture-altivec.h
libavx2_la_SOURCES = \
strategies/avx2/dct-avx2.c \ strategies/avx2/dct-avx2.c \
strategies/avx2/dct-avx2.h \ strategies/avx2/dct-avx2.h \
strategies/avx2/intra-avx2.c \ strategies/avx2/intra-avx2.c \
@ -139,36 +150,38 @@ avx2_sources = \
strategies/avx2/quant-avx2.c \ strategies/avx2/quant-avx2.c \
strategies/avx2/quant-avx2.h strategies/avx2/quant-avx2.h
libkvazaar_la_SOURCES += $(avx2_sources) libsse2_la_SOURCES = \
libkvazaar_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-number $(KVZ_API_VERSION) strategies/sse2/picture-sse2.c \
strategies/sse2/picture-sse2.h
libsse41_la_SOURCES = \
strategies/sse41/picture-sse41.c \
strategies/sse41/picture-sse41.h
if HAVE_PPC if HAVE_PPC
libaltivec_la_CFLAGS = -maltivec
strategies/altivec/picture-altivec.lo: CFLAGS += -maltivec endif
else #HAVE_PPC
if HAVE_X86 if HAVE_X86
strategies/sse2/picture-sse2.lo: CFLAGS += -msse2 libavx2_la_CFLAGS = -mavx2
strategies/sse41/picture-sse41.lo: CFLAGS += -msse4.1 libsse2_la_CFLAGS = -msse2
$(avx2_sources): CFLAGS += -mavx2 libsse41_la_CFLAGS = -msse4.1
if ENABLE_ASM if ENABLE_ASM
libkvazaar_la_SOURCES += \ noinst_LTLIBRARIES += libasm.la
libkvazaar_la_LIBADD += libasm.la
libasm_la_SOURCES = \
strategies/x86_asm/picture-x86-asm-sad.asm \ strategies/x86_asm/picture-x86-asm-sad.asm \
strategies/x86_asm/picture-x86-asm-sad.h \ strategies/x86_asm/picture-x86-asm-sad.h \
strategies/x86_asm/picture-x86-asm-satd.asm \ strategies/x86_asm/picture-x86-asm-satd.asm \
strategies/x86_asm/picture-x86-asm-satd.h strategies/x86_asm/picture-x86-asm-satd.h
libasm_la_CFLAGS = -DKVZ_COMPILE_ASM
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-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 strategies/x86_asm/picture-x86-asm-satd.lo: strategies/x86_asm/picture-x86-asm-satd.asm
endif #ENABLE_ASM endif #ENABLE_ASM
endif #HAVE_X86 endif #HAVE_X86
endif #HAVE_PPC
yasm_verbose = $(yasm_verbose_@AM_V@) yasm_verbose = $(yasm_verbose_@AM_V@)
yasm_verbose_ = $(yasm_verbose_@AM_DEFAULT_V@) yasm_verbose_ = $(yasm_verbose_@AM_DEFAULT_V@)