View Single Post
Old 22nd November 2011, 09:26   #6  |  Link
Gainnothing
Registered User
 
Join Date: Jan 2005
Posts: 23
Quote:
Originally Posted by vampiredom View Post
Wow. There is a lot of stuff there. Too much for me to process.



I really can't understand what you're getting at with this. I would assume anything that is 640x360 to be square pixel 16:9 (this assumption could be wrong, but you've provided no real information about your source other than the dimensions). So, to bring that optimally to widescreen NTSC DVD specs, resizing to 704x480 and adding 8 pixel borders to the sides would be correct, or as close to correct as you can come.

646 5/22 is a really strange number. I am guessing you got that from 640 * (486/480) ... That is just wrong. The "real" NTSC vertical resolution may be 486 but DVDs are 480, and PAR specs are what they are regardless. You could say that a DVD is a 720x480 "crop" of 720x486 area or, more accurately, a 480 height-crop with 8 extra pixels on each side that stick out beyond an area 704x486... or something like that.

NTSC widescreen is actually a tad wider than 16:9 ... that's why there are those 8 pixel borders you have to add. The 16:9 area is 704x480.

There will always be resizing for HDTV because the resolutions of 640x360, NTSC DVD and HDTV are not equal.

You can keep it letterboxed on 4:3 DVD if you want, but that will have less real pixels to serve up to the display. It is usually a good idea to use the widescreen PAR for widescreen material on DVD so as to maximize this.

If you really want the letterboxing, know that NTSC 4:3 PAR is 10:11.

640 * (10/11) = 704 x 360

So, the letterboxed 4:3 would be achieved by:

Code:
# I will also recommend Spline36Resize in instead of Lanczos
Spline36Resize(704,360)
AddBorders(0,120,0,120)
If you really hate the borders on the sides, you can go with 720x368 but, to me, it seems senseless to scale the image height from 360->368.

I hope this helps. Perhaps others will address your other points.
Article location:

http://lipas.uwasa.fi/~f76998/video/conversion/


My goal:
This video I have is letterboxed. My first step is to leave as it is, letterboxed, and just adjust for DVD analog tv. I do not want to advanced to HDTV yet. Of course, there is resizing for HDTV. What I meant is I am not ready to encode for HDTV YET. First step: see it on my analog screen as is. Next step: see it on same tv:full version. Next step after: HDTV So you jumped kind of 3 steps ahead of me and there was a communication error.

From article here are the specs for DVD NTSC

Sampling Matrix:
720 x 480

Sampling rate:
13.5

PAR:
4320/4739

Width in Microsecs:
53.33333

Active Image ARea Width:
710.85

Active Image Area Height:
486


There is no mention about 480 x 360 so based upon the chart I came up with a guess for the active image area.

Matrix:
640 x 360

My guestimate for PAR:


Par = dar/sar
(4/3) / 646+5/22 / 368

(4/3) {368/ 646+ 5/22)
1472/1938.681818181818

= .759278797683524
which apx equals rougly 323384/42651


My guestimate for Active image area width:

646 5/22 (look at the guys chart as it matches D2 standard)

My guestimate for Active image area height:
368

height usually does not change and most cases stays at 486 but is 243 for VCD qaulity. I have tried 486 as a height but got an ugly answer. Thus 368 sounded reasonable. I also tried 352 as a height and the width came height was almost in the 490's, so I kind of just killed that idea. 368 sounded reasonable but if you want to know the incorrect stats here they are:

HERE IS THE INCORRECT GUESS FOR HEIGHT USING 352

First figuring out PAR

Par = dar/sar
(4/3) / 646 5/22/352

(4/3) {352/646 5/22)
1408/1938.681818181818

= .72626667604511
30976/42651 will be the PAR for this TRY


Vertical Conversion Factor:

486/352 = 1.380681818181818 = 243/176


Horizontal Conversion Factor:

30976/42651 / (4320/4739)

(30976/42651) (4739/4320)

(30976/6093) (677/4320)

(3872/6093) (677/540) (divide by 8)

(968/6093) (677/135) (divide by 4)

(655,336/822,555)( 243/176) multiplying vertical conversion

(655,336/ 274,185) (81/176) (DIVIDE by 3)

(655,336 /30,465) (9/176) divide by 9

(655,336/3385) (1/176) (divide by 9)

(163,834/3385) (1/44) (divide by 4)

(81,917/3385) (1/22) (divide by 2)

(7,447/3385) (1/2) (divide by 11)

(7447/6770) = 1.1 Horizontal Conversion Factor


New Horizontal Size (width)


(1.1) (640) = 704

NEW VERTICAL SIZE (height)

(243/176) (360/1)

(243 /22) (45/1)

(10935/220 = 498

So in this example you would have resize to

704 x 498 so you would have to addborders to the left and right by 8.

Addborders (8,0,8,0)

And then we would have to crop 9 on the top and bottom

Crop (0,9,0,9)


Thus:

LanzcosResize(704,498)
Crop (0,18)
Addborders (8,0,8,0)

That was the ugly answer .



Here is the 368 for the height:

First figuring out PAR since it is NOT in this guy’s chart:

Par = dar/sar
(4/3) / 646 5/22/368

(4/3) {368/646 5/22)
1472/1938.681818181818

= .759278797683524

Again, no resizing for HDTV. Just a regular par for 1.333333….
There is a calculator on the Internet that is helpful for this purpose that I found:

http://www.basic-mathematics.com/dec...alculator.html



Using bottom one here for PAR
323384/42651 = 0.7592787976835245 sounds like a great answer that is really close to the division but is off by a couple and that is why I underlined the end of the number. But we will use this fraction as the GUESTIMATE for PAR. Actually now that I am looking at the numbers it is a perfect match with an added number.

Now, following the procedure as outlined in “A Quick Guide to Digital Video Resolution and Apect Ratio conversions. Read the procedure or my numbers will be meaning nothing to you.

This is my work below: Please note I am not great at finding the LCM or GCF right away, so that is why it takes me so long.


Vertical ConversIon factor
486/368 = 1.320652173913044 or 243/184

The article mentions that anything other than 0.5, 1, or 2 may be because you are doing standards conversions between NTSC and PAL. Well, I am not really. It is a mp4 AVC with h.264 when demuxed becomes a 25 FPS pal frame rate. But let us not get into that yet.

Next step;

Horizontal Conversion Factor

(32384/42651) / (4320/4739)

(32384/42651) (4739/4320)

(8096/6093) (677/1080)

( 2024)/6093) (677/270)

(1012/6093) (677/135)

Now, taking the result from the above 2 and multiplying it by the Vertical Conversion Factor:

(685,124/822,555 ) )( 243/184) (v. conversion factor

(685,124 /274, 185) (81/184)

685,124 /30,465) (9/184)

(685,124 /3,385) (1/184)

(171,281/3385) (1/46)

(7,447/3385) (1/2)

7447/6770 = 1.1


NEW HORIZONTAL SIZE (width)

1.1 (640) = 704

NEW VERTICAL SIZE (height)

(243/184) (360/1)
(243/46) (90/1)

(243/23) (45/1)

(243/23) (45/1)
(10935/23)= 475.434783 or just 475

Thus 640 x 360 gets resized to 704 x 475


And then ADD BLACK BORDERS TO THE TOP AND BOTTOM

Horizontal is 704 and we need 720. So add 8 pixels to the left and right

Vertically is 475 and we need 480 BUT 475 is not a multiple of 2 so bump it up one number to 476. So we add 2. pixels to the top and bottom.

Hence:

LanczosResize (704 x 476)
AddBorders (8,2,8,2)






And I am guessing no one here so far knows about Active Image ARea.

Last edited by Gainnothing; 22nd November 2011 at 09:52.
Gainnothing is offline   Reply With Quote