[FFmpeg-devel] [PATCH] bgr32 libswscale special convertor
Michael Niedermayer
michaelni
Mon Aug 10 14:39:47 CEST 2009
On Sun, Aug 09, 2009 at 10:09:13AM +0200, Peter Schlaile wrote:
> Hi,
>
> the following patch against today's GIT adds acceleration for the
> conversion paths
>
> YUV420 -> BGR32
> YUV420A -> BGR32
>
> to libswscale. (Those are needed by Blender's video sequence editor, since
> the internal image buffers are BGR32.)
>
> Cheers,
> Peter
>
> ----
> Peter Schlaile
> yuv2rgb_mmx.c | 10 ++++++
> yuv2rgb_template.c | 76 ++++++++++++++++++++++++++++++++++++++---------------
> 2 files changed, 65 insertions(+), 21 deletions(-)
> 91cd19aec9ebcc6b9c5f75b4656152d833bf0525 ffmpeg_swscale_bgr32_accel.diff
> diff --git a/x86/yuv2rgb_mmx.c b/x86/yuv2rgb_mmx.c
> index ced537f..3e708c4 100644
> --- a/x86/yuv2rgb_mmx.c
> +++ b/x86/yuv2rgb_mmx.c
> @@ -67,6 +67,11 @@ SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
> if (HAVE_7REGS) return yuva420_rgb32_MMX2;
> break;
> }else return yuv420_rgb32_MMX2;
> + case PIX_FMT_BGR32:
tabs are forbidden in svn
> + if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P){
> + if (HAVE_7REGS) return yuva420_bgr32_MMX2;
> + break;
> + }else return yuv420_bgr32_MMX2;
> case PIX_FMT_BGR24: return yuv420_rgb24_MMX2;
> case PIX_FMT_RGB565: return yuv420_rgb16_MMX2;
> case PIX_FMT_RGB555: return yuv420_rgb15_MMX2;
> @@ -79,6 +84,11 @@ SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
> if (HAVE_7REGS) return yuva420_rgb32_MMX;
> break;
> }else return yuv420_rgb32_MMX;
> + case PIX_FMT_BGR32:
> + if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P){
> + if (HAVE_7REGS) return yuva420_bgr32_MMX;
> + break;
> + }else return yuv420_bgr32_MMX;
> case PIX_FMT_BGR24: return yuv420_rgb24_MMX;
> case PIX_FMT_RGB565: return yuv420_rgb16_MMX;
> case PIX_FMT_RGB555: return yuv420_rgb15_MMX;
> diff --git a/x86/yuv2rgb_template.c b/x86/yuv2rgb_template.c
> index 798eff0..3b57aff 100644
> --- a/x86/yuv2rgb_template.c
> +++ b/x86/yuv2rgb_template.c
> @@ -408,37 +408,37 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr
> YUV2RGB_OPERANDS
> }
>
> -#define RGB_PLANAR2PACKED32 \
> +#define RGB_PLANAR2PACKED32(blue,red,green,alpha) \
document the arguments please
also green and alpha seem unneeded
[...]
> +static inline int RENAME(yuv420_bgr32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
> + int srcSliceH, uint8_t* dst[], int dstStride[]){
some of the args should be const
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090810/0013f0e7/attachment.pgp>
More information about the ffmpeg-devel
mailing list