PDA

View Full Version : Latest codec comparison - Question about aspect ratios


Defiler
7th May 2003, 14:36
Thanks for the good comparison, Doom9.

I was re-reading the "setup" section of it this morning, when something struck me.

Saving Private Ryan script:
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
mpeg2source("D:\DVD\Projects\SAVING_PRIVATE_RYAN_VTS_01_PGC1\SAVING_PRIVATE_RYAN_ForceFilm.d2v")
crop(2,8,714,464)
BicubicResize(640,352,0,0.5)

At first glance, that didn't seem like the appropriate resolution to resize to. I don't use Gordian Knot, or any of the other one-stop tools. I tend to do all my aspect ratio calculations by hand.

To investigate, I decided to install Gordian Knot and see what it wanted to do with those cropping parameters shown above.

http://hellninjacommando.com/misc/gknot.png

Gordian Knot seems to agree, but I can't quite figure out how it decided on that post-cropping aspect ratio.
It seems to me that the DAR should be: (taking 0.911 as the pixel aspect ratio):

(714 * 0.911) / (464 * 3/4) = 1.869

Next, I decided to install FitCD 1.1.2, and see how it handled the situation:

http://hellninjacommando.com/misc/fitcd.png

Once again, I don't understand how it calculated that DAR, but interestingly, it has chosen a different width for the same height.
FitCD would actually prefer 672 x 368 (which it claims has a -0.13% DAR error.)

ITU-R 601.4 compliance was disabled in both applications.

Unless I misunderstood, I am using the formulae from this thread in my calculations above:
http://forum.doom9.org/showthread.php?s=&threadid=42708

I've spent the last several hours reading all of the aspect ratio threads I could find, and I haven't seen anything that explains the above to me.

ultimatebilly
7th May 2003, 14:40
Well, in your calculation you take the Pixel aspect ratio into account, so you should activate this option in gordianknot too (ITU-R compliance)...
And don't forget that you set gordianknot to take divisibility by 32 into account, something that changes the aspect ratio once again, so you should set the divider to 1...
I never used fitcd, but you should set the divider to 1 there also, and enable ITU-R compliance...
The final resolution should be divisible by 8 at least (some people even say that a horizontal resolution divisible by 32 enhances compressibility), but for your calculations better set it to 1...

Defiler
7th May 2003, 14:44
OK.. That's extremely strange.
Why does Gordian Knot select a different pixel aspect ratio when you check "NTSC Anamorphic 16:9" than it does when you press "Select" and choose "NTSC, Anamorphic"?

When I do the latter, Gordian Knot chooses the same resolutions as FitCD.
Does this mean that the aspect ratio for Saving Private Ryan in the codec comparison is incorrect?

I disabled ITU-R 601.4 support because various threads, as well as Gordian Knot itself, claim that it introduces 2.5% aspect ratio error when used with computer displays.

Here's what I chose in Gordian Knot, after your reply:
http://hellninjacommando.com/misc/gknot2.png

I don't use either of these tools myself. I just want to make sure I'm not doing my manual calculations incorrectly.

ultimatebilly
7th May 2003, 15:02
Well, with the "select"-button you can feed a custom pixel aspect ratio into GKnot, its for use with resolution values entered manually into GKnot (into the "other"-field on the left).
The normal NTSC-anamorphic preset works with an Image aspect ratio of 16/9, but doesn't take the pixel AR into account (unless you check ITU-R compliance...)
And if you reread The Wefs statement about the pixel aspect ratio, than you will see that he says that the software-players are actually 2.5% off, not Gknot with ITU-R...
He usually strongly suggests to use it...
(Of course not for DVD-reencoding, because then the TV will "apply the ITU-recommendation")....

PS.: I only use Gknot for all resizing calculations I have to make, may it be for SVCD, DVD or Xvid...
I didn't understand the resizing it does myself too a long time (as you may have read in the aspect ratio threads you read in your research) but since I understand (at least I hope so) the resizing it does I realized that it is the perfect tool for resizing calculations, and its of course much more simple than calculating by hand...
And you have that nice preview :)

Defiler
7th May 2003, 15:11
So, where does it come up with 1.185:1 for the NTSC anamorphic aspect ratio, when ITU-R support is disabled?

The odd thing, to me, is that GKnot claims 0% aspect ratio error for a particular setting with, or without, the ITU-R compliance checkbox active.

Additionally, why do you think ITU-R compliance was disabled for the codec comparison test?

ultimatebilly
7th May 2003, 15:16
This is my post about resizing in GKnot I was referring to:

http://forum.doom9.org/showthread.php?threadid=40622

The links in it are great, they explained everything to me...
Just forget the stupid shit in the end, "breitwand" is of course widescreen :D
So all you did by applying the pixel aspect ratio via the "select"-button was to activate the ITU-R-recommendation...
Seems that fit2disc had enabled it too...

ultimatebilly
7th May 2003, 15:25
I don't think ITU-R was disabled in the codec-comparision, I was referring to you:

ITU-R 601.4 compliance was disabled in both applications.

The odd thing, to me, is that GKnot claims 0% aspect ratio error for a particular setting with, or without, the ITU-R compliance checkbox active.

That's probably because you have overridden the ITU-setting with setting the PAR manually via the "select"-button...

Defiler
7th May 2003, 15:33
Yes. My mistake. Toggling the ITU-R setting does reset the PAR.

However, given the input settings, 640x352 is not a resolution that Gordian Knot will let you select without disabling ITU-R compliance.
Given that the codec comparison used Gordian Knot, ITU-R must have been disabled.

Thanks for the link. I actually read that before posting this thread, though. :D

This means that I was doing it right all along. I was thrown for a loop, because I didn't expect Doom9 to choose an odd ratio in a codec comparison.

ultimatebilly
7th May 2003, 15:39
Well, maybe he just forgot about setting it, because he is mainly doing DVD-Rs nowadays :)
Maybe he generally doesn't use the ITU-option, I remember to read in a guide of his to uncheck it...
In the end its a matter of taste, if you believe in this particular ITU-recommendation or not...
But for the essence of the codec comparision there is no real difference, is it?

Defiler
7th May 2003, 15:51
Thanks for all your replies. I feel better about the whole mess now.

ultimatebilly
7th May 2003, 16:00
Agreed, this whole PAR, DAR and whatever thing definitively IS a mess!
It was a pleasure refreshing all this :D

Doom9
7th May 2003, 17:48
and the ITU employee section strikes again ;) I'm not getting tired to reiterate that I have never liked that standard and never will. PC resizing will remain the same, ITU resizing here or there, whereas DVD mastering studios don't always follow standards. Maybe you've come across some DVDs where you could actually see ugly boarders even on the TV? This is especially apparent if you have a 16:9 TV and can switch between different zoom modes. There are DVDs with ugly boarders on top, on the sides, at the bottom. Either the makers of those DVDs didn't stick to the standard, or TVs do display things differently. But the bottom line is that this standard isn't good for much if people don't stick to it.. and on my PC I can be sure that I always resize the same (and it will look the same). I'll get to see every pixel that they put on the DVD no matter what hardware I use. The resolutions chosen have been used for years and are considered standard for PC based resizing.

Defiler
7th May 2003, 18:26
Doom9: Thanks for the reply. I definitely don't have an opinion on this one way or the other; I just want my circles to be round. Heh.

Isn't it the case that Saving Private Ryan, using the settings above (from the comparison), would be slightly too wide when viewed in a window? If this isn't the case, could you explain why? I'd like to put this question to rest (at least in my own mind) for good.

For purposes of discussion, let's assume that we are playing the file in some useless app without aspect ratio controls (e.g. Windows Media Player)

^^-+I4004+-^^
7th May 2003, 19:10
Defiler you're correct,GK is twisting the AR.....(for a number of reasons...and now this way comes the wef to tell us we know zilch...hehe)
d9 you're wrong.......
(as 16:9 with wrong AR is not so easy to correct for with player...it's much easier for us capturing folks to just hit "4:3" mode for all "not-normal" resolutions we do to have perfect AR)
how will you easily correct that 16:9 slight AR offset.....

ITU is not important(as pixels become square on 4:3 desktop resolutions anyways...),but doing stuff properly is....ie. resizing first(think about it:if you resize first good deal of AR problems dissapears),cropping later,adding black borders if needed...such stuff...baring in mind your square pixel 4:3 monitor desktop (you probably use such) etc
keeping the AR as opposed to twisting it in a way one needs to do custom AR in zplayer to correct for it....

not a big deal (errors are not big anyhow),but it's AR error anyhow...

>There are DVDs with ugly boarders on top, on the sides, at the bottom.

this doesn't matter.have you ever seen dvd that had AR error when you watched it on tv (because it had those borders)?


/ivo

Defiler
7th May 2003, 20:11
Thanks for the reply.

Let me restate my question in a slightly different way.

Assuming that we have a 4:3 DVD, or a widescreen non-anamorphic DVD, and that the DVD encoder didn't make some kind of horrible mistake..

The actual image, once the black borders have been cropped off; can this always be resized to match the aspect ratio on the back of the DVD case?

For example.. If we have a 4:3 DVD with large borders on the left and right sides (Macross Plus is a good example of this, with at least 20 pixels of black), is the video meant to be resized to 4:3 after these are cropped, or before? This has never been made totally clear to me. I know it sounds like a simple question, but I haven't seen it addressed directly in a straightforward way.

^^-+I4004+-^^
7th May 2003, 20:49
make simple test....do it the both ways.the way i suggested and the way Gk (or that other tool) does....

then compare these two with the original dvd image....
i expect that your dvdrip will look more close to original if you resize first!
you can view that 20 pixels as just tv's overscan that will never be seen on tv anyhow,so the rest of the image has correct AR just as any other "fill PC screen" dvd......

with resizing first my capturings,i never have any AR error......
if i cropped first i would ALWAYS have SOME error!
my stuff tends to be 7xx x 576 and later resized to 4:3 resolutions or sometimes not resized at all.....

why is this not adressed?well if the author of GK said it's the correct way then most believe it...i would for example first check if it keeps AR....if my method was better i would use my method iffcourse...even if it makes processing slower because i don't crop first but do all the filtering on full res too........
i don't like the concept of cropping first.....see if you do......


[btw. if you do that test,i would be interested in publishing the results.....screenshots etc.]

>The actual image, once the black borders have been cropped off; can this always be resized to match the aspect ratio on the back of the DVD case?



but look at this scenario:let's say image (with black borders on sides) had corect AR (as it must have otherwise it'll look funny on tv as any other dvd with such error) and you cropped them first and resized to resolution that's ment to be used when no side black borders exist.........now that means you're messing the AR ,doesn't it:you're fitting the cropped image to the resolution that expects uncropped image......that doesn't fit->AR is messed!

resize first......it makes sense....try it.........crop later....if you end up with non 16 (or 32) resolution,add black borders until it's 16 or 32...you're set and you can sleep tight...you AR is perfect...

/ivo

Defiler
7th May 2003, 21:01
I like that technique. Very easy to explain when people ask. Heh.

I'll do a comparison of the three methods via some torture-test DVD, and send you my results.

Doom9
7th May 2003, 23:16
if you end up with non 16 (or 32) resolution,add black borders until it's 16 or 32...you're set and you can sleep tight...you AR is perfect...
and of course that's perfect because black bars don't use up any bitrate, or do they? :devil:

GK is twisting the ARand the next thing you're going to tell us is that Jackei is a moron. I just wonder why it isn't you who has written all the great tools. You certainly behave like you have invented them.

Ookami
8th May 2003, 00:40
About Jakei, I will dig out the old ezboard thread were he prooves the whole resizing stuff to use mere mortals :) .

I will post it, ASAP.

Atamido
8th May 2003, 02:00
In my oh-so uninformed opinion, this is how I think the resize should work.

You crop the black bars. Resize only if you want a smaller picture. If you don't want a smaller picture, then don't resize. Treat each of the pixels as square as this helps with encoding efficiency. Set the equivalent AR information in Matroska. Then during playback the picture will be displayed at the correct aspect ratio.

While encoding efficiency would be better, the drawback is that resizing during encode allows for much more complex resize filters than what is used in a player to resize on playback.

Optimally, whatever player you are using should be able to hold the actual dimensions of the physical display, and compare that against the resolution currently being used. That is the only way to get your AR perfect. Because while 1600x1200 has a ratio of 1.333, 1280x1024 has a ratio of 1.25.

TheWEF
8th May 2003, 04:19
^^-+I4004+-^^ is just a troll and you shouldn't trust a single word he is saying. actually he has no clue about aspect ratio and i think it would be best if a moderator would delete his foolish posts. this stuff is just misleading and confusing people.

wef.

NeVeRLiFt
8th May 2003, 04:37
I always use this...

1:2.35 movies: 720x304, 640x272, 576x240, 512x224, 480x208, 400x176
1:1.85 movies: 720x384, 640x352, 576x304, 512x272, 480x256, 400x224
1:1.33 movies: 720x544, 640x480, 576x432, 512x384, 480x368, 400x304

never have any problems ;)

int 21h
8th May 2003, 04:43
Just use DVD-R and @#$@ the rest. When will we see the MPEG-2 encoder/transcoder comparison is what I wonder! (i.e. CCE vs. TMPGEnc vs. DVDShrink vs. DVD2One vs. IC) Obviously CCE would win, but it would be interesting nonetheless.

TheWEF
8th May 2003, 04:52
of course you "never have a problem" because the AR error can be really big and still go unnoticed.

hopefully as a conclusion for this onethousandsevenhundredandfiftyfirst ar-thread:

there is a practical and a theoretical approach to the problem:

the theoretical one is about sampling rates and the itu standard. all needed documents are provided in this forum (e.g. gknot forum), you can read them, understand them and make up your own mind.

practically the human eye and human mind are not very ar-sensitive and if you follow very simple rules in doom9s guides you can forget about all this itu stuff.

wef.

TheWEF
8th May 2003, 04:56
Originally posted by int 21h
Obviously CCE would win, but it would be interesting nonetheless.

well, it wouldn't win the speed comparison. ;)
yea, would be interesting, guess you would be the perfect author! :D

wef.

NeVeRLiFt
8th May 2003, 05:07
Originally posted by int 21h
Just use DVD-R and @#$@ the rest. When will we see the MPEG-2 encoder/transcoder comparison is what I wonder! (i.e. CCE vs. TMPGEnc vs. DVDShrink vs. DVD2One vs. IC) Obviously CCE would win, but it would be interesting nonetheless.

:)

sounds like a plan...

Defiler
8th May 2003, 06:05
TheWEF:
Perhaps you can answer my question for me.
Is the actual "useful" portion of the frame on the DVD in the listed aspect ratio, or are the black bars on the left and right sides included in that calculation?

I think that's the last (practical) point about AR that I don't fully understand. It's not that I don't trust GKnot's calculations; it's simply that I'd like to understand the reasoning behind them.

int 21h
8th May 2003, 06:21
Keep in mind that there are literally many, many Aspect Ratios, and what is listed on the DVD cover is an estimation to what the DVD most closely conforms to. So even though it may list 1.85, its quite likely it could be more of 1.8, or 1.70. (i.e. http://www.widescreen.org/aspect_ratios.shtml)

int 21h
8th May 2003, 06:23
Oh yea, also just wanted to make clear, no disrespect to your comparison Doom9. As always it seems to be right on target, I only wish I could have helped more with the CSS stuff (but real life has kept me busy). I would consider making the transcoder/encoder comparison, if it were hosted on Doom9... It definitely wouldn't be the first time I've made such a comparison. ;)

TheWEF
8th May 2003, 06:39
Originally posted by int 21h
I would consider making the transcoder/encoder comparison, if it were hosted on Doom9...

now that's an offer! :cool: doom?

Originally posted by Defiler
Is the actual "useful" portion of the frame on the DVD in the listed aspect ratio

int 21h said it, you can forget what's written on the package.

wef.

Doom9
8th May 2003, 07:02
@int21h: sure, go ahead. And maybe you can take this as a reason to finish the CSS stuff.. the comparison is definitely too large again (in terms of loading time to get a full page displayed). Also.. it will give you something to chew on the manageability of writing such an article.. the way it's done now you can drag & drop screenshots into the article which takes very little time.. if you start with scripts, things get more complicated.

Defiler
8th May 2003, 13:48
Thanks for the information. I'm now of the opinion that every DVD should start with a nice circular test pattern.

TheWEF: Am I correct in thinking that Gordian Knot crops and resizes in the following way?:

1. Crop user-specified pixels.
2. Multiply width by pixel aspect ratio.
3. Multiply width by 4/3 if anamorphic.
4. Display a list of mod32/mod16 resolutions, using some kind of table based on an aspect ratio threshold. (i.e. the various aspect ratio ranges use different sets of values)
5. Calculate the aspect ratio error margin between the chosen resolution, and the post-cropping aspect ratio.

Is this at least functionally equivalent to what GKnot does, or am I way off base?

frauz
9th May 2003, 06:56
...but I'd like to know if the Matrix movie resolution used for codec comparison was the one of the photos (642x273). ThX

ultimatebilly
9th May 2003, 09:15
As you can see from doom9s script:
"BicubicResize(640,272,0,0.5)"
he used 640*272...