From patchwork Mon Jun 24 17:20:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 50134 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:ae71:0:b0:482:c625:d099 with SMTP id w17csp2155353vqz; Mon, 24 Jun 2024 10:20:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUj4bBSYgKAHxSq7r52IrZsc8qhmUIbIki8MpReylxShn/fnzDa5bGv1Y2C9cSJH9sfcErQPqZRJStZYzDiybXznQjvlRZZxzIHGw== X-Google-Smtp-Source: AGHT+IFKfdDlJQ0mU/t4xHTJU5cSigdPyN8Jgjq/D9QXioEC3FLiQOY91uHkxmwcWXjWTnGz+VCY X-Received: by 2002:a50:9b54:0:b0:57c:5f22:f9c1 with SMTP id 4fb4d7f45d1cf-57d4bd80f7emr3055319a12.21.1719249659508; Mon, 24 Jun 2024 10:20:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719249659; cv=none; d=google.com; s=arc-20160816; b=h1BaDnM+CoWXB6M05K6mqbpkrYOn8zu5hO9OObP9Gx7Ps4QsTnHCui5kuutYCQjZlt 3LIkIbEIF9U3LlMNdOUdKQh0wF+hVQHlI08jh/te9ZhN5rj/QV6xjboupXZNaxLA4xbn ujJiwiHKOTMaEmgGLURQSA9Kt+8C3NO2TpRtDbbxgK857lppo8lTwwS3o7OJpsGi9XeP 2DEMqnfOwPDZJ1KFjKW+0m18rpWYWVKH/CvBnOCK7WYY+pWRbarprZP57s3TQ1yzGUa2 ObQa+GWob16QL9NFMqOAgnShJqgYMRO92aPhqjVVWb18nOLVtnAelSov2z0bfzKNAQRq LfSw== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=/sWOP9PmFIGfVLefyoml+tVDMbt5Rdv2ynUY88KXyII=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=yrQ6oAkphXst23NB8M4Dn7n708+zNvygt2xuatPkpdy3Pu7UCzABQrD5o0etS33r+m 69ymwzzuXIeZz3nrCYmVWIw8aZNFEFFEU822bZFiFcp3qEM4HsM+UeIyRlkf+JdFGty0 c4/g6w7kRGYBcfWZqp87cJEXy8q9Ixi040r1pZedvyXgzfwwXbTZeJREBPNZtottrJDO U7QBUEeTzTMgyL7fGd1IHkjDVcJPJn8fZ1pUFi42DQ4SAM5bB8rPoXoy1SxHb6905c45 bKzs+hfZJbWZmkHgZtMSrY6aUrwaActoAcOP7EUwaT2ZQqDO85zKxAr3UrjjjHUJv2Ra CvQQ==; 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=aSWZZ6Ed; 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-57d306c6861si3757979a12.381.2024.06.24.10.20.59; Mon, 24 Jun 2024 10:20:59 -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=aSWZZ6Ed; 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 9C95068D4CF; Mon, 24 Jun 2024 20:20:56 +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 1F25868C0DC for ; Mon, 24 Jun 2024 20:20:48 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1719249647; bh=bjbKLqsS/OkOVZ2AIrHi6YPDKUQ/v37jWtrz/Npth5U=; h=From:To:Cc:Subject:Date:From; b=aSWZZ6EdCxZDISoPmwTNh3Af7QJNuIj1y4iudsyQfgkVkhuARTHv4XAZC5caJ/+a7 LTEhHvpDUJWK7KgrKXHKHuqjzZtZ0XXFeWAln1iHJ3wBwvrttZvMosXUMGBWALLiaH E4F5Q/THjO3QDLMgQW/Rr+Q4a/26fOuCmbwityJQ= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id D4D5240675; Mon, 24 Jun 2024 19:20:47 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Jun 2024 19:20:36 +0200 Message-ID: <20240624172044.101722-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/9] 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: uwJ6aEGBGrni 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 c025800206..375e6e560b 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--;