Log in

View Full Version : big question about DVD letterboxing


brett
13th September 2002, 09:45
I'm new to the DVD-R scene -- just got a DVR-104 a week ago, and have mostly done simple IfoEdit rips, but I've been doing DivX since pre-NanDub days, so I'm comfortable with most of the concepts.

So, before I explore the finer points of CCE, I've got a big question about DVD letterboxing as it relates to MPEG-2 streams, and I hope you'll excuse me for relating everything in terms of my experience with DivX.

When you're encoding DivX, you want your movie to be a final resolution that's divisible by 16 (preferably 32 in the X direction for video out compatibility). This is because MPEG-4 has 16-pixel macroblocks. You don't NEED to crop the black bars off, but if that hard edge isn't on a macroblock boundry, it'll be difficult to encode and quality will suffer.

I have created hard-coded subtitles in several of my DivX rips, so they look the way I want on any player. To get the subs under the picture, you have to letterbox it, then put the subs in the black area. If you make sure that the letterboxing area is a multiple of 16-pixels, the quality will be virtually as good as if you hadn't put the subtitles in at all. If your letterboxing is not a multiple of 16, your quality will be much worse.

It is my understanding that MPEG-2 functions the same way. That is, MPEG-2 has 16x16 macroblocks, and a hard edge encodes much better if it falls between blocks instead of through them. That being the case, I find it extremely odd that this is not considered during the DVD transfer process.

The last DivX movie I encoded (Time and Tide, I think) had a source size of 716x364 with the black cropped off. My source cropping was X1:2 X2:2 Y1:54 Y2:62. That means that all four sides of the picture had edges through macroblocks. Many movies use the full width of 720 pixels, but even so, I do not recall ever finding a movie where the letterboxing was in multiples of 16 pixels. Why? The digital transfer process does not get every single bit of the picture that was in the film source, so preserving the EXACT aspect at all costs is not the reason. Are DVD's just made that way because they feel they have so much bitrate to spare that it doesn't matter where the letterboxing edge falls? Regardless, those of us who burn DVD-R's only have half the space to work with, so shouldn't the letterboxing be considered?

Take Lord of the Rings, for example. Even after ripping out everything you can, you're left with 571 MB of audio and 6.12 GB of video that must be fit into 3.81 GB. Now look at the letterboxing. The top offset is 59 pixels, and the bottom offset is 64 pixels. I'm actually pretty impressed that the bottom is divisible by 16, but both edges are noisy with light and dark bands. You can get a much cleaner source by cropping at Y1:61 and Y2:67, then re-letterboxing 64 pixels on both the top and bottom. You can do this with a simple AviSynth script:

Crop(0,61,720,352)
AddBorders(0,64,0,64)

Of course, that takes the movie from an already overly-wide 2.39:1 aspect up to 2.42:1. What I would do (and most people will probably say this is stupid) is enlarge the picture a little with:

BicubicResize(720,384,0.333,0.333,30,61,660,352)
AddBorders(0,48,0,48)

...taking the movie to 2.22:1, which is still very wide, and maintains clean edges. I suppose you have to also deal with decombing (and then re-interlacing?) the movie if you're going to resize it.

Anyway, I just wanted to get some input on this. Am I completely wrong about the way macroblocks work in DVD's?

ulfschack
15th September 2002, 21:34
Most of this "divisible by" 16,8,4 or 2 debates have been in the Mpeg-4 section of this forum. Maybe Mpeg-2 is more tolerant. I don't know. I do however know that a macro-block is 8x8.

cheers

The_Flash
15th September 2002, 22:11
Time and Tide is a pretty neat film. I think you should spend more of your time watching films by Tsui Hark instead of worrying about stuff like this. :D