Browse Source

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>
tags/n4.4
Chip Kerchner Andriy Gelman 5 years ago
parent
commit
e7f53d6ac9
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      libswscale/ppc/yuv2rgb_altivec.c

+ 10
- 0
libswscale/ppc/yuv2rgb_altivec.c View File

@@ -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, \


Loading…
Cancel
Save