Age | Commit message (Collapse) | Author |
|
nvenc_hevc
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
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.
|
|
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.
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
|
|
|
|
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.
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
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>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
|
|
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>
|
|
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Maximum usable surfaces is limited to MAX_REGISTERED_FRAMES constant in
nvenc.h
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
|
|
|
|
Merged from libav commit by Yogender Gupta:
https://git.libav.org/?p=libav.git;a=commitdiff;h=70de2ea4261f860457a04e3d0c58c5543f403325
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
|
|
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
cosmetics: Fix spelling mistakes
Merged-by: Clément Bœsch <u@pkh.me>
|
|
Use explicit nvenc capability checks instead to determine usable devices
instead of SM versions.
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
|
|
Signed-off-by: Diego Biurrun <diego@biurrun.de>
|
|
|
|
|
|
Change 'nvenc_<codec>' to '<codec>_nvenc', which is consistent with
other similar decoders and encoders (QSV, MMAL).
|
|
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
|
|
Partially based on the work of Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
|