Commit 7cfa5195 authored by David Schleef's avatar David Schleef Committed by Sebastian Dröge
Browse files

videomixer: Add orc implementation for blending

videomixer: Add orc implementation for blending
parent 1ace738c
......@@ -701,6 +701,18 @@ BLEND_A32 (argb_mmx, _blend_loop_argb_mmx);
BLEND_A32 (bgra_mmx, _blend_loop_bgra_mmx);
#endif
static void
_blend_loop_argb_orc (guint8 * dest, const guint8 * src, gint src_height,
gint src_width, gint src_stride, gint dest_stride, guint s_alpha)
{
s_alpha = MIN (255, s_alpha);
gst_videomixer_orc_blend_ayuv (dest, dest_stride, src, src_stride,
s_alpha, src_width, src_height);
}
BLEND_A32 (argb_orc, _blend_loop_argb_orc);
/* Init function */
BlendFunction gst_video_mixer_blend_argb;
BlendFunction gst_video_mixer_blend_bgra;
......@@ -815,4 +827,6 @@ gst_video_mixer_init_blend (void)
gst_video_mixer_blend_bgra = blend_bgra_mmx;
}
#endif
gst_video_mixer_blend_argb = blend_argb_orc;
}
......@@ -28,3 +28,38 @@ addw t2, t1, t2
shruw t2, t2, c1
convsuswb d1, t2
.function gst_videomixer_orc_blend_ayuv
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 2 tw
.temp 1 tb
.temp 4 a
.temp 8 d_wide
.temp 8 s_wide
.temp 8 a_wide
.const 4 c_alpha 0xffffff00
loadl t, s
convlw tw, t
convwb tb, tw
splatbl a, tb
x4 convubw a_wide, a
x4 mullw a_wide, a_wide, alpha
x4 shruw a_wide, a_wide, 8
andl t, t, c_alpha
x4 convubw s_wide, t
andl t, d, c_alpha
x4 convubw d_wide, t
x4 subw s_wide, s_wide, d_wide
x4 mullw s_wide, s_wide, a_wide
x4 div255w s_wide, s_wide
x4 addw d_wide, d_wide, s_wide
x4 convwb d, d_wide
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