[FFmpeg-devel] [PATCH v3 1/5] avcodec/dovi_rpu - field and macro for metadata compression

Cosmin Stejerean cosmin at cosmin.at
Thu May 23 22:50:24 EEST 2024


From: Cosmin Stejerean <cosmin at cosmin.at>


Add a field to enable or disable metadata compression since not all clients support this.

Introduce DOVI_ENCODING_OPTS macro to faciliate exposing this as an option to encoders.

---
 libavcodec/dovi_rpu.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/dovi_rpu.h b/libavcodec/dovi_rpu.h
index 8ce0c88e9d..5406425c0d 100644
--- a/libavcodec/dovi_rpu.h
+++ b/libavcodec/dovi_rpu.h
@@ -28,6 +28,11 @@
 #include "libavutil/frame.h"
 #include "avcodec.h"
 
+#define DOVI_ENCODING_OPTS(dovi) \
+    { "dolbyvision", "Enable Dolby Vision RPU coding", OFFSET(dovi.enable), AV_OPT_TYPE_BOOL, {.i64 = FF_DOVI_AUTOMATIC }, -1, 1, VE, .unit = "dovi" }, \
+    {   "auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DOVI_AUTOMATIC}, .flags = VE, .unit = "dovi" }, \
+    { "dv_enable_compression", "Enable Dolby Vision metadata compression", OFFSET(dovi.enable_compression), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE },
+
 #define DOVI_MAX_DM_ID 15
 typedef struct DOVIContext {
     void *logctx;
@@ -71,6 +76,11 @@ typedef struct DOVIContext {
     AVDOVIDmData *ext_blocks;
     int num_ext_blocks;
 
+    /**
+     * Enable metadata compression in the output. Currently this is experimental.
+     */
+    int enable_compression;
+
     /**
      * Private fields internal to dovi_rpu.c
      */
-- 
2.42.1




More information about the ffmpeg-devel mailing list