diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-12-08 11:17:01 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-07-02 09:35:23 +0200 |
commit | b7c5f885233a7b8692140c920d9f43220dc830d9 (patch) | |
tree | 8a597fdad01b11ebf49a27de41164c6b56a82c1a | |
parent | b55566db4c51d920a6496455bb30a608e5a50a41 (diff) | |
download | ffmpeg-b7c5f885233a7b8692140c920d9f43220dc830d9.tar.gz |
pixfmt: add P010 pixel format
P010 is the 10-bit variant of NV12 (planar luma, packed chroma), using two
bytes per component to store 10-bit data plus 6-bit zeroes in the LSBs.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavutil/pixdesc.c | 24 | ||||
-rw-r--r-- | libavutil/pixfmt.h | 4 | ||||
-rw-r--r-- | libavutil/version.h | 2 |
4 files changed, 32 insertions, 1 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index 1caa1b7575..8b5a33511d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2016-xx-xx - xxxxxxx - lavu 55.18.0 - pixdesc.h + Add AV_PIX_FMT_P010(LE/BE). + 2016-xx-xx - xxxxxxx - lavc 57.24.0 - avcodec.h Decoders now export the frame timestamp as AVFrame.pts. It was previously exported as AVFrame.pkt_pts, which is now deprecated. diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 6d9e38db7b..cf2ea9ca40 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -1590,6 +1590,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { .name = "cuda", .flags = AV_PIX_FMT_FLAG_HWACCEL, }, + [AV_PIX_FMT_P010LE] = { + .name = "p010le", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 1, + .comp = { + { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */ + { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */ + { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR, + }, + [AV_PIX_FMT_P010BE] = { + .name = "p010be", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 1, + .comp = { + { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */ + { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */ + { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, + }, }; #if FF_API_PLUS1_MINUS1 FF_ENABLE_DEPRECATION_WARNINGS diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 9a5903b483..8a8d624a37 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -227,6 +227,9 @@ enum AVPixelFormat { */ AV_PIX_FMT_CUDA, + AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian + AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian + 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 }; @@ -282,6 +285,7 @@ enum AVPixelFormat { #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_P010 AV_PIX_FMT_NE(P010BE, P010LE) /** * Chromaticity coordinates of the source primaries. diff --git a/libavutil/version.h b/libavutil/version.h index e24b30d57b..6cd42a6276 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -54,7 +54,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 17 +#define LIBAVUTIL_VERSION_MINOR 18 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |