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 0BCF54ADBB for ; Tue, 21 May 2024 10:22:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5239168D30D; Tue, 21 May 2024 13:21:58 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 64A4468D2B3 for ; Tue, 21 May 2024 13:21:51 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1716286911; bh=fNeiKDVcQgHGJYmbrbvGllQTDmHNjO+wdw50PMnBrLQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cExKap276MUvaqFNAc9NoNneJZ3WLeMQ1Yx7OOpnI/JBtdYVYq1KZ24gHh95gAaqt 3tW4hgy2YoBrroDk/Tdu8MLGau7jR8uFnPhucYw2HVgtrsYRJplyBSPEcXV9nYG2yY kcFUwa5FYzyk0cWvy6PL/+eQ0tngROB93goo/gns= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 32E5A410B5; Tue, 21 May 2024 12:21:51 +0200 (CEST) Date: Tue, 21 May 2024 12:21:51 +0200 Message-ID: <20240521122151.GE10061@haasn.xyz> From: Niklas Haas To: Cosmin Stejerean via ffmpeg-devel , "ffmpeg-devel@ffmpeg.org" In-Reply-To: <0101018f98b99e17-5074658e-5904-4d46-8d6f-4a7f3630bdd4-000000@us-west-2.amazonses.com> References: <20240521011728.29347-1-cosmin@cosmin.at> <0101018f98b99e17-5074658e-5904-4d46-8d6f-4a7f3630bdd4-000000@us-west-2.amazonses.com> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH] avcodec/dovi_rpudec - correctly read el_bit_depth_minus8 when ext_mapping_idc is non-zero 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: Cosmin Stejerean 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 Tue, 21 May 2024 01:17:32 +0000 Cosmin Stejerean via ffmpeg-devel wrote: > From: Cosmin Stejerean > > It looks like the el_bitdepth_minus8 value in the header can also encode > ext_mapping_idc in the upper 8 bits. > > Samples having a non-zero ext_mapping_idc fail validation currently because the > value returned is out of range. This bypasses this by currently ignoring the > ext_mapping_idc and using only the lower 8 bits for el_bitdepth_minus8. What is ext_mapping_idc? If it's signalled data that can't be reconstructed, we need to store it somewhere into AVDOVIMetadata and then re-synthesize it during encoding. Otherwise the RPU transcode will be lossy. > > --- > libavcodec/dovi_rpudec.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c > index 7c7eda9d09..1b11ad3640 100644 > --- a/libavcodec/dovi_rpudec.c > +++ b/libavcodec/dovi_rpudec.c > @@ -411,7 +411,9 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, > > if ((hdr->rpu_format & 0x700) == 0) { > int bl_bit_depth_minus8 = get_ue_golomb_31(gb); > - int el_bit_depth_minus8 = get_ue_golomb_31(gb); > + // this can encode a two byte value, with higher byte being ext_mapping_idc > + // use only the lower byte for el_bit_depth_minus8 > + uint8_t el_bit_depth_minus8 = get_ue_golomb_long(gb) & 0xFF; > int vdr_bit_depth_minus8 = get_ue_golomb_31(gb); > VALIDATE(bl_bit_depth_minus8, 0, 8); > VALIDATE(el_bit_depth_minus8, 0, 8); > -- > 2.42.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". _______________________________________________ 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".