x264 - The multiple of 16 - What if I want to ignore it?

If you have questions about compression/encoding/converting look here.
Locked
User avatar
Bauzi
Joined: Fri May 21, 2004 12:48 pm
Status: Under High Voltage
Location: Austria (uhm the other country without kangaroos^^)
Contact:
Org Profile

x264 - The multiple of 16 - What if I want to ignore it?

Post by Bauzi » Mon Sep 03, 2007 5:55 am

Hey there,

I have a question. How bad is it for the x264 codec when my ressolution is not a multiple of 16? Does it just need some more bitrate? Or do I really see some optic crappy things?
I guess the XviD codec has some problems with my ressolution and causes heavy macroblocking for no "real" reason (cleaned up DVD footage all the way), because 540 is either no multiple of 8.

Well I have a ressolution of 720x540 and 540 is not a multiple of 16. I really want to keep this ressolution because of effects and other stuff. Man... 4:3 at 720x540 with DVD ress just kicks ass :o

Anyway I want to decrease the ressolution for the XviD, because of the filesize, but I want my 720x540 for the mp4 =/
However if there are good reasons to not do it (beside an eviiiiil message from zarxGUI or from the command line interpretor), I might change it too.
You can find me on YT under "Bauzi514". Subscribe to never miss my AMV releases. :amv:

User avatar
post-it
Joined: Wed Jul 17, 2002 5:21 am
Status: Hunting Tanks
Location: Chilliwack - Fishing
Org Profile

Post by post-it » Mon Sep 03, 2007 9:21 am

Zero1, ErMaC or TAB are the people to see on this subject; I just fine-tune Codec's.

.. Ermac once told me the difference between the settings and why 2's 4's 8's and 16's were so important ( but that was over four years ago ) and it basically boiled-down to Color-Shimmering and Micro-Bursting error correction abilities within the Codec's themselves.
.. at that time everybody was having issues with a new release called Divx 4.0.3 and a new twist called Xvid which was giving everybody "green Screens of death!"
.. About the only thing I understood and worked for me was 1) 8's if it was MPG based and 2) 16's if it was AVI based. x264 was still being developed so the Source Codes were available but not an actual Codec of any working kind -- unless you compiled it yourself. As a programmer, I added little "flags" to the codec's build to watch it pass or fail at different setting. I was quite impressed with x264 and my notes told me that anything with a scale of 13:10 through 44:8 worked fine in 16's ( 704 X 396 = Color Shimmering .. 640 X 360 = Micro Bursting .. 720 X 448 = fairly good picture. )
http://www.megaupload.com/?d=JK5999GJ is a Captured 22 second section Rated "G" 8-)

.. someday someone will explain to me why the SKY in this video turned to garbage :oops:

.. Anyway, get with Zero1, ErMaC or TAB to find out which settings work and why they work. 8-)

User avatar
Keeper of Hellfire
Joined: Sun Jan 09, 2005 6:13 am
Location: Germany
Org Profile

Post by Keeper of Hellfire » Mon Sep 03, 2007 9:26 am

You figured out the reason yourself - not using multiples of 16 will hurt compressibility. What stops you from making it multiples of 16 - like 720x544 or better 720x528? No one will notice the slight distortion, and especially the latter resolution will slightly correct a distortion that is probably already done to your footage. It is a common misbelief (which is sadly supported by the most NLE manufacturers) that 720x480 (or 720x576 in case of PAL) should be displayed in a 4:3 aspect ratio - it's a 704 pixels wide but full height window of it.

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Post by Qyot27 » Mon Sep 03, 2007 10:18 am

You could always use storage resolution and apply a 4:3 flag to the stream or the container. Whether it resizes to 720x540 or 640x480 on playback then relies on the player and how they handle it. But if you fullscreen it the difference won't be apparent.

The advice for having things in multiples of 16 is because of the size of macroblocks and not having them sliced in two, which results in a waste of bitrate. It can also cause the green tearing at the bottom/top of the screen that XviD sometimes exhibits. That same concern is also why it's better to have any letterboxing and the core of the video be at a multiple of 16 - for instance, the main screen being 640x352 and the letterboxing be 64 pixels on the top and bottom - because it more efficiently stores the data (in that case, you're using full macroblock sizes for the letterboxing and for the core video).

User avatar
Tab.
Joined: Tue May 13, 2003 10:36 pm
Status: SLP
Location: gayville
Org Profile

Post by Tab. » Mon Sep 03, 2007 12:57 pm

Zero1, ErMaC or TAB are the people to see on this subject; I just fine-tune Codec's.
:D <3u2

Okay, why in ass are you using 720x540 instead of 640x480? Upscaling from 720x480 to 540 isn't going to gain you much of anything over downscaling to 640.

Anyway, the long and short of it is that it's not going to do anything noticeable. The reason why a mod16 resolution is advised is because DCT-based video codecs divide the image up into 16x16 macroblocks. If your resolution is not mod16, the codec must fill in the missing space to make it so. As far as I know, the general way of doing this is simply to repeat the edge pixels until the resolution is again mod16, which will not do any serious damage to your compressibility as far as I can see.
◔ ◡ ◔

User avatar
Bauzi
Joined: Fri May 21, 2004 12:48 pm
Status: Under High Voltage
Location: Austria (uhm the other country without kangaroos^^)
Contact:
Org Profile

Post by Bauzi » Mon Sep 03, 2007 1:58 pm

Okay, why in ass are you using 720x540 instead of 640x480? Upscaling from 720x480 to 540 isn't going to gain you much of anything over downscaling to 640.
I´m a fag and use PAL not NTSC. xD
As far as I know, the general way of doing this is simply to repeat the edge pixels until the resolution is again mod16, which will not do any serious damage to your compressibility as far as I can see.
I guess I should try to experiment with the bunch of ressolutions here. I guess the XviD will be downscalled for sure.
You can find me on YT under "Bauzi514". Subscribe to never miss my AMV releases. :amv:

User avatar
Keeper of Hellfire
Joined: Sun Jan 09, 2005 6:13 am
Location: Germany
Org Profile

Post by Keeper of Hellfire » Mon Sep 03, 2007 1:59 pm

Tab. wrote:Okay, why in ass are you using 720x540 instead of 640x480? Upscaling from 720x480 to 540 isn't going to gain you much of anything over downscaling to 640.
Since we can assume he uses PAL footage, he is downscaling from 720x576. :wink:

User avatar
Tab.
Joined: Tue May 13, 2003 10:36 pm
Status: SLP
Location: gayville
Org Profile

Post by Tab. » Mon Sep 03, 2007 5:29 pm

I see. That makes some sense, but, if you're still worried about being mod16, why not just crop down from 540 to 528? There can't be too much important information in twelve pixels...
◔ ◡ ◔

User avatar
Bauzi
Joined: Fri May 21, 2004 12:48 pm
Status: Under High Voltage
Location: Austria (uhm the other country without kangaroos^^)
Contact:
Org Profile

Post by Bauzi » Tue Sep 04, 2007 3:22 am

Tab. wrote:I see. That makes some sense, but, if you're still worried about being mod16, why not just crop down from 540 to 528? There can't be too much important information in twelve pixels...
Yeah I think about it. I guess I will resize it back to 4:3 with the sampel aspect ratio in zarxGUI or a script.
You can find me on YT under "Bauzi514". Subscribe to never miss my AMV releases. :amv:

Locked

Return to “Conversion / Encoding Help”