diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
commit | efbc9d9043ff8ff92716ddd00a5f61412d535593 (patch) | |
tree | 8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c | |
parent | df6b139a6d9027156f614b68687e039e3a5854db (diff) |
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c')
-rw-r--r-- | src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c | 771 |
1 files changed, 375 insertions, 396 deletions
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c index c38801ef3..6584fae99 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c @@ -50,8 +50,7 @@ #define FF_PIXEL_PACKED 1 /**< only one components containing all the channels */
#define FF_PIXEL_PALETTE 2 /**< one components containing indexes for a palette */
-typedef struct PixFmtInfo
-{
+typedef struct PixFmtInfo {
const char *name;
uint8_t nb_channels; /**< number of channels (including alpha) */
uint8_t color_type; /**< color type (see FF_COLOR_xxx constants) */
@@ -65,8 +64,7 @@ typedef struct PixFmtInfo /* this table gives more information about formats */
#if __STDC_VERSION__ >= 199901L
-static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] =
-{
+static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
/* YUV formats */
[PIX_FMT_YUV420P] = {
.name = "yuv420p",
@@ -400,322 +398,322 @@ static PixFmtInfo pix_fmt_info[PIX_FMT_NB]; void avpicture_init_pixfmtinfo(void)
{
- pix_fmt_info[PIX_FMT_YUV420P].name = "yuv420p";
- pix_fmt_info[PIX_FMT_YUV420P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUV420P].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_YUV420P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUV420P].depth = 8;
- pix_fmt_info[PIX_FMT_YUV420P].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_YUV420P].y_chroma_shift = 1;
-
- pix_fmt_info[PIX_FMT_YUV422P].name = "yuv422p";
- pix_fmt_info[PIX_FMT_YUV422P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUV422P].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_YUV422P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUV422P].depth = 8,
- pix_fmt_info[PIX_FMT_YUV422P].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_YUV422P].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_YUV444P].name = "yuv444p";
- pix_fmt_info[PIX_FMT_YUV444P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUV444P].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_YUV444P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUV444P].depth = 8;
- pix_fmt_info[PIX_FMT_YUV444P].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_YUV444P].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_YUYV422].name = "yuyv422";
- pix_fmt_info[PIX_FMT_YUYV422].nb_channels = 1;
- pix_fmt_info[PIX_FMT_YUYV422].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_YUYV422].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_YUYV422].depth = 8;
- pix_fmt_info[PIX_FMT_YUYV422].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_YUYV422].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_UYVY422].name = "uyvy422";
- pix_fmt_info[PIX_FMT_UYVY422].nb_channels = 1;
- pix_fmt_info[PIX_FMT_UYVY422].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_UYVY422].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_UYVY422].depth = 8;
- pix_fmt_info[PIX_FMT_UYVY422].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_UYVY422].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_YUV410P].name = "yuv410p";
- pix_fmt_info[PIX_FMT_YUV410P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUV410P].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_YUV410P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUV410P].depth = 8;
- pix_fmt_info[PIX_FMT_YUV410P].x_chroma_shift = 2;
- pix_fmt_info[PIX_FMT_YUV410P].y_chroma_shift = 2;
-
- pix_fmt_info[PIX_FMT_YUV411P].name = "yuv411p";
- pix_fmt_info[PIX_FMT_YUV411P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUV411P].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_YUV411P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUV411P].depth = 8;
- pix_fmt_info[PIX_FMT_YUV411P].x_chroma_shift = 2;
- pix_fmt_info[PIX_FMT_YUV411P].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_YUV440P].name = "yuv440p";
- pix_fmt_info[PIX_FMT_YUV440P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUV440P].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_YUV440P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUV440P].depth = 8;
- pix_fmt_info[PIX_FMT_YUV440P].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_YUV440P].y_chroma_shift = 1;
-
- pix_fmt_info[PIX_FMT_YUVA420P].name = "yuva420p";
- pix_fmt_info[PIX_FMT_YUVA420P].nb_channels = 4;
- pix_fmt_info[PIX_FMT_YUVA420P].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_YUVA420P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUVA420P].depth = 8;
- pix_fmt_info[PIX_FMT_YUVA420P].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_YUVA420P].y_chroma_shift = 1;
-
- /* JPEG YUV */
- pix_fmt_info[PIX_FMT_YUVJ420P].name = "yuvj420p";
- pix_fmt_info[PIX_FMT_YUVJ420P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUVJ420P].color_type = FF_COLOR_YUV_JPEG;
- pix_fmt_info[PIX_FMT_YUVJ420P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUVJ420P].depth = 8;
- pix_fmt_info[PIX_FMT_YUVJ420P].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_YUVJ420P].y_chroma_shift = 1;
-
- pix_fmt_info[PIX_FMT_YUVJ422P].name = "yuvj422p";
- pix_fmt_info[PIX_FMT_YUVJ422P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUVJ422P].color_type = FF_COLOR_YUV_JPEG;
- pix_fmt_info[PIX_FMT_YUVJ422P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUVJ422P].depth = 8;
- pix_fmt_info[PIX_FMT_YUVJ422P].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_YUVJ422P].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_YUVJ444P].name = "yuvj444p";
- pix_fmt_info[PIX_FMT_YUVJ444P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUVJ444P].color_type = FF_COLOR_YUV_JPEG;
- pix_fmt_info[PIX_FMT_YUVJ444P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUVJ444P].depth = 8;
- pix_fmt_info[PIX_FMT_YUVJ444P].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_YUVJ444P].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_YUVJ440P].name = "yuvj440p";
- pix_fmt_info[PIX_FMT_YUVJ440P].nb_channels = 3;
- pix_fmt_info[PIX_FMT_YUVJ440P].color_type = FF_COLOR_YUV_JPEG;
- pix_fmt_info[PIX_FMT_YUVJ440P].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_YUVJ440P].depth = 8;
- pix_fmt_info[PIX_FMT_YUVJ440P].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_YUVJ440P].y_chroma_shift = 1;
-
- /* RGB formats */
- pix_fmt_info[PIX_FMT_RGB24].name = "rgb24";
- pix_fmt_info[PIX_FMT_RGB24].nb_channels = 3;
- pix_fmt_info[PIX_FMT_RGB24].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB24].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB24].depth = 8;
- pix_fmt_info[PIX_FMT_RGB24].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB24].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_BGR24].name = "bgr24";
- pix_fmt_info[PIX_FMT_BGR24].nb_channels = 3;
- pix_fmt_info[PIX_FMT_BGR24].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_BGR24].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_BGR24].depth = 8;
- pix_fmt_info[PIX_FMT_BGR24].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_BGR24].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB32].name = "rgb32";
- pix_fmt_info[PIX_FMT_RGB32].nb_channels = 4;
- pix_fmt_info[PIX_FMT_RGB32].is_alpha = 1;
- pix_fmt_info[PIX_FMT_RGB32].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB32].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB32].depth = 8;
- pix_fmt_info[PIX_FMT_RGB32].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB32].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB48BE].name = "rgb48be";
- pix_fmt_info[PIX_FMT_RGB48BE].nb_channels = 3;
- pix_fmt_info[PIX_FMT_RGB48BE].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB48BE].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB48BE].depth = 16;
- pix_fmt_info[PIX_FMT_RGB48BE].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB48BE].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB48LE].name = "rgb48le";
- pix_fmt_info[PIX_FMT_RGB48LE].nb_channels = 3;
- pix_fmt_info[PIX_FMT_RGB48LE].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB48LE].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB48LE].depth = 16;
- pix_fmt_info[PIX_FMT_RGB48LE].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB48LE].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB565].name = "rgb565";
- pix_fmt_info[PIX_FMT_RGB565].nb_channels = 3;
- pix_fmt_info[PIX_FMT_RGB565].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB565].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB565].depth = 5;
- pix_fmt_info[PIX_FMT_RGB565].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB565].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB555].name = "rgb555";
- pix_fmt_info[PIX_FMT_RGB555].nb_channels = 3;
- pix_fmt_info[PIX_FMT_RGB555].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB555].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB555].depth = 5;
- pix_fmt_info[PIX_FMT_RGB555].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB555].y_chroma_shift = 0;
-
- /* gray / mono formats */
- pix_fmt_info[PIX_FMT_GRAY16BE].name = "gray16be";
- pix_fmt_info[PIX_FMT_GRAY16BE].nb_channels = 1;
- pix_fmt_info[PIX_FMT_GRAY16BE].color_type = FF_COLOR_GRAY;
- pix_fmt_info[PIX_FMT_GRAY16BE].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_GRAY16BE].depth = 16;
-
- pix_fmt_info[PIX_FMT_GRAY16LE].name = "gray16le";
- pix_fmt_info[PIX_FMT_GRAY16LE].nb_channels = 1;
- pix_fmt_info[PIX_FMT_GRAY16LE].color_type = FF_COLOR_GRAY;
- pix_fmt_info[PIX_FMT_GRAY16LE].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_GRAY16LE].depth = 16;
-
- pix_fmt_info[PIX_FMT_GRAY8].name = "gray";
- pix_fmt_info[PIX_FMT_GRAY8].nb_channels = 1;
- pix_fmt_info[PIX_FMT_GRAY8].color_type = FF_COLOR_GRAY;
- pix_fmt_info[PIX_FMT_GRAY8].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_GRAY8].depth = 8;
-
- pix_fmt_info[PIX_FMT_MONOWHITE].name = "monow";
- pix_fmt_info[PIX_FMT_MONOWHITE].nb_channels = 1;
- pix_fmt_info[PIX_FMT_MONOWHITE].color_type = FF_COLOR_GRAY;
- pix_fmt_info[PIX_FMT_MONOWHITE].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_MONOWHITE].depth = 1;
-
- pix_fmt_info[PIX_FMT_MONOBLACK].name = "monob";
- pix_fmt_info[PIX_FMT_MONOBLACK].nb_channels = 1;
- pix_fmt_info[PIX_FMT_MONOBLACK].color_type = FF_COLOR_GRAY;
- pix_fmt_info[PIX_FMT_MONOBLACK].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_MONOBLACK].depth = 1;
-
- /* paletted formats */
- pix_fmt_info[PIX_FMT_PAL8].name = "pal8";
- pix_fmt_info[PIX_FMT_PAL8].nb_channels = 4;
- pix_fmt_info[PIX_FMT_PAL8].is_alpha = 1;
- pix_fmt_info[PIX_FMT_PAL8].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_PAL8].pixel_type = FF_PIXEL_PALETTE;
- pix_fmt_info[PIX_FMT_PAL8].depth = 8;
-
- pix_fmt_info[PIX_FMT_UYYVYY411].name = "uyyvyy411";
- pix_fmt_info[PIX_FMT_UYYVYY411].nb_channels = 1;
- pix_fmt_info[PIX_FMT_UYYVYY411].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_UYYVYY411].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_UYYVYY411].depth = 8;
- pix_fmt_info[PIX_FMT_UYYVYY411].x_chroma_shift = 2;
- pix_fmt_info[PIX_FMT_UYYVYY411].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_BGR32].name = "bgr32";
- pix_fmt_info[PIX_FMT_BGR32].nb_channels = 4;
- pix_fmt_info[PIX_FMT_BGR32].is_alpha = 1;
- pix_fmt_info[PIX_FMT_BGR32].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_BGR32].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_BGR32].depth = 8;
- pix_fmt_info[PIX_FMT_BGR32].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_BGR32].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_BGR565].name = "bgr565";
- pix_fmt_info[PIX_FMT_BGR565].nb_channels = 3;
- pix_fmt_info[PIX_FMT_BGR565].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_BGR565].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_BGR565].depth = 5;
- pix_fmt_info[PIX_FMT_BGR565].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_BGR565].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_BGR555].name = "bgr555";
- pix_fmt_info[PIX_FMT_BGR555].nb_channels = 3;
- pix_fmt_info[PIX_FMT_BGR555].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_BGR555].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_BGR555].depth = 5;
- pix_fmt_info[PIX_FMT_BGR555].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_BGR555].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB8].name = "rgb8";
- pix_fmt_info[PIX_FMT_RGB8].nb_channels = 1;
- pix_fmt_info[PIX_FMT_RGB8].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB8].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB8].depth = 8;
- pix_fmt_info[PIX_FMT_RGB8].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB8].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB4].name = "rgb4";
- pix_fmt_info[PIX_FMT_RGB4].nb_channels = 1;
- pix_fmt_info[PIX_FMT_RGB4].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB4].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB4].depth = 4;
- pix_fmt_info[PIX_FMT_RGB4].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB4].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB4_BYTE].name = "rgb4_byte";
- pix_fmt_info[PIX_FMT_RGB4_BYTE].nb_channels = 1;
- pix_fmt_info[PIX_FMT_RGB4_BYTE].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB4_BYTE].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB4_BYTE].depth = 8;
- pix_fmt_info[PIX_FMT_RGB4_BYTE].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB4_BYTE].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_BGR8].name = "bgr8";
- pix_fmt_info[PIX_FMT_BGR8].nb_channels = 1;
- pix_fmt_info[PIX_FMT_BGR8].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_BGR8].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_BGR8].depth = 8;
- pix_fmt_info[PIX_FMT_BGR8].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_BGR8].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_BGR4].name = "bgr4";
- pix_fmt_info[PIX_FMT_BGR4].nb_channels = 1;
- pix_fmt_info[PIX_FMT_BGR4].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_BGR4].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_BGR4].depth = 4;
- pix_fmt_info[PIX_FMT_BGR4].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_BGR4].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_BGR4_BYTE].name = "bgr4_byte";
- pix_fmt_info[PIX_FMT_BGR4_BYTE].nb_channels = 1;
- pix_fmt_info[PIX_FMT_BGR4_BYTE].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_BGR4_BYTE].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_BGR4_BYTE].depth = 8;
- pix_fmt_info[PIX_FMT_BGR4_BYTE].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_BGR4_BYTE].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_NV12].name = "nv12";
- pix_fmt_info[PIX_FMT_NV12].nb_channels = 2;
- pix_fmt_info[PIX_FMT_NV12].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_NV12].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_NV12].depth = 8;
- pix_fmt_info[PIX_FMT_NV12].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_NV12].y_chroma_shift = 1;
-
- pix_fmt_info[PIX_FMT_NV21].name = "nv12";
- pix_fmt_info[PIX_FMT_NV21].nb_channels = 2;
- pix_fmt_info[PIX_FMT_NV21].color_type = FF_COLOR_YUV;
- pix_fmt_info[PIX_FMT_NV21].pixel_type = FF_PIXEL_PLANAR;
- pix_fmt_info[PIX_FMT_NV21].depth = 8;
- pix_fmt_info[PIX_FMT_NV21].x_chroma_shift = 1;
- pix_fmt_info[PIX_FMT_NV21].y_chroma_shift = 1;
-
- pix_fmt_info[PIX_FMT_BGR32_1].name = "bgr32_1";
- pix_fmt_info[PIX_FMT_BGR32_1].nb_channels = 4;
- pix_fmt_info[PIX_FMT_BGR32_1].is_alpha = 1;
- pix_fmt_info[PIX_FMT_BGR32_1].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_BGR32_1].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_BGR32_1].depth = 8;
- pix_fmt_info[PIX_FMT_BGR32_1].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_BGR32_1].y_chroma_shift = 0;
-
- pix_fmt_info[PIX_FMT_RGB32_1].name = "rgb32_1";
- pix_fmt_info[PIX_FMT_RGB32_1].nb_channels = 4;
- pix_fmt_info[PIX_FMT_RGB32_1].is_alpha = 1;
- pix_fmt_info[PIX_FMT_RGB32_1].color_type = FF_COLOR_RGB;
- pix_fmt_info[PIX_FMT_RGB32_1].pixel_type = FF_PIXEL_PACKED;
- pix_fmt_info[PIX_FMT_RGB32_1].depth = 8;
- pix_fmt_info[PIX_FMT_RGB32_1].x_chroma_shift = 0;
- pix_fmt_info[PIX_FMT_RGB32_1].y_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_YUV420P].name = "yuv420p";
+ pix_fmt_info[PIX_FMT_YUV420P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUV420P].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_YUV420P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUV420P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUV420P].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_YUV420P].y_chroma_shift = 1;
+
+ pix_fmt_info[PIX_FMT_YUV422P].name = "yuv422p";
+ pix_fmt_info[PIX_FMT_YUV422P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUV422P].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_YUV422P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUV422P].depth = 8,
+ pix_fmt_info[PIX_FMT_YUV422P].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_YUV422P].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_YUV444P].name = "yuv444p";
+ pix_fmt_info[PIX_FMT_YUV444P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUV444P].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_YUV444P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUV444P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUV444P].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_YUV444P].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_YUYV422].name = "yuyv422";
+ pix_fmt_info[PIX_FMT_YUYV422].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_YUYV422].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_YUYV422].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_YUYV422].depth = 8;
+ pix_fmt_info[PIX_FMT_YUYV422].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_YUYV422].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_UYVY422].name = "uyvy422";
+ pix_fmt_info[PIX_FMT_UYVY422].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_UYVY422].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_UYVY422].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_UYVY422].depth = 8;
+ pix_fmt_info[PIX_FMT_UYVY422].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_UYVY422].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_YUV410P].name = "yuv410p";
+ pix_fmt_info[PIX_FMT_YUV410P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUV410P].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_YUV410P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUV410P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUV410P].x_chroma_shift = 2;
+ pix_fmt_info[PIX_FMT_YUV410P].y_chroma_shift = 2;
+
+ pix_fmt_info[PIX_FMT_YUV411P].name = "yuv411p";
+ pix_fmt_info[PIX_FMT_YUV411P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUV411P].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_YUV411P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUV411P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUV411P].x_chroma_shift = 2;
+ pix_fmt_info[PIX_FMT_YUV411P].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_YUV440P].name = "yuv440p";
+ pix_fmt_info[PIX_FMT_YUV440P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUV440P].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_YUV440P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUV440P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUV440P].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_YUV440P].y_chroma_shift = 1;
+
+ pix_fmt_info[PIX_FMT_YUVA420P].name = "yuva420p";
+ pix_fmt_info[PIX_FMT_YUVA420P].nb_channels = 4;
+ pix_fmt_info[PIX_FMT_YUVA420P].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_YUVA420P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUVA420P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUVA420P].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_YUVA420P].y_chroma_shift = 1;
+
+ /* JPEG YUV */
+ pix_fmt_info[PIX_FMT_YUVJ420P].name = "yuvj420p";
+ pix_fmt_info[PIX_FMT_YUVJ420P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUVJ420P].color_type = FF_COLOR_YUV_JPEG;
+ pix_fmt_info[PIX_FMT_YUVJ420P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUVJ420P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUVJ420P].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_YUVJ420P].y_chroma_shift = 1;
+
+ pix_fmt_info[PIX_FMT_YUVJ422P].name = "yuvj422p";
+ pix_fmt_info[PIX_FMT_YUVJ422P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUVJ422P].color_type = FF_COLOR_YUV_JPEG;
+ pix_fmt_info[PIX_FMT_YUVJ422P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUVJ422P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUVJ422P].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_YUVJ422P].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_YUVJ444P].name = "yuvj444p";
+ pix_fmt_info[PIX_FMT_YUVJ444P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUVJ444P].color_type = FF_COLOR_YUV_JPEG;
+ pix_fmt_info[PIX_FMT_YUVJ444P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUVJ444P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUVJ444P].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_YUVJ444P].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_YUVJ440P].name = "yuvj440p";
+ pix_fmt_info[PIX_FMT_YUVJ440P].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_YUVJ440P].color_type = FF_COLOR_YUV_JPEG;
+ pix_fmt_info[PIX_FMT_YUVJ440P].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_YUVJ440P].depth = 8;
+ pix_fmt_info[PIX_FMT_YUVJ440P].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_YUVJ440P].y_chroma_shift = 1;
+
+ /* RGB formats */
+ pix_fmt_info[PIX_FMT_RGB24].name = "rgb24";
+ pix_fmt_info[PIX_FMT_RGB24].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_RGB24].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB24].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB24].depth = 8;
+ pix_fmt_info[PIX_FMT_RGB24].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB24].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_BGR24].name = "bgr24";
+ pix_fmt_info[PIX_FMT_BGR24].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_BGR24].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_BGR24].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_BGR24].depth = 8;
+ pix_fmt_info[PIX_FMT_BGR24].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_BGR24].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB32].name = "rgb32";
+ pix_fmt_info[PIX_FMT_RGB32].nb_channels = 4;
+ pix_fmt_info[PIX_FMT_RGB32].is_alpha = 1;
+ pix_fmt_info[PIX_FMT_RGB32].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB32].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB32].depth = 8;
+ pix_fmt_info[PIX_FMT_RGB32].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB32].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB48BE].name = "rgb48be";
+ pix_fmt_info[PIX_FMT_RGB48BE].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_RGB48BE].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB48BE].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB48BE].depth = 16;
+ pix_fmt_info[PIX_FMT_RGB48BE].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB48BE].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB48LE].name = "rgb48le";
+ pix_fmt_info[PIX_FMT_RGB48LE].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_RGB48LE].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB48LE].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB48LE].depth = 16;
+ pix_fmt_info[PIX_FMT_RGB48LE].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB48LE].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB565].name = "rgb565";
+ pix_fmt_info[PIX_FMT_RGB565].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_RGB565].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB565].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB565].depth = 5;
+ pix_fmt_info[PIX_FMT_RGB565].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB565].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB555].name = "rgb555";
+ pix_fmt_info[PIX_FMT_RGB555].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_RGB555].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB555].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB555].depth = 5;
+ pix_fmt_info[PIX_FMT_RGB555].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB555].y_chroma_shift = 0;
+
+ /* gray / mono formats */
+ pix_fmt_info[PIX_FMT_GRAY16BE].name = "gray16be";
+ pix_fmt_info[PIX_FMT_GRAY16BE].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_GRAY16BE].color_type = FF_COLOR_GRAY;
+ pix_fmt_info[PIX_FMT_GRAY16BE].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_GRAY16BE].depth = 16;
+
+ pix_fmt_info[PIX_FMT_GRAY16LE].name = "gray16le";
+ pix_fmt_info[PIX_FMT_GRAY16LE].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_GRAY16LE].color_type = FF_COLOR_GRAY;
+ pix_fmt_info[PIX_FMT_GRAY16LE].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_GRAY16LE].depth = 16;
+
+ pix_fmt_info[PIX_FMT_GRAY8].name = "gray";
+ pix_fmt_info[PIX_FMT_GRAY8].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_GRAY8].color_type = FF_COLOR_GRAY;
+ pix_fmt_info[PIX_FMT_GRAY8].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_GRAY8].depth = 8;
+
+ pix_fmt_info[PIX_FMT_MONOWHITE].name = "monow";
+ pix_fmt_info[PIX_FMT_MONOWHITE].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_MONOWHITE].color_type = FF_COLOR_GRAY;
+ pix_fmt_info[PIX_FMT_MONOWHITE].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_MONOWHITE].depth = 1;
+
+ pix_fmt_info[PIX_FMT_MONOBLACK].name = "monob";
+ pix_fmt_info[PIX_FMT_MONOBLACK].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_MONOBLACK].color_type = FF_COLOR_GRAY;
+ pix_fmt_info[PIX_FMT_MONOBLACK].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_MONOBLACK].depth = 1;
+
+ /* paletted formats */
+ pix_fmt_info[PIX_FMT_PAL8].name = "pal8";
+ pix_fmt_info[PIX_FMT_PAL8].nb_channels = 4;
+ pix_fmt_info[PIX_FMT_PAL8].is_alpha = 1;
+ pix_fmt_info[PIX_FMT_PAL8].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_PAL8].pixel_type = FF_PIXEL_PALETTE;
+ pix_fmt_info[PIX_FMT_PAL8].depth = 8;
+
+ pix_fmt_info[PIX_FMT_UYYVYY411].name = "uyyvyy411";
+ pix_fmt_info[PIX_FMT_UYYVYY411].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_UYYVYY411].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_UYYVYY411].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_UYYVYY411].depth = 8;
+ pix_fmt_info[PIX_FMT_UYYVYY411].x_chroma_shift = 2;
+ pix_fmt_info[PIX_FMT_UYYVYY411].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_BGR32].name = "bgr32";
+ pix_fmt_info[PIX_FMT_BGR32].nb_channels = 4;
+ pix_fmt_info[PIX_FMT_BGR32].is_alpha = 1;
+ pix_fmt_info[PIX_FMT_BGR32].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_BGR32].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_BGR32].depth = 8;
+ pix_fmt_info[PIX_FMT_BGR32].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_BGR32].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_BGR565].name = "bgr565";
+ pix_fmt_info[PIX_FMT_BGR565].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_BGR565].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_BGR565].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_BGR565].depth = 5;
+ pix_fmt_info[PIX_FMT_BGR565].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_BGR565].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_BGR555].name = "bgr555";
+ pix_fmt_info[PIX_FMT_BGR555].nb_channels = 3;
+ pix_fmt_info[PIX_FMT_BGR555].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_BGR555].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_BGR555].depth = 5;
+ pix_fmt_info[PIX_FMT_BGR555].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_BGR555].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB8].name = "rgb8";
+ pix_fmt_info[PIX_FMT_RGB8].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_RGB8].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB8].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB8].depth = 8;
+ pix_fmt_info[PIX_FMT_RGB8].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB8].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB4].name = "rgb4";
+ pix_fmt_info[PIX_FMT_RGB4].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_RGB4].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB4].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB4].depth = 4;
+ pix_fmt_info[PIX_FMT_RGB4].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB4].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB4_BYTE].name = "rgb4_byte";
+ pix_fmt_info[PIX_FMT_RGB4_BYTE].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_RGB4_BYTE].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB4_BYTE].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB4_BYTE].depth = 8;
+ pix_fmt_info[PIX_FMT_RGB4_BYTE].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB4_BYTE].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_BGR8].name = "bgr8";
+ pix_fmt_info[PIX_FMT_BGR8].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_BGR8].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_BGR8].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_BGR8].depth = 8;
+ pix_fmt_info[PIX_FMT_BGR8].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_BGR8].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_BGR4].name = "bgr4";
+ pix_fmt_info[PIX_FMT_BGR4].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_BGR4].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_BGR4].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_BGR4].depth = 4;
+ pix_fmt_info[PIX_FMT_BGR4].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_BGR4].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_BGR4_BYTE].name = "bgr4_byte";
+ pix_fmt_info[PIX_FMT_BGR4_BYTE].nb_channels = 1;
+ pix_fmt_info[PIX_FMT_BGR4_BYTE].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_BGR4_BYTE].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_BGR4_BYTE].depth = 8;
+ pix_fmt_info[PIX_FMT_BGR4_BYTE].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_BGR4_BYTE].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_NV12].name = "nv12";
+ pix_fmt_info[PIX_FMT_NV12].nb_channels = 2;
+ pix_fmt_info[PIX_FMT_NV12].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_NV12].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_NV12].depth = 8;
+ pix_fmt_info[PIX_FMT_NV12].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_NV12].y_chroma_shift = 1;
+
+ pix_fmt_info[PIX_FMT_NV21].name = "nv12";
+ pix_fmt_info[PIX_FMT_NV21].nb_channels = 2;
+ pix_fmt_info[PIX_FMT_NV21].color_type = FF_COLOR_YUV;
+ pix_fmt_info[PIX_FMT_NV21].pixel_type = FF_PIXEL_PLANAR;
+ pix_fmt_info[PIX_FMT_NV21].depth = 8;
+ pix_fmt_info[PIX_FMT_NV21].x_chroma_shift = 1;
+ pix_fmt_info[PIX_FMT_NV21].y_chroma_shift = 1;
+
+ pix_fmt_info[PIX_FMT_BGR32_1].name = "bgr32_1";
+ pix_fmt_info[PIX_FMT_BGR32_1].nb_channels = 4;
+ pix_fmt_info[PIX_FMT_BGR32_1].is_alpha = 1;
+ pix_fmt_info[PIX_FMT_BGR32_1].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_BGR32_1].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_BGR32_1].depth = 8;
+ pix_fmt_info[PIX_FMT_BGR32_1].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_BGR32_1].y_chroma_shift = 0;
+
+ pix_fmt_info[PIX_FMT_RGB32_1].name = "rgb32_1";
+ pix_fmt_info[PIX_FMT_RGB32_1].nb_channels = 4;
+ pix_fmt_info[PIX_FMT_RGB32_1].is_alpha = 1;
+ pix_fmt_info[PIX_FMT_RGB32_1].color_type = FF_COLOR_RGB;
+ pix_fmt_info[PIX_FMT_RGB32_1].pixel_type = FF_PIXEL_PACKED;
+ pix_fmt_info[PIX_FMT_RGB32_1].depth = 8;
+ pix_fmt_info[PIX_FMT_RGB32_1].x_chroma_shift = 0;
+ pix_fmt_info[PIX_FMT_RGB32_1].y_chroma_shift = 0;
}
#endif
@@ -725,43 +723,40 @@ void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift) *v_shift = pix_fmt_info[pix_fmt].y_chroma_shift;
}
-int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt)
-{
+int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt){
int i;
- for(i = 0; i < 256; i++)
- {
- int r, g, b;
+ for(i=0; i<256; i++){
+ int r,g,b;
- switch(pix_fmt)
- {
+ switch(pix_fmt) {
case PIX_FMT_RGB8:
- r = (i >> 5) * 36;
- g = ((i >> 2) & 7) * 36;
- b = (i & 3) * 85;
+ r= (i>>5 )*36;
+ g= ((i>>2)&7)*36;
+ b= (i&3 )*85;
break;
case PIX_FMT_BGR8:
- b = (i >> 6) * 85;
- g = ((i >> 3) & 7) * 36;
- r = (i & 7) * 36;
+ b= (i>>6 )*85;
+ g= ((i>>3)&7)*36;
+ r= (i&7 )*36;
break;
case PIX_FMT_RGB4_BYTE:
- r = (i >> 3) * 255;
- g = ((i >> 1) & 3) * 85;
- b = (i & 1) * 255;
+ r= (i>>3 )*255;
+ g= ((i>>1)&3)*85;
+ b= (i&1 )*255;
break;
case PIX_FMT_BGR4_BYTE:
- b = (i >> 3) * 255;
- g = ((i >> 1) & 3) * 85;
- r = (i & 1) * 255;
+ b= (i>>3 )*255;
+ g= ((i>>1)&3)*85;
+ r= (i&1 )*255;
break;
case PIX_FMT_GRAY8:
- r = b = g = i;
+ r=b=g= i;
break;
default:
return -1;
}
- pal[i] = b + (g << 8) + (r << 16);
+ pal[i] = b + (g<<8) + (r<<16);
}
return 0;
@@ -775,8 +770,7 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width) memset(picture->linesize, 0, sizeof(picture->linesize));
pinfo = &pix_fmt_info[pix_fmt];
- switch(pix_fmt)
- {
+ switch(pix_fmt) {
case PIX_FMT_YUV420P:
case PIX_FMT_YUV422P:
case PIX_FMT_YUV444P:
@@ -832,7 +826,7 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width) picture->linesize[0] = width * 2;
break;
case PIX_FMT_UYYVYY411:
- picture->linesize[0] = width + width / 2;
+ picture->linesize[0] = width + width/2;
break;
case PIX_FMT_RGB4:
case PIX_FMT_BGR4:
@@ -864,8 +858,7 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, pinfo = &pix_fmt_info[pix_fmt];
size = picture->linesize[0] * height;
- switch(pix_fmt)
- {
+ switch(pix_fmt) {
case PIX_FMT_YUV420P:
case PIX_FMT_YUV422P:
case PIX_FMT_YUV444P:
@@ -948,13 +941,12 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, }
void ff_img_copy_plane(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
+ const uint8_t *src, int src_wrap,
+ int width, int height)
{
if((!dst) || (!src))
return;
- for(; height > 0; height--)
- {
+ for(;height > 0; height--) {
memcpy(dst, src, width);
dst += dst_wrap;
src += src_wrap;
@@ -967,11 +959,9 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane) const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
pf = &pix_fmt_info[pix_fmt];
- switch(pf->pixel_type)
- {
+ switch(pf->pixel_type) {
case FF_PIXEL_PACKED:
- switch(pix_fmt)
- {
+ switch(pix_fmt) {
case PIX_FMT_YUYV422:
case PIX_FMT_UYVY422:
case PIX_FMT_RGB565:
@@ -990,13 +980,13 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane) return (width * bits + 7) >> 3;
break;
case FF_PIXEL_PLANAR:
- if(plane == 1 || plane == 2)
- width = -((-width) >> pf->x_chroma_shift);
+ if (plane == 1 || plane == 2)
+ width= -((-width)>>pf->x_chroma_shift);
- return (width * pf->depth + 7) >> 3;
+ return (width * pf->depth + 7) >> 3;
break;
case FF_PIXEL_PALETTE:
- if(plane == 0)
+ if (plane == 0)
return width;
break;
}
@@ -1010,50 +1000,45 @@ void av_picture_copy(AVPicture *dst, const AVPicture *src, int i;
const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
- switch(pf->pixel_type)
- {
+ switch(pf->pixel_type) {
case FF_PIXEL_PACKED:
case FF_PIXEL_PLANAR:
- for(i = 0; i < pf->nb_channels; i++)
- {
+ for(i = 0; i < pf->nb_channels; i++) {
int h;
int bwidth = ff_get_plane_bytewidth(pix_fmt, width, i);
h = height;
- if(i == 1 || i == 2)
- {
- h = -((-height) >> pf->y_chroma_shift);
+ if (i == 1 || i == 2) {
+ h= -((-height)>>pf->y_chroma_shift);
}
ff_img_copy_plane(dst->data[i], dst->linesize[i],
- src->data[i], src->linesize[i],
- bwidth, h);
+ src->data[i], src->linesize[i],
+ bwidth, h);
}
break;
case FF_PIXEL_PALETTE:
ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- width, height);
+ src->data[0], src->linesize[0],
+ width, height);
/* copy the palette */
- memcpy(dst->data[1], src->data[1], 4 * 256);
+ memcpy(dst->data[1], src->data[1], 4*256);
break;
}
}
/* 2x2 -> 1x1 */
void ff_shrink22(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
+ const uint8_t *src, int src_wrap,
+ int width, int height)
{
int w;
const uint8_t *s1, *s2;
uint8_t *d;
- for(; height > 0; height--)
- {
+ for(;height > 0; height--) {
s1 = src;
s2 = s1 + src_wrap;
d = dst;
- for(w = width; w >= 4; w -= 4)
- {
+ for(w = width;w >= 4; w-=4) {
d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
d[1] = (s1[2] + s1[3] + s2[2] + s2[3] + 2) >> 2;
d[2] = (s1[4] + s1[5] + s2[4] + s2[5] + 2) >> 2;
@@ -1062,8 +1047,7 @@ void ff_shrink22(uint8_t *dst, int dst_wrap, s2 += 8;
d += 4;
}
- for(; w > 0; w--)
- {
+ for(;w > 0; w--) {
d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
s1 += 2;
s2 += 2;
@@ -1076,22 +1060,20 @@ void ff_shrink22(uint8_t *dst, int dst_wrap, /* 4x4 -> 1x1 */
void ff_shrink44(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
+ const uint8_t *src, int src_wrap,
+ int width, int height)
{
int w;
const uint8_t *s1, *s2, *s3, *s4;
uint8_t *d;
- for(; height > 0; height--)
- {
+ for(;height > 0; height--) {
s1 = src;
s2 = s1 + src_wrap;
s3 = s2 + src_wrap;
s4 = s3 + src_wrap;
d = dst;
- for(w = width; w > 0; w--)
- {
+ for(w = width;w > 0; w--) {
d[0] = (s1[0] + s1[1] + s1[2] + s1[3] +
s2[0] + s2[1] + s2[2] + s2[3] +
s3[0] + s3[1] + s3[2] + s3[3] +
@@ -1109,25 +1091,22 @@ void ff_shrink44(uint8_t *dst, int dst_wrap, /* 8x8 -> 1x1 */
void ff_shrink88(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
+ const uint8_t *src, int src_wrap,
+ int width, int height)
{
int w, i;
- for(; height > 0; height--)
- {
- for(w = width; w > 0; w--)
- {
- int tmp = 0;
- for(i = 0; i < 8; i++)
- {
+ for(;height > 0; height--) {
+ for(w = width;w > 0; w--) {
+ int tmp=0;
+ for(i=0; i<8; i++){
tmp += src[0] + src[1] + src[2] + src[3] + src[4] + src[5] + src[6] + src[7];
src += src_wrap;
}
- *(dst++) = (tmp + 32) >> 6;
- src += 8 - 8 * src_wrap;
+ *(dst++) = (tmp + 32)>>6;
+ src += 8 - 8*src_wrap;
}
- src += 8 * src_wrap - 8 * width;
+ src += 8*src_wrap - 8*width;
dst += dst_wrap - width;
}
}
|