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

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Jan 24 23:08:26 EET 2021


Am Sa., 10. Okt. 2020 um 02:44 Uhr schrieb Andriy Gelman
<andriy.gelman at gmail.com>:
>
> From: Chip Kerchner <Chip.Kerchner at ibm.com>
>
> ---
>  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 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 */

Is there a speed impact if this function is used?

Carl Eugen


More information about the ffmpeg-devel mailing list