[FFmpeg-devel] [PATCH] avutil/tx: use llrintf() to convert a float into a 64 bit integer

Martin Storsjö martin at martin.st
Tue Nov 8 19:21:44 EET 2022


On Tue, 8 Nov 2022, James Almer wrote:

> Should fix fate failures on Windowx x86 targets, where long is 32 bits.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> libavutil/tx_priv.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
> index 3195cb51b2..fb61119009 100644
> --- a/libavutil/tx_priv.h
> +++ b/libavutil/tx_priv.h
> @@ -124,7 +124,7 @@ typedef void TXComplex;
>     } while (0)
>
> #define UNSCALE(x) ((double)(x)/2147483648.0)
> -#define RESCALE(x) (av_clip64(lrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX))
> +#define RESCALE(x) (av_clip64(llrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX))

LGTM, thanks! This does seem to fix the test failures in my configs.

// Martin




More information about the ffmpeg-devel mailing list