Commit graph

21 commits

Author SHA1 Message Date
Seungha Yang
f49f039ff2 codecs: h265decoder: Add support for interlaced stream
* Invoke GstH265DecoderClass::new_sequence() method per interlaced
  stream status update so that subclass can update caps.
* Parse picture timing SEI and set buffer flags on GstH265Picture
  object. Subclass can refer to it like that of our h264decoder
  implementation.
* Remove pointless GstH265PictureField enum

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2008>
2021-02-09 16:19:41 +00:00
Nicolas Dufresne
c1502a2bdf h265decoder: Remove unsued WpOffsetHalfRangeC
This is only needed for VA implementation of weight tables and isn't used
within the base class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1714>
2020-11-04 17:53:23 +00:00
Seungha Yang
db10288382 codecs: h265decoder: Make GstVideoCodecFrame hold the last reference of the buffer
The functionality of passing the last reference of GstH265Picture
was silently dropped by the commit eeffd91109
This commit will make it work again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1755>
2020-11-02 20:20:56 +00:00
Seungha Yang
b69840711e codecs: h265decoder: Clear GstVideoCodecFrame on DPB clear if needed
h265decoder might need to clear DPB depending on context even if
it's not flushing case. So associated GstVideoCodecFrame needs to be
released in case non-flushing case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1755>
2020-11-02 20:20:56 +00:00
Seungha Yang
16b4fe3d0b codecs: h265decoder: Don't drain DPB on EOB/EOS/IDR nalu
DPB bumping decision per end-of-bitstream, end-of-sequence or IDR nal
should done by spec. In short, draining on EOB/EOS/IDR is undefined
behavior as per spec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1755>
2020-11-02 20:20:56 +00:00
Nicolas Dufresne
849b7a315c h265decoder: Complete dependent slice header
This will save the last independent slice and fill in the missing
information for dependent slices. This was left over during the porting
from gstreamer-vaapi. The private variable prev_independent_slice was
already there.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1750>
2020-11-02 18:20:32 +00:00
Nicolas Dufresne
e3fb5f894f h265decoder: Prevent possible infinite loop
Theoretically, one could produce a broken stream that would lead to
infinite in the specified algorithm to calculate l0/l1 reference lists.
This patch will pearly exit if this condition is met.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1750>
2020-11-02 18:20:32 +00:00
Seungha Yang
eeffd91109 codecs: h265decocer: Rework for DPB management
* Move all DPB bumping process into GstH265Dpb internal
* Handle DPB add process in GstH265Dpb struct
* Make implementation to be 1:1 mappable with hevc specification
* Fix wrong DPB bumping implementation especially when no_output_of_prior_pics_flag
  was specified.

With fixes from Nicolas Dufresne <nicolas.dufresne@collabora.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1748>
2020-11-01 21:46:12 +09:00
He Junyan
002cddf131 codecs: h265decoder: Fix picture leaks because of reference set.
The last frame's reference set has no one to cleanup. We need to
clean all pictures in the stop() func.
We also add a helper function to cleanup all the pictures in the
reference picture set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1717>
2020-10-23 16:21:15 +00:00
He Junyan
4d296a07e4 codecs: h265decoder: Fix 3 ref array leaks in finalize.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1717>
2020-10-23 16:21:15 +00:00
Nicolas Dufresne
f22fc190e7 h265decoder: Add support for l0/l1
Add support for reference list needed for VA-API and some V4L2 decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1713>
2020-10-21 09:05:57 -04:00
Nicolas Dufresne
f330b5ae62 h265decoder: Sync with the H264 implementation
This ensures that we get the last reference to picture being outputed,
avoiding GstBuffer structure copies and simplifying the buffer management.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1713>
2020-10-21 09:05:57 -04:00
Víctor Manuel Jáquez Leal
23e99a7a77 codecs: set sys frame num before new_picture()
Derive classes might need to operate on the current frame at their
new_picture() vmethod, so it would be needed to set system_frame_number
on picture before calling the vmethod.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1209>
2020-04-23 19:54:17 +00:00
Seungha Yang
5a29917a63 codecs: Add minimal state validation
... to prevent requesting decoding before the preparation.
For instance, baseclass should not request decoding a picture if there
is no parsed valid headers, since subclass is most likely
not ready to decoding it.
2020-04-09 19:33:56 +00:00
Thibault Saunier
b9e0ccd8b7 codecs: Add basic documentation stubs 2020-04-08 08:47:46 -04:00
Seungha Yang
5609d8751c h265decoder: Pass max_dpb_size to new_sequence vfunc
same as we are doing in h264decoder
2020-03-08 16:11:35 +09:00
Seungha Yang
ba3430a059 h265decoder: Fix for output and removal picture from DPB
See C.5.2.2 Output and removal of pictures from the DPB.

If the number of pictures in the DPB is greater than or equal to
sps_max_dec_pic_buffering_minus1[HighestTid] + 1, then the picture
should be outputted.
2020-03-07 12:20:03 +09:00
Seungha Yang
82f1d5e8be codecs: Change output_picture() to mandatory implementation
GstVideoCodecFrame is expected to be consumed by subclass
per output_picture(). So the implementation cannot be optional.
2020-03-05 15:27:42 +00:00
Seungha Yang
83b056cb77 h265decoder: Port to nal type classification macro
... and remove namespaceless macro methods from baseclass
2020-03-05 23:22:39 +09:00
Nicolas Dufresne
56c3b40c30 h264picture: Add system_frame_num
This allow cross-referencing GstH264Picture and GstVideoCodecFrame.
2020-03-05 03:06:16 +00:00
Nicolas Dufresne
00d04784d3 Move CODEC base classes into it's own library
This introduce a library which contains a set of base classes which
handles the parsing and the state tracking for the purpose of decoding
different CODECs. Currently H264, H265 and VP9 are supported. These
bases classes are used to decode with low level decoding API like DXVA,
NVDEC, VDPAU, VAAPI and V4L2 State Less decoders. The new library is
named gstreamer-codecs-1.0 / libgstcodecs.
2020-03-05 03:06:16 +00:00
Renamed from sys/d3d11/gsth265decoder.c (Browse further)