[XviD-devel] Dev-API-4 : Possibility to mark a defined area of the encoded picture as 'BLACK=0' , to encode BlackBars with absolute minimum of bitrate ?

ChristianHJW christian at matroska.org
Sun Jul 27 10:12:32 CEST 2003


Hi,

sorry if i am too dumb to look this up from the specs, but does 
dev-api-4 allow apps to tell XviD to set certain areas of the picture 
internally to 'BLACK', such that these macroblocks are just written as 
'0' from the encoder ?

The idea is to encode letterboxed DVDs without using a resizing filter 
or any cropping, but to not waste bits and time on XviD trying to find 
out how to encode the black bars. Of course, a nice avisynth script 
could add nice borders on top and bottom to the picture after cropping, 
and these would be 'BLACK' and nothing else, but then still XviD would 
waste precious encoding time on trying to encode this.

If you ask why, well, looking at present MPEG4 hardware decoders it 
seems they have to invest a lot of their limited processing power into 
decoding and resizing the picture, while it would probably be much 
easier for them if the get the MPEG4 video in the same resolution and 
Aspect Ratio as the original DVD has, especially with respect to 
interlaced material ??

MP4 container supports the AR flag in the MPEG4 video header, and i 
would start to make all my encodings using standard resolutions like

720 x 576 or 480 x 576, using the different standard AR flags ( 4:3, 
16:9, 21:9 ) to make sure my XVID MPEG4 video streams are compatible 
with these standard resolutions for any MPEG4 hardware device, not only 
those based on the SIGMA chip ( reading AVIs, in 1:1 AR only and without 
supporting interlacing ).

Sidenote ( more future orientated ) :

For our matroska 'hardware profiles' we will suggest to stick to the 
following resolutions when making native MPEG4 MKV files, as we hope 
they will be easier to support in future standalones ( remember you can 
easily make a MP4 from a MKV if you use either AAC or MP3 audio ) :

352 x 240 ( VCD NTSC )
352 x 288 ( VCD PAL )
480 x 240 ( new )
480 x 288 ( new )
480 x 352 ( new )
480 x 480 ( S-VCD NTSC )
480 x 576 ( S-VCD PAL )
560 x 240 ( new )
560 x 288 ( new )
560 x 352 ( new )
560 x 480 ( new )
560 x 576 ( new )
640 x 288 ( new )
640 x 352 ( new )
640 x 480 ( new )
640 X 576 ( new )
720 x 288 ( new )
720 x 352 ( new )
720 X 480 ( DVD NTSC )
720 X 576 ( DVD PAL )

AR can be 4:3, 16:9 or 21:9 ( 2.35:1 ), for any of them, giving you a 
lot of possibilities to play, resulting in a big variety of pixel 
numbers also and different 'flavours' depending on whether your focus is 
on TV or PC playback. But all of them could be supported with a few 
standard interlacing algorithms even in current hardware decoders of 
today, if we're not mistaken.

For the upcoming HDTV those could be :

1024 x 480 ( AR 4:3 , 16:9 , 21:9 )
1024 x 576 ( AR 4:3 , 16:9 , 21:9 )
1024 x 768 ( AR 4:3 , 16:9 , 21:9 )


Sorry for the long email, but it would be great if it could be 
considered to support the ability to set certain macroblocks to '0' from 
Dev-Api-4 ( and i would suggest to limit this to complete 8 x 8 
macroblocks, anything else would defeat the purpose, even if this would 
mean cropping a few lines into the original picture ).

Thanks a lot


Christian



More information about the XviD-devel mailing list