Determine if source file will be upscaled or downscaled
Posted: Tue Oct 27, 2009 4:44 am
CX2D version 4 includes new scalar filters to resize source file resolution to that to be converted to. It is important to some people to know if the source resolution will be upscaled or downscaled in order to pick a filter they believe works best for upscaling or downscaling.
The determination cannot be made by simply comparing source resolution with that to be converted to because pixel shape of the source and converted target can be different. So one has to calculate the resolution that the source will be scaled to and compare that with source resolution.
Some definitions are needed before presenting equations to determine the resolution a source will be rescaled to.
SAR (Source Aspect Ratio) ~ the aspect ratio of the source file being converted
TAR (Target Aspect Ratio) ~ the aspect ratio to be converted to -- either 4:3 = 1.333 or 16:9 = 1.778
THP (Target Horizontal Pixels) ~ number of horizontal pixels to be converted to -- 720 for Full D1 resolution for example
TVP (Target Vertical Pixels) ~ number of vertical pixels to be converted to -- 480 NTSC or 576 PAL for Full D1 resolution for example
SHP (Source Horizontal Pixels) ~ number of horizontal pixels in source
SVP (Source Vertical Pixels) ~ number of vertical pixels in source
How to determine these values for either version 4 or 5 is explained in Notes 1 and 2 of http://forums.vso-software.fr/calculati ... t9319.html.
If SAR > TAR, a source file will be rescaled to THP horizontal pixels and [(TAR/SAR) x TVP] vertical pixels. If SAR < TAR, the source will be scaled to [(SAR/TAR) x THP] horizontal pixels and TVP vertical pixels.
So a source is upscaled if either of the rescaled components is greater than the corresponding source resolution component, downscaled otherwise.
Note: You can verify the equations above for new scaled resolutions with entries in the conversion log like
Video processing: Mitchell (VSO) resampler (720*480)->(720*428) 4 threads
This entry shows slight downscaling even though the source had 720x480 resolution and was converted to 720x480 NTSC.
The determination cannot be made by simply comparing source resolution with that to be converted to because pixel shape of the source and converted target can be different. So one has to calculate the resolution that the source will be scaled to and compare that with source resolution.
Some definitions are needed before presenting equations to determine the resolution a source will be rescaled to.
SAR (Source Aspect Ratio) ~ the aspect ratio of the source file being converted
TAR (Target Aspect Ratio) ~ the aspect ratio to be converted to -- either 4:3 = 1.333 or 16:9 = 1.778
THP (Target Horizontal Pixels) ~ number of horizontal pixels to be converted to -- 720 for Full D1 resolution for example
TVP (Target Vertical Pixels) ~ number of vertical pixels to be converted to -- 480 NTSC or 576 PAL for Full D1 resolution for example
SHP (Source Horizontal Pixels) ~ number of horizontal pixels in source
SVP (Source Vertical Pixels) ~ number of vertical pixels in source
How to determine these values for either version 4 or 5 is explained in Notes 1 and 2 of http://forums.vso-software.fr/calculati ... t9319.html.
If SAR > TAR, a source file will be rescaled to THP horizontal pixels and [(TAR/SAR) x TVP] vertical pixels. If SAR < TAR, the source will be scaled to [(SAR/TAR) x THP] horizontal pixels and TVP vertical pixels.
So a source is upscaled if either of the rescaled components is greater than the corresponding source resolution component, downscaled otherwise.
Note: You can verify the equations above for new scaled resolutions with entries in the conversion log like
Video processing: Mitchell (VSO) resampler (720*480)->(720*428) 4 threads
This entry shows slight downscaling even though the source had 720x480 resolution and was converted to 720x480 NTSC.