Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th April 2021, 12:58   #81  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
at least for Anime I read that FSRCNNX is not good for things that less than 720 (will case oil pant effect), is it possible have another options like SSSR and Ravu? as they good for those cases
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 7th April 2021, 19:43   #82  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 319
Despite being based on FSRCNNX, the latest models are actually very different in some important ways, and the LineArt models have been trained with an Anime dataset, which makes a big difference. It is true however that for more than 2x there are more artifacts, but not much more can be done with only 24 filters.

Anyway, to implement RAVU it is necessary to load a 32 bit texture, which I think is not possible with AviSynth. SSSR seems definitely possible, but it would not fit in this application, and also I'm not very interested.
__________________
AviSynth AiUpscale
Alexkral is offline   Reply With Quote
Old 9th April 2021, 13:13   #83  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
so that mean AviSynthShader need update to support float (32 bit)? maybe with opengl and Vulkan too
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 10th April 2021, 07:24   #84  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 319
Avisynth Shader supports 16 bit half-float for internal processing, which should be enough, but it doesn't support 32 bit float input. The problem would also be to load a floating point image in AviSynth since ImageSource would not work. 16 bit integer is useless because there are negative values.

AviSynth Shader would surely also benefit from an update to DirectX 10 or higher, which would mean Shader Model 4 -> no limit on the number of constant registers per shader -> more filters per convolutional layer -> better models (and also slower ).
__________________
AviSynth AiUpscale
Alexkral is offline   Reply With Quote
Old 11th October 2021, 08:15   #85  |  Link
VincAlastor
Registered User
 
Join Date: Sep 2009
Location: Berlin
Posts: 173
Really good script! Thanks!
I'm using it for anamorphic SD upscaling. At the end I'm resizing to 1280*720. I would like to use avisynth shader ResizeShader() with SSIM downscaling. But I'll getting a script error when using AiUpscale() and Avisynth shader in the same script. I know AiUpscale is using avisynth shader but is there nevertheless a way to load two instances avisynth shader?

Last edited by VincAlastor; 11th October 2021 at 08:25.
VincAlastor is offline   Reply With Quote
Old 11th October 2021, 20:42   #86  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Wow I hadn't seen this one before! Glad AvisynthShader has been of more modern use! I've been wondering for a while how to run more modern upscalers in Avisynth.

To clarify a few things. The output can be in any bitdepth you want. See ExecuteShader's OutputPrecision parameter. However, graphic cards are designed to push data to the graphic card with a large pipeline. The pipeline to get data back is a lot more limited and is a performance bottleneck. Returning in 16-bit instead of 8-bit can cut performance by half (might depend on graphic card too, haven't tested on my new system).

As for using DirectX 10, 11 or 12 instead of DirectX 9... it would be possible (madVR is doing it), but complicated. The approach (shortcut) I'm using in DirectX 9 doesn't work in later versions. It would require more complicated vertex calculation code or whatever that I simply don't understand to mimic the DX9 way.

I think that what's missing in DX10 and above is all the FVF stuff to convert this. Searching FVF with DX10 or above returns nearly nothing. This thread mentions that "FVF Format's are pretty much abandoned" and "What this means in practice is getting rid of fixed pipeline code, moving everything over to shaders and using IDirect3DVertexDeclaration9 instead of FVF codes". I'll leave the interpretation up to you.

I'm not exactly sure why I hadn't supported 32-bit calculation. One problem I had is that supported video buffer formats vary greatly from one video card to the next -- hard to know which formats can be used reliably. Some formats would work on NVidia and not on AMD, and vice-versa. PlanarOut feature, in particular, doesn't work with all graphic cards.

btw software vertex processing is supported right here. Glad it's working! (seeing a few surprised faces)

Last edited by MysteryX; 11th October 2021 at 21:04.
MysteryX is offline   Reply With Quote
Old 14th October 2021, 08:01   #87  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 319
Quote:
Originally Posted by VincAlastor View Post
But I'll getting a script error when using AiUpscale() and Avisynth shader in the same script.
I'm not sure if that could be fixed, could you post your script and the errors you are getting?

Quote:
Originally Posted by MysteryX View Post
Wow I hadn't seen this one before! Glad AvisynthShader has been of more modern use! I've been wondering for a while how to run more modern upscalers in Avisynth.
Hi MysteryX, I'm glad you like this!

I have to say that I have zero knowledge of DirectX programming, so I can't help with that. However when I was doing the whole training thing, I also trained a 2x HQ model with 64 filters (the published model has 24), which cannot be used with AviSynth Shader but can be used as an mpv shader. Using it in mpv with my GTX 1080 I was only able to get 12 fps for 4k upscaling, so I'm not sure it could be used with more modern GPUs. The results in terms of metrics were very similar to a full VDSR model, but the most important thing is that perceptually I could barely distinguish any difference between it, and the 24 filter model at a fairly short distance. So I think at least for 2x it would be overkill. For 3x and 4x however, these models usually produce quite noticeable artifacts with only 24 filters, so a 64 filter model would probably be more justified.
__________________
AviSynth AiUpscale
Alexkral is offline   Reply With Quote
Old 14th October 2021, 11:13   #88  |  Link
VincAlastor
Registered User
 
Join Date: Sep 2009
Location: Berlin
Posts: 173
Quote:
Originally Posted by Alexkral View Post
I'm not sure if that could be fixed, could you post your script and the errors you are getting?
Sure, thank you very much to take a look to.

DGSource("", cl = 0, ct = 0, cr = 0, cb = 0, deinterlace=1, use_pf=true)
AiUpscale(Luma="HQ Sharp", Chroma="KrigBilateral")
ResizeShader(Width=1280, Height=720, Kernel="SSIM")

Script Error

Shader: Failed to open pixel shader Shaders\Lanczos3\Lanczos3.cso
(C:/Program Files (x86)/AviSynth+/plugins64+/AiUpscale.avsi, line 362)
(C:/Program Files (x86)/AviSynth+/plugins64+/AiUpscale.avsi, line 366)
(C:/Program Files (x86)/AviSynth+/plugins64+/AiUpscale.avsi, line 146)
(C:/Program Files (x86)/AviSynth+/plugins64+/AiUpscale.avsi, line 147)
(C:\Temp\script.avs, line 6)
VincAlastor is offline   Reply With Quote
Old 14th October 2021, 13:04   #89  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 319
It works fine here. Try changing line 96 in AiUpscale.avsi to reflect the full path to your Shaders folder, e.g:

Code:
Global Path = "C:\Program Files (x86)\AviSynth+\plugins64+\Shaders\"
__________________
AviSynth AiUpscale
Alexkral is offline   Reply With Quote
Old 14th October 2021, 18:11   #90  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Is there a problem running 64 filters in a row? The only restriction I'm seeing is to not have more than 10 different source clips. Unless you need more than 10 intermediary clips, like needing to merge the result of 64 different shaders or something.

Btw you'd greatly benefit from running SIMD downscaling in the same chain before returning it from the GPU; otherwise you pull everything and push everything back, killing performance for nothing.
MysteryX is offline   Reply With Quote
Old 14th October 2021, 19:07   #91  |  Link
VincAlastor
Registered User
 
Join Date: Sep 2009
Location: Berlin
Posts: 173
Quote:
Originally Posted by Alexkral View Post
It works fine here. Try changing line 96 in AiUpscale.avsi to reflect the full path to your Shaders folder, e.g:

Code:
Global Path = "C:\Program Files (x86)\AviSynth+\plugins64+\Shaders\"
thats the solution! thank you very much
VincAlastor is offline   Reply With Quote
Old 14th October 2021, 19:25   #92  |  Link
VincAlastor
Registered User
 
Join Date: Sep 2009
Location: Berlin
Posts: 173
Quote:
Originally Posted by MysteryX View Post
Is there a problem running 64 filters in a row? The only restriction I'm seeing is to not have more than 10 different source clips. Unless you need more than 10 intermediary clips, like needing to merge the result of 64 different shaders or something.

Btw you'd greatly benefit from running SIMD downscaling in the same chain before returning it from the GPU; otherwise you pull everything and push everything back, killing performance for nothing.
sure, you're totally right. Thank you.
VincAlastor is offline   Reply With Quote
Old 14th October 2021, 19:52   #93  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
GPU processing isn't a big deal; you can process as much as you want once the video data is there. The bottleneck is data transfer between the CPU and GPU.

Which is where it's beneficial to downscale in 16-bit and then return back from the GPU in 8-bit.
MysteryX is offline   Reply With Quote
Old 5th January 2022, 07:02   #94  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
I tested this upscaler too, on possibly not so easy material: Interlaced, compressed with obvious artifacts in motion even after applying QTGMC. So far, I don't see much difference to the usual approach with NNEDI3_rpow2. I guess it depends much more on the cleaning before upscaling. There seem to be stronger AI models, but only implemented in VapourSynth yet.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 5th January 2022, 11:48   #95  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 319
Quote:
Originally Posted by LigH View Post
I tested this upscaler too, on possibly not so easy material: Interlaced, compressed with obvious artifacts in motion even after applying QTGMC. So far, I don't see much difference to the usual approach with NNEDI3_rpow2. I guess it depends much more on the cleaning before upscaling. There seem to be stronger AI models, but only implemented in VapourSynth yet.
That's normal, the quality of the upscaler is of less importance as the quality of the content worsens. For this type of content you will probably get better results with the FSRCNNX shaders, or even the FSRCNNX-Enhance shaders. Both have been trained with different levels of increased distortion, and therefore should be able to reduce compression artifacts. You can try both in VS with vs-placebo.
__________________
AviSynth AiUpscale
Alexkral is offline   Reply With Quote
Old 21st January 2022, 01:25   #96  |  Link
spam_sakura
Registered User
 
spam_sakura's Avatar
 
Join Date: Jan 2022
Posts: 1
Hi, need some help.

My script:
Import("W:\TEST StaxRip-x64-2.0.8.0-stable\Apps\Plugins\AiUpscale.avsi")
Import("W:\TEST StaxRip-x64-2.0.8.0-stable\Apps\Plugins\Shaders\AviSynthShader-1.6.6\Shader.avsi")
LoadPlugin("W:\TEST StaxRip-x64-2.0.8.0-stable\Apps\Plugins\Shaders\AviSynthShader-1.6.6\Shader-x64.dll")
DirectShowSource("V:\1.mp4").AiUpscale
spline64resize(2880,2160)

Error
System exception - Access Violation
(W:\TEST StaxRip-x64-2.0.8.0-stable\Apps\Plugins\AiUpscale.avsi, line 281)
(W:\TEST StaxRip-x64-2.0.8.0-stable\Apps\Plugins\AiUpscale.avsi, line 285)
(W:\TEST StaxRip-x64-2.0.8.0-stable\Apps\Plugins\AiUpscale.avsi, line 142)
(W:\TEST StaxRip-x64-2.0.8.0-stable\Apps\Plugins\AiUpscale.avsi, line 147)
(E:\!DownloaD\4k\TEST_4K_PC_4x3.avs, line 4)
(E:\!DownloaD\4k\TEST_4K_PC_4x3_temp\TEST_4K_PC_4x3_source.avs, line 1)
spam_sakura is offline   Reply With Quote
Old 21st January 2022, 05:52   #97  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 319
It works fine for me with the latest versions, I don't know where the problem may be.
__________________
AviSynth AiUpscale
Alexkral is offline   Reply With Quote
Old 21st January 2022, 09:22   #98  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
I would not trust DirectShowSource to be reliable. For MP4 clips, I would prefer L-SMASH Works with LSMASHVideoSource (or alternatively LwLibavVideoSource if the source container is a little incomplete).
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 21st January 2022, 11:18   #99  |  Link
goorawin
Registered User
 
Join Date: Feb 2012
Posts: 82
You need to include brackets after AiUpscale, like so
DirectShowSource("V:\1.mp4").AiUpscale()
goorawin is offline   Reply With Quote
Old 15th May 2022, 18:36   #100  |  Link
Floatingshed
Registered User
 
Join Date: Nov 2008
Posts: 322
I'm having trouble getting this to load. I think the problem is with Shader-x64.dll. It and all the other files are in the correct plugins directory.
I am getting the No function named "ConvertToShader" message. If I move Shader-x64.dll out of the plugins folder and load it manually I get:
"Cannot load.... platform returned code 126.... specified module could not be found.
So, it looks like I'm missing a runtime, can anyone please let me know which one? Thanks.
Floatingshed is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.