Package: effectv Version: 0.3.11-1 Severity: wishlist Tags: patch Effectv support a huge number of palettes : rgb24,rgb565,rgb555,yuv422,yuv422p,yuv420p,yuv411p,yuv410p,grey
But "uyvy" is not yet supported ... The patch has been proposed upstream without results ... See : http://sourceforge.net/forum/forum.php?thread_id=1829769&forum_id=66362 Here is the patch : ---8<------------------------------------------------------- diff -Nru effectv-0.3.11/effectv.1 effectv-0.3.11-guc/effectv.1 --- effectv-0.3.11/effectv.1 2006-02-14 11:25:42.000000000 +0100 +++ effectv-0.3.11-guc/effectv.1 2007-09-23 11:35:05.000000000 +0200 @@ -65,7 +65,7 @@ .I \-autoplay FRAMES Changes effects automatically every FRAMES. .TP -.I \-palette {rgb24,rgb565,rgb555,yuv422,yuv422p,yuv420p,yuv411p,yuv410p,grey} +.I \-palette {rgb24,rgb565,rgb555,yuv422,yuv422p,yuv420p,yuv411p,yuv410p,uyvy,grey} Set the palette of capturing device. It is detected automatically by default. .TP .I \-vloopback FILE diff -Nru effectv-0.3.11/palette.c effectv-0.3.11-guc/palette.c --- effectv-0.3.11/palette.c 2006-02-14 15:06:17.000000000 +0100 +++ effectv-0.3.11-guc/palette.c 2007-09-23 11:34:50.000000000 +0200 @@ -626,6 +626,63 @@ } } +static void convert_UYVYtoRGB32 +(unsigned char *src, RGB32 *dest, int width, int height) +{ + int i, length; + unsigned int gray; + unsigned int u, v; + unsigned char *p; + + length = width * height / 2; + p = (unsigned char *)dest; + for(i=0; i<length; i++) { + u = src[0]; + v = src[2]; + gray = YtoRGB[src[1]]; + p[0] = clip[CLIP + gray + UtoB[u]]; + p[1] = clip[CLIP + gray + UtoG[u] + VtoG[v]]; + p[2] = clip[CLIP + gray + VtoR[v]]; + gray = YtoRGB[src[3]]; + p[4] = clip[CLIP + gray + UtoB[u]]; + p[5] = clip[CLIP + gray + UtoG[u] + VtoG[v]]; + p[6] = clip[CLIP + gray + VtoR[v]]; + p += 8; + src += 4; + } +} + +static void convert_UYVYtoRGB32_hflip +(unsigned char *src, RGB32 *dest, int width, int height) +{ + int x, y; + unsigned int gray; + unsigned int u, v; + unsigned char *p; + + /* Images will be cluttered when 'width' is odd number. It is not so + * difficult to adjust it, but it makes conversion little slow.. */ + width &= 0xfffffffe; + p = (unsigned char *)(dest + width - 2); + for(y=0; y<height; y++) { + for(x=0; x<width; x+=2) { + u = src[0]; + v = src[2]; + gray = YtoRGB[src[1]]; + p[4] = clip[CLIP + gray + UtoB[u]]; + p[5] = clip[CLIP + gray + UtoG[u] + VtoG[v]]; + p[6] = clip[CLIP + gray + VtoR[v]]; + gray = YtoRGB[src[3]]; + p[0] = clip[CLIP + gray + UtoB[u]]; + p[1] = clip[CLIP + gray + UtoG[u] + VtoG[v]]; + p[2] = clip[CLIP + gray + VtoR[v]]; + p -= 8; + src += 4; + } + p += width * 8; + } +} + static const struct palette_converter_toRGB32_map converter_toRGB32_list[] = { {VIDEO_PALETTE_RGB24, convert_RGB24toRGB32, convert_RGB24toRGB32_hflip}, {VIDEO_PALETTE_RGB565, convert_RGB565toRGB32, convert_RGB565toRGB32_hflip}, @@ -635,6 +692,7 @@ {VIDEO_PALETTE_YUV420P, convert_YUV420PtoRGB32, convert_YUV420PtoRGB32_hflip}, {VIDEO_PALETTE_YUV411P, convert_YUV411PtoRGB32, convert_YUV411PtoRGB32_hflip}, {VIDEO_PALETTE_YUV410P, convert_YUV410PtoRGB32, convert_YUV410PtoRGB32_hflip}, + {VIDEO_PALETTE_UYVY , convert_UYVYtoRGB32, convert_UYVYtoRGB32_hflip}, {VIDEO_PALETTE_GREY , convert_GREYtoRGB32, convert_GREYtoRGB32_hflip}, {-1, NULL, NULL} }; @@ -879,6 +937,7 @@ {"yuv420p", VIDEO_PALETTE_YUV420P, "VIDEO_PALETTE_YUV420P"}, {"yuv411p", VIDEO_PALETTE_YUV411P, "VIDEO_PALETTE_YUV411P"}, {"yuv410p", VIDEO_PALETTE_YUV410P, "VIDEO_PALETTE_YUV410P"}, + {"uyvy", VIDEO_PALETTE_UYVY, "VIDEO_PALETTE_UYVY"}, {"grey", VIDEO_PALETTE_GREY, "VIDEO_PALETTE_GREY"}, {"", -1, ""} }; diff -Nru effectv-0.3.11/utils.c effectv-0.3.11-guc/utils.c --- effectv-0.3.11/utils.c 2006-02-14 15:06:17.000000000 +0100 +++ effectv-0.3.11-guc/utils.c 2007-09-23 11:26:18.000000000 +0200 @@ -26,7 +26,7 @@ /* * HSI color system utilities */ -static int trunc(double f) +static int HSItrunc(double f) { int i; @@ -44,9 +44,9 @@ Gv=1+S*sin(H); Bv=1+S*sin(H+2*M_PI/3); T=255.999*I/2; - *r=trunc(Rv*T); - *g=trunc(Gv*T); - *b=trunc(Bv*T); + *r=HSItrunc(Rv*T); + *g=HSItrunc(Gv*T); + *b=HSItrunc(Bv*T); } /* ---8<------------------------------------------------------- -- System Information: Debian Release: lenny/sid APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Kernel: Linux 2.6.22-3-486 Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages effectv depends on: ii libc6 2.7-3 GNU C Library: Shared libraries ii libsdl1.2debian 1.2.11-9 Simple DirectMedia Layer effectv recommends no packages. -- no debconf information