diff mbox series

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

Message ID 0101018fa70133a0-c75eef16-284e-4546-b4a9-7f547e9b1d47-000000@us-west-2.amazonses.com
State New
Headers show
Series avcodec/dovi - disable metadata compression by default | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Cosmin Stejerean May 23, 2024, 7:50 p.m. UTC
From: Cosmin Stejerean <cosmin@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 mbox series

Patch

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
      */