diff --git a/CMakeLists.txt b/CMakeLists.txt index bc31707f..8ab4a876 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,20 @@ cmake_minimum_required(VERSION 3.0) project(Anime4KCPP) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + if(WIN32) - set(CMAKE_CXX_FLAGS "-std=c++17 -O2 -fopenmp") + set(CMAKE_CXX_FLAGS "-O2 -fopenmp") else() - set(CMAKE_CXX_FLAGS "-std=c++17 -O2 -lpthread -fopenmp") + set(CMAKE_CXX_FLAGS "-O2 -lpthread -fopenmp") +endif() + +if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set(CMAKE_CXX_FLAGS "/EHsc") endif() + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") set(TOP_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) diff --git a/GUI/CMakeLists.txt b/GUI/CMakeLists.txt index c73d3b64..be236db0 100644 --- a/GUI/CMakeLists.txt +++ b/GUI/CMakeLists.txt @@ -6,9 +6,6 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(TS_FILES ./src/Anime4KCPP_GUI_zh_CN.ts) set(UI_FILE ./src/mainwindow.ui) @@ -27,8 +24,9 @@ add_executable(Anime4KCPP_GUI find_package(Qt5 COMPONENTS Widgets LinguistTools REQUIRED) find_package(OpenCV REQUIRED) +find_package(OpenCL REQUIRED) -include_directories(${OpenCV_INCLUDE_DIRS}) +include_directories(${OpenCV_INCLUDE_DIRS} ${OpenCL_INCLUDE_DIRS}) target_link_libraries(Anime4KCPP_GUI PRIVATE Qt5::Widgets) target_link_libraries(${PROJECT_NAME} PRIVATE ${OpenCV_LIBS}) diff --git a/GUI/include/mainwindow.h b/GUI/include/mainwindow.h index bf4cb83e..8cfb3fae 100644 --- a/GUI/include/mainwindow.h +++ b/GUI/include/mainwindow.h @@ -20,8 +20,8 @@ #include -#define CORE_VERSION "1.3.2" -#define VERSION "1.1" +#define CORE_VERSION "1.5.0" +#define VERSION "1.2.0" QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } diff --git a/README.md b/README.md index 45ab3b94..2647d5bc 100644 --- a/README.md +++ b/README.md @@ -7,22 +7,44 @@ This project is for learning and the exploration task of algorithm course in SWJ # About Anime4K Anime4K is a simple high-quality anime upscale algorithm for anime. it does not use any machine learning approaches, and can be very fast in real-time processing. +# Why Anime4KCPP +- Cross-platform, building have already tested in Windows and Linux, MACOS is also supported. +- Wide compatibility, support both CPU and GPU. +- easy to use with GUI or CLI. +- High performance. +- GPU acceleration support, use it to process your image or video in a short time. +- More arguments for you, you can get a better quality than real-time playback. +- Filters support, use them to denoise or anti-aliasing. + # Result ![examples](images/examples.png) +# GPU acceleration +Anime4KCPP now supports GPU acceleration, which is implement by original OpenCL for high performance, it can complete 1080 -> 4K image processing in 0.1s on *AMD Vege 8 Graphics* (integrated in *AMD Ryzen 3500U*). + # Performance CPU: AMD Ryzen 3500U +GPU: AMD Vege 8 Graphics RAM: 16G Anime4K Settings: balance + CPU: Image: 256x256 -> 512x512: 0.025s 1080P -> 4k: 0.65s Video(Length: 1 min 32 seconds): - 480P -> 1080P : 3 min 13 seconds + 480P -> 1080P : 3 min 13 seconds 1080P -> 4K : 19 min 9 seconds + GPU: + Image: + 256x256 -> 512x512: 0.008s + 1080P -> 4k: 0.1s + + Video(Length: 1 min 32 seconds): + 480P -> 1080P : 0 min 51 seconds + 1080P -> 4K : 4 min 30 seconds # GUI Anime4KCPP now provides a GUI interface, upscale your image or video by an easier way! ***NOTICE: please install [ffmpeg](https://ffmpeg.org) for video processing firstly*** @@ -55,6 +77,7 @@ This project uses [cmake](https://cmake.org) to build. -a, --postProcessing Enable post processing -r, --preFilters Enhancement filter, only working when preProcessing is true,there are 5 options by binary:Median blur=0000001, Mean blur=0000010, CAS Sharpening=0000100, Gaussian blur weak=0001000, Gaussian blur=0010000, Bilateral filter=0100000, Bilateral filter faster=1000000, you can freely combine them, eg: Gaussian blur weak + Bilateral filter = 0001000 | 0100000 = 0101000 = 40(D) (unsigned int [=4]) -e, --postFilters Enhancement filter, only working when postProcessing is true,there are 5 options by binary:Median blur=0000001, Mean blur=0000010, CAS Sharpening=0000100, Gaussian blur weak=0001000, Gaussian blur=0010000, Bilateral filter=0100000, Bilateral filter faster=1000000, you can freely combine them, eg: Gaussian blur weak + Bilateral filter = 0001000 | 0100000 = 0101000 = 40(D), so you can put 40 to enable Gaussian blur weak and Bilateral filter, which also is what I recommend for image that < 1080P, 48 for image that >= 1080P, and for performance I recommend to use 72 for video that < 1080P, 80 for video that >=1080P (unsigned int [=40]) + -q, --GPUMode Enable GPU acceleration -?, --help print this message ## Filters