1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00
Commit Graph

15 Commits

Author SHA1 Message Date
Kacper Michajłow
d57de83352 avcodec/d3d12va_encode: fix format specifier for HRESULT
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-10-27 15:39:39 +01:00
Tong Wu
10e9672a8c avcodec/d3d12va_encode: use macros to set QP range and max frame size
Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-10-12 01:50:57 +00:00
Araz Iusubov
c2ce387385 avcodec/d3d12va_encode: texture array support for HEVC
This patch adds support for the texture array feature
used by AMD boards in the D3D12 HEVC encoder.
In texture array mode, a single texture array is shared for all
reference and reconstructed pictures using different subresources.
The implementation ensures compatibility
and has been successfully tested on AMD, Intel, and NVIDIA GPUs.
2025-09-03 11:56:06 +02:00
Tong Wu
9893d66add avcodec/d3d12va_encode: add max_frame_size option
Add the max_frame_size option to support setting max frame size in
bytes. Max frame size is the maximum cap in the bitrate algorithm per
each encoded frame.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-08-31 10:46:11 +00:00
Kacper Michajłow
ac6db22e37 avcodec/d3d12va_encode: fix label followed by a declaration warning
Fixes: d3d12va_encode.c: warning: label followed by a declaration is a
       C23 extension

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-11 19:29:53 +00:00
Kacper Michajłow
62e2af358d avcodec/d3d12va_encode: don't return uninitialized value on error
When CreateEvent fails, err was not initialized.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
7d9b21601c avcodec/d3d12va_encode: don't write garbage when there is no header
When codec->write_sequence_header is not defined, bit_len was undefined,
and while data bufer was zeroed we could just overread it. Do nothing
when we don't have anything to write.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
a1588c875a avcodec/d3d12va_encode: use correct none flag
NFC, it's still 0, but correct enum type so compilers won't complain.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Araz Iusubov
49e52ca24f avcodec/d3d12va_encode: fix l0 reference count limit
Prevents potential null pointer dereference when querying
MaxL1ReferencesForB from codec-specific support structures
during GOP structure initialization.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-06-08 21:24:25 +08:00
James Almer
c88614662c avcodec/d3d12va_encode: use the correct specifier to log size_t values
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 21:06:33 -03:00
Lynne
e6019ed075 hw_base_encode: allocate DPB image upfront
Vulkan requires this, as it needs to initialize state upfront.
2024-09-09 07:05:42 +02:00
Lynne
9db68ed042 hw_base_encode: refactor picture allocation/freeing
This commit cleans up and refactors the mess of private state upon
private state that used to be.

Now, FFHWBaseEncodePicture is fully initialized upon call-time,
and, most importantly, this lets APIs which require initialization
data for frames (VkImageViews) to initialize this for both the
input image, and the reconstruction (DPB) image.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-09-09 07:05:24 +02:00
Tong Wu
b1d410716b lavc/d3d12va_encode: trim header alignment at output
It is d3d12va's requirement that the FrameStartOffset must be aligned as
per hardware limitation. However, we could trim this alignment at output
to reduce coded size. A aligned_header_size is added to
D3D12VAEncodePicture.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-07-28 17:50:30 +02:00
Tong Wu
e783e45e29 avcodec/hw_base_encode: avoid getting FFHWBaseEncodeContext from avctx
This patch is to make FFHWBaseEncodeContext a standalone component
and avoid getting FFHWBaseEncodeContext from avctx->priv_data.
This patch also removes some unnecessary AVCodecContext arguments.

For receive_packet call, a small wrapper is introduced.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
ba0c14e6bf avcodec: add D3D12VA hardware HEVC encoder
This implementation is based on D3D12 Video Encoding Spec:
https://microsoft.github.io/DirectX-Specs/d3d/D3D12VideoEncoding.html

Sample command line for transcoding:
ffmpeg.exe -hwaccel d3d12va -hwaccel_output_format d3d12 -i input.mp4
-c:v hevc_d3d12va output.mp4

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00