[FFmpeg-devel] [PATCH] UltraSPARC VIS optimized yuv2rgb

Diego Biurrun diego
Mon Jul 16 23:11:50 CEST 2007


On Mon, Jul 16, 2007 at 10:18:35PM +0200, Balatoni Denes wrote:
> 
> Monday 16 July 2007 21:39-kor Diego Biurrun ezt ?rta:
> > The rules say 4 spaces, please change your code to use 4 space
> > indentation.
> 
> Okay, I have found the rule. This patch should be fine.
> 
> --- libswscale.old/yuv2rgb.c.orig	1970-01-01 01:00:00.000000000 +0100
> +++ libswscale/yuv2rgb.c.orig	2007-07-16 22:06:51.000000000 +0200

Huh?

> --- libswscale.old/yuv2rgb_vis.c	1970-01-01 01:00:00.000000000 +0100
> +++ libswscale/yuv2rgb_vis.c	2007-07-16 22:16:16.000000000 +0200
> @@ -0,0 +1,208 @@
> +
> +static short int  __attribute__((aligned(8))) sparc_coeffs[4*10]=
> +{
> +    596,  596,  596,  596, // 16*1.164*32
> +    8266, 8266, 8266, 8266, //128*2.018*32
> +    1602, 1602, 1602, 1602, //128*0.391*32
> +    3330, 3330, 3330, 3330, //128*0.813*32
> +    6537, 6537, 6537, 6537, //128*1.596*32
> +    9535, 9535, 9535, 9535, //1.164*32*256
> +    6660, 6660, 6660, 6660, //0.813*32*256
> +    13074,13074,13074,13074, //1.596*32*256
> +    16531,16531,16531,16531, //2.018*32*256
> +    3203, 3203, 3203, 3203, //0.391*32*256
> +};

This could be vertically aligned.

> +#define YUV2RGB_KERNEL \
> +    /* ^^^^ f0=Y f3=u f5=v */ \
> +    "fmul8x16 %%f3, %%f48, %%f6   \n\t" \
> +    "fmul8x16 %%f19, %%f48, %%f22 \n\t" \
> +    "fmul8x16 %%f5, %%f44, %%f8   \n\t" \
> +    "fmul8x16 %%f21, %%f44, %%f24 \n\t" \
> +    "fmul8x16 %%f0, %%f42, %%f0   \n\t" \
> +    "fmul8x16 %%f16, %%f42, %%f16 \n\t" \
> +    "fmul8x16 %%f3, %%f50, %%f2   \n\t" \
> +    "fmul8x16 %%f19, %%f50, %%f18 \n\t" \
> +    "fmul8x16 %%f5, %%f46, %%f4   \n\t" \
> +    "fmul8x16 %%f21, %%f46, %%f20 \n\t" \

You could align all the operands, this would make the code more
readable.

Diego




More information about the ffmpeg-devel mailing list