[vlc-devel] [PATCH 2/2] XYZ to RGB filter conversion

Jean-Baptiste Kempf jb at videolan.org
Thu Feb 14 15:33:55 CET 2013


On 14 Feb, Nicolas BERTRAND wrote :
> Modification in modules/codec/avcodec to handle JPEG2000 codec and
> set chroma format to XYZ
> 
> Creation of module xyz_rgb in modules/video_chroma. This module filter
> from XYZ to RGB. Actually it converts from XYZ12 to RGB32. As XYZ is
> 12 bits depth and RGB 8 bit depth, a lack of precision is introduced
> in colors precision.
> 
> RGB color space display mist be used with opengl output (-Vgl)
> 
> WARNING: This modification needs a libav supporting XYZ format,
> i.e PIX_FMT_XYZ12


>  modules/codec/avcodec/chroma.c  |    3 +
>  modules/codec/avcodec/video.c   |    1 +

Split this part from the next:

>  modules/video_chroma/Modules.am |    5 +
>  modules/video_chroma/xyz_rgb.c  |  267 +++++++++++++++++++++++++++++++++++++++

> +    /* XYZ */
> +    {VLC_CODEC_XYZ12, PIX_FMT_XYZ12, 0xfff0, 0xfff0, 0xfff0},

This needs the proper AV*VERSION guards

> +    if (i_codec_id == CODEC_ID_JPEG2000)  p_context->pix_fmt = PIX_FMT_XYZ12;

Hmmm, is it always the case?

> +//static picture_t *XYZ_RGB_Filter  ( filter_t *, picture_t * );

Why keep it?

> +    msg_Info(p_this, "Entering XYZ to RGB chroma filter module  , input chroma %4.4s, out format %4.4s",
> +            (char *)&p_filter->fmt_in.video.i_chroma, (char *)&p_filter->fmt_out.video.i_chroma);

Don't msg_Info this.

> +   msg_Info(p_this, "filter configured and selected");

Dbg is enough, and you need more meaningful debug.

> + *****************************************************************************/
> +static void CloseFilter( vlc_object_t *p_this )
> +{
> +    filter_t *p_filter = (filter_t *)p_this;
> +
> +
> +    free( p_filter->p_sys );
> +    return;
> +}

Excessive vertical whitespace.

> +static void CalcXyz2Rgb(filter_t *p_filter, uint8_t *p_src, uint8_t *p_dst){
> +
> +
> +
> +
> +}

idem

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list