diff options
author | Seungha Yang <seungha@centricular.com> | 2020-11-06 01:45:36 +0900 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-11-13 15:25:42 +0000 |
commit | 7a53d7a4aa7b55880805a09a702c00f90e6d5610 (patch) | |
tree | f3b6246d28f4a998084ee2adcd5e16cb6589f7cf /sys | |
parent | 157210eb1949421f6f307d1d2f070b2380199d5d (diff) | |
download | gstreamer-plugins-bad-7a53d7a4aa7b55880805a09a702c00f90e6d5610.tar.gz |
codecs: h264decoder: Store reference picture type using enum value
Managing reference picture type by using two variables
(ref and long_term) seems to be redundant and that can be
represented by using a single enum value.
This is to sync this implementation with gstreamer-vaapi so that
make comparison between this and gstreamer-vaapi easier and also
in order to minimize the change required for subclass to be able
to support interlaced.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1534>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/d3d11/gstd3d11h264dec.c | 7 | ||||
-rw-r--r-- | sys/nvcodec/gstnvh264dec.c | 6 | ||||
-rw-r--r-- | sys/v4l2codecs/gstv4l2codech264dec.c | 6 | ||||
-rw-r--r-- | sys/va/gstvah264dec.c | 4 |
4 files changed, 13 insertions, 10 deletions
diff --git a/sys/d3d11/gstd3d11h264dec.c b/sys/d3d11/gstd3d11h264dec.c index 4cd0a875a..ded00ef6a 100644 --- a/sys/d3d11/gstd3d11h264dec.c +++ b/sys/d3d11/gstd3d11h264dec.c @@ -565,7 +565,7 @@ gst_d3d11_h264_dec_start_picture (GstH264Decoder * decoder, ID3D11VideoDecoderOutputView *other_view; gint id = 0xff; - if (!other->ref) + if (!GST_H264_PICTURE_IS_REF (other)) continue; other_view = gst_d3d11_h264_dec_get_output_view_from_picture (self, other); @@ -574,7 +574,8 @@ gst_d3d11_h264_dec_start_picture (GstH264Decoder * decoder, id = gst_d3d11_decoder_get_output_view_index (other_view); self->ref_frame_list[i].Index7Bits = id; - self->ref_frame_list[i].AssociatedFlag = other->long_term; + self->ref_frame_list[i].AssociatedFlag = + GST_H264_PICTURE_IS_LONG_TERM_REF (other); self->field_order_cnt_list[i][0] = other->top_field_order_cnt; self->field_order_cnt_list[i][1] = other->bottom_field_order_cnt; self->frame_num_list[i] = self->ref_frame_list[i].AssociatedFlag @@ -587,7 +588,7 @@ gst_d3d11_h264_dec_start_picture (GstH264Decoder * decoder, pic_params.CurrPic.Index7Bits = gst_d3d11_decoder_get_output_view_index (view); - pic_params.RefPicFlag = picture->ref; + pic_params.RefPicFlag = GST_H264_PICTURE_IS_REF (picture); pic_params.frame_num = picture->frame_num; if (pic_params.field_pic_flag && pic_params.CurrPic.AssociatedFlag) { diff --git a/sys/nvcodec/gstnvh264dec.c b/sys/nvcodec/gstnvh264dec.c index c0264a462..95501f848 100644 --- a/sys/nvcodec/gstnvh264dec.c +++ b/sys/nvcodec/gstnvh264dec.c @@ -643,13 +643,13 @@ gst_nv_h264_dec_start_picture (GstH264Decoder * decoder, /* nBitstreamDataLen, pBitstreamData, nNumSlices and pSliceDataOffsets * will be set later */ - params->ref_pic_flag = picture->ref; + params->ref_pic_flag = GST_H264_PICTURE_IS_REF (picture); /* will be updated later, if any slices belong to this frame is not * intra slice */ params->intra_pic_flag = 1; h264_params->frame_num = picture->frame_num; - h264_params->ref_pic_flag = picture->ref; + h264_params->ref_pic_flag = GST_H264_PICTURE_IS_REF (picture); /* FIXME: should be updated depending on field type? */ h264_params->CurrFieldOrderCnt[0] = picture->top_field_order_cnt; h264_params->CurrFieldOrderCnt[1] = picture->bottom_field_order_cnt; @@ -689,7 +689,7 @@ gst_nv_h264_dec_start_picture (GstH264Decoder * decoder, picture_index = other_frame->index; dpb->PicIdx = picture_index; - if (other->long_term) { + if (GST_H264_PICTURE_IS_LONG_TERM_REF (other)) { dpb->FrameIdx = other->long_term_frame_idx; dpb->is_long_term = 1; } else { diff --git a/sys/v4l2codecs/gstv4l2codech264dec.c b/sys/v4l2codecs/gstv4l2codech264dec.c index 7f67917c1..a24739ebf 100644 --- a/sys/v4l2codecs/gstv4l2codech264dec.c +++ b/sys/v4l2codecs/gstv4l2codech264dec.c @@ -476,8 +476,10 @@ gst_v4l2_codec_h264_dec_fill_decoder_params (GstV4l2CodecH264Dec * self, .top_field_order_cnt = ref_pic->pic_order_cnt, .bottom_field_order_cnt = ref_pic->bottom_field_order_cnt, .flags = V4L2_H264_DPB_ENTRY_FLAG_VALID - | (ref_pic->ref ? V4L2_H264_DPB_ENTRY_FLAG_ACTIVE : 0) - | (ref_pic->long_term ? V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM : 0), + | (GST_H264_PICTURE_IS_REF (ref_pic) ? + V4L2_H264_DPB_ENTRY_FLAG_ACTIVE : 0) + | (GST_H264_PICTURE_IS_LONG_TERM_REF (ref_pic) ? + V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM : 0), }; } /* *INDENT-ON* */ diff --git a/sys/va/gstvah264dec.c b/sys/va/gstvah264dec.c index 3c01ebf77..e90f84bb4 100644 --- a/sys/va/gstvah264dec.c +++ b/sys/va/gstvah264dec.c @@ -158,11 +158,11 @@ _fill_vaapi_pic (VAPictureH264 * va_picture, GstH264Picture * picture) va_picture->picture_id = gst_va_decode_picture_get_surface (va_pic); va_picture->flags = 0; - if (picture->ref && picture->long_term) { + if (GST_H264_PICTURE_IS_LONG_TERM_REF (picture)) { va_picture->flags |= VA_PICTURE_H264_LONG_TERM_REFERENCE; va_picture->frame_idx = picture->long_term_frame_idx; } else { - if (picture->ref) + if (GST_H264_PICTURE_IS_SHORT_TERM_REF (picture)) va_picture->flags |= VA_PICTURE_H264_SHORT_TERM_REFERENCE; va_picture->frame_idx = picture->frame_num; } |