summaryrefslogtreecommitdiff
path: root/libswscale/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-10-06 12:10:34 +0200
committerAnton Khirnov <anton@khirnov.net>2012-10-08 07:13:26 +0200
commit716d413c13981da15323c7a3821860536eefdbbb (patch)
treeb15ebcded50b8edaa5b9fc8f261774043138e1fa /libswscale/utils.c
parent78071a1420b425dfb787ac739048f523007b8139 (diff)
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r--libswscale/utils.c222
1 files changed, 111 insertions, 111 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 0002e17635..fcdd04a118 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -73,102 +73,102 @@ typedef struct FormatEntry {
int is_supported_in, is_supported_out;
} FormatEntry;
-static const FormatEntry format_entries[PIX_FMT_NB] = {
- [PIX_FMT_YUV420P] = { 1, 1 },
- [PIX_FMT_YUYV422] = { 1, 1 },
- [PIX_FMT_RGB24] = { 1, 1 },
- [PIX_FMT_BGR24] = { 1, 1 },
- [PIX_FMT_YUV422P] = { 1, 1 },
- [PIX_FMT_YUV444P] = { 1, 1 },
- [PIX_FMT_YUV410P] = { 1, 1 },
- [PIX_FMT_YUV411P] = { 1, 1 },
- [PIX_FMT_GRAY8] = { 1, 1 },
- [PIX_FMT_MONOWHITE] = { 1, 1 },
- [PIX_FMT_MONOBLACK] = { 1, 1 },
- [PIX_FMT_PAL8] = { 1, 0 },
- [PIX_FMT_YUVJ420P] = { 1, 1 },
- [PIX_FMT_YUVJ422P] = { 1, 1 },
- [PIX_FMT_YUVJ444P] = { 1, 1 },
- [PIX_FMT_UYVY422] = { 1, 1 },
- [PIX_FMT_UYYVYY411] = { 0, 0 },
- [PIX_FMT_BGR8] = { 1, 1 },
- [PIX_FMT_BGR4] = { 0, 1 },
- [PIX_FMT_BGR4_BYTE] = { 1, 1 },
- [PIX_FMT_RGB8] = { 1, 1 },
- [PIX_FMT_RGB4] = { 0, 1 },
- [PIX_FMT_RGB4_BYTE] = { 1, 1 },
- [PIX_FMT_NV12] = { 1, 1 },
- [PIX_FMT_NV21] = { 1, 1 },
- [PIX_FMT_ARGB] = { 1, 1 },
- [PIX_FMT_RGBA] = { 1, 1 },
- [PIX_FMT_ABGR] = { 1, 1 },
- [PIX_FMT_BGRA] = { 1, 1 },
- [PIX_FMT_GRAY16BE] = { 1, 1 },
- [PIX_FMT_GRAY16LE] = { 1, 1 },
- [PIX_FMT_YUV440P] = { 1, 1 },
- [PIX_FMT_YUVJ440P] = { 1, 1 },
- [PIX_FMT_YUVA420P] = { 1, 1 },
- [PIX_FMT_RGB48BE] = { 1, 1 },
- [PIX_FMT_RGB48LE] = { 1, 1 },
- [PIX_FMT_RGB565BE] = { 1, 1 },
- [PIX_FMT_RGB565LE] = { 1, 1 },
- [PIX_FMT_RGB555BE] = { 1, 1 },
- [PIX_FMT_RGB555LE] = { 1, 1 },
- [PIX_FMT_BGR565BE] = { 1, 1 },
- [PIX_FMT_BGR565LE] = { 1, 1 },
- [PIX_FMT_BGR555BE] = { 1, 1 },
- [PIX_FMT_BGR555LE] = { 1, 1 },
- [PIX_FMT_YUV420P16LE] = { 1, 1 },
- [PIX_FMT_YUV420P16BE] = { 1, 1 },
- [PIX_FMT_YUV422P16LE] = { 1, 1 },
- [PIX_FMT_YUV422P16BE] = { 1, 1 },
- [PIX_FMT_YUV444P16LE] = { 1, 1 },
- [PIX_FMT_YUV444P16BE] = { 1, 1 },
- [PIX_FMT_RGB444LE] = { 1, 1 },
- [PIX_FMT_RGB444BE] = { 1, 1 },
- [PIX_FMT_BGR444LE] = { 1, 1 },
- [PIX_FMT_BGR444BE] = { 1, 1 },
- [PIX_FMT_Y400A] = { 1, 0 },
- [PIX_FMT_BGR48BE] = { 1, 1 },
- [PIX_FMT_BGR48LE] = { 1, 1 },
- [PIX_FMT_YUV420P9BE] = { 1, 1 },
- [PIX_FMT_YUV420P9LE] = { 1, 1 },
- [PIX_FMT_YUV420P10BE] = { 1, 1 },
- [PIX_FMT_YUV420P10LE] = { 1, 1 },
- [PIX_FMT_YUV422P9BE] = { 1, 1 },
- [PIX_FMT_YUV422P9LE] = { 1, 1 },
- [PIX_FMT_YUV422P10BE] = { 1, 1 },
- [PIX_FMT_YUV422P10LE] = { 1, 1 },
- [PIX_FMT_YUV444P9BE] = { 1, 1 },
- [PIX_FMT_YUV444P9LE] = { 1, 1 },
- [PIX_FMT_YUV444P10BE] = { 1, 1 },
- [PIX_FMT_YUV444P10LE] = { 1, 1 },
- [PIX_FMT_GBRP] = { 1, 0 },
- [PIX_FMT_GBRP9LE] = { 1, 0 },
- [PIX_FMT_GBRP9BE] = { 1, 0 },
- [PIX_FMT_GBRP10LE] = { 1, 0 },
- [PIX_FMT_GBRP10BE] = { 1, 0 },
- [PIX_FMT_GBRP16LE] = { 1, 0 },
- [PIX_FMT_GBRP16BE] = { 1, 0 },
+static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
+ [AV_PIX_FMT_YUV420P] = { 1, 1 },
+ [AV_PIX_FMT_YUYV422] = { 1, 1 },
+ [AV_PIX_FMT_RGB24] = { 1, 1 },
+ [AV_PIX_FMT_BGR24] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P] = { 1, 1 },
+ [AV_PIX_FMT_YUV410P] = { 1, 1 },
+ [AV_PIX_FMT_YUV411P] = { 1, 1 },
+ [AV_PIX_FMT_GRAY8] = { 1, 1 },
+ [AV_PIX_FMT_MONOWHITE] = { 1, 1 },
+ [AV_PIX_FMT_MONOBLACK] = { 1, 1 },
+ [AV_PIX_FMT_PAL8] = { 1, 0 },
+ [AV_PIX_FMT_YUVJ420P] = { 1, 1 },
+ [AV_PIX_FMT_YUVJ422P] = { 1, 1 },
+ [AV_PIX_FMT_YUVJ444P] = { 1, 1 },
+ [AV_PIX_FMT_UYVY422] = { 1, 1 },
+ [AV_PIX_FMT_UYYVYY411] = { 0, 0 },
+ [AV_PIX_FMT_BGR8] = { 1, 1 },
+ [AV_PIX_FMT_BGR4] = { 0, 1 },
+ [AV_PIX_FMT_BGR4_BYTE] = { 1, 1 },
+ [AV_PIX_FMT_RGB8] = { 1, 1 },
+ [AV_PIX_FMT_RGB4] = { 0, 1 },
+ [AV_PIX_FMT_RGB4_BYTE] = { 1, 1 },
+ [AV_PIX_FMT_NV12] = { 1, 1 },
+ [AV_PIX_FMT_NV21] = { 1, 1 },
+ [AV_PIX_FMT_ARGB] = { 1, 1 },
+ [AV_PIX_FMT_RGBA] = { 1, 1 },
+ [AV_PIX_FMT_ABGR] = { 1, 1 },
+ [AV_PIX_FMT_BGRA] = { 1, 1 },
+ [AV_PIX_FMT_GRAY16BE] = { 1, 1 },
+ [AV_PIX_FMT_GRAY16LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV440P] = { 1, 1 },
+ [AV_PIX_FMT_YUVJ440P] = { 1, 1 },
+ [AV_PIX_FMT_YUVA420P] = { 1, 1 },
+ [AV_PIX_FMT_RGB48BE] = { 1, 1 },
+ [AV_PIX_FMT_RGB48LE] = { 1, 1 },
+ [AV_PIX_FMT_RGB565BE] = { 1, 1 },
+ [AV_PIX_FMT_RGB565LE] = { 1, 1 },
+ [AV_PIX_FMT_RGB555BE] = { 1, 1 },
+ [AV_PIX_FMT_RGB555LE] = { 1, 1 },
+ [AV_PIX_FMT_BGR565BE] = { 1, 1 },
+ [AV_PIX_FMT_BGR565LE] = { 1, 1 },
+ [AV_PIX_FMT_BGR555BE] = { 1, 1 },
+ [AV_PIX_FMT_BGR555LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P16LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P16BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P16LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P16BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P16LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P16BE] = { 1, 1 },
+ [AV_PIX_FMT_RGB444LE] = { 1, 1 },
+ [AV_PIX_FMT_RGB444BE] = { 1, 1 },
+ [AV_PIX_FMT_BGR444LE] = { 1, 1 },
+ [AV_PIX_FMT_BGR444BE] = { 1, 1 },
+ [AV_PIX_FMT_Y400A] = { 1, 0 },
+ [AV_PIX_FMT_BGR48BE] = { 1, 1 },
+ [AV_PIX_FMT_BGR48LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P9BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P9LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P10BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P10LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P9BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P9LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P10BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P10LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P9BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P9LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P10BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P10LE] = { 1, 1 },
+ [AV_PIX_FMT_GBRP] = { 1, 0 },
+ [AV_PIX_FMT_GBRP9LE] = { 1, 0 },
+ [AV_PIX_FMT_GBRP9BE] = { 1, 0 },
+ [AV_PIX_FMT_GBRP10LE] = { 1, 0 },
+ [AV_PIX_FMT_GBRP10BE] = { 1, 0 },
+ [AV_PIX_FMT_GBRP16LE] = { 1, 0 },
+ [AV_PIX_FMT_GBRP16BE] = { 1, 0 },
};
-int sws_isSupportedInput(enum PixelFormat pix_fmt)
+int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
{
- return (unsigned)pix_fmt < PIX_FMT_NB ?
+ return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
format_entries[pix_fmt].is_supported_in : 0;
}
-int sws_isSupportedOutput(enum PixelFormat pix_fmt)
+int sws_isSupportedOutput(enum AVPixelFormat pix_fmt)
{
- return (unsigned)pix_fmt < PIX_FMT_NB ?
+ return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
format_entries[pix_fmt].is_supported_out : 0;
}
extern const int32_t ff_yuv2rgb_coeffs[8][4];
-const char *sws_format_name(enum PixelFormat format)
+const char *sws_format_name(enum AVPixelFormat format)
{
- if ((unsigned)format < PIX_FMT_NB && av_pix_fmt_descriptors[format].name)
+ if ((unsigned)format < AV_PIX_FMT_NB && av_pix_fmt_descriptors[format].name)
return av_pix_fmt_descriptors[format].name;
else
return "Unknown format";
@@ -743,7 +743,7 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode,
}
#endif /* HAVE_MMXEXT_INLINE */
-static void getSubSampleFactors(int *h, int *v, enum PixelFormat format)
+static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
{
*h = av_pix_fmt_descriptors[format].log2_chroma_w;
*v = av_pix_fmt_descriptors[format].log2_chroma_h;
@@ -795,20 +795,20 @@ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
return 0;
}
-static int handle_jpeg(enum PixelFormat *format)
+static int handle_jpeg(enum AVPixelFormat *format)
{
switch (*format) {
- case PIX_FMT_YUVJ420P:
- *format = PIX_FMT_YUV420P;
+ case AV_PIX_FMT_YUVJ420P:
+ *format = AV_PIX_FMT_YUV420P;
return 1;
- case PIX_FMT_YUVJ422P:
- *format = PIX_FMT_YUV422P;
+ case AV_PIX_FMT_YUVJ422P:
+ *format = AV_PIX_FMT_YUV422P;
return 1;
- case PIX_FMT_YUVJ444P:
- *format = PIX_FMT_YUV444P;
+ case AV_PIX_FMT_YUVJ444P:
+ *format = AV_PIX_FMT_YUV444P;
return 1;
- case PIX_FMT_YUVJ440P:
- *format = PIX_FMT_YUV440P;
+ case AV_PIX_FMT_YUVJ440P:
+ *format = AV_PIX_FMT_YUV440P;
return 1;
default:
return 0;
@@ -839,8 +839,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 16, 16);
int dst_stride_px = dst_stride >> 1;
int flags, cpu_flags;
- enum PixelFormat srcFormat = c->srcFormat;
- enum PixelFormat dstFormat = c->dstFormat;
+ enum AVPixelFormat srcFormat = c->srcFormat;
+ enum AVPixelFormat dstFormat = c->dstFormat;
cpu_flags = av_get_cpu_flags();
flags = c->flags;
@@ -913,12 +913,12 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
* chroma interpolation */
if (flags & SWS_FULL_CHR_H_INT &&
isAnyRGB(dstFormat) &&
- dstFormat != PIX_FMT_RGBA &&
- dstFormat != PIX_FMT_ARGB &&
- dstFormat != PIX_FMT_BGRA &&
- dstFormat != PIX_FMT_ABGR &&
- dstFormat != PIX_FMT_RGB24 &&
- dstFormat != PIX_FMT_BGR24) {
+ dstFormat != AV_PIX_FMT_RGBA &&
+ dstFormat != AV_PIX_FMT_ARGB &&
+ dstFormat != AV_PIX_FMT_BGRA &&
+ dstFormat != AV_PIX_FMT_ABGR &&
+ dstFormat != AV_PIX_FMT_RGB24 &&
+ dstFormat != AV_PIX_FMT_BGR24) {
av_log(c, AV_LOG_ERROR,
"full chroma interpolation for destination format '%s' not yet implemented\n",
sws_format_name(dstFormat));
@@ -936,9 +936,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
/* drop every other pixel for chroma calculation unless user
* wants full chroma */
if (isAnyRGB(srcFormat) && !(flags & SWS_FULL_CHR_H_INP) &&
- srcFormat != PIX_FMT_RGB8 && srcFormat != PIX_FMT_BGR8 &&
- srcFormat != PIX_FMT_RGB4 && srcFormat != PIX_FMT_BGR4 &&
- srcFormat != PIX_FMT_RGB4_BYTE && srcFormat != PIX_FMT_BGR4_BYTE &&
+ srcFormat != AV_PIX_FMT_RGB8 && srcFormat != AV_PIX_FMT_BGR8 &&
+ srcFormat != AV_PIX_FMT_RGB4 && srcFormat != AV_PIX_FMT_BGR4 &&
+ srcFormat != AV_PIX_FMT_RGB4_BYTE && srcFormat != AV_PIX_FMT_BGR4_BYTE &&
((dstW >> c->chrDstHSubSample) <= (srcW >> 1) ||
(flags & SWS_FAST_BILINEAR)))
c->chrSrcHSubSample = 1;
@@ -1199,9 +1199,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
av_log(c, AV_LOG_INFO, "from %s to %s%s ",
sws_format_name(srcFormat),
#ifdef DITHER1XBPP
- dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ||
- dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE ||
- dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE ?
+ dstFormat == AV_PIX_FMT_BGR555 || dstFormat == AV_PIX_FMT_BGR565 ||
+ dstFormat == AV_PIX_FMT_RGB444BE || dstFormat == AV_PIX_FMT_RGB444LE ||
+ dstFormat == AV_PIX_FMT_BGR444BE || dstFormat == AV_PIX_FMT_BGR444LE ?
"dithered " : "",
#else
"",
@@ -1236,8 +1236,8 @@ fail: // FIXME replace things by appropriate error codes
}
#if FF_API_SWS_GETCONTEXT
-SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
- int dstW, int dstH, enum PixelFormat dstFormat,
+SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
+ int dstW, int dstH, enum AVPixelFormat dstFormat,
int flags, SwsFilter *srcFilter,
SwsFilter *dstFilter, const double *param)
{
@@ -1647,9 +1647,9 @@ void sws_freeContext(SwsContext *c)
}
struct SwsContext *sws_getCachedContext(struct SwsContext *context, int srcW,
- int srcH, enum PixelFormat srcFormat,
+ int srcH, enum AVPixelFormat srcFormat,
int dstW, int dstH,
- enum PixelFormat dstFormat, int flags,
+ enum AVPixelFormat dstFormat, int flags,
SwsFilter *srcFilter,
SwsFilter *dstFilter,
const double *param)