View Full Version : Why a multiple of 16 resize?
CWR03
22nd September 2005, 12:37
I've been reading for years that you "have to" resize an .avi backup file from DVD with the aspect settings a multiple of 16 - my question is why? Is it compatability with standalone players, or is it only for certain codecs used in compression? I use Gordian Knot with XviD, I've encoded a number of files at 640 x 360 to maintain a 16:9 aspect ratio, and they look perfectly fine to me. I'm hoping to get a widescreen LCD monitor soon, and if I've been making a mistake that'll show up with it I'd definitely like to know as soon as possible.
E-Male
22nd September 2005, 13:20
i'm sure you'll get a better explaination, but here's my quick one:
xvid compresses using 8 by 8 pixel blocks, so you need a resolution devidable by 8
the 16 i think comes either from the croma subampling (4 pixel share one chrome [=color]) or form the fact that the blocks are also related and even numbers are always better in this case
in general having resolutions deviable by 2 to the power of n, with n as big as possible is good for codecs, especially block-based ones
i personally use mostly mod 32 reoslutions und fix the AR with matroska
bill_baroud
22nd September 2005, 14:54
It could have something to do with SSE2, where you need memory address multiple of 16 if you want to have decent performances, but x264 doesn't use SSE2 and is also limited to mod16 resolution.
I would second E-male here...
Mug Funky
23rd September 2005, 03:25
yep - though the DCTs are 8x8 (except in h.264), they are grouped in "macroblocks" which get assigned quants, given motion vectors, etc. these are 16x16 and contain 4 luma blocks and 1 chroma block.
even if the codec allows you to save arbitrary (but probably mod 2 or 4 for colour sampling reasons) sizes, internally it'll just be mirroring the edge pixels to fit the nearest mod16 size.
i remember akupenguin posted a graph of PSNR v black-border size at a constant bitrate, and the mod 8 and 16 sized borders had an edge over the others, quality wise. mod 8 is more important than mod16, as chroma is usually such a low res as makes hardly any difference, but it's still good practice to stick to mod 16.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.