Commit graph

1885 commits

Author SHA1 Message Date
He Junyan
dbed28d419 libs: encoder: h265: Add tile info to bitstream.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/294>
2020-06-05 19:28:01 +08:00
He Junyan
71db357284 libs: encoder: h265: promote level if tile is enabled.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/294>
2020-06-05 19:27:42 +08:00
He Junyan
812c9fdea7 libs: encoder: h265: Add num-tile-cols/rows properties.
These properties are used for support of tile encoding. We just
support uniform mode of tile encoding, that is, separating picture
equally by (num-tile-cols X num-tile-rows).
According to HEVC spec A1, the max number of tiles in column is 20
and in rows is 22, so add two constant definitions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/294>
2020-06-05 19:27:36 +08:00
He Junyan
bc1c97c755 libs: encoder: h265: extract slice creation from add_slice_headers
extract slice creation details from add_slice_headers, and let the
add_slice_headers just focuses on calculating slice start address
and CTU number.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/294>
2020-06-05 19:27:26 +08:00
He Junyan
6c76e81cb6 libs: encoder: Add a helper function to check the tile support.
Encoding by tiles separation now is a very common feature for all
relative new codecs, such as HEVC, AV1, and VP9. Just make this
check as a common helper function of the encoder base class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/294>
2020-06-05 19:27:11 +08:00
He Junyan
85bc355019 libs: decoder: H265: Add SCC_MAIN_444_10 profile support.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/311>
2020-06-05 09:51:19 +00:00
He Junyan
5f92699a4b libs: decoder: update reference list for SCC.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/311>
2020-06-05 09:51:19 +00:00
He Junyan
c956d91807 libs: decoder: H265: Fill picture and slice SCC parameters.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/311>
2020-06-05 09:51:19 +00:00
He Junyan
1d9b2cab42 libs: util: H265: recognize the SCC profiles.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/311>
2020-06-05 09:51:19 +00:00
He Junyan
9067d902e2 libs: profile: Add screen extended main/main10/main444 define.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/311>
2020-06-05 09:51:19 +00:00
He Junyan
8486f82d98 libs: encoder: h265: Add support for MAIN 4:2:2 10 profile.
Using YUY2 as the input of the encoder can generate main 4:2:2 bit
streams and using Y210 as the input of the encoder can generate main
4:2:2 10 bit streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/334>
2020-06-05 08:42:35 +00:00
He Junyan
5c67bdaf63 libs: encoder: h265: Use correct index for SubWidthC and SubHeightC.
We need to use the chroma_format_idc as the index for getting the
SubWidthC and SubHeightC values as the spec 6.1(table 6-1) defines.
The wrong SubWidthC or SubHeightC make us calculate a wrong right
or bottom offset for crop size and generate garbage in output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/334>
2020-06-05 08:42:35 +00:00
He Junyan
a2063083a5 libs: encoder: h265: Fix chrome idc for 444 10 bits
GST_VAAPI_CHROMA_TYPE_YUV444_10BPP should also set chroma_format_idc
to 3 as GST_VAAPI_CHROMA_TYPE_YUV444 does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/334>
2020-06-05 08:42:35 +00:00
Thibault Saunier
31d85bfb65 Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 17:37:48 -04:00
He Junyan
e41c6bd298 libs: delete all gstvaapiobject related files.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/331>
2020-05-27 15:08:28 +08:00
He Junyan
2515d4dd2f libs: surface: return fail immediately if can not create subpicture
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/331>
2020-05-27 15:08:11 +08:00
He Junyan
6333c85316 libs: subpicture: Make subpicture a standard GstMiniObject.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/331>
2020-05-27 15:08:00 +08:00
He Junyan
3df1018b02 libs: decoder: h264: Add ref flags for splited field.
When split one frame into fields, the second field should also
copy the reference flags.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/333>
2020-05-26 07:40:26 +00:00
Víctor Manuel Jáquez Leal
593f6650ef libs: decoder: h264: disallow multiple slice group
As far as we know there are no VAAPI drivers supporting FMO, which
migth be used in baseline streams.

This commit is a continuation of
https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/328

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/332>
2020-05-25 16:01:44 +02:00
Víctor Manuel Jáquez Leal
e68fece3e6 vaapidecoder: h264: remove baseline as constrained property
From now on always the baseline is going to be treated as constrained without
need of setting a property.

Since the property was added along the development cycle (1.17 / commit
866a9f06) and never released, we assume that it is safe to remove it.

Fixes: #252
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/328>
2020-05-21 13:10:57 +02:00
Haihao Xiang
20ce08aa23 vaapiencoder_h264: set direct_spatial_mv_pred_flag to true by default
This flag is set to true by default in both MediaSDK and FFmpeg-vaapi,
so let's align this plugin with other libraries / softwares.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/329>
2020-05-21 13:51:57 +08:00
Víctor Manuel Jáquez Leal
ab475c22d5 libs: use array_unref() rather than array_free()
It is more convinience and thread-safe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/325>
2020-05-16 20:29:34 +00:00
He Junyan
2b1809e9d3 libs: video-format: add a helper function of get_formats_by_chroma.
The function iterates all supported video formats and returns the
formats belong to the specified chroma type.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16 19:58:15 +00:00
Víctor Manuel Jáquez Leal
5d56ce6927 libs: texture: remove unused headers include
This is continuation of
https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/317

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/324>
2020-05-16 21:05:20 +02:00
Víctor Manuel Jáquez Leal
e20d06e64d libs: removed duplicated function declarations
Some headers had duplicated inlined function declaration. This was
for gtkdoc, but now GStreamer uses hotdoc and the internal library
documentation is not generated. So let's remove these extra lines.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/323>
2020-05-16 20:01:59 +02:00
He Junyan
f20bd8bfd1 libs: texture: Make texture a standard GstMiniObject.
We store GstVaapiTextureGLX and GstVaapiTextureEGL's private data in
the qdata of miniobject and avoid extending the base texture class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/317>
2020-05-16 19:18:46 +02:00
Víctor Manuel Jáquez Leal
d195417758 libs: display: drm: use g_strcmp0 to be null safe
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/321>
2020-04-26 10:40:38 +00:00
He Junyan
f1d13d1e08 libs: bufferproxy: remove GstMemory reference
Since bufferproxy and surface are not referenced circularly, there's
no need to keep, in the buffer proxy, a reference to the GstMemory
where it is held. This patch removes that handling.
2020-04-04 14:30:44 +02:00
He Junyan
e54671d4b3 libs,plugin: break surface-bufferproxy circular reference
The bufferproxy may reference the surface and the surface may also
reference the bufferproxy, producing a circular reference, which might
lead to serious resource leak problems.

Now make the relationship clearer, the bufferproxy's references is
transfered to surface, while bufferproxy just keeps the surface's
address without increasing its reference count.

The surface can be created through a bufferproxy like in
gst_vaapi_surface_new_with_dma_buf_handle(), and the surface might
get its bufferproxy via gst_vaapi_surface_get_dma_buf_handle(). In
both cases the surface holds a bufferproxy's reference.
2020-04-04 14:22:04 +02:00
He Junyan
c80668c337 libs: bufferproxy: rename parent memeber as surface 2020-04-04 14:22:04 +02:00
U. Artie Eoff
5f9e3ceef3 libs: filter: HDR10 tone mapping support
Add support for HDR10 tone mapping (since VA-API 1.4.0).
2020-04-03 09:23:32 -07:00
He Junyan
026c01875c libs: encoder: h265: Support MAIN 4:4:4 10 profile.
Using Y410 as the input of the encoder can generate main_444_10 bit
streams.
2020-04-02 23:01:46 +08:00
He Junyan
80b6e006bc libs: encoder: fix an inexact trace info in chroma type check. 2020-04-02 15:23:05 +08:00
Haihao Xiang
f680a8cba1 libs: encoder: make sure format array is not NULL when returning TRUE
This fixed segfault when running the pipeline below with iHD driver
(commit efe5e9a) on ICL

gst-launch-1.0 videotestsrc ! vaapivp9enc tune=low-power ! vaapivp9dec ! \
fakesink
2020-03-31 15:03:30 +08:00
Víctor Manuel Jáquez Leal
ecbf070fa4 libs: extend g_autoptr support 2020-03-27 10:40:20 +00:00
He Junyan
532a1e5509 libs,plugins: decoder: Add -intra profile support for hevc.
In hevc, we can consider the -intra profile a subset of the none
-intra profile. The -intra profiles just contain I frames and we
definitely can use the none -intra profiles's context to decode
them.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2020-03-20 14:57:49 +01:00
U. Artie Eoff
a28046a8df libs: encoder: h265: support ICQ/QVBR BRC
Enable support for ICQ and QVBR bitrate control.

The code is essentially the same for h264 ICQ/QVBR support
which was added in commit 9e0c133a24.
2020-03-20 11:58:15 +00:00
U. Artie Eoff
861b4cc4b6 libs: encoder: set VA HRD param before RC param
This is a workaround for intel-media-driver bug
https://github.com/intel/media-driver/issues/865

The driver will force the RC method to CBR for HEVCe
when it parses the HRD param.  Thus, any RC method
param submitted "prior" to the HRD param will be lost.
Therefore, VBR, ICQ and QVBR for HEVCe can't be
effectively enabled if the RC method param "precedes"
the HRD param.

To work around this issue, set the HRD param before
the RC method param so the driver will parse the RC
method param "after" the HRD param.

Afaict, other codecs in the driver (and other drivers)
do not appear to be dependent on the order of HRD and
RC param submission.
2020-03-19 12:09:03 -07:00
Haihao Xiang
61516dd5e1 vaapijpegenc: Add a quantization quirk for iHD driver
iHD driver shifts the value by 50 when calculating quantization for JPEG
encoding, so we should add 50 in this plugin for iHD driver too.
2020-03-17 16:10:06 +00:00
Víctor Manuel Jáquez Leal
bb38055745 libs: remove GstVaapiPixmap
GstVaapiPixmap is an abstract base class which only implementation
were GstVaapiPixmapX11. This class were used for a special type of
rendering in the tests apps, utterly unrelated in GStreamer.

Since gstreamer-vaapi is no longer a general-user wrapper for VA-API
we should remove this unused API.

This removal drops libxrender dependency.
2020-03-17 15:46:46 +00:00
He Junyan
f303b4a30f libs: utils: Add HEVC Main444 sting in string_of_VAProfile
HEVCMain444_10 is already a supported profile and misses the strings.
2020-03-17 12:43:16 +00:00
He Junyan
5e612aeb84 libs: videopool: fix a condition race for pool allocate. 2020-03-06 12:40:48 +00:00
Xu Guangxin
bf2299279f libs: decoder: h265: parser state after update dependent slice
If the dependent_slice_segment_flag is true, most slice info derived from last slice.
So we need check the slice type after we call populate_dependent_slice_hdr
2020-03-04 11:37:06 +08:00
Víctor Manuel Jáquez Leal
a8031bcb0e libs: display: force RGBA image format for i965 driver
Since commit 32bf6f1e GLTextureUpload is broken because i965
doesn't report properly RGBA support. It could be possible to use RGBx
but GLTextureUpload only regotiates RGBA.

The simplest fix to this regression is adding synthetically the RGBA
format in the internal format map.
2020-02-28 12:20:18 +01:00
Víctor Manuel Jáquez Leal
ae0261023a libs: display: iterate all quirks table
Instead of break at the fist foud quirk in the table, iterate all over
so it would be feasible to add several quirks for one driver per
element in array.
2020-02-28 12:10:25 +01:00
U. Artie Eoff
acf90c1070 libs: filter: handle RGB to/from YUV color primary driver quirk
The intel-media-driver (iHD) can't convert output color
primaries when doing YUV to/from RGB CSC.  Thus, we must
keep the output color primaries the same as the input
color primaries for this case.

fixes #238
2020-02-28 11:09:11 +00:00
U. Artie Eoff
13601f4071 libs: display: add YUV to/from RGB color primary quirk
The intel-media-driver (iHD) can't convert output color
primaries when doing YUV to/from RGB CSC.
2020-02-28 11:09:11 +00:00
Víctor Manuel Jáquez Leal
96fdc3d322 libs: surface: Add hints to allocation flags.
When creating surfaces it is possible to pass to VA hints of its usage,
so the driver may do some optimizations.

This commit adds the handling of encoding/decoding hints.
2020-02-23 13:12:15 +01:00
Víctor Manuel Jáquez Leal
8c08ef31a5 libs: surface: surfacepool: Add allocation flags in constructors. 2020-02-23 13:12:15 +01:00
Haihao Xiang
17d82e14e7 libs: h265enc: Set max_transform_hierarchy_depth_{inter, intra} to 2
Intel HW has limitation on max_transform_hierarchy_depth_inter and
max_transform_hierarchy_depth_intra (see [1]). We can provide a quirk for
other HWs if other HWs may support other values

[1] https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol10-hevc.pdf
2020-02-21 17:30:29 +00:00