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 2016, 15:24   #1821  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 1,034
Quote:
Originally Posted by MysteryX View Post
I've also been having issues with SMDegrain(prefilter=4) working terrible with MT; working faster with a single thread. I suppose this script will have the same problem.
Try to remove AVP.dll
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 24th June 2016, 15:31   #1822  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 1,034
Quote:
Originally Posted by DJATOM View Post
Strange, but in avspmod x64 it only shows the first 800 pixels for height. Applying SMDegrain (with lsb) didn't change it, still 1920x800. 32-bit version works fine. Need to investigate.
Upd: made a new index and problem is fixed now (tested with avs+ r1873, x64; index made with DGIndexIM beta 50 X64). Still can't see any corruption :\
Just tried with DGIndexIM beta 50 x64 and I see the same corruption.

This is the script I used:

PHP Code:
SetMemoryMax(8000)
SetFilterMTMode("DEFAULT_MT_MODE"2)
SetFilterMTMode("ChangeFPS"3)

SetFilterMTMode("DGSourceIM"3)
LoadPlugin("D:\eseguibili\media\DGDecIM\x64\dgdecodeim.dll")
DGSourceIM("E:\in\2_24 13 hours  The secret soldiers of Benghazi\13HoursAV26.dgi"silent=true)

ChangeFPS(last,last,true)

Crop(01400, -140)

SMDegrain (tr=4,PreFilter=4,thSAD=400,contrasharp=false,refinemotion=false,plane=4,chroma=true,lsb=true,mode=6)

Prefetch(8
Have you tried a preview only or real encoding?

Are you under Windows 8 or 10?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 24th June 2016, 15:42   #1823  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 187
Quote:
Originally Posted by tormento View Post
Have you tried a preview only or real encoding?
Preview in avspmod.
Quote:
Originally Posted by tormento View Post
Are you under Windows 8 or 10?
Windows 7 Ultimate.
DJATOM is offline   Reply With Quote
Old 24th June 2016, 15:58   #1824  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,117
Quote:
Originally Posted by tormento View Post
Here is the original sample from BD.

When I use AviSynth+, I have image corruption.

13HoursAVS+.dgi

PHP Code:
SetMemoryMax(8000)
SetFilterMTMode("DEFAULT_MT_MODE"2)
SetFilterMTMode("ChangeFPS"3)
SetFilterMTMode("DGSource"3)
LoadPlugin("D:\eseguibili\media\DGDecNV\x64\DGDecodeNV.dll")
DGSource("E:\in\2_24 13 hours  The secret soldiers of Benghazi\13HoursAVS+.dgi")
#SetFilterMTMode("DGSourceIM", 3)
#LoadPlugin("D:\eseguibili\media\DGDecIM\x64\dgdecodeim.dll")
#DGSourceIM("E:\in\2_24 13 hours  The secret soldiers of Benghazi\13HoursCUT.dgi", silent=true)
ChangeFPS(last,last,true)
#Crop(0, 140, 0, -140)
SMDegrain (tr=4,PreFilter=4,thSAD=400,contrasharp=false,refinemotion=false,plane=4,chroma=true,lsb=true,mode=6)
Prefetch(8
I also cannot reproduce the corruption. I tried the script exactly as is. However, if I randomly seek multiple times back and forward to random spots it makes VDub freeze. The script finishes without problems in AvsMeter though. No problems in VDub's 'Run video analysis pass' also. What version of SMDegrain are you using? I'll do a bit more testing over the weekend.

I'm using Windows 7, with Windows 10 some problems have been reported:

Quote:
Originally Posted by Khanattila View Post

FAQ
  • Q) I can't make DGNV and KNLmeansCL work together in avs script.
    A) Post #650, Post #664.
Reel.Deel is offline   Reply With Quote
Old 24th June 2016, 16:05   #1825  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 1,034
Quote:
Originally Posted by DJATOM View Post
Preview in avspmod.

Windows 7 Ultimate.
Problems arose with Windows 10, AFAIK.

Try to do a real encode.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 24th June 2016, 16:08   #1826  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 1,034
Quote:
Originally Posted by Reel.Deel View Post
What version of SMDegrain are you using? I'll do a bit more testing over the weekend.
Latest. To make it work with x64 I had to do little tunings for prefilter=2.
Quote:
Originally Posted by Reel.Deel View Post
FAQ
Q) I can't make DGNV and KNLmeansCL work together in avs script.
A) Post #650, Post #664.
It works in a pure x64 environment. Moreover, the same behaviour happens with DGIndexIM.

P.S: I have tried AVSPmod_x64 in a pure x64 environment. Corruption happens in frame 24 and others.

Thanks for reporting me that on obsolete OS, it works. And, ABOVE ALL, try it in a pure x64 environment.
__________________
@turment on Telegram

Last edited by tormento; 24th June 2016 at 16:17.
tormento is offline   Reply With Quote
Old 24th June 2016, 16:31   #1827  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 187
Quote:
Originally Posted by tormento View Post
Problems arose with Windows 10, AFAIK.

Try to do a real encode.
http://www114.zippyshare.com/v/zj9xTEWa/file.html
DJATOM is offline   Reply With Quote
Old 24th June 2016, 17:21   #1828  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 1,034
Quote:
Originally Posted by DJATOM View Post


Not windows 10
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 24th June 2016, 17:28   #1829  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 187
Indeed, I just don't want to use the worst OS ever.
DJATOM is offline   Reply With Quote
Old 24th June 2016, 18:21   #1830  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 1,034
Quote:
Originally Posted by djatom View Post
indeed, i just don't want to use the worst os ever.
omg lol
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 25th June 2016, 19:43   #1831  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,245
Artifact hunting mode ON

Reproduced.

Converted the .h264 into mp4 with ffmpeg because I couldn't get work any dgdecxxx.

Find my input source here

Script:
Code:
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("lsmashvideosource", 3)
lsmashvideosource("13HoursCUT.mp4", format="YUV420P8")
Crop(0, 140, 0, -140)
SMDegrain (tr=4,PreFilter=4,thSAD=400,contrasharp=false,refinemotion=false,plane=4,chroma=true,lsb=true,mode=6)
Prefetch(8)
Let's edit SMDegrain.avsi.
We remove and simplify the non-relevant lines (assuming the SMDegrain calling parameters)

So we replace the whole
Code:
pref=eval(""" ...... 
             """)
part with

Code:
NL_in   = input8.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)

#PF remark:
# We created a big image, assuming that U and V is half the height in YV12
# Y8:
# Y_msb U_msb
# Y_msb V_msb
# Y_lsb U_lsb
# Y_lsb V_lsb

Y8      = Y8.KNLMeansCL(D=1, A=1, h=7.0,lsb_inout=true,device_type="GPU") # D=0/1 nochange GPU/CPU:nochange

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))

pref=YToUV(u16,v16,Y8.crop(0,0,-u8.width(),0))
Ok. Now let's comment out the KNLMeansCL call.
Code:
Y8=Y8#.KNLMeansCL(D=1,A=1,h=7.0,lsb_inout=true,device_type="GPU")
No more artifact.

I don't know how KNLMeans work but the idea that all planes are stuffed into one greyscale image and is sent to the plugin may fail sometimes.

Now I really wonder why only avs+ is affected.

Last edited by pinterf; 25th June 2016 at 19:48.
pinterf is offline   Reply With Quote
Old 25th June 2016, 20:14   #1832  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,117
Quote:
Originally Posted by pinterf View Post
I don't know how KNLMeans work but the idea that all planes are stuffed into one greyscale image and is sent to the plugin may fail sometimes.

Now I really wonder why only avs+ is affected.
I think the script is doing that because KNLMeansCl does not process chroma unless the input format is YV24 or RGB. I wonder why Dogway didn't separate the planes, process them indivdually, and then merge them?

I wish I could help but I still cannot reproduce the corruption even with the simplified script. :/

Are you using Windows 10?
Reel.Deel is offline   Reply With Quote
Old 25th June 2016, 20:27   #1833  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,245
No, Win7Prof.
Built a special avisynth.dll in which I switched off SSE3 and newer cpuid detection but the problem remained.
pinterf is offline   Reply With Quote
Old 25th June 2016, 20:53   #1834  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,245
O.K.

Still smdegrain.avsi, Dither_Luma_Rebuild

Replaced the line with 56064 (219*256) with 61184 (239*256)
(and the 219 with 239 but it does not play now).
The artifact disappeared.

There is another thing that may not be intentional:
Code:
String(lsb?65536:255)
For me 65535 would be more logical, but I'm far from fluently reading the avisynth expression syntax

Code:
function Dither_Luma_Rebuild (clip src, float "s0", float "c",int "uv", bool "lsb", bool "lsb_in", bool "lsb_out", int "mode", float "ampn", bool "slice"){
lsb_in  = Default( lsb_in  ,false)
lsb_out = Default( lsb_out ,false)
lsb     = Default( lsb     ,lsb_in || lsb_out)
mode    = Default( mode ,6)
uv      = Default(uv,    3)
s0      = Default(s0,  2.0)
c       = Default(c,  1.0/16)
ampn    = Default(ampn, 0.0)
slice   = Default(slice, true)

    k = (s0 - 1) * c
    t = lsb_in ? "x 4096 - 61184 / 0 1 clip" : "x 16 - 239 / 0 1 clip"
#    t = lsb_in ? "x 4096 - 56064 / 0 1 clip" : "x 16 - 219 / 0 1 clip"
    e = String(k)+" "+String(1+c)+" "+String((1+c)*c)+" "+t+" "+String(c)
\       +" + / - * "+t+" 1 "+String(k)+" - * + "+String(lsb?65536:255)+" *"
src
lsb ? (lsb_in ? Dither_lut16 (yexpr=e,expr="x 32768 - 32768 * 28672 / 32768 +",y=3, u=uv, v=uv)   : \
                Dither_lut8  (yexpr=e,expr="x 128 - 32768 * 112 / 32768 +"    ,y=3, u=uv, v=uv))  : \
                mt_lut       (yexpr=e,expr="x 128 - 128 * 112 / 128 +"        ,y=3, u=uv, v=uv)
lsb_out ? last : (lsb ? Ditherpost(mode=mode,ampn=ampn,slice=slice,staticnoise=ampn!=0.0?true:false,u=uv,v=uv) : last)}
I don't know what is the right constant there, the creators of this script can correct it for the right value.

Last edited by pinterf; 25th June 2016 at 20:54. Reason: correction
pinterf is offline   Reply With Quote
Old 25th June 2016, 22:34   #1835  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,245
Or 220*256-1? instead of 219*256? Anyway it can be different rounding in evaluation than in classic avisynth?
pinterf is offline   Reply With Quote
Old 25th June 2016, 22:39   #1836  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,117
Have you look at cretindesalpes original script: http://forum.doom9.org/showthread.ph...18#post1548318
Reel.Deel is offline   Reply With Quote
Old 26th June 2016, 03:16   #1837  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 1,287
this with TV_range bool http://pastebin.com/vz6Ewuvv

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))
try first
Code:
SMDegrain (tr=4,PreFilter=prefilter4,TV_range=false,thSAD=400,contrasharp=false,refinemotion=false,plane=4,chroma=true,lsb=true,mode=6)
Prefetch(8)
then try
Code:
SMDegrain (tr=4,PreFilter=prefilter4.SmoothCustom16("Y>60160?y:y","u>61440?u:u","v>61440?v:v",limiter=true),thSAD=400,contrasharp=false,refinemotion=false,plane=4,chroma=true,lsb=true,mode=6)
Prefetch(8)
and
Code:
SMDegrain (tr=4,PreFilter=prefilter4.Ditherpost(mode=6,ampn=0.0,staticnoise=false).Limiter(),thSAD=400,contrasharp=false,refinemotion=false,plane=4,chroma=true,lsb=true,mode=6)
Prefetch(8)
__________________
My Avisynth Stuff

Last edited by real.finder; 27th June 2016 at 22:29.
real.finder is offline   Reply With Quote
Old 26th June 2016, 19:37   #1838  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,942
Quote:
Originally Posted by pinterf View Post
There is another thing that may not be intentional:
Code:
String(lsb?65536:255)
For me 65535 would be more logical, but I'm far from fluently reading the avisynth expression syntax
The typical "ternary operator" (boolean_expression ? true_case_result : false_case_result)... inside a function of a C-like language, you could expand this to:

Code:
if(lsb) return String(65536); else return String(255);
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 26th June 2016, 19:44   #1839  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
@ultim or someone

I have a question about multi-threading.

Is it possible to implement a temporal IIR filter as MT_NICE_FILTER ?
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 26th June 2016, 20:07   #1840  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 1,287
Quote:
Originally Posted by LigH View Post
The typical "ternary operator" (boolean_expression ? true_case_result : false_case_result)... inside a function of a C-like language, you could expand this to:

Code:
if(lsb) return String(65536); else return String(255);
he mean the value, 65536 is full 16 bit range, 256 is full 8 bit range, so he say that it should (65536 -1) like (256 -1)
__________________
My Avisynth Stuff
real.finder 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 22:32.


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