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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 30th June 2016, 15:25   #1881  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by LigH View Post
Rare occasion... I hope you had
Cola vs Beer
pinterf is offline  
Old 30th June 2016, 16:33   #1882  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
The one with the new TV_range=true parameter is O.K.
The other two clips are corrupted.
What is the conclusion? The second method receives a limited prefiltered clip, still it shows garbage
something in Dither_Luma_Rebuild not like avs+, did you try something else? like prefilter 1 and 2 and 3?
__________________
See My Avisynth Stuff
real.finder is offline  
Old 30th June 2016, 17:37   #1883  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by real.finder View Post
something in Dither_Luma_Rebuild not like avs+, did you try something else? like prefilter 1 and 2 and 3?
Only prefilter=4 (knl) gives corruption.
__________________
@turment on Telegram
tormento is offline  
Old 30th June 2016, 18:03   #1884  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
Only prefilter=4 (knl) gives corruption.
try this then

Code:
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("lsmashvideosource", 3)
lsmashvideosource("13HoursCUT.mp4", format="YUV420P8")
Crop(0, 140, 0, -140)
# In a more lucid state I could probably have laid out this block much better... or not...
NL_in   = Dither_convert_8_to_16()
NL_W    = width(NL_in)
U8      = UToY8(NL_in)
V8      = VToY8(NL_in)
NL_lsb  = StackVertical(StackVertical(Dither_get_msb(u8),Dither_get_msb(v8)),StackVertical(Dither_get_lsb(u8),Dither_get_lsb(v8)))
 
Y8      = StackHorizontal(ConvertToY8(NL_in),NL_lsb)

Y8      = Y8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
 
u_h = u8.height()/2
v_h = v8.height()/2
 
u16 = StackVertical(Dither_get_msb(Y8).crop(NL_W,0,0,-v_h),Dither_get_lsb(Y8).crop(NL_W,0,0,-v_h))
v16 = StackVertical(Dither_get_msb(Y8).crop(NL_W,u_h, 0,0),Dither_get_lsb(Y8).crop(NL_W,u_h, 0,0))
 
prefilter4 = YToUV(u16,v16,Y8.crop(0,0,-u8.width(),0))

SMDegrain (tr=4,PreFilter=prefilter4.SmoothLevels16(preset="tv2pc"),TV_range=false,thSAD=400,contrasharp=false,refinemotion=false,plane=4,chroma=true,lsb=true,mode=6)
Prefetch(8)
+ this one http://pastebin.com/JtWFN124 (not tested enough)

Code:
SMDegrain (tr=4,PreFilter=4,thSAD=400,contrasharp=false,refinemotion=false,plane=4,chroma=true,lsb=false,mode=6)
Prefetch(8)
yes, use it with no lsb for testing purpose
__________________
See My Avisynth Stuff

Last edited by real.finder; 30th June 2016 at 18:20.
real.finder is offline  
Old 1st July 2016, 05:47   #1885  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by real.finder View Post
try this then

+ this one http://pastebin.com/JtWFN124 (not tested enough)
Both works. No corruption.
__________________
@turment on Telegram
tormento is offline  
Old 1st July 2016, 08:47   #1886  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Weird.

Replaced the one-pass combined YUV KNLMeans path
Code:
NL_in   = Dither_convert_8_to_16()
NL_W    = width(NL_in)
U8      = UToY8(NL_in)
V8      = VToY8(NL_in)
NL_lsb  = StackVertical(StackVertical(Dither_get_msb(u8),Dither_get_msb(v8)),StackVertical(Dither_get_lsb(u8),Dither_get_lsb(v8)))
 
Y8      = StackHorizontal(ConvertToY8(NL_in),NL_lsb)

Y8      = Y8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
 
u_h = u8.height()/2
v_h = v8.height()/2
 
u16 = StackVertical(Dither_get_msb(Y8).crop(NL_W,0,0,-v_h),Dither_get_lsb(Y8).crop(NL_W,0,0,-v_h))
v16 = StackVertical(Dither_get_msb(Y8).crop(NL_W,u_h, 0,0),Dither_get_lsb(Y8).crop(NL_W,u_h, 0,0))
 
prefilter4 = YToUV(u16,v16,Y8.crop(0,0,-u8.width(),0))
With a 3 pass KNLMeans path (distinct Y, U, V)
Code:
NL_in   = Dither_convert_8_to_16()
U8      = UToY8(NL_in)
V8      = VToY8(NL_in)
Y8      = ConvertToY8(NL_in)
U16 = U8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
V16 = V8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
Y16 = ConvertToY8(NL_in).KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
prefilter4 = YToUV(u16,v16,Y16)
Result is:
KNLMeansCL: fatal error!

No MT.

Then I tried with different avisynth DLLs I have:
Classic AVS 2.6: no error
Avisynth+ r1576: no error
From Avisynth r1689 on: KNLMeansCL: fatal error!

When omitting KNLMeans calculation for clip V16, it works again.
Code:
U8      = UToY8(NL_in)
V8      = VToY8(NL_in)
Y8      = ConvertToY8(NL_in)
U16 = U8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
V16 = U16 #V8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
Y16 = ConvertToY8(NL_in).KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
prefilter4 = YToUV(u16,v16,Y16)
Could you try if it works or not for you?
pinterf is offline  
Old 1st July 2016, 08:52   #1887  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Ultim, Pinter said that making AviSynth+ cross-platform-compatible wasn't his area of expertise and someone would have to do that. Is that something you'll handle or we'll have to wait until someone else volunteers?
MysteryX is offline  
Old 1st July 2016, 09:02   #1888  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by pinterf View Post
When omitting KNLMeans calculation for clip V16, it works again.
Code:
U8      = UToY8(NL_in)
V8      = VToY8(NL_in)
Y8      = ConvertToY8(NL_in)
U16 = U8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
V16 = U16 #V8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
Y16 = ConvertToY8(NL_in).KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU")
prefilter4 = YToUV(u16,v16,Y16)
Could you try if it works or not for you?
Works.

P.S: When I say it "works", it is corruption related. I am not doing any analysis about quality of output.
__________________
@turment on Telegram
tormento is offline  
Old 1st July 2016, 09:17   #1889  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by tormento View Post
Works.

P.S: When I say it "works", it is corruption related. I am not doing any analysis about quality of output.
Just to make sure, I suppose you tried with the non-uncommented V16 line (the quote is the commented one)?
pinterf is offline  
Old 1st July 2016, 09:25   #1890  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by pinterf View Post
Just to make sure, I suppose you tried with the non-uncommented V16 line (the quote is the commented one)?
The "works" is for the commented one.

The uncommented works with Prefetch(6) instead of Prefetch(8) because otherwise GPU memory requirements goes beyond my 2GB card.
__________________
@turment on Telegram

Last edited by tormento; 1st July 2016 at 10:17. Reason: Prefetch(6) works.
tormento is offline  
Old 1st July 2016, 10:01   #1891  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
@tormento, pinterf
You guys realize that using Prefetch(8) will use 8 times the GPU memory, right? I ran a little test and ran out of memory at Prefetch(4). I do however only have 1G graphics memory.

Use AVSMeter with the -gpu switch to check GPU memory usage.

When you run out of GPU memory you'll get this:
KNLMeansCL: fatal error! (AviSynthGetFrame)
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 1st July 2016 at 10:03.
Groucho2004 is offline  
Old 1st July 2016, 10:14   #1892  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by Groucho2004 View Post
Use AVSMeter with the -gpu switch to check GPU memory usage.

When you run out of GPU memory you'll get this:
KNLMeansCL: fatal error! (AviSynthGetFrame)
You are right. I have 2 GB on my GPU and the "uncommented script" with Prefetch(6) works, with following stats:

Code:
[Runtime info]
Frames processed:               107 (0 - 106)
FPS (min | max | average):      0.362 | 830086 | 8.244
Memory usage (phys | virt):     1272 | 2775 MiB
Thread count:                   171
CPU usage (average):            54%
GPU usage (average):            29%
Video engine load (average):    15%
GPU memory usage:               1741 MiB
Time (elapsed):                 00:00:12.980
With Prefetch(8), it goes to 1920 MB and then KNL crashes.
__________________
@turment on Telegram
tormento is offline  
Old 1st July 2016, 10:17   #1893  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by pinterf View Post
Just to make sure, I suppose you tried with the non-uncommented V16 line (the quote is the commented one)?
As I wrote, the uncommented works with Prefetch(6) and no corruption too.
__________________
@turment on Telegram
tormento is offline  
Old 1st July 2016, 10:23   #1894  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by Groucho2004 View Post
@tormento, pinterf
You guys realize that using Prefetch(8) will use 8 times the GPU memory, right? I ran a little test and ran out of memory at Prefetch(4). I do however only have 1G graphics memory.

Use AVSMeter with the -gpu switch to check GPU memory usage.

When you run out of GPU memory you'll get this:
KNLMeansCL: fatal error! (AviSynthGetFrame)
No MT mode here
pinterf is offline  
Old 1st July 2016, 10:28   #1895  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
The author of KNLMeansCL explicitely recommended NOT to use MT with KNLMeans, and if you use, set it to MT mode=3. A single instance of it then gets created.
MysteryX is offline  
Old 1st July 2016, 11:05   #1896  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by pinterf View Post
Weird.

Replaced the one-pass combined YUV KNLMeans path
...
With a 3 pass KNLMeans path (distinct Y, U, V)
Code:
NL_in   = Dither_convert_8_to_16()
U8      = UToY8(NL_in)
V8      = VToY8(NL_in)
Y8      = ConvertToY8(NL_in)
U16 = U8.KNLMeansCL(D=0, A=1, h=7.0,lsb_inout=true,device_type="GPU")
V16 = V8.KNLMeansCL(D=0, A=1, h=7.0,lsb_inout=true,device_type="GPU")
Y16 = ConvertToY8(NL_in).KNLMeansCL(D=0, A=1, h=7.0,lsb_inout=true,device_type="GPU")
prefilter4 = YToUV(u16,v16,Y16)
With D=0 it works. (tried before without success: GPU/CPU, lsb_inout=false,h=1.0)
Still no MT. Maybe we should pass the problem to the right forum.
pinterf is offline  
Old 1st July 2016, 11:10   #1897  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by pinterf View Post
With D=0 it works. (tried before without success: GPU/CPU, lsb_inout=false,h=1.0)
Still no MT. Maybe we should pass the problem to the right forum.
"d=0" uses less gpu memory.
What graphics card do you have? How much memory? Have you tried monitoring the GPU memory usage?
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 1st July 2016, 11:57   #1898  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
AMD 7570, 1G RAM. 385 MB Dedicated, 98 MB Dynamic.
With classic AVS and Avs+ 1576 there is no problem.
pinterf is offline  
Old 1st July 2016, 12:11   #1899  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by pinterf View Post
Still no MT. Maybe we should pass the problem to the right forum.
+1

Let's stay on image corruption topic.
__________________
@turment on Telegram
tormento is offline  
Old 1st July 2016, 14:26   #1900  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
1.) Image corruption solved*

Avisynth.dll compiled for Debug has no corruption.
Release version has.

2.) KNLMeansCL fatal error (3*call in a sequence + SMDegrain) solved**

Avisynth.dll compiled for Debug has no fatal error.
Release version has.

Programmers' dream: debug the release.

*, **not solved
pinterf is offline  
Closed Thread

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 15:41.


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