diff --git a/doc/APIchanges b/doc/APIchanges index 735b9477ac..6e0d27d993 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.28.0 - pixfmt.h + Add AV_PIX_FMT_GRAY12(LE/BE). + 2016-xx-xx - xxxxxxx - lavu 55.27.0 - hwcontext.h Add av_hwframe_map() and associated AV_HWFRAME_MAP_* flags. Add av_hwframe_ctx_create_derived(). diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 7987f292ac..db90229ebc 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -493,6 +493,27 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, }, + [AV_PIX_FMT_GRAY12BE] = { + .name = "gray12be", + .nb_components = 1, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */ + }, + .flags = AV_PIX_FMT_FLAG_BE, + .alias = "y12be", + }, + [AV_PIX_FMT_GRAY12LE] = { + .name = "gray12le", + .nb_components = 1, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */ + }, + .alias = "y12le", + }, [AV_PIX_FMT_GRAY16BE] = { .name = "gray16be", .nb_components = 1, @@ -1950,6 +1971,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt) case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE switch (pix_fmt) { + PIX_FMT_SWAP_ENDIANNESS(GRAY12); PIX_FMT_SWAP_ENDIANNESS(GRAY16); PIX_FMT_SWAP_ENDIANNESS(YA16); PIX_FMT_SWAP_ENDIANNESS(RGB48); diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 0bee724998..5a7b78a6aa 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -245,6 +245,9 @@ enum AVPixelFormat { AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian + AV_PIX_FMT_GRAY12BE, ///< Y , 12bpp, big-endian + AV_PIX_FMT_GRAY12LE, ///< Y , 12bpp, little-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 }; @@ -259,6 +262,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_BGR32 AV_PIX_FMT_NE(ABGR, RGBA) #define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB) +#define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE) #define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE) #define AV_PIX_FMT_YA16 AV_PIX_FMT_NE(YA16BE, YA16LE) #define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE) diff --git a/libavutil/version.h b/libavutil/version.h index 9287a0b5bd..95aea2f678 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -54,7 +54,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 27 +#define LIBAVUTIL_VERSION_MINOR 28 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \