[usf-devel] Re: [Matroska-devel] Request for a hi-speed bitmap compression formatstandard

  • From: Christian HJ Wiesner <chris@xxxxxxxxxxxx>
  • To: Discussion about the current and future development of Matroska <matroska-devel@xxxxxxxxxxxxxxxxxx>
  • Date: Mon, 11 Aug 2003 15:12:52 +0200

Ronald Bultje wrote:

>Hey Chris/guys,
>Subtitles are effectively just UTF8 strings. 
>
nope BBB, on DVDs, subs are special bitmap type pictures, with a special 
bitmap sheme, Gabest can explain it in more detail if you want, but 
basically what i understand from him you have

- a 16 colour general palette for the complete .sub VOBSUB subtitles stream
- a 4 colour subpalette for every single subtitle
- resolution is typically same width as DVD, but height is 2 lines 
smaller, so you have 720 x 574 for PAL and 720 x 478 for NTSC
- every pixel has 2 bits only, as you basically choose one of the 4 
colours from the colour subpalette for the subtitle
- empty lines are marked with a special 4 bit code, same is valid for 
the rest of a line after the last set bit ( this will save A LOT of 
space of course, as most lines of the complete picture are inactive )

The final result is RLE compressed, gaining in best case a 1:2 ratio. If 
you demux it form the DVD VOB files, you get a

.idx file : timing information
.sub file : RLE compressed 'bitmaps' ( the arent really bitmaps, look at 
the 'void line' code above, bitmaps dont have those )

and the size is tpically 4 - 8 MB per language. To make confusion 
perfect, there is another TEXT based subtitles format, called the 
'MicroDVD' format, using the same extension, .SUB .

Back on subject, the MPEG1 compressed subs would be very interesting for 
fansubbers, as they wouldnt have to give their SSA scripts away with the 
file, they could transform them to compressed picture subs, and the idea 
to use lzo on the already existing VOBSUB type files is no good option 
for them, as they use a lot of fancy features like highlighting and the 
like, and you need a new bitmap for every single change of the subs, 
like only changing the colour of a character, etc . MNG is one option 
for those 'moving' picture subs, but again much too slow ( like PNG ), 
so MPEG1 is an option, at least if the fansubbers dont want to hardcode 
the subs into the picture.

About hardcoding of subs : I guess the fansubbers would be scared if 
they knew how much MPEG4 does fuck up in terms of necessary bitrate for 
the encoding of hardcoded subs, as the sharp contrast between picture 
and the subs is a pain in the ass for the ME/MP of any MPEG4 codec. A 
simple test was to use a constant quantizer of, say, 4, and to encode 
the same movie with and without hardcoded subs. I estimate that for a 
typical 600 MB video stream in a 700 MB movie, the difference in using 
subs with constant quantizer is about 30 - 40 MB, if not more.

>Use XML or xhtml for
>mark-up if really you want to, and you're there. 
>Ronald
>
Yes, we are :) .... ever checked http://usf.corecodec.org :) ??

Regards

Christian

http://usf.corecodec.org

Other related posts: