avutil/pixfmt: add AV_PIX_FMT_CUARRAY for opaque CUDA block-linear surfaces

Add a new hardware pixel format representing opaque block-linear CUDA
arrays (CUarray). This format is used by NVDEC when decoding into
opaque surfaces registered with cuvidRegisterDecodeSurfaces, and can
be consumed directly by NVENC as CUDA array input without requiring
a pitch-linear copy.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
This commit is contained in:
Diego de Souza
2026-03-14 01:11:31 +01:00
committed by Timo Rothenpieler
parent 5002b55ce7
commit c7546ce0ea
3 changed files with 13 additions and 0 deletions

View File

@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2026-06-23.
API changes, most recent first:
2026-07-14 - xxxxxxxxxx - lavu 61.5.100 - pixfmt.h
Add AV_PIX_FMT_CUARRAY.
2026-07-11 - xxxxxxxxxxx - lavu 61.4.100 - frame.h
Add AV_FRAME_DATA_DOWNMIX_MATRIX.

View File

@@ -2278,6 +2278,10 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.name = "cuda",
.flags = AV_PIX_FMT_FLAG_HWACCEL,
},
[AV_PIX_FMT_CUARRAY] = {
.name = "cuarray",
.flags = AV_PIX_FMT_FLAG_HWACCEL,
},
[AV_PIX_FMT_AMF_SURFACE] = {
.name = "amf",
.flags = AV_PIX_FMT_FLAG_HWACCEL,

View File

@@ -499,6 +499,12 @@ enum AVPixelFormat {
AV_PIX_FMT_OHCODEC, /// hardware decoding through openharmony
/**
* CUDA block-linear (opaque). data[0] is a CUarray in block-linear layout,
* e.g. from NVDEC opaque decode. Use for zero-copy to NVENC (CUDA array input).
*/
AV_PIX_FMT_CUARRAY,
AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
};