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. |
1st February 2006, 04:52 | #1 | Link |
Registered User
Join Date: Dec 2005
Posts: 145
|
Sample Aspect Ratio calcutions
Source/Encoded Resolution ( X:Y )
Desired Display Resolution/Aspect Ratio ( H:V ) The formula to calculate PAR/SAR Y ÷ X ÷ V x H = SAR fraction for example a NTSC 16:9 with resolution 720:480 480 ÷ 720 ÷ 9 x 16 = 1.185185185... (32/27) therefore the Sample Aspect Ratio that should be keyed in in MeGUI is 32x27 for NTSC 4:3 with resolution 704:480 480 ÷ 704 ÷ 3 x 4 = 0.88888...(10/11) SAR = 10x11 CROPPING without resizing won't affect the SAR Any comments on the way I calculate SAR? I took quite some time to understand that SAR is actually the ratio of every single pixel..not the ratio displayed by the video frame |
1st February 2006, 10:28 | #2 | Link |
n00b ever
Join Date: May 2002
Posts: 627
|
@kotrtim
the way u derive (s)ar is ok but why do u use different vertical resolutions for the 4/3 and for the 16/9 streams. maybe it's ok (i'm living in the pal world ) just ask. however, the values calculated Code:
- for ntsc 720 x 4:3 64:72 (8:9) 16:9 64:54 (32:27) - for ntsc 704 x 4:3 10:11 16:9 16:11 y Last edited by yaz; 1st February 2006 at 10:31. |
2nd February 2006, 20:57 | #3 | Link |
Registered User
Join Date: Dec 2003
Posts: 51
|
Cropping will change the SAR, at least thats what I was told in the similar thread I posted. This comment might be of use, I saved it and use this calculation...
"The actual way meGUI calculates the SAR is as follows: 1) Apply the cropping and then determine the aspect ratio of the input video image (inputPixelCountRatio). 2) Scale the vertical resolution according to the horizontal resolution that's been specified (resizedVerticalResolution = horizontalResolution / inputPixelCountRatio) 3) Adjust the vertical resolution so that it matches the closest multiple of 16. 4) Set SARX to the horizontal resolution. 5) Set SARY to Round(HorizontalResolution^2 / (VerticalResolution * DAR)), this is then truncated to an integer." So if you're not resizing you can ignore 1-3 and use the horizontal and vertical resolution after you've cropped. Last edited by Raithmir; 2nd February 2006 at 21:04. |
2nd February 2006, 21:03 | #4 | Link |
Registered User
Join Date: Dec 2003
Posts: 51
|
http://forum.doom9.org/showthread.php?t=104485
Some confusing information at first but read the whole thread. No doubt someone else will come along and tell me it's all wrong and I'm doing it incorrectly again. |
3rd February 2006, 05:06 | #5 | Link |
Registered User
Join Date: Dec 2005
Posts: 145
|
My opinion is SAR won't change after cropping as you crop off pixels, and SAR is the ratio of every pixel, so the value of SAR should not change whereas the DAR will change as DAR is the measurement of the whole frame, when you croped, the frame size definitely changes.
If we want to resize, why not just resize so that it is 1:1, of course this is just my opinion |
3rd February 2006, 06:41 | #6 | Link | |
Registered User
Join Date: Jan 2006
Posts: 294
|
Quote:
|
|
3rd February 2006, 12:02 | #7 | Link |
n00b ever
Join Date: May 2002
Posts: 627
|
cropping does not change the way of derivation (resizing). if u crop the stream (sar) u 'crop' also what u get on the display (dar). u'd better think of it as 'how to distort each pixel so as to get the right aspect ratio on the display'.
say, u got a pal 4:3 dvd. its stream size is 720x576 (by def) which is 5/4 ratio. it must be displayed 4/3 so as to get the correct ratio on the display, so, it must be resized to 768x576. it is the same as displaying each pixel in a 16x15 rectangle instead of a 15x15 square (measured in whatever unit). if u crop it to 704x576 (for any reason) it must be resized the same way, so the display size must be ~751x576. otherwise the picture on the display will be distorted. it's simple as that the bests y |
3rd February 2006, 12:29 | #8 | Link |
Registered User
Join Date: Jan 2006
Posts: 294
|
But why is it that the "true" DAR includes black bars? Surely they are not part of the actual image, and it should be resized to 4:3 without them. Like if you cropped to 704x576 to give the full image, shouldn't that then be resized to 768x576 (instead of 751x as with counting the black bars) to give proper AR since the original T.V. show was 4:3 (and had no black bars originally)?
|
3rd February 2006, 13:33 | #9 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
If you can guys, try and calculate "everything" as a fraction, because converting fractions to decimals and back to fractions again "can" produce conflicting Aspect Ratio Signalling (ARS) values.
If your NTSC movie has an aspect ratio of 1.33:1, then this can be represented as a fraction of 4/3. Meaning: - Code:
4 480 1920 8 - x --- = ---- lowest dominator - Giving an ARS value of 8:9 3 720 2160 9 Code:
16 480 7680 32 -- x --- = ---- lowest dominator -- Giving an ARS value of 32:27 9 720 6480 27 Code:
37 480 17760 37 -- x --- = ----- lowest dominator -- Giving an ARS value of 37:30 20 720 14400 30 Code:
47 480 22560 47 -- x --- = ----- lowest dominator -- Giving an ARS value of 47:30 20 720 14400 30 Code:
12 480 5760 8 -- x --- = ---- lowest dominator - Giving an ARS value of 8:5 5 720 3600 5 The same formula can be used to work out the "Aspect Ratio Signalling" values of cropped and re-sized encodes too by entering the relevant resolutions. Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
Last edited by SeeMoreDigital; 3rd February 2006 at 16:01. |
3rd February 2006, 14:07 | #10 | Link | |
Registered User
Join Date: Jan 2006
Posts: 294
|
Quote:
So that is the question that I haven't seen everyone agree upon: If you have a movie/show that you "know" the aspect ratio of (16:9, 4:3, etc) but it has black bars which need to be cropped, do you a.) Use the cropped size in your SAR calculation, or b.) Use the original size before cropping? |
|
3rd February 2006, 14:43 | #11 | Link | |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
Quote:
All MAR's can be converted to a fraction. For example: - 1.85:1 works out at 37/20 2.35:1 works out at 47/20 2.40:1 works out at 12/5 The MAR value can then be placed into the equation like this: - Code:
MAR FAR ARS 47 368 17296 1081 -- x --- = ----- lowest dominator ---- Giving an ARS value of 1081:900 20 720 14400 900 Code:
1081 1080 6 ---- to ---- lowest dominator - Giving an ARS value of 6:5 900 900 5
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
Last edited by SeeMoreDigital; 3rd February 2006 at 16:00. |
|
3rd February 2006, 15:06 | #12 | Link |
Registered User
Join Date: Jan 2006
Posts: 294
|
Well, yes I understand that, but it doesn't really answer my question about how to deal with DVD's that require cropping off the black bars.
Another related question is: Why are the padding bars even there on the DVD? Are they part of the original image as it was meant to be displayed or just artifacts of DVD conversion? Answering this will answer the first question also. |
3rd February 2006, 15:27 | #13 | Link | ||
n00b ever
Join Date: May 2002
Posts: 627
|
Quote:
this box is resized during the playback according to the 'par' value (which simply defines how much it should be streched horizontally) calculated as showed above. don't ask me why is it figured out like this but that's what we have Quote:
about the borders ... maybe they just cut away some dirty/bleeding/shifted/ringing/... pixels round the pictures for getting better compression. dunno the bests y |
||
3rd February 2006, 15:40 | #14 | Link | ||
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
Quote:
However, because this is not always possible with cropping alone, you may end up having to re-size the image slightly until you obtain a "mod16" frame size. In theory, it is possible to display an encode at any shape you want, once the required AR signalling value has been applied. Quote:
It was decided that the most effective way of displaying images with different aspect ratios was to overlay the "image portion" onto a "black background portion" (aka: matte) with a fixed Frame Aspect Ratio (FAR). So this is why all commercial PAL DVD's have an fixed FAR of 720x576 or 5/4. All commercial NTSC DVD's have a fixed FAR of 720x480 or 3/2. Hope that helps.... a bit
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
Last edited by SeeMoreDigital; 3rd February 2006 at 15:44. |
||
3rd February 2006, 15:45 | #15 | Link |
Registered User
Join Date: Jan 2006
Posts: 294
|
Hmm, I'm still not quite satisfied with an answer, so let me phrase the question in another way with an example case:
You have T.V. show on an NTSC DVD. The video has 8 pixels of black padding on either size, so you crop them off and are left with a resolution of 704x480. What SAR would you set in this case? 10:11? 8:9? Something else? |
3rd February 2006, 15:59 | #16 | Link | |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
Quote:
Code:
MAR FAR ARS 4 480 1920 10 - x --- = ---- lowest dominator -- Giving an ARS value of 10:11 3 704 2112 11
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
|
3rd February 2006, 15:59 | #17 | Link | |
Registered User
Join Date: Dec 2005
Posts: 145
|
Quote:
lets say you have a pice of paper, 100 cm long, 10 cm width, you divide eqaully into 10 cells (similar to pixels), of course 100/10 = 10cm, therefore each box is 10cm x10cm, the sample ratio is 1x1, now cut off one cell, the piece of paper is now 90cm long, 10cm width, but the ratio of each cell is still 1x1, it never change, you can still use the previous equation 100/10 = 10cm , not 90/10..... but for DAR, it is changed, before you cut, DAR is 100x10, after you cut it is 90x10 This is what I understand about cropping without resizing, hope you can imagine what i'm trying to tell Last edited by kotrtim; 3rd February 2006 at 16:11. |
|
3rd February 2006, 16:08 | #18 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
kotrtim,
I think you are thinking about "square" pixels and not "anamorphic" (aka: non square) pixels. Do you understand the differences? Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
3rd February 2006, 16:24 | #20 | Link | |
Registered User
Join Date: Jan 2006
Posts: 294
|
Quote:
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|