View Full Version : So just what problems does a nom-mod16 res cause?
Alizar
4th April 2006, 08:58
I assume the title is fairly obvious. I know AVC (and MPEG-4 ASP codecs) are designed for mod16 and that encoding to a non-mod8 resolution will cause a decrease in compression efficiency.
Are there any other ill-effects that this can cause?
DarkZell666
4th April 2006, 09:12
For some avisynth filters and for some codecs this reduces speed because they have to use more generic routines to process the clip. Many of the "fast" routines are optimized for mod8 and/or mod16 resolutions :)
It's logical to use mod16 resolutions since macroblocs in h264 can be as big as 16x16 pixels. If you use another resolution, it's up to the implementation to choose wether to truncate the picture, or clone the last column of macroblocs to extend the picture to something at least mod8, etc ... or simply do nothing and produce a misaligned or completely b0rked picture xD
bond
4th April 2006, 19:10
there is no non-mod16 picture possible in avc. whats possible is making the decoder not show parts of the picture (so when encoding with non-mod16 the encoder will add pixels so your picture gets mod16 but the decoder will not show those pixels, altough they are there)
Caroliano
4th April 2006, 21:57
If you mantain it at least in mod8, it will only decrease the compressibility. If you use an non-mod8 resolution, you can have serious quality loss in the edges of the picture, besides the compressibility hit.
See:
http://forum.doom9.org/showthread.php?t=103021
http://forum.doom9.org/showthread.php?t=103150
http://forum.doom9.org/showthread.php?t=101195
http://forum.doom9.org/showthread.php?t=105607
sade
4th April 2006, 22:13
If you mantain it at least in mod8, it will only decrease the compressibility. If you use an non-mod8 resolution, you can have serious quality loss in the edges of the picture, besides the compressibility hit.
AVC uses a 4x4 transform, whereas ASP uses a 8x8 dct, so mod4 should be enough to prevent ringing, no?
Edit: afaik this only matters when you have black bars like described in the first link. if the edge pixels get mirrored like it is done in the encoder this shouldn't be a concern
bond
4th April 2006, 22:16
AVC uses a 4x4 Transform, whereas ASP uses a 8x8 dct, so mod4 should be enough to prevent ringing, no?this isnt related to this, macroblocks are always 16x16 afaik
sade
4th April 2006, 22:26
it doesn't matter when you only have a non mod 16 clip but it's a problem when you have mixed 16:9 and 4:3 content and therefor really black bars.
in the former case i see no sense in ensuring mod8 either
akupenguin
5th April 2006, 00:23
In h264, if the resolution of the whole frame is not mod16, you basically pay the bit costs (and cpu-time) for the rounded-up resolution instead of the displayed resolution. So e.g. 640x368 ~ 640x352 > 640x364 > 640x360 > 640x356. (where ">" is "better")
If you have mixed 16:9 and 4:3 content... well, the best thing would be to encode them separately and then concatenate. But some codecs/players don't like it when videos change resolution in the middle of the stream, so black bars are understandable. In that case, align the bars to the largest mod possible (up to 16). Even though h264 has a 4x4 dct, it also has a 8x8dct, and some other aspects are block-based with various sizes.
Alizar
5th April 2006, 01:14
In h264, if the resolution of the whole frame is not mod16, you basically pay the bit costs (and cpu-time) for the rounded-up resolution instead of the displayed resolution. So e.g. 640x368 ~ 640x352 > 640x364 > 640x360 > 640x356. (where ">" is "better")
If you have mixed 16:9 and 4:3 content... well, the best thing would be to encode them separately and then concatenate. But some codecs/players don't like it when videos change resolution in the middle of the stream, so black bars are understandable. In that case, align the bars to the largest mod possible (up to 16). Even though h264 has a 4x4 dct, it also has a 8x8dct, and some other aspects are block-based with various sizes.
Thanks, aku. I'd been looking for a straight answer for exactly what the outcome was for some time rather than a simple "Well, it's bad so don't."
Audionut
5th April 2006, 05:17
rather than a simple "Well, it's bad so don't."
If you read people's posts to your threads, and followed the links that they provide, you would have found your answer.
If you mantain it at least in mod8, it will only decrease the compressibility. If you use an non-mod8 resolution, you can have serious quality loss in the edges of the picture, besides the compressibility hit.
See:
http://forum.doom9.org/showthread.php?t=103021
http://forum.doom9.org/showthread.php?t=103150
http://forum.doom9.org/showthread.php?t=101195
http://forum.doom9.org/showthread.php?t=105607
Alizar
5th April 2006, 09:41
If you read people's posts to your threads, and followed the links that they provide, you would have found your answer.
Pardon me. I was simply trying to thank aku for his response.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.