[vlc-devel] [PATCH] picture_BlendSubpicture() : ensure the chromas are compatible

Rafaël Carré funman at videolan.org
Fri Dec 2 17:23:49 CET 2011


Le Fri, 18 Nov 2011 22:50:23 -0500,
Rafaël Carré <funman at videolan.org> a écrit :

> In this testcase the picture being blended is J420 and source is I420
> 
> fourcc.c says J420 is YUV_PLANAR_420, like I420
> libavutil/pixdesc.c uses the same description for J420 & I420
> 552b93b46f79299a4b2d952bfd34e1d5eed7bbe0 says J420 & I420 are 'not exactly equal'
> vlc_fourcc.h says:
>     J420 /* Planar YUV 4:2:0 Y:U:V full scale */
>     I420 /* Planar YUV 4:2:0 Y:U:V 8-bit */
>   -> different pixel size? but video_format_Setup() says both have 12 bits per pixel
> VoutDisplayCreateRender() assumes they are identical if source is J4** and video surface is I4**
> libswscale assumes they are identical in its 'handle_jpeg' function
> ---
>  src/misc/picture.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/src/misc/picture.c b/src/misc/picture.c
> index 87876b0..1904e98 100644
> --- a/src/misc/picture.c
> +++ b/src/misc/picture.c
> @@ -400,7 +400,11 @@ int picture_Export( vlc_object_t *p_obj,
>  void picture_BlendSubpicture(picture_t *dst,
>                               filter_t *blend, subpicture_t *src)
>  {
> -    assert(blend && dst && blend->fmt_out.video.i_chroma == dst->format.i_chroma);
> +    assert(blend && dst &&
> +        !memcmp(vlc_fourcc_GetChromaDescription(blend->fmt_out.video.i_chroma),
> +                vlc_fourcc_GetChromaDescription(dst->format.i_chroma),
> +                sizeof(vlc_chroma_description_t)));
> +
>      assert(src && !src->b_fade && src->b_absolute);
>  
>      for (subpicture_region_t *r = src->p_region; r != NULL; r = r->p_next) {


ping (fixes #5516)

Do we need a i420 <-> j420 filter instead?

-- 
Rafaël Carré



More information about the vlc-devel mailing list