On Fri, Feb 22, 2013 at 07:10:08PM +0100, Nicolas BERTRAND wrote:
> Only for XYZ 12 bits values

Diego is still needed for the commit message. I'd suggest simply
"add (or introduce) XYZ colourspace format" without any prefixes

> ---
>  libavutil/pixdesc.c |   24 ++++++++++++++++++++++++
>  libavutil/pixfmt.h  |    4 ++++
>  2 files changed, 28 insertions(+)
> 
> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> index df906ac..a07a5d3 100644
> --- a/libavutil/pixdesc.c
> +++ b/libavutil/pixdesc.c
> @@ -1365,6 +1365,30 @@ const AVPixFmtDescriptor 
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>          .log2_chroma_h = 1,
>          .flags = PIX_FMT_HWACCEL,
>      },
> +    [AV_PIX_FMT_XYZ12LE] = {
> +        .name = "xyz12le",
> +        .nb_components = 3,
> +        .log2_chroma_w = 0,
> +        .log2_chroma_h = 0,
> +        .comp = {
> +            { 0, 5, 1, 4, 11 },       /* X */
> +            { 0, 5, 3, 4, 11 },       /* Y */
> +            { 0, 5, 5, 4, 11 },       /* Z */
> +      },
> +      /*.flags = -- not used*/

indentation is slightly off

> +    },
> +    [AV_PIX_FMT_XYZ12BE] = {
> +        .name = "xyz12be",
> +        .nb_components = 3,
> +        .log2_chroma_w = 0,
> +        .log2_chroma_h = 0,
> +        .comp = {
> +            { 0, 5, 1, 4, 11 },       /* X */
> +            { 0, 5, 3, 4, 11 },       /* Y */
> +            { 0, 5, 5, 4, 11 },       /* Z */
> +       },

ditto

> +        .flags = PIX_FMT_BE,
> +    },
>  };
>  
>  static enum AVPixelFormat get_pix_fmt_internal(const char *name)
> diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> index 1863099..8ad05c3 100644
> --- a/libavutil/pixfmt.h
> +++ b/libavutil/pixfmt.h
> @@ -179,6 +179,8 @@ enum AVPixelFormat {
>      AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample 
> per 1x1 Y & A samples, big-endian)
>      AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample 
> per 1x1 Y & A samples, little-endian)
>      AV_PIX_FMT_VDPAU,     ///< HW acceleration through VDPAU, 
> Picture.data[3] contains a VdpVideoSurface
> +    AV_PIX_FMT_XYZ12LE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 
> 12Z (lsb), the 2-bytes value for each X/Y/Z is stored as little endian, 4 
> lower bytes set to 0
> +    AV_PIX_FMT_XYZ12BE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 
> 12Z (lsb), the 2-bytes value for each X/Y/Z is stored as big endian, 4 lower 
> bytes set to 0

4 lower BITS (should be even more obvious if you translate it to French ;)

>      AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if 
> you want to link with shared libav* because the number of formats might 
> differ between versions
>  
>  #if FF_API_PIX_FMT
> @@ -264,6 +266,8 @@ enum AVPixelFormat {
>  #define PIX_FMT_GBRP9  AV_PIX_FMT_GBRP9
>  #define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
>  #define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
> +
> +#define PIX_FMT_XYZ12 AV_PIX_FMT_XYZ12LE

that's wrong
You need to define AV_PIX_FMT_XYZ12 (PIX_FMT_* is deprecated)
and it should be defined to
AV_PIX_FMT_NE(AV_PIX_FMT_XYZ12BE, AV_PIX_FMT_XYZ12LE)
so the correct version will be picked up depending on endianness

>  #endif
>  
>  #endif /* AVUTIL_PIXFMT_H */
> -- 
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to