[MPlayer-dev-eng] [PATCH] New video filter: deblendlogo

Trent Piepho xyzzy at speakeasy.org
Wed Feb 23 23:41:17 CET 2005


On Wed, 23 Feb 2005, Oded Shimon wrote:
> On Wednesday 23 February 2005 21:21, Oded Shimon wrote:
> > 2 possible options:
> > Disable YV12 altogether for the filter, let the user do
> > 'scale=,format=rgba' before the filter.
> > Allow YV12, and convert only the necessary area to RGBA and back.
> Funny thing is, this doesn't even work.
> 
> Does anyone know th _REAL_ YUV <-> RGB convertion equations?... They are NOT 
> what is written in DOCS/tech/colorspaces.txt

There are two kinds of YUV that normally get used.  One is full range
where Y, U, and V each go from 0 to 255.  JPEG files use this.  

The other, specified by rec 601, has a limited range.  Y ranges from 16 to
235, U and V from 16 to 240.  This is used by MPEG, MJPEG, and a lot of other
video codecs I'm assuming.

I suggest reading the colorspace-faq, which goes into much detail.  Look at
the equation for question C-30, "HOW DO I ENCODE Y'CBCR COMPONENTS FROM
COMPUTER R'G'B' ?"

That equation, which I believe is the correct one, is the same as the first
equation in DOCS/tech/colorspaces.txt (if you scale down by a factor of 256). 
It's also the same as the defines BY, BV, BU, GY, GU, etc.  in swscale.c
(around line 100).




More information about the MPlayer-dev-eng mailing list