69 Commits

Author SHA1 Message Date
Salman Chishti
5909f627fb ci(*): upgrade GitHub Actions for Node 24 compatibility (#1454)
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
2026-01-27 08:04:06 +00:00
Salman Chishti
ce07604217 ci(*): upgrade GitHub Actions to latest versions (#1455)
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
2026-01-27 08:01:58 +00:00
k4yt3x
8a9e571114 feat(encoder): add separate audio/subtitle copy and recalculate PTS option
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-11-23 00:00:00 +00:00
k4yt3x
f3df895890 ci(build): update setup-vulkan-sdk to v1.2.1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-10-15 00:00:00 +00:00
k4yt3x
d848db037a deps(rife): update librife-ncnn-vulkan to fix ncnn compatibility issues
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-10-15 00:00:00 +00:00
Michael
feb84c3cae deps(ncnn): bump ncnn to 20250503 to fix black output frames on RADV (#1410)
Signed-off-by: Michael <mwp.foss@gmail.com>
2025-08-03 08:10:57 +00:00
k4yt3x
6bf0ee527d docs(readme): add hardware requirements
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-03-26 00:00:00 +00:00
k4yt3x
4668556417 docs(book): correct the renamed CLI arguments
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-03-23 00:00:00 +00:00
k4yt3x
d6403dc1a4 docs(readme): update file server URLs
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-03-09 00:00:00 +00:00
k4yt3x
66778b7feb docs(book): add docs for setting the encoder options
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-24 00:00:00 +00:00
k4yt3x
445d13b73b fix(libvideo2x): fix atomic int64_t frame_idx_ self add
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-08 00:00:00 +00:00
k4yt3x
8803cf10a4 fix(video2x): allow Real-ESRGAN noise to be -1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-08 00:00:00 +00:00
k4yt3x
3e987b9693 docs(book): update command arguments in the container usages (#1323)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-04 00:00:00 +00:00
k4yt3x
afa37f9e58 chore(models): add the Real-ESRGAN general models (#1319)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-02 00:00:00 +00:00
k4yt3x
2c5a059d39 build(arch): move PKGBUILD openmp from makedepends to depends
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-02 00:00:00 +00:00
lbrunkho
0585130f09 ci(dockerfile): add the missing openmp dependency (#1317) 2025-02-02 00:30:06 +00:00
k4yt3x
5d043cab3b docs(book): update Linux AppImage and Ubuntu build instructions
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-27 00:00:00 +00:00
Integral
73113feb38 docs: add archlinuxcn/video2x-qt6 to readme & linux installation guide (#1307) 2025-01-25 05:48:06 +00:00
k4yt3x
a0b8611ea2 docs(readme): update readme for 6.4.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-24 00:00:00 +00:00
k4yt3x
a96bda9b4d docs(changelog): update changelogs for 6.4.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-24 00:00:00 +00:00
k4yt3x
aecb16b467 feat(video2x): use boost::po to validate the required options
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-24 00:00:00 +00:00
k4yt3x
7d10fa2814 fix(encoder): re-add PTS calculation after processing for interpolators
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-21 00:00:00 +00:00
Dawei Feng
9d4b21b4c1 feat(rife): add support for rife v4.25 & v4.26 (#1304)
* chore(deps): update rife submodule
* update: add support for rife v4.25 & v4.26
* style(*): format code with clang-format

---------

Signed-off-by: k4yt3x <i@k4yt3x.com>
Co-authored-by: k4yt3x <i@k4yt3x.com>
2025-01-21 17:37:35 +00:00
k4yt3x
947788225e fix(encoder): fix a bug that causes the wrong encoder to be selected
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-20 00:00:00 +00:00
k4yt3x
eae89cea4b feat(libvideo2x): allow processing videos without PTS information
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-18 00:00:00 +00:00
k4yt3x
43ecf9e825 build(just): make CMake generator a variable
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-18 00:00:00 +00:00
k4yt3x
0bbee7c66b chore(models): remove the Real-ESRGAN x2 Plus model as it is broken
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-17 00:00:00 +00:00
k4yt3x
54b39643a9 style(*): format source code under tools with clang-format
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-14 00:00:00 +00:00
K4YT3X
031c0a72fb docs(issue): add issue templates (#1298) 2025-01-13 23:44:47 +00:00
k4yt3x
774fd4f8c2 fix(fsutils): fix resource finding in AppImage
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-11 00:00:00 +00:00
k4yt3x
55556e60a1 build(cmake): adjust installation paths on Windows 2025-01-10 16:19:34 -05:00
k4yt3x
49ce40b05f build(cmake): always use CMake install directory variables
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
b40beef9ab build(cmake): fix ncnn layer Reshape not found
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
b4b666af3e chore(models): add the Real-ESRGAN x2 Plus model
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
8b630cf0c7 build(appimage): add AppImage build script
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
68796e630e fix(*): fix missing ncnn features
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
ae9b69ac2e docs(book): update build instructions for Linux with just
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
6ab1759e1a docs(contributing): add contributing guidelines
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-09 00:00:00 +00:00
k4yt3x
9e27aed644 style(*): set deleted object pointers to nullptr
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-09 00:00:00 +00:00
k4yt3x
1edec941c7 build(cmake): fix libvideo2x output file name
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
k4yt3x
e7096887ed style(*): remove redundant nullptr checks on object deletion (#1288)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
Henje
8ffe1b84bd feat(encoder): copy input streams' metadata to output streams (#1284)
* feat(encoder): copy language tag for audio and subtitle streams

Containers with audio streams for different languages use a tag
to signal which track contains which language. This information is
saved in the metadata object of a stream and needs to be copied
in addition to the codec properties.

* feat(encoder): copy input streams' metadata to output streams

---------

Signed-off-by: k4yt3x <i@k4yt3x.com>
Co-authored-by: k4yt3x <i@k4yt3x.com>
2025-01-08 20:39:43 +00:00
k4yt3x
b1190d7591 build(just): add attributes and rename variables
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
k4yt3x
6b0ad2df03 build(cmake): fix build errors on Windows
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
k4yt3x
8687d7d175 build(cmake): reorganize CMakeLists.txt and make it compatible with Ninja
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
k4yt3x
953147ede7 style(*): convert all uses of NULL to nullptr
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-04 00:00:00 +00:00
k4yt3x
f38452ff94 fix(logging): fix logging statements not using the logger singleton
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-04 00:00:00 +00:00
k4yt3x
7c867b1b97 build(cmake): use GNU install directories
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-04 00:00:00 +00:00
k4yt3x
1668c8a050 docs(readme): update copyright year to 2025
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-04 00:00:00 +00:00
k4yt3x
a9b9a71e9b style(*): add .clang-format and format all files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-31 00:00:00 +00:00
k4yt3x
c95a6a46cd feat(encoder): improve av_opt_set error message
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-30 00:00:00 +00:00
k4yt3x
a72c094588 perf(*): change multiversioning target clones to x86-64-v3 and x86-64-v4
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-30 00:00:00 +00:00
k4yt3x
7665cd217c build(cmake): remove the AVX2 and AVX-512F optimization options
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-26 00:00:00 +00:00
k4yt3x
2cfdb698c9 build(container): optimize container build speed
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
39a1828a3b build(cmake): disable spdlog exceptions
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
13a480c6cf docs(readme): add the video2x AUR package information
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
b6bd26c173 build(debian): update package version to 6.3.1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
Integral
517003a0ba docs(book): update Linux installation instructions (#1272)
* docs(book): update linux installation instructions
* docs(book): replace apt with apt-get

---------

Co-authored-by: K4YT3X <github@k4yt3x.com>
2024-12-23 05:00:23 +00:00
k4yt3x
588c0fbe21 docs(readme): add @Integral-Tech to the special thanks list
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
a0b2330e74 build(arch): update PKGBUILD pkgname and pkgver
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
3c342f5cd5 docs(readme): update Arch Linux package information
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
31c616d8df build(cmake): add the CMake package config and target files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
a27c795614 docs(readme): fix broken links for the Ubuntu package
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-22 00:00:00 +00:00
K4YT3X
e1e8ed864d perf: improve vectorization optimizations and add function multi-versioning (#1271)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-22 10:53:09 +00:00
Integral
f68939c478 docs(readme): add archlinuxcn link (#1270)
* docs(readme): add archlinuxcn link
* docs(readme): display the available Linux packages in a list

---------

Co-authored-by: K4YT3X <github@k4yt3x.com>
2024-12-22 10:41:20 +00:00
k4yt3x
996b0bfa78 docs(readme): update readme for 6.3.1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
709cf08760 fix(encoder): decreasing PTS precision with increasing video duration (#1269)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
bf5917b084 docs(readme): add French to the list of GUI languages
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
96ebd860e3 docs(readme): add sample clips for Real-CUGAN and Real-ESRGAN
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
74 changed files with 3146 additions and 1153 deletions

8
.clang-format Normal file
View File

@@ -0,0 +1,8 @@
BasedOnStyle: Chromium
AlignAfterOpenBracket: BlockIndent
AllowShortEnumsOnASingleLine: false
BinPackArguments: false
BreakStringLiterals: false
ColumnLimit: 100
IndentWidth: 4
InsertBraces: true

39
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,39 @@
---
name: Bug report
about: Report a bug in the program
title: "<Bug summary>"
labels: type:Bug
assignees: ''
---
**Describe the bug**
A clear and concise description of the bug.
**To Reproduce**
Steps to reproduce the behavior:
1. Do this...
2. Do that...
3. See error here...
**Expected behavior**
A clear and concise description of what you expected to happen.
**Actual behavior**
A clear and concise description of what actually happened.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment:**
- OS: `e.g., Windows 11 24H2 or Arch Linux`
- GPU: `e.g., NVIDIA GeForce RTX 4090`
- Video2X Version: `e.g., 6.3.1`
**Full command**
If applicable, add the full command you used to run the program.
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Request a feature to be added or suggest an idea
title: "<Feature summary>"
labels: type:Enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -26,7 +26,7 @@ jobs:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
@@ -49,15 +49,16 @@ jobs:
- name: Build Video2X
run: |
mkdir -p /tmp/build /tmp/install
cmake -B /tmp/build -S . -DUSE_SYSTEM_NCNN=OFF -DUSE_SYSTEM_SPDLOG=OFF \
cmake -B /tmp/build -S . -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/tmp/install \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DINSTALL_BIN_DESTINATION=. -DINSTALL_INCLUDE_DESTINATION=include \
-DINSTALL_LIB_DESTINATION=. -DINSTALL_MODEL_DESTINATION=.
-DINSTALL_LIB_DESTINATION=. -DINSTALL_MODEL_DESTINATION=. \
-DCMAKE_INSTALL_PREFIX=/tmp/install
cmake --build /tmp/build --config Debug --target install
- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: video2x-nightly-linux-amd64
path: /tmp/install
@@ -66,14 +67,14 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.0
uses: humbletim/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.3.204.0
vulkan-query-version: 1.4.304.1
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools, SPIRV-Headers
vulkan-use-cache: true
@@ -81,7 +82,7 @@ jobs:
shell: pwsh
run: |
$ffmpegVersion = "7.1"
$ncnnVersion = "20240820"
$ncnnVersion = "20241226"
git submodule update --init --recursive
@@ -97,12 +98,12 @@ jobs:
shell: pwsh
run: |
cmake -S . -B build `
-DUSE_SYSTEM_NCNN=OFF -DUSE_SYSTEM_SPDLOG=OFF -DUSE_SYSTEM_BOOST=OFF `
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF -DVIDEO2X_USE_EXTERNAL_BOOST=OFF `
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=build/video2x_install
cmake --build build --config Debug --parallel --target install
- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: video2x-nightly-windows-amd64
path: build/video2x_install
@@ -111,9 +112,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
- uses: mr-smithers-excellent/docker-build-push@v5
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build the Docker image
with:
registry: ghcr.io
@@ -121,3 +122,58 @@ jobs:
image: video2x
tags: latest
pushImage: false
appimage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install dependencies
run: |
git submodule update --init --recursive
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential cmake clang pkg-config ninja-build curl file fuse \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options1.83-dev \
libboost-program-options1.83.0 \
libspdlog-dev
- name: Build Video2X
run: |
cmake -G Ninja -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DNCNN_BUILD_SHARED_LIBS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DNCNN_AVX512=OFF \
-DCMAKE_INSTALL_PREFIX=AppDir/usr
cmake --build build --config Release --target install --parallel
- name: Build AppImage
run: |
sudo curl -Lo /usr/local/bin/linuxdeploy \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
sudo chmod +x /usr/local/bin/linuxdeploy
LD_LIBRARY_PATH=AppDir/usr/lib linuxdeploy \
--appdir AppDir \
--executable AppDir/usr/bin/video2x \
--exclude-library "libvulkan.so.1" \
--desktop-file packaging/appimage/video2x.desktop \
--icon-file packaging/appimage/video2x.png \
--output appimage
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: Video2X-x86_64.AppImage
path: Video2X-x86_64.AppImage

View File

@@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Install mdBook
run: |
@@ -40,7 +40,7 @@ jobs:
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
path: "build/docs/book"

View File

@@ -31,7 +31,7 @@ jobs:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
@@ -53,16 +53,17 @@ jobs:
- name: Build Video2X
run: |
cmake -B build -S . -DUSE_SYSTEM_NCNN=OFF -DUSE_SYSTEM_SPDLOG=OFF -DSPDLOG_NO_EXCEPTIONS=ON \
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/video2x-linux-ubuntu-2404-amd64/usr
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DCMAKE_INSTALL_PREFIX=build/video2x-linux-ubuntu-2404-amd64/usr
cmake --build build --config Release --target install --parallel
mkdir -p build/video2x-linux-ubuntu-2404-amd64/DEBIAN
cp packaging/debian/control build/video2x-linux-ubuntu-2404-amd64/DEBIAN/control
dpkg-deb --build build/video2x-linux-ubuntu-2404-amd64
- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: video2x-linux-ubuntu-2404-amd64
path: build/video2x-linux-ubuntu-2404-amd64.deb
@@ -76,14 +77,14 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.0
uses: humbletim/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.3.204.0
vulkan-query-version: 1.4.304.1
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools, SPIRV-Headers
vulkan-use-cache: true
@@ -107,7 +108,7 @@ jobs:
shell: pwsh
run: |
cmake -S . -B build `
-DUSE_SYSTEM_NCNN=OFF -DUSE_SYSTEM_SPDLOG=OFF -DUSE_SYSTEM_BOOST=OFF `
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF -DVIDEO2X_USE_EXTERNAL_BOOST=OFF `
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/video2x_install
cmake --build build --config Release --parallel --target install
@@ -116,7 +117,7 @@ jobs:
Compress-Archive -Path build/video2x_install/* -DestinationPath build/video2x-windows-amd64.zip
- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: video2x-windows-amd64
path: build/video2x-windows-amd64.zip
@@ -128,9 +129,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
- uses: mr-smithers-excellent/docker-build-push@v5
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push the Docker image
with:
registry: ghcr.io
@@ -152,7 +153,7 @@ jobs:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
# - name: Download artifacts
# uses: actions/download-artifact@v4
# uses: actions/download-artifact@v7
- name: Create release
id: create_release

338
.justfile Normal file
View File

@@ -0,0 +1,338 @@
# Use PowerShell to run recipes on Windows
set windows-shell := ['pwsh', '-Command']
# Default build directory, generator, and C++ compiler
bindir := "build"
generator := "Ninja"
cxx := "clang++"
# Test video and output paths
test_video := "data/standard-test.mp4"
test_output := "data/output.mp4"
[unix]
[group('build')]
build:
cmake -G '{{generator}}' -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER={{cxx}} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX={{bindir}}/video2x-install \
-DVIDEO2X_ENABLE_NATIVE=ON
cmake --build {{bindir}} --config Release --parallel --target install
[windows]
[group('build')]
build:
cmake -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX={{bindir}}/video2x-install \
-DCMAKE_INSTALL_BINDIR="." \
-DCMAKE_INSTALL_LIBDIR="." \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DCMAKE_INSTALL_DATADIR="." \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DVIDEO2X_USE_EXTERNAL_BOOST=OFF
cmake --build {{bindir}} --config Release --parallel --target install
[unix]
[group('build')]
static:
cmake -G '{{generator}}' -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER={{cxx}} \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX={{bindir}}/video2x-install \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DVIDEO2X_USE_EXTERNAL_BOOST=OFF
cmake --build {{bindir}} --config Release --parallel --target install
[unix]
[group('build')]
debug:
cmake -G '{{generator}}' -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER={{cxx}} \
-DCMAKE_BUILD_TYPE=Debug
cmake --build {{bindir}} --config Debug --parallel
[windows]
[group('build')]
debug:
cmake -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX={{bindir}}/video2x-install \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DVIDEO2X_USE_EXTERNAL_BOOST=OFF
cmake --build {{bindir}} --config Debug --parallel
[unix]
[group('build')]
debian:
apt-get update
apt-get install -y --no-install-recommends \
build-essential cmake clang pkg-config ninja-build \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libspdlog-dev \
libboost-program-options-dev
cmake -G '{{generator}}' -B /tmp/build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DCMAKE_CXX_COMPILER={{cxx}} \
-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
[unix]
[group('build')]
ubuntu2404:
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential cmake pkg-config ninja-build \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options-dev
cmake -G '{{generator}}' -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=video2x-linux-ubuntu-amd64/usr
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
[unix]
[group('build')]
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 ninja-build \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options-dev
cmake -G '{{generator}}' -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=video2x-linux-ubuntu-amd64/usr
cmake --build build --config Release --target install --parallel
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
[unix]
[group('build')]
appimage:
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential cmake clang pkg-config ninja-build curl file fuse \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options1.83-dev \
libboost-program-options1.83.0 \
libspdlog-dev
cmake -G '{{generator}}' -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DNCNN_BUILD_SHARED_LIBS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DNCNN_AVX512=OFF \
-DCMAKE_INSTALL_PREFIX=AppDir/usr
cmake --build build --config Release --target install --parallel
rm -rf AppDir/usr/share/video2x/models/rife/rife \
AppDir/usr/share/video2x/models/rife/rife-HD \
AppDir/usr/share/video2x/models/rife/rife-UHD \
AppDir/usr/share/video2x/models/rife/rife-anime \
AppDir/usr/share/video2x/models/rife/rife-v2 \
AppDir/usr/share/video2x/models/rife/rife-v2.3 \
AppDir/usr/share/video2x/models/rife/rife-v2.4 \
AppDir/usr/share/video2x/models/rife/rife-v3.0 \
AppDir/usr/share/video2x/models/rife/rife-v3.1
curl -Lo /usr/local/bin/linuxdeploy \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x /usr/local/bin/linuxdeploy
LD_LIBRARY_PATH=AppDir/usr/lib linuxdeploy \
--appdir AppDir \
--executable AppDir/usr/bin/video2x \
--exclude-library "libvulkan.so.1" \
--desktop-file packaging/appimage/video2x.desktop \
--icon-file packaging/appimage/video2x.png \
--output appimage
[unix]
[group('misc')]
clean:
rm -vrf {{bindir}} data/output*.* heaptrack*.zst valgrind.log
[windows]
[group('misc')]
clean:
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path build,data/output*.*
[unix]
[group('test')]
test-realesrgan:
LD_LIBRARY_PATH={{bindir}} {{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realesrgan -s 4 --realesrgan-model realesr-animevideov3
[unix]
[group('test')]
test-realcugan:
LD_LIBRARY_PATH={{bindir}} {{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realcugan -s 4 -n 0 --realcugan-model models-se
[unix]
[group('test')]
test-libplacebo:
LD_LIBRARY_PATH={{bindir}} {{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a
[unix]
[group('test')]
test-rife:
LD_LIBRARY_PATH={{bindir}} {{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p rife -m 4 --rife-model rife-v4.6
[unix]
[group('test')]
memcheck-realesrgan:
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 realesrgan -s 2 --realesrgan-model realesr-animevideov3 \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
memcheck-realcugan:
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 realcugan -s 2 -n 0 --realcugan-model models-se \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
memcheck-libplacebo:
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 libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
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
[unix]
[group('test')]
heaptrack-realesrgan:
LD_LIBRARY_PATH={{bindir}} HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realesrgan -s 4 --realesrgan-model realesr-animevideov3 \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
heaptrack-realcugan:
LD_LIBRARY_PATH={{bindir}} HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realcugan -s 4 -n 0 --realcugan-model models-se \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
heaptrack-libplacebo:
LD_LIBRARY_PATH={{bindir}} HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
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

View File

@@ -5,6 +5,52 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Option to recalculate the PTS.
- Real-ESRGAN models `realesr-general-x4v3` and `realesr-general-wdn-x4v3` (#1319).
- (Video2X Qt6) Korean translation.
### Changed
- Separate audio and subtitle stream copying options.
## [6.4.0] - 2025-01-24
### Added
- Multi-versioning to critical functions to enhance performance in generic architecture builds.
- RIFE models `v4.25` and `v4.26` (#1304).
- Support for processing videos without PTS information (#1278).
- The feature to copy input streams' metadata to the output streams (#1282).
- (Video2X Qt6) German translation (#1279).
- (Video2X Qt6) Option to remove finished tasks from the queue.
- (Video2X Qt6) Option to specify actions after processing is complete.
- (Video2X Qt6) Support for adding and removing tasks during processing (#1281).
- (Video2X Qt6) The feature to automatically set codec to PNG for images (#1204).
- (Video2X Qt6) The preferences dialog.
### Changed
- Improve the CMake optimization flags and option names.
- (Video2X Qt6) Embed translation files in the executable to avoid missing resources (#1250).
- (Video2X Qt6) Redesign the main window UI to improve usability.
### Fixed
- A bug that causes the wrong encoder to be selected.
- (Video2X Qt6) Incorrect font used for the Japanese translation (#1276).
## [6.3.1] - 2024-12-21
### Fixed
- The issue of decreasing PTS precision with increasing video duration (#1269).
- (Video2X Qt6) Errors restoring Real-CUGAN configs in the Edit Task dialog.
- (Video2X Qt6) The incorrect comparison of version numbers.
## [6.3.0] - 2024-12-20
### Added

View File

@@ -1,22 +1,33 @@
cmake_minimum_required(VERSION 3.10)
project(video2x VERSION 6.3.0 LANGUAGES CXX)
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(video2x VERSION 6.4.0 LANGUAGES CXX)
include(CMakePackageConfigHelpers)
include(ExternalProject)
include(GNUInstallDirs)
# The FindBoost module is removed in CMake 3.30
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
cmake_policy(SET CMP0167 NEW)
endif()
# Set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Set the default build type to Release if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# Set global compile options for all targets
# Build options
option(BUILD_SHARED_LIBS "Build libvideo2x as a shared library" ON)
option(VIDEO2X_BUILD_CLI "Build the video2x command line interface executable" ON)
option(VIDEO2X_USE_EXTERNAL_NCNN "Use the system-provided ncnn library" ON)
option(VIDEO2X_USE_EXTERNAL_SPDLOG "Use the system-provided spdlog library" ON)
option(VIDEO2X_USE_EXTERNAL_BOOST "Use the system-provided Boost library" ON)
option(VIDEO2X_ENABLE_NATIVE "Enable optimizations for the native architecture" OFF)
option(VIDEO2X_ENABLE_X86_64_V4 "Enable x86-64-v4 (AVX-512) optimizations" OFF)
option(VIDEO2X_ENABLE_X86_64_V3 "Enable x86-64-v3 (AVX2) optimizations" OFF)
# Enable extra compiler warnings
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/W4 /permissive-)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
@@ -29,411 +40,456 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options(/Ox /Ot /GL /DNDEBUG)
add_link_options(/LTCG /OPT:REF /OPT:ICF)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-O3 -march=native -ffunction-sections -fdata-sections)
add_compile_options(-O3 -ffunction-sections -fdata-sections)
add_link_options(-Wl,-s -flto -Wl,--gc-sections)
endif()
endif()
# Build options
option(BUILD_SHARED_LIBS "Build libvideo2x as a shared library" ON)
option(BUILD_VIDEO2X_CLI "Build the video2x executable" ON)
option(USE_SYSTEM_NCNN "Use system ncnn library" ON)
option(USE_SYSTEM_SPDLOG "Use system spdlog library" ON)
option(USE_SYSTEM_BOOST "Use system Boost library" ON)
# Enable the requested architecture-specific optimizations
if(VIDEO2X_ENABLE_NATIVE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/arch:NATIVE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-march=native)
endif()
elseif(VIDEO2X_ENABLE_X86_64_V4)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/arch:AVX512)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-march=x86-64-v4)
endif()
elseif(VIDEO2X_ENABLE_X86_64_V3)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/arch:AVX2)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-march=x86-64-v3)
endif()
endif()
# Generate the version header file
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/include/libvideo2x/version.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/libvideo2x/version.h"
@ONLY
)
# Find the required packages
set(LIBVIDEO2X_INCLUDE_DIRS)
set(LIBVIDEO2X_LIBS)
set(VIDEO2X_INCLUDE_DIRS)
set(VIDEO2X_LIBS)
# Platform-specific dependencies
if(WIN32)
# Define base paths for FFmpeg and ncnn
set(FFMPEG_BASE_PATH ${PROJECT_SOURCE_DIR}/third_party/ffmpeg-shared)
set(NCNN_BASE_PATH ${PROJECT_SOURCE_DIR}/third_party/ncnn-shared/x64)
# FFmpeg
set(FFMPEG_LIB
${FFMPEG_BASE_PATH}/lib/avcodec.lib
${FFMPEG_BASE_PATH}/lib/avdevice.lib
${FFMPEG_BASE_PATH}/lib/avfilter.lib
${FFMPEG_BASE_PATH}/lib/avformat.lib
${FFMPEG_BASE_PATH}/lib/avutil.lib
${FFMPEG_BASE_PATH}/lib/swscale.lib
)
list(APPEND LIBVIDEO2X_LIBS ${FFMPEG_LIB})
list(APPEND LIBVIDEO2X_INCLUDE_DIRS ${FFMPEG_BASE_PATH}/include)
list(APPEND VIDEO2X_LIBS ${FFMPEG_LIB})
list(APPEND VIDEO2X_INCLUDE_DIRS ${FFMPEG_BASE_PATH}/include)
# ncnn
set(SPIRV_BUILD_PATH
${CMAKE_BINARY_DIR}/realesrgan-prefix/src/realesrgan-build/ncnn/glslang/SPIRV
)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(SPIRV_LIB ${SPIRV_BUILD_PATH}/Release/SPIRV.lib)
else()
set(SPIRV_LIB ${SPIRV_BUILD_PATH}/Debug/SPIRVd.lib)
endif()
list(APPEND LIBVIDEO2X_LIBS ${NCNN_BASE_PATH}/lib/ncnn.lib ${SPIRV_LIB})
list(APPEND LIBVIDEO2X_INCLUDE_DIRS ${NCNN_BASE_PATH}/include/ncnn)
else()
# FFmpeg
find_package(PkgConfig REQUIRED)
set(FFMPEG_REQUIRED_PKGS
libavcodec
libavdevice
libavfilter
libavformat
libavutil
libswscale
)
# Loop through each package to find and collect include dirs and libraries
foreach(PKG ${FFMPEG_REQUIRED_PKGS})
pkg_check_modules(${PKG} REQUIRED ${PKG})
list(APPEND LIBVIDEO2X_INCLUDE_DIRS ${${PKG}_INCLUDE_DIRS})
list(APPEND LIBVIDEO2X_LIBS ${${PKG}_LIBRARIES})
list(APPEND VIDEO2X_INCLUDE_DIRS ${${PKG}_INCLUDE_DIRS})
list(APPEND VIDEO2X_LIBS ${${PKG}_LIBRARIES})
endforeach()
endif() # WIN32
# Find ncnn package
if(USE_SYSTEM_NCNN)
find_package(ncnn REQUIRED)
else()
option(NCNN_INSTALL_SDK "" OFF)
option(NCNN_PIXEL_ROTATE "" OFF)
option(NCNN_VULKAN "" ON)
option(NCNN_VULKAN_ONLINE_SPIRV "" ON)
option(NCNN_BUILD_BENCHMARK "" OFF)
option(NCNN_BUILD_TESTS "" OFF)
option(NCNN_BUILD_TOOLS "" OFF)
option(NCNN_BUILD_EXAMPLES "" OFF)
option(NCNN_DISABLE_RTTI "" ON)
option(NCNN_DISABLE_EXCEPTION "" ON)
option(NCNN_BUILD_SHARED_LIBS "" OFF)
option(SKIP_GLSLANG_INSTALL "" ON)
option(WITH_LAYER_absval "" OFF)
option(WITH_LAYER_argmax "" OFF)
option(WITH_LAYER_batchnorm "" OFF)
option(WITH_LAYER_bias "" OFF)
option(WITH_LAYER_bnll "" OFF)
option(WITH_LAYER_concat "" ON)
option(WITH_LAYER_convolution "" ON)
option(WITH_LAYER_crop "" ON)
option(WITH_LAYER_deconvolution "" OFF)
option(WITH_LAYER_dropout "" OFF)
option(WITH_LAYER_eltwise "" ON)
option(WITH_LAYER_elu "" OFF)
option(WITH_LAYER_embed "" OFF)
option(WITH_LAYER_exp "" OFF)
option(WITH_LAYER_flatten "" ON)
option(WITH_LAYER_innerproduct "" ON)
option(WITH_LAYER_input "" ON)
option(WITH_LAYER_log "" OFF)
option(WITH_LAYER_lrn "" OFF)
option(WITH_LAYER_memorydata "" OFF)
option(WITH_LAYER_mvn "" OFF)
option(WITH_LAYER_pooling "" OFF)
option(WITH_LAYER_power "" OFF)
option(WITH_LAYER_prelu "" ON)
option(WITH_LAYER_proposal "" OFF)
option(WITH_LAYER_reduction "" OFF)
option(WITH_LAYER_relu "" ON)
option(WITH_LAYER_reshape "" OFF)
option(WITH_LAYER_roipooling "" OFF)
option(WITH_LAYER_scale "" OFF)
option(WITH_LAYER_sigmoid "" OFF)
option(WITH_LAYER_slice "" OFF)
option(WITH_LAYER_softmax "" OFF)
option(WITH_LAYER_split "" ON)
option(WITH_LAYER_spp "" OFF)
option(WITH_LAYER_tanh "" OFF)
option(WITH_LAYER_threshold "" OFF)
option(WITH_LAYER_tile "" OFF)
option(WITH_LAYER_rnn "" OFF)
option(WITH_LAYER_lstm "" OFF)
option(WITH_LAYER_binaryop "" ON)
option(WITH_LAYER_unaryop "" OFF)
option(WITH_LAYER_convolutiondepthwise "" OFF)
option(WITH_LAYER_padding "" ON)
option(WITH_LAYER_squeeze "" OFF)
option(WITH_LAYER_expanddims "" OFF)
option(WITH_LAYER_normalize "" OFF)
option(WITH_LAYER_permute "" OFF)
option(WITH_LAYER_priorbox "" OFF)
option(WITH_LAYER_detectionoutput "" OFF)
option(WITH_LAYER_interp "" ON)
option(WITH_LAYER_deconvolutiondepthwise "" OFF)
option(WITH_LAYER_shufflechannel "" OFF)
option(WITH_LAYER_instancenorm "" OFF)
option(WITH_LAYER_clip "" OFF)
option(WITH_LAYER_reorg "" OFF)
option(WITH_LAYER_yolodetectionoutput "" OFF)
option(WITH_LAYER_quantize "" OFF)
option(WITH_LAYER_dequantize "" OFF)
option(WITH_LAYER_yolov3detectionoutput "" OFF)
option(WITH_LAYER_psroipooling "" OFF)
option(WITH_LAYER_roialign "" OFF)
option(WITH_LAYER_packing "" ON)
option(WITH_LAYER_requantize "" OFF)
option(WITH_LAYER_cast "" ON)
option(WITH_LAYER_hardsigmoid "" OFF)
option(WITH_LAYER_selu "" OFF)
option(WITH_LAYER_hardswish "" OFF)
option(WITH_LAYER_noop "" OFF)
option(WITH_LAYER_pixelshuffle "" ON)
option(WITH_LAYER_deepcopy "" OFF)
option(WITH_LAYER_mish "" OFF)
option(WITH_LAYER_statisticspooling "" OFF)
option(WITH_LAYER_swish "" OFF)
option(WITH_LAYER_gemm "" OFF)
option(WITH_LAYER_groupnorm "" OFF)
option(WITH_LAYER_layernorm "" OFF)
option(WITH_LAYER_softplus "" OFF)
add_subdirectory(third_party/ncnn)
endif()
# spdlog
if(USE_SYSTEM_SPDLOG)
find_package(spdlog REQUIRED)
list(APPEND LIBVIDEO2X_INCLUDE_DIRS ${spdlog_INCLUDE_DIRS})
list(APPEND VIDEO2X_INCLUDE_DIRS ${spdlog_INCLUDE_DIRS})
set(SPDLOG_LIB spdlog::spdlog)
else()
add_subdirectory(third_party/spdlog)
set(SPDLOG_LIB spdlog::spdlog_header_only)
endif()
list(APPEND LIBVIDEO2X_LIBS ${SPDLOG_LIB})
list(APPEND VIDEO2X_LIBS ${SPDLOG_LIB})
# Find dependencies required for the CLI
if(BUILD_VIDEO2X_CLI)
# Vulkan
find_package(Vulkan REQUIRED)
list(APPEND VIDEO2X_LIBS Vulkan::Vulkan)
# Boost
if(USE_SYSTEM_BOOST)
find_package(Boost REQUIRED COMPONENTS program_options)
list(APPEND LIBVIDEO2X_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
else()
option(Boost_USE_STATIC_LIBS "" ON)
option(Boost_USE_STATIC_RUNTIME "" ON)
option(Boost_COMPONENTS "program_options")
add_subdirectory(third_party/boost)
include_directories(${PROJECT_SOURCE_DIR}/third_party/boost/libs/program_options/include)
set(BOOST_BASE_PATH
${CMAKE_BINARY_DIR}/third_party/boost/libs/program_options/${CMAKE_BUILD_TYPE}
)
endif()
list(APPEND VIDEO2X_LIBS Boost::program_options)
endif()
# Include ExternalProject module
include(ExternalProject)
# Add librealesrgan-ncnn-vulkan as an external project
ExternalProject_Add(
realesrgan
SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/librealesrgan_ncnn_vulkan/src
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/realesrgan_install
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DUSE_SYSTEM_NCNN=${USE_SYSTEM_NCNN}
BUILD_ALWAYS ON
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE}
# Add the libvideo2x shared library
add_library(libvideo2x
src/avutils.cpp
src/conversions.cpp
src/decoder.cpp
src/encoder.cpp
src/filter_libplacebo.cpp
src/filter_realcugan.cpp
src/filter_realesrgan.cpp
src/fsutils.cpp
src/interpolator_rife.cpp
src/libplacebo.cpp
src/libvideo2x.cpp
src/logger_manager.cpp
src/processor_factory.cpp
)
# Add librealcugan-ncnn-vulkan as an external project
ExternalProject_Add(
realcugan
SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/librealcugan_ncnn_vulkan/src
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/realcugan_install
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DUSE_SYSTEM_NCNN=${USE_SYSTEM_NCNN}
BUILD_ALWAYS ON
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE}
# Set the C++ standard to C++17
target_compile_features(libvideo2x PRIVATE cxx_std_17)
# Set the shared library output name and disable C++ extensions
set_target_properties(libvideo2x PROPERTIES
PREFIX ""
OUTPUT_NAME libvideo2x
CXX_EXTENSIONS OFF
)
# Add librife-ncnn-vulkan as an external project
ExternalProject_Add(
rife
SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/librife_ncnn_vulkan/src
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/rife_install
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DUSE_SYSTEM_NCNN=${USE_SYSTEM_NCNN}
BUILD_ALWAYS ON
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE}
)
# Remove duplicate entries
list(REMOVE_DUPLICATES LIBVIDEO2X_INCLUDE_DIRS)
list(REMOVE_DUPLICATES LIBVIDEO2X_LIBS)
list(REMOVE_DUPLICATES VIDEO2X_INCLUDE_DIRS)
list(REMOVE_DUPLICATES VIDEO2X_LIBS)
# Create the shared library 'libvideo2x'
file(GLOB LIBVIDEO2X_SOURCES src/*.cpp)
add_library(libvideo2x ${LIBVIDEO2X_SOURCES})
target_compile_definitions(libvideo2x PRIVATE LIBVIDEO2X_EXPORTS)
if(WIN32)
set_target_properties(libvideo2x PROPERTIES OUTPUT_NAME libvideo2x)
else()
set_target_properties(libvideo2x PROPERTIES OUTPUT_NAME video2x)
endif()
# Ensure that the shared library is built after the external projects
add_dependencies(libvideo2x realesrgan realcugan rife)
# Include directories for the shared library
target_include_directories(libvideo2x PRIVATE
${LIBVIDEO2X_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/libvideo2x
${PROJECT_SOURCE_DIR}/third_party/librealesrgan_ncnn_vulkan/src
${PROJECT_SOURCE_DIR}/third_party/librealcugan_ncnn_vulkan/src
${PROJECT_SOURCE_DIR}/third_party/librife_ncnn_vulkan/src
"${CMAKE_CURRENT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_SOURCE_DIR}/include/libvideo2x"
"${PROJECT_SOURCE_DIR}/third_party/librealesrgan_ncnn_vulkan/src"
"${PROJECT_SOURCE_DIR}/third_party/librealcugan_ncnn_vulkan/src"
"${PROJECT_SOURCE_DIR}/third_party/librife_ncnn_vulkan/src"
)
# Compile options for the shared library
target_compile_options(libvideo2x PRIVATE -fPIC $<$<CONFIG:Debug>:-g -DDEBUG>)
# Add the export definition for the exported symbols
target_compile_definitions(libvideo2x PRIVATE LIBVIDEO2X_EXPORTS)
# Define the paths to the shared libraries
if(WIN32)
set(REALESRGAN_LIB ${CMAKE_BINARY_DIR}/realesrgan_install/lib/librealesrgan-ncnn-vulkan.lib)
set(REALCUGAN_LIB ${CMAKE_BINARY_DIR}/realcugan_install/lib/librealcugan-ncnn-vulkan.lib)
set(RIFE_LIB ${CMAKE_BINARY_DIR}/rife_install/lib/librife-ncnn-vulkan.lib)
else()
set(REALESRGAN_LIB ${CMAKE_BINARY_DIR}/realesrgan_install/lib/librealesrgan-ncnn-vulkan.so)
set(REALCUGAN_LIB ${CMAKE_BINARY_DIR}/realcugan_install/lib/librealcugan-ncnn-vulkan.so)
set(RIFE_LIB ${CMAKE_BINARY_DIR}/rife_install/lib/librife-ncnn-vulkan.so)
# Set debug compile options
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(libvideo2x PRIVATE $<$<CONFIG:Debug>:/Zi /Od /MDd>)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(libvideo2x PRIVATE
$<$<NOT:$<PLATFORM_ID:Windows>>:-fPIC>
$<$<CONFIG:Debug>:-g -O0>
)
endif()
list(APPEND LIBVIDEO2X_LIBS ${REALESRGAN_LIB} ${REALCUGAN_LIB} ${RIFE_LIB})
# Link the shared library with the dependencies
target_link_libraries(libvideo2x PRIVATE ${LIBVIDEO2X_LIBS})
# FFmpeg
if(WIN32)
set(ffmpeg_base_path "${PROJECT_SOURCE_DIR}/third_party/ffmpeg-shared")
target_include_directories(libvideo2x SYSTEM PRIVATE "${ffmpeg_base_path}/include")
target_link_libraries(libvideo2x PRIVATE
"${ffmpeg_base_path}/lib/avcodec.lib"
"${ffmpeg_base_path}/lib/avfilter.lib"
"${ffmpeg_base_path}/lib/avformat.lib"
"${ffmpeg_base_path}/lib/avutil.lib"
"${ffmpeg_base_path}/lib/swscale.lib"
)
else()
# Use pkg-config to find FFmpeg libraries
find_package(PkgConfig REQUIRED)
if(NOT WIN32)
if(USE_SYSTEM_NCNN)
target_link_libraries(libvideo2x PUBLIC ncnn)
# Find and configure FFmpeg libraries
pkg_check_modules(libavcodec REQUIRED libavcodec)
pkg_check_modules(libavfilter REQUIRED libavfilter)
pkg_check_modules(libavformat REQUIRED libavformat)
pkg_check_modules(libavutil REQUIRED libavutil)
pkg_check_modules(libswscale REQUIRED libswscale)
# Apply include directories and libraries directly to the target
target_include_directories(libvideo2x SYSTEM PRIVATE
${libavcodec_INCLUDE_DIRS}
${libavfilter_LIBRARIES}
${libavformat_INCLUDE_DIRS}
${libavutil_INCLUDE_DIRS}
${libswscale_INCLUDE_DIRS}
)
target_link_libraries(libvideo2x PRIVATE
${libavcodec_LIBRARIES}
${libavfilter_LIBRARIES}
${libavformat_LIBRARIES}
${libavutil_LIBRARIES}
${libswscale_LIBRARIES}
)
endif()
# ncnn
if(VIDEO2X_USE_EXTERNAL_NCNN)
find_package(ncnn REQUIRED)
else()
if(WIN32)
# Use the pre-built shared ncnn library on Windows
set(ncnn_base_path "${PROJECT_SOURCE_DIR}/third_party/ncnn-shared/x64")
add_library(ncnn SHARED IMPORTED)
set_target_properties(ncnn PROPERTIES
IMPORTED_LOCATION "${ncnn_base_path}/bin/ncnn.dll"
IMPORTED_IMPLIB "${ncnn_base_path}/lib/ncnn.lib"
INTERFACE_INCLUDE_DIRECTORIES "${ncnn_base_path}/include/ncnn"
)
else()
target_link_libraries(libvideo2x PRIVATE ncnn)
option(NCNN_INSTALL_SDK "" ON)
option(SKIP_GLSLANG_INSTALL "" OFF)
option(NCNN_PIXEL_ROTATE "" OFF)
option(NCNN_PIXEL_AFFINE "" OFF)
option(NCNN_PIXEL_DRAWING "" OFF)
option(NCNN_VULKAN "" ON)
option(NCNN_VULKAN_ONLINE_SPIRV "" ON)
option(NCNN_BUILD_BENCHMARK "" OFF)
option(NCNN_BUILD_TESTS "" OFF)
option(NCNN_BUILD_TOOLS "" OFF)
option(NCNN_BUILD_EXAMPLES "" OFF)
option(NCNN_DISABLE_RTTI "" ON)
option(NCNN_DISABLE_EXCEPTION "" ON)
option(NCNN_INT8 "" OFF)
option(NCNN_BUILD_SHARED_LIBS "" OFF)
option(WITH_LAYER_absval "" OFF)
option(WITH_LAYER_argmax "" OFF)
option(WITH_LAYER_batchnorm "" OFF)
option(WITH_LAYER_bias "" OFF)
option(WITH_LAYER_bnll "" OFF)
option(WITH_LAYER_concat "" ON)
option(WITH_LAYER_convolution "" ON)
option(WITH_LAYER_crop "" ON)
option(WITH_LAYER_deconvolution "" ON)
option(WITH_LAYER_dropout "" OFF)
option(WITH_LAYER_eltwise "" ON)
option(WITH_LAYER_elu "" OFF)
option(WITH_LAYER_embed "" OFF)
option(WITH_LAYER_exp "" OFF)
option(WITH_LAYER_flatten "" ON)
option(WITH_LAYER_innerproduct "" ON)
option(WITH_LAYER_input "" ON)
option(WITH_LAYER_log "" OFF)
option(WITH_LAYER_lrn "" OFF)
option(WITH_LAYER_memorydata "" ON)
option(WITH_LAYER_mvn "" OFF)
option(WITH_LAYER_pooling "" ON)
option(WITH_LAYER_power "" OFF)
option(WITH_LAYER_prelu "" ON)
option(WITH_LAYER_proposal "" OFF)
option(WITH_LAYER_reduction "" ON)
option(WITH_LAYER_relu "" ON)
option(WITH_LAYER_reshape "" ON)
option(WITH_LAYER_roipooling "" OFF)
option(WITH_LAYER_scale "" ON)
option(WITH_LAYER_sigmoid "" ON)
option(WITH_LAYER_slice "" ON)
option(WITH_LAYER_softmax "" OFF)
option(WITH_LAYER_split "" ON)
option(WITH_LAYER_spp "" OFF)
option(WITH_LAYER_tanh "" OFF)
option(WITH_LAYER_threshold "" OFF)
option(WITH_LAYER_tile "" OFF)
option(WITH_LAYER_rnn "" OFF)
option(WITH_LAYER_lstm "" OFF)
option(WITH_LAYER_binaryop "" ON)
option(WITH_LAYER_unaryop "" ON)
option(WITH_LAYER_convolutiondepthwise "" OFF)
option(WITH_LAYER_padding "" ON)
option(WITH_LAYER_squeeze "" OFF)
option(WITH_LAYER_expanddims "" OFF)
option(WITH_LAYER_normalize "" OFF)
option(WITH_LAYER_permute "" OFF)
option(WITH_LAYER_priorbox "" OFF)
option(WITH_LAYER_detectionoutput "" OFF)
option(WITH_LAYER_interp "" ON)
option(WITH_LAYER_deconvolutiondepthwise "" OFF)
option(WITH_LAYER_shufflechannel "" OFF)
option(WITH_LAYER_instancenorm "" OFF)
option(WITH_LAYER_clip "" ON)
option(WITH_LAYER_reorg "" OFF)
option(WITH_LAYER_yolodetectionoutput "" OFF)
option(WITH_LAYER_quantize "" OFF)
option(WITH_LAYER_dequantize "" OFF)
option(WITH_LAYER_yolov3detectionoutput "" OFF)
option(WITH_LAYER_psroipooling "" OFF)
option(WITH_LAYER_roialign "" OFF)
option(WITH_LAYER_packing "" ON)
option(WITH_LAYER_requantize "" OFF)
option(WITH_LAYER_cast "" ON)
option(WITH_LAYER_hardsigmoid "" OFF)
option(WITH_LAYER_selu "" OFF)
option(WITH_LAYER_hardswish "" OFF)
option(WITH_LAYER_noop "" OFF)
option(WITH_LAYER_pixelshuffle "" ON)
option(WITH_LAYER_deepcopy "" OFF)
option(WITH_LAYER_mish "" OFF)
option(WITH_LAYER_statisticspooling "" OFF)
option(WITH_LAYER_swish "" OFF)
option(WITH_LAYER_gemm "" OFF)
option(WITH_LAYER_groupnorm "" OFF)
option(WITH_LAYER_layernorm "" OFF)
option(WITH_LAYER_softplus "" OFF)
option(WITH_LAYER_gru "" OFF)
option(WITH_LAYER_multiheadattention "" OFF)
option(WITH_LAYER_gelu "" OFF)
option(WITH_LAYER_convolution1d "" OFF)
option(WITH_LAYER_pooling1d "" OFF)
option(WITH_LAYER_convolutiondepthwise1d "" OFF)
option(WITH_LAYER_convolution3d "" OFF)
option(WITH_LAYER_convolutiondepthwise3d "" OFF)
option(WITH_LAYER_pooling3d "" OFF)
option(WITH_LAYER_matmul "" OFF)
option(WITH_LAYER_deconvolution1d "" OFF)
option(WITH_LAYER_deconvolutiondepthwise1d "" OFF)
option(WITH_LAYER_deconvolution3d "" OFF)
option(WITH_LAYER_deconvolutiondepthwise3d "" OFF)
option(WITH_LAYER_einsum "" OFF)
option(WITH_LAYER_deformableconv2d "" OFF)
option(WITH_LAYER_gridsample "" ON)
add_subdirectory(third_party/ncnn)
endif()
endif()
target_link_libraries(libvideo2x PRIVATE ncnn)
# Create the executable 'video2x'
if(BUILD_VIDEO2X_CLI)
file(GLOB VIDEO2X_SOURCES tools/video2x/src/*.cpp)
add_executable(video2x ${VIDEO2X_SOURCES})
set_target_properties(video2x PROPERTIES OUTPUT_NAME video2x)
# Include directories for the executable
target_include_directories(video2x PRIVATE
${VIDEO2X_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/tools/video2x/include
)
# Compile options for the executable
target_compile_options(video2x PRIVATE $<$<CONFIG:Debug>:-g -DDEBUG>)
# Link the executable with the shared library
target_link_libraries(video2x PRIVATE libvideo2x ${VIDEO2X_LIBS})
endif()
# Define the default installation directories
if(WIN32)
set(BIN_DESTINATION_DEFAULT ".")
set(INCLUDE_DESTINATION_DEFAULT "include/libvideo2x")
set(LIB_DESTINATION_DEFAULT ".")
set(MODEL_DESTINATION_DEFAULT ".")
# spdlog
if(VIDEO2X_USE_EXTERNAL_SPDLOG)
find_package(spdlog REQUIRED)
target_include_directories(libvideo2x SYSTEM PRIVATE ${spdlog_INCLUDE_DIRS})
target_link_libraries(libvideo2x PRIVATE spdlog::spdlog)
else()
set(BIN_DESTINATION_DEFAULT "bin")
set(INCLUDE_DESTINATION_DEFAULT "include/libvideo2x")
set(LIB_DESTINATION_DEFAULT "lib")
set(MODEL_DESTINATION_DEFAULT "share/video2x")
# spdlog exceptions are incompatible with ncnn
option(SPDLOG_NO_EXCEPTIONS "" ON)
option(SPDLOG_INSTALL "" ON)
add_subdirectory(third_party/spdlog)
target_link_libraries(libvideo2x PRIVATE spdlog::spdlog_header_only)
endif()
# Set the installation directories
set(INSTALL_BIN_DESTINATION ${BIN_DESTINATION_DEFAULT} CACHE STRING "")
set(INSTALL_INCLUDE_DESTINATION ${INCLUDE_DESTINATION_DEFAULT} CACHE STRING "")
set(INSTALL_LIB_DESTINATION ${LIB_DESTINATION_DEFAULT} CACHE STRING "")
set(INSTALL_MODEL_DESTINATION ${MODEL_DESTINATION_DEFAULT} CACHE STRING "")
# Add Real-ESRGAN, Real-CUGAN, and RIFE
option(USE_SYSTEM_NCNN "" ${VIDEO2X_USE_EXTERNAL_NCNN})
add_subdirectory(third_party/librealesrgan_ncnn_vulkan/src)
add_subdirectory(third_party/librealcugan_ncnn_vulkan/src)
add_subdirectory(third_party/librife_ncnn_vulkan/src)
# Prevent the min and max macros from causing error C2589 on Windows
if(WIN32)
target_compile_definitions(librealesrgan-ncnn-vulkan PRIVATE -DNOMINMAX)
target_compile_definitions(librealcugan-ncnn-vulkan PRIVATE -DNOMINMAX)
target_compile_definitions(librife-ncnn-vulkan PRIVATE -DNOMINMAX)
endif()
# Link the shared library to the ncnn-Vulkan libraries
target_link_libraries(libvideo2x PRIVATE
librealesrgan-ncnn-vulkan
librealcugan-ncnn-vulkan
librife-ncnn-vulkan
)
# Common installation rules for libvideo2x and models
install(TARGETS libvideo2x
LIBRARY DESTINATION ${INSTALL_LIB_DESTINATION}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
ARCHIVE DESTINATION ${INSTALL_LIB_DESTINATION}
RUNTIME DESTINATION ${INSTALL_BIN_DESTINATION}
EXPORT Video2XTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libvideo2x"
)
# Install model files
install(DIRECTORY ${CMAKE_SOURCE_DIR}/models DESTINATION ${INSTALL_MODEL_DESTINATION})
# Install the header files from the include directory
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/libvideo2x/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libvideo2x"
FILES_MATCHING PATTERN "*.h"
)
# Install the executable if BUILD_VIDEO2X_CLI is enabled
if(BUILD_VIDEO2X_CLI)
install(TARGETS video2x RUNTIME DESTINATION ${INSTALL_BIN_DESTINATION})
# Install the generated version.h file
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/libvideo2x/version.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libvideo2x"
)
# Export targets and create CMake package config
install(EXPORT Video2XTargets
FILE Video2XTargets.cmake
NAMESPACE Video2X::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Video2X"
)
# Generate the CMake package config file
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Video2XConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/Video2XConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Video2X"
)
# Install the CMake package config file
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/Video2XConfig.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Video2X"
)
# Install the model files
if(WIN32)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/models" DESTINATION "${CMAKE_INSTALL_DATADIR}")
else()
install(DIRECTORY "${CMAKE_SOURCE_DIR}/models" DESTINATION "${CMAKE_INSTALL_DATADIR}/video2x")
endif()
# Install the header files
file(GLOB HEADER_FILES ${PROJECT_SOURCE_DIR}/include/libvideo2x/*.h)
install(FILES
${HEADER_FILES}
${CMAKE_CURRENT_BINARY_DIR}/libvideo2x/version.h
DESTINATION ${INSTALL_INCLUDE_DESTINATION}
)
# Platform-specific installation rules
# Install the FFmpeg and ncnn shared libraries
if(WIN32)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(BOOST_DLL_PATH ${BOOST_BASE_PATH}/boost_program_options-vc143-mt-x64-1_86.dll)
else()
set(BOOST_DLL_PATH ${BOOST_BASE_PATH}/boost_program_options-vc143-mt-gd-x64-1_86.dll)
file(GLOB ffmpeg_dlls "${ffmpeg_base_path}/bin/*.dll")
install(FILES ${ffmpeg_dlls} DESTINATION "${CMAKE_INSTALL_BINDIR}")
if(NOT VIDEO2X_USE_EXTERNAL_BOOST)
install(FILES "${ncnn_base_path}/bin/ncnn.dll" DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
endif()
# Build the video2x CLI executable
if(VIDEO2X_BUILD_CLI)
add_executable(video2x
tools/video2x/src/argparse.cpp
tools/video2x/src/newline_safe_sink.cpp
tools/video2x/src/timer.cpp
tools/video2x/src/validators.cpp
tools/video2x/src/video2x.cpp
tools/video2x/src/vulkan_utils.cpp
)
# Set the C++ standard to C++17
target_compile_features(video2x PRIVATE cxx_std_17)
# Set the shared library output name and disable C++ extensions
set_target_properties(video2x PROPERTIES
OUTPUT_NAME video2x
CXX_EXTENSIONS OFF
)
# Include directories for the executable
target_include_directories(video2x PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_SOURCE_DIR}/tools/video2x/include"
)
# Link the executable with the shared library
target_link_libraries(video2x PRIVATE libvideo2x)
# Set debug compile options
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(video2x PRIVATE $<$<CONFIG:Debug>:/Zi /Od /MDd>)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(video2x PRIVATE $<$<CONFIG:Debug>:-g -O0>)
endif()
file(GLOB FFMPEG_DLLS "${FFMPEG_BASE_PATH}/bin/*.dll")
install(FILES
${CMAKE_BINARY_DIR}/realesrgan_install/bin/librealesrgan-ncnn-vulkan.dll
${CMAKE_BINARY_DIR}/realcugan_install/bin/librealcugan-ncnn-vulkan.dll
${CMAKE_BINARY_DIR}/rife_install/bin/librife-ncnn-vulkan.dll
${FFMPEG_DLLS}
${NCNN_BASE_PATH}/bin/ncnn.dll
${BOOST_DLL_PATH}
DESTINATION ${INSTALL_BIN_DESTINATION}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
else()
install(FILES ${REALESRGAN_LIB} ${REALCUGAN_LIB} ${RIFE_LIB}
DESTINATION ${INSTALL_LIB_DESTINATION}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
# FFmpeg
if(WIN32)
target_include_directories(video2x SYSTEM PRIVATE
"${PROJECT_SOURCE_DIR}/third_party/ffmpeg-shared/include"
)
target_link_libraries(video2x PRIVATE
"${ffmpeg_base_path}/lib/avcodec.lib"
"${ffmpeg_base_path}/lib/avutil.lib"
)
else()
# FFmpeg libraries have already been found
# Apply include directories and libraries directly to the target
target_include_directories(video2x SYSTEM PRIVATE
${libavcodec_INCLUDE_DIRS}
${libavutil_INCLUDE_DIRS}
)
target_link_libraries(video2x PRIVATE ${libavcodec_LIBRARIES} ${libavutil_LIBRARIES})
endif()
# spdlog
# spdlog targets has already been added
if(VIDEO2X_USE_EXTERNAL_SPDLOG)
target_include_directories(video2x SYSTEM PRIVATE ${spdlog_INCLUDE_DIRS})
target_link_libraries(video2x PRIVATE spdlog::spdlog)
else()
target_link_libraries(video2x PRIVATE spdlog::spdlog_header_only)
endif()
# Vulkan
find_package(Vulkan REQUIRED)
target_link_libraries(video2x PRIVATE Vulkan::Vulkan)
# Boost
if(VIDEO2X_USE_EXTERNAL_BOOST)
find_package(Boost REQUIRED COMPONENTS program_options)
else()
option(Boost_USE_STATIC_LIBS "" ON)
option(Boost_USE_STATIC_RUNTIME "" ON)
option(Boost_COMPONENTS program_options)
add_subdirectory(third_party/boost)
target_include_directories(video2x SYSTEM PRIVATE
${PROJECT_SOURCE_DIR}/third_party/boost/libs/program_options/include
)
# Suppress the -Wsign-conversion warnings for Boost.Nowide
if (TARGET boost_nowide AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(boost_nowide PRIVATE -Wno-error=sign-conversion)
endif()
endif()
target_link_libraries(video2x PRIVATE Boost::program_options)
# Install the video2x executable
install(TARGETS video2x RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
# Install the Boost DLL
if(WIN32 AND NOT VIDEO2X_USE_EXTERNAL_BOOST)
set(boost_base_path
"${CMAKE_BINARY_DIR}/third_party/boost/libs/program_options/${CMAKE_BUILD_TYPE}"
)
# Different build types have different DLL names
if(CMAKE_BUILD_TYPE STREQUAL Release)
set(boost_dll_path "${boost_base_path}/boost_program_options-vc143-mt-x64-1_86.dll")
else()
set(boost_dll_path "${boost_base_path}/boost_program_options-vc143-mt-gd-x64-1_86.dll")
endif()
install(FILES "${boost_dll_path}" DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
endif()

114
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,114 @@
# Contributing to Video2X
Thank you for considering contributing to Video2X. This document outlines the guidelines for contributing to ensure a smooth and effective development process. Should you have any questions or require assistance, please do not hesitate to reach out to the project maintainers.
## Commit Messages
Commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. This helps maintain a consistent and informative project history.
### Commit Message Format
```text
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
#### Common Types
- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation updates
- **perf**: Performance improvements that do not affect the code's behavior
- **style**: Changes that do not affect the code's functionality (e.g., formatting)
- **refactor**: Code changes that neither fix a bug nor add a feature
- **test**: Adding or modifying tests
- **chore**: Maintenance or other non-functional updates
#### Common Scopes
Including a scope is optional but is strongly encouraged. One commit should only address changes to a single module or component. If a change must affect multiple modules, use `*` as the scope.
- **avutils**: The audio/video utilities
- **conversions**: The video format conversion utilities
- **decoder**: The video decoder module
- **encoder**: The video encoder module
- **fsutils**: The file system utilities
- **logging**: Any logging-related changes
- **libplacebo**: The libplacebo filter
- **realesrgan**: The Real-ESRGAN filter
- **realcugan**: The Real-CUGAN filter
- **rife**: The RIFE frame interpolator
- **video2x**: The Video2X command-line interface
#### Example
```
feat(encoder): add support for specifying video pixel format
Add the `pix_fmt` field to the `EncoderConfig` struct to allow users to specify the pixel format for encoding.
Closes #12345
```
## Documentation of Changes
All changes must be documented in the `CHANGELOG.md` file. The changelog must adhere to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.
### Example Changelog Entry
```markdown
## [Unreleased]
### Added
- Support for specifying video pixel format in the encoder module (#12345).
### Fixed
- A memory leak in the video encoder module (#23456).
```
## Coding Standards
All code contributions must strictly follow the coding standards outlined in this section. These standards help maintain code quality, readability, and consistency throughout the project. Before submitting any code changes, ensure your code adheres to these guidelines.
### C++ Code Style
C++ code must follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html). This ensures consistency and readability across the codebase. Additionally:
- Use smart pointers (`std::unique_ptr`, `std::shared_ptr`) instead of raw pointers wherever possible.
- Use `#pragma once` for header guards.
- Use `#include` directives in the following order:
1. Related header files
2. C++ standard library headers
3. Third-party library headers
4. Project-specific headers
- Never check pointers with implicit conversion to `bool`; always perform an explicit comparison with `nullptr`.
- Always set pointers to `nullptr` after freeing the associated memory.
### Code Formatting
All C++ code must be formatted using `clang-format` with the project's `.clang-format` configuration file before submitting a pull request. This helps maintain a uniform code style.
## Submitting a Pull Request
1. **Fork the repository**: Create a personal fork of the project.
2. **Create a branch**: Create a new branch for your changes:
```bash
git checkout -b <type>/<scope>
```
3. **Write code**: Make your changes, ensuring they adhere to the coding standards and are properly documented.
4. **Document changes**: Update `CHANGELOG.md` with your changes.
5. **Commit changes**: Write clear and descriptive commit messages using the Conventional Commits format.
6. **Push changes**: Push your branch to your fork:
```bash
git push origin <type>/<scope>
```
7. **Open a pull request**: Submit your pull request to the `master` branch of the original repository. Include a clear description of the changes made and reference any relevant issues.
## Code Reviews
All pull requests will undergo a code review. Please expect feedback from the maintainers after you submit the pull request. We may need further information or changes before merging your pull request.

223
Makefile
View File

@@ -1,223 +0,0 @@
.PHONY: build static debug windows windows-debug debian ubuntu clean \
test-realesrgan test-realcugan test-libplacebo test-rife \
memcheck-realesrgan memcheck-realcugan memcheck-libplacebo memcheck-rife \
heaptrack-realesrgan heaptrack-realcugan heaptrack-libplacebo heaptrack-rife
BINDIR=build
CXX=clang++
TEST_VIDEO=data/standard-test.mp4
TEST_OUTPUT=data/output.mp4
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 \
-DBUILD_SHARED_LIBS=OFF \
-DUSE_SYSTEM_NCNN=OFF \
-DUSE_SYSTEM_SPDLOG=OFF \
-DUSE_SYSTEM_BOOST=OFF
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 .
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
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 \
libomp-dev \
libspdlog-dev \
libboost-program-options-dev
cmake -B /tmp/build -S . -DUSE_SYSTEM_NCNN=OFF -DCMAKE_CXX_COMPILER=$(CXX) \
-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
ubuntu2404:
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential cmake pkg-config \
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 \
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=video2x-linux-ubuntu-amd64/usr
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 \
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=video2x-linux-ubuntu-amd64/usr
cmake --build build --config Release --target install --parallel
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
clean:
rm -vrf $(BINDIR) data/output*.* heaptrack*.zst valgrind.log
test-realesrgan:
LD_LIBRARY_PATH=$(BINDIR) $(BINDIR)/video2x -i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
-p realesrgan -s 4 --realesrgan-model realesr-animevideov3
test-realcugan:
LD_LIBRARY_PATH=$(BINDIR) $(BINDIR)/video2x -i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
-p realcugan -s 4 -n 0 --realcugan-model models-se
test-libplacebo:
LD_LIBRARY_PATH=$(BINDIR) $(BINDIR)/video2x -i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
-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
memcheck-realesrgan:
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 realesrgan -s 2 --realesrgan-model realesr-animevideov3 \
-e preset=veryfast -e crf=30
memcheck-realcugan:
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 realcugan -s 2 -n 0 --realcugan-model models-se \
-e preset=veryfast -e crf=30
memcheck-libplacebo:
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 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
heaptrack-realesrgan:
LD_LIBRARY_PATH=$(BINDIR) HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
$(BINDIR)/video2x \
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
-p realesrgan -s 4 --realesrgan-model realesr-animevideov3 \
-e preset=veryfast -e crf=30
heaptrack-realcugan:
LD_LIBRARY_PATH=$(BINDIR) HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
$(BINDIR)/video2x \
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
-p realcugan -s 4 -n 0 --realcugan-model models-se \
-e preset=veryfast -e crf=30
heaptrack-libplacebo:
LD_LIBRARY_PATH=$(BINDIR) HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
$(BINDIR)/video2x \
-i $(TEST_VIDEO) -o $(TEST_OUTPUT) \
-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

View File

@@ -27,30 +27,58 @@ Version 6.0.0 is a complete rewrite of this project in C/C++. It:
- genuinely works this time, with much less hassle compared to the 5.0.0 beta;
- is blazing fast, thanks to the new optimized pipeline and the efficiency of C/C++;
- is cross-platform, available now for both Windows and Linux;
- offers significantly better output quality with Anime4K v4, RealESRGAN, RealCUGAN, and RIFE;
- offers significantly better output quality with Anime4K v4, Real-ESRGAN, Real-CUGAN, and RIFE;
- supports two modes: filtering (upscaling) and frame interpolation;
- supports Anime4K v4 and all custom MPV-compatible GLSL shaders;
- supports RealESRGAN, RealCUGAN, and RIFE (all models) via ncnn and Vulkan;
- supports Real-ESRGAN, Real-CUGAN, and RIFE (all models) via ncnn and Vulkan;
- requires zero additional disk space during processing, just space for the final output.
</details>
![6.3.0-screenshot](https://github.com/user-attachments/assets/c5442f84-5ffc-4476-915f-a0fc188a2cb3)
![6.4.0-screenshot](https://github.com/user-attachments/assets/9b1cc8a7-2903-4d2c-80a2-8d81f007e45b)
## 🖥️ Hardware Requirements
Your system must meet the minimum hardware requirements below to run Video2X.
- **CPU**
- The precompiled binaries require CPUs with AVX2 support.
- **Intel**: Haswell (Q2 2013) or newer
- **AMD**: Excavator (Q2 2015) or newer
- **GPU**
- The GPU must support Vulkan.
- **NVIDIA**: Kepler (GTX 600 series, Q2 2012) or newer
- **AMD**: GCN 1.0 (Radeon HD 7000 series, Q1 2012) or newer
- **Intel**: HD Graphics 4000 (Q2 2012) or newer
## [🪟 Install on Windows](https://docs.video2x.org/installing/windows-qt6.html)
**[Download the Latest Windows Installer Executable (6.3.0)](https://github.com/k4yt3x/video2x/releases/download/6.3.0/video2x-qt6-windows-amd64-installer.exe)**
**[Download the Latest Windows Installer Executable (6.4.0)](https://github.com/k4yt3x/video2x/releases/download/6.4.0/video2x-qt6-windows-amd64-installer.exe)**
You can download the latest Windows release on the [releases page](https://github.com/k4yt3x/video2x/releases/latest). For basic GUI usage, refer to the [documentation](https://docs.video2x.org/running/desktop.html). If you're unable to download directly from GitHub, try the [mirror site](https://files.k4yt3x.com/Projects/Video2X). The GUI currently supports the following languages:
You can download the latest Windows release on the [releases page](https://github.com/k4yt3x/video2x/releases/latest). For basic GUI usage, refer to the [documentation](https://docs.video2x.org/running/desktop.html). If you're unable to download directly from GitHub, try the [mirror site](https://files.k4yt3x.com). The GUI currently supports the following languages:
- English (United States)
- 简体中文(中国)
- 日本語(日本)
- Português (Portugal)
- Français (France)
- Deutsch (Deutschland)
## [🐧 Install on Linux](https://docs.video2x.org/installing/linux.html)
You can install Video2X on Arch Linux using the [video2x-git](https://aur.archlinux.org/packages/video2x-git) AUR package or on Ubuntu/Debian using the `.deb` package from the [releases page](https://github.com/k4yt3x/video2x/releases/latest). If you'd like to build from source, refer to the [PKGBUILD](packaging/arch/PKGBUILD) file for a general overview of the required packages and commands. If you'd prefer not to compile the program from source, consider using the container image below.
Video2X packages are available for the Linux distros listed below. A universal AppImage is also available for other distros. If you'd like to build it from source code, refer to the [PKGBUILD](packaging/arch/PKGBUILD) file for a general overview of the required dependencies and commands.
- Arch Linux: AUR packages, maintained by [@K4YT3X](https://github.com/k4yt3x).
- [aur/video2x](https://aur.archlinux.org/packages/video2x)
- [aur/video2x-git](https://aur.archlinux.org/packages/video2x-git)
- [aur/video2x-qt6](https://aur.archlinux.org/packages/video2x-qt6)
- [aur/video2x-qt6-git](https://aur.archlinux.org/packages/video2x-qt6-git)
- Arch Linux (Chinese Mainland): archlinuxcn packages, maintained by [@Integral-Tech](https://github.com/Integral-Tech).
- [archlinuxcn/video2x](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x)
- [archlinuxcn/video2x-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-git)
- [archlinuxcn/video2x-qt6](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-qt6)
- [archlinuxcn/video2x-qt6-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-qt6-git)
- Other distros: `Video2X-x86_64.AppImage` on the [releases page](https://github.com/k4yt3x/video2x/releases/latest).
## [📦 Container Image](https://docs.video2x.org/running/container.html)
@@ -87,9 +115,11 @@ _Upscale demo: Spirited Away's movie trailer_
The following clip can be used to test if your setup works properly. This is also the standard clip used for running performance benchmarks.
- [Standard Test Clip (240P)](https://files.k4yt3x.com/Resources/Videos/standard-test.mp4) 4.54 MiB
- [waifu2x Upscaled Sample (1080P)](https://files.k4yt3x.com/Resources/Videos/standard-waifu2x.mp4) 4.54 MiB
- [Ground Truth (1080P)](https://files.k4yt3x.com/Resources/Videos/standard-original.mp4) 22.2 MiB
- [Standard Test Clip (240P)](https://files.k4yt3x.com/resources/videos/standard-test.mp4) 4.54 MiB
- [Real-CUGAN Upscaled Sample (1704P)](https://files.k4yt3x.com/resources/videos/standard-realcugan.mp4) 3.5 MiB
- [Real-ESRGAN Upscaled Sample (1704P)](https://files.k4yt3x.com/resources/videos/standard-realesrgan.mp4) 3.1 MiB
- [waifu2x Upscaled Sample (1080P)](https://files.k4yt3x.com/resources/videos/standard-waifu2x.mp4) 4.54 MiB
- [Ground Truth (1080P)](https://files.k4yt3x.com/resources/videos/standard-original.mp4) 22.2 MiB
The original clip came from the anime "さくら荘のペットな彼女."\
Copyright of this clip belongs to 株式会社アニプレックス.
@@ -97,7 +127,7 @@ Copyright of this clip belongs to 株式会社アニプレックス.
## ⚖️ License
This project is licensed under [GNU AGPL version 3](https://www.gnu.org/licenses/agpl-3.0.txt).\
Copyright (C) 2018-2024 K4YT3X and [contributors](https://github.com/k4yt3x/video2x/graphs/contributors).
Copyright (C) 2018-2025 K4YT3X and [contributors](https://github.com/k4yt3x/video2x/graphs/contributors).
![AGPLv3](https://www.gnu.org/graphics/agplv3-155x51.png)
@@ -120,6 +150,7 @@ Special thanks to the following individuals for their significant contributions
- [@ArchieMeng](https://github.com/archiemeng)
- [@BrianPetkovsek](https://github.com/BrianPetkovsek)
- [@Integral-Tech](https://github.com/Integral-Tech)
- [@ddouglas87](https://github.com/ddouglas87)
- [@lhanjian](https://github.com/lhanjian)
- [@nihui](https://github.com/nihui)

View File

@@ -0,0 +1,2 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/Video2XTargets.cmake")

View File

@@ -4,13 +4,17 @@ Instructions for building this project on Linux.
## Arch Linux
Arch users can build the latest version of the project from the AUR package `video2x-git`. The project's repository also contains another PKGBUILD example at `packaging/arch/PKGBUILD`.
Arch users can build the latest version of the project from the AUR packages [`video2x`](https://aur.archlinux.org/packages/video2x) and [`video2x-git`](https://aur.archlinux.org/packages/video2x-git). The project's repository also contains another PKGBUILD example at `packaging/arch/PKGBUILD`.
```bash
# Build only
git clone https://aur.archlinux.org/video2x-git.git
git clone https://aur.archlinux.org/video2x.git
cd video2x-git
# Build the package without installing it
makepkg -s
# Build and install the package
makepkg -si
```
To build manually from the source, follow the instructions below.
@@ -18,33 +22,36 @@ To build manually from the source, follow the instructions below.
```bash
# Install build and runtime dependencies
# See the PKGBUILD file for the list of up-to-date dependencies
pacman -Sy ffmpeg ncnn vulkan-driver opencv spdlog boost-libs
pacman -Sy git cmake make clang pkgconf vulkan-headers openmp boost
pacman -Sy ffmpeg ncnn vulkan-driver spdlog boost-libs
pacman -Sy git cmake clang pkgconf just vulkan-headers openmp boost
# Clone the repository
git clone --recurse-submodules https://github.com/k4yt3x/video2x.git
cd video2x
# Build the project
make build
just build
```
The built binaries will be located in the `build` directory.
## Ubuntu
Ubuntu users can use the `Makefile` to build the project automatically. The `ubuntu2404` and `ubuntu2204` targets are available for Ubuntu 24.04 and 22.04, respectively. `make` will automatically install the required dependencies, build the project, and package it into a `.deb` package file. It is recommended to perform the build in a container to ensure the environment's consistency and to avoid leaving extra build packages on your system.
Ubuntu users can use the `.justfile` to build the project automatically. The `ubuntu2404` and `ubuntu2204` targets are available for Ubuntu 24.04 and 22.04, respectively. `just` will automatically install the required dependencies, build the project, and package it into a `.deb` package file. It is recommended to perform the build in a container to ensure the environment's consistency and to avoid leaving extra build packages on your system.
```bash
# make needs to be installed manually
sudo apt-get update && sudo apt-get install make
# The version of `just` in the Ubuntu repository is outdated
# We need to compile and install `just` manually
sudo apt-get update && sudo apt-get install cargo
cargo install just
# Clone the repository
git clone --recurse-submodules https://github.com/k4yt3x/video2x.git
cd video2x
# Build the project
make ubuntu2404
# Before running the command, ensure ~/.cargo/bin is in your PATH
just ubuntu2404
```
The built `.deb` package will be located under the current directory.

View File

@@ -1,19 +1,20 @@
# Linux
Instructions for installing this project on Linux systems.
Video2X packages are available for the Linux distros listed below. If you'd like to build it from source code, refer to the [PKGBUILD](https://github.com/k4yt3x/video2x/tree/master/packaging/arch/PKGBUILD) file for a general overview of the required dependencies and commands. If a package is not available for your distro and you prefer not to compile the program from source code, consider using the [container image](running/container.md).
## Arch Linux
Arch users can install the project from the AUR.
- AUR packages, maintained by [@K4YT3X](https://github.com/k4yt3x).
- [aur/video2x](https://aur.archlinux.org/packages/video2x)
- [aur/video2x-git](https://aur.archlinux.org/packages/video2x-git)
- [aur/video2x-qt6](https://aur.archlinux.org/packages/video2x-qt6)
- [aur/video2x-qt6-git](https://aur.archlinux.org/packages/video2x-qt6-git)
- Chinese Mainland: archlinuxcn packages, maintained by [@Integral-Tech](https://github.com/Integral-Tech).
- [archlinuxcn/video2x](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x)
- [archlinuxcn/video2x-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-git)
- [archlinuxcn/video2x-qt6](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-qt6)
- [archlinuxcn/video2x-qt6-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-qt6-git)
```bash
yay -S video2x-git
```
## Other Distros
## Ubuntu
Ubuntu users can download the `.deb` packages from the [releases page](https://github.com/k4yt3x/video2x/releases/latest). Install the package with the APT package manager:
```bash
apt-get install ./video2x-linux-ubuntu2404-amd64.deb
```
Users of other distros can download and use the AppImage from the [releases page](https://github.com/k4yt3x/video2x/releases/latest).

View File

@@ -9,27 +9,27 @@ This page does not cover all the options available. For help with more options a
Use the following command to upscale a video by 4x with RealESRGAN:
```bash
video2x -i input.mp4 -o output.mp4 -f realesrgan -r 4 -m realesr-animevideov3
video2x -i input.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
Use the following command to upscale a video to with libplacebo + Anime4Kv4 Mode A+A:
```bash
video2x -i input.mp4 -o output.mp4 -f libplacebo -s anime4k-v4-a+a -w 3840 -h 2160
video2x -i input.mp4 -o output.mp4 -w 3840 -h 2160 -p libplacebo --libplacebo-shader anime4k-v4-a+a
```
## Advanced
It is possible to specify custom MPV-compatible GLSL shader files with the `--shader, -s` argument:
It is possible to specify custom MPV-compatible GLSL shader files with the `--libplacebo-shader` argument:
```bash
video2x -i input.mp4 -o output.mp4 -f libplacebo -s path/to/custom/shader.glsl -w 3840 -h 2160
video2x -i input.mp4 -o output.mp4 -p libplacebo -w 3840 -h 2160 --libplacebo-shader path/to/custom/shader.glsl
```
List the available GPUs with `--list-gpus, -l`:
```bash
$video2x --list-gpus
$ video2x --list-gpus
0. NVIDIA RTX A6000
Type: Discrete GPU
Vulkan API Version: 1.3.289
@@ -39,11 +39,66 @@ $video2x --list-gpus
Select which GPU to use with the `--gpu, -g` argument:
```bash
video2x -i input.mp4 -o output.mp4 -f realesrgan -r 4 -m realesr-animevideov3 -g 1
video2x -i input.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3 -g 1
```
Specify arbitrary extra FFmepg encoder options with the `--extra-encoder-options, -e` argument:
Specify arbitrary extra FFmpeg encoder options with the `--extra-encoder-options, -e` argument:
```bash
video2x -i input.mkv -o output.mkv -f realesrgan -m realesrgan-plus -r 4 -c libx264rgb -e crf=17 -e preset=veryslow -e tune=film
video2x -i input.mkv -o output.mkv -p realesrgan --realesrgan-model realesrgan-plus -s 4 -c libx264rgb -e crf=17 -e preset=veryslow -e tune=film
```
## Encoder Options
Video2X uses FFmpeg's C libraries to encode videos. Encoder options are specified in two ways:
- **Common options** shared by all encoders are stored in a [`AVCodecContext`](https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html) struct. Below are some options set through `AVCodecContext`:
- Codec
- Pixel format
- Bitrate
- Keyframe interval
- Minimum and maximum quantizer
- GOP size
- **Encoder-specific** options are stored in [`AVOption`](https://ffmpeg.org/doxygen/trunk/structAVOption.html) structs and set with the [`av_opt_set`](https://ffmpeg.org/doxygen/trunk/group__opt__set__funcs.html#ga5fd4b92bdf4f392a2847f711676a7537) function. Below are some encoder-specific options for `libx264`:
- CRF
- Preset
- Tune
- Profile
Common options can only be set through Video2X's command line arguments. You can run `video2x --help` and see the `Encoder options` section to see the supported options.
You can specify encoder-specific options in Video2X using the `--extra-encoder-option` (`-e`) argument. To view the available options for a particular codec, run:
```bash
ffmpeg -h encoder=$ENCODER
```
For example, to view the available options for `libx264`, run:
```console
$ ffmpeg -h encoder=libx264
Encoder libx264 [libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10]:
General capabilities: dr1 delay threads
Threading capabilities: other
Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv16 nv21 yuv420p10le yuv422p10le yuv444p10le nv20le gray gray10le
libx264 AVOptions:
-preset <string> E..V....... Set the encoding preset (cf. x264 --fullhelp) (default "medium")
-tune <string> E..V....... Tune the encoding params (cf. x264 --fullhelp)
-profile <string> E..V....... Set profile restrictions (cf. x264 --fullhelp)
-fastfirstpass <boolean> E..V....... Use fast settings when encoding first pass (default true)
-level <string> E..V....... Specify level (as defined by Annex A)
-passlogfile <string> E..V....... Filename for 2 pass stats
-wpredp <string> E..V....... Weighted prediction for P-frames
-a53cc <boolean> E..V....... Use A53 Closed Captions (if available) (default true)
-x264opts <string> E..V....... x264 options
-crf <float> E..V....... Select the quality for constant quality mode (from -1 to FLT_MAX) (default -1)
-crf_max <float> E..V....... In CRF mode, prevents VBV from lowering quality beyond this point. (from -1 to FLT_MAX) (default -1)
-qp <int> E..V....... Constant quantization parameter rate control method (from -1 to INT_MAX) (default -1)
...
```
You can then set the encoder-specific options with the `-e` argument. The `-e` argument can be used multiple times to set multiple options. For example, the following arguments set the CRF to 17, the preset to `veryslow`, and the tune to `film` for `libx264`:
```console
-e crf=17 -e preset=veryslow -e tune=film
```

View File

@@ -17,7 +17,7 @@ This section documents how to upscale a video. Replace `$TAG` with an appropriat
Make sure your host has the proper GPU and Vulkan libraries and drivers, then use the following command to launch the container:
```shell
docker run --gpus all -it --rm -v $PWD/data:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -f realesrgan -r 4 -m realesr-animevideov3
docker run --gpus all -it --rm -v $PWD/data:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
### NVIDIA GPUs
@@ -33,19 +33,19 @@ In addition to installing the proper drivers on your host, `nvidia-docker2` (NVI
Once all the prerequisites are installed, you can launch the container:
```shell
docker run --gpus all -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -f realesrgan -r 4 -m realesr-animevideov3
docker run --gpus all -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
Depending on the version of your nvidia-docker and some other mysterious factors, you can also try setting `no-cgroups = true` in `/etc/nvidia-container-runtime/config.toml` and adding the NVIDIA devices into the container if the command above doesn't work:
```shell
docker run --gpus all --device=/dev/nvidia0 --device=/dev/nvidiactl --runtime nvidia -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -f realesrgan -r 4 -m realesr-animevideov3
docker run --gpus all --device=/dev/nvidia0 --device=/dev/nvidiactl --runtime nvidia -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
If you are still getting a `vkEnumeratePhysicalDevices failed -3` error at this point, try adding the `--privileged` flag to give the container the same level of permissions as the host:
```shell
docker run --gpus all --privileged -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -f realesrgan -r 4 -m realesr-animevideov3
docker run --gpus all --privileged -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
### Intel GPUs
@@ -53,5 +53,5 @@ docker run --gpus all --privileged -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x
Similar to NVIDIA GPUs, you can add `--gpus all` or `--device /dev/dri` to pass the GPU into the container. Adding `--privileged` might help with the performance (thanks @NukeninDark).
```shell
docker run --gpus all --privileged -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -f realesrgan -r 4 -m realesr-animevideov3
docker run --gpus all --privileged -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```

View File

@@ -7,19 +7,19 @@ extern "C" {
namespace video2x {
namespace avutils {
AVRational get_video_frame_rate(AVFormatContext *ifmt_ctx, int in_vstream_idx);
AVRational get_video_frame_rate(AVFormatContext* ifmt_ctx, int in_vstream_idx);
int64_t get_video_frame_count(AVFormatContext *ifmt_ctx, int in_vstream_idx);
int64_t get_video_frame_count(AVFormatContext* ifmt_ctx, int in_vstream_idx);
AVPixelFormat get_encoder_default_pix_fmt(const AVCodec *encoder, AVPixelFormat target_pix_fmt);
AVPixelFormat get_encoder_default_pix_fmt(const AVCodec* encoder, AVPixelFormat target_pix_fmt);
float get_frame_diff(AVFrame *frame1, AVFrame *frame2);
float get_frame_diff(AVFrame* frame1, AVFrame* frame2);
void av_bufferref_deleter(AVBufferRef *bufferref);
void av_bufferref_deleter(AVBufferRef* bufferref);
void av_frame_deleter(AVFrame *frame);
void av_frame_deleter(AVFrame* frame);
void av_packet_deleter(AVPacket *packet);
void av_packet_deleter(AVPacket* packet);
} // namespace avutils
} // namespace video2x

View File

@@ -11,13 +11,13 @@ namespace video2x {
namespace conversions {
// Convert AVFrame to another pixel format
AVFrame *convert_avframe_pix_fmt(AVFrame *src_frame, AVPixelFormat pix_fmt);
AVFrame* convert_avframe_pix_fmt(AVFrame* src_frame, AVPixelFormat pix_fmt);
// Convert AVFrame to ncnn::Mat
ncnn::Mat avframe_to_ncnn_mat(AVFrame *frame);
ncnn::Mat avframe_to_ncnn_mat(AVFrame* frame);
// Convert ncnn::Mat to AVFrame
AVFrame *ncnn_mat_to_avframe(const ncnn::Mat &mat, AVPixelFormat pix_fmt);
AVFrame* ncnn_mat_to_avframe(const ncnn::Mat& mat, AVPixelFormat pix_fmt);
} // namespace conversions
} // namespace video2x

View File

@@ -15,18 +15,18 @@ class Decoder {
Decoder();
~Decoder();
int init(AVHWDeviceType hw_type, AVBufferRef *hw_ctx, const std::filesystem::path &in_fpath);
int init(AVHWDeviceType hw_type, AVBufferRef* hw_ctx, const std::filesystem::path& in_fpath);
AVFormatContext *get_format_context() const;
AVCodecContext *get_codec_context() const;
AVFormatContext* get_format_context() const;
AVCodecContext* get_codec_context() const;
int get_video_stream_index() const;
private:
static AVPixelFormat hw_pix_fmt_;
static AVPixelFormat get_hw_format(AVCodecContext *ctx, const AVPixelFormat *pix_fmts);
static AVPixelFormat get_hw_format(AVCodecContext* ctx, const AVPixelFormat* pix_fmts);
AVFormatContext *fmt_ctx_;
AVCodecContext *dec_ctx_;
AVFormatContext* fmt_ctx_;
AVCodecContext* dec_ctx_;
int in_vstream_idx_;
};

View File

@@ -10,16 +10,16 @@ extern "C" {
#include <libavutil/pixdesc.h>
}
#include "fsutils.h"
namespace video2x {
namespace encoder {
// Encoder configurations
struct EncoderConfig {
// Non-AVCodecContext options
AVCodecID codec = AV_CODEC_ID_NONE;
bool copy_streams = true;
std::string codec = "libx264";
bool recalculate_pts = true;
bool copy_audio_streams = true;
bool copy_subtitle_streams = true;
// Basic video options
AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
@@ -45,7 +45,7 @@ struct EncoderConfig {
int delay = -1;
// Extra AVOptions
std::vector<std::pair<fsutils::StringType, fsutils::StringType>> extra_opts;
std::vector<std::pair<std::string, std::string>> extra_opts;
};
class Encoder {
@@ -54,30 +54,31 @@ class Encoder {
~Encoder();
int init(
AVBufferRef *hw_ctx,
const std::filesystem::path &out_fpath,
AVFormatContext *ifmt_ctx,
AVCodecContext *dec_ctx,
EncoderConfig &enc_cfg,
AVBufferRef* hw_ctx,
const std::filesystem::path& out_fpath,
AVFormatContext* ifmt_ctx,
AVCodecContext* dec_ctx,
EncoderConfig& enc_cfg,
int width,
int height,
int frm_rate_mul,
int in_vstream_idx
);
int write_frame(AVFrame *frame, int64_t frame_idx);
int write_frame(AVFrame* frame, int64_t frame_idx);
int flush();
AVCodecContext *get_encoder_context() const;
AVFormatContext *get_format_context() const;
int *get_stream_map() const;
AVCodecContext* get_encoder_context() const;
AVFormatContext* get_format_context() const;
int* get_stream_map() const;
int get_output_video_stream_index() const;
private:
AVFormatContext *ofmt_ctx_;
AVCodecContext *enc_ctx_;
EncoderConfig enc_cfg_;
AVFormatContext* ofmt_ctx_;
AVCodecContext* enc_ctx_;
int out_vstream_idx_;
int *stream_map_;
int* stream_map_;
};
} // namespace encoder

View File

@@ -19,7 +19,7 @@ class FilterLibplacebo : public Filter {
// Constructor
FilterLibplacebo(
uint32_t vk_device_index,
const std::filesystem::path &shader_path,
const std::filesystem::path& shader_path,
int width,
int height
);
@@ -28,30 +28,30 @@ class FilterLibplacebo : public Filter {
virtual ~FilterLibplacebo() override;
// Initializes the filter with decoder and encoder contexts
int init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *hw_ctx) override;
int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) override;
// Processes an input frame and returns the processed frame
int filter(AVFrame *in_frame, AVFrame **out_frame) override;
int filter(AVFrame* in_frame, AVFrame** out_frame) override;
// Flushes any remaining frames
int flush(std::vector<AVFrame *> &flushed_frames) override;
int flush(std::vector<AVFrame*>& flushed_frames) override;
// Returns the filter's type
ProcessorType get_processor_type() const override { return ProcessorType::Libplacebo; }
// Returns the filter's output dimensions
void get_output_dimensions(
const ProcessorConfig &proc_cfg,
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int &out_width,
int &out_height
int& out_width,
int& out_height
) const override;
private:
AVFilterGraph *filter_graph_;
AVFilterContext *buffersrc_ctx_;
AVFilterContext *buffersink_ctx_;
AVFilterGraph* filter_graph_;
AVFilterContext* buffersrc_ctx_;
AVFilterContext* buffersink_ctx_;
uint32_t vk_device_index_;
const std::filesystem::path shader_path_;
int width_;

View File

@@ -28,25 +28,25 @@ class FilterRealcugan : public Filter {
virtual ~FilterRealcugan() override;
// Initializes the filter with decoder and encoder contexts
int init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *hw_ctx) override;
int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) override;
// Processes an input frame and returns the processed frame
int filter(AVFrame *in_frame, AVFrame **out_frame) override;
int filter(AVFrame* in_frame, AVFrame** out_frame) override;
// Returns the filter's type
ProcessorType get_processor_type() const override { return ProcessorType::RealCUGAN; }
// Returns the filter's output dimensions
void get_output_dimensions(
const ProcessorConfig &proc_cfg,
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int &out_width,
int &out_height
int& out_width,
int& out_height
) const override;
private:
RealCUGAN *realcugan_;
RealCUGAN* realcugan_;
int gpuid_;
bool tta_mode_;
int scaling_factor_;

View File

@@ -18,6 +18,7 @@ class FilterRealesrgan : public Filter {
int gpuid = 0,
bool tta_mode = false,
int scaling_factor = 4,
int noise_level = 0,
const fsutils::StringType model_name = STR("realesr-animevideov3")
);
@@ -25,28 +26,29 @@ class FilterRealesrgan : public Filter {
virtual ~FilterRealesrgan() override;
// Initializes the filter with decoder and encoder contexts
int init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *hw_ctx) override;
int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) override;
// Processes an input frame and returns the processed frame
int filter(AVFrame *in_frame, AVFrame **out_frame) override;
int filter(AVFrame* in_frame, AVFrame** out_frame) override;
// Returns the filter's type
ProcessorType get_processor_type() const override { return ProcessorType::RealESRGAN; }
// Returns the filter's output dimensions
void get_output_dimensions(
const ProcessorConfig &proc_cfg,
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int &out_width,
int &out_height
int& out_width,
int& out_height
) const override;
private:
RealESRGAN *realesrgan_;
RealESRGAN* realesrgan_;
int gpuid_;
bool tta_mode_;
int scaling_factor_;
int noise_level_;
const fsutils::StringType model_name_;
AVRational in_time_base_;
AVRational out_time_base_;

View File

@@ -1,6 +1,7 @@
#pragma once
#include <filesystem>
#include <optional>
#include <string>
namespace video2x {
@@ -20,15 +21,15 @@ typedef std::wstring StringType;
typedef std::string StringType;
#endif
bool filepath_is_readable(const std::filesystem::path &path);
bool file_is_readable(const std::filesystem::path& path);
std::filesystem::path find_resource_file(const std::filesystem::path &path);
std::optional<std::filesystem::path> find_resource(const std::filesystem::path& resource);
std::string path_to_u8string(const std::filesystem::path &path);
std::string path_to_u8string(const std::filesystem::path& path);
std::string wstring_to_u8string(const fsutils::StringType &wstr);
std::string wstring_to_u8string(const fsutils::StringType& wstr);
fsutils::StringType path_to_string_type(const std::filesystem::path &path);
fsutils::StringType path_to_string_type(const std::filesystem::path& path);
fsutils::StringType to_string_type(int value);

View File

@@ -27,10 +27,10 @@ class InterpolatorRIFE : public Interpolator {
virtual ~InterpolatorRIFE() override;
// Initializes the interpolator with decoder and encoder contexts
int init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *hw_ctx) override;
int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) override;
// Processes an input frame and returns the processed frame
int interpolate(AVFrame *prev_frame, AVFrame *in_frame, AVFrame **out_frame, float time_step)
int interpolate(AVFrame* prev_frame, AVFrame* in_frame, AVFrame** out_frame, float time_step)
override;
// Returns the interpolator's type
@@ -38,15 +38,15 @@ class InterpolatorRIFE : public Interpolator {
// Returns the interpolator's output dimensions
void get_output_dimensions(
const ProcessorConfig &proc_cfg,
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int &out_width,
int &out_height
int& out_width,
int& out_height
) const override;
private:
RIFE *rife_;
RIFE* rife_;
int gpuid_;
bool tta_mode_;
bool tta_temporal_mode_;

View File

@@ -11,14 +11,14 @@ namespace video2x {
namespace processors {
int init_libplacebo(
AVFilterGraph **filter_graph,
AVFilterContext **buffersrc_ctx,
AVFilterContext **buffersink_ctx,
AVCodecContext *dec_ctx,
AVFilterGraph** filter_graph,
AVFilterContext** buffersrc_ctx,
AVFilterContext** buffersink_ctx,
AVCodecContext* dec_ctx,
int out_width,
int out_height,
uint32_t vk_device_index,
const std::filesystem::path &shader_path
const std::filesystem::path& shader_path
);
} // namespace processors

View File

@@ -51,33 +51,33 @@ class LIBVIDEO2X_API VideoProcessor {
private:
[[nodiscard]] int process_frames(
decoder::Decoder &decoder,
encoder::Encoder &encoder,
std::unique_ptr<processors::Processor> &processor
decoder::Decoder& decoder,
encoder::Encoder& encoder,
std::unique_ptr<processors::Processor>& processor
);
[[nodiscard]] int write_frame(AVFrame *frame, encoder::Encoder &encoder);
[[nodiscard]] int write_frame(AVFrame* frame, encoder::Encoder& encoder);
[[nodiscard]] inline int write_raw_packet(
AVPacket *packet,
AVFormatContext *ifmt_ctx,
AVFormatContext *ofmt_ctx,
int *stream_map
AVPacket* packet,
AVFormatContext* ifmt_ctx,
AVFormatContext* ofmt_ctx,
int* stream_map
);
[[nodiscard]] inline int process_filtering(
std::unique_ptr<processors::Processor> &processor,
encoder::Encoder &encoder,
AVFrame *frame,
AVFrame *proc_frame
std::unique_ptr<processors::Processor>& processor,
encoder::Encoder& encoder,
AVFrame* frame,
AVFrame* proc_frame
);
[[nodiscard]] inline int process_interpolation(
std::unique_ptr<processors::Processor> &processor,
encoder::Encoder &encoder,
std::unique_ptr<AVFrame, decltype(&avutils::av_frame_deleter)> &prev_frame,
AVFrame *frame,
AVFrame *proc_frame
std::unique_ptr<processors::Processor>& processor,
encoder::Encoder& encoder,
std::unique_ptr<AVFrame, decltype(&avutils::av_frame_deleter)>& prev_frame,
AVFrame* frame,
AVFrame* proc_frame
);
processors::ProcessorConfig proc_cfg_;

View File

@@ -14,20 +14,20 @@ namespace logger_manager {
class LIBVIDEO2X_API LoggerManager {
public:
LoggerManager(const LoggerManager &) = delete;
LoggerManager &operator=(const LoggerManager &) = delete;
LoggerManager(const LoggerManager&) = delete;
LoggerManager& operator=(const LoggerManager&) = delete;
static LoggerManager &instance();
static LoggerManager& instance();
std::shared_ptr<spdlog::logger> logger();
bool reconfigure_logger(
const std::string &logger_name,
const std::vector<spdlog::sink_ptr> &sinks,
const std::string &pattern = "%+"
const std::string& logger_name,
const std::vector<spdlog::sink_ptr>& sinks,
const std::string& pattern = "%+"
);
bool set_log_level(const std::string &level_str);
bool set_log_level(const std::string& level_str);
void hook_ffmpeg_logging();
void unhook_ffmpeg_logging();

View File

@@ -66,16 +66,16 @@ struct ProcessorConfig {
class Processor {
public:
virtual ~Processor() = default;
virtual int init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *hw_ctx) = 0;
virtual int flush(std::vector<AVFrame *> &) { return 0; }
virtual int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) = 0;
virtual int flush(std::vector<AVFrame*>&) { return 0; }
virtual ProcessingMode get_processing_mode() const = 0;
virtual ProcessorType get_processor_type() const = 0;
virtual void get_output_dimensions(
const ProcessorConfig &proc_cfg,
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int &width,
int &height
int& width,
int& height
) const = 0;
};
@@ -83,7 +83,7 @@ class Processor {
class Filter : public Processor {
public:
ProcessingMode get_processing_mode() const override { return ProcessingMode::Filter; }
virtual int filter(AVFrame *in_frame, AVFrame **out_frame) = 0;
virtual int filter(AVFrame* in_frame, AVFrame** out_frame) = 0;
};
// Abstract base class for interpolators
@@ -91,7 +91,7 @@ class Interpolator : public Processor {
public:
ProcessingMode get_processing_mode() const override { return ProcessingMode::Interpolate; }
virtual int
interpolate(AVFrame *prev_frame, AVFrame *in_frame, AVFrame **out_frame, float time_step) = 0;
interpolate(AVFrame* prev_frame, AVFrame* in_frame, AVFrame** out_frame, float time_step) = 0;
};
} // namespace processors

View File

@@ -12,17 +12,17 @@ namespace processors {
// Processor Factory Class
class ProcessorFactory {
public:
using Creator = std::function<std::unique_ptr<Processor>(const ProcessorConfig &, uint32_t)>;
using Creator = std::function<std::unique_ptr<Processor>(const ProcessorConfig&, uint32_t)>;
// Singleton instance accessor
static ProcessorFactory &instance();
static ProcessorFactory& instance();
// Register a processor type with its creation function
void register_processor(ProcessorType type, Creator creator);
// Create a processor instance based on configuration
std::unique_ptr<Processor>
create_processor(const ProcessorConfig &proc_cfg, uint32_t vk_device_index) const;
create_processor(const ProcessorConfig& proc_cfg, uint32_t vk_device_index) const;
private:
// Private constructor for Singleton
@@ -32,7 +32,7 @@ class ProcessorFactory {
std::unordered_map<ProcessorType, Creator> creators;
// Static initializer for default processors
static void init_default_processors(ProcessorFactory &factory);
static void init_default_processors(ProcessorFactory& factory);
};
} // namespace processors

Binary file not shown.

View File

@@ -0,0 +1,75 @@
7767517
73 74
Input data 0 1 data
Split splitncnn_input0 1 2 data data_splitncnn_0 data_splitncnn_1
Convolution /Conv 1 1 data_splitncnn_1 /Conv_output_0 0=64 1=3 4=1 5=1 6=1728
PReLU /PRelu 1 1 /Conv_output_0 /PRelu_output_0 0=64
Convolution /Conv_1 1 1 /PRelu_output_0 /Conv_1_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_1 1 1 /Conv_1_output_0 /PRelu_1_output_0 0=64
Convolution /Conv_2 1 1 /PRelu_1_output_0 /Conv_2_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_2 1 1 /Conv_2_output_0 /PRelu_2_output_0 0=64
Convolution /Conv_3 1 1 /PRelu_2_output_0 /Conv_3_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_3 1 1 /Conv_3_output_0 /PRelu_3_output_0 0=64
Convolution /Conv_4 1 1 /PRelu_3_output_0 /Conv_4_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_4 1 1 /Conv_4_output_0 /PRelu_4_output_0 0=64
Convolution /Conv_5 1 1 /PRelu_4_output_0 /Conv_5_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_5 1 1 /Conv_5_output_0 /PRelu_5_output_0 0=64
Convolution /Conv_6 1 1 /PRelu_5_output_0 /Conv_6_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_6 1 1 /Conv_6_output_0 /PRelu_6_output_0 0=64
Convolution /Conv_7 1 1 /PRelu_6_output_0 /Conv_7_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_7 1 1 /Conv_7_output_0 /PRelu_7_output_0 0=64
Convolution /Conv_8 1 1 /PRelu_7_output_0 /Conv_8_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_8 1 1 /Conv_8_output_0 /PRelu_8_output_0 0=64
Convolution /Conv_9 1 1 /PRelu_8_output_0 /Conv_9_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_9 1 1 /Conv_9_output_0 /PRelu_9_output_0 0=64
Convolution /Conv_10 1 1 /PRelu_9_output_0 /Conv_10_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_10 1 1 /Conv_10_output_0 /PRelu_10_output_0 0=64
Convolution /Conv_11 1 1 /PRelu_10_output_0 /Conv_11_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_11 1 1 /Conv_11_output_0 /PRelu_11_output_0 0=64
Convolution /Conv_12 1 1 /PRelu_11_output_0 /Conv_12_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_12 1 1 /Conv_12_output_0 /PRelu_12_output_0 0=64
Convolution /Conv_13 1 1 /PRelu_12_output_0 /Conv_13_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_13 1 1 /Conv_13_output_0 /PRelu_13_output_0 0=64
Convolution /Conv_14 1 1 /PRelu_13_output_0 /Conv_14_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_14 1 1 /Conv_14_output_0 /PRelu_14_output_0 0=64
Convolution /Conv_15 1 1 /PRelu_14_output_0 /Conv_15_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_15 1 1 /Conv_15_output_0 /PRelu_15_output_0 0=64
Convolution /Conv_16 1 1 /PRelu_15_output_0 /Conv_16_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_16 1 1 /Conv_16_output_0 /PRelu_16_output_0 0=64
Convolution /Conv_17 1 1 /PRelu_16_output_0 /Conv_17_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_17 1 1 /Conv_17_output_0 /PRelu_17_output_0 0=64
Convolution /Conv_18 1 1 /PRelu_17_output_0 /Conv_18_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_18 1 1 /Conv_18_output_0 /PRelu_18_output_0 0=64
Convolution /Conv_19 1 1 /PRelu_18_output_0 /Conv_19_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_19 1 1 /Conv_19_output_0 /PRelu_19_output_0 0=64
Convolution /Conv_20 1 1 /PRelu_19_output_0 /Conv_20_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_20 1 1 /Conv_20_output_0 /PRelu_20_output_0 0=64
Convolution /Conv_21 1 1 /PRelu_20_output_0 /Conv_21_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_21 1 1 /Conv_21_output_0 /PRelu_21_output_0 0=64
Convolution /Conv_22 1 1 /PRelu_21_output_0 /Conv_22_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_22 1 1 /Conv_22_output_0 /PRelu_22_output_0 0=64
Convolution /Conv_23 1 1 /PRelu_22_output_0 /Conv_23_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_23 1 1 /Conv_23_output_0 /PRelu_23_output_0 0=64
Convolution /Conv_24 1 1 /PRelu_23_output_0 /Conv_24_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_24 1 1 /Conv_24_output_0 /PRelu_24_output_0 0=64
Convolution /Conv_25 1 1 /PRelu_24_output_0 /Conv_25_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_25 1 1 /Conv_25_output_0 /PRelu_25_output_0 0=64
Convolution /Conv_26 1 1 /PRelu_25_output_0 /Conv_26_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_26 1 1 /Conv_26_output_0 /PRelu_26_output_0 0=64
Convolution /Conv_27 1 1 /PRelu_26_output_0 /Conv_27_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_27 1 1 /Conv_27_output_0 /PRelu_27_output_0 0=64
Convolution /Conv_28 1 1 /PRelu_27_output_0 /Conv_28_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_28 1 1 /Conv_28_output_0 /PRelu_28_output_0 0=64
Convolution /Conv_29 1 1 /PRelu_28_output_0 /Conv_29_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_29 1 1 /Conv_29_output_0 /PRelu_29_output_0 0=64
Convolution /Conv_30 1 1 /PRelu_29_output_0 /Conv_30_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_30 1 1 /Conv_30_output_0 /PRelu_30_output_0 0=64
Convolution /Conv_31 1 1 /PRelu_30_output_0 /Conv_31_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_31 1 1 /Conv_31_output_0 /PRelu_31_output_0 0=64
Convolution /Conv_32 1 1 /PRelu_31_output_0 /Conv_32_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_32 1 1 /Conv_32_output_0 /PRelu_32_output_0 0=64
Convolution /Conv_33 1 1 /PRelu_32_output_0 /Conv_33_output_0 0=48 1=3 4=1 5=1 6=27648
PixelShuffle /DepthToSpace 1 1 /Conv_33_output_0 /DepthToSpace_output_0 0=4
Interp /Resize 1 1 data_splitncnn_0 /Resize_output_0 0=1 1=4.000000e+00 2=4.000000e+00
BinaryOp /Add 2 1 /DepthToSpace_output_0 /Resize_output_0 /Add_output_0
Clip /Clip 1 1 /Add_output_0 output 0=0.000000e+00 1=1.000000e+00

Binary file not shown.

View File

@@ -0,0 +1,75 @@
7767517
73 74
Input data 0 1 data
Split splitncnn_input0 1 2 data data_splitncnn_0 data_splitncnn_1
Convolution /Conv 1 1 data_splitncnn_1 /Conv_output_0 0=64 1=3 4=1 5=1 6=1728
PReLU /PRelu 1 1 /Conv_output_0 /PRelu_output_0 0=64
Convolution /Conv_1 1 1 /PRelu_output_0 /Conv_1_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_1 1 1 /Conv_1_output_0 /PRelu_1_output_0 0=64
Convolution /Conv_2 1 1 /PRelu_1_output_0 /Conv_2_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_2 1 1 /Conv_2_output_0 /PRelu_2_output_0 0=64
Convolution /Conv_3 1 1 /PRelu_2_output_0 /Conv_3_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_3 1 1 /Conv_3_output_0 /PRelu_3_output_0 0=64
Convolution /Conv_4 1 1 /PRelu_3_output_0 /Conv_4_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_4 1 1 /Conv_4_output_0 /PRelu_4_output_0 0=64
Convolution /Conv_5 1 1 /PRelu_4_output_0 /Conv_5_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_5 1 1 /Conv_5_output_0 /PRelu_5_output_0 0=64
Convolution /Conv_6 1 1 /PRelu_5_output_0 /Conv_6_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_6 1 1 /Conv_6_output_0 /PRelu_6_output_0 0=64
Convolution /Conv_7 1 1 /PRelu_6_output_0 /Conv_7_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_7 1 1 /Conv_7_output_0 /PRelu_7_output_0 0=64
Convolution /Conv_8 1 1 /PRelu_7_output_0 /Conv_8_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_8 1 1 /Conv_8_output_0 /PRelu_8_output_0 0=64
Convolution /Conv_9 1 1 /PRelu_8_output_0 /Conv_9_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_9 1 1 /Conv_9_output_0 /PRelu_9_output_0 0=64
Convolution /Conv_10 1 1 /PRelu_9_output_0 /Conv_10_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_10 1 1 /Conv_10_output_0 /PRelu_10_output_0 0=64
Convolution /Conv_11 1 1 /PRelu_10_output_0 /Conv_11_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_11 1 1 /Conv_11_output_0 /PRelu_11_output_0 0=64
Convolution /Conv_12 1 1 /PRelu_11_output_0 /Conv_12_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_12 1 1 /Conv_12_output_0 /PRelu_12_output_0 0=64
Convolution /Conv_13 1 1 /PRelu_12_output_0 /Conv_13_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_13 1 1 /Conv_13_output_0 /PRelu_13_output_0 0=64
Convolution /Conv_14 1 1 /PRelu_13_output_0 /Conv_14_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_14 1 1 /Conv_14_output_0 /PRelu_14_output_0 0=64
Convolution /Conv_15 1 1 /PRelu_14_output_0 /Conv_15_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_15 1 1 /Conv_15_output_0 /PRelu_15_output_0 0=64
Convolution /Conv_16 1 1 /PRelu_15_output_0 /Conv_16_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_16 1 1 /Conv_16_output_0 /PRelu_16_output_0 0=64
Convolution /Conv_17 1 1 /PRelu_16_output_0 /Conv_17_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_17 1 1 /Conv_17_output_0 /PRelu_17_output_0 0=64
Convolution /Conv_18 1 1 /PRelu_17_output_0 /Conv_18_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_18 1 1 /Conv_18_output_0 /PRelu_18_output_0 0=64
Convolution /Conv_19 1 1 /PRelu_18_output_0 /Conv_19_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_19 1 1 /Conv_19_output_0 /PRelu_19_output_0 0=64
Convolution /Conv_20 1 1 /PRelu_19_output_0 /Conv_20_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_20 1 1 /Conv_20_output_0 /PRelu_20_output_0 0=64
Convolution /Conv_21 1 1 /PRelu_20_output_0 /Conv_21_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_21 1 1 /Conv_21_output_0 /PRelu_21_output_0 0=64
Convolution /Conv_22 1 1 /PRelu_21_output_0 /Conv_22_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_22 1 1 /Conv_22_output_0 /PRelu_22_output_0 0=64
Convolution /Conv_23 1 1 /PRelu_22_output_0 /Conv_23_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_23 1 1 /Conv_23_output_0 /PRelu_23_output_0 0=64
Convolution /Conv_24 1 1 /PRelu_23_output_0 /Conv_24_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_24 1 1 /Conv_24_output_0 /PRelu_24_output_0 0=64
Convolution /Conv_25 1 1 /PRelu_24_output_0 /Conv_25_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_25 1 1 /Conv_25_output_0 /PRelu_25_output_0 0=64
Convolution /Conv_26 1 1 /PRelu_25_output_0 /Conv_26_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_26 1 1 /Conv_26_output_0 /PRelu_26_output_0 0=64
Convolution /Conv_27 1 1 /PRelu_26_output_0 /Conv_27_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_27 1 1 /Conv_27_output_0 /PRelu_27_output_0 0=64
Convolution /Conv_28 1 1 /PRelu_27_output_0 /Conv_28_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_28 1 1 /Conv_28_output_0 /PRelu_28_output_0 0=64
Convolution /Conv_29 1 1 /PRelu_28_output_0 /Conv_29_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_29 1 1 /Conv_29_output_0 /PRelu_29_output_0 0=64
Convolution /Conv_30 1 1 /PRelu_29_output_0 /Conv_30_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_30 1 1 /Conv_30_output_0 /PRelu_30_output_0 0=64
Convolution /Conv_31 1 1 /PRelu_30_output_0 /Conv_31_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_31 1 1 /Conv_31_output_0 /PRelu_31_output_0 0=64
Convolution /Conv_32 1 1 /PRelu_31_output_0 /Conv_32_output_0 0=64 1=3 4=1 5=1 6=36864
PReLU /PRelu_32 1 1 /Conv_32_output_0 /PRelu_32_output_0 0=64
Convolution /Conv_33 1 1 /PRelu_32_output_0 /Conv_33_output_0 0=48 1=3 4=1 5=1 6=27648
PixelShuffle /DepthToSpace 1 1 /Conv_33_output_0 /DepthToSpace_output_0 0=4
Interp /Resize 1 1 data_splitncnn_0 /Resize_output_0 0=1 1=4.000000e+00 2=4.000000e+00
BinaryOp /Add 2 1 /DepthToSpace_output_0 /Resize_output_0 /Add_output_0
Clip /Clip 1 1 /Add_output_0 output 0=0.000000e+00 1=1.000000e+00

BIN
models/rife/rife-v4.25-lite/flownet.bin vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,391 @@
7767517
389 485
Input in0 0 1 in0
Split splitncnn_input0 1 8 in0 in0_splitncnn_0 in0_splitncnn_1 in0_splitncnn_2 in0_splitncnn_3 in0_splitncnn_4 in0_splitncnn_5 in0_splitncnn_6 in0_splitncnn_7
Input in1 0 1 in1
Split splitncnn_input1 1 7 in1 in1_splitncnn_0 in1_splitncnn_1 in1_splitncnn_2 in1_splitncnn_3 in1_splitncnn_4 in1_splitncnn_5 in1_splitncnn_6
Input in2 0 1 in2
MemoryData block0.convblock.0.beta 0 1 block0.convblock.0.beta 0=1 1=1 2=192
MemoryData block0.convblock.1.beta 0 1 block0.convblock.1.beta 0=1 1=1 2=192
MemoryData block0.convblock.2.beta 0 1 block0.convblock.2.beta 0=1 1=1 2=192
MemoryData block0.convblock.3.beta 0 1 block0.convblock.3.beta 0=1 1=1 2=192
MemoryData block0.convblock.4.beta 0 1 block0.convblock.4.beta 0=1 1=1 2=192
MemoryData block0.convblock.5.beta 0 1 block0.convblock.5.beta 0=1 1=1 2=192
MemoryData block0.convblock.6.beta 0 1 block0.convblock.6.beta 0=1 1=1 2=192
MemoryData block0.convblock.7.beta 0 1 block0.convblock.7.beta 0=1 1=1 2=192
MemoryData block1.convblock.0.beta 0 1 block1.convblock.0.beta 0=1 1=1 2=128
MemoryData block1.convblock.1.beta 0 1 block1.convblock.1.beta 0=1 1=1 2=128
MemoryData block1.convblock.2.beta 0 1 block1.convblock.2.beta 0=1 1=1 2=128
MemoryData block1.convblock.3.beta 0 1 block1.convblock.3.beta 0=1 1=1 2=128
MemoryData block1.convblock.4.beta 0 1 block1.convblock.4.beta 0=1 1=1 2=128
MemoryData block1.convblock.5.beta 0 1 block1.convblock.5.beta 0=1 1=1 2=128
MemoryData block1.convblock.6.beta 0 1 block1.convblock.6.beta 0=1 1=1 2=128
MemoryData block1.convblock.7.beta 0 1 block1.convblock.7.beta 0=1 1=1 2=128
MemoryData block2.convblock.0.beta 0 1 block2.convblock.0.beta 0=1 1=1 2=96
MemoryData block2.convblock.1.beta 0 1 block2.convblock.1.beta 0=1 1=1 2=96
MemoryData block2.convblock.2.beta 0 1 block2.convblock.2.beta 0=1 1=1 2=96
MemoryData block2.convblock.3.beta 0 1 block2.convblock.3.beta 0=1 1=1 2=96
MemoryData block2.convblock.4.beta 0 1 block2.convblock.4.beta 0=1 1=1 2=96
MemoryData block2.convblock.5.beta 0 1 block2.convblock.5.beta 0=1 1=1 2=96
MemoryData block2.convblock.6.beta 0 1 block2.convblock.6.beta 0=1 1=1 2=96
MemoryData block2.convblock.7.beta 0 1 block2.convblock.7.beta 0=1 1=1 2=96
MemoryData block3.convblock.0.beta 0 1 block3.convblock.0.beta 0=1 1=1 2=64
MemoryData block3.convblock.1.beta 0 1 block3.convblock.1.beta 0=1 1=1 2=64
MemoryData block3.convblock.2.beta 0 1 block3.convblock.2.beta 0=1 1=1 2=64
MemoryData block3.convblock.3.beta 0 1 block3.convblock.3.beta 0=1 1=1 2=64
MemoryData block3.convblock.4.beta 0 1 block3.convblock.4.beta 0=1 1=1 2=64
MemoryData block3.convblock.5.beta 0 1 block3.convblock.5.beta 0=1 1=1 2=64
MemoryData block3.convblock.6.beta 0 1 block3.convblock.6.beta 0=1 1=1 2=64
MemoryData block3.convblock.7.beta 0 1 block3.convblock.7.beta 0=1 1=1 2=64
MemoryData block4.convblock.0.beta 0 1 block4.convblock.0.beta 0=1 1=1 2=24
MemoryData block4.convblock.1.beta 0 1 block4.convblock.1.beta 0=1 1=1 2=24
MemoryData block4.convblock.2.beta 0 1 block4.convblock.2.beta 0=1 1=1 2=24
MemoryData block4.convblock.3.beta 0 1 block4.convblock.3.beta 0=1 1=1 2=24
MemoryData block4.convblock.4.beta 0 1 block4.convblock.4.beta 0=1 1=1 2=24
MemoryData block4.convblock.5.beta 0 1 block4.convblock.5.beta 0=1 1=1 2=24
MemoryData block4.convblock.6.beta 0 1 block4.convblock.6.beta 0=1 1=1 2=24
MemoryData block4.convblock.7.beta 0 1 block4.convblock.7.beta 0=1 1=1 2=24
Crop Slice_4 1 1 in0_splitncnn_7 165 -23309=1,0 -23310=1,1 -23311=1,0
BinaryOp Mul_6 1 1 165 167 0=2 1=1
BinaryOp Add_8 1 1 167 169 1=1 2=1.000000e+00
BinaryOp Mul_9 2 1 169 in2 170 0=2
Split splitncnn_0 1 5 170 170_splitncnn_0 170_splitncnn_1 170_splitncnn_2 170_splitncnn_3 170_splitncnn_4
Crop Slice_15 1 1 in0_splitncnn_6 176 -23309=1,0 -23310=1,3 -23311=1,0
Convolution Conv_16 1 1 176 178 0=16 1=3 3=2 4=1 5=1 6=432 9=2 -23310=1,2.000000e-01
Convolution Conv_18 1 1 178 180 0=16 1=3 4=1 5=1 6=2304 9=2 -23310=1,2.000000e-01
Convolution Conv_20 1 1 180 182 0=16 1=3 4=1 5=1 6=2304 9=2 -23310=1,2.000000e-01
Deconvolution ConvTranspose_22 1 1 182 183 0=4 1=4 3=2 4=1 5=1 6=1024
Split splitncnn_1 1 5 183 183_splitncnn_0 183_splitncnn_1 183_splitncnn_2 183_splitncnn_3 183_splitncnn_4
Crop Slice_27 1 1 in1_splitncnn_6 188 -23309=1,0 -23310=1,3 -23311=1,0
Convolution Conv_28 1 1 188 190 0=16 1=3 3=2 4=1 5=1 6=432 9=2 -23310=1,2.000000e-01
Convolution Conv_30 1 1 190 192 0=16 1=3 4=1 5=1 6=2304 9=2 -23310=1,2.000000e-01
Convolution Conv_32 1 1 192 194 0=16 1=3 4=1 5=1 6=2304 9=2 -23310=1,2.000000e-01
Deconvolution ConvTranspose_34 1 1 194 195 0=4 1=4 3=2 4=1 5=1 6=1024
Split splitncnn_2 1 5 195 195_splitncnn_0 195_splitncnn_1 195_splitncnn_2 195_splitncnn_3 195_splitncnn_4
Crop Slice_39 1 1 in0_splitncnn_5 200 -23309=1,0 -23310=1,3 -23311=1,0
Crop Slice_44 1 1 in1_splitncnn_5 205 -23309=1,0 -23310=1,3 -23311=1,0
Concat Concat_45 5 1 200 205 183_splitncnn_4 195_splitncnn_4 170_splitncnn_4 206
Interp Resize_47 1 1 206 211 0=2 1=3.125000e-02 2=3.125000e-02
Convolution Conv_48 1 1 211 213 0=96 1=3 3=2 4=1 5=1 6=12960 9=2 -23310=1,2.000000e-01
Convolution Conv_50 1 1 213 215 0=192 1=3 3=2 4=1 5=1 6=165888 9=2 -23310=1,2.000000e-01
Split splitncnn_3 1 2 215 215_splitncnn_0 215_splitncnn_1
Convolution Conv_52 1 1 215_splitncnn_1 216 0=192 1=3 4=1 5=1 6=331776
BinaryOp Mul_53 2 1 216 block0.convblock.0.beta 217 0=2
BinaryOp Add_54 2 1 217 215_splitncnn_0 218
ReLU LeakyRelu_55 1 1 218 219 0=2.000000e-01
Split splitncnn_4 1 2 219 219_splitncnn_0 219_splitncnn_1
Convolution Conv_56 1 1 219_splitncnn_1 220 0=192 1=3 4=1 5=1 6=331776
BinaryOp Mul_57 2 1 220 block0.convblock.1.beta 221 0=2
BinaryOp Add_58 2 1 221 219_splitncnn_0 222
ReLU LeakyRelu_59 1 1 222 223 0=2.000000e-01
Split splitncnn_5 1 2 223 223_splitncnn_0 223_splitncnn_1
Convolution Conv_60 1 1 223_splitncnn_1 224 0=192 1=3 4=1 5=1 6=331776
BinaryOp Mul_61 2 1 224 block0.convblock.2.beta 225 0=2
BinaryOp Add_62 2 1 225 223_splitncnn_0 226
ReLU LeakyRelu_63 1 1 226 227 0=2.000000e-01
Split splitncnn_6 1 2 227 227_splitncnn_0 227_splitncnn_1
Convolution Conv_64 1 1 227_splitncnn_1 228 0=192 1=3 4=1 5=1 6=331776
BinaryOp Mul_65 2 1 228 block0.convblock.3.beta 229 0=2
BinaryOp Add_66 2 1 229 227_splitncnn_0 230
ReLU LeakyRelu_67 1 1 230 231 0=2.000000e-01
Split splitncnn_7 1 2 231 231_splitncnn_0 231_splitncnn_1
Convolution Conv_68 1 1 231_splitncnn_1 232 0=192 1=3 4=1 5=1 6=331776
BinaryOp Mul_69 2 1 232 block0.convblock.4.beta 233 0=2
BinaryOp Add_70 2 1 233 231_splitncnn_0 234
ReLU LeakyRelu_71 1 1 234 235 0=2.000000e-01
Split splitncnn_8 1 2 235 235_splitncnn_0 235_splitncnn_1
Convolution Conv_72 1 1 235_splitncnn_1 236 0=192 1=3 4=1 5=1 6=331776
BinaryOp Mul_73 2 1 236 block0.convblock.5.beta 237 0=2
BinaryOp Add_74 2 1 237 235_splitncnn_0 238
ReLU LeakyRelu_75 1 1 238 239 0=2.000000e-01
Split splitncnn_9 1 2 239 239_splitncnn_0 239_splitncnn_1
Convolution Conv_76 1 1 239_splitncnn_1 240 0=192 1=3 4=1 5=1 6=331776
BinaryOp Mul_77 2 1 240 block0.convblock.6.beta 241 0=2
BinaryOp Add_78 2 1 241 239_splitncnn_0 242
ReLU LeakyRelu_79 1 1 242 243 0=2.000000e-01
Split splitncnn_10 1 2 243 243_splitncnn_0 243_splitncnn_1
Convolution Conv_80 1 1 243_splitncnn_1 244 0=192 1=3 4=1 5=1 6=331776
BinaryOp Mul_81 2 1 244 block0.convblock.7.beta 245 0=2
BinaryOp Add_82 2 1 245 243_splitncnn_0 246
ReLU LeakyRelu_83 1 1 246 247 0=2.000000e-01
Deconvolution ConvTranspose_84 1 1 247 248 0=52 1=4 3=2 4=1 5=1 6=159744
PixelShuffle DepthToSpace_85 1 1 248 249 0=2
Interp Resize_87 1 1 249 254 0=2 1=3.200000e+01 2=3.200000e+01
Split splitncnn_11 1 3 254 254_splitncnn_0 254_splitncnn_1 254_splitncnn_2
Crop Slice_92 1 1 254_splitncnn_2 259 -23309=1,0 -23310=1,4 -23311=1,0
BinaryOp Mul_94 1 1 259 261 0=2 1=1 2=3.200000e+01
Split splitncnn_12 1 6 261 261_splitncnn_0 261_splitncnn_1 261_splitncnn_2 261_splitncnn_3 261_splitncnn_4 261_splitncnn_5
Crop Slice_99 1 1 254_splitncnn_1 266 -23309=1,4 -23310=1,5 -23311=1,0
Crop Slice_104 1 1 254_splitncnn_0 271 -23309=1,5 -23310=1,2147483647 -23311=1,0
Crop Slice_109 1 1 261_splitncnn_5 276 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_110 2 1 in0_splitncnn_4 276 277 0=6
Crop Slice_115 1 1 261_splitncnn_4 282 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_116 2 1 in1_splitncnn_4 282 283 0=6
Crop Slice_121 1 1 261_splitncnn_3 288 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_122 2 1 183_splitncnn_3 288 289 0=6
Crop Slice_127 1 1 261_splitncnn_2 294 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_128 2 1 195_splitncnn_3 294 295 0=6
Crop Slice_133 1 1 277 300 -23309=1,0 -23310=1,3 -23311=1,0
Crop Slice_138 1 1 283 305 -23309=1,0 -23310=1,3 -23311=1,0
Concat Concat_139 7 1 300 305 289 295 170_splitncnn_3 266 271 306
Interp Resize_141 1 1 306 311 0=2 1=6.250000e-02 2=6.250000e-02
Interp Resize_143 1 1 261_splitncnn_1 316 0=2 1=6.250000e-02 2=6.250000e-02
BinaryOp Div_146 1 1 316 321 0=3 1=1 2=1.600000e+01
Concat Concat_147 2 1 311 321 322
Convolution Conv_148 1 1 322 324 0=64 1=3 3=2 4=1 5=1 6=16128 9=2 -23310=1,2.000000e-01
Convolution Conv_150 1 1 324 326 0=128 1=3 3=2 4=1 5=1 6=73728 9=2 -23310=1,2.000000e-01
Split splitncnn_13 1 2 326 326_splitncnn_0 326_splitncnn_1
Convolution Conv_152 1 1 326_splitncnn_1 327 0=128 1=3 4=1 5=1 6=147456
BinaryOp Mul_153 2 1 327 block1.convblock.0.beta 328 0=2
BinaryOp Add_154 2 1 328 326_splitncnn_0 329
ReLU LeakyRelu_155 1 1 329 330 0=2.000000e-01
Split splitncnn_14 1 2 330 330_splitncnn_0 330_splitncnn_1
Convolution Conv_156 1 1 330_splitncnn_1 331 0=128 1=3 4=1 5=1 6=147456
BinaryOp Mul_157 2 1 331 block1.convblock.1.beta 332 0=2
BinaryOp Add_158 2 1 332 330_splitncnn_0 333
ReLU LeakyRelu_159 1 1 333 334 0=2.000000e-01
Split splitncnn_15 1 2 334 334_splitncnn_0 334_splitncnn_1
Convolution Conv_160 1 1 334_splitncnn_1 335 0=128 1=3 4=1 5=1 6=147456
BinaryOp Mul_161 2 1 335 block1.convblock.2.beta 336 0=2
BinaryOp Add_162 2 1 336 334_splitncnn_0 337
ReLU LeakyRelu_163 1 1 337 338 0=2.000000e-01
Split splitncnn_16 1 2 338 338_splitncnn_0 338_splitncnn_1
Convolution Conv_164 1 1 338_splitncnn_1 339 0=128 1=3 4=1 5=1 6=147456
BinaryOp Mul_165 2 1 339 block1.convblock.3.beta 340 0=2
BinaryOp Add_166 2 1 340 338_splitncnn_0 341
ReLU LeakyRelu_167 1 1 341 342 0=2.000000e-01
Split splitncnn_17 1 2 342 342_splitncnn_0 342_splitncnn_1
Convolution Conv_168 1 1 342_splitncnn_1 343 0=128 1=3 4=1 5=1 6=147456
BinaryOp Mul_169 2 1 343 block1.convblock.4.beta 344 0=2
BinaryOp Add_170 2 1 344 342_splitncnn_0 345
ReLU LeakyRelu_171 1 1 345 346 0=2.000000e-01
Split splitncnn_18 1 2 346 346_splitncnn_0 346_splitncnn_1
Convolution Conv_172 1 1 346_splitncnn_1 347 0=128 1=3 4=1 5=1 6=147456
BinaryOp Mul_173 2 1 347 block1.convblock.5.beta 348 0=2
BinaryOp Add_174 2 1 348 346_splitncnn_0 349
ReLU LeakyRelu_175 1 1 349 350 0=2.000000e-01
Split splitncnn_19 1 2 350 350_splitncnn_0 350_splitncnn_1
Convolution Conv_176 1 1 350_splitncnn_1 351 0=128 1=3 4=1 5=1 6=147456
BinaryOp Mul_177 2 1 351 block1.convblock.6.beta 352 0=2
BinaryOp Add_178 2 1 352 350_splitncnn_0 353
ReLU LeakyRelu_179 1 1 353 354 0=2.000000e-01
Split splitncnn_20 1 2 354 354_splitncnn_0 354_splitncnn_1
Convolution Conv_180 1 1 354_splitncnn_1 355 0=128 1=3 4=1 5=1 6=147456
BinaryOp Mul_181 2 1 355 block1.convblock.7.beta 356 0=2
BinaryOp Add_182 2 1 356 354_splitncnn_0 357
ReLU LeakyRelu_183 1 1 357 358 0=2.000000e-01
Deconvolution ConvTranspose_184 1 1 358 359 0=52 1=4 3=2 4=1 5=1 6=106496
PixelShuffle DepthToSpace_185 1 1 359 360 0=2
Interp Resize_187 1 1 360 365 0=2 1=1.600000e+01 2=1.600000e+01
Split splitncnn_21 1 3 365 365_splitncnn_0 365_splitncnn_1 365_splitncnn_2
Crop Slice_192 1 1 365_splitncnn_2 370 -23309=1,0 -23310=1,4 -23311=1,0
Crop Slice_199 1 1 365_splitncnn_1 377 -23309=1,4 -23310=1,5 -23311=1,0
Crop Slice_204 1 1 365_splitncnn_0 382 -23309=1,5 -23310=1,2147483647 -23311=1,0
Eltwise Add_205 2 1 261_splitncnn_0 370 383 0=1 -23301=2,1.000000e+00,1.600000e+01
Split splitncnn_22 1 6 383 383_splitncnn_0 383_splitncnn_1 383_splitncnn_2 383_splitncnn_3 383_splitncnn_4 383_splitncnn_5
Crop Slice_210 1 1 383_splitncnn_5 388 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_211 2 1 in0_splitncnn_3 388 389 0=6
Crop Slice_216 1 1 383_splitncnn_4 394 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_217 2 1 in1_splitncnn_3 394 395 0=6
Crop Slice_222 1 1 383_splitncnn_3 400 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_223 2 1 183_splitncnn_2 400 401 0=6
Crop Slice_228 1 1 383_splitncnn_2 406 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_229 2 1 195_splitncnn_2 406 407 0=6
Crop Slice_234 1 1 389 412 -23309=1,0 -23310=1,3 -23311=1,0
Crop Slice_239 1 1 395 417 -23309=1,0 -23310=1,3 -23311=1,0
Concat Concat_240 7 1 412 417 401 407 170_splitncnn_2 377 382 418
Interp Resize_242 1 1 418 423 0=2 1=1.250000e-01 2=1.250000e-01
Interp Resize_244 1 1 383_splitncnn_1 428 0=2 1=1.250000e-01 2=1.250000e-01
BinaryOp Div_247 1 1 428 433 0=3 1=1 2=8.000000e+00
Concat Concat_248 2 1 423 433 434
Convolution Conv_249 1 1 434 436 0=48 1=3 3=2 4=1 5=1 6=12096 9=2 -23310=1,2.000000e-01
Convolution Conv_251 1 1 436 438 0=96 1=3 3=2 4=1 5=1 6=41472 9=2 -23310=1,2.000000e-01
Split splitncnn_23 1 2 438 438_splitncnn_0 438_splitncnn_1
Convolution Conv_253 1 1 438_splitncnn_1 439 0=96 1=3 4=1 5=1 6=82944
BinaryOp Mul_254 2 1 439 block2.convblock.0.beta 440 0=2
BinaryOp Add_255 2 1 440 438_splitncnn_0 441
ReLU LeakyRelu_256 1 1 441 442 0=2.000000e-01
Split splitncnn_24 1 2 442 442_splitncnn_0 442_splitncnn_1
Convolution Conv_257 1 1 442_splitncnn_1 443 0=96 1=3 4=1 5=1 6=82944
BinaryOp Mul_258 2 1 443 block2.convblock.1.beta 444 0=2
BinaryOp Add_259 2 1 444 442_splitncnn_0 445
ReLU LeakyRelu_260 1 1 445 446 0=2.000000e-01
Split splitncnn_25 1 2 446 446_splitncnn_0 446_splitncnn_1
Convolution Conv_261 1 1 446_splitncnn_1 447 0=96 1=3 4=1 5=1 6=82944
BinaryOp Mul_262 2 1 447 block2.convblock.2.beta 448 0=2
BinaryOp Add_263 2 1 448 446_splitncnn_0 449
ReLU LeakyRelu_264 1 1 449 450 0=2.000000e-01
Split splitncnn_26 1 2 450 450_splitncnn_0 450_splitncnn_1
Convolution Conv_265 1 1 450_splitncnn_1 451 0=96 1=3 4=1 5=1 6=82944
BinaryOp Mul_266 2 1 451 block2.convblock.3.beta 452 0=2
BinaryOp Add_267 2 1 452 450_splitncnn_0 453
ReLU LeakyRelu_268 1 1 453 454 0=2.000000e-01
Split splitncnn_27 1 2 454 454_splitncnn_0 454_splitncnn_1
Convolution Conv_269 1 1 454_splitncnn_1 455 0=96 1=3 4=1 5=1 6=82944
BinaryOp Mul_270 2 1 455 block2.convblock.4.beta 456 0=2
BinaryOp Add_271 2 1 456 454_splitncnn_0 457
ReLU LeakyRelu_272 1 1 457 458 0=2.000000e-01
Split splitncnn_28 1 2 458 458_splitncnn_0 458_splitncnn_1
Convolution Conv_273 1 1 458_splitncnn_1 459 0=96 1=3 4=1 5=1 6=82944
BinaryOp Mul_274 2 1 459 block2.convblock.5.beta 460 0=2
BinaryOp Add_275 2 1 460 458_splitncnn_0 461
ReLU LeakyRelu_276 1 1 461 462 0=2.000000e-01
Split splitncnn_29 1 2 462 462_splitncnn_0 462_splitncnn_1
Convolution Conv_277 1 1 462_splitncnn_1 463 0=96 1=3 4=1 5=1 6=82944
BinaryOp Mul_278 2 1 463 block2.convblock.6.beta 464 0=2
BinaryOp Add_279 2 1 464 462_splitncnn_0 465
ReLU LeakyRelu_280 1 1 465 466 0=2.000000e-01
Split splitncnn_30 1 2 466 466_splitncnn_0 466_splitncnn_1
Convolution Conv_281 1 1 466_splitncnn_1 467 0=96 1=3 4=1 5=1 6=82944
BinaryOp Mul_282 2 1 467 block2.convblock.7.beta 468 0=2
BinaryOp Add_283 2 1 468 466_splitncnn_0 469
ReLU LeakyRelu_284 1 1 469 470 0=2.000000e-01
Deconvolution ConvTranspose_285 1 1 470 471 0=52 1=4 3=2 4=1 5=1 6=79872
PixelShuffle DepthToSpace_286 1 1 471 472 0=2
Interp Resize_288 1 1 472 477 0=2 1=8.000000e+00 2=8.000000e+00
Split splitncnn_31 1 3 477 477_splitncnn_0 477_splitncnn_1 477_splitncnn_2
Crop Slice_293 1 1 477_splitncnn_2 482 -23309=1,0 -23310=1,4 -23311=1,0
Crop Slice_300 1 1 477_splitncnn_1 489 -23309=1,4 -23310=1,5 -23311=1,0
Crop Slice_305 1 1 477_splitncnn_0 494 -23309=1,5 -23310=1,2147483647 -23311=1,0
Eltwise Add_306 2 1 383_splitncnn_0 482 495 0=1 -23301=2,1.000000e+00,8.000000e+00
Split splitncnn_32 1 6 495 495_splitncnn_0 495_splitncnn_1 495_splitncnn_2 495_splitncnn_3 495_splitncnn_4 495_splitncnn_5
Crop Slice_311 1 1 495_splitncnn_5 500 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_312 2 1 in0_splitncnn_2 500 501 0=6
Crop Slice_317 1 1 495_splitncnn_4 506 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_318 2 1 in1_splitncnn_2 506 507 0=6
Crop Slice_323 1 1 495_splitncnn_3 512 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_324 2 1 183_splitncnn_1 512 513 0=6
Crop Slice_329 1 1 495_splitncnn_2 518 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_330 2 1 195_splitncnn_1 518 519 0=6
Crop Slice_335 1 1 501 524 -23309=1,0 -23310=1,3 -23311=1,0
Crop Slice_340 1 1 507 529 -23309=1,0 -23310=1,3 -23311=1,0
Concat Concat_341 7 1 524 529 513 519 170_splitncnn_1 489 494 530
Interp Resize_343 1 1 530 535 0=2 1=2.500000e-01 2=2.500000e-01
Interp Resize_345 1 1 495_splitncnn_1 540 0=2 1=2.500000e-01 2=2.500000e-01
BinaryOp Div_348 1 1 540 545 0=3 1=1 2=4.000000e+00
Concat Concat_349 2 1 535 545 546
Convolution Conv_350 1 1 546 548 0=32 1=3 3=2 4=1 5=1 6=8064 9=2 -23310=1,2.000000e-01
Convolution Conv_352 1 1 548 550 0=64 1=3 3=2 4=1 5=1 6=18432 9=2 -23310=1,2.000000e-01
Split splitncnn_33 1 2 550 550_splitncnn_0 550_splitncnn_1
Convolution Conv_354 1 1 550_splitncnn_1 551 0=64 1=3 4=1 5=1 6=36864
BinaryOp Mul_355 2 1 551 block3.convblock.0.beta 552 0=2
BinaryOp Add_356 2 1 552 550_splitncnn_0 553
ReLU LeakyRelu_357 1 1 553 554 0=2.000000e-01
Split splitncnn_34 1 2 554 554_splitncnn_0 554_splitncnn_1
Convolution Conv_358 1 1 554_splitncnn_1 555 0=64 1=3 4=1 5=1 6=36864
BinaryOp Mul_359 2 1 555 block3.convblock.1.beta 556 0=2
BinaryOp Add_360 2 1 556 554_splitncnn_0 557
ReLU LeakyRelu_361 1 1 557 558 0=2.000000e-01
Split splitncnn_35 1 2 558 558_splitncnn_0 558_splitncnn_1
Convolution Conv_362 1 1 558_splitncnn_1 559 0=64 1=3 4=1 5=1 6=36864
BinaryOp Mul_363 2 1 559 block3.convblock.2.beta 560 0=2
BinaryOp Add_364 2 1 560 558_splitncnn_0 561
ReLU LeakyRelu_365 1 1 561 562 0=2.000000e-01
Split splitncnn_36 1 2 562 562_splitncnn_0 562_splitncnn_1
Convolution Conv_366 1 1 562_splitncnn_1 563 0=64 1=3 4=1 5=1 6=36864
BinaryOp Mul_367 2 1 563 block3.convblock.3.beta 564 0=2
BinaryOp Add_368 2 1 564 562_splitncnn_0 565
ReLU LeakyRelu_369 1 1 565 566 0=2.000000e-01
Split splitncnn_37 1 2 566 566_splitncnn_0 566_splitncnn_1
Convolution Conv_370 1 1 566_splitncnn_1 567 0=64 1=3 4=1 5=1 6=36864
BinaryOp Mul_371 2 1 567 block3.convblock.4.beta 568 0=2
BinaryOp Add_372 2 1 568 566_splitncnn_0 569
ReLU LeakyRelu_373 1 1 569 570 0=2.000000e-01
Split splitncnn_38 1 2 570 570_splitncnn_0 570_splitncnn_1
Convolution Conv_374 1 1 570_splitncnn_1 571 0=64 1=3 4=1 5=1 6=36864
BinaryOp Mul_375 2 1 571 block3.convblock.5.beta 572 0=2
BinaryOp Add_376 2 1 572 570_splitncnn_0 573
ReLU LeakyRelu_377 1 1 573 574 0=2.000000e-01
Split splitncnn_39 1 2 574 574_splitncnn_0 574_splitncnn_1
Convolution Conv_378 1 1 574_splitncnn_1 575 0=64 1=3 4=1 5=1 6=36864
BinaryOp Mul_379 2 1 575 block3.convblock.6.beta 576 0=2
BinaryOp Add_380 2 1 576 574_splitncnn_0 577
ReLU LeakyRelu_381 1 1 577 578 0=2.000000e-01
Split splitncnn_40 1 2 578 578_splitncnn_0 578_splitncnn_1
Convolution Conv_382 1 1 578_splitncnn_1 579 0=64 1=3 4=1 5=1 6=36864
BinaryOp Mul_383 2 1 579 block3.convblock.7.beta 580 0=2
BinaryOp Add_384 2 1 580 578_splitncnn_0 581
ReLU LeakyRelu_385 1 1 581 582 0=2.000000e-01
Deconvolution ConvTranspose_386 1 1 582 583 0=52 1=4 3=2 4=1 5=1 6=53248
PixelShuffle DepthToSpace_387 1 1 583 584 0=2
Interp Resize_389 1 1 584 589 0=2 1=4.000000e+00 2=4.000000e+00
Split splitncnn_41 1 3 589 589_splitncnn_0 589_splitncnn_1 589_splitncnn_2
Crop Slice_394 1 1 589_splitncnn_2 594 -23309=1,0 -23310=1,4 -23311=1,0
Crop Slice_401 1 1 589_splitncnn_1 601 -23309=1,4 -23310=1,5 -23311=1,0
Crop Slice_406 1 1 589_splitncnn_0 606 -23309=1,5 -23310=1,2147483647 -23311=1,0
Eltwise Add_407 2 1 495_splitncnn_0 594 607 0=1 -23301=2,1.000000e+00,4.000000e+00
Split splitncnn_42 1 6 607 607_splitncnn_0 607_splitncnn_1 607_splitncnn_2 607_splitncnn_3 607_splitncnn_4 607_splitncnn_5
Crop Slice_412 1 1 607_splitncnn_5 612 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_413 2 1 in0_splitncnn_1 612 613 0=6
Crop Slice_418 1 1 607_splitncnn_4 618 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_419 2 1 in1_splitncnn_1 618 619 0=6
Crop Slice_424 1 1 607_splitncnn_3 624 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_425 2 1 183_splitncnn_0 624 625 0=6
Crop Slice_430 1 1 607_splitncnn_2 630 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_431 2 1 195_splitncnn_0 630 631 0=6
Crop Slice_436 1 1 613 636 -23309=1,0 -23310=1,3 -23311=1,0
Crop Slice_441 1 1 619 641 -23309=1,0 -23310=1,3 -23311=1,0
Concat Concat_442 7 1 636 641 625 631 170_splitncnn_0 601 606 642
Interp Resize_444 1 1 642 647 0=2
Interp Resize_446 1 1 607_splitncnn_1 652 0=2
Concat Concat_450 2 1 647 652 658
Convolution Conv_451 1 1 658 660 0=12 1=3 3=2 4=1 5=1 6=3024 9=2 -23310=1,2.000000e-01
Convolution Conv_453 1 1 660 662 0=24 1=3 3=2 4=1 5=1 6=2592 9=2 -23310=1,2.000000e-01
Split splitncnn_43 1 2 662 662_splitncnn_0 662_splitncnn_1
Convolution Conv_455 1 1 662_splitncnn_1 663 0=24 1=3 4=1 5=1 6=5184
BinaryOp Mul_456 2 1 663 block4.convblock.0.beta 664 0=2
BinaryOp Add_457 2 1 664 662_splitncnn_0 665
ReLU LeakyRelu_458 1 1 665 666 0=2.000000e-01
Split splitncnn_44 1 2 666 666_splitncnn_0 666_splitncnn_1
Convolution Conv_459 1 1 666_splitncnn_1 667 0=24 1=3 4=1 5=1 6=5184
BinaryOp Mul_460 2 1 667 block4.convblock.1.beta 668 0=2
BinaryOp Add_461 2 1 668 666_splitncnn_0 669
ReLU LeakyRelu_462 1 1 669 670 0=2.000000e-01
Split splitncnn_45 1 2 670 670_splitncnn_0 670_splitncnn_1
Convolution Conv_463 1 1 670_splitncnn_1 671 0=24 1=3 4=1 5=1 6=5184
BinaryOp Mul_464 2 1 671 block4.convblock.2.beta 672 0=2
BinaryOp Add_465 2 1 672 670_splitncnn_0 673
ReLU LeakyRelu_466 1 1 673 674 0=2.000000e-01
Split splitncnn_46 1 2 674 674_splitncnn_0 674_splitncnn_1
Convolution Conv_467 1 1 674_splitncnn_1 675 0=24 1=3 4=1 5=1 6=5184
BinaryOp Mul_468 2 1 675 block4.convblock.3.beta 676 0=2
BinaryOp Add_469 2 1 676 674_splitncnn_0 677
ReLU LeakyRelu_470 1 1 677 678 0=2.000000e-01
Split splitncnn_47 1 2 678 678_splitncnn_0 678_splitncnn_1
Convolution Conv_471 1 1 678_splitncnn_1 679 0=24 1=3 4=1 5=1 6=5184
BinaryOp Mul_472 2 1 679 block4.convblock.4.beta 680 0=2
BinaryOp Add_473 2 1 680 678_splitncnn_0 681
ReLU LeakyRelu_474 1 1 681 682 0=2.000000e-01
Split splitncnn_48 1 2 682 682_splitncnn_0 682_splitncnn_1
Convolution Conv_475 1 1 682_splitncnn_1 683 0=24 1=3 4=1 5=1 6=5184
BinaryOp Mul_476 2 1 683 block4.convblock.5.beta 684 0=2
BinaryOp Add_477 2 1 684 682_splitncnn_0 685
ReLU LeakyRelu_478 1 1 685 686 0=2.000000e-01
Split splitncnn_49 1 2 686 686_splitncnn_0 686_splitncnn_1
Convolution Conv_479 1 1 686_splitncnn_1 687 0=24 1=3 4=1 5=1 6=5184
BinaryOp Mul_480 2 1 687 block4.convblock.6.beta 688 0=2
BinaryOp Add_481 2 1 688 686_splitncnn_0 689
ReLU LeakyRelu_482 1 1 689 690 0=2.000000e-01
Split splitncnn_50 1 2 690 690_splitncnn_0 690_splitncnn_1
Convolution Conv_483 1 1 690_splitncnn_1 691 0=24 1=3 4=1 5=1 6=5184
BinaryOp Mul_484 2 1 691 block4.convblock.7.beta 692 0=2
BinaryOp Add_485 2 1 692 690_splitncnn_0 693
ReLU LeakyRelu_486 1 1 693 694 0=2.000000e-01
Deconvolution ConvTranspose_487 1 1 694 695 0=52 1=4 3=2 4=1 5=1 6=19968
PixelShuffle DepthToSpace_488 1 1 695 696 0=2
Interp Resize_490 1 1 696 701 0=2
Split splitncnn_51 1 2 701 701_splitncnn_0 701_splitncnn_1
Crop Slice_495 1 1 701_splitncnn_1 706 -23309=1,0 -23310=1,4 -23311=1,0
Crop Slice_502 1 1 701_splitncnn_0 713 -23309=1,4 -23310=1,5 -23311=1,0
BinaryOp Add_503 2 1 607_splitncnn_0 706 714
Split splitncnn_52 1 2 714 714_splitncnn_0 714_splitncnn_1
Crop Slice_508 1 1 714_splitncnn_1 719 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp warp_509 2 1 in0_splitncnn_0 719 720 0=6
Crop Slice_514 1 1 714_splitncnn_0 725 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp warp_515 2 1 in1_splitncnn_0 725 726 0=6
Sigmoid Sigmoid_516 1 1 713 727
Split splitncnn_53 1 2 727 727_splitncnn_0 727_splitncnn_1
BinaryOp Mul_517 2 1 720 727_splitncnn_1 728 0=2
BinaryOp Sub_519 1 1 727_splitncnn_0 730 0=7 1=1 2=1.000000e+00
BinaryOp Mul_520 2 1 726 730 731 0=2
BinaryOp Add_521 2 1 728 731 out0

BIN
models/rife/rife-v4.25/flownet.bin vendored Normal file

Binary file not shown.

380
models/rife/rife-v4.25/flownet.param vendored Normal file
View File

@@ -0,0 +1,380 @@
7767517
378 475
Input in0 0 1 in0
Split splitncnn_0 1 7 in0 1 2 3 4 5 6 7
Input in1 0 1 in1
Split splitncnn_1 1 7 in1 9 10 11 12 13 14 15
Input in2 0 1 in2
Concat cat_0 2 1 1 9 17 0=0
Crop slice_136 1 1 17 18 -23310=1,1 -23311=1,0 -23309=1,0
BinaryOp mul_0 1 1 18 19 0=2 1=1 2=0.000000e+00
BinaryOp add_1 1 1 19 20 0=0 1=1 2=1.000000e+00
BinaryOp mul_2 2 1 20 in2 21 0=2
Split splitncnn_2 1 5 21 22 23 24 25 26
Crop slice_137 1 1 7 27 -23310=1,3 -23311=1,0 -23309=1,0
Split splitncnn_3 1 2 27 28 29
Crop slice_138 1 1 15 30 -23310=1,3 -23311=1,0 -23309=1,0
Split splitncnn_4 1 2 30 31 32
Convolution convrelu_2 1 1 32 33 0=16 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 9=2
Convolution convrelu_3 1 1 33 34 0=16 1=3 -23310=1,2.000000e-01 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=2304 9=2
Convolution convrelu_4 1 1 34 35 0=16 1=3 -23310=1,2.000000e-01 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=2304 9=2
Deconvolution deconv_69 1 1 35 36 0=4 1=4 11=4 12=1 13=2 14=1 18=0 19=0 2=1 3=2 4=1 5=1 6=1024
Split splitncnn_5 1 5 36 37 38 39 40 41
Convolution convrelu_0 1 1 29 42 0=16 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 9=2
Convolution convrelu_1 1 1 42 43 0=16 1=3 -23310=1,2.000000e-01 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=2304 9=2
Convolution convrelu_5 1 1 43 44 0=16 1=3 -23310=1,2.000000e-01 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=2304 9=2
Deconvolution deconv_68 1 1 44 45 0=4 1=4 11=4 12=1 13=2 14=1 18=0 19=0 2=1 3=2 4=1 5=1 6=1024
Split splitncnn_6 1 5 45 46 47 48 49 50
Concat cat_1 5 1 28 31 46 37 22 51 0=0
Interp upsample_1 1 1 51 52 0=2 1=6.250000e-02 2=6.250000e-02 6=0
MemoryData block0.convblock.0 0 1 53 0=1 1=1 2=192
Convolution convrelu_6 1 1 52 54 0=96 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=12960 9=2
Convolution convrelu_7 1 1 54 55 0=192 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=165888 9=2
Split splitncnn_7 1 2 55 56 57
Convolution conv_20 1 1 57 58 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=331776
BinaryOp mul_3 2 1 58 53 59 0=2
BinaryOp add_4 2 1 59 56 60 0=0
MemoryData block0.convblock.1 0 1 61 0=1 1=1 2=192
ReLU leakyrelu_83 1 1 60 62 0=2.000000e-01
Split splitncnn_8 1 2 62 63 64
Convolution conv_21 1 1 64 65 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=331776
BinaryOp mul_5 2 1 65 61 66 0=2
BinaryOp add_6 2 1 66 63 67 0=0
MemoryData block0.convblock.2 0 1 68 0=1 1=1 2=192
ReLU leakyrelu_84 1 1 67 69 0=2.000000e-01
Split splitncnn_9 1 2 69 70 71
Convolution conv_22 1 1 71 72 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=331776
BinaryOp mul_7 2 1 72 68 73 0=2
BinaryOp add_8 2 1 73 70 74 0=0
MemoryData block0.convblock.3 0 1 75 0=1 1=1 2=192
ReLU leakyrelu_85 1 1 74 76 0=2.000000e-01
Split splitncnn_10 1 2 76 77 78
Convolution conv_23 1 1 78 79 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=331776
BinaryOp mul_9 2 1 79 75 80 0=2
BinaryOp add_10 2 1 80 77 81 0=0
MemoryData block0.convblock.4 0 1 82 0=1 1=1 2=192
ReLU leakyrelu_86 1 1 81 83 0=2.000000e-01
Split splitncnn_11 1 2 83 84 85
Convolution conv_24 1 1 85 86 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=331776
BinaryOp mul_11 2 1 86 82 87 0=2
BinaryOp add_12 2 1 87 84 88 0=0
MemoryData block0.convblock.5 0 1 89 0=1 1=1 2=192
ReLU leakyrelu_87 1 1 88 90 0=2.000000e-01
Split splitncnn_12 1 2 90 91 92
Convolution conv_25 1 1 92 93 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=331776
BinaryOp mul_13 2 1 93 89 94 0=2
BinaryOp add_14 2 1 94 91 95 0=0
MemoryData block0.convblock.6 0 1 96 0=1 1=1 2=192
ReLU leakyrelu_88 1 1 95 97 0=2.000000e-01
Split splitncnn_13 1 2 97 98 99
Convolution conv_26 1 1 99 100 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=331776
BinaryOp mul_15 2 1 100 96 101 0=2
BinaryOp add_16 2 1 101 98 102 0=0
MemoryData block0.convblock.7 0 1 103 0=1 1=1 2=192
ReLU leakyrelu_89 1 1 102 104 0=2.000000e-01
Split splitncnn_14 1 2 104 105 106
Convolution conv_27 1 1 106 107 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=331776
BinaryOp mul_17 2 1 107 103 108 0=2
BinaryOp add_18 2 1 108 105 109 0=0
ReLU leakyrelu_90 1 1 109 110 0=2.000000e-01
Deconvolution deconv_70 1 1 110 111 0=52 1=4 11=4 12=1 13=2 14=1 18=0 19=0 2=1 3=2 4=1 5=1 6=159744
PixelShuffle pixelshuffle_131 1 1 111 112 0=2 1=0
Interp upsample_2 1 1 112 113 0=2 1=1.600000e+01 2=1.600000e+01 6=0
Slice tensor_split_0 1 3 113 114 115 116 -23300=3,4,1,-233 1=0
BinaryOp mul_19 1 1 114 117 0=2 1=1 2=1.600000e+01
Split splitncnn_15 1 6 117 118 119 120 121 122 123
Crop slice_139 1 1 123 124 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_20 2 1 2 124 125 0=6
Crop slice_140 1 1 122 126 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_21 2 1 10 126 127 0=6
Crop slice_141 1 1 121 128 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_22 2 1 47 128 129 0=6
Crop slice_142 1 1 120 130 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_23 2 1 38 130 131 0=6
Interp upsample_3 1 1 119 132 0=2 1=1.250000e-01 2=1.250000e-01 6=0
BinaryOp div_24 1 1 132 133 0=3 1=1 2=8.000000e+00
Crop slice_144 1 1 127 134 -23310=1,3 -23311=1,0 -23309=1,0
Crop slice_143 1 1 125 135 -23310=1,3 -23311=1,0 -23309=1,0
Concat cat_2 7 1 135 134 129 131 23 115 116 136 0=0
Interp upsample_4 1 1 136 137 0=2 1=1.250000e-01 2=1.250000e-01 6=0
Concat cat_3 2 1 137 133 138 0=0
MemoryData block1.convblock.0 0 1 139 0=1 1=1 2=128
Convolution convrelu_8 1 1 138 140 0=64 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=16128 9=2
Convolution convrelu_9 1 1 140 141 0=128 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=73728 9=2
Split splitncnn_16 1 2 141 142 143
Convolution conv_30 1 1 143 144 0=128 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=147456
BinaryOp mul_25 2 1 144 139 145 0=2
BinaryOp add_26 2 1 145 142 146 0=0
MemoryData block1.convblock.1 0 1 147 0=1 1=1 2=128
ReLU leakyrelu_93 1 1 146 148 0=2.000000e-01
Split splitncnn_17 1 2 148 149 150
Convolution conv_31 1 1 150 151 0=128 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=147456
BinaryOp mul_27 2 1 151 147 152 0=2
BinaryOp add_28 2 1 152 149 153 0=0
MemoryData block1.convblock.2 0 1 154 0=1 1=1 2=128
ReLU leakyrelu_94 1 1 153 155 0=2.000000e-01
Split splitncnn_18 1 2 155 156 157
Convolution conv_32 1 1 157 158 0=128 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=147456
BinaryOp mul_29 2 1 158 154 159 0=2
BinaryOp add_30 2 1 159 156 160 0=0
MemoryData block1.convblock.3 0 1 161 0=1 1=1 2=128
ReLU leakyrelu_95 1 1 160 162 0=2.000000e-01
Split splitncnn_19 1 2 162 163 164
Convolution conv_33 1 1 164 165 0=128 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=147456
BinaryOp mul_31 2 1 165 161 166 0=2
BinaryOp add_32 2 1 166 163 167 0=0
MemoryData block1.convblock.4 0 1 168 0=1 1=1 2=128
ReLU leakyrelu_96 1 1 167 169 0=2.000000e-01
Split splitncnn_20 1 2 169 170 171
Convolution conv_34 1 1 171 172 0=128 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=147456
BinaryOp mul_33 2 1 172 168 173 0=2
BinaryOp add_34 2 1 173 170 174 0=0
MemoryData block1.convblock.5 0 1 175 0=1 1=1 2=128
ReLU leakyrelu_97 1 1 174 176 0=2.000000e-01
Split splitncnn_21 1 2 176 177 178
Convolution conv_35 1 1 178 179 0=128 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=147456
BinaryOp mul_35 2 1 179 175 180 0=2
BinaryOp add_36 2 1 180 177 181 0=0
MemoryData block1.convblock.6 0 1 182 0=1 1=1 2=128
ReLU leakyrelu_98 1 1 181 183 0=2.000000e-01
Split splitncnn_22 1 2 183 184 185
Convolution conv_36 1 1 185 186 0=128 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=147456
BinaryOp mul_37 2 1 186 182 187 0=2
BinaryOp add_38 2 1 187 184 188 0=0
MemoryData block1.convblock.7 0 1 189 0=1 1=1 2=128
ReLU leakyrelu_99 1 1 188 190 0=2.000000e-01
Split splitncnn_23 1 2 190 191 192
Convolution conv_37 1 1 192 193 0=128 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=147456
BinaryOp mul_39 2 1 193 189 194 0=2
BinaryOp add_40 2 1 194 191 195 0=0
ReLU leakyrelu_100 1 1 195 196 0=2.000000e-01
Deconvolution deconv_71 1 1 196 197 0=52 1=4 11=4 12=1 13=2 14=1 18=0 19=0 2=1 3=2 4=1 5=1 6=106496
PixelShuffle pixelshuffle_132 1 1 197 198 0=2 1=0
Interp upsample_5 1 1 198 199 0=2 1=8.000000e+00 2=8.000000e+00 6=0
Slice tensor_split_1 1 3 199 200 201 202 -23300=3,4,1,-233 1=0
BinaryOp mul_41 1 1 200 203 0=2 1=1 2=8.000000e+00
BinaryOp add_42 2 1 118 203 204 0=0
Split splitncnn_24 1 6 204 205 206 207 208 209 210
Crop slice_145 1 1 210 211 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_43 2 1 3 211 212 0=6
Crop slice_146 1 1 209 213 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_44 2 1 11 213 214 0=6
Crop slice_147 1 1 208 215 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_45 2 1 48 215 216 0=6
Crop slice_148 1 1 207 217 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_46 2 1 39 217 218 0=6
Interp upsample_6 1 1 206 219 0=2 1=2.500000e-01 2=2.500000e-01 6=0
BinaryOp div_47 1 1 219 220 0=3 1=1 2=4.000000e+00
Crop slice_150 1 1 214 221 -23310=1,3 -23311=1,0 -23309=1,0
Crop slice_149 1 1 212 222 -23310=1,3 -23311=1,0 -23309=1,0
Concat cat_4 7 1 222 221 216 218 24 201 202 223 0=0
Interp upsample_7 1 1 223 224 0=2 1=2.500000e-01 2=2.500000e-01 6=0
Concat cat_5 2 1 224 220 225 0=0
MemoryData block2.convblock.0 0 1 226 0=1 1=1 2=96
Convolution convrelu_10 1 1 225 227 0=48 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=12096 9=2
Convolution convrelu_11 1 1 227 228 0=96 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=41472 9=2
Split splitncnn_25 1 2 228 229 230
Convolution conv_40 1 1 230 231 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=82944
BinaryOp mul_48 2 1 231 226 232 0=2
BinaryOp add_49 2 1 232 229 233 0=0
MemoryData block2.convblock.1 0 1 234 0=1 1=1 2=96
ReLU leakyrelu_103 1 1 233 235 0=2.000000e-01
Split splitncnn_26 1 2 235 236 237
Convolution conv_41 1 1 237 238 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=82944
BinaryOp mul_50 2 1 238 234 239 0=2
BinaryOp add_51 2 1 239 236 240 0=0
MemoryData block2.convblock.2 0 1 241 0=1 1=1 2=96
ReLU leakyrelu_104 1 1 240 242 0=2.000000e-01
Split splitncnn_27 1 2 242 243 244
Convolution conv_42 1 1 244 245 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=82944
BinaryOp mul_52 2 1 245 241 246 0=2
BinaryOp add_53 2 1 246 243 247 0=0
MemoryData block2.convblock.3 0 1 248 0=1 1=1 2=96
ReLU leakyrelu_105 1 1 247 249 0=2.000000e-01
Split splitncnn_28 1 2 249 250 251
Convolution conv_43 1 1 251 252 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=82944
BinaryOp mul_54 2 1 252 248 253 0=2
BinaryOp add_55 2 1 253 250 254 0=0
MemoryData block2.convblock.4 0 1 255 0=1 1=1 2=96
ReLU leakyrelu_106 1 1 254 256 0=2.000000e-01
Split splitncnn_29 1 2 256 257 258
Convolution conv_44 1 1 258 259 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=82944
BinaryOp mul_56 2 1 259 255 260 0=2
BinaryOp add_57 2 1 260 257 261 0=0
MemoryData block2.convblock.5 0 1 262 0=1 1=1 2=96
ReLU leakyrelu_107 1 1 261 263 0=2.000000e-01
Split splitncnn_30 1 2 263 264 265
Convolution conv_45 1 1 265 266 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=82944
BinaryOp mul_58 2 1 266 262 267 0=2
BinaryOp add_59 2 1 267 264 268 0=0
MemoryData block2.convblock.6 0 1 269 0=1 1=1 2=96
ReLU leakyrelu_108 1 1 268 270 0=2.000000e-01
Split splitncnn_31 1 2 270 271 272
Convolution conv_46 1 1 272 273 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=82944
BinaryOp mul_60 2 1 273 269 274 0=2
BinaryOp add_61 2 1 274 271 275 0=0
MemoryData block2.convblock.7 0 1 276 0=1 1=1 2=96
ReLU leakyrelu_109 1 1 275 277 0=2.000000e-01
Split splitncnn_32 1 2 277 278 279
Convolution conv_47 1 1 279 280 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=82944
BinaryOp mul_62 2 1 280 276 281 0=2
BinaryOp add_63 2 1 281 278 282 0=0
ReLU leakyrelu_110 1 1 282 283 0=2.000000e-01
Deconvolution deconv_72 1 1 283 284 0=52 1=4 11=4 12=1 13=2 14=1 18=0 19=0 2=1 3=2 4=1 5=1 6=79872
PixelShuffle pixelshuffle_133 1 1 284 285 0=2 1=0
Interp upsample_8 1 1 285 286 0=2 1=4.000000e+00 2=4.000000e+00 6=0
Slice tensor_split_2 1 3 286 287 288 289 -23300=3,4,1,-233 1=0
BinaryOp mul_64 1 1 287 290 0=2 1=1 2=4.000000e+00
BinaryOp add_65 2 1 205 290 291 0=0
Split splitncnn_33 1 6 291 292 293 294 295 296 297
Crop slice_151 1 1 297 298 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_66 2 1 4 298 299 0=6
Crop slice_152 1 1 296 300 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_67 2 1 12 300 301 0=6
Crop slice_153 1 1 295 302 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_68 2 1 49 302 303 0=6
Crop slice_154 1 1 294 304 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_69 2 1 40 304 305 0=6
Interp upsample_9 1 1 293 306 0=2 1=5.000000e-01 2=5.000000e-01 6=0
BinaryOp div_70 1 1 306 307 0=3 1=1 2=2.000000e+00
Crop slice_156 1 1 301 308 -23310=1,3 -23311=1,0 -23309=1,0
Crop slice_155 1 1 299 309 -23310=1,3 -23311=1,0 -23309=1,0
Concat cat_6 7 1 309 308 303 305 25 288 289 310 0=0
Interp upsample_10 1 1 310 311 0=2 1=5.000000e-01 2=5.000000e-01 6=0
Concat cat_7 2 1 311 307 312 0=0
MemoryData block3.convblock.0 0 1 313 0=1 1=1 2=64
Convolution convrelu_12 1 1 312 314 0=32 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=8064 9=2
Convolution convrelu_13 1 1 314 315 0=64 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=18432 9=2
Split splitncnn_34 1 2 315 316 317
Convolution conv_50 1 1 317 318 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=36864
BinaryOp mul_71 2 1 318 313 319 0=2
BinaryOp add_72 2 1 319 316 320 0=0
MemoryData block3.convblock.1 0 1 321 0=1 1=1 2=64
ReLU leakyrelu_113 1 1 320 322 0=2.000000e-01
Split splitncnn_35 1 2 322 323 324
Convolution conv_51 1 1 324 325 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=36864
BinaryOp mul_73 2 1 325 321 326 0=2
BinaryOp add_74 2 1 326 323 327 0=0
MemoryData block3.convblock.2 0 1 328 0=1 1=1 2=64
ReLU leakyrelu_114 1 1 327 329 0=2.000000e-01
Split splitncnn_36 1 2 329 330 331
Convolution conv_52 1 1 331 332 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=36864
BinaryOp mul_75 2 1 332 328 333 0=2
BinaryOp add_76 2 1 333 330 334 0=0
MemoryData block3.convblock.3 0 1 335 0=1 1=1 2=64
ReLU leakyrelu_115 1 1 334 336 0=2.000000e-01
Split splitncnn_37 1 2 336 337 338
Convolution conv_53 1 1 338 339 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=36864
BinaryOp mul_77 2 1 339 335 340 0=2
BinaryOp add_78 2 1 340 337 341 0=0
MemoryData block3.convblock.4 0 1 342 0=1 1=1 2=64
ReLU leakyrelu_116 1 1 341 343 0=2.000000e-01
Split splitncnn_38 1 2 343 344 345
Convolution conv_54 1 1 345 346 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=36864
BinaryOp mul_79 2 1 346 342 347 0=2
BinaryOp add_80 2 1 347 344 348 0=0
MemoryData block3.convblock.5 0 1 349 0=1 1=1 2=64
ReLU leakyrelu_117 1 1 348 350 0=2.000000e-01
Split splitncnn_39 1 2 350 351 352
Convolution conv_55 1 1 352 353 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=36864
BinaryOp mul_81 2 1 353 349 354 0=2
BinaryOp add_82 2 1 354 351 355 0=0
MemoryData block3.convblock.6 0 1 356 0=1 1=1 2=64
ReLU leakyrelu_118 1 1 355 357 0=2.000000e-01
Split splitncnn_40 1 2 357 358 359
Convolution conv_56 1 1 359 360 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=36864
BinaryOp mul_83 2 1 360 356 361 0=2
BinaryOp add_84 2 1 361 358 362 0=0
MemoryData block3.convblock.7 0 1 363 0=1 1=1 2=64
ReLU leakyrelu_119 1 1 362 364 0=2.000000e-01
Split splitncnn_41 1 2 364 365 366
Convolution conv_57 1 1 366 367 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=36864
BinaryOp mul_85 2 1 367 363 368 0=2
BinaryOp add_86 2 1 368 365 369 0=0
ReLU leakyrelu_120 1 1 369 370 0=2.000000e-01
Deconvolution deconv_73 1 1 370 371 0=52 1=4 11=4 12=1 13=2 14=1 18=0 19=0 2=1 3=2 4=1 5=1 6=53248
PixelShuffle pixelshuffle_134 1 1 371 372 0=2 1=0
Interp upsample_11 1 1 372 373 0=2 1=2.000000e+00 2=2.000000e+00 6=0
Slice tensor_split_3 1 3 373 374 375 376 -23300=3,4,1,-233 1=0
BinaryOp mul_87 1 1 374 377 0=2 1=1 2=2.000000e+00
BinaryOp add_88 2 1 292 377 378 0=0
Split splitncnn_42 1 6 378 379 380 381 382 383 384
Crop slice_157 1 1 384 385 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_89 2 1 5 385 386 0=6
Crop slice_158 1 1 383 387 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_90 2 1 13 387 388 0=6
Crop slice_159 1 1 382 389 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_91 2 1 50 389 390 0=6
Crop slice_160 1 1 381 391 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_92 2 1 41 391 392 0=6
Crop slice_162 1 1 388 393 -23310=1,3 -23311=1,0 -23309=1,0
Crop slice_161 1 1 386 394 -23310=1,3 -23311=1,0 -23309=1,0
Concat cat_8 7 1 394 393 390 392 26 375 376 395 0=0
Concat cat_9 2 1 395 379 396 0=0
MemoryData block4.convblock.0 0 1 397 0=1 1=1 2=32
Convolution convrelu_14 1 1 396 398 0=16 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=4032 9=2
Convolution convrelu_15 1 1 398 399 0=32 1=3 -23310=1,2.000000e-01 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=4608 9=2
Split splitncnn_43 1 2 399 400 401
Convolution conv_60 1 1 401 402 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=9216
BinaryOp mul_93 2 1 402 397 403 0=2
BinaryOp add_94 2 1 403 400 404 0=0
MemoryData block4.convblock.1 0 1 405 0=1 1=1 2=32
ReLU leakyrelu_123 1 1 404 406 0=2.000000e-01
Split splitncnn_44 1 2 406 407 408
Convolution conv_61 1 1 408 409 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=9216
BinaryOp mul_95 2 1 409 405 410 0=2
BinaryOp add_96 2 1 410 407 411 0=0
MemoryData block4.convblock.2 0 1 412 0=1 1=1 2=32
ReLU leakyrelu_124 1 1 411 413 0=2.000000e-01
Split splitncnn_45 1 2 413 414 415
Convolution conv_62 1 1 415 416 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=9216
BinaryOp mul_97 2 1 416 412 417 0=2
BinaryOp add_98 2 1 417 414 418 0=0
MemoryData block4.convblock.3 0 1 419 0=1 1=1 2=32
ReLU leakyrelu_125 1 1 418 420 0=2.000000e-01
Split splitncnn_46 1 2 420 421 422
Convolution conv_63 1 1 422 423 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=9216
BinaryOp mul_99 2 1 423 419 424 0=2
BinaryOp add_100 2 1 424 421 425 0=0
MemoryData block4.convblock.4 0 1 426 0=1 1=1 2=32
ReLU leakyrelu_126 1 1 425 427 0=2.000000e-01
Split splitncnn_47 1 2 427 428 429
Convolution conv_64 1 1 429 430 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=9216
BinaryOp mul_101 2 1 430 426 431 0=2
BinaryOp add_102 2 1 431 428 432 0=0
MemoryData block4.convblock.5 0 1 433 0=1 1=1 2=32
ReLU leakyrelu_127 1 1 432 434 0=2.000000e-01
Split splitncnn_48 1 2 434 435 436
Convolution conv_65 1 1 436 437 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=9216
BinaryOp mul_103 2 1 437 433 438 0=2
BinaryOp add_104 2 1 438 435 439 0=0
MemoryData block4.convblock.6 0 1 440 0=1 1=1 2=32
ReLU leakyrelu_128 1 1 439 441 0=2.000000e-01
Split splitncnn_49 1 2 441 442 443
Convolution conv_66 1 1 443 444 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=9216
BinaryOp mul_105 2 1 444 440 445 0=2
BinaryOp add_106 2 1 445 442 446 0=0
MemoryData block4.convblock.7 0 1 447 0=1 1=1 2=32
ReLU leakyrelu_129 1 1 446 448 0=2.000000e-01
Split splitncnn_50 1 2 448 449 450
Convolution conv_67 1 1 450 451 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=9216
BinaryOp mul_107 2 1 451 447 452 0=2
BinaryOp add_108 2 1 452 449 453 0=0
ReLU leakyrelu_130 1 1 453 454 0=2.000000e-01
Deconvolution deconv_74 1 1 454 455 0=52 1=4 11=4 12=1 13=2 14=1 18=0 19=0 2=1 3=2 4=1 5=1 6=26624
PixelShuffle pixelshuffle_135 1 1 455 456 0=2 1=0
Split splitncnn_51 1 2 456 457 458
Crop slice_163 1 1 458 459 -23310=1,4 -23311=1,0 -23309=1,0
BinaryOp add_109 2 1 380 459 460 0=0
Split splitncnn_52 1 2 460 461 462
Crop slice_164 1 1 457 463 -23310=1,5 -23311=1,0 -23309=1,4
Sigmoid sigmoid_0 1 1 463 464
Split splitncnn_53 1 2 464 465 466
BinaryOp sub_110 1 1 465 467 0=7 1=1 2=1.000000e+00
Crop slice_165 1 1 462 468 -23310=1,4 -23311=1,0 -23309=1,2
rife.Warp warp_111 2 1 14 468 469 0=6
BinaryOp mul_112 2 1 469 467 470 0=2
Crop slice_166 1 1 461 471 -23310=1,2 -23311=1,0 -23309=1,0
rife.Warp warp_113 2 1 6 471 472 0=6
BinaryOp mul_114 2 1 472 466 473 0=2
BinaryOp add_115 2 1 473 470 out0 0=0

BIN
models/rife/rife-v4.26/flownet.bin vendored Normal file

Binary file not shown.

392
models/rife/rife-v4.26/flownet.param vendored Normal file
View File

@@ -0,0 +1,392 @@
7767517
390 487
Input in0 0 1 in0
Split splitncnn_input0 1 7 in0 in0_splitncnn_0 in0_splitncnn_1 in0_splitncnn_2 in0_splitncnn_3 in0_splitncnn_4 in0_splitncnn_5 in0_splitncnn_6
Input in1 0 1 in1
Split splitncnn_input1 1 7 in1 in1_splitncnn_0 in1_splitncnn_1 in1_splitncnn_2 in1_splitncnn_3 in1_splitncnn_4 in1_splitncnn_5 in1_splitncnn_6
Input in2 0 1 in2
MemoryData block0.convblock.0.beta 0 1 block0.convblock.0.beta 0=1 1=1 2=192
MemoryData block0.convblock.1.beta 0 1 block0.convblock.1.beta 0=1 1=1 2=192
MemoryData block0.convblock.2.beta 0 1 block0.convblock.2.beta 0=1 1=1 2=192
MemoryData block0.convblock.3.beta 0 1 block0.convblock.3.beta 0=1 1=1 2=192
MemoryData block0.convblock.4.beta 0 1 block0.convblock.4.beta 0=1 1=1 2=192
MemoryData block0.convblock.5.beta 0 1 block0.convblock.5.beta 0=1 1=1 2=192
MemoryData block0.convblock.6.beta 0 1 block0.convblock.6.beta 0=1 1=1 2=192
MemoryData block0.convblock.7.beta 0 1 block0.convblock.7.beta 0=1 1=1 2=192
MemoryData block1.convblock.0.beta 0 1 block1.convblock.0.beta 0=1 1=1 2=128
MemoryData block1.convblock.1.beta 0 1 block1.convblock.1.beta 0=1 1=1 2=128
MemoryData block1.convblock.2.beta 0 1 block1.convblock.2.beta 0=1 1=1 2=128
MemoryData block1.convblock.3.beta 0 1 block1.convblock.3.beta 0=1 1=1 2=128
MemoryData block1.convblock.4.beta 0 1 block1.convblock.4.beta 0=1 1=1 2=128
MemoryData block1.convblock.5.beta 0 1 block1.convblock.5.beta 0=1 1=1 2=128
MemoryData block1.convblock.6.beta 0 1 block1.convblock.6.beta 0=1 1=1 2=128
MemoryData block1.convblock.7.beta 0 1 block1.convblock.7.beta 0=1 1=1 2=128
MemoryData block2.convblock.0.beta 0 1 block2.convblock.0.beta 0=1 1=1 2=96
MemoryData block2.convblock.1.beta 0 1 block2.convblock.1.beta 0=1 1=1 2=96
MemoryData block2.convblock.2.beta 0 1 block2.convblock.2.beta 0=1 1=1 2=96
MemoryData block2.convblock.3.beta 0 1 block2.convblock.3.beta 0=1 1=1 2=96
MemoryData block2.convblock.4.beta 0 1 block2.convblock.4.beta 0=1 1=1 2=96
MemoryData block2.convblock.5.beta 0 1 block2.convblock.5.beta 0=1 1=1 2=96
MemoryData block2.convblock.6.beta 0 1 block2.convblock.6.beta 0=1 1=1 2=96
MemoryData block2.convblock.7.beta 0 1 block2.convblock.7.beta 0=1 1=1 2=96
MemoryData block3.convblock.0.beta 0 1 block3.convblock.0.beta 0=1 1=1 2=64
MemoryData block3.convblock.1.beta 0 1 block3.convblock.1.beta 0=1 1=1 2=64
MemoryData block3.convblock.2.beta 0 1 block3.convblock.2.beta 0=1 1=1 2=64
MemoryData block3.convblock.3.beta 0 1 block3.convblock.3.beta 0=1 1=1 2=64
MemoryData block3.convblock.4.beta 0 1 block3.convblock.4.beta 0=1 1=1 2=64
MemoryData block3.convblock.5.beta 0 1 block3.convblock.5.beta 0=1 1=1 2=64
MemoryData block3.convblock.6.beta 0 1 block3.convblock.6.beta 0=1 1=1 2=64
MemoryData block3.convblock.7.beta 0 1 block3.convblock.7.beta 0=1 1=1 2=64
MemoryData block4.convblock.0.beta 0 1 block4.convblock.0.beta 0=1 1=1 2=32
MemoryData block4.convblock.1.beta 0 1 block4.convblock.1.beta 0=1 1=1 2=32
MemoryData block4.convblock.2.beta 0 1 block4.convblock.2.beta 0=1 1=1 2=32
MemoryData block4.convblock.3.beta 0 1 block4.convblock.3.beta 0=1 1=1 2=32
MemoryData block4.convblock.4.beta 0 1 block4.convblock.4.beta 0=1 1=1 2=32
MemoryData block4.convblock.5.beta 0 1 block4.convblock.5.beta 0=1 1=1 2=32
MemoryData block4.convblock.6.beta 0 1 block4.convblock.6.beta 0=1 1=1 2=32
MemoryData block4.convblock.7.beta 0 1 block4.convblock.7.beta 0=1 1=1 2=32
Concat /Concat 2 1 in0_splitncnn_6 in1_splitncnn_6 /Concat_output_0
Crop /Slice 1 1 /Concat_output_0 /Slice_output_0 -23309=1,0 -23310=1,1 -23311=1,0
BinaryOp /Mul 1 1 /Slice_output_0 /Mul_output_0 0=2 1=1
BinaryOp /Add 1 1 /Mul_output_0 /Add_output_0 1=1 2=1.000000e+00
BinaryOp /Mul_1 2 1 /Add_output_0 in2 /Mul_1_output_0 0=2
Split splitncnn_0 1 5 /Mul_1_output_0 /Mul_1_output_0_splitncnn_0 /Mul_1_output_0_splitncnn_1 /Mul_1_output_0_splitncnn_2 /Mul_1_output_0_splitncnn_3 /Mul_1_output_0_splitncnn_4
Crop /Slice_1 1 1 in0_splitncnn_5 /Slice_1_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Split splitncnn_1 1 2 /Slice_1_output_0 /Slice_1_output_0_splitncnn_0 /Slice_1_output_0_splitncnn_1
Convolution /encode/cnn0/Conv 1 1 /Slice_1_output_0_splitncnn_1 /encode/relu/LeakyRelu_output_0 0=16 1=3 3=2 4=1 5=1 6=432 9=2 -23310=1,2.000000e-01
Convolution /encode/cnn1/Conv 1 1 /encode/relu/LeakyRelu_output_0 /encode/relu_1/LeakyRelu_output_0 0=16 1=3 4=1 5=1 6=2304 9=2 -23310=1,2.000000e-01
Convolution /encode/cnn2/Conv 1 1 /encode/relu_1/LeakyRelu_output_0 /encode/relu_2/LeakyRelu_output_0 0=16 1=3 4=1 5=1 6=2304 9=2 -23310=1,2.000000e-01
Deconvolution /encode/cnn3/ConvTranspose 1 1 /encode/relu_2/LeakyRelu_output_0 /encode/cnn3/ConvTranspose_output_0 0=4 1=4 3=2 4=1 5=1 6=1024
Split splitncnn_2 1 5 /encode/cnn3/ConvTranspose_output_0 /encode/cnn3/ConvTranspose_output_0_splitncnn_0 /encode/cnn3/ConvTranspose_output_0_splitncnn_1 /encode/cnn3/ConvTranspose_output_0_splitncnn_2 /encode/cnn3/ConvTranspose_output_0_splitncnn_3 /encode/cnn3/ConvTranspose_output_0_splitncnn_4
Crop /Slice_2 1 1 in1_splitncnn_5 /Slice_2_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Split splitncnn_3 1 2 /Slice_2_output_0 /Slice_2_output_0_splitncnn_0 /Slice_2_output_0_splitncnn_1
Convolution /encode/cnn0_1/Conv 1 1 /Slice_2_output_0_splitncnn_1 /encode/relu_3/LeakyRelu_output_0 0=16 1=3 3=2 4=1 5=1 6=432 9=2 -23310=1,2.000000e-01
Convolution /encode/cnn1_1/Conv 1 1 /encode/relu_3/LeakyRelu_output_0 /encode/relu_4/LeakyRelu_output_0 0=16 1=3 4=1 5=1 6=2304 9=2 -23310=1,2.000000e-01
Convolution /encode/cnn2_1/Conv 1 1 /encode/relu_4/LeakyRelu_output_0 /encode/relu_5/LeakyRelu_output_0 0=16 1=3 4=1 5=1 6=2304 9=2 -23310=1,2.000000e-01
Deconvolution /encode/cnn3_1/ConvTranspose 1 1 /encode/relu_5/LeakyRelu_output_0 /encode/cnn3_1/ConvTranspose_output_0 0=4 1=4 3=2 4=1 5=1 6=1024
Split splitncnn_4 1 5 /encode/cnn3_1/ConvTranspose_output_0 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_0 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_1 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_2 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_3 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_4
Concat /Concat_1 5 1 /Slice_1_output_0_splitncnn_0 /Slice_2_output_0_splitncnn_0 /encode/cnn3/ConvTranspose_output_0_splitncnn_4 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_4 /Mul_1_output_0_splitncnn_4 /Concat_1_output_0
Interp /block0/Resize 1 1 /Concat_1_output_0 /block0/Resize_output_0 0=2 1=6.250000e-02 2=6.250000e-02
Convolution /block0/conv0/conv0.0/conv0.0.0/Conv 1 1 /block0/Resize_output_0 /block0/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 0=96 1=3 3=2 4=1 5=1 6=12960 9=2 -23310=1,2.000000e-01
Convolution /block0/conv0/conv0.1/conv0.1.0/Conv 1 1 /block0/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 /block0/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 0=192 1=3 3=2 4=1 5=1 6=165888 9=2 -23310=1,2.000000e-01
Split splitncnn_5 1 2 /block0/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 /block0/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block0/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1
Convolution /block0/convblock/convblock.0/conv/Conv 1 1 /block0/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1 /block0/convblock/convblock.0/conv/Conv_output_0 0=192 1=3 4=1 5=1 6=331776
BinaryOp /block0/convblock/convblock.0/Mul 2 1 /block0/convblock/convblock.0/conv/Conv_output_0 block0.convblock.0.beta /block0/convblock/convblock.0/Mul_output_0 0=2
BinaryOp /block0/convblock/convblock.0/Add 2 1 /block0/convblock/convblock.0/Mul_output_0 /block0/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.0/Add_output_0
ReLU /block0/convblock/convblock.0/relu/LeakyRelu 1 1 /block0/convblock/convblock.0/Add_output_0 /block0/convblock/convblock.0/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_6 1 2 /block0/convblock/convblock.0/relu/LeakyRelu_output_0 /block0/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block0/convblock/convblock.1/conv/Conv 1 1 /block0/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1 /block0/convblock/convblock.1/conv/Conv_output_0 0=192 1=3 4=1 5=1 6=331776
BinaryOp /block0/convblock/convblock.1/Mul 2 1 /block0/convblock/convblock.1/conv/Conv_output_0 block0.convblock.1.beta /block0/convblock/convblock.1/Mul_output_0 0=2
BinaryOp /block0/convblock/convblock.1/Add 2 1 /block0/convblock/convblock.1/Mul_output_0 /block0/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.1/Add_output_0
ReLU /block0/convblock/convblock.1/relu/LeakyRelu 1 1 /block0/convblock/convblock.1/Add_output_0 /block0/convblock/convblock.1/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_7 1 2 /block0/convblock/convblock.1/relu/LeakyRelu_output_0 /block0/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block0/convblock/convblock.2/conv/Conv 1 1 /block0/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1 /block0/convblock/convblock.2/conv/Conv_output_0 0=192 1=3 4=1 5=1 6=331776
BinaryOp /block0/convblock/convblock.2/Mul 2 1 /block0/convblock/convblock.2/conv/Conv_output_0 block0.convblock.2.beta /block0/convblock/convblock.2/Mul_output_0 0=2
BinaryOp /block0/convblock/convblock.2/Add 2 1 /block0/convblock/convblock.2/Mul_output_0 /block0/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.2/Add_output_0
ReLU /block0/convblock/convblock.2/relu/LeakyRelu 1 1 /block0/convblock/convblock.2/Add_output_0 /block0/convblock/convblock.2/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_8 1 2 /block0/convblock/convblock.2/relu/LeakyRelu_output_0 /block0/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block0/convblock/convblock.3/conv/Conv 1 1 /block0/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1 /block0/convblock/convblock.3/conv/Conv_output_0 0=192 1=3 4=1 5=1 6=331776
BinaryOp /block0/convblock/convblock.3/Mul 2 1 /block0/convblock/convblock.3/conv/Conv_output_0 block0.convblock.3.beta /block0/convblock/convblock.3/Mul_output_0 0=2
BinaryOp /block0/convblock/convblock.3/Add 2 1 /block0/convblock/convblock.3/Mul_output_0 /block0/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.3/Add_output_0
ReLU /block0/convblock/convblock.3/relu/LeakyRelu 1 1 /block0/convblock/convblock.3/Add_output_0 /block0/convblock/convblock.3/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_9 1 2 /block0/convblock/convblock.3/relu/LeakyRelu_output_0 /block0/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block0/convblock/convblock.4/conv/Conv 1 1 /block0/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1 /block0/convblock/convblock.4/conv/Conv_output_0 0=192 1=3 4=1 5=1 6=331776
BinaryOp /block0/convblock/convblock.4/Mul 2 1 /block0/convblock/convblock.4/conv/Conv_output_0 block0.convblock.4.beta /block0/convblock/convblock.4/Mul_output_0 0=2
BinaryOp /block0/convblock/convblock.4/Add 2 1 /block0/convblock/convblock.4/Mul_output_0 /block0/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.4/Add_output_0
ReLU /block0/convblock/convblock.4/relu/LeakyRelu 1 1 /block0/convblock/convblock.4/Add_output_0 /block0/convblock/convblock.4/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_10 1 2 /block0/convblock/convblock.4/relu/LeakyRelu_output_0 /block0/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block0/convblock/convblock.5/conv/Conv 1 1 /block0/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1 /block0/convblock/convblock.5/conv/Conv_output_0 0=192 1=3 4=1 5=1 6=331776
BinaryOp /block0/convblock/convblock.5/Mul 2 1 /block0/convblock/convblock.5/conv/Conv_output_0 block0.convblock.5.beta /block0/convblock/convblock.5/Mul_output_0 0=2
BinaryOp /block0/convblock/convblock.5/Add 2 1 /block0/convblock/convblock.5/Mul_output_0 /block0/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.5/Add_output_0
ReLU /block0/convblock/convblock.5/relu/LeakyRelu 1 1 /block0/convblock/convblock.5/Add_output_0 /block0/convblock/convblock.5/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_11 1 2 /block0/convblock/convblock.5/relu/LeakyRelu_output_0 /block0/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block0/convblock/convblock.6/conv/Conv 1 1 /block0/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1 /block0/convblock/convblock.6/conv/Conv_output_0 0=192 1=3 4=1 5=1 6=331776
BinaryOp /block0/convblock/convblock.6/Mul 2 1 /block0/convblock/convblock.6/conv/Conv_output_0 block0.convblock.6.beta /block0/convblock/convblock.6/Mul_output_0 0=2
BinaryOp /block0/convblock/convblock.6/Add 2 1 /block0/convblock/convblock.6/Mul_output_0 /block0/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.6/Add_output_0
ReLU /block0/convblock/convblock.6/relu/LeakyRelu 1 1 /block0/convblock/convblock.6/Add_output_0 /block0/convblock/convblock.6/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_12 1 2 /block0/convblock/convblock.6/relu/LeakyRelu_output_0 /block0/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block0/convblock/convblock.7/conv/Conv 1 1 /block0/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1 /block0/convblock/convblock.7/conv/Conv_output_0 0=192 1=3 4=1 5=1 6=331776
BinaryOp /block0/convblock/convblock.7/Mul 2 1 /block0/convblock/convblock.7/conv/Conv_output_0 block0.convblock.7.beta /block0/convblock/convblock.7/Mul_output_0 0=2
BinaryOp /block0/convblock/convblock.7/Add 2 1 /block0/convblock/convblock.7/Mul_output_0 /block0/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block0/convblock/convblock.7/Add_output_0
ReLU /block0/convblock/convblock.7/relu/LeakyRelu 1 1 /block0/convblock/convblock.7/Add_output_0 /block0/convblock/convblock.7/relu/LeakyRelu_output_0 0=2.000000e-01
Deconvolution /block0/lastconv/lastconv.0/ConvTranspose 1 1 /block0/convblock/convblock.7/relu/LeakyRelu_output_0 /block0/lastconv/lastconv.0/ConvTranspose_output_0 0=52 1=4 3=2 4=1 5=1 6=159744
PixelShuffle /block0/lastconv/lastconv.1/DepthToSpace 1 1 /block0/lastconv/lastconv.0/ConvTranspose_output_0 /block0/lastconv/lastconv.1/DepthToSpace_output_0 0=2
Interp /block0/Resize_1 1 1 /block0/lastconv/lastconv.1/DepthToSpace_output_0 /block0/Resize_1_output_0 0=2 1=1.600000e+01 2=1.600000e+01
Split splitncnn_13 1 3 /block0/Resize_1_output_0 /block0/Resize_1_output_0_splitncnn_0 /block0/Resize_1_output_0_splitncnn_1 /block0/Resize_1_output_0_splitncnn_2
Crop /block0/Slice 1 1 /block0/Resize_1_output_0_splitncnn_2 /block0/Slice_output_0 -23309=1,0 -23310=1,4 -23311=1,0
BinaryOp /block0/Mul 1 1 /block0/Slice_output_0 /block0/Mul_output_0 0=2 1=1 2=1.600000e+01
Split splitncnn_14 1 6 /block0/Mul_output_0 /block0/Mul_output_0_splitncnn_0 /block0/Mul_output_0_splitncnn_1 /block0/Mul_output_0_splitncnn_2 /block0/Mul_output_0_splitncnn_3 /block0/Mul_output_0_splitncnn_4 /block0/Mul_output_0_splitncnn_5
Crop /block0/Slice_1 1 1 /block0/Resize_1_output_0_splitncnn_1 /block0/Slice_1_output_0 -23309=1,4 -23310=1,5 -23311=1,0
Crop /block0/Slice_2 1 1 /block0/Resize_1_output_0_splitncnn_0 /block0/Slice_2_output_0 -23309=1,5 -23310=1,2147483647 -23311=1,0
Crop /Slice_3 1 1 /block0/Mul_output_0_splitncnn_5 /Slice_3_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp 2 1 in0_splitncnn_4 /Slice_3_output_0 /warp_output_0 0=6
Crop /Slice_4 1 1 /block0/Mul_output_0_splitncnn_4 /Slice_4_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_1 2 1 in1_splitncnn_4 /Slice_4_output_0 /warp_1_output_0 0=6
Crop /Slice_5 1 1 /block0/Mul_output_0_splitncnn_3 /Slice_5_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp_2 2 1 /encode/cnn3/ConvTranspose_output_0_splitncnn_3 /Slice_5_output_0 /warp_2_output_0 0=6
Crop /Slice_6 1 1 /block0/Mul_output_0_splitncnn_2 /Slice_6_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_3 2 1 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_3 /Slice_6_output_0 /warp_3_output_0 0=6
Crop /Slice_7 1 1 /warp_output_0 /Slice_7_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Crop /Slice_8 1 1 /warp_1_output_0 /Slice_8_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Concat /Concat_2 7 1 /Slice_7_output_0 /Slice_8_output_0 /warp_2_output_0 /warp_3_output_0 /Mul_1_output_0_splitncnn_3 /block0/Slice_1_output_0 /block0/Slice_2_output_0 /Concat_2_output_0
Interp /block1/Resize 1 1 /Concat_2_output_0 /block1/Resize_output_0 0=2 1=1.250000e-01 2=1.250000e-01
Interp /block1/Resize_1 1 1 /block0/Mul_output_0_splitncnn_1 /block1/Resize_1_output_0 0=2 1=1.250000e-01 2=1.250000e-01
BinaryOp /block1/Div 1 1 /block1/Resize_1_output_0 /block1/Div_output_0 0=3 1=1 2=8.000000e+00
Concat /block1/Concat 2 1 /block1/Resize_output_0 /block1/Div_output_0 /block1/Concat_output_0
Convolution /block1/conv0/conv0.0/conv0.0.0/Conv 1 1 /block1/Concat_output_0 /block1/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 0=64 1=3 3=2 4=1 5=1 6=16128 9=2 -23310=1,2.000000e-01
Convolution /block1/conv0/conv0.1/conv0.1.0/Conv 1 1 /block1/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 /block1/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 0=128 1=3 3=2 4=1 5=1 6=73728 9=2 -23310=1,2.000000e-01
Split splitncnn_15 1 2 /block1/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 /block1/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block1/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1
Convolution /block1/convblock/convblock.0/conv/Conv 1 1 /block1/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1 /block1/convblock/convblock.0/conv/Conv_output_0 0=128 1=3 4=1 5=1 6=147456
BinaryOp /block1/convblock/convblock.0/Mul 2 1 /block1/convblock/convblock.0/conv/Conv_output_0 block1.convblock.0.beta /block1/convblock/convblock.0/Mul_output_0 0=2
BinaryOp /block1/convblock/convblock.0/Add 2 1 /block1/convblock/convblock.0/Mul_output_0 /block1/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.0/Add_output_0
ReLU /block1/convblock/convblock.0/relu/LeakyRelu 1 1 /block1/convblock/convblock.0/Add_output_0 /block1/convblock/convblock.0/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_16 1 2 /block1/convblock/convblock.0/relu/LeakyRelu_output_0 /block1/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block1/convblock/convblock.1/conv/Conv 1 1 /block1/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1 /block1/convblock/convblock.1/conv/Conv_output_0 0=128 1=3 4=1 5=1 6=147456
BinaryOp /block1/convblock/convblock.1/Mul 2 1 /block1/convblock/convblock.1/conv/Conv_output_0 block1.convblock.1.beta /block1/convblock/convblock.1/Mul_output_0 0=2
BinaryOp /block1/convblock/convblock.1/Add 2 1 /block1/convblock/convblock.1/Mul_output_0 /block1/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.1/Add_output_0
ReLU /block1/convblock/convblock.1/relu/LeakyRelu 1 1 /block1/convblock/convblock.1/Add_output_0 /block1/convblock/convblock.1/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_17 1 2 /block1/convblock/convblock.1/relu/LeakyRelu_output_0 /block1/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block1/convblock/convblock.2/conv/Conv 1 1 /block1/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1 /block1/convblock/convblock.2/conv/Conv_output_0 0=128 1=3 4=1 5=1 6=147456
BinaryOp /block1/convblock/convblock.2/Mul 2 1 /block1/convblock/convblock.2/conv/Conv_output_0 block1.convblock.2.beta /block1/convblock/convblock.2/Mul_output_0 0=2
BinaryOp /block1/convblock/convblock.2/Add 2 1 /block1/convblock/convblock.2/Mul_output_0 /block1/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.2/Add_output_0
ReLU /block1/convblock/convblock.2/relu/LeakyRelu 1 1 /block1/convblock/convblock.2/Add_output_0 /block1/convblock/convblock.2/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_18 1 2 /block1/convblock/convblock.2/relu/LeakyRelu_output_0 /block1/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block1/convblock/convblock.3/conv/Conv 1 1 /block1/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1 /block1/convblock/convblock.3/conv/Conv_output_0 0=128 1=3 4=1 5=1 6=147456
BinaryOp /block1/convblock/convblock.3/Mul 2 1 /block1/convblock/convblock.3/conv/Conv_output_0 block1.convblock.3.beta /block1/convblock/convblock.3/Mul_output_0 0=2
BinaryOp /block1/convblock/convblock.3/Add 2 1 /block1/convblock/convblock.3/Mul_output_0 /block1/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.3/Add_output_0
ReLU /block1/convblock/convblock.3/relu/LeakyRelu 1 1 /block1/convblock/convblock.3/Add_output_0 /block1/convblock/convblock.3/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_19 1 2 /block1/convblock/convblock.3/relu/LeakyRelu_output_0 /block1/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block1/convblock/convblock.4/conv/Conv 1 1 /block1/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1 /block1/convblock/convblock.4/conv/Conv_output_0 0=128 1=3 4=1 5=1 6=147456
BinaryOp /block1/convblock/convblock.4/Mul 2 1 /block1/convblock/convblock.4/conv/Conv_output_0 block1.convblock.4.beta /block1/convblock/convblock.4/Mul_output_0 0=2
BinaryOp /block1/convblock/convblock.4/Add 2 1 /block1/convblock/convblock.4/Mul_output_0 /block1/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.4/Add_output_0
ReLU /block1/convblock/convblock.4/relu/LeakyRelu 1 1 /block1/convblock/convblock.4/Add_output_0 /block1/convblock/convblock.4/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_20 1 2 /block1/convblock/convblock.4/relu/LeakyRelu_output_0 /block1/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block1/convblock/convblock.5/conv/Conv 1 1 /block1/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1 /block1/convblock/convblock.5/conv/Conv_output_0 0=128 1=3 4=1 5=1 6=147456
BinaryOp /block1/convblock/convblock.5/Mul 2 1 /block1/convblock/convblock.5/conv/Conv_output_0 block1.convblock.5.beta /block1/convblock/convblock.5/Mul_output_0 0=2
BinaryOp /block1/convblock/convblock.5/Add 2 1 /block1/convblock/convblock.5/Mul_output_0 /block1/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.5/Add_output_0
ReLU /block1/convblock/convblock.5/relu/LeakyRelu 1 1 /block1/convblock/convblock.5/Add_output_0 /block1/convblock/convblock.5/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_21 1 2 /block1/convblock/convblock.5/relu/LeakyRelu_output_0 /block1/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block1/convblock/convblock.6/conv/Conv 1 1 /block1/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1 /block1/convblock/convblock.6/conv/Conv_output_0 0=128 1=3 4=1 5=1 6=147456
BinaryOp /block1/convblock/convblock.6/Mul 2 1 /block1/convblock/convblock.6/conv/Conv_output_0 block1.convblock.6.beta /block1/convblock/convblock.6/Mul_output_0 0=2
BinaryOp /block1/convblock/convblock.6/Add 2 1 /block1/convblock/convblock.6/Mul_output_0 /block1/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.6/Add_output_0
ReLU /block1/convblock/convblock.6/relu/LeakyRelu 1 1 /block1/convblock/convblock.6/Add_output_0 /block1/convblock/convblock.6/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_22 1 2 /block1/convblock/convblock.6/relu/LeakyRelu_output_0 /block1/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block1/convblock/convblock.7/conv/Conv 1 1 /block1/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1 /block1/convblock/convblock.7/conv/Conv_output_0 0=128 1=3 4=1 5=1 6=147456
BinaryOp /block1/convblock/convblock.7/Mul 2 1 /block1/convblock/convblock.7/conv/Conv_output_0 block1.convblock.7.beta /block1/convblock/convblock.7/Mul_output_0 0=2
BinaryOp /block1/convblock/convblock.7/Add 2 1 /block1/convblock/convblock.7/Mul_output_0 /block1/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block1/convblock/convblock.7/Add_output_0
ReLU /block1/convblock/convblock.7/relu/LeakyRelu 1 1 /block1/convblock/convblock.7/Add_output_0 /block1/convblock/convblock.7/relu/LeakyRelu_output_0 0=2.000000e-01
Deconvolution /block1/lastconv/lastconv.0/ConvTranspose 1 1 /block1/convblock/convblock.7/relu/LeakyRelu_output_0 /block1/lastconv/lastconv.0/ConvTranspose_output_0 0=52 1=4 3=2 4=1 5=1 6=106496
PixelShuffle /block1/lastconv/lastconv.1/DepthToSpace 1 1 /block1/lastconv/lastconv.0/ConvTranspose_output_0 /block1/lastconv/lastconv.1/DepthToSpace_output_0 0=2
Interp /block1/Resize_2 1 1 /block1/lastconv/lastconv.1/DepthToSpace_output_0 /block1/Resize_2_output_0 0=2 1=8.000000e+00 2=8.000000e+00
Split splitncnn_23 1 3 /block1/Resize_2_output_0 /block1/Resize_2_output_0_splitncnn_0 /block1/Resize_2_output_0_splitncnn_1 /block1/Resize_2_output_0_splitncnn_2
Crop /block1/Slice 1 1 /block1/Resize_2_output_0_splitncnn_2 /block1/Slice_output_0 -23309=1,0 -23310=1,4 -23311=1,0
Crop /block1/Slice_1 1 1 /block1/Resize_2_output_0_splitncnn_1 /block1/Slice_1_output_0 -23309=1,4 -23310=1,5 -23311=1,0
Crop /block1/Slice_2 1 1 /block1/Resize_2_output_0_splitncnn_0 /block1/Slice_2_output_0 -23309=1,5 -23310=1,2147483647 -23311=1,0
Eltwise /Add_1 2 1 /block0/Mul_output_0_splitncnn_0 /block1/Slice_output_0 /Add_1_output_0 0=1 -23301=2,1.000000e+00,8.000000e+00
Split splitncnn_24 1 6 /Add_1_output_0 /Add_1_output_0_splitncnn_0 /Add_1_output_0_splitncnn_1 /Add_1_output_0_splitncnn_2 /Add_1_output_0_splitncnn_3 /Add_1_output_0_splitncnn_4 /Add_1_output_0_splitncnn_5
Crop /Slice_9 1 1 /Add_1_output_0_splitncnn_5 /Slice_9_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp_4 2 1 in0_splitncnn_3 /Slice_9_output_0 /warp_4_output_0 0=6
Crop /Slice_10 1 1 /Add_1_output_0_splitncnn_4 /Slice_10_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_5 2 1 in1_splitncnn_3 /Slice_10_output_0 /warp_5_output_0 0=6
Crop /Slice_11 1 1 /Add_1_output_0_splitncnn_3 /Slice_11_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp_6 2 1 /encode/cnn3/ConvTranspose_output_0_splitncnn_2 /Slice_11_output_0 /warp_6_output_0 0=6
Crop /Slice_12 1 1 /Add_1_output_0_splitncnn_2 /Slice_12_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_7 2 1 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_2 /Slice_12_output_0 /warp_7_output_0 0=6
Crop /Slice_13 1 1 /warp_4_output_0 /Slice_13_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Crop /Slice_14 1 1 /warp_5_output_0 /Slice_14_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Concat /Concat_3 7 1 /Slice_13_output_0 /Slice_14_output_0 /warp_6_output_0 /warp_7_output_0 /Mul_1_output_0_splitncnn_2 /block1/Slice_1_output_0 /block1/Slice_2_output_0 /Concat_3_output_0
Interp /block2/Resize 1 1 /Concat_3_output_0 /block2/Resize_output_0 0=2 1=2.500000e-01 2=2.500000e-01
Interp /block2/Resize_1 1 1 /Add_1_output_0_splitncnn_1 /block2/Resize_1_output_0 0=2 1=2.500000e-01 2=2.500000e-01
BinaryOp /block2/Div 1 1 /block2/Resize_1_output_0 /block2/Div_output_0 0=3 1=1 2=4.000000e+00
Concat /block2/Concat 2 1 /block2/Resize_output_0 /block2/Div_output_0 /block2/Concat_output_0
Convolution /block2/conv0/conv0.0/conv0.0.0/Conv 1 1 /block2/Concat_output_0 /block2/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 0=48 1=3 3=2 4=1 5=1 6=12096 9=2 -23310=1,2.000000e-01
Convolution /block2/conv0/conv0.1/conv0.1.0/Conv 1 1 /block2/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 /block2/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 0=96 1=3 3=2 4=1 5=1 6=41472 9=2 -23310=1,2.000000e-01
Split splitncnn_25 1 2 /block2/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 /block2/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block2/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1
Convolution /block2/convblock/convblock.0/conv/Conv 1 1 /block2/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1 /block2/convblock/convblock.0/conv/Conv_output_0 0=96 1=3 4=1 5=1 6=82944
BinaryOp /block2/convblock/convblock.0/Mul 2 1 /block2/convblock/convblock.0/conv/Conv_output_0 block2.convblock.0.beta /block2/convblock/convblock.0/Mul_output_0 0=2
BinaryOp /block2/convblock/convblock.0/Add 2 1 /block2/convblock/convblock.0/Mul_output_0 /block2/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.0/Add_output_0
ReLU /block2/convblock/convblock.0/relu/LeakyRelu 1 1 /block2/convblock/convblock.0/Add_output_0 /block2/convblock/convblock.0/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_26 1 2 /block2/convblock/convblock.0/relu/LeakyRelu_output_0 /block2/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block2/convblock/convblock.1/conv/Conv 1 1 /block2/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1 /block2/convblock/convblock.1/conv/Conv_output_0 0=96 1=3 4=1 5=1 6=82944
BinaryOp /block2/convblock/convblock.1/Mul 2 1 /block2/convblock/convblock.1/conv/Conv_output_0 block2.convblock.1.beta /block2/convblock/convblock.1/Mul_output_0 0=2
BinaryOp /block2/convblock/convblock.1/Add 2 1 /block2/convblock/convblock.1/Mul_output_0 /block2/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.1/Add_output_0
ReLU /block2/convblock/convblock.1/relu/LeakyRelu 1 1 /block2/convblock/convblock.1/Add_output_0 /block2/convblock/convblock.1/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_27 1 2 /block2/convblock/convblock.1/relu/LeakyRelu_output_0 /block2/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block2/convblock/convblock.2/conv/Conv 1 1 /block2/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1 /block2/convblock/convblock.2/conv/Conv_output_0 0=96 1=3 4=1 5=1 6=82944
BinaryOp /block2/convblock/convblock.2/Mul 2 1 /block2/convblock/convblock.2/conv/Conv_output_0 block2.convblock.2.beta /block2/convblock/convblock.2/Mul_output_0 0=2
BinaryOp /block2/convblock/convblock.2/Add 2 1 /block2/convblock/convblock.2/Mul_output_0 /block2/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.2/Add_output_0
ReLU /block2/convblock/convblock.2/relu/LeakyRelu 1 1 /block2/convblock/convblock.2/Add_output_0 /block2/convblock/convblock.2/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_28 1 2 /block2/convblock/convblock.2/relu/LeakyRelu_output_0 /block2/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block2/convblock/convblock.3/conv/Conv 1 1 /block2/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1 /block2/convblock/convblock.3/conv/Conv_output_0 0=96 1=3 4=1 5=1 6=82944
BinaryOp /block2/convblock/convblock.3/Mul 2 1 /block2/convblock/convblock.3/conv/Conv_output_0 block2.convblock.3.beta /block2/convblock/convblock.3/Mul_output_0 0=2
BinaryOp /block2/convblock/convblock.3/Add 2 1 /block2/convblock/convblock.3/Mul_output_0 /block2/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.3/Add_output_0
ReLU /block2/convblock/convblock.3/relu/LeakyRelu 1 1 /block2/convblock/convblock.3/Add_output_0 /block2/convblock/convblock.3/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_29 1 2 /block2/convblock/convblock.3/relu/LeakyRelu_output_0 /block2/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block2/convblock/convblock.4/conv/Conv 1 1 /block2/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1 /block2/convblock/convblock.4/conv/Conv_output_0 0=96 1=3 4=1 5=1 6=82944
BinaryOp /block2/convblock/convblock.4/Mul 2 1 /block2/convblock/convblock.4/conv/Conv_output_0 block2.convblock.4.beta /block2/convblock/convblock.4/Mul_output_0 0=2
BinaryOp /block2/convblock/convblock.4/Add 2 1 /block2/convblock/convblock.4/Mul_output_0 /block2/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.4/Add_output_0
ReLU /block2/convblock/convblock.4/relu/LeakyRelu 1 1 /block2/convblock/convblock.4/Add_output_0 /block2/convblock/convblock.4/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_30 1 2 /block2/convblock/convblock.4/relu/LeakyRelu_output_0 /block2/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block2/convblock/convblock.5/conv/Conv 1 1 /block2/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1 /block2/convblock/convblock.5/conv/Conv_output_0 0=96 1=3 4=1 5=1 6=82944
BinaryOp /block2/convblock/convblock.5/Mul 2 1 /block2/convblock/convblock.5/conv/Conv_output_0 block2.convblock.5.beta /block2/convblock/convblock.5/Mul_output_0 0=2
BinaryOp /block2/convblock/convblock.5/Add 2 1 /block2/convblock/convblock.5/Mul_output_0 /block2/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.5/Add_output_0
ReLU /block2/convblock/convblock.5/relu/LeakyRelu 1 1 /block2/convblock/convblock.5/Add_output_0 /block2/convblock/convblock.5/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_31 1 2 /block2/convblock/convblock.5/relu/LeakyRelu_output_0 /block2/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block2/convblock/convblock.6/conv/Conv 1 1 /block2/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1 /block2/convblock/convblock.6/conv/Conv_output_0 0=96 1=3 4=1 5=1 6=82944
BinaryOp /block2/convblock/convblock.6/Mul 2 1 /block2/convblock/convblock.6/conv/Conv_output_0 block2.convblock.6.beta /block2/convblock/convblock.6/Mul_output_0 0=2
BinaryOp /block2/convblock/convblock.6/Add 2 1 /block2/convblock/convblock.6/Mul_output_0 /block2/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.6/Add_output_0
ReLU /block2/convblock/convblock.6/relu/LeakyRelu 1 1 /block2/convblock/convblock.6/Add_output_0 /block2/convblock/convblock.6/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_32 1 2 /block2/convblock/convblock.6/relu/LeakyRelu_output_0 /block2/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block2/convblock/convblock.7/conv/Conv 1 1 /block2/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1 /block2/convblock/convblock.7/conv/Conv_output_0 0=96 1=3 4=1 5=1 6=82944
BinaryOp /block2/convblock/convblock.7/Mul 2 1 /block2/convblock/convblock.7/conv/Conv_output_0 block2.convblock.7.beta /block2/convblock/convblock.7/Mul_output_0 0=2
BinaryOp /block2/convblock/convblock.7/Add 2 1 /block2/convblock/convblock.7/Mul_output_0 /block2/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block2/convblock/convblock.7/Add_output_0
ReLU /block2/convblock/convblock.7/relu/LeakyRelu 1 1 /block2/convblock/convblock.7/Add_output_0 /block2/convblock/convblock.7/relu/LeakyRelu_output_0 0=2.000000e-01
Deconvolution /block2/lastconv/lastconv.0/ConvTranspose 1 1 /block2/convblock/convblock.7/relu/LeakyRelu_output_0 /block2/lastconv/lastconv.0/ConvTranspose_output_0 0=52 1=4 3=2 4=1 5=1 6=79872
PixelShuffle /block2/lastconv/lastconv.1/DepthToSpace 1 1 /block2/lastconv/lastconv.0/ConvTranspose_output_0 /block2/lastconv/lastconv.1/DepthToSpace_output_0 0=2
Interp /block2/Resize_2 1 1 /block2/lastconv/lastconv.1/DepthToSpace_output_0 /block2/Resize_2_output_0 0=2 1=4.000000e+00 2=4.000000e+00
Split splitncnn_33 1 3 /block2/Resize_2_output_0 /block2/Resize_2_output_0_splitncnn_0 /block2/Resize_2_output_0_splitncnn_1 /block2/Resize_2_output_0_splitncnn_2
Crop /block2/Slice 1 1 /block2/Resize_2_output_0_splitncnn_2 /block2/Slice_output_0 -23309=1,0 -23310=1,4 -23311=1,0
Crop /block2/Slice_1 1 1 /block2/Resize_2_output_0_splitncnn_1 /block2/Slice_1_output_0 -23309=1,4 -23310=1,5 -23311=1,0
Crop /block2/Slice_2 1 1 /block2/Resize_2_output_0_splitncnn_0 /block2/Slice_2_output_0 -23309=1,5 -23310=1,2147483647 -23311=1,0
Eltwise /Add_2 2 1 /Add_1_output_0_splitncnn_0 /block2/Slice_output_0 /Add_2_output_0 0=1 -23301=2,1.000000e+00,4.000000e+00
Split splitncnn_34 1 6 /Add_2_output_0 /Add_2_output_0_splitncnn_0 /Add_2_output_0_splitncnn_1 /Add_2_output_0_splitncnn_2 /Add_2_output_0_splitncnn_3 /Add_2_output_0_splitncnn_4 /Add_2_output_0_splitncnn_5
Crop /Slice_15 1 1 /Add_2_output_0_splitncnn_5 /Slice_15_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp_8 2 1 in0_splitncnn_2 /Slice_15_output_0 /warp_8_output_0 0=6
Crop /Slice_16 1 1 /Add_2_output_0_splitncnn_4 /Slice_16_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_9 2 1 in1_splitncnn_2 /Slice_16_output_0 /warp_9_output_0 0=6
Crop /Slice_17 1 1 /Add_2_output_0_splitncnn_3 /Slice_17_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp_10 2 1 /encode/cnn3/ConvTranspose_output_0_splitncnn_1 /Slice_17_output_0 /warp_10_output_0 0=6
Crop /Slice_18 1 1 /Add_2_output_0_splitncnn_2 /Slice_18_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_11 2 1 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_1 /Slice_18_output_0 /warp_11_output_0 0=6
Crop /Slice_19 1 1 /warp_8_output_0 /Slice_19_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Crop /Slice_20 1 1 /warp_9_output_0 /Slice_20_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Concat /Concat_4 7 1 /Slice_19_output_0 /Slice_20_output_0 /warp_10_output_0 /warp_11_output_0 /Mul_1_output_0_splitncnn_1 /block2/Slice_1_output_0 /block2/Slice_2_output_0 /Concat_4_output_0
Interp /block3/Resize 1 1 /Concat_4_output_0 /block3/Resize_output_0 0=2 1=5.000000e-01 2=5.000000e-01
Interp /block3/Resize_1 1 1 /Add_2_output_0_splitncnn_1 /block3/Resize_1_output_0 0=2 1=5.000000e-01 2=5.000000e-01
BinaryOp /block3/Div 1 1 /block3/Resize_1_output_0 /block3/Div_output_0 0=3 1=1 2=2.000000e+00
Concat /block3/Concat 2 1 /block3/Resize_output_0 /block3/Div_output_0 /block3/Concat_output_0
Convolution /block3/conv0/conv0.0/conv0.0.0/Conv 1 1 /block3/Concat_output_0 /block3/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 0=32 1=3 3=2 4=1 5=1 6=8064 9=2 -23310=1,2.000000e-01
Convolution /block3/conv0/conv0.1/conv0.1.0/Conv 1 1 /block3/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 /block3/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 0=64 1=3 3=2 4=1 5=1 6=18432 9=2 -23310=1,2.000000e-01
Split splitncnn_35 1 2 /block3/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 /block3/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block3/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1
Convolution /block3/convblock/convblock.0/conv/Conv 1 1 /block3/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1 /block3/convblock/convblock.0/conv/Conv_output_0 0=64 1=3 4=1 5=1 6=36864
BinaryOp /block3/convblock/convblock.0/Mul 2 1 /block3/convblock/convblock.0/conv/Conv_output_0 block3.convblock.0.beta /block3/convblock/convblock.0/Mul_output_0 0=2
BinaryOp /block3/convblock/convblock.0/Add 2 1 /block3/convblock/convblock.0/Mul_output_0 /block3/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.0/Add_output_0
ReLU /block3/convblock/convblock.0/relu/LeakyRelu 1 1 /block3/convblock/convblock.0/Add_output_0 /block3/convblock/convblock.0/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_36 1 2 /block3/convblock/convblock.0/relu/LeakyRelu_output_0 /block3/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block3/convblock/convblock.1/conv/Conv 1 1 /block3/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1 /block3/convblock/convblock.1/conv/Conv_output_0 0=64 1=3 4=1 5=1 6=36864
BinaryOp /block3/convblock/convblock.1/Mul 2 1 /block3/convblock/convblock.1/conv/Conv_output_0 block3.convblock.1.beta /block3/convblock/convblock.1/Mul_output_0 0=2
BinaryOp /block3/convblock/convblock.1/Add 2 1 /block3/convblock/convblock.1/Mul_output_0 /block3/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.1/Add_output_0
ReLU /block3/convblock/convblock.1/relu/LeakyRelu 1 1 /block3/convblock/convblock.1/Add_output_0 /block3/convblock/convblock.1/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_37 1 2 /block3/convblock/convblock.1/relu/LeakyRelu_output_0 /block3/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block3/convblock/convblock.2/conv/Conv 1 1 /block3/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1 /block3/convblock/convblock.2/conv/Conv_output_0 0=64 1=3 4=1 5=1 6=36864
BinaryOp /block3/convblock/convblock.2/Mul 2 1 /block3/convblock/convblock.2/conv/Conv_output_0 block3.convblock.2.beta /block3/convblock/convblock.2/Mul_output_0 0=2
BinaryOp /block3/convblock/convblock.2/Add 2 1 /block3/convblock/convblock.2/Mul_output_0 /block3/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.2/Add_output_0
ReLU /block3/convblock/convblock.2/relu/LeakyRelu 1 1 /block3/convblock/convblock.2/Add_output_0 /block3/convblock/convblock.2/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_38 1 2 /block3/convblock/convblock.2/relu/LeakyRelu_output_0 /block3/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block3/convblock/convblock.3/conv/Conv 1 1 /block3/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1 /block3/convblock/convblock.3/conv/Conv_output_0 0=64 1=3 4=1 5=1 6=36864
BinaryOp /block3/convblock/convblock.3/Mul 2 1 /block3/convblock/convblock.3/conv/Conv_output_0 block3.convblock.3.beta /block3/convblock/convblock.3/Mul_output_0 0=2
BinaryOp /block3/convblock/convblock.3/Add 2 1 /block3/convblock/convblock.3/Mul_output_0 /block3/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.3/Add_output_0
ReLU /block3/convblock/convblock.3/relu/LeakyRelu 1 1 /block3/convblock/convblock.3/Add_output_0 /block3/convblock/convblock.3/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_39 1 2 /block3/convblock/convblock.3/relu/LeakyRelu_output_0 /block3/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block3/convblock/convblock.4/conv/Conv 1 1 /block3/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1 /block3/convblock/convblock.4/conv/Conv_output_0 0=64 1=3 4=1 5=1 6=36864
BinaryOp /block3/convblock/convblock.4/Mul 2 1 /block3/convblock/convblock.4/conv/Conv_output_0 block3.convblock.4.beta /block3/convblock/convblock.4/Mul_output_0 0=2
BinaryOp /block3/convblock/convblock.4/Add 2 1 /block3/convblock/convblock.4/Mul_output_0 /block3/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.4/Add_output_0
ReLU /block3/convblock/convblock.4/relu/LeakyRelu 1 1 /block3/convblock/convblock.4/Add_output_0 /block3/convblock/convblock.4/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_40 1 2 /block3/convblock/convblock.4/relu/LeakyRelu_output_0 /block3/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block3/convblock/convblock.5/conv/Conv 1 1 /block3/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1 /block3/convblock/convblock.5/conv/Conv_output_0 0=64 1=3 4=1 5=1 6=36864
BinaryOp /block3/convblock/convblock.5/Mul 2 1 /block3/convblock/convblock.5/conv/Conv_output_0 block3.convblock.5.beta /block3/convblock/convblock.5/Mul_output_0 0=2
BinaryOp /block3/convblock/convblock.5/Add 2 1 /block3/convblock/convblock.5/Mul_output_0 /block3/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.5/Add_output_0
ReLU /block3/convblock/convblock.5/relu/LeakyRelu 1 1 /block3/convblock/convblock.5/Add_output_0 /block3/convblock/convblock.5/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_41 1 2 /block3/convblock/convblock.5/relu/LeakyRelu_output_0 /block3/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block3/convblock/convblock.6/conv/Conv 1 1 /block3/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1 /block3/convblock/convblock.6/conv/Conv_output_0 0=64 1=3 4=1 5=1 6=36864
BinaryOp /block3/convblock/convblock.6/Mul 2 1 /block3/convblock/convblock.6/conv/Conv_output_0 block3.convblock.6.beta /block3/convblock/convblock.6/Mul_output_0 0=2
BinaryOp /block3/convblock/convblock.6/Add 2 1 /block3/convblock/convblock.6/Mul_output_0 /block3/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.6/Add_output_0
ReLU /block3/convblock/convblock.6/relu/LeakyRelu 1 1 /block3/convblock/convblock.6/Add_output_0 /block3/convblock/convblock.6/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_42 1 2 /block3/convblock/convblock.6/relu/LeakyRelu_output_0 /block3/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block3/convblock/convblock.7/conv/Conv 1 1 /block3/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1 /block3/convblock/convblock.7/conv/Conv_output_0 0=64 1=3 4=1 5=1 6=36864
BinaryOp /block3/convblock/convblock.7/Mul 2 1 /block3/convblock/convblock.7/conv/Conv_output_0 block3.convblock.7.beta /block3/convblock/convblock.7/Mul_output_0 0=2
BinaryOp /block3/convblock/convblock.7/Add 2 1 /block3/convblock/convblock.7/Mul_output_0 /block3/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block3/convblock/convblock.7/Add_output_0
ReLU /block3/convblock/convblock.7/relu/LeakyRelu 1 1 /block3/convblock/convblock.7/Add_output_0 /block3/convblock/convblock.7/relu/LeakyRelu_output_0 0=2.000000e-01
Deconvolution /block3/lastconv/lastconv.0/ConvTranspose 1 1 /block3/convblock/convblock.7/relu/LeakyRelu_output_0 /block3/lastconv/lastconv.0/ConvTranspose_output_0 0=52 1=4 3=2 4=1 5=1 6=53248
PixelShuffle /block3/lastconv/lastconv.1/DepthToSpace 1 1 /block3/lastconv/lastconv.0/ConvTranspose_output_0 /block3/lastconv/lastconv.1/DepthToSpace_output_0 0=2
Interp /block3/Resize_2 1 1 /block3/lastconv/lastconv.1/DepthToSpace_output_0 /block3/Resize_2_output_0 0=2 1=2.000000e+00 2=2.000000e+00
Split splitncnn_43 1 3 /block3/Resize_2_output_0 /block3/Resize_2_output_0_splitncnn_0 /block3/Resize_2_output_0_splitncnn_1 /block3/Resize_2_output_0_splitncnn_2
Crop /block3/Slice 1 1 /block3/Resize_2_output_0_splitncnn_2 /block3/Slice_output_0 -23309=1,0 -23310=1,4 -23311=1,0
Crop /block3/Slice_1 1 1 /block3/Resize_2_output_0_splitncnn_1 /block3/Slice_1_output_0 -23309=1,4 -23310=1,5 -23311=1,0
Crop /block3/Slice_2 1 1 /block3/Resize_2_output_0_splitncnn_0 /block3/Slice_2_output_0 -23309=1,5 -23310=1,2147483647 -23311=1,0
Eltwise /Add_3 2 1 /Add_2_output_0_splitncnn_0 /block3/Slice_output_0 /Add_3_output_0 0=1 -23301=2,1.000000e+00,2.000000e+00
Split splitncnn_44 1 6 /Add_3_output_0 /Add_3_output_0_splitncnn_0 /Add_3_output_0_splitncnn_1 /Add_3_output_0_splitncnn_2 /Add_3_output_0_splitncnn_3 /Add_3_output_0_splitncnn_4 /Add_3_output_0_splitncnn_5
Crop /Slice_21 1 1 /Add_3_output_0_splitncnn_5 /Slice_21_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp_12 2 1 in0_splitncnn_1 /Slice_21_output_0 /warp_12_output_0 0=6
Crop /Slice_22 1 1 /Add_3_output_0_splitncnn_4 /Slice_22_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_13 2 1 in1_splitncnn_1 /Slice_22_output_0 /warp_13_output_0 0=6
Crop /Slice_23 1 1 /Add_3_output_0_splitncnn_3 /Slice_23_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp_14 2 1 /encode/cnn3/ConvTranspose_output_0_splitncnn_0 /Slice_23_output_0 /warp_14_output_0 0=6
Crop /Slice_24 1 1 /Add_3_output_0_splitncnn_2 /Slice_24_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_15 2 1 /encode/cnn3_1/ConvTranspose_output_0_splitncnn_0 /Slice_24_output_0 /warp_15_output_0 0=6
Crop /Slice_25 1 1 /warp_12_output_0 /Slice_25_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Crop /Slice_26 1 1 /warp_13_output_0 /Slice_26_output_0 -23309=1,0 -23310=1,3 -23311=1,0
Concat /Concat_5 7 1 /Slice_25_output_0 /Slice_26_output_0 /warp_14_output_0 /warp_15_output_0 /Mul_1_output_0_splitncnn_0 /block3/Slice_1_output_0 /block3/Slice_2_output_0 /Concat_5_output_0
Interp /block4/Resize 1 1 /Concat_5_output_0 /block4/Resize_output_0 0=2
Interp /block4/Resize_1 1 1 /Add_3_output_0_splitncnn_1 /block4/Resize_1_output_0 0=2
Concat /block4/Concat 2 1 /block4/Resize_output_0 /block4/Resize_1_output_0 /block4/Concat_output_0
Convolution /block4/conv0/conv0.0/conv0.0.0/Conv 1 1 /block4/Concat_output_0 /block4/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 0=16 1=3 3=2 4=1 5=1 6=4032 9=2 -23310=1,2.000000e-01
Convolution /block4/conv0/conv0.1/conv0.1.0/Conv 1 1 /block4/conv0/conv0.0/conv0.0.1/LeakyRelu_output_0 /block4/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 0=32 1=3 3=2 4=1 5=1 6=4608 9=2 -23310=1,2.000000e-01
Split splitncnn_45 1 2 /block4/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0 /block4/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block4/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1
Convolution /block4/convblock/convblock.0/conv/Conv 1 1 /block4/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_1 /block4/convblock/convblock.0/conv/Conv_output_0 0=32 1=3 4=1 5=1 6=9216
BinaryOp /block4/convblock/convblock.0/Mul 2 1 /block4/convblock/convblock.0/conv/Conv_output_0 block4.convblock.0.beta /block4/convblock/convblock.0/Mul_output_0 0=2
BinaryOp /block4/convblock/convblock.0/Add 2 1 /block4/convblock/convblock.0/Mul_output_0 /block4/conv0/conv0.1/conv0.1.1/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.0/Add_output_0
ReLU /block4/convblock/convblock.0/relu/LeakyRelu 1 1 /block4/convblock/convblock.0/Add_output_0 /block4/convblock/convblock.0/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_46 1 2 /block4/convblock/convblock.0/relu/LeakyRelu_output_0 /block4/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block4/convblock/convblock.1/conv/Conv 1 1 /block4/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_1 /block4/convblock/convblock.1/conv/Conv_output_0 0=32 1=3 4=1 5=1 6=9216
BinaryOp /block4/convblock/convblock.1/Mul 2 1 /block4/convblock/convblock.1/conv/Conv_output_0 block4.convblock.1.beta /block4/convblock/convblock.1/Mul_output_0 0=2
BinaryOp /block4/convblock/convblock.1/Add 2 1 /block4/convblock/convblock.1/Mul_output_0 /block4/convblock/convblock.0/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.1/Add_output_0
ReLU /block4/convblock/convblock.1/relu/LeakyRelu 1 1 /block4/convblock/convblock.1/Add_output_0 /block4/convblock/convblock.1/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_47 1 2 /block4/convblock/convblock.1/relu/LeakyRelu_output_0 /block4/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block4/convblock/convblock.2/conv/Conv 1 1 /block4/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_1 /block4/convblock/convblock.2/conv/Conv_output_0 0=32 1=3 4=1 5=1 6=9216
BinaryOp /block4/convblock/convblock.2/Mul 2 1 /block4/convblock/convblock.2/conv/Conv_output_0 block4.convblock.2.beta /block4/convblock/convblock.2/Mul_output_0 0=2
BinaryOp /block4/convblock/convblock.2/Add 2 1 /block4/convblock/convblock.2/Mul_output_0 /block4/convblock/convblock.1/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.2/Add_output_0
ReLU /block4/convblock/convblock.2/relu/LeakyRelu 1 1 /block4/convblock/convblock.2/Add_output_0 /block4/convblock/convblock.2/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_48 1 2 /block4/convblock/convblock.2/relu/LeakyRelu_output_0 /block4/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block4/convblock/convblock.3/conv/Conv 1 1 /block4/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_1 /block4/convblock/convblock.3/conv/Conv_output_0 0=32 1=3 4=1 5=1 6=9216
BinaryOp /block4/convblock/convblock.3/Mul 2 1 /block4/convblock/convblock.3/conv/Conv_output_0 block4.convblock.3.beta /block4/convblock/convblock.3/Mul_output_0 0=2
BinaryOp /block4/convblock/convblock.3/Add 2 1 /block4/convblock/convblock.3/Mul_output_0 /block4/convblock/convblock.2/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.3/Add_output_0
ReLU /block4/convblock/convblock.3/relu/LeakyRelu 1 1 /block4/convblock/convblock.3/Add_output_0 /block4/convblock/convblock.3/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_49 1 2 /block4/convblock/convblock.3/relu/LeakyRelu_output_0 /block4/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block4/convblock/convblock.4/conv/Conv 1 1 /block4/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_1 /block4/convblock/convblock.4/conv/Conv_output_0 0=32 1=3 4=1 5=1 6=9216
BinaryOp /block4/convblock/convblock.4/Mul 2 1 /block4/convblock/convblock.4/conv/Conv_output_0 block4.convblock.4.beta /block4/convblock/convblock.4/Mul_output_0 0=2
BinaryOp /block4/convblock/convblock.4/Add 2 1 /block4/convblock/convblock.4/Mul_output_0 /block4/convblock/convblock.3/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.4/Add_output_0
ReLU /block4/convblock/convblock.4/relu/LeakyRelu 1 1 /block4/convblock/convblock.4/Add_output_0 /block4/convblock/convblock.4/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_50 1 2 /block4/convblock/convblock.4/relu/LeakyRelu_output_0 /block4/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block4/convblock/convblock.5/conv/Conv 1 1 /block4/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_1 /block4/convblock/convblock.5/conv/Conv_output_0 0=32 1=3 4=1 5=1 6=9216
BinaryOp /block4/convblock/convblock.5/Mul 2 1 /block4/convblock/convblock.5/conv/Conv_output_0 block4.convblock.5.beta /block4/convblock/convblock.5/Mul_output_0 0=2
BinaryOp /block4/convblock/convblock.5/Add 2 1 /block4/convblock/convblock.5/Mul_output_0 /block4/convblock/convblock.4/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.5/Add_output_0
ReLU /block4/convblock/convblock.5/relu/LeakyRelu 1 1 /block4/convblock/convblock.5/Add_output_0 /block4/convblock/convblock.5/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_51 1 2 /block4/convblock/convblock.5/relu/LeakyRelu_output_0 /block4/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block4/convblock/convblock.6/conv/Conv 1 1 /block4/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_1 /block4/convblock/convblock.6/conv/Conv_output_0 0=32 1=3 4=1 5=1 6=9216
BinaryOp /block4/convblock/convblock.6/Mul 2 1 /block4/convblock/convblock.6/conv/Conv_output_0 block4.convblock.6.beta /block4/convblock/convblock.6/Mul_output_0 0=2
BinaryOp /block4/convblock/convblock.6/Add 2 1 /block4/convblock/convblock.6/Mul_output_0 /block4/convblock/convblock.5/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.6/Add_output_0
ReLU /block4/convblock/convblock.6/relu/LeakyRelu 1 1 /block4/convblock/convblock.6/Add_output_0 /block4/convblock/convblock.6/relu/LeakyRelu_output_0 0=2.000000e-01
Split splitncnn_52 1 2 /block4/convblock/convblock.6/relu/LeakyRelu_output_0 /block4/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1
Convolution /block4/convblock/convblock.7/conv/Conv 1 1 /block4/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_1 /block4/convblock/convblock.7/conv/Conv_output_0 0=32 1=3 4=1 5=1 6=9216
BinaryOp /block4/convblock/convblock.7/Mul 2 1 /block4/convblock/convblock.7/conv/Conv_output_0 block4.convblock.7.beta /block4/convblock/convblock.7/Mul_output_0 0=2
BinaryOp /block4/convblock/convblock.7/Add 2 1 /block4/convblock/convblock.7/Mul_output_0 /block4/convblock/convblock.6/relu/LeakyRelu_output_0_splitncnn_0 /block4/convblock/convblock.7/Add_output_0
ReLU /block4/convblock/convblock.7/relu/LeakyRelu 1 1 /block4/convblock/convblock.7/Add_output_0 /block4/convblock/convblock.7/relu/LeakyRelu_output_0 0=2.000000e-01
Deconvolution /block4/lastconv/lastconv.0/ConvTranspose 1 1 /block4/convblock/convblock.7/relu/LeakyRelu_output_0 /block4/lastconv/lastconv.0/ConvTranspose_output_0 0=52 1=4 3=2 4=1 5=1 6=26624
PixelShuffle /block4/lastconv/lastconv.1/DepthToSpace 1 1 /block4/lastconv/lastconv.0/ConvTranspose_output_0 /block4/lastconv/lastconv.1/DepthToSpace_output_0 0=2
Interp /block4/Resize_2 1 1 /block4/lastconv/lastconv.1/DepthToSpace_output_0 /block4/Resize_2_output_0 0=2
Split splitncnn_53 1 2 /block4/Resize_2_output_0 /block4/Resize_2_output_0_splitncnn_0 /block4/Resize_2_output_0_splitncnn_1
Crop /block4/Slice 1 1 /block4/Resize_2_output_0_splitncnn_1 /block4/Slice_output_0 -23309=1,0 -23310=1,4 -23311=1,0
Crop /block4/Slice_1 1 1 /block4/Resize_2_output_0_splitncnn_0 /block4/Slice_1_output_0 -23309=1,4 -23310=1,5 -23311=1,0
BinaryOp /Add_4 2 1 /Add_3_output_0_splitncnn_0 /block4/Slice_output_0 /Add_4_output_0
Split splitncnn_54 1 2 /Add_4_output_0 /Add_4_output_0_splitncnn_0 /Add_4_output_0_splitncnn_1
Crop /Slice_27 1 1 /Add_4_output_0_splitncnn_1 /Slice_27_output_0 -23309=1,0 -23310=1,2 -23311=1,0
rife.Warp /warp_16 2 1 in0_splitncnn_0 /Slice_27_output_0 /warp_16_output_0 0=6
Crop /Slice_28 1 1 /Add_4_output_0_splitncnn_0 /Slice_28_output_0 -23309=1,2 -23310=1,4 -23311=1,0
rife.Warp /warp_17 2 1 in1_splitncnn_0 /Slice_28_output_0 /warp_17_output_0 0=6
Sigmoid /Sigmoid 1 1 /block4/Slice_1_output_0 /Sigmoid_output_0
Split splitncnn_55 1 2 /Sigmoid_output_0 /Sigmoid_output_0_splitncnn_0 /Sigmoid_output_0_splitncnn_1
BinaryOp /Mul_2 2 1 /warp_16_output_0 /Sigmoid_output_0_splitncnn_1 /Mul_2_output_0 0=2
BinaryOp /Sub 1 1 /Sigmoid_output_0_splitncnn_0 /Sub_output_0 0=7 1=1 2=1.000000e+00
BinaryOp /Mul_3 2 1 /warp_17_output_0 /Sub_output_0 /Mul_3_output_0 0=2
BinaryOp /Add_5 2 1 /Mul_2_output_0 /Mul_3_output_0 out0

View File

@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Video2X
Comment=A machine learning-based video super resolution and frame interpolation framework
TryExec=video2x
Exec=video2x
Icon=video2x
Type=Application
Terminal=true
Categories=AudioVideo;Video;Qt

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -1,23 +1,25 @@
pkgname=video2x
pkgver=r874.66c623f
pkgname=video2x-git
pkgver=6.0.0
pkgrel=1
pkgdesc="A machine learning-based lossless video super resolution framework"
pkgdesc="A machine learning-based video super resolution and frame interpolation framework"
arch=('x86_64')
url="https://github.com/k4yt3x/video2x"
license=('AGPL3')
depends=('ffmpeg' 'ncnn' 'vulkan-driver' 'spdlog' 'boost-libs')
makedepends=('git' 'cmake' 'make' 'clang' 'pkgconf' 'vulkan-headers' 'openmp' 'boost')
license=('AGPL-3.0-only')
depends=('ffmpeg' 'ncnn' 'openmp' 'vulkan-driver' 'spdlog' 'boost-libs')
makedepends=('git' 'cmake' 'clang' 'vulkan-headers' 'boost')
pkgver() {
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}
prepare() {
git rm ../third_party/{ncnn,spdlog,boost}
git submodule update --init --recursive
}
build() {
cmake -B build -S .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
cmake -B build -S .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_CXX_COMPILER=clang++ -DVIDEO2X_ENABLE_X86_64_V3=ON
cmake --build build --config Release --parallel
}

View File

@@ -1,5 +1,5 @@
Package: video2x
Version: 6.1.1
Version: 6.3.1
Section: video
Priority: optional
Architecture: amd64

View File

@@ -1,5 +1,5 @@
Package: video2x
Version: 6.1.1
Version: 6.3.1
Section: video
Priority: optional
Architecture: amd64

View File

@@ -1,7 +1,7 @@
# Name: Video2X Dockerfile
# Creator: K4YT3X
# Date Created: February 3, 2022
# Last Modified: November 1, 2024
# Last Modified: December 23, 2024
# stage 1: build the python components into wheels
FROM docker.io/archlinux:latest AS builder
@@ -17,11 +17,11 @@ RUN pacman -Syy --noconfirm \
# Switch to the non-root user and copy the source code
USER builder
COPY --chown=builder:builder . /video2x
COPY --chown=builder:builder packaging/arch/PKGBUILD /video2x/PKGBUILD
WORKDIR /video2x
# Build the package
RUN cp packaging/arch/PKGBUILD . \
&& makepkg -s --noconfirm \
RUN makepkg -s --noconfirm \
&& find /video2x -maxdepth 1 -name 'video2x-*.pkg.tar.zst' ! -name '*-debug-*' | head -n 1 | \
xargs -I {} cp {} /tmp/video2x.pkg.tar.zst
@@ -38,7 +38,7 @@ ENV VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json\
COPY --from=builder /tmp/video2x.pkg.tar.zst /video2x.pkg.tar.zst
RUN pacman -Sy --noconfirm nvidia-utils vulkan-radeon vulkan-intel vulkan-swrast \
ffmpeg ncnn spdlog boost-libs \
ffmpeg ncnn openmp spdlog boost-libs \
&& pacman -U --noconfirm /video2x.pkg.tar.zst \
&& rm -rf /video2x.pkg.tar.zst /var/cache/pacman/pkg/*

View File

@@ -15,7 +15,7 @@ extern "C" {
namespace video2x {
namespace avutils {
AVRational get_video_frame_rate(AVFormatContext *ifmt_ctx, int in_vstream_idx) {
AVRational get_video_frame_rate(AVFormatContext* ifmt_ctx, int in_vstream_idx) {
AVRational frame_rate = ifmt_ctx->streams[in_vstream_idx]->avg_frame_rate;
if (frame_rate.num == 0 && frame_rate.den == 0) {
frame_rate = ifmt_ctx->streams[in_vstream_idx]->r_frame_rate;
@@ -27,19 +27,19 @@ AVRational get_video_frame_rate(AVFormatContext *ifmt_ctx, int in_vstream_idx) {
frame_rate = ifmt_ctx->streams[in_vstream_idx]->time_base;
}
if (frame_rate.num == 0 && frame_rate.den == 0) {
spdlog::warn("Unable to determine the video's frame rate");
logger()->warn("Unable to determine the video's frame rate");
}
return frame_rate;
}
int64_t get_video_frame_count(AVFormatContext *ifmt_ctx, int in_vstream_idx) {
int64_t get_video_frame_count(AVFormatContext* ifmt_ctx, int in_vstream_idx) {
// Use the 'nb_frames' field if it is available
int64_t nb_frames = ifmt_ctx->streams[in_vstream_idx]->nb_frames;
if (nb_frames != AV_NOPTS_VALUE && nb_frames > 0) {
spdlog::debug("Read total number of frames from 'nb_frames': {}", nb_frames);
logger()->debug("Read total number of frames from 'nb_frames': {}", nb_frames);
return nb_frames;
}
spdlog::warn("Estimating the total number of frames using duration * fps");
logger()->warn("Estimating the total number of frames using duration * fps");
// Get the duration of the video
double duration_secs = 0.0;
@@ -50,32 +50,32 @@ int64_t get_video_frame_count(AVFormatContext *ifmt_ctx, int in_vstream_idx) {
av_q2d(ifmt_ctx->streams[in_vstream_idx]->time_base);
}
if (duration_secs <= 0) {
spdlog::warn("Unable to determine the video's duration");
logger()->warn("Unable to determine the video's duration");
return -1;
}
spdlog::debug("Video duration: {}s", duration_secs);
logger()->debug("Video duration: {}s", duration_secs);
// Calculate average FPS
double fps = av_q2d(get_video_frame_rate(ifmt_ctx, in_vstream_idx));
if (fps <= 0) {
spdlog::warn("Unable to estimate the video's average frame rate");
logger()->warn("Unable to estimate the video's average frame rate");
return -1;
}
spdlog::debug("Video average frame rate: {}", fps);
logger()->debug("Video average frame rate: {}", fps);
// Estimate and return the total number of frames
return static_cast<int64_t>(duration_secs * fps);
}
AVPixelFormat get_encoder_default_pix_fmt(const AVCodec *encoder, AVPixelFormat target_pix_fmt) {
AVPixelFormat get_encoder_default_pix_fmt(const AVCodec* encoder, AVPixelFormat target_pix_fmt) {
int ret;
char errbuf[AV_ERROR_MAX_STRING_SIZE];
// Retrieve the list of supported pixel formats
#if LIBAVCODEC_BUILD >= AV_VERSION_INT(61, 13, 100)
const AVPixelFormat *supported_pix_fmts = nullptr;
const AVPixelFormat* supported_pix_fmts = nullptr;
ret = avcodec_get_supported_config(
nullptr, encoder, AV_CODEC_CONFIG_PIX_FORMAT, 0, (const void **)&supported_pix_fmts, nullptr
nullptr, encoder, AV_CODEC_CONFIG_PIX_FORMAT, 0, (const void**)&supported_pix_fmts, nullptr
);
if (ret < 0) {
av_strerror(ret, errbuf, sizeof(errbuf));
@@ -85,19 +85,20 @@ AVPixelFormat get_encoder_default_pix_fmt(const AVCodec *encoder, AVPixelFormat
if (supported_pix_fmts == nullptr) {
if (target_pix_fmt == AV_PIX_FMT_NONE) {
spdlog::warn("Encoder supports all pixel formats; defaulting to yuv420p");
logger()->warn("Encoder supports all pixel formats; defaulting to yuv420p");
return AV_PIX_FMT_YUV420P;
} else {
spdlog::warn("Encoder supports all pixel formats; defaulting to the decoder's format");
logger()->warn("Encoder supports all pixel formats; defaulting to the decoder's format"
);
return target_pix_fmt;
}
}
#else
const AVPixelFormat *supported_pix_fmts = encoder->pix_fmts;
const AVPixelFormat* supported_pix_fmts = encoder->pix_fmts;
#endif
// Determine if the target pixel format has an alpha channel
const AVPixFmtDescriptor *desc = nullptr;
const AVPixFmtDescriptor* desc = nullptr;
int has_alpha = 0;
if (target_pix_fmt != AV_PIX_FMT_NONE) {
desc = av_pix_fmt_desc_get(target_pix_fmt);
@@ -106,7 +107,7 @@ AVPixelFormat get_encoder_default_pix_fmt(const AVCodec *encoder, AVPixelFormat
// Iterate over supported pixel formats to find the best match
AVPixelFormat best_pix_fmt = AV_PIX_FMT_NONE;
for (const AVPixelFormat *p = supported_pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
for (const AVPixelFormat* p = supported_pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
if (target_pix_fmt != AV_PIX_FMT_NONE) {
best_pix_fmt =
av_find_best_pix_fmt_of_2(best_pix_fmt, *p, target_pix_fmt, has_alpha, nullptr);
@@ -124,7 +125,7 @@ AVPixelFormat get_encoder_default_pix_fmt(const AVCodec *encoder, AVPixelFormat
}
if (target_pix_fmt != AV_PIX_FMT_NONE && best_pix_fmt != target_pix_fmt) {
spdlog::warn(
logger()->warn(
"Incompatible pixel format '%s' for encoder '%s'; auto-selecting format '%s'",
av_get_pix_fmt_name(target_pix_fmt),
encoder->name,
@@ -135,7 +136,8 @@ AVPixelFormat get_encoder_default_pix_fmt(const AVCodec *encoder, AVPixelFormat
return best_pix_fmt;
}
float get_frame_diff(AVFrame *frame1, AVFrame *frame2) {
[[gnu::target_clones("arch=x86-64-v4", "arch=x86-64-v3", "default")]]
float get_frame_diff(AVFrame* frame1, AVFrame* frame2) {
if (!frame1 || !frame2) {
logger()->error("Invalid frame(s) provided for comparison");
return -1.0f;
@@ -151,8 +153,8 @@ float get_frame_diff(AVFrame *frame1, AVFrame *frame2) {
// Convert both frames to the target pixel format using the provided function
AVPixelFormat target_pix_fmt = AV_PIX_FMT_RGB24;
AVFrame *rgb_frame1 = conversions::convert_avframe_pix_fmt(frame1, target_pix_fmt);
AVFrame *rgb_frame2 = conversions::convert_avframe_pix_fmt(frame2, target_pix_fmt);
AVFrame* rgb_frame1 = conversions::convert_avframe_pix_fmt(frame1, target_pix_fmt);
AVFrame* rgb_frame2 = conversions::convert_avframe_pix_fmt(frame2, target_pix_fmt);
if (!rgb_frame1 || !rgb_frame2) {
logger()->error("Failed to convert frames to target pixel format");
@@ -170,8 +172,8 @@ float get_frame_diff(AVFrame *frame1, AVFrame *frame2) {
// Calculate difference pixel by pixel
for (int y = 0; y < height; y++) {
uint8_t *ptr1 = rgb_frame1->data[0] + y * rgb_frame1->linesize[0];
uint8_t *ptr2 = rgb_frame2->data[0] + y * rgb_frame2->linesize[0];
uint8_t* ptr1 = rgb_frame1->data[0] + y * rgb_frame1->linesize[0];
uint8_t* ptr2 = rgb_frame2->data[0] + y * rgb_frame2->linesize[0];
for (int x = 0; x < width * 3; x++) {
sum_diff +=
static_cast<uint64_t>(ptr1[x] > ptr2[x] ? ptr1[x] - ptr2[x] : ptr2[x] - ptr1[x]);
@@ -190,14 +192,14 @@ float get_frame_diff(AVFrame *frame1, AVFrame *frame2) {
}
// Deleter for AVBufferRef unique_ptr
void av_bufferref_deleter(AVBufferRef *bufferref) {
void av_bufferref_deleter(AVBufferRef* bufferref) {
if (bufferref != nullptr) {
av_buffer_unref(&bufferref);
}
}
// Deleter for AVFrame unique_ptr
void av_frame_deleter(AVFrame *frame) {
void av_frame_deleter(AVFrame* frame) {
if (frame != nullptr) {
av_frame_free(&frame);
frame = nullptr;
@@ -205,7 +207,7 @@ void av_frame_deleter(AVFrame *frame) {
}
// Deleter for AVPacket unique_ptr
void av_packet_deleter(AVPacket *packet) {
void av_packet_deleter(AVPacket* packet) {
if (packet != nullptr) {
av_packet_unref(packet);
av_packet_free(&packet);

View File

@@ -11,8 +11,9 @@ namespace video2x {
namespace conversions {
// Convert AVFrame format
AVFrame *convert_avframe_pix_fmt(AVFrame *src_frame, AVPixelFormat pix_fmt) {
AVFrame *dst_frame = av_frame_alloc();
[[gnu::target_clones("arch=x86-64-v4", "arch=x86-64-v3", "default")]]
AVFrame* convert_avframe_pix_fmt(AVFrame* src_frame, AVPixelFormat pix_fmt) {
AVFrame* dst_frame = av_frame_alloc();
if (dst_frame == nullptr) {
logger()->error("Failed to allocate destination AVFrame.");
return nullptr;
@@ -30,7 +31,7 @@ AVFrame *convert_avframe_pix_fmt(AVFrame *src_frame, AVPixelFormat pix_fmt) {
}
// Create a SwsContext for pixel format conversion
SwsContext *sws_ctx = sws_getContext(
SwsContext* sws_ctx = sws_getContext(
src_frame->width,
src_frame->height,
static_cast<AVPixelFormat>(src_frame->format),
@@ -67,8 +68,9 @@ AVFrame *convert_avframe_pix_fmt(AVFrame *src_frame, AVPixelFormat pix_fmt) {
}
// Convert AVFrame to ncnn::Mat by copying the data
ncnn::Mat avframe_to_ncnn_mat(AVFrame *frame) {
AVFrame *converted_frame = nullptr;
[[gnu::target_clones("arch=x86-64-v4", "arch=x86-64-v3", "default")]]
ncnn::Mat avframe_to_ncnn_mat(AVFrame* frame) {
AVFrame* converted_frame = nullptr;
// Convert to BGR24 format if necessary
if (frame->format != AV_PIX_FMT_BGR24) {
@@ -88,10 +90,10 @@ ncnn::Mat avframe_to_ncnn_mat(AVFrame *frame) {
ncnn::Mat ncnn_image = ncnn::Mat(width, height, static_cast<size_t>(3), 3);
// Manually copy the pixel data from AVFrame to the new ncnn::Mat
const uint8_t *src_data = converted_frame->data[0];
const uint8_t* src_data = converted_frame->data[0];
for (int y = 0; y < height; y++) {
uint8_t *dst_row = ncnn_image.row<uint8_t>(y);
const uint8_t *src_row = src_data + y * converted_frame->linesize[0];
uint8_t* dst_row = ncnn_image.row<uint8_t>(y);
const uint8_t* src_row = src_data + y * converted_frame->linesize[0];
// Copy 3 channels (BGR) per pixel
memcpy(dst_row, src_row, static_cast<size_t>(width) * 3);
@@ -106,11 +108,12 @@ ncnn::Mat avframe_to_ncnn_mat(AVFrame *frame) {
}
// Convert ncnn::Mat to AVFrame with a specified pixel format (this part is unchanged)
AVFrame *ncnn_mat_to_avframe(const ncnn::Mat &mat, AVPixelFormat pix_fmt) {
[[gnu::target_clones("arch=x86-64-v4", "arch=x86-64-v3", "default")]]
AVFrame* ncnn_mat_to_avframe(const ncnn::Mat& mat, AVPixelFormat pix_fmt) {
int ret;
// Step 1: Allocate a destination AVFrame for the specified pixel format
AVFrame *dst_frame = av_frame_alloc();
AVFrame* dst_frame = av_frame_alloc();
if (!dst_frame) {
logger()->error("Failed to allocate destination AVFrame.");
return nullptr;
@@ -128,7 +131,7 @@ AVFrame *ncnn_mat_to_avframe(const ncnn::Mat &mat, AVPixelFormat pix_fmt) {
}
// Step 2: Convert ncnn::Mat to BGR AVFrame
AVFrame *bgr_frame = av_frame_alloc();
AVFrame* bgr_frame = av_frame_alloc();
if (!bgr_frame) {
logger()->error("Failed to allocate intermediate BGR AVFrame.");
av_frame_free(&dst_frame);
@@ -149,15 +152,15 @@ AVFrame *ncnn_mat_to_avframe(const ncnn::Mat &mat, AVPixelFormat pix_fmt) {
// Copy the pixel data from ncnn::Mat to the BGR AVFrame
for (int y = 0; y < mat.h; y++) {
uint8_t *dst_row = bgr_frame->data[0] + y * bgr_frame->linesize[0];
const uint8_t *src_row = mat.row<const uint8_t>(y);
uint8_t* dst_row = bgr_frame->data[0] + y * bgr_frame->linesize[0];
const uint8_t* src_row = mat.row<const uint8_t>(y);
// Copy 3 channels (BGR) per pixel
memcpy(dst_row, src_row, static_cast<size_t>(mat.w) * 3);
}
// Step 3: Convert the BGR frame to the desired pixel format
SwsContext *sws_ctx = sws_getContext(
SwsContext* sws_ctx = sws_getContext(
bgr_frame->width,
bgr_frame->height,
AV_PIX_FMT_BGR24,

View File

@@ -22,8 +22,8 @@ Decoder::~Decoder() {
}
}
AVPixelFormat Decoder::get_hw_format(AVCodecContext *_, const AVPixelFormat *pix_fmts) {
for (const AVPixelFormat *p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
AVPixelFormat Decoder::get_hw_format(AVCodecContext*, const AVPixelFormat* pix_fmts) {
for (const AVPixelFormat* p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
if (*p == hw_pix_fmt_) {
return *p;
}
@@ -34,8 +34,8 @@ AVPixelFormat Decoder::get_hw_format(AVCodecContext *_, const AVPixelFormat *pix
int Decoder::init(
AVHWDeviceType hw_type,
AVBufferRef *hw_ctx,
const std::filesystem::path &in_fpath
AVBufferRef* hw_ctx,
const std::filesystem::path& in_fpath
) {
int ret;
@@ -59,10 +59,10 @@ int Decoder::init(
}
int stream_index = ret;
AVStream *video_stream = fmt_ctx_->streams[stream_index];
AVStream* video_stream = fmt_ctx_->streams[stream_index];
// Find the decoder for the video stream
const AVCodec *decoder = avcodec_find_decoder(video_stream->codecpar->codec_id);
const AVCodec* decoder = avcodec_find_decoder(video_stream->codecpar->codec_id);
if (!decoder) {
logger()->error(
"Failed to find decoder for codec ID {}",
@@ -96,7 +96,7 @@ int Decoder::init(
// Automatically determine the hardware pixel format
for (int i = 0;; i++) {
const AVCodecHWConfig *config = avcodec_get_hw_config(decoder, i);
const AVCodecHWConfig* config = avcodec_get_hw_config(decoder, i);
if (config == nullptr) {
logger()->error(
"Decoder {} does not support device type {}.",
@@ -124,11 +124,11 @@ int Decoder::init(
return 0;
}
AVFormatContext *Decoder::get_format_context() const {
AVFormatContext* Decoder::get_format_context() const {
return fmt_ctx_;
}
AVCodecContext *Decoder::get_codec_context() const {
AVCodecContext* Decoder::get_codec_context() const {
return dec_ctx_;
}

View File

@@ -6,10 +6,9 @@ extern "C" {
#include <libavutil/opt.h>
}
#include "logger_manager.h"
#include "avutils.h"
#include "conversions.h"
#include "logger_manager.h"
namespace video2x {
namespace encoder {
@@ -33,11 +32,11 @@ Encoder::~Encoder() {
}
int Encoder::init(
AVBufferRef *hw_ctx,
const std::filesystem::path &out_fpath,
AVFormatContext *ifmt_ctx,
AVCodecContext *dec_ctx,
EncoderConfig &enc_cfg,
AVBufferRef* hw_ctx,
const std::filesystem::path& out_fpath,
AVFormatContext* ifmt_ctx,
AVCodecContext* dec_ctx,
EncoderConfig& enc_cfg,
int width,
int height,
int frm_rate_mul,
@@ -45,6 +44,9 @@ int Encoder::init(
) {
int ret;
// Copy the encoder configuration
enc_cfg_ = enc_cfg;
// Allocate the output format context
avformat_alloc_output_context2(&ofmt_ctx_, nullptr, nullptr, out_fpath.u8string().c_str());
if (!ofmt_ctx_) {
@@ -53,16 +55,14 @@ int Encoder::init(
}
// Find the encoder
const AVCodec *encoder = avcodec_find_encoder(enc_cfg.codec);
const AVCodec* encoder = avcodec_find_encoder_by_name(enc_cfg.codec.c_str());
if (!encoder) {
logger()->error(
"Required video encoder not found for codec {}", avcodec_get_name(enc_cfg.codec)
);
logger()->error("Could not find encoder '{}'", enc_cfg.codec);
return AVERROR_ENCODER_NOT_FOUND;
}
// Create a new video stream in the output file
AVStream *out_vstream = avformat_new_stream(ofmt_ctx_, nullptr);
AVStream* out_vstream = avformat_new_stream(ofmt_ctx_, nullptr);
if (!out_vstream) {
logger()->error("Failed to allocate the output video stream");
return AVERROR_UNKNOWN;
@@ -126,7 +126,7 @@ int Encoder::init(
logger()->error("Could not get the default pixel format for the encoder");
return AVERROR(EINVAL);
}
spdlog::debug("Auto-selected pixel format: {}", av_get_pix_fmt_name(enc_ctx_->pix_fmt));
logger()->debug("Auto-selected pixel format: {}", av_get_pix_fmt_name(enc_ctx_->pix_fmt));
}
if (frm_rate_mul > 0) {
@@ -150,13 +150,18 @@ int Encoder::init(
}
// Set extra AVOptions
for (const auto &[opt_name, opt_value] : enc_cfg.extra_opts) {
std::string opt_name_str = fsutils::wstring_to_u8string(opt_name);
std::string opt_value_str = fsutils::wstring_to_u8string(opt_value);
spdlog::debug("Setting encoder option '{}' to '{}'", opt_name_str, opt_value_str);
for (const auto& [opt_name, opt_value] : enc_cfg.extra_opts) {
std::string opt_name_str = opt_name;
std::string opt_value_str = opt_value;
logger()->debug("Setting encoder option '{}' to '{}'", opt_name_str, opt_value_str);
if (av_opt_set(enc_ctx_->priv_data, opt_name_str.c_str(), opt_value_str.c_str(), 0) < 0) {
spdlog::warn("Failed to set encoder option '{}' to '{}'", opt_name_str, opt_value_str);
ret = av_opt_set(enc_ctx_->priv_data, opt_name_str.c_str(), opt_value_str.c_str(), 0);
if (ret < 0) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
av_strerror(ret, errbuf, sizeof(errbuf));
logger()->warn(
"Failed to set encoder option '{}' to '{}': {}", opt_name_str, opt_value_str, errbuf
);
}
}
@@ -166,7 +171,8 @@ int Encoder::init(
}
// Open the encoder
if ((ret = avcodec_open2(enc_ctx_, encoder, nullptr)) < 0) {
ret = avcodec_open2(enc_ctx_, encoder, nullptr);
if (ret < 0) {
logger()->error("Cannot open video encoder");
return ret;
}
@@ -178,47 +184,63 @@ int Encoder::init(
return ret;
}
// Copy time base and frame rate from the encoder context
out_vstream->time_base = enc_ctx_->time_base;
out_vstream->avg_frame_rate = enc_ctx_->framerate;
out_vstream->r_frame_rate = enc_ctx_->framerate;
// Copy other streams if necessary
if (enc_cfg.copy_streams) {
// Allocate the stream mape frame o
if (enc_cfg.copy_audio_streams || enc_cfg.copy_subtitle_streams) {
// Allocate the stream map
stream_map_ =
reinterpret_cast<int *>(av_malloc_array(ifmt_ctx->nb_streams, sizeof(*stream_map_)));
reinterpret_cast<int*>(av_malloc_array(ifmt_ctx->nb_streams, sizeof(*stream_map_)));
if (!stream_map_) {
logger()->error("Could not allocate stream mapping");
return AVERROR(ENOMEM);
}
// Map each input stream to an output stream
for (int i = 0; i < static_cast<int>(ifmt_ctx->nb_streams); i++) {
AVStream *in_stream = ifmt_ctx->streams[i];
AVCodecParameters *in_codecpar = in_stream->codecpar;
for (int stream_index = 0; stream_index < static_cast<int>(ifmt_ctx->nb_streams);
stream_index++) {
AVStream* in_stream = ifmt_ctx->streams[stream_index];
AVCodecParameters* in_codecpar = in_stream->codecpar;
// Skip the input video stream as it's already processed
if (i == in_vstream_idx) {
stream_map_[i] = out_vstream_idx_;
if (stream_index == in_vstream_idx) {
stream_map_[stream_index] = out_vstream_idx_;
continue;
}
// Map only audio and subtitle streams (skip other types)
if (in_codecpar->codec_type != AVMEDIA_TYPE_AUDIO &&
in_codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE) {
stream_map_[i] = -1;
spdlog::warn("Skipping unsupported stream type at index: {}", i);
continue;
// Determine if the current stream should be skipped
switch (in_codecpar->codec_type) {
case AVMEDIA_TYPE_AUDIO:
if (!enc_cfg.copy_audio_streams) {
stream_map_[stream_index] = -1;
continue;
}
logger()->debug("Copying audio stream at index: {}", stream_index);
break;
case AVMEDIA_TYPE_SUBTITLE:
if (!enc_cfg.copy_subtitle_streams) {
stream_map_[stream_index] = -1;
continue;
}
logger()->debug("Copying subtitle stream at index: {}", stream_index);
break;
default:
stream_map_[stream_index] = -1;
logger()->warn("Skipping unsupported stream type at index: {}", stream_index);
continue;
}
// Create corresponding output stream for audio and subtitle streams
AVStream *out_stream = avformat_new_stream(ofmt_ctx_, nullptr);
AVStream* out_stream = avformat_new_stream(ofmt_ctx_, nullptr);
if (!out_stream) {
logger()->error("Failed allocating output stream");
return AVERROR_UNKNOWN;
}
// Copy codec parameters from input to output
// Copy codec parameters from the input stream to the output stream
ret = avcodec_parameters_copy(out_stream->codecpar, in_codecpar);
if (ret < 0) {
logger()->error("Failed to copy codec parameters");
@@ -226,12 +248,19 @@ int Encoder::init(
}
out_stream->codecpar->codec_tag = 0;
// Copy all metadata from the input stream to the output stream
AVDictionaryEntry* tag = nullptr;
while ((tag = av_dict_get(in_stream->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)) !=
nullptr) {
av_dict_set(&out_stream->metadata, tag->key, tag->value, 0);
}
// Copy time base
out_stream->time_base = in_stream->time_base;
// Map input stream index to output stream index
spdlog::debug("Stream mapping: {} (in) -> {} (out)", i, out_stream->index);
stream_map_[i] = out_stream->index;
logger()->debug("Stream mapping: {} (in) -> {} (out)", stream_index, out_stream->index);
stream_map_[stream_index] = out_stream->index;
}
}
@@ -254,16 +283,18 @@ int Encoder::init(
return 0;
}
int Encoder::write_frame(AVFrame *frame, int64_t frame_idx) {
AVFrame *converted_frame = nullptr;
[[gnu::target_clones("arch=x86-64-v4", "arch=x86-64-v3", "default")]]
int Encoder::write_frame(AVFrame* frame, int64_t frame_idx) {
AVFrame* converted_frame = nullptr;
int ret;
// Let the encoder decide the frame type
frame->pict_type = AV_PICTURE_TYPE_NONE;
// Calculate this frame's presentation timestamp (PTS)
frame->pts = frame_idx * (enc_ctx_->time_base.den * enc_ctx_->framerate.den /
(enc_ctx_->time_base.num * enc_ctx_->framerate.num));
if (enc_cfg_.recalculate_pts) {
frame->pts = av_rescale_q(frame_idx, av_inv_q(enc_ctx_->framerate), enc_ctx_->time_base);
}
// Convert the frame to the encoder's pixel format if needed
if (frame->format != enc_ctx_->pix_fmt) {
@@ -275,7 +306,7 @@ int Encoder::write_frame(AVFrame *frame, int64_t frame_idx) {
converted_frame->pts = frame->pts;
}
AVPacket *enc_pkt = av_packet_alloc();
AVPacket* enc_pkt = av_packet_alloc();
if (!enc_pkt) {
logger()->error("Could not allocate AVPacket");
return AVERROR(ENOMEM);
@@ -326,9 +357,10 @@ int Encoder::write_frame(AVFrame *frame, int64_t frame_idx) {
return 0;
}
[[gnu::target_clones("arch=x86-64-v4", "arch=x86-64-v3", "default")]]
int Encoder::flush() {
int ret;
AVPacket *enc_pkt = av_packet_alloc();
AVPacket* enc_pkt = av_packet_alloc();
if (!enc_pkt) {
logger()->error("Could not allocate AVPacket");
return AVERROR(ENOMEM);
@@ -374,11 +406,11 @@ int Encoder::flush() {
return 0;
}
AVCodecContext *Encoder::get_encoder_context() const {
AVCodecContext* Encoder::get_encoder_context() const {
return enc_ctx_;
}
AVFormatContext *Encoder::get_format_context() const {
AVFormatContext* Encoder::get_format_context() const {
return ofmt_ctx_;
}
@@ -386,7 +418,7 @@ int Encoder::get_output_video_stream_index() const {
return out_vstream_idx_;
}
int *Encoder::get_stream_map() const {
int* Encoder::get_stream_map() const {
return stream_map_;
}

View File

@@ -1,7 +1,5 @@
#include "filter_libplacebo.h"
#include <cstdio>
#include <spdlog/spdlog.h>
#include "fsutils.h"
@@ -13,7 +11,7 @@ namespace processors {
FilterLibplacebo::FilterLibplacebo(
uint32_t vk_device_index,
const std::filesystem::path &shader_path,
const std::filesystem::path& shader_path,
int width,
int height
)
@@ -40,22 +38,22 @@ FilterLibplacebo::~FilterLibplacebo() {
}
}
int FilterLibplacebo::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *) {
int FilterLibplacebo::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {
// Construct the shader path
std::filesystem::path shader_full_path;
if (fsutils::filepath_is_readable(shader_path_)) {
std::optional<std::filesystem::path> shader_full_path = std::nullopt;
if (fsutils::file_is_readable(shader_path_)) {
// If the shader path is directly readable, use it
shader_full_path = shader_path_;
} else {
// Construct the fallback path using std::filesystem
shader_full_path = fsutils::find_resource_file(
shader_full_path = fsutils::find_resource(
std::filesystem::path(STR("models")) / STR("libplacebo") /
(fsutils::path_to_string_type(shader_path_) + STR(".glsl"))
);
}
// Check if the shader file exists
if (!std::filesystem::exists(shader_full_path)) {
if (!shader_full_path.has_value()) {
logger()->error("libplacebo shader file not found: '{}'", shader_path_.u8string());
return -1;
}
@@ -73,7 +71,7 @@ int FilterLibplacebo::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVB
width_,
height_,
vk_device_index_,
shader_full_path
shader_full_path.value()
);
// Set these resources to nullptr since they are already freed by `avfilter_graph_free`
@@ -85,7 +83,7 @@ int FilterLibplacebo::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVB
return ret;
}
int FilterLibplacebo::filter(AVFrame *in_frame, AVFrame **out_frame) {
int FilterLibplacebo::filter(AVFrame* in_frame, AVFrame** out_frame) {
int ret;
// Get the filtered frame
@@ -116,7 +114,7 @@ int FilterLibplacebo::filter(AVFrame *in_frame, AVFrame **out_frame) {
return 0;
}
int FilterLibplacebo::flush(std::vector<AVFrame *> &flushed_frames) {
int FilterLibplacebo::flush(std::vector<AVFrame*>& flushed_frames) {
int ret = av_buffersrc_add_frame(buffersrc_ctx_, nullptr);
if (ret < 0) {
logger()->error("Error while flushing filter graph");
@@ -125,7 +123,7 @@ int FilterLibplacebo::flush(std::vector<AVFrame *> &flushed_frames) {
// Retrieve all remaining frames from the filter graph
while (1) {
AVFrame *filt_frame = av_frame_alloc();
AVFrame* filt_frame = av_frame_alloc();
if (filt_frame == nullptr) {
return AVERROR(ENOMEM);
}
@@ -151,11 +149,11 @@ int FilterLibplacebo::flush(std::vector<AVFrame *> &flushed_frames) {
}
void FilterLibplacebo::get_output_dimensions(
const ProcessorConfig &proc_cfg,
const ProcessorConfig& proc_cfg,
int,
int,
int &out_width,
int &out_height
int& out_width,
int& out_height
) const {
out_width = proc_cfg.width;
out_height = proc_cfg.height;

View File

@@ -32,13 +32,11 @@ FilterRealcugan::FilterRealcugan(
model_name_(std::move(model_name)) {}
FilterRealcugan::~FilterRealcugan() {
if (realcugan_) {
delete realcugan_;
realcugan_ = nullptr;
}
delete realcugan_;
realcugan_ = nullptr;
}
int FilterRealcugan::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *) {
int FilterRealcugan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {
// Construct the model paths using std::filesystem
std::filesystem::path model_param_path;
std::filesystem::path model_bin_path;
@@ -68,20 +66,22 @@ int FilterRealcugan::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBu
std::filesystem::path(STR("models")) / STR("realcugan") / model_name_ / bin_file_name;
// Get the full paths using a function that possibly modifies or validates the path
std::filesystem::path model_param_full_path = fsutils::find_resource_file(model_param_path);
std::filesystem::path model_bin_full_path = fsutils::find_resource_file(model_bin_path);
std::optional<std::filesystem::path> model_param_full_path =
fsutils::find_resource(model_param_path);
std::optional<std::filesystem::path> model_bin_full_path =
fsutils::find_resource(model_bin_path);
// Check if the model files exist
if (!std::filesystem::exists(model_param_full_path)) {
logger()->error("RealCUGAN model param file not found: {}", model_param_path.u8string());
if (!model_param_full_path.has_value()) {
logger()->error("Real-CUGAN model param file not found: {}", model_param_path.u8string());
return -1;
}
if (!std::filesystem::exists(model_bin_full_path)) {
logger()->error("RealCUGAN model bin file not found: {}", model_bin_path.u8string());
if (!model_bin_full_path.has_value()) {
logger()->error("Real-CUGAN model bin file not found: {}", model_bin_path.u8string());
return -1;
}
// Create a new RealCUGAN instance
// Create a new Real-CUGAN instance
realcugan_ = new RealCUGAN(gpuid_, tta_mode_, num_threads_);
// Store the time bases
@@ -90,8 +90,8 @@ int FilterRealcugan::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBu
out_pix_fmt_ = enc_ctx->pix_fmt;
// Load the model
if (realcugan_->load(model_param_full_path, model_bin_full_path) != 0) {
logger()->error("Failed to load RealCUGAN model");
if (realcugan_->load(model_param_full_path.value(), model_bin_full_path.value()) != 0) {
logger()->error("Failed to load Real-CUGAN model");
return -1;
}
@@ -161,7 +161,7 @@ int FilterRealcugan::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBu
return 0;
}
int FilterRealcugan::filter(AVFrame *in_frame, AVFrame **out_frame) {
int FilterRealcugan::filter(AVFrame* in_frame, AVFrame** out_frame) {
int ret;
// Convert the input frame to RGB24
@@ -178,7 +178,7 @@ int FilterRealcugan::filter(AVFrame *in_frame, AVFrame **out_frame) {
ret = realcugan_->process(in_mat, out_mat);
if (ret != 0) {
logger()->error("RealCUGAN processing failed");
logger()->error("Real-CUGAN processing failed");
return ret;
}
@@ -193,11 +193,11 @@ int FilterRealcugan::filter(AVFrame *in_frame, AVFrame **out_frame) {
}
void FilterRealcugan::get_output_dimensions(
const ProcessorConfig &,
const ProcessorConfig&,
int in_width,
int in_height,
int &out_width,
int &out_height
int& out_width,
int& out_height
) const {
out_width = in_width * scaling_factor_;
out_height = in_height * scaling_factor_;

View File

@@ -17,50 +17,58 @@ FilterRealesrgan::FilterRealesrgan(
int gpuid,
bool tta_mode,
int scaling_factor,
int noise_level,
const fsutils::StringType model_name
)
: realesrgan_(nullptr),
gpuid_(gpuid),
tta_mode_(tta_mode),
scaling_factor_(scaling_factor),
noise_level_(noise_level),
model_name_(std::move(model_name)) {}
FilterRealesrgan::~FilterRealesrgan() {
if (realesrgan_) {
delete realesrgan_;
realesrgan_ = nullptr;
}
delete realesrgan_;
realesrgan_ = nullptr;
}
int FilterRealesrgan::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *) {
int FilterRealesrgan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {
// Construct the model paths using std::filesystem
std::filesystem::path model_param_path;
std::filesystem::path model_bin_path;
fsutils::StringType param_file_name =
model_name_ + STR("-x") + fsutils::to_string_type(scaling_factor_) + STR(".param");
fsutils::StringType bin_file_name =
model_name_ + STR("-x") + fsutils::to_string_type(scaling_factor_) + STR(".bin");
fsutils::StringType param_file_name = model_name_;
fsutils::StringType bin_file_name = model_name_;
if (model_name_ == STR("realesr-generalv3") && noise_level_ > 0) {
param_file_name += STR("-wdn");
bin_file_name += STR("-wdn");
}
param_file_name += STR("-x") + fsutils::to_string_type(scaling_factor_) + STR(".param");
bin_file_name += STR("-x") + fsutils::to_string_type(scaling_factor_) + STR(".bin");
// Find the model paths by model name if provided
model_param_path = std::filesystem::path(STR("models")) / STR("realesrgan") / param_file_name;
model_bin_path = std::filesystem::path(STR("models")) / STR("realesrgan") / bin_file_name;
// Get the full paths using a function that possibly modifies or validates the path
std::filesystem::path model_param_full_path = fsutils::find_resource_file(model_param_path);
std::filesystem::path model_bin_full_path = fsutils::find_resource_file(model_bin_path);
std::optional<std::filesystem::path> model_param_full_path =
fsutils::find_resource(model_param_path);
std::optional<std::filesystem::path> model_bin_full_path =
fsutils::find_resource(model_bin_path);
// Check if the model files exist
if (!std::filesystem::exists(model_param_full_path)) {
logger()->error("RealESRGAN model param file not found: {}", model_param_path.u8string());
if (!model_param_full_path.has_value()) {
logger()->error("Real-ESRGAN model param file not found: {}", model_param_path.u8string());
return -1;
}
if (!std::filesystem::exists(model_bin_full_path)) {
logger()->error("RealESRGAN model bin file not found: {}", model_bin_path.u8string());
if (!model_bin_full_path.has_value()) {
logger()->error("Real-ESRGAN model bin file not found: {}", model_bin_path.u8string());
return -1;
}
// Create a new RealESRGAN instance
// Create a new Real-ESRGAN instance
realesrgan_ = new RealESRGAN(gpuid_, tta_mode_);
// Store the time bases
@@ -69,12 +77,12 @@ int FilterRealesrgan::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVB
out_pix_fmt_ = enc_ctx->pix_fmt;
// Load the model
if (realesrgan_->load(model_param_full_path, model_bin_full_path) != 0) {
logger()->error("Failed to load RealESRGAN model");
if (realesrgan_->load(model_param_full_path.value(), model_bin_full_path.value()) != 0) {
logger()->error("Failed to load Real-ESRGAN model");
return -1;
}
// Set RealESRGAN parameters
// Set Real-ESRGAN parameters
realesrgan_->scale = scaling_factor_;
realesrgan_->prepadding = 10;
@@ -93,7 +101,7 @@ int FilterRealesrgan::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVB
return 0;
}
int FilterRealesrgan::filter(AVFrame *in_frame, AVFrame **out_frame) {
int FilterRealesrgan::filter(AVFrame* in_frame, AVFrame** out_frame) {
int ret;
// Convert the input frame to RGB24
@@ -110,7 +118,7 @@ int FilterRealesrgan::filter(AVFrame *in_frame, AVFrame **out_frame) {
ret = realesrgan_->process(in_mat, out_mat);
if (ret != 0) {
logger()->error("RealESRGAN processing failed");
logger()->error("Real-ESRGAN processing failed");
return ret;
}
@@ -125,11 +133,11 @@ int FilterRealesrgan::filter(AVFrame *in_frame, AVFrame **out_frame) {
}
void FilterRealesrgan::get_output_dimensions(
const ProcessorConfig &,
const ProcessorConfig&,
int in_width,
int in_height,
int &out_width,
int &out_height
int& out_width,
int& out_height
) const {
out_width = in_width * scaling_factor_;
out_height = in_height * scaling_factor_;

View File

@@ -20,7 +20,7 @@ static std::filesystem::path get_executable_directory() {
std::vector<wchar_t> filepath(MAX_PATH);
// Get the executable path, expanding the buffer if necessary
DWORD size = GetModuleFileNameW(NULL, filepath.data(), static_cast<DWORD>(filepath.size()));
DWORD size = GetModuleFileNameW(nullptr, filepath.data(), static_cast<DWORD>(filepath.size()));
if (size == 0) {
logger()->error("Error getting executable path: {}", GetLastError());
return std::filesystem::path();
@@ -29,7 +29,7 @@ static std::filesystem::path get_executable_directory() {
// Resize the buffer if necessary
while (size >= filepath.size()) {
filepath.resize(filepath.size() * 2);
size = GetModuleFileNameW(NULL, filepath.data(), static_cast<DWORD>(filepath.size()));
size = GetModuleFileNameW(nullptr, filepath.data(), static_cast<DWORD>(filepath.size()));
if (size == 0) {
logger()->error("Error getting executable path: {}", GetLastError());
return std::filesystem::path();
@@ -54,13 +54,13 @@ static std::filesystem::path get_executable_directory() {
}
#endif // _WIN32
bool filepath_is_readable(const std::filesystem::path &path) {
bool file_is_readable(const std::filesystem::path& path) {
#if _WIN32
FILE *fp = _wfopen(path.c_str(), L"rb");
#else // _WIN32
FILE *fp = fopen(path.c_str(), "rb");
#endif // _WIN32
if (!fp) {
FILE* fp = _wfopen(path.c_str(), L"rb");
#else
FILE* fp = fopen(path.c_str(), "rb");
#endif
if (fp == nullptr) {
return false;
}
@@ -68,19 +68,43 @@ bool filepath_is_readable(const std::filesystem::path &path) {
return true;
}
std::filesystem::path find_resource_file(const std::filesystem::path &path) {
if (filepath_is_readable(path)) {
return path;
std::optional<std::filesystem::path> find_resource(const std::filesystem::path& resource) {
// Build a list of candidate directories
std::vector<std::filesystem::path> candidates;
// 1. The resource's path as provided
candidates.push_back(resource);
#ifndef _WIN32
// 2. AppImage's mounted directory
if (const char* appdir = std::getenv("APPDIR")) {
candidates.push_back(
std::filesystem::path(appdir) / "usr" / "share" / "video2x" / resource
);
}
if (filepath_is_readable(std::filesystem::path("/usr/share/video2x/") / path)) {
return std::filesystem::path("/usr/share/video2x/") / path;
// 3. The Linux standard local data directory
candidates.push_back(std::filesystem::path("/usr/local/share/video2x") / resource);
// 4. The Linux standard data directory
candidates.push_back(std::filesystem::path("/usr/share/video2x") / resource);
#endif
// 5. The executable's parent directory
candidates.push_back(get_executable_directory() / resource);
// Iterate over the candidate directories and return the first readable file
for (const auto& candidate : candidates) {
if (file_is_readable(candidate) || std::filesystem::is_directory(candidate)) {
return candidate;
}
}
return get_executable_directory() / path;
// Return nullopt if the resource was not found
return std::nullopt;
}
std::string path_to_u8string(const std::filesystem::path &path) {
std::string path_to_u8string(const std::filesystem::path& path) {
#if _WIN32
std::wstring wide_path = path.wstring();
int buffer_size =
@@ -99,7 +123,7 @@ std::string path_to_u8string(const std::filesystem::path &path) {
}
#ifdef _WIN32
std::string wstring_to_u8string(const std::wstring &wstr) {
std::string wstring_to_u8string(const std::wstring& wstr) {
if (wstr.empty()) {
return std::string();
}
@@ -119,13 +143,13 @@ std::string wstring_to_u8string(const std::wstring &wstr) {
);
return converted_str;
}
#else
std::string wstring_to_u8string(const std::string &str) {
#else // _WIN32
std::string wstring_to_u8string(const std::string& str) {
return str;
}
#endif
#endif // _WIN32
fsutils::StringType path_to_string_type(const std::filesystem::path &path) {
fsutils::StringType path_to_string_type(const std::filesystem::path& path) {
#if _WIN32
return path.wstring();
#else

View File

@@ -29,45 +29,59 @@ InterpolatorRIFE::InterpolatorRIFE(
model_name_(std::move(model_name)) {}
InterpolatorRIFE::~InterpolatorRIFE() {
if (rife_) {
delete rife_;
rife_ = nullptr;
}
delete rife_;
rife_ = nullptr;
}
int InterpolatorRIFE::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *) {
int InterpolatorRIFE::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {
// Construct the model directory path using std::filesystem
std::filesystem::path model_param_dir;
// Find the model paths by model name if provided
model_param_dir = std::filesystem::path(STR("models")) / STR("rife") / model_name_;
std::filesystem::path model_dir =
std::filesystem::path(STR("models")) / STR("rife") / model_name_;
// Get the full paths using a function that possibly modifies or validates the path
std::filesystem::path model_param_full_path = fsutils::find_resource_file(model_param_dir);
std::optional<std::filesystem::path> model_dir_full_path = fsutils::find_resource(model_dir);
// Check if the model files exist
if (!std::filesystem::exists(model_param_full_path)) {
logger()->error("RIFE model param directory not found: {}", model_param_dir.u8string());
if (!model_dir_full_path.has_value()) {
logger()->error("RIFE model param directory not found: {}", model_dir.u8string());
return -1;
}
// Automatically infer the RIFE model generation based on the model name
bool rife_v2 = false;
bool rife_v4 = false;
int rife_padding = 32;
if (model_name_.find(STR("rife-v2")) != fsutils::StringType::npos) {
rife_v2 = true;
} else if (model_name_.find(STR("rife-v3")) != fsutils::StringType::npos) {
rife_v2 = true;
} else if (model_name_.find(STR("rife-v4")) != fsutils::StringType::npos) {
rife_v4 = true;
if (model_name_.find(STR("rife-v4.25")) != fsutils::StringType::npos) {
rife_padding = 64;
}
if (model_name_.find(STR("rife-v4.25-lite")) != fsutils::StringType::npos) {
rife_padding = 128;
}
if (model_name_.find(STR("rife-v4.26")) != fsutils::StringType::npos) {
rife_padding = 64;
}
} else if (model_name_.find(STR("rife")) == fsutils::StringType::npos) {
logger()->critical("Failed to infer RIFE model generation from model name");
return -1;
}
// Create a new RIFE instance
rife_ =
new RIFE(gpuid_, tta_mode_, tta_temporal_mode_, uhd_mode_, num_threads_, rife_v2, rife_v4);
rife_ = new RIFE(
gpuid_,
tta_mode_,
tta_temporal_mode_,
uhd_mode_,
num_threads_,
rife_v2,
rife_v4,
rife_padding
);
// Store the time bases
in_time_base_ = dec_ctx->time_base;
@@ -75,7 +89,7 @@ int InterpolatorRIFE::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVB
out_pix_fmt_ = enc_ctx->pix_fmt;
// Load the model
if (rife_->load(model_param_full_path) != 0) {
if (rife_->load(model_dir_full_path.value()) != 0) {
logger()->error("Failed to load RIFE model");
return -1;
}
@@ -84,9 +98,9 @@ int InterpolatorRIFE::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVB
}
int InterpolatorRIFE::interpolate(
AVFrame *prev_frame,
AVFrame *in_frame,
AVFrame **out_frame,
AVFrame* prev_frame,
AVFrame* in_frame,
AVFrame** out_frame,
float time_step
) {
int ret;
@@ -123,11 +137,11 @@ int InterpolatorRIFE::interpolate(
}
void InterpolatorRIFE::get_output_dimensions(
const ProcessorConfig &,
const ProcessorConfig&,
int in_width,
int in_height,
int &out_width,
int &out_height
int& out_width,
int& out_height
) const {
out_width = in_width;
out_height = in_height;

View File

@@ -1,6 +1,5 @@
#include "libplacebo.h"
#include <stdio.h>
#include <stdlib.h>
#include <string>
@@ -17,35 +16,39 @@ namespace video2x {
namespace processors {
int init_libplacebo(
AVFilterGraph **filter_graph,
AVFilterContext **buffersrc_ctx,
AVFilterContext **buffersink_ctx,
AVCodecContext *dec_ctx,
AVFilterGraph** filter_graph,
AVFilterContext** buffersrc_ctx,
AVFilterContext** buffersink_ctx,
AVCodecContext* dec_ctx,
int out_width,
int out_height,
uint32_t vk_device_index,
const std::filesystem::path &shader_path
const std::filesystem::path& shader_path
) {
int ret;
// Create the Vulkan hardware device context
AVBufferRef *vk_hw_device_ctx = nullptr;
AVBufferRef* vk_hw_device_ctx = nullptr;
ret = av_hwdevice_ctx_create(
&vk_hw_device_ctx, AV_HWDEVICE_TYPE_VULKAN, std::to_string(vk_device_index).c_str(), NULL, 0
&vk_hw_device_ctx,
AV_HWDEVICE_TYPE_VULKAN,
std::to_string(vk_device_index).c_str(),
nullptr,
0
);
if (ret < 0) {
logger()->error("Failed to create Vulkan hardware device context for libplacebo.");
vk_hw_device_ctx = nullptr;
}
AVFilterGraph *graph = avfilter_graph_alloc();
AVFilterGraph* graph = avfilter_graph_alloc();
if (!graph) {
logger()->error("Unable to create filter graph.");
return AVERROR(ENOMEM);
}
// Create buffer source
const AVFilter *buffersrc = avfilter_get_by_name("buffer");
const AVFilter* buffersrc = avfilter_get_by_name("buffer");
if (!buffersrc) {
logger()->error("Filter 'buffer' not found.");
avfilter_graph_free(&graph);
@@ -65,34 +68,35 @@ int init_libplacebo(
// Make a copy of the AVClass on the stack
AVClass priv_class_copy = *buffersrc->priv_class;
AVClass *priv_class_copy_ptr = &priv_class_copy;
AVClass* priv_class_copy_ptr = &priv_class_copy;
// Check if the colorspace option is supported
if (av_opt_find(&priv_class_copy_ptr, "colorspace", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)) {
if (av_opt_find(&priv_class_copy_ptr, "colorspace", nullptr, 0, AV_OPT_SEARCH_FAKE_OBJ)) {
args += ":colorspace=" + std::to_string(dec_ctx->colorspace);
} else {
spdlog::warn("Option 'colorspace' is not supported by the buffer filter.");
logger()->warn("Option 'colorspace' is not supported by the buffer filter.");
}
// Check if the range option is supported
if (av_opt_find(&priv_class_copy_ptr, "range", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)) {
if (av_opt_find(&priv_class_copy_ptr, "range", nullptr, 0, AV_OPT_SEARCH_FAKE_OBJ)) {
args += ":range=" + std::to_string(dec_ctx->color_range);
} else {
spdlog::warn("Option 'range' is not supported by the buffer filter.");
logger()->warn("Option 'range' is not supported by the buffer filter.");
}
spdlog::debug("Buffer source args: {}", args);
ret = avfilter_graph_create_filter(buffersrc_ctx, buffersrc, "in", args.c_str(), NULL, graph);
logger()->debug("Buffer source args: {}", args);
ret =
avfilter_graph_create_filter(buffersrc_ctx, buffersrc, "in", args.c_str(), nullptr, graph);
if (ret < 0) {
logger()->error("Cannot create buffer source.");
avfilter_graph_free(&graph);
return ret;
}
AVFilterContext *last_filter = *buffersrc_ctx;
AVFilterContext* last_filter = *buffersrc_ctx;
// Create the libplacebo filter
const AVFilter *libplacebo_filter = avfilter_get_by_name("libplacebo");
const AVFilter* libplacebo_filter = avfilter_get_by_name("libplacebo");
if (!libplacebo_filter) {
logger()->error("Filter 'libplacebo' not found.");
avfilter_graph_free(&graph);
@@ -112,9 +116,9 @@ int init_libplacebo(
":h=" + std::to_string(out_height) + ":custom_shader_path='" +
shader_path_string + "'";
AVFilterContext *libplacebo_ctx;
AVFilterContext* libplacebo_ctx;
ret = avfilter_graph_create_filter(
&libplacebo_ctx, libplacebo_filter, "libplacebo", filter_args.c_str(), NULL, graph
&libplacebo_ctx, libplacebo_filter, "libplacebo", filter_args.c_str(), nullptr, graph
);
if (ret < 0) {
logger()->error("Cannot create libplacebo filter.");
@@ -139,8 +143,8 @@ int init_libplacebo(
last_filter = libplacebo_ctx;
// Create buffer sink
const AVFilter *buffersink = avfilter_get_by_name("buffersink");
ret = avfilter_graph_create_filter(buffersink_ctx, buffersink, "out", NULL, NULL, graph);
const AVFilter* buffersink = avfilter_get_by_name("buffersink");
ret = avfilter_graph_create_filter(buffersink_ctx, buffersink, "out", nullptr, nullptr, graph);
if (ret < 0) {
logger()->error("Cannot create buffer sink.");
avfilter_graph_free(&graph);
@@ -156,7 +160,7 @@ int init_libplacebo(
}
// Configure the filter graph
ret = avfilter_graph_config(graph, NULL);
ret = avfilter_graph_config(graph, nullptr);
if (ret < 0) {
logger()->error("Error configuring the filter graph.");
avfilter_graph_free(&graph);

View File

@@ -28,6 +28,7 @@ VideoProcessor::VideoProcessor(
hw_device_type_(hw_device_type),
benchmark_(benchmark) {}
[[gnu::target_clones("arch=x86-64-v4", "arch=x86-64-v3", "default")]]
int VideoProcessor::process(
const std::filesystem::path in_fname,
const std::filesystem::path out_fname
@@ -35,7 +36,7 @@ int VideoProcessor::process(
int ret = 0;
// Helper lambda to handle errors:
auto handle_error = [&](int error_code, const std::string &msg) {
auto handle_error = [&](int error_code, const std::string& msg) {
// Format and log the error message
char errbuf[AV_ERROR_MAX_STRING_SIZE];
av_strerror(error_code, errbuf, sizeof(errbuf));
@@ -56,8 +57,8 @@ int VideoProcessor::process(
// Initialize hardware device context
if (hw_device_type_ != AV_HWDEVICE_TYPE_NONE) {
AVBufferRef *tmp_hw_ctx = nullptr;
ret = av_hwdevice_ctx_create(&tmp_hw_ctx, hw_device_type_, NULL, NULL, 0);
AVBufferRef* tmp_hw_ctx = nullptr;
ret = av_hwdevice_ctx_create(&tmp_hw_ctx, hw_device_type_, nullptr, nullptr, 0);
if (ret < 0) {
return handle_error(ret, "Error initializing hardware device context");
}
@@ -71,8 +72,8 @@ int VideoProcessor::process(
return handle_error(ret, "Failed to initialize decoder");
}
AVFormatContext *ifmt_ctx = decoder.get_format_context();
AVCodecContext *dec_ctx = decoder.get_codec_context();
AVFormatContext* ifmt_ctx = decoder.get_format_context();
AVCodecContext* dec_ctx = decoder.get_codec_context();
int in_vstream_idx = decoder.get_video_stream_index();
// Create and initialize the appropriate filter
@@ -139,19 +140,20 @@ int VideoProcessor::process(
// Process frames using the selected filter.
int VideoProcessor::process_frames(
decoder::Decoder &decoder,
encoder::Encoder &encoder,
std::unique_ptr<processors::Processor> &processor
decoder::Decoder& decoder,
encoder::Encoder& encoder,
std::unique_ptr<processors::Processor>& processor
) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
int ret = 0;
// Get required objects
AVFormatContext *ifmt_ctx = decoder.get_format_context();
AVCodecContext *dec_ctx = decoder.get_codec_context();
AVFormatContext* ifmt_ctx = decoder.get_format_context();
AVCodecContext* dec_ctx = decoder.get_codec_context();
int in_vstream_idx = decoder.get_video_stream_index();
AVFormatContext *ofmt_ctx = encoder.get_format_context();
int *stream_map = encoder.get_stream_map();
AVFormatContext* ofmt_ctx = encoder.get_format_context();
AVCodecContext* enc_ctx = encoder.get_encoder_context();
int* stream_map = encoder.get_stream_map();
// Reference to the previous frame does not require allocation
// It will be cloned from the current frame
@@ -178,14 +180,14 @@ int VideoProcessor::process_frames(
}
// Set the total number of frames in the VideoProcessingContext
spdlog::debug("Estimating the total number of frames to process");
logger()->debug("Estimating the total number of frames to process");
total_frames_ = avutils::get_video_frame_count(ifmt_ctx, in_vstream_idx);
if (total_frames_ <= 0) {
spdlog::warn("Unable to determine the total number of frames");
logger()->warn("Unable to determine the total number of frames");
total_frames_ = 0;
} else {
spdlog::debug("{} frames to process", total_frames_.load());
logger()->debug("{} frames to process", total_frames_.load());
}
// Set total frames for interpolation
@@ -198,7 +200,7 @@ int VideoProcessor::process_frames(
ret = av_read_frame(ifmt_ctx, packet.get());
if (ret < 0) {
if (ret == AVERROR_EOF) {
spdlog::debug("Reached end of file");
logger()->debug("Reached end of file");
break;
}
av_strerror(ret, errbuf, sizeof(errbuf));
@@ -234,8 +236,14 @@ int VideoProcessor::process_frames(
return ret;
}
// Calculate this frame's presentation timestamp (PTS)
if (enc_cfg_.recalculate_pts) {
frame->pts =
av_rescale_q(frame_idx_, av_inv_q(enc_ctx->framerate), enc_ctx->time_base);
}
// Process the frame based on the selected processing mode
AVFrame *proc_frame = nullptr;
AVFrame* proc_frame = nullptr;
switch (processor->get_processing_mode()) {
case processors::ProcessingMode::Filter: {
ret = process_filtering(processor, encoder, frame.get(), proc_frame);
@@ -255,10 +263,11 @@ int VideoProcessor::process_frames(
return ret;
}
av_frame_unref(frame.get());
frame_idx_++;
spdlog::debug("Processed frame {}/{}", frame_idx_.load(), total_frames_.load());
frame_idx_.fetch_add(1);
logger()->debug("Processed frame {}/{}", frame_idx_.load(), total_frames_.load());
}
} else if (enc_cfg_.copy_streams && stream_map[packet->stream_index] >= 0) {
} else if ((enc_cfg_.copy_audio_streams || enc_cfg_.copy_subtitle_streams) &&
stream_map[packet->stream_index] >= 0) {
ret = write_raw_packet(packet.get(), ifmt_ctx, ofmt_ctx, stream_map);
if (ret < 0) {
return ret;
@@ -267,28 +276,28 @@ int VideoProcessor::process_frames(
av_packet_unref(packet.get());
}
// Flush the filter
std::vector<AVFrame *> raw_flushed_frames;
// Flush the processor
std::vector<AVFrame*> raw_flushed_frames;
ret = processor->flush(raw_flushed_frames);
if (ret < 0) {
av_strerror(ret, errbuf, sizeof(errbuf));
logger()->critical("Error flushing filter: {}", errbuf);
logger()->critical("Error flushing processor: {}", errbuf);
return ret;
}
// Wrap flushed frames in unique_ptrs
std::vector<std::unique_ptr<AVFrame, decltype(&avutils::av_frame_deleter)>> flushed_frames;
for (AVFrame *raw_frame : raw_flushed_frames) {
for (AVFrame* raw_frame : raw_flushed_frames) {
flushed_frames.emplace_back(raw_frame, &avutils::av_frame_deleter);
}
// Encode and write all flushed frames
for (auto &flushed_frame : flushed_frames) {
for (auto& flushed_frame : flushed_frames) {
ret = write_frame(flushed_frame.get(), encoder);
if (ret < 0) {
return ret;
}
frame_idx_++;
frame_idx_.fetch_add(1);
}
// Flush the encoder
@@ -302,12 +311,12 @@ int VideoProcessor::process_frames(
return ret;
}
int VideoProcessor::write_frame(AVFrame *frame, encoder::Encoder &encoder) {
int VideoProcessor::write_frame(AVFrame* frame, encoder::Encoder& encoder) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
int ret = 0;
if (!benchmark_) {
ret = encoder.write_frame(frame, frame_idx_);
ret = encoder.write_frame(frame, frame_idx_.load());
if (ret < 0) {
av_strerror(ret, errbuf, sizeof(errbuf));
logger()->critical("Error encoding/writing frame: {}", errbuf);
@@ -317,17 +326,17 @@ int VideoProcessor::write_frame(AVFrame *frame, encoder::Encoder &encoder) {
}
int VideoProcessor::write_raw_packet(
AVPacket *packet,
AVFormatContext *ifmt_ctx,
AVFormatContext *ofmt_ctx,
int *stream_map
AVPacket* packet,
AVFormatContext* ifmt_ctx,
AVFormatContext* ofmt_ctx,
int* stream_map
) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
int ret = 0;
AVStream *in_stream = ifmt_ctx->streams[packet->stream_index];
AVStream* in_stream = ifmt_ctx->streams[packet->stream_index];
int out_stream_idx = stream_map[packet->stream_index];
AVStream *out_stream = ofmt_ctx->streams[out_stream_idx];
AVStream* out_stream = ofmt_ctx->streams[out_stream_idx];
av_packet_rescale_ts(packet, in_stream->time_base, out_stream->time_base);
packet->stream_index = out_stream_idx;
@@ -341,16 +350,16 @@ int VideoProcessor::write_raw_packet(
}
int VideoProcessor::process_filtering(
std::unique_ptr<processors::Processor> &processor,
encoder::Encoder &encoder,
AVFrame *frame,
AVFrame *proc_frame
std::unique_ptr<processors::Processor>& processor,
encoder::Encoder& encoder,
AVFrame* frame,
AVFrame* proc_frame
) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
int ret = 0;
// Cast the processor to a Filter
processors::Filter *filter = static_cast<processors::Filter *>(processor.get());
processors::Filter* filter = static_cast<processors::Filter*>(processor.get());
// Process the frame using the filter
ret = filter->filter(frame, &proc_frame);
@@ -369,18 +378,18 @@ int VideoProcessor::process_filtering(
}
int VideoProcessor::process_interpolation(
std::unique_ptr<processors::Processor> &processor,
encoder::Encoder &encoder,
std::unique_ptr<AVFrame, decltype(&avutils::av_frame_deleter)> &prev_frame,
AVFrame *frame,
AVFrame *proc_frame
std::unique_ptr<processors::Processor>& processor,
encoder::Encoder& encoder,
std::unique_ptr<AVFrame, decltype(&avutils::av_frame_deleter)>& prev_frame,
AVFrame* frame,
AVFrame* proc_frame
) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
int ret = 0;
// Cast the processor to an Interpolator
processors::Interpolator *interpolator =
static_cast<processors::Interpolator *>(processor.get());
processors::Interpolator* interpolator =
static_cast<processors::Interpolator*>(processor.get());
// Calculate the time step for each frame
float time_step = 1.0f / static_cast<float>(proc_cfg_.frm_rate_mul);
@@ -391,7 +400,7 @@ int VideoProcessor::process_interpolation(
if (proc_cfg_.scn_det_thresh < 100.0 && prev_frame.get() != nullptr) {
float frame_diff = avutils::get_frame_diff(prev_frame.get(), frame);
if (frame_diff > proc_cfg_.scn_det_thresh) {
spdlog::debug(
logger()->debug(
"Scene change detected ({:.2f}%), skipping frame {}", frame_diff, frame_idx_.load()
);
skip_frame = true;
@@ -430,7 +439,7 @@ int VideoProcessor::process_interpolation(
}
}
frame_idx_++;
frame_idx_.fetch_add(1);
current_time_step += time_step;
}

View File

@@ -26,7 +26,7 @@ static spdlog::level::level_enum ffmpeg_level_to_spdlog(int av_level) {
}
}
static void ffmpeg_log_callback(void *avcl, int level, const char *fmt, va_list vargs) {
static void ffmpeg_log_callback(void* avcl, int level, const char* fmt, va_list vargs) {
// Format the message the same way as the default callback
char line[1024];
int print_prefix = 1;
@@ -53,7 +53,7 @@ LoggerManager::LoggerManager() {
spdlog::register_logger(logger_);
}
LoggerManager &LoggerManager::instance() {
LoggerManager& LoggerManager::instance() {
static LoggerManager instance;
return instance;
}
@@ -63,9 +63,9 @@ std::shared_ptr<spdlog::logger> LoggerManager::logger() {
}
bool LoggerManager::reconfigure_logger(
const std::string &logger_name,
const std::vector<spdlog::sink_ptr> &sinks,
const std::string &pattern
const std::string& logger_name,
const std::vector<spdlog::sink_ptr>& sinks,
const std::string& pattern
) {
if (logger_name.empty() || sinks.empty()) {
return false;
@@ -94,7 +94,7 @@ bool LoggerManager::reconfigure_logger(
return true;
}
bool LoggerManager::set_log_level(const std::string &level_str) {
bool LoggerManager::set_log_level(const std::string& level_str) {
spdlog::level::level_enum log_level = spdlog::level::from_str(level_str);
if (log_level == spdlog::level::off && level_str != "off") {
// Invalid level_str

View File

@@ -13,7 +13,7 @@ namespace video2x {
namespace processors {
// Access the singleton instance
ProcessorFactory &ProcessorFactory::instance() {
ProcessorFactory& ProcessorFactory::instance() {
static ProcessorFactory factory;
// Ensure default processors are registered only once
@@ -33,7 +33,7 @@ void ProcessorFactory::register_processor(ProcessorType type, Creator creator) {
// Create a processor instance
std::unique_ptr<Processor> ProcessorFactory::create_processor(
const ProcessorConfig &proc_cfg,
const ProcessorConfig& proc_cfg,
uint32_t vk_device_index
) const {
auto it = creators.find(proc_cfg.processor_type);
@@ -49,12 +49,12 @@ std::unique_ptr<Processor> ProcessorFactory::create_processor(
}
// Initialize default processors
void ProcessorFactory::init_default_processors(ProcessorFactory &factory) {
void ProcessorFactory::init_default_processors(ProcessorFactory& factory) {
factory.register_processor(
ProcessorType::Libplacebo,
[](const ProcessorConfig &proc_cfg,
[](const ProcessorConfig& proc_cfg,
uint32_t vk_device_index) -> std::unique_ptr<Processor> {
const auto &config = std::get<LibplaceboConfig>(proc_cfg.config);
const auto& config = std::get<LibplaceboConfig>(proc_cfg.config);
if (config.shader_path.empty()) {
logger()->critical("Shader path must be provided for the libplacebo filter");
return nullptr;
@@ -76,9 +76,9 @@ void ProcessorFactory::init_default_processors(ProcessorFactory &factory) {
factory.register_processor(
ProcessorType::RealESRGAN,
[](const ProcessorConfig &proc_cfg,
[](const ProcessorConfig& proc_cfg,
uint32_t vk_device_index) -> std::unique_ptr<Processor> {
const auto &config = std::get<RealESRGANConfig>(proc_cfg.config);
const auto& config = std::get<RealESRGANConfig>(proc_cfg.config);
if (proc_cfg.scaling_factor <= 0) {
logger()->critical("Scaling factor must be provided for the RealESRGAN filter");
return nullptr;
@@ -91,6 +91,7 @@ void ProcessorFactory::init_default_processors(ProcessorFactory &factory) {
static_cast<int>(vk_device_index),
config.tta_mode,
proc_cfg.scaling_factor,
proc_cfg.noise_level,
config.model_name
);
}
@@ -98,9 +99,9 @@ void ProcessorFactory::init_default_processors(ProcessorFactory &factory) {
factory.register_processor(
ProcessorType::RealCUGAN,
[](const ProcessorConfig &proc_cfg,
[](const ProcessorConfig& proc_cfg,
uint32_t vk_device_index) -> std::unique_ptr<Processor> {
const auto &config = std::get<RealCUGANConfig>(proc_cfg.config);
const auto& config = std::get<RealCUGANConfig>(proc_cfg.config);
if (proc_cfg.scaling_factor <= 0) {
logger()->critical("Scaling factor must be provided for the RealCUGAN filter");
return nullptr;
@@ -123,9 +124,9 @@ void ProcessorFactory::init_default_processors(ProcessorFactory &factory) {
factory.register_processor(
ProcessorType::RIFE,
[](const ProcessorConfig &proc_cfg,
[](const ProcessorConfig& proc_cfg,
uint32_t vk_device_index) -> std::unique_ptr<Processor> {
const auto &cfg = std::get<RIFEConfig>(proc_cfg.config);
const auto& cfg = std::get<RIFEConfig>(proc_cfg.config);
if (cfg.model_name.empty()) {
logger()->critical("Model name must be provided for the RIFE filter");
return nullptr;

View File

@@ -16,11 +16,11 @@ struct Arguments {
[[nodiscard]] int parse_args(
int argc,
#ifdef _WIN32
wchar_t *argv[],
wchar_t* argv[],
#else
char *argv[],
char* argv[],
#endif
Arguments &arguments,
video2x::processors::ProcessorConfig &proc_cfg,
video2x::encoder::EncoderConfig &enc_cfg
Arguments& arguments,
video2x::processors::ProcessorConfig& proc_cfg,
video2x::encoder::EncoderConfig& enc_cfg
);

View File

@@ -9,10 +9,10 @@ class newline_safe_sink : public spdlog::sinks::ansicolor_stdout_sink_mt {
newline_safe_sink() = default;
~newline_safe_sink() = default;
newline_safe_sink(const newline_safe_sink &) = delete;
newline_safe_sink &operator=(const newline_safe_sink &) = delete;
newline_safe_sink(const newline_safe_sink&) = delete;
newline_safe_sink& operator=(const newline_safe_sink&) = delete;
void log(const spdlog::details::log_msg &msg);
void log(const spdlog::details::log_msg& msg);
void set_needs_newline(bool needs_newline) { needs_newline_.store(needs_newline); };
bool get_needs_newline() { return needs_newline_.load(); };

View File

@@ -6,7 +6,7 @@
namespace po = boost::program_options;
template <typename T>
void validate_positive(const T &value, const std::string &option_name) {
void validate_positive(const T& value, const std::string& option_name) {
if (value < 0) {
throw po::validation_error(
po::validation_error::invalid_option_value,
@@ -17,7 +17,7 @@ void validate_positive(const T &value, const std::string &option_name) {
}
template <typename T>
void validate_min(const T &value, const std::string &option_name, const T &min) {
void validate_min(const T& value, const std::string& option_name, const T& min) {
if (value < min) {
throw po::validation_error(
po::validation_error::invalid_option_value,
@@ -28,7 +28,7 @@ void validate_min(const T &value, const std::string &option_name, const T &min)
}
template <typename T>
void validate_max(const T &value, const std::string &option_name, const T &max) {
void validate_max(const T& value, const std::string& option_name, const T& max) {
if (value > max) {
throw po::validation_error(
po::validation_error::invalid_option_value,
@@ -39,7 +39,7 @@ void validate_max(const T &value, const std::string &option_name, const T &max)
}
template <typename T>
void validate_range(const T &value, const std::string &option_name, const T &min, const T &max) {
void validate_range(const T& value, const std::string& option_name, const T& min, const T& max) {
if (value < min || value > max) {
throw po::validation_error(
po::validation_error::invalid_option_value,
@@ -51,7 +51,7 @@ void validate_range(const T &value, const std::string &option_name, const T &min
}
template <typename T>
void validate_greater_equal_one(const T &value, const std::string &option_name) {
void validate_greater_equal_one(const T& value, const std::string& option_name) {
if (value < 1) {
throw po::validation_error(
po::validation_error::invalid_option_value,
@@ -61,10 +61,10 @@ void validate_greater_equal_one(const T &value, const std::string &option_name)
}
}
void validate_anime4k_shader_name(const video2x::fsutils::StringType &shader_name);
void validate_anime4k_shader_name(const video2x::fsutils::StringType& shader_name);
void validate_realesrgan_model_name(const video2x::fsutils::StringType &model_name);
void validate_realesrgan_model_name(const video2x::fsutils::StringType& model_name);
void validate_realcugan_model_name(const video2x::fsutils::StringType &model_name);
void validate_realcugan_model_name(const video2x::fsutils::StringType& model_name);
void validate_rife_model_name(const video2x::fsutils::StringType &model_name);
void validate_rife_model_name(const video2x::fsutils::StringType& model_name);

View File

@@ -4,4 +4,4 @@
int list_vulkan_devices();
int get_vulkan_device_prop(uint32_t vk_device_index, VkPhysicalDeviceProperties *dev_props);
int get_vulkan_device_prop(uint32_t vk_device_index, VkPhysicalDeviceProperties* dev_props);

View File

@@ -25,7 +25,7 @@
namespace po = boost::program_options;
#ifdef _WIN32
std::string wstring_to_u8string(const std::wstring &wstr) {
std::string wstring_to_u8string(const std::wstring& wstr) {
if (wstr.empty()) {
return std::string();
}
@@ -46,7 +46,7 @@ std::string wstring_to_u8string(const std::wstring &wstr) {
return converted_str;
}
#else
std::string wstring_to_u8string(const std::string &str) {
std::string wstring_to_u8string(const std::string& str) {
return str;
}
#endif
@@ -54,13 +54,13 @@ std::string wstring_to_u8string(const std::string &str) {
int parse_args(
int argc,
#ifdef _WIN32
wchar_t *argv[],
wchar_t* argv[],
#else
char *argv[],
char* argv[],
#endif
Arguments &arguments,
video2x::processors::ProcessorConfig &proc_cfg,
video2x::encoder::EncoderConfig &enc_cfg
Arguments& arguments,
video2x::processors::ProcessorConfig& proc_cfg,
video2x::encoder::EncoderConfig& enc_cfg
) {
try {
// clang-format off
@@ -76,9 +76,11 @@ int parse_args(
("list-devices,l", "List the available Vulkan devices (GPUs)")
// General Processing Options
("input,i", PO_STR_VALUE<video2x::fsutils::StringType>(), "Input video file path")
("output,o", PO_STR_VALUE<video2x::fsutils::StringType>(), "Output video file path")
("processor,p", PO_STR_VALUE<video2x::fsutils::StringType>(),
("input,i", PO_STR_VALUE<video2x::fsutils::StringType>()->required(),
"Input video file path")
("output,o", PO_STR_VALUE<video2x::fsutils::StringType>()->required(),
"Output video file path")
("processor,p", PO_STR_VALUE<video2x::fsutils::StringType>()->required(),
"Processor to use (libplacebo, realesrgan, realcugan, rife)")
("hwaccel,a", PO_STR_VALUE<video2x::fsutils::StringType>()
->default_value(STR("none"), "none"), "Hardware acceleration method (decoding)")
@@ -93,7 +95,9 @@ int parse_args(
encoder_opts.add_options()
("codec,c", PO_STR_VALUE<video2x::fsutils::StringType>()
->default_value(STR("libx264"), "libx264"), "Output codec")
("no-copy-streams", "Do not copy audio and subtitle streams")
("no-recalculate-pts", "Do not recalculate presentation timestamps")
("no-copy-audio-streams", "Do not copy audio streams")
("no-copy-subtitle-streams", "Do not copy subtitle streams")
("pix-fmt", PO_STR_VALUE<video2x::fsutils::StringType>(), "Output pixel format")
("bit-rate", po::value<int64_t>(&enc_cfg.bit_rate)->default_value(0),
"Bitrate in bits per second")
@@ -132,7 +136,7 @@ int parse_args(
("scaling-factor,s", po::value<int>(&proc_cfg.scaling_factor)
->notifier([](int v) { validate_min(v, "scaling-factor", 2); }), "Scaling factor")
("noise-level,n", po::value<int>(&proc_cfg.noise_level)
->notifier([](int v) { validate_min(v, "noise-level", 0); }), "Noise level")
->notifier([](int v) { validate_min(v, "noise-level", -1); }), "Noise level")
;
po::options_description interp_opts("Frame interpolation options");
@@ -154,23 +158,23 @@ int parse_args(
"anime4k-v4-b, anime4k-v4-b+b, anime4k-v4-c, anime4k-v4-c+a, anime4k-v4.1-gan)")
;
po::options_description realesrgan_opts("RealESRGAN options");
po::options_description realesrgan_opts("Real-ESRGAN options");
realesrgan_opts.add_options()
("realesrgan-model", PO_STR_VALUE<video2x::fsutils::StringType>()
->default_value(STR("realesr-animevideov3"), "realesr-animevideov3")
->notifier(validate_realesrgan_model_name),
"Name of the RealESRGAN model to use (realesr-animevideov3, realesrgan-plus-anime, "
"realesrgan-plus)")
"Name of the Real-ESRGAN model to use (realesr-animevideov3, "
"realesrgan-plus-anime, realesrgan-plus, realesr-generalv3)")
;
po::options_description realcugan_opts("RealCUGAN options");
po::options_description realcugan_opts("Real-CUGAN options");
realcugan_opts.add_options()
("realcugan-model", PO_STR_VALUE<video2x::fsutils::StringType>()
->default_value(STR("models-se"), "models-se")
->notifier(validate_realcugan_model_name),
"Name of the RealCUGAN model to use (models-nose, models-pro, models-se)")
"Name of the Real-CUGAN model to use (models-nose, models-pro, models-se)")
("realcugan-threads", po::value<int>()->default_value(1),
"Number of threads to use for RealCUGAN")
"Number of threads to use for Real-CUGAN")
("realcugan-syncgap", po::value<int>()->default_value(3),
"Sync gap mode; 0:no sync, 1: accurate sync: 2 = rough sync, 3: very rough sync")
;
@@ -180,7 +184,8 @@ int parse_args(
("rife-model", PO_STR_VALUE<video2x::fsutils::StringType>()
->default_value(STR("rife-v4.6"), "rife-v4.6")->notifier(validate_rife_model_name),
"Name of the RIFE model to use (rife, rife-HD, rife-UHD, rife-anime, rife-v2, "
"rife-v2.3, rife-v2.4, rife-v3.0, rife-v3.1, rife-v4, rife-v4.6)")
"rife-v2.3, rife-v2.4, rife-v3.0, rife-v3.1, rife-v4, rife-v4.6, rife-v4.25, "
"rife-v4.25-lite, rife-v4.26)")
("rife-uhd", "Enable Ultra HD mode")
;
// clang-format on
@@ -200,7 +205,6 @@ int parse_args(
#else
po::store(po::command_line_parser(argc, argv).options(all_opts).run(), vm);
#endif
po::notify(vm);
if (vm.count("help") || argc == 1) {
std::cout
@@ -210,7 +214,7 @@ int parse_args(
<< " video2x -i input.mp4 -o output.mp4 -w 3840 -h 2160 \\" << std::endl
<< " -p libplacebo --libplacebo-shader anime4k-v4-a+a" << std::endl
<< std::endl
<< " Upscale a film by 4x using RealESRGAN with custom encoder options:"
<< " Upscale a film by 4x using Real-ESRGAN with custom encoder options:"
<< std::endl
<< " video2x -i input.mkv -o output.mkv -s 4 \\" << std::endl
<< " -p realesrgan --realesrgan-model realesrgan-plus \\" << std::endl
@@ -235,6 +239,9 @@ int parse_args(
return 1;
}
// Run all notify functions and validations
po::notify(vm);
if (vm.count("log-level")) {
if (!video2x::logger_manager::LoggerManager::instance().set_log_level(
wstring_to_u8string(vm["log-level"].as<video2x::fsutils::StringType>())
@@ -307,22 +314,21 @@ int parse_args(
}
// Parse codec to AVCodec
enc_cfg.codec = AV_CODEC_ID_H264;
enc_cfg.codec = "libx264";
if (vm.count("codec")) {
video2x::fsutils::StringType codec_str = vm["codec"].as<video2x::fsutils::StringType>();
const AVCodec *codec =
avcodec_find_encoder_by_name(wstring_to_u8string(codec_str).c_str());
if (codec == nullptr) {
video2x::logger()->critical(
"Codec '{}' not found.", wstring_to_u8string(codec_str)
);
std::string codec_str =
wstring_to_u8string(vm["codec"].as<video2x::fsutils::StringType>());
if (avcodec_find_encoder_by_name(codec_str.c_str()) == nullptr) {
video2x::logger()->critical("Invalid encoder '{}'.", codec_str);
return -1;
}
enc_cfg.codec = codec->id;
enc_cfg.codec = codec_str;
}
// Parse copy streams flag
enc_cfg.copy_streams = vm.count("no-copy-streams") == 0;
// Parse copy streams options
enc_cfg.recalculate_pts = vm.count("no-recalculate-pts") == 0;
enc_cfg.copy_audio_streams = vm.count("no-copy-audio-streams") == 0;
enc_cfg.copy_subtitle_streams = vm.count("no-copy-subtitle-streams") == 0;
// Parse pixel format to AVPixelFormat
enc_cfg.pix_fmt = AV_PIX_FMT_NONE;
@@ -342,13 +348,15 @@ int parse_args(
// Parse extra AVOptions
if (vm.count("extra-encoder-option")) {
for (const auto &opt :
for (const auto& opt :
vm["extra-encoder-option"].as<std::vector<video2x::fsutils::StringType>>()) {
size_t eq_pos = opt.find('=');
if (eq_pos != video2x::fsutils::StringType::npos) {
video2x::fsutils::StringType key = opt.substr(0, eq_pos);
video2x::fsutils::StringType value = opt.substr(eq_pos + 1);
enc_cfg.extra_opts.push_back(std::make_pair(key, value));
enc_cfg.extra_opts.push_back(
std::make_pair(wstring_to_u8string(key), wstring_to_u8string(value))
);
} else {
video2x::logger()->critical(
"Invalid extra AVOption format: {}", wstring_to_u8string(opt)
@@ -381,16 +389,19 @@ int parse_args(
}
case video2x::processors::ProcessorType::RealESRGAN: {
if (!vm.count("realesrgan-model")) {
video2x::logger()->critical("RealESRGAN model name must be set for RealESRGAN."
);
video2x::logger()->critical("The model name must be set for Real-ESRGAN.");
return -1;
}
if (proc_cfg.scaling_factor < 2 || proc_cfg.scaling_factor > 4) {
video2x::logger()->critical(
"Scaling factor must be set to 2, 3, or 4 for RealESRGAN."
"Scaling factor must be set to 2, 3, or 4 for Real-ESRGAN."
);
return -1;
}
if (proc_cfg.noise_level < -1 || proc_cfg.noise_level > 1) {
video2x::logger()->critical("Noise level must be 0 or 1 for Real-ESRGAN.");
return -1;
}
proc_cfg.processor_type = video2x::processors::ProcessorType::RealESRGAN;
video2x::processors::RealESRGANConfig realesrgan_config;
@@ -402,31 +413,31 @@ int parse_args(
}
case video2x::processors::ProcessorType::RealCUGAN: {
if (!vm.count("realcugan-model")) {
video2x::logger()->critical("RealCUGAN model name must be set for RealCUGAN.");
video2x::logger()->critical("The model name must be set for Real-CUGAN.");
return -1;
}
if (vm.count("realcugan-threads") && vm["realcugan-threads"].as<int>() < 1) {
video2x::logger()->critical(
"Number of threads must be at least 1 for RealCUGAN."
"Number of threads must be at least 1 for Real-CUGAN."
);
return -1;
}
if (vm.count("realcugan-syncgap") && (vm["realcugan-syncgap"].as<int>() < 0 ||
vm["realcugan-syncgap"].as<int>() > 3)) {
video2x::logger()->critical(
"Sync gap mode must be set to 0, 1, 2, or 3 for RealCUGAN."
"Sync gap mode must be set to 0, 1, 2, or 3 for Real-CUGAN."
);
return -1;
}
if (proc_cfg.scaling_factor < 2 || proc_cfg.scaling_factor > 4) {
video2x::logger()->critical(
"Scaling factor must be set to 2, 3, or 4 for RealCUGAN."
"Scaling factor must be set to 2, 3, or 4 for Real-CUGAN."
);
return -1;
}
if (proc_cfg.noise_level < -1 || proc_cfg.noise_level > 3) {
video2x::logger()->critical(
"Noise level must be set to -1, 0, 1, 2, or 3 for RealCUGAN."
"Noise level must be set to -1, 0, 1, 2, or 3 for Real-CUGAN."
);
return -1;
}
@@ -443,7 +454,7 @@ int parse_args(
}
case video2x::processors::ProcessorType::RIFE: {
if (!vm.count("rife-model")) {
video2x::logger()->critical("RIFE model name must be set for RIFE.");
video2x::logger()->critical("The model name must be set for RIFE.");
return -1;
}
if (proc_cfg.frm_rate_mul < 2) {
@@ -467,10 +478,10 @@ int parse_args(
video2x::logger()->critical("Invalid processor type.");
return -1;
}
} catch (const po::error &e) {
} catch (const po::error& e) {
video2x::logger()->critical("Error parsing arguments: {}", e.what());
return -1;
} catch (const std::exception &e) {
} catch (const std::exception& e) {
video2x::logger()->critical(
"Unexpected exception caught while parsing options: {}", e.what()
);

View File

@@ -1,6 +1,6 @@
#include "newline_safe_sink.h"
void newline_safe_sink::log(const spdlog::details::log_msg &msg) {
void newline_safe_sink::log(const spdlog::details::log_msg& msg) {
if (needs_newline_.exchange(false)) {
std::fputs("\n", stdout);
}

View File

@@ -2,7 +2,7 @@
#include <unordered_set>
void validate_anime4k_shader_name(const video2x::fsutils::StringType &shader_name) {
void validate_anime4k_shader_name(const video2x::fsutils::StringType& shader_name) {
static const std::unordered_set<video2x::fsutils::StringType> valid_anime4k_shaders = {
STR("anime4k-v4-a"),
STR("anime4k-v4-a+a"),
@@ -22,9 +22,12 @@ void validate_anime4k_shader_name(const video2x::fsutils::StringType &shader_nam
}
}
void validate_realesrgan_model_name(const video2x::fsutils::StringType &model_name) {
void validate_realesrgan_model_name(const video2x::fsutils::StringType& model_name) {
static const std::unordered_set<video2x::fsutils::StringType> valid_realesrgan_models = {
STR("realesrgan-plus"), STR("realesrgan-plus-anime"), STR("realesr-animevideov3")
STR("realesrgan-plus"),
STR("realesrgan-plus-anime"),
STR("realesr-animevideov3"),
STR("realesr-generalv3"),
};
if (valid_realesrgan_models.count(model_name) == 0) {
throw po::validation_error(
@@ -36,7 +39,7 @@ void validate_realesrgan_model_name(const video2x::fsutils::StringType &model_na
}
}
void validate_realcugan_model_name(const video2x::fsutils::StringType &model_name) {
void validate_realcugan_model_name(const video2x::fsutils::StringType& model_name) {
static const std::unordered_set<video2x::fsutils::StringType> valid_realcugan_models = {
STR("models-nose"), STR("models-pro"), STR("models-se")
};
@@ -49,7 +52,7 @@ void validate_realcugan_model_name(const video2x::fsutils::StringType &model_nam
}
}
void validate_rife_model_name(const video2x::fsutils::StringType &model_name) {
void validate_rife_model_name(const video2x::fsutils::StringType& model_name) {
static const std::unordered_set<video2x::fsutils::StringType> valid_rife_models = {
STR("rife"),
STR("rife-HD"),
@@ -62,13 +65,17 @@ void validate_rife_model_name(const video2x::fsutils::StringType &model_name) {
STR("rife-v3.1"),
STR("rife-v4"),
STR("rife-v4.6"),
STR("rife-v4.25"),
STR("rife-v4.25-lite"),
STR("rife-v4.26"),
};
if (valid_rife_models.count(model_name) == 0) {
throw po::validation_error(
po::validation_error::invalid_option_value,
"rife-model",
"RIFE model must be one of: rife, rife-HD, rife-UHD, rife-anime, rife-v2, rife-v2.3, "
"rife-v2.4, rife-v3.0, rife-v3.1, rife-v4, rife-v4.6"
"rife-v2.4, rife-v3.0, rife-v3.1, rife-v4, rife-v4.6, rife-v4.25, rife-v4.25-lite, "
"rife-v4.26"
);
}
}

View File

@@ -40,7 +40,7 @@ std::tuple<int, int, int> calculate_time_components(int time_elapsed) {
}
#ifdef _WIN32
int wmain(int argc, wchar_t *argv[]) {
int wmain(int argc, wchar_t* argv[]) {
// Set console output code page to UTF-8
SetConsoleOutputCP(CP_UTF8);
@@ -51,7 +51,7 @@ int wmain(int argc, wchar_t *argv[]) {
console_mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(console_handle, console_mode);
#else
int main(int argc, char **argv) {
int main(int argc, char** argv) {
#endif
// Initialize newline-safe logger with custom formatting pattern
std::shared_ptr<newline_safe_sink> logger_sink = std::make_shared<newline_safe_sink>();

View File

@@ -5,7 +5,7 @@
#include <libvideo2x/logger_manager.h>
static int enumerate_vulkan_devices(VkInstance *instance, std::vector<VkPhysicalDevice> &devices) {
static int enumerate_vulkan_devices(VkInstance* instance, std::vector<VkPhysicalDevice>& devices) {
// Create a Vulkan instance
VkInstanceCreateInfo create_info{};
create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
@@ -96,7 +96,7 @@ int list_vulkan_devices() {
return 0;
}
int get_vulkan_device_prop(uint32_t vk_device_index, VkPhysicalDeviceProperties *dev_props) {
int get_vulkan_device_prop(uint32_t vk_device_index, VkPhysicalDeviceProperties* dev_props) {
if (dev_props == nullptr) {
video2x::logger()->error("Invalid device properties pointer.");
return -1;