summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2020-11-05 18:09:06 -0500
committerSeungha Yang <seungha@centricular.com>2020-11-17 19:00:39 +0900
commit4ee616761678f1f76bc02cfdc5956cd04cbe3178 (patch)
tree3e1370a199a16d9d3338144c45e9e49d1e3746bc /gst-libs
parent11509fded16c93e64c20c2fd6fe44f8100c56081 (diff)
downloadgstreamer-plugins-bad-4ee616761678f1f76bc02cfdc5956cd04cbe3178.tar.gz
h264dec: Fix POC calculation for type 0
This is mostly for future use as it only fixes the caclulation for interlaced cases, the case of frame seemed correct already. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1812>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecs/gsth264decoder.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gst-libs/gst/codecs/gsth264decoder.c b/gst-libs/gst/codecs/gsth264decoder.c
index 353fc5d52..9fdca7cab 100644
--- a/gst-libs/gst/codecs/gsth264decoder.c
+++ b/gst-libs/gst/codecs/gsth264decoder.c
@@ -1229,15 +1229,21 @@ gst_h264_decoder_calculate_poc (GstH264Decoder * self, GstH264Picture * picture)
picture->pic_order_cnt_msb + picture->pic_order_cnt_lsb;
}
- if (picture->field != GST_H264_PICTURE_FIELD_TOP_FIELD) {
- if (GST_H264_PICTURE_IS_FRAME (picture)) {
- picture->bottom_field_order_cnt =
- picture->top_field_order_cnt +
+ switch (picture->field) {
+ case GST_H264_PICTURE_FIELD_FRAME:
+ picture->top_field_order_cnt = picture->pic_order_cnt_msb +
+ picture->pic_order_cnt_lsb;
+ picture->bottom_field_order_cnt = picture->top_field_order_cnt +
picture->delta_pic_order_cnt_bottom;
- } else {
- picture->bottom_field_order_cnt =
- picture->pic_order_cnt_msb + picture->pic_order_cnt_lsb;
- }
+ break;
+ case GST_H264_PICTURE_FIELD_TOP_FIELD:
+ picture->top_field_order_cnt = picture->pic_order_cnt_msb +
+ picture->pic_order_cnt_lsb;
+ break;
+ case GST_H264_PICTURE_FIELD_BOTTOM_FIELD:
+ picture->bottom_field_order_cnt = picture->pic_order_cnt_msb +
+ picture->pic_order_cnt_lsb;
+ break;
}
break;
}