Commit b99391b7 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele Committed by Wim Taymans
Browse files

[MOVED FROM BAD 08/68] don't mix tabs and spaces

Original commit message from CVS:
don't mix tabs and spaces
parent 5c6a30bd
......@@ -62,7 +62,7 @@ static GstStaticPadTemplate gst_colorspace_src_template =
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB "; "
GST_VIDEO_CAPS_BGRx "; " GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_RGB_16)
GST_VIDEO_CAPS_BGRx "; " GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_RGB_16)
);
/* Stereo signals and args */
......@@ -132,125 +132,125 @@ colorspace_setup_converter (GstColorspace * space, GstCaps * from_caps,
gst_structure_get_int (from_struct, "bpp", &from_bpp);
switch (to_space) {
case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
#ifdef HAVE_HERMES
{
gint to_bpp;
gst_structure_get_int (to_struct, "bpp", &to_bpp);
gst_structure_get_int (from_struct, "red_mask", &space->source.r);
gst_structure_get_int (from_struct, "green_mask", &space->source.g);
gst_structure_get_int (from_struct, "blue_mask", &space->source.b);
space->source.a = 0;
space->srcbpp = space->source.bits = from_bpp;
space->source.indexed = 0;
space->source.has_colorkey = 0;
GST_INFO ("source red mask %08x", space->source.r);
GST_INFO ("source green mask %08x", space->source.g);
GST_INFO ("source blue mask %08x", space->source.b);
GST_INFO ("source bpp %08x", space->srcbpp);
gst_structure_get_int (to_struct, "red_mask", &space->dest.r);
gst_structure_get_int (to_struct, "green_mask", &space->dest.g);
gst_structure_get_int (to_struct, "blue_mask", &space->dest.b);
space->dest.a = 0;
space->destbpp = space->dest.bits = to_bpp;
space->dest.indexed = 0;
space->dest.has_colorkey = 0;
GST_INFO ("dest red mask %08x", space->dest.r);
GST_INFO ("dest green mask %08x", space->dest.g);
GST_INFO ("dest blue mask %08x", space->dest.b);
GST_INFO ("dest bpp %08x", space->destbpp);
if (!Hermes_ConverterRequest (space->h_handle, &space->source,
&space->dest)) {
g_warning ("Hermes: could not get converter\n");
return FALSE;
}
GST_INFO ("converter set up");
space->type = GST_COLORSPACE_HERMES;
return TRUE;
}
{
gint to_bpp;
gst_structure_get_int (to_struct, "bpp", &to_bpp);
gst_structure_get_int (from_struct, "red_mask", &space->source.r);
gst_structure_get_int (from_struct, "green_mask", &space->source.g);
gst_structure_get_int (from_struct, "blue_mask", &space->source.b);
space->source.a = 0;
space->srcbpp = space->source.bits = from_bpp;
space->source.indexed = 0;
space->source.has_colorkey = 0;
GST_INFO ("source red mask %08x", space->source.r);
GST_INFO ("source green mask %08x", space->source.g);
GST_INFO ("source blue mask %08x", space->source.b);
GST_INFO ("source bpp %08x", space->srcbpp);
gst_structure_get_int (to_struct, "red_mask", &space->dest.r);
gst_structure_get_int (to_struct, "green_mask", &space->dest.g);
gst_structure_get_int (to_struct, "blue_mask", &space->dest.b);
space->dest.a = 0;
space->destbpp = space->dest.bits = to_bpp;
space->dest.indexed = 0;
space->dest.has_colorkey = 0;
GST_INFO ("dest red mask %08x", space->dest.r);
GST_INFO ("dest green mask %08x", space->dest.g);
GST_INFO ("dest blue mask %08x", space->dest.b);
GST_INFO ("dest bpp %08x", space->destbpp);
if (!Hermes_ConverterRequest (space->h_handle, &space->source,
&space->dest)) {
g_warning ("Hermes: could not get converter\n");
return FALSE;
}
GST_INFO ("converter set up");
space->type = GST_COLORSPACE_HERMES;
return TRUE;
}
#else
g_warning ("colorspace: compiled without hermes!");
return FALSE;
g_warning ("colorspace: compiled without hermes!");
return FALSE;
#endif
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
if (from_bpp == 32) {
space->type = GST_COLORSPACE_RGB32_YV12;
space->destbpp = 12;
return TRUE;
}
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
if (from_bpp == 32) {
space->type = GST_COLORSPACE_RGB32_I420;
space->destbpp = 12;
return TRUE;
}
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!",
from_bpp);
return FALSE;
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
if (from_bpp == 32) {
space->type = GST_COLORSPACE_RGB32_YV12;
space->destbpp = 12;
return TRUE;
}
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
if (from_bpp == 32) {
space->type = GST_COLORSPACE_RGB32_I420;
space->destbpp = 12;
return TRUE;
}
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!",
from_bpp);
return FALSE;
}
break;
}
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
switch (to_space) {
case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
GST_INFO ("colorspace: YUV to RGB");
gst_structure_get_int (to_struct, "bpp", &space->destbpp);
space->converter =
gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps);
space->type = GST_COLORSPACE_YUV_RGB;
return TRUE;
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
space->type = GST_COLORSPACE_NONE;
space->destbpp = 12;
return TRUE;
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
space->type = GST_COLORSPACE_420_SWAP;
space->destbpp = 12;
return TRUE;
case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
GST_INFO ("colorspace: YUV to RGB");
gst_structure_get_int (to_struct, "bpp", &space->destbpp);
space->converter =
gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps);
space->type = GST_COLORSPACE_YUV_RGB;
return TRUE;
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
space->type = GST_COLORSPACE_NONE;
space->destbpp = 12;
return TRUE;
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
space->type = GST_COLORSPACE_420_SWAP;
space->destbpp = 12;
return TRUE;
}
break;
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
switch (to_space) {
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
space->type = GST_COLORSPACE_YUY2_I420;
space->destbpp = 12;
return TRUE;
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
space->type = GST_COLORSPACE_NONE;
space->destbpp = 16;
return TRUE;
case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
GST_INFO ("colorspace: YUY2 to RGB not implemented!!");
return FALSE;
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
space->type = GST_COLORSPACE_YUY2_I420;
space->destbpp = 12;
return TRUE;
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
space->type = GST_COLORSPACE_NONE;
space->destbpp = 16;
return TRUE;
case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
GST_INFO ("colorspace: YUY2 to RGB not implemented!!");
return FALSE;
}
break;
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
switch (to_space) {
case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
GST_INFO ("colorspace: YV12 to RGB");
gst_structure_get_int (to_struct, "bpp", &space->destbpp);
space->converter =
gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps);
space->type = GST_COLORSPACE_YUV_RGB;
return TRUE;
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
space->type = GST_COLORSPACE_420_SWAP;
space->destbpp = 12;
return TRUE;
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
space->type = GST_COLORSPACE_NONE;
space->destbpp = 12;
return TRUE;
case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
GST_INFO ("colorspace: YV12 to RGB");
gst_structure_get_int (to_struct, "bpp", &space->destbpp);
space->converter =
gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps);
space->type = GST_COLORSPACE_YUV_RGB;
return TRUE;
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
space->type = GST_COLORSPACE_420_SWAP;
space->destbpp = 12;
return TRUE;
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
space->type = GST_COLORSPACE_NONE;
space->destbpp = 12;
return TRUE;
}
break;
}
......@@ -317,7 +317,7 @@ gst_colorspace_get_format (const GstCaps * caps)
GstCaps *fcaps;
fcaps =
gst_caps_copy (gst_static_caps_get (&gst_colorspace_formats[i].caps));
gst_caps_copy (gst_static_caps_get (&gst_colorspace_formats[i].caps));
icaps = gst_caps_intersect (caps, fcaps);
if (!gst_caps_is_empty (icaps)) {
......@@ -417,8 +417,8 @@ gst_colorspace_link (GstPad * pad, const GstCaps * caps)
othercaps = gst_caps_copy (gst_pad_get_negotiated_caps (otherpad));
gst_caps_set_simple (othercaps,
"width", G_TYPE_INT, width,
"height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL);
"width", G_TYPE_INT, width,
"height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL);
link_ret = gst_pad_try_set_caps (otherpad, othercaps);
if (link_ret != GST_PAD_LINK_OK) {
......@@ -434,15 +434,15 @@ gst_colorspace_link (GstPad * pad, const GstCaps * caps)
if (gst_pad_is_negotiated (otherpad)) {
space->converter_index =
gst_colorspace_get_converter (space->sink_format_index,
space->src_format_index);
gst_colorspace_get_converter (space->sink_format_index,
space->src_format_index);
g_print ("using index %d\n", space->converter_index);
space->sink_size = gst_colorspace_format_get_size (space->sink_format_index,
width, height);
width, height);
space->src_size = gst_colorspace_format_get_size (space->src_format_index,
width, height);
width, height);
space->width = width;
space->height = height;
space->fps = fps;
......@@ -474,9 +474,10 @@ gst_colorspace_get_type (void)
0,
(GInstanceInitFunc) gst_colorspace_init,
};
colorspace_type =
g_type_register_static (GST_TYPE_ELEMENT, "GstColorspace",
&colorspace_info, 0);
g_type_register_static (GST_TYPE_ELEMENT, "GstColorspace",
&colorspace_info, 0);
}
return colorspace_type;
}
......@@ -621,7 +622,7 @@ static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "colorspace", GST_RANK_PRIMARY,
GST_TYPE_COLORSPACE))
GST_TYPE_COLORSPACE))
return FALSE;
return TRUE;
......
......@@ -231,9 +231,9 @@ gst_colorspace_I420_to_bgr32_mmx (GstColorspace * space, unsigned char *src,
size = space->width * space->height;
gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */
src + size, /* cr component */
src + size + (size >> 2), /* cb component */
gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */
src + size, /* cr component */
src + size + (size >> 2), /* cb component */
dest, space->height, space->width);
}
......@@ -248,9 +248,9 @@ gst_colorspace_I420_to_bgr16_mmx (GstColorspace * space, unsigned char *src,
size = space->width * space->height;
gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */
src + size, /* cr component */
src + size + (size >> 2), /* cb component */
gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */
src + size, /* cr component */
src + size + (size >> 2), /* cb component */
dest, space->height, space->width);
GST_DEBUG ("gst_colorspace_I420_to_bgr16_mmx done");
......@@ -266,9 +266,9 @@ gst_colorspace_YV12_to_bgr32_mmx (GstColorspace * space, unsigned char *src,
size = space->width * space->height;
gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */
src + size + (size >> 2), /* cb component */
src + size, /* cr component */
gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */
src + size + (size >> 2), /* cb component */
src + size, /* cr component */
dest, space->height, space->width);
}
......@@ -283,9 +283,9 @@ gst_colorspace_YV12_to_bgr16_mmx (GstColorspace * space, unsigned char *src,
size = space->width * space->height;
gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */
src + size + (size >> 2), /* cb component */
src + size, /* cr component */
gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */
src + size + (size >> 2), /* cb component */
src + size, /* cr component */
dest, space->height, space->width);
GST_DEBUG ("gst_colorspace_YV12_to_bgr16_mmx done");
......@@ -500,7 +500,7 @@ gst_colorspace_yuv_to_rgb32 (GstColorspace * space,
dest[x * 4 + 0] = 0;
dest[x * 3 + 1] = CLAMP (Y[x] + V_r_tab[V[x / 2]], 0, 255);
dest[x * 3 + 2] =
CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255);
CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255);
dest[x * 3 + 3] = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255);
}
Y += src_rowstride;
......@@ -527,7 +527,7 @@ gst_colorspace_yuv_to_rgb24 (GstColorspace * space,
for (x = 0; x < width; x++) {
dest[x * 3 + 0] = CLAMP (Y[x] + V_r_tab[V[x / 2]], 0, 255);
dest[x * 3 + 1] =
CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255);
CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255);
dest[x * 3 + 2] = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255);
}
Y += src_rowstride;
......@@ -557,7 +557,7 @@ gst_colorspace_yuv_to_rgb16 (GstColorspace * space,
g = CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255);
b = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255);
*(unsigned short *) (dest + x * 2) =
((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3);
((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3);
}
Y += src_rowstride;
dest += dest_rowstride;
......@@ -569,10 +569,10 @@ gst_colorspace_yuv_to_rgb16 (GstColorspace * space,
}
#ifdef HAVE_LIBMMX
static mmx_t MMX_80w = (mmx_t) (long long) 0x0080008000800080LL; /*dd 00080 0080h, 000800080h */
static mmx_t MMX_80w = (mmx_t) (long long) 0x0080008000800080LL; /*dd 00080 0080h, 000800080h */
static mmx_t MMX_00FFw = (mmx_t) (long long) 0x00ff00ff00ff00ffLL; /*dd 000FF 00FFh, 000FF00FFh */
static mmx_t MMX_FF00w = (mmx_t) (long long) 0xff00ff00ff00ff00LL; /*dd 000FF 00FFh, 000FF00FFh */
static mmx_t MMX_00FFw = (mmx_t) (long long) 0x00ff00ff00ff00ffLL; /*dd 000FF 00FFh, 000FF00FFh */
static mmx_t MMX_FF00w = (mmx_t) (long long) 0xff00ff00ff00ff00LL; /*dd 000FF 00FFh, 000FF00FFh */
static mmx_t MMX32_Vredcoeff = (mmx_t) (long long) 0x0059005900590059LL;
static mmx_t MMX32_Ubluecoeff = (mmx_t) (long long) 0x0072007200720072LL;
......@@ -589,7 +589,7 @@ gst_colorspace_yuv_to_bgr32_mmx (tables, lum, cr, cb, out, rows, cols)
int cols, rows;
{
guint32 *row1 = (guint32 *) out; /* 32 bit target */
guint32 *row1 = (guint32 *) out; /* 32 bit target */
int cols4 = cols >> 2;
int y, x;
......@@ -598,108 +598,108 @@ gst_colorspace_yuv_to_bgr32_mmx (tables, lum, cr, cb, out, rows, cols)
for (x = cols4; x; x--) {
/* create Cr (result in mm1) */
movd_m2r (*(mmx_t *) cb, mm1); /* 0 0 0 0 v3 v2 v1 v0 */
pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */
movd_m2r (*(mmx_t *) lum, mm2); /* 0 0 0 0 l3 l2 l1 l0 */
punpcklbw_r2r (mm7, mm1); /* 0 v3 0 v2 00 v1 00 v0 */
punpckldq_r2r (mm1, mm1); /* 00 v1 00 v0 00 v1 00 v0 */
psubw_m2r (MMX_80w, mm1); /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */
movd_m2r (*(mmx_t *) cb, mm1); /* 0 0 0 0 v3 v2 v1 v0 */
pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */
movd_m2r (*(mmx_t *) lum, mm2); /* 0 0 0 0 l3 l2 l1 l0 */
punpcklbw_r2r (mm7, mm1); /* 0 v3 0 v2 00 v1 00 v0 */
punpckldq_r2r (mm1, mm1); /* 00 v1 00 v0 00 v1 00 v0 */
psubw_m2r (MMX_80w, mm1); /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */
/* create Cr_g (result in mm0) */
movq_r2r (mm1, mm0); /* r1 r1 r0 r0 r1 r1 r0 r0 */
pmullw_m2r (MMX32_Vgrncoeff, mm0); /* red*-46dec=0.7136*64 */
pmullw_m2r (MMX32_Vredcoeff, mm1); /* red*89dec=1.4013*64 */
psraw_i2r (6, mm0); /* red=red/64 */
psraw_i2r (6, mm1); /* red=red/64 */
movq_r2r (mm1, mm0); /* r1 r1 r0 r0 r1 r1 r0 r0 */
pmullw_m2r (MMX32_Vgrncoeff, mm0); /* red*-46dec=0.7136*64 */
pmullw_m2r (MMX32_Vredcoeff, mm1); /* red*89dec=1.4013*64 */
psraw_i2r (6, mm0); /* red=red/64 */
psraw_i2r (6, mm1); /* red=red/64 */
/* create L1 L2 (result in mm2,mm4) */
/* L2=lum+cols */
movq_m2r (*(mmx_t *) (lum + cols), mm3); /* 0 0 0 0 L3 L2 L1 L0 */
punpckldq_r2r (mm3, mm2); /* L3 L2 L1 L0 l3 l2 l1 l0 */
movq_r2r (mm2, mm4); /* L3 L2 L1 L0 l3 l2 l1 l0 */
pand_m2r (MMX_FF00w, mm2); /* L3 0 L1 0 l3 0 l1 0 */
pand_m2r (MMX_00FFw, mm4); /* 0 L2 0 L0 0 l2 0 l0 */
psrlw_i2r (8, mm2); /* 0 L3 0 L1 0 l3 0 l1 */
movq_m2r (*(mmx_t *) (lum + cols), mm3); /* 0 0 0 0 L3 L2 L1 L0 */
punpckldq_r2r (mm3, mm2); /* L3 L2 L1 L0 l3 l2 l1 l0 */
movq_r2r (mm2, mm4); /* L3 L2 L1 L0 l3 l2 l1 l0 */
pand_m2r (MMX_FF00w, mm2); /* L3 0 L1 0 l3 0 l1 0 */
pand_m2r (MMX_00FFw, mm4); /* 0 L2 0 L0 0 l2 0 l0 */
psrlw_i2r (8, mm2); /* 0 L3 0 L1 0 l3 0 l1 */
/* create R (result in mm6) */
movq_r2r (mm2, mm5); /* 0 L3 0 L1 0 l3 0 l1 */
movq_r2r (mm4, mm6); /* 0 L2 0 L0 0 l2 0 l0 */
paddsw_r2r (mm1, mm5); /* lum1+red:x R3 x R1 x r3 x r1 */
paddsw_r2r (mm1, mm6); /* lum1+red:x R2 x R0 x r2 x r0 */
packuswb_r2r (mm5, mm5); /* R3 R1 r3 r1 R3 R1 r3 r1 */
packuswb_r2r (mm6, mm6); /* R2 R0 r2 r0 R2 R0 r2 r0 */
pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */
punpcklbw_r2r (mm5, mm6); /* R3 R2 R1 R0 r3 r2 r1 r0 */
movq_r2r (mm2, mm5); /* 0 L3 0 L1 0 l3 0 l1 */
movq_r2r (mm4, mm6); /* 0 L2 0 L0 0 l2 0 l0 */
paddsw_r2r (mm1, mm5); /* lum1+red:x R3 x R1 x r3 x r1 */
paddsw_r2r (mm1, mm6); /* lum1+red:x R2 x R0 x r2 x r0 */
packuswb_r2r (mm5, mm5); /* R3 R1 r3 r1 R3 R1 r3 r1 */
packuswb_r2r (mm6, mm6); /* R2 R0 r2 r0 R2 R0 r2 r0 */
pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */
punpcklbw_r2r (mm5, mm6); /* R3 R2 R1 R0 r3 r2 r1 r0 */
/* create Cb (result in mm1) */
movd_m2r (*(mmx_t *) cr, mm1); /* 0 0 0 0 u3 u2 u1 u0 */
punpcklbw_r2r (mm7, mm1); /* 0 u3 0 u2 00 u1 00 u0 */
punpckldq_r2r (mm1, mm1); /* 00 u1 00 u0 00 u1 00 u0 */
psubw_m2r (MMX_80w, mm1); /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */
movd_m2r (*(mmx_t *) cr, mm1); /* 0 0 0 0 u3 u2 u1 u0 */
punpcklbw_r2r (mm7, mm1); /* 0 u3 0 u2 00 u1 00 u0 */
punpckldq_r2r (mm1, mm1); /* 00 u1 00 u0 00 u1 00 u0 */
psubw_m2r (MMX_80w, mm1); /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */
/* create Cb_g (result in mm5) */
movq_r2r (mm1, mm5); /* u1 u1 u0 u0 u1 u1 u0 u0 */
pmullw_m2r (MMX32_Ugrncoeff, mm5); /* blue*-109dec=1.7129*64 */
pmullw_m2r (MMX32_Ubluecoeff, mm1); /* blue*114dec=1.78125*64 */
psraw_i2r (6, mm5); /* blue=red/64 */
psraw_i2r (6, mm1); /* blue=blue/64 */
movq_r2r (mm1, mm5); /* u1 u1 u0 u0 u1 u1 u0 u0 */
pmullw_m2r (MMX32_Ugrncoeff, mm5); /* blue*-109dec=1.7129*64 */
pmullw_m2r (MMX32_Ubluecoeff, mm1); /* blue*114dec=1.78125*64 */
psraw_i2r (6, mm5); /* blue=red/64 */
psraw_i2r (6, mm1); /* blue=blue/64 */
/* create G (result in mm7) */
movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */
movq_r2r (mm4, mm7); /* 0 L2 0 L0 0 l2 0 l1 */
paddsw_r2r (mm5, mm3); /* lum1+Cb_g:x G3t x G1t x g3t x g1t */
paddsw_r2r (mm5, mm7); /* lum1+Cb_g:x G2t x G0t x g2t x g0t */
paddsw_r2r (mm0, mm3); /* lum1+Cr_g:x G3 x G1 x g3 x g1 */
paddsw_r2r (mm0, mm7); /* lum1+blue:x G2 x G0 x g2 x g0 */
packuswb_r2r (mm3, mm3); /* G3 G1 g3 g1 G3 G1 g3 g1 */
packuswb_r2r (mm7, mm7); /* G2 G0 g2 g0 G2 G0 g2 g0 */
punpcklbw_r2r (mm3, mm7); /* G3 G2 G1 G0 g3 g2 g1 g0 */
movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */
movq_r2r (mm4, mm7); /* 0 L2 0 L0 0 l2 0 l1 */
paddsw_r2r (mm5, mm3); /* lum1+Cb_g:x G3t x G1t x g3t x g1t */
paddsw_r2r (mm5, mm7); /* lum1+Cb_g:x G2t x G0t x g2t x g0t */
paddsw_r2r (mm0, mm3); /* lum1+Cr_g:x G3 x G1 x g3 x g1 */
paddsw_r2r (mm0, mm7); /* lum1+blue:x G2 x G0 x g2 x g0 */
packuswb_r2r (mm3, mm3); /* G3 G1 g3 g1 G3 G1 g3 g1 */
packuswb_r2r (mm7, mm7); /* G2 G0 g2 g0 G2 G0 g2 g0 */
punpcklbw_r2r (mm3, mm7); /* G3 G2 G1 G0 g3 g2 g1 g0 */
/* create B (result in mm5) */
movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */
movq_r2r (mm4, mm5); /* 0 L2 0 L0 0 l2 0 l1 */
paddsw_r2r (mm1, mm3); /* lum1+blue:x B3 x B1 x b3 x b1 */
paddsw_r2r (mm1, mm5); /* lum1+blue:x B2 x B0 x b2 x b0 */
packuswb_r2r (mm3, mm3); /* B3 B1 b3 b1 B3 B1 b3 b1 */
packuswb_r2r (mm5, mm5); /* B2 B0 b2 b0 B2 B0 b2 b0 */
punpcklbw_r2r (mm3, mm5); /* B3 B2 B1 B0 b3 b2 b1 b0 */
movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */
movq_r2r (mm4, mm5); /* 0 L2 0 L0 0 l2 0 l1 */
paddsw_r2r (mm1, mm3); /* lum1+blue:x B3 x B1 x b3 x b1 */
paddsw_r2r (mm1, mm5); /* lum1+blue:x B2 x B0 x b2 x b0 */
packuswb_r2r (mm3, mm3); /* B3 B1 b3 b1 B3 B1 b3 b1 */
packuswb_r2r (mm5, mm5); /* B2 B0 b2 b0 B2 B0 b2 b0 */
punpcklbw_r2r (mm3, mm5); /* B3 B2 B1 B0 b3 b2 b1 b0 */
/* fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */
pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */
pxor_r2r (mm4, mm4); /* 0 0 0 0 0 0 0 0 */
movq_r2r (mm6, mm1); /* R3 R2 R1 R0 r3 r2 r1 r0 */
movq_r2r (mm5, mm3); /* B3 B2 B1 B0 b3 b2 b1 b0 */
pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */
pxor_r2r (mm4, mm4); /* 0 0 0 0 0 0 0 0 */
movq_r2r (mm6, mm1); /* R3 R2 R1 R0 r3 r2 r1 r0 */
movq_r2r (mm5, mm3); /* B3 B2 B1 B0 b3 b2 b1 b0 */
/* process lower lum */
punpcklbw_r2r (mm4, mm1); /* 0 r3 0 r2 0 r1 0 r0 */
punpcklbw_r2r (mm4, mm3); /* 0 b3 0 b2 0 b1 0 b0 */
movq_r2r (mm1, mm2); /* 0 r3 0 r2 0 r1 0 r0 */
movq_r2r (mm3, mm0); /* 0 b3 0 b2 0 b1 0 b0 */
punpcklwd_r2r (mm1, mm3); /* 0 r1 0 b1 0 r0 0 b0 */
punpckhwd_r2r (mm2, mm0); /* 0 r3 0 b3 0 r2 0 b2 */
pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */
movq_r2r (mm7, mm1); /* G3 G2 G1 G0 g3 g2 g1 g0 */
punpcklbw_r2r (mm1, mm2); /* g3 0 g2 0 g1 0 g0 0 */
punpcklwd_r2r (mm4, mm2); /* 0 0 g1 0 0 0 g0 0 */
por_r2r (mm3, mm2); /* 0 r1 g1 b1 0 r0 g0 b0 */
movq_r2m (mm2, *(mmx_t *) row1); /* wrote out ! row1 */
pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */
punpcklbw_r2r (mm1, mm4); /* g3 0 g2 0 g1 0 g0 0 */
punpckhwd_r2r (mm2, mm4); /* 0 0 g3 0 0 0 g2 0 */
por_r2r (mm0, mm4); /* 0 r3 g3 b3 0 r2 g2 b2 */
movq_r2m (mm4, *(mmx_t *) (row1 + 2)); /* wrote out ! row1 */
punpcklbw_r2r (mm4, mm1); /* 0 r3 0 r2 0 r1 0 r0 */
punpcklbw_r2r (mm4, mm3); /* 0 b3 0 b2 0 b1 0 b0 */
movq_r2r (mm1, mm2); /* 0 r3 0 r2 0 r1 0 r0 */
movq_r2r (mm3, mm0); /* 0 b3 0 b2 0 b1 0 b0 */
punpcklwd_r2r (mm1, mm3); /* 0 r1 0 b1 0 r0 0 b0 */
punpckhwd_r2r (mm2, mm0); /* 0 r3 0 b3 0 r2 0 b2 */
pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */
movq_r2r (mm7, mm1); /* G3 G2 G1 G0 g3 g2 g1 g0 */
punpcklbw_r2r (mm1, mm2); /* g3 0 g2 0 g1 0 g0 0 */
punpcklwd_r2r (mm4, mm2); /* 0 0 g1 0 0 0 g0 0 */
por_r2r (mm3, mm2); /* 0 r1 g1 b1 0 r0 g0 b0 */
movq_r2m (mm2, *(mmx_t *) row1); /* wrote out ! row1 */
pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */
punpcklbw_r2r (mm1, mm4); /* g3 0 g2 0 g1 0 g0 0 */
punpckhwd_r2r (mm2, mm4); /* 0 0 g3 0 0 0 g2 0 */
por_r2r (mm0, mm4); /* 0 r3 g3 b3 0 r2 g2 b2 */
movq_r2m (mm4, *(mmx_t *) (row1 + 2)); /* wrote out ! row1 */
/* fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */
/* this can be done "destructive" */
pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */
punpckhbw_r2r (mm2, mm6); /* 0 R3 0 R2 0 R1 0 R0 */
punpckhbw_r2r (mm1, mm5); /* G3 B3 G2 B2 G1 B1 G0 B0 */
movq_r2r (mm5, mm1); /* G3 B3 G2 B2 G1 B1 G0 B0 */
punpcklwd_r2r (mm6, mm1); /* 0 R1 G1 B1 0 R0 G0 B0 */
movq_r2m (mm1, *(mmx_t *) (row1 + cols)); /* wrote out ! row2 */
punpckhwd_r2r (mm6, mm5); /* 0 R3 G3 B3 0 R2 G2 B2 */
movq_r2m (mm5, *(mmx_t *) (row1 + cols + 2)); /* wrote out ! row2 */
pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */
punpckhbw_r2r (mm2, mm6); /* 0 R3 0 R2 0 R1 0 R0 */
punpckhbw_r2r (mm1, mm5); /* G3 B3 G2 B2 G1 B1 G0 B0 */
movq_r2r (mm5, mm1); /* G3 B3 G2 B2 G1 B1 G0 B0 */
punpcklwd_r2r (mm6, mm1); /* 0 R1 G1 B1 0 R0 G0 B0 */
movq_r2m (mm1, *(mmx_t *) (row1 + cols)); /* wrote out ! row2 */
punpckhwd_r2r (mm6, mm5); /* 0 R3 G3 B3 0 R2 G2 B2 */
movq_r2m (mm5, *(mmx_t *) (row1 + cols + 2)); /* wrote out ! row2 */
lum += 4;
cr += 2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment