From patchwork Fri Apr 12 11:35:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 48021 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:670b:b0:1a9:af23:56c1 with SMTP id wh11csp202944pzb; Fri, 12 Apr 2024 04:37:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVt+TDb5+Cyv4ZRb5nvYepuSKwU91rB/izzFmvxCBaJUsMJntpoyC774H4mzm9ck4zXlPmNBc0JexcG9GNLPiJpSb2tXzrzxUgqjw== X-Google-Smtp-Source: AGHT+IHebTl7Rqd+8TsYlz9hVKVamDLr4eBpNbmS3DT5w5gIF1y/fzuAOfWavUrHaOVAsCn92362 X-Received: by 2002:ac2:58ec:0:b0:517:8a22:e32e with SMTP id v12-20020ac258ec000000b005178a22e32emr1165903lfo.1.1712921849300; Fri, 12 Apr 2024 04:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712921849; cv=none; d=google.com; s=arc-20160816; b=t8cUWdnmOMvbYvmAUB5uINSprVlNhNSNG2PN3DP1Mk4jzXx1euTBCySJru4NQ/CZHG 6fWFQUYJNfq8OypKWS+goxwZ/y2WLI3SymQLzU8prV3dGYua8NTCVaDferI5lRaH7+ZA I+bPvhkOO6siRRTg0kE2wjTPScWU5TkZb6smrnutEFKG5kjXMhbWpUWxq0OdDAf1u/2S BbGU2VENfB/mI71DyfaZ2kZmgQsQMFApp4c4cYVkgBbOAWnt13d2kJ8upHMcxpDJfvfd p/L0bKTtWToiax0x06eM7u5RsxwTd40On/r53Cpa07l4KA5m7LpLLhmRjy8EdXKdlJRx nTxg== 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=o2ZU1IAeu7vrQxlFjYB2IsxnkfGqT+ryRy0GYuW7yaA=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=p57ClNX7t3fWVeRRi9s/MunKUDpsVZviCxqrDRRHKCHbQJXH7lE3vUDR9XzWpp8NtT rpz0nFUZxV22j+MTrVmu/170zyAX6VA+bukoqkZxiL7rEOXHz4qFTgTR1a7c0ONhYVUL lUipUXZL+Eynps9/UWrsHeXpBT+xjZfRinNXbQAD8RaBl6ynFcsyOfEw7zY/HrOyi58Z nSQakqqazEWKGHbXXtpNqs2qIn88LUjSRBDWIB9GttkHtoYUylhEuNNVUb3Vd/zj+0s/ HNiSlK27w6V3iOd+AwHAcybWBNS6OEJUkc6/e3f0gXmw9m0f/jSGfRpi7TebPQdMOYkS 2CrQ==; 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=i5Qh3ilV; 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 v1-20020a05651203a100b005158e5d8dcbsi1015253lfp.313.2024.04.12.04.37.28; Fri, 12 Apr 2024 04:37:29 -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=i5Qh3ilV; 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 44AB968D29A; Fri, 12 Apr 2024 14:36:36 +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 CFCC768D222 for ; Fri, 12 Apr 2024 14:36:23 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1712921783; bh=PEn6CZGVhkrXT8gy51WOSvFjX15xYmUzk2qSzYIioCY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i5Qh3ilVjBpeiH3qQAViEh3roa/B34mkUYXMF9twpoYzEu/jqhR6vywvCOdai5yXS QMbKtv17BF/8eEOU2WKPvautx3I7VApHHoVXjJXOl0G0LLyVcOyIq5JSKrnkVpi6EK 3VhjtIAdKcGTaKB5DiBd+wBLztIw0F7hcCS/DRAQ= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 932A7429D1; Fri, 12 Apr 2024 13:36:23 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 12 Apr 2024 13:35:17 +0200 Message-ID: <20240412113620.84013-4-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240412113620.84013-1-ffmpeg@haasn.xyz> References: <20240412113620.84013-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 03/13] avcodec/dovi_rpu: clarify error on missing RPU VDR 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: OAkvNiZamPVu From: Niklas Haas The code was written under the misguided assumption that these fields would only be present when the value changes, however this does not match the actual patent specification, which says that streams are required to either always signal this metadata, or never signal it. That said, the specification does not really clarify what the defaults of these fields should be in the event that this metadata is missing, so without any sample file or other reference I don't wish to hazard a guess at how to interpret these fields. Fix the current behavior by making sure we always throw this error, even for files that have the vdr sequence info in one frame but are missing it in the next frame. --- libavcodec/dovi_rpu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index bfb7b9fe66..267e52ceb6 100644 --- a/libavcodec/dovi_rpu.c +++ b/libavcodec/dovi_rpu.c @@ -499,11 +499,11 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, hdr->el_spatial_resampling_filter_flag = get_bits1(gb); hdr->disable_residual_flag = get_bits1(gb); } - } - - if (!hdr->bl_bit_depth) { - av_log(s->logctx, AV_LOG_ERROR, "Missing RPU VDR sequence info?\n"); - goto fail; + } else { + /* lack of documentation/samples */ + avpriv_request_sample(s->logctx, "Missing RPU VDR sequence info\n"); + ff_dovi_ctx_unref(s); + return AVERROR_PATCHWELCOME; } vdr_dm_metadata_present = get_bits1(gb);