Discussion:
[Bug 778732] New: [gst-vaapi][encoder]Add Encoder VBR feature in GStreamer-VAAPI for AVC/VP8/HEVC/VP9
(too old to reply)
"GStreamer" (GNOME Bugzilla)
2017-02-16 02:26:16 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Bug ID: 778732
Summary: [gst-vaapi][encoder]Add Encoder VBR feature in
GStreamer-VAAPI for AVC/VP8/HEVC/VP9
Classification: Platform
Product: GStreamer
Version: unspecified
OS: other
Status: NEW
Severity: major
Priority: Normal
Component: gstreamer-vaapi
Assignee: gstreamer-***@lists.freedesktop.org
Reporter: ***@intel.com
QA Contact: gstreamer-***@lists.freedesktop.org
CC: ***@gmail.com, ***@igalia.com
GNOME version: ---

The request is about VBR.As the encoder in VAAPI driver is improved and new
feature VBR is added for AVC/VP8/HEVC. Now upstreaming is on-going. here VP9 is
ready in driver. The middleware should support this.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-02-16 08:56:55 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Tim-Philipp Müller <***@zen.co.uk> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@zen.co.uk
Summary|[gst-vaapi][encoder]Add |Encoders: add VBR feature
|Encoder VBR feature in |for AVC/VP8/HEVC/VP9
|GStreamer-VAAPI for |
|AVC/VP8/HEVC/VP9 |
Severity|major |enhancement
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-02-17 05:48:57 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Hyunjun Ko <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@igalia.com
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-05-24 14:16:15 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

--- Comment #3 from Hyunjun Ko <***@igalia.com> ---
Note that, regarding vp9, there was already the issue.
See bug #766832
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-05-24 14:14:02 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

--- Comment #1 from Hyunjun Ko <***@igalia.com> ---
Created attachment 352506
--> https://bugzilla.gnome.org/attachment.cgi?id=352506&action=edit
libs: encoder: h265: Adds VBR Encoding support

Enables Variable BitRate mode, which does set FrameRate and RateControl
parameters.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-05-24 14:14:36 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

--- Comment #2 from Hyunjun Ko <***@igalia.com> ---
Created attachment 352507
--> https://bugzilla.gnome.org/attachment.cgi?id=352507&action=edit
libs: encoder: vp8: Adds VBR Encoding support
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-05-31 14:32:58 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #352506|none |reviewed
status| |
Attachment #352506|none |reviewed
status| |

--- Comment #4 from Víctor Manuel Jáquez Leal <***@igalia.com> ---
Review of attachment 352506:
--> (https://bugzilla.gnome.org/review?bug=778732&attachment=352506)

a couple comments

::: gst-libs/gst/vaapi/gstvaapiencoder_h265.c
@@ +1579,2 @@
pic_param->pic_fields.bits.cu_qp_delta_enabled_flag = TRUE;
+

since coding unit quantization parameter changes are required for
non-constant-QP modes, I would rewrite this as

pic_param->pic_fields.bits.cu_qp_delta_enabled_flag =
GST_VAAPI_ENCODER_RATE_CONTROL (encoder) != GST_VAAPI_RATECONTROL_CQP;

@@ +1805,3 @@
+ memset (rate_control, 0, sizeof (VAEncMiscParameterRateControl));
+ rate_control->bits_per_second = encoder->bitrate_bits;
+ rate_control->target_percentage = 70;

I'm a bit worried about this target_percentage, the hard-coded value (70) it is
copied again and again like a some kind of cargo cult.

/* this is the bit-rate the rate control is targeting, as a percentage of
the maximum
* bit-rate for example if target_percentage is 95 then the rate control
will target
* a bit-rate that is 95% of the maximum bit-rate
*/

looking at the ffmpeg implementation of the vaapi encoder, the
target_percentage is 100% if the rate-control is CBR. Otherwise a ad-hoc
formula is used.

--- Comment #5 from Víctor Manuel Jáquez Leal <***@igalia.com> ---
Review of attachment 352506:
--> (https://bugzilla.gnome.org/review?bug=778732&attachment=352506)

a couple comments

::: gst-libs/gst/vaapi/gstvaapiencoder_h265.c
@@ +1579,2 @@
pic_param->pic_fields.bits.cu_qp_delta_enabled_flag = TRUE;
+

since coding unit quantization parameter changes are required for
non-constant-QP modes, I would rewrite this as

pic_param->pic_fields.bits.cu_qp_delta_enabled_flag =
GST_VAAPI_ENCODER_RATE_CONTROL (encoder) != GST_VAAPI_RATECONTROL_CQP;

@@ +1805,3 @@
+ memset (rate_control, 0, sizeof (VAEncMiscParameterRateControl));
+ rate_control->bits_per_second = encoder->bitrate_bits;
+ rate_control->target_percentage = 70;

I'm a bit worried about this target_percentage, the hard-coded value (70) it is
copied again and again like a some kind of cargo cult.

/* this is the bit-rate the rate control is targeting, as a percentage of
the maximum
* bit-rate for example if target_percentage is 95 then the rate control
will target
* a bit-rate that is 95% of the maximum bit-rate
*/

looking at the ffmpeg implementation of the vaapi encoder, the
target_percentage is 100% if the rate-control is CBR. Otherwise a ad-hoc
formula is used.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-05-31 14:32:50 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #352506|none |reviewed
status| |

--- Comment #4 from Víctor Manuel Jáquez Leal <***@igalia.com> ---
Review of attachment 352506:
--> (https://bugzilla.gnome.org/review?bug=778732&attachment=352506)

a couple comments

::: gst-libs/gst/vaapi/gstvaapiencoder_h265.c
@@ +1579,2 @@
pic_param->pic_fields.bits.cu_qp_delta_enabled_flag = TRUE;
+

since coding unit quantization parameter changes are required for
non-constant-QP modes, I would rewrite this as

pic_param->pic_fields.bits.cu_qp_delta_enabled_flag =
GST_VAAPI_ENCODER_RATE_CONTROL (encoder) != GST_VAAPI_RATECONTROL_CQP;

@@ +1805,3 @@
+ memset (rate_control, 0, sizeof (VAEncMiscParameterRateControl));
+ rate_control->bits_per_second = encoder->bitrate_bits;
+ rate_control->target_percentage = 70;

I'm a bit worried about this target_percentage, the hard-coded value (70) it is
copied again and again like a some kind of cargo cult.

/* this is the bit-rate the rate control is targeting, as a percentage of
the maximum
* bit-rate for example if target_percentage is 95 then the rate control
will target
* a bit-rate that is 95% of the maximum bit-rate
*/

looking at the ffmpeg implementation of the vaapi encoder, the
target_percentage is 100% if the rate-control is CBR. Otherwise a ad-hoc
formula is used.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-05-31 14:40:41 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #352507|none |needs-work
status| |

--- Comment #6 from Víctor Manuel Jáquez Leal <***@igalia.com> ---
Review of attachment 352507:
--> (https://bugzilla.gnome.org/review?bug=778732&attachment=352507)

::: gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
@@ +224,3 @@

+ if (GST_VAAPI_ENCODER_RATE_CONTROL (encoder) & GST_VAAPI_RATECONTROL_CBR ||
+ GST_VAAPI_ENCODER_RATE_CONTROL (encoder) & GST_VAAPI_RATECONTROL_VBR)

This is wrong: GstVaapiRateControl is not a bitwise enum, is a normal enum. So
no bitwise operations are allowed

@@ +271,3 @@

+ if (GST_VAAPI_ENCODER_RATE_CONTROL (encoder) != GST_VAAPI_RATECONTROL_CBR &&
+ GST_VAAPI_ENCODER_RATE_CONTROL (encoder) != GST_VAAPI_RATECONTROL_VBR)

why not just

if (GST_VAAPI_ENCODER_RATE_CONTROL (encoder) == GST_VAAPI_RATECONTROL_CQP)
return;

??
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-05-31 17:20:29 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Whiteboard| |P1
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-01 03:28:29 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

--- Comment #7 from Hyunjun Ko <***@igalia.com> ---
(In reply to Víctor Manuel Jáquez Leal from comment #5)
Post by "GStreamer" (GNOME Bugzilla)
a couple comments
::: gst-libs/gst/vaapi/gstvaapiencoder_h265.c
@@ +1579,2 @@
pic_param->pic_fields.bits.cu_qp_delta_enabled_flag = TRUE;
+
since coding unit quantization parameter changes are required for
non-constant-QP modes, I would rewrite this as
pic_param->pic_fields.bits.cu_qp_delta_enabled_flag =
GST_VAAPI_ENCODER_RATE_CONTROL (encoder) != GST_VAAPI_RATECONTROL_CQP;
I like this better. Thanks!
Post by "GStreamer" (GNOME Bugzilla)
@@ +1805,3 @@
+ memset (rate_control, 0, sizeof (VAEncMiscParameterRateControl));
+ rate_control->bits_per_second = encoder->bitrate_bits;
+ rate_control->target_percentage = 70;
I'm a bit worried about this target_percentage, the hard-coded value (70) it
is copied again and again like a some kind of cargo cult.
/* this is the bit-rate the rate control is targeting, as a percentage
of the maximum
* bit-rate for example if target_percentage is 95 then the rate control
will target
* a bit-rate that is 95% of the maximum bit-rate
*/
looking at the ffmpeg implementation of the vaapi encoder, the
target_percentage is 100% if the rate-control is CBR. Otherwise a ad-hoc
formula is used.
I agree with your concern. Probably we can think about this more and provide
another patch only for this, including h264/h265/vp8/vp9.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-02 04:53:35 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Hyunjun Ko <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #352506|reviewed |none
status| |
Attachment #352506|0 |1
is obsolete| |

--- Comment #8 from Hyunjun Ko <***@igalia.com> ---
Created attachment 353042
--> https://bugzilla.gnome.org/attachment.cgi?id=353042&action=edit
libs: encoder: h265: Adds VBR Encoding support

Enables Variable BitRate mode, which does set FrameRate and RateControl
parameters.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-02 04:54:04 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Hyunjun Ko <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #352507|needs-work |none
status| |
Attachment #352507|0 |1
is obsolete| |

--- Comment #9 from Hyunjun Ko <***@igalia.com> ---
Created attachment 353043
--> https://bugzilla.gnome.org/attachment.cgi?id=353043&action=edit
libs: encoder: vp8: Adds VBR Encoding support
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-02 04:54:48 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

--- Comment #10 from Hyunjun Ko <***@igalia.com> ---
Created attachment 353044
--> https://bugzilla.gnome.org/attachment.cgi?id=353044&action=edit
libs: encoder: Describes more detail about the bitrate property
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-02 09:15:06 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Hyunjun Ko <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #353042|0 |1
is obsolete| |

--- Comment #11 from Hyunjun Ko <***@igalia.com> ---
Created attachment 353056
--> https://bugzilla.gnome.org/attachment.cgi?id=353056&action=edit
libs: encoder: h265: Adds VBR Encoding support
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-02 09:15:33 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Hyunjun Ko <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #353043|0 |1
is obsolete| |

--- Comment #12 from Hyunjun Ko <***@igalia.com> ---
Created attachment 353057
--> https://bugzilla.gnome.org/attachment.cgi?id=353057&action=edit
libs: encoder: vp8: Adds VBR Encoding support
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-05 19:00:49 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Depends on| |783449
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 08:41:42 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #353057|0 |1
is obsolete| |

--- Comment #14 from Víctor Manuel Jáquez Leal <***@igalia.com> ---
Created attachment 353296
--> https://bugzilla.gnome.org/attachment.cgi?id=353296&action=edit
libs: encoder: vp8: Adds VBR Encoding support
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 08:41:37 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #353056|0 |1
is obsolete| |

--- Comment #13 from Víctor Manuel Jáquez Leal <***@igalia.com> ---
Created attachment 353295
--> https://bugzilla.gnome.org/attachment.cgi?id=353295&action=edit
libs: encoder: h265: Adds VBR Encoding support

Enables Variable BitRate mode, which does set FrameRate and RateControl
parameters.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 08:42:20 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #353044|none |accepted-commit_now
status| |
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 08:43:47 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Summary|Encoders: add VBR feature |Encoders: add VBR feature
|for AVC/VP8/HEVC/VP9 |for AVC/VP8/HEVC
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 08:44:16 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://bugzilla.gnome.org/
| |show_bug.cgi?id=766832
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 15:37:47 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732
Bug 778732 depends on bug 783449, which changed state.

Bug 783449 Summary: libs: encoder: refactor buffer parameters assignation
https://bugzilla.gnome.org/show_bug.cgi?id=783449

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 15:39:43 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED

--- Comment #15 from Víctor Manuel Jáquez Leal <***@igalia.com> ---
y # Bug 778732 - Encoders: add VBR feature for AVC/VP8/HEVC - NEW

Attachment 353044 pushed as cbd912b - libs: encoder: Describes more detail
about the bitrate property
Attachment 353295 pushed as f68d045 - libs: encoder: h265: Adds VBR Encoding
support
Attachment 353296 pushed as 5d345b0 - libs: encoder: vp8: Adds VBR Encoding
support
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 15:39:47 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #353296|none |committed
status| |
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 15:39:52 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #353044|accepted-commit_now |committed
status| |
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 15:39:56 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #353295|none |committed
status| |
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2017-06-07 15:42:18 UTC
Permalink
Raw Message
https://bugzilla.gnome.org/show_bug.cgi?id=778732

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|git master |1.13.1
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
Loading...