From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6809C400DF for ; Fri, 13 Oct 2023 14:27:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C14B68C945; Fri, 13 Oct 2023 17:27:18 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7234768BDD0 for ; Fri, 13 Oct 2023 17:27:10 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 348FE4B023; Fri, 13 Oct 2023 16:27:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1697207230; bh=gMjchaBAcqxnFhovlkXllMhXhYqt3dMXb76K5QjJuLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RatPzPcryuo78axSykpxnQ0oQx8FcWCD0DiEhG3mFpOT6WUjM+4NfULHKbGXGtW7x aQ6ae+C65IQHmljqgpKKrgtQ7IFZM8937iVyeXff/NB68bjgmZ4hr3kF50DUNX1O+w Tpr0vYIv8ZxoJm/0IwTED2iTM47BUQqZ6RMm3yFE= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 13 Oct 2023 16:24:39 +0200 Message-ID: <20231013142706.23971-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013142706.23971-1-ffmpeg@haasn.xyz> References: <20231013142706.23971-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 01/13] avfilter/vf_scale: don't change range by default 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Niklas Haas If we don't convert the pixel format, then we shouldn't touch the pixel range by default, either. Ensures full-range YUV input comes out as full-range YUV output, unless we go through a pixel format conversion. In theory, we may also want to extend this logic to YUV->YUV conversions, but a few special cases (YUVJ, Gray, RGB) make this more annoying than it needs to be, so I'll defer it to a future commit. --- libavfilter/vf_scale.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index b0221e8538..9bbf0f8ed5 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -863,6 +863,8 @@ scale: in_full = (in_range == AVCOL_RANGE_JPEG); if (scale->out_range != AVCOL_RANGE_UNSPECIFIED) out_full = (scale->out_range == AVCOL_RANGE_JPEG); + else if (in->format == out->format) + out_full = in_full; /* preserve pixel range by default */ sws_setColorspaceDetails(scale->sws, inv_table, in_full, table, out_full, -- 2.42.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".