videomixer: Add support for Y444, Y42B, Y41B and YV12

This commit is contained in:
Sebastian Dröge 2010-04-20 12:18:18 +02:00
parent 314fbd80e8
commit bd0b307a74
3 changed files with 238 additions and 67 deletions

View file

@ -34,6 +34,8 @@
#include <string.h>
#include <gst/video/video.h>
#define BLEND(D,S,alpha) (((D) * (256 - (alpha)) + (S) * (alpha)) >> 8)
#ifdef HAVE_GCC_ASM
@ -224,18 +226,10 @@ A32_COLOR (abgr_c, TRUE, _fill_color_loop_ac3c2c1_c);
A32_COLOR (rgba_c, TRUE, _fill_color_loop_c1c2c3a_c);
A32_COLOR (ayuv_c, FALSE, _fill_color_loop_ac1c2c3_c);
/* I420 */
#define I420_Y_ROWSTRIDE(width) (GST_ROUND_UP_4(width))
#define I420_U_ROWSTRIDE(width) (GST_ROUND_UP_8(width)/2)
#define I420_V_ROWSTRIDE(width) ((GST_ROUND_UP_8(I420_Y_ROWSTRIDE(width)))/2)
#define I420_Y_OFFSET(w,h) (0)
#define I420_U_OFFSET(w,h) (I420_Y_OFFSET(w,h)+(I420_Y_ROWSTRIDE(w)*GST_ROUND_UP_2(h)))
#define I420_V_OFFSET(w,h) (I420_U_OFFSET(w,h)+(I420_U_ROWSTRIDE(w)*GST_ROUND_UP_2(h)/2))
#define I420_BLEND(name,MEMCPY,BLENDLOOP) \
/* Y444, Y42B, I420, YV12, Y41B */
#define PLANAR_YUV_BLEND(name,format_name,format_enum,x_round,y_round,MEMCPY,BLENDLOOP) \
inline static void \
_blend_i420_##name (const guint8 * src, guint8 * dest, \
_blend_##format_name##_##name (const guint8 * src, guint8 * dest, \
gint src_stride, gint dest_stride, gint src_width, gint src_height, \
gint dest_width, gdouble src_alpha) \
{ \
@ -265,7 +259,7 @@ _blend_i420_##name (const guint8 * src, guint8 * dest, \
} \
\
static void \
blend_i420_##name (const guint8 * src, gint xpos, gint ypos, \
blend_##format_name##_##name (const guint8 * src, gint xpos, gint ypos, \
gint src_width, gint src_height, gdouble src_alpha, \
guint8 * dest, gint dest_width, gint dest_height) \
{ \
@ -275,9 +269,14 @@ blend_i420_##name (const guint8 * src, gint xpos, gint ypos, \
gint b_src_height = src_height; \
gint xoffset = 0; \
gint yoffset = 0; \
gint src_comp_rowstride, dest_comp_rowstride; \
gint src_comp_height, dest_comp_height; \
gint src_comp_width, dest_comp_width; \
gint comp_ypos, comp_xpos; \
gint comp_yoffset, comp_xoffset; \
\
xpos = GST_ROUND_UP_2 (xpos); \
ypos = GST_ROUND_UP_2 (ypos); \
xpos = x_round (xpos); \
ypos = y_round (ypos); \
\
/* adjust src pointers for negative sizes */ \
if (xpos < 0) { \
@ -307,78 +306,164 @@ blend_i420_##name (const guint8 * src, gint xpos, gint ypos, \
} \
\
/* First mix Y, then U, then V */ \
b_src = src + I420_Y_OFFSET (src_width, src_height); \
b_dest = dest + I420_Y_OFFSET (dest_width, dest_height); \
_blend_i420_##name (b_src + xoffset + yoffset * I420_Y_ROWSTRIDE (src_width), \
b_dest + xpos + ypos * I420_Y_ROWSTRIDE (dest_width), \
I420_Y_ROWSTRIDE (src_width), \
I420_Y_ROWSTRIDE (dest_width), b_src_width, b_src_height, \
dest_width, src_alpha); \
b_src = src + gst_video_format_get_component_offset (format_enum, 0, src_width, src_height); \
b_dest = dest + gst_video_format_get_component_offset (format_enum, 0, dest_width, dest_height); \
src_comp_rowstride = gst_video_format_get_row_stride (format_enum, 0, src_width); \
dest_comp_rowstride = gst_video_format_get_row_stride (format_enum, 0, dest_width); \
src_comp_height = gst_video_format_get_component_height (format_enum, 0, b_src_height); \
dest_comp_height = gst_video_format_get_component_height (format_enum, 0, dest_height); \
src_comp_width = gst_video_format_get_component_width (format_enum, 0, b_src_width); \
dest_comp_width = gst_video_format_get_component_width (format_enum, 0, dest_width); \
comp_xpos = (xpos == 0) ? 0 : gst_video_format_get_component_width (format_enum, 0, xpos); \
comp_ypos = (ypos == 0) ? 0 : gst_video_format_get_component_height (format_enum, 0, ypos); \
comp_xoffset = (xoffset == 0) ? 0 : gst_video_format_get_component_width (format_enum, 0, xoffset); \
comp_yoffset = (yoffset == 0) ? 0 : gst_video_format_get_component_height (format_enum, 0, yoffset); \
_blend_##format_name##_##name (b_src + comp_xoffset + comp_yoffset * src_comp_rowstride, \
b_dest + comp_xpos + comp_ypos * dest_comp_rowstride, \
src_comp_rowstride, \
dest_comp_rowstride, src_comp_width, src_comp_height, \
dest_comp_width, src_alpha); \
\
b_src = src + I420_U_OFFSET (src_width, src_height); \
b_dest = dest + I420_U_OFFSET (dest_width, dest_height); \
b_src = src + gst_video_format_get_component_offset (format_enum, 1, src_width, src_height); \
b_dest = dest + gst_video_format_get_component_offset (format_enum, 1, dest_width, dest_height); \
src_comp_rowstride = gst_video_format_get_row_stride (format_enum, 1, src_width); \
dest_comp_rowstride = gst_video_format_get_row_stride (format_enum, 1, dest_width); \
src_comp_height = gst_video_format_get_component_height (format_enum, 1, b_src_height); \
dest_comp_height = gst_video_format_get_component_height (format_enum, 1, dest_height); \
src_comp_width = gst_video_format_get_component_width (format_enum, 1, b_src_width); \
dest_comp_width = gst_video_format_get_component_width (format_enum, 1, dest_width); \
comp_xpos = (xpos == 0) ? 0 : gst_video_format_get_component_width (format_enum, 1, xpos); \
comp_ypos = (ypos == 0) ? 0 : gst_video_format_get_component_height (format_enum, 1, ypos); \
comp_xoffset = (xoffset == 0) ? 0 : gst_video_format_get_component_width (format_enum, 1, xoffset); \
comp_yoffset = (yoffset == 0) ? 0 : gst_video_format_get_component_height (format_enum, 1, yoffset); \
_blend_##format_name##_##name (b_src + comp_xoffset + comp_yoffset * src_comp_rowstride, \
b_dest + comp_xpos + comp_ypos * dest_comp_rowstride, \
src_comp_rowstride, \
dest_comp_rowstride, src_comp_width, src_comp_height, \
dest_comp_width, src_alpha); \
\
_blend_i420_##name (b_src + xoffset / 2 + \
yoffset / 2 * I420_U_ROWSTRIDE (src_width), \
b_dest + xpos / 2 + ypos / 2 * I420_U_ROWSTRIDE (dest_width), \
I420_U_ROWSTRIDE (src_width), I420_U_ROWSTRIDE (dest_width), \
b_src_width / 2, GST_ROUND_UP_2 (b_src_height) / 2, dest_width / 2, \
src_alpha); \
\
b_src = src + I420_V_OFFSET (src_width, src_height); \
b_dest = dest + I420_V_OFFSET (dest_width, dest_height); \
\
_blend_i420_##name (b_src + xoffset / 2 + \
yoffset / 2 * I420_V_ROWSTRIDE (src_width), \
b_dest + xpos / 2 + ypos / 2 * I420_V_ROWSTRIDE (dest_width), \
I420_V_ROWSTRIDE (src_width), I420_V_ROWSTRIDE (dest_width), \
b_src_width / 2, GST_ROUND_UP_2 (b_src_height) / 2, dest_width / 2, \
src_alpha); \
b_src = src + gst_video_format_get_component_offset (format_enum, 2, src_width, src_height); \
b_dest = dest + gst_video_format_get_component_offset (format_enum, 2, dest_width, dest_height); \
src_comp_rowstride = gst_video_format_get_row_stride (format_enum, 2, src_width); \
dest_comp_rowstride = gst_video_format_get_row_stride (format_enum, 2, dest_width); \
src_comp_height = gst_video_format_get_component_height (format_enum, 2, b_src_height); \
dest_comp_height = gst_video_format_get_component_height (format_enum, 2, dest_height); \
src_comp_width = gst_video_format_get_component_width (format_enum, 2, b_src_width); \
dest_comp_width = gst_video_format_get_component_width (format_enum, 2, dest_width); \
comp_xpos = (xpos == 0) ? 0 : gst_video_format_get_component_width (format_enum, 2, xpos); \
comp_ypos = (ypos == 0) ? 0 : gst_video_format_get_component_height (format_enum, 2, ypos); \
comp_xoffset = (xoffset == 0) ? 0 : gst_video_format_get_component_width (format_enum, 2, xoffset); \
comp_yoffset = (yoffset == 0) ? 0 : gst_video_format_get_component_height (format_enum, 2, yoffset); \
_blend_##format_name##_##name (b_src + comp_xoffset + comp_yoffset * src_comp_rowstride, \
b_dest + comp_xpos + comp_ypos * dest_comp_rowstride, \
src_comp_rowstride, \
dest_comp_rowstride, src_comp_width, src_comp_height, \
dest_comp_width, src_alpha); \
}
#define I420_FILL_CHECKER(name, MEMSET) \
#define PLANAR_YUV_FILL_CHECKER(name, format_name, format_enum, MEMSET) \
static void \
fill_checker_i420_##name (guint8 * dest, gint width, gint height) \
fill_checker_##format_name##_##name (guint8 * dest, gint width, gint height) \
{ \
gint size; \
gint i, j; \
static const int tab[] = { 80, 160, 80, 160 }; \
guint8 *p = dest; \
guint8 *p; \
gint comp_width, comp_height; \
gint rowstride; \
\
for (i = 0; i < height; i++) { \
for (j = 0; j < width; j++) { \
p = dest + gst_video_format_get_component_offset (format_enum, 0, width, height); \
comp_width = gst_video_format_get_component_width (format_enum, 0, width); \
comp_height = gst_video_format_get_component_height (format_enum, 0, height); \
rowstride = gst_video_format_get_row_stride (format_enum, 0, width); \
\
for (i = 0; i < comp_height; i++) { \
for (j = 0; j < comp_width; j++) { \
*p++ = tab[((i & 0x8) >> 3) + ((j & 0x8) >> 3)]; \
} \
p += I420_Y_ROWSTRIDE (width) - width; \
p += rowstride - comp_width; \
} \
\
size = (I420_U_ROWSTRIDE (width) * height) / 2; \
MEMSET (dest + I420_U_OFFSET (width, height), 0x80, size); \
p = dest + gst_video_format_get_component_offset (format_enum, 1, width, height); \
comp_width = gst_video_format_get_component_width (format_enum, 1, width); \
comp_height = gst_video_format_get_component_height (format_enum, 1, height); \
rowstride = gst_video_format_get_row_stride (format_enum, 1, width); \
\
size = (I420_V_ROWSTRIDE (width) * height) / 2; \
MEMSET (dest + I420_V_OFFSET (width, height), 0x80, size); \
for (i = 0; i < comp_height; i++) { \
MEMSET (p, 0x80, comp_width); \
p += rowstride; \
} \
\
p = dest + gst_video_format_get_component_offset (format_enum, 2, width, height); \
comp_width = gst_video_format_get_component_width (format_enum, 2, width); \
comp_height = gst_video_format_get_component_height (format_enum, 2, height); \
rowstride = gst_video_format_get_row_stride (format_enum, 2, width); \
\
for (i = 0; i < comp_height; i++) { \
MEMSET (p, 0x80, comp_width); \
p += rowstride; \
} \
}
#define I420_FILL_COLOR(name,MEMSET) \
#define PLANAR_YUV_FILL_COLOR(name,format_name,format_enum,MEMSET) \
static void \
fill_color_i420_##name (guint8 * dest, gint width, gint height, \
fill_color_##format_name##_##name (guint8 * dest, gint width, gint height, \
gint colY, gint colU, gint colV) \
{ \
gint size; \
guint8 *p; \
gint comp_width, comp_height; \
gint rowstride; \
gint i; \
\
size = I420_Y_ROWSTRIDE (width) * height; \
MEMSET (dest, colY, size); \
p = dest + gst_video_format_get_component_offset (format_enum, 0, width, height); \
comp_width = gst_video_format_get_component_width (format_enum, 0, width); \
comp_height = gst_video_format_get_component_height (format_enum, 0, height); \
rowstride = gst_video_format_get_row_stride (format_enum, 0, width); \
\
size = (I420_U_ROWSTRIDE (width) * height) / 2; \
MEMSET (dest + I420_U_OFFSET (width, height), colU, size); \
for (i = 0; i < comp_height; i++) { \
MEMSET (p, colY, comp_width); \
p += rowstride; \
} \
\
size = (I420_V_ROWSTRIDE (width) * height) / 2; \
MEMSET (dest + I420_V_OFFSET (width, height), colV, size); \
p = dest + gst_video_format_get_component_offset (format_enum, 1, width, height); \
comp_width = gst_video_format_get_component_width (format_enum, 1, width); \
comp_height = gst_video_format_get_component_height (format_enum, 1, height); \
rowstride = gst_video_format_get_row_stride (format_enum, 1, width); \
\
for (i = 0; i < comp_height; i++) { \
MEMSET (p, colU, comp_width); \
p += rowstride; \
} \
\
p = dest + gst_video_format_get_component_offset (format_enum, 2, width, height); \
comp_width = gst_video_format_get_component_width (format_enum, 2, width); \
comp_height = gst_video_format_get_component_height (format_enum, 2, height); \
rowstride = gst_video_format_get_row_stride (format_enum, 2, width); \
\
for (i = 0; i < comp_height; i++) { \
MEMSET (p, colV, comp_width); \
p += rowstride; \
} \
}
I420_BLEND (c, memcpy, _blend_u8_c);
I420_FILL_CHECKER (c, memset);
I420_FILL_COLOR (c, memset);
#define GST_ROUND_UP_1(x) (x)
PLANAR_YUV_BLEND (c, i420, GST_VIDEO_FORMAT_I420, GST_ROUND_UP_2,
GST_ROUND_UP_2, memcpy, _blend_u8_c);
PLANAR_YUV_FILL_CHECKER (c, i420, GST_VIDEO_FORMAT_I420, memset);
PLANAR_YUV_FILL_COLOR (c, i420, GST_VIDEO_FORMAT_I420, memset);
PLANAR_YUV_FILL_COLOR (c, yv12, GST_VIDEO_FORMAT_YV12, memset);
PLANAR_YUV_BLEND (c, y444, GST_VIDEO_FORMAT_Y444, GST_ROUND_UP_1,
GST_ROUND_UP_1, memcpy, _blend_u8_c);
PLANAR_YUV_FILL_CHECKER (c, y444, GST_VIDEO_FORMAT_Y444, memset);
PLANAR_YUV_FILL_COLOR (c, y444, GST_VIDEO_FORMAT_Y444, memset);
PLANAR_YUV_BLEND (c, y42b, GST_VIDEO_FORMAT_Y42B, GST_ROUND_UP_2,
GST_ROUND_UP_1, memcpy, _blend_u8_c);
PLANAR_YUV_FILL_CHECKER (c, y42b, GST_VIDEO_FORMAT_Y42B, memset);
PLANAR_YUV_FILL_COLOR (c, y42b, GST_VIDEO_FORMAT_Y42B, memset);
PLANAR_YUV_BLEND (c, y41b, GST_VIDEO_FORMAT_Y41B, GST_ROUND_UP_4,
GST_ROUND_UP_1, memcpy, _blend_u8_c);
PLANAR_YUV_FILL_CHECKER (c, y41b, GST_VIDEO_FORMAT_Y41B, memset);
PLANAR_YUV_FILL_COLOR (c, y41b, GST_VIDEO_FORMAT_Y41B, memset);
/* RGB, BGR, xRGB, xBGR, RGBx, BGRx */
@ -557,9 +642,23 @@ A32_COLOR (abgr_mmx, TRUE, _fill_color_loop_abgr_mmx);
A32_COLOR (rgba_mmx, TRUE, _fill_color_loop_rgba_mmx);
A32_COLOR (ayuv_mmx, FALSE, _fill_color_loop_argb_mmx);
I420_BLEND (mmx, _memcpy_u8_mmx, _blend_u8_mmx);
I420_FILL_CHECKER (mmx, _memset_u8_mmx);
I420_FILL_COLOR (mmx, _memset_u8_mmx);
PLANAR_YUV_BLEND (mmx, i420, GST_VIDEO_FORMAT_I420, GST_ROUND_UP_2,
GST_ROUND_UP_2, _memcpy_u8_mmx, _blend_u8_mmx);
PLANAR_YUV_FILL_CHECKER (mmx, i420, GST_VIDEO_FORMAT_I420, _memset_u8_mmx);
PLANAR_YUV_FILL_COLOR (mmx, i420, GST_VIDEO_FORMAT_I420, _memset_u8_mmx);
PLANAR_YUV_FILL_COLOR (mmx, yv12, GST_VIDEO_FORMAT_YV12, _memset_u8_mmx);
PLANAR_YUV_BLEND (mmx, y444, GST_VIDEO_FORMAT_Y444, GST_ROUND_UP_1,
GST_ROUND_UP_1, _memcpy_u8_mmx, _blend_u8_mmx);
PLANAR_YUV_FILL_CHECKER (mmx, y444, GST_VIDEO_FORMAT_Y444, _memset_u8_mmx);
PLANAR_YUV_FILL_COLOR (mmx, y444, GST_VIDEO_FORMAT_Y444, _memset_u8_mmx);
PLANAR_YUV_BLEND (mmx, y42b, GST_VIDEO_FORMAT_Y42B, GST_ROUND_UP_2,
GST_ROUND_UP_1, _memcpy_u8_mmx, _blend_u8_mmx);
PLANAR_YUV_FILL_CHECKER (mmx, y42b, GST_VIDEO_FORMAT_Y42B, _memset_u8_mmx);
PLANAR_YUV_FILL_COLOR (mmx, y42b, GST_VIDEO_FORMAT_Y42B, _memset_u8_mmx);
PLANAR_YUV_BLEND (mmx, y41b, GST_VIDEO_FORMAT_Y41B, GST_ROUND_UP_4,
GST_ROUND_UP_1, _memcpy_u8_mmx, _blend_u8_mmx);
PLANAR_YUV_FILL_CHECKER (mmx, y41b, GST_VIDEO_FORMAT_Y41B, _memset_u8_mmx);
PLANAR_YUV_FILL_COLOR (mmx, y41b, GST_VIDEO_FORMAT_Y41B, _memset_u8_mmx);
RGB_BLEND (rgb_mmx, 3, _memcpy_u8_mmx, _blend_u8_mmx);
@ -581,7 +680,11 @@ RGB_FILL_COLOR (bgrx_mmx, 4, _memset_bgrx_mmx);
BlendFunction gst_video_mixer_blend_argb;
BlendFunction gst_video_mixer_blend_bgra;
/* AYUV/ABGR is equal to ARGB, RGBA is equal to BGRA */
BlendFunction gst_video_mixer_blend_y444;
BlendFunction gst_video_mixer_blend_y42b;
BlendFunction gst_video_mixer_blend_i420;
/* I420 is equal to YV12 */
BlendFunction gst_video_mixer_blend_y41b;
BlendFunction gst_video_mixer_blend_rgb;
/* BGR is equal to RGB */
BlendFunction gst_video_mixer_blend_rgbx;
@ -591,7 +694,11 @@ FillCheckerFunction gst_video_mixer_fill_checker_argb;
FillCheckerFunction gst_video_mixer_fill_checker_bgra;
/* ABGR is equal to ARGB, RGBA is equal to BGRA */
FillCheckerFunction gst_video_mixer_fill_checker_ayuv;
FillCheckerFunction gst_video_mixer_fill_checker_y444;
FillCheckerFunction gst_video_mixer_fill_checker_y42b;
FillCheckerFunction gst_video_mixer_fill_checker_i420;
/* I420 is equal to YV12 */
FillCheckerFunction gst_video_mixer_fill_checker_y41b;
FillCheckerFunction gst_video_mixer_fill_checker_rgb;
/* BGR is equal to RGB */
FillCheckerFunction gst_video_mixer_fill_checker_xrgb;
@ -602,7 +709,11 @@ FillColorFunction gst_video_mixer_fill_color_bgra;
FillColorFunction gst_video_mixer_fill_color_abgr;
FillColorFunction gst_video_mixer_fill_color_rgba;
FillColorFunction gst_video_mixer_fill_color_ayuv;
FillColorFunction gst_video_mixer_fill_color_y444;
FillColorFunction gst_video_mixer_fill_color_y42b;
FillColorFunction gst_video_mixer_fill_color_i420;
FillColorFunction gst_video_mixer_fill_color_yv12;
FillColorFunction gst_video_mixer_fill_color_y41b;
FillColorFunction gst_video_mixer_fill_color_rgb;
FillColorFunction gst_video_mixer_fill_color_bgr;
FillColorFunction gst_video_mixer_fill_color_xrgb;
@ -621,6 +732,9 @@ gst_video_mixer_init_blend (void)
gst_video_mixer_blend_argb = blend_argb_c;
gst_video_mixer_blend_bgra = blend_bgra_c;
gst_video_mixer_blend_i420 = blend_i420_c;
gst_video_mixer_blend_y444 = blend_y444_c;
gst_video_mixer_blend_y42b = blend_y42b_c;
gst_video_mixer_blend_y41b = blend_y41b_c;
gst_video_mixer_blend_rgb = blend_rgb_c;
gst_video_mixer_blend_xrgb = blend_xrgb_c;
@ -628,6 +742,9 @@ gst_video_mixer_init_blend (void)
gst_video_mixer_fill_checker_bgra = fill_checker_bgra_c;
gst_video_mixer_fill_checker_ayuv = fill_checker_ayuv_c;
gst_video_mixer_fill_checker_i420 = fill_checker_i420_c;
gst_video_mixer_fill_checker_y444 = fill_checker_y444_c;
gst_video_mixer_fill_checker_y42b = fill_checker_y42b_c;
gst_video_mixer_fill_checker_y41b = fill_checker_y41b_c;
gst_video_mixer_fill_checker_rgb = fill_checker_rgb_c;
gst_video_mixer_fill_checker_xrgb = fill_checker_xrgb_c;
@ -637,6 +754,10 @@ gst_video_mixer_init_blend (void)
gst_video_mixer_fill_color_rgba = fill_color_rgba_c;
gst_video_mixer_fill_color_ayuv = fill_color_ayuv_c;
gst_video_mixer_fill_color_i420 = fill_color_i420_c;
gst_video_mixer_fill_color_yv12 = fill_color_yv12_c;
gst_video_mixer_fill_color_y444 = fill_color_y444_c;
gst_video_mixer_fill_color_y42b = fill_color_y42b_c;
gst_video_mixer_fill_color_y41b = fill_color_y41b_c;
gst_video_mixer_fill_color_rgb = fill_color_rgb_c;
gst_video_mixer_fill_color_bgr = fill_color_bgr_c;
gst_video_mixer_fill_color_xrgb = fill_color_xrgb_c;
@ -649,10 +770,16 @@ gst_video_mixer_init_blend (void)
gst_video_mixer_blend_argb = blend_argb_mmx;
gst_video_mixer_blend_bgra = blend_bgra_mmx;
gst_video_mixer_blend_i420 = blend_i420_mmx;
gst_video_mixer_blend_y444 = blend_y444_mmx;
gst_video_mixer_blend_y42b = blend_y42b_mmx;
gst_video_mixer_blend_y41b = blend_y41b_mmx;
gst_video_mixer_blend_rgb = blend_rgb_mmx;
gst_video_mixer_blend_xrgb = blend_xrgb_mmx;
gst_video_mixer_fill_checker_i420 = fill_checker_i420_mmx;
gst_video_mixer_fill_checker_y444 = fill_checker_y444_mmx;
gst_video_mixer_fill_checker_y42b = fill_checker_y42b_mmx;
gst_video_mixer_fill_checker_y41b = fill_checker_y41b_mmx;
gst_video_mixer_fill_color_argb = fill_color_argb_mmx;
gst_video_mixer_fill_color_bgra = fill_color_bgra_mmx;
@ -660,6 +787,10 @@ gst_video_mixer_init_blend (void)
gst_video_mixer_fill_color_rgba = fill_color_rgba_mmx;
gst_video_mixer_fill_color_ayuv = fill_color_ayuv_mmx;
gst_video_mixer_fill_color_i420 = fill_color_i420_mmx;
gst_video_mixer_fill_color_yv12 = fill_color_yv12_mmx;
gst_video_mixer_fill_color_y444 = fill_color_y444_mmx;
gst_video_mixer_fill_color_y42b = fill_color_y42b_mmx;
gst_video_mixer_fill_color_y41b = fill_color_y41b_mmx;
gst_video_mixer_fill_color_xrgb = fill_color_xrgb_mmx;
gst_video_mixer_fill_color_xbgr = fill_color_xbgr_mmx;
gst_video_mixer_fill_color_rgbx = fill_color_rgbx_mmx;

View file

@ -32,6 +32,10 @@ extern BlendFunction gst_video_mixer_blend_bgra;
#define gst_video_mixer_blend_abgr gst_video_mixer_blend_argb
#define gst_video_mixer_blend_rgba gst_video_mixer_blend_bgra
extern BlendFunction gst_video_mixer_blend_i420;
#define gst_video_mixer_blend_yv12 gst_video_mixer_blend_i420
extern BlendFunction gst_video_mixer_blend_y41b;
extern BlendFunction gst_video_mixer_blend_y42b;
extern BlendFunction gst_video_mixer_blend_y444;
extern BlendFunction gst_video_mixer_blend_rgb;
#define gst_video_mixer_blend_bgr gst_video_mixer_blend_rgb
extern BlendFunction gst_video_mixer_blend_rgbx;
@ -45,6 +49,10 @@ extern FillCheckerFunction gst_video_mixer_fill_checker_bgra;
#define gst_video_mixer_fill_checker_rgba gst_video_mixer_fill_checker_bgra
extern FillCheckerFunction gst_video_mixer_fill_checker_ayuv;
extern FillCheckerFunction gst_video_mixer_fill_checker_i420;
#define gst_video_mixer_fill_checker_yv12 gst_video_mixer_fill_checker_i420
extern FillCheckerFunction gst_video_mixer_fill_checker_y41b;
extern FillCheckerFunction gst_video_mixer_fill_checker_y42b;
extern FillCheckerFunction gst_video_mixer_fill_checker_y444;
extern FillCheckerFunction gst_video_mixer_fill_checker_rgb;
#define gst_video_mixer_fill_checker_bgr gst_video_mixer_fill_checker_rgb
extern FillCheckerFunction gst_video_mixer_fill_checker_rgbx;
@ -58,6 +66,10 @@ extern FillColorFunction gst_video_mixer_fill_color_bgra;
extern FillColorFunction gst_video_mixer_fill_color_rgba;
extern FillColorFunction gst_video_mixer_fill_color_ayuv;
extern FillColorFunction gst_video_mixer_fill_color_i420;
extern FillColorFunction gst_video_mixer_fill_color_yv12;
extern FillColorFunction gst_video_mixer_fill_color_y41b;
extern FillColorFunction gst_video_mixer_fill_color_y42b;
extern FillColorFunction gst_video_mixer_fill_color_y444;
extern FillColorFunction gst_video_mixer_fill_color_rgb;
extern FillColorFunction gst_video_mixer_fill_color_bgr;
extern FillColorFunction gst_video_mixer_fill_color_xrgb;

View file

@ -471,7 +471,9 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") ";" GST_VIDEO_CAPS_BGRA ";"
GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_RGBA ";" GST_VIDEO_CAPS_ABGR ";"
GST_VIDEO_CAPS_YUV ("I420") ";" GST_VIDEO_CAPS_RGB ";"
GST_VIDEO_CAPS_YUV ("Y444") ";" GST_VIDEO_CAPS_YUV ("Y42B") ";"
GST_VIDEO_CAPS_YUV ("{ I420, YV12 }") ";"
GST_VIDEO_CAPS_YUV ("Y41B") ";" GST_VIDEO_CAPS_RGB ";"
GST_VIDEO_CAPS_BGR ";" GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_xBGR ";"
GST_VIDEO_CAPS_RGBx ";" GST_VIDEO_CAPS_BGRx)
);
@ -481,7 +483,9 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%d",
GST_PAD_REQUEST,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") ";" GST_VIDEO_CAPS_BGRA ";"
GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_RGBA ";" GST_VIDEO_CAPS_ABGR ";"
GST_VIDEO_CAPS_YUV ("I420") ";" GST_VIDEO_CAPS_RGB ";"
GST_VIDEO_CAPS_YUV ("Y444") ";" GST_VIDEO_CAPS_YUV ("Y42B") ";"
GST_VIDEO_CAPS_YUV ("{ I420, YV12 }") ";"
GST_VIDEO_CAPS_YUV ("Y41B") ";" GST_VIDEO_CAPS_RGB ";"
GST_VIDEO_CAPS_BGR ";" GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_xBGR ";"
GST_VIDEO_CAPS_RGBx ";" GST_VIDEO_CAPS_BGRx)
);
@ -975,12 +979,36 @@ gst_videomixer_setcaps (GstPad * pad, GstCaps * caps)
mixer->fill_color = gst_video_mixer_fill_color_rgba;
ret = TRUE;
break;
case GST_VIDEO_FORMAT_Y444:
mixer->blend = gst_video_mixer_blend_y444;
mixer->fill_checker = gst_video_mixer_fill_checker_y444;
mixer->fill_color = gst_video_mixer_fill_color_y444;
ret = TRUE;
break;
case GST_VIDEO_FORMAT_Y42B:
mixer->blend = gst_video_mixer_blend_y42b;
mixer->fill_checker = gst_video_mixer_fill_checker_y42b;
mixer->fill_color = gst_video_mixer_fill_color_y42b;
ret = TRUE;
break;
case GST_VIDEO_FORMAT_I420:
mixer->blend = gst_video_mixer_blend_i420;
mixer->fill_checker = gst_video_mixer_fill_checker_i420;
mixer->fill_color = gst_video_mixer_fill_color_i420;
ret = TRUE;
break;
case GST_VIDEO_FORMAT_YV12:
mixer->blend = gst_video_mixer_blend_yv12;
mixer->fill_checker = gst_video_mixer_fill_checker_yv12;
mixer->fill_color = gst_video_mixer_fill_color_yv12;
ret = TRUE;
break;
case GST_VIDEO_FORMAT_Y41B:
mixer->blend = gst_video_mixer_blend_y41b;
mixer->fill_checker = gst_video_mixer_fill_checker_y41b;
mixer->fill_color = gst_video_mixer_fill_color_y41b;
ret = TRUE;
break;
case GST_VIDEO_FORMAT_RGB:
mixer->blend = gst_video_mixer_blend_rgb;
mixer->fill_checker = gst_video_mixer_fill_checker_rgb;