After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785434 - omx: add H265 support on Zynq UltraScale+
omx: add H265 support on Zynq UltraScale+
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-omx
git master
Other Linux
: Normal enhancement
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-26 08:57 UTC by Guillaume Desmottes
Modified: 2017-09-06 18:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
omxh265enc: add H265 encoder (28.41 KB, patch)
2017-07-26 08:57 UTC, Guillaume Desmottes
none Details | Review
omxh265dec: add H265 decoder (11.28 KB, patch)
2017-07-26 08:57 UTC, Guillaume Desmottes
none Details | Review
omxh265enc: add H265 encoder (30.49 KB, patch)
2017-08-29 11:42 UTC, Guillaume Desmottes
none Details | Review
omxh265dec: add H265 decoder (11.23 KB, patch)
2017-08-29 11:42 UTC, Guillaume Desmottes
none Details | Review
omxh265enc: add H265 encoder (30.71 KB, patch)
2017-08-31 13:41 UTC, Guillaume Desmottes
committed Details | Review
omxh265dec: add H265 decoder (11.21 KB, patch)
2017-08-31 13:41 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2017-07-26 08:57:11 UTC
The Zynq UltraScale+ OMX stack supports HEVC so we added elements for to use it.
Comment 1 Guillaume Desmottes 2017-07-26 08:57:34 UTC
Created attachment 356404 [details] [review]
omxh265enc: add H265 encoder

The OMX spec doesn't support HEVC but the OMX stack of the
zynqultrascaleplus adds it as a custom extension.

I used the H264 encoder code as a template.
Comment 2 Guillaume Desmottes 2017-07-26 08:57:39 UTC
Created attachment 356405 [details] [review]
omxh265dec: add H265 decoder

Add HEVC decoder for the zynqultrascaleplus platform.

I used the H264 decoder code as a template.
Comment 3 Olivier Crête 2017-07-26 13:52:15 UTC
I wonder how much that matches what Android does?

https://android.googlesource.com/platform/frameworks/native/+/master/include/media/openmax/OMX_VideoExt.h

Afaik, Xilinx should implement the Android API, as this is the effective upstream of OpenMAX IL now.
Comment 4 Guillaume Desmottes 2017-08-29 11:42:18 UTC
Created attachment 358675 [details] [review]
omxh265enc: add H265 encoder

The OMX spec doesn't support HEVC but the OMX stack of the
zynqultrascaleplus adds it as a custom extension.
It uses the same API as the one of Android's OMX stack.

I used the H264 encoder code as a template.
Comment 5 Guillaume Desmottes 2017-08-29 11:42:24 UTC
Created attachment 358676 [details] [review]
omxh265dec: add H265 decoder

Add HEVC decoder for the zynqultrascaleplus platform.

I used the H264 decoder code as a template.
Comment 6 Guillaume Desmottes 2017-08-29 11:42:59 UTC
(In reply to Olivier Crête from comment #3)
> I wonder how much that matches what Android does?

This new version now uses the same API as Android.
Comment 7 Nicolas Dufresne (ndufresne) 2017-08-29 14:42:41 UTC
Review of attachment 358675 [details] [review]:

Looks fine overall, I have few question and nitpick though.

::: omx/gstomx.c
@@ +2308,3 @@
       , gst_omx_theora_dec_get_type
 #endif
+#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS

I think this one should be HAVE_HEVC instead.

::: omx/gstomxh265enc.c
@@ +90,3 @@
+#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
+  g_object_class_install_property (gobject_class, PROP_PERIODICITYOFIDRFRAMES,
+      g_param_spec_uint ("periodicty-idr", "Target Bitrate",

That one is specific to Xilinx ? I thought it was part of the spec.

@@ +98,3 @@
+
+  g_object_class_install_property (gobject_class, PROP_B_FRAMES,
+      g_param_spec_uint ("b-frames", "Number of B-frames",

There is nothing to configure b-frame in the spec ? Only in Xilinx extension ?

@@ +268,3 @@
+
+#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
+  /* GOP pattern */

This part looks like some HW specific quirks, but I can't understand what bug it's working around. Can you explain in a comment ?

@@ +300,3 @@
+  err =
+      gst_omx_component_set_parameter (GST_OMX_VIDEO_ENC (self)->enc,
+      (OMX_INDEXTYPE) OMX_ALG_IndexParamVideoHevc, &param);

This is identical, why do ALG needed to fork this part ? Can we use a #define instead ?
Comment 8 Nicolas Dufresne (ndufresne) 2017-08-29 14:44:03 UTC
Review of attachment 358676 [details] [review]:

That one is pretty small, looks good, just unsure about a ifdef.

::: omx/gstomx.c
@@ +2309,3 @@
       , gst_omx_theora_dec_get_type
 #endif
 #ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS

HAVE_HEVC ?
Comment 9 Guillaume Desmottes 2017-08-30 14:33:03 UTC
Review of attachment 358675 [details] [review]:

::: omx/gstomx.c
@@ +2308,3 @@
       , gst_omx_theora_dec_get_type
 #endif
+#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS

indeed. Fixed.

::: omx/gstomxh265enc.c
@@ +90,3 @@
+#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
+  g_object_class_install_property (gobject_class, PROP_PERIODICITYOFIDRFRAMES,
+      g_param_spec_uint ("periodicty-idr", "Target Bitrate",

The spec defines OMX_VIDEO_CONFIG_AVCINTRAPERIOD which is AVC specific so Allegro defined its own extension for it.

@@ +98,3 @@
+
+  g_object_class_install_property (gobject_class, PROP_B_FRAMES,
+      g_param_spec_uint ("b-frames", "Number of B-frames",

No, the spec API is AVC specific: OMX_VIDEO_PARAM_AVCTYPE.

@@ +268,3 @@
+
+#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
+  /* GOP pattern */

Limitation of the Android API. I added a comment.

@@ +300,3 @@
+  err =
+      gst_omx_component_set_parameter (GST_OMX_VIDEO_ENC (self)->enc,
+      (OMX_INDEXTYPE) OMX_ALG_IndexParamVideoHevc, &param);

The param arg is different so they use another index to make this clearer. I added a comment and used a #define.
Comment 10 Guillaume Desmottes 2017-08-30 14:37:56 UTC
Review of attachment 358676 [details] [review]:

::: omx/gstomx.c
@@ +2309,3 @@
       , gst_omx_theora_dec_get_type
 #endif
 #ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS

Yep fixed that as well.
Comment 11 Guillaume Desmottes 2017-08-31 13:41:24 UTC
Created attachment 358855 [details] [review]
omxh265enc: add H265 encoder

The OMX spec doesn't support HEVC but the OMX stack of the
zynqultrascaleplus adds it as a custom extension.
It uses the same API as the one of Android's OMX stack.

I used the H264 encoder code as a template.
Comment 12 Guillaume Desmottes 2017-08-31 13:41:30 UTC
Created attachment 358856 [details] [review]
omxh265dec: add H265 decoder

Add HEVC decoder for the zynqultrascaleplus platform.

I used the H264 decoder code as a template.
Comment 13 Nicolas Dufresne (ndufresne) 2017-09-06 18:53:03 UTC
Attachment 358855 [details] pushed as cf9f190 - omxh265enc: add H265 encoder
Attachment 358856 [details] pushed as 5751001 - omxh265dec: add H265 decoder

Thanks