[FFmpeg-devel] [PATCH 1/3] avutil: Add Dolby Vision RPU side data type

Derek Buitenhuis derek.buitenhuis at gmail.com
Thu Oct 21 16:48:41 EEST 2021


Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
All known encoders, etc. expect RPUs in this format, to my knowledge.
(There is no spec for parsing the RPUs, even privately, and not a single
piece of software that would benefit from that - and it is a legal minefield
which I am not going to touch.)

The comment says "with emulation bytes intact" but technically, RPUs
do not have emulation bytes, since they are not actually NALs, but just
masquerade as them, and as such, encoder APIs expect them to be there.
---
 doc/APIchanges      | 3 +++
 libavutil/frame.c   | 1 +
 libavutil/frame.h   | 7 +++++++
 libavutil/version.h | 2 +-
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 7b267a79ac..8bc9c7eb6e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil:     2021-04-27
 
 API changes, most recent first:
 
+2021-XX-XX - xxxxxxxxxx - lavf 57.8.100 - frame.h
+  Add AV_FRAME_DATA_DOVI_RPU.
+
 2021-09-21 - xxxxxxxxxx - lavu 57.7.100 - pixfmt.h
   Add AV_PIX_FMT_X2BGR10.
 
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 2617cda2b5..23b52f7b66 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -728,6 +728,7 @@ const char *av_frame_side_data_name(enum AVFrameSideDataType type)
     case AV_FRAME_DATA_SEI_UNREGISTERED:            return "H.26[45] User Data Unregistered SEI message";
     case AV_FRAME_DATA_FILM_GRAIN_PARAMS:           return "Film grain parameters";
     case AV_FRAME_DATA_DETECTION_BBOXES:            return "Bounding boxes for object detection and classification";
+    case AV_FRAME_DATA_DOVI_RPU:                    return "Dolby Vision RPU Data";
     }
     return NULL;
 }
diff --git a/libavutil/frame.h b/libavutil/frame.h
index ff2540a20f..29839211ca 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -187,6 +187,13 @@ enum AVFrameSideDataType {
      * as described by AVDetectionBBoxHeader.
      */
     AV_FRAME_DATA_DETECTION_BBOXES,
+
+    /**
+     * Dolby Vision RPU data, suitable for passing to x265
+     * or other libraries. Array of uint8_t, with NAL emulation
+     * bytes intact.
+     */
+    AV_FRAME_DATA_DOVI_RPU,
 };
 
 enum AVActiveFormatDescription {
diff --git a/libavutil/version.h b/libavutil/version.h
index 896e348d80..eeb33b388c 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  57
-#define LIBAVUTIL_VERSION_MINOR   7
+#define LIBAVUTIL_VERSION_MINOR   8
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
2.32.0



More information about the ffmpeg-devel mailing list