[Bug 760270] videoparse: add support of padded video
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Wed Jan 27 04:50:28 PST 2016
https://bugzilla.gnome.org/show_bug.cgi?id=760270
--- Comment #23 from Aurélien Zanelli <aurelien.zanelli at parrot.com> ---
(In reply to Nicolas Dufresne (stormer) from comment #22)
> (In reply to Aurélien Zanelli from comment #21)
> > stdlib is needed for atoi function used to parse stride/offset string but
> > stdio was not needed so I remove it.
>
> Make sense. Would it possible to port to g_ascii_strtoll() or
> g_ascii_strtoull(), just to make sure we stay portable (maybe I'm over
> worried here ?)
No problem to port it, in fact I found we often use these functions to parse
int. After some research, it seems they have more error checking that atoi.
> > > For I420, GStreamer defaults add an empty line, which imho is acceptable no
> > > to have. It's a minor issue though.
> > I'm not sure I understand what you mean here.
> > Do you mean the 'empty line' added by the round up of height when it's no a
> > multiple of 2 ?
> > In this case, it seems right to do that, no ?
>
> So, what we do in GStreamer as a default for I420 and YV12 is:
>
> info->offset[1] = info->stride[0] * GST_ROUND_UP_2 (height);
>
> This effectively skip a line. Skipping this line has no effect on memory
> alignment. Odd and even lines have the same memory alignment. I don't really
> know the origin of this.
In my current understanding, it's due to the subsampling of 4:2:0 formats:
If we have a NxN luma plane, U and V planes have a size of (N/2)x(N/2) since
1 chroma sample is mapped to a 2x2 squared luma sample.
So, for me, it implies that luma plane width and height should be at least
multiple of two.
So I think we round up U/V plane offset to be more portable as some elements
may not like an odd number of lines.
We may CC Wim here to have more details on that. And by the way, it is the same
for NV12/NV21 formats.
> An offset 0 to 0 and offset 1 to (even if height is odd):
>
> info->offset[1] = info->stride[0] * height;
>
> Would be completely valid. In fact this is what you get from GLMemory. So
> basically, this is one case where the GStreamer default offset is not the
> minimum acceptable offset. The minimum acceptable offset is (for i <
> (num_planes -1)):
>
> offset[i + 1] = offset[i] + height * stride[i]
I think, there is no issue to handle this special case in videoparse so I will
do it.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list