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. |
|
|
Thread Tools | Search this Thread | Display Modes |
4th October 2022, 14:17 | #1 | Link |
Registered User
Join Date: Jan 2015
Posts: 1,056
|
Bicubicresize() and Bob() should default to Catrom, not Mitchell-Netravali
Catrom is the One True Cubic, a claim that I base on the following two facts:
1) It's the only cubic that preserves linear gradients (it follows the b+2c=1 rule) and also always passes through the original control points/samples (is a "no-op") 2) Spline16, Lagrange-2, Lanczos-2, etc. are all approximations of Catrom and not any other cubic EDIT: in PSNR tests, it also kicks Mitchell-Netravali's ass all up and down the sidewalk every day of the week and twice on Sundays.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers. Last edited by Katie Boundary; 5th October 2022 at 17:14. |
4th October 2022, 16:03 | #2 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
Create a couple of wrapper functions with whatever defaults you prefer and use those.
Code:
function KatieBicubic(clip Source, int target_width, int target_height, \ float "src_left", float "src_top", float "src_width", float "src_height", float "B", float "C") { B = default(B, 0) C = default(C, 0.5) BicubicResize(Source, target_width, target_height, \ src_left=src_left, src_top=src_top, src_width=src_width, src_height=src_height, b=B, c=C) } |
4th October 2022, 17:51 | #3 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Quote:
|
|
4th October 2022, 19:25 | #4 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
And here Katie CatromResize() as discussed in Katie PM.
Code:
Function CatromResize(clip a, int w, int h, float "src_left", float "src_top", float "src_width", float "src_height") { src_left = Default(src_left ,0.0) # Should provide defaults for optionals, otherwise are UNDEFINED src_top = Default(src_top ,0.0) # Ditto : (If client specifies src_top then use it, otherwise default to 0.0) src_width = Default(src_width ,0.0) # Ditto src_height = Default(src_height,0.0) # Ditto BicubicResize(a, w, h, 0, 0.5, src_left, src_top, src_width, src_height) } And here slightly more Advanced implementation Code:
Function CatromResize(clip a, int w, int h, float "src_left", float "src_top", float "src_width", float "src_height") { BicubicResize(a, w, h, 0, 0.5, src_left, src_top, src_width, src_height) } BicubicResize and have it supply its defaults instead [EDIT: when are undefined]. Either we supply 0.0 default, or BicubicResize does, dont really matter which does it, only need to supply our own defaults if we require different defaults than used by BicubicResize. Note, HH moved args b,c, to end of arg KatieBicubic() list. EDIT: Removed "c=" and "b=" from "c=0" and "b=0.5" [leaving the above in blue] Otherwise need supply all of the src left/src_top etc together with names. Once you supply a named argument in a function call, all following supplied args (if any) MUST also be supplied named. UNTESTED, EDIT: Katie, use one of above. PM script functions bugged due to red line above.
__________________
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; 4th October 2022 at 20:19. |
5th October 2022, 10:37 | #6 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,075
|
Lanczos are sinc weighted by sinc and may be very 'long' in taps. It is from DSP-theory of signals processing. Bicubic is fixed number of samples kernel and not based on sinc. Lanczos2 uses same number of taps also may looks close to some bicubic b,c but the curve still not the equal I think because bicubic is based on different basis function (x^n, not sin(x)).
|
5th October 2022, 17:11 | #7 | Link |
Registered User
Join Date: Jan 2015
Posts: 1,056
|
This is a discussion of what AVIsynth default behavior should be. It has nothing to do with the creation of custom AVSI files. In our PM conversations, I was merely using Catrom as an example to better understand how AVSI scripting works in general.
Also, your inbox is full.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers. |
6th October 2022, 10:09 | #10 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
__________________
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 ??? |
|
7th October 2022, 17:15 | #11 | Link |
Registered User
Join Date: Jan 2015
Posts: 1,056
|
I'm not criticizing or complaining. I'm clarifying the purpose of the thread so that discussions can be properly contained.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers. |
|
|