summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiota2023-12-05 18:57:53 -0800
committerxiota2023-12-05 18:57:53 -0800
commit5143e15b1191f9ac0708a35876c4ecb887c72075 (patch)
tree20c6d51bace5ad212fe2dbc16746e943132ec62a
parent19671d74fc19ed9f54a3f2e08d04f41b082ec29a (diff)
downloadaur-5143e15b1191f9ac0708a35876c4ecb887c72075.tar.gz
fix man formatting and license path
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD23
-rw-r--r--glsl.man148
-rw-r--r--glsladv.man263
4 files changed, 428 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c46ffe75d8e4..88e29b158f9c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,17 @@
pkgbase = anime4k-git
pkgdesc = A High-Quality Real Time Upscaler for Anime Video
pkgver = 4.0.1.r40.g8e39551
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/bloc97/Anime4K
arch = any
license = MIT
- makedepends = go-md2man
provides = anime4k=4.0.1
conflicts = anime4k
source = anime4k::git+https://github.com/bloc97/Anime4K.git
+ source = glsl.man
+ source = glsladv.man
sha256sums = SKIP
+ sha256sums = 8a4b346c0dffc2927795a4388b9f53a532bc5d1dfb090142f40ed251eaf75452
+ sha256sums = bc2a7076956166d51ab9380e2519b479683682df65b5e7822e68782c3706a9d1
pkgname = anime4k-git
diff --git a/PKGBUILD b/PKGBUILD
index c1d39fe4cf9f..dab9ff0e4b2f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,20 +4,26 @@
_pkgname="anime4k"
pkgname="$_pkgname-git"
pkgver=4.0.1.r40.g8e39551
-pkgrel=1
+pkgrel=2
pkgdesc="A High-Quality Real Time Upscaler for Anime Video"
url="https://github.com/bloc97/Anime4K"
license=('MIT')
arch=('any')
-makedepends=('go-md2man')
-
provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")
_pkgsrc="$_pkgname"
-source=("$_pkgsrc"::"git+$url.git")
-sha256sums=('SKIP')
+source=(
+ "$_pkgsrc"::"git+$url.git"
+ "glsl.man"
+ "glsladv.man"
+)
+sha256sums=(
+ 'SKIP'
+ '8a4b346c0dffc2927795a4388b9f53a532bc5d1dfb090142f40ed251eaf75452'
+ 'bc2a7076956166d51ab9380e2519b479683682df65b5e7822e68782c3706a9d1'
+)
pkgver() {
cd "$_pkgsrc"
@@ -25,11 +31,6 @@ pkgver() {
| sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}
-build() {
- go-md2man -in anime4k/md/GLSL_Instructions_Linux.md -out glsl.man
- go-md2man -in anime4k/md/GLSL_Instructions_Advanced.md -out glsladv.man
-}
-
package() {
install -d "${pkgdir}/usr/share/anime4k/tensorflow"
cp -rf "$_pkgsrc/glsl"/* "${pkgdir:?}/usr/share/anime4k/"
@@ -38,5 +39,5 @@ package() {
install -Dm644 glsl.man "${pkgdir}/usr/share/man/man1/anime4k.1"
install -Dm644 glsladv.man "${pkgdir}/usr/share/man/man1/anime4k-advanced.1"
- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/$pkgname/"
+ install -Dm644 "$_pkgsrc/LICENSE" -t "${pkgdir}/usr/share/licenses/$pkgname/"
}
diff --git a/glsl.man b/glsl.man
new file mode 100644
index 000000000000..530644ed9073
--- /dev/null
+++ b/glsl.man
@@ -0,0 +1,148 @@
+.nh
+.TH Usage Instructions (GLSL / MPV) (v4.x)
+.SH Installing and Setting Up Anime4K for Linux-based Distributions (and other Unix-like OS)
+.RS
+.IP " 1." 5
+Install \fBmpv\fR from repositories of your distribution, some of the
+common ones are mentioned here
+.SS Fedora Silverblue
+.RS
+.IP " 1." 5
+Install the RPM-Fusion "free" repository, if not already
+installed, paste in the command below\fBsudo rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm\fR
+.IP " 2." 5
+Reboot and install \fBmpv\fR
+.IP " 3." 5
+Reboot and continue to step 2
+
+.RE
+
+.SS Fedora
+.EX
+sudo dnf install mpv
+
+.EE
+
+.SS Ubuntu and Derivatives
+.EX
+sudo apt install mpv
+
+.EE
+
+.SS Arch and Derivatives
+.EX
+sudo pacman -S mpv
+
+.EE
+
+.SS Gentoo (Add USE Flags as mentioned here
+\[la]https://wiki.gentoo.org/wiki/Mpv#USE_flags\[ra])
+.EX
+sudo emerge --ask media-video/mpv`
+
+.EE
+
+
+.RE
+
+.RS
+.IP \(bu 2
+Note: make sure to install a version of
+\[la]https://mpv.io/\[ra]
+that was released after June 2021, older versions might not
+work
+\[la]https://github.com/bloc97/Anime4K/issues/134\[ra]\&.
+
+.RE
+
+.RS
+.IP " 1." 5
+Clone the repo using
+\fBgit clone https://github.com/bloc97/Anime4K.git\fR, or download the
+template files and extract them.
+.RS
+.IP \(bu 2
+\fBOptimized shaders for lower-end GPU:\fP
+.br
+\fI(Eg. GTX 980, GTX 1060, RX 570)\fP
+.RS
+.IP \(bu 2
+Download the template files
+here
+\[la]https://github.com/Tama47/Anime4K/releases/download/v4.0.1/GLSL_Mac_Linux_Low\-end.zip\[ra]\&.
+.IP \(bu 2
+
+Or click here to install manually.
+
+Copy & Paste the code from input.conf and mpv.conf in your input.conf and mpv.conf file.
+Then download and extract the shaders from releases and put them in the shaders folder.
+
+.RE
+
+
+.IP \(bu 2
+\fBOptimized shaders for higher-end GPU:\fP
+.br
+\fI(Eg. GTX 1080, RTX 2070, RTX 3060, RX 590, Vega 56, 5700XT,
+6600XT)\fP
+.RS
+.IP \(bu 2
+Download the template files
+here
+\[la]https://github.com/Tama47/Anime4K/releases/download/v4.0.1/GLSL_Mac_Linux_High\-end.zip\[ra]\&.
+.IP \(bu 2
+
+Or click here to install manually.
+
+Copy & Paste the code from input.conf and mpv.conf in your input.conf and mpv.conf file.
+Then download and extract the shaders from releases and put them in the shaders folder.
+
+.RE
+
+
+
+.RE
+
+.IP " 2." 5
+Navigate to \fB~/.config/mpv\fR and move the \fBinput.conf\fR, \fBmpv.conf\fR
+and the \fBshaders\fR folder into the \fBmpv\fR directory.
+\fBmv path/to/stuff ~/.config/mpv\fR
+
+.RE
+
+.ti 0
+\l'\n(.lu'
+
+.SH Quick Usage Instructions
+.RS
+.IP " 1." 5
+Anime4K has 3 major modes: A, B, and C. Each mode is optimized for a
+different class of anime degradations.
+.RS
+.IP \(bu 2
+Mode A is automatically enabled, if you use our template (this can
+be change in \fBmpv.conf\fR).
+
+.RE
+
+.IP " 2." 5
+To enable each mode manually:
+.RS
+.IP \(bu 2
+Press \fBCTRL+1\fP to enable Mode A (Optimized for 1080p Anime).
+.IP \(bu 2
+Press \fBCTRL+2\fP to enable Mode B (Optimized for 720p Anime).
+.IP \(bu 2
+Press \fBCTRL+3\fP to enable Mode C (Optimized for 480p Anime).
+.IP \(bu 2
+Press \fBCTRL+0\fP to clear all shaders (Disable Anime4K).
+
+.RE
+
+.IP " 3." 5
+For more explanations and customization options, see the Advanced
+Usage
+Instructions
+\[la]GLSL_Instructions_Advanced.md#advanced\-usage\-instructions\-glsl\-\-mpv\-v4x\[ra]\&.
+
+.RE
diff --git a/glsladv.man b/glsladv.man
new file mode 100644
index 000000000000..01f90aa94a76
--- /dev/null
+++ b/glsladv.man
@@ -0,0 +1,263 @@
+.nh
+.TH Advanced Usage Instructions (GLSL / MPV) (v4.x)
+.SH Modes
+.PP
+Now, Anime4K has 3 major modes, as the small CNN networks cannot learn effectively every type of distribution shift and degradation seen in the wild. Human judgement will serve (for now) as the stopgap solution. Usually the correct mode is the one that looks best.
+
+.PP
+The easiest way is to first visually inspect each mode in the A-B-C order. Mode A has the most visible artifacts of the three modes if used incorrectly. B and C can be harder to distinguish for lower resolution anime.
+
+.PP
+If you want increased perceptual quality, use the corresponding secondary mode.
+
+.TS
+allbox;
+l l
+l l .
+\fBPrimary Mode\fP \fBCorresponding Secondary Mode\fP
+A A+A
+B B+B
+C C+A
+.TE
+
+.PP
+Here's what each mode is optimized for and what it does:
+
+.TS
+allbox;
+l l l l
+l l l l .
+\fBModes\fP \fBOptimized for?\fP \fBPositive effects\fP \fBNegative effects (If used incorrectly)\fP
+A T{
+Most 1080p anime.
+Some older 720p anime.
+Most old SD anime.
+(High amounts of blur)
+(A lot of resampling artifacts)
+(Smearing due to compression)
+T} T{
+High perceptual quality.
+Reduces compression artifacts.
+Reconstructs most degraded lines.
+Reduces large amounts of blur.
+Reduces noise.
+T} T{
+Can amplify ringing if already present.
+Can amplify banding if already present.
+Strong denoising might blur textures.
+T}
+B T{
+Some 1080p anime.
+Most 720p anime.
+1080p->720p downscaled anime.
+(Low amounts of blur)
+(Some resampling artifacts)
+(Ringing due to downsampling)
+T} T{
+Reduces compression artifacts.
+Reconstructs some degraded lines.
+Reduces some blur.
+Reduces noise.
+Reduces ringing.
+Reduces aliasing.
+T} T{
+Some artifacts might not be removed.
+Some lines might still be blurry.
+Strong denoising might blur textures.
+T}
+C T{
+1080p->480p downscaled anime.
+Very rarely, 1080p animated movies.
+Images with no degradation.
+Wallpapers Pixiv art.
+T} T{
+Highest PSNR.
+Reduces noise.
+T} T{
+Low perceptual quality.
+Can amplify ringing if already present.
+Can amplify resampling artifacts.
+T} T{
+A+A* Same as A
+T{ T{
+Highest perceptual quality.
+Reconstructs almost all degraded lines.
+Same positive effects from mode A.
+T} T{
+Can cause severe ringing.
+Can cause banding.
+Can cause aliasing.
+Same negative effects from mode A.
+Slower than mode A.
+T}
+B+B* T{
+Same as B
+T} T{
+High perceptual quality.
+Same positive effects from mode B.
+T} T{
+Same negative effects from mode B.
+Slower than mode B.
+T}
+C+A* T{
+Same as C
+T} T{
+Slightly higher perceptual quality.
+Same positive effects from mode C.
+T} T{
+Same negative effects from mode C.
+Slower than mode C.
+T}
+.TE
+
+.PP
+*These modes should only be used on upscaling ratios of x2 or higher. If you have a 1080p screen, using mode A on 1080p anime will improve image quality, but mode A+A will most likely oversharpen and degrade the image.
+
+.SH Advanced Customization
+.PP
+Not satisfied from simply using the default options? Curious about unsupported/weird modes such as B+A, A+B or B+A+A ? This quick guide will get you started on customizing your own restoration pipeline.
+
+.PP
+First, the basics.
+
+.RS
+.IP \(bu 2
+All the shaders can be used standalone or in combination with any other shaders.
+.IP \(bu 2
+You can only use each shader file once. Using the same file two or more times causes buggy behaviour and loss of performance. Either use a different variant or copy and rename the duplicate shaders.
+.IP \(bu 2
+The shaders process the image in the same order as the filename order given in \fBinput.conf\fR\&. One exception is \fBClamp_Highlights\fR, explained in the table below.
+.IP \(bu 2
+You are free to choose the CNN variant (S, M, L, VL, UL) for better speed or quality. Each step in size for CNN shaders doubles the processing time. For example, if the M version takes 5ms to run, the L version should take approximately 10ms to run, 20ms for VL and so on.
+.IP \(bu 2
+Non-CNN shaders are significantly faster but might be of lower quality.
+
+.RE
+
+.PP
+Quick explanation of each shader type:
+
+.TS
+allbox;
+l l
+l l .
+\fBShader Type (in order of importance)\fP \fBEffect\fP
+Restore T{
+The shader that makes Anime4K different from other upscalers. Restores image, best used before upscaling. Removes compression artifacts, blur, ringing, etc. \fBRestore\fR is more optimized for upsampling artifacts and blur, while \fBRestore_Soft\fR is more optimized for downsampling artifacts and aliasing.
+T}
+Upscale T{
+Upscales an image by a factor of x2, assumes image contains no degradation.
+T}
+Upscale_Denoise T{
+Upscales an image by a factor of x2 and denoises it with no GPU performance penality.
+T}
+Clamp_Highlights T{
+Computes and saves image statistics at the location it is placed in the shader stage, then clamps the image highlights at the end after all the shaders to prevent overshoot and reduce ringing.
+T}
+Darken T{
+Darkens lines in image. As what constitutes a line is ambiguous, might darken other stuff. Use according to personal taste.
+T}
+Thin T{
+Makes lines thinner in image. As what constitutes a line is ambiguous, might thin other stuff. Use according to personal taste.
+T}
+Denoise T{
+Applies a denoising filter to the image.
+T}
+Deblur T{
+Applies a deblur filter to the image. Sharpens details without overshoot or ringing.
+T}
+AutoDownscalePre_x4 T{
+Downscales an image after a first upscaling step, so that the second x2 upscaling step exactly matches screen size. This improves performance without noticeably impacting quality as you will not be working with images larger than the screen size. Should be placed between two Upscale shaders. Without this shader, the default behaviour is to downscale to the screen size after running all shaders.
+T}
+AutoDownscalePre_x2 T{
+Downscales an image after a first upscaling step to match screen size. This improves performance without noticeably impacting quality as you will not be working with images larger than the screen size. Should be placed after the first Upscale shader. Without this shader, the default behaviour is to downscale to the screen size after running all shaders.
+T}
+.TE
+
+.ti 0
+\l'\n(.lu'
+
+.PP
+Overview of default modes:
+
+.TS
+allbox;
+l l
+l l .
+\fBMode\fP \fBShaders\fP
+A \fBRestore -> Upscale -> Upscale\fR
+B \fBRestore_Soft -> Upscale -> Upscale\fR
+C \fBUpscale_Denoise -> Upscale\fR
+A+A \fBRestore -> Upscale -> Restore -> Upscale\fR
+B+B \fBRestore_Soft -> Upscale -> Restore_Soft -> Upscale\fR
+C+A \fBUpscale_Denoise -> Restore -> Upscale\fR
+.TE
+
+.PP
+\fINote: Clamp_Highlights and AutoDownscalePre were removed from table for clarity.\fP
+
+.ti 0
+\l'\n(.lu'
+
+.PP
+How the modes are defined:
+
+.RS
+.IP \(bu 2
+Mode A is defined initially as: \fBRestore -> Upscale\fR
+.IP \(bu 2
+Mode B is defined initially as: \fBRestore_Soft -> Upscale\fR
+.IP \(bu 2
+Mode C is defined initially as: \fBUpscale\fR
+.IP \(bu 2
+If the mode does not start with a \fBRestore\fR shader, it must start with a \fBUpscale_Denoise\fR or \fBDenoise\fR shader, as almost every video compression algorithm is lossy.
+.IP \(bu 2
+All modes have to add upscale shaders until the entire shader pipeline upscales at least 4x. A reasonable assumption is the smallest reasonable video size being 480p and the largest screen being 4K, upscaling at 4x is close to the 4.5x of 480p->4K.
+____
+With the definitions above, we can see for example, what C+A+B is.
+
+.RE
+
+.RS
+.IP " 1." 5
+Initial definition: \fBC (Upscale) -> A (Restore -> Upscale) -> B (Restore_Soft -> Upscale)\fR
+.IP " 2." 5
+All modes have to start with restore/denoise: \fBC (Upscale_Denoise) -> A (Restore -> Upscale) -> B (Restore_Soft -> Upscale)\fR
+.IP " 3." 5
+Upscale ratio of 4x is already met.
+.IP " 4." 5
+C+A+B is: \fBUpscale_Denoise -> Restore -> Upscale -> Restore_Soft -> Upscale\fR
+.IP " 5." 5
+Shader variants (S/M/L/VL/UL) can be chosen at will.
+
+.RE
+
+.SH Best Practices
+.PP
+It is recommended to always include \fBClamp_Highlights\fR at the beginning to prevent ringing in some anime, but removing it will slightly improve speed.
+
+.PP
+Adding a \fBRestore\fR shader after an upscaling step improves perceptual quality, but makes processing slower and might introduce artifacts.
+
+.PP
+Shaders applied after a x2 upscaling step will take four times the processing time. For example, if a shader takes 10ms to run when placed before a upscaler, it will need 40ms if placed after the upscaler. This can be counteracted by using a smaller CNN variant two steps below. (eg. S instead of L)
+
+.PP
+Artifacts introduced by lower quality shaders (eg. M or S variants) usually are not noticeable when working at very high resolutions. This advantage can be used to reduce GPU fan noise/heat and power use if you do not mind slightly lower image quality.
+
+.PP
+The target for 24fps video is usually ~41ms. Frame drops will appear if the GPU cannot keep up. If that happens, use lower quality/faster shader variants.
+Use the mpv profiler (press Shift+I and then 2 on the keyboard's top row) to verify whether your GPU can keep up.
+
+.TS
+allbox;
+l l
+l l .
+\fBVideo Framerate\fP \fBMaximum time (ms)\fP
+24 41
+30 33
+60 16
+.TE
+
+.ti 0
+\l'\n(.lu'