vaenc: Allow to set the max-qp and min-qp for QVBR and ICQ modes

In fact, these setting can work well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6841>
This commit is contained in:
He Junyan 2024-05-14 10:54:03 +08:00
parent 7211e3fffd
commit fc3f5a2f09
5 changed files with 0 additions and 46 deletions

View file

@ -2620,17 +2620,6 @@ _av1_ensure_rate_control (GstVaAV1Enc * self)
self->rc.rc_ctrl_mode = VA_RC_NONE;
}
/* ICQ mode and QVBR mode do not need max/min qp. */
if (self->rc.rc_ctrl_mode == VA_RC_ICQ || self->rc.rc_ctrl_mode == VA_RC_QVBR) {
self->rc.min_qindex = 0;
self->rc.max_qindex = 255;
update_property_uint (base, &self->prop.min_qp, self->rc.min_qindex,
PROP_MIN_QP);
update_property_uint (base, &self->prop.max_qp, self->rc.max_qindex,
PROP_MAX_QP);
}
if (self->rc.min_qindex > self->rc.max_qindex) {
GST_INFO_OBJECT (self, "The min_qindex %d is bigger than the max_qindex"
" %d, set it to the max_qindex", self->rc.min_qindex,

View file

@ -985,10 +985,8 @@ gst_va_base_enc_add_rate_control_parameter (GstVaBaseEnc * base,
/* *INDENT-ON* */
if (rc_mode == VA_RC_ICQ) {
g_assert (min_qp == 0);
rate_control.rate_control.ICQ_quality_factor = qp_i;
} else if (rc_mode == VA_RC_QVBR) {
g_assert (min_qp == 0);
rate_control.rate_control.quality_factor = qp_i;
} else {
rate_control.rate_control.initial_qp = qp_i;

View file

@ -537,17 +537,6 @@ _ensure_rate_control (GstVaH264Enc * self)
self->rc.rc_ctrl_mode = VA_RC_NONE;
}
/* ICQ mode and QVBR mode do not need max/min qp. */
if (self->rc.rc_ctrl_mode == VA_RC_ICQ || self->rc.rc_ctrl_mode == VA_RC_QVBR) {
self->rc.min_qp = 0;
self->rc.max_qp = 51;
update_property_uint (base, &self->prop.min_qp, self->rc.min_qp,
PROP_MIN_QP);
update_property_uint (base, &self->prop.max_qp, self->rc.max_qp,
PROP_MAX_QP);
}
if (self->rc.min_qp > self->rc.max_qp) {
GST_INFO_OBJECT (self, "The min_qp %d is bigger than the max_qp %d, "
"set it to the max_qp", self->rc.min_qp, self->rc.max_qp);

View file

@ -3273,17 +3273,6 @@ _h265_ensure_rate_control (GstVaH265Enc * self)
self->rc.rc_ctrl_mode = VA_RC_NONE;
}
/* ICQ mode and QVBR mode do not need max/min qp. */
if (self->rc.rc_ctrl_mode == VA_RC_ICQ || self->rc.rc_ctrl_mode == VA_RC_QVBR) {
self->rc.min_qp = 0;
self->rc.max_qp = 51;
update_property_uint (base, &self->prop.min_qp, self->rc.min_qp,
PROP_MIN_QP);
update_property_uint (base, &self->prop.max_qp, self->rc.max_qp,
PROP_MAX_QP);
}
if (self->rc.min_qp > self->rc.max_qp) {
GST_INFO_OBJECT (self, "The min_qp %d is bigger than the max_qp %d, "
"set it to the max_qp", self->rc.min_qp, self->rc.max_qp);

View file

@ -1913,17 +1913,6 @@ _vp9_ensure_rate_control (GstVaVp9Enc * self)
self->rc.rc_ctrl_mode = VA_RC_NONE;
}
/* ICQ mode and QVBR mode do not need max/min qp. */
if (self->rc.rc_ctrl_mode == VA_RC_ICQ || self->rc.rc_ctrl_mode == VA_RC_QVBR) {
self->rc.min_qindex = 0;
self->rc.max_qindex = 255;
update_property_uint (base, &self->prop.min_qp, self->rc.min_qindex,
PROP_MIN_QP);
update_property_uint (base, &self->prop.max_qp, self->rc.max_qindex,
PROP_MAX_QP);
}
if (self->rc.min_qindex > self->rc.max_qindex) {
GST_INFO_OBJECT (self, "The min_qindex %d is bigger than the max_qindex"
" %d, set it to the max_qindex", self->rc.min_qindex,