On Wed, May 13, 2015 at 01:46:51PM +0200, Luca Barbato wrote:
> --- a/libavcodec/ppc/pixblockdsp.c
> +++ b/libavcodec/ppc/pixblockdsp.c
> @@ -133,6 +133,40 @@ static void diff_pixels_altivec(int16_t *restrict block, 
> const uint8_t *s1,
>  
> +static void diff_pixels_vsx(int16_t *restrict block, const uint8_t *s1,
> +                            const uint8_t *s2, int stride)
> +{
> +    int i;
> +    vec_s16 shorts1, shorts2;
> +    for (i = 0; i < 8; i++) {
> +        shorts1 = vsx_ld_u8_s16(0, s1);
> +        shorts2 = vsx_ld_u8_s16(0, s2);
> +
> +        shorts1 = vec_sub(shorts1, shorts2);
> +
> +        vec_vsx_st(shorts1, 0, block);
> +
> +        s1    += stride;
> +        s2    += stride;
> +        block += 8;
> +    }
> +}

You could reduce the scope of shorts1 and shorts2 by moving the declarations
into the block.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to