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

Diego Biurrun diego
Mon Jul 16 23:51:46 CEST 2007


On Mon, Jul 16, 2007 at 11:55:09PM +0200, Balatoni Denes wrote:
> 
> Monday 16 July 2007 23:11-kor Diego Biurrun ezt ?rta:
> > >
> > > --- 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.
> 
> Well, it was, than you said indent it by four. So it is, and I won't change it 
> now :|

I did not mean to say that it should be left-aligned, just that FFmpeg
uses 4 space indentation as a base from which you can right-align where
it makes sense.  Is that better?

> > > +#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.
> 
> I will not, this way it can be later deinterleaved, when it has been proven 
> that the interleaved version is not faster (which I am afraid is the case, 
> btw).

What do you mean by "deinterleave"?  I have no idea in which way it
could be related to code formatting?

Diego




More information about the ffmpeg-devel mailing list