From: Jeongmo Yang Date: Tue, 4 Feb 2020 03:48:22 +0000 (+0900) Subject: [videoconvert] Update converting function for I420toSN12 X-Git-Tag: submit/tizen/20200204.110420^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb66f88dce2d188502fa4a0fe7b3ced684ee887f;p=platform%2Fupstream%2Fgst-plugins-base.git [videoconvert] Update converting function for I420toSN12 [Version] 1.12.2-8 [Profile] Common [Issue Type] Update Change-Id: I71e33e185881844b18de1321c45f65dbce002a3f Signed-off-by: Jeongmo Yang --- diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index 4aa97d477..a5db58373 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -5789,38 +5789,55 @@ convert_scale_planes (GstVideoConverter * convert, static void convert_I420_SN12 (GstVideoConverter * convert, const GstVideoFrame * src, - GstVideoFrame * dest ) + GstVideoFrame * dst) { - guint8 *mY, *mUV, *Y, *U, *V; - gint l1, l2; - int i, j; - gboolean interlaced = GST_VIDEO_FRAME_IS_INTERLACED (src); + guint8 *src_Y = NULL; + guint8 *src_U = NULL; + guint8 *src_V = NULL; + guint8 *dst_Y = NULL; + guint8 *dst_UV = NULL; + int i = 0; + int j = 0; gint width = convert->in_width; gint height = convert->in_height; + gint loop_count_Y = GST_ROUND_DOWN_2 (height); + gint loop_count_UV = GST_ROUND_UP_2 (width) >> 1; + + gint src_stride_Y = GST_VIDEO_FRAME_PLANE_STRIDE (src, 0); + gint src_stride_U = GST_VIDEO_FRAME_PLANE_STRIDE (src, 1); + gint src_stride_diff = src_stride_U - loop_count_UV; + + gint dst_stride_Y = GST_VIDEO_FRAME_PLANE_STRIDE (dst, 0); + gint dst_stride_UV = GST_VIDEO_FRAME_PLANE_STRIDE (dst, 1); + gint dst_stride_diff = GST_ROUND_DOWN_2 (dst_stride_UV - width); + + src_Y = GST_VIDEO_FRAME_PLANE_DATA (src, 0); + src_U = GST_VIDEO_FRAME_PLANE_DATA (src, 1); + src_V = GST_VIDEO_FRAME_PLANE_DATA (src, 2); - mY = mUV = Y = U = V = NULL; - mY = GST_VIDEO_FRAME_PLANE_DATA (dest, 0); - mUV = GST_VIDEO_FRAME_PLANE_DATA (dest, 1); + dst_Y = GST_VIDEO_FRAME_PLANE_DATA (dst, 0); + dst_UV = GST_VIDEO_FRAME_PLANE_DATA (dst, 1); - GST_DEBUG_OBJECT (convert, "%dx%d, Y %p, UV %p", width, height, mY, mUV); + GST_DEBUG_OBJECT (convert, "size %dx%d, stride src[0:%d,1:%d], dst[0:%d,1:%d]", + width, height, src_stride_Y, src_stride_U, dst_stride_Y, dst_stride_UV); - for (i = 0; i < GST_ROUND_DOWN_2 (height); i += 2) { - GET_LINE_OFFSETS (interlaced, i, l1, l2); + for (i = 0 ; i < loop_count_Y ; i += 2) { + memcpy (dst_Y, src_Y, width); + src_Y += src_stride_Y; + dst_Y += dst_stride_Y; - Y = FRAME_GET_Y_LINE (src, l1); - memcpy(mY, Y, width); - mY += width; - Y = FRAME_GET_Y_LINE (src, l2); - memcpy(mY, Y, width); - mY += width; + memcpy (dst_Y, src_Y, width); + src_Y += src_stride_Y; + dst_Y += dst_stride_Y; - U = FRAME_GET_U_LINE (src, i >> 1); - V = FRAME_GET_V_LINE (src, i >> 1); - for (j = 0; j < (width + 1) / 2; j++) { - *mUV++ = *U++; - *mUV++ = *V++; + for (j = 0 ; j < loop_count_UV ; j++) { + *dst_UV++ = *src_U++; + *dst_UV++ = *src_V++; } + src_U += src_stride_diff; + src_V += src_stride_diff; + dst_UV += dst_stride_diff; } } diff --git a/packaging/gst-plugins-base.spec b/packaging/gst-plugins-base.spec index a20f10e1d..c29bc0e41 100644 --- a/packaging/gst-plugins-base.spec +++ b/packaging/gst-plugins-base.spec @@ -5,7 +5,7 @@ Name: gst-plugins-base Version: 1.12.2 -Release: 7 +Release: 8 License: LGPL-2.0+ Summary: GStreamer Streaming-Media Framework Plug-Ins Url: http://gstreamer.freedesktop.org/