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,349
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: 258
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,349
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: 258
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: 172
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,466
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: 258
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: 172
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: 258
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,466
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: 172
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: 172
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,466
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
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 11:01.


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