diff options
author | David Schleef <ds@schleef.org> | 2004-01-15 08:58:22 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2004-01-15 08:58:22 +0000 |
commit | 4910efb9b7baced502f3f78cf54ba580603d4415 (patch) | |
tree | 7c0ca8f3bca493926990f9f12b97970b3294051d /ext/hermes/rgb2yuv.c | |
parent | 4506b4c38b4a74556e1134b2989334a118dcb3ca (diff) | |
download | gst-plugins-bad-4910efb9b7baced502f3f78cf54ba580603d4415.tar.gz gst-plugins-bad-4910efb9b7baced502f3f78cf54ba580603d4415.tar.bz2 gst-plugins-bad-4910efb9b7baced502f3f78cf54ba580603d4415.zip |
Duplicate the ext/hermes colorspace plugin, and remove Hermes code and GPL code. Fix for new caps negotiation. Rewr...
Original commit message from CVS:
* configure.ac:
* gst/colorspace/Makefile.am:
* gst/colorspace/gstcolorspace.c:
* gst/colorspace/gstcolorspace.h:
* gst/colorspace/yuv2rgb.c:
* gst/colorspace/yuv2rgb.h:
Duplicate the ext/hermes colorspace plugin, and remove Hermes
code and GPL code. Fix for new caps negotiation. Rewrite
much of the format handling code, and some of the conversion
code. Basically, rewrote almost everything. This element
handles I420, YV12 to RGB conversions.
* ext/hermes/Makefile.am:
* ext/hermes/gsthermescolorspace.c:
Rename colorspace to hermescolorspace. Fix negotiation issues.
Remove non-Hermes related code. This element handles lots of
RGB to RGB conversions, but no YUV.
* ext/hermes/gstcolorspace.c:
* ext/hermes/gstcolorspace.h:
* ext/hermes/rgb2yuv.c:
* ext/hermes/yuv2rgb.c:
* ext/hermes/yuv2rgb.h:
* ext/hermes/yuv2rgb_mmx16.s:
* ext/hermes/yuv2yuv.c:
* ext/hermes/yuv2yuv.h:
Remove old code.
Diffstat (limited to 'ext/hermes/rgb2yuv.c')
-rw-r--r-- | ext/hermes/rgb2yuv.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/ext/hermes/rgb2yuv.c b/ext/hermes/rgb2yuv.c deleted file mode 100644 index 6aa1e805..00000000 --- a/ext/hermes/rgb2yuv.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * - * rgb2rgb.c, Software RGB to YUV convertor - * Written by Nick Kurshev. - * palette & yuv & runtime cpu stuff by Michael (michaelni@gmx.at) (under GPL) - */ - -#include "config.h" - -#include <math.h> -#include <stdlib.h> - -#include <gst/gst.h> - -#define Y_FROM_RGB(r,g,b) ((9798 * (r) + 19235 * (g) + 3736 * (b)) >> 15) -#define U_FROM_BY(b,y) ((16122 * ((b) - (y))) >> 15) + 128; -#define V_FROM_RY(r,y) ((25203 * ((r) - (y))) >> 15) + 128; - -static void -gst_colorspace_rgb32_to_yuv (unsigned char *src, - unsigned char *ydst, - unsigned char *udst, - unsigned char *vdst, - guint width, guint height) -{ - int y; - const int chrom_width = width >> 1; - int Y; - int b, g, r; - - for (y = height; y; y -= 2) { - int i; - - for (i = chrom_width; i; i--) { - b = *src++; - g = *src++; - r = *src++; - src++; - - Y = Y_FROM_RGB (r,g,b); - - *ydst++ = Y; - *udst++ = U_FROM_BY (b,Y); - *vdst++ = V_FROM_RY (r,Y); - - b = *src++; - g = *src++; - r = *src++; src++; - - *ydst++ = Y_FROM_RGB (r,g,b); - } - - for (i = width; i; i--) { - b = *src++; - g = *src++; - r = *src++; src++; - *ydst++ = Y_FROM_RGB (r,g,b); - } - } -} - -void -gst_colorspace_rgb32_to_i420 (unsigned char *src, unsigned char *dest, guint width, guint height) -{ - unsigned char *ydst = dest; - unsigned char *udst = ydst + (width * height); - unsigned char *vdst = udst + ((width * height) >> 2); - - gst_colorspace_rgb32_to_yuv (src, ydst, udst, vdst, width, height); -} - -void -gst_colorspace_rgb32_to_yv12 (unsigned char *src, unsigned char *dest, guint width, guint height) -{ - unsigned char *ydst = dest; - unsigned char *vdst = ydst + (width * height); - unsigned char *udst = vdst + ((width * height) >> 2); - - gst_colorspace_rgb32_to_yuv (src, ydst, udst, vdst, width, height); -} |