gst-plugins-base: video: respect stride alignment when calculating planes offsets

Edward Hervey bilboed at gmail.com
Thu Jul 18 23:50:39 PDT 2013


This commit causes chroma distortion on most files here :(

Attached is an example

  Edward

On Thu, 2013-07-18 at 07:23 -0700, Sebastian Dröge wrote:
> Module: gst-plugins-base
> Branch: master
> Commit: 28e1dadbfaa403679e69f8173d1aa2c7500fd556
> URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=28e1dadbfaa403679e69f8173d1aa2c7500fd556
> 
> Author: Arnaud Vrac <avrac at freebox.fr>
> Date:   Thu Jul 18 14:13:33 2013 +0200
> 
> video: respect stride alignment when calculating planes offsets
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=694299
> 
> ---
> 
>  gst-libs/gst/video/video-info.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c
> index 25fb47a..4f569ed 100644
> --- a/gst-libs/gst/video/video-info.c
> +++ b/gst-libs/gst/video/video-info.c
> @@ -767,6 +767,7 @@ gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align)
>  
>    for (i = 0; i < n_planes; i++) {
>      gint vedge, hedge, comp;
> +    guint offset;
>  
>      /* Find the component for this plane, FIXME, we assume the plane number and
>       * component number is the same for now, for scaling the dimensions this is
> @@ -780,10 +781,15 @@ gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align)
>      vedge =
>          GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (vinfo, comp, align->padding_top);
>  
> -    GST_DEBUG ("plane %d: comp: %d, hedge %d vedge %d align %d stride %d", i,
> -        comp, hedge, vedge, align->stride_align[i], info->stride[i]);
> -
> -    info->offset[i] += (vedge * info->stride[i]) +
> +    offset = (vedge * info->stride[i]) +
>          (hedge * GST_VIDEO_FORMAT_INFO_PSTRIDE (vinfo, comp));
> +
> +    offset = (offset + align->stride_align[i]) & ~align->stride_align[i];
> +
> +    GST_DEBUG ("plane %d: comp: %d, hedge %d vedge %d align %d stride %d "
> +        "offset %u", i, comp, hedge, vedge, align->stride_align[i],
> +        info->stride[i], offset);
> +
> +    info->offset[i] += offset;
>    }
>  }
> 
> _______________________________________________
> gstreamer-commits mailing list
> gstreamer-commits at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-commits

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2013-07-19 08:49:07.png
Type: image/png
Size: 283820 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130719/42af7093/attachment-0001.png>


More information about the gstreamer-devel mailing list