On Mon, Feb 18, 2013 at 05:57:15PM +0100, Nicolas BERTRAND wrote:
> Only for 12 bits values

The log message can be improved, feel free to ask Diego for help.

> ---
>  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..a4a021b 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*/
> +    },
> +    [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 */
> +       },
> +       /*.flags = -- not used*/

PIX_FMT_BE should be in the flags here

> +    },
>  };
>  
>  static enum AVPixelFormat get_pix_fmt_internal(const char *name)
> diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> index 1863099..f9ffdf7 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, the 
> 4 unused bytes is set to 0 (OxXXX0)

4 lower bits set to zero maybe?

> +    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, the 4 
> unused bytes is set to 0 (OxXXX0)
>      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
>  #endif
>  
>  #endif /* AVUTIL_PIXFMT_H */
> -- 
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to