mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-05-16 23:42:54 +00:00
vah264enc: Set the trellis only when HW supports it
This commit is contained in:
parent
90c9e66e9d
commit
9f9625bbc8
|
@ -178,6 +178,7 @@ struct _GstVaH264Enc
|
|||
guint min_cr;
|
||||
gboolean use_cabac;
|
||||
gboolean use_dct8x8;
|
||||
gboolean support_trellis;
|
||||
gboolean use_trellis;
|
||||
gboolean aud;
|
||||
gboolean cc;
|
||||
|
@ -781,9 +782,9 @@ _validate_parameters (GstVaH264Enc * self)
|
|||
self->num_slices, PROP_NUM_SLICES);
|
||||
|
||||
/* Ensure trellis. */
|
||||
if (self->use_trellis &&
|
||||
!gst_va_encoder_has_trellis (base->encoder, base->profile,
|
||||
GST_VA_BASE_ENC_ENTRYPOINT (base))) {
|
||||
self->support_trellis = gst_va_encoder_has_trellis (base->encoder,
|
||||
base->profile, GST_VA_BASE_ENC_ENTRYPOINT (base));
|
||||
if (self->use_trellis && !self->support_trellis) {
|
||||
GST_INFO_OBJECT (self, "The trellis is not supported");
|
||||
self->use_trellis = FALSE;
|
||||
}
|
||||
|
@ -1530,6 +1531,7 @@ gst_va_h264_enc_reset_state (GstVaBaseEnc * base)
|
|||
self->level_str = NULL;
|
||||
self->mb_width = 0;
|
||||
self->mb_height = 0;
|
||||
self->support_trellis = FALSE;
|
||||
|
||||
self->gop.i_period = 0;
|
||||
self->gop.total_idr_count = 0;
|
||||
|
@ -2950,8 +2952,8 @@ _encode_one_frame (GstVaH264Enc * self, GstVideoCodecFrame * gst_frame)
|
|||
self->rc.rc_ctrl_mode, self->rc.cpb_length_bits))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_va_base_enc_add_trellis_parameter (base, frame->picture,
|
||||
self->use_trellis))
|
||||
if (self->support_trellis && !gst_va_base_enc_add_trellis_parameter (base,
|
||||
frame->picture, self->use_trellis))
|
||||
return FALSE;
|
||||
|
||||
_fill_sequence_param (self, &sequence);
|
||||
|
|
Loading…
Reference in a new issue