aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/rpidistro-ffmpeg/files/0002-Fix-build-on-powerpc-and-ppc64.patch
blob: f3987916790e610c4d71bc0b8db69a3474d0e2c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Tue, 19 Jan 2021 20:35:29 +0100
Subject: Fix build on powerpc and ppc64

Upstream-Status: Inappropriate

RPI-Distro repo clones original ffmpeg and applies patches to enable
raspiberry pi support.

---
 libswscale/ppc/yuv2rgb_altivec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5365452..930ef6b 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -283,6 +283,16 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed short Y,
  * ------------------------------------------------------------------------------
  */
 
+#if !HAVE_VSX
+static inline vector unsigned char vec_xl(signed long long offset, const ubyte *addr)
+{
+    const vector unsigned char *v_addr = (const vector unsigned char *) (addr + offset);
+    vector unsigned char align_perm = vec_lvsl(offset, addr);
+
+    return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
+}
+#endif /* !HAVE_VSX */
+
 #define DEFCSP420_CVT(name, out_pixels)                                       \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
                             int *instrides, int srcSliceY, int srcSliceH,     \