aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/amfenc_hevc.c
Commit message (Collapse)AuthorAgeFilesLines
* all: fix typos found by codespellTimo Rothenpieler7 days1-9/+9
|
* avcodec: remove deprecated FF_API_TICKS_PER_FRAMEJames Almer2025-03-281-7/+1
| | | | | | Deprecated since 2023-05-15. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/amfenc: add smart access video optionEvgeny Pavlov2025-03-211-0/+18
| | | | | | | This commit adds option for enabling SmartAccess Video (SAV) in AMF encoders. SAV is an AMD hardware-specific feature which enables the parallelization of encode and decode streams across multiple Video Codec Engine (VCN) hardware instances.
* avcodec/codec_internal, all: Use macros to set deprecated AVCodec fieldsAndreas Rheinhardt2025-03-101-1/+1
| | | | | | | | | | | | | | The aim of this is twofold: a) Clang warns when setting a deprecated field in a definition and because several of the widely set AVCodec fields are deprecated, one gets several hundred warnings from Clang for an ordinary build. Yet fortunately Clang (unlike GCC) allows to disable deprecation warnings inside a definition, so that one can create simple macros to set these fields that also suppress deprecation warnings for Clang. This has already been done in fdff1b9cbfd8cf5a9810c29efa4baf13a4786742 for AVCodec.channel_layouts. b) Using macros will allow to easily migrate these fields to internal ones. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Enable 10-bit output for RGB input in AMF HEVC and AV1Dmitrii Ovchinnikov2025-03-061-32/+52
| | | | encoders
* avcodec/amfenc: Fix max rate control log messageAraz Iusubov2025-02-141-1/+1
|
* avcodec/amfenc: redesign to use hwcontext_amf.Dmitrii Ovchinnikov2025-02-041-6/+3
| | | | | Co-authored-by: Evgeny Pavlov <lucenticus@gmail.com> v3: cleanup code
* avcodec/amfenc: Implement async_depth optionCameron Gutman2024-12-201-0/+2
| | | | | | | | This option, which is also available on other FFmpeg hardware encoders, allows the user to trade throughput for reduced output latency. This is useful for ultra low latency applications like game streaming. Signed-off-by: Cameron Gutman <aicommander@gmail.com>
* avcodec/amfenc: GOP size checkAraz Iusubov2024-11-071-1/+3
| | | | Fix for the error with an invalid GOP size parameter.
* avcodec/amfenc: add support for QueryOutput waitCameron Gutman2024-11-061-0/+5
| | | | | | | | | Enable waiting in QueryOutput() based on driver support to reduce unnecessary delays. Fix for issue #10622 Co-authored-by: Araz Iusubov <Primeadvice@gmail.com>
* avcodec/amfenc: Color information updateAraz Iusubov2024-11-061-9/+4
| | | | | Processing of transfer characteristic SMPTE2084 and 8-bit depth added on AMF side and will appear in one of upcoming releases.
* avcodec/amfenc: Add support for on-demand key framesCameron Gutman2024-09-281-0/+1
| | | | | v2: Use forced_idr option instead of AV_FRAME_FLAG_KEY Signed-off-by: Cameron Gutman <aicommander@gmail.com>
* avcodec/amfenc: Update supported HEVC color rangesCameron Gutman2024-09-281-1/+1
| | | | | | We properly set AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE since fb4dd4b6f48. Signed-off-by: Cameron Gutman <aicommander@gmail.com>
* avcodec/amfenc: Fix inverted loop filter optionCameron Gutman2024-09-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | The AMF HEVC encoder takes a bool option for whether deblocking filter should be _disabled_ instead of whether it should _enabled_ like the AMF H.264 encoder does. The logic was accidentally copied from H.264 to HEVC without negating the bool value, so the deblocking filter was actually disabled when AV_CODEC_FLAG_LOOP_FILTER was set. Before this patch: ------------------ no flags set => deblocking filter on flags +loop => deblocking filter off flags -loop => deblocking filter on After this patch: ----------------- no flags set => deblocking filter on flags +loop => deblocking filter on flags -loop => deblocking filter off Signed-off-by: Cameron Gutman <aicommander@gmail.com>
* avcodec/internal: add FFCodec.color_rangesNiklas Haas2024-09-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I went through all codecs and put them into five basic categories: 1. JPEG range only 2. MPEG range only 3. Explicitly tagged 4. Broken (codec supports both but encoder ignores tags) 5. N/A (headerless or pseudo-formats) Filters in category 5 remain untouched. The rest gain an explicit assignment of their supported color ranges, with codecs in category 4 being set to MPEG-only for safety. It might be considered redundant to distinguish between 0 (category 5) and MPEG+JPEG (category 3), but in doing so we effectively communicate that we can guarantee that these tags will be encoded, which is distinct from the situation where there are some codecs that simply don't have tagging or implied semantics (e.g. rawvideo). A full list of codecs follows: JPEG range only: - amv - roqvideo MPEG range only: - asv1, asv2 - avui - cfhd - cljr - dnxhd - dvvideo - ffv1 - flv - h261, h263, h263p - {h263,vp8}_v4l2m2m - huffyuv, ffvhuff - jpeg2000 - libopenjpeg - libtheora - libwebp, libwebp_anim - libx262 - libxavs, libxavs2 - libxvid - mpeg1video, mpeg2video - mpeg2_qsv - mpeg2_vaapi - mpeg4, msmpeg4, msmpeg4v2, wmv1, wmv2 - mpeg4_omx - prores, prores_aw, prores_ks - rv10, rv20 - snow - speedhq - svq1 - tiff - utvideo Explicitly tagged (MPEG/JPEG): - {av1,h264,hevc}_nvenc - {av1,h264,hevc}_vaapi - {av1,h264,hevc,vp8,vp9,mpeg4}_mediacodec - {av1,h264,hevc,vp9}_qsv - h264_amf - {h264,hevc,prores}_videotoolbox - libaom-av1 - libkvazaar - libopenh264 - librav1e - libsvtav1 - libvpx, libvpx-vp9 - libx264 - libx265 - ljpeg - mjpeg - vc2 Broken (encoder ignores tags): - {av1,hevc}_amf - {h264,hevc,mpeg4}_v4l2m2m - h264_omx - libxeve - magicyuv - {vp8,vp9,mjpeg}_vaapi N/A: - ayuv, yuv4, y41p, v308, v210, v410, v408 (headerless) - pgmyuv (headerless) - rawvideo, bitpacked (headerless) - vnull, wrapped_avframe (pseudocodecs)
* avcodec/amfenc: Fixes the color information in the output.Michael Fabian 'Xaymar' Dirks2024-09-041-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | added 10 bit support for amf hevc. before: command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file.mkv -an -c:v h264_amf res.dx11_hw_h264.mkv output - Format of input frames context (p010le) is not supported by AMF. command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v hevc_amf res.dx11_hw_hevc.mkv output - Format of input frames context (p010le) is not supported by AMF. after: command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v h264_amf res.dx11_hw_h264.mkv output - 10-bit input video is not supported by AMF H264 encoder command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v hevc_amf res.dx11_hw_hevc.mkv output - 10bit file v2 - lost line returned in ff_amf_pix_fmts v3 - fixes after review v4 - extract duplicated code, fix incorrect processing of 10-bit input for h264 v5 - non-functional changes after review Co-authored-by: Evgeny Pavlov <lucenticus@gmail.com> Co-authored-by: Araz Iusubov <Primeadvice@gmail.com> Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
* avcodec/amfenc: new encoder features supportAraz Iusubov2024-08-151-0/+6
| | | | | | | | Implemented: New usage modes for AV1 encoder. Latency mode for H264, HEVC and AV1 encoders. Adaptive Quantization (AQ) mode in AV1 encoder. Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
* libavcodec/amfenc: Update AMF encoder optionsAraz Iusubov2024-06-201-48/+95
| | | | | | Encoder options have been updated to the current version of the AMF. Signed-off-by: Araz Iusubov <Primeadvice@gmail.com>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-1/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* all: use designated initializers for AVOption.unitAnton Khirnov2024-02-141-73/+73
| | | | | | | | | | | | | | | | | | | | | | | | Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+1
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-1/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* definesAndreas Rheinhardt2023-09-071-2/+2
| | | | | | | | | These defines are also used in other contexts than just AVCodecContext ones, e.g. in libavformat. Furthermore, given that these defines are public, the AV-prefix is the right one, so deprecate (and not just move) the FF-macros. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavcodec/amfenc: add PreAnalysis supportDmitrii Ovchinnikov2023-06-291-11/+133
| | | | | Additional information about the work of preanalysis can be found here: https://github.com/GPUOpen-LibrariesAndSDKs/AMF/wiki/PreProcessing%20and%20PreAnalysis
* lavc: deprecate AVCodecContext.ticks_per_frameAnton Khirnov2023-05-151-1/+7
| | | | | | | | For encoding, this field is entirely redundant with AVCodecContext.framerate. For decoding, this field is entirely redundant with AV_CODEC_PROP_FIELDS.
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Add FF_CODEC_CAP_NOT_INIT_THREADSAFEAndreas Rheinhardt2022-07-181-1/+2
| | | | | | | This is in preparation of switching the default init-thread-safety to a codec being init-thread-safe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-1/+1
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Rename AVCodecDefault->FFCodecDefaultAndreas Rheinhardt2022-03-211-1/+1
| | | | | | | This structure is no longer declared in a public header, so using an FF-prefix is more appropriate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-9/+9
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-211-0/+1
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/amfenc: use AVCodecContext.get_encode_buffer()James Almer2021-03-171-1/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec/amfenc_hevc: Recommend values for min and max video quantizer scale.Ovchinnikov Dmitrii2021-03-091-0/+2
| | | | | | | Current settings makes bitrate larger than expected, more information: https://github.com/HandBrake/HandBrake/issues/3447#issue-820490736 Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/amfenc: Add hardware config metadataOvchinnikovDmitrii2020-11-081-0/+1
| | | | | | | | 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.
* avcodec/amfenc_hevc: set default gops_per_idr 1Lu Jiao2020-07-031-1/+1
| | | | | | | | | | | | | Previously gops_per_idr default 60 would make amd gpu encoding hevc has erratic seek bar behaviour as descripted in this ticket: https://trac.ffmpeg.org/ticket/7272 This bad default is already fixed in newer AMF headers: https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/public/include/components/VideoEncoderHEVC.h Fixes ticket #7272. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/encode: restructure the core encoding codeJames Almer2020-06-181-1/+0
| | | | | | | | | | | | | | | | 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>
* libavcodec/amfenc_hevc.c: Fix Maximum Reference Frames option on AMF HEVC.Sitan Liu2020-02-091-1/+1
|
* libavcodec/amfenc_hevc.c: Fix Profile level option on AMF HEVC.Sitan Liu2020-02-091-1/+1
|
* libavcodec/amfenc_hevc.c: Fix constant QP settings for I, POvchinnikovDmitrii2020-02-011-2/+2
|
* Merge commit '34c113335b53d83ed343de49741f0823aa1f8cc6'Mark Thompson2018-01-161-3/+3
|\ | | | | | | | | | | | | | | | | | | * 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 9ea6607d294526688ab1b1342cb36ee159683e88, this just applies some minor fixups and adds the general documentation. Merged-by: Mark Thompson <sw@jkqxz.net>
| * Add support for H.264 and HEVC hardware encoding for AMD GPUs based on AMF SDKMichael Wootton2018-01-041-0/+332
| | | | | | | 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>
* amf: fix wrong profile level after auto-correction in H264 and HEVCMironov, Mikhail2017-12-091-4/+4
| | | | | | | | Moved bitrate parameters set before Init() call because bitrate is used in profile level correction code inside Init(). Signed-off-by: Mikhail Mironov <mikhail.mironov@amd.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Add HW H.264 and HEVC encoding for AMD GPUs based on AMF SDKMikhail Mironov2017-11-281-0/+326
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>