View Full Version : non mod 16 cropping or black bars : which is worst and why?
OvejaNegra
29th December 2009, 05:53
As the title says.
i know the ideal is crop black bars and leave the frame on mod 16 size.
But some times is not possible without cropping image.
Well i DONT want crop the image.
Sometimes that can't be done without breaking one of these two rules:
A) crop black bars and leave a non mod 16 picture (some times the picture has tiny little bars of 2 or 3 pixels on the sides or up and down).
B) Leave the black bars (rarely those black bars are mod 16 width).
I know both choises are not reccomended, but wich one is preferable? (in therms of compression quality/efficience)
Thanks
roozhou
29th December 2009, 07:49
Of course you should crop black bars and leave a non-mod16 resolution.
Black bars give sharp edges so they hurt compression.
AMED
29th December 2009, 07:58
So encoding at non Mod16 is not an issue with x264 or is it more the playback end that can causes issues with non Mod16 encodes?
roozhou
29th December 2009, 09:14
So encoding at non Mod16 is not an issue with x264 or is it more the playback end that can causes issues with non Mod16 encodes?
Right. Modern decoders like CoreAVC, libavcodec, DivXH264 do not have such problem. Remember that 1920x1080 is not mod16 but 1080p videos play in your media players perfectly.
Caroliano
29th December 2009, 14:10
Search is always your friend:
http://forum.doom9.org/showthread.php?t=143215&highlight=mod16 <-- short and precise answer
http://forum.doom9.org/showthread.php?t=146148&highlight=mod16 <-- very informative thread
OvejaNegra
29th December 2009, 17:51
AWESOME the second th.
Thanks Caroliano!!
Why i could not find that thread? I think we need a better tag system!!
OvejaNegra
30th December 2009, 18:30
For avoid creating a new thread (but maybe i'm a little ou of topic):
Xvid can do non mod 16 resolutions? Or not?
roozhou
30th December 2009, 19:03
Don't know about xvid, but Divx supports non-mod16:
Video
ID : 0
Format : MPEG-4 Visual
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Muxing mode : Packed bitstream
Codec ID : DX50
Codec ID/Hint : DivX 5
Duration : 2mn 6s
Bit rate : 8 054 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 30.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.129
Stream size : 121 MiB (97%)
Writing library : DivX 2310
benwaggoner
31st December 2009, 20:16
I think pretty much every codec since MPEG-1 supports non-mod16. Some may require an even number for height/width, but mod16 has long been a best practice, not a hard requirement.
mariush
31st December 2009, 21:56
If i remember correctly xvid required width and height multiple of 4. I think it was because of some conversions between yv12 and yuv2 and other color spaces it supported. Huffyuv had the same requirements so I personally got used to cropping to multiples of 4.
As for x264, i think internally just duplicates the last line(s) to reach a multiple of 16. In some cases (mpc-hc with dxva decoding of 1920x1080 on 1920x1200 screen) I could see those duplicated lines and it was a bit annoying.
To answer the original question, I always crop the black lines out unless the destination is some device that only accepts some fixed resolutions. I also try to keep both width and height multiples of 16, 8 or in worst case multiples of 4. A couple of lines cut out to have a multiple of 4 at least, won't be noticeable.
OvejaNegra
4th January 2010, 15:48
So, the decoder must be capable of hiding the added lines?
But if any tool checks the videos (for example the mediainfo library) it will detect that the video has those padding lines or it will report the number of "usefull lines" ?
Thanks for the answers and happy 2010 to everyone :)
Caroliano
5th January 2010, 16:26
For your first question, the answer is yes. But I think that any H.264 compilant, non-buggy decoder should be able to do that. Remember, 1080p is not mod16. As for mediainfo I don't know the answer.
OvejaNegra
6th January 2010, 14:53
Thank you.
I'll find out about mediainfo.
Keiyakusha
6th January 2010, 15:31
But if any tool checks the videos (for example the mediainfo library) it will detect that the video has those padding lines or it will report the number of "usefull lines" ?
Etto... if you mean h264 here, If image is not mod16, it always has padding to the closest mod16 number... you don't need any tool for this.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.