diff mbox series

[FFmpeg-devel] Ticket #8750 Add inline function for the vec_xl intrinsic in non-VSX environments

Message ID OF3956EA65.6FB918F0-ON0025859D.0045C8DE-0025859D.0045D2DD@notes.na.collabserv.com
State New
Headers show
Series [FFmpeg-devel] Ticket #8750 Add inline function for the vec_xl intrinsic in non-VSX environments
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate warning Make fate failed

Commit Message

Chip Kerchner July 6, 2020, 12:42 p.m. UTC

diff mbox series

Patch

diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 536545293d..930ef6b98f 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,     \