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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#21 | Link |
|
Registered User
Join Date: May 2005
Posts: 236
|
Result on your screenshots seems good, I will try your function when I've got the occasion
![]() btw to improve the readability of the presets in your code, maybe you could do something like in the hybridFuPP script ? Code:
# HybridFuPP 0.97a by FuPP
Function HybridFuPP(clip input, int "width", int "height", bool "Fast", bool "Dering", bool "Deblock", int "MP_Mode",
\ int "EM_Mode", int "DB_Q", int "DB_Off_a" , int "DB_Off_b", int "M_Thr", int "M_SCD", int "E_Thr",
\ int "D_Thr", int "B_Thr", int "Resizer", int "S_Str", int "T_Str", int "S_Radius", float "S_Dist",
\ int "C_Str", int "M_Str", int "E_Str_X", int "E_Str_Y", int "E_Str_B", int "LP_Str", int "DR_Str" ,
\ int "DR_Radius", string "show", string "N1", string "N2", string "M", string "E1", string "E2" ,
\ string "LP", string "DR", string "Preset", bool "Skin", int "Sp_Str", bool "ARAdjust", int "Skin_Type")
{
width = Default(width , width(input))
height = Default(height, height(input))
Preset = Default(Preset, "high")
Show = Default(Show , "")
preset_num = -1
preset_num = Preset == "medium" ? 0 : preset_num
preset_num = Preset == "high" ? 1 : preset_num
preset_num = Preset == "very high" ? 2 : preset_num
preset_num = Preset == "low" ? 3 : preset_num
preset_num = Preset == "very low" ? 4 : preset_num
preset_num = Preset == "anime1" ? 5 : preset_num
preset_num = Preset == "anime2" ? 6 : preset_num
preset_num = Preset == "HybridQ" ? 7 : preset_num
Assert(preset_num >=0 ? true : false, chr(10) + "This preset does not exist !" + chr(10))
_Resizer = Select(preset_num, 3 , 4 , 5 , 2 , 0 , 2 , 0 , 3 )
_Fast = Select(preset_num, true , true , true , true , true , true , true , true )
_S_Str = Select(preset_num, 10 , 5 , 7 , 12 , 12 , 7 , 20 , 12 )
_S_Radius = Select(preset_num, 1 , 1 , 1 , 1 , 1 , 1 , 2 , 1 )
_S_Dist = Select(preset_num, 0.1 , 0.1 , 0.1 , 0.1 , 0.1 , 0.1 , 0.1 , 0.1 )
_T_Str = Select(preset_num, 3 , 3 , 2 , 5 , 5 , 6 , 15 , 5 )
_C_Str = Select(preset_num, 14 , 14 , 14 , 14 , 14 , 15 , 15 , 14 )
_MP_Mode = Select(preset_num, 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 )
_M_Thr = Select(preset_num, 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 )
_M_SCD = Select(preset_num, 260 , 260 , 260 , 260 , 260 , 260 , 260 , 260 )
_M_Str = Select(preset_num, 120 , 120 , 80 , 120 , 120 , 0 , 60 , 120 )
_EM_Mode = Select(preset_num, 1 , 1 , 1 , 1 , 1 , 3 , 3 , 3 )
_E_Thr = Select(preset_num, 12 , 10 , 10 , 14 , 14 , 8 , 6 , 14 )
_E_Str_X = Select(preset_num, 0 , 0 , 0 , 0 , 0 , 46 , 46 , 1 )
_E_Str_Y = Select(preset_num, 0 , 0 , 0 , 0 , 0 , 46 , 46 , 0 )
_E_Str_B = Select(preset_num, 0 , 0 , 0 , 0 , 0 , -2 , -2 , 0 )
_Dering = Select(preset_num, false, false, false, false, false, true , false, false)
_DR_Radius = Select(preset_num, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 )
_DR_Str = Select(preset_num, 30 , 30 , 30 , 30 , 30 , 60 , 60 , 30 )
_D_Thr = Select(preset_num, 35 , 32 , 31 , 37 , 39 , 30 , 30 , 30 )
_B_Thr = Select(preset_num, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 )
_LP_Str = Select(preset_num, 30 , 30 , 30 , 30 , 30 , 40 , 40 , 30 )
_Deblock = Select(preset_num, false, false, false, false, false, false, false, false)
_DB_Q = Select(preset_num, 25 , 25 , 25 , 25 , 25 , 25 , 25 , 25 )
_DB_Off_a = Select(preset_num, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 )
_DB_Off_b = Select(preset_num, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 )
_Skin = Select(preset_num, false, false, false, false, false, false, false, true )
_SP_str = Select(preset_num, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 )
_ARAdjust = Select(preset_num, false, false, false, false, false, false, false, true )
_Skin_Type = Select(preset_num, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 )
Resizer = Default(Resizer, _Resizer)
Fast = Default(Fast, _Fast)
S_Str = Default(S_Str, _S_Str)
S_Radius = Default(S_Radius, _S_Radius)
S_Dist = Default(S_Dist, _S_Dist)
T_Str = Default(T_Str, _T_Str)
C_Str = Default(C_Str, _C_Str)
MP_Mode = Default(MP_Mode, _MP_Mode)
M_Thr = Default(M_Thr, _M_Thr)
M_SCD = Default(M_SCD, _M_SCD)
M_Str = Default(M_Str, _M_Str)
D_Thr = Default(D_Thr, _D_Thr)
B_Thr = Default(B_Thr, _B_Thr)
LP_Str = Default(LP_Str, _LP_Str)
[....]
|
|
|
|
|
|
#22 | Link |
|
dumber every day
Join Date: Dec 2006
Location: Planet Earth
Posts: 154
|
@Alain2 .. Thank you for the pointer to that script layout, very cool. I'll see what improvements I can make to the readability of the presets section.
I can't do exactly what he did since I'm allowing you to override a single part of a preset which allows you to take most of preset has and just tweak it vs start from ground zero and specify everything should you just want one change, like thsad for example. Anyway it gives me some stuff to look into! |
|
|
|
|
|
#23 | Link |
|
Registered User
Join Date: May 2005
Posts: 236
|
Actually in fupp layout it is the same, you use
Code:
Preset = Default(Preset, "high") Code:
_Resizer = Select(preset_num, 3 , 4 , 5 , 2 , 0 , 2 , 0 , 3 ) And all these parameters are still overridable, as define after with the Default function, for instance for the resizer (_Resizer from preset is overriden by Resizer if it exists/is defined when calling the function) Code:
Resizer = Default(Resizer, _Resizer) |
|
|
|
|
|
#24 | Link |
|
dumber every day
Join Date: Dec 2006
Location: Planet Earth
Posts: 154
|
Doh! missed the _ on the variable
Perhaps the occasional use of a comment would have helped me ![]() Its certainly one approach to the problem but I think I'm going to leave this in the if-then-else format that I currently have. I'm going to go back and do better alignment of the lines to improve readability though. I'm also intrigued with the string definitions for the functions in one place, makes for easy function changes, may take a shot at that as well. Again thanks for the pointer, good stuff! |
|
|
|
|
|
#25 | Link |
|
dumber every day
Join Date: Dec 2006
Location: Planet Earth
Posts: 154
|
Rev 0.4 posted.
I made some changes mostly aimed at speed. Even for a motion compensated script this was starting to crawl ! I did some benchmarking of functions for speed (function vs function and function vs parameters) to arrive at some new items in the script. The major changes are: 1) changed resizer for the upsampled clip, used to help search for motion vectors. Was LanczosResize now BicubicResize, small speed increase 2) changed noise filter for pre-filtered clip, used to help search for motion vectors. Was fft3dfilter now removegrain + temporalrepair. Large speed increase. Made add config option to choose in the future if there is interest. 3) removed last call to ttempsmoothf, seemed redundant and that is a very slow function. Good speed increase. 4) Improved code readability 5) Improved debug views 6) Added additional lite edge cleaning via masking 7) Changed some of the block and overlap values in the presets to help with speed Overall the speed increased 2-3X from where it was, still slow but now comparable to what you expect from a motion compensated noise script. Let me know if you find any errors in the script or my logic. Thanks |
|
|
|
|
|
#26 | Link |
|
Registered User
Join Date: Jan 2007
Posts: 24
|
Be sure to add that Unfilter is a necessary filter and that the latest package of RemoveGrain should not be used with this script (except for SSETools, which is not in the pre-release package). Also, line 82 calls the function "inpand"; should it instead be "mt_inpand"?
Last edited by Zanejin; 12th November 2007 at 06:05. |
|
|
|
|
|
#27 | Link |
|
dumber every day
Join Date: Dec 2006
Location: Planet Earth
Posts: 154
|
@Zanejin -- good catch on the mt_inpand(), thanks for that! ... I often find myself reading both the V1 anv V2 documentation for masktools since they both have good information. Kind of need to read V1 to understand the V2 sequel but that leads to my mt_ mistakes
![]() I'll make the header update to show unfilter as a req, not sure what to do about the new release of removegrain, for now I just was more explicit via date code in the header of what I've tested. Rev 0.4a posted |
|
|
|
|
|
#28 | Link |
|
Registered User
Join Date: Dec 2002
Location: UK
Posts: 1,673
|
In addition to the filters you listed, I also had to grab unfilter from here:
http://avisynth.org/warpenterprises/ Is that right, or should it have come from somewhere else? Cheers, David. |
|
|
|
|
|
#29 | Link |
|
Registered User
Join Date: Nov 2006
Location: Brazil
Posts: 83
|
Thought I should give an opinion on this filter: it rocks my socks!
Some screens (frame 17790) for comparison purpose. Original: ![]() Denoise + sharpening script 1: Code:
degrainmedian(mode=0) degrainmedian(mode=3) ttempsmooth() fastlinedarkenmod(thinning=0, strength=25) limitedsharpenfaster(ss_x=1.0, ss_y=1.0, smode=4, strength=20) ![]() Denoise + sharpening script 2: Code:
fft3dfilter() ttempsmooth() fastlinedarkenmod(thinning=0, strength=25) limitedsharpenfaster(ss_x=1.0, ss_y=1.0, smode=4, strength=20) ![]() Denoise + sharpening script 3: Code:
mc_spuds(frames=2,strength=4) ttempsmooth() fastlinedarkenmod(thinning=0, strength=25) limitedsharpenfaster(ss_x=1.0, ss_y=1.0, smode=4, strength=20) ![]() I don't even need to use LSF on this. Here's one without it.
|
|
|
|
|
|
#30 | Link |
|
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,182
|
spuds,
why bicubic upsampled instead internal interpolation?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
|
|
|
|
|
#33 | Link |
|
N00B !
Join Date: Jun 2006
Posts: 223
|
![]() ?? also i only called it into my script and just used it as mc_spuds(frames=3,strength=4) my avisynth version is 2.5.8 latest update .. P.S : everything required is there including all the versions of the filters you stated in your first post .. |
|
|
|
|
|
#34 | Link | |
|
ffdshow/AviSynth wrangler
Join Date: Feb 2003
Location: Austria
Posts: 2,441
|
Quote:
np: Bola - AMNiON (Soup)
__________________
now playing: [artist] - [track] ([album]) |
|
|
|
|
|
|
#35 | Link | |||
|
dumber every day
Join Date: Dec 2006
Location: Planet Earth
Posts: 154
|
Quote:
Quote:
... I assume since I'm using pel=2 I could just use sharp=1 to get a pretty similar result. My intention was to utilize the b/c parameters of bicubic to explore their impact and see if anything of interest came out. Does mvtools do a straight b=c=1/3 bicubic for sharp=1 ?Quote:
I have some small updates in the works, I'll post a new version in the next couple of weeks. I've got another notably bad videocam clip that I'm working on to help make further improvements, mostly edge enhancements. |
|||
|
|
|
|
|
#36 | Link | |
|
Registered User
Join Date: Nov 2006
Location: Brazil
Posts: 83
|
Quote:
The blocking seems to be common among filters using mvanalyse or any mvtools thing. |
|
|
|
|
|
|
#37 | Link |
|
dumber every day
Join Date: Dec 2006
Location: Planet Earth
Posts: 154
|
Do you have an example video clip you could post and a still shot of the issue? I'd like to see if it could be avoided.
Blocking to my understanding is an artifact caused by video compression. If you are getting it after you compress the scripts output then we might be able to do a couple of things to the to help avoid that (trick the compression engine to allocate more bandwidth into the sections that are blocking). |
|
|
|
|
|
#38 | Link |
|
Registered User
Join Date: Nov 2006
Location: Brazil
Posts: 83
|
All of those appear while seeking in virtualdub.
Code:
setmemorymax(768)
movie = DGDecode_mpeg2source("G:\Gundam Wing - Endless Waltz\VTS_01_1.d2v",cpu=4,info=3)
movied2v = "G:\Gundam Wing - Endless Waltz\VTS_01_1.d2v"
movie = tfm(movie,d2v=movied2v,order=1).tdecimate(mode=1)
movie = ColorMatrix(movie,hints=true)
last = movie
crop( 4, 0, -4, 0)
Lanczos4Resize(640,480)
mc_spuds(frames=2, strength=2)
![]() Frame 1413 NOT blured. ![]() Frame 1438 blured. ![]() Frame 1439 NOT blured. ![]() Blocks on frame 1459. ![]() Will post an uncompressed vid as soon as I can. |
|
|
|
|
|
#39 | Link | |
|
N00B !
Join Date: Jun 2006
Posts: 223
|
Quote:
also it isnt woking on a 720x480 source .. also i am tryin to get this one to 640x272 .. |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|