[FFmpeg-devel] [PATCH] read palette information from extradata for dvd subtitle decoder
elupus
elupus
Fri Jan 18 11:56:30 CET 2008
elupus <elupus <at> ecce.se> writes:
>
> Ian Caulfield <ian.caulfield <at> gmail.com> writes:
>
--
> > When Nero Digital shoves dvd subtitles into mp4 files, it seems to
> > include the (binary) palette data from the IFO as extradata...
> >
> > Ian
> >
>
> uint32_t palette[16]; /* New type struct {zero_1, Y, Cr, Cb} ? */
>
> As taken from the PGC ifo struct. So just the 16 32bit values? Need some
good
> way to tell them apart reliably then, any ideas?
>
Found these tidbits from gpac muxer for mp4
> The subpictures palette in MP4 file is stored in decoder
> specific info of the track and the content is:
> 0 1 2 3 4 5 6 7 60 61 62 63
> 0, Y1, V1, U1, 0, Y2, V2, U3, ..., 0, Y15, V15, U15
Odd order of the yuv components. Probably a result of gabest nice old vobsub
bug that is also mentioned.
> The generic formula for conversion from YUV to RGB is:
> R = Y + 1.403V
> G = Y - 0.344U - 0.714V
> B = Y + 1.770U
>
> Gabest uses:
> R = Y + 1.403U
> G = Y - 0.344U - 0.714V
> B = Y + 1.770V
U and V are swapped on first and last line.
More information about the ffmpeg-devel
mailing list