mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
decoder: h264: slightly optimize the process to detect new pictures.
Optimize the process to detect new pictures or start of new access units by checking if the previous NAL unit was the end of a picture, or the end of the previous access unit.
This commit is contained in:
parent
8ed129b8bd
commit
a208a80c29
1 changed files with 6 additions and 1 deletions
|
@ -4040,7 +4040,12 @@ gst_vaapi_decoder_h264_parse(GstVaapiDecoder *base_decoder,
|
|||
case GST_H264_NAL_SLICE_IDR:
|
||||
case GST_H264_NAL_SLICE:
|
||||
flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE;
|
||||
if (is_new_picture(pi, priv->prev_slice_pi)) {
|
||||
if (priv->prev_pi &&
|
||||
(priv->prev_pi->flags & GST_VAAPI_DECODER_UNIT_FLAG_AU_END)) {
|
||||
flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START |
|
||||
GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START;
|
||||
}
|
||||
else if (is_new_picture(pi, priv->prev_slice_pi)) {
|
||||
flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START;
|
||||
if (is_new_access_unit(pi, priv->prev_slice_pi))
|
||||
flags |= GST_VAAPI_DECODER_UNIT_FLAG_AU_START;
|
||||
|
|
Loading…
Reference in a new issue