# HG changeset patch # User alex # Date 1163533691 0 # Node ID 58412faefb46a6bc313e4631f49d1330346f1ce5 # Parent 214d3d9b69dcb0eb1b2b1f4240e7ebe07aa56b0d changed rgba32_to routines to support both alpha and non-alpha formats diff -r 214d3d9b69dc -r 58412faefb46 imgconvert_template.h --- a/imgconvert_template.h Tue Nov 14 19:19:13 2006 +0000 +++ b/imgconvert_template.h Tue Nov 14 19:48:11 2006 +0000 @@ -410,7 +410,8 @@ } } -#if !defined(FMT_RGBA32) && defined(RGBA_OUT) +// RGB24 has optimised routines +#if !defined(FMT_RGBA32) && !defined(FMT_RGB24) /* alpha support */ static void glue(rgba32_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src, @@ -419,7 +420,10 @@ const uint8_t *s; uint8_t *d; int src_wrap, dst_wrap, j, y; - unsigned int v, r, g, b, a; + unsigned int v, r, g, b; +#ifdef RGBA_OUT + unsigned int a; +#endif s = src->data[0]; src_wrap = src->linesize[0] - width * 4; @@ -430,11 +434,15 @@ for(y=0;y> 24) & 0xff; r = (v >> 16) & 0xff; g = (v >> 8) & 0xff; b = v & 0xff; +#ifdef RGBA_OUT + a = (v >> 24) & 0xff; RGBA_OUT(d, r, g, b, a); +#else + RGB_OUT(d, r, g, b); +#endif s += 4; d += BPP; } @@ -449,7 +457,10 @@ const uint8_t *s; uint8_t *d; int src_wrap, dst_wrap, j, y; - unsigned int r, g, b, a; + unsigned int r, g, b; +#ifdef RGBA_IN + unsigned int a; +#endif s = src->data[0]; src_wrap = src->linesize[0] - width * BPP; @@ -459,8 +470,13 @@ for(y=0;y