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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th December 2015, 04:02   #221  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
MisteryX, I downloaded the .zip file of AviSynth Shader 1.3.2 and tried install it, but I can't do it work. How I install properly, considering I downloaded the AviSynthShader-1.3.2.zip?
I had the Microsoft C++ 2008, 2010, 2012 and 2013 (All of them in last updates) and Microsoft .NET Framework 4.5.2 and 4.6.1, and AviSynth 2.6 ST. Windows 7 32 bits.
__________________
Searching for great solutions

Last edited by luquinhas0021; 30th December 2015 at 04:04.
luquinhas0021 is offline   Reply With Quote
Old 30th December 2015, 05:59   #222  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
luquinhas0021, what error are you getting? AviSynthShader depends neither on VC runtime libraries (they're included, I know it's not good for DLLs but I'm not seeing any issue), nor on .NET.

Here's something cool. The bottleneck is memory transfers, right?

I've done a hybrid between SuperRes and Super-xBR, called SuperResXBR. It performs both operations at the same time, reducing memory transfers and increasing performance.
https://github.com/mysteryx93/AviSyn...rs/SuperResXBR

Using KNLMeansCL with cmode=true allows me to use stronger SuperRes, which further reduces the halo effects of Super-xBR. I'm using SuperRes with 2 passes of .50 or .75, and Super-xBR with its default settings, and it looks just as good as NNEDI3+SuperRes and even slightly better and sharper. Quality is better.

Performance-wise, you'll get about the same performance as NNEDI3+SuperRes, EXCEPT that the CPU runs at 15% instead of 45%! If I encode with x265, this leaves a LOT more CPU juice to run the heavy encoder.

There's only one issue. Here are the screenshots of my complex script with NNEDI3 (left) vs Super-xBR (right). There is a line of distortion at the top with Super-xBR. Anyone has an idea about how to fix that? These screenshots are with 2 passes of .50. 2 passes of .75 works fine with NNEDI3 but appear too much for Super-xBR.


Edit: here's a really good shot. In the middle is NNEDI3+SuperRes(Passes=2, Strength=.75). On the right is the following script. To see how far we've gone, on the left is NNEDI3(nns=4)


With such quality difference, I can forgive the distortion at the top; or crop it afterwards.

Code:
file="Preview.avi"
AviSource(file, audio=True, pixel_type="YV12")
ConvertToYV24()
KNLMeansCL(D=1, A=2, h=2.1, cmode=true, device_type="GPU", device_id=1)
ConvertToYV12()
Crop(0, 0, -8, -0)
SuperResXBR(2, .6, 0, xbrEdgeStrength=2.5, xbrSharpness=1.2, MatrixIn="601")
InterFrame(Cores=8, Tuning="Smooth", NewNum=60000, NewDen=1001)
SuperResXBR(2, .6, 0, xbrEdgeStrength=2.5, xbrSharpness=1.2)
ResizeX(944, 720, 0, 4, -4, -4, kernel="Bicubic", a1=-.6, a2=0)

Last edited by MysteryX; 30th December 2015 at 06:31.
MysteryX is offline   Reply With Quote
Old 30th December 2015, 15:12   #223  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
I'm with AviSynthShader-1.3.2's .zip file. What should I do now?
__________________
Searching for great solutions
luquinhas0021 is offline   Reply With Quote
Old 30th December 2015, 16:00   #224  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Quote:
Originally Posted by luquinhas0021 View Post
I'm with AviSynthShader-1.3.2's .zip file. What should I do now?
Don't be so helpless. Install the plugin like any other plugin. Put the shaders anywhere you want and call them with Shader("C:\Path\To\File") like opening any other file.
foxyshadis is offline   Reply With Quote
Old 30th December 2015, 23:23   #225  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
v1.3.3 is ready.

Version 1.3.3: December 30th 2015
- Shader.dll: Added the option to copy clip data without processing by leaving Path empty
- Shader.dll: Fixed a bug where input textures were unecessarily copied for each command. This slightly increases performance and reduces CPU usage
- Added SuperResXBR, a hybrid between SuperRes and Super-xBR that runs both in the same command chain, reducing memory usage and improving performance
- SuperRes: Fixed a bug where YUV-RGB conversion was ignored when Convert=false
- SuperRes: Added ConvertYuv to specify whether to convert YUV-RGB data or not

When I did the previous tests with Super-xBR combined with SuperRes, it wasn't doing the YUV-RGB conversion which slightly deteriorated the image. By fixing this, results are better and it is seriously good. Performance is also very good. On a 288p clip with a quad-core i7 and a Radeon HD 7670M, I'm getting 55fps with a simple call to SuperResXBR. This is getting interesting.
MysteryX is offline   Reply With Quote
Old 31st December 2015, 00:59   #226  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Mistery, for installing your plugin, all I need is paste Shader.dll on Avisynth's plugin folder (I did it)? In Avisynthshader.zip, comes a bunch of .cso files? What I do with them? Avisynth Shader requires some other plugin or a Windows component for it work?
I did the follow script, but Avisynth speaked that the function SuperXBR doesn't exist:

ImageSource("C:\Users\Fernando H. Silva\Documents\Lucas\Imagens\Cat.jpg")
SuperXBR(EdgeStrenght=1, Sharpness=1)
Some is incomplete?

I've tried this follow script:

LoadPlugin("Shader.dll")

ImageSource("C:\Users\Fernando H. Silva\Documents\Lucas\Imagens\Cat.jpg")
SuperXBR(EdgeStrenght=1, Sharpness=1)

The message that player shows is: "Unable to load "Shader.dll": module not found. Install missing library?"

I'm with v1.3.3. My DirectX is the 11.1.
__________________
Searching for great solutions

Last edited by luquinhas0021; 31st December 2015 at 01:58.
luquinhas0021 is offline   Reply With Quote
Old 31st December 2015, 01:40   #227  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
It's Avisynth 2.6 only, and you need the DirectX runtimes installed. But in this case, you probably just need a full path to the plugin, instead of just the name. The .cso files are the shaders.

MysteryX, I notice in your avsi files, you have no provision for the path to the shaders. Since virtually anything can change the current directory, or people may elect to keep the folder structure as-is, it makes more sense to have a path="" option to point to the shaders, and perhaps trying both pathless and with a local known path if that fails, like SuperRes looking in both ".\" and "SuperRes\".
foxyshadis is offline   Reply With Quote
Old 31st December 2015, 03:17   #228  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Before I had an option to specify the path. Now it will look in the same folder as Shader.dll. Before I had all the CSO files in the same folder as all other plugins. Now I created a sub-folder called Shaders and put Shader.dll and all CSO files in there, to make it cleaner. It uses DirectX9.

Make sure to import SuperResXBR.avsi. If the DLL doesn't load, however, I don't know. Perhaps it's not finding it.
MysteryX is offline   Reply With Quote
Old 1st January 2016, 04:52   #229  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
MisteryX, please, post results of Superres-xBR of Clown and Lighthouse images. The image you posted the results is too blocky.
__________________
Searching for great solutions
luquinhas0021 is offline   Reply With Quote
Old 1st January 2016, 17:37   #230  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by luquinhas0021 View Post
MisteryX, please, post results of Superres-xBR of Clown and Lighthouse images. The image you posted the results is too blocky.
I'll post these later. For now, Super-xBR has a half-pixel shift to the right and a 1-pixel vertical stretching. This makes SuperRes run a little bit offset. And if you run it twice, it doubles the distortion. I'll see what I can do.
MysteryX is offline   Reply With Quote
Old 5th January 2016, 20:18   #231  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
I made another improvement to SuperResXBR: adding WidthOut and HeightOut parameters, allowing to downscale the result before transfering back from the GPU.

This allows to downscale with high-bit-depth and to reduce memory transfers

This change isn't released into a package but you can get the updated file here
https://github.com/mysteryx93/AviSyn...perResXBR.avsi
MysteryX is offline   Reply With Quote
Old 7th January 2016, 07:12   #232  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
WOW. I spent a lot of time trying to port it to DX11 with DirectCompute, to realize DirectCompute would require the shaders to be written differently, and to realize that Super-xBR, after all, is already written with PS_3_0.

Then the next is how to configure the STRUCT parameters... I spent quite a bit of time to allow configuring greater arrays of values, to realize that the STRUCT wasn't even being used. In the end, I realized the parameters being used are in the separate included file.

And the file compiles as-is with PS_3_0. It simply got broken in the unnecessary adaption.

Simply recompiling the original HLSL file solves the distortion problem... duh...

Will test and release soon.
MysteryX is offline   Reply With Quote
Old 7th January 2016, 19:54   #233  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
AviSynthShader v1.3.4 is ready!

What's new:
- Shader.dll: It is now possible to set parameter as vectors with more than 4 values
- Super-xBR and SuperResXBR: Fixed image distortion.
- SuperResXBR: Added WidthOut, HeightOut, b and c to do a final Bicubic resize before reading from GPU, reducing memory transfers

I added image comparison of SuperResXBR to the first post. Now that I look at it, Lighthouse doesn't look that good. Definitely a LOT more details coming out, but also lots of ringing and the straight lines appear like zigzags. You can tone down settings to remove ringing, but the zigzags remain. The 2 other images look very good. These problems only seem apparent on images with straight lines.

Edit: I just added another version of Lighthouse with weak settings that looks better

Last edited by MysteryX; 8th January 2016 at 00:19.
MysteryX is offline   Reply With Quote
Old 8th January 2016, 01:00   #234  |  Link
Hyllian
Registered User
 
Hyllian's Avatar
 
Join Date: Jun 2014
Posts: 42
Quote:
Originally Posted by MysteryX View Post
5. SuperRes(2, .43, 0, """edi_rpow2(2, nns=4, cshift="Spline16Resize")"""), twice

I'd like to understand this config. It's called SuperRes. Does it use Spline16Resize as the resizer?

This is the best combo in my eyes.

Last edited by Hyllian; 8th January 2016 at 01:03.
Hyllian is offline   Reply With Quote
Old 8th January 2016, 02:07   #235  |  Link
sqrt(9801)
Registered User
 
Join Date: Jun 2013
Posts: 24
It uses NNEDI3(_rpow2) and Spline16Resize for correcting the center shift.

Quote:
Originally Posted by MysteryX View Post
And the file compiles as-is with PS_3_0. It simply got broken in the unnecessary adaption.

Simply recompiling the original HLSL file solves the distortion problem... duh...
Does that mean it was always possible to just compile the original HLSL file from the MPDN_Extensions repo and have it work in AvisynthShader ? If so, I kinda feel stupid, haha.
sqrt(9801) is offline   Reply With Quote
Old 8th January 2016, 02:47   #236  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by sqrt(9801) View Post
Does that mean it was always possible to just compile the original HLSL file from the MPDN_Extensions repo and have it work in AvisynthShader ? If so, I kinda feel stupid, haha.
Yes. Don't take it personal.

It means we can also port NNEDI3 the same way. I see NNEDI3 had to be compiled many times... perhaps compiling at run-time and being able to set HLSL compile-time parameters would be useful?

Quote:
Originally Posted by Hyllian View Post
This is the best combo in my eyes.
SuperResXBR is working surprisingly well on my 288p VCD sources.

Last edited by MysteryX; 8th January 2016 at 02:49.
MysteryX is offline   Reply With Quote
Old 8th January 2016, 02:52   #237  |  Link
loneboyz
Registered User
 
Join Date: Jan 2011
Posts: 29
Quote:
Originally Posted by MysteryX View Post
- SuperResXBR: Added WidthOut, HeightOut, b and c to do a final Bicubic resize before reading from GPU, reducing memory transfers
It seem still old, I can't see this parameter of function in script?
loneboyz is offline   Reply With Quote
Old 8th January 2016, 03:54   #238  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by loneboyz View Post
It seem still old, I can't see this parameter of function in script?
Oups. Fixed.

SuperResXBR seems very good on irregular textures and live action footage, even when it has artifacts. However, it's not as good on geometric forms and straight lines.

Last edited by MysteryX; 8th January 2016 at 05:22.
MysteryX is offline   Reply With Quote
Old 8th January 2016, 05:41   #239  |  Link
loneboyz
Registered User
 
Join Date: Jan 2011
Posts: 29
Thank MysteryX!

Follow your documentation, SuperResXBR with default b=0, c=0.75 when downscale with Bicubic (call second after larger upscale). So, what this has different from your previous settings b=-0.6, c=0 in SuperRes?
loneboyz is offline   Reply With Quote
Old 8th January 2016, 05:47   #240  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by loneboyz View Post
Thank MysteryX!

Follow your documentation, SuperResXBR with default b=0, c=0.75 when downscale with Bicubic (call second after larger upscale). So, what this has different from your previous settings b=-0.6, c=0 in SuperRes?
-.6,0 actually looks very similar to 0,.75, and 0,.75 just looks slightly better.

And this goes right back to what's written in the Bicubic documentation about these settings
http://avisynth.nl/index.php/Resize
MysteryX is offline   Reply With Quote
Reply


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 21:17.


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