2024-11-04 08:49:20 +00:00
|
|
|
.PHONY: build static debug windows windows-debug debian ubuntu clean \
|
2024-12-01 09:55:56 +00:00
|
|
|
test-realesrgan test-libplacebo test-rife \
|
|
|
|
memcheck-realesrgan memcheck-libplacebo memcheck-rife \
|
|
|
|
heaptrack-realesrgan heaptrack-libplacebo heaptrack-rife
|
2024-10-08 02:29:00 +00:00
|
|
|
|
|
|
|
BINDIR=build
|
|
|
|
CXX=clang++
|
|
|
|
|
2024-10-21 00:00:00 +00:00
|
|
|
TEST_VIDEO=data/standard-test.mp4
|
|
|
|
TEST_OUTPUT=data/output.mp4
|
|
|
|
|
2024-10-08 02:29:00 +00:00
|
|
|
build:
|
|
|
|
cmake -S . -B $(BINDIR) \
|
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
|
|
-DCMAKE_CXX_COMPILER=$(CXX) \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
cmake --build $(BINDIR) --config Release --parallel
|
|
|
|
cp $(BINDIR)/compile_commands.json .
|
|
|
|
|
|
|
|
static:
|
|
|
|
cmake -S . -B $(BINDIR) \
|
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
|
|
-DCMAKE_CXX_COMPILER=$(CXX) \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2024-12-16 00:00:00 +00:00
|
|
|
-DBUILD_SHARED_LIBS=OFF \
|
|
|
|
-DUSE_SYSTEM_NCNN=OFF \
|
|
|
|
-DUSE_SYSTEM_SPDLOG=OFF \
|
|
|
|
-DUSE_SYSTEM_BOOST=OFF
|
2024-10-08 02:29:00 +00:00
|
|
|
cmake --build $(BINDIR) --config Release --parallel
|
|
|
|
cp $(BINDIR)/compile_commands.json .
|
|
|
|
|
|
|
|
debug:
|
|
|
|
cmake -S . -B $(BINDIR) \
|
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
|
|
-DCMAKE_CXX_COMPILER=$(CXX) \
|
|
|
|
-DCMAKE_BUILD_TYPE=Debug
|
|
|
|
cmake --build $(BINDIR) --config Debug --parallel
|
|
|
|
cp $(BINDIR)/compile_commands.json .
|
|
|
|
|
2024-11-04 08:49:20 +00:00
|
|
|
windows:
|
|
|
|
cmake -S . -B $(BINDIR) \
|
|
|
|
-DUSE_SYSTEM_NCNN=OFF \
|
|
|
|
-DUSE_SYSTEM_SPDLOG=OFF \
|
|
|
|
-DUSE_SYSTEM_BOOST=OFF \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=build/libvideo2x-shared
|
|
|
|
cmake --build $(BINDIR) --config Release --parallel --target install
|
|
|
|
|
|
|
|
windows-debug:
|
|
|
|
cmake -S . -B $(BINDIR) \
|
|
|
|
-DUSE_SYSTEM_NCNN=OFF \
|
|
|
|
-DUSE_SYSTEM_SPDLOG=OFF \
|
|
|
|
-DUSE_SYSTEM_BOOST=OFF \
|
|
|
|
-DCMAKE_BUILD_TYPE=Debug \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=build/libvideo2x-shared
|
|
|
|
cmake --build $(BINDIR) --config Debug --parallel --target install
|
|
|
|
|
2024-10-10 07:23:13 +00:00
|
|
|
debian:
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
build-essential cmake clang pkg-config \
|
|
|
|
libavcodec-dev \
|
|
|
|
libavdevice-dev \
|
|
|
|
libavfilter-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libavutil-dev \
|
|
|
|
libswscale-dev \
|
|
|
|
libvulkan-dev \
|
|
|
|
glslang-tools \
|
2024-10-14 02:46:59 +00:00
|
|
|
libomp-dev \
|
2024-10-21 23:54:22 +00:00
|
|
|
libspdlog-dev \
|
2024-11-02 00:00:00 +00:00
|
|
|
libboost-program-options-dev
|
2024-12-16 00:00:00 +00:00
|
|
|
cmake -B /tmp/build -S . -DUSE_SYSTEM_NCNN=OFF -DCMAKE_CXX_COMPILER=$(CXX) \
|
2024-10-10 07:23:13 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/install \
|
|
|
|
-DINSTALL_BIN_DESTINATION=. -DINSTALL_INCLUDE_DESTINATION=include \
|
|
|
|
-DINSTALL_LIB_DESTINATION=. -DINSTALL_MODEL_DESTINATION=.
|
|
|
|
cmake --build /tmp/build --config Release --target install --parallel
|
|
|
|
|
2024-11-09 00:00:00 +00:00
|
|
|
ubuntu2404:
|
2024-10-31 00:00:00 +00:00
|
|
|
apt-get update
|
2024-11-09 00:00:00 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
2024-10-31 00:00:00 +00:00
|
|
|
build-essential cmake pkg-config \
|
|
|
|
libavcodec-dev \
|
|
|
|
libavdevice-dev \
|
|
|
|
libavfilter-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libavutil-dev \
|
|
|
|
libswscale-dev \
|
|
|
|
libvulkan-dev \
|
|
|
|
glslang-tools \
|
|
|
|
libomp-dev \
|
2024-11-02 00:00:00 +00:00
|
|
|
libboost-program-options-dev
|
2024-10-31 00:00:00 +00:00
|
|
|
cmake -B build -S . -DUSE_SYSTEM_NCNN=OFF -DUSE_SYSTEM_SPDLOG=OFF -DSPDLOG_NO_EXCEPTIONS=ON \
|
2024-12-16 00:00:00 +00:00
|
|
|
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=video2x-linux-ubuntu-amd64/usr
|
2024-11-09 00:00:00 +00:00
|
|
|
cmake --build build --config Release --target install --parallel
|
|
|
|
mkdir -p video2x-linux-ubuntu-amd64/DEBIAN
|
|
|
|
cp packaging/debian/control.ubuntu2404 video2x-linux-ubuntu-amd64/DEBIAN/control
|
|
|
|
dpkg-deb --build video2x-linux-ubuntu-amd64
|
|
|
|
|
|
|
|
ubuntu2204:
|
|
|
|
apt-get update
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
|
|
|
|
add-apt-repository -y ppa:ubuntuhandbook1/ffmpeg7
|
|
|
|
apt-get update
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
|
|
build-essential cmake \
|
|
|
|
libavcodec-dev \
|
|
|
|
libavdevice-dev \
|
|
|
|
libavfilter-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libavutil-dev \
|
|
|
|
libswscale-dev \
|
|
|
|
libvulkan-dev \
|
|
|
|
glslang-tools \
|
|
|
|
libomp-dev \
|
|
|
|
libboost-program-options-dev
|
|
|
|
cmake -B build -S . -DUSE_SYSTEM_NCNN=OFF -DUSE_SYSTEM_SPDLOG=OFF -DSPDLOG_NO_EXCEPTIONS=ON \
|
2024-12-16 00:00:00 +00:00
|
|
|
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=video2x-linux-ubuntu-amd64/usr
|
2024-10-31 00:00:00 +00:00
|
|
|
cmake --build build --config Release --target install --parallel
|
2024-11-09 00:00:00 +00:00
|
|
|
mkdir -p video2x-linux-ubuntu-amd64/DEBIAN
|
|
|
|
cp packaging/debian/control.ubuntu2204 video2x-linux-ubuntu-amd64/DEBIAN/control
|
|
|
|
dpkg-deb --build video2x-linux-ubuntu-amd64
|
2024-10-31 00:00:00 +00:00
|
|
|
|
2024-10-21 00:00:00 +00:00
|
|
|
clean:
|
2024-10-29 00:00:00 +00:00
|
|
|
rm -vrf $(BINDIR) data/output*.* heaptrack*.zst valgrind.log
|
2024-10-21 00:00:00 +00:00
|
|
|
|
2024-10-08 02:29:00 +00:00
|
|
|
test-realesrgan:
|
2024-10-21 00:00:00 +00:00
|
|
|
LD_LIBRARY_PATH=$(BINDIR) $(BINDIR)/video2x -i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
2024-12-01 09:55:56 +00:00
|
|
|
-p realesrgan -s 4 --realesrgan-model realesr-animevideov3
|
2024-10-08 02:29:00 +00:00
|
|
|
|
|
|
|
test-libplacebo:
|
2024-10-21 00:00:00 +00:00
|
|
|
LD_LIBRARY_PATH=$(BINDIR) $(BINDIR)/video2x -i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
2024-12-01 09:55:56 +00:00
|
|
|
-p libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a
|
|
|
|
|
|
|
|
test-rife:
|
|
|
|
LD_LIBRARY_PATH=$(BINDIR) $(BINDIR)/video2x -i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
|
|
|
-p rife -m 4 --rife-model rife-v4.6
|
2024-10-08 02:29:00 +00:00
|
|
|
|
2024-10-21 00:00:00 +00:00
|
|
|
memcheck-realesrgan:
|
2024-10-08 02:29:00 +00:00
|
|
|
LD_LIBRARY_PATH=$(BINDIR) valgrind \
|
|
|
|
--tool=memcheck \
|
|
|
|
--leak-check=full \
|
|
|
|
--show-leak-kinds=all \
|
|
|
|
--track-origins=yes \
|
|
|
|
--show-reachable=yes \
|
|
|
|
--verbose --log-file="valgrind.log" \
|
|
|
|
$(BINDIR)/video2x \
|
2024-10-21 00:00:00 +00:00
|
|
|
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
2024-12-01 09:55:56 +00:00
|
|
|
-p realesrgan -s 2 --realesrgan-model realesr-animevideov3 \
|
|
|
|
-e preset=veryfast -e crf=30
|
2024-10-08 02:29:00 +00:00
|
|
|
|
2024-10-21 00:00:00 +00:00
|
|
|
memcheck-libplacebo:
|
2024-10-08 02:29:00 +00:00
|
|
|
LD_LIBRARY_PATH=$(BINDIR) valgrind \
|
|
|
|
--tool=memcheck \
|
|
|
|
--leak-check=full \
|
|
|
|
--show-leak-kinds=all \
|
|
|
|
--track-origins=yes \
|
|
|
|
--show-reachable=yes \
|
|
|
|
--verbose --log-file="valgrind.log" \
|
|
|
|
$(BINDIR)/video2x \
|
2024-10-21 00:00:00 +00:00
|
|
|
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
2024-12-01 09:55:56 +00:00
|
|
|
-p libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a \
|
|
|
|
-e preset=veryfast -e crf=30
|
|
|
|
|
|
|
|
memcheck-rife:
|
|
|
|
LD_LIBRARY_PATH=$(BINDIR) valgrind \
|
|
|
|
--tool=memcheck \
|
|
|
|
--leak-check=full \
|
|
|
|
--show-leak-kinds=all \
|
|
|
|
--track-origins=yes \
|
|
|
|
--show-reachable=yes \
|
|
|
|
--verbose --log-file="valgrind.log" \
|
|
|
|
$(BINDIR)/video2x \
|
|
|
|
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
|
|
|
-p rife -m 4 --rife-model rife-v4.6 \
|
|
|
|
-e preset=veryfast -e crf=30
|
2024-10-08 02:29:00 +00:00
|
|
|
|
2024-10-21 00:00:00 +00:00
|
|
|
heaptrack-realesrgan:
|
|
|
|
LD_LIBRARY_PATH=$(BINDIR) HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
|
|
|
|
$(BINDIR)/video2x \
|
|
|
|
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
2024-12-01 09:55:56 +00:00
|
|
|
-p realesrgan -s 4 --realesrgan-model realesr-animevideov3 \
|
|
|
|
-e preset=veryfast -e crf=30
|
2024-10-21 00:00:00 +00:00
|
|
|
|
|
|
|
heaptrack-libplacebo:
|
|
|
|
LD_LIBRARY_PATH=$(BINDIR) HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
|
|
|
|
$(BINDIR)/video2x \
|
|
|
|
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
2024-12-01 09:55:56 +00:00
|
|
|
-p libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a \
|
|
|
|
-e preset=veryfast -e crf=30
|
|
|
|
|
|
|
|
heaptrack-rife:
|
|
|
|
LD_LIBRARY_PATH=$(BINDIR) HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
|
|
|
|
$(BINDIR)/video2x \
|
|
|
|
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
|
|
|
|
-p rife -m 4 --rife-model rife-v4.6 \
|
|
|
|
-e preset=veryfast -e crf=30
|