Commit 6b0768e2 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Clean up swscale pixfmt macros using av_pix_fmt_descriptors[].

parent bd97b2e1
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
*/ */
#define LIBAVUTIL_VERSION_MAJOR 51 #define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 18 #define LIBAVUTIL_VERSION_MINOR 19
#define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
......
...@@ -126,6 +126,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -126,6 +126,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUYV422] = { [PIX_FMT_YUYV422] = {
.name = "yuyv422", .name = "yuyv422",
...@@ -148,6 +149,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -148,6 +149,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,2,2,0,7}, /* G */ {0,2,2,0,7}, /* G */
{0,2,3,0,7}, /* B */ {0,2,3,0,7}, /* B */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_BGR24] = { [PIX_FMT_BGR24] = {
.name = "bgr24", .name = "bgr24",
...@@ -159,6 +161,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -159,6 +161,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,2,2,0,7}, /* G */ {0,2,2,0,7}, /* G */
{0,2,3,0,7}, /* R */ {0,2,3,0,7}, /* R */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_YUV422P] = { [PIX_FMT_YUV422P] = {
.name = "yuv422p", .name = "yuv422p",
...@@ -170,6 +173,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -170,6 +173,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV444P] = { [PIX_FMT_YUV444P] = {
.name = "yuv444p", .name = "yuv444p",
...@@ -181,6 +185,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -181,6 +185,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV410P] = { [PIX_FMT_YUV410P] = {
.name = "yuv410p", .name = "yuv410p",
...@@ -192,6 +197,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -192,6 +197,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV411P] = { [PIX_FMT_YUV411P] = {
.name = "yuv411p", .name = "yuv411p",
...@@ -203,6 +209,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -203,6 +209,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_GRAY8] = { [PIX_FMT_GRAY8] = {
.name = "gray", .name = "gray",
...@@ -254,6 +261,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -254,6 +261,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUVJ422P] = { [PIX_FMT_YUVJ422P] = {
.name = "yuvj422p", .name = "yuvj422p",
...@@ -265,6 +273,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -265,6 +273,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUVJ444P] = { [PIX_FMT_YUVJ444P] = {
.name = "yuvj444p", .name = "yuvj444p",
...@@ -276,6 +285,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -276,6 +285,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_XVMC_MPEG2_MC] = { [PIX_FMT_XVMC_MPEG2_MC] = {
.name = "xvmcmc", .name = "xvmcmc",
...@@ -317,7 +327,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -317,7 +327,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,0,1,3,2}, /* G */ {0,0,1,3,2}, /* G */
{0,0,1,0,2}, /* R */ {0,0,1,0,2}, /* R */
}, },
.flags = PIX_FMT_PAL, .flags = PIX_FMT_PAL | PIX_FMT_RGB,
}, },
[PIX_FMT_BGR4] = { [PIX_FMT_BGR4] = {
.name = "bgr4", .name = "bgr4",
...@@ -329,7 +339,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -329,7 +339,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,3,2,0,1}, /* G */ {0,3,2,0,1}, /* G */
{0,3,4,0,0}, /* R */ {0,3,4,0,0}, /* R */
}, },
.flags = PIX_FMT_BITSTREAM, .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,
}, },
[PIX_FMT_BGR4_BYTE] = { [PIX_FMT_BGR4_BYTE] = {
.name = "bgr4_byte", .name = "bgr4_byte",
...@@ -341,7 +351,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -341,7 +351,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,0,1,1,1}, /* G */ {0,0,1,1,1}, /* G */
{0,0,1,0,0}, /* R */ {0,0,1,0,0}, /* R */
}, },
.flags = PIX_FMT_PAL, .flags = PIX_FMT_PAL | PIX_FMT_RGB,
}, },
[PIX_FMT_RGB8] = { [PIX_FMT_RGB8] = {
.name = "rgb8", .name = "rgb8",
...@@ -353,7 +363,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -353,7 +363,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,0,1,3,2}, /* G */ {0,0,1,3,2}, /* G */
{0,0,1,0,2}, /* B */ {0,0,1,0,2}, /* B */
}, },
.flags = PIX_FMT_PAL, .flags = PIX_FMT_PAL | PIX_FMT_RGB,
}, },
[PIX_FMT_RGB4] = { [PIX_FMT_RGB4] = {
.name = "rgb4", .name = "rgb4",
...@@ -365,7 +375,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -365,7 +375,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,3,2,0,1}, /* G */ {0,3,2,0,1}, /* G */
{0,3,4,0,0}, /* B */ {0,3,4,0,0}, /* B */
}, },
.flags = PIX_FMT_BITSTREAM, .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,
}, },
[PIX_FMT_RGB4_BYTE] = { [PIX_FMT_RGB4_BYTE] = {
.name = "rgb4_byte", .name = "rgb4_byte",
...@@ -377,7 +387,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -377,7 +387,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,0,1,1,1}, /* G */ {0,0,1,1,1}, /* G */
{0,0,1,0,0}, /* B */ {0,0,1,0,0}, /* B */
}, },
.flags = PIX_FMT_PAL, .flags = PIX_FMT_PAL | PIX_FMT_RGB,
}, },
[PIX_FMT_NV12] = { [PIX_FMT_NV12] = {
.name = "nv12", .name = "nv12",
...@@ -389,6 +399,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -389,6 +399,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,7}, /* U */ {1,1,1,0,7}, /* U */
{1,1,2,0,7}, /* V */ {1,1,2,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_NV21] = { [PIX_FMT_NV21] = {
.name = "nv21", .name = "nv21",
...@@ -400,6 +411,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -400,6 +411,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,7}, /* V */ {1,1,1,0,7}, /* V */
{1,1,2,0,7}, /* U */ {1,1,2,0,7}, /* U */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_ARGB] = { [PIX_FMT_ARGB] = {
.name = "argb", .name = "argb",
...@@ -412,6 +424,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -412,6 +424,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,3,3,0,7}, /* G */ {0,3,3,0,7}, /* G */
{0,3,4,0,7}, /* B */ {0,3,4,0,7}, /* B */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_RGBA] = { [PIX_FMT_RGBA] = {
.name = "rgba", .name = "rgba",
...@@ -424,6 +437,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -424,6 +437,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,3,3,0,7}, /* B */ {0,3,3,0,7}, /* B */
{0,3,4,0,7}, /* A */ {0,3,4,0,7}, /* A */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_ABGR] = { [PIX_FMT_ABGR] = {
.name = "abgr", .name = "abgr",
...@@ -436,6 +450,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -436,6 +450,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,3,3,0,7}, /* G */ {0,3,3,0,7}, /* G */
{0,3,4,0,7}, /* R */ {0,3,4,0,7}, /* R */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_BGRA] = { [PIX_FMT_BGRA] = {
.name = "bgra", .name = "bgra",
...@@ -448,6 +463,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -448,6 +463,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,3,3,0,7}, /* R */ {0,3,3,0,7}, /* R */
{0,3,4,0,7}, /* A */ {0,3,4,0,7}, /* A */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_GRAY16BE] = { [PIX_FMT_GRAY16BE] = {
.name = "gray16be", .name = "gray16be",
...@@ -478,6 +494,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -478,6 +494,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUVJ440P] = { [PIX_FMT_YUVJ440P] = {
.name = "yuvj440p", .name = "yuvj440p",
...@@ -489,6 +506,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -489,6 +506,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* U */ {1,0,1,0,7}, /* U */
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUVA420P] = { [PIX_FMT_YUVA420P] = {
.name = "yuva420p", .name = "yuva420p",
...@@ -501,6 +519,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -501,6 +519,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{2,0,1,0,7}, /* V */ {2,0,1,0,7}, /* V */
{3,0,1,0,7}, /* A */ {3,0,1,0,7}, /* A */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_VDPAU_H264] = { [PIX_FMT_VDPAU_H264] = {
.name = "vdpau_h264", .name = "vdpau_h264",
...@@ -560,6 +579,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -560,6 +579,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,5,3,0,15}, /* G */ {0,5,3,0,15}, /* G */
{0,5,5,0,15}, /* B */ {0,5,5,0,15}, /* B */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_RGB565BE] = { [PIX_FMT_RGB565BE] = {
.name = "rgb565be", .name = "rgb565be",
...@@ -571,7 +591,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -571,7 +591,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,5,5}, /* G */ {0,1,1,5,5}, /* G */
{0,1,1,0,4}, /* B */ {0,1,1,0,4}, /* B */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_RGB,
}, },
[PIX_FMT_RGB565LE] = { [PIX_FMT_RGB565LE] = {
.name = "rgb565le", .name = "rgb565le",
...@@ -583,6 +603,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -583,6 +603,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,5,5}, /* G */ {0,1,1,5,5}, /* G */
{0,1,1,0,4}, /* B */ {0,1,1,0,4}, /* B */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_RGB555BE] = { [PIX_FMT_RGB555BE] = {
.name = "rgb555be", .name = "rgb555be",
...@@ -594,7 +615,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -594,7 +615,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,5,4}, /* G */ {0,1,1,5,4}, /* G */
{0,1,1,0,4}, /* B */ {0,1,1,0,4}, /* B */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_RGB,
}, },
[PIX_FMT_RGB555LE] = { [PIX_FMT_RGB555LE] = {
.name = "rgb555le", .name = "rgb555le",
...@@ -606,6 +627,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -606,6 +627,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,5,4}, /* G */ {0,1,1,5,4}, /* G */
{0,1,1,0,4}, /* B */ {0,1,1,0,4}, /* B */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_RGB444BE] = { [PIX_FMT_RGB444BE] = {
.name = "rgb444be", .name = "rgb444be",
...@@ -617,7 +639,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -617,7 +639,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,4,3}, /* G */ {0,1,1,4,3}, /* G */
{0,1,1,0,3}, /* B */ {0,1,1,0,3}, /* B */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_RGB,
}, },
[PIX_FMT_RGB444LE] = { [PIX_FMT_RGB444LE] = {
.name = "rgb444le", .name = "rgb444le",
...@@ -629,6 +651,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -629,6 +651,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,4,3}, /* G */ {0,1,1,4,3}, /* G */
{0,1,1,0,3}, /* B */ {0,1,1,0,3}, /* B */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_BGR48BE] = { [PIX_FMT_BGR48BE] = {
.name = "bgr48be", .name = "bgr48be",
...@@ -640,7 +663,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -640,7 +663,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,5,3,0,15}, /* G */ {0,5,3,0,15}, /* G */
{0,5,5,0,15}, /* R */ {0,5,5,0,15}, /* R */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_RGB,
}, },
[PIX_FMT_BGR48LE] = { [PIX_FMT_BGR48LE] = {
.name = "bgr48le", .name = "bgr48le",
...@@ -652,6 +675,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -652,6 +675,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,5,3,0,15}, /* G */ {0,5,3,0,15}, /* G */
{0,5,5,0,15}, /* R */ {0,5,5,0,15}, /* R */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_BGR565BE] = { [PIX_FMT_BGR565BE] = {
.name = "bgr565be", .name = "bgr565be",
...@@ -663,7 +687,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -663,7 +687,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,5,5}, /* G */ {0,1,1,5,5}, /* G */
{0,1,1,0,4}, /* R */ {0,1,1,0,4}, /* R */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_RGB,
}, },
[PIX_FMT_BGR565LE] = { [PIX_FMT_BGR565LE] = {
.name = "bgr565le", .name = "bgr565le",
...@@ -675,6 +699,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -675,6 +699,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,5,5}, /* G */ {0,1,1,5,5}, /* G */
{0,1,1,0,4}, /* R */ {0,1,1,0,4}, /* R */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_BGR555BE] = { [PIX_FMT_BGR555BE] = {
.name = "bgr555be", .name = "bgr555be",
...@@ -686,7 +711,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -686,7 +711,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,5,4}, /* G */ {0,1,1,5,4}, /* G */
{0,1,1,0,4}, /* R */ {0,1,1,0,4}, /* R */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_RGB,
}, },
[PIX_FMT_BGR555LE] = { [PIX_FMT_BGR555LE] = {
.name = "bgr555le", .name = "bgr555le",
...@@ -698,6 +723,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -698,6 +723,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,5,4}, /* G */ {0,1,1,5,4}, /* G */
{0,1,1,0,4}, /* R */ {0,1,1,0,4}, /* R */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_BGR444BE] = { [PIX_FMT_BGR444BE] = {
.name = "bgr444be", .name = "bgr444be",
...@@ -709,7 +735,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -709,7 +735,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,4,3}, /* G */ {0,1,1,4,3}, /* G */
{0,1,1,0,3}, /* R */ {0,1,1,0,3}, /* R */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_RGB,
}, },
[PIX_FMT_BGR444LE] = { [PIX_FMT_BGR444LE] = {
.name = "bgr444le", .name = "bgr444le",
...@@ -721,6 +747,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -721,6 +747,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,4,3}, /* G */ {0,1,1,4,3}, /* G */
{0,1,1,0,3}, /* R */ {0,1,1,0,3}, /* R */
}, },
.flags = PIX_FMT_RGB,
}, },
[PIX_FMT_VAAPI_MOCO] = { [PIX_FMT_VAAPI_MOCO] = {
.name = "vaapi_moco", .name = "vaapi_moco",
...@@ -756,6 +783,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -756,6 +783,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,8}, /* U */ {1,1,1,0,8}, /* U */
{2,1,1,0,8}, /* V */ {2,1,1,0,8}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV420P9BE] = { [PIX_FMT_YUV420P9BE] = {
.name = "yuv420p9be", .name = "yuv420p9be",
...@@ -767,7 +795,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -767,7 +795,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,8}, /* U */ {1,1,1,0,8}, /* U */
{2,1,1,0,8}, /* V */ {2,1,1,0,8}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV420P10LE] = { [PIX_FMT_YUV420P10LE] = {
.name = "yuv420p10le", .name = "yuv420p10le",
...@@ -779,6 +807,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -779,6 +807,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,9}, /* U */ {1,1,1,0,9}, /* U */
{2,1,1,0,9}, /* V */ {2,1,1,0,9}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV420P10BE] = { [PIX_FMT_YUV420P10BE] = {
.name = "yuv420p10be", .name = "yuv420p10be",
...@@ -790,7 +819,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -790,7 +819,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,9}, /* U */ {1,1,1,0,9}, /* U */
{2,1,1,0,9}, /* V */ {2,1,1,0,9}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV420P16LE] = { [PIX_FMT_YUV420P16LE] = {
.name = "yuv420p16le", .name = "yuv420p16le",
...@@ -802,6 +831,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -802,6 +831,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,15}, /* U */ {1,1,1,0,15}, /* U */
{2,1,1,0,15}, /* V */ {2,1,1,0,15}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV420P16BE] = { [PIX_FMT_YUV420P16BE] = {
.name = "yuv420p16be", .name = "yuv420p16be",
...@@ -813,7 +843,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -813,7 +843,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,15}, /* U */ {1,1,1,0,15}, /* U */
{2,1,1,0,15}, /* V */ {2,1,1,0,15}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV422P9LE] = { [PIX_FMT_YUV422P9LE] = {
.name = "yuv422p9le", .name = "yuv422p9le",
...@@ -825,6 +855,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -825,6 +855,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,8}, /* U */ {1,1,1,0,8}, /* U */
{2,1,1,0,8}, /* V */ {2,1,1,0,8}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV422P9BE] = { [PIX_FMT_YUV422P9BE] = {
.name = "yuv422p9be", .name = "yuv422p9be",
...@@ -836,7 +867,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -836,7 +867,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,8}, /* U */ {1,1,1,0,8}, /* U */
{2,1,1,0,8}, /* V */ {2,1,1,0,8}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV422P10LE] = { [PIX_FMT_YUV422P10LE] = {
.name = "yuv422p10le", .name = "yuv422p10le",
...@@ -848,6 +879,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -848,6 +879,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,9}, /* U */ {1,1,1,0,9}, /* U */
{2,1,1,0,9}, /* V */ {2,1,1,0,9}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV422P10BE] = { [PIX_FMT_YUV422P10BE] = {
.name = "yuv422p10be", .name = "yuv422p10be",
...@@ -859,7 +891,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -859,7 +891,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,9}, /* U */ {1,1,1,0,9}, /* U */
{2,1,1,0,9}, /* V */ {2,1,1,0,9}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV422P16LE] = { [PIX_FMT_YUV422P16LE] = {
.name = "yuv422p16le", .name = "yuv422p16le",
...@@ -871,6 +903,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -871,6 +903,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,15}, /* U */ {1,1,1,0,15}, /* U */
{2,1,1,0,15}, /* V */ {2,1,1,0,15}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV422P16BE] = { [PIX_FMT_YUV422P16BE] = {
.name = "yuv422p16be", .name = "yuv422p16be",
...@@ -882,7 +915,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -882,7 +915,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,15}, /* U */ {1,1,1,0,15}, /* U */
{2,1,1,0,15}, /* V */ {2,1,1,0,15}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV444P16LE] = { [PIX_FMT_YUV444P16LE] = {
.name = "yuv444p16le", .name = "yuv444p16le",
...@@ -894,6 +927,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -894,6 +927,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,15}, /* U */ {1,1,1,0,15}, /* U */
{2,1,1,0,15}, /* V */ {2,1,1,0,15}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV444P16BE] = { [PIX_FMT_YUV444P16BE] = {
.name = "yuv444p16be", .name = "yuv444p16be",
...@@ -905,7 +939,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -905,7 +939,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,15}, /* U */ {1,1,1,0,15}, /* U */
{2,1,1,0,15}, /* V */ {2,1,1,0,15}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV444P10LE] = { [PIX_FMT_YUV444P10LE] = {
.name = "yuv444p10le", .name = "yuv444p10le",
...@@ -917,6 +951,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -917,6 +951,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,9}, /* U */ {1,1,1,0,9}, /* U */
{2,1,1,0,9}, /* V */ {2,1,1,0,9}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV444P10BE] = { [PIX_FMT_YUV444P10BE] = {
.name = "yuv444p10be", .name = "yuv444p10be",
...@@ -928,7 +963,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -928,7 +963,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,9}, /* U */ {1,1,1,0,9}, /* U */
{2,1,1,0,9}, /* V */ {2,1,1,0,9}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV444P9LE] = { [PIX_FMT_YUV444P9LE] = {
.name = "yuv444p9le", .name = "yuv444p9le",
...@@ -940,6 +975,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -940,6 +975,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,8}, /* U */ {1,1,1,0,8}, /* U */
{2,1,1,0,8}, /* V */ {2,1,1,0,8}, /* V */
}, },
.flags = PIX_FMT_PLANAR,
}, },
[PIX_FMT_YUV444P9BE] = { [PIX_FMT_YUV444P9BE] = {
.name = "yuv444p9be", .name = "yuv444p9be",
...@@ -951,7 +987,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -951,7 +987,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,8}, /* U */ {1,1,1,0,8}, /* U */
{2,1,1,0,8}, /* V */ {2,1,1,0,8}, /* V */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
}, },
[PIX_FMT_DXVA2_VLD] = { [PIX_FMT_DXVA2_VLD] = {
.name = "dxva2_vld", .name = "dxva2_vld",
...@@ -977,6 +1013,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -977,6 +1013,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,0,1,0,7}, /* B */ {1,0,1,0,7}, /* B */
{2,0,1,0,7}, /* R */ {2,0,1,0,7}, /* R */
}, },
.flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
}, },
[PIX_FMT_GBRP9LE] = { [PIX_FMT_GBRP9LE] = {
.name = "gbrp9le", .name = "gbrp9le",
...@@ -988,6 +1025,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -988,6 +1025,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,8}, /* B */ {1,1,1,0,8}, /* B */
{2,1,1,0,8}, /* R */ {2,1,1,0,8}, /* R */
}, },
.flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
}, },
[PIX_FMT_GBRP9BE] = { [PIX_FMT_GBRP9BE] = {
.name = "gbrp9be", .name = "gbrp9be",
...@@ -999,7 +1037,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -999,7 +1037,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,8}, /* B */ {1,1,1,0,8}, /* B */
{2,1,1,0,8}, /* R */ {2,1,1,0,8}, /* R */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
}, },
[PIX_FMT_GBRP10LE] = { [PIX_FMT_GBRP10LE] = {
.name = "gbrp10le", .name = "gbrp10le",
...@@ -1011,6 +1049,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -1011,6 +1049,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,9}, /* B */ {1,1,1,0,9}, /* B */
{2,1,1,0,9}, /* R */ {2,1,1,0,9}, /* R */
}, },
.flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
}, },
[PIX_FMT_GBRP10BE] = { [PIX_FMT_GBRP10BE] = {
.name = "gbrp10be", .name = "gbrp10be",
...@@ -1022,7 +1061,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -1022,7 +1061,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,9}, /* B */ {1,1,1,0,9}, /* B */
{2,1,1,0,9}, /* R */ {2,1,1,0,9}, /* R */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
}, },
[PIX_FMT_GBRP16LE] = { [PIX_FMT_GBRP16LE] = {
.name = "gbrp16le", .name = "gbrp16le",
...@@ -1034,6 +1073,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -1034,6 +1073,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,15}, /* B */ {1,1,1,0,15}, /* B */
{2,1,1,0,15}, /* R */ {2,1,1,0,15}, /* R */
}, },
.flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
}, },
[PIX_FMT_GBRP16BE] = { [PIX_FMT_GBRP16BE] = {
.name = "gbrp16be", .name = "gbrp16be",
...@@ -1045,7 +1085,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { ...@@ -1045,7 +1085,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{1,1,1,0,15}, /* B */ {1,1,1,0,15}, /* B */
{2,1,1,0,15}, /* R */ {2,1,1,0,15}, /* R */
}, },
.flags = PIX_FMT_BE, .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
}, },
}; };
......
...@@ -87,6 +87,8 @@ typedef struct AVPixFmtDescriptor{ ...@@ -87,6 +87,8 @@ typedef struct AVPixFmtDescriptor{
#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette. #define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end. #define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end.
#define PIX_FMT_HWACCEL 8 ///< Pixel format is an HW accelerated format. #define PIX_FMT_HWACCEL 8 ///< Pixel format is an HW accelerated format.
#define PIX_FMT_PLANAR 16 ///< At least one pixel component is not in the first data plane
#define PIX_FMT_RGB 32 ///< The pixel format contains RGB-like data (as opposed to YUV/grayscale)
/** /**
* The array of all the pixel format descriptors. * The array of all the pixel format descriptors.
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#include "libavutil/log.h" #include "libavutil/log.h"
#include "libavutil/pixfmt.h" #include "libavutil/pixfmt.h"
#include "libavutil/pixdesc.h"
#define STR(s) AV_TOSTRING(s) //AV_STRINGIFY is too long #define STR(s) AV_TOSTRING(s) //AV_STRINGIFY is too long
...@@ -520,83 +521,31 @@ void ff_bfin_get_unscaled_swscale(SwsContext *c); ...@@ -520,83 +521,31 @@ void ff_bfin_get_unscaled_swscale(SwsContext *c);
const char *sws_format_name(enum PixelFormat format); const char *sws_format_name(enum PixelFormat format);
//FIXME replace this with something faster #define is16BPS(x) \
#define is16BPS(x) ( \ (av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 15)
(x)==PIX_FMT_GRAY16BE \
|| (x)==PIX_FMT_GRAY16LE \ #define is9_OR_10BPS(x) \
|| (x)==PIX_FMT_BGR48BE \ (av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 8 || \
|| (x)==PIX_FMT_BGR48LE \ av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 9)
|| (x)==PIX_FMT_RGB48BE \
|| (x)==PIX_FMT_RGB48LE \ #define isBE(x) \
|| (x)==PIX_FMT_YUV420P16LE \ (av_pix_fmt_descriptors[x].flags & PIX_FMT_BE)
|| (x)==PIX_FMT_YUV422P16LE \
|| (x)==PIX_FMT_YUV444P16LE \ #define isYUV(x) \
|| (x)==PIX_FMT_YUV420P16BE \ (!(av_pix_fmt_descriptors[x].flags & PIX_FMT_RGB) && \
|| (x)==PIX_FMT_YUV422P16BE \ av_pix_fmt_descriptors[x].nb_components >= 2)
|| (x)==PIX_FMT_YUV444P16BE \
) #define isPlanarYUV(x) \
#define is9_OR_10BPS(x) ( \ ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR) && \
(x)==PIX_FMT_YUV420P9LE \ isYUV(x))
|| (x)==PIX_FMT_YUV420P9BE \
|| (x)==PIX_FMT_YUV422P9LE \ #define isRGB(x) \
|| (x)==PIX_FMT_YUV422P9BE \ (av_pix_fmt_descriptors[x].flags & PIX_FMT_RGB)
|| (x)==PIX_FMT_YUV444P9BE \
|| (x)==PIX_FMT_YUV444P9LE \ #define isGray(x) \
|| (x)==PIX_FMT_YUV422P10BE \ (!(av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) && \
|| (x)==PIX_FMT_YUV422P10LE \ av_pix_fmt_descriptors[x].nb_components <= 2)
|| (x)==PIX_FMT_YUV444P10BE \
|| (x)==PIX_FMT_YUV444P10LE \
|| (x)==PIX_FMT_YUV420P10LE \
|| (x)==PIX_FMT_YUV420P10BE \
)
#define isBE(x) ((x)&1)
#define isPlanar8YUV(x) ( \
(x)==PIX_FMT_YUV410P \
|| (x)==PIX_FMT_YUV420P \
|| (x)==PIX_FMT_YUVA420P \
|| (x)==PIX_FMT_YUV411P \
|| (x)==PIX_FMT_YUV422P \
|| (x)==PIX_FMT_YUV444P \
|| (x)==PIX_FMT_YUV440P \
|| (x)==PIX_FMT_NV12 \
|| (x)==PIX_FMT_NV21 \
)
#define isPlanarYUV(x) ( \
isPlanar8YUV(x) \
|| (x)==PIX_FMT_YUV420P9LE \
|| (x)==PIX_FMT_YUV422P9LE \
|| (x)==PIX_FMT_YUV444P9LE \
|| (x)==PIX_FMT_YUV420P10LE \
|| (x)==PIX_FMT_YUV422P10LE \
|| (x)==PIX_FMT_YUV444P10LE \
|| (x)==PIX_FMT_YUV420P16LE \
|| (x)==PIX_FMT_YUV422P16LE \
|| (x)==PIX_FMT_YUV444P16LE \
|| (x)==PIX_FMT_YUV420P9BE \
|| (x)==PIX_FMT_YUV422P9BE \
|| (x)==PIX_FMT_YUV444P9BE \
|| (x)==PIX_FMT_YUV420P10BE \
|| (x)==PIX_FMT_YUV422P10BE \
|| (x)==PIX_FMT_YUV444P10BE \
|| (x)==PIX_FMT_YUV420P16BE \
|| (x)==PIX_FMT_YUV422P16BE \
|| (x)==PIX_FMT_YUV444P16BE \
)
#define isYUV(x) ( \
(x)==PIX_FMT_UYVY422 \
|| (x)==PIX_FMT_YUYV422 \
|| isPlanarYUV(x) \
)
#define isGray(x) ( \
(x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_Y400A \
|| (x)==PIX_FMT_GRAY16BE \
|| (x)==PIX_FMT_GRAY16LE \
)
#define isGray16(x) ( \
(x)==PIX_FMT_GRAY16BE \
|| (x)==PIX_FMT_GRAY16LE \
)
#define isRGBinInt(x) ( \ #define isRGBinInt(x) ( \
(x)==PIX_FMT_RGB48BE \ (x)==PIX_FMT_RGB48BE \
|| (x)==PIX_FMT_RGB48LE \ || (x)==PIX_FMT_RGB48LE \
...@@ -633,39 +582,18 @@ const char *sws_format_name(enum PixelFormat format); ...@@ -633,39 +582,18 @@ const char *sws_format_name(enum PixelFormat format);
|| (x)==PIX_FMT_MONOBLACK \ || (x)==PIX_FMT_MONOBLACK \
|| (x)==PIX_FMT_MONOWHITE \ || (x)==PIX_FMT_MONOWHITE \
) )
#define isRGBinBytes(x) ( \
(x)==PIX_FMT_RGB48BE \
|| (x)==PIX_FMT_RGB48LE \
|| (x)==PIX_FMT_RGBA \
|| (x)==PIX_FMT_ARGB \
|| (x)==PIX_FMT_RGB24 \
)
#define isBGRinBytes(x) ( \
(x)==PIX_FMT_BGR48BE \
|| (x)==PIX_FMT_BGR48LE \
|| (x)==PIX_FMT_BGRA \
|| (x)==PIX_FMT_ABGR \
|| (x)==PIX_FMT_BGR24 \
)
#define isAnyRGB(x) ( \ #define isAnyRGB(x) ( \
isRGBinInt(x) \ isRGBinInt(x) \
|| isBGRinInt(x) \ || isBGRinInt(x) \
) )
#define isALPHA(x) ( \ #define isALPHA(x) \
(x)==PIX_FMT_BGR32 \ (av_pix_fmt_descriptors[x].nb_components == 2 || \
|| (x)==PIX_FMT_BGR32_1 \ av_pix_fmt_descriptors[x].nb_components == 4)
|| (x)==PIX_FMT_RGB32 \
|| (x)==PIX_FMT_RGB32_1 \ #define isPacked(x) \
|| (x)==PIX_FMT_Y400A \ (av_pix_fmt_descriptors[x].nb_components >= 2 && \
|| (x)==PIX_FMT_YUVA420P \ !(av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR))
)
#define isPacked(x) ( \
(x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_UYVY422 \
|| (x)==PIX_FMT_Y400A \
|| isAnyRGB(x) \
)
#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || (x) == PIX_FMT_Y400A) #define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || (x) == PIX_FMT_Y400A)
extern const uint64_t ff_dither4[2]; extern const uint64_t ff_dither4[2];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment