[FFmpeg-devel] [PATCH 4/7] Adds gray floating-point pixel formats.

Sergey Lavrushkin dualfal at gmail.com
Thu Aug 9 20:15:16 EEST 2018


Here are updated patches with fixes. I updated conversion functions, so
they should
properly work with format for different endianness.

2018-08-08 1:47 GMT+03:00 Michael Niedermayer <michael at niedermayer.cc>:

> On Tue, Aug 07, 2018 at 12:17:58AM +0300, Sergey Lavrushkin wrote:
> > I split patch to one for libavutil and another for libswscale,
> > also added LUT for unscaled conversion, added
> > conversions for scaling and updated fate tests.
>
> >  libavutil/pixdesc.c              |   22 ++++++++++++++++++++++
> >  libavutil/pixfmt.h               |    5 +++++
> >  libavutil/version.h              |    2 +-
> >  tests/ref/fate/sws-pixdesc-query |    3 +++
> >  4 files changed, 31 insertions(+), 1 deletion(-)
> > b58f328f5d90954c62957f127b1acbfad5795a4d  0004-libavutil-Adds-gray-
> floating-point-pixel-formats.patch
> > From 8bcc10b49c41612b4d6549e64d90acf3f0b3fc6a Mon Sep 17 00:00:00 2001
> > From: Sergey Lavrushkin <dualfal at gmail.com>
> > Date: Fri, 3 Aug 2018 18:02:49 +0300
> > Subject: [PATCH 4/9] libavutil: Adds gray floating-point pixel formats.
> >
> > ---
> >  libavutil/pixdesc.c              | 22 ++++++++++++++++++++++
> >  libavutil/pixfmt.h               |  5 +++++
> >  libavutil/version.h              |  2 +-
> >  tests/ref/fate/sws-pixdesc-query |  3 +++
> >  4 files changed, 31 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> > index 96e079584a..970a83214c 100644
> > --- a/libavutil/pixdesc.c
> > +++ b/libavutil/pixdesc.c
> > @@ -2206,6 +2206,28 @@ static const AVPixFmtDescriptor
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> >          .name  = "opencl",
> >          .flags = AV_PIX_FMT_FLAG_HWACCEL,
> >      },
> > +    [AV_PIX_FMT_GRAYF32BE] = {
> > +        .name = "grayf32be",
> > +        .nb_components = 1,
> > +        .log2_chroma_w = 0,
> > +        .log2_chroma_h = 0,
> > +        .comp = {
> > +            { 0, 4, 0, 0, 32, 3, 31, 1 },       /* Y */
> > +        },
> > +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_FLOAT,
> > +        .alias = "yf32be",
> > +    },
> > +    [AV_PIX_FMT_GRAYF32LE] = {
> > +        .name = "grayf32le",
> > +        .nb_components = 1,
> > +        .log2_chroma_w = 0,
> > +        .log2_chroma_h = 0,
> > +        .comp = {
> > +            { 0, 4, 0, 0, 32, 3, 31, 1 },       /* Y */
> > +        },
> > +        .flags = AV_PIX_FMT_FLAG_FLOAT,
> > +        .alias = "yf32le",
> > +    },
> >  };
> >  #if FF_API_PLUS1_MINUS1
> >  FF_ENABLE_DEPRECATION_WARNINGS
> > diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> > index 2b3307845e..7b254732d8 100644
> > --- a/libavutil/pixfmt.h
> > +++ b/libavutil/pixfmt.h
> > @@ -337,6 +337,9 @@ enum AVPixelFormat {
> >      AV_PIX_FMT_GRAY14BE,   ///<        Y        , 14bpp, big-endian
> >      AV_PIX_FMT_GRAY14LE,   ///<        Y        , 14bpp, little-endian
> >
> > +    AV_PIX_FMT_GRAYF32BE,  ///< IEEE-754 single precision Y, 32bpp,
> big-endian
> > +    AV_PIX_FMT_GRAYF32LE,  ///< IEEE-754 single precision Y, 32bpp,
> little-endian
> > +
> >      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
> >  };
> >
> > @@ -405,6 +408,8 @@ enum AVPixelFormat {
> >  #define AV_PIX_FMT_GBRPF32    AV_PIX_FMT_NE(GBRPF32BE,  GBRPF32LE)
> >  #define AV_PIX_FMT_GBRAPF32   AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE)
> >
> > +#define AV_PIX_FMT_GRAYF32 AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE)
> > +
> >  #define AV_PIX_FMT_YUVA420P9  AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
> >  #define AV_PIX_FMT_YUVA422P9  AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
> >  #define AV_PIX_FMT_YUVA444P9  AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
> > diff --git a/libavutil/version.h b/libavutil/version.h
> > index 44bdebdc93..5205c5bc60 100644
> > --- a/libavutil/version.h
> > +++ b/libavutil/version.h
>
> > @@ -79,7 +79,7 @@
> >   */
> >
> >  #define LIBAVUTIL_VERSION_MAJOR  56
> > -#define LIBAVUTIL_VERSION_MINOR  18
> > +#define LIBAVUTIL_VERSION_MINOR  19
> >  #define LIBAVUTIL_VERSION_MICRO 102
>
> a bump to minor must reset micro to 100
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> In a rich man's house there is no place to spit but his face.
> -- Diogenes of Sinope
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-libavutil-Adds-gray-floating-point-pixel-formats.patch
Type: text/x-patch
Size: 3564 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180809/dcc437f0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-libswscale-Adds-conversions-from-to-float-gray-forma.patch
Type: text/x-patch
Size: 23667 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180809/dcc437f0/attachment-0001.bin>


More information about the ffmpeg-devel mailing list