summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2021-01-10 23:16:55 +0900
committerSeungha Yang <seungha@centricular.com>2021-01-10 23:27:27 +0900
commitae7c20a6edba33d24f7dced9f55c8f7c192c07b2 (patch)
tree6e5ffad44a27c889bf3d16bbd33058563b170a95 /gst-libs
parente14bbd7f5ce58ee65dc909f6a98dfd1bab0cd7cb (diff)
downloadgstreamer-plugins-bad-ae7c20a6edba33d24f7dced9f55c8f7c192c07b2.tar.gz
codecs: h264picture: Count only complete complementary field pair for dpb fullness decision
Our DPB implementation was designed as such that allowing temporary DPB overflow in the middle of field picture decoding and incomplete field pair should not trigger DPB bumping. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1947>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecs/gsth264picture.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gst-libs/gst/codecs/gsth264picture.c b/gst-libs/gst/codecs/gsth264picture.c
index be5013d20..90fa1c346 100644
--- a/gst-libs/gst/codecs/gsth264picture.c
+++ b/gst-libs/gst/codecs/gsth264picture.c
@@ -596,7 +596,7 @@ gst_h264_dpb_has_empty_frame_buffer (GstH264Dpb * dpb)
} else {
gint i;
gint count = 0;
- /* Count pictures without second fields */
+ /* Count the number of complementary field pairs */
for (i = 0; i < dpb->pic_list->len; i++) {
GstH264Picture *picture =
g_array_index (dpb->pic_list, GstH264Picture *, i);
@@ -604,7 +604,8 @@ gst_h264_dpb_has_empty_frame_buffer (GstH264Dpb * dpb)
if (picture->second_field)
continue;
- count++;
+ if (GST_H264_PICTURE_IS_FRAME (picture) || picture->other_field)
+ count++;
}
if (count <= dpb->max_num_frames)