summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc_h264.c
Commit message (Collapse)AuthorAge
* avcodec/nvenc: only set b_ref_mode when explicitly requestedTimo Rothenpieler2022-11-05
|
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-03
| | | | | | | | 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-18
| | | | | | | 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-05
| | | | | | | | | | | 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-21
| | | | | | | 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-21
| | | | | | | | | | | | | | | | 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-21
| | | | | | | | | | 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/nvenc: add udu_sei option to import user data unregistered SEIsLimin Wang2021-12-25
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add constrainedFrame encoding supportLimin Wang2021-09-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add single slice intra refresh supportLimin Wang2021-09-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add intra refresh supportLimin Wang2021-09-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add chroma qp offset supportRicardo Monteiro2021-08-08
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add option to disable all extra SEI dataTimo Rothenpieler2021-06-06
| | | | | | | | | | | With these triggering a lot of crashes recently, an option to globally disable all of them is added as a tool to work around those crashes in case the SEI data is not needed by the user. Also re-enables s12m for hevc_nvenc, since the issue is not specifically with that, but it affects all SEI data. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | 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: Remove deprecated old aliases for NVENC encodersAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in 888a5c794778a2f2aad22e9b4a3952dff92b11fa. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/nvenc: use AVCodecContext.get_encode_buffer()James Almer2021-03-17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/nvenc: don't disable b-frames by defaultRicardo Monteiro2021-02-22
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: mark newly deprecated rc modesTimo Rothenpieler2020-10-21
|
* avcodec/nvenc: add new h264 levels from Video SDK 10Timo Rothenpieler2020-07-01
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add new Video SDK 10 featuresRoman Arzumanyan2020-07-01
| | | | | | | | 1. new Nvenc presets 2. new multipass encode modes 3. low delay key frame scale Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/encode: restructure the core encoding codeJames Almer2020-06-18
| | | | | | | | | | | | | | | | 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>
* avcodec/nvenc_h264: add spatial_aq and temporal_aq option to consistent with ↵Limin Wang2020-05-03
| | | | | | nvenc_hevc Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/nvenc: add hardware config metadataMark Thompson2020-04-27
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec: Add explicit capability flag for encoder flushingPhilip Langdale2020-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, there was no way to flush an encoder such that after draining, the encoder could be used again. We generally suggested that clients teardown and replace the encoder instance in these situations. However, for at least some hardware encoders, the cost of this tear down/replace cycle is very high, which can get in the way of some use-cases - for example: segmented encoding with nvenc. To help address that use case, we added support for calling avcodec_flush_buffers() to nvenc and things worked in practice, although it was not clearly documented as to whether this should work or not. There was only one previous example of an encoder implementing the flush callback (audiotoolboxenc) and it's unclear if that was intentional or not. However, it was clear that calling avocdec_flush_buffers() on any other encoder would leave the encoder in an undefined state, and that's not great. As part of cleaning this up, this change introduces a formal capability flag for encoders that support flushing and ensures a flush call is a no-op for any other encoder. This allows client code to check if it is meaningful to call flush on an encoder before actually doing it. I have not attempted to separate the steps taken inside avcodec_flush_buffers() because it's not doing anything that's wrong for an encoder. But I did add a sanity check to reject attempts to flush a frame threaded encoder because I couldn't wrap my head around whether that code path was actually safe or not. As this combination doesn't exist today, we'll deal with it if it ever comes up.
* nvenc: implement flush to help allow an encoder to be re-usedPhilip Langdale2020-01-08
| | | | | | It can be useful to re-use an encoder instance when doing segmented encodings, and this requires flushing the encoder at the start of each segment.
* avcodec/nvenc: switch to dedicated dpb_size optionTimo Rothenpieler2019-09-27
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add option to turn off a53 closed caption embeddingTimo Rothenpieler2018-08-21
|
* avcodec/nvenc: add support for B frames as refTimo Rothenpieler2018-04-11
|
* avcodec: add metadata to identify wrappers and hardware decoderswm42017-12-14
| | | | | | | | | | | | | | | | | | | | | Explicitly identify decoder/encoder wrappers with a common name. This saves API users from guessing by the name suffix. For example, they don't have to guess that "h264_qsv" is the h264 QSV implementation, and instead they can just check the AVCodec .codec and .wrapper_name fields. Explicitly mark AVCodec entries that are hardware decoders or most likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing API users listing hardware decoders in a more generic way. The proposed AVCodecHWConfig does not provide this information fully, because it's concerned with decoder configuration, not information about the fact whether the hardware is used or not. AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software implementations in case the hardware is not capable. Based on a patch by Philip Langdale <philipl@overt.org>. Merges Libav commit 47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1.
* avcodec/nvenc: migrate to new encode APITimo Rothenpieler2017-09-07
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add support for specifying entropy coding modeTimo Rothenpieler2017-09-01
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Add default value for AVCodecContext::refsSrinath K R2017-06-01
| | | | | | | | | | | | | AVCodecContext::refs is used to control the DPB size to be used by the encoder. The default value for AVCodecContext::refs as set in libavcodec/options_table.h is 1. This patch sets AVCodecContext::refs to 0 for h264_nvenc and hevc_nvenc in order to let the driver take the decision of the correct DPB size to use in all cases. Signed-off-by: Srinath K R <skr@nvidia.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add weighted prediction supportSumit Agarwal2017-05-10
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add fractional CQ supportBen Chang2017-05-10
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: deprecated old rc modes, add new onesTimo Rothenpieler2017-05-09
|
* avcodec/nvenc: surface allocation reductionBen Chang2017-04-26
| | | | | | | | | | | | | | | | This patch aims to reduce the number of input/output surfaces NVENC allocates per session. Previous default sets allocated surfaces to 32 (unless there is user specified param or lookahead involved). Having large number of surfaces consumes extra video memory (esp for higher resolution encoding). The patch changes the surfaces calculation for default, B-frames, lookahead scenario respectively. The other change involves surface selection. Previously, if a session allocates x surfaces, only x-1 surfaces are used (due to combination of output delay and lock toggle logic). To prevent unused surfaces, changing surface rotation to using predefined fifo. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Deprecate usage of global_quality, introducing qpTimo Rothenpieler2017-03-23
|
* avcodec/nvenc: add initial QP value optionsKonda Raju2017-03-01
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: allow forcing keyframes by defaultTimo Rothenpieler2017-02-20
|
* avcodec/nvenc: Add bluray_compat basic implementationMiroslav Slugen2017-01-01
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Make AUD optional for h264_nvenc and hevc_nvencMiroslav Slugen2017-01-01
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: maximum usable surfaces are limited to maximum registered framesMiroslav Slugeň2016-11-22
| | | | | | | Maximum usable surfaces is limited to MAX_REGISTERED_FRAMES constant in nvenc.h Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add support for forcing intra/idr framesTimo Rothenpieler2016-10-12
|
* avcodec/nvenc: nicely align AVOptionsTimo Rothenpieler2016-09-28
|
* avcodec/nvenc: Extended rate-control support as provided by SDK 7Yogender Gupta2016-09-28
| | | | | Merged from libav commit by Yogender Gupta: https://git.libav.org/?p=libav.git;a=commitdiff;h=70de2ea4261f860457a04e3d0c58c5543f403325
* avcodec/nvenc: added support for rate control lookaheadOliver Collyer2016-08-28
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Bring encoder names in line with other encodersTimo Rothenpieler2016-06-25
|
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\ | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * nvenc_h264: Fix name of private AVClassDiego Biurrun2016-04-04
| |