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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th March 2021, 04:15   #61  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,330
Quote:
Originally Posted by real.finder View Post
done in x86 not x64
1- BinomialBlur give 400~ fps
2- FastBlur 188~ fps
3- GBlur 75~ fps with padding, 80~ fps without padding
I assume you used Asd's updated VariableBlur?
Reel.Deel is offline   Reply With Quote
Old 14th March 2021, 05:00   #62  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 929
Thanks
kedautinh12 is offline   Reply With Quote
Old 14th March 2021, 13:02   #63  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,381
Quote:
Originally Posted by Reel.Deel View Post
I assume you used Asd's updated VariableBlur?
I use it in x64 only
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 14th March 2021, 13:11   #64  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,312
A few things about that script...
  • It's a bit unfair to make FastBlur do 8 iterations when anything higher than the default of 3 is visually inidistinguishable - it's not equivalent to GBlur's "grid" parameter.
  • ColorBars(pixel_type = "yv21") will remove the need for, and constant overhead of, converttoyv12.
  • The script as posted gives an error when testing Gblur:

    Code:
    GBlur:size of grid must be odd and between 3 and 11
    Setting grid = 3 seems to be fastest.
  • GBlur and BinomialBlur only blur the Y channel by default


With that in mind, the following script:

Code:
ColorBars(pixel_type = "yv12")
Variance = 4.0
# GBlur(3, sqrt(Variance), u = true, v = true)
# BinomialBlur(Variance, u = 3, v = 3)
FastBlur(sqrt(Variance), gamma = false)
gives, I think, fairer results:

FastBlur: 837fps
BinomialBlur: 775fps
GBlur (x86): 321fps

Curiously though, BinomialBlur starts off at around 630fps, speeds up a bit fairly quickly then continues to creep up until it hits 775fps, whereas FastBlur starts off at over 1000fps before descending to 837fps. It doesn't seem to have a memory leak though - CPU usage drops from 100% to 82% for some reason. I'll look into that.

I think it may be a multithreading issue. I've got 12 logical cores, but if I reduce multithreading to 4, I can get FastBlur to a constant 1200fps. I may add a parameter to control the number of threads, because I suspect it's going to be one of those things which doesn't have a "best for everyone" solution.

Also BinomialBlur suffers greatly if Variance is increased, e.g. to 40:

FastBlur: 789fps
GBlur (x86): 292fps
BinomialBlur: 115fps
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 14th March 2021 at 14:31.
wonkey_monkey is offline   Reply With Quote
Old 14th March 2021, 15:35   #65  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,381
Quote:
Originally Posted by wonkey_monkey View Post
[*]The script as posted gives an error when testing Gblur:

Code:
GBlur:size of grid must be odd and between 3 and 11
you have very old GBlur, the uptodate can be found here https://forum.doom9.org/showthread.php?t=181891

edit: I use all them like this to replace BinomialBlur in YAHRmask since BinomialBlur didn't get update since many years!

I did another test

Code:
ColorBars(pixel_type = "yv12")
Variance = 4.0
rad=round(Variance*2)
converttoy8.FastBlur(sqrt(Variance),iterations=rad,gamma=false)
now it's about 440 fps, but (without converttoy8 of course) BinomialBlur now give about 700 and gblur about 85 with padding

edit: forget to mention that both BinomialBlur and gblur use about 10% from cpu, While FastBlur use about 75%-85%
__________________
See My Avisynth Stuff

Last edited by real.finder; 14th March 2021 at 15:49.
real.finder is offline   Reply With Quote
Old 14th March 2021, 16:07   #66  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,312
Settings iterations=rad makes no sense for FastBlur. Leave it at the default (3).

I'm also uncertain of the logic of setting grid=rad for gblur. grid=3 is much faster with only very little difference to the pixels (similar to what happens when increasing iterations for FastBlur). There also seems to be a border issue with gblur:

__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 15th March 2021, 17:47   #67  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,381
Quote:
Originally Posted by wonkey_monkey View Post
Settings iterations=rad makes no sense for FastBlur. Leave it at the default (3).
that true, maybe even 2 seems good

FastBlur(sqrt(Variance),iterations=2,gamma=false)

now it's real fast blur , but I think it need more parameters for setting MT and control which planer to processes

Quote:
Originally Posted by wonkey_monkey View Post
I'm also uncertain of the logic of setting grid=rad for gblur. grid=3 is much faster with only very little difference to the pixels (similar to what happens when increasing iterations for FastBlur).
well it's not true for gblur, try with Variance = 10.0 and see

Quote:
Originally Posted by wonkey_monkey View Post
There also seems to be a border issue with gblur:
yes that why I use padding for it, vcmohan say this too

Quote:
Originally Posted by vcmohan View Post
Borders equal to radius will remain unfiltered.
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 16th March 2021, 01:43   #68  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,312
Now has a threads parameter to set the number of threads. Defaults to half the number of logical processors minus 1, or 2, whichever is greater (unless you only have one logical processor, in which case: 1). Set threads to 0 to use all available logical processors, or use a floating pointer between 0 and 1 as a multiplier on the number of local processors, e.g. to use 3/4 of them, set threads to 0.75.

http://horman.net/avisynth/download/FastBlur.zip
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 16th March 2021, 15:49   #69  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,381
Quote:
Originally Posted by wonkey_monkey View Post
Now has a threads parameter to set the number of threads. Defaults to half the number of logical processors minus 1, or 2, whichever is greater (unless you only have one logical processor, in which case: 1). Set threads to 0 to use all available logical processors, or use a floating pointer between 0 and 1 as a multiplier on the number of local processors, e.g. to use 3/4 of them, set threads to 0.75.

http://horman.net/avisynth/download/FastBlur.zip
thanks, that look good, I will test soon, but what about adding option to not process the chroma?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 16th March 2021, 16:19   #70  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,312
Quote:
thanks, that look good, I will test soon, but what about adding option to not process the chroma?
I can't think of a good reason for a blurrer to provide that functionality. You can use Extract/Merge/CombinePlanes.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 16th March 2021, 17:31   #71  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,381
Quote:
Originally Posted by wonkey_monkey View Post
I can't think of a good reason for a blurrer to provide that functionality. You can use Extract/Merge/CombinePlanes.
in masktools u=1,v=1 aka don't care or ignore will be faster than copy it, since it not needed for masking most of times, so maybe adding IgnoreChroma bool parameter or make it like masktools and BinomialBlur will be better

Code:
        int  Y = 3
        int  U = 2
        int  V = 2

            Controls which planes the filter is applied to:

                    3 : corresponding plane will be filtered
                    2 : corresponding plane will be copied from the source
                    1 : corresponding plane will be ignored
                    from 0 to -255 : corresponding plane will be assigned the absolute value.
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 16th March 2021, 18:36   #72  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,312
If you're making a mask and UV aren't needed anyway, just use ExtractY/ConvertToY8 first to delete them with no overhead.

It's just not in FastBlur's remit to monkey around with planes when the language already provides the tools.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 16th March 2021, 18:48   #73  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,899
Monkey See, Monkey do
__________________
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   Reply With Quote
Old 16th March 2021, 18:57   #74  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,381
Quote:
Originally Posted by wonkey_monkey View Post
If you're making a mask and UV aren't needed anyway, just use ExtractY/ConvertToY8 first to delete them with no overhead.

It's just not in FastBlur's remit to monkey around with planes when the language already provides the tools.
there are small difference

simple test, mt_convolution use u=v=1 by default

Code:
ColorBars(pixel_type = "yv12").trim(0, 5000)

CombinePlanes(ExtractY().mt_convolution("2 1 2"),last,planes="YUV",sample_clip=last)

Frames processed:                   5001 (0 - 5000)
FPS (min | max | average):          160.1 | 293.2 | 280.3
Process memory usage (max):         73 MiB
Thread count:                       16
CPU usage (average):                8.0%

Time (elapsed):                     00:00:17.841
Code:
ColorBars(pixel_type = "yv12").trim(0, 5000)

mt_convolution("2 1 2")

Frames processed:                   5001 (0 - 5000)
FPS (min | max | average):          154.7 | 298.2 | 280.4
Process memory usage (max):         71 MiB
Thread count:                       16
CPU usage (average):                7.9%

Time (elapsed):                     00:00:17.838
u=v=1 (don't care or ignore) method seems a bit faster and use less ram and cpu
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 16th March 2021, 19:16   #75  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,312
Quote:
seems a bit faster
0.03% is not a significant difference, and when I ran both scripts I found the first to be consistently faster by about 3%.

In any case, your two scripts produce potentially different outputs anyway. Separating, then recombining, U and V with Y is not the same as ignoring U and V completely.

Not sure why your memory usage is so high. I'd try removing a few plugins and see if it changes.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 16th March 2021 at 19:30.
wonkey_monkey is offline   Reply With Quote
Old 17th March 2021, 20:04   #76  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,381
ok, so I did update things in some of the scripts I maintain to use fastblur

they now get more fps than old BinomialBlur, hopefully the source code is complete so in any case in the avs+ future update anyone can update things for fastblur too
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 30th September 2021, 06:43   #77  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,595
wonkey_monkey,

I've been using FastBlur to blur an overlay mask and I've experienced some wonkiness with large amounts of blurring. Here's an example. Change the value for Blur to 46 and there's no longer any unhappiness. I'm using the current x86 version but the same applies to FastBlur 0.2.1

BlankClip(pixel_type="YV12", width=480, height=540)
KillAudio()
AddBorders(240, 0, 240, 0, color=$FFFFFF)
ColorYUV(Levels="TV->PC")
FastBlur(44, y_blur=0, iterations=3, dither=true)

Click for the full size version.


Last edited by hello_hello; 30th September 2021 at 07:00.
hello_hello is offline   Reply With Quote
Old 30th September 2021, 15:59   #78  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,899
Yip, even my eyes can see horizontal lines, and note Top Left Hand side corner [EDIT: of black bar], is sorta rounded.
[dont now what them there dots are at left and right edges, result of dither?]

EDIT: Horizontal bars, some kind of 'beat/moire' pattern due to y_blur and dither ?
__________________
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; 30th September 2021 at 16:13.
StainlessS is offline   Reply With Quote
Old 30th September 2021, 18:24   #79  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,312
Quote:
Originally Posted by StainlessS View Post
Yip, even my eyes can see horizontal lines, and note Top Left Hand side corner [EDIT: of black bar], is sorta rounded.
Your brain might see those things, but they're not there. It's an optical illusion.

The black dots are an overflow from dithering, which shouldn't happen but obviously does, and which I'll look into.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 30th September 2021, 19:17   #80  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,899
in pub on 8 inch tablet, not seeing horizontal bar, nor rounded t.l.h.s corner.
__________________
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   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 14:45.


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