annotate Makefile @ 24:377dc78a052d

Add EXIF metadata conversion from TIFF files to BPG via libexif.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 10 May 2017 14:09:07 +0300
parents bbd61622856a
children a6e6f87414ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 # libbpg Makefile
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 #
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 # Compile options:
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 #
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 # Enable compilation of Javascript decoder with Emscripten
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 #USE_EMCC=y
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 # Enable x265 for the encoder
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 USE_X265=y
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 # Enable the JCTVC code (best quality but slow) for the encoder
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 #USE_JCTVC=y
24
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
11
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
12 # Use libexif (currently only for converting TIFF metadata to EXIF in BPG)
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
13 USE_LIBEXIF=y
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
14
0
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 # Compile bpgview (SDL and SDL_image libraries needed)
2
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
16
0
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 USE_BPGVIEW=y
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 # Enable it to use bit depths > 12 (need more tests to validate encoder)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 #USE_JCTVC_HIGH_BIT_DEPTH=y
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 # Enable the cross compilation for Windows
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 #CONFIG_WIN32=y
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 # Enable for compilation on MacOS X
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #CONFIG_APPLE=y
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 # Installation prefix
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 prefix=/usr/local
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 #################################
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 ifdef CONFIG_WIN32
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 CROSS_PREFIX:=x86_64-w64-mingw32-
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 #CROSS_PREFIX=i686-w64-mingw32-
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 EXE:=.exe
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 else
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 CROSS_PREFIX:=
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 EXE:=
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 endif
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 CC=$(CROSS_PREFIX)gcc
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 CXX=$(CROSS_PREFIX)g++
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 AR=$(CROSS_PREFIX)ar
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 EMCC=emcc
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 PWD:=$(shell pwd)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
2
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
46 LIBSDL_CFLAGS:=$(shell pkg-config --cflags sdl)
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
47 LIBSDL_LDFLAGS:=$(shell pkg-config --libs sdl) -lSDL_image
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
48
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
49 LIBPNG_CFLAGS:=$(shell pkg-config --cflags libpng)
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
50 LIBPNG_LDFLAGS:=$(shell pkg-config --libs libpng)
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
51
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
52 LIBJPEG_CFLAGS:=$(shell pkg-config --cflags libjpeg)
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
53 LIBJPEG_LDFLAGS:=$(shell pkg-config --libs libjpeg)
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
54
24
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
55 ifdef USE_LIBEXIF
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
56 LIBEXIF_CFLAGS:=$(shell pkg-config --cflags libexif) -DHAVE_LIBEXIF
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
57 LIBEXIF_LDFLAGS:=$(shell pkg-config --libs libexif)
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
58 endif
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
59
4
bbd61622856a Initial implementation of TIFF format read support via libtiff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2
diff changeset
60 LIBTIFF_CFLAGS:=$(shell pkg-config --cflags libtiff-4)
bbd61622856a Initial implementation of TIFF format read support via libtiff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2
diff changeset
61 LIBTIFF_LDFLAGS:=$(shell pkg-config --libs libtiff-4)
bbd61622856a Initial implementation of TIFF format read support via libtiff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2
diff changeset
62
0
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 CFLAGS:=-Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT
24
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
65 CFLAGS+=-I. $(LIBSDL_CFLAGS) $(LIBPNG_CFLAGS) $(LIBJPEG_CFLAGS) $(LIBTIFF_CFLAGS) $(LIBEXIF_CFLAGS)
0
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 CFLAGS+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\"
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 ifdef USE_JCTVC_HIGH_BIT_DEPTH
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 CFLAGS+=-DRExt__HIGH_BIT_DEPTH_SUPPORT
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 endif
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 # Emscriptem config
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 EMLDFLAGS:=-s "EXPORTED_FUNCTIONS=['_bpg_decoder_open','_bpg_decoder_decode','_bpg_decoder_get_info','_bpg_decoder_start','_bpg_decoder_get_frame_duration','_bpg_decoder_get_line','_bpg_decoder_close','_malloc','_free']"
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 EMLDFLAGS+=-s NO_FILESYSTEM=1 -s NO_BROWSER=1
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 #EMLDFLAGS+=-O1 --pre-js pre.js --post-js post.js
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 # Note: the closure compiler is disabled because it adds unwanted global symbols
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 EMLDFLAGS+=-O3 --memory-init-file 0 --closure 0 --pre-js pre.js --post-js post.js
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 EMCFLAGS:=$(CFLAGS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 LDFLAGS=-g
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 ifdef CONFIG_APPLE
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 LDFLAGS+=-Wl,-dead_strip
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 else
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 LDFLAGS+=-Wl,--gc-sections
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 endif
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 CFLAGS+=-g
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 CXXFLAGS=$(CFLAGS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 PROGS=bpgdec$(EXE) bpgenc$(EXE)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 ifdef USE_BPGVIEW
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 PROGS+=bpgview$(EXE)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 endif
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 ifdef USE_EMCC
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 PROGS+=bpgdec.js bpgdec8.js bpgdec8a.js
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 endif
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 all: $(PROGS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 LIBBPG_OBJS:=$(addprefix libavcodec/, \
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 hevc_cabac.o hevc_filter.o hevc.o hevcpred.o hevc_refs.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 hevcdsp.o hevc_mvs.o hevc_ps.o hevc_sei.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 utils.o cabac.o golomb.o videodsp.o )
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 LIBBPG_OBJS+=$(addprefix libavutil/, mem.o buffer.o log2_tab.o frame.o pixdesc.o md5.o )
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 LIBBPG_OBJS+=libbpg.o
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 LIBBPG_JS_OBJS:=$(patsubst %.o, %.js.o, $(LIBBPG_OBJS)) tmalloc.js.o
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 LIBBPG_JS8_OBJS:=$(patsubst %.o, %.js8.o, $(LIBBPG_OBJS)) tmalloc.js8.o
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 LIBBPG_JS8A_OBJS:=$(patsubst %.o, %.js8a.o, $(LIBBPG_OBJS)) tmalloc.js8a.o
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 $(LIBBPG_OBJS): CFLAGS+=-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DHAVE_AV_CONFIG_H -std=c99 -D_GNU_SOURCE=1 -DUSE_VAR_BIT_DEPTH -DUSE_PRED
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 $(LIBBPG_JS_OBJS): EMCFLAGS+=-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DHAVE_AV_CONFIG_H -std=c99 -D_GNU_SOURCE=1 -DUSE_VAR_BIT_DEPTH
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 $(LIBBPG_JS8_OBJS): EMCFLAGS+=-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DHAVE_AV_CONFIG_H -std=c99 -D_GNU_SOURCE=1
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 $(LIBBPG_JS8A_OBJS): EMCFLAGS+=-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DHAVE_AV_CONFIG_H -std=c99 -D_GNU_SOURCE=1 -DUSE_PRED
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 BPGENC_OBJS:=bpgenc.o
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 BPGENC_LIBS:=
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 ifdef USE_X265
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 X265_LIBS:=./x265.out/8bit/libx265.a ./x265.out/10bit/libx265.a ./x265.out/12bit/libx265.a
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 BPGENC_OBJS+=x265_glue.o $(X265_LIBS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 bpgenc.o: CFLAGS+=-DUSE_X265
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 x265_glue.o: CFLAGS+=-I./x265/source -I./x265.out/8bit
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 x265_glue.o: $(X265_LIBS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 ifdef CONFIG_WIN32
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 CMAKE_OPTS:=-DCMAKE_TOOLCHAIN_FILE=../../x265/build/msys/toolchain-x86_64-w64-mingw32.cmake
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133 else
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 CMAKE_OPTS:=
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 endif
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 x265.out:
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 mkdir -p x265.out/8bit x265.out/10bit x265.out/12bit
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 cd x265.out/12bit && cmake ../../x265/source $(CMAKE_OPTS) -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 cd x265.out/10bit && cmake ../../x265/source $(CMAKE_OPTS) -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN10=ON
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141 cd x265.out/8bit && cmake ../../x265/source $(CMAKE_OPTS) -DLINKED_10BIT=ON -DLINKED_12BIT=ON -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 # use this target to manually rebuild x265
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 x265_make: | x265.out
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 $(MAKE) -C x265.out/12bit
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146 $(MAKE) -C x265.out/10bit
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 $(MAKE) -C x265.out/8bit
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 x265_clean:
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150 rm -rf x265.out
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 $(X265_LIBS): x265_make
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154 else
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 x265_clean:
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 endif # USE_X265
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 ifdef USE_JCTVC
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 JCTVC_OBJS=$(addprefix jctvc/TLibEncoder/, SyntaxElementWriter.o TEncSbac.o \
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 TEncBinCoderCABACCounter.o TEncGOP.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163 TEncSampleAdaptiveOffset.o TEncBinCoderCABAC.o TEncAnalyze.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164 TEncEntropy.o TEncTop.o SEIwrite.o TEncPic.o TEncRateCtrl.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 WeightPredAnalysis.o TEncSlice.o TEncCu.o NALwrite.o TEncCavlc.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 TEncSearch.o TEncPreanalyzer.o)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 JCTVC_OBJS+=jctvc/TLibVideoIO/TVideoIOYuv.o
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 JCTVC_OBJS+=$(addprefix jctvc/TLibCommon/, TComWeightPrediction.o TComLoopFilter.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 TComBitStream.o TComMotionInfo.o TComSlice.o ContextModel3DBuffer.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 TComPic.o TComRdCostWeightPrediction.o TComTU.o TComPicSym.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 TComPicYuv.o TComYuv.o TComTrQuant.o TComInterpolationFilter.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
172 ContextModel.o TComSampleAdaptiveOffset.o SEI.o TComPrediction.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
173 TComDataCU.o TComChromaFormat.o Debug.o TComRom.o\
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 TComPicYuvMD5.o TComRdCost.o TComPattern.o TComCABACTables.o)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 JCTVC_OBJS+=jctvc/libmd5/libmd5.o
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176 JCTVC_OBJS+=jctvc/TAppEncCfg.o jctvc/TAppEncTop.o jctvc/program_options_lite.o
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178 $(JCTVC_OBJS) jctvc_glue.o: CFLAGS+=-I$(PWD)/jctvc -Wno-sign-compare
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
180 jctvc/libjctvc.a: $(JCTVC_OBJS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181 $(AR) rcs $@ $^
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183 BPGENC_OBJS+=jctvc_glue.o jctvc/libjctvc.a
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185 bpgenc.o: CFLAGS+=-DUSE_JCTVC
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186 endif # USE_JCTVC
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 ifdef CONFIG_WIN32
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191 BPGDEC_LIBS:=-lpng -lz
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 BPGENC_LIBS+=-lpng -ljpeg -lz
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193 BPGVIEW_LIBS:=-lmingw32 -lSDLmain -lSDL_image -lSDL -mwindows
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
195 else
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
196
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197 ifdef CONFIG_APPLE
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198 LIBS:=
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199 else
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200 LIBS:=-lrt
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201 endif # !CONFIG_APPLE
2
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
202
0
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
203 LIBS+=-lm -lpthread
2
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
204 BPGDEC_LIBS:=$(LIBPNG_LDFLAGS) $(LIBS)
24
377dc78a052d Add EXIF metadata conversion from TIFF files to BPG via libexif.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
205 BPGENC_LIBS+=$(LIBPNG_LDFLAGS) $(LIBJPEG_LDFLAGS) $(LIBTIFF_LDFLAGS) $(LIBEXIF_LDFLAGS) $(LIBS)
2
bb21eb1cd483 Use pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
206 BPGVIEW_LIBS:=$(LIBSDL_LDFLAGS) $(LIBS)
0
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
207
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
208 endif #!CONFIG_WIN32
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
209
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
210 bpgenc.o: CFLAGS+=-Wno-unused-but-set-variable
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
211
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212 libbpg.a: $(LIBBPG_OBJS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
213 $(AR) rcs $@ $^
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
215 bpgdec$(EXE): bpgdec.o libbpg.a
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
216 $(CC) $(LDFLAGS) -o $@ $^ $(BPGDEC_LIBS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
217
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
218 bpgenc$(EXE): $(BPGENC_OBJS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219 $(CXX) $(LDFLAGS) -o $@ $^ $(BPGENC_LIBS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
221 bpgview$(EXE): bpgview.o libbpg.a
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 $(CC) $(LDFLAGS) -o $@ $^ $(BPGVIEW_LIBS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224 bpgdec.js: $(LIBBPG_JS_OBJS) post.js
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225 $(EMCC) $(EMLDFLAGS) -s TOTAL_MEMORY=33554432 -o $@ $(LIBBPG_JS_OBJS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
227 bpgdec8.js: $(LIBBPG_JS8_OBJS) post.js
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
228 $(EMCC) $(EMLDFLAGS) -s TOTAL_MEMORY=33554432 -o $@ $(LIBBPG_JS8_OBJS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230 bpgdec8a.js: $(LIBBPG_JS8A_OBJS) post.js
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
231 $(EMCC) $(EMLDFLAGS) -s TOTAL_MEMORY=33554432 -o $@ $(LIBBPG_JS8A_OBJS)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
232
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233 size:
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
234 strip bpgdec
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
235 size bpgdec libbpg.o libavcodec/*.o libavutil/*.o | sort -n
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
236 gzip < bpgdec | wc
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
237
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
238 install: bpgenc bpgdec
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
239 install -s -m 755 $^ $(prefix)/bin
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
240
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
241 CLEAN_DIRS=doc html libavcodec libavutil \
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
242 jctvc jctvc/TLibEncoder jctvc/TLibVideoIO jctvc/TLibCommon jctvc/libmd5
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
243
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
244 clean: x265_clean
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
245 rm -f $(PROGS) *.o *.a *.d *~ $(addsuffix /*.o, $(CLEAN_DIRS)) \
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
246 $(addsuffix /*.d, $(CLEAN_DIRS)) $(addsuffix /*~, $(CLEAN_DIRS)) \
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
247 $(addsuffix /*.a, $(CLEAN_DIRS))
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
248
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
249 %.o: %.c
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
250 $(CC) $(CFLAGS) -c -o $@ $<
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
251
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
252 %.o: %.cpp
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
253 $(CXX) $(CXXFLAGS) -c -o $@ $<
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
254
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
255 %.js.o: %.c
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
256 $(EMCC) $(EMCFLAGS) -c -o $@ $<
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258 %.js8.o: %.c
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
259 $(EMCC) $(EMCFLAGS) -c -o $@ $<
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
260
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
261 %.js8a.o: %.c
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
262 $(EMCC) $(EMCFLAGS) -c -o $@ $<
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
263
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
264 -include $(wildcard *.d)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
265 -include $(wildcard libavcodec/*.d)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
266 -include $(wildcard libavutil/*.d)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
267 -include $(wildcard jctvc/*.d)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
268 -include $(wildcard jctvc/TLibEncoder/*.d)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
269 -include $(wildcard jctvc/TLibVideoIO/*.d)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
270 -include $(wildcard jctvc/TLibCommon/*.d)
772086c29cc7 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
271 -include $(wildcard jctvc/libmd5/*.d)