On Tue, 19 Jan 2016 at 22:11 Vittorio Giovara <vittorio.giov...@gmail.com>
wrote:

> Based on the original documentation found in mpeg2dec (1995).
>
> Signed-off-by: Vittorio Giovara <vittorio.giov...@gmail.com>
> ---
> Based off an archeological expedition with Derek.
> Vittorio
>
>  libswscale/yuv2rgb.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
> index a4f7a11..fca3242 100644
> --- a/libswscale/yuv2rgb.c
> +++ b/libswscale/yuv2rgb.c
> @@ -35,6 +35,17 @@
>  #include "swscale.h"
>  #include "swscale_internal.h"
>
> +/* Color space conversion coefficients for YCbCr -> RGB mapping.
> + *
> + * Entries are {crv, cbu, cgu, cgv}
> + *
> + *   crv = (255 / 224) * 65536 * (1 - cr) / 0.5
> + *   cbu = (255 / 224) * 65536 * (1 - cb) / 0.5
> + *   cgu = (255 / 224) * 65536 * (cb / cg) * (1 - cb) / 0.5
> + *   cgv = (255 / 224) * 65536 * (cr / cg) * (1 - cr) / 0.5
> + *
> + * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1.
> + */
>

Yes, brilliant!
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to