[FFmpeg-devel] dvdsub encoder: respect palette when it makes sense

Nicolas George nicolas.george
Mon Mar 2 10:32:07 CET 2009


Le duodi 12 vent?se, an CCXVII, Michael Niedermayer a ?crit?:
> dvdsubdec seems to support 8bit

I found some information here:
http://www.mpeg.org/MPEG/DVD/Book_B/Subpic.html
and there:
http://dvd.sourceforge.net/dvdinfo/spu.html

# 4 colors out of 16 color palette (4 colors are determined once per PGC).
# 4 out of 16 contrast values

In practice, that means:

- there is a 16-colors palette in the DVD title's IFO file or the VOBSUB idx
  file;

- each subpicture packet is a 4-color pixmap;

- each subpicture packet has two fields that give, for the four color cells,
  the alpha value and the palette entry number (lines 164-167 of the current
  code).

The 8bit stuff is for HD-DVD subtitles, added by revision 9788. The encoder
does not support HD-DVD subtitles.

> also in the other mail you spoke about makin them playabe in mplayer, this
> actually is of almost no relevance, it rather matters if they ae playable
> on hardware dvd players / if they are compliant tto he specs 

You are perfectly right in principle, and I did not express myself
correctly. I can make a VOBSUB file that mplayer can play with either the
current version of my patched version; supposedly, other compliant players
would play it too.

But the colors (or, in mplayer case, the gray levels) are randomly permuted.

This is both what I can see in mplayer and what I understand in the source
code.

The purpose of my patch was to stop the random permutation of colors. I now
see a better way to do it, and will shortly submit a patch implementing it.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090302/a44a25d4/attachment.pgp>



More information about the ffmpeg-devel mailing list