Re: [FFmpeg-devel] [PATCH 1/4] avutil: add support for CUVA HDR Vivid metadata

2022-02-25 Thread lance . lmwang
On Tue, Feb 15, 2022 at 08:08:51AM +0100, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> >  libavutil/Makefile |   2 +
> >  libavutil/frame.c  |   1 +
> >  libavutil/frame.h  |   7 +
> >  libavutil/hdr_dynamic_vivid_metadata.c |  47 ++
> >  libavutil/hdr_dynamic_vivid_metadata.h | 285 
> > +
> >  libavutil/version.h|   2 +-
> >  6 files changed, 343 insertions(+), 1 deletion(-)
> >  create mode 100644 libavutil/hdr_dynamic_vivid_metadata.c
> >  create mode 100644 libavutil/hdr_dynamic_vivid_metadata.h
> > 
> > diff --git a/libavutil/Makefile b/libavutil/Makefile
> > index d17876d..a8d7587 100644
> > --- a/libavutil/Makefile
> > +++ b/libavutil/Makefile
> > @@ -34,6 +34,7 @@ HEADERS = adler32.h   
> >   \
> >frame.h   \
> >hash.h\
> >hdr_dynamic_metadata.h\
> > +  hdr_dynamic_vivid_metadata.h  \
> >hmac.h\
> >hwcontext.h   \
> >hwcontext_cuda.h  \
> > @@ -130,6 +131,7 @@ OBJS = adler32.o
> > \
> > frame.o  \
> > hash.o   \
> > hdr_dynamic_metadata.o   \
> > +   hdr_dynamic_vivid_metadata.o \
> > hmac.o   \
> > hwcontext.o  \
> > imgutils.o   \
> > diff --git a/libavutil/frame.c b/libavutil/frame.c
> > index 8997c85..b035e28 100644
> > --- a/libavutil/frame.c
> > +++ b/libavutil/frame.c
> > @@ -723,6 +723,7 @@ const char *av_frame_side_data_name(enum 
> > AVFrameSideDataType type)
> >  case AV_FRAME_DATA_SPHERICAL:   return "Spherical 
> > Mapping";
> >  case AV_FRAME_DATA_ICC_PROFILE: return "ICC profile";
> >  case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata 
> > SMPTE2094-40 (HDR10+)";
> > +case AV_FRAME_DATA_DYNAMIC_HDR_VIVID: return "HDR Dynamic Metadata 
> > CUVA 005.1 2021 (Vivid)";
> >  case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest";
> >  case AV_FRAME_DATA_VIDEO_ENC_PARAMS:return "Video encoding 
> > parameters";
> >  case AV_FRAME_DATA_SEI_UNREGISTERED:return "H.26[45] User 
> > Data Unregistered SEI message";
> > diff --git a/libavutil/frame.h b/libavutil/frame.h
> > index 18e239f..32cde3c 100644
> > --- a/libavutil/frame.h
> > +++ b/libavutil/frame.h
> > @@ -158,6 +158,13 @@ enum AVFrameSideDataType {
> >  AV_FRAME_DATA_DYNAMIC_HDR_PLUS,
> >  
> >  /**
> > + * HDR Vivid dynamic metadata associated with a video frame. The 
> > payload is
> > + * an AVDynamicHDRVivid type and contains information for color
> > + * volume transform - CUVA 005.1-2021.
> > + */
> > +AV_FRAME_DATA_DYNAMIC_HDR_VIVID,
> > +
> 
> Always add at the end. You are breaking ABI otherwise.

plan to push the patchset(including of moving the type at the end) in the next 
two day if no other more comments 

> 
> > +/**
> >   * Regions Of Interest, the data is an array of AVRegionOfInterest 
> > type, the number of
> >   * array element is implied by AVFrameSideData.size / 
> > AVRegionOfInterest.self_size.
> >   */
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

-- 
Thanks,
Limin Wang
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/4] avutil: add support for CUVA HDR Vivid metadata

2022-02-14 Thread lance . lmwang
On Tue, Feb 15, 2022 at 08:08:51AM +0100, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> >  libavutil/Makefile |   2 +
> >  libavutil/frame.c  |   1 +
> >  libavutil/frame.h  |   7 +
> >  libavutil/hdr_dynamic_vivid_metadata.c |  47 ++
> >  libavutil/hdr_dynamic_vivid_metadata.h | 285 
> > +
> >  libavutil/version.h|   2 +-
> >  6 files changed, 343 insertions(+), 1 deletion(-)
> >  create mode 100644 libavutil/hdr_dynamic_vivid_metadata.c
> >  create mode 100644 libavutil/hdr_dynamic_vivid_metadata.h
> > 
> > diff --git a/libavutil/Makefile b/libavutil/Makefile
> > index d17876d..a8d7587 100644
> > --- a/libavutil/Makefile
> > +++ b/libavutil/Makefile
> > @@ -34,6 +34,7 @@ HEADERS = adler32.h   
> >   \
> >frame.h   \
> >hash.h\
> >hdr_dynamic_metadata.h\
> > +  hdr_dynamic_vivid_metadata.h  \
> >hmac.h\
> >hwcontext.h   \
> >hwcontext_cuda.h  \
> > @@ -130,6 +131,7 @@ OBJS = adler32.o
> > \
> > frame.o  \
> > hash.o   \
> > hdr_dynamic_metadata.o   \
> > +   hdr_dynamic_vivid_metadata.o \
> > hmac.o   \
> > hwcontext.o  \
> > imgutils.o   \
> > diff --git a/libavutil/frame.c b/libavutil/frame.c
> > index 8997c85..b035e28 100644
> > --- a/libavutil/frame.c
> > +++ b/libavutil/frame.c
> > @@ -723,6 +723,7 @@ const char *av_frame_side_data_name(enum 
> > AVFrameSideDataType type)
> >  case AV_FRAME_DATA_SPHERICAL:   return "Spherical 
> > Mapping";
> >  case AV_FRAME_DATA_ICC_PROFILE: return "ICC profile";
> >  case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata 
> > SMPTE2094-40 (HDR10+)";
> > +case AV_FRAME_DATA_DYNAMIC_HDR_VIVID: return "HDR Dynamic Metadata 
> > CUVA 005.1 2021 (Vivid)";
> >  case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest";
> >  case AV_FRAME_DATA_VIDEO_ENC_PARAMS:return "Video encoding 
> > parameters";
> >  case AV_FRAME_DATA_SEI_UNREGISTERED:return "H.26[45] User 
> > Data Unregistered SEI message";
> > diff --git a/libavutil/frame.h b/libavutil/frame.h
> > index 18e239f..32cde3c 100644
> > --- a/libavutil/frame.h
> > +++ b/libavutil/frame.h
> > @@ -158,6 +158,13 @@ enum AVFrameSideDataType {
> >  AV_FRAME_DATA_DYNAMIC_HDR_PLUS,
> >  
> >  /**
> > + * HDR Vivid dynamic metadata associated with a video frame. The 
> > payload is
> > + * an AVDynamicHDRVivid type and contains information for color
> > + * volume transform - CUVA 005.1-2021.
> > + */
> > +AV_FRAME_DATA_DYNAMIC_HDR_VIVID,
> > +
> 
> Always add at the end. You are breaking ABI otherwise.

Thanks for the comments, will fix it in the next version.

> 
> > +/**
> >   * Regions Of Interest, the data is an array of AVRegionOfInterest 
> > type, the number of
> >   * array element is implied by AVFrameSideData.size / 
> > AVRegionOfInterest.self_size.
> >   */
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

-- 
Thanks,
Limin Wang
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/4] avutil: add support for CUVA HDR Vivid metadata

2022-02-14 Thread Andreas Rheinhardt
lance.lmw...@gmail.com:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  libavutil/Makefile |   2 +
>  libavutil/frame.c  |   1 +
>  libavutil/frame.h  |   7 +
>  libavutil/hdr_dynamic_vivid_metadata.c |  47 ++
>  libavutil/hdr_dynamic_vivid_metadata.h | 285 
> +
>  libavutil/version.h|   2 +-
>  6 files changed, 343 insertions(+), 1 deletion(-)
>  create mode 100644 libavutil/hdr_dynamic_vivid_metadata.c
>  create mode 100644 libavutil/hdr_dynamic_vivid_metadata.h
> 
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index d17876d..a8d7587 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -34,6 +34,7 @@ HEADERS = adler32.h 
> \
>frame.h   \
>hash.h\
>hdr_dynamic_metadata.h\
> +  hdr_dynamic_vivid_metadata.h  \
>hmac.h\
>hwcontext.h   \
>hwcontext_cuda.h  \
> @@ -130,6 +131,7 @@ OBJS = adler32.o  
>   \
> frame.o  \
> hash.o   \
> hdr_dynamic_metadata.o   \
> +   hdr_dynamic_vivid_metadata.o \
> hmac.o   \
> hwcontext.o  \
> imgutils.o   \
> diff --git a/libavutil/frame.c b/libavutil/frame.c
> index 8997c85..b035e28 100644
> --- a/libavutil/frame.c
> +++ b/libavutil/frame.c
> @@ -723,6 +723,7 @@ const char *av_frame_side_data_name(enum 
> AVFrameSideDataType type)
>  case AV_FRAME_DATA_SPHERICAL:   return "Spherical 
> Mapping";
>  case AV_FRAME_DATA_ICC_PROFILE: return "ICC profile";
>  case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata 
> SMPTE2094-40 (HDR10+)";
> +case AV_FRAME_DATA_DYNAMIC_HDR_VIVID: return "HDR Dynamic Metadata CUVA 
> 005.1 2021 (Vivid)";
>  case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest";
>  case AV_FRAME_DATA_VIDEO_ENC_PARAMS:return "Video encoding 
> parameters";
>  case AV_FRAME_DATA_SEI_UNREGISTERED:return "H.26[45] User 
> Data Unregistered SEI message";
> diff --git a/libavutil/frame.h b/libavutil/frame.h
> index 18e239f..32cde3c 100644
> --- a/libavutil/frame.h
> +++ b/libavutil/frame.h
> @@ -158,6 +158,13 @@ enum AVFrameSideDataType {
>  AV_FRAME_DATA_DYNAMIC_HDR_PLUS,
>  
>  /**
> + * HDR Vivid dynamic metadata associated with a video frame. The payload 
> is
> + * an AVDynamicHDRVivid type and contains information for color
> + * volume transform - CUVA 005.1-2021.
> + */
> +AV_FRAME_DATA_DYNAMIC_HDR_VIVID,
> +

Always add at the end. You are breaking ABI otherwise.

> +/**
>   * Regions Of Interest, the data is an array of AVRegionOfInterest type, 
> the number of
>   * array element is implied by AVFrameSideData.size / 
> AVRegionOfInterest.self_size.
>   */
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/4] avutil: add support for CUVA HDR Vivid metadata

2022-02-14 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavutil/Makefile |   2 +
 libavutil/frame.c  |   1 +
 libavutil/frame.h  |   7 +
 libavutil/hdr_dynamic_vivid_metadata.c |  47 ++
 libavutil/hdr_dynamic_vivid_metadata.h | 285 +
 libavutil/version.h|   2 +-
 6 files changed, 343 insertions(+), 1 deletion(-)
 create mode 100644 libavutil/hdr_dynamic_vivid_metadata.c
 create mode 100644 libavutil/hdr_dynamic_vivid_metadata.h

diff --git a/libavutil/Makefile b/libavutil/Makefile
index d17876d..a8d7587 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -34,6 +34,7 @@ HEADERS = adler32.h   
  \
   frame.h   \
   hash.h\
   hdr_dynamic_metadata.h\
+  hdr_dynamic_vivid_metadata.h  \
   hmac.h\
   hwcontext.h   \
   hwcontext_cuda.h  \
@@ -130,6 +131,7 @@ OBJS = adler32.o
\
frame.o  \
hash.o   \
hdr_dynamic_metadata.o   \
+   hdr_dynamic_vivid_metadata.o \
hmac.o   \
hwcontext.o  \
imgutils.o   \
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 8997c85..b035e28 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -723,6 +723,7 @@ const char *av_frame_side_data_name(enum 
AVFrameSideDataType type)
 case AV_FRAME_DATA_SPHERICAL:   return "Spherical Mapping";
 case AV_FRAME_DATA_ICC_PROFILE: return "ICC profile";
 case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata 
SMPTE2094-40 (HDR10+)";
+case AV_FRAME_DATA_DYNAMIC_HDR_VIVID: return "HDR Dynamic Metadata CUVA 
005.1 2021 (Vivid)";
 case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest";
 case AV_FRAME_DATA_VIDEO_ENC_PARAMS:return "Video encoding 
parameters";
 case AV_FRAME_DATA_SEI_UNREGISTERED:return "H.26[45] User Data 
Unregistered SEI message";
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 18e239f..32cde3c 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -158,6 +158,13 @@ enum AVFrameSideDataType {
 AV_FRAME_DATA_DYNAMIC_HDR_PLUS,
 
 /**
+ * HDR Vivid dynamic metadata associated with a video frame. The payload is
+ * an AVDynamicHDRVivid type and contains information for color
+ * volume transform - CUVA 005.1-2021.
+ */
+AV_FRAME_DATA_DYNAMIC_HDR_VIVID,
+
+/**
  * Regions Of Interest, the data is an array of AVRegionOfInterest type, 
the number of
  * array element is implied by AVFrameSideData.size / 
AVRegionOfInterest.self_size.
  */
diff --git a/libavutil/hdr_dynamic_vivid_metadata.c 
b/libavutil/hdr_dynamic_vivid_metadata.c
new file mode 100644
index 000..32da01f
--- /dev/null
+++ b/libavutil/hdr_dynamic_vivid_metadata.c
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2021 Limin Wang 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "hdr_dynamic_vivid_metadata.h"
+#include "mem.h"
+
+AVDynamicHDRVivid *av_dynamic_hdr_vivid_alloc(size_t *size)
+{
+AVDynamicHDRVivid *hdr_vivid = av_mallocz(sizeof(AVDynamicHDRVivid));
+if (!hdr_vivid)
+return NULL;
+
+if (size)
+*size = sizeof(*hdr_vivid);
+
+return hdr_vivid;
+}
+
+AVDynamicHDRVivid *av_dynamic_hdr_vivid_create_side_data(AVFrame *frame)
+{
+AVFrameSideData *side_data = av_frame_new_side_data(frame,
+
AV_FRAME_D