diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 3c31ee2132..9ea8fccb94 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -734,6 +734,27 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .alias = "y10le", }, + [AV_PIX_FMT_GRAY10MSBBE] = { + .name = "gray10msbbe", + .nb_components = 1, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 2, 0, 6, 10 }, /* Y */ + }, + .flags = AV_PIX_FMT_FLAG_BE, + .alias = "y10msbbe", + }, + [AV_PIX_FMT_GRAY10MSBLE] = { + .name = "gray10msble", + .nb_components = 1, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 2, 0, 6, 10 }, /* Y */ + }, + .alias = "y10msble", + }, [AV_PIX_FMT_GRAY12BE] = { .name = "gray12be", .nb_components = 1, @@ -755,6 +776,27 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .alias = "y12le", }, + [AV_PIX_FMT_GRAY12MSBBE] = { + .name = "gray12msbbe", + .nb_components = 1, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 2, 0, 4, 12 }, /* Y */ + }, + .flags = AV_PIX_FMT_FLAG_BE, + .alias = "y12msbbe", + }, + [AV_PIX_FMT_GRAY12MSBLE] = { + .name = "gray12msble", + .nb_components = 1, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 2, 0, 4, 12 }, /* Y */ + }, + .alias = "y12msble", + }, [AV_PIX_FMT_GRAY14BE] = { .name = "gray14be", .nb_components = 1, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 6aa1c94cec..b811285e51 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -499,6 +499,11 @@ enum AVPixelFormat { AV_PIX_FMT_OHCODEC, /// hardware decoding through openharmony + AV_PIX_FMT_GRAY10MSBBE, ///< Y , 10bpp, lowest bits zero, big-endian + AV_PIX_FMT_GRAY10MSBLE, ///< Y , 10bpp, lowest bits zero, little-endian + AV_PIX_FMT_GRAY12MSBBE, ///< Y , 12bpp, lowest bits zero, big-endian + AV_PIX_FMT_GRAY12MSBLE, ///< Y , 12bpp, lowest bits zero, 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 }; @@ -551,6 +556,8 @@ enum AVPixelFormat { #define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE) #define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE) +#define AV_PIX_FMT_GRAY10MSB AV_PIX_FMT_NE(GRAY10MSBBE, GRAY10MSBLE) +#define AV_PIX_FMT_GRAY12MSB AV_PIX_FMT_NE(GRAY12MSBBE, GRAY12MSBLE) #define AV_PIX_FMT_YUV444P10MSB AV_PIX_FMT_NE(YUV444P10MSBBE, YUV444P10MSBLE) #define AV_PIX_FMT_YUV444P12MSB AV_PIX_FMT_NE(YUV444P12MSBBE, YUV444P12MSBLE) diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils index ccd1522ef2..738ce0289c 100644 --- a/tests/ref/fate/imgutils +++ b/tests/ref/fate/imgutils @@ -306,6 +306,10 @@ gbrp10msbbe planes: 3, linesizes: 128 128 128 0, plane_sizes: 6144 6144 gbrp10msble planes: 3, linesizes: 128 128 128 0, plane_sizes: 6144 6144 6144 0, plane_offsets: 6144 6144 0, total_size: 18432 gbrp12msbbe planes: 3, linesizes: 128 128 128 0, plane_sizes: 6144 6144 6144 0, plane_offsets: 6144 6144 0, total_size: 18432 gbrp12msble planes: 3, linesizes: 128 128 128 0, plane_sizes: 6144 6144 6144 0, plane_offsets: 6144 6144 0, total_size: 18432 +gray10msbbe planes: 1, linesizes: 128 0 0 0, plane_sizes: 6144 0 0 0, plane_offsets: 0 0 0, total_size: 6144 +gray10msble planes: 1, linesizes: 128 0 0 0, plane_sizes: 6144 0 0 0, plane_offsets: 0 0 0, total_size: 6144 +gray12msbbe planes: 1, linesizes: 128 0 0 0, plane_sizes: 6144 0 0 0, plane_offsets: 0 0 0, total_size: 6144 +gray12msble planes: 1, linesizes: 128 0 0 0, plane_sizes: 6144 0 0 0, plane_offsets: 0 0 0, total_size: 6144 image_fill_black tests yuv420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af @@ -559,3 +563,7 @@ gbrp10msbbe total_size: 18432, black_unknown_crc: 0x00000000, black_tv_cr gbrp10msble total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000 gbrp12msbbe total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000 gbrp12msble total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000 +gray10msbbe total_size: 6144, black_unknown_crc: 0x02d4a26f, black_tv_crc: 0x02d4a26f, black_pc_crc: 0x00000000 +gray10msble total_size: 6144, black_unknown_crc: 0xb93165c3, black_tv_crc: 0xb93165c3, black_pc_crc: 0x00000000 +gray12msbbe total_size: 6144, black_unknown_crc: 0x02d4a26f, black_tv_crc: 0x02d4a26f, black_pc_crc: 0x00000000 +gray12msble total_size: 6144, black_unknown_crc: 0xb93165c3, black_tv_crc: 0xb93165c3, black_pc_crc: 0x00000000 diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index a062088d54..af421b4eee 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -73,8 +73,12 @@ isNBPS: gbrp9le gray10be gray10le + gray10msbbe + gray10msble gray12be gray12le + gray12msbbe + gray12msble gray14be gray14le gray9be @@ -186,7 +190,9 @@ isBE: gbrpf16be gbrpf32be gray10be + gray10msbbe gray12be + gray12msbbe gray14be gray16be gray32be @@ -625,8 +631,12 @@ Gray: gray gray10be gray10le + gray10msbbe + gray10msble gray12be gray12le + gray12msbbe + gray12msble gray14be gray14le gray16be @@ -1225,6 +1235,10 @@ DataInHighBits: gbrp10msble gbrp12msbbe gbrp12msble + gray10msbbe + gray10msble + gray12msbbe + gray12msble p010be p010le p012be