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 4AED149BCC for ; Mon, 4 Mar 2024 13:23:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 514F368D48C; Mon, 4 Mar 2024 15:23:17 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 848E268D482 for ; Mon, 4 Mar 2024 15:23:10 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1709558590; bh=wUqtUOpI4+EEwZMGesEw2xI9WC6QE0OaybimPaKK/po=; h=Date:From:To:Subject:In-Reply-To:References:From; b=UCeHD4nooaSgdr9xSlG+CRGJzsfgpCbo8V1n7QA8N6nQjN4ISWqMrxJCyMEoblEGo vOJOCk7SaTQ/AlWXW/TOa3KOzkhpiwysnFw2sa4dRXLxYbZYvh5bcbZh7zflcUk83i FJktF+TDhQAmpN1Cmi/tkDs3x9L82D7Pq0d0lY0U= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 41D6A428D7 for ; Mon, 4 Mar 2024 14:23:10 +0100 (CET) Date: Mon, 4 Mar 2024 14:23:10 +0100 Message-ID: <20240304142310.GB74150@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: References: <20240225114451.27645-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH 1/3] avcodec/dovi_rpu: implement support for profile 10 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 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 Mon, 04 Mar 2024 14:06:51 +0100 Andreas Rheinhardt wrote: > Niklas Haas: > > From: Niklas Haas > > > > Instead of the nal_prefix, this profile inside wraps the RPU inside an > > EMDF header, as specified in ETSI TS 102 366. This particular usage is > > supposedly specified in ETSI TS 103 572, at least according to European > > Patent EP 3 588 964 A1, but I could not find any references to DV RPUs > > in the former. > > > > It's worth pointing out that the EMDF container is not byte-aligned, > > meaning that payloads are delivered at arbitrary byte boundaries. Hence > > the reason for doing it inside ff_dovi_rpu_parse, which already uses > > a bitstream reader, rather than splitting off the container in > > a separate stage. (Plus, we hard-code the DV-specific payload ID) > > > > Magic values were taken from a combination of the sources below, all of > > which agree about what the specific EMDF header should look like. In > > fact, they all hard-code a very *specific* header sequence, but I wanted > > to go the extra mile and at least properly skip the variable fields > > - even though the non-existent Dolby Vision specification probably > > specifies that they all must be 0. This is probably overkill. > > > > Validated and tested using sample files from the merge request linked > > below. > > > > Relevant links: > > - https://www.etsi.org/deliver/etsi_ts/102300_102399/102366/01.04.01_60/ts_102366v010401p.pdf > > - https://patentimages.storage.googleapis.com/8a/0b/da/28294acaed2182/EP3588964A1.pdf > > - https://www.etsi.org/deliver/etsi_ts/103500_103599/103572/01.03.01_60/ts_103572v010301p.pdf > > - https://github.com/rockchip-linux/mpp/blob/fdeb8c378b79d4b4ef80457e4431815de89dc417/mpp/codec/dec/av1/av1d_cbs.c#L2378 > > - https://github.com/elginsk8r/android_kernel_amlogic_linux-4.9/blob/23a4c38bf06ef34821e476a8edddbf9213712c8a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c#L5638 > > - https://gitlab.com/mbunkus/mkvtoolnix/-/merge_requests/2254 > > --- > > libavcodec/dovi_rpu.c | 68 +++++++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 65 insertions(+), 3 deletions(-) > > > > diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c > > index a6b23f4dd11..c7cdd65a2f2 100644 > > --- a/libavcodec/dovi_rpu.c > > +++ b/libavcodec/dovi_rpu.c > > @@ -174,6 +174,18 @@ static inline int64_t get_se_coef(GetBitContext *gb, const AVDOVIRpuDataHeader * > > return 0; /* unreachable */ > > } > > > > +static inline unsigned get_variable_bits(GetBitContext *gb, int n) > > +{ > > + unsigned int value = get_bits(gb, n); > > + int read_more = get_bits1(gb); > > + while (read_more) { > > + value = (value + 1) << n; > > + value += get_bits(gb, n); > > Using |= is more appropriate. > > > + read_more = get_bits1(gb); > > + }; > > The ';' is a null statement. Fixed both, thanks. _______________________________________________ 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".