summaryrefslogtreecommitdiffstats
path: root/libavcodec/nvenc.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/nvenc: fix hw accelerated transcode with bframesGanapathy Kasi2017-06-021-0/+75
| | | | | | | | | | | | | 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-011-1/+14
|
* avcodec/nvenc: remove unnecessary alignmentTimo Rothenpieler2017-05-231-4/+4
| | | | Fixes #6260
* avcodec/nvenc: add weighted prediction supportSumit Agarwal2017-05-101-0/+9
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add fractional CQ supportBen Chang2017-05-101-1/+6
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: deprecated old rc modes, add new onesTimo Rothenpieler2017-05-091-11/+21
|
* avcodec/nvenc: remove usage of deprecated fieldsTimo Rothenpieler2017-05-091-7/+0
|
* avcodec/nvenc: use frames hwctx when registering a frameTimo Rothenpieler2017-05-071-1/+1
|
* avcodec/nvenc: support external context in sw modeTimo Rothenpieler2017-05-071-5/+10
|
* avcodec/nvenc: surface allocation reductionBen Chang2017-04-261-17/+38
| | | | | | | | | | | | | | | | 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-231-3/+5
|
* avcodec/nvenc: Deprecate usage of global_quality, introducing qpTimo Rothenpieler2017-03-231-5/+11
|
* lavc/nvenc: misc cosmetics to reduce diff with LibavClément Bœsch2017-03-201-13/+13
|
* avcodec/nvenc: allow different const-qps for I, P and B framesKonda Raju2017-03-171-9/+20
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add initial QP value optionsKonda Raju2017-03-011-8/+25
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: remove qmin and qmax constraints for vbrGanapathy Raman Kasi2017-03-011-10/+3
| | | | | | | 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-141-0/+28
| | | | Thanks to Miroslav Slugeň for figuring out what was going on here.
* avcodec/nvenc: set frame buffer format for mapped framesTimo Rothenpieler2017-02-131-0/+1
|
* avcodec/nvenc: add logging for more error casesTimo Rothenpieler2017-01-201-2/+6
|
* avcodec/nvenc: make gpu indices independend of supported capabilitiesTimo Rothenpieler2017-01-201-2/+5
|
* avcodec/nvenc: Add bluray_compat basic implementationMiroslav Slugen2017-01-011-0/+15
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Make AUD optional for h264_nvenc and hevc_nvencMiroslav Slugen2017-01-011-2/+2
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: round qpIntra and qpInter calculationMiroslav Slugeň2017-01-011-2/+2
| | | | | | | | Round qpIntra and qpInter calculation instead of old floor behavior. Adopted from vaapi_encode_h264.c Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* NVENC: Update check for LookaheadRuta Gadkari2016-12-261-1/+1
| | | | Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: mark intentional fall throughTimo Rothenpieler2016-11-301-0/+1
|
* avcodec/nvenc: always reduce DAR width and heightMiroslav Slugeň2016-11-301-12/+9
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Delay identification of underlying format of cuda framesPhilip Langdale2016-11-301-34/+37
| | | | | | | | | | | | | | | | | | When input surfaces are cuda frames, we will not know what the actual underlying format (nv12, p010, etc) is at surface allocation time. On the other hand, we will know when the input frames are actually registered and associated with a surface. So, let's delay format discovery until registration time, which is actually how we handle other frame properties, such as dimensions. By itself, this change doesn't allow for transcoding of 10bit content from cuvid, but it reduces the problem to the hardcoding of the sw format in ffmpeg_cuvid.c Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Remove aspect-ratio decompensation logicPhilip Langdale2016-11-251-12/+0
| | | | | | This dubious behaviour in nvenc was finally removed by nvidia, and as we refuse to run on anything older than 7.0, we don't need to keep it around for old versions.
* avcodec/nvenc: better surface allocation alghoritm, fix rc_lookaheadMiroslav Slugeň2016-11-221-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User selectable surfaces are not working correctly, if you set number of surfaces on cmdline, it will always use minimum 32 or 48 depends on selected resolution, but in nvenc it is not necessary to use so many surfaces. So from now you can define as low as 1 surface and nvenc will still work, it will ofcourse lower GPU memory usage by 95% and async_delay to zero That was the easy part, now littlebit more... Next part of this patch is to always prefer rc_lookahead to be more important for number of surfaces, than user defined surfaces value. Maximum rc_lookahead from nvidia documentation is 32, but could increase in future generations so there is no limit for this yet. Value async_depth is still accepted and prefered over rc_lookahead. There were also bug when you request more than rc_lookahead > 31, it will always set maximum 31, because surface numbers recalculation was after setting lookahead, which is now fixed. Results: If you set -rc_lookahead 32 and -bf 3 it will now use only 40 surfaces and lower GPU memory usage by 20%, also it will now increase PSNR by 0.012dB Two more comments: 1. from my internal test, i don't understand addition of 4 more surfaces when lookahead is calculated, i didn't used this and everything works as with those 4 more extra surfaces, does anybody know what is going on there? I looks like it was used for B frames which are calculated separately, because B frames maximum is 4. 2. rc_lookahead is defined default to -1, but in test condition if (ctx->rc_lookahead) which sets lookahead it will be always true, i don't know if this is intended behavior, so in default behavior is lookahead always on! This is default condition when rc_lokkahead is -1 (not defined on cmdline), whis is maybe something that is not intended: ctx->encode_config.rcParams.enableLookahead = 1; ctx->encode_config.rcParams.lookaheadDepth = 0; ctx->encode_config.rcParams.disableIadapt = 0; ctx->encode_config.rcParams.disableBadapt = 0; Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: use dynamically loaded CUDATimo Rothenpieler2016-11-221-103/+22
|
* avcodec/nvenc.c: Use new safe dlopen code.Matt Oliver2016-11-051-5/+1
| | | | Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* avcodec/nvenc: add test for Temporal AQ supportSven C. Dack2016-10-191-0/+6
| | | | | | Adds a check to see if the hardware supports temporal aq. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: add support for forcing intra/idr framesTimo Rothenpieler2016-10-121-1/+7
|
* avcodec/nvenc: Extended rate-control support as provided by SDK 7Yogender Gupta2016-09-281-3/+43
| | | | | Merged from libav commit by Yogender Gupta: https://git.libav.org/?p=libav.git;a=commitdiff;h=70de2ea4261f860457a04e3d0c58c5543f403325
* avcodec/nvenc: add HEVC REXT profileTimo Rothenpieler2016-09-281-0/+10
|
* avcodec/nvenc: Make sure that enum and array index matchTimo Rothenpieler2016-09-281-12/+20
| | | | | | Based on libav commits by Luca Barbato and Yogender Gupta: https://git.libav.org/?p=libav.git;a=commit;h=352741b5ead1543d775ccf6040f33023e4491186 https://git.libav.org/?p=libav.git;a=commit;h=e02e2515b24bfc37ede6ca1744696230be55e50b
* avcodec/nvenc: use AVERROR_BUFFER_TOO_SMALL instead of ENOBUFSJames Almer2016-09-241-1/+1
| | | | | | | Should fix compilation with mingw32 Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/nvenc: use frame size instead of surface sizeTimo Rothenpieler2016-09-081-1/+1
|
* avcodec/nvenc: support RGB inputSven C. Dack2016-09-071-0/+10
| | | | | | | nvenc still encodes as yuv, but does the conversion internally which brings some performance gains. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: correctly set inputPitchTimo Rothenpieler2016-09-071-0/+3
|
* avcodec/nvenc: use av_image_copy for copying frame dataTimo Rothenpieler2016-09-071-73/+21
|
* avcodec/nvenc: update license headerTimo Rothenpieler2016-08-281-2/+2
|
* avcodec/nvenc: use proper soname for cuda/nvenc librariesTimo Rothenpieler2016-08-281-2/+2
|
* avcodec/nvenc: check maximum driver API versionTimo Rothenpieler2016-08-281-0/+18
|
* avcodec/nvenc: fix potantially uninitialized freeTimo Rothenpieler2016-08-281-1/+1
|
* avcodec/nvenc: fix library names on cygwinTimo Rothenpieler2016-08-281-11/+13
|
* avcodec/nvenc: added support for rate control lookaheadOliver Collyer2016-08-281-0/+11
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: added support for 10 bit HEVC encodingOliver Collyer2016-08-281-4/+69
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-211-3/+4
|\ | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-4/+4
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
OpenPOWER on IntegriCloud