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 24th June 2020, 21:59   #601  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 202
Sorry, I think I'm complicating things. What I would like to know is if, as it seems, the use of the Width and Height parameters with any Output is enough to make sure that the size of each texture is that intended.
Alexkral is offline   Reply With Quote
Old 27th June 2020, 03:32   #602  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,209
if I remember, the shader takes parameters to know the input size, and the parameters added to the command are the output size. I could be wrong, but I think it's that.
MysteryX is offline   Reply With Quote
Old 27th June 2020, 08:50   #603  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 202
Okay, it seems to work fine so thanks.
Alexkral is offline   Reply With Quote
Old 27th June 2020, 23:20   #604  |  Link
amayra
Quality Checker
 
amayra's Avatar
 
Join Date: Aug 2013
Posts: 271
any plan for VapourSynth support ?
__________________
I love Doom9
amayra is offline   Reply With Quote
Old 28th June 2020, 10:32   #605  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 202
@Amayra, just out of curiosity, what would you use this for in VapourSynth? I mean, something that is not possible with AviSynth?
Alexkral is offline   Reply With Quote
Old 2nd July 2020, 22:51   #606  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,209
I would like to add VapourSynth support. I think AviSynth/VapourSynth cross-platoform compatibility should be the standard in 2020 (although this particular project can't work outside Windows because of DirectX9)

Yet I still haven't looked into learning VapourSynth at all.

It would be useful if someone would write documentation with standard guidelines to write plugins for both VapourSynth and Avisynth, and also for making them cross-platform. Otherwise each dev needs to figure it out on their own.
MysteryX is offline   Reply With Quote
Old 3rd July 2020, 12:13   #607  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,244
Quote:
Originally Posted by MysteryX View Post
I would like to add VapourSynth support. I think AviSynth/VapourSynth cross-platoform compatibility should be the standard in 2020 (although this particular project can't work outside Windows because of DirectX9)

Yet I still haven't looked into learning VapourSynth at all.

It would be useful if someone would write documentation with standard guidelines to write plugins for both VapourSynth and Avisynth, and also for making them cross-platform. Otherwise each dev needs to figure it out on their own.
Cross-platform development is so far outside the scope of everything ending in synth it's not even funny. You need a fairly thick programming book to cover that subject in general.

Here's the uncomfortable truth:
1. Did you write GPU code? Probably not portable
2. Did you write code with unaligned memory access? Probably not portable
3. Did you access the filesystem? Probably not portable
4. Did you partially access a wider numerical type in memory? Definitely not portable!
5. Are you super great at build systems? No? No portability for you!

If you write sane code that only performs some CPU calculations and nothing else it'll probably be portable without much effort but that's about it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 3rd July 2020, 19:04   #608  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,209
These would be good guidelines for those starting to write new plugins. Things to know before writing the first line of code.

What's easier to do is port to VapourSynth and support both. If the actual work is done by a well-encapsulated class, then it should only require 2 separate code files to interop with each *synth?
MysteryX is offline   Reply With Quote
Old 3rd July 2020, 20:16   #609  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,244
Quote:
Originally Posted by MysteryX View Post
These would be good guidelines for those starting to write new plugins. Things to know before writing the first line of code.

What's easier to do is port to VapourSynth and support both. If the actual work is done by a well-encapsulated class, then it should only require 2 separate code files to interop with each *synth?
Yes, supporting both is very easy if you know what a function looks like.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 20th July 2020, 15:26   #610  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 1,831
Quote:
Originally Posted by poisondeathray View Post
I can reproduce this; easier to see with colorbars or similar patterns

fulls=true seems to "fix" it (or match the others)

Code:
ConvertBits(16, fulls=true)
SuperResXBR(MatrixIn="Rec601")
ConvertBits(8, fulls=true, dither=-1)
Quote:
Originally Posted by markiemarcus View Post
Many thanks for this! It does indeed work. I guess the big question is why? I haven't observed this behaviour in KNLMeansCL for example. Just a bug?

I also wonder why it produces very slightly different results (detail-wise) to the LSB method. I was under the impression that despite the different approach to high bit depth processing, the results should be 100% identical.
it's was bug and fixed in https://forum.doom9.org/showthread.p...15#post1916615
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 21st July 2020, 20:08   #611  |  Link
Alexkral
Registered User
 
Join Date: Oct 2018
Posts: 202
Hi MysteryX, I've been working with AviSynth Shader for some time trying to use it to run some Super-resolution CNNs implemented as pixel shaders. You can see the result here. First thing I have to say is that it works very good and fast, so I wanted to thank you for your work, it's great to be able to use a tool like this. However I have found some problems and limitations that I wanted to inform you about, so that you can see what would be necessary to solve them if this is possible:

- This works by using each plane as the input/output for a filter, so with a maximum of 9 clips, the maximum number of filters is 36. To implement a network of 64 filters (most), 16 clips would therefore be necessary. For simple models like FSRCNN, this can be solved by spliting the layers between two or more shaders, but for more complex models this would mean a large increase in the number of shaders, and apart from what this would mean for performance, there is already a limit about the maximum number of shaders that can be used in the same pass (see below).
- I'm not sure what the problem is with Y16 as this seems to have been changing. Using it as input produces the error "CombinePlanes: source has no such plane U". Using it as output returns a YUVA444P16 clip. Maybe this could help to increase performance.
- Dithering is not good for this, having an option to disable it would allow returning an 8-bit clip on the last pass (most of the time the only one) or even a Y8 clip (trying to return a Y8 clip now with Precision = 0 produces the error "CombinePlanes: source bit depth is different from 16").
- Shader Model 3.0 has a limit of 224 Constant registers. This means that, for example, the maximum number of clips that can be used in a shader for a Conv3x3 layer is equal to 6. Unfortunately this can only be solved by using Shader Model 4.0 or spliting the layers as above.
- There is a limit on the maximum number of shaders that can be used in a single pass, after which an access violation error occurs. I have noticed that this limit varies slightly depending on Precision and PlanarOut. This is what I've found in case it could help you:

With Precision = 1 and PlanarOut = false, the limit is 79.
With Precision = 1 and PlanarOut = true, the limit is 76.
With Precision = 2 and PlanarOut = false, the limit is 80.
With Precision = 2 and PlanarOut = true, the limit is 77.

And I think that would be it. For the kind of models I am using, troubleshooting the Y8 and Y16 issues and the dithering issue could help to increase performance. I don't think that solving the other issues related to increasing the number of filters or layers could be especially beneficial, because the models would be much slower and the improvement in results would be only marginal. To have the possibility of implementing other more complex networks, a solution would be necessary though.
Alexkral is offline   Reply With Quote
Old 24th July 2020, 17:49   #612  |  Link
amayra
Quality Checker
 
amayra's Avatar
 
Join Date: Aug 2013
Posts: 271
Quote:
Originally Posted by Alexkral View Post
@Amayra, just out of curiosity, what would you use this for in VapourSynth? I mean, something that is not possible with AviSynth?
will like my script to be cross-platform and all work in one VS script to run it in mpv

I find VapourSynth faster/stable then AviSynth when it comes to frame interpolation
__________________
I love Doom9
amayra is offline   Reply With Quote
Old 16th September 2020, 03:17   #613  |  Link
ENunn
Registered User
 
Join Date: Dec 2019
Posts: 15
Don't know if anyone here still uses this, but do I have to use a combination of SuperRes and another upscaler to upscale say a 720p source to 4k? If not, how do I make it so that it doesn't scale 2x.
The results are pretty good tbh :P
ENunn 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 02:00.


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