[FFmpeg-devel] [PATCH] Enables parsing DVD color palette directly from IFO file

Hendrik Leppkes h.leppkes at gmail.com
Mon Nov 10 15:33:08 CET 2014


On Mon, Nov 10, 2014 at 3:01 PM, Nicolas George <george at nsup.org> wrote:

>
> > +
> > +      /* YCrCb - RGB conversion */
> > +      Cr = Cr - 128;
> > +      Cb = Cb - 128;
>
> > +      R = Y + Cr + (Cr>>2) + (Cr>>3) + (Cr>>5);
> > +      G = Y - ((Cb>>2) + (Cb>>4) + (Cb>>5)) - ((Cr>>1) + (Cr>>3) +
> (Cr>>4) + (Cr>>5));
> > +      B = Y + Cb + (Cb>>1) + (Cb>>2) + (Cb>>6);
>
> Are these he official formulas? The shifts look like premature
> optimization.
>

We have conversion macros for those, see yuv_a_to_rgba at the beginning of
the same file.
In fact, if you just read all the YCbCr stuff into a fixed-size buffer
first, you might even be able to use the same function for the entire
conversion.

- Hendrik


More information about the ffmpeg-devel mailing list