diff options
author | Oskar Arvidsson <oskar@irock.se> | 2011-03-29 19:48:47 +0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-05-10 15:24:19 +0400 |
commit | 42239ced656ddddb85eb9655e8a66d29065f0dad (patch) | |
tree | d90980a25e0338c70b9b1c22ffe9edbb21c1cb26 /libavutil | |
parent | e39e3abad4ce667f06d41097428695a7aad095fb (diff) |
Add pixel formats for 9- and 10-bit yuv420p.
Also add support for these formats in libswscale.
Needed for high bit depth h264 decoding.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/pixdesc.c | 46 | ||||
-rw-r--r-- | libavutil/pixfmt.h | 6 |
2 files changed, 52 insertions, 0 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 16a26da3da..a291141436 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -740,6 +740,52 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, + [PIX_FMT_YUV420P9LE] = { + .name = "yuv420p9le", + .nb_components= 3, + .log2_chroma_w= 1, + .log2_chroma_h= 1, + .comp = { + {0,1,1,0,8}, /* Y */ + {1,1,1,0,8}, /* U */ + {2,1,1,0,8}, /* V */ + }, + }, + [PIX_FMT_YUV420P9BE] = { + .name = "yuv420p9be", + .nb_components= 3, + .log2_chroma_w= 1, + .log2_chroma_h= 1, + .comp = { + {0,1,1,0,8}, /* Y */ + {1,1,1,0,8}, /* U */ + {2,1,1,0,8}, /* V */ + }, + .flags = PIX_FMT_BE, + }, + [PIX_FMT_YUV420P10LE] = { + .name = "yuv420p10le", + .nb_components= 3, + .log2_chroma_w= 1, + .log2_chroma_h= 1, + .comp = { + {0,1,1,0,9}, /* Y */ + {1,1,1,0,9}, /* U */ + {2,1,1,0,9}, /* V */ + }, + }, + [PIX_FMT_YUV420P10BE] = { + .name = "yuv420p10be", + .nb_components= 3, + .log2_chroma_w= 1, + .log2_chroma_h= 1, + .comp = { + {0,1,1,0,9}, /* Y */ + {1,1,1,0,9}, /* U */ + {2,1,1,0,9}, /* V */ + }, + .flags = PIX_FMT_BE, + }, [PIX_FMT_YUV420P16LE] = { .name = "yuv420p16le", .nb_components= 3, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index dcdf4af4fb..fafbf9be1a 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -135,6 +135,10 @@ enum PixelFormat { PIX_FMT_Y400A, ///< 8bit gray, 8bit alpha PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian + PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian 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 }; @@ -159,6 +163,8 @@ enum PixelFormat { #define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE) #define PIX_FMT_BGR444 PIX_FMT_NE(BGR444BE, BGR444LE) +#define PIX_FMT_YUV420P9 PIX_FMT_NE(YUV420P9BE , YUV420P9LE) +#define PIX_FMT_YUV420P10 PIX_FMT_NE(YUV420P10BE, YUV420P10LE) #define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420P16BE, YUV420P16LE) #define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE) #define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE) |