back in the H263 days I used to compress all my videos restricting the height/with to multiples of 16, accorsing to a not--too-well-understood kind of consensus.
Now I'm using HEVC and I wonder if there's any reason/advantage to restrict dimensions to any given multiple (2, 4, 8, 16...).
Can someone provide a reasoned answer or point me to a knowledgeable article that clarifies it?
Thanks for any help you can provide.
+ Reply to Thread
Results 1 to 9 of 9
mod8 is just fine, all major resolution falls into that, you do not need to resize or pad, because you need mod 16, or because you supposedly save some tiny videobitrate.
Say, I'm going to go with mod 16, to have better compression (negligible anyway) you need to crop or add black padding. By cropping couple of lines you butcher video just to be more compressible.How smart is that? Or you add black pad, go ahead, but how much black? My guess is most would crop. Sadly it is all over the web, in every script someone crops away like that is a cool thing or something. Or even worse, you screw up aspect ratio because you want mod 16. And then folks are returning to videohelp about fixing aspect ratio.
Take 1920x1080,...., 1080 is not even mod 16.
Chroma subsampling requires the frame width and the frame height to be multiples of 2.
mod8 was the limit for the MPEG-1 & MPEG-2 encoders. But since the days of DivX and Xvid the encoders are less limited... I mean, anything that is not exact mod8 or mod16 will be "self-padded" to a mod8 or mod16 size and the decoders are designed to ignore the padding.
By using only mod16 or mod8 you'll get additional compression and this was important when making a 2-hour movie fit on a 700MB CD-R was the way to go.
But today that rule makes no sense at all."Like this facility, I don't exist."
4x4 is the smallest size for HEVC, so in theory you wouldn't want mod2, ideally at least mod4
I don't know of any good tests that look at measuring the impact of this for HEVC on compression efficiency. I'd guess it's mostly negligible. But at very low bitrates it might matter
I do legit stuff only, mod8 is fine even working with SD video, because I would not crop but just pad black if something
wait for hardware limitations on videos below mod8, from some users, personally, I think it is the thing of the past, but did not have opportunity to "test' that claim, that there are devices that give problems with mode 2 or mod 4
Thanks El Heggunte, poisondeathray and _Al_ for your answers.
So... what I get from your posts is:
-mod2 , because of color subsampling like 4:2:0
-mod4 , because of HEVC smallest transform size
-mod8 , because it fits most common frame sizes without cropping and because lower modN might trigger some hardware incompatibility
-mod16 , only to squeeze some bits when using lower bitrates and small filesize
So, mod8 seems the logical "bet", but it also looks like no answer is final and I sholud carry my own tests using these recommendations as guidelines. Maybe too much work just for my domestic use, so I would be better off just adhering to mod8... but I know I can't stop until I know.
NTSC DV is 411 so mod x should be at least 4 and mod y 2 because of color subsumpling, if there is a case you deal with it. But I would not encode SD resolution to HEVC anyway. You need video crisp and sharp with all the details they are in original. Or you'd need to "turn off all those smoothing features" in HEVC if it is possible.
With x264, the mod# you chose only affects the size of the squared on the right boarder and the bottom boarder of the screen. So if you only had a resolution that could be divided by 4 on both the horizontal and the vertical, then the right and bottom boarder squares would only be a max of 4x4. This did not affect the rest of the image allowing for the largest squares possible everywhere else. I would assume x265 plays the same way. Overall this should not hurt compression much at all