| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case a set of NALs with emulation_prevention_three_byte is decoded using
hardware decoder like Hantro G1, wrong struct v4l2_ctrl_h264_decode_params
.dec_ref_pic_marking_bit_size is passed into the kernel, which results in
decoding artifacts. Subtract the number of emulation three bytes from the
.dec_ref_pic_m->bit_size to get the correct bit size and avoid having these
artifacts. Apply the exact same fix to slice->pic_order_cnt_bit_size as well.
The following NALs (7, 8, 6, 5) decode with artifacts,
.dec_ref_pic_marking_bit_size is set to 10 without this patch.
00000000 00 00 00 01 27 4d 00 20 89 8b 60 3c 04 bf 2e 02 |....'M. ..`<....|
00000010 d4 18 04 18 c0 c0 01 77 00 00 5d c1 7b df 05 00 |.......w..].{...|
00000020 00 00 01 28 ee 1f 20 00 00 01 06 05 10 b9 ed b9 |...(.. .........|
00000030 30 5d 21 4b 71 83 71 2c 10 a3 14 bb 29 80 00 00 |0]!Kq.q,....)...|
00000040 01 25 b8 00 05 00 00 03 03 7f fa 78 1e e7 fd fe |.%.........x....|
^^^^^^^^^^^^--- emulation 3 byte
00000050 b4 62 7a 31 ff 7d 81 fd 26 d8 62 b6 d6 25 46 ae |.bz1.}..&.b..%F.|
The following NALs (7, 8, 6, 5) decode fine,
.dec_ref_pic_marking_bit_size is set to 2 without this patch.
00000000 00 00 00 01 27 4d 00 20 89 8b 60 3c 04 bf 2e 02 |....'M. ..`<....|
00000010 d4 18 04 18 c0 c0 01 77 00 00 5d c1 7b df 05 00 |.......w..].{...|
00000020 00 00 01 28 ee 1f 20 00 00 01 06 05 10 b9 ed b9 |...(.. .........|
00000030 30 5d 21 4b 71 83 71 2c 10 a3 14 bb 29 80 00 00 |0]!Kq.q,....)...|
00000040 01 25 b8 00 04 c0 00 03 7f fa 78 1e e7 fd fe b4 |.%........x.....|
00000050 62 7a 31 ff 7d 81 fd 26 d8 62 b6 d6 25 46 ae ce |bz1.}..&.b..%F..|
Fixes: d0d65fa875 ("codecparsers: h264: record dec_ref_pic_marking() size")
Fixes: 0cc7d6f093 ("codecparsers: h264: record pic_order_cnt elements size")
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2517>
|
|
|
|
|
|
|
|
| |
This prevents assertion from being thrown in
gst_h264_dpb_perform_memory_management_control_operation
if corrupt NAL has a control op greater than 6
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2508>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2493>
|
|
|
|
|
|
|
| |
g_memdup() is deprecated since GLib 2.68 and we want to avoid
deprecation warnings with recent versions of GLib.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2280>
|
|
|
|
|
|
|
|
|
| |
The spec mandates this field be parsed using unsigned arithmetic. Nevertheless,
av1parser will use -1 apparently as an uninitialized value in
gst_av1_parse_frame_header. This immediately underflows last_frame_idx
though, since its type was defined as guint8. Fix this by converting to gint8.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2401>
|
|
|
|
|
|
| |
Segmentation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2369>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2369>
|
|
|
|
|
|
|
| |
Remaining size should exclude already read "tile size bits".
And see also "5.11.1. General tile group OBU syntax"
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2365>
|
|
|
|
|
|
|
| |
Add YCrCb 4:1:1 support in openjpeg elements
and fix in jpeg2000parse the YCrCb 4:1:0 support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2321>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Offset and size are stored as 32 bit guint and might overflow when
adding the nal_length_size, so let's avoid that.
For the size this would happen if the AVC/HEVC NAL unit size happens to
be stored in 4 bytes and is 4294967292 or higher, which is likely
corrupted data anyway.
For the offset this is something for the caller of these functions to
take care of but is unlikely to happen as it would require parsing on a
>4GB buffer.
Allowing these overflows causes all kinds of follow-up bugs in the
h2645parse elements, ranging from infinite loops and memory leaks to
potential memory corruptions.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2103>
|
|
|
|
|
|
|
|
|
|
|
|
| |
volatile is not sufficient to provide atomic guarantees and real atomics
should be used instead. GCC 11 has started warning about using volatile
with atomic operations.
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2098>
|
|
|
|
|
| |
Fixes: #1500
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1974>
|
|
|
|
|
|
|
| |
obu->obu_size does not contain the bytes of obu_size itself, we need
to exclude it when doing the saint check.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1614>
|
|
|
|
|
|
|
|
|
| |
The av1 can support multi layers when scalability is enabled. We
need an API to set the operating point and filter the OBUs just
belonging to some layers(the layers are specified by the operating
point).
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In practice, we encounter streams that have one or more temporal units
error. When that kind of error temporal units is in annex b format, the
whole temporal unit should be discarded.
But the temporal units before it are correct and can be used. More
important, because of the error temporal unit, the parser is in a wrong
state and all later temporal unit are also parsed uncorrectly.
We need to add this API to reset the annex_b state only when we meet
some temporal unit error.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
|
|
|
|
| |
The current seen_frame_header is not cleaned correctly. According
to the spec, it should be cleaned when tiles are parsed completely.
Also delete a verbose seen_frame_header init in reset_state().
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
|
|
|
| |
Some buggy stream just writes the wrong temporal unit and frame size in
the stream. We should return failure rather than assert to abort.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. store more tile info when parse tile group.
The column, row, tile offset and tile data size are all useful for
decoder process, especially for HW kind decoder such as VAAPI dec.
Also fix the tile group skip size for each tile data.
2. No min_inner_tile_width requirement in newest spec.
3. Calculate the sbs of each tile for both uniform tile and non-uniformi
tile.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
|
|
|
|
| |
The global motion params and its matrix values need to be verified
before we use them. If it is invalid, we should notify the decoder
that it should not be used.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
|
|
|
|
|
| |
1. loop_filter_ref_deltas should be int because it needs to compare
with 0.
2. Move the loop filter init logic to setup_past_independence() and
load_previous(), which make it more precise with the spec.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
|
|
|
|
|
| |
The metadata OBUs, for example, ITUT_T35 has an undefined payload such
as itu_t_t35_payload_bytes field in AV1 spec, which may cause the failure
of parsing the trailings bits. We can give a warning and ignore this kind
of errors.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
|
|
|
| |
All the ref index need to compare with 0 in reference index decision
algorithm. We also need to init them to -1.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1714>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1750>
|
| |
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1703>
|
|
|
|
|
|
|
| |
Uninited frame_hdr may have garbage and may contain some wrong
results after the parsing process.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1587>
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are streams which have the right general_profile_idc and
general_profile_compatibility_flag, but don't have the right extension
flags. We may try to use chroma_format_idc and bit_depth to
recognize these streams.
e.g.
https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/SCC/IBF_Disabled_A_MediaTek_2.zip
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1328>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently screen-extended-high-throughput-444 is recognized as
screen-extended-main-444, screen-extended-high-throughput-444-10 is
recognized as screen-extended-main-444-10 because they have the same
extension flags, so without this patch, it is possible that a decoder
which supports SCC but doesn't support throughput SCC will try to decode
a throughput SCC stream.
e.g.
https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/SCC/HT_A_SCC_Apple_2.zip
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1328>
|
|
|
|
|
|
|
|
|
|
|
| |
... and do more strict validation for num_tile_columns_minus1 and
num_tile_rows_minus1.
As per specification Table A.8, allowed maximum number of tile rows
and tile columns are 22 and 20, respectively. So we should adjust the size
of each array.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1372>
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, bound check would simply trace the values and the range. This
enhances the trace by also tracing the name of the variable that was to be set
or read. This is not magically perfect in all cases, but greatly speed the
debugging work. Here's an example before and after this change:
Before: gst_h264_parser_parse_slice_hdr: value not in allowed range. value: 819183, range -87-77
After: gst_h264_parser_parse_slice_hdr: value for 'slice->slice_qp_delta' not in allowed range. value: 819183, range -87-77
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1356>
|
|
|
|
| |
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1303>
|
|
|
|
|
|
|
| |
This is minor optimization to avoid setting values we don't need. It also
makes debugging easier since only relevant values a non-zero now.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>
|
|
|
|
|
|
|
|
| |
The default in PPS was not applied properly. The default does not apply for
I-Slice and l1 default only applies for B-Slice. This fixes the slice values
for num_ref_idx_l0_active_minus1 and num_ref_idx_l1_active_minus1.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The parser is used all over the place assuming that after calling
gst_h265_parser_identify_nalu(), the start-code found is can also be
identified. In H264 this works, because scan_for_start_code rely on
gst_byte_reader_masked_scan_uint32() that ensures that 1 byte passed the 3
bytes start code is found. But for HEVC, we need two bytes to identify the
following NAL.
This patch will return NO_NAL_END, even if a start code is found in the case
there was not enough bytes. This solution was chosen to maintain backward
compatibility, and reduce complexicity.
Fixes #1287
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
|
|
|
|
|
|
|
|
|
|
| |
Same as done for H264, this error was trying to catch the case where we had
a start code without any bytes afterward. This will never happen since the
start code scanner only returns a match if there is one byte after start
code (pattern 0x00000100 / mask 0xffffff00). In H264, once byte is sufficient
to identify the NALU.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
|
|
|
|
|
|
|
|
|
|
|
| |
This will stop stripping four bytes start code. This was fixed and broken
again as it was causing the a timestamp shift. We now call
gst_base_parse_set_ts_at_offset() with the offset of the first NAL to ensure
that fixing a moderatly broken input stream won't affect the timestamps. We
also fixes the unit test, removing a comment about the stripping behaviour not
being correct.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
|
|
|
|
|
|
|
|
|
|
| |
Unlike H264, H265 requires 2 bytes after the start code to allow NAL
identification. This would otherwise report a broken NAL and skip
important data.
Fixes #1287
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
|
|
|
|
|
|
|
|
|
| |
This error was trying to catch the case where we had a start code without any
bytes afterward. This will never happen since the start code scanner only returns
a match if there is one byte adter start code (pattern 0x00000100 / mask
0xffffff00).
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
|
|
|
|
|
|
| |
Add support for screen content coding extensions profiles.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1146>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the first version of AV1 parser implementation in GStreamer.
A test file is also provied with several test cases. It contains a
test sequence taken from the aom testdata set, with one key and one
inter-frame. The same test sequence has been reencoded to annexb.
testdata is taken from aom testdata (and reencoded for annexb) as well
as handcrafted testcases. Once reference testdata is available, the
testing could be imporved aswell.
Co-author: He Junyan <junyan.he@hotmail.com>
Co-author: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/785>
|
|
|
|
|
|
| |
It is compitable with scc and we use scc's function to identify it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1121>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the old manner does not consider the profile idc. The profile idc should
play an more important role in recognizing the profile than the other
information. And there is no need to mix profiles of different extensions
together to find the closest profile when the bits stream is not standard,
different extensions support different features and should not be mixed.
The correct way should be recognize the extension category by profile idc
firstly, and then find the closest profile.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1121>
|