[XviD-devel] Status of GMC

Christoph Lampert xvid-devel@xvid.org
Sat, 2 Nov 2002 12:23:33 +0100 (CET)


Hi,

it's working (translational and encoding only) except for SKIPed
Macroblocks. Those are difficult, because current source assumes 
SKIP -> motion vectors (0,0) in several places which is not true
for GMC anymore (then SKIP -> global motion).

This leads to another problem: Black bars (letterboxing) which is no big
problems for non-GMC clips (because every MB is encoded using a single bit
for "not_coded" now often have to be encoded as INTER or INTRA blocks. 

This brings me back to a problem/feature I though of
earlier: XVID-generated letterboxing. Sometimes black bars are
not caused by stupidity of users but intentional, e.g. to keep aspect
ratio or to create space for overlayed subtitles. Of course it's slow 
to have XVID encode all these (hopefully) black blocks in every frame
and with GMC it might also use space inefficiently. 

So I'd like to add a feature to have XVID add black bars to the top and
bottom (or overwrite existing areas of the image with
black?) without really "encoding" them.  What do you think would be a good
way to do so?

a) Make black bars part of the picture, so add their height to
image_height etc., add a field "first_MBrow" and "last_MBrow" and 
split loops over all MBs to first process black, then normal, then black again? 

b) Treat black bars as of they were _not_ part of the picture, so 
leave image_height etc. as it is. Write a
"image_height+topbar+bottombar" to MPEG-stream instead of just
image_height, and modify routines to always write N black blocks to the
top and bottom of the bitstream.

In both cases, image_setedges would have to be modified, but not much.
And while we're at it. Would it be good to support vertical bars as well?

gruel 

P.S. What's smaller? A coded INTER-block without DCT and with vectors
(0,0), or a completely black INTRA-block?