diff options
author | Oskar Arvidsson <oskar@irock.se> | 2011-03-29 17:48:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-10 22:33:41 +0200 |
commit | d4497f6dfb8dddf25b7be441f16d387aa18a65d6 (patch) | |
tree | a688c802bf50f533e5c66798c2aecc247c0e3a20 /libavutil | |
parent | af0b2d6736a99203fed3014a3e83f8226dade2af (diff) | |
download | ffmpeg-d4497f6dfb8dddf25b7be441f16d387aa18a65d6.tar.gz |
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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/pixdesc.c | 46 | ||||
-rw-r--r-- | libavutil/pixfmt.h | 9 |
2 files changed, 55 insertions, 0 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 82dda06b4b..ad2f5643a5 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 69c6274489..9bf8a0af39 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -135,6 +135,13 @@ enum PixelFormat { PIX_FMT_Y400A, ///< 8bit gray, 8bit alpha 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_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 + + //the following 4 formats are deprecated and should be replaced by PIX_FMT_YUV420P16* with the bpp stored seperately + PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (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_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-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 +166,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) |