From 9e2f23c5bc9407c5eef24513c48dd56d2d84a081 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 27 Mar 2012 17:18:40 +0200 Subject: [PATCH] effectv: fix strides --- gst/effectv/gstaging.c | 2 +- gst/effectv/gstdice.c | 1 + gst/effectv/gstrev.c | 6 +++--- gst/effectv/gstwarp.c | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gst/effectv/gstaging.c b/gst/effectv/gstaging.c index 7b8f16f..5b50a8c 100644 --- a/gst/effectv/gstaging.c +++ b/gst/effectv/gstaging.c @@ -322,7 +322,7 @@ gst_agingtv_transform_frame (GstVideoFilter * filter, GstVideoFrame * in_frame, width = GST_VIDEO_FRAME_WIDTH (in_frame); height = GST_VIDEO_FRAME_HEIGHT (in_frame); stride = GST_VIDEO_FRAME_PLANE_STRIDE (in_frame, 0); - video_size = stride * height; + video_size = stride * height / 4; src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); diff --git a/gst/effectv/gstdice.c b/gst/effectv/gstdice.c index a8ae474..d9c4f39 100644 --- a/gst/effectv/gstdice.c +++ b/gst/effectv/gstdice.c @@ -139,6 +139,7 @@ gst_dicetv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, g_map_width = filter->g_map_width; dicemap = filter->dicemap; + video_stride /= 4; map_i = 0; for (map_y = 0; map_y < g_map_height; map_y++) { diff --git a/gst/effectv/gstrev.c b/gst/effectv/gstrev.c index 315ce4a..b4b041d 100644 --- a/gst/effectv/gstrev.c +++ b/gst/effectv/gstrev.c @@ -129,7 +129,7 @@ gst_revtv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, height = GST_VIDEO_FRAME_HEIGHT (in_frame); /* Clear everything to black */ - memset (dest, 0, dstride * height * sizeof (guint32)); + memset (dest, 0, dstride * height); GST_OBJECT_LOCK (filter); linespace = filter->linespace; @@ -138,7 +138,7 @@ gst_revtv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, /* draw the offset lines */ for (y = 0; y < height; y += linespace) { for (x = 0; x <= width; x++) { - nsrc = src + (y * sstride) + x; + nsrc = src + (y * sstride / 4) + x; /* Calc Y Value for curpix */ R = ((*nsrc) & 0xff0000) >> (16 - 1); @@ -148,7 +148,7 @@ gst_revtv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, yval = y - ((short) (R + G + B) / vscale); if (yval > 0) { - dest[x + (yval * dstride)] = THE_COLOR; + dest[x + (yval * dstride / 4)] = THE_COLOR; } } } diff --git a/gst/effectv/gstwarp.c b/gst/effectv/gstwarp.c index 38d79d5..87978fb 100644 --- a/gst/effectv/gstwarp.c +++ b/gst/effectv/gstwarp.c @@ -154,8 +154,8 @@ gst_warptv_transform_frame (GstVideoFilter * filter, GstVideoFrame * in_frame, src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); - sstride = GST_VIDEO_FRAME_PLANE_STRIDE (in_frame, 0) / 4; - dstride = GST_VIDEO_FRAME_PLANE_STRIDE (out_frame, 0) / 4; + sstride = GST_VIDEO_FRAME_PLANE_STRIDE (in_frame, 0); + dstride = GST_VIDEO_FRAME_PLANE_STRIDE (out_frame, 0); width = GST_VIDEO_FRAME_WIDTH (in_frame); height = GST_VIDEO_FRAME_HEIGHT (in_frame); @@ -198,9 +198,9 @@ gst_warptv_transform_frame (GstVideoFilter * filter, GstVideoFrame * in_frame, else if (dy > maxy) dy = maxy; - dest[x] = src[dy * sstride + dx]; + dest[x] = src[dy * sstride / 4 + dx]; } - dest += dstride; + dest += dstride / 4; } warptv->tval = (warptv->tval + 1) & 511; -- 2.7.4