codecs: h264picture: Add more trace log
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1768>
This commit is contained in:
parent
cba368785b
commit
0e53668a9b
@ -611,14 +611,32 @@ gst_h264_decoder_handle_frame_num_gap (GstH264Decoder * self, gint frame_num)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (priv->prev_ref_frame_num == frame_num) {
|
||||||
|
GST_TRACE_OBJECT (self,
|
||||||
|
"frame_num == PrevRefFrameNum (%d), not a gap", frame_num);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((priv->prev_ref_frame_num + 1) % priv->max_frame_num) == frame_num) {
|
||||||
|
GST_TRACE_OBJECT (self,
|
||||||
|
"frame_num == (PrevRefFrameNum + 1) %% MaxFrameNum (%d), not a gap",
|
||||||
|
frame_num);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gst_h264_dpb_get_size (priv->dpb) == 0) {
|
||||||
|
GST_TRACE_OBJECT (self, "DPB is empty, not a gap");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!sps->gaps_in_frame_num_value_allowed_flag) {
|
if (!sps->gaps_in_frame_num_value_allowed_flag) {
|
||||||
/* This is likely the case where some frames were dropped.
|
/* This is likely the case where some frames were dropped.
|
||||||
* then we need to keep decoding without error out */
|
* then we need to keep decoding without error out */
|
||||||
GST_WARNING_OBJECT (self, "Invalid frame num %d", frame_num);
|
GST_WARNING_OBJECT (self, "Invalid frame num %d", frame_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Handling frame num gap %d -> %d",
|
GST_DEBUG_OBJECT (self, "Handling frame num gap %d -> %d (MaxFrameNum: %d)",
|
||||||
priv->prev_ref_frame_num, frame_num);
|
priv->prev_ref_frame_num, frame_num, priv->max_frame_num);
|
||||||
|
|
||||||
/* 7.4.3/7-23 */
|
/* 7.4.3/7-23 */
|
||||||
unused_short_term_frame_num =
|
unused_short_term_frame_num =
|
||||||
@ -708,13 +726,8 @@ gst_h264_decoder_start_current_picture (GstH264Decoder * self)
|
|||||||
if (priv->current_slice.nalu.idr_pic_flag)
|
if (priv->current_slice.nalu.idr_pic_flag)
|
||||||
priv->prev_ref_frame_num = 0;
|
priv->prev_ref_frame_num = 0;
|
||||||
|
|
||||||
/* 7.4.3 */
|
if (!gst_h264_decoder_handle_frame_num_gap (self, frame_num))
|
||||||
if (frame_num != priv->prev_ref_frame_num &&
|
return FALSE;
|
||||||
frame_num != (priv->prev_ref_frame_num + 1) % priv->max_frame_num &&
|
|
||||||
gst_h264_dpb_get_size (priv->dpb) > 0) {
|
|
||||||
if (!gst_h264_decoder_handle_frame_num_gap (self, frame_num))
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gst_h264_decoder_init_current_picture (self))
|
if (!gst_h264_decoder_init_current_picture (self))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -726,6 +726,8 @@ gst_h264_dpb_perform_memory_management_control_operation (GstH264Dpb * dpb,
|
|||||||
other = gst_h264_dpb_get_short_ref_by_pic_num (dpb, pic_num_x);
|
other = gst_h264_dpb_get_short_ref_by_pic_num (dpb, pic_num_x);
|
||||||
if (other) {
|
if (other) {
|
||||||
other->ref = FALSE;
|
other->ref = FALSE;
|
||||||
|
GST_TRACE ("MMCO-1: unmark short-term ref picture %p, (poc %d)",
|
||||||
|
other, other->pic_order_cnt);
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING ("Invalid picNumX %d for operation type 1", pic_num_x);
|
GST_WARNING ("Invalid picNumX %d for operation type 1", pic_num_x);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -738,6 +740,8 @@ gst_h264_dpb_perform_memory_management_control_operation (GstH264Dpb * dpb,
|
|||||||
ref_pic_marking->long_term_pic_num);
|
ref_pic_marking->long_term_pic_num);
|
||||||
if (other) {
|
if (other) {
|
||||||
other->ref = FALSE;
|
other->ref = FALSE;
|
||||||
|
GST_TRACE ("MMCO-2: unmark long-term ref picture %p, (poc %d)",
|
||||||
|
other, other->pic_order_cnt);
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING ("Invalid LongTermPicNum %d for operation type 2",
|
GST_WARNING ("Invalid LongTermPicNum %d for operation type 2",
|
||||||
ref_pic_marking->long_term_pic_num);
|
ref_pic_marking->long_term_pic_num);
|
||||||
@ -754,10 +758,10 @@ gst_h264_dpb_perform_memory_management_control_operation (GstH264Dpb * dpb,
|
|||||||
|
|
||||||
if (other->ref && other->long_term && other->long_term_frame_idx ==
|
if (other->ref && other->long_term && other->long_term_frame_idx ==
|
||||||
ref_pic_marking->long_term_frame_idx) {
|
ref_pic_marking->long_term_frame_idx) {
|
||||||
GST_LOG ("Unmark old long-term ref pic %p (poc %d)",
|
|
||||||
other, other->pic_order_cnt);
|
|
||||||
other->ref = FALSE;
|
other->ref = FALSE;
|
||||||
other->long_term = FALSE;
|
other->long_term = FALSE;
|
||||||
|
GST_TRACE ("MMCO-3: unmark old long-term ref pic %p (poc %d)",
|
||||||
|
other, other->pic_order_cnt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -765,8 +769,10 @@ gst_h264_dpb_perform_memory_management_control_operation (GstH264Dpb * dpb,
|
|||||||
pic_num_x = get_picNumX (picture, ref_pic_marking);
|
pic_num_x = get_picNumX (picture, ref_pic_marking);
|
||||||
other = gst_h264_dpb_get_short_ref_by_pic_num (dpb, pic_num_x);
|
other = gst_h264_dpb_get_short_ref_by_pic_num (dpb, pic_num_x);
|
||||||
if (other) {
|
if (other) {
|
||||||
other->long_term = TRUE;;
|
other->long_term = TRUE;
|
||||||
other->long_term_frame_idx = ref_pic_marking->long_term_frame_idx;
|
other->long_term_frame_idx = ref_pic_marking->long_term_frame_idx;
|
||||||
|
GST_TRACE ("MMCO-3: mark long-term ref pic %p, index %d, (poc %d)",
|
||||||
|
other, other->long_term_frame_idx, other->pic_order_cnt);
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING ("Invalid picNumX %d for operation type 3", pic_num_x);
|
GST_WARNING ("Invalid picNumX %d for operation type 3", pic_num_x);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -779,6 +785,8 @@ gst_h264_dpb_perform_memory_management_control_operation (GstH264Dpb * dpb,
|
|||||||
max_long_term_frame_idx =
|
max_long_term_frame_idx =
|
||||||
ref_pic_marking->max_long_term_frame_idx_plus1 - 1;
|
ref_pic_marking->max_long_term_frame_idx_plus1 - 1;
|
||||||
|
|
||||||
|
GST_TRACE ("MMCO-4: max_long_term_frame_idx %d", max_long_term_frame_idx);
|
||||||
|
|
||||||
for (i = 0; i < dpb->pic_list->len; i++) {
|
for (i = 0; i < dpb->pic_list->len; i++) {
|
||||||
other = g_array_index (dpb->pic_list, GstH264Picture *, i);
|
other = g_array_index (dpb->pic_list, GstH264Picture *, i);
|
||||||
|
|
||||||
@ -786,6 +794,8 @@ gst_h264_dpb_perform_memory_management_control_operation (GstH264Dpb * dpb,
|
|||||||
other->long_term_frame_idx > max_long_term_frame_idx) {
|
other->long_term_frame_idx > max_long_term_frame_idx) {
|
||||||
other->ref = FALSE;
|
other->ref = FALSE;
|
||||||
other->long_term = FALSE;
|
other->long_term = FALSE;
|
||||||
|
GST_TRACE ("MMCO-4: unmark long-term ref pic %p, index %d, (poc %d)",
|
||||||
|
other, other->long_term_frame_idx, other->pic_order_cnt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -809,7 +819,7 @@ gst_h264_dpb_perform_memory_management_control_operation (GstH264Dpb * dpb,
|
|||||||
|
|
||||||
if (other->ref && other->long_term && other->long_term_frame_idx ==
|
if (other->ref && other->long_term && other->long_term_frame_idx ==
|
||||||
ref_pic_marking->long_term_frame_idx) {
|
ref_pic_marking->long_term_frame_idx) {
|
||||||
GST_LOG ("Unmark old long-term ref pic %p (poc %d)",
|
GST_TRACE ("MMCO-6: unmark old long-term ref pic %p (poc %d)",
|
||||||
other, other->pic_order_cnt);
|
other, other->pic_order_cnt);
|
||||||
other->ref = FALSE;
|
other->ref = FALSE;
|
||||||
other->long_term = FALSE;
|
other->long_term = FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user