PDA

View Full Version : When is there a need for multiple of 16 width and height in MPEG-1 and MPEG-2?


rse
8th March 2007, 21:58
Hi!

Iīm on revising my website and canīt really find an answer on the question in the title. On VCD, SVCD and DVD there are only special resolutions allowed, so thereīs no question, but what is elsewhere? Do MPEG-1 and/or MPEG-2 even have these limitations or not? Anyway, HDTV 1080 isnīt a multiple of 16 and apparently seems encodable at least with MPEG-2...

So what are the REAL criteria?

foxyshadis
9th March 2007, 04:18
The real criteria is whether the decoder (or playback system in general) supports tweaking the requirements. Some do, PC players in particular, but almost no hardware/firmware based player will unless it already handles 1080p. MPEG-4 parts 2 and 10 have the same restriction.

This is partly because the actual bitstream is always mod 16, and it's the bitstream or the container that applies the cropping of the output. Some players simply ignore it, some crash because there's a difference, etc.

dragongodz
9th March 2007, 11:58
PC players in particular
i doubt you will find a software player that has any trouble down to atleast mod 4 now days. i remember mod 4 for an encoder ages ago because of the way it used mmx.

but almost no hardware/firmware based player will unless it already handles 1080p
do you mean you think hardware players will not handle non mod 16 encodes ? i actually doubt thats true.

MPEG-4 parts 2 and 10 have the same restriction.

i have done non mod 16 mpeg part 2 encodes and they play fine on both my pc and hardware dvd player. :)

rse
9th March 2007, 14:19
So, if I understand you right, the restrictions of all MPEG-1, MPEG-2 and MPEG-4 Video coding standards says that both, width and height, must be a multiple of 16. But a lot of implementations also can handle non-mod-16 widths and heights. Right?

dragongodz
9th March 2007, 16:35
mpeg uses a macroblock of 16x16 and standards such as vcd and dvd etc also stick to 16x16.

however as i said its doubtful most modern decoders would not be able to handle non mod 16 encodes aswell IMHO.

rse
9th March 2007, 17:17
Yeah, I know that, but I also know that itīs obviously not a must to have mod 16 width and height to be able to encode in MPEG-1, 2 or 4. So the Question is if thereīs a MUST for mod 16 in some case, according to some standard, not if itīs better to use mod 16. VCD, SVCD and DVD are not the case I mean, because they are restricted to a number of resolutions and not only to mod 16.

Probably DVB in SDTV is such a case, I don't know the restrictions in DVB. I only can assume that it would probably not be too useful to use non-mod-16 in DVB ;-)

dragongodz
10th March 2007, 02:37
So the Question is if thereīs a MUST for mod 16 in some case, according to some standard
you really need to be more clear about what you want to know from the start. trying to guess exactly what you are after is not a game most are willing to play.

Probably DVB in SDTV is such a case, I don't know the restrictions in DVB.
well i am no expert about such standards but from what i do understand SDTV uses DVD resolutions.

i will go back to your first post aswell
HDTV 1080 isnīt a multiple of 16
do you mean 1080p/i ? as in 1920x1080(or switch them around for HD order) because that is mod 16.

maybe this is more what you are after
http://electronics.howstuffworks.com/hdtv1.htm

sillKotscha
10th March 2007, 03:00
So, if I understand you right, the restrictions of all MPEG-1, MPEG-2 and MPEG-4 Video coding standards says that both, width and height, must be a multiple of 16.

if I'm not mistaken this is not true for MPEG4, which can be of course go down to mod4... but speaking of standards such as vcd and dvd you have to stick to 16x16... as dragongodz already mentioned ;)

which will give you the answer to: "So the Question is if thereīs a MUST for mod 16 in some case, according to some standard"

... it is not 'some standard'!!

rse
10th March 2007, 09:49
you really need to be more clear about what you want to know from the start. trying to guess exactly what you are after is not a game most are willing to play.
English is not my native language, but I thought I had asked clearly with this words:
Do MPEG-1 and/or MPEG-2 even have these limitations or not?
Which are ment according to the title. Sorry if it wasnīt clear.
Iīll try to redefine my question once more and hopefully more clearly (and extended to the already given answers):

Is there a standard using an MPEG-videostandard out there, which defines width and height to be a multiple of 16 and allows all multiples of 16 within a minimum and maximum? What I donīt mean is the intern representation of the picture in the encoded bitstream (the makroblocks). What I mean is what resolutions encoders and decoders will handle if they stick 100% to the standard.

Please ask me whatīs probably still not clear ;-)
So DVD, VCD and SVCD are not the wanted answer as they doesnīt allow resolutions between i.e. 704 and 480. DVB in SDTV-Resolutions (or smaller) may be probably an answer with a maximum of 720x576 and a minimum of 576 in height, but I donīt know that.
well i am no expert about such standards but from what i do understand SDTV uses DVD resolutions
DVB-T in Germany is aired in various resolutions, including 544x576 and 528x576 for example, which are both not in DVD standard.
do you mean 1080p/i ? as in 1920x1080(or switch them around for HD order) because that is mod 16
I meant this one. But: 1080 / 16 = 67,5 if Iīm right, not mod 16 ;-)
MPEG-4 parts 2 and 10 have the same restriction.
I thought you meant that height and width must be mod 16. Probably you only meant that it would be better to be mod 16 to ensure compatibility to poor decoders...
which will give you the answer to: "So the Question is if thereīs a MUST for mod 16 in some case, according to some standard"

... it is not 'some standard'!!
What do you mean by the ' ' ? Do you mean that thereīs no Standard except DVD, VCD and SVCD which stick to mod 16, or do you mean, that DVD, VCD, SVCD are not only 'some' standards, they are really big standards. I meant some standard with the same meaning like does a standard exist, without a rating to itīs importance. Sorry for that misleading phrase.

Once more sorry for my ambiguous phrases due to English is not my native language. Please ask if something is not 100% unambiguous.

dragongodz
10th March 2007, 12:40
if Iīm right, not mod 16
i stand corrected. i should have done the math. :)

DVB-T in Germany is aired in various resolutions, including 544x576 and 528x576 for example, which are both not in DVD standard.
i think you have partially answered your own question. that is for that instance different resolutions can be used. this though doesnt mean that it applies everywhere.

it really comes down to what limits have been set by where the mpeg is going to be used, set by either hardware or artificial standards or regulatory etc.
to try and list all the potential such cases is practically impossible.

so the only real thing you can do is look at what your encode is targeted for. research that particualr format and any limitations on both the format and output(devices, media etc) related to where you live.

sorry if this doesnt help you enough but i still feel your question is still far to general to be more exacting on.

foxyshadis
10th March 2007, 14:17
I thought you meant that height and width must be mod 16. Probably you only meant that it would be better to be mod 16 to ensure compatibility to poor decoders...

That's exactly what I meant. I end up updating and testing codecs all the time, and almost all of them start out only being about to encode/decode mod 16, then loosen up as updates are made since it's a big-demand thing. Sometimes this includes initial firmwares for hardware players, but SMD and others with them would know a lot more about that than me.

Sort of the way DVD specs allow up to 9800 kbps, but a number of players start to choke if you try to push that, even strictly within vbv limits.

The mpeg specs never prohibit non-mod-16 though, and I believe they also don't require it, it's just allowed either way.

Appu
10th March 2007, 16:48
If the width/height is not multiple of 16, what the encoders normally do for enoding the last macro block/block?

foxyshadis
10th March 2007, 17:07
Padding. Dumber ones pad with black matte, that's why borders will look terrible in some codecs (like early divx). Many will repeat edge pixels, though, so there's no real penalty for doing it.

hank315
10th March 2007, 18:01
If the width/height is not multiple of 16, what the encoders normally do for enoding the last macro block/block?
A decent MPEG2 encoder will extend the width/height to mod 16 and will output the actual values in the sequence header.
So 1920x1080 will be encoded as 1920x1088 with header values 1920x1080.

rse
11th March 2007, 10:11
it really comes down to what limits have been set by where the mpeg is going to be used, set by either hardware or artificial standards or regulatory etc.
to try and list all the potential such cases is practically impossible.
The mpeg specs never prohibit non-mod-16 though, and I believe they also don't require it, it's just allowed either way.

Thanks! Thatīs what I searched for :-) The answer is not as simple as I woudīve liked it to be, but itīs the answer to my Question. Now Iīm sure what to write on my Site. Thank you very much for your patience with me.

Bester
21st March 2007, 08:41
The mpeg specs never prohibit non-mod-16 though, and I believe they also don't require it, it's just allowed either way.

I don't think this is correct.
The smallest unit in mpeg1 is an 8*8 block. Always 4 luma blocks and 2 chroma blocks are taken to build the coded macroblock. So there is a mod 16 restriction. If input video is non mod 16 then the encoder has to either crop or extend the frame to mod 16.

foxyshadis
21st March 2007, 08:49
I guess I should prefix all of my comments with internal (coded) and external (display) tags or something, because in that sentence I was talking about the display requirements. I did affirm a few times that the internal representation is always mod-16.

Since one chroma block is 16x16, 4 luma and 1 chroma. ;) I assume that was just a typo though.

Bester
21st March 2007, 13:52
Well, I misunderstood your posting. The decoder can of course do whatever it likes with the mpeg stream.

Since one chroma block is 16x16, 4 luma and 1 chroma. I assume that was just a typo though.

No typo.
An MPEG1 macroblock is built of
4 Y blocks, 1 Cb block and 1 Cr block- each block contains 8*8 px.
An MPEG2 macroblock is either built of
4 Y blocks, 1 Cb block and 1 Cr block- each block contains 8*8 px,
4 Y blocks, 2 Cb blocks and 2 Cr blocks- each block contains 8*8 px or
4 Y blocks, 4 Cb blocks and 4 Cr blocks- each block contains 8*8 px.

foxyshadis
21st March 2007, 15:34
Oh right, you meant one chroma block per plane, I don't know why I didn't see that. >.>