From patchwork Tue Apr 9 12:57:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 47974 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9c8d:b0:1a7:a0dc:8de5 with SMTP id mj13csp332591pzb; Tue, 9 Apr 2024 06:00:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX3zDj49mFRB5MnPXyWDdt/8B0oxrVoJ06oVZB1GSnxDFchS45d/IBrH8hAnHX0MHST7gdn3A0MRZrAP+bgYSYWdW9fUD+IgMhyzg== X-Google-Smtp-Source: AGHT+IHvu8d0Mv00GwnIOqgahC1tQ42nOyM6B6UDFsQnQWkbNRqgoYWVE8qiG4jprC3xHpz7OWSJ X-Received: by 2002:a05:6512:2101:b0:513:cfb8:8cb3 with SMTP id q1-20020a056512210100b00513cfb88cb3mr6797711lfr.1.1712667606315; Tue, 09 Apr 2024 06:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712667606; cv=none; d=google.com; s=arc-20160816; b=hQH1ixZuwR8yerhfHMWuqN240CqBbvJvqk9ZQgBmFG7ErlmzI0wpxjWARb5LVpy6cx 8fZKIW7a5H5zl0IPcAlBDvWbqw9i+ZLqY76GGWM9GOuELqqlc4kHp4AU+xUD1iq7YMwY CSMUsWoPBlIj2WqYNXePphjcuTRxg1rawFPyXhKN44yO8zQJFLZ4zj2y8mszPRrz+w/1 RuFm4x5L/vNeBeUM2eRE/YJ8NwGPi27rOYlwgRDKq+KJTKRH8p4oWqeTvPJCrh339ZrG 5vPWDjFIFVv28vOQX/QPPOZlfiz2IZOp68dRewTMPJZpx/skMbyF9aGEB9Q2UMKe5ICJ XuUA== 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=EwmR47Yzu2TWBAIufKGL6iVR4ED040XE9w6ABZsoUL8=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=y9MDyRxtlrHMUEQVVWCAsV97y4Fcm/DUMHDTHMx6sCCUF25jf7pHSGOmrK7y31xaKr mPvXdogzq00MTe5oaP9wkJctGmzYCEbgCeR56S99bTKCt+muuE4zr+/QaVo40f84Ffzb qF386Ia//Vw9Kjm8k+t8yJn3q5UhJvQT2C/vT8QgaftXQpr1pTOngN+19jpuYW5022gW +JXxcCZ7tkQJqkIihsncDJXCHHudxDhsCaTwVcsKukG5I42mMHA9AVQrhCkX2setsjwv U12I2PcYDZi8c2836yJOBUoqkG+j/Y2x6FCE77PE+HmcKZTdYdOBfiZ69QiMkDMMu4vc BamQ==; 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=jmlFOEuF; 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 hv8-20020a17090760c800b00a51ab9a254dsi4475253ejc.201.2024.04.09.06.00.04; Tue, 09 Apr 2024 06:00:06 -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=jmlFOEuF; 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 D39DA68D171; Tue, 9 Apr 2024 15:59:26 +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 4720A68D07E for ; Tue, 9 Apr 2024 15:59:17 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1712667557; bh=7d78h44qfomf2wASovFHqpGHzlu1LfrAEiKMdkrspj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jmlFOEuFhTUOrEZ0EOCnPUIl0ACfhl6mihLCHOd3/HnW9CL8MiE7eR66J2lGzDd97 rspcH5OXV10HDEipjp7N8f5T3dLPaeNm5v3Q2tCEM7iDguUURnIuHvEPrmSZGslZy5 jhw7ftwHMwVAAzO8ArGBO/FKRF0yrxoOQJqmIcYw= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 0F55842500; Tue, 9 Apr 2024 14:59:17 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Tue, 9 Apr 2024 14:57:23 +0200 Message-ID: <20240409125914.61149-4-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240409125914.61149-1-ffmpeg@haasn.xyz> References: <20240409125914.61149-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 03/11] 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: L/DJA+eWOyKu 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 bfb7b9fe661..267e52ceb66 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);