mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 06:26:23 +00:00
libs: decoder: h264: reduce frame number of gaps
Reduce frame num gaps so that we don't have to create unnecessary dummy pictures, just throw them away. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=777506
This commit is contained in:
parent
b0016e336b
commit
d89a3bd258
1 changed files with 15 additions and 2 deletions
|
@ -3137,6 +3137,7 @@ fill_picture_gaps (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture,
|
|||
GstVaapiDecoderH264Private *const priv = &decoder->priv;
|
||||
GstH264SPS *const sps = get_sps (decoder);
|
||||
const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4);
|
||||
gint32 prev_frame_num;
|
||||
GstVaapiFrameStore *prev_frame;
|
||||
GstVaapiPicture *base_picture;
|
||||
GstVaapiPictureH264 *lost_picture, *prev_picture;
|
||||
|
@ -3164,8 +3165,20 @@ fill_picture_gaps (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture,
|
|||
lost_slice_hdr.dec_ref_pic_marking.adaptive_ref_pic_marking_mode_flag = 0;
|
||||
|
||||
/* XXX: this process is incorrect for MVC */
|
||||
/* XXX: optimize to reduce the number of dummy pictures created */
|
||||
priv->frame_num = priv->prev_ref_frame_num;
|
||||
/* Reduce frame num gaps so we don't have to create unnecessary
|
||||
* dummy pictures */
|
||||
prev_frame_num = priv->prev_ref_frame_num;
|
||||
if (prev_frame_num > slice_hdr->frame_num)
|
||||
prev_frame_num -= MaxFrameNum;
|
||||
|
||||
if ((slice_hdr->frame_num - prev_frame_num) - 1 > sps->num_ref_frames) {
|
||||
prev_frame_num = (slice_hdr->frame_num - sps->num_ref_frames) - 1;
|
||||
|
||||
if (prev_frame_num < 0)
|
||||
prev_frame_num += MaxFrameNum;
|
||||
}
|
||||
priv->frame_num = prev_frame_num;
|
||||
|
||||
for (;;) {
|
||||
priv->prev_ref_frame_num = priv->frame_num;
|
||||
priv->frame_num = (priv->prev_ref_frame_num + 1) % MaxFrameNum;
|
||||
|
|
Loading…
Reference in a new issue