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 2017, 21:29   #481  |  Link
CkJ
Registered User
 
Join Date: Jul 2014
Posts: 24
Hi @MysteryX
I update the latest version and get this error https://i.imgbox.com/ISPA6GoC.png
My script:
Code:
loadplugin("AviSynthShader-1.6.1\Shader.dll")
import("AviSynthShader-1.6.1\Shader.avsi")
import("ResizeX_v1.0.1.avsi")
import("edi_rpow2_v1.0.avsi")
loadplugin("nnedi3.dll")
ImageSource("Lighthouse.png").ConvertToRGB24
SuperRes(2, .4, 0, """edi_rpow2(2, edi="nnedi3", cshift="spline36resize")""")
CkJ is offline   Reply With Quote
Old 17th April 2017, 17:30   #482  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 1,978
CkJ, your script works here. What version of Avisynth are you using? x86 or x64? Anyone else have this issue?
MysteryX is offline   Reply With Quote
Old 17th April 2017, 21:36   #483  |  Link
CkJ
Registered User
 
Join Date: Jul 2014
Posts: 24
I'm using Avisynth 2.6 x86.
CkJ is offline   Reply With Quote
Old 6th August 2017, 08:49   #484  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 333
Quote:
Ok. Can you make it support Y8?
If i need to use it only on luma that would speed up things.
Quote:
Originally Posted by MysteryX View Post
No, HLSL shaders work on RGB data. Any other data format first needs to be converted into 16-bit RGB. Plus, the necessary colorspace conversions (Gamma to Linear RGB) wouldn't be possible with Y8 data.
Then what about this idea?
Adding boolean value called grayscaled or something.
If grayscaled is false, it works normally.
If grayscaled is true then after video is converted to RGB, it upscales only one channel of RGB clip and duplicate it and merge them together as R, G, and B channels since black and white video has all same value of R, G, B channels right?
By black and white, I mean YUV video converted to Y8 or YUV video that grayscale() function is called.
bxyhxyh is offline   Reply With Quote
Old 6th August 2017, 17:03   #485  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 1,978
Instead, how about you simply convert your Y8 clip to RGB before calling it? Or to YV24 to do more precise color conversion on the GPU.

It would be good to process a single plane for performance reasons; but this idea gives no gain.
MysteryX is offline   Reply With Quote
Old 6th August 2017, 18:52   #486  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 333
Quote:
Originally Posted by MysteryX View Post
Instead, how about you simply convert your Y8 clip to RGB before calling it? Or to YV24 to do more precise color conversion on the GPU.
What's the point of doing that if SuperRes upscales all three channels of RGB clip?

It seems you didn't get the point, or I didn't explain it clear.

For example you would need to upscale only luma channel. Then upscale chroma with standard resizer and merge them together.
Something like
Code:
source=anysource()

luma    = source.ConvertToY8()
lumabig = luma.superres()

u = source.utoY8().FasterAndSimplerResizer()
v = source.vtoY8().FasterAndSimplerResizer()

YtoUV(u,v,lumabig)
You said that's not possible because shader converts it to RGB clip anyway even if you make it to support Y8 clip. Therefore there is no gain.

So I'm telling if shader converts it to RGB then what about make it upscaling only one channel from THAT intermediate RGB clip internally? (since grayscaled clip has all same value for all three channels of RGB clip)

like this.
Code:
source=anysource()

luma    = source.grayscale()                     # or luma = source.ConvertToY8()
lumabig = luma.superres(grayscaled=true)         # this would upscale only one channel of RGB clip that's converted from 'luma' clip. Then duplicate it and merge them together in the process.

u = source.utoY8().FasterAndSimplerResizer()
v = source.vtoY8().FasterAndSimplerResizer()

YtoUV(u,v,lumabig)

Last edited by bxyhxyh; 6th August 2017 at 19:25.
bxyhxyh is offline   Reply With Quote
Old 6th August 2017, 19:40   #487  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 1,978
Processing only 1 channel on the GPU and treating it as Luma is definitely possible. However, the bottleneck is memory transfer from the GPU, so you most likely won't see any performance gain. Also, SuperRes is designed to work with 3 planes of RGB data -- but different shaders can be designed to work with 1 Luma plane.
MysteryX is offline   Reply With Quote
Old 9th August 2017, 21:38   #488  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 1,978
Version 1.6.2 is ready!

What's new:
- Added Factor parameter to SuperXBR and SuperResXBR to upscale by a factor of 2, 4, 8 or 16 in one call
MysteryX is offline   Reply With Quote
Old 19th August 2017, 13:34   #489  |  Link
gmail123
Registered User
 
Join Date: Dec 2014
Posts: 13
11

Quote:
Originally Posted by MysteryX View Post
Version 1.6.2 is ready!

What's new:
- Added Factor parameter to SuperXBR and SuperResXBR to upscale by a factor of 2, 4, 8 or 16 in one call
avs 2.6

http://imgbox.com/t0BvXH6I

but avs+ is good.

Last edited by gmail123; 19th August 2017 at 13:36. Reason: no map
gmail123 is offline   Reply With Quote
Old 23rd August 2017, 05:45   #490  |  Link
gmail123
Registered User
 
Join Date: Dec 2014
Posts: 13
highest quality

my English is poor.
how to use full 16bit processing queue,get highest quality for video upscale.
sample:
LWLibavVideoSource("D:\film\12.mkv")
Dither_convert_8_to_16()
?
SuperRes(?)
?
DitherPost()

how to use "ConvertToShader(Precision=3)" 。

please help me.thanks.

Last edited by gmail123; 23rd August 2017 at 09:57. Reason: ok
gmail123 is offline   Reply With Quote
Old 23rd August 2017, 17:03   #491  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 1,978
If using AVS 2.6 and Stack16 format, set lsb_in=true and lsb_out=true

If using AVS+, use ConvertBits(16) and ConvertBits(8, dither=0), and it will automatically process in 16-bit

If you're having issues with AVS 2.6 and YV12 format, try converting to YV24 first (ideally in 16-bit). That conversion needs to be done anyway.
MysteryX is offline   Reply With Quote
Old 24th August 2017, 17:06   #492  |  Link
gmail123
Registered User
 
Join Date: Dec 2014
Posts: 13
wrong

avs 2.6

https://imgbox.com/hJBS0AvY

Last edited by gmail123; 24th August 2017 at 17:10. Reason: g
gmail123 is offline   Reply With Quote
Old 28th August 2017, 15:26   #493  |  Link
gmail123
Registered User
 
Join Date: Dec 2014
Posts: 13
wrong

avs+,in megui, script:
AddAutoloadDir("D:\video\MeGUI\tools\avisynth_plugin")
LoadPlugin("D:\video\MeGUI\tools\lsmash\LSMASHSource.dll")
LWLibavVideoSource("C:\Users\pc\Desktop\am.mkv")
ConvertBits(16)
SuperRes(3, .43, 0, """nnedi3_rpow2(2, nns=4, cshift="Spline16Resize")""")
ConvertBits(8, dither=0)
but
gmail123 is offline   Reply With Quote
Old 28th August 2017, 15:42   #494  |  Link
gmail123
Registered User
 
Join Date: Dec 2014
Posts: 13
how to use Precision=3 or Precision=2?
please help me, Correct the error in the script.

ConvertToShader(3)
LWLibavVideoSource("C:\Users\pc\Desktop\am.mkv")
ExecuteShader(last,Clip1Precision=3,Precision=3,OutputPrecision=2)
ConvertFromShader(3)

ConvertBits(16)
SuperRes(3, .43, 0, """nnedi3_rpow2(2, nns=4, cshift="Spline16Resize")""")
ConvertBits(8, dither=0)
gmail123 is offline   Reply With Quote
Old 28th August 2017, 17:11   #495  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 1,978
Code:
LWLibavVideoSource("C:\Users\pc\Desktop\am.mkv")
ConvertToShader(3)
ExecuteShader(last,Clip1Precision=3,Precision=3,OutputPrecision=2)
ConvertFromShader(2)
If OutputPrecision=2, ConvertFromShader must be 2. Note, however, that Precision=3 is half-float and it is slow to convert on the CPU. It is generally recommended to use 2(int) for input/output and 3(half-float) for internal processing on the GPU.

Also, ExecuteShader requires a command chain to execute. Right now you've got nothing to execute.

Code:
ConvertBits(16)
SuperRes(3, .43, 0, """nnedi3_rpow2(2, nns=4, cshift="Spline16Resize")""")
ConvertBits(8, dither=0)
This looks like a bug. I'll have to look into fixing a few bugs.
MysteryX is offline   Reply With Quote
Old 29th August 2017, 14:21   #496  |  Link
SaurusX
Registered User
 
Join Date: Feb 2017
Posts: 24
Thanks for your work on this, MysteryX. At this point I don't think there's a better upscaling process than SuperRes.
SaurusX is offline   Reply With Quote
Old 7th September 2017, 13:57   #497  |  Link
thecoreyburton
Registered User
 
Join Date: Jul 2015
Posts: 87
Hi MysteryX,

I'm looking to use AviSynthShader to apply various Retroarch shaders to losslessly dumped pixel game footage and was wondering if you could help me. I've only ever lightly explored the world of shaders - enough to know that CG and HLSL are extremely similar (although not identical) - but I was hoping that some of those might work. So far I've had no luck, even for shaders known to work with HLSL compilers. I get a simple "Failed to open pixel shader" error message when trying the following script:

Quote:
AVISource("Lossless.avi")
SourceFile=Last
ConvertToShader(Precision=1)
Shader("C:\dot.cg")
ExecuteShader(last, SourceFile, Clip1Precision=1, Precision=1, OutputPrecision=1)
ConvertFromShader(Precision=1,Format=RGB32)
In this case, test.cg can be any one of the shaders from the above link (though if something specific is required, I can select one). Is it an incompatibility between languages, or am I doing something wrong?

Edit: Here's a proper example file. I'd like to get this working, though I know it may not be possible.

Last edited by thecoreyburton; 8th September 2017 at 10:35.
thecoreyburton is offline   Reply With Quote
Old 8th September 2017, 17:40   #498  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 1,978
You might be using a shader of the wrong version. This uses DirectX9 for processing which requires Pixel Shader version 3.0. Pixel Shader v5.1 would instead require DirectX12.

Try compiling manually using fxc

Code:
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Utilities\bin\x86\fxc.exe /T ps_3_0 /Fo "..\YVToYuv.cso" "YVToYuv.hlsl"
MysteryX is offline   Reply With Quote
Old 8th September 2017, 19:28   #499  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 1,978
AviSynthShader v1.6.3 is ready!

What's new:
- Fixed compatibility regression with Avisynth 2.6
- Now converts properly from YV16 format with Avisynth 2.6
- Updated Avisynth headers
MysteryX is offline   Reply With Quote
Old 9th September 2017, 04:18   #500  |  Link
thecoreyburton
Registered User
 
Join Date: Jul 2015
Posts: 87
No such luck - but I can now see what the problem is. Thanks for the reply, I really appreciate it.

Fantastic job on the plugin, too!
thecoreyburton 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 07:32.


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