blob: f3987916790e610c4d71bc0b8db69a3474d0e2c1 [file] [log] [blame]
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
2Date: Tue, 19 Jan 2021 20:35:29 +0100
3Subject: Fix build on powerpc and ppc64
4
Andrew Geissler517393d2023-01-13 08:55:19 -06005Upstream-Status: Inappropriate
6
7RPI-Distro repo clones original ffmpeg and applies patches to enable
8raspiberry pi support.
Andrew Geissler87f5cff2022-09-30 13:13:31 -05009
10---
11 libswscale/ppc/yuv2rgb_altivec.c | 10 ++++++++++
12 1 file changed, 10 insertions(+)
13
14diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
15index 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 Geissler517393d2023-01-13 08:55:19 -060021
Andrew Geissler87f5cff2022-09-30 13:13:31 -050022+#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, \