summaryrefslogtreecommitdiff
path: root/libavcodec/cuvid.c
Commit message (Collapse)AuthorAge
* avcodec/cuvid: make capability check optionalTimo Rothenpieler2017-06-01
|
* avcodec/cuvid: use capability check instead of dummy decoderTimo Rothenpieler2017-05-09
|
* cuvid: support AVCodecContext.hw_device_ctx APIwm42017-05-05
| | | | | | | | | | | This is a newer API that is intended for decoders like the cuvid wrapper. Until now, the wrapper required to set an awkward "incomplete" hw_frames_ctx to set the device. Now the device can be set directly, and the user can get AV_PIX_FMT_CUDA output for a specific device simply by setting hw_device_ctx. This still does a dummy ff_get_format() call at init time, and should be fully backward compatible.
* avcodec: do not use AVFrame accessorMuhammad Faiz2017-04-23
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09'James Almer2017-04-22
| | | | | | | | | * commit '061a0c14bb5767bca72e3a7227ca400de439ba09': decode: restructure the core decoding code CUVID decoder adapted by wm4. Merged-by: James Almer <jamrial@gmail.com>
* avcodec/cuvid: add support for cropping/resizingTimo Rothenpieler2017-03-09
| | | | Overhauled version, original patch by Miroslav Slugeň <thunder.m@email.cz>.
* avcodec/cuvid: add drop_second_field as input optionMiroslav Slugeň2017-02-18
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuvid: don't overwrite deinterlace at progressive inputMiroslav Slugeň2017-02-18
| | | | | | | If there is progressive input it will disable deinterlacing in cuvid for all future frames even those interlaced. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuvid: add format mismatch debug logsTimo Rothenpieler2017-02-14
|
* avcodec/cuvid: set width and height before calling get_formatTimo Rothenpieler2017-02-14
| | | | | The external hw_frames_ctx is initialized in that callback, and needs that information to be accurate.
* avcodec/cuvid: update hw_frames_ctx reference after get_format callTimo Rothenpieler2017-02-14
|
* avcodec/cuvid: fail early if GPU can't handle video resolutionPavel Koshevoy2017-01-23
| | | | | | | | | | | | | | CUVID on GeForce GT 730 and GeForce GTX 1060 does not report any error when decoding 8K h264 packets. However, it does return an error during cuvidCreateDecoder call if the indicated video resolution is not supported. Given that stream resolution is typically known as a result of probing it is better to use this information during avcodec_open2 call to fail immediately, rather than proceeding to decode and never receiving any frames from the decoder nor receiving any indication of decode failure. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuvid: fix compilation with msvc11Timo Rothenpieler2016-12-12
|
* avcodec/cuvid: Restore initialization of pixel format in init()Philip Langdale2016-11-23
| | | | | | | | | | | | I moved this into the handle_video_sequence callback because that's the earliest time you can make an accurate decision as to what the format should be. However, transcoding requires that the decision between using the accelerated PIX_FMT_CUDA vs a normal pix format happen at init() time. There is enough information available to make that decision and things work out with the underlying format only being discovered in the sequence callback.
* avcodec/cuvid: Add support for P010/P016 as an output surface formatPhilip Langdale2016-11-22
| | | | | | | | | | | | | | | | | The nvidia 375.xx driver introduces support for P016 output surfaces, for 10bit and 12bit HEVC content (it's also the first driver to support hardware decoding of 12bit content). The cuvid api, as far as I can tell, only declares one output format that they appear to refer to as P016 in the driver strings. Of course, 10bit content in P016 is identical to P010, and it is useful for compatibility purposes to declare the format to be P010 to work with other components that only know how to consume P010 (and to avoid triggering swscale conversions that are lossy when they shouldn't be). For simplicity, this change does not maintain the previous ability to output dithered NV12 for 10/12 bit input video - the user will need to update their driver to decode such videos.
* avcodec/cuvid: allow setting number of used surfacesMiroslav Slugen2016-11-22
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuvid: use dynamically loaded CUDA/CUVIDTimo Rothenpieler2016-11-22
| | | | And remove the now obsolete compat headers.
* avcodec/cuvid: Don't claim to decode h.263 (it doesn't)Philip Langdale2016-10-30
| | | | Turns out cuvid doesn't support h.263.
* avcodec/cuvid: Allow reinitialization of decoderPhilip Langdale2016-10-22
| | | | In practice, this works fine.
* Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'Hendrik Leppkes2016-10-07
| | | | | | | * commit '32c8359093d1ff4f45ed19518b449b3ac3769d27': lavc: export the timestamps when decoding in AVFrame.pts Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* avcodec/cuvid: don't align frame sizeTimo Rothenpieler2016-10-04
| | | | hwcontext_cuda was changed to take care of proper alignment internally
* avcodec/cuvid: make use of new av_hwdevice_ctx_create apiTimo Rothenpieler2016-09-29
|
* avcodec/cuvid: support a pre-initialized hw_frames_ctxTimo Rothenpieler2016-09-29
|
* avcodec/cuvid: use actual frame size for buffer allocationTimo Rothenpieler2016-09-29
|
* avcodec/cuvid: mark as avoid for probingTimo Rothenpieler2016-09-23
|
* cuvid: Pass bit depth information to decoderPhilip Langdale2016-09-22
| | | | | | | Although cuvid can only output 8bit, it can consume HEVC Main10 if the bit depth is set properly. In cases where >8bit is not supported, this change is still beneficial as the decoder will fail to be created instead of plowing throw and decoding as 8bit.
* cuvid: Use bundled headersPhilip Langdale2016-09-22
| | | | | | | | We need to remove the dynlink fanciness and replace it with normal function prototypes and update the include paths and configure logic. We don't need to explicitly check for PICPARMS now - they're going to be there.
* avcodec/cuvid: add support for hardware deinterlacingTimo Rothenpieler2016-09-21
| | | | | | | | Currently does not work with the ffmpeg cli tool, due do it using the old one in one out API. Anything using the new API, like mpv, can make use of it, provided it is prepared for a decoder modifying the framerate and outputing multiple frames per input. FFmpeg itself is not.
* avcodec/cuvid: implement new send_packet/receive_frame apiTimo Rothenpieler2016-09-21
|
* avcodec/cuvid: Check for non 420 chroma formats - they aren't supportedPhilip Langdale2016-09-17
| | | | | | | | | | Despite the video parser seeming to correctly handle 422 and 444 chroma formats, the video decoder fails miserably to actually decode frames - even though no errors are ever returned; you just get frames showing unintialized garbage. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuvid: Fully re-initialize the parser after a flush.Philip Langdale2016-09-17
| | | | | | | | I'm not really sure how this worked at all before, but we do need to reinitalize the parser with the stream extradata. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuvid: Always check for internal errors during parsingPhilip Langdale2016-09-10
| | | | | | | | | | | | | The cuvid parser is basically undocumented, and although you'd think that a failed callback would result in the overall parse call returning an error, that is not true. So, we end up silently trying to keep going as if nothing is wrong, which doesn't achieve anything. Solution: check the internal error flag every time. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuvid: check for and warn about invalid pkt_timebaseTimo Rothenpieler2016-09-09
|
* avcodec/cuvid: use pkt_timebase instead of time_baseTimo Rothenpieler2016-09-09
|
* cuvid: Implement flush to support seeking in media playersPhilip Langdale2016-09-06
| | | | | | | | | | | | | | | | | | | | | Right now, if we attempt to use cuvid in a media player and then try to seek, the decoder will happily pass out whatever frames were already in flight before the seek. There is both the output queue in our code and some number of frames within the cuvid decoder that need to be accounted for. cuvid doesn't support flush, so our only choice is to do a brute-force re-creation of the decoder, which also implies re-creating the parser, but this is fine. The only subtlty is that there is sanity check code in decoder initialisation that wants to make sure the HWContextFrame hasn't already been initialised. This is a fair check to do at the beginning but not after a flush, so it has to be made conditional. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* cuvid: Add hwaccels and decoders for remaining supported formatsPhilip Langdale2016-09-06
| | | | | | | | | | | cuvid/nvdecode also supports mpeg1, mpeg2, h.263/mpeg4-asp and mjpeg. It should, in theory, also support wmv3 via the vc1 support, given that vdpau supports this. However, it failed to play wmv3 samples which vdpau played correctly, so I'm not sure what to make of it. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuvid: add cuvid decoderTimo Rothenpieler2016-06-10