From patchwork Tue Jun 18 19:35:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 50004 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9196:0:b0:460:55fa:d5ed with SMTP id s22csp2780035vqg; Tue, 18 Jun 2024 12:42:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU6xayfuWz1a9V75mmnpGS49Y24+p/9/Bgh/MNwYy1EpmTtg7Yca9wn40yUTrp3xhPEydj7iZbCwbRJ+8/t8669WSe4RcLr3ARWng== X-Google-Smtp-Source: AGHT+IEEg78oua+on3Y1Yo8grO6DtrB0hJM1+gFsCbYpBXSi7wb4nGqJJB32CfKQbtr5undj6WgX X-Received: by 2002:a50:c318:0:b0:57c:fd20:3531 with SMTP id 4fb4d7f45d1cf-57d07ed45e8mr252011a12.31.1718739765791; Tue, 18 Jun 2024 12:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718739765; cv=none; d=google.com; s=arc-20160816; b=pRtjTpwFwEq0dSiyZvZJeGyHajVp/0JjMToGw/beQkIWjx91Ch+qcRR1wKIilqWxce YCsTCQiFdz4oje6ZysFs6yCaP9/pfPGRfs+L7T7Um6xHRpXAbFVOfQNTnOPnouUOhYlW fjZvxg5X7JFNLYn2h0W/J7bI9Fc3MMPFQxgAZrqhuNcbG2ZygfasUo8aUwX3ZlU+MQef 15OWjf3muHSVwBo/fk+UeWBRPywFzJayXVAR9KKuvRtTBB8G7U5LoquEBtaL93JLAcGD zxxyyM/93Tz3Q+F54lsTPtGKlfOa5WAAx65IPDdaEwqxzKxU4tMZRSDhFkesWwZtfAgz d1rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=gVGpbJMiM7y1Pfda3CrD22e4d4ZoPIPgfPA6pKzxcUc=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=DiUThvymUknhnzHBxi/8SOsofAHbGVCQvVuhs3mfknGJcch1SJU/WR/8PrSbWMVmTh 28GBWzGY/XoTEqTTX1yD0ele8R5ZPjwy9wYKjpbDSGU/iP0g6gTHaiOteCxCTvIsMd8a GminkgXJUdKyH/H6oRMk0eV7/an9Bq3t0LWPL06lk2c4B456UApkLhFIrMN+Zlxe0kx6 qW6CcrLgz3eXFkLhntxLhWE0u6MDIVsMSnM/028LSfFnnkHK+ZD8wxQKzmF5K1upiuXW N4aFCFteNb+xUs/IhdEq+0jpz/IarxqlPijsK1qsqzYd3qEdyop3MGojkJd7LGw/UkGS j/+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=gJbe5piV; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-57cb72d622dsi5826615a12.30.2024.06.18.12.42.45; Tue, 18 Jun 2024 12:42:45 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=gJbe5piV; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 832A768D70E; Tue, 18 Jun 2024 22:42:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D185668D42E for ; Tue, 18 Jun 2024 22:42:23 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1718739743; bh=U1of1TbLrtAR2Iuzi1lIdodfRtko6M29SjYyNwZdp9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gJbe5piVXS8Nk2ssmOdDozRyJTZ4OfAa0mfeAFLVXdZSSesYZMDxYeMRvxbyA/Yfp v1ZhSUqgS7sNvnBBUb8rdQt4coaqN2oIcluvm4H5t0ZVApBkVI1y4ysgWxQ5bVJmWS fqo2mdEBjiP/oc6zgj1y7GNiamVAxCXYDo3f9pC8= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 8A4E44197E; Tue, 18 Jun 2024 21:42:23 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Tue, 18 Jun 2024 21:35:31 +0200 Message-ID: <20240618194221.26073-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240618194221.26073-1-ffmpeg@haasn.xyz> References: <20240618194221.26073-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/8] avcodec/dovi_rpudec: clarify semantics 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9X4jtkGcmquH From: Niklas Haas ff_dovi_rpu_parse() and ff_dovi_rpu_generate() are a bit inconsistent in that they expect different levels of encapsulation, due to the nature of how this is handled in the context of different APIs. Clarify the status quo. (And fix an incorrect reference to the RPU payload bytes as 'RBSP') --- libavcodec/dovi_rpu.h | 5 +++-- libavcodec/dovi_rpudec.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/dovi_rpu.h b/libavcodec/dovi_rpu.h index bfb118d6b5..205d16ffbc 100644 --- a/libavcodec/dovi_rpu.h +++ b/libavcodec/dovi_rpu.h @@ -95,8 +95,9 @@ void ff_dovi_ctx_unref(DOVIContext *s); void ff_dovi_ctx_flush(DOVIContext *s); /** - * Parse the contents of a Dovi RPU NAL and update the parsed values in the - * DOVIContext struct. + * Parse the contents of a Dolby Vision RPU and update the parsed values in the + * DOVIContext struct. This function should receive the decoded unit payload, + * without any T.35 or NAL unit headers. * * Returns 0 or an error code. * diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c index cae4dc4c3c..b34c3116b7 100644 --- a/libavcodec/dovi_rpudec.c +++ b/libavcodec/dovi_rpudec.c @@ -360,7 +360,7 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, emdf_protection = get_bits(gb, 5 + 12); VALIDATE(emdf_protection, 0x400, 0x400); } else { - /* NAL RBSP with prefix and trailing zeroes */ + /* NAL unit with prefix and trailing zeroes */ VALIDATE(rpu[0], 25, 25); /* NAL prefix */ rpu++; rpu_size--;