NVDEC and 10-bit HEVC decode

Matthew Waters ystreet00 at gmail.com
Mon Jun 25 12:51:37 UTC 2018


On 25/06/18 20:47, Samuel Hurst wrote:
> On 23/06/18 01:16, Matthew Waters wrote:
>> Almost :)
>>
>> You want to add 16-bit formats to GstGL rather than 10/12-bit formats.
>> Either that or you need to convert in the decoder to 10/12-bit.
>
> So should I instead create a new GST_VIDEO_FORMAT_P016, which is then
> converted to GST_GL_RGB16? How do I tie the new format to be 16-bit
> per component instead of 8-bit, or is this just automagically decided
> in the GL core?

8-bit vs 16-bit is decided based on the format one creates the texture
with and by the data/parameters passed to upload.  By default the
unsized formats are 8-bit (RGBA, RGB, RG, RED) and there are different
sized formats that can be used (RGBA8, RGBA16, etc).  The other variable
is the type which can be bytes (8-bit), short (16-bit), complex
(UNSIGNED_SHORT_565), etc that can also indicate how data is split up. 
There is a table in the OpenGL specifications that outlines what
(unsized format, type, sized format) combinations are valid (which can
be modified by GL extensions).  GStreamer mostly keeps the formats
(unsized+type vs sized) fairly well aligned (same number of components,
pixel strides equal, etc) so the GL driver doesn't need to convert.

> What else would I need to do to add this to the GST video format code?
> Presumably I'd need to add a pack/unpack routine into
> gst-libs/gst/video/video-format.c? Hopefully, this should just be a
> case of copying the NV12 routines and making them work for 16-bit
> variables?
>
> I'm guessing something like this:
> https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=388b48511e90e008138e1842640b76934bd891dc

You might be able to find an easier one but the structure would be the
same as that, yes.  Creating a NV12 format for 16-bit values would be
the way to go.

>> Here's a similar commit for adding ARGB64 support with RGBA16 textures:
>> https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/gst-libs/gst/gl?id=3cfff727b19d450898dbe7931c53ea05bc2a9ac3.
>>
>> Of which I just noticed a bug of it possibly adding the YUY2/UYVY
>> formats twice!
>
> Thanks, I was messing around in the right bits then :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180625/122e160d/attachment.sig>


More information about the gstreamer-devel mailing list