Commit graph

28 commits

Author SHA1 Message Date
He Junyan e023546162 va: encoder: Fix the unit of bitrate in debug log message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6483>
2024-04-01 15:39:13 +00:00
He Junyan 71eff7ce97 va: encoder: update the bitrate change correctly
We should update and notify the bitrate change at a common place,
no matter whether the bitrate is calculated or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan d90f718b1a va: h265enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
Ruijing Dong bc858976db va: enc : checking surface alignment attribute
Apply surface alignment attribute when availalbe,
also fix frame cropping issue for va h265 encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6282>
2024-03-18 16:34:42 +00:00
Antonio Larrosa 7b8fa42f8a va{h264,h265,av1}enc: fix potential crash on devices without rate control
This fixes a crash in `gst_va_h264_enc_class_init` and `gst_va_h265_enc_class_init`
(and probably also in gst_va_av1_enc_class_init) when calling
`g_object_class_install_properties (object_class, n_props, properties);`

When rate_control_type is 0, the following code is executed in :

```
  } else {
    n_props--;
    properties[PROP_RATE_CONTROL] = NULL;
  }
```

n_props has initially a value of N_PROPERTIES but PROP_RATE_CONTROL
is not the last element in the array, so it's making
g_object_class_install_properties fail to iterate over the
properties array.

This applies the same fix to gstvah264enc.c, gstvah265enc.c and
gstvaav1enc.c.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6319>
2024-03-12 16:58:07 +00:00
He Junyan 1a78d61b9f vah265enc: Set backward_num to 1 in low delay mode
In low delay B mode, the P frame is converted as B frame with forward
references. For example, One P frame may refers to P-1, P-2 and P-3 in
list0 and refers to P-3, P-2 and P-1 in list1.
So the num in list0 and list1 does not reflect the forward_num and
backward_num. The vaapi does not provide ref num for forward or backward
so far. In this case, we just consider the backward_num to be 1 conservatively.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
He Junyan b9c28920e0 vah265enc: Improve B pyramid mode in HEVC
If the reference frame number is bigger than 2, we can enable the
pyramid B mode. We do not need to assign a reference frame to each
pyramid level.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
He Junyan 196de61035 vah265enc: Expand log2_max_pic_order_cnt if needed
In b_pyramid mode, B frames can be ref and prevPicOrderCntLsb can
be the B frame POC which is smaller than the P frame. This can cause
POC diff bigger than MaxPicOrderCntLsb/2 and generate wrong POC value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
He Junyan f4779f1fab va: baseenc: Extend the create_output_buffer() to accept prefix data
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan 39144f612e va: encoder: extend prepare_output() virtual function
The output of VP9 and AV1 encoder is a little different from the H264
and H265 encoder, it may contain repeat frames and so the output frame
number may be more than the input. We need to call finish_subframe()
when some frame will be repeated later. So we need to extend the
current prepare_output() virtual function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan 354aceb9cd va: Add the entrypoint parameter to gst_va_profile_caps()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5797>
2023-12-12 20:41:54 +08:00
He Junyan 5e6c91579f va: encoder: Add in_info field to base encoder
When we consider the DMA kind caps as input, the input_state->info
only contains the video format of GST_VIDEO_FORMAT_DMA_DRM, which
is not enough for va plugins. The new info in base encoder contains
the correct video info after the DMA caps parsing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5189>
2023-08-29 15:31:09 +00:00
Mengkejiergeli Ba ebea1219a9 vah265enc: Correct the value of cu_qp_delta flag and depth
According to libva API description, cu_qp_delta in VAConfigAttribValEncHEVCFeatures
is supposed to be used as a flag not the value of depth. And if flag enabled,
diff_cu_qp_delta_depth should be decided by log2_diff_max_min_luma_coding_block_size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5068>
2023-07-27 16:00:19 +00:00
Víctor Manuel Jáquez Leal 53860147c6 va: bump libva version to 1.12
Remove all checks in gstva for all version lower than 1.12

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4781>
2023-06-08 08:50:04 +00:00
He Junyan 96e576a818 va: h265enc: map the mbbrc to correct enum value in get_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4509>
2023-04-28 16:46:24 +00:00
Seungha Yang 7bc6ba63b2 va: Add Windows specific element type/feature naming support
Adapter LUID will be changed per boot. Use different naming rule on Windows

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4114>
2023-03-10 13:57:47 +00:00
Seungha Yang c1946c0209 va: Add support for Win32 backend
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4114>
2023-03-10 13:57:47 +00:00
Seungha Yang bc8db7bc3e va: Drop all GSlice bits
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4114>
2023-03-10 13:57:47 +00:00
Seungha Yang 2f98234287 va: Fix struct empty initialization syntax
"struct Foo bar; bar = {};" is not a valid syntax. Also remove use
of __typeof__ which is GCC specific

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4113>
2023-03-06 13:39:19 +00:00
Víctor Manuel Jáquez Leal 573eecac30 vah265enc: Use helper to update properties.
This is a continuation of the original patch by
 Mengkejiergeli Ba <mengkejiergeli.ba@intel.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3996>
2023-02-20 18:18:27 +00:00
Edward Hervey b01ed725be va: Fix path leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3755>
2023-01-19 16:41:44 +01:00
Víctor Manuel Jáquez Leal c8a0d706ca va: Add render node name in non-first devices.
There could be multi-GPU setups where the non-first has more
entrypoints than the first one, and the elements names are not
homogeneous, leading to pipeline building error.

This patch add the render node in the elements names when they belong
to the non-first device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3491>
2022-12-01 16:00:55 +00:00
He Junyan c365389930 va: Add H265 SCC profile support.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:19 +08:00
He Junyan 0952c556dc va: Add extended formats support such as 10/12 bits, 4:2:2 and 4:4:4.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:14 +08:00
He Junyan 17c416ca92 va: enable multi tile support for H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:07 +08:00
He Junyan 2f8ce208e8 va: enable vah265lpenc for low power mode H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:00 +08:00
He Junyan 2677d4c6db va: Add the low-delay-b frame support for H265.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:41 +08:00
He Junyan 3d99f24843 va: Implement the vah265enc plugin for va HEVC encoding.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:08 +08:00