Log in

View Full Version : Using MOD4/2 over MOD16 with x264?


kkiller23
7th September 2012, 20:44
I was wondering what kind of problems i could run into from using mod2 or 4 over mod16 with x264?

is mod2 and 4 still square pixels?

720/390 is closet for a bluray i'm downsizing and i really want to get it in the 720x*** range.

So would would i run into any problems using 720x390 over
720x384? besides the fact that the mod16 has a 1.5625 resize error and the mod2 has a 0%

Keiyakusha
7th September 2012, 21:00
I was wondering what kind of problems i could run into from using mod2 or 4 over mod16 with x264?
Nope

is mod2 and 4 still square pixels?
They have nothing to do with square or not square pixels

So would would i run into any problems using 720x390 over
720x384? besides the fact that the mod16 has a 1.5625 resize error and the mod2 has a 0%
By saying that you obviously keeping in mind some crappy fromt end (GUI). Throw it away, encode MOD2 (or whatever you want) with correct aspect ratio and without overcropping.

kkiller23
7th September 2012, 21:10
So it'd be okay to use mod4 or mod4 over mod16 and yes i was using a resize calculator.

What is the main difference in using mod4 or mod2 over mod16? Because when googling this it doesn't really help me as every post say something different. One says it doesn't really matter if you use don't use mod16 with x264 and others say to stick with mod16.

Keiyakusha
7th September 2012, 21:18
What is the main difference in using mod4 or mod2 over mod16? Because when googling this it doesn't really help me as every post say something different. One says it doesn't really matter if you use don't use mod16 with x264 and others say to stick with mod16.

Since x264 uses 16x16 blocks to encode the picture, when for the last block in column or row there is less pixels, lets say 8 (like in 1920x1080), it will add padding to extend it to 16px. Bit you won't see these extra pixels anyway. As you can see even blurays have that, so why you shouldn't? No reason to prefer mod16 unless you really like numbers that you can divide by 16 and can't live without them.

kkiller23
7th September 2012, 21:28
Alright, thank you for the info. I'm gonna go with 720x390 then since it doesn't really matter.

nibus
12th September 2012, 02:35
Really the only advantage of mod16 is a very slight increase in compression.

If you want perfect aspect ratios and mod16, try:

768x432 / 16:9 (Widescreen)
768x320 / 2.4:1 (Panoramic widescreen)
768x576 / 4:3

ramicio
14th September 2012, 16:01
Why wouldn't you just encode it to the same size as the input, calculate the SAR, and then rely on aspect ratio information in the container to take care of things?

Asmodian
14th September 2012, 19:34
Because some players do not respect aspect ratio information from the container.

There are advantages either way.

Keiyakusha
14th September 2012, 19:42
Actually in proper h264 encode there should be ar information on stream level. anything that is not able to read that info I personally consider broken. Not sure if standard requires this or not. Fact that many people use only container ar created many problems and confusion. I wish it was never included in matroska spec, same as framerate and resolution info, that can be found in stream itself and that can vary any number of times during one stream.

kypec
14th September 2012, 19:43
Because some players do not respect aspect ratio information from the container.
What about AR encoded directly at the stream level? I've yet to see a device that wouldn't honour that information...

ramicio
14th September 2012, 19:47
So they are broken players then, and deserve no respect. I'm not sure that a raw h.264 stream contains anything but pixel aspect ratio, which isn't helpful in the big picture. A container's set aspect ratio and the pixel ratio is what determines the final product.

Asmodian
14th September 2012, 20:25
What about AR encoded directly at the stream level? I've yet to see a device that wouldn't honour that information...

I have seen this but I would call it a broken player for sure (a software player, not hardware). But if one way works fine no matter how stupid the player and another has an issue there is an advantage. Also square pixels can be nice if you want to display without resizing.

I actually use stream level aspect ratios myself (setting SAR in x264), I was just answering why some would want to encode square pixels. Remember there is no "best". ;)

ramicio
14th September 2012, 20:26
You are resizing the video at one stage, anyway. Since we're talking DVD video here, you would be resizing it twice. Once for encoding and another time during playback.

kypec
14th September 2012, 20:57
I actually use stream level aspect ratios myself (setting SAR in x264), ;)I do it the same way for my encodes. ;)

I'm not sure that a raw h.264 stream contains anything but pixel aspect ratio, which isn't helpful in the big picture. A container's set aspect ratio and the pixel ratio is what determines the final product.
When there is no AR specified at container's level then 1:1 should be assumed by default of course. In that case SAR (as specified with --sar switch in x264 parameters) is the only thing that determines final DAR so it is totally helpful also in the big picture. :)

Asmodian
14th September 2012, 23:44
You are resizing the video at one stage, anyway. Since we're talking DVD video here, you would be resizing it twice. Once for encoding and another time during playback.

Exactly, so if you want to watch the video at native resolution you can resize to square pixels once and not have to do any resize at playback (a DVD on my cell phone for example).

Not that this has anything to do with the OP's question. :p