[FFmpeg-cvslog] avcodec/dovi_rpu: clarify error on missing RPU VDR

Niklas Haas git at videolan.org
Mon Apr 22 13:24:01 EEST 2024


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Wed Apr  3 17:20:09 2024 +0200| [dbfd979c1b7f08d7309d227165812226755cc41c] | committer: Niklas Haas

avcodec/dovi_rpu: clarify error on missing RPU VDR

The code was written under the misguided assumption that these fields
would only be present when the value changes, however this does not
match the actual patent specification, which says that streams are
required to either always signal this metadata, or never signal it.

That said, the specification does not really clarify what the defaults
of these fields should be in the event that this metadata is missing, so
without any sample file or other reference I don't wish to hazard
a guess at how to interpret these fields.

Fix the current behavior by making sure we always throw this error, even
for files that have the vdr sequence info in one frame but are missing
it in the next frame.

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

 libavcodec/dovi_rpu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c
index bfb7b9fe66..267e52ceb6 100644
--- a/libavcodec/dovi_rpu.c
+++ b/libavcodec/dovi_rpu.c
@@ -499,11 +499,11 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size,
             hdr->el_spatial_resampling_filter_flag = get_bits1(gb);
             hdr->disable_residual_flag = get_bits1(gb);
         }
-    }
-
-    if (!hdr->bl_bit_depth) {
-        av_log(s->logctx, AV_LOG_ERROR, "Missing RPU VDR sequence info?\n");
-        goto fail;
+    } else {
+        /* lack of documentation/samples */
+        avpriv_request_sample(s->logctx, "Missing RPU VDR sequence info\n");
+        ff_dovi_ctx_unref(s);
+        return AVERROR_PATCHWELCOME;
     }
 
     vdr_dm_metadata_present = get_bits1(gb);



More information about the ffmpeg-cvslog mailing list