diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 9c708520b1..3a34c21a07 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2791,6 +2791,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_PLANAR, }, + [AV_PIX_FMT_NV15] = { + .name = "nv15", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 1, + .comp = { + { 0, 10, 0, 0, 10 }, /* Y */ + { 1, 20, 0, 0, 10 }, /* U */ + { 1, 20, 10, 0, 10 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BITSTREAM, + }, + [AV_PIX_FMT_NV20] = { + .name = "nv20", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 0, + .comp = { + { 0, 10, 0, 0, 10 }, /* Y */ + { 1, 20, 0, 0, 10 }, /* U */ + { 1, 20, 10, 0, 10 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BITSTREAM, + }, }; static const char * const color_range_names[] = { diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 4aa20e4e58..210db762f8 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -196,8 +196,8 @@ enum AVPixelFormat { AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian, deprecated in favor of AV_PIX_FMT_NV20 + AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian, deprecated in favor of AV_PIX_FMT_NV20 AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian @@ -439,6 +439,9 @@ enum AVPixelFormat { */ AV_PIX_FMT_D3D12, + AV_PIX_FMT_NV15, ///< like P010, but has no zero padding bits, 15bpp, bitstream + AV_PIX_FMT_NV20, ///< like P210, but has no zero padding bits, 20bpp, bitstream + 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 }; @@ -523,7 +526,6 @@ enum AVPixelFormat { #define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE) #define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE) -#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE) #define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE) #define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE) #define AV_PIX_FMT_P012 AV_PIX_FMT_NE(P012BE, P012LE) diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index fff93bbf0e..9b427ff0a1 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -61,6 +61,8 @@ isNBPS: gray14le gray9be gray9le + nv15 + nv20 nv20be nv20le p010be @@ -221,7 +223,9 @@ isYUV: ayuv64be ayuv64le nv12 + nv15 nv16 + nv20 nv20be nv20le nv21 @@ -337,7 +341,9 @@ isYUV: isPlanarYUV: nv12 + nv15 nv16 + nv20 nv20be nv20le nv21 @@ -434,7 +440,9 @@ isPlanarYUV: isSemiPlanarYUV: nv12 + nv15 nv16 + nv20 nv20be nv20le nv21 @@ -868,7 +876,9 @@ Planar: gbrpf32be gbrpf32le nv12 + nv15 nv16 + nv20 nv20be nv20le nv21