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

Michael Niedermayer michaelni
Mon Jul 16 23:16:12 CEST 2007


Hi

On Mon, Jul 16, 2007 at 09:45:51PM +0200, Balatoni Denes wrote:
> Hi!
> 
> Here are some VIS optimized yuv420p/422P to rgb32 conversion routines. Sorry, 
> only this much has been done, but other formats (411, 444 etc.) can be added 
> easily. Adding rgb24 however is quite complicated (and slow) in VIS I - 
> that's why I didn't do it. 
> 
> These are actually not too useful, because if one has to use software 
> colorspace conversion / scaling for playback, it likely will be slow no 
> matter if it's in assembly of visual basic. The real solution is to have a 
> hardware overlay driver - xine has them, and I will send at least one vo 
> driver (sun xvr100(=radeon 7000) is almost ready) ported from xine to 
> mplayer.

[...]
> +
> +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
> +};

DECLARE_ALIGNED()
and please dont duplicate yuv-rgb tables rather build them from the exitsing
tables at runtime so that if a new entry is added to the existing table we
dont have to go hunting in the arch specific code ...


> +
> +#define YUV2RGB_INIT \
> +     "wr %%g0, 0x10, %%gsr \n\t" \
> +     "ldd [%5], %%f32      \n\t" \
> +     "ldd [%5+8], %%f34    \n\t" \
> +     "ldd [%5+16], %%f36   \n\t" \
> +     "ldd [%5+24], %%f38   \n\t" \
> +     "ldd [%5+32], %%f40   \n\t" \
> +     "ldd [%5+40], %%f42   \n\t" \
> +     "ldd [%5+48], %%f44   \n\t" \
> +     "ldd [%5+56], %%f46   \n\t" \
> +     "ldd [%5+64], %%f48   \n\t" \
> +     "ldd [%5+72], %%f50   \n\t"
> +
> +#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" \

what about vertical align like:

"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" \

?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070716/c01bb38d/attachment.pgp>



More information about the ffmpeg-devel mailing list