aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/ppc
diff options
context:
space:
mode:
authorChip Kerchner <Chip.Kerchner@ibm.com>2020-10-09 20:17:20 -0400
committerAndriy Gelman <andriy.gelman@gmail.com>2021-02-22 23:19:21 -0500
commite7f53d6ac961011db6e97c255677a984b3c228fd (patch)
treeaa1ef3e4ee89120d04df8f799f5244e8c39ce0b3 /libswscale/ppc
parent7b30dad3a696cc5423218ba0c11a48b6009a121b (diff)
downloadffmpeg-e7f53d6ac961011db6e97c255677a984b3c228fd.tar.gz
lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments
Add inline function for vec_xl if VSX is not supported. vec_xl intrinsic is only available on POWER 7 or higher. Fixes ticket #8750. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Diffstat (limited to 'libswscale/ppc')
-rw-r--r--libswscale/ppc/yuv2rgb_altivec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 4f5382e4c1..5e1033a973 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,6 +284,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, \