[FFmpeg-devel] [PATCH 1/3] swscale: don't assign range converters for float

Chen, Wenbin wenbin.chen at intel.com
Tue Nov 14 04:27:28 EET 2023


> From: Niklas Haas <git at haasn.dev>
> 
> This logic was incongruent with logic used elsewhere, where floating
> point formats are explicitly exempted from range conversion. Fixes an
> issue where floating point formats were not going through special
> unscaled converters even when it was otherwise possible.
> ---
>  libswscale/swscale.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libswscale/swscale.c b/libswscale/swscale.c
> index 46ba68fe6a..a66db22767 100644
> --- a/libswscale/swscale.c
> +++ b/libswscale/swscale.c
> @@ -534,7 +534,8 @@ av_cold void ff_sws_init_range_convert(SwsContext
> *c)
>  {
>      c->lumConvertRange = NULL;
>      c->chrConvertRange = NULL;
> -    if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
> +    if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat) &&
> +        !isFloat(c->srcFormat) && !isFloat(c->dstFormat)) {
>          if (c->dstBpc <= 14) {
>              if (c->srcRange) {
>                  c->lumConvertRange = lumRangeFromJpeg_c;
> --
> 2.42.0
> 

This patchset works for me. Thanks for your quick fixing.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list