Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/8] avdovi/dovi_rpudec: handle prev_vdr_rpu_id failures
@ 2024-06-09 15:05 Niklas Haas
  2024-06-09 15:05 ` [FFmpeg-devel] [PATCH 2/8] avcodec/dovi_rpu: properly handle vdr_dm_metadata_present Niklas Haas
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Niklas Haas @ 2024-06-09 15:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Niklas Haas

From: Niklas Haas <git@haasn.dev>

According to the spec, missing previous VDR RPU IDs do not constitute an
error, but we should instead fallback first to VDR RPU with ID 0, and
failing that, synthesize "neutral" metadata.

That's nontrivial though as the resulting metadata will be dependent on
other properties of the RPU, and this case is not hit in practice so
I'll defer it to a rainy day.
---
 libavcodec/dovi_rpudec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c
index 7c7eda9d09..d1dcc3a262 100644
--- a/libavcodec/dovi_rpudec.c
+++ b/libavcodec/dovi_rpudec.c
@@ -444,7 +444,12 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size,
     if (use_prev_vdr_rpu) {
         int prev_vdr_rpu_id = get_ue_golomb_31(gb);
         VALIDATE(prev_vdr_rpu_id, 0, DOVI_MAX_DM_ID);
+        if (!s->vdr[prev_vdr_rpu_id])
+            prev_vdr_rpu_id = 0;
         if (!s->vdr[prev_vdr_rpu_id]) {
+            /* FIXME: Technically, the spec says that in this case we should
+             * synthesize "neutral" vdr metadata, but easier to just error
+             * out as this corner case is not hit in practice */
             av_log(s->logctx, AV_LOG_ERROR, "Unknown previous RPU ID: %u\n",
                    prev_vdr_rpu_id);
             goto fail;
-- 
2.45.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-06-14 11:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-09 15:05 [FFmpeg-devel] [PATCH 1/8] avdovi/dovi_rpudec: handle prev_vdr_rpu_id failures Niklas Haas
2024-06-09 15:05 ` [FFmpeg-devel] [PATCH 2/8] avcodec/dovi_rpu: properly handle vdr_dm_metadata_present Niklas Haas
2024-06-09 15:05 ` [FFmpeg-devel] [PATCH 3/8] avcodec/dovi_rpu: fix dm_metadata_id handling Niklas Haas
2024-06-09 15:05 ` [FFmpeg-devel] [PATCH 4/8] avcodec/dovi_rpudec: simplify vdr handling (cosmetic) Niklas Haas
2024-06-09 15:05 ` [FFmpeg-devel] [PATCH 5/8] avcodec/dovi_rpu: simplify vdr type Niklas Haas
2024-06-09 15:05 ` [FFmpeg-devel] [PATCH 6/8] avcodec/dovi_rpu: guard ext blocks by dm_metadata_present Niklas Haas
2024-06-09 15:05 ` [FFmpeg-devel] [PATCH 7/8] avcodec/dovi_rpudec: reject reserved_zero_3bits != 0 Niklas Haas
2024-06-09 15:05 ` [FFmpeg-devel] [PATCH 8/8] avcodec/dovi_rpudec: handle errors consistently Niklas Haas
2024-06-14 11:41 ` [FFmpeg-devel] [PATCH 1/8] avdovi/dovi_rpudec: handle prev_vdr_rpu_id failures Niklas Haas

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git