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. |
13th June 2021, 04:05 | #21 | Link |
App Digger
Join Date: Sep 2018
Posts: 411
|
Thanks.
But z_pointresize raises an error with interlaced=true. Thus z_pointresize seems to be not working with field-based frames processed by separatefields. See my issue report here. Last edited by JKyle; 13th June 2021 at 04:40. |
13th June 2021, 15:34 | #22 | Link |
App Digger
Join Date: Sep 2018
Posts: 411
|
In addition to the fact that z_PointResize fails on separated fields (interlaced=true), I've also found out that the restriction of chroma subsampling 420 is meaningless. I confirmed that this script works as well with YUV422 and YUV444.
So I modded as follows:
Here's my script code: Code:
# ChubbyRain2.avsi # # http://avisynth.nl/index.php/ChubbyRain2 # # - based on Mug Funky's ChubbyRain # - ChubbyRain2 by Lothar on Doom9's forum # https://forum.doom9.org/showthread.php?p=589885#post589885 # - updated by Asd-g to support HBD # - moddded by JKyle # - z_PointResize reverted back to PointResize to avoid error when interlaced=true # - Loosened chroma subsampling 420 restriction to accept 422 and 444 # ### Requirements ### #------------------- # Bifrost (https://github.com/Asd-g/AviSynth-bifrost) # MaskTools2 (https://github.com/pinterf/masktools) # vsCnr2 (https://github.com/Asd-g/AviSynth-vsCnr2) # ### Changelog ### #--------------- # Changed requirements: replaced Cnr2 with vsCnr2. # Added support for 10..16-bit clips. function ChubbyRain2(clip c, int "th", int "radius", bool "show", int "sft", bool "interlaced") { Assert(IsYUV(c), "ChubbyRain2: only YUV clips are supported.") Assert(IsPlanar(c), "ChubbyRain2: only clips with planar color formats are supported.") th = Default(th, 10) radius = Default(radius, 10) show = Default(show, false) sft = Default(sft, 10) interlaced = Default(interlaced, false) c = (interlaced) ? c.SeparateFields() : c uc = mt_convolution(c, horizontal="1", vertical="1 -2 1", Y=1, U=3, V=3) mt_convolution(c, horizontal="1", vertical="1 2 1", Y=2, U=3, V=3) bifrost(interlaced=false) vsCnr2() cc = TemporalSoften(radius, 0, sft, 2, 2) mt_lutxy(ExtractU(uc), ExtractV(uc), "x y + "+String(th)+" > 255 0 ?", scale_inputs="allf", use_expr=1) PointResize(c.width,c.height) rainbow = mt_expand(y=3, u=-128, v=-128)#.blur(1.5) mt_merge(c, cc, rainbow, y=2, luma=true) return (show) ? rainbow : (interlaced) ? Weave() : last } |
13th June 2021, 15:48 | #24 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Maybe something like this (Untested)
Code:
# ChubbyRain2.avsi # # http://avisynth.nl/index.php/ChubbyRain2 # # - based on Mug Funky's ChubbyRain # - ChubbyRain2 by Lothar on Doom9's forum # https://forum.doom9.org/showthread.php?p=589885#post589885 # - updated by Asd-g to support HBD # - moddded by JKyle # - z_PointResize reverted back to PointResize to avoid error when interlaced=true # - Loosened chroma subsampling 420 restriction to accept 422 and 444 # ### Requirements ### #------------------- # Bifrost (https://github.com/Asd-g/AviSynth-bifrost) # MaskTools2 (https://github.com/pinterf/masktools) # vsCnr2 (https://github.com/Asd-g/AviSynth-vsCnr2) # ### Changelog ### #--------------- # Changed requirements: replaced Cnr2 with vsCnr2. # Added support for 10..16-bit clips. function ChubbyRain2(clip c, int "th", int "radius", bool "show", int "sft", bool "interlaced") { Assert(IsYUV(c), "ChubbyRain2: only YUV clips are supported.") Assert(IsPlanar(c), "ChubbyRain2: only clips with planar color formats are supported.") th = Default(th, 10) radius = Default(radius, 10) show = Default(show, false) sft = Default(sft, 10) interlaced = Default(interlaced, false) c = (interlaced) ? c.SeparateFields().AssumeFrameBased : c uc = mt_convolution(c, horizontal="1", vertical="1 -2 1", Y=1, U=3, V=3) mt_convolution(c, horizontal="1", vertical="1 2 1", Y=2, U=3, V=3) bifrost(interlaced=false) vsCnr2() cc = TemporalSoften(radius, 0, sft, 2, 2) mt_lutxy(ExtractU(uc), ExtractV(uc), "x y + "+String(th)+" > 255 0 ?", scale_inputs="allf", use_expr=1) z_PointResize(c.width,c.height) # Dont know if this is correct rainbow = mt_expand(y=3, u=-128, v=-128)#.blur(1.5) mt_merge(c, cc, rainbow, y=2, luma=true) return (show) ? rainbow : (interlaced) ? AssumeFieldBased.Weave() : last } assummng that you approve them.
__________________
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; 13th June 2021 at 16:09. |
13th June 2021, 16:42 | #25 | Link |
Registered User
Join Date: Jan 2018
Posts: 2,153
|
Here for fixed, you can check it:
https://github.com/Asd-g/AviSynthPlu...bbyRain2_.avsi Last edited by kedautinh12; 13th June 2021 at 16:50. |
13th June 2021, 16:56 | #26 | Link | ||
App Digger
Join Date: Sep 2018
Posts: 411
|
Quote:
Quote:
The script works on other planar color formats as well. --- And StainlessS's idea doesn't work, either. It simply outputs black pixels on HBD sources. Last edited by JKyle; 13th June 2021 at 17:00. |
||
13th June 2021, 18:10 | #28 | Link | |
Registered User
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
|
Quote:
|
|
13th June 2021, 18:23 | #29 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Code:
# ChubbyRain2.avsi # # http://avisynth.nl/index.php/ChubbyRain2 # # - based on Mug Funky's ChubbyRain # - ChubbyRain2 by Lothar on Doom9's forum # https://forum.doom9.org/showthread.php?p=589885#post589885 # - updated by Asd-g to support HBD # - moddded by JKyle # - z_PointResize reverted back to PointResize to avoid error when interlaced=true # - Loosened chroma subsampling 420 restriction to accept 422 and 444 # ### Requirements ### #------------------- # Bifrost (https://github.com/Asd-g/AviSynth-bifrost) # MaskTools2 (https://github.com/pinterf/masktools) # vsCnr2 (https://github.com/Asd-g/AviSynth-vsCnr2) # ### Changelog ### #--------------- # Changed requirements: replaced Cnr2 with vsCnr2. # Added support for 10..16-bit clips. Function ChubbyRain2(clip c, int "th", int "radius", bool "show", int "sft", bool "interlaced") { Assert(IsYUV(c), "ChubbyRain2: only YUV clips are supported.") Assert(IsPlanar(c), "ChubbyRain2: only clips with planar color formats are supported.") th = Default(th, 10) radius = Default(radius, 10) show = Default(show, false) sft = Default(sft, 10) interlaced = Default(interlaced, false) c = (interlaced) ? c.SeparateFields().AssumeFrameBased : c uc = mt_convolution(c, horizontal="1", vertical="1 -2 1", Y=1, U=3, V=3) mt_convolution(c, horizontal="1", vertical="1 2 1", Y=2, U=3, V=3) bifrost(interlaced=false) vsCnr2() cc = TemporalSoften(radius, 0, sft, 2, 2) mt_lutxy(ExtractU(uc), ExtractV(uc), "x y + "+String(th)+" > 255 0 ?", scale_inputs="allf", use_expr=1) z_PointResize(c.width,c.height) rainbow = mt_expand(y=3, u=-128, v=-128)#.blur(1.5) mt_merge(c, cc, rainbow, y=2, luma=true) return (show) ? rainbow : (interlaced) ? AssumeFieldBased.Weave() : last } # I did not have any of these and so had to download them. LoadPlugin(".\Bifrost_x86.dll") LoadPlugin(".\vsCnr2_x86.dll") LoadPlugin(".\avsresize_x86.dll") # ADDED #LoadPlugin(".\Bifrost_x64.dll") #LoadPlugin(".\vsCnr2_x64.dll") #LoadPlugin(".\avsresize_x64.dll") ColorBars().KillAudio ConvertToYV24.ConvertBits(10) # YUV444P10 : OK #ConvertToYV16.ConvertBits(16) # YUV422P16 : OK #ConvertToYV16.ConvertBits(32) # YUV422PS DONT WORK : bifrost 8 -> 16 bit only LACED=True ChubbyRain2(th=10, radius=10, show=false, sft=10, interlaced=LACED) info #ConvertToRGB32 # if cannot view in player Return Last
__________________
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; 13th June 2021 at 19:19. |
|
13th June 2021, 18:51 | #31 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
So is mine, I'll test in 64 bit.
EDIT: NOPE, fails in x64. I'll find out why.
__________________
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; 13th June 2021 at 18:54. |
13th June 2021, 18:59 | #32 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
OK, My error in above post, it worked ok in x64.
I had used my default PotPlayer x86 [from within PS-PAD text editor] using x64 plugins in the script, thats why it failed. But when loading script in x64 Vdub2 [EDIT: or Potplayer x64], plays OK. result with 16 bit clip,YUV422P16 EDIT: I earlier downloaded current versions of all 3 plugs, perhaps you have an old one.
__________________
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; 14th June 2021 at 01:39. |
13th June 2021, 19:31 | #33 | Link | ||
App Digger
Join Date: Sep 2018
Posts: 411
|
Quote:
Quote:
All my plugins are the most recent ones to the best of my knowledge. Avsresize r6 StvG : https://forum.doom9.org/showthread.p...08#post1943908 Bifrost 2.1.0 : https://github.com/Asd-g/AviSynth-bi...ases/tag/2.1.0 vsCnr2 1.0.0 : https://github.com/Asd-g/AviSynth-vs...ases/tag/1.0.0 Masktools2 2.2.26 : https://github.com/pinterf/masktools...ses/tag/2.2.26 ffms2 2020-11-23 StvG : https://forum.doom9.org/showthread.p...93#post1928993 BTW, Asd-g's new fix seems to work OK with interlaced sources. (By deinterlacing the source first with TDeint.) Now the only thing that confuses me is why he put the 420 restriction in his script. Last edited by JKyle; 13th June 2021 at 19:58. |
||
13th June 2021, 19:55 | #34 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Avsresize r6 StvG : https://forum.doom9.org/showthread.p...08#post1943908
Bifrost 2.1.0 : https://github.com/Asd-g/AviSynth-bi...ases/tag/2.1.0 vsCnr2 1.0.0 : https://github.com/Asd-g/AviSynth-vs...ases/tag/1.0.0 Above same as me. I'm using earlier Masktools and ffms2 [probably got them, just not installed in plugins yet]. Maybe prob down to some size requirement [multiple of whatever, x and y]. I'll down your sample maybe a little later and try, I'm off out down the pub soon, some celebrations still going on there I think. [football]
__________________
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; 14th June 2021 at 01:54. |
14th June 2021, 00:44 | #35 | Link |
App Digger
Join Date: Sep 2018
Posts: 411
|
Looking at the script code, z_PointResize applies to the plane that has either 0 or 255(scaled) according to the expression in mt_lutxy.
But I see no gain of using a z_ function on those values where the algorithm is a simple nearest neighbor method. So I think we better not use z_PointResize in this case. This way, we can get rid of the need to deinterlace the interlaced source (like Asd-g introduced in his fix) and thus save the processing time drastically for interlaced sources. And about the chroma subsampling restriction, I see no reason why the source should be 420. No function in the script forces that restriction. Therefore, I believe the script suggested in my above post is a proper version that works as expected. |
14th June 2021, 11:34 | #37 | Link |
Registered User
Join Date: Jan 2018
Posts: 2,153
|
Asd-g explain his choice
https://github.com/Asd-g/AviSynthPlu...ment-860541218 |
14th June 2021, 20:34 | #38 | Link |
App Digger
Join Date: Sep 2018
Posts: 411
|
I've been mistakenly missing the incorrect application of TemporalSoften to separated fields of interlaced sources.
Asd-g disabled(dummied) the interlaced option and removed the SeparateFields process on interlaced sources for this and other related issues. I think his mod is better in this regard. Here's his script. You need Avsresize additionally to run his script since he adopts z_PointResize. And real.finder has come up with his own solution, ChubbyRain3, to address the interlaced source issues. See here for reference. |
14th June 2021, 22:31 | #39 | Link |
App Digger
Join Date: Sep 2018
Posts: 411
|
I've found an issue with Asd-g's new script on some source files. See here.
So I replaced z_PointResize with PointResize to avoid such errors. Like Asd-g mentioned, "there is no gain of using z_ over internal resizer because of the factor (2)". And instead of disabling the interlaced option, I put it in Bifrost. The output looks satisfying, and I believe it's OK since no field separation is involved this time. Code:
######################################################################################### # # ChubbyRain2.avsi # # http://avisynth.nl/index.php/ChubbyRain2 # # - based on Mug Funky's ChubbyRain # - ChubbyRain2 by Lothar on Doom9's forum # https://forum.doom9.org/showthread.php?p=589885#post589885 # - updated by Asd-g to support HBD # - mod by JKyle # ### Requirements ### #------------------- # Bifrost (https://github.com/Asd-g/AviSynth-bifrost) # MaskTools2 (https://github.com/pinterf/masktools) # vsCnr2 (https://github.com/Asd-g/AviSynth-vsCnr2) # ### Changelog ### #--------------- # Changed requirements: replaced Cnr2 with vsCnr2 (Asd-g) # Added support for 10..16-bit clips (Asd-g) # Removed restriction for only 420 video (Asd-g) # Made parameter "interlaced" dummy (Asd-g) # Replaced z_PointResize with PointResize (JKyle) # Revived "interlaced" for use in Bifrost (JKyle) # ######################################################################################### function ChubbyRain2(clip c, int "th", int "radius", int "sft", bool "interlaced", bool "show") { th = Default(th, 10) radius = Default(radius, 10) sft = Default(sft, 10) interlaced = Default(interlaced, false) show = Default(show, false) uc = mt_convolution(c, horizontal="1", vertical="1 -2 1", Y=1, U=3, V=3) mt_convolution(c, horizontal="1", vertical="1 2 1", Y=2, U=3, V=3) Bifrost(interlaced=interlaced) vsCnr2() cc = TemporalSoften(radius, 0, sft, 2, 2) mt_lutxy(ExtractU(uc), ExtractV(uc), "x y + "+String(th)+" > 255 0 ?", scale_inputs="allf", use_expr=1) PointResize(c.width, c.height) rainbow = mt_expand(y=3, u=-128, v=-128)#.blur(1.5) mt_merge(c, cc, rainbow, y=2, luma=true) return (show) ? rainbow : last } [Update] As Asd-g explained in his reply, you need to deinterlace the source properly (BWDIF or yadifmod2, etc.) in order to use his script. See here for detail. Last edited by JKyle; 14th June 2021 at 23:48. Reason: Asd-g's script prerequisite explained |
14th June 2021, 23:57 | #40 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
new update for ChubbyRain3 https://github.com/realfinder/AVS-St...ubbyRain3.avsi
it should be faster than ChubbyRain2 without interlaced=true, and it should work as it should when using interlaced=true
__________________
See My Avisynth Stuff |
Thread Tools | Search this Thread |
Display Modes | |
|
|