aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-08 20:54:00 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-08 21:06:57 +0200
commitac627b3d38d370027406c93c2dcaac0b1712a7d4 (patch)
treed2d1f39e96a75d864681349c4fbd37692e558683 /libswscale
parent89715a3cf187c271f7cf4c230b23cd6f6d638e32 (diff)
parent716d413c13981da15323c7a3821860536eefdbbb (diff)
downloadffmpeg-ac627b3d38d370027406c93c2dcaac0b1712a7d4.tar.gz
Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
* commit '716d413c13981da15323c7a3821860536eefdbbb': Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat Conflicts: doc/examples/muxing.c ffmpeg.h ffmpeg_filter.c ffmpeg_opt.c ffplay.c ffprobe.c libavcodec/8bps.c libavcodec/aasc.c libavcodec/aura.c libavcodec/avcodec.h libavcodec/avs.c libavcodec/bfi.c libavcodec/bmp.c libavcodec/bmpenc.c libavcodec/c93.c libavcodec/cscd.c libavcodec/cyuv.c libavcodec/dpx.c libavcodec/dpxenc.c libavcodec/eatgv.c libavcodec/escape124.c libavcodec/ffv1.c libavcodec/flashsv.c libavcodec/fraps.c libavcodec/h264.c libavcodec/huffyuv.c libavcodec/iff.c libavcodec/imgconvert.c libavcodec/indeo3.c libavcodec/kmvc.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libx264.c libavcodec/ljpegenc.c libavcodec/mjpegdec.c libavcodec/mjpegenc.c libavcodec/motionpixels.c libavcodec/mpeg12.c libavcodec/mpeg12enc.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo_enc.c libavcodec/pamenc.c libavcodec/pcxenc.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/pnm.c libavcodec/pnmdec.c libavcodec/pnmenc.c libavcodec/ptx.c libavcodec/qdrw.c libavcodec/qpeg.c libavcodec/qtrleenc.c libavcodec/raw.c libavcodec/rawdec.c libavcodec/rl2.c libavcodec/sgidec.c libavcodec/sgienc.c libavcodec/snowdec.c libavcodec/snowenc.c libavcodec/sunrast.c libavcodec/targa.c libavcodec/targaenc.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/tmv.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/vb.c libavcodec/vp3.c libavcodec/wnv1.c libavcodec/xl.c libavcodec/xwddec.c libavcodec/xwdenc.c libavcodec/yop.c libavdevice/v4l2.c libavdevice/x11grab.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/buffersrc.c libavfilter/drawutils.c libavfilter/formats.c libavfilter/src_movie.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_format.c libavfilter/vf_hflip.c libavfilter/vf_lut.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_yadif.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/movenc.c libavformat/mxf.h libavformat/utils.c libavformat/yuv4mpeg.c libavutil/imgutils.c libavutil/pixdesc.c libswscale/input.c libswscale/output.c libswscale/swscale_internal.h libswscale/swscale_unscaled.c libswscale/utils.c libswscale/x86/swscale_template.c libswscale/x86/yuv2rgb.c libswscale/x86/yuv2rgb_template.c libswscale/yuv2rgb.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/bfin/swscale_bfin.c4
-rw-r--r--libswscale/bfin/yuv2rgb_bfin.c12
-rw-r--r--libswscale/input.c448
-rw-r--r--libswscale/options.c4
-rw-r--r--libswscale/output.c234
-rw-r--r--libswscale/ppc/swscale_altivec.c16
-rw-r--r--libswscale/ppc/yuv2rgb_altivec.c64
-rw-r--r--libswscale/ppc/yuv2yuv_altivec.c8
-rw-r--r--libswscale/sparc/yuv2rgb_vis.c4
-rw-r--r--libswscale/swscale-test.c78
-rw-r--r--libswscale/swscale.c40
-rw-r--r--libswscale/swscale.h12
-rw-r--r--libswscale/swscale_internal.h126
-rw-r--r--libswscale/swscale_unscaled.c172
-rw-r--r--libswscale/utils.c284
-rw-r--r--libswscale/x86/swscale.c34
-rw-r--r--libswscale/x86/swscale_template.c36
-rw-r--r--libswscale/x86/yuv2rgb.c20
-rw-r--r--libswscale/x86/yuv2rgb_template.c2
-rw-r--r--libswscale/yuv2rgb.c90
20 files changed, 844 insertions, 844 deletions
diff --git a/libswscale/bfin/swscale_bfin.c b/libswscale/bfin/swscale_bfin.c
index a51b2af56c..2b93858e5c 100644
--- a/libswscale/bfin/swscale_bfin.c
+++ b/libswscale/bfin/swscale_bfin.c
@@ -73,12 +73,12 @@ static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[],
void ff_bfin_get_unscaled_swscale(SwsContext *c)
{
- if (c->dstFormat == PIX_FMT_YUV420P && c->srcFormat == PIX_FMT_UYVY422) {
+ if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_UYVY422) {
av_log(NULL, AV_LOG_VERBOSE,
"selecting Blackfin optimized uyvytoyv12_unscaled\n");
c->swScale = uyvytoyv12_unscaled;
}
- if (c->dstFormat == PIX_FMT_YUV420P && c->srcFormat == PIX_FMT_YUYV422) {
+ if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_YUYV422) {
av_log(NULL, AV_LOG_VERBOSE,
"selecting Blackfin optimized yuyvtoyv12_unscaled\n");
c->swScale = yuyvtoyv12_unscaled;
diff --git a/libswscale/bfin/yuv2rgb_bfin.c b/libswscale/bfin/yuv2rgb_bfin.c
index dae7f314e7..e1b7afaaa7 100644
--- a/libswscale/bfin/yuv2rgb_bfin.c
+++ b/libswscale/bfin/yuv2rgb_bfin.c
@@ -173,22 +173,22 @@ SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c)
SwsFunc f;
switch (c->dstFormat) {
- case PIX_FMT_RGB555:
+ case AV_PIX_FMT_RGB555:
f = bfin_yuv420_rgb555;
break;
- case PIX_FMT_BGR555:
+ case AV_PIX_FMT_BGR555:
f = bfin_yuv420_bgr555;
break;
- case PIX_FMT_RGB565:
+ case AV_PIX_FMT_RGB565:
f = bfin_yuv420_rgb565;
break;
- case PIX_FMT_BGR565:
+ case AV_PIX_FMT_BGR565:
f = bfin_yuv420_bgr565;
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
f = bfin_yuv420_rgb24;
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
f = bfin_yuv420_bgr24;
break;
default:
diff --git a/libswscale/input.c b/libswscale/input.c
index 9234646435..6d76068f9a 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -49,12 +49,12 @@
#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))
-#define r ((origin == PIX_FMT_BGR48BE || origin == PIX_FMT_BGR48LE) ? b_r : r_b)
-#define b ((origin == PIX_FMT_BGR48BE || origin == PIX_FMT_BGR48LE) ? r_b : b_r)
+#define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? b_r : r_b)
+#define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? r_b : b_r)
static av_always_inline void
rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width,
- enum PixelFormat origin)
+ enum AVPixelFormat origin)
{
int i;
for (i = 0; i < width; i++) {
@@ -69,7 +69,7 @@ rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width,
static av_always_inline void
rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV,
const uint16_t *src1, const uint16_t *src2,
- int width, enum PixelFormat origin)
+ int width, enum AVPixelFormat origin)
{
int i;
av_assert1(src1==src2);
@@ -86,7 +86,7 @@ rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV,
static av_always_inline void
rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV,
const uint16_t *src1, const uint16_t *src2,
- int width, enum PixelFormat origin)
+ int width, enum AVPixelFormat origin)
{
int i;
av_assert1(src1==src2);
@@ -129,12 +129,12 @@ static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV
rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin); \
}
-rgb64funcs(rgb, LE, PIX_FMT_RGBA64LE)
-rgb64funcs(rgb, BE, PIX_FMT_RGBA64BE)
+rgb64funcs(rgb, LE, AV_PIX_FMT_RGBA64LE)
+rgb64funcs(rgb, BE, AV_PIX_FMT_RGBA64BE)
static av_always_inline void rgb48ToY_c_template(uint16_t *dst,
const uint16_t *src, int width,
- enum PixelFormat origin)
+ enum AVPixelFormat origin)
{
int i;
for (i = 0; i < width; i++) {
@@ -151,7 +151,7 @@ static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU,
const uint16_t *src1,
const uint16_t *src2,
int width,
- enum PixelFormat origin)
+ enum AVPixelFormat origin)
{
int i;
av_assert1(src1 == src2);
@@ -170,7 +170,7 @@ static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU,
const uint16_t *src1,
const uint16_t *src2,
int width,
- enum PixelFormat origin)
+ enum AVPixelFormat origin)
{
int i;
av_assert1(src1 == src2);
@@ -233,15 +233,15 @@ static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \
rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin); \
}
-rgb48funcs(rgb, LE, PIX_FMT_RGB48LE)
-rgb48funcs(rgb, BE, PIX_FMT_RGB48BE)
-rgb48funcs(bgr, LE, PIX_FMT_BGR48LE)
-rgb48funcs(bgr, BE, PIX_FMT_BGR48BE)
+rgb48funcs(rgb, LE, AV_PIX_FMT_RGB48LE)
+rgb48funcs(rgb, BE, AV_PIX_FMT_RGB48BE)
+rgb48funcs(bgr, LE, AV_PIX_FMT_BGR48LE)
+rgb48funcs(bgr, BE, AV_PIX_FMT_BGR48BE)
-#define input_pixel(i) ((origin == PIX_FMT_RGBA || \
- origin == PIX_FMT_BGRA || \
- origin == PIX_FMT_ARGB || \
- origin == PIX_FMT_ABGR) \
+#define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \
+ origin == AV_PIX_FMT_BGRA || \
+ origin == AV_PIX_FMT_ARGB || \
+ origin == AV_PIX_FMT_ABGR) \
? AV_RN32A(&src[(i) * 4]) \
: (isBE(origin) ? AV_RB16(&src[(i) * 2]) \
: AV_RL16(&src[(i) * 2])))
@@ -249,7 +249,7 @@ rgb48funcs(bgr, BE, PIX_FMT_BGR48BE)
static av_always_inline void rgb16_32ToY_c_template(int16_t *dst,
const uint8_t *src,
int width,
- enum PixelFormat origin,
+ enum AVPixelFormat origin,
int shr, int shg,
int shb, int shp,
int maskr, int maskg,
@@ -274,7 +274,7 @@ static av_always_inline void rgb16_32ToUV_c_template(int16_t *dstU,
int16_t *dstV,
const uint8_t *src,
int width,
- enum PixelFormat origin,
+ enum AVPixelFormat origin,
int shr, int shg,
int shb, int shp,
int maskr, int maskg,
@@ -301,7 +301,7 @@ static av_always_inline void rgb16_32ToUV_half_c_template(int16_t *dstU,
int16_t *dstV,
const uint8_t *src,
int width,
- enum PixelFormat origin,
+ enum AVPixelFormat origin,
int shr, int shg,
int shb, int shp,
int maskr, int maskg,
@@ -325,8 +325,8 @@ static av_always_inline void rgb16_32ToUV_half_c_template(int16_t *dstU,
b = (rb & maskb) >> shb;
if (shp ||
- origin == PIX_FMT_BGR565LE || origin == PIX_FMT_BGR565BE ||
- origin == PIX_FMT_RGB565LE || origin == PIX_FMT_RGB565BE) {
+ origin == AV_PIX_FMT_BGR565LE || origin == AV_PIX_FMT_BGR565BE ||
+ origin == AV_PIX_FMT_RGB565LE || origin == AV_PIX_FMT_RGB565BE) {
g >>= shg;
} else {
g = (g & maskg) >> shg;
@@ -369,22 +369,22 @@ static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \
rsh, gsh, bsh, S); \
}
-rgb16_32_wrapper(PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(PIX_FMT_BGR32_1, bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(PIX_FMT_RGB32_1, rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(PIX_FMT_BGR555LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
-rgb16_32_wrapper(PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
-rgb16_32_wrapper(PIX_FMT_RGB565LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
-rgb16_32_wrapper(PIX_FMT_RGB444LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
-rgb16_32_wrapper(PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
-rgb16_32_wrapper(PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
-rgb16_32_wrapper(PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
-rgb16_32_wrapper(PIX_FMT_RGB444BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
+rgb16_32_wrapper(AV_PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
+rgb16_32_wrapper(AV_PIX_FMT_BGR32_1, bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
+rgb16_32_wrapper(AV_PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
+rgb16_32_wrapper(AV_PIX_FMT_RGB32_1, rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
+rgb16_32_wrapper(AV_PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
+rgb16_32_wrapper(AV_PIX_FMT_BGR555LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
+rgb16_32_wrapper(AV_PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
+rgb16_32_wrapper(AV_PIX_FMT_RGB565LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
+rgb16_32_wrapper(AV_PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
+rgb16_32_wrapper(AV_PIX_FMT_RGB444LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
+rgb16_32_wrapper(AV_PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
+rgb16_32_wrapper(AV_PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
+rgb16_32_wrapper(AV_PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
+rgb16_32_wrapper(AV_PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
+rgb16_32_wrapper(AV_PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
+rgb16_32_wrapper(AV_PIX_FMT_RGB444BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc,
@@ -864,250 +864,250 @@ static void planar_rgb16be_to_uv(uint8_t *dstU, uint8_t *dstV,
av_cold void ff_sws_init_input_funcs(SwsContext *c)
{
- enum PixelFormat srcFormat = c->srcFormat;
+ enum AVPixelFormat srcFormat = c->srcFormat;
c->chrToYV12 = NULL;
switch (srcFormat) {
- case PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YUYV422:
c->chrToYV12 = yuy2ToUV_c;
break;
- case PIX_FMT_UYVY422:
+ case AV_PIX_FMT_UYVY422:
c->chrToYV12 = uyvyToUV_c;
break;
- case PIX_FMT_NV12:
+ case AV_PIX_FMT_NV12:
c->chrToYV12 = nv12ToUV_c;
break;
- case PIX_FMT_NV21:
+ case AV_PIX_FMT_NV21:
c->chrToYV12 = nv21ToUV_c;
break;
- case PIX_FMT_RGB8:
- case PIX_FMT_BGR8:
- case PIX_FMT_PAL8:
- case PIX_FMT_BGR4_BYTE:
- case PIX_FMT_RGB4_BYTE:
+ case AV_PIX_FMT_RGB8:
+ case AV_PIX_FMT_BGR8:
+ case AV_PIX_FMT_PAL8:
+ case AV_PIX_FMT_BGR4_BYTE:
+ case AV_PIX_FMT_RGB4_BYTE:
c->chrToYV12 = palToUV_c;
break;
- case PIX_FMT_GBRP9LE:
+ case AV_PIX_FMT_GBRP9LE:
c->readChrPlanar = planar_rgb9le_to_uv;
break;
- case PIX_FMT_GBRP10LE:
+ case AV_PIX_FMT_GBRP10LE:
c->readChrPlanar = planar_rgb10le_to_uv;
break;
- case PIX_FMT_GBRP12LE:
+ case AV_PIX_FMT_GBRP12LE:
c->readChrPlanar = planar_rgb12le_to_uv;
break;
- case PIX_FMT_GBRP14LE:
+ case AV_PIX_FMT_GBRP14LE:
c->readChrPlanar = planar_rgb14le_to_uv;
break;
- case PIX_FMT_GBRP16LE:
+ case AV_PIX_FMT_GBRP16LE:
c->readChrPlanar = planar_rgb16le_to_uv;
break;
- case PIX_FMT_GBRP9BE:
+ case AV_PIX_FMT_GBRP9BE:
c->readChrPlanar = planar_rgb9be_to_uv;
break;
- case PIX_FMT_GBRP10BE:
+ case AV_PIX_FMT_GBRP10BE:
c->readChrPlanar = planar_rgb10be_to_uv;
break;
- case PIX_FMT_GBRP12BE:
+ case AV_PIX_FMT_GBRP12BE:
c->readChrPlanar = planar_rgb12be_to_uv;
break;
- case PIX_FMT_GBRP14BE:
+ case AV_PIX_FMT_GBRP14BE:
c->readChrPlanar = planar_rgb14be_to_uv;
break;
- case PIX_FMT_GBRP16BE:
+ case AV_PIX_FMT_GBRP16BE:
c->readChrPlanar = planar_rgb16be_to_uv;
break;
- case PIX_FMT_GBRP:
+ case AV_PIX_FMT_GBRP:
c->readChrPlanar = planar_rgb_to_uv;
break;
#if HAVE_BIGENDIAN
- case PIX_FMT_YUV444P9LE:
- case PIX_FMT_YUV422P9LE:
- case PIX_FMT_YUV420P9LE:
- case PIX_FMT_YUV422P10LE:
- case PIX_FMT_YUV444P10LE:
- case PIX_FMT_YUV420P10LE:
- case PIX_FMT_YUV422P12LE:
- case PIX_FMT_YUV444P12LE:
- case PIX_FMT_YUV420P12LE:
- case PIX_FMT_YUV422P14LE:
- case PIX_FMT_YUV444P14LE:
- case PIX_FMT_YUV420P14LE:
- case PIX_FMT_YUV420P16LE:
- case PIX_FMT_YUV422P16LE:
- case PIX_FMT_YUV444P16LE:
+ case AV_PIX_FMT_YUV444P9LE:
+ case AV_PIX_FMT_YUV422P9LE:
+ case AV_PIX_FMT_YUV420P9LE:
+ case AV_PIX_FMT_YUV422P10LE:
+ case AV_PIX_FMT_YUV444P10LE:
+ case AV_PIX_FMT_YUV420P10LE:
+ case AV_PIX_FMT_YUV422P12LE:
+ case AV_PIX_FMT_YUV444P12LE:
+ case AV_PIX_FMT_YUV420P12LE:
+ case AV_PIX_FMT_YUV422P14LE:
+ case AV_PIX_FMT_YUV444P14LE:
+ case AV_PIX_FMT_YUV420P14LE:
+ case AV_PIX_FMT_YUV420P16LE:
+ case AV_PIX_FMT_YUV422P16LE:
+ case AV_PIX_FMT_YUV444P16LE:
c->chrToYV12 = bswap16UV_c;
break;
#else
- case PIX_FMT_YUV444P9BE:
- case PIX_FMT_YUV422P9BE:
- case PIX_FMT_YUV420P9BE:
- case PIX_FMT_YUV444P10BE:
- case PIX_FMT_YUV422P10BE:
- case PIX_FMT_YUV420P10BE:
- case PIX_FMT_YUV444P12BE:
- case PIX_FMT_YUV422P12BE:
- case PIX_FMT_YUV420P12BE:
- case PIX_FMT_YUV444P14BE:
- case PIX_FMT_YUV422P14BE:
- case PIX_FMT_YUV420P14BE:
- case PIX_FMT_YUV420P16BE:
- case PIX_FMT_YUV422P16BE:
- case PIX_FMT_YUV444P16BE:
+ case AV_PIX_FMT_YUV444P9BE:
+ case AV_PIX_FMT_YUV422P9BE:
+ case AV_PIX_FMT_YUV420P9BE:
+ case AV_PIX_FMT_YUV444P10BE:
+ case AV_PIX_FMT_YUV422P10BE:
+ case AV_PIX_FMT_YUV420P10BE:
+ case AV_PIX_FMT_YUV444P12BE:
+ case AV_PIX_FMT_YUV422P12BE:
+ case AV_PIX_FMT_YUV420P12BE:
+ case AV_PIX_FMT_YUV444P14BE:
+ case AV_PIX_FMT_YUV422P14BE:
+ case AV_PIX_FMT_YUV420P14BE:
+ case AV_PIX_FMT_YUV420P16BE:
+ case AV_PIX_FMT_YUV422P16BE:
+ case AV_PIX_FMT_YUV444P16BE:
c->chrToYV12 = bswap16UV_c;
break;
#endif
}
if (c->chrSrcHSubSample) {
switch (srcFormat) {
- case PIX_FMT_RGBA64BE:
+ case AV_PIX_FMT_RGBA64BE:
c->chrToYV12 = rgb64BEToUV_half_c;
break;
- case PIX_FMT_RGBA64LE:
+ case AV_PIX_FMT_RGBA64LE:
c->chrToYV12 = rgb64LEToUV_half_c;
break;
- case PIX_FMT_RGB48BE:
+ case AV_PIX_FMT_RGB48BE:
c->chrToYV12 = rgb48BEToUV_half_c;
break;
- case PIX_FMT_RGB48LE:
+ case AV_PIX_FMT_RGB48LE:
c->chrToYV12 = rgb48LEToUV_half_c;
break;
- case PIX_FMT_BGR48BE:
+ case AV_PIX_FMT_BGR48BE:
c->chrToYV12 = bgr48BEToUV_half_c;
break;
- case PIX_FMT_BGR48LE:
+ case AV_PIX_FMT_BGR48LE:
c->chrToYV12 = bgr48LEToUV_half_c;
break;
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
c->chrToYV12 = bgr32ToUV_half_c;
break;
- case PIX_FMT_RGB32_1:
+ case AV_PIX_FMT_RGB32_1:
c->chrToYV12 = bgr321ToUV_half_c;
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
c->chrToYV12 = bgr24ToUV_half_c;
break;
- case PIX_FMT_BGR565LE:
+ case AV_PIX_FMT_BGR565LE:
c->chrToYV12 = bgr16leToUV_half_c;
break;
- case PIX_FMT_BGR565BE:
+ case AV_PIX_FMT_BGR565BE:
c->chrToYV12 = bgr16beToUV_half_c;
break;
- case PIX_FMT_BGR555LE:
+ case AV_PIX_FMT_BGR555LE:
c->chrToYV12 = bgr15leToUV_half_c;
break;
- case PIX_FMT_BGR555BE:
+ case AV_PIX_FMT_BGR555BE:
c->chrToYV12 = bgr15beToUV_half_c;
break;
- case PIX_FMT_GBR24P :
+ case AV_PIX_FMT_GBR24P :
c->chrToYV12 = gbr24pToUV_half_c;
break;
- case PIX_FMT_BGR444LE:
+ case AV_PIX_FMT_BGR444LE:
c->chrToYV12 = bgr12leToUV_half_c;
break;
- case PIX_FMT_BGR444BE:
+ case AV_PIX_FMT_BGR444BE:
c->chrToYV12 = bgr12beToUV_half_c;
break;
- case PIX_FMT_BGR32:
+ case AV_PIX_FMT_BGR32:
c->chrToYV12 = rgb32ToUV_half_c;
break;
- case PIX_FMT_BGR32_1:
+ case AV_PIX_FMT_BGR32_1:
c->chrToYV12 = rgb321ToUV_half_c;
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
c->chrToYV12 = rgb24ToUV_half_c;
break;
- case PIX_FMT_RGB565LE:
+ case AV_PIX_FMT_RGB565LE:
c->chrToYV12 = rgb16leToUV_half_c;
break;
- case PIX_FMT_RGB565BE:
+ case AV_PIX_FMT_RGB565BE:
c->chrToYV12 = rgb16beToUV_half_c;
break;
- case PIX_FMT_RGB555LE:
+ case AV_PIX_FMT_RGB555LE:
c->chrToYV12 = rgb15leToUV_half_c;
break;
- case PIX_FMT_RGB555BE:
+ case AV_PIX_FMT_RGB555BE:
c->chrToYV12 = rgb15beToUV_half_c;
break;
- case PIX_FMT_RGB444LE:
+ case AV_PIX_FMT_RGB444LE:
c->chrToYV12 = rgb12leToUV_half_c;
break;
- case PIX_FMT_RGB444BE:
+ case AV_PIX_FMT_RGB444BE:
c->chrToYV12 = rgb12beToUV_half_c;
break;
}
} else {
switch (srcFormat) {
- case PIX_FMT_RGBA64BE:
+ case AV_PIX_FMT_RGBA64BE:
c->chrToYV12 = rgb64BEToUV_c;
break;
- case PIX_FMT_RGBA64LE:
+ case AV_PIX_FMT_RGBA64LE:
c->chrToYV12 = rgb64LEToUV_c;
break;
- case PIX_FMT_RGB48BE:
+ case AV_PIX_FMT_RGB48BE:
c->chrToYV12 = rgb48BEToUV_c;
break;
- case PIX_FMT_RGB48LE:
+ case AV_PIX_FMT_RGB48LE:
c->chrToYV12 = rgb48LEToUV_c;
break;
- case PIX_FMT_BGR48BE:
+ case AV_PIX_FMT_BGR48BE:
c->chrToYV12 = bgr48BEToUV_c;
break;
- case PIX_FMT_BGR48LE:
+ case AV_PIX_FMT_BGR48LE:
c->chrToYV12 = bgr48LEToUV_c;
break;
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
c->chrToYV12 = bgr32ToUV_c;
break;
- case PIX_FMT_RGB32_1:
+ case AV_PIX_FMT_RGB32_1:
c->chrToYV12 = bgr321ToUV_c;
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
c->chrToYV12 = bgr24ToUV_c;
break;
- case PIX_FMT_BGR565LE:
+ case AV_PIX_FMT_BGR565LE:
c->chrToYV12 = bgr16leToUV_c;
break;
- case PIX_FMT_BGR565BE:
+ case AV_PIX_FMT_BGR565BE:
c->chrToYV12 = bgr16beToUV_c;
break;
- case PIX_FMT_BGR555LE:
+ case AV_PIX_FMT_BGR555LE:
c->chrToYV12 = bgr15leToUV_c;
break;
- case PIX_FMT_BGR555BE:
+ case AV_PIX_FMT_BGR555BE:
c->chrToYV12 = bgr15beToUV_c;
break;
- case PIX_FMT_BGR444LE:
+ case AV_PIX_FMT_BGR444LE:
c->chrToYV12 = bgr12leToUV_c;
break;
- case PIX_FMT_BGR444BE:
+ case AV_PIX_FMT_BGR444BE:
c->chrToYV12 = bgr12beToUV_c;
break;
- case PIX_FMT_BGR32:
+ case AV_PIX_FMT_BGR32:
c->chrToYV12 = rgb32ToUV_c;
break;
- case PIX_FMT_BGR32_1:
+ case AV_PIX_FMT_BGR32_1:
c->chrToYV12 = rgb321ToUV_c;
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
c->chrToYV12 = rgb24ToUV_c;
break;
- case PIX_FMT_RGB565LE:
+ case AV_PIX_FMT_RGB565LE:
c->chrToYV12 = rgb16leToUV_c;
break;
- case PIX_FMT_RGB565BE:
+ case AV_PIX_FMT_RGB565BE:
c->chrToYV12 = rgb16beToUV_c;
break;
- case PIX_FMT_RGB555LE:
+ case AV_PIX_FMT_RGB555LE:
c->chrToYV12 = rgb15leToUV_c;
break;
- case PIX_FMT_RGB555BE:
+ case AV_PIX_FMT_RGB555BE:
c->chrToYV12 = rgb15beToUV_c;
break;
- case PIX_FMT_RGB444LE:
+ case AV_PIX_FMT_RGB444LE:
c->chrToYV12 = rgb12leToUV_c;
break;
- case PIX_FMT_RGB444BE:
+ case AV_PIX_FMT_RGB444BE:
c->chrToYV12 = rgb12beToUV_c;
break;
}
@@ -1116,187 +1116,187 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c->lumToYV12 = NULL;
c->alpToYV12 = NULL;
switch (srcFormat) {
- case PIX_FMT_GBRP9LE:
+ case AV_PIX_FMT_GBRP9LE:
c->readLumPlanar = planar_rgb9le_to_y;
break;
- case PIX_FMT_GBRP10LE:
+ case AV_PIX_FMT_GBRP10LE:
c->readLumPlanar = planar_rgb10le_to_y;
break;
- case PIX_FMT_GBRP12LE:
+ case AV_PIX_FMT_GBRP12LE:
c->readLumPlanar = planar_rgb12le_to_y;
break;
- case PIX_FMT_GBRP14LE:
+ case AV_PIX_FMT_GBRP14LE:
c->readLumPlanar = planar_rgb14le_to_y;
break;
- case PIX_FMT_GBRP16LE:
+ case AV_PIX_FMT_GBRP16LE:
c->readLumPlanar = planar_rgb16le_to_y;
break;
- case PIX_FMT_GBRP9BE:
+ case AV_PIX_FMT_GBRP9BE:
c->readLumPlanar = planar_rgb9be_to_y;
break;
- case PIX_FMT_GBRP10BE:
+ case AV_PIX_FMT_GBRP10BE:
c->readLumPlanar = planar_rgb10be_to_y;
break;
- case PIX_FMT_GBRP12BE:
+ case AV_PIX_FMT_GBRP12BE:
c->readLumPlanar = planar_rgb12be_to_y;
break;
- case PIX_FMT_GBRP14BE:
+ case AV_PIX_FMT_GBRP14BE:
c->readLumPlanar = planar_rgb14be_to_y;
break;
- case PIX_FMT_GBRP16BE:
+ case AV_PIX_FMT_GBRP16BE:
c->readLumPlanar = planar_rgb16be_to_y;
break;
- case PIX_FMT_GBRP:
+ case AV_PIX_FMT_GBRP:
c->readLumPlanar = planar_rgb_to_y;
break;
#if HAVE_BIGENDIAN
- case PIX_FMT_YUV444P9LE:
- case PIX_FMT_YUV422P9LE:
- case PIX_FMT_YUV420P9LE:
- case PIX_FMT_YUV444P10LE:
- case PIX_FMT_YUV422P10LE:
- case PIX_FMT_YUV420P10LE:
- case PIX_FMT_YUV444P12LE:
- case PIX_FMT_YUV422P12LE:
- case PIX_FMT_YUV420P12LE:
- case PIX_FMT_YUV444P14LE:
- case PIX_FMT_YUV422P14LE:
- case PIX_FMT_YUV420P14LE:
- case PIX_FMT_YUV420P16LE:
- case PIX_FMT_YUV422P16LE:
- case PIX_FMT_YUV444P16LE:
- case PIX_FMT_GRAY16LE:
+ case AV_PIX_FMT_YUV444P9LE:
+ case AV_PIX_FMT_YUV422P9LE:
+ case AV_PIX_FMT_YUV420P9LE:
+ case AV_PIX_FMT_YUV444P10LE:
+ case AV_PIX_FMT_YUV422P10LE:
+ case AV_PIX_FMT_YUV420P10LE:
+ case AV_PIX_FMT_YUV444P12LE:
+ case AV_PIX_FMT_YUV422P12LE:
+ case AV_PIX_FMT_YUV420P12LE:
+ case AV_PIX_FMT_YUV444P14LE:
+ case AV_PIX_FMT_YUV422P14LE:
+ case AV_PIX_FMT_YUV420P14LE:
+ case AV_PIX_FMT_YUV420P16LE:
+ case AV_PIX_FMT_YUV422P16LE:
+ case AV_PIX_FMT_YUV444P16LE:
+ case AV_PIX_FMT_GRAY16LE:
c->lumToYV12 = bswap16Y_c;
break;
#else
- case PIX_FMT_YUV444P9BE:
- case PIX_FMT_YUV422P9BE:
- case PIX_FMT_YUV420P9BE:
- case PIX_FMT_YUV444P10BE:
- case PIX_FMT_YUV422P10BE:
- case PIX_FMT_YUV420P10BE:
- case PIX_FMT_YUV444P12BE:
- case PIX_FMT_YUV422P12BE:
- case PIX_FMT_YUV420P12BE:
- case PIX_FMT_YUV444P14BE:
- case PIX_FMT_YUV422P14BE:
- case PIX_FMT_YUV420P14BE:
- case PIX_FMT_YUV420P16BE:
- case PIX_FMT_YUV422P16BE:
- case PIX_FMT_YUV444P16BE:
- case PIX_FMT_GRAY16BE:
+ case AV_PIX_FMT_YUV444P9BE:
+ case AV_PIX_FMT_YUV422P9BE:
+ case AV_PIX_FMT_YUV420P9BE:
+ case AV_PIX_FMT_YUV444P10BE:
+ case AV_PIX_FMT_YUV422P10BE:
+ case AV_PIX_FMT_YUV420P10BE:
+ case AV_PIX_FMT_YUV444P12BE:
+ case AV_PIX_FMT_YUV422P12BE:
+ case AV_PIX_FMT_YUV420P12BE:
+ case AV_PIX_FMT_YUV444P14BE:
+ case AV_PIX_FMT_YUV422P14BE:
+ case AV_PIX_FMT_YUV420P14BE:
+ case AV_PIX_FMT_YUV420P16BE:
+ case AV_PIX_FMT_YUV422P16BE:
+ case AV_PIX_FMT_YUV444P16BE:
+ case AV_PIX_FMT_GRAY16BE:
c->lumToYV12 = bswap16Y_c;
break;
#endif
- case PIX_FMT_YUYV422:
- case PIX_FMT_Y400A:
+ case AV_PIX_FMT_YUYV422:
+ case AV_PIX_FMT_Y400A:
c->lumToYV12 = yuy2ToY_c;
break;
- case PIX_FMT_UYVY422:
+ case AV_PIX_FMT_UYVY422:
c->lumToYV12 = uyvyToY_c;
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
c->lumToYV12 = bgr24ToY_c;
break;
- case PIX_FMT_BGR565LE:
+ case AV_PIX_FMT_BGR565LE:
c->lumToYV12 = bgr16leToY_c;
break;
- case PIX_FMT_BGR565BE:
+ case AV_PIX_FMT_BGR565BE:
c->lumToYV12 = bgr16beToY_c;
break;
- case PIX_FMT_BGR555LE:
+ case AV_PIX_FMT_BGR555LE:
c->lumToYV12 = bgr15leToY_c;
break;
- case PIX_FMT_BGR555BE:
+ case AV_PIX_FMT_BGR555BE:
c->lumToYV12 = bgr15beToY_c;
break;
- case PIX_FMT_BGR444LE:
+ case AV_PIX_FMT_BGR444LE:
c->lumToYV12 = bgr12leToY_c;
break;
- case PIX_FMT_BGR444BE:
+ case AV_PIX_FMT_BGR444BE:
c->lumToYV12 = bgr12beToY_c;
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
c->lumToYV12 = rgb24ToY_c;
break;
- case PIX_FMT_RGB565LE:
+ case AV_PIX_FMT_RGB565LE:
c->lumToYV12 = rgb16leToY_c;
break;
- case PIX_FMT_RGB565BE:
+ case AV_PIX_FMT_RGB565BE:
c->lumToYV12 = rgb16beToY_c;
break;
- case PIX_FMT_RGB555LE:
+ case AV_PIX_FMT_RGB555LE:
c->lumToYV12 = rgb15leToY_c;
break;
- case PIX_FMT_RGB555BE:
+ case AV_PIX_FMT_RGB555BE:
c->lumToYV12 = rgb15beToY_c;
break;
- case PIX_FMT_RGB444LE:
+ case AV_PIX_FMT_RGB444LE:
c->lumToYV12 = rgb12leToY_c;
break;
- case PIX_FMT_RGB444BE:
+ case AV_PIX_FMT_RGB444BE:
c->lumToYV12 = rgb12beToY_c;
break;
- case PIX_FMT_RGB8:
- case PIX_FMT_BGR8:
- case PIX_FMT_PAL8:
- case PIX_FMT_BGR4_BYTE:
- case PIX_FMT_RGB4_BYTE:
+ case AV_PIX_FMT_RGB8:
+ case AV_PIX_FMT_BGR8:
+ case AV_PIX_FMT_PAL8:
+ case AV_PIX_FMT_BGR4_BYTE:
+ case AV_PIX_FMT_RGB4_BYTE:
c->lumToYV12 = palToY_c;
break;
- case PIX_FMT_MONOBLACK:
+ case AV_PIX_FMT_MONOBLACK:
c->lumToYV12 = monoblack2Y_c;
break;
- case PIX_FMT_MONOWHITE:
+ case AV_PIX_FMT_MONOWHITE:
c->lumToYV12 = monowhite2Y_c;
break;
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
c->lumToYV12 = bgr32ToY_c;
break;
- case PIX_FMT_RGB32_1:
+ case AV_PIX_FMT_RGB32_1:
c->lumToYV12 = bgr321ToY_c;
break;
- case PIX_FMT_BGR32:
+ case AV_PIX_FMT_BGR32:
c->lumToYV12 = rgb32ToY_c;
break;
- case PIX_FMT_BGR32_1:
+ case AV_PIX_FMT_BGR32_1:
c->lumToYV12 = rgb321ToY_c;
break;
- case PIX_FMT_RGB48BE:
+ case AV_PIX_FMT_RGB48BE:
c->lumToYV12 = rgb48BEToY_c;
break;
- case PIX_FMT_RGB48LE:
+ case AV_PIX_FMT_RGB48LE:
c->lumToYV12 = rgb48LEToY_c;
break;
- case PIX_FMT_BGR48BE:
+ case AV_PIX_FMT_BGR48BE:
c->lumToYV12 = bgr48BEToY_c;
break;
- case PIX_FMT_BGR48LE:
+ case AV_PIX_FMT_BGR48LE:
c->lumToYV12 = bgr48LEToY_c;
break;
- case PIX_FMT_RGBA64BE:
+ case AV_PIX_FMT_RGBA64BE:
c->lumToYV12 = rgb64BEToY_c;
break;
- case PIX_FMT_RGBA64LE:
+ case AV_PIX_FMT_RGBA64LE:
c->lumToYV12 = rgb64LEToY_c;
break;
}
if (c->alpPixBuf) {
switch (srcFormat) {
- case PIX_FMT_RGBA64LE:
- case PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64ToA_c; break;
- case PIX_FMT_BGRA:
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA64LE:
+ case AV_PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64ToA_c; break;
+ case AV_PIX_FMT_BGRA:
+ case AV_PIX_FMT_RGBA:
c->alpToYV12 = rgbaToA_c;
break;
- case PIX_FMT_ABGR:
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ABGR:
+ case AV_PIX_FMT_ARGB:
c->alpToYV12 = abgrToA_c;
break;
- case PIX_FMT_Y400A:
+ case AV_PIX_FMT_Y400A:
c->alpToYV12 = uyvyToY_c;
break;
- case PIX_FMT_PAL8 :
+ case AV_PIX_FMT_PAL8 :
c->alpToYV12 = palToA_c;
break;
}
diff --git a/libswscale/options.c b/libswscale/options.c
index 02047509d0..9cd4fc0607 100644
--- a/libswscale/options.c
+++ b/libswscale/options.c
@@ -56,8 +56,8 @@ static const AVOption options[] = {
{ "srch", "source height", OFFSET(srcH), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },
{ "dstw", "destination width", OFFSET(dstW), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },
{ "dsth", "destination height", OFFSET(dstH), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },
- { "src_format", "source format", OFFSET(srcFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, PIX_FMT_NB - 1, VE },
- { "dst_format", "destination format", OFFSET(dstFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, PIX_FMT_NB - 1, VE },
+ { "src_format", "source format", OFFSET(srcFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, AV_PIX_FMT_NB - 1, VE },
+ { "dst_format", "destination format", OFFSET(dstFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, AV_PIX_FMT_NB - 1, VE },
{ "src_range", "source range", OFFSET(srcRange), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, 1, VE },
{ "dst_range", "destination range", OFFSET(dstRange), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, 1, VE },
{ "param0", "scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, VE },
diff --git a/libswscale/output.c b/libswscale/output.c
index 5039629b79..15591ae285 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -276,11 +276,11 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS
const int16_t **chrUSrc, const int16_t **chrVSrc,
uint8_t *dest, int chrDstW)
{
- enum PixelFormat dstFormat = c->dstFormat;
+ enum AVPixelFormat dstFormat = c->dstFormat;
const uint8_t *chrDither = c->chrDither8;
int i;
- if (dstFormat == PIX_FMT_NV12)
+ if (dstFormat == AV_PIX_FMT_NV12)
for (i=0; i<chrDstW; i++) {
int u = chrDither[i & 7] << 12;
int v = chrDither[(i + 3) & 7] << 12;
@@ -312,7 +312,7 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS
acc <<= 1; \
acc |= (val) >= (128 + 110)
#define output_pixel(pos, acc) \
- if (target == PIX_FMT_MONOBLACK) { \
+ if (target == AV_PIX_FMT_MONOBLACK) { \
pos = acc; \
} else { \
pos = ~acc; \
@@ -324,7 +324,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc, uint8_t *dest, int dstW,
- int y, enum PixelFormat target)
+ int y, enum AVPixelFormat target)
{
const uint8_t * const d128=dither_8x8_220[y&7];
int i;
@@ -362,7 +362,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2],
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf[2], uint8_t *dest, int dstW,
int yalpha, int uvalpha, int y,
- enum PixelFormat target)
+ enum AVPixelFormat target)
{
const int16_t *buf0 = buf[0], *buf1 = buf[1];
const uint8_t * const d128 = dither_8x8_220[y & 7];
@@ -397,7 +397,7 @@ static av_always_inline void
yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf0, uint8_t *dest, int dstW,
- int uvalpha, int y, enum PixelFormat target)
+ int uvalpha, int y, enum AVPixelFormat target)
{
const uint8_t * const d128 = dither_8x8_220[y & 7];
int i;
@@ -453,11 +453,11 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
y, fmt); \
}
-YUV2PACKEDWRAPPER(yuv2mono,, white, PIX_FMT_MONOWHITE)
-YUV2PACKEDWRAPPER(yuv2mono,, black, PIX_FMT_MONOBLACK)
+YUV2PACKEDWRAPPER(yuv2mono,, white, AV_PIX_FMT_MONOWHITE)
+YUV2PACKEDWRAPPER(yuv2mono,, black, AV_PIX_FMT_MONOBLACK)
#define output_pixels(pos, Y1, U, Y2, V) \
- if (target == PIX_FMT_YUYV422) { \
+ if (target == AV_PIX_FMT_YUYV422) { \
dest[pos + 0] = Y1; \
dest[pos + 1] = U; \
dest[pos + 2] = Y2; \
@@ -475,7 +475,7 @@ yuv2422_X_c_template(SwsContext *c, const int16_t *lumFilter,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc, uint8_t *dest, int dstW,
- int y, enum PixelFormat target)
+ int y, enum AVPixelFormat target)
{
int i;
@@ -513,7 +513,7 @@ yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2],
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf[2], uint8_t *dest, int dstW,
int yalpha, int uvalpha, int y,
- enum PixelFormat target)
+ enum AVPixelFormat target)
{
const int16_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
@@ -543,7 +543,7 @@ static av_always_inline void
yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf0, uint8_t *dest, int dstW,
- int uvalpha, int y, enum PixelFormat target)
+ int uvalpha, int y, enum AVPixelFormat target)
{
const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
int i;
@@ -596,11 +596,11 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
#undef output_pixels
-YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, PIX_FMT_YUYV422)
-YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, PIX_FMT_UYVY422)
+YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, AV_PIX_FMT_YUYV422)
+YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, AV_PIX_FMT_UYVY422)
-#define R_B ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? R : B)
-#define B_R ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? B : R)
+#define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? R : B)
+#define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? B : R)
#define output_pixel(pos, val) \
if (isBE(target)) { \
AV_WB16(pos, val); \
@@ -614,7 +614,7 @@ yuv2rgb48_X_c_template(SwsContext *c, const int16_t *lumFilter,
const int16_t *chrFilter, const int32_t **chrUSrc,
const int32_t **chrVSrc, int chrFilterSize,
const int32_t **alpSrc, uint16_t *dest, int dstW,
- int y, enum PixelFormat target)
+ int y, enum AVPixelFormat target)
{
int i;
@@ -672,7 +672,7 @@ yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2],
const int32_t *ubuf[2], const int32_t *vbuf[2],
const int32_t *abuf[2], uint16_t *dest, int dstW,
int yalpha, int uvalpha, int y,
- enum PixelFormat target)
+ enum AVPixelFormat target)
{
const int32_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
@@ -713,7 +713,7 @@ static av_always_inline void
yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0,
const int32_t *ubuf[2], const int32_t *vbuf[2],
const int32_t *abuf0, uint16_t *dest, int dstW,
- int uvalpha, int y, enum PixelFormat target)
+ int uvalpha, int y, enum AVPixelFormat target)
{
const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
int i;
@@ -826,10 +826,10 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \
dstW, uvalpha, y, fmt); \
}
-YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE)
-YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE)
-YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE)
-YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE)
+YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, AV_PIX_FMT_RGB48BE)
+YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, AV_PIX_FMT_RGB48LE)
+YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, AV_PIX_FMT_BGR48BE)
+YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, AV_PIX_FMT_BGR48LE)
/*
* Write out 2 RGB pixels in the target pixel format. This function takes a
@@ -843,23 +843,23 @@ static av_always_inline void
yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2,
unsigned A1, unsigned A2,
const void *_r, const void *_g, const void *_b, int y,
- enum PixelFormat target, int hasAlpha)
+ enum AVPixelFormat target, int hasAlpha)
{
- if (target == PIX_FMT_ARGB || target == PIX_FMT_RGBA ||
- target == PIX_FMT_ABGR || target == PIX_FMT_BGRA) {
+ if (target == AV_PIX_FMT_ARGB || target == AV_PIX_FMT_RGBA ||
+ target == AV_PIX_FMT_ABGR || target == AV_PIX_FMT_BGRA) {
uint32_t *dest = (uint32_t *) _dest;
const uint32_t *r = (const uint32_t *) _r;
const uint32_t *g = (const uint32_t *) _g;
const uint32_t *b = (const uint32_t *) _b;
#if CONFIG_SMALL
- int sh = hasAlpha ? ((target == PIX_FMT_RGB32_1 || target == PIX_FMT_BGR32_1) ? 0 : 24) : 0;
+ int sh = hasAlpha ? ((target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24) : 0;
dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (hasAlpha ? A1 << sh : 0);
dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (hasAlpha ? A2 << sh : 0);
#else
if (hasAlpha) {
- int sh = (target == PIX_FMT_RGB32_1 || target == PIX_FMT_BGR32_1) ? 0 : 24;
+ int sh = (target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24;
dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (A1 << sh);
dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (A2 << sh);
@@ -868,14 +868,14 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2,
dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2];
}
#endif
- } else if (target == PIX_FMT_RGB24 || target == PIX_FMT_BGR24) {
+ } else if (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) {
uint8_t *dest = (uint8_t *) _dest;
const uint8_t *r = (const uint8_t *) _r;
const uint8_t *g = (const uint8_t *) _g;
const uint8_t *b = (const uint8_t *) _b;
-#define r_b ((target == PIX_FMT_RGB24) ? r : b)
-#define b_r ((target == PIX_FMT_RGB24) ? b : r)
+#define r_b ((target == AV_PIX_FMT_RGB24) ? r : b)
+#define b_r ((target == AV_PIX_FMT_RGB24) ? b : r)
dest[i * 6 + 0] = r_b[Y1];
dest[i * 6 + 1] = g[Y1];
@@ -885,23 +885,23 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2,
dest[i * 6 + 5] = b_r[Y2];
#undef r_b
#undef b_r
- } else if (target == PIX_FMT_RGB565 || target == PIX_FMT_BGR565 ||
- target == PIX_FMT_RGB555 || target == PIX_FMT_BGR555 ||
- target == PIX_FMT_RGB444 || target == PIX_FMT_BGR444) {
+ } else if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565 ||
+ target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555 ||
+ target == AV_PIX_FMT_RGB444 || target == AV_PIX_FMT_BGR444) {
uint16_t *dest = (uint16_t *) _dest;
const uint16_t *r = (const uint16_t *) _r;
const uint16_t *g = (const uint16_t *) _g;
const uint16_t *b = (const uint16_t *) _b;
int dr1, dg1, db1, dr2, dg2, db2;
- if (target == PIX_FMT_RGB565 || target == PIX_FMT_BGR565) {
+ if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565) {
dr1 = dither_2x2_8[ y & 1 ][0];
dg1 = dither_2x2_4[ y & 1 ][0];
db1 = dither_2x2_8[(y & 1) ^ 1][0];
dr2 = dither_2x2_8[ y & 1 ][1];
dg2 = dither_2x2_4[ y & 1 ][1];
db2 = dither_2x2_8[(y & 1) ^ 1][1];
- } else if (target == PIX_FMT_RGB555 || target == PIX_FMT_BGR555) {
+ } else if (target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555) {
dr1 = dither_2x2_8[ y & 1 ][0];
dg1 = dither_2x2_8[ y & 1 ][1];
db1 = dither_2x2_8[(y & 1) ^ 1][0];
@@ -926,7 +926,7 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2,
const uint8_t *b = (const uint8_t *) _b;
int dr1, dg1, db1, dr2, dg2, db2;
- if (target == PIX_FMT_RGB8 || target == PIX_FMT_BGR8) {
+ if (target == AV_PIX_FMT_RGB8 || target == AV_PIX_FMT_BGR8) {
const uint8_t * const d64 = dither_8x8_73[y & 7];
const uint8_t * const d32 = dither_8x8_32[y & 7];
dr1 = dg1 = d32[(i * 2 + 0) & 7];
@@ -942,7 +942,7 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2,
dg2 = d64[(i * 2 + 1) & 7];
}
- if (target == PIX_FMT_RGB4 || target == PIX_FMT_BGR4) {
+ if (target == AV_PIX_FMT_RGB4 || target == AV_PIX_FMT_BGR4) {
dest[i] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1] +
((r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]) << 4);
} else {
@@ -958,7 +958,7 @@ yuv2rgb_X_c_template(SwsContext *c, const int16_t *lumFilter,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc, uint8_t *dest, int dstW,
- int y, enum PixelFormat target, int hasAlpha)
+ int y, enum AVPixelFormat target, int hasAlpha)
{
int i;
@@ -1011,7 +1011,7 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf[2], uint8_t *dest, int dstW,
int yalpha, int uvalpha, int y,
- enum PixelFormat target, int hasAlpha)
+ enum AVPixelFormat target, int hasAlpha)
{
const int16_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
@@ -1048,7 +1048,7 @@ static av_always_inline void
yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf0, uint8_t *dest, int dstW,
- int uvalpha, int y, enum PixelFormat target,
+ int uvalpha, int y, enum AVPixelFormat target,
int hasAlpha)
{
const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
@@ -1133,24 +1133,24 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
}
#if CONFIG_SMALL
-YUV2RGBWRAPPER(yuv2rgb,, 32_1, PIX_FMT_RGB32_1, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-YUV2RGBWRAPPER(yuv2rgb,, 32, PIX_FMT_RGB32, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPER(yuv2rgb,, 32_1, AV_PIX_FMT_RGB32_1, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPER(yuv2rgb,, 32, AV_PIX_FMT_RGB32, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
#else
#if CONFIG_SWSCALE_ALPHA
-YUV2RGBWRAPPER(yuv2rgb,, a32_1, PIX_FMT_RGB32_1, 1)
-YUV2RGBWRAPPER(yuv2rgb,, a32, PIX_FMT_RGB32, 1)
+YUV2RGBWRAPPER(yuv2rgb,, a32_1, AV_PIX_FMT_RGB32_1, 1)
+YUV2RGBWRAPPER(yuv2rgb,, a32, AV_PIX_FMT_RGB32, 1)
#endif
-YUV2RGBWRAPPER(yuv2rgb,, x32_1, PIX_FMT_RGB32_1, 0)
-YUV2RGBWRAPPER(yuv2rgb,, x32, PIX_FMT_RGB32, 0)
+YUV2RGBWRAPPER(yuv2rgb,, x32_1, AV_PIX_FMT_RGB32_1, 0)
+YUV2RGBWRAPPER(yuv2rgb,, x32, AV_PIX_FMT_RGB32, 0)
#endif
-YUV2RGBWRAPPER(yuv2, rgb, rgb24, PIX_FMT_RGB24, 0)
-YUV2RGBWRAPPER(yuv2, rgb, bgr24, PIX_FMT_BGR24, 0)
-YUV2RGBWRAPPER(yuv2rgb,, 16, PIX_FMT_RGB565, 0)
-YUV2RGBWRAPPER(yuv2rgb,, 15, PIX_FMT_RGB555, 0)
-YUV2RGBWRAPPER(yuv2rgb,, 12, PIX_FMT_RGB444, 0)
-YUV2RGBWRAPPER(yuv2rgb,, 8, PIX_FMT_RGB8, 0)
-YUV2RGBWRAPPER(yuv2rgb,, 4, PIX_FMT_RGB4, 0)
-YUV2RGBWRAPPER(yuv2rgb,, 4b, PIX_FMT_RGB4_BYTE, 0)
+YUV2RGBWRAPPER(yuv2, rgb, rgb24, AV_PIX_FMT_RGB24, 0)
+YUV2RGBWRAPPER(yuv2, rgb, bgr24, AV_PIX_FMT_BGR24, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 16, AV_PIX_FMT_RGB565, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 15, AV_PIX_FMT_RGB555, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 12, AV_PIX_FMT_RGB444, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 8, AV_PIX_FMT_RGB8, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 4, AV_PIX_FMT_RGB4, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 4b, AV_PIX_FMT_RGB4_BYTE, 0)
static av_always_inline void
yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
@@ -1158,10 +1158,10 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc, uint8_t *dest,
- int dstW, int y, enum PixelFormat target, int hasAlpha)
+ int dstW, int y, enum AVPixelFormat target, int hasAlpha)
{
int i;
- int step = (target == PIX_FMT_RGB24 || target == PIX_FMT_BGR24) ? 3 : 4;
+ int step = (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) ? 3 : 4;
for (i = 0; i < dstW; i++) {
int j;
@@ -1202,35 +1202,35 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
}
switch(target) {
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ARGB:
dest[0] = hasAlpha ? A : 255;
dest[1] = R >> 22;
dest[2] = G >> 22;
dest[3] = B >> 22;
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
dest[0] = R >> 22;
dest[1] = G >> 22;
dest[2] = B >> 22;
break;
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA:
dest[0] = R >> 22;
dest[1] = G >> 22;
dest[2] = B >> 22;
dest[3] = hasAlpha ? A : 255;
break;
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ABGR:
dest[0] = hasAlpha ? A : 255;
dest[1] = B >> 22;
dest[2] = G >> 22;
dest[3] = R >> 22;
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
dest[0] = B >> 22;
dest[1] = G >> 22;
dest[2] = R >> 22;
break;
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGRA:
dest[0] = B >> 22;
dest[1] = G >> 22;
dest[2] = R >> 22;
@@ -1242,24 +1242,24 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
}
#if CONFIG_SMALL
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
#else
#if CONFIG_SWSCALE_ALPHA
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, 1)
-YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, 1)
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, 1)
-YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, 1)
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA, 1)
+YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR, 1)
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA, 1)
+YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB, 1)
#endif
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, PIX_FMT_BGRA, 0)
-YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, PIX_FMT_ABGR, 0)
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, PIX_FMT_RGBA, 0)
-YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, PIX_FMT_ARGB, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, AV_PIX_FMT_BGRA, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, AV_PIX_FMT_ABGR, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, AV_PIX_FMT_RGBA, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, AV_PIX_FMT_ARGB, 0)
#endif
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full, PIX_FMT_BGR24, 0)
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full, PIX_FMT_RGB24, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full, AV_PIX_FMT_BGR24, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full, AV_PIX_FMT_RGB24, 0)
av_cold void ff_sws_init_output_funcs(SwsContext *c,
yuv2planar1_fn *yuv2plane1,
@@ -1269,7 +1269,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
yuv2packed2_fn *yuv2packed2,
yuv2packedX_fn *yuv2packedX)
{
- enum PixelFormat dstFormat = c->dstFormat;
+ enum AVPixelFormat dstFormat = c->dstFormat;
if (is16BPS(dstFormat)) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
@@ -1285,13 +1285,13 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
} else {
*yuv2plane1 = yuv2plane1_8_c;
*yuv2planeX = yuv2planeX_8_c;
- if (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)
+ if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)
*yuv2nv12cX = yuv2nv12cX_c;
}
if(c->flags & SWS_FULL_CHR_H_INT) {
switch (dstFormat) {
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA:
#if CONFIG_SMALL
*yuv2packedX = yuv2rgba32_full_X_c;
#else
@@ -1305,7 +1305,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ARGB:
#if CONFIG_SMALL
*yuv2packedX = yuv2argb32_full_X_c;
#else
@@ -1319,7 +1319,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGRA:
#if CONFIG_SMALL
*yuv2packedX = yuv2bgra32_full_X_c;
#else
@@ -1333,7 +1333,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ABGR:
#if CONFIG_SMALL
*yuv2packedX = yuv2abgr32_full_X_c;
#else
@@ -1347,10 +1347,10 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
*yuv2packedX = yuv2rgb24_full_X_c;
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
*yuv2packedX = yuv2bgr24_full_X_c;
break;
}
@@ -1359,28 +1359,28 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
} else {
YUV_PACKED:
switch (dstFormat) {
- case PIX_FMT_RGB48LE:
+ case AV_PIX_FMT_RGB48LE:
*yuv2packed1 = yuv2rgb48le_1_c;
*yuv2packed2 = yuv2rgb48le_2_c;
*yuv2packedX = yuv2rgb48le_X_c;
break;
- case PIX_FMT_RGB48BE:
+ case AV_PIX_FMT_RGB48BE:
*yuv2packed1 = yuv2rgb48be_1_c;
*yuv2packed2 = yuv2rgb48be_2_c;
*yuv2packedX = yuv2rgb48be_X_c;
break;
- case PIX_FMT_BGR48LE:
+ case AV_PIX_FMT_BGR48LE:
*yuv2packed1 = yuv2bgr48le_1_c;
*yuv2packed2 = yuv2bgr48le_2_c;
*yuv2packedX = yuv2bgr48le_X_c;
break;
- case PIX_FMT_BGR48BE:
+ case AV_PIX_FMT_BGR48BE:
*yuv2packed1 = yuv2bgr48be_1_c;
*yuv2packed2 = yuv2bgr48be_2_c;
*yuv2packedX = yuv2bgr48be_X_c;
break;
- case PIX_FMT_RGB32:
- case PIX_FMT_BGR32:
+ case AV_PIX_FMT_RGB32:
+ case AV_PIX_FMT_BGR32:
#if CONFIG_SMALL
*yuv2packed1 = yuv2rgb32_1_c;
*yuv2packed2 = yuv2rgb32_2_c;
@@ -1400,8 +1400,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_RGB32_1:
- case PIX_FMT_BGR32_1:
+ case AV_PIX_FMT_RGB32_1:
+ case AV_PIX_FMT_BGR32_1:
#if CONFIG_SMALL
*yuv2packed1 = yuv2rgb32_1_1_c;
*yuv2packed2 = yuv2rgb32_1_2_c;
@@ -1421,54 +1421,54 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
*yuv2packed1 = yuv2rgb24_1_c;
*yuv2packed2 = yuv2rgb24_2_c;
*yuv2packedX = yuv2rgb24_X_c;
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
*yuv2packed1 = yuv2bgr24_1_c;
*yuv2packed2 = yuv2bgr24_2_c;
*yuv2packedX = yuv2bgr24_X_c;
break;
- case PIX_FMT_RGB565LE:
- case PIX_FMT_RGB565BE:
- case PIX_FMT_BGR565LE:
- case PIX_FMT_BGR565BE:
+ case AV_PIX_FMT_RGB565LE:
+ case AV_PIX_FMT_RGB565BE:
+ case AV_PIX_FMT_BGR565LE:
+ case AV_PIX_FMT_BGR565BE:
*yuv2packed1 = yuv2rgb16_1_c;
*yuv2packed2 = yuv2rgb16_2_c;
*yuv2packedX = yuv2rgb16_X_c;
break;
- case PIX_FMT_RGB555LE:
- case PIX_FMT_RGB555BE:
- case PIX_FMT_BGR555LE:
- case PIX_FMT_BGR555BE:
+ case AV_PIX_FMT_RGB555LE:
+ case AV_PIX_FMT_RGB555BE:
+ case AV_PIX_FMT_BGR555LE:
+ case AV_PIX_FMT_BGR555BE:
*yuv2packed1 = yuv2rgb15_1_c;
*yuv2packed2 = yuv2rgb15_2_c;
*yuv2packedX = yuv2rgb15_X_c;
break;
- case PIX_FMT_RGB444LE:
- case PIX_FMT_RGB444BE:
- case PIX_FMT_BGR444LE:
- case PIX_FMT_BGR444BE:
+ case AV_PIX_FMT_RGB444LE:
+ case AV_PIX_FMT_RGB444BE:
+ case AV_PIX_FMT_BGR444LE:
+ case AV_PIX_FMT_BGR444BE:
*yuv2packed1 = yuv2rgb12_1_c;
*yuv2packed2 = yuv2rgb12_2_c;
*yuv2packedX = yuv2rgb12_X_c;
break;
- case PIX_FMT_RGB8:
- case PIX_FMT_BGR8:
+ case AV_PIX_FMT_RGB8:
+ case AV_PIX_FMT_BGR8:
*yuv2packed1 = yuv2rgb8_1_c;
*yuv2packed2 = yuv2rgb8_2_c;
*yuv2packedX = yuv2rgb8_X_c;
break;
- case PIX_FMT_RGB4:
- case PIX_FMT_BGR4:
+ case AV_PIX_FMT_RGB4:
+ case AV_PIX_FMT_BGR4:
*yuv2packed1 = yuv2rgb4_1_c;
*yuv2packed2 = yuv2rgb4_2_c;
*yuv2packedX = yuv2rgb4_X_c;
break;
- case PIX_FMT_RGB4_BYTE:
- case PIX_FMT_BGR4_BYTE:
+ case AV_PIX_FMT_RGB4_BYTE:
+ case AV_PIX_FMT_BGR4_BYTE:
*yuv2packed1 = yuv2rgb4b_1_c;
*yuv2packed2 = yuv2rgb4b_2_c;
*yuv2packedX = yuv2rgb4b_X_c;
@@ -1476,22 +1476,22 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
}
}
switch (dstFormat) {
- case PIX_FMT_MONOWHITE:
+ case AV_PIX_FMT_MONOWHITE:
*yuv2packed1 = yuv2monowhite_1_c;
*yuv2packed2 = yuv2monowhite_2_c;
*yuv2packedX = yuv2monowhite_X_c;
break;
- case PIX_FMT_MONOBLACK:
+ case AV_PIX_FMT_MONOBLACK:
*yuv2packed1 = yuv2monoblack_1_c;
*yuv2packed2 = yuv2monoblack_2_c;
*yuv2packedX = yuv2monoblack_X_c;
break;
- case PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YUYV422:
*yuv2packed1 = yuv2yuyv422_1_c;
*yuv2packed2 = yuv2yuyv422_2_c;
*yuv2packedX = yuv2yuyv422_X_c;
break;
- case PIX_FMT_UYVY422:
+ case AV_PIX_FMT_UYVY422:
*yuv2packed1 = yuv2uyvy422_1_c;
*yuv2packed2 = yuv2uyvy422_2_c;
*yuv2packedX = yuv2uyvy422_X_c;
diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c
index e013f03c3b..9ca2868cc8 100644
--- a/libswscale/ppc/swscale_altivec.c
+++ b/libswscale/ppc/swscale_altivec.c
@@ -287,7 +287,7 @@ static void hScale_altivec_real(SwsContext *c, int16_t *dst, int dstW,
av_cold void ff_sws_init_swScale_altivec(SwsContext *c)
{
- enum PixelFormat dstFormat = c->dstFormat;
+ enum AVPixelFormat dstFormat = c->dstFormat;
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
return;
@@ -296,7 +296,7 @@ av_cold void ff_sws_init_swScale_altivec(SwsContext *c)
c->hyScale = c->hcScale = hScale_altivec_real;
}
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
- dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 &&
+ dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
!c->alpPixBuf) {
c->yuv2planeX = yuv2planeX_altivec;
}
@@ -305,22 +305,22 @@ av_cold void ff_sws_init_swScale_altivec(SwsContext *c)
* match what's found in the body of ff_yuv2packedX_altivec() */
if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf) {
switch (c->dstFormat) {
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ABGR:
c->yuv2packedX = ff_yuv2abgr_X_altivec;
break;
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGRA:
c->yuv2packedX = ff_yuv2bgra_X_altivec;
break;
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ARGB:
c->yuv2packedX = ff_yuv2argb_X_altivec;
break;
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA:
c->yuv2packedX = ff_yuv2rgba_X_altivec;
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
c->yuv2packedX = ff_yuv2bgr24_X_altivec;
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
c->yuv2packedX = ff_yuv2rgb24_X_altivec;
break;
}
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index ade134d779..a8501d9a10 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -548,41 +548,41 @@ av_cold SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c)
return NULL;
switch (c->srcFormat) {
- case PIX_FMT_YUV410P:
- case PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUV410P:
+ case AV_PIX_FMT_YUV420P:
/*case IMGFMT_CLPL: ??? */
- case PIX_FMT_GRAY8:
- case PIX_FMT_NV12:
- case PIX_FMT_NV21:
+ case AV_PIX_FMT_GRAY8:
+ case AV_PIX_FMT_NV12:
+ case AV_PIX_FMT_NV21:
if ((c->srcH & 0x1) != 0)
return NULL;
switch (c->dstFormat) {
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGB24\n");
return altivec_yuv2_rgb24;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGR24\n");
return altivec_yuv2_bgr24;
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ARGB:
av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ARGB\n");
return altivec_yuv2_argb;
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ABGR:
av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ABGR\n");
return altivec_yuv2_abgr;
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA:
av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGBA\n");
return altivec_yuv2_rgba;
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGRA:
av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGRA\n");
return altivec_yuv2_bgra;
default: return NULL;
}
break;
- case PIX_FMT_UYVY422:
+ case AV_PIX_FMT_UYVY422:
switch (c->dstFormat) {
- case PIX_FMT_BGR32:
+ case AV_PIX_FMT_BGR32:
av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space UYVY -> RGB32\n");
return altivec_uyvy_rgb32;
default: return NULL;
@@ -631,7 +631,7 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c,
const int16_t **alpSrc,
uint8_t *dest,
int dstW, int dstY,
- enum PixelFormat target)
+ enum AVPixelFormat target)
{
int i, j;
vector signed short X, X0, X1, Y0, U0, V0, Y1, U1, V1, U, V;
@@ -706,22 +706,22 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c,
B = vec_packclp(B0, B1);
switch (target) {
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ABGR:
out_abgr(R, G, B, out);
break;
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGRA:
out_bgra(R, G, B, out);
break;
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA:
out_rgba(R, G, B, out);
break;
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ARGB:
out_argb(R, G, B, out);
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
out_rgb24(R, G, B, out);
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
out_bgr24(R, G, B, out);
break;
default:
@@ -798,22 +798,22 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c,
nout = (vector unsigned char *) scratch;
switch (target) {
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ABGR:
out_abgr(R, G, B, nout);
break;
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGRA:
out_bgra(R, G, B, nout);
break;
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA:
out_rgba(R, G, B, nout);
break;
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ARGB:
out_argb(R, G, B, nout);
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
out_rgb24(R, G, B, nout);
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
out_bgr24(R, G, B, nout);
break;
default:
@@ -846,9 +846,9 @@ void ff_yuv2 ## suffix ## _X_altivec(SwsContext *c, \
dest, dstW, dstY, pixfmt); \
}
-YUV2PACKEDX_WRAPPER(abgr, PIX_FMT_ABGR);
-YUV2PACKEDX_WRAPPER(bgra, PIX_FMT_BGRA);
-YUV2PACKEDX_WRAPPER(argb, PIX_FMT_ARGB);
-YUV2PACKEDX_WRAPPER(rgba, PIX_FMT_RGBA);
-YUV2PACKEDX_WRAPPER(rgb24, PIX_FMT_RGB24);
-YUV2PACKEDX_WRAPPER(bgr24, PIX_FMT_BGR24);
+YUV2PACKEDX_WRAPPER(abgr, AV_PIX_FMT_ABGR);
+YUV2PACKEDX_WRAPPER(bgra, AV_PIX_FMT_BGRA);
+YUV2PACKEDX_WRAPPER(argb, AV_PIX_FMT_ARGB);
+YUV2PACKEDX_WRAPPER(rgba, AV_PIX_FMT_RGBA);
+YUV2PACKEDX_WRAPPER(rgb24, AV_PIX_FMT_RGB24);
+YUV2PACKEDX_WRAPPER(bgr24, AV_PIX_FMT_BGR24);
diff --git a/libswscale/ppc/yuv2yuv_altivec.c b/libswscale/ppc/yuv2yuv_altivec.c
index af78782b54..60d50a7baa 100644
--- a/libswscale/ppc/yuv2yuv_altivec.c
+++ b/libswscale/ppc/yuv2yuv_altivec.c
@@ -182,13 +182,13 @@ static int yv12touyvy_unscaled_altivec(SwsContext *c, const uint8_t *src[],
void ff_swscale_get_unscaled_altivec(SwsContext *c)
{
if ((av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) && !(c->srcW & 15) &&
- !(c->flags & SWS_BITEXACT) && c->srcFormat == PIX_FMT_YUV420P) {
- enum PixelFormat dstFormat = c->dstFormat;
+ !(c->flags & SWS_BITEXACT) && c->srcFormat == AV_PIX_FMT_YUV420P) {
+ enum AVPixelFormat dstFormat = c->dstFormat;
// unscaled YV12 -> packed YUV, we want speed
- if (dstFormat == PIX_FMT_YUYV422)
+ if (dstFormat == AV_PIX_FMT_YUYV422)
c->swScale = yv12toyuy2_unscaled_altivec;
- else if (dstFormat == PIX_FMT_UYVY422)
+ else if (dstFormat == AV_PIX_FMT_UYVY422)
c->swScale = yv12touyvy_unscaled_altivec;
}
}
diff --git a/libswscale/sparc/yuv2rgb_vis.c b/libswscale/sparc/yuv2rgb_vis.c
index bb9ab22dbe..ed008377ad 100644
--- a/libswscale/sparc/yuv2rgb_vis.c
+++ b/libswscale/sparc/yuv2rgb_vis.c
@@ -199,11 +199,11 @@ av_cold SwsFunc ff_yuv2rgb_init_vis(SwsContext *c)
c->sparc_coeffs[3] = (((int16_t)c->vOffset * (int16_t)c->vgCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
c->sparc_coeffs[4] = (((int16_t)c->vOffset * (int16_t)c->vrCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
- if (c->dstFormat == PIX_FMT_RGB32 && c->srcFormat == PIX_FMT_YUV422P && (c->dstW & 7) == 0) {
+ if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV422P && (c->dstW & 7) == 0) {
av_log(c, AV_LOG_INFO,
"SPARC VIS accelerated YUV422P -> RGB32 (WARNING: alpha value is wrong)\n");
return vis_422P_ARGB32;
- } else if (c->dstFormat == PIX_FMT_RGB32 && c->srcFormat == PIX_FMT_YUV420P && (c->dstW & 7) == 0) {
+ } else if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV420P && (c->dstW & 7) == 0) {
av_log(c, AV_LOG_INFO,
"SPARC VIS accelerated YUV420P -> RGB32 (WARNING: alpha value is wrong)\n");
return vis_420P_ARGB32;
diff --git a/libswscale/swscale-test.c b/libswscale/swscale-test.c
index ef6c55ce02..03a887fc35 100644
--- a/libswscale/swscale-test.c
+++ b/libswscale/swscale-test.c
@@ -36,20 +36,20 @@
/* HACK Duplicated from swscale_internal.h.
* Should be removed when a cleaner pixel format system exists. */
#define isGray(x) \
- ((x) == PIX_FMT_GRAY8 || \
- (x) == PIX_FMT_Y400A || \
- (x) == PIX_FMT_GRAY16BE || \
- (x) == PIX_FMT_GRAY16LE)
+ ((x) == AV_PIX_FMT_GRAY8 || \
+ (x) == AV_PIX_FMT_Y400A || \
+ (x) == AV_PIX_FMT_GRAY16BE || \
+ (x) == AV_PIX_FMT_GRAY16LE)
#define hasChroma(x) \
(!(isGray(x) || \
- (x) == PIX_FMT_MONOBLACK || \
- (x) == PIX_FMT_MONOWHITE))
+ (x) == AV_PIX_FMT_MONOBLACK || \
+ (x) == AV_PIX_FMT_MONOWHITE))
#define isALPHA(x) \
- ((x) == PIX_FMT_BGR32 || \
- (x) == PIX_FMT_BGR32_1 || \
- (x) == PIX_FMT_RGB32 || \
- (x) == PIX_FMT_RGB32_1 || \
- (x) == PIX_FMT_YUVA420P)
+ ((x) == AV_PIX_FMT_BGR32 || \
+ (x) == AV_PIX_FMT_BGR32_1 || \
+ (x) == AV_PIX_FMT_RGB32 || \
+ (x) == AV_PIX_FMT_RGB32_1 || \
+ (x) == AV_PIX_FMT_YUVA420P)
static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1,
int stride2, int w, int h)
@@ -77,11 +77,11 @@ struct Results {
// test by ref -> src -> dst -> out & compare out against ref
// ref & out are YV12
static int doTest(uint8_t *ref[4], int refStride[4], int w, int h,
- enum PixelFormat srcFormat, enum PixelFormat dstFormat,
+ enum AVPixelFormat srcFormat, enum AVPixelFormat dstFormat,
int srcW, int srcH, int dstW, int dstH, int flags,
struct Results *r)
{
- static enum PixelFormat cur_srcFormat;
+ static enum AVPixelFormat cur_srcFormat;
static int cur_srcW, cur_srcH;
static uint8_t *src[4];
static int srcStride[4];
@@ -112,11 +112,11 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h,
goto end;
}
}
- srcContext = sws_getContext(w, h, PIX_FMT_YUVA420P, srcW, srcH,
+ srcContext = sws_getContext(w, h, AV_PIX_FMT_YUVA420P, srcW, srcH,
srcFormat, SWS_BILINEAR, NULL, NULL, NULL);
if (!srcContext) {
fprintf(stderr, "Failed to get %s ---> %s\n",
- av_pix_fmt_descriptors[PIX_FMT_YUVA420P].name,
+ av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name,
av_pix_fmt_descriptors[srcFormat].name);
res = -1;
goto end;
@@ -187,12 +187,12 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h,
}
}
outContext = sws_getContext(dstW, dstH, dstFormat, w, h,
- PIX_FMT_YUVA420P, SWS_BILINEAR,
+ AV_PIX_FMT_YUVA420P, SWS_BILINEAR,
NULL, NULL, NULL);
if (!outContext) {
fprintf(stderr, "Failed to get %s ---> %s\n",
av_pix_fmt_descriptors[dstFormat].name,
- av_pix_fmt_descriptors[PIX_FMT_YUVA420P].name);
+ av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name);
res = -1;
goto end;
}
@@ -235,8 +235,8 @@ end:
}
static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h,
- enum PixelFormat srcFormat_in,
- enum PixelFormat dstFormat_in)
+ enum AVPixelFormat srcFormat_in,
+ enum AVPixelFormat dstFormat_in)
{
const int flags[] = { SWS_FAST_BILINEAR, SWS_BILINEAR, SWS_BICUBIC,
SWS_X, SWS_POINT, SWS_AREA, 0 };
@@ -244,16 +244,16 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h,
const int srcH = h;
const int dstW[] = { srcW - srcW / 3, srcW, srcW + srcW / 3, 0 };
const int dstH[] = { srcH - srcH / 3, srcH, srcH + srcH / 3, 0 };
- enum PixelFormat srcFormat, dstFormat;
+ enum AVPixelFormat srcFormat, dstFormat;
- for (srcFormat = srcFormat_in != PIX_FMT_NONE ? srcFormat_in : 0;
- srcFormat < PIX_FMT_NB; srcFormat++) {
+ for (srcFormat = srcFormat_in != AV_PIX_FMT_NONE ? srcFormat_in : 0;
+ srcFormat < AV_PIX_FMT_NB; srcFormat++) {
if (!sws_isSupportedInput(srcFormat) ||
!sws_isSupportedOutput(srcFormat))
continue;
- for (dstFormat = dstFormat_in != PIX_FMT_NONE ? dstFormat_in : 0;
- dstFormat < PIX_FMT_NB; dstFormat++) {
+ for (dstFormat = dstFormat_in != AV_PIX_FMT_NONE ? dstFormat_in : 0;
+ dstFormat < AV_PIX_FMT_NB; dstFormat++) {
int i, j, k;
int res = 0;
@@ -273,26 +273,26 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h,
srcFormat, dstFormat,
srcW, srcH, dstW[i], dstH[j], flags[k],
NULL);
- if (dstFormat_in != PIX_FMT_NONE)
+ if (dstFormat_in != AV_PIX_FMT_NONE)
break;
}
- if (srcFormat_in != PIX_FMT_NONE)
+ if (srcFormat_in != AV_PIX_FMT_NONE)
break;
}
}
static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp,
- enum PixelFormat srcFormat_in,
- enum PixelFormat dstFormat_in)
+ enum AVPixelFormat srcFormat_in,
+ enum AVPixelFormat dstFormat_in)
{
char buf[256];
while (fgets(buf, sizeof(buf), fp)) {
struct Results r;
- enum PixelFormat srcFormat;
+ enum AVPixelFormat srcFormat;
char srcStr[12];
int srcW, srcH;
- enum PixelFormat dstFormat;
+ enum AVPixelFormat dstFormat;
char dstStr[12];
int dstW, dstH;
int flags;
@@ -311,12 +311,12 @@ static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp,
srcFormat = av_get_pix_fmt(srcStr);
dstFormat = av_get_pix_fmt(dstStr);
- if (srcFormat == PIX_FMT_NONE || dstFormat == PIX_FMT_NONE) {
+ if (srcFormat == AV_PIX_FMT_NONE || dstFormat == AV_PIX_FMT_NONE) {
fprintf(stderr, "malformed input file\n");
return -1;
}
- if ((srcFormat_in != PIX_FMT_NONE && srcFormat_in != srcFormat) ||
- (dstFormat_in != PIX_FMT_NONE && dstFormat_in != dstFormat))
+ if ((srcFormat_in != AV_PIX_FMT_NONE && srcFormat_in != srcFormat) ||
+ (dstFormat_in != AV_PIX_FMT_NONE && dstFormat_in != dstFormat))
continue;
if (ret != 12) {
printf("%s", buf);
@@ -337,8 +337,8 @@ static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp,
int main(int argc, char **argv)
{
- enum PixelFormat srcFormat = PIX_FMT_NONE;
- enum PixelFormat dstFormat = PIX_FMT_NONE;
+ enum AVPixelFormat srcFormat = AV_PIX_FMT_NONE;
+ enum AVPixelFormat dstFormat = AV_PIX_FMT_NONE;
uint8_t *rgb_data = av_malloc(W * H * 4);
uint8_t *rgb_src[4] = { rgb_data, NULL, NULL, NULL };
int rgb_stride[4] = { 4 * W, 0, 0, 0 };
@@ -354,8 +354,8 @@ int main(int argc, char **argv)
if (!rgb_data || !data)
return -1;
- sws = sws_getContext(W / 12, H / 12, PIX_FMT_RGB32, W, H,
- PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL);
+ sws = sws_getContext(W / 12, H / 12, AV_PIX_FMT_RGB32, W, H,
+ AV_PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL);
av_lfg_init(&rand, 1);
@@ -380,13 +380,13 @@ int main(int argc, char **argv)
goto end;
} else if (!strcmp(argv[i], "-src")) {
srcFormat = av_get_pix_fmt(argv[i + 1]);
- if (srcFormat == PIX_FMT_NONE) {
+ if (srcFormat == AV_PIX_FMT_NONE) {
fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);
return -1;
}
} else if (!strcmp(argv[i], "-dst")) {
dstFormat = av_get_pix_fmt(argv[i + 1]);
- if (dstFormat == PIX_FMT_NONE) {
+ if (dstFormat == AV_PIX_FMT_NONE) {
fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);
return -1;
}
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 00a876195e..7c4324417d 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -72,7 +72,7 @@ static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW,
int bits = av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1;
int sh = bits - 4;
- if((isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15)
+ if((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15)
sh= 9;
for (i = 0; i < dstW; i++) {
@@ -97,7 +97,7 @@ static void hScale16To15_c(SwsContext *c, int16_t *dst, int dstW,
int sh = av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1;
if(sh<15)
- sh= isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1;
+ sh= isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1;
for (i = 0; i < dstW; i++) {
int j;
@@ -339,7 +339,7 @@ static int swScale(SwsContext *c, const uint8_t *src[],
const int chrSrcW = c->chrSrcW;
const int lumXInc = c->lumXInc;
const int chrXInc = c->chrXInc;
- const enum PixelFormat dstFormat = c->dstFormat;
+ const enum AVPixelFormat dstFormat = c->dstFormat;
const int flags = c->flags;
int32_t *vLumFilterPos = c->vLumFilterPos;
int32_t *vChrFilterPos = c->vChrFilterPos;
@@ -679,7 +679,7 @@ static int swScale(SwsContext *c, const uint8_t *src[],
static av_cold void sws_init_swScale_c(SwsContext *c)
{
- enum PixelFormat srcFormat = c->srcFormat;
+ enum AVPixelFormat srcFormat = c->srcFormat;
ff_sws_init_output_funcs(c, &c->yuv2plane1, &c->yuv2planeX,
&c->yuv2nv12cX, &c->yuv2packed1,
@@ -724,7 +724,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
}
if (!(isGray(srcFormat) || isGray(c->dstFormat) ||
- srcFormat == PIX_FMT_MONOBLACK || srcFormat == PIX_FMT_MONOWHITE))
+ srcFormat == AV_PIX_FMT_MONOBLACK || srcFormat == AV_PIX_FMT_MONOWHITE))
c->needs_hcscale = 1;
}
@@ -752,7 +752,7 @@ static void reset_ptr(const uint8_t *src[], int format)
}
}
-static int check_image_pointers(const uint8_t * const data[4], enum PixelFormat pix_fmt,
+static int check_image_pointers(const uint8_t * const data[4], enum AVPixelFormat pix_fmt,
const int linesizes[4])
{
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
@@ -806,28 +806,28 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
if (usePal(c->srcFormat)) {
for (i = 0; i < 256; i++) {
int p, r, g, b, y, u, v, a = 0xff;
- if (c->srcFormat == PIX_FMT_PAL8) {
+ if (c->srcFormat == AV_PIX_FMT_PAL8) {
p = ((const uint32_t *)(srcSlice[1]))[i];
a = (p >> 24) & 0xFF;
r = (p >> 16) & 0xFF;
g = (p >> 8) & 0xFF;
b = p & 0xFF;
- } else if (c->srcFormat == PIX_FMT_RGB8) {
+ } else if (c->srcFormat == AV_PIX_FMT_RGB8) {
r = ( i >> 5 ) * 36;
g = ((i >> 2) & 7) * 36;
b = ( i & 3) * 85;
- } else if (c->srcFormat == PIX_FMT_BGR8) {
+ } else if (c->srcFormat == AV_PIX_FMT_BGR8) {
b = ( i >> 6 ) * 85;
g = ((i >> 3) & 7) * 36;
r = ( i & 7) * 36;
- } else if (c->srcFormat == PIX_FMT_RGB4_BYTE) {
+ } else if (c->srcFormat == AV_PIX_FMT_RGB4_BYTE) {
r = ( i >> 3 ) * 255;
g = ((i >> 1) & 3) * 85;
b = ( i & 1) * 255;
- } else if (c->srcFormat == PIX_FMT_GRAY8 || c->srcFormat == PIX_FMT_GRAY8A) {
+ } else if (c->srcFormat == AV_PIX_FMT_GRAY8 || c->srcFormat == AV_PIX_FMT_GRAY8A) {
r = g = b = i;
} else {
- av_assert1(c->srcFormat == PIX_FMT_BGR4_BYTE);
+ av_assert1(c->srcFormat == AV_PIX_FMT_BGR4_BYTE);
b = ( i >> 3 ) * 255;
g = ((i >> 1) & 3) * 85;
r = ( i & 1) * 255;
@@ -849,27 +849,27 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
c->pal_yuv[i]= y + (u<<8) + (v<<16) + (a<<24);
switch (c->dstFormat) {
- case PIX_FMT_BGR32:
+ case AV_PIX_FMT_BGR32:
#if !HAVE_BIGENDIAN
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
#endif
c->pal_rgb[i]= r + (g<<8) + (b<<16) + (a<<24);
break;
- case PIX_FMT_BGR32_1:
+ case AV_PIX_FMT_BGR32_1:
#if HAVE_BIGENDIAN
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
#endif
c->pal_rgb[i]= a + (r<<8) + (g<<16) + (b<<24);
break;
- case PIX_FMT_RGB32_1:
+ case AV_PIX_FMT_RGB32_1:
#if HAVE_BIGENDIAN
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
#endif
c->pal_rgb[i]= a + (b<<8) + (g<<16) + (r<<24);
break;
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
#if !HAVE_BIGENDIAN
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
#endif
default:
c->pal_rgb[i]= b + (g<<8) + (r<<16) + (a<<24);
diff --git a/libswscale/swscale.h b/libswscale/swscale.h
index 71cb5d8108..ea2116c1fa 100644
--- a/libswscale/swscale.h
+++ b/libswscale/swscale.h
@@ -134,13 +134,13 @@ struct SwsContext;
* Return a positive value if pix_fmt is a supported input format, 0
* otherwise.
*/
-int sws_isSupportedInput(enum PixelFormat pix_fmt);
+int sws_isSupportedInput(enum AVPixelFormat pix_fmt);
/**
* Return a positive value if pix_fmt is a supported output format, 0
* otherwise.
*/
-int sws_isSupportedOutput(enum PixelFormat pix_fmt);
+int sws_isSupportedOutput(enum AVPixelFormat pix_fmt);
/**
* Allocate an empty SwsContext. This must be filled and passed to
@@ -180,8 +180,8 @@ void sws_freeContext(struct SwsContext *swsContext);
* written
* @deprecated Use sws_getCachedContext() instead.
*/
-struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
- int dstW, int dstH, enum PixelFormat dstFormat,
+struct 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);
#endif
@@ -307,8 +307,8 @@ void sws_freeFilter(SwsFilter *filter);
* are assumed to remain the same.
*/
struct SwsContext *sws_getCachedContext(struct SwsContext *context,
- int srcW, int srcH, enum PixelFormat srcFormat,
- int dstW, int dstH, enum PixelFormat dstFormat,
+ int srcW, int srcH, enum AVPixelFormat srcFormat,
+ int dstW, int dstH, enum AVPixelFormat dstFormat,
int flags, SwsFilter *srcFilter,
SwsFilter *dstFilter, const double *param);
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 21b37ceeb8..9a055b64c8 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -242,8 +242,8 @@ typedef struct SwsContext {
int chrDstH; ///< Height of destination chroma planes.
int lumXInc, chrXInc;
int lumYInc, chrYInc;
- enum PixelFormat dstFormat; ///< Destination pixel format.
- enum PixelFormat srcFormat; ///< Source pixel format.
+ enum AVPixelFormat dstFormat; ///< Destination pixel format.
+ enum AVPixelFormat srcFormat; ///< Source pixel format.
int dstFormatBpp; ///< Number of bits per pixel of the destination pixel format.
int srcFormatBpp; ///< Number of bits per pixel of the source pixel format.
int dstBpc, srcBpc;
@@ -552,7 +552,7 @@ void ff_bfin_get_unscaled_swscale(SwsContext *c);
* @deprecated Use av_get_pix_fmt_name() instead.
*/
attribute_deprecated
-const char *sws_format_name(enum PixelFormat format);
+const char *sws_format_name(enum AVPixelFormat format);
#endif
#define is16BPS(x) \
@@ -583,79 +583,79 @@ const char *sws_format_name(enum PixelFormat format);
av_pix_fmt_descriptors[x].nb_components <= 2)
#else
#define isGray(x) \
- ((x) == PIX_FMT_GRAY8 || \
- (x) == PIX_FMT_Y400A || \
- (x) == PIX_FMT_GRAY16BE || \
- (x) == PIX_FMT_GRAY16LE)
+ ((x) == AV_PIX_FMT_GRAY8 || \
+ (x) == AV_PIX_FMT_Y400A || \
+ (x) == AV_PIX_FMT_GRAY16BE || \
+ (x) == AV_PIX_FMT_GRAY16LE)
#endif
#define isRGBinInt(x) \
( \
- (x)==PIX_FMT_RGB48BE || \
- (x)==PIX_FMT_RGB48LE || \
- (x)==PIX_FMT_RGBA64BE || \
- (x)==PIX_FMT_RGBA64LE || \
- (x)==PIX_FMT_RGB32 || \
- (x)==PIX_FMT_RGB32_1 || \
- (x)==PIX_FMT_RGB24 || \
- (x)==PIX_FMT_RGB565BE || \
- (x)==PIX_FMT_RGB565LE || \
- (x)==PIX_FMT_RGB555BE || \
- (x)==PIX_FMT_RGB555LE || \
- (x)==PIX_FMT_RGB444BE || \
- (x)==PIX_FMT_RGB444LE || \
- (x)==PIX_FMT_RGB8 || \
- (x)==PIX_FMT_RGB4 || \
- (x)==PIX_FMT_RGB4_BYTE || \
- (x)==PIX_FMT_MONOBLACK || \
- (x)==PIX_FMT_MONOWHITE \
+ (x) == AV_PIX_FMT_RGB48BE || \
+ (x) == AV_PIX_FMT_RGB48LE || \
+ (x) == AV_PIX_FMT_RGBA64BE || \
+ (x) == AV_PIX_FMT_RGBA64LE || \
+ (x) == AV_PIX_FMT_RGB32 || \
+ (x) == AV_PIX_FMT_RGB32_1 || \
+ (x) == AV_PIX_FMT_RGB24 || \
+ (x) == AV_PIX_FMT_RGB565BE || \
+ (x) == AV_PIX_FMT_RGB565LE || \
+ (x) == AV_PIX_FMT_RGB555BE || \
+ (x) == AV_PIX_FMT_RGB555LE || \
+ (x) == AV_PIX_FMT_RGB444BE || \
+ (x) == AV_PIX_FMT_RGB444LE || \
+ (x) == AV_PIX_FMT_RGB8 || \
+ (x) == AV_PIX_FMT_RGB4 || \
+ (x) == AV_PIX_FMT_RGB4_BYTE || \
+ (x) == AV_PIX_FMT_MONOBLACK || \
+ (x) == AV_PIX_FMT_MONOWHITE \
)
#define isBGRinInt(x) \
( \
- (x)==PIX_FMT_BGR48BE || \
- (x)==PIX_FMT_BGR48LE || \
- (x)==PIX_FMT_BGRA64BE || \
- (x)==PIX_FMT_BGRA64LE || \
- (x)==PIX_FMT_BGR32 || \
- (x)==PIX_FMT_BGR32_1 || \
- (x)==PIX_FMT_BGR24 || \
- (x)==PIX_FMT_BGR565BE || \
- (x)==PIX_FMT_BGR565LE || \
- (x)==PIX_FMT_BGR555BE || \
- (x)==PIX_FMT_BGR555LE || \
- (x)==PIX_FMT_BGR444BE || \
- (x)==PIX_FMT_BGR444LE || \
- (x)==PIX_FMT_BGR8 || \
- (x)==PIX_FMT_BGR4 || \
- (x)==PIX_FMT_BGR4_BYTE|| \
- (x)==PIX_FMT_MONOBLACK|| \
- (x)==PIX_FMT_MONOWHITE \
+ (x) == AV_PIX_FMT_BGR48BE || \
+ (x) == AV_PIX_FMT_BGR48LE || \
+ (x) == AV_PIX_FMT_BGRA64BE || \
+ (x) == AV_PIX_FMT_BGRA64LE || \
+ (x) == AV_PIX_FMT_BGR32 || \
+ (x) == AV_PIX_FMT_BGR32_1 || \
+ (x) == AV_PIX_FMT_BGR24 || \
+ (x) == AV_PIX_FMT_BGR565BE || \
+ (x) == AV_PIX_FMT_BGR565LE || \
+ (x) == AV_PIX_FMT_BGR555BE || \
+ (x) == AV_PIX_FMT_BGR555LE || \
+ (x) == AV_PIX_FMT_BGR444BE || \
+ (x) == AV_PIX_FMT_BGR444LE || \
+ (x) == AV_PIX_FMT_BGR8 || \
+ (x) == AV_PIX_FMT_BGR4 || \
+ (x) == AV_PIX_FMT_BGR4_BYTE || \
+ (x) == AV_PIX_FMT_MONOBLACK || \
+ (x) == AV_PIX_FMT_MONOWHITE \
)
#define isRGBinBytes(x) ( \
- (x)==PIX_FMT_RGB48BE \
- || (x)==PIX_FMT_RGB48LE \
- || (x)==PIX_FMT_RGBA64BE \
- || (x)==PIX_FMT_RGBA64LE \
- || (x)==PIX_FMT_RGBA \
- || (x)==PIX_FMT_ARGB \
- || (x)==PIX_FMT_RGB24 \
+ (x) == AV_PIX_FMT_RGB48BE \
+ || (x) == AV_PIX_FMT_RGB48LE \
+ || (x) == AV_PIX_FMT_RGBA64BE \
+ || (x) == AV_PIX_FMT_RGBA64LE \
+ || (x) == AV_PIX_FMT_RGBA \
+ || (x) == AV_PIX_FMT_ARGB \
+ || (x) == AV_PIX_FMT_RGB24 \
)
#define isBGRinBytes(x) ( \
- (x)==PIX_FMT_BGR48BE \
- || (x)==PIX_FMT_BGR48LE \
- || (x)==PIX_FMT_BGRA64BE \
- || (x)==PIX_FMT_BGRA64LE \
- || (x)==PIX_FMT_BGRA \
- || (x)==PIX_FMT_ABGR \
- || (x)==PIX_FMT_BGR24 \
+ (x) == AV_PIX_FMT_BGR48BE \
+ || (x) == AV_PIX_FMT_BGR48LE \
+ || (x) == AV_PIX_FMT_BGRA64BE \
+ || (x) == AV_PIX_FMT_BGRA64LE \
+ || (x) == AV_PIX_FMT_BGRA \
+ || (x) == AV_PIX_FMT_ABGR \
+ || (x) == AV_PIX_FMT_BGR24 \
)
#define isAnyRGB(x) \
( \
isRGBinInt(x) || \
isBGRinInt(x) || \
- (x)==PIX_FMT_GBR24P \
+ (x)==AV_PIX_FMT_GBR24P \
)
#define isALPHA(x) \
@@ -664,10 +664,10 @@ const char *sws_format_name(enum PixelFormat format);
#if 1
#define isPacked(x) ( \
- (x)==PIX_FMT_PAL8 \
- || (x)==PIX_FMT_YUYV422 \
- || (x)==PIX_FMT_UYVY422 \
- || (x)==PIX_FMT_Y400A \
+ (x)==AV_PIX_FMT_PAL8 \
+ || (x)==AV_PIX_FMT_YUYV422 \
+ || (x)==AV_PIX_FMT_UYVY422 \
+ || (x)==AV_PIX_FMT_Y400A \
|| isRGBinInt(x) \
|| isBGRinInt(x) \
)
@@ -675,7 +675,7 @@ const char *sws_format_name(enum PixelFormat format);
#define isPacked(x) \
((av_pix_fmt_descriptors[x].nb_components >= 2 && \
!(av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR)) || \
- (x) == PIX_FMT_PAL8)
+ (x) == AV_PIX_FMT_PAL8)
#endif
#define isPlanar(x) \
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index de73287278..32a2d52c82 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -180,7 +180,7 @@ static int planarToNv12Wrapper(SwsContext *c, const uint8_t *src[],
copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
dstParam[0], dstStride[0]);
- if (c->dstFormat == PIX_FMT_NV12)
+ if (c->dstFormat == AV_PIX_FMT_NV12)
interleaveBytes(src[1], src[2], dst, c->srcW / 2, srcSliceH / 2,
srcStride[1], srcStride[2], dstStride[0]);
else
@@ -357,31 +357,31 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
int srcSliceY, int srcSliceH, uint8_t *dst[],
int dstStride[])
{
- const enum PixelFormat srcFormat = c->srcFormat;
- const enum PixelFormat dstFormat = c->dstFormat;
+ const enum AVPixelFormat srcFormat = c->srcFormat;
+ const enum AVPixelFormat dstFormat = c->dstFormat;
void (*conv)(const uint8_t *src, uint8_t *dst, int num_pixels,
const uint8_t *palette) = NULL;
int i;
uint8_t *dstPtr = dst[0] + dstStride[0] * srcSliceY;
const uint8_t *srcPtr = src[0];
- if (srcFormat == PIX_FMT_GRAY8A) {
+ if (srcFormat == AV_PIX_FMT_GRAY8A) {
switch (dstFormat) {
- case PIX_FMT_RGB32 : conv = gray8aToPacked32; break;
- case PIX_FMT_BGR32 : conv = gray8aToPacked32; break;
- case PIX_FMT_BGR32_1: conv = gray8aToPacked32_1; break;
- case PIX_FMT_RGB32_1: conv = gray8aToPacked32_1; break;
- case PIX_FMT_RGB24 : conv = gray8aToPacked24; break;
- case PIX_FMT_BGR24 : conv = gray8aToPacked24; break;
+ case AV_PIX_FMT_RGB32 : conv = gray8aToPacked32; break;
+ case AV_PIX_FMT_BGR32 : conv = gray8aToPacked32; break;
+ case AV_PIX_FMT_BGR32_1: conv = gray8aToPacked32_1; break;
+ case AV_PIX_FMT_RGB32_1: conv = gray8aToPacked32_1; break;
+ case AV_PIX_FMT_RGB24 : conv = gray8aToPacked24; break;
+ case AV_PIX_FMT_BGR24 : conv = gray8aToPacked24; break;
}
} else if (usePal(srcFormat)) {
switch (dstFormat) {
- case PIX_FMT_RGB32 : conv = sws_convertPalette8ToPacked32; break;
- case PIX_FMT_BGR32 : conv = sws_convertPalette8ToPacked32; break;
- case PIX_FMT_BGR32_1: conv = sws_convertPalette8ToPacked32; break;
- case PIX_FMT_RGB32_1: conv = sws_convertPalette8ToPacked32; break;
- case PIX_FMT_RGB24 : conv = sws_convertPalette8ToPacked24; break;
- case PIX_FMT_BGR24 : conv = sws_convertPalette8ToPacked24; break;
+ case AV_PIX_FMT_RGB32 : conv = sws_convertPalette8ToPacked32; break;
+ case AV_PIX_FMT_BGR32 : conv = sws_convertPalette8ToPacked32; break;
+ case AV_PIX_FMT_BGR32_1: conv = sws_convertPalette8ToPacked32; break;
+ case AV_PIX_FMT_RGB32_1: conv = sws_convertPalette8ToPacked32; break;
+ case AV_PIX_FMT_RGB24 : conv = sws_convertPalette8ToPacked24; break;
+ case AV_PIX_FMT_BGR24 : conv = sws_convertPalette8ToPacked24; break;
}
}
@@ -451,7 +451,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
uint8_t *dst[], int dstStride[])
{
int alpha_first = 0;
- if (c->srcFormat != PIX_FMT_GBRP) {
+ if (c->srcFormat != AV_PIX_FMT_GBRP) {
av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
av_get_pix_fmt_name(c->srcFormat),
av_get_pix_fmt_name(c->dstFormat));
@@ -459,32 +459,32 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
}
switch (c->dstFormat) {
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] },
(int []) { srcStride[1], srcStride[0], srcStride[2] },
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, c->srcW);
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] },
(int []) { srcStride[2], srcStride[0], srcStride[1] },
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, c->srcW);
break;
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ARGB:
alpha_first = 1;
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA:
gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] },
(int []) { srcStride[2], srcStride[0], srcStride[1] },
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, alpha_first, c->srcW);
break;
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ABGR:
alpha_first = 1;
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGRA:
gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] },
(int []) { srcStride[1], srcStride[0], srcStride[2] },
dst[0] + srcSliceY * dstStride[0], dstStride[0],
@@ -502,32 +502,32 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
}
#define isRGBA32(x) ( \
- (x) == PIX_FMT_ARGB \
- || (x) == PIX_FMT_RGBA \
- || (x) == PIX_FMT_BGRA \
- || (x) == PIX_FMT_ABGR \
+ (x) == AV_PIX_FMT_ARGB \
+ || (x) == AV_PIX_FMT_RGBA \
+ || (x) == AV_PIX_FMT_BGRA \
+ || (x) == AV_PIX_FMT_ABGR \
)
#define isRGBA64(x) ( \
- (x) == PIX_FMT_RGBA64LE \
- || (x) == PIX_FMT_RGBA64BE \
- || (x) == PIX_FMT_BGRA64LE \
- || (x) == PIX_FMT_BGRA64BE \
+ (x) == AV_PIX_FMT_RGBA64LE \
+ || (x) == AV_PIX_FMT_RGBA64BE \
+ || (x) == AV_PIX_FMT_BGRA64LE \
+ || (x) == AV_PIX_FMT_BGRA64BE \
)
#define isRGB48(x) ( \
- (x) == PIX_FMT_RGB48LE \
- || (x) == PIX_FMT_RGB48BE \
- || (x) == PIX_FMT_BGR48LE \
- || (x) == PIX_FMT_BGR48BE \
+ (x) == AV_PIX_FMT_RGB48LE \
+ || (x) == AV_PIX_FMT_RGB48BE \
+ || (x) == AV_PIX_FMT_BGR48LE \
+ || (x) == AV_PIX_FMT_BGR48BE \
)
/* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
typedef void (* rgbConvFn) (const uint8_t *, uint8_t *, int);
static rgbConvFn findRgbConvFn(SwsContext *c)
{
- const enum PixelFormat srcFormat = c->srcFormat;
- const enum PixelFormat dstFormat = c->dstFormat;
+ const enum AVPixelFormat srcFormat = c->srcFormat;
+ const enum AVPixelFormat dstFormat = c->dstFormat;
const int srcId = c->srcFormatBpp;
const int dstId = c->dstFormatBpp;
rgbConvFn conv = NULL;
@@ -536,7 +536,7 @@ static rgbConvFn findRgbConvFn(SwsContext *c)
(((bpp + 7) >> 3) == 2 && \
(!(av_pix_fmt_descriptors[fmt].flags & PIX_FMT_BE) != !HAVE_BIGENDIAN))
-#define CONV_IS(src, dst) (srcFormat == PIX_FMT_##src && dstFormat == PIX_FMT_##dst)
+#define CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst)
if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) {
if ( CONV_IS(ABGR, RGBA)
@@ -627,8 +627,8 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
int dstStride[])
{
- const enum PixelFormat srcFormat = c->srcFormat;
- const enum PixelFormat dstFormat = c->dstFormat;
+ const enum AVPixelFormat srcFormat = c->srcFormat;
+ const enum AVPixelFormat dstFormat = c->dstFormat;
const int srcBpp = (c->srcFormatBpp + 7) >> 3;
const int dstBpp = (c->dstFormatBpp + 7) >> 3;
rgbConvFn conv = findRgbConvFn(c);
@@ -642,11 +642,11 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
int src_bswap = IS_NOT_NE(c->srcFormatBpp, srcFormat);
int dst_bswap = IS_NOT_NE(c->dstFormatBpp, dstFormat);
- if ((srcFormat == PIX_FMT_RGB32_1 || srcFormat == PIX_FMT_BGR32_1) &&
+ if ((srcFormat == AV_PIX_FMT_RGB32_1 || srcFormat == AV_PIX_FMT_BGR32_1) &&
!isRGBA32(dstFormat))
srcPtr += ALT32_CORR;
- if ((dstFormat == PIX_FMT_RGB32_1 || dstFormat == PIX_FMT_BGR32_1) &&
+ if ((dstFormat == AV_PIX_FMT_RGB32_1 || dstFormat == AV_PIX_FMT_BGR32_1) &&
!isRGBA32(srcFormat))
dstPtr += ALT32_CORR;
@@ -926,8 +926,8 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
void ff_get_unscaled_swscale(SwsContext *c)
{
- const enum PixelFormat srcFormat = c->srcFormat;
- const enum PixelFormat dstFormat = c->dstFormat;
+ const enum AVPixelFormat srcFormat = c->srcFormat;
+ const enum AVPixelFormat dstFormat = c->dstFormat;
const int flags = c->flags;
const int dstH = c->dstH;
int needsDither;
@@ -937,26 +937,26 @@ void ff_get_unscaled_swscale(SwsContext *c)
(c->dstFormatBpp < c->srcFormatBpp || (!isAnyRGB(srcFormat)));
/* yv12_to_nv12 */
- if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) &&
- (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) {
+ if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) &&
+ (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) {
c->swScale = planarToNv12Wrapper;
}
/* yuv2bgr */
- if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUV422P ||
- srcFormat == PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) &&
+ if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P ||
+ srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) &&
!(flags & SWS_ACCURATE_RND) && !(dstH & 1)) {
c->swScale = ff_yuv2rgb_get_func_ptr(c);
}
- if (srcFormat == PIX_FMT_YUV410P &&
- (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P) &&
+ if (srcFormat == AV_PIX_FMT_YUV410P &&
+ (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
!(flags & SWS_BITEXACT)) {
c->swScale = yvu9ToYv12Wrapper;
}
/* bgr24toYV12 */
- if (srcFormat == PIX_FMT_BGR24 &&
- (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P) &&
+ if (srcFormat == AV_PIX_FMT_BGR24 &&
+ (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
!(flags & SWS_ACCURATE_RND))
c->swScale = bgr24ToYv12Wrapper;
@@ -966,74 +966,74 @@ void ff_get_unscaled_swscale(SwsContext *c)
c->swScale= rgbToRgbWrapper;
#define isByteRGB(f) (\
- f == PIX_FMT_RGB32 ||\
- f == PIX_FMT_RGB32_1 ||\
- f == PIX_FMT_RGB24 ||\
- f == PIX_FMT_BGR32 ||\
- f == PIX_FMT_BGR32_1 ||\
- f == PIX_FMT_BGR24)
+ f == AV_PIX_FMT_RGB32 ||\
+ f == AV_PIX_FMT_RGB32_1 ||\
+ f == AV_PIX_FMT_RGB24 ||\
+ f == AV_PIX_FMT_BGR32 ||\
+ f == AV_PIX_FMT_BGR32_1 ||\
+ f == AV_PIX_FMT_BGR24)
if (isAnyRGB(srcFormat) && isPlanar(srcFormat) && isByteRGB(dstFormat))
c->swScale = planarRgbToRgbWrapper;
/* bswap 16 bits per pixel/component packed formats */
- if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR444) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR48) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGRA64) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR555) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR565) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_GRAY16) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB444) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB48) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGBA64) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB555) ||
- IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB565))
+ if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR48) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGRA64) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR555) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR565) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY16) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB444) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB48) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGBA64) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB555) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB565))
c->swScale = packed_16bpc_bswap;
if (usePal(srcFormat) && isByteRGB(dstFormat))
c->swScale = palToRgbWrapper;
- if (srcFormat == PIX_FMT_YUV422P) {
- if (dstFormat == PIX_FMT_YUYV422)
+ if (srcFormat == AV_PIX_FMT_YUV422P) {
+ if (dstFormat == AV_PIX_FMT_YUYV422)
c->swScale = yuv422pToYuy2Wrapper;
- else if (dstFormat == PIX_FMT_UYVY422)
+ else if (dstFormat == AV_PIX_FMT_UYVY422)
c->swScale = yuv422pToUyvyWrapper;
}
/* LQ converters if -sws 0 or -sws 4*/
if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)) {
/* yv12_to_yuy2 */
- if (srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) {
- if (dstFormat == PIX_FMT_YUYV422)
+ if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) {
+ if (dstFormat == AV_PIX_FMT_YUYV422)
c->swScale = planarToYuy2Wrapper;
- else if (dstFormat == PIX_FMT_UYVY422)
+ else if (dstFormat == AV_PIX_FMT_UYVY422)
c->swScale = planarToUyvyWrapper;
}
}
- if (srcFormat == PIX_FMT_YUYV422 &&
- (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P))
+ if (srcFormat == AV_PIX_FMT_YUYV422 &&
+ (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P))
c->swScale = yuyvToYuv420Wrapper;
- if (srcFormat == PIX_FMT_UYVY422 &&
- (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P))
+ if (srcFormat == AV_PIX_FMT_UYVY422 &&
+ (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P))
c->swScale = uyvyToYuv420Wrapper;
- if (srcFormat == PIX_FMT_YUYV422 && dstFormat == PIX_FMT_YUV422P)
+ if (srcFormat == AV_PIX_FMT_YUYV422 && dstFormat == AV_PIX_FMT_YUV422P)
c->swScale = yuyvToYuv422Wrapper;
- if (srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P)
+ if (srcFormat == AV_PIX_FMT_UYVY422 && dstFormat == AV_PIX_FMT_YUV422P)
c->swScale = uyvyToYuv422Wrapper;
-#define isPlanarGray(x) (isGray(x) && (x) != PIX_FMT_GRAY8A)
+#define isPlanarGray(x) (isGray(x) && (x) != AV_PIX_FMT_GRAY8A)
/* simple copy */
if ( srcFormat == dstFormat ||
- (srcFormat == PIX_FMT_YUVA420P && dstFormat == PIX_FMT_YUV420P) ||
- (srcFormat == PIX_FMT_YUV420P && dstFormat == PIX_FMT_YUVA420P) ||
+ (srcFormat == AV_PIX_FMT_YUVA420P && dstFormat == AV_PIX_FMT_YUV420P) ||
+ (srcFormat == AV_PIX_FMT_YUV420P && dstFormat == AV_PIX_FMT_YUVA420P) ||
(isPlanarYUV(srcFormat) && isPlanarGray(dstFormat)) ||
(isPlanarYUV(dstFormat) && isPlanarGray(srcFormat)) ||
(isPlanarGray(dstFormat) && isPlanarGray(srcFormat)) ||
(isPlanarYUV(srcFormat) && isPlanarYUV(dstFormat) &&
c->chrDstHSubSample == c->chrSrcHSubSample &&
c->chrDstVSubSample == c->chrSrcVSubSample &&
- dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 &&
- srcFormat != PIX_FMT_NV12 && srcFormat != PIX_FMT_NV21))
+ dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
+ srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21))
{
if (isPacked(c->srcFormat))
c->swScale = packedCopyWrapper;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 4b14c737af..9c839d8dde 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -75,127 +75,127 @@ 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_0RGB] = { 1, 1 },
- [PIX_FMT_RGB0] = { 1, 1 },
- [PIX_FMT_0BGR] = { 1, 1 },
- [PIX_FMT_BGR0] = { 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_YUVA422P] = { 1, 1 },
- [PIX_FMT_YUVA444P] = { 1, 1 },
- [PIX_FMT_RGB48BE] = { 1, 1 },
- [PIX_FMT_RGB48LE] = { 1, 1 },
- [PIX_FMT_RGBA64BE] = { 1, 0 },
- [PIX_FMT_RGBA64LE] = { 1, 0 },
- [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_BGRA64BE] = { 0, 0 },
- [PIX_FMT_BGRA64LE] = { 0, 0 },
- [PIX_FMT_YUV420P9BE] = { 1, 1 },
- [PIX_FMT_YUV420P9LE] = { 1, 1 },
- [PIX_FMT_YUV420P10BE] = { 1, 1 },
- [PIX_FMT_YUV420P10LE] = { 1, 1 },
- [PIX_FMT_YUV420P12BE] = { 1, 1 },
- [PIX_FMT_YUV420P12LE] = { 1, 1 },
- [PIX_FMT_YUV420P14BE] = { 1, 1 },
- [PIX_FMT_YUV420P14LE] = { 1, 1 },
- [PIX_FMT_YUV422P9BE] = { 1, 1 },
- [PIX_FMT_YUV422P9LE] = { 1, 1 },
- [PIX_FMT_YUV422P10BE] = { 1, 1 },
- [PIX_FMT_YUV422P10LE] = { 1, 1 },
- [PIX_FMT_YUV422P12BE] = { 1, 1 },
- [PIX_FMT_YUV422P12LE] = { 1, 1 },
- [PIX_FMT_YUV422P14BE] = { 1, 1 },
- [PIX_FMT_YUV422P14LE] = { 1, 1 },
- [PIX_FMT_YUV444P9BE] = { 1, 1 },
- [PIX_FMT_YUV444P9LE] = { 1, 1 },
- [PIX_FMT_YUV444P10BE] = { 1, 1 },
- [PIX_FMT_YUV444P10LE] = { 1, 1 },
- [PIX_FMT_YUV444P12BE] = { 1, 1 },
- [PIX_FMT_YUV444P12LE] = { 1, 1 },
- [PIX_FMT_YUV444P14BE] = { 1, 1 },
- [PIX_FMT_YUV444P14LE] = { 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_GBRP12LE] = { 1, 0 },
- [PIX_FMT_GBRP12BE] = { 1, 0 },
- [PIX_FMT_GBRP14LE] = { 1, 0 },
- [PIX_FMT_GBRP14BE] = { 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_0RGB] = { 1, 1 },
+ [AV_PIX_FMT_RGB0] = { 1, 1 },
+ [AV_PIX_FMT_0BGR] = { 1, 1 },
+ [AV_PIX_FMT_BGR0] = { 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_YUVA422P] = { 1, 1 },
+ [AV_PIX_FMT_YUVA444P] = { 1, 1 },
+ [AV_PIX_FMT_RGB48BE] = { 1, 1 },
+ [AV_PIX_FMT_RGB48LE] = { 1, 1 },
+ [AV_PIX_FMT_RGBA64BE] = { 1, 0 },
+ [AV_PIX_FMT_RGBA64LE] = { 1, 0 },
+ [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_BGRA64BE] = { 0, 0 },
+ [AV_PIX_FMT_BGRA64LE] = { 0, 0 },
+ [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_YUV420P12BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P12LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P14BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P14LE] = { 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_YUV422P12BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P12LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P14BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV422P14LE] = { 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_YUV444P12BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P12LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P14BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P14LE] = { 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_GBRP12LE] = { 1, 0 },
+ [AV_PIX_FMT_GBRP12BE] = { 1, 0 },
+ [AV_PIX_FMT_GBRP14LE] = { 1, 0 },
+ [AV_PIX_FMT_GBRP14BE] = { 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];
#if FF_API_SWS_FORMAT_NAME
-const char *sws_format_name(enum PixelFormat format)
+const char *sws_format_name(enum AVPixelFormat format)
{
return av_get_pix_fmt_name(format);
}
@@ -765,7 +765,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;
@@ -817,33 +817,33 @@ 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;
}
}
-static int handle_0alpha(enum PixelFormat *format)
+static int handle_0alpha(enum AVPixelFormat *format)
{
switch (*format) {
- case PIX_FMT_0BGR : *format = PIX_FMT_ABGR ; return 1;
- case PIX_FMT_BGR0 : *format = PIX_FMT_BGRA ; return 4;
- case PIX_FMT_0RGB : *format = PIX_FMT_ARGB ; return 1;
- case PIX_FMT_RGB0 : *format = PIX_FMT_RGBA ; return 4;
+ case AV_PIX_FMT_0BGR : *format = AV_PIX_FMT_ABGR ; return 1;
+ case AV_PIX_FMT_BGR0 : *format = AV_PIX_FMT_BGRA ; return 4;
+ case AV_PIX_FMT_0RGB : *format = AV_PIX_FMT_ARGB ; return 1;
+ case AV_PIX_FMT_RGB0 : *format = AV_PIX_FMT_RGBA ; return 4;
default: return 0;
}
}
@@ -871,8 +871,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
int dstH = c->dstH;
int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 66, 16);
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;
@@ -963,12 +963,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_WARNING,
"full chroma interpolation for destination format '%s' not yet implemented\n",
av_get_pix_fmt_name(dstFormat));
@@ -986,9 +986,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;
@@ -1021,7 +1021,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
c->dstBpc = 1 + av_pix_fmt_descriptors[dstFormat].comp[0].depth_minus1;
if (c->dstBpc < 8)
c->dstBpc = 8;
- if (isAnyRGB(srcFormat) || srcFormat == PIX_FMT_PAL8)
+ if (isAnyRGB(srcFormat) || srcFormat == AV_PIX_FMT_PAL8)
c->srcBpc = 16;
if (c->dstBpc == 16)
dst_stride <<= 1;
@@ -1264,9 +1264,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
av_log(c, AV_LOG_INFO, "from %s to %s%s ",
av_get_pix_fmt_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
"",
@@ -1301,8 +1301,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)
{
@@ -1714,9 +1714,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)
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index de59a2b3e0..e6a0123eb9 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -113,7 +113,7 @@ void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufI
const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input
c->blueDither= ff_dither8[dstY&1];
- if (c->dstFormat == PIX_FMT_RGB555 || c->dstFormat == PIX_FMT_BGR555)
+ if (c->dstFormat == AV_PIX_FMT_RGB555 || c->dstFormat == AV_PIX_FMT_BGR555)
c->greenDither= ff_dither8[dstY&1];
else
c->greenDither= ff_dither4[dstY&1];
@@ -402,7 +402,7 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c)
} else if (c->srcBpc == 12) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \
ff_hscale12to19_ ## filtersize ## _ ## opt1; \
- } else if (c->srcBpc == 14 || ((c->srcFormat==PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15)) { \
+ } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15)) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \
ff_hscale14to19_ ## filtersize ## _ ## opt1; \
} else { /* c->srcBpc == 16 */ \
@@ -433,7 +433,7 @@ switch(c->dstBpc){ \
default: av_assert0(c->dstBpc>8); \
}
#define case_rgb(x, X, opt) \
- case PIX_FMT_ ## X: \
+ case AV_PIX_FMT_ ## X: \
c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \
if (!c->chrSrcHSubSample) \
c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \
@@ -445,23 +445,23 @@ switch(c->dstBpc){ \
ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMXEXT);
switch (c->srcFormat) {
- case PIX_FMT_Y400A:
+ case AV_PIX_FMT_Y400A:
c->lumToYV12 = ff_yuyvToY_mmx;
if (c->alpPixBuf)
c->alpToYV12 = ff_uyvyToY_mmx;
break;
- case PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YUYV422:
c->lumToYV12 = ff_yuyvToY_mmx;
c->chrToYV12 = ff_yuyvToUV_mmx;
break;
- case PIX_FMT_UYVY422:
+ case AV_PIX_FMT_UYVY422:
c->lumToYV12 = ff_uyvyToY_mmx;
c->chrToYV12 = ff_uyvyToUV_mmx;
break;
- case PIX_FMT_NV12:
+ case AV_PIX_FMT_NV12:
c->chrToYV12 = ff_nv12ToUV_mmx;
break;
- case PIX_FMT_NV21:
+ case AV_PIX_FMT_NV21:
c->chrToYV12 = ff_nv21ToUV_mmx;
break;
case_rgb(rgb24, RGB24, mmx);
@@ -494,23 +494,23 @@ switch(c->dstBpc){ \
ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2, sse2, 1);
switch (c->srcFormat) {
- case PIX_FMT_Y400A:
+ case AV_PIX_FMT_Y400A:
c->lumToYV12 = ff_yuyvToY_sse2;
if (c->alpPixBuf)
c->alpToYV12 = ff_uyvyToY_sse2;
break;
- case PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YUYV422:
c->lumToYV12 = ff_yuyvToY_sse2;
c->chrToYV12 = ff_yuyvToUV_sse2;
break;
- case PIX_FMT_UYVY422:
+ case AV_PIX_FMT_UYVY422:
c->lumToYV12 = ff_uyvyToY_sse2;
c->chrToYV12 = ff_uyvyToUV_sse2;
break;
- case PIX_FMT_NV12:
+ case AV_PIX_FMT_NV12:
c->chrToYV12 = ff_nv12ToUV_sse2;
break;
- case PIX_FMT_NV21:
+ case AV_PIX_FMT_NV21:
c->chrToYV12 = ff_nv21ToUV_sse2;
break;
case_rgb(rgb24, RGB24, sse2);
@@ -550,16 +550,16 @@ switch(c->dstBpc){ \
ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx, avx, 1);
switch (c->srcFormat) {
- case PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YUYV422:
c->chrToYV12 = ff_yuyvToUV_avx;
break;
- case PIX_FMT_UYVY422:
+ case AV_PIX_FMT_UYVY422:
c->chrToYV12 = ff_uyvyToUV_avx;
break;
- case PIX_FMT_NV12:
+ case AV_PIX_FMT_NV12:
c->chrToYV12 = ff_nv12ToUV_avx;
break;
- case PIX_FMT_NV21:
+ case AV_PIX_FMT_NV21:
c->chrToYV12 = ff_nv21ToUV_avx;
break;
case_rgb(rgb24, RGB24, avx);
diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
index 370a0ebe1b..a09de1892a 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -1631,19 +1631,19 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
{
- enum PixelFormat dstFormat = c->dstFormat;
+ enum AVPixelFormat dstFormat = c->dstFormat;
c->use_mmx_vfilter= 0;
- if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && dstFormat != PIX_FMT_NV12
- && dstFormat != PIX_FMT_NV21 && !(c->flags & SWS_BITEXACT)) {
+ if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && dstFormat != AV_PIX_FMT_NV12
+ && dstFormat != AV_PIX_FMT_NV21 && !(c->flags & SWS_BITEXACT)) {
if (c->flags & SWS_ACCURATE_RND) {
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
- case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;
- case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;
- case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;
- case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;
- case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
+ case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;
+ case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;
+ case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;
+ case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;
+ case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
default: break;
}
}
@@ -1652,34 +1652,34 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
c->yuv2planeX = RENAME(yuv2yuvX );
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
- case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
- case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
- case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;
- case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;
- case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
+ case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
+ case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
+ case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;
+ case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;
+ case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
default: break;
}
}
}
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
c->yuv2packed1 = RENAME(yuv2rgb32_1);
c->yuv2packed2 = RENAME(yuv2rgb32_2);
break;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
c->yuv2packed1 = RENAME(yuv2bgr24_1);
c->yuv2packed2 = RENAME(yuv2bgr24_2);
break;
- case PIX_FMT_RGB555:
+ case AV_PIX_FMT_RGB555:
c->yuv2packed1 = RENAME(yuv2rgb555_1);
c->yuv2packed2 = RENAME(yuv2rgb555_2);
break;
- case PIX_FMT_RGB565:
+ case AV_PIX_FMT_RGB565:
c->yuv2packed1 = RENAME(yuv2rgb565_1);
c->yuv2packed2 = RENAME(yuv2rgb565_2);
break;
- case PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YUYV422:
c->yuv2packed1 = RENAME(yuv2yuyv422_1);
c->yuv2packed2 = RENAME(yuv2yuyv422_2);
break;
diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c
index 9a9220ddba..4d8e79d8d4 100644
--- a/libswscale/x86/yuv2rgb.c
+++ b/libswscale/x86/yuv2rgb.c
@@ -77,32 +77,32 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
#if HAVE_MMXEXT_INLINE
if (cpu_flags & AV_CPU_FLAG_MMXEXT) {
switch (c->dstFormat) {
- case PIX_FMT_RGB24: return yuv420_rgb24_MMX2;
- case PIX_FMT_BGR24: return yuv420_bgr24_MMX2;
+ case AV_PIX_FMT_RGB24: return yuv420_rgb24_MMX2;
+ case AV_PIX_FMT_BGR24: return yuv420_bgr24_MMX2;
}
}
#endif
if (cpu_flags & AV_CPU_FLAG_MMX) {
switch (c->dstFormat) {
- case PIX_FMT_RGB32:
- if (c->srcFormat == PIX_FMT_YUVA420P) {
+ case AV_PIX_FMT_RGB32:
+ if (c->srcFormat == AV_PIX_FMT_YUVA420P) {
#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
return yuva420_rgb32_MMX;
#endif
break;
} else return yuv420_rgb32_MMX;
- case PIX_FMT_BGR32:
- if (c->srcFormat == PIX_FMT_YUVA420P) {
+ case AV_PIX_FMT_BGR32:
+ if (c->srcFormat == AV_PIX_FMT_YUVA420P) {
#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
return yuva420_bgr32_MMX;
#endif
break;
} else return yuv420_bgr32_MMX;
- case PIX_FMT_RGB24: return yuv420_rgb24_MMX;
- case PIX_FMT_BGR24: return yuv420_bgr24_MMX;
- case PIX_FMT_RGB565: return yuv420_rgb16_MMX;
- case PIX_FMT_RGB555: return yuv420_rgb15_MMX;
+ case AV_PIX_FMT_RGB24: return yuv420_rgb24_MMX;
+ case AV_PIX_FMT_BGR24: return yuv420_bgr24_MMX;
+ case AV_PIX_FMT_RGB565: return yuv420_rgb16_MMX;
+ case AV_PIX_FMT_RGB555: return yuv420_rgb15_MMX;
}
}
#endif /* HAVE_INLINE_ASM */
diff --git a/libswscale/x86/yuv2rgb_template.c b/libswscale/x86/yuv2rgb_template.c
index 79e48fd7f0..c879102cc4 100644
--- a/libswscale/x86/yuv2rgb_template.c
+++ b/libswscale/x86/yuv2rgb_template.c
@@ -43,7 +43,7 @@
if (h_size * depth > FFABS(dstStride[0])) \
h_size -= 8; \
\
- vshift = c->srcFormat != PIX_FMT_YUV422P; \
+ vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \
\
__asm__ volatile ("pxor %mm4, %mm4\n\t"); \
for (y = 0; y < srcSliceH; y++) { \
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 073fa665cf..8af3e9037e 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -126,7 +126,7 @@ const int *sws_getCoefficients(int colorspace)
{ \
int y; \
\
- if (!alpha && c->srcFormat == PIX_FMT_YUV422P) { \
+ if (!alpha && c->srcFormat == AV_PIX_FMT_YUV422P) { \
srcStride[1] *= 2; \
srcStride[2] *= 2; \
} \
@@ -625,42 +625,42 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));
switch (c->dstFormat) {
- case PIX_FMT_BGR48BE:
- case PIX_FMT_BGR48LE:
+ case AV_PIX_FMT_BGR48BE:
+ case AV_PIX_FMT_BGR48LE:
return yuv2rgb_c_bgr48;
- case PIX_FMT_RGB48BE:
- case PIX_FMT_RGB48LE:
+ case AV_PIX_FMT_RGB48BE:
+ case AV_PIX_FMT_RGB48LE:
return yuv2rgb_c_48;
- case PIX_FMT_ARGB:
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ARGB:
+ case AV_PIX_FMT_ABGR:
if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat))
return yuva2argb_c;
- case PIX_FMT_RGBA:
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_RGBA:
+ case AV_PIX_FMT_BGRA:
return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva2rgba_c : yuv2rgb_c_32;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
return yuv2rgb_c_24_rgb;
- case PIX_FMT_BGR24:
+ case AV_PIX_FMT_BGR24:
return yuv2rgb_c_24_bgr;
- case PIX_FMT_RGB565:
- case PIX_FMT_BGR565:
+ case AV_PIX_FMT_RGB565:
+ case AV_PIX_FMT_BGR565:
return yuv2rgb_c_16_ordered_dither;
- case PIX_FMT_RGB555:
- case PIX_FMT_BGR555:
+ case AV_PIX_FMT_RGB555:
+ case AV_PIX_FMT_BGR555:
return yuv2rgb_c_15_ordered_dither;
- case PIX_FMT_RGB444:
- case PIX_FMT_BGR444:
+ case AV_PIX_FMT_RGB444:
+ case AV_PIX_FMT_BGR444:
return yuv2rgb_c_12_ordered_dither;
- case PIX_FMT_RGB8:
- case PIX_FMT_BGR8:
+ case AV_PIX_FMT_RGB8:
+ case AV_PIX_FMT_BGR8:
return yuv2rgb_c_8_ordered_dither;
- case PIX_FMT_RGB4:
- case PIX_FMT_BGR4:
+ case AV_PIX_FMT_RGB4:
+ case AV_PIX_FMT_BGR4:
return yuv2rgb_c_4_ordered_dither;
- case PIX_FMT_RGB4_BYTE:
- case PIX_FMT_BGR4_BYTE:
+ case AV_PIX_FMT_RGB4_BYTE:
+ case AV_PIX_FMT_BGR4_BYTE:
return yuv2rgb_c_4b_ordered_dither;
- case PIX_FMT_MONOBLACK:
+ case AV_PIX_FMT_MONOBLACK:
return yuv2rgb_c_1_ordered_dither;
}
return NULL;
@@ -707,25 +707,25 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
int fullRange, int brightness,
int contrast, int saturation)
{
- const int isRgb = c->dstFormat == PIX_FMT_RGB32 ||
- c->dstFormat == PIX_FMT_RGB32_1 ||
- c->dstFormat == PIX_FMT_BGR24 ||
- c->dstFormat == PIX_FMT_RGB565BE ||
- c->dstFormat == PIX_FMT_RGB565LE ||
- c->dstFormat == PIX_FMT_RGB555BE ||
- c->dstFormat == PIX_FMT_RGB555LE ||
- c->dstFormat == PIX_FMT_RGB444BE ||
- c->dstFormat == PIX_FMT_RGB444LE ||
- c->dstFormat == PIX_FMT_RGB8 ||
- c->dstFormat == PIX_FMT_RGB4 ||
- c->dstFormat == PIX_FMT_RGB4_BYTE ||
- c->dstFormat == PIX_FMT_MONOBLACK;
- const int isNotNe = c->dstFormat == PIX_FMT_NE(RGB565LE, RGB565BE) ||
- c->dstFormat == PIX_FMT_NE(RGB555LE, RGB555BE) ||
- c->dstFormat == PIX_FMT_NE(RGB444LE, RGB444BE) ||
- c->dstFormat == PIX_FMT_NE(BGR565LE, BGR565BE) ||
- c->dstFormat == PIX_FMT_NE(BGR555LE, BGR555BE) ||
- c->dstFormat == PIX_FMT_NE(BGR444LE, BGR444BE);
+ const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32 ||
+ c->dstFormat == AV_PIX_FMT_RGB32_1 ||
+ c->dstFormat == AV_PIX_FMT_BGR24 ||
+ c->dstFormat == AV_PIX_FMT_RGB565BE ||
+ c->dstFormat == AV_PIX_FMT_RGB565LE ||
+ c->dstFormat == AV_PIX_FMT_RGB555BE ||
+ c->dstFormat == AV_PIX_FMT_RGB555LE ||
+ c->dstFormat == AV_PIX_FMT_RGB444BE ||
+ c->dstFormat == AV_PIX_FMT_RGB444LE ||
+ c->dstFormat == AV_PIX_FMT_RGB8 ||
+ c->dstFormat == AV_PIX_FMT_RGB4 ||
+ c->dstFormat == AV_PIX_FMT_RGB4_BYTE ||
+ c->dstFormat == AV_PIX_FMT_MONOBLACK;
+ const int isNotNe = c->dstFormat == AV_PIX_FMT_NE(RGB565LE, RGB565BE) ||
+ c->dstFormat == AV_PIX_FMT_NE(RGB555LE, RGB555BE) ||
+ c->dstFormat == AV_PIX_FMT_NE(RGB444LE, RGB444BE) ||
+ c->dstFormat == AV_PIX_FMT_NE(BGR565LE, BGR565BE) ||
+ c->dstFormat == AV_PIX_FMT_NE(BGR555LE, BGR555BE) ||
+ c->dstFormat == AV_PIX_FMT_NE(BGR444LE, BGR444BE);
const int bpp = c->dstFormatBpp;
uint8_t *y_table;
uint16_t *y_table16;
@@ -893,8 +893,8 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
fill_gv_table(c->table_gV, 1, cgv);
break;
case 32:
- base = (c->dstFormat == PIX_FMT_RGB32_1 ||
- c->dstFormat == PIX_FMT_BGR32_1) ? 8 : 0;
+ base = (c->dstFormat == AV_PIX_FMT_RGB32_1 ||
+ c->dstFormat == AV_PIX_FMT_BGR32_1) ? 8 : 0;
rbase = base + (isRgb ? 16 : 0);
gbase = base + 8;
bbase = base + (isRgb ? 0 : 16);