[MPlayer-dev-eng] [PATCH] vobsub custom colors rgb->yuv fix.
Ulion
ulion2002 at gmail.com
Mon Dec 3 09:15:13 CET 2007
2007/12/3, Ulion <ulion2002 at gmail.com>:
> 2007/12/3, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> > Hello,
> > On Mon, Dec 03, 2007 at 11:31:27AM +0800, Ulion wrote:
> > > 2007/12/2, Ulion <ulion2002 at gmail.com>:
> > > > Hello,
> > > >
> > > > the custom colors in .idx file, is same with palette in .idx, all in
> > > > rgb format, spudec all use them as yuv format, and in vobsub.c,
> > > > palette has rgb->yuv convert code, but custom palette was not
> > > > converted.
> > > > Although spudec only use the 'y' part of palette, this bug will still
> > > > make spudec use wrong 'y' value of custom palette. Here's the fix, if
> > > > there are no objections, I will commit it tomorrow.
> > >
> > > Done.
> > >
> > > Same problem also happens in demux_mkv.c, here's a patch for it, if
> > > there's no objections, I will commit it tomorrow.
> >
> > Are you really sure about this? I thought there was some reason it was
> > like this...
>
> I'm sure because spudec use the second byte of the cuspal, it thought
> it was 'Y'.
>
> But just now I fount the formulae has problem to convert from rgb->yuv.
> Indeed I should use macro RGB_TO_Y_CCIR, RGB_TO_U_CCIR, RGB_TO_V_CCIR
> to get the yuv in correct yuv color space range, should I, Reimar?
Here's formulae fix for rgb->yuv, use RGB_TO_Y_CCIR... in
libavcodec/colorspace.h, is here any can tell me whether directly
include libavcodec/colorspace.h in vobsub.c and libmpdemux/demux_mkv.c
is safe and acceptable?
Second attachment is the custom palette rgb->yuv fix for demux_mkv,
updated to use correct formulae.
If there's no object, I will commit these two patch in 2 days.
--
Ulion
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vobsub_yuv_fix.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071203/ac6d89aa/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vobsub_mkv_cuspal_yuv2.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071203/ac6d89aa/attachment.txt>
More information about the MPlayer-dev-eng
mailing list