diff mbox series

[FFmpeg-devel] avcodec/bsf/dovi_rpu: remove EL when stripping dovi metadata

Message ID 20241015094135.36966-1-gnattuoc@me.com
State New
Headers show
Series [FFmpeg-devel] avcodec/bsf/dovi_rpu: remove EL when stripping dovi metadata | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed

Commit Message

gnattu Oct. 15, 2024, 9:41 a.m. UTC
When RPU is removed EL should also be removed. This only applies to
HEVC as AV1 based Profile 10 does not support EL at all.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
---
 libavcodec/bsf/dovi_rpu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/bsf/dovi_rpu.c b/libavcodec/bsf/dovi_rpu.c
index ae04d16360f..b4f80588e99 100644
--- a/libavcodec/bsf/dovi_rpu.c
+++ b/libavcodec/bsf/dovi_rpu.c
@@ -84,7 +84,8 @@  static int dovi_rpu_update_fragment_hevc(AVBSFContext *bsf, AVPacket *pkt,
     uint8_t *rpu = NULL;
     int rpu_size, ret;
 
-    if (!nal || nal->type != HEVC_NAL_UNSPEC62)
+    // HEVC_NAL_UNSPEC62 is Dolby Vision PRU and HEVC_NAL_UNSPEC63 is Dolby Vision EL
+    if (!nal || (nal->type != HEVC_NAL_UNSPEC62 && nal->type != HEVC_NAL_UNSPEC63))
         return 0;
 
     if (s->strip) {
@@ -92,6 +93,10 @@  static int dovi_rpu_update_fragment_hevc(AVBSFContext *bsf, AVPacket *pkt,
         return 0;
     }
 
+    if (nal->type == HEVC_NAL_UNSPEC63) {
+        return 0;
+    }
+
     ret = update_rpu(bsf, pkt, 0, nal->data + 2, nal->data_size - 2, &rpu, &rpu_size);
     if (ret < 0)
         return ret;