summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.c
Commit message (Collapse)AuthorAge
* avcodec/nvenc: fix indentationTimo Rothenpieler2019-04-27
|
* avcodec/nvenc: only unregister input resources when absolutely neededTimo Rothenpieler2019-04-27
| | | | | | | | | | | | This reverts nvenc to old behaviour, which in some super rare edge cases performs better. The implication of this is that any potential API user who relies on nvenc cleaning up every frames device resources after it's done using them will have to change their usage pattern. That should not be a problem, since pretty much every normal usage pattern automatically implies that surfaces are reused from a common pool, since constant re-allocation is also very expensive.
* avcodec/nvenc: add minimum driver version for SDK 8.2 and 9.0Timo Rothenpieler2019-03-10
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add b_as_ref support for HEVCRoman Arzumanyan2019-02-14
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avutil/hwcontext_cuda: Define and use common CHECK_CU()Philip Langdale2018-11-14
| | | | | | | | | | | | | | | | | | We have a pattern of wrapping CUDA calls to print errors and normalise return values that is used in a couple of places. To avoid duplication and increase consistency, let's put the wrapper implementation in a shared place and use it everywhere. Affects: * avcodec/cuviddec * avcodec/nvdec * avcodec/nvenc * avfilter/vf_scale_cuda * avfilter/vf_scale_npp * avfilter/vf_thumbnail_cuda * avfilter/vf_transpose_npp * avfilter/vf_yadif_cuda
* avcodec/nvenc: add option to turn off a53 closed caption embeddingTimo Rothenpieler2018-08-21
|
* avcodec/nvenc: enable nvenc encoder instance reusePavel Koshevoy2018-06-15
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* Revert "avcodec/nvenc: make hw_frames_ctx fully optional"Timo Rothenpieler2018-05-10
| | | | | | | | This reverts commit 7d4e1f7cfb667585514bfa0a4d0fee2f717a93ed. Accidentially pushed this with a batch of other patches, and it didn't seem to break anything, so I went with it. Except it does, so reverting it it is.
* avcodec/nvenc: move reconfig_encoder call inside of push/pop ctxTimo Rothenpieler2018-05-04
| | | | Also make it void, it must not fail the encode anyway.
* avcodec/nvenc: add A53CC supportRoman Arzumanyan2018-05-04
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: support dynamic bitrate changespkviet2018-05-04
| | | | | | | | | The patch enables dynamic bitrate through ReconfigureEncoder method from nvenc API. This is useful for live streaming in case of network congestion. Signed-off-by: pkviet <pkv.stream@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: support dynamic aspect ratio changeMiroslav Slugeň2018-05-04
| | | | | | | | If there is input like DVB-T streams it can change aspect ratio on-the-fly, so nvenc should respect this change and change aspect ratio in encoder. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: make hw_frames_ctx fully optionalTimo Rothenpieler2018-05-04
|
* avcodec/nv{enc,dec}: use sane version checking macroTimo Rothenpieler2018-04-13
| | | | | For some odd reason, the Nvidia version macros puts the minor version in the msb, so comparing against it is impossible.
* avcodec/nvenc: update required driver versions for nvencTimo Rothenpieler2018-04-11
|
* avcodec/nvenc: add support for B frames as refTimo Rothenpieler2018-04-11
|
* avcodec/nvenc: Declare support for P016Philip Langdale2018-03-02
| | | | | | | | | | | | | | | | | | | nvenc doesn't support P016, but we have two problems today: 1) We declare support for YUV444P16 which nvenc also doesn't support. We do this because it's the only pix_fmt we have that can approximate nvenc's internal format that is YUV444P10 with data in MSBs instead of LSBs. Because the declared format is a 16bit one, it will be preferrentially chosen when encoding >10bit content, but that content will normally be YUV420P12 or P016 which should get mapped to P010 and not YUV444P10. 2) Transcoding P016 content with nvenc should be possible in a pure hardware pipeline, and that can't be done if nvenc doesn't say it accepts P016. By mapping it to P010, we can use it, albeit with truncation. I have established that swscale doesn't know how to dither to 10bits so we'd get truncation anyway, even if we tried to do this 'properly'.
* avcodec/nvenc: also clear data pointer after unregistering a resourceTimo Rothenpieler2018-01-28
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add some more error case checksTimo Rothenpieler2018-01-28
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: unregister input resource when unmappingTimo Rothenpieler2018-01-28
| | | | | | | | | | Currently the resource is only ever unregistered when the registered_frames array is fully in use and an unmapped entry is re-used and cleaned up. I'm pretty sure the frame will have been cleaned up before that happens, so I'm kinda surprised this never blew up. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: refcount input frame mappingsTimo Rothenpieler2018-01-28
| | | | | | | | If some logic like vsync in ffmpeg.c duplicates frames, it might pass the same frame twice, which will result in a crash due it being effectively mapped and unmapped twice. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: set correct error codePan Bian2017-11-29
| | | | | | | | | In function process_output_surface(), the return value is 0 on the path that av_mallocz() returns a NULL pointer. 0 indicates success, which deviates from the fact. Return "AVERROR(ENOMEM)" instead of "0". Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* compat/cuda: Pass a logging context to load functionsMark Thompson2017-11-20
| | | | Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: check pop_context return valueTimo Rothenpieler2017-11-17
|
* nvenc: support d3d11 surface inputHendrik Leppkes2017-11-15
|
* nvenc: factor context push/pop into functionsHendrik Leppkes2017-11-15
| | | | | This reduces code repetition, and will allow adding further push/pop refinement for D3D11 devices in future commits.
* avcodec/nvenc: sanitize variable namesTimo Rothenpieler2017-09-07
|
* avcodec/nvenc: migrate to new encode APITimo Rothenpieler2017-09-07
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: always output picture timing SEITimo Rothenpieler2017-09-02
| | | | | | | | Interlaced encoding profits from it, or might even need it in some players. No harm in enabling it unconditionally. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: only push cuda context on encoder close if encoder existsTimo Rothenpieler2017-09-01
| | | | 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: fix hw accelerated transcode with bframesGanapathy Kasi2017-06-02
| | | | | | | | | | | | | hw accelerated transcode (h264_cuvid -> h264_nvenc with -hwaccel cuvid) was broken after the filtergraph initialization was changed to intialize decoder first followed by encoder (commit af1761f7b5b1b72197dc40934953b775c2d951cc). During initialzing encoder with bframes, local buffers are allocated internally in encoder which fails since no cuda context is available. Now pushing the correct cuda context before encoder initialization fixes the issue. Also adding push/pop cuda ctx during create/destroy/map/unmap resources and destroy encoder session. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: print minimum driver version on errorTimo Rothenpieler2017-06-01
|
* avcodec/nvenc: remove unnecessary alignmentTimo Rothenpieler2017-05-23
| | | | Fixes #6260
* 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: remove usage of deprecated fieldsTimo Rothenpieler2017-05-09
|
* avcodec/nvenc: use frames hwctx when registering a frameTimo Rothenpieler2017-05-07
|
* avcodec/nvenc: support external context in sw modeTimo Rothenpieler2017-05-07
|
* 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: apply quantization factors to cqpTimo Rothenpieler2017-03-23
|
* avcodec/nvenc: Deprecate usage of global_quality, introducing qpTimo Rothenpieler2017-03-23
|
* lavc/nvenc: misc cosmetics to reduce diff with LibavClément Bœsch2017-03-20
|
* avcodec/nvenc: allow different const-qps for I, P and B framesKonda Raju2017-03-17
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add initial QP value optionsKonda Raju2017-03-01
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: remove qmin and qmax constraints for vbrGanapathy Raman Kasi2017-03-01
| | | | | | | qmin and qmax are not necessary for nvenc vbr. Enforcing this constraint, doesn't allow user to use vbr 2 pass mode without explicity setting the qmin and qmax options Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: push cuda context before encoding a frameTimo Rothenpieler2017-02-14
| | | | Thanks to Miroslav Slugeň for figuring out what was going on here.
* avcodec/nvenc: set frame buffer format for mapped framesTimo Rothenpieler2017-02-13
|
* avcodec/nvenc: add logging for more error casesTimo Rothenpieler2017-01-20
|