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 4th December 2019, 17:29   #4981  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by wonkey_monkey View Post
Bug report: it seems that the standard resizers (spline16, bicubic, and bilinear, at least) don't process the alpha planes of YUVA clips.
Fixed in source, available on my repo, no release yet.

(@jpsdr, this fix probably affects your _MT resizer versions because they are using this source)
pinterf is offline  
Old 5th December 2019, 06:24   #4982  |  Link
dREV
Registered User
 
dREV's Avatar
 
Join Date: Jan 2019
Location: Antarctica
Posts: 74
Hi, I briefly wanted to ask about SetFilterMTMode("",) + Prefetch(1) if this is still relevant or not reading the previous earlier threads about this but wasn't sure if this has changed or not and if it is still relevant if this is linked with the amount of RAM one has on their PC which I only got 8 gigs or and the amount of (weak and heavy) filters in the chain.

It crashes when I go Prefetch(2) and I'm also on a Ryzen 5 2nd generation 2600 CPU if that helps.
dREV is offline  
Old 5th December 2019, 07:27   #4983  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I cant answer this, but you might want to provide a little more info for those that can.

Your script, & is it x86 or x64 Avs+.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline  
Old 5th December 2019, 08:21   #4984  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
Especially if you try to multi-thread QTGMC, be aware that it first will use as many EDI threads as cores, so using a higher prefetch value will multiply their threads even further; you may want to restrict that parameter in QTGMC when you have a CPU with many logical cores.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 5th December 2019, 09:55   #4985  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
Quote:
Originally Posted by pinterf View Post
(@jpsdr, this fix probably affects your _MT resizer versions because they are using this source)
Thanks for the warning, i've checked, but in fact my getframe is very different, and i allready processed the alpha planes.
__________________
My github.
jpsdr is offline  
Old 5th December 2019, 18:09   #4986  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by wonkey_monkey View Post
also, not a bug report as such, but addborders really should have the option not to convert the background to TV Range when adding borders to a YUV clip. Maybe it could be updated to adopt the color_yuv parameter of blankclip?
Quote:
Originally Posted by pinterf View Post
I've added them as issues in order not to forget them
Same for Letterbox too please P. [long time I've been a bit miffed with both Addborders and Letterbox for TV range only borders]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 5th December 2019 at 18:17.
StainlessS is offline  
Old 5th December 2019, 19:15   #4987  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Suppose I have two scripts, one of which imports the other. The first script gets a source:

Code:
source = AviSource("myfile.avi")
The second file returns a clip based on this source, but I'd also like the second file to be openable stand by itself. Is there a way to call AviSource and assign the the result to source at the top of the second file, but only if source has not already been defined? I tried VarExist like this:

Code:
source = VarExist(source) ? source : avisource("myfile.avi")
But I just get errors.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline  
Old 5th December 2019, 20:05   #4988  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Maybe try [quotes around source in VarExist]
Code:
source = VarExist("source") ? source : avisource("myfile.avi")
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 5th December 2019 at 20:09.
StainlessS is offline  
Old 5th December 2019, 21:31   #4989  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Ah, of course, that makes sense. Thanks.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline  
Old 6th December 2019, 10:05   #4990  |  Link
dREV
Registered User
 
dREV's Avatar
 
Join Date: Jan 2019
Location: Antarctica
Posts: 74
Quote:
Originally Posted by StainlessS View Post
I cant answer this, but you might want to provide a little more info for those that can.

Your script, & is it x86 or x64 Avs+.
Alright, for those that can answer

It's AviSynth+ 0.1.0 r2772 using the 32 bit version with the 10 bit hack pipeline for HEVC in MeGUI 2525.

Script
Code:
plugins and import address
#rgtools
SetFilterMTMode("removegrain",         MT_NICE_FILTER)
SetFilterMTMode("repair",              MT_NICE_FILTER)
SetFilterMTMode("verticalcleaner",     MT_NICE_FILTER)
SetFilterMTMode("clense",              MT_NICE_FILTER)

#medianblur   
SetFilterMTMode("medianblur",          MT_MULTI_INSTANCE)
SetFilterMTMode("medianblurtemporal",  MT_MULTI_INSTANCE)
SetFilterMTMode("average",             MT_NICE_FILTER)
SetFilterMTMode("TMaskCleaner",        MT_MULTI_INSTANCE)
SetFilterMTMode("checkmate",           MT_NICE_FILTER)
SetFilterMTMode("Deblock",             MT_NICE_FILTER)
SetFilterMTMode("msharpen",            MT_MULTI_INSTANCE)
SetFilterMTMode("TColorMask",          MT_NICE_FILTER)
SetFilterMTMode("Vinverse",            MT_MULTI_INSTANCE)
SetFilterMTMode("Vinverse2",           MT_MULTI_INSTANCE)

#masktools   
SetFilterMTMode("mt_invert",           MT_MULTI_INSTANCE)
SetFilterMTMode("mt_binarize",         MT_MULTI_INSTANCE)
SetFilterMTMode("mt_inflate",          MT_MULTI_INSTANCE)
SetFilterMTMode("mt_deflate",          MT_MULTI_INSTANCE)
SetFilterMTMode("mt_inpand",           MT_MULTI_INSTANCE)
SetFilterMTMode("mt_expand",           MT_MULTI_INSTANCE)
SetFilterMTMode("mt_lut",              MT_MULTI_INSTANCE)
SetFilterMTMode("mt_lutxy",            MT_MULTI_INSTANCE)
SetFilterMTMode("mt_lutxyz",           MT_MULTI_INSTANCE)
SetFilterMTMode("mt_luts",             MT_MULTI_INSTANCE)
SetFilterMTMode("mt_lutf",             MT_MULTI_INSTANCE)
SetFilterMTMode("mt_lutsx",            MT_MULTI_INSTANCE)
SetFilterMTMode("mt_lutspa",           MT_MULTI_INSTANCE)
SetFilterMTMode("mt_merge",            MT_MULTI_INSTANCE)
SetFilterMTMode("mt_logic",            MT_MULTI_INSTANCE)
SetFilterMTMode("mt_convolution",      MT_MULTI_INSTANCE)
SetFilterMTMode("mt_mappedblur",       MT_MULTI_INSTANCE)
SetFilterMTMode("mt_makediff",         MT_MULTI_INSTANCE)
SetFilterMTMode("mt_average",          MT_MULTI_INSTANCE)
SetFilterMTMode("mt_adddiff",          MT_MULTI_INSTANCE)
SetFilterMTMode("mt_clamp",            MT_MULTI_INSTANCE)
SetFilterMTMode("mt_motion",           MT_MULTI_INSTANCE)
SetFilterMTMode("mt_edge",             MT_MULTI_INSTANCE)
SetFilterMTMode("mt_hysteresis",       MT_MULTI_INSTANCE)
SetFilterMTMode("AddGrainC",           MT_MULTI_INSTANCE) 

# Source plugins
SetFilterMTMode("DGDecode_mpeg2source",MT_NICE_FILTER)    #seems to work fine as 1
SetFilterMTMode("TFM",                 MT_MULTI_INSTANCE) #2 is faster. 1 crashes randomly.
SetFilterMTMode("TDecimate",           MT_SERIALIZED)     #1 gave error, 2 was slower than 3
SetFilterMTMode("TDeint",              MT_MULTI_INSTANCE) # Mode 1 creates artifacts
SetFilterMTMode("SmoothLevels",        MT_MULTI_INSTANCE) # Mode 1 freezes

# Filters from Dither 1.25.0. Tested by Firesledge (not extensively though)
SetFilterMTMode ("DitherPost",         MT_NICE_FILTER)
SetFilterMTMode ("SmoothGrad",         MT_NICE_FILTER)
SetFilterMTMode ("Dither_box_filter16", MT_NICE_FILTER)
SetFilterMTMode ("Dither_bilateral16", MT_NICE_FILTER)
SetFilterMTMode ("Dither_limit_dif16", MT_NICE_FILTER)
SetFilterMTMode ("Dither_resize16",    MT_NICE_FILTER)
SetFilterMTMode ("Dither_out",         MT_NICE_FILTER)
SetFilterMTMode ("Dither_removegrain16", MT_NICE_FILTER)
SetFilterMTMode ("Dither_repair16",    MT_NICE_FILTER)
SetFilterMTMode ("Dither_median16",    MT_NICE_FILTER)
SetFilterMTMode ("Dither_add16",       MT_NICE_FILTER)
SetFilterMTMode ("Dither_sub16",       MT_NICE_FILTER)
SetFilterMTMode ("Dither_max_dif16",   MT_NICE_FILTER)
SetFilterMTMode ("Dither_merge16",     MT_NICE_FILTER)
SetFilterMTMode("NNEDI3",              MT_MULTI_INSTANCE)

SetFilterMTMode("FTurnLeft",           MT_NICE_FILTER)
SetFilterMTMode("FTurnRight",          MT_NICE_FILTER)

SetFilterMTMode("yadifmod",            MT_NICE_FILTER)
SetFilterMTMode("ContinuityFixer",     MT_NICE_FILTER)

ConvertBits(bits=8)

#filter varies here, crop, continuityfix

dither_convert_8_to_16()
#deband filter with mask=0 banding, only when no choice
f3kdbmod16()
s16 = last
DitherPost()

ConvertBits(bits=8)
FTurnRight()
##line darkening (Hysteria) filter sometimes here - 8 bit?
#Anti-Aliasing filter, maa2 usually - 8 bit?
FTurnLeft()

dither_convert_8_to_16()
s16.Dither_limit_dif16 (last, thr=0.25, elast=4.0)
SmoothGrad()
ly = GradFun3mod(thr=0.35,yuv444=true, resizer="DebilinearM", lsb_in=true, lsb=true)
lc = nnedi3_resize16(1280*2, 720*2,lsb_in=true,lsb=true,kernel_d="Spline36",kernel_u="Spline36",src_top=0.0,src_left=0.50,nlsb=false)
lu = lc.UtoY()
lv = lc.VtoY()
YtoUV(lu,lv,ly)

DitherPost(mode=6)

ConvertBits(bits=16)
ConvertToStacked()
#grain filter
ConvertFromStacked().ConvertToDoubleWidth()

Prefetch(1)
Not sure if needed but some HEVC settings are sea, qcomp ranges from 60 to 80, veryslow speed, rc lookahead 40 and tune animation (majority of times then film) rest are almost max or max settings and a couple turned off like no sao, no amp, --no-strong-intra-smoothing, limit-refs=0, --no-limit-modes, and has both --fades and -dither

I've also tried it using the 64 bit version with filters and did not see much difference tho I only did a few tests.

Not sure why but when I use real.finder's maa2 anti-aliasing script https://forum.doom9.org/showthread.php?t=174121 when indexing the source it doesn't like each other and tend to get Access Violation. I have to use the script as Prefetch(0) to go thru then I have to edit the script back to Prefetch(1) to encode in MeGUI. Using older versions doesn't do this. If somebody can inform me on why this maybe occurring.

Quote:
Originally Posted by LigH View Post
Especially if you try to multi-thread QTGMC, be aware that it first will use as many EDI threads as cores, so using a higher prefetch value will multiply their threads even further; you may want to restrict that parameter in QTGMC when you have a CPU with many logical cores.
OK, I haven't tried using that yet but I will keep your words down and note it on the read me file for that filter. Thanks for the info.

Last edited by dREV; 9th December 2019 at 20:49.
dREV is offline  
Old 6th December 2019, 12:14   #4991  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by StainlessS View Post
Same for Letterbox too please P. [long time I've been a bit miffed with both Addborders and Letterbox for TV range only borders]
New parameter color_yuv is done for AddBorders and LetterBox. Works exactly like in BlankClip.
pinterf is offline  
Old 6th December 2019, 12:51   #4992  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
New parameter color_yuv is done
Splendid
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline  
Old 6th December 2019, 15:41   #4993  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Wonkey,
Quote:
Originally Posted by wonkey_monkey View Post
Code:
processed = source.
qtgmc.
flipvertical.
filter_with_many_parameters(
  10,
  20,
  "mode",         # you can even put a comment here if you want to
  reverse = true
).
trim(50, 99).
selecteven;
Just a bit of nit-pickin',
above script would not work in Avs [you is mixin' avs script and C].
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline  
Old 6th December 2019, 16:23   #4994  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Quote:
Originally Posted by StainlessS View Post
Wonkey,


Just a bit of nit-pickin',
above script would not work in Avs [you is mixin' avs script and C].
That was the point of my post - suggesting an alternate format that's more amenable to multi-lining.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline  
Old 6th December 2019, 17:34   #4995  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I was suggesting that the trailing semi-colon would prevent it from working at full capacity, or at all
[even with auto appended lines]
EDIT: perhaps the semi-colon was deliberate ?, to show where appended lines thing is force ended, is that it ?
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 6th December 2019 at 17:44.
StainlessS is offline  
Old 6th December 2019, 18:40   #4996  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Exactly, like C/C++.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline  
Old 6th December 2019, 20:48   #4997  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
So, guess that if implemented as suggested, then to avoid massive parsing, we will have to have statement terminators like everywhere, all of the time,
is that the suggestion ? (henceforth all avs script needs statement terminators, tis a change that might prevent adoption, do you have any other ideas ?).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline  
Old 6th December 2019, 21:30   #4998  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by dREV View Post
Alright, for those that can answer

It's AviSynth+ 0.1.0 r2772 using the 32 bit version with the 10 bit hack pipeline for HEVC in MeGUI 2525.
Not related to the Access Violation, but to the quality instead.
You are bringing everything to 16bit stacked, filtering with f3kdb with 16bit precision, then you are using DitherPost as default to bring everything to 8bit to filter with maa2, lastly you're using DitherPost(mode=6) which is dithering with the Floyd Steinberg error diffusion, then you're converting it again from 8bit dithered to 16bit planar, then you're bringing it to stacked MSB and LSB again, you apply your denoise and then you convert from 16bit stacked to 16bit interleaved and you output it as interleaved.

Why?


Doesn't this make more sense?

Code:
#Here we're telling f3kdb to take your 8bit source, filter it with 16bit precision and output 16bit stacked

#Debanding 16bit stacked

f3kdb(input_depth=8, output_mode=1, output_depth=16)

#Now we're gonna truncate everything to 8bit, 
#apply anti-aliasing with maa2 and then use the original 16bit stacked we received from f3kdb 
#and apply only the changes made by maa2 thus retaining 16bit precision

#antialiasing 8bit, 16bit stacked output
s16 = last
DitherPost (mode=-1)
maa2()
Dither_convert_8_to_16 ()
s16.Dither_limit_dif16 (last, thr=1.0, elast=2.0)

#16bit stacked resize and debanding

ly = GradFun3mod(thr=0.35,yuv444=true, resizer="DebilinearM", lsb_in=true, lsb=true)
lc = nnedi3_resize16(1280*2, 720*2,lsb_in=true,lsb=true,kernel_d="Spline36",kernel_u="Spline36",src_top=0.0,src_left=0.50,nlsb=false)
lu = lc.UtoY()
lv = lc.VtoY()
YtoUV(lu,lv,ly)


#your 16bit stacked degrain filter

Something()

#16bit planar output (your target is x265 which will handle 16bit planar just fine; just remember to add --dither to the command line)

ConvertFromStacked()

Last edited by FranceBB; 6th December 2019 at 21:33.
FranceBB is offline  
Old 6th December 2019, 22:21   #4999  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Quote:
Originally Posted by StainlessS View Post
So, guess that if implemented as suggested, then to avoid massive parsing, we will have to have statement terminators like everywhere, all of the time,
is that the suggestion ? (henceforth all avs script needs statement terminators
Only those that start with the magic code to switch to the alternative parsing.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline  
Old 9th December 2019, 09:21   #5000  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
In Pascal it's exactly the opposite syntax: Semicola closing each line, a dot finishing "the sentence" (the program).
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH 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 10:57.


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