aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cuviddec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/cuviddec: fix wrong 10bit 420 format in cuvid_handle_video_sequenceTimo Rothenpieler2025-07-261-1/+1
|
* avcodec/cuviddec: also reflect new pix_fmts in cuvid_handle_video_sequenceTimo Rothenpieler2025-07-261-2/+22
|
* avcodec/nvdec: switch to proper pixfmts on next major bumpTimo Rothenpieler2025-07-111-0/+8
|
* avcodec/cuviddec: only flush cuvid when output queue is emptyTimo Rothenpieler2025-05-211-1/+6
|
* avcodec/cuviddec: print error when queueing frames failsTimo Rothenpieler2025-05-211-3/+11
|
* avutil: remove deprecated FF_API_FRAME_PKTJames Almer2025-03-281-6/+0
| | | | | | Deprecated since 2023-03-20. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cuviddec: use pre-existing chroma format informationTimo Rothenpieler2025-03-131-23/+8
| | | | Fixes #11505
* avcodec/cuviddec: correctly handle buffer size and status when deinterlacingTimo Rothenpieler2025-02-261-11/+13
|
* avcodec/cuviddec: add HEVC/H.264 4:2:2 and H.264 10-bit supportDiego de Souza2025-02-021-11/+72
| | | | | | | | | This commit adds support for 4:2:2 decoding for HEVC and H.264 on NVIDIA Blackwell GPUs for cuviddec. Moreover, it supports 10-bit decoding for H.264 on Blackwell GPUs. Signed-off-by: Diego de Souza <ddesouza@nvidia.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: Fix missing HW_CONFIG_METHOD_HW_FRAMES_CTX flagZhao Zhili2025-01-151-0/+1
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/cuviddec: more accurately guess probed sw pixel formatRoman Arzumanyan2024-08-021-3/+20
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* all: use designated initializers for AVOption.unitAnton Khirnov2024-02-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
* avcodec: Remove redundant pix_fmts from decodersAndreas Rheinhardt2024-02-091-5/+0
| | | | | | | | | | | | | | | AVCodec.pix_fmts is only intended for encoders (decoders use the get_format callback to let the user choose a pix fmt). So remove them for the decoders for which this is possible without further complications; keep them for now in the codecs that actually use them (by passing avctx->codec->pix_fmts to ff_get_formatt()). Also notice that some of these lists were wrong; e.g. 317b7b06fd97cd39feac7df57db22a30550351ff added support for YUV444P16 for cuviddec, but forgot to add it to pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+1
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-1/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cuviddec: dynamically set max decode surfacesRandom Joe2023-08-131-1/+6
|
* libavcodec/cuviddec: determine amount of decoded surfaces from within cuvid ↵Roman Arzumanyan2023-06-061-2/+32
| | | | | | parser Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-041-1/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: use the new AVFrame interlace flags in all decoders and encodersJames Almer2023-05-041-3/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/frame: deprecate AVFrame.pkt_{pos,size}Anton Khirnov2023-03-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | These fields are supposed to store information about the packet the frame was decoded from, specifically the byte offset it was stored at and its size. However, - the fields are highly ad-hoc - there is no strong reason why specifically those (and not any other) packet properties should have a dedicated field in AVFrame; unlike e.g. the timestamps, there is no fundamental link between coded packet offset/size and decoded frames - they only make sense for frames produced by decoding demuxed packets, and even then it is not always the case that the encoded data was stored in the file as a contiguous sequence of bytes (in order for pos to be well-defined) - pkt_pos was added without much explanation, apparently to allow passthrough of this information through lavfi in order to handle byte seeking in ffplay. That is now implemented using arbitrary user data passthrough in AVFrame.opaque_ref. - several filters use pkt_pos as a variable available to user-supplied expressions, but there seems to be no established motivation for using them. - pkt_size was added for use in ffprobe, but that too is now handled without using this field. Additonally, the values of this field produced by libavcodec are flawed, as described in the previous ffprobe conversion commit. In summary - these fields are ill-defined and insufficiently motivated, so deprecate them.
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc: use AVFrame.duration instead of AVFrame.pkt_durationAnton Khirnov2022-07-191-1/+1
|
* avcodec: Add FF_CODEC_CAP_NOT_INIT_THREADSAFEAndreas Rheinhardt2022-07-181-1/+2
| | | | | | | This is in preparation of switching the default init-thread-safety to a codec being init-thread-safe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cuviddec: fix null pointer dereferenceZhao Zhili2022-06-261-9/+11
| | | | | | It can happened on error path of cuvid_decode_init(). Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: fix AV1 decoding errorZhao Zhili2022-06-261-0/+10
| | | | | | | | | | | cuvidParseVideoData only supports pure OBUs, it reports an unknown error with AV1CodecConfigurationRecord. Check whether extradata is AV1CodecConfigurationRecord and skip the first 4 bytes to fix the issue. The bug is revealed in ffmpeg cmd since 45e3b6a68 and ffd1316e. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/internal: Hide stuff only used by the core decode APIAndreas Rheinhardt2022-05-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | The general decoding API uses bitstream filters and an AVFifo and therefore AVCodecInternal contains pointers to an AVBSFContext and to an AVFifo and lavc/internal.h includes lavc/bsf.h and lavu/fifo.h. Yet actually, only two files are supposed to use these, namely avcodec.c and (mainly) decode.c. For all the other files, it should be an opaque type that they should not touch and that they need not know anything about. This can be achieved by not including these headers and using the structs instead of the corresponding typedefs. This also forces translation units that really use the BSF and the FIFO APIs themselves to include the relevant headers directly instead of relying on indirect inclusions (up until now, even avcodec.c and decode.c relied on fifo.h to be included by internal.h). Of course, it also avoids unnecessary rebuilds when bsf.h or fifo.h change. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-1/+1
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-10/+10
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-211-0/+1
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-161-0/+2
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc/cuviddec: convert to the new FIFO APIAnton Khirnov2022-02-071-12/+10
|
* lavc/cuviddec: do not reallocate the fifo unnecessarilyAnton Khirnov2022-02-071-7/+1
|
* avcodec/cuviddec: Use AVCodecInternal.in_pkt instead of stack packetAndreas Rheinhardt2021-11-071-4/+9
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cuviddec: signal that the decoder sets all output frame propertiesJames Almer2021-06-211-0/+1
| | | | | | Fixes memleaks described in ticket #9082. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cuviddec: remove unused AVCodec.decode() callbackJames Almer2021-06-211-32/+0
| | | | | | The AVCodec.receive_frame() callback takes precedence. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cuviddec: correctly set key_frame with interlaced contentstuhlo2021-06-111-1/+4
| | | | | | | | | | | Fixes #9283 This fixes setting of 'key_frame' flag in AVFrame when input h264 packets represents individual fields of interlaced video. In this case, pairs of two consecutive fields represents a single decoded picture and have identical 'CurrPicIdx', however, only the first field is entirely intra-coded and has the flag 'intra_pic_flag' set and the second field was resetting the flag before it was even read in the function 'cuvid_output_frame'. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: Remove deprecated AVFrame.pkt_pts fieldAndreas Rheinhardt2021-04-271-5/+0
| | | | | | | Deprecated in 32c8359093d1ff4f45ed19518b449b3ac3769d27. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cuviddec: set ulMaxDisplayDelay to zero if low_delay flag is setMichal Novotny2021-02-221-1/+1
| | | | | | | Zero is the recommended value in Nvidia coding samples for low latency use-cases. Signed-off-by: Michal Novotny <michal.novotny@comprimato.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: unref output frame on failureJames Almer2020-12-131-0/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cuviddec: check for av_buffer_ref() failureJames Almer2020-12-131-0/+6
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cuviddec: fix missing context push/popleozhang2020-11-211-0/+7
| | | | | | | | Test command like below: cuda-memcheck ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input_file -c:v h264_nvenc -f null - Signed-off-by: leozhang <nowerzt@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* lavc: Mark hw_config pointer arrays as constMark Thompson2020-11-081-1/+1
| | | | They are read-only just like the HWConfig structures they point to.
* avcodec/cuviddec: add av1 supportRoman Arzumanyan2020-10-151-0/+13
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/cuviddec: avoid copy of uninitialized extradata pointerTimo Rothenpieler2020-10-011-4/+5
|
* avcodec/cuviddec: use correct type for extradata_sizeTimo Rothenpieler2020-10-011-2/+2
|
* avcodec/cuviddec: fix copy&paste errorTimo Rothenpieler2020-10-011-1/+1
|
* avcodec/cuviddec: handle arbitrarily sized extradataTimo Rothenpieler2020-09-291-16/+24
|
* avcodec/decode: use a single list bsf for codec decode bsfsMarton Balint2020-05-021-1/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>