mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
codecs: h264dec: Add a flag to record whether picture is reference.
The picture->ref field will change from time to time according to decoder's state and reference sliding window. We need another flag to record whether the picture is a reference picture when it is created, and this can help the bumping check. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>
This commit is contained in:
parent
b4e3887449
commit
be223ad316
3 changed files with 11 additions and 2 deletions
|
@ -2199,6 +2199,7 @@ gst_h264_decoder_init_gap_picture (GstH264Decoder * self,
|
||||||
picture->frame_num = picture->pic_num = frame_num;
|
picture->frame_num = picture->pic_num = frame_num;
|
||||||
picture->dec_ref_pic_marking.adaptive_ref_pic_marking_mode_flag = FALSE;
|
picture->dec_ref_pic_marking.adaptive_ref_pic_marking_mode_flag = FALSE;
|
||||||
picture->ref = GST_H264_PICTURE_REF_SHORT_TERM;
|
picture->ref = GST_H264_PICTURE_REF_SHORT_TERM;
|
||||||
|
picture->ref_pic = TRUE;
|
||||||
picture->dec_ref_pic_marking.long_term_reference_flag = FALSE;
|
picture->dec_ref_pic_marking.long_term_reference_flag = FALSE;
|
||||||
picture->field = GST_H264_PICTURE_FIELD_FRAME;
|
picture->field = GST_H264_PICTURE_FIELD_FRAME;
|
||||||
|
|
||||||
|
|
|
@ -707,7 +707,7 @@ gst_h264_dpb_needs_bump (GstH264Dpb * dpb, GstH264Picture * to_insert,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (to_insert->ref != GST_H264_PICTURE_REF_NONE) {
|
if (to_insert->ref_pic) {
|
||||||
GST_TRACE ("No empty frame buffer for ref frame, need bumping.");
|
GST_TRACE ("No empty frame buffer for ref frame, need bumping.");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1055,7 +1055,13 @@ gst_h264_picture_set_reference (GstH264Picture * picture,
|
||||||
g_return_if_fail (picture != NULL);
|
g_return_if_fail (picture != NULL);
|
||||||
|
|
||||||
picture->ref = reference;
|
picture->ref = reference;
|
||||||
|
if (reference > GST_H264_PICTURE_REF_NONE)
|
||||||
|
picture->ref_pic = TRUE;
|
||||||
|
|
||||||
if (other_field && picture->other_field)
|
if (other_field && picture->other_field) {
|
||||||
picture->other_field->ref = reference;
|
picture->other_field->ref = reference;
|
||||||
|
|
||||||
|
if (reference > GST_H264_PICTURE_REF_NONE)
|
||||||
|
picture->other_field->ref_pic = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,6 +143,8 @@ struct _GstH264Picture
|
||||||
gboolean idr;
|
gboolean idr;
|
||||||
gint idr_pic_id;
|
gint idr_pic_id;
|
||||||
GstH264PictureReference ref;
|
GstH264PictureReference ref;
|
||||||
|
/* Whether a reference picture. */
|
||||||
|
gboolean ref_pic;
|
||||||
gboolean needed_for_output;
|
gboolean needed_for_output;
|
||||||
gboolean mem_mgmt_5;
|
gboolean mem_mgmt_5;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue