summaryrefslogtreecommitdiffstats
path: root/libavcodec/cuviddec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/cuviddec: add capability check for maximum macroblock countRuta Gadkari2019-05-081-0/+6
| | | | | | | | | Cuvid supports clips with a limit on maximum number of macroblocks. This check was missing after cuvidGetDecoderCaps API call allowing unsupported clips to proceed. Added the missing check, same as the one in hwaccel nvdec implementation. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: improve progressive frame detectionSergey Svechnikov2019-04-231-0/+6
| | | | | | | | | | | | | There are 2 types of problems when using adaptive deinterlace with cuvid: 1. Sometimes, in the middle of transcoding, cuvid outputs frames with visible horizontal lines (as though weave deinterlace method was chosen); 2. Occasionally, on scene changes, cuvid outputs a wrong frame, which should have been shown several seconds before (as if the frame was assigned some wrong PTS value). The reason is that sometimes CUVIDPARSERDISPINFO has property progressive_frame equal to 1 with interlaced videos. In order to fix the problem we should check if the video is interlaced or progressive in the beginning of a video sequence (cuvid_handle_video_sequence). And then we just use this information instead of the property progressive_frame in CUVIDPARSERDISPINFO (which is unreliable). Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: Remove unnecessary stream synchronisationPhilip Langdale2019-03-301-4/+0
| | | | | | | | We're also doing a sync here after copying the frame to be passed on down the pipleine. And it is also unnecessary. I was able to demonstrate a 33% speedup removing the sync from an example transcode pipeline.
* avcodec/cuviddec: Add support for decoding HEVC 4:4:4 contentPhilip Langdale2019-02-161-20/+46
| | | | | | | | | | | This is the equivalent change for cuviddec after the previous change for nvdec. I made similar changes to the copying routines to handle pixel formats in a more generic way. Note that unlike with nvdec, there is no confusion about the ability of a codec to output 444 formats. This is because the cuvid parser is used, meaning that 444 JPEG content is still indicated as using a 420 output format.
* avutil/hwcontext_cuda: Define and use common CHECK_CU()Philip Langdale2018-11-141-23/+2
| | | | | | | | | | | | | | | | | | 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/cuviddec: properly take deinterlacing and display delay into account ↵Timo Rothenpieler2018-10-141-1/+5
| | | | | | for buffer_full check Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: explicitly synchronize cuMemcpy callsTimo Rothenpieler2018-05-101-1/+5
|
* avcodec/cuviddec: set key frame for decoded framesYogender Gupta2018-01-191-0/+13
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec: add metadata to identify wrappers and hardware decoderswm42017-12-141-1/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* lavc: Delete all fake hwaccelsMark Thompson2017-11-261-6/+0
| | | | They are now unused.
* lavc: Use hardware config information in ff_get_format()Mark Thompson2017-11-261-2/+0
| | | | | | | | | | | | | | | This removes the dependency that hardware pixel formats previously had on AVHWAccel instances, meaning only those which actually do something need exist after this patch. Also updates avcodec_default_get_format() to be able to choose hardware formats if either a matching device has been supplied or no additional external configuration is required, and avcodec_get_hw_frames_parameters() to use the hardware config rather than searching the old hwaccel list. The FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS mechanism is deleted because it no longer does anything (the codec already contains the pointers to the matching hwaccels).
* lavc: Add hardware config metadata for decoders supporting hardware outputMark Thompson2017-11-261-0/+15
| | | | | | | | | This includes a pointer to the associated hwaccel for decoders using hwaccels - these will be used later to implement the hwaccel setup without needing a global list. Also added is a new file listing all hwaccels as external declarations - this will be used later to generate the hwaccel list at configure time.
* compat/cuda: Pass a logging context to load functionsMark Thompson2017-11-201-1/+1
| | | | Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec: allow multiple hwaccels for the same codec/pixfmtwm42017-11-101-0/+2
| | | | | | | | | | | | | | | Currently, AVHWAccels are looked up using a (codec_id, pixfmt) tuple. This means it's impossible to have 2 decoders for the same codec and using the same opaque hardware pixel format. This breaks merging Libav's CUVID hwaccel. FFmpeg has its own CUVID support, but it's a full stream decoder, using NVIDIA's codec parser. The Libav one is a true hwaccel, which is based on the builtin software decoders. Fix this by introducing another field to disambiguate AVHWAccels, and use it for our CUVID decoders. FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS makes this mechanism backwards compatible and optional.
* avcodec/cuvid: rename cuvid.c to cuviddec.cwm42017-11-101-0/+1164
cuvid.c is used by Libav's CUVID hwaccel. Resolve the conflict and avoid future merge problems by renaming our decoder. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
OpenPOWER on IntegriCloud