[FFmpeg-devel] [PATCH] UltraSPARC VIS yuv2rgb fourth try

Benoit Fouet benoit.fouet
Wed Jul 18 10:20:58 CEST 2007


Balatoni Denes wrote:
> diff -Naur libswscale.old/yuv2rgb_vis.c libswscale/yuv2rgb_vis.c
> --- libswscale.old/yuv2rgb_vis.c	1970-01-01 01:00:00.000000000 +0100
> +++ libswscale/yuv2rgb_vis.c	2007-07-17 20:29:32.000000000 +0200
> @@ -0,0 +1,206 @@
> +/*
> + * VIS optimized software YUV to RGB coverter
>   

converter

> + * Copyright (c) 2007 Denes Balatoni <dbalatoni at programozo.hu>
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include <inttypes.h>
> +#include <stdlib.h>
> +
> +#include "swscale.h"
> +
> +#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" \
> +    "fmul8x16 %%f3, %%f50, %%f2   \n\t" \
> +    "fmul8x16 %%f19, %%f50, %%f18 \n\t" \
> +    "fmul8x16 %%f5, %%f46, %%f4   \n\t" \
> +    "fmul8x16 %%f21, %%f46, %%f20 \n\t" \
> +    \
> +    "fpsub16  %%f6, %%f34, %%f6   \n\t" /* 1 */ \
> +    "fpsub16  %%f22, %%f34, %%f22 \n\t" /* 1 */ \
> +    "fpsub16  %%f8, %%f38, %%f8   \n\t" /* 3 */ \
> +    "fpsub16  %%f24, %%f38, %%f24 \n\t" /* 3 */ \
> +    "fpsub16  %%f0, %%f32, %%f0   \n\t" /* 0 */ \
> +    "fpsub16  %%f16, %%f32, %%f16 \n\t" /* 0 */ \
> +    "fpsub16  %%f2, %%f36, %%f2   \n\t" /* 2 */ \
> +    "fpsub16  %%f18, %%f36, %%f18 \n\t" /* 2 */ \
> +    "fpsub16  %%f4, %%f40, %%f4   \n\t" /* 4 */ \
> +    "fpsub16  %%f20, %%f40, %%f20 \n\t" /* 4 */ \
> +    \
> +    "fpadd16  %%f0, %%f8, %%f8    \n\t" /* Gt */ \
> +    "fpadd16  %%f16, %%f24, %%f24 \n\t" /* Gt */ \
> +    "fpadd16  %%f0, %%f4, %%f4    \n\t" /* R */ \
> +    "fpadd16  %%f16, %%f20, %%f20 \n\t" /* R */ \
> +    "fpadd16  %%f0, %%f6, %%f6    \n\t" /* B */ \
> +    "fpadd16  %%f16, %%f22, %%f22 \n\t" /* B */ \
> +    "fpadd16  %%f8, %%f2, %%f2    \n\t" /* G */ \
> +    "fpadd16  %%f24, %%f18, %%f18 \n\t" /* G */ \
> +    \
> +    "fpack16 %%f4, %%f4    \n\t" \
> +    "fpack16 %%f20, %%f20  \n\t" \
> +    "fpack16 %%f6, %%f6    \n\t" \
> +    "fpack16 %%f22, %%f22  \n\t" \
> +    "fpack16 %%f2, %%f2    \n\t" \
> +    "fpack16 %%f18, %%f18  \n\t"
> +
>   

maybe you could align it a bit more...

-- 
Ben
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-devel mailing list