[Ffmpeg-devel] Re: [PATCH] YVU9 support

Måns Rullgård mru
Sun Mar 19 01:35:42 CET 2006


Fabrizio Gennari <fabrizio.ge at tiscali.it> writes:

>>Add new values at the end of the list instead so it avoids breaking
>>binary compatibility.  Apart from that the patch looks good.
>
> Here is the same patch, only with the new value in enum PixelFormat just
> before PIX_FMT_NB.
>
> Index: libavcodec/imgconvert.c
> ===================================================================
> RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/imgconvert.c,v
> retrieving revision 1.61
> diff -u -r1.61 imgconvert.c
> --- libavcodec/imgconvert.c	12 Jan 2006 22:43:15 -0000	1.61
> +++ libavcodec/imgconvert.c	5 Mar 2006 18:16:14 -0000
> @@ -113,6 +113,14 @@
>          .depth = 8,
>          .x_chroma_shift = 2, .y_chroma_shift = 2,
>      },
> +    [PIX_FMT_YVU410P] = {
> +        .name = "yvu410p",
> +        .nb_channels = 3,
> +        .color_type = FF_COLOR_YUV,
> +        .pixel_type = FF_PIXEL_PLANAR,
> +        .depth = 8,
> +        .x_chroma_shift = 2, .y_chroma_shift = 2,
> +    },
>      [PIX_FMT_YUV411P] = {
>          .name = "yuv411p",
>          .nb_channels = 3,
> @@ -292,6 +300,17 @@
>          picture->linesize[1] = w2;
>          picture->linesize[2] = w2;
>          return size + 2 * size2;
> +    case PIX_FMT_YVU410P:
> +        w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift;
> +        h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift;
> +        size2 = w2 * h2;
> +        picture->data[0] = ptr;
> +        picture->data[2] = picture->data[0] + size;
> +        picture->data[1] = picture->data[2] + size2;
> +        picture->linesize[0] = width;
> +        picture->linesize[1] = w2;
> +        picture->linesize[2] = w2;
> +        return size + 2 * size2;
>      case PIX_FMT_RGB24:
>      case PIX_FMT_BGR24:
>          picture->data[0] = ptr;

Luca, does this interfere with any of your cropping/scaling/padding
changes, or can it be applied?

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list