From 220a947dc73d14f8773dc69dfc57f53be4e4be1b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 29 Nov 2013 19:57:46 +0100 Subject: [PATCH] videomixer: Simplify NV12/21 blending code macros --- gst/videomixer/blend.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gst/videomixer/blend.c b/gst/videomixer/blend.c index 9aaeac8..f17300e 100644 --- a/gst/videomixer/blend.c +++ b/gst/videomixer/blend.c @@ -443,7 +443,7 @@ PLANAR_YUV_FILL_CHECKER (y41b, GST_VIDEO_FORMAT_Y41B, memset); PLANAR_YUV_FILL_COLOR (y41b, GST_VIDEO_FORMAT_Y41B, memset); /* NV12, NV21 */ -#define NV_YUV_BLEND(format_name,first_component,MEMCPY,BLENDLOOP) \ +#define NV_YUV_BLEND(format_name,MEMCPY,BLENDLOOP) \ inline static void \ _blend_##format_name (const guint8 * src, guint8 * dest, \ gint src_stride, gint dest_stride, gint src_width, gint src_height, \ @@ -550,8 +550,8 @@ blend_##format_name (GstVideoFrame * srcframe, gint xpos, gint ypos, \ dest_comp_rowstride, src_comp_width, src_comp_height, \ src_alpha); \ \ - b_src = GST_VIDEO_FRAME_COMP_DATA (srcframe, first_component); \ - b_dest = GST_VIDEO_FRAME_COMP_DATA (destframe, first_component); \ + b_src = GST_VIDEO_FRAME_PLANE_DATA (srcframe, 1); \ + b_dest = GST_VIDEO_FRAME_PLANE_DATA (destframe, 1); \ src_comp_rowstride = GST_VIDEO_FRAME_COMP_STRIDE (srcframe, 1); \ dest_comp_rowstride = GST_VIDEO_FRAME_COMP_STRIDE (destframe, 1); \ src_comp_width = GST_VIDEO_FORMAT_INFO_SCALE_WIDTH(info, 1, b_src_width); \ @@ -567,7 +567,7 @@ blend_##format_name (GstVideoFrame * srcframe, gint xpos, gint ypos, \ src_alpha); \ } -#define NV_YUV_FILL_CHECKER(format_name, first_component, MEMSET) \ +#define NV_YUV_FILL_CHECKER(format_name, MEMSET) \ static void \ fill_checker_##format_name (GstVideoFrame * frame) \ { \ @@ -589,7 +589,7 @@ fill_checker_##format_name (GstVideoFrame * frame) \ p += rowstride - comp_width; \ } \ \ - p = GST_VIDEO_FRAME_COMP_DATA (frame, first_component); \ + p = GST_VIDEO_FRAME_PLANE_DATA (frame, 1); \ comp_width = GST_VIDEO_FRAME_COMP_WIDTH (frame, 1); \ comp_height = GST_VIDEO_FRAME_COMP_HEIGHT (frame, 1); \ rowstride = GST_VIDEO_FRAME_COMP_STRIDE (frame, 1); \ @@ -636,11 +636,11 @@ fill_color_##format_name (GstVideoFrame * frame, \ } \ } -NV_YUV_BLEND (nv12, 1, memcpy, video_mixer_orc_blend_u8); -NV_YUV_FILL_CHECKER (nv12, 1, memset); +NV_YUV_BLEND (nv12, memcpy, video_mixer_orc_blend_u8); +NV_YUV_FILL_CHECKER (nv12, memset); NV_YUV_FILL_COLOR (nv12, memset); -NV_YUV_BLEND (nv21, 2, memcpy, video_mixer_orc_blend_u8); -NV_YUV_FILL_CHECKER (nv21, 2, memset); +NV_YUV_BLEND (nv21, memcpy, video_mixer_orc_blend_u8); +NV_YUV_FILL_CHECKER (nv21, memset); /* RGB, BGR, xRGB, xBGR, RGBx, BGRx */ -- 2.7.4