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 31st January 2021, 19:42   #681  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
PHP Code:
SetMemoryMax()
SetFilterMTMode("DEFAULT_MT_MODE"2)
LoadPlugin("D:\eseguibili\media\DGDecNV\DGDecodeNV.dll")
DGSource("F:\In\1_50 colore venuto dallo spazio, Il\colore.dgi",ct=140,cb=140,cl=0,cr=0)
CompTest24(1)
SMDegrain (tr=4thSAD=500refinemotion=falsemode=0contrasharp=falsePreFilter=4truemotion=trueplane=4chroma=truen16_out=true)
Prefetch(6
x265 slow --input-depth 16 --dither 4.43 fps

Perhaps the best compromise yet.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 31st January 2021, 21:27   #682  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
Please explain me why explicitely define prefilter is faster than implicitely use prefilter=4.
in the code I post it will be 8bit for prefilter, and it will be faster as Boulder told you

Quote:
Doing it in 8 bits gives you a nice boost without actually sacrificing quality.
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 1st February 2021, 08:05   #683  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Quote:
Originally Posted by real.finder View Post
in the code I post it will be 8bit for prefilter, and it will be faster as Boulder told you
The bold part is the one I need clarification about:

ConvertBits(10).SMDegrain(tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=SMDegrain_prefilters(prefilter=4,a=1,d=1,h=7.0), truemotion=true, plane=4, chroma=true)
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 1st February 2021, 09:43   #684  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Quote:
Originally Posted by real.finder View Post
Code:
SMDegrain(tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=ConvertBits(8).SMDegrain_prefilters(prefilter=4,a=1,d=1,h=7.0), truemotion=true, plane=4, chroma=true)
Code:
SMDegrain (tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=ConvertBits(8).SMDegrain_prefilters(prefilter=4,a=1,d=1,h=7.0),, truemotion=true, plane=4, chroma=true, n16_out=true)
actually turned out to be slower than
Code:
SMDegrain (tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true, n16_out=true)
4.27 fps vs 4.43.

P.S: n16_out=true doesn't need to have ConvertBit(16) in front of SMDegrain, does it?
__________________
@turment on Telegram

Last edited by tormento; 1st February 2021 at 09:45.
tormento is offline   Reply With Quote
Old 1st February 2021, 18:49   #685  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
The bold part is the one I need clarification about:

ConvertBits(10).SMDegrain(tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=SMDegrain_prefilters(prefilter=4,a=1,d=1,h=7.0), truemotion=true, plane=4, chroma=true)
as the name said it's just prefilter function of SMDegrain

Quote:
Originally Posted by tormento View Post
Code:
SMDegrain (tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=ConvertBits(8).SMDegrain_prefilters(prefilter=4,a=1,d=1,h=7.0),, truemotion=true, plane=4, chroma=true, n16_out=true)
actually turned out to be slower than
Code:
SMDegrain (tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true, n16_out=true)
4.27 fps vs 4.43.
they should be the same in that case

edit: try add ,device_type="GPU" to SMDegrain_prefilters

anyway there are no point of using n16_out with external PreFilter like this

Quote:
Originally Posted by tormento View Post
P.S: n16_out=true doesn't need to have ConvertBit(16) in front of SMDegrain, does it?
n16_out is like the lsb_out but a bit faster and only work with 8bit input
__________________
See My Avisynth Stuff

Last edited by real.finder; 1st February 2021 at 19:00.
real.finder is offline   Reply With Quote
Old 1st February 2021, 19:39   #686  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Quote:
Originally Posted by real.finder View Post
as the name said it's just prefilter function of SMDegrain
Ok, but why to use it instead of prefilter=4 in the 8 bit source case?
Quote:
Originally Posted by real.finder View Post
anyway there are no point of using n16_out with external PreFilter like this
Ok, why? I thought n16_out is used to output 16 bit depth video. Am I wrong? What should I use to deliver a 16 bit video out from *ANY* input source?
Quote:
n16_out is like the lsb_out but a bit faster and only work with 8bit input
So if I have a 10/12 bit input, have I to ConvertBits(16) before using SMDegrain?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 1st February 2021, 20:19   #687  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
Ok, but why to use it instead of prefilter=4 in the 8 bit source case?
who say use it in 8 bit source? you asked for speed optimization and I give you some, no more no less

Quote:
Ok, why? I thought n16_out is used to output 16 bit depth video. Am I wrong? What should I use to deliver a 16 bit video out from *ANY* input source?
it is but it only work for 8bit input, see here https://forum.doom9.org/showthread.p...16#post1837161

if you need 16bit from 10-14 bits then use ConvertBits(16) before SMDegrain

Quote:
So if I have a 10/12 bit input, have I to ConvertBits(16) before using SMDegrain?
it's up to you, SMDegrain can work with those as they are (input depth = output depth)
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 1st February 2021, 20:24   #688  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Quote:
Originally Posted by real.finder View Post
if you need 16bit from 10-14 bits then use ConvertBits(16) before SMDegrain
What will happen if I feed 10 bit source without ConvertBits(16) but with n16_out?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 1st February 2021, 20:25   #689  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
What will happen if I feed 10 bit source without ConvertBits(16) but with n16_out?
you should get an error message
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 2nd February 2021, 17:08   #690  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Ok, the results. Bit long and tedious job but it will save me some encoding time.

Code:
Number of frames:                     4560
Length (hh:mm:ss.ms):         00:03:10.190
Frame width:                          1920
Frame height:                         1040
Framerate:                          23.976 (24000/1001)
Colorspace:                           YV12
Base script:
PHP Code:
SetMemoryMax()
SetFilterMTMode("DEFAULT_MT_MODE"2)
LoadPlugin("D:\eseguibili\media\DGDecNV\DGDecodeNV.dll")
DGSource("F:\In\2_37 padrino III coda, Il - La morte di Michael Corleone\coda.dgi",ct=20,cb=20,cl=0,cr=0)
(*)
Prefetch(6
where (*) are the differences that I will list below.
Code:
[1] SMDegrain (tr=6, thSAD=600, refinemotion=false, n16=true, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
[2] ConvertBits(10).SMDegrain (tr=6, thSAD=600, refinemotion=false, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
[3] ConvertBits(12).SMDegrain (tr=6, thSAD=600, refinemotion=false, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
[4] ConvertBits(16).SMDegrain (tr=6, thSAD=600, refinemotion=false, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
[5] SMDegrain (tr=6, thSAD=600, refinemotion=false, n16_out=true, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
AVSMeter64 results:
Code:
FPS  min  |   max  | average
[1] 1.238 |  46512 | 10.96
[2] 1.222 |  256.8 |  7.679
[3] 1.174 |  46083 |  6.170
[4] 1.084 | 140845 |  6.210
[5] 1.272 |  35461 | 10.97
x265 encoding:
Code:
[1] x265_x64.exe -D 10 --crf 22.0 --preset slow --profile main10 --level 4.1 --keyint 240 --vbv-bufsize 78125 --vbv-maxrate 62500 --aq-mode 2 --sar 1:1
[2] same as [1]
[3] same as [1] --input-depth 12 --dither
[4] same as [1] --input-depth 16 --dither
[5] same as [1] --input-depth 16 --dither
x265 results:
Code:
[1] 3.51 fps, 1734.92 kb/s, Avg QP:25.95
[2] 3.23 fps, 1713.39 kb/s, Avg QP:25.92
[3] 2.86 fps, 1713.58 kb/s, Avg QP:25.91
[4] 2.75 fps, 1716.02 kb/s, Avg QP:25.91
[5] 3.55 fps, 1714.94 kb/s, Avg QP:25.91
Can't understand the speedup with out16.
__________________
@turment on Telegram

Last edited by tormento; 2nd February 2021 at 17:22.
tormento is offline   Reply With Quote
Old 2nd February 2021, 17:33   #691  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
Ok, the results. Bit long and tedious job but it will save me some encoding time.

Code:
Number of frames:                     4560
Length (hh:mm:ss.ms):         00:03:10.190
Frame width:                          1920
Frame height:                         1040
Framerate:                          23.976 (24000/1001)
Colorspace:                           YV12
Base script:
PHP Code:
SetMemoryMax()
SetFilterMTMode("DEFAULT_MT_MODE"2)
LoadPlugin("D:\eseguibili\media\DGDecNV\DGDecodeNV.dll")
DGSource("F:\In\2_37 padrino III coda, Il - La morte di Michael Corleone\coda.dgi",ct=20,cb=20,cl=0,cr=0)
(*)
Prefetch(6
where (*) are the differences that I will list below.
Code:
[1] SMDegrain (tr=6, thSAD=600, refinemotion=false, n16=true, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
[2] ConvertBits(10).SMDegrain (tr=6, thSAD=600, refinemotion=false, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
[3] ConvertBits(12).SMDegrain (tr=6, thSAD=600, refinemotion=false, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
[4] ConvertBits(16).SMDegrain (tr=6, thSAD=600, refinemotion=false, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
[5] SMDegrain (tr=6, thSAD=600, refinemotion=false, n16_out=true, mode=0, contrasharp=false, PreFilter=4, truemotion=true, plane=4, chroma=true)
AVSMeter64 results:
Code:
FPS  min  |   max  | average
[1] 1.238 |  46512 | 10.96
[2] 1.222 |  256.8 |  7.679
[3] 1.174 |  46083 |  6.170
[4] 1.084 | 140845 |  6.210
[5] 1.272 |  35461 | 10.97
x265 encoding:
Code:
[1] x265_x64.exe -D 10 --crf 22.0 --preset slow --profile main10 --level 4.1 --keyint 240 --vbv-bufsize 78125 --vbv-maxrate 62500 --aq-mode 2 --sar 1:1
[2] same as [1]
[3] same as [1] --input-depth 12 --dither
[4] same as [1] --input-depth 16 --dither
[5] same as [1] --input-depth 16 --dither
x265 results:
Code:
[1] 3.51 fps, 1734.92 kb/s, Avg QP:25.95
[2] 3.23 fps, 1713.39 kb/s, Avg QP:25.92
[3] 2.86 fps, 1713.58 kb/s, Avg QP:25.91
[4] 2.75 fps, 1716.02 kb/s, Avg QP:25.91
[5] 3.55 fps, 1714.94 kb/s, Avg QP:25.91
Can't understand the speedup with out16.
see here https://forum.doom9.org/showthread.p...16#post1835681

also you can speed 2-4 as Boulder told you and I post an example code to do that
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 2nd February 2021, 17:35   #692  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Quote:
Originally Posted by real.finder View Post
also you can speed 2-4 as Boulder told you and I post an example code to do that
That is what I am doing, i.e. process everything in 16 bit and dither in x265.

He asked you:
Quote:
Originally Posted by Boulder View Post
Is this utilized in the SMDegrain port?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 2nd February 2021, 17:47   #693  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post

He asked you:
edit: I mean that part of his post

Quote:
pinterf's MVTools has the possibility to use MAnalyse and MRecalculate at a lower bitdepth and do all the processing at a higher bitdepth. In this case it would mean creating the vectors at 8 bits and do all the denoising etc. at 16 bits which makes things quite a bit faster. Is this utilized in the SMDegrain port?
also
Quote:
motion analysis tends to be the slowest part of the whole thing. Doing it in 8 bits gives you a nice boost without actually sacrificing quality.
and I answer

Quote:
Originally Posted by real.finder View Post
you can by using prefilter as clip
then I give how to do that for you

Quote:
Originally Posted by real.finder View Post
Code:
#8bit source input
ConvertBits(XX).SMDegrain(tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=SMDegrain_prefilters(prefilter=4,a=1,d=1,h=7.0,device_type="GPU"), truemotion=true, plane=4, chroma=true)
or if you have HBD source already

Code:
#HBD source input
SMDegrain(tr=4, thSAD=500, refinemotion=false, mode=0, contrasharp=false, PreFilter=ConvertBits(8).SMDegrain_prefilters(prefilter=4,a=1,d=1,h=7.0,device_type="GPU"), truemotion=true, plane=4, chroma=true)
(same old post but with small edit)
__________________
See My Avisynth Stuff

Last edited by real.finder; 2nd February 2021 at 18:01.
real.finder is offline   Reply With Quote
Old 2nd February 2021, 17:55   #694  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,729
For HDR sources, I recommend ConvertBits(10) instead of ConvertBits(8) for prefilter as the source has information in the whole 10-bit range. At least DGSource will output 16-bit video in such cases (it's what the card just does).
__________________
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 February 2021, 18:05   #695  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by Boulder View Post
For HDR sources, I recommend ConvertBits(10) instead of ConvertBits(8) for prefilter as the source has information in the whole 10-bit range. At least DGSource will output 16-bit video in such cases (it's what the card just does).
prefilter it's just for Motion Analyse even if your source is 16bit you can use 8bit without loosing quality, but if you care that much about HBD and you have fast CPU and you don't care about time then you can Motion Analyse in HBD and maybe you will get some better Motion Analyse from that in the end

anyway, I don't know about DGSource, but I think LSMASHSource can do HW decode for 10bit without convert it to 16bit
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 2nd February 2021, 18:27   #696  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Quote:
Originally Posted by real.finder View Post
same old post but with small edit
The code you are giving me does SMDegrain on 8 bit source giving out 8 bit video. I need 10 bit output (or higher) to feed 10 bit x265 with.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 2nd February 2021, 19:02   #697  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
The code you are giving me does SMDegrain on 8 bit source giving out 8 bit video. I need 10 bit output (or higher) to feed 10 bit x265 with.
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 2nd February 2021, 19:06   #698  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Quote:
Originally Posted by real.finder View Post

I lost the initial conversion

I tried some posts ago and it was slower than regular pre=4
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 2nd February 2021, 20:57   #699  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
I lost the initial conversion

I tried some posts ago and it was slower than regular pre=4
you tried vs n16 things, of course n16 and even n16_out are the fastest high bit method

edit: also it was without device_type="GPU"

I said for your case above

Quote:
Originally Posted by tormento View Post
AVSMeter64 results:
Code:
FPS  min  |   max  | average
[1] 1.238 |  46512 | 10.96
[2] 1.222 |  256.8 |  7.679
[3] 1.174 |  46083 |  6.170
[4] 1.084 | 140845 |  6.210
[5] 1.272 |  35461 | 10.97
for 2, 3 and 4 not for 1 and 5 which use n16 things
__________________
See My Avisynth Stuff

Last edited by real.finder; 2nd February 2021 at 21:02.
real.finder is offline   Reply With Quote
Old 9th March 2021, 12:08   #700  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,563
Launching AVSMeter_x64 -avsinfo, I am getting:

Function duplicates:

"undefined" : "[InternalFunction]"
"Undefined" : "D:\Programmi\Media\AviSynth+\plugins64\Zs_RF_Shared-1.143~realfinder.avsi"


Why?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Reply

Tags
avisynth, avs script, avs+, banding, generator, hbd, mod

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 07:11.


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