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

gnattu via ffmpeg-devel git at videolan.org
Thu Nov 28 15:30:52 EET 2024


ffmpeg | branch: master | gnattu via ffmpeg-devel <ffmpeg-devel at ffmpeg.org> | Tue Oct 15 17:41:35 2024 +0800| [248832dd5b799a95bcb1beb4d65a9ad5071a06a8] | committer: Anton Khirnov

avcodec/bsf/dovi_rpu: remove EL when stripping dovi metadata

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 at me.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=248832dd5b799a95bcb1beb4d65a9ad5071a06a8
---

 libavcodec/bsf/dovi_rpu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/bsf/dovi_rpu.c b/libavcodec/bsf/dovi_rpu.c
index ae04d16360..5dccd4bc7e 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,9 @@ 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;



More information about the ffmpeg-cvslog mailing list