From patchwork Fri Oct 27 17:04:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44385 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a17:907:11d0:b0:9b2:d3d7:e340 with SMTP id va16csp2293ejb; Fri, 27 Oct 2023 10:06:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUCkE8FkFTAH1i0RW9kqgfzo3Jqe/AC9Q6vz58yWI73ygg4zaJojhSAcBSe8At/bvdb8QG X-Received: by 2002:a17:907:6d23:b0:9ae:6648:9b53 with SMTP id sa35-20020a1709076d2300b009ae66489b53mr5896235ejc.23.1698426355211; Fri, 27 Oct 2023 10:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698426355; cv=none; d=google.com; s=arc-20160816; b=OnqDId9+vybu8PQk3zfFpR2EveYDoBRqfjrI9jfVVfQ6wtOleOi6e80/lVl/saDyVM tjvUrAUOkQqY8cMnYNWjALGE/t/G0XWtbTzKioiNCVxkIcVih9JXPK8iZBaMTT57uP5Q 53HIo07k7ELjRqQ0fIpaD6qKOrSXtmwbfZz12Pzjk/rzblhM91c9Wlj/rzNYI4xRPzJW EkBmzzY8kCgdOMys2NP+uZHCpv9ofKUGEjkcEEv06O4n6JOM31ChQqNThFqJ76j6DMTZ R0GlisPB7XIYEieLmoykQeHSXj6CT7O4Lq/WL0tINDoziRPbBdPK+vaxlwE4wy0Qthlx hX4A== 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=84Jl48RSFWLu0ymOH+bTAIpzwiBv52NiuoTe3tmVrTA=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=fo3NelK29rH9+EOQt0GksQVDvYyQun00aJltUD6xIWi2jR0I+eEO29xDT51bZXnHfH gxAu/Rgvqd0OJjaPOuXkoJL69T1GQgOceBDQIxm4DTVCxukTsBI74MFDwRNv5gwwTmPp ZGZQsScOgeDgGH4SmqmV8Y3Uy+Se3ghlBXVEXEPsHzYwUeqSLjYPztrOYGQs874oU+QT 6Yiu2UfQ5gP5p2PT0JUz5Nvl/m9dNHGtNAjyCcbCK+js1o6KWiy4PLpdhEvuNeJdDX4M 60cjQwm+1jQUlZD92TGzya8C6WEq9lyq08bF3h/5yxYrfiZ9mLXQWhCtrrMIDThXQLxq aUgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=CTs4Rvif; 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 bv3-20020a170907934300b009a9cd0f5710si924744ejc.977.2023.10.27.10.05.25; Fri, 27 Oct 2023 10:05:55 -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=CTs4Rvif; 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 D10A268CBC8; Fri, 27 Oct 2023 20:04:59 +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 A6CFE68C9DD for ; Fri, 27 Oct 2023 20:04:50 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 66BBF4B967; Fri, 27 Oct 2023 19:04:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698426290; bh=B9p++V8xgR4IZGExURg6x6U8Z8l1VUaZe4053TNHuSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CTs4RvifHoNxk6RSr6yNTaZAhfcVAYVuYhQ6QEKcMfDGqafEe5/EEX8tcjFNk8f9V EB1CW+aO7pvoMhj4IOyFR/NI1AMXJrS524LLDeNv+4QTUCjH274nvGm3nl7e/Y18Ji TPYC6Qu3X488z5WizLVXznm4Z2sXW46Zm427MHlk= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Oct 2023 19:04:41 +0200 Message-ID: <20231027170446.63684-3-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231027170446.63684-1-ffmpeg@haasn.xyz> References: <20231027170446.63684-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/8] avfilter/vf_alphamerge: warn if input not full range 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: 2zr2ly8ulN1H From: Niklas Haas Alpha planes must always be full range, so complain loudly if fed limited range grayscale input. --- libavfilter/vf_alphamerge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c index 4bbc06da36..b814aa64f0 100644 --- a/libavfilter/vf_alphamerge.c +++ b/libavfilter/vf_alphamerge.c @@ -60,6 +60,12 @@ static int do_alphamerge(FFFrameSync *fs) if (!alpha_buf) return ff_filter_frame(ctx->outputs[0], main_buf); + if (alpha_buf->color_range == AVCOL_RANGE_MPEG) { + av_log(ctx, AV_LOG_WARNING, "alpha plane color range tagged as %s, " + "output will be wrong!", + av_color_range_name(alpha_buf->color_range)); + } + if (s->is_packed_rgb) { int x, y; uint8_t *pin, *pout;