View Single Post
Old 10th May 2010, 09:33   #13  |  Link
Robert Martens
Registered User
 
Join Date: Feb 2010
Location: New York
Posts: 116
Quote:
Originally Posted by Undead Sega View Post
And does it have to be DV video specifically as the input?
It's taken a month, but I've finally addressed this.

I couldn't resist. Someone contacted me about SimpleSlug, asked a few questions, and made a comment in passing that led me to believe they thought the script could handle both anamorphic AND square pixel widescreen footage. At the time I only accepted widescreen DV, so I said to myself "Self, you should tweak the script ever so gently to allow a slightly greater range of input sizes".

Well, everything with me turns into a project, so a few weeks after my brilliant idea (and a few days later than I'd planned, thanks to a family member's computer virus), I give you SimpleSlugUpscale 0.8, which will accept any size input with any pixel aspect ratio, and scale it to any size and PAR output.

I was so happy with previous versions not being wider than a page (as displayed on my 1024x768 CRT), or much taller than one, but that's gone right out the window in favor of legibility. White space abounds in this script, in an attempt to make things more understandable (for myself, if no one else), and as such I must refrain from posting a code block here. Trying to twist it into something that would be readable on a message board could be a bit of a challenge, to say the least.

To summarize the changes, the script now:

-Allows any size and PAR input and output ('outwidth', 'outheight', and 'PARout' are used to define custom target sizes)

-Allows any deinterlacer

-Supports progressive clips by 'prog' boolean, which will bypass deinterlacing and go straight to cropping, scaling and/or boxing

-Has a revised box function that does pillar or letterboxes depending on input and output shape

-Contains ep0 and ep1 parameters, to allow extra parameters for resizer (taps for Blackman and Lanczos, b and c for Bicubic, p for Gauss)

-Contains PARin and PARout parameters, to specify custom pixel aspect ratios (assuming presets don't properly handle your footage)

-Has lost the 'croptop' parameter, its functionality replaced with 'vshift' ('hshift' also available)

-Features 'boxcolor' to set color of pillar/letterbox (integer, either an RGB value or one of the global variables defined in AviSynth 2.5\plugins\colors_rgb.avsi)

-Also features 'boxbgblur' to change amount of blur for "boxbg" size modes

-No longer has YV12 conversion built in; this must be handled before SimpleSlug is called. If you're using RGB footage and an RGB deinterlacer, you won't need any conversion. Same for YUY2 with a YUY2 deinterlacer. By default I'm using TempGaussMC, as always, so you'll need to produce YV12 input with either the 'pixel_type' parameter of your source filter or a ConvertToYV12(interlaced=true) filter before you run SSU.

-Defaults output sizes to mod 8, but this behavior can be changed with 'modw' and 'modh' (will always Floor to the nearest multiple that's below the target output size for a given axis)

-Uses a greater number of TGMC defaults for the "balance" 'qual' setting; with the perspective of some time, I see now my changes had a tendency to make video look too artificial. Bringing back TempGauss' defaults makes for a better result, to my eye. You can certainly adjust things to suit your own taste, if you feel so inclined.

From my research here on Doom9, I only now get the impression that I've ended up duplicating the work of at least a few other members, namely mikeytown2 and his ZoomBox function--among others--but this new set of features seemed useful for SimpleSlug, and I needed the practice working with Avisynth. I wasn't looking to steal anyone's thunder, I just got carried away.

I suppose this script isn't very "simple" anymore, if you use the full array of features, but there are only four things you must do to get this new version working: convert interlaced video to the proper color space for your deinterlacer, set 'prog' true if the input is progressive, set 'widein' true if it's anamorphic, and choose a 'size' option from the list (pay close attention to that, names have been added, removed, and changed from prior releases). Most everything else should be taken care of automatically, so I think the script should still manage to ease the pain of all this scaling business for the uninitiated. Not that I'm such an expert, but you know what I mean.

I've cleaned the script up as much as I can for now; I'd love to sit on this thing until I'm absolutely sure it's perfect, but nothing's ever perfect, so there it is. It's still pre-1.0, anyway, so brace yourself for bugs. Hopefully there won't be many, since I've tested input of quite a few shapes and sizes: 720x480, 720x576, 1280x720, 1920x1080, 1440x1080, 1080x1920 (yes, tall and narrow), 720x1280, 1280x768, 848x480, 320x240, 320x210, 4520x720, 2048x1152, all the sample clips I've been able to find, shoot, or generate. I've tried output that was each of those sizes, plus a dozen others. Some 4:3, some 16:9, some 1:1, some real oddball ratios, and some output dimensions that were literally odd, as is possible with RGB processing.

Upscaling defaults, as it always has, to BlackmanResize, but now I default to Bilinear for downscaling. This can, of course, be overridden by the 'resize' parameter, so everyone's free to choose their poison. I know there's a concern for excessive high frequency detail when downscaling, but in my admittedly informal tests I haven't found any problems with taking 1920x1080 from a Canon XF series camera, or 2048x1152 shot by a RED One, down to NTSC DV resolution. I scaled down to 720x480, compressed with Cedocida, brought the clips into Avid Liquid, then sent them out over the breakout box component outputs to my old Sony CRT, and it was gorgeous, no twitter, didn't look overly sharp. The Canon XF clip was interlaced, and as per the defaults I deinterlaced it with a simple Bob() (triggered if the output height is 1.5 times or more smaller than the input height; less severe downscales use my "low" TGMC preset). Take that with a grain of salt, though, as I haven't had any experience with downscaling issues. If you find my defaults objectionable, feel free to override them, and please let me know if you have suggestions.

I think I've tested a good number of possible input and output scenarios, but there can never be too many tests, so if you have any footage that's an interesting size, shape, or pixel aspect ratio on your hands, I'd appreciate if you could try it out with SimpleSlug and see what happens.

Last edited by Robert Martens; 5th March 2011 at 23:16.
Robert Martens is offline   Reply With Quote