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 237BD40B08 for ; Sun, 6 Mar 2022 22:47:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D165D68B0C3; Mon, 7 Mar 2022 00:47:37 +0200 (EET) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6F91868AAC1 for ; Mon, 7 Mar 2022 00:47:31 +0200 (EET) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 226MlUVa013885-226MlUVb013885 for ; Mon, 7 Mar 2022 00:47:30 +0200 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id B542CA142C for ; Mon, 7 Mar 2022 00:47:30 +0200 (EET) Date: Mon, 7 Mar 2022 00:47:30 +0200 (EET) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: <20220305230848.GI2829255@pb2> Message-ID: <53f6d459-cbb4-82ee-62cd-676fbfe15af7@martin.st> References: <20220303120645.13076-1-martin@martin.st> <20220304200900.GF2829255@pb2> <20220305230848.GI2829255@pb2> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] libavfilter: vf_scale: Properly take in->color_range into account 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, 6 Mar 2022, Michael Niedermayer wrote: > On Sat, Mar 05, 2022 at 11:33:15PM +0200, Martin Storsj=F6 wrote: >> On Fri, 4 Mar 2022, Michael Niedermayer wrote: >> >>> On Thu, Mar 03, 2022 at 02:06:45PM +0200, Martin Storsj=F6 wrote: >>>> While swscale can be reconfigured with sws_setColorspaceDetails, >>>> the in/out ranges also need to be set before calling >>>> sws_init_context, otherwise the initialization might choose >>>> fastpaths that don't take the ranges into account. >>>> >>>> Therefore, look at in->color_range too, when deciding on whether >>>> the scaler needs to be reconfigured. >>>> >>>> Add a new member variable for keeping track of this, for being >>>> able to differentiate between whether the scale filter parameter >>>> "in_range" has been set (which should override whatever the input >>>> frame has set) or whether it has been configured based on the >>>> latest frame (which should trigger reconfiguring the scaler if >>>> the input frame ranges change). >>>> >>>> Signed-off-by: Martin Storsj=F6 >>>> --- >>>> To test this (without risking running many conflicting swscale >>>> filters in one filter pipeline), we'd need to be able to tag >>>> the incoming raw yuv data with colorspace and range without setting >>>> the in_color_matrix and in_range options on the scale filter. >>>> >>>> When using the rawvideo demuxer, the pixel format is set via the >>>> ffmpeg -pix_fmt option, but there's no corresponding option for >>>> setting color matrix or range for it. >>>> --- >>>> libavfilter/vf_scale.c | 13 +++++++++++++ >>>> 1 file changed, 13 insertions(+) >>> >>> This changes the output for: >>> ffmpeg -i tickets/524/AVCI50.mov -vframes 3 file-avci50dec.nut >>> ffmpeg -i tickets/4493/AVCI100.mov -vframes 3 file-avci100dec.nut >>> >>> https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket524/ >>> >>> Is that intended ? >>> >>> - 233903 file-avci100dec.nut >>> - 383853 file-avci50dec.nut >>> + 196558 file-avci100dec.nut >>> + 333893 file-avci50dec.nut >> >> Looks like these source files have full range content; for any data with >> full range input, this patch makes sure it uses the right intended >> conversion through swscale. So yes, I guess it's expected that these >> conversions change. > > patch ok then Pushed, thanks. // Martin _______________________________________________ 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".