Commit Graph
100 Commits
Author SHA1 Message Date
Timo Rothenpieler 2de6cd4ba4 avutil/hwcontext_cuda: return more useful error codes from init functions 2021-11-22 23:03:21 +01:00
Timo Rothenpieler b1f1de0844 avutil/hwcontext_cuda: add option to use primary device context 2021-11-22 23:03:21 +01:00
Timo Rothenpieler 2ece70090d avutil/hwcontext_vulkan: add support for exporting memory via Win32 Handles 2021-11-14 12:50:32 +01:00
Timo Rothenpieler fedf4ff85c avutil/vulkan: load win32 external memory functions 2021-11-14 12:50:32 +01:00
Timo Rothenpieler 1831fa7278 avfilter/sharpen_npp: use FILTER_SINGLE_PIXFMT 2021-10-07 19:01:25 +02:00
Timo Rothenpieler 37745b4904 avfilter/scale_npp: fix non-aligned output frame dimensions 2021-10-07 18:07:53 +02:00
Timo Rothenpieler 06de593303 avfilter/frei0r: use win32dlfcn wrapper 2021-09-15 12:37:02 +02:00
Timo Rothenpieler 1d23e125b6 configure: account for openssl3 license change 2021-09-15 12:37:02 +02:00
Timo Rothenpieler acd3c101ef compat/cuda: add __expf() implementation 2021-08-14 15:06:47 +02:00
Timo Rothenpieler 00b579890d avcodec/nvenc: always set qp cr/cb offsets 2021-08-09 15:16:58 +02:00
Timo Rothenpieler ac0408522a avcodec/nvenc: make aware of SDK 11.1 driver requirements 2021-08-08 02:00:38 +02:00
Timo Rothenpieler 7ec7e6aa2d configure: use pkg-config for xlib/Xv 2021-07-14 23:58:24 +02:00
Timo Rothenpieler 62dc5df941 avfilter/scale_cuda: add support for pixel format conversion 2021-06-25 01:44:30 +02:00
Timo Rothenpieler b0e2e938c3 avfilter/scale_cuda: combine separate CUDA sources 2021-06-24 20:58:47 +02:00
Timo Rothenpieler 91a41a3439 avfilter/cuda: fix ptx inflation with large payloads 2021-06-24 20:58:47 +02:00
Timo Rothenpieler 072788c46e avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
Timo Rothenpieler abe150c9de configure: msys also has .exe suffix 2021-06-22 14:04:50 +02:00
Timo Rothenpieler 8bcce5673a avcodec/nvenc: add option to disable all extra SEI data
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>
2021-06-06 22:01:56 +02:00
Timo Rothenpieler c67f354be8 configure: detect nvcc without sm_30 support
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-06-06 21:31:00 +02:00
Timo Rothenpieler 57de80673c avcodec/nvenc: extract sei data prep into own function 2021-06-04 18:40:17 +02:00
Timo Rothenpieler 8d0fea81c7 avcodec/nvenc: disable s12m timestamps by default
Leads to weird crashes with valid looking input data for otherwise
unknown reasons.
2021-05-29 22:59:57 +02:00
Timo Rothenpieler 988f2e9eb0 avcodec/nvenc: fix lossless tuning logic
Relying on the order of the enum is bad.
It clashes with the new presets having to sit at the end of the list, so
that they can be properly filtered out by the options parser on builds
with older SDKs.

So this refactors nvenc.c to instead rely on the internal NVENC_LOSSLESS
flag. For this, the preset mapping has to happen much earlier, so it's
moved from nvenc_setup_encoder to nvenc_setup_device and thus runs
before the device capability check.
2021-04-18 11:39:45 +02:00
Timo Rothenpieler ef16dcc6a9 avfilter/overlay_cuda: check av_buffer_ref result 2021-04-11 10:22:01 +02:00
Timo Rothenpieler 5d52c4cbba avfilter/overlay_cuda: hold explicit reference to hw_device_ctx 2021-04-11 09:21:21 +02:00
Timo Rothenpieler 7555d6f74c avcodec/nvenc: add support for gbrp rgb input 2021-04-11 09:21:21 +02:00
Timo Rothenpieler 7a2d94cf1a avcodec/nvenc: fix timestamp offset ticks logic 2021-01-09 16:34:59 +01:00
Timo RothenpielerandJames Almer ac5b45abab avcodec/nvdec: add av1 hwaccel
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Co-authored-by: James Almer <jamrial@gmail.com>
2020-11-11 18:36:09 +01:00
Timo Rothenpieler 72982f8cb5 avcodec/nvdec: add support for separate reference frame
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-11-11 18:36:09 +01:00
Timo RothenpielerandJames Almer 5868f1c66b avcodec/av1dec: expose coded_lossless
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Co-authored-by: James Almer <jamrial@gmail.com>
2020-11-11 18:36:09 +01:00
Timo RothenpielerandJames Almer e1efff8906 avcodec/av1dec: expose skip mode frame index
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Co-authored-by: James Almer <jamrial@gmail.com>
2020-11-11 18:36:09 +01:00
Timo Rothenpieler a1553b0cfb avfilter/scale_cuda: fix pitch calculation for >8 bit formats 2020-11-05 00:47:14 +01:00
Timo Rothenpieler 09e49ba31e avfilter/scale_cuda: simplify linesize calculation 2020-11-04 20:00:35 +01:00
Timo Rothenpieler 94cb78ed94 avfilter/scale_cuda: add support for RGB formats 2020-11-04 19:53:41 +01:00
Timo Rothenpieler 9a0b702078 avfilter/scale_cuda: expose optional algorithm parameter 2020-11-04 18:10:19 +01:00
Timo Rothenpieler cfdddec0c8 avfilter/scale_cuda: add lanczos algorithm 2020-11-04 01:43:21 +01:00
Timo Rothenpieler 98d3f23598 avutil/hwcontext_cuda: fix edge case with non-even frame heights 2020-11-04 01:36:48 +01:00
Timo Rothenpieler 2f3cb5ccca avutil/hwcontext_cuda: query correct alignment from device 2020-11-04 01:36:39 +01:00
Timo Rothenpieler 4ad7af085c avfilter/scale_cuda: add nearest neighbour algorithm 2020-11-03 19:58:13 +01:00
Timo Rothenpieler 15c0e038ce avfilter/scale_cuda: code cleanup 2020-11-03 19:58:13 +01:00
Timo Rothenpieler f1d0f83712 avfilter/scale_cuda: add bicubic interpolation 2020-11-03 19:58:13 +01:00
Timo Rothenpieler d5763edab2 avutil/hwcontext_cuda: increase CUDA frame alignment to 512
At least on Turing, a frame without 512 byte alignment cannot be passed
to cuTexObjectCreate.
2020-11-03 18:17:35 +01:00
Timo Rothenpieler 45e3131c44 avcodec/nvenc: fix build with older SDKs 2020-10-30 20:44:49 +01:00
Timo Rothenpieler 91b8e00538 avcodec/nvenc: only enforce explicitly set twopass mode 2020-10-30 17:27:03 +01:00
Timo Rothenpieler d5b0a8e503 avcodec/nvenc: only auto-pick vbr rc in cq mode 2020-10-30 17:27:03 +01:00
Timo Rothenpieler bb6edf618a avcodec/nvenc: all presets are SDK10 presets now 2020-10-29 21:59:37 +01:00
Timo Rothenpieler 1bf86ee907 avcodec/nvenc: removed unused and deprecated field 2020-10-21 18:47:30 +02:00
Timo Rothenpieler e0c8e517b6 avcodec/nvenc: reduce automated use of deprecated modes 2020-10-21 18:45:52 +02:00
Timo Rothenpieler cde3c08033 avcodec/nvenc: mark newly deprecated rc modes 2020-10-21 18:17:08 +02:00
Timo Rothenpieler 11a8e93681 avcodec/nvenc: use alias to provide deprecated profiles 2020-10-21 18:03:45 +02:00
Timo Rothenpieler 62073cfa97 avcodec/nvenc: update driver versions for SDK 11.0 2020-10-17 23:10:42 +02:00
Timo Rothenpieler 0a31d57a56 configure: check for nvdec/cuvid AV1 support 2020-10-15 23:25:05 +02:00
Timo Rothenpieler 13c74291ec avcodec/cuviddec: avoid copy of uninitialized extradata pointer 2020-10-01 21:28:55 +02:00
Timo Rothenpieler c75756d047 avcodec/cuviddec: use correct type for extradata_size 2020-10-01 20:49:59 +02:00
Timo Rothenpieler bba6262080 avcodec/cuviddec: fix copy&paste error 2020-10-01 20:20:48 +02:00
Timo Rothenpieler a96743a05c avcodec/cuviddec: handle arbitrarily sized extradata 2020-09-29 23:29:04 +02:00
Timo Rothenpieler 466c14d107 avcodec/nvenc: fix B-Ref-Mode support check for recent HEVC 2020-07-28 21:44:11 +02:00
Timo Rothenpieler 3223f6b32d avcodec/nvenc: add new h264 levels from Video SDK 10
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-07-01 16:10:00 +02:00
Timo Rothenpieler 9aef4ae975 avcodec/nvenc: rename tc option to something more unique
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-06-30 19:03:56 +02:00
Timo Rothenpieler b11ed97599 avcodec/nvenc: add a53cc option for hevc_nvenc
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-06-30 19:01:54 +02:00
Timo Rothenpieler 9ce7de9038 avcodec/nvenc: refactor dts calculation logic
The old approach used some highly complex delta computation math and
output-delaying.
I do not remember what the initial reasoning behind that was, but given
that we can just offset the dts by the amount of bframes, it seems wholy
unnecessary.

This leaves open an issue with VFR content, for which some more complex
logic might be needed.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-05-02 01:33:49 +02:00
Timo Rothenpieler aaadf0dce8 avcodec/nvenc: offset dts to account for b-frame reordering
Fixes ticket #7303

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-05-01 20:52:36 +02:00
Timo Rothenpieler 30b28f9a83 avutil/hwcontext_cuda: Only handle CUDA hardware frames 2020-04-06 19:33:01 +02:00
Timo Rothenpieler 77d5ea1c7c avutil/frame: make frame copy functions hwframe aware 2020-03-28 17:59:32 +01:00
Timo Rothenpieler b06ae06e6a avutil/hwcontext: correctly set extended_data on hwframe_get_buffer 2020-03-28 17:59:29 +01:00
Timo Rothenpieler 767f53533a nvdec: attach real hw_frames to post-processed frames 2020-03-28 17:58:54 +01:00
Timo Rothenpieler d9a37af070 avutil/hwcontext_cuda: combine transfer functions
Gets rid of some mostly duplicated code and adds the ability to do
hardware to hardware transfers.
2020-03-19 17:38:36 +01:00
Timo Rothenpieler cb3c77cfee ffmpeg: default hwaccel_output_format to cuda when hwaccel is cuvid
This ensures old commandlines using -hwaccel cuvid don't break due to
the recent removal of the the cuvid-specific hwaccel bringup.
2020-03-07 13:13:55 +01:00
Timo Rothenpieler d4996a600c avcodec/nvdec_mpeg12: set field flags 2020-01-02 13:15:27 +01:00
Timo Rothenpieler 4fb6ce27f0 avcodec/nvenc: make sure newly allocated packets are refcounted
Fixes ticket 8383

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-11-17 01:37:34 +01:00
Timo Rothenpieler ab0ef1abdf avcodec/nvenc: make use of new GetLastErrorString function
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-09-27 20:00:59 +02:00
Timo Rothenpieler 51a23343d9 avcodec/nvenc: pass CUstream to nvenc when available
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-09-27 20:00:59 +02:00
Timo Rothenpieler e929b2f248 avcodec/nvenc: switch to dedicated dpb_size option
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-09-27 20:00:59 +02:00
Timo Rothenpieler 89cbbe9f70 avcodec/nvenc: fix typo in new Windows driver version
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-09-24 12:00:00 +02:00
Timo Rothenpieler 648f5c9382 avcodec/nvenc: add driver version info for SDK 9.1
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-09-23 15:47:27 +02:00
Timo Rothenpieler a6818d5bd0 compat/cuda/ptx2c: don't drop final newline 2019-05-24 19:23:39 +02:00
Timo Rothenpieler 2e254bb897 avcodec/nvenc: fix indentation 2019-04-27 12:33:08 +02:00
Timo Rothenpieler 23ed147e8f avcodec/nvenc: only unregister input resources when absolutely needed
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.
2019-04-27 12:33:08 +02:00
Timo Rothenpieler 1144d5c96d avcodec/nvenc: add minimum driver version for SDK 8.2 and 9.0
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-03-10 00:25:31 +01:00
Timo Rothenpieler 85051febc6 configure: update minimum required ffnvcodec versions
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-02-27 18:03:17 +01:00
Timo Rothenpieler c775410f31 configure: pass windows-path to nvcc whenever cygpath is available
It might be using cl.exe on Windows, which does not understand Unix-Paths.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-02-27 18:03:17 +01:00
Timo Rothenpieler 9e1e521393 avutil/cuda_check: fix usage of removed .c file
Why did this not break compilation?
2019-02-15 00:44:12 +01:00
Timo Rothenpieler 15c6390139 avutil/cuda_check: avoid pointlessly exporting same symbol from two libraries 2019-02-14 13:21:07 +01:00
Timo Rothenpieler 2797bd5c81 avfilter/*_cuda: don't include internal header
It's not used, and pulls in the ffnvcodec header, which does not neccesarily have to exist to build these filters, since they include the full cuda.h.
2018-10-21 22:55:21 +02:00
Timo Rothenpieler 19546cfef1 avcodec/cuviddec: properly take deinterlacing and display delay into account for buffer_full check
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2018-10-14 18:09:00 +02:00
Timo Rothenpieler 0c71c6d66f avcodec/utils: document allocation requirement of extradata 2018-08-25 18:31:12 +02:00
Timo Rothenpieler dc2d56a66b avcodec/nvenc: add option to turn off a53 closed caption embedding 2018-08-21 15:14:56 +02:00
Timo Rothenpieler ed647ab79f avformat/librtmp: fix returning EOF from Read/Write
Ticket #7052
2018-07-28 01:04:38 +02:00
Timo Rothenpieler 3f953379e1 avcodec/qsvenc: fix version detection on cygwin 2018-06-27 16:04:08 +02:00
Timo Rothenpieler 6129b13dad configure: simplify ffnvcodec version logic 2018-06-15 11:18:47 +02:00
Timo Rothenpieler 46c1ee1917 avcodec/hevcdec: make ff_hevc_frame_nb_refs take a const pointer 2018-05-10 18:41:56 +02:00
Timo Rothenpieler 1c15d26615 avfilter/vf_hwupload_cuda: update supported pix_fmts 2018-05-10 00:34:22 +02:00
Timo Rothenpieler ece068a771 avutil/hwcontext_cuda: use generic size and pointer assignment functions 2018-05-10 00:34:22 +02:00
Timo Rothenpieler 41a18982d0 avutil/hwcontext_cuda: add support for nvenc rgb formats 2018-05-10 00:34:22 +02:00
Timo Rothenpieler 93d1756af2 avcodec/cuviddec: explicitly synchronize cuMemcpy calls 2018-05-10 00:34:22 +02:00
Timo Rothenpieler 9b82e333b7 avutil/hwcontext_cuda: explicitly synchronize cuMemcpy calls 2018-05-10 00:34:22 +02:00
Timo Rothenpieler 880236e898 avcodec/nvdec: pass CUstream in vpp parameters 2018-05-10 00:34:22 +02:00
Timo Rothenpieler c855683427 avutil/hwcontext_cuda: add CUstream in cuda hwctx 2018-05-10 00:34:22 +02:00
Timo Rothenpieler baabd3c2ad avcodec/nvdec: avoid needless copy of output frame
Replaces the data pointers with the mapped cuvid ones.
Adds buffer_refs to the frame to ensure the needed contexts stay alive
and the cuvid idx stays allocated.
Adds another buffer_ref to unmap the frame when it's unreferenced itself.
2018-05-10 00:34:21 +02:00
Timo Rothenpieler 2e700b082c Revert "avcodec/nvenc: make hw_frames_ctx fully optional"
This reverts commit 7d4e1f7cfb.

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.
2018-05-10 00:34:21 +02:00
Timo Rothenpieler fdbb4b9a78 avcodec/nvenc: move reconfig_encoder call inside of push/pop ctx
Also make it void, it must not fail the encode anyway.
2018-05-04 23:35:38 +02:00