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 28th September 2021, 22:20   #441  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,483
Must be expr, I would think.

Out of curiosity, why do you use 0.500001 and 0.250001?

Very strange that just moving dup into the other string fixes it. It's all just strings that point so I don't see how expr can be to blame.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 28th September 2021 at 22:26.
wonkey_monkey is offline   Reply With Quote
Old 28th September 2021, 22:37   #442  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Never mind, might have just tested further. "0 max" fixed it. Anyway, the string behaviour was very strange nonetheless. I might replace it with 'cos' now that is in SIMD, was just benchmarking.

About the decimals, I saw it in a vs script, so I asked here. I tested against Merge(a,b,0.5) and it happened to match Expr(a,b,"x y + 0.500001 * ")
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 28th September 2021, 23:13   #443  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,483
Could be down to different rounding modes or just how precision is lost in different ways with different operation orders. I don't think it's a good indication that you should use 0.500001/0.250001 in general.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 29th September 2021, 08:17   #444  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,308
You cannot know if Merge is the more correct. Filters are usually using scaled-up fix point integer arithmetic which mimics floating point. e.g. 14 bit precision for intermediate calculations which fit into a 32 bit integer when dealing with 8-10 bit data.
pinterf is offline   Reply With Quote
Old 29th September 2021, 09:42   #445  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,497
Quote:
Originally Posted by Dogway View Post
I didn't spot any staircasing so vertical blur seems very destructive to me.
I have tried to reduce the bitrate of the Transformer clip that I sent with a simple Blur(0,1) and I did a couple of trials with Blur before and after SMDegrain(4,400). In both cases I had an increase in size with x264 -crf 20 -preset slow.

How could that be possible? Any idea to increase compressibility of such a sharp clip?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 29th September 2021, 16:34   #446  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Ok, I thought about Merge() as the reference. This is the vs script I saw it first. Anyway I will revert back all the decimal guided rounding, much easier.

@tormento: That escapes me, maybe x264 is not deterministic. Did you try my suggestions?

By the way, I managed to finish HSV conversion, took me a week! Also probably today I will upload new ExTools version with the latest changes.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 29th September 2021, 16:58   #447  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,497
Quote:
Originally Posted by Dogway View Post
Did you try my suggestions?
I am waiting for your latest iteration of tools
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 29th September 2021, 18:27   #448  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,483
That's possibly an attempt to avoid banker's rounding (round half-values to the nearest even number) which can introduce banding.

Compare the pixel values of the following:

Code:
expr("sx 0.5 +")    # 0 2 2 4 4 6 6 8 8 10 10 ...
and

Code:
expr(sx 0.5001 + ")    # 1 2 3 4 5 6 7 8 9 10 11 ...
In most cases banker's rounding is preferable as, on average, it has no bias, but in certain very specific situations it can cause banding. Dithering is one solution.

Your trig functions won't be affected because you're using so many (approximations to) irrational numbers.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 29th September 2021 at 18:34.
wonkey_monkey is offline   Reply With Quote
Old 30th September 2021, 00:41   #449  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Wow so interesting, I see. Well when the output is dependent of such value I may use it, inside an amount of operations I don't think so because operations are done in float point. I propagated my scripts with such decimals so I need to consider it on a case by case, I guess for the Merge() behavior is a yes (?).

On another note I'm finishing IPT color space and hence Skin_Qualifier(), it's slow because it uses atan2, and I noticed some issues with my atanT() and atan2T() approximations, atan2T() has the potential to be 5 times faster (about 60fps)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 2nd October 2021, 10:57   #450  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,497
@Dogway

I saw you released ExTools 6.0. Can I consider ex_smooth as definitive version to play with?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 2nd October 2021, 11:23   #451  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,703
I've tried testing the deblock pack, but Deblock_QED gives me an error that there is no function named Deblock_deblock. I do have the Deblock plugin installed, and I recall that calling the function like that should definitely work (removing Deblock_ fixes the issue).
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 2nd October 2021, 11:59   #452  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,956
Is Deblock.dll called exactly that, ie without version number or other mod ?
__________________
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 2nd October 2021, 12:43   #453  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,703
Quote:
Originally Posted by StainlessS View Post
Is Deblock.dll called exactly that, ie without version number or other mod ?
Ah, that's it. The 64-bit build is named Deblock-x64.dll so it won't work directly without either renaming or editing the function.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 2nd October 2021, 13:33   #454  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,956
Not a good idea to have hyphen in dll file name, advise only "_" or alpha for 1st char, and thereafter digits too, then ".dll".
__________________
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 2nd October 2021, 16:53   #455  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Quote:
Originally Posted by tormento View Post
I saw you released ExTools 6.0. Can I consider ex_smooth as definitive version to play with?
Yes sure. Also I'm the process of updating GradFun3 to ExTools, I will keep it its own script though.


By the way I'm wondering if there's a scaling option in Expr() for evaluating the expression as float instead of input bitdepth. I know the opposite is possible (evaluate as 8-bit).
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 2nd October 2021, 20:19   #456  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by Dogway View Post
By the way I'm wondering if there's a scaling option in Expr() for evaluating the expression as float instead of input bitdepth. I know the opposite is possible (evaluate as 8-bit).
f32 keyword should do it
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 2nd October 2021, 21:02   #457  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Didn't work for me. I think it's not supported but pinterf has to confirm.


There are two ways currently to do this:

with ConvertBits()
Code:
ConvertBits(32)
Expr("x 0.5 - abs","",scale_inputs="none") # 187
ConvertBits(16)
And the annoying way of dividing by range_max if input is int:
Code:
Expr("x range_max / 0.5 - abs range_max *","",scale_inputs="none") # 458
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 2nd October 2021 at 21:06.
Dogway is offline   Reply With Quote
Old 2nd October 2021, 21:13   #458  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Expr("f32 x 0.5 scalef +","") seems work, but I see no reason for not make it work with scale_inputs, so we will wait pinterf
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 3rd October 2021, 17:57   #459  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,497
Quote:
Originally Posted by Dogway View Post
Call like ex_smooth(1 or 2, sharp=true, limit=true)
I tried to unsharpen Transformers 5, to lower encoding bitrate, but with not much success.

I remember you that this was the clip.

My first attempt was

SetMemoryMax()
SetFilterMTMode("DEFAULT_MT_MODE", 2)
LoadPlugin("D:\Eseguibili\Media\DGDecNV\DGDecodeNV.dll")
DGSource("F:\In\transformers5\transformers5.dgi",ct=64,cb=64,cl=0,cr=0)
ConvertBits(16)
SMDegrain (tr=4, thSAD=400, refinemotion=true, contrasharp=false, PreFilter=4, plane=4, chroma=true)
fmtc_bitdepth (bits=8,dmode=8)
Prefetch(6)


with the x264 switches

x264.exe --crf 20 --preset slow --aq-mode 2 --colorprim bt709 --colormatrix bt709 --transfer bt709

and the result have been

encoded 5053 frames, 5.58 fps, 8195.16 kb/s, duration 0:15:05.53

As I told in my previous post, I usually get from 3000 to 4000 kbps with those settings, depending on the type of movie. So more than 8k is just a bit too much and notice that there is almost no grain or noise at all in the original video.

So I have tried to use

Blur(0,1)

just after the SMDegrain call, with same parameters, obtaining

encoded 5053 frames, 5.31 fps, 7412.87 kb/s, duration 0:15:52.00

As last attempt, I have used your new ex_smooth, just after SMDegrain call too

ex_smooth(0,1,sharp=true,limit=true)

obtaining

encoded 5053 frames, 5.16 fps, 7990.14 kb/s, duration 0:16:19.11

So, is there a better way to unsharpen and calm down that rabid movie?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 3rd October 2021, 20:19   #460  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
That was only my first suggestion, why don't you try the other ones?
Anyway you have to consider that is an action packed snippet, maybe it's not representative of the whole movie.
For a clearer picture of the final bitrate encode chunks of it with SelectRangeEvery(), for example 2 minutes every 10 minutes or so.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Reply

Tags
avisynth, dogway, filters, hbd, packs

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 00:42.


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