Anime4KCPP v3

June 1, 2026 ยท View on GitHub

Logo
Ask DeepWiki

Anime4KCPP v3

Anime4KCPP is a high performance anime upscaler.

Anime4KCPP v3 uses CNN based algorithm, and aims to be simple and efficient.

Playground

Use Anime4KCPP Playground to upscale images in your browser with WebAssembly.

For the Microsoft Edge browser, to achieve optimal performance, you need to disable the Enhanced Security for the site.

Build

Dependency

Build tools:

  • CMake
  • A C++17 compatible compiler

Dependency handling:

  • If you have internet access, CMake will automatically download and configure most required dependencies.
  • You can also manually download dependencies.

Manual configuration (optional):

  • Most dependencies are located via find_package. Others may use pkg-config or require explicit path specification via CMake variables.
  • For certain dependencies, dedicated CMake variables (e.g., AC_PATH_XXX) are provided.
  • Setting these variables will:
    1. Direct CMake to search in your specified paths first
    2. Override default search locations

List of dependencies

DependencyCMake optionModuleAcquisitionManual Configuration
CUDA ToolkitAC_CORE_WITH_CUDAcore(CUDA)Manualfind_package
libavcodecAC_BUILD_VIDEOvideoManualpkg-config / AC_PATH_FFMPEG
libavformatAC_BUILD_VIDEOvideoManualpkg-config / AC_PATH_FFMPEG
libavutilAC_BUILD_VIDEOvideoManualpkg-config / AC_PATH_FFMPEG
libswscaleAC_BUILD_VIDEOvideoManualpkg-config / AC_PATH_FFMPEG
QtAC_BUILD_GUIguiManualfind_package
Avisynth SDKAC_BUILD_FILTER_AVISYNTHfilter(avisynth)AutomaticAC_PATH_AVISYNTH_SDK
CLI11AC_BUILD_CLIcliAutomaticfind_package / AC_PATH_CLI11
DirectShow BaseClassesAC_BUILD_FILTER_DIRECTSHOWfilter(directshow)AutomaticAC_PATH_DIRECTSHOW_BASECLASSES
Eigen3AC_CORE_WITH_EIGEN3core(eigen3)Automaticfind_package / AC_PATH_EIGEN3
OpenCL SDKAC_CORE_WITH_OPENCLcore(opencl)Automaticfind_package
pybind11AC_BUILD_BINDING_PYTHONbinding(python)Automaticfind_package
ruapuN/AcoreAutomaticAC_PATH_RUAPU
stbN/AcoreAutomaticAC_PATH_STB
fpngAC_CORE_WITH_FPNGcoreAutomaticAC_PATH_FPNG
halfN/AcoreAutomaticAC_PATH_HALF
VapourSynth SDKAC_BUILD_FILTER_VAPOURSYNTHfilter(vapoursynth)Automaticpkg-config / AC_PATH_VAPOURSYNTH_SDK
doctestAC_BUILD_TESTStestsAutomaticfind_package / AC_PATH_DOCTEST
  • The minimum tested version of the CUDA Toolkit is 11.
  • The minimum version of FFmpeg libraries is FFmpeg 4.
  • Both Qt5 and Qt6 should be OK.
  • VapourSynth SDK 4 is required.
  • For non MSVC compilers, a modified version of the DirectShow BaseClasses will be used.

Platform

Windows

Tested with MinGW-w64, Clang and MSVC.

DirectShow filter is only available on Windows, tested compilers include MinGW-w64, ClangCL and MSVC.

Build with MinGW-w64:

mkdir build; cd build
cmake -G "MinGW Makefiles" .. -DAC_CORE_WITH_OPENCL=ON -DAC_ENABLE_STATIC_CRT=ON
cmake --build . --config Release -j8
cd bin
./ac_cli -v

Build with MSVC:

mkdir build; cd build
cmake -G "Visual Studio 17 2022" .. -DAC_CORE_WITH_OPENCL=ON
cmake --build . --config Release -j8
cd bin/Release/
./ac_cli -v

To setup FFmpeg libraries for building video module on Windows, it is recommended to add an AC_PATH_FFMPEG variable to CMake, but you can also use pkg-config for Windows. AC_PATH_FFMPEG should be a path to the FFmpeg's root folder witch contains lib and include.

To add AC_PATH_FFMPEG to CMake, click Add Entry button in cmake-gui or use -DAC_PATH_FFMPEG="path/to/ffmpeg/root" in terminal.

You can download FFmpeg with sdk from BtBN (ffmpeg-master-latest-win64-gpl-shared.zip or ffmpeg-master-latest-win64-lgpl-shared.zip) or gyan.dev (ffmpeg-release-full-shared.7z) for Windows.

Linux

Tested with gcc and Clang.

# Toolchain
sudo apt install cmake build-essential
# For video module:
sudo apt install pkg-config libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
# For GUI:
sudo apt install qt6-base-dev qt6-tools-dev
# For python binding:
sudo apt install python3-dev
mkdir build && cd build
cmake .. -DAC_CORE_WITH_OPENCL=ON #-DAC_BUILD_VIDEO=ON -DAC_BUILD_GUI=ON
cmake --build . --config Release -j8
cd bin
./ac_cli -v

Termux

To build with OpenCL support, you need install ocl-icd package, OpenCL SDK from Khronos seems not to be worked with termux.

pkg install cmake clang ocl-icd opencl-clhpp opencl-headers
mkdir build && cd build
cmake .. -DAC_CORE_WITH_OPENCL=ON
cmake --build . --config Release -j8
cd bin
LD_LIBRARY_PATH=/vendor/lib64:$PREFIX/lib ./ac_cli -l

WASM

Tested with Emscripten. check Anime4KCPP-Playground.

Mac OS

Tested with Apple Clang via github actions, MACOSX_DEPLOYMENT_TARGET >= 10.12 is required.

CMake options

OptionDescriptionDefault
AC_SHARED_LIBbuild as a shared libraryOFF
AC_CORE_WITH_EIGEN3build core with eigen3OFF
AC_CORE_WITH_SSEbuild core with x86 sseAuto detect
AC_CORE_WITH_SSE2build core with x86 sse2Auto detect
AC_CORE_WITH_AVXbuild core with x86 avxAuto detect
AC_CORE_WITH_AVX2build core with x86 avx2Auto detect
AC_CORE_WITH_AVX512build core with x86 avx512Auto detect
AC_CORE_WITH_FMAbuild core with x86 fmaAuto detect
AC_CORE_WITH_NEONbuild core with arm neonAuto detect
AC_CORE_WITH_RVVbuild core with risc-v vectorAuto detect
AC_CORE_WITH_LSXbuild core with loongarch lsxAuto detect
AC_CORE_WITH_LASXbuild core with loongarch lasxAuto detect
AC_CORE_WITH_MSAbuild core with mips msaAuto detect
AC_CORE_WITH_ALTIVECbuild core with powerpc altivecAuto detect
AC_CORE_WITH_VSXbuild core with powerpc vsxAuto detect
AC_CORE_WITH_WASM_SIMD128build core with wasm simd128Auto detect
AC_CORE_WITH_OPENCLbuild core with openclOFF
AC_CORE_WITH_CUDAbuild core with cudaOFF
AC_CORE_WITH_FPNGbuild core with fpngON
AC_CORE_ENABLE_FAST_MATHenable fast math for coreOFF
AC_CORE_DISABLE_IMAGE_IOdisable image file read and write for coreOFF
AC_BUILD_CLIbuild cliON
AC_BUILD_GUIbuild guiOFF
AC_BUILD_VIDEObuild video moduleOFF
AC_BUILD_FILTER_AVISYNTHbuild avisynth filterOFF
AC_BUILD_FILTER_VAPOURSYNTHbuild vapoursynth filterOFF
AC_BUILD_FILTER_DIRECTSHOWbuild directshow filter (Windows only)OFF
AC_BUILD_FILTER_AVISYNTH_VAPOURSYNTHbuild an avisynth and vapoursynth universal filterOFF
AC_BUILD_BINDING_Cbuild c binding for coreOFF
AC_BUILD_BINDING_PYTHONbuild python binding for coreOFF
AC_TOOLS_BENCHMARKbuild benchmarkOFF
AC_BUILD_TESTSbuild testsOFF
AC_ENABLE_LTOenable LTOOFF
AC_ENABLE_STATIC_CRTenable static link crtOFF
AC_DISABLE_RTTIdisable rttiOFF
AC_DISABLE_EXCEPTIONdisable exceptionOFF
AC_DISABLE_PICdisable pic or pieOFF

There are some convenient presets:

AC_PRESET_RELEASE

  • AC_CORE_WITH_EIGEN3
  • AC_CORE_WITH_OPENCL
  • AC_CORE_WITH_CUDA
  • AC_CORE_WITH_FPNG
  • AC_CORE_ENABLE_FAST_MATH
  • AC_BUILD_CLI
  • AC_BUILD_GUI
  • AC_BUILD_VIDEO
  • AC_BUILD_FILTER_AVISYNTH_VAPOURSYNTH
  • AC_BUILD_FILTER_DIRECTSHOW (Windows only)

LICENSE

The video module is under GPLv3, any module built with the video module are also under GPLv3, others under MIT. For example, if cli build with video module, it is under GPLv3, otherwise, it is under MIT.