Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 1 | From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> |
| 2 | Date: Tue, 19 Jan 2021 20:35:29 +0100 |
| 3 | Subject: Fix build on powerpc and ppc64 |
| 4 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 5 | Upstream-Status: Inappropriate |
| 6 | |
| 7 | RPI-Distro repo clones original ffmpeg and applies patches to enable |
| 8 | raspiberry pi support. |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 9 | |
| 10 | --- |
| 11 | libswscale/ppc/yuv2rgb_altivec.c | 10 ++++++++++ |
| 12 | 1 file changed, 10 insertions(+) |
| 13 | |
| 14 | diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c |
| 15 | index 5365452..930ef6b 100644 |
| 16 | --- a/libswscale/ppc/yuv2rgb_altivec.c |
| 17 | +++ b/libswscale/ppc/yuv2rgb_altivec.c |
| 18 | @@ -283,6 +283,16 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed short Y, |
| 19 | * ------------------------------------------------------------------------------ |
| 20 | */ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 21 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 22 | +#if !HAVE_VSX |
| 23 | +static inline vector unsigned char vec_xl(signed long long offset, const ubyte *addr) |
| 24 | +{ |
| 25 | + const vector unsigned char *v_addr = (const vector unsigned char *) (addr + offset); |
| 26 | + vector unsigned char align_perm = vec_lvsl(offset, addr); |
| 27 | + |
| 28 | + return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm); |
| 29 | +} |
| 30 | +#endif /* !HAVE_VSX */ |
| 31 | + |
| 32 | #define DEFCSP420_CVT(name, out_pixels) \ |
| 33 | static int altivec_ ## name(SwsContext *c, const unsigned char **in, \ |
| 34 | int *instrides, int srcSliceY, int srcSliceH, \ |