I'm playing with the class UMC::MPEG2VideoEncoder. I tested it with various widths and heights of the encoded MPEG2 stream and looks like it works fine only if the width is multiple of 16, (width % 16) == 0.
For example if I try to encode a movie with width = 60, height = 60 then code crashes in file umc_mpeg2_enc_me.h line:41
mpeg2_assert(limit_right >= 0);
because the limit_right value is -4.
My question is:
What are the restrictions on the width and height in UMC::MPEG2VideoEncoder?
Hi, thanks for pointing this out.
In current version only width has to be a multiple of 16. If there is a need to avoid this limitation please change in umc_mpeg2_enc_defs.h in BOUNDS_H macro srcYFrameHSize to MBcountH*16 in both places.
Really it is not good to work with frame dimensions not multiple of 16 (of 32 for height with interlaced content). MPEG2 standard doesn't define how to fill extended area and such boundary macroblocks are poorly compressed. Also, some players do display aligned area and noisy or color stripes appear on the right or bottom border.