mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
vah26{4,5}enc: Set the qp_p and qp_b to qp_i value in ICQ and QVBR
Set the P and B frame qp to I frame value to avoid generating delta QP between different frame types. For ICQ and QVBR modes, we can only set the qpi value, so the qpp and qpb values should be set to the same value as the qpi. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6841>
This commit is contained in:
parent
9d23c26027
commit
7211e3fffd
2 changed files with 4 additions and 4 deletions
|
@ -629,7 +629,7 @@ _ensure_rate_control (GstVaH264Enc * self)
|
|||
switch (self->rc.rc_ctrl_mode) {
|
||||
case VA_RC_NONE:
|
||||
case VA_RC_ICQ:
|
||||
self->rc.qp_p = self->rc.qp_b = 26;
|
||||
self->rc.qp_p = self->rc.qp_b = self->rc.qp_i;
|
||||
/* Fall through. */
|
||||
case VA_RC_CQP:
|
||||
bitrate = 0;
|
||||
|
@ -648,7 +648,7 @@ _ensure_rate_control (GstVaH264Enc * self)
|
|||
self->rc.qp_i = 26;
|
||||
/* Fall through. */
|
||||
case VA_RC_QVBR:
|
||||
self->rc.qp_p = self->rc.qp_b = 26;
|
||||
self->rc.qp_p = self->rc.qp_b = self->rc.qp_i;
|
||||
self->rc.target_percentage = MAX (10, self->rc.target_percentage);
|
||||
self->rc.max_bitrate = (guint) gst_util_uint64_scale_int (bitrate,
|
||||
100, self->rc.target_percentage);
|
||||
|
|
|
@ -3373,7 +3373,7 @@ _h265_ensure_rate_control (GstVaH265Enc * self)
|
|||
switch (self->rc.rc_ctrl_mode) {
|
||||
case VA_RC_NONE:
|
||||
case VA_RC_ICQ:
|
||||
self->rc.qp_p = self->rc.qp_b = 26;
|
||||
self->rc.qp_p = self->rc.qp_b = self->rc.qp_i;
|
||||
/* Fall through. */
|
||||
case VA_RC_CQP:
|
||||
bitrate = 0;
|
||||
|
@ -3392,7 +3392,7 @@ _h265_ensure_rate_control (GstVaH265Enc * self)
|
|||
self->rc.qp_i = 26;
|
||||
/* Fall through. */
|
||||
case VA_RC_QVBR:
|
||||
self->rc.qp_p = self->rc.qp_b = 26;
|
||||
self->rc.qp_p = self->rc.qp_b = self->rc.qp_i;
|
||||
self->rc.target_percentage = MAX (10, self->rc.target_percentage);
|
||||
self->rc.max_bitrate = (guint) gst_util_uint64_scale_int (bitrate,
|
||||
100, self->rc.target_percentage);
|
||||
|
|
Loading…
Reference in a new issue