[FFmpeg-devel] [PATCH] libavfilter: vf_scale: Properly take in->color_range into account

Diederick C. Niehorster dcnieho at gmail.com
Thu Mar 3 14:08:39 EET 2022


On Thu, Mar 3, 2022 at 1:07 PM Martin Storsjö <martin at martin.st> 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ö <martin at martin.st>
> ---
>

Tested by me to resolve https://trac.ffmpeg.org/ticket/9576.

Thanks Martin!

All the best,
Dee


More information about the ffmpeg-devel mailing list