PDA

View Full Version : scaling, aspect


jmac698
25th August 2006, 13:54
The SD/HD aspect ratio faq, version 0.2-draft

This is quick summary of timings and resolutions. To fully understand it,
you should have read some of the references. It covers DVD resolutions,
including 2.35 and 16:9 movies, with anamorphic video. It also covers
upscaling to HDTV. The theory is supported with some actual measurements.
The reason for this FAQ is especially converting between HDTV resolutions
properly, for example upscaled movie in pillarboxed HDTV back to DVD.
Also included, a conversion guide.

Standard Definition section
---------------------------
Derived and tabulated from [1].

13.5Mhz sampling
samples, pixels sampling periods, microseconds
ntsc pal NTSC PAL
total samples 858 864 63.55 64
picture 720 720 53.33 53.33*
right side 16 12 1.19 .89
left side 122 132 9.04 9.78

*Note: actually 53+1/3

Microseconds rounded to 2 places, pixels rounded to whole number.

18MHz sampling
samples, pixels sampling periods, microseconds
ntsc pal NTSC PAL
total samples 1144 1152 63.55 64
picture 960 960 53.33 53.33
right side 21 16 1.16 .89
left side 163 176 9.06 9.78

ntsc pal
frame period 33.3667 40
line period 63.5556 64
samples/line 858 864
active period 52.66* 52
active 711 702

*Note: actually 52+59/90

Pixel Aspect Ratios, from [3], D1 720x480 video (DVD)
Type DAR PAR Square Active
NTSC 4:3 160/117 1.37 128/117 1.09 658 650
NTSC 16:9 640/351 1.82 512/351 1.46 494
PAL 4:3 108/79 1.37 72/79 0.91
PAL 16:9 144/79 1.82 96/79 1.22

*Note: Active video in NTSC is (4739/90)*13.5=710.85 pixels of 720 (D1).
In PAL, it's 52*13.5=702.

References
[1] Capture Guide, http://www.doom9.org/capture/sizes_advanced.html
[2] BT.601-5
[3] Resolutions, Aspect Ratios And The ITU-R BT.601 Standard, http://forum.doom9.org/showthread.php?t=42708

HD Section
-------------
aspect sqSD/DAR/unsqueezed rectSD/DAR/unsqueezed squareHD
4:3 640x480 4:3 640x480 720x480 4:3 720x480 1440x1080
16:9ltr 640x360 4:3 640x360 720x360 4:3 720x360 1920x1080
2.35 640x272 4:3 640x272 720x272 4:3 720x272 1920x817
ana16:9 640x480 16:9 853x480 720x480 16:9 960x480 --
ana2.35 640x360 16:9 853x360 720x360 16:9 960x360 1920x817

HD pixels are square and the Display Aspect Ratio is a pure 4:3 or 16:9. Thus,
if you can compare material from HD to an SD source, you can work backwards
to see what the SD aspect ratio was.
Here is the first result of an actual test, comparing HD to DVD:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
hd=MPEG2Source ("C:\MyVideos\wide-hd.d2v", idct=3, cpu=2, upConv=1)
sd=MPEG2Source ("C:\MyVideos\wide-sd.d2v", idct=3, cpu=0, upConv=1)
sd=sd.trim(1828,0)
hd=hd.trim(1666,0)

sd=sd.crop(0,58,-0,-62)
sd=sd.BicubicResize(1912,788)
sd=sd.letterbox(2,2,2,2)
r=layer(hd,sd,"add",level=200,x=4,y=29)

Here we took a 720x360 2.35 anamorphic widescreen SD and mapped it
to a 16:9 HD. The 360 height of SD maps to 788 of HD, and 720 of width
to 1912 of HD width. That's a stretch of 2.66x width and 2.19 height.
These results are only approximate, but seem to fit with a non-ITU
scaling, where 720x486->1920x1080, which would be 2.66 in X and 2.22 in Y.
The SD image is approximately horizontally centered and near the top
in the Y direction. It would seem that all versions (2.35, fullscreen) can
be derived from a 16:9 version. It would be interesting to research if
this is practice in the film industry.
UPDATE: this upscaling test doesn't seem to match any of the logical zooms below, 1920x800 would be a 2.22 zoom. Also, the test in question was shot on Super35mm film, which uses a non-anamorphic lens to create all versions of the film. The framing marks for 4:3, 16:9, and 2.35:1 are marked on a piece of glass in the camera, and that decision is made by the Director of Photography. The full-frame version is often higher than the widescreen versions. Super35 film is about 1.39:1 aspect. The 16:9 version is indeed showing the most film area, plus a bit at the top of the 4:3 version.

jmac698
15th October 2006, 22:46
Some updates. Remember, 710.85x486 represents 4:3 aspect exactly, but each pixel is less wide than tall. For square pixels, 648x486 is exactly 4:3 aspect.
You need to know about square pixels to display on a computer, or convert to HDTV which uses square pixels. So an analog capture made at 720x480 should be scaled and shown on a computer at 656x480, of which only the middle 648 pixels probably contain a picture.


1:1 rec601
656x480->720x480, >4:3 aspect
648x486->711x486, 4:3 aspect
640x480->702x480, 4:3 aspect
Finally, 704 is the nearest multiple of 8, which is needed by mpeg encodes.

upscaling possibilities

SD HD
x/y x/y zoom scalex
711x486 1440x1080 2.22 2.0253
720x486 1458x1080 2.22 2.025
702x480 1422x1067 2.22 2.0256
702x480 1280x960 2 1.823
711x486 1296x972 2 1.82278
720x486 1313x972 2 1.8236
702x480 1440x1080 2.25 2.10256
711x480 1458x1080 2.25 2.0506
720x480 1476x1080 2.25 2.05
711x486 1458x1093.5 2.25 2.0506

warning: these calculations are not done to the highest accuracy, but should be ok to the nearest pixel.
If a 640x480, correct 4:3 aspect movie has been made, exported to 720x480, then upscaled, the highest zoom of 2.25 should be possible, and converted to 1440x1080

jmac698
15th October 2006, 23:22
One more thing you need to properly upscale/downscale, is what is defined as a common reference point. Why are letterbox movies always at 58/62 instead of 60/60 y-cropped pixels? It must be that line 242 is considered the middle of the screen. Also tests upscaling DVD/TV to HD and comparing, there is a slight shift there. Just an idea.. be back some other day!