From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id AD0174B7F5 for ; Fri, 14 Jun 2024 11:41:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F1FF68D661; Fri, 14 Jun 2024 14:41:42 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 727EA68D5B2 for ; Fri, 14 Jun 2024 14:41:35 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1718365294; bh=kkJVxUtTts5Kv1WdREoswY5DP9e47F+wZP8fcqXbA/E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ThCyQdEKUP/KIeqHJngV0afDy0cLsVhCbKWeqtcIzLGeIl05+C7LHaDhemhkMaECh UWDQkkSnHkzc5mRW0YAeAyxM1xrXU2pgs2RVjGJddDn02ZHUOPWNE4ojVKEjfKXLs4 4Lwz+FKPFmN42p4U9l3YSVDQNJi9NVuqHEuHA16k= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 7065C41128; Fri, 14 Jun 2024 13:41:34 +0200 (CEST) Date: Fri, 14 Jun 2024 13:41:34 +0200 Message-ID: <20240614134134.GB25621@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: <20240609150553.72865-1-ffmpeg@haasn.xyz> References: <20240609150553.72865-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH 1/8] avdovi/dovi_rpudec: handle prev_vdr_rpu_id failures X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Niklas Haas Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, 09 Jun 2024 17:05:46 +0200 Niklas Haas wrote: > From: Niklas Haas > > 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 > Ping for review, otherwis will merge soon as it's a lot of relatively low-hanging fruit that fixes current deviations with the spec. _______________________________________________ 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".