From b9145fcab27da9e14c6929036d771afd1907a771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 8 Oct 2024 09:27:17 +0300 Subject: [PATCH] swscale: Fix aarch64 and i386 compilation failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This unbreaks builds after c1a0e657638f7007dcc807a2d985c22631fcd6d3, which broke with errors like src/libswscale/aarch64/rgb2rgb.c:66:25: error: incompatible function pointer types assigning to 'void (*)(const uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int, int, int, int, const int32_t *)' (aka 'void (*)(const unsigned char *, unsigned char *, unsigned char *, unsigned char *, int, int, int, int, int, const int *)') from 'void (const uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int, int, int, int, int32_t *)' (aka 'void (const unsigned char *, unsigned char *, unsigned char *, unsigned char *, int, int, int, int, int, int *)') [-Wincompatible-function-pointer-types] 66 | ff_rgb24toyv12 = rgb24toyv12; | ^ ~~~~~~~~~~~ and src/libswscale/aarch64/swscale_unscaled.c:213:29: error: incompatible function pointer types assigning to 'SwsFunc' (aka 'int (*)(struct SwsContext *, const unsigned char *const *, const int *, int, int, unsigned char *const *, const int *)') from 'int (SwsContext *, const uint8_t *const *, const int *, int, int, const uint8_t **, const int *)' (aka 'int (struct SwsContext *, const unsigned char *const *, const int *, int, int, const unsigned char **, const int *)') [-Wincompatible-function-pointer-types] 213 | c->convert_unscaled = nv24_to_yuv420p_neon_wrapper; | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Martin Storsjö --- libswscale/aarch64/rgb2rgb.c | 4 ++-- libswscale/aarch64/swscale_unscaled.c | 2 +- libswscale/x86/rgb2rgb.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/aarch64/rgb2rgb.c b/libswscale/aarch64/rgb2rgb.c index 20a25033cb..401c7d09c1 100644 --- a/libswscale/aarch64/rgb2rgb.c +++ b/libswscale/aarch64/rgb2rgb.c @@ -30,11 +30,11 @@ // Only handle width aligned to 16 void ff_rgb24toyv12_neon(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, - int chromStride, int srcStride, int32_t *rgb2yuv); + int chromStride, int srcStride, const int32_t *rgb2yuv); static void rgb24toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, - int chromStride, int srcStride, int32_t *rgb2yuv) + int chromStride, int srcStride, const int32_t *rgb2yuv) { int width_align = width & (~15); diff --git a/libswscale/aarch64/swscale_unscaled.c b/libswscale/aarch64/swscale_unscaled.c index 294411a726..a7db4c033d 100644 --- a/libswscale/aarch64/swscale_unscaled.c +++ b/libswscale/aarch64/swscale_unscaled.c @@ -150,7 +150,7 @@ void ff_nv24_to_yuv420p_chroma_neon(uint8_t *dst1, int dstStride1, static int nv24_to_yuv420p_neon_wrapper(SwsContext *c, const uint8_t *const src[], const int srcStride[], int srcSliceY, int srcSliceH, - const uint8_t *dst[], const int dstStride[]) + uint8_t *const dst[], const int dstStride[]) { uint8_t *dst1 = dst[1] + dstStride[1] * srcSliceY / 2; uint8_t *dst2 = dst[2] + dstStride[2] * srcSliceY / 2; diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index 4943023342..456bbc7898 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -1484,7 +1484,7 @@ static inline void planar2x_mmxext(const uint8_t *src, uint8_t *dst, int srcWidt static inline void rgb24toyv12_mmxext(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride, - int32_t *rgb2yuv) + const int32_t *rgb2yuv) { #define BGR2Y_IDX "16*4+16*32" #define BGR2U_IDX "16*4+16*33"