1
0
Fork 0
Commit Graph

21 Commits

Author SHA1 Message Date
Andreas Rheinhardt 423b6a7e49 avutil/imgutils: Add wrapper for av_image_copy() to avoid casts
av_image_copy() accepts const uint8_t* const * as source;
lots of user have uint8_t* const * and therefore either
cast (the majority) or copy the array of pointers.

This commit changes this by adding a static inline wrapper
for av_image_copy() that casts between the two types
so that we do not need to add casts everywhere else.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-12 09:42:27 +02:00
Andreas Rheinhardt d9d5695390 avcodec/amfenc: Fix declaration-after-statement warning
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-10 09:11:09 +02:00
Dmitrii Ovchinnikov f593dc98bf libavcodec/amfenc: add PreAnalysis support
Additional information about the work of preanalysis can be found here:
https://github.com/GPUOpen-LibrariesAndSDKs/AMF/wiki/PreProcessing%20and%20PreAnalysis
2023-06-29 10:49:33 -03:00
Dmitrii Ovchinnikov 5f0a7a9169 libavcodec/amfenc: add AV1 encoding support
Tested-by: Jean-Baptiste Kempf <jb@videolan.org>
2023-01-27 22:38:45 +05:30
Martin Storsjö a78f136f3f configure: Use a separate config_components.h header for $ALL_COMPONENTS
This avoids unnecessary rebuilds of most source files if only the
list of enabled components has changed, but not the other properties
of the build, set in config.h.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:12:49 +02:00
Anton Khirnov 70611d7f3b lavc/amfenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
James Almer b615e8a782 avcodec/amfenc: use AVCodecContext.get_encode_buffer()
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-17 13:42:54 -03:00
OvchinnikovDmitrii 2fb764e1f3 lavc/amfenc: Add hardware config metadata
Without this metadata section the ffmpeg utility thinks that the AMF encoder
does not support input from D3D11 and DXVA2 hardware surfaces, causing
hardware pipelines to fail.

Fixes #8953.
2020-11-08 19:05:17 +00:00
James Almer 827d6fe73d avcodec/encode: restructure the core encoding code
This commit follows the same logic as 061a0c14bb, but for the encode API: The
new public encoding API will no longer be a wrapper around the old deprecated
one, and the internal API used by the encoders now consists of a single
receive_packet() callback that pulls frames as required.

amf encoders adapted by James Almer
librav1e encoder adapted by James Almer
nvidia encoders adapted by James Almer
MediaFoundation encoders adapted by James Almer
vaapi encoders adapted by Linjie Fu
v4l2_m2m encoders adapted by Andriy Gelman

Signed-off-by: James Almer <jamrial@gmail.com>
2020-06-18 17:11:37 -03:00
James Almer fdf46b4a6b avcodec/amfnec: allocate packets using av_new_packet()
This ensures they will be reference counted, as required by the AVCodec.receive_packet()
API.

Should fix ticket #8386.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-11-19 19:42:48 -03:00
OvchinnikovDmitrii f8ad2ddd7a libavcodec/amfenc: Vulkan initialization support for encoder.
Added linux support for amf encoder through vulkan.

To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and
amf-amdgpu-pro package(amdgru-pro contains, but does not install
automatically) are required.

This driver can be installed using amdgpu-pro-install script in
official amd driver archive.

Initialization of amf encoder occurs in this order:
1) trying to initialize through dx11(only windows)
2) trying to initialize through dx9(only windows)
3) trying to initialize through vulkan

Only Vulkan initialization available on linux.
2019-08-27 18:28:31 -07:00
Mark Thompson edecd723f3 amfenc: Remove spurious initialisations
Also minor cosmetics.
2018-04-15 16:46:17 +01:00
Alexander Kravchenko 2c6ca2b549 amfenc: Add DXVA2 hardware frame input support
Adds support for AMF initialisation from a DXVA2 (Direct3D9) device, and
then allows passing DXVA2 surfaces into an AMF encoder.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-04-15 16:46:17 +01:00
Alexander Kravchenko ab7eed13a7 amfenc: Ensure that the software format of hardware frames is valid
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-04-15 16:46:17 +01:00
Mark Thompson 73ed6fa9d7 amfenc: Do not automatically download/upload unknown hardware input frames
Supplying a hardware input frame which is not in the input hardware frames
context is not allowed by the API, so additional code to handle it is not
necessary.  Further, handling it automatically results in very low
performance - it is more appropriate to fail immediately so that the user
can fix their incorrect setup.
2018-04-15 16:46:12 +01:00
Mark Thompson ff1be6c9a6 amfenc: Fail to open if the user-supplied device is not usable
If the user supplies a device or frames context then it is an error
not to use it; this is consistent with other hardware components.

Also factorise out the D3D11 initialisation and improve error
messages.
2018-04-15 16:42:35 +01:00
Alexander Kravchenko 05f1a3face lavc/amfenc: Retain a reference to D3D frames used as input during the encoding process
Fixes ticket #6990.

Tested-by: James Almer <jamrial@gmail.com>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
2018-04-10 23:59:21 +01:00
Mark Thompson 3895fce26e Merge commit '34c113335b53d83ed343de49741f0823aa1f8cc6'
* commit '34c113335b53d83ed343de49741f0823aa1f8cc6':
  Add support for H.264 and HEVC hardware encoding for AMD GPUs based on AMF SDK

Most of this was already present from 9ea6607d29,
this just applies some minor fixups and adds the general documentation.

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-01-16 23:25:27 +00:00
Michael Wootton 34c113335b Add support for H.264 and HEVC hardware encoding for AMD GPUs based on AMF SDK
Requires AMF headers for at least version 1.4.4.1.

Signed-off-by: Mikhail Mironov <mikhail.mironov@amd.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-01-04 18:15:56 +01:00
James Almer a198c1386a avcodec/amfenc: move config.h include where it's needed
Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-29 14:24:08 -03:00
Mikhail Mironov 9ea6607d29 Add HW H.264 and HEVC encoding for AMD GPUs based on AMF SDK
Requires AMF headers for at least version 1.4.4.1.

Signed-off-by: Mikhail Mironov <mikhail.mironov@amd.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2017-11-28 22:14:42 +00:00