diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-10-06 12:10:34 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-10-08 07:13:26 +0200 |
commit | 716d413c13981da15323c7a3821860536eefdbbb (patch) | |
tree | b15ebcded50b8edaa5b9fc8f261774043138e1fa /libswscale | |
parent | 78071a1420b425dfb787ac739048f523007b8139 (diff) | |
download | ffmpeg-716d413c13981da15323c7a3821860536eefdbbb.tar.gz |
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/bfin/swscale_bfin.c | 4 | ||||
-rw-r--r-- | libswscale/bfin/yuv2rgb_bfin.c | 12 | ||||
-rw-r--r-- | libswscale/input.c | 354 | ||||
-rw-r--r-- | libswscale/options.c | 4 | ||||
-rw-r--r-- | libswscale/output.c | 234 | ||||
-rw-r--r-- | libswscale/ppc/swscale_altivec.c | 16 | ||||
-rw-r--r-- | libswscale/ppc/yuv2rgb_altivec.c | 64 | ||||
-rw-r--r-- | libswscale/ppc/yuv2yuv_altivec.c | 8 | ||||
-rw-r--r-- | libswscale/sparc/yuv2rgb_vis.c | 4 | ||||
-rw-r--r-- | libswscale/swscale-test.c | 78 | ||||
-rw-r--r-- | libswscale/swscale.c | 6 | ||||
-rw-r--r-- | libswscale/swscale.h | 12 | ||||
-rw-r--r-- | libswscale/swscale_internal.h | 82 | ||||
-rw-r--r-- | libswscale/swscale_unscaled.c | 182 | ||||
-rw-r--r-- | libswscale/utils.c | 222 | ||||
-rw-r--r-- | libswscale/x86/swscale.c | 32 | ||||
-rw-r--r-- | libswscale/x86/swscale_template.c | 34 | ||||
-rw-r--r-- | libswscale/x86/yuv2rgb.c | 24 | ||||
-rw-r--r-- | libswscale/x86/yuv2rgb_template.c | 2 | ||||
-rw-r--r-- | libswscale/yuv2rgb.c | 94 |
20 files changed, 734 insertions, 734 deletions
diff --git a/libswscale/bfin/swscale_bfin.c b/libswscale/bfin/swscale_bfin.c index f2fe871fc8..9d0bbe3e2a 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 4078a18660..5b74c7a516 100644 --- a/libswscale/bfin/yuv2rgb_bfin.c +++ b/libswscale/bfin/yuv2rgb_bfin.c @@ -172,22 +172,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 40ed122427..142cc29a62 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -48,12 +48,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 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++) { @@ -70,7 +70,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; assert(src1 == src2); @@ -89,7 +89,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; assert(src1 == src2); @@ -149,15 +149,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]))) @@ -165,7 +165,7 @@ rgb48funcs(bgr, BE, PIX_FMT_BGR48BE) static av_always_inline void rgb16_32ToY_c_template(uint8_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, @@ -190,7 +190,7 @@ static av_always_inline void rgb16_32ToUV_c_template(uint8_t *dstU, uint8_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, @@ -217,7 +217,7 @@ static av_always_inline void rgb16_32ToUV_half_c_template(uint8_t *dstU, uint8_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, @@ -241,8 +241,8 @@ static av_always_inline void rgb16_32ToUV_half_c_template(uint8_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; @@ -285,22 +285,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 abgrToA_c(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused) @@ -670,211 +670,211 @@ 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_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_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_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_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_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_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_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_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_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; } @@ -883,152 +883,152 @@ 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_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_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_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_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_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_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; } if (c->alpPixBuf) { switch (srcFormat) { - case PIX_FMT_BGRA: - case PIX_FMT_RGBA: + 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; } diff --git a/libswscale/options.c b/libswscale/options.c index 57f461b7ea..daf013c741 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 43d5435b98..42be67d5bc 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -264,11 +264,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; @@ -300,7 +300,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; \ @@ -312,7 +312,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; @@ -350,7 +350,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]; @@ -385,7 +385,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; @@ -441,11 +441,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; \ @@ -463,7 +463,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; @@ -501,7 +501,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], @@ -529,7 +529,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; @@ -568,11 +568,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); \ @@ -586,7 +586,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; @@ -644,7 +644,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], @@ -685,7 +685,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; @@ -798,10 +798,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 @@ -815,23 +815,23 @@ static av_always_inline void yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned 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); @@ -840,14 +840,14 @@ yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned 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]; dest[i * 6 + 2] = b_r[Y1]; @@ -856,23 +856,23 @@ yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned 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]; @@ -897,7 +897,7 @@ yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned 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]; @@ -913,7 +913,7 @@ yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned 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 { @@ -929,7 +929,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; @@ -989,7 +989,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], @@ -1033,7 +1033,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]; @@ -1132,24 +1132,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, @@ -1157,10 +1157,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; @@ -1201,36 +1201,36 @@ 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; dest += 4; 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,37 +1347,37 @@ 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; } } else { 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; @@ -1397,8 +1397,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; @@ -1418,54 +1418,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; @@ -1473,22 +1473,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 7616ddf1fa..b0e25d041a 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 380c76f4d1..94e87fe62f 100644 --- a/libswscale/ppc/yuv2rgb_altivec.c +++ b/libswscale/ppc/yuv2rgb_altivec.c @@ -552,41 +552,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; @@ -635,7 +635,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; @@ -710,22 +710,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: @@ -802,22 +802,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: @@ -850,9 +850,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 45d766bd02..e68cccf6a7 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 d7102a3a45..cd8a8b0b9c 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 3497dffbe0..34de141bfa 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]; @@ -111,11 +111,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; @@ -184,12 +184,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; } @@ -232,8 +232,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 }; @@ -241,16 +241,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; @@ -270,26 +270,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; @@ -308,12 +308,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); @@ -334,8 +334,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 }; @@ -351,8 +351,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); @@ -377,13 +377,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 edd3b728ee..4c74e18de3 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -326,7 +326,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; @@ -677,7 +677,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, @@ -721,7 +721,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; } diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 8f4605ea6b..598946d807 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 @@ -301,8 +301,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 9583fb9464..20caba0fc1 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -238,8 +238,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; @@ -540,7 +540,7 @@ SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c); SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c); void ff_bfin_get_unscaled_swscale(SwsContext *c); -const char *sws_format_name(enum PixelFormat format); +const char *sws_format_name(enum AVPixelFormat format); #define is16BPS(x) \ (av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 15) @@ -569,47 +569,47 @@ 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_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_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_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_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 isAnyRGB(x) \ (isRGBinInt(x) || \ @@ -622,7 +622,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) #define isPlanar(x) \ (av_pix_fmt_descriptors[x].nb_components >= 2 && \ @@ -638,7 +638,7 @@ const char *sws_format_name(enum PixelFormat format); #define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || \ (av_pix_fmt_descriptors[x].flags & PIX_FMT_PSEUDOPAL) || \ - (x) == PIX_FMT_Y400A) + (x) == AV_PIX_FMT_Y400A) extern const uint64_t ff_dither4[2]; extern const uint64_t ff_dither8[2]; diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 595edf8ae1..2351f96ed0 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -125,7 +125,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 @@ -302,31 +302,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_Y400A) { + if (srcFormat == AV_PIX_FMT_Y400A) { 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; } } @@ -396,7 +396,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)); @@ -404,32 +404,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], @@ -447,18 +447,18 @@ 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 \ ) /* {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; @@ -471,7 +471,7 @@ static rgbConvFn findRgbConvFn(SwsContext *c) if (IS_NOT_NE(srcId, srcFormat) || IS_NOT_NE(dstId, dstFormat)) return NULL; -#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) @@ -536,8 +536,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); @@ -548,11 +548,11 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[], } else { const uint8_t *srcPtr = src[0]; uint8_t *dstPtr = dst[0]; - 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; @@ -860,8 +860,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; @@ -871,26 +871,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; @@ -903,66 +903,66 @@ void ff_get_unscaled_swscale(SwsContext *c) 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_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_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_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_RGB555) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB565)) c->swScale = packed_16bpc_bswap; if ((usePal(srcFormat) && ( - dstFormat == PIX_FMT_RGB32 || - dstFormat == PIX_FMT_RGB32_1 || - dstFormat == PIX_FMT_RGB24 || - dstFormat == PIX_FMT_BGR32 || - dstFormat == PIX_FMT_BGR32_1 || - dstFormat == PIX_FMT_BGR24))) + dstFormat == AV_PIX_FMT_RGB32 || + dstFormat == AV_PIX_FMT_RGB32_1 || + dstFormat == AV_PIX_FMT_RGB24 || + dstFormat == AV_PIX_FMT_BGR32 || + dstFormat == AV_PIX_FMT_BGR32_1 || + dstFormat == AV_PIX_FMT_BGR24))) 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; /* 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) && isGray(dstFormat)) || (isPlanarYUV(dstFormat) && isGray(srcFormat)) || (isGray(dstFormat) && isGray(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; @@ -988,7 +988,7 @@ static void reset_ptr(const uint8_t *src[], int format) } } -static int check_image_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, +static int check_image_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, const int linesizes[4]) { const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; @@ -1041,28 +1041,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; - if (c->srcFormat == PIX_FMT_PAL8) { + if (c->srcFormat == AV_PIX_FMT_PAL8) { p = ((const uint32_t *)(srcSlice[1]))[i]; 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_Y400A) { + } else if (c->srcFormat == AV_PIX_FMT_GRAY8 || + c->srcFormat == AV_PIX_FMT_Y400A) { r = g = b = i; } else { - assert(c->srcFormat == PIX_FMT_BGR4_BYTE); + assert(c->srcFormat == AV_PIX_FMT_BGR4_BYTE); b = ( i >> 3 ) * 255; g = ((i >> 1) & 3) * 85; r = ( i & 1) * 255; @@ -1073,27 +1073,27 @@ int attribute_align_arg sws_scale(struct SwsContext *c, c->pal_yuv[i] = y + (u << 8) + (v << 16); 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); 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] = (r + (g << 8) + (b << 16)) << 8; 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] = (b + (g << 8) + (r << 16)) << 8; 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); diff --git a/libswscale/utils.c b/libswscale/utils.c index 0002e17635..fcdd04a118 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -73,102 +73,102 @@ typedef struct FormatEntry { int is_supported_in, is_supported_out; } FormatEntry; -static const FormatEntry format_entries[PIX_FMT_NB] = { - [PIX_FMT_YUV420P] = { 1, 1 }, - [PIX_FMT_YUYV422] = { 1, 1 }, - [PIX_FMT_RGB24] = { 1, 1 }, - [PIX_FMT_BGR24] = { 1, 1 }, - [PIX_FMT_YUV422P] = { 1, 1 }, - [PIX_FMT_YUV444P] = { 1, 1 }, - [PIX_FMT_YUV410P] = { 1, 1 }, - [PIX_FMT_YUV411P] = { 1, 1 }, - [PIX_FMT_GRAY8] = { 1, 1 }, - [PIX_FMT_MONOWHITE] = { 1, 1 }, - [PIX_FMT_MONOBLACK] = { 1, 1 }, - [PIX_FMT_PAL8] = { 1, 0 }, - [PIX_FMT_YUVJ420P] = { 1, 1 }, - [PIX_FMT_YUVJ422P] = { 1, 1 }, - [PIX_FMT_YUVJ444P] = { 1, 1 }, - [PIX_FMT_UYVY422] = { 1, 1 }, - [PIX_FMT_UYYVYY411] = { 0, 0 }, - [PIX_FMT_BGR8] = { 1, 1 }, - [PIX_FMT_BGR4] = { 0, 1 }, - [PIX_FMT_BGR4_BYTE] = { 1, 1 }, - [PIX_FMT_RGB8] = { 1, 1 }, - [PIX_FMT_RGB4] = { 0, 1 }, - [PIX_FMT_RGB4_BYTE] = { 1, 1 }, - [PIX_FMT_NV12] = { 1, 1 }, - [PIX_FMT_NV21] = { 1, 1 }, - [PIX_FMT_ARGB] = { 1, 1 }, - [PIX_FMT_RGBA] = { 1, 1 }, - [PIX_FMT_ABGR] = { 1, 1 }, - [PIX_FMT_BGRA] = { 1, 1 }, - [PIX_FMT_GRAY16BE] = { 1, 1 }, - [PIX_FMT_GRAY16LE] = { 1, 1 }, - [PIX_FMT_YUV440P] = { 1, 1 }, - [PIX_FMT_YUVJ440P] = { 1, 1 }, - [PIX_FMT_YUVA420P] = { 1, 1 }, - [PIX_FMT_RGB48BE] = { 1, 1 }, - [PIX_FMT_RGB48LE] = { 1, 1 }, - [PIX_FMT_RGB565BE] = { 1, 1 }, - [PIX_FMT_RGB565LE] = { 1, 1 }, - [PIX_FMT_RGB555BE] = { 1, 1 }, - [PIX_FMT_RGB555LE] = { 1, 1 }, - [PIX_FMT_BGR565BE] = { 1, 1 }, - [PIX_FMT_BGR565LE] = { 1, 1 }, - [PIX_FMT_BGR555BE] = { 1, 1 }, - [PIX_FMT_BGR555LE] = { 1, 1 }, - [PIX_FMT_YUV420P16LE] = { 1, 1 }, - [PIX_FMT_YUV420P16BE] = { 1, 1 }, - [PIX_FMT_YUV422P16LE] = { 1, 1 }, - [PIX_FMT_YUV422P16BE] = { 1, 1 }, - [PIX_FMT_YUV444P16LE] = { 1, 1 }, - [PIX_FMT_YUV444P16BE] = { 1, 1 }, - [PIX_FMT_RGB444LE] = { 1, 1 }, - [PIX_FMT_RGB444BE] = { 1, 1 }, - [PIX_FMT_BGR444LE] = { 1, 1 }, - [PIX_FMT_BGR444BE] = { 1, 1 }, - [PIX_FMT_Y400A] = { 1, 0 }, - [PIX_FMT_BGR48BE] = { 1, 1 }, - [PIX_FMT_BGR48LE] = { 1, 1 }, - [PIX_FMT_YUV420P9BE] = { 1, 1 }, - [PIX_FMT_YUV420P9LE] = { 1, 1 }, - [PIX_FMT_YUV420P10BE] = { 1, 1 }, - [PIX_FMT_YUV420P10LE] = { 1, 1 }, - [PIX_FMT_YUV422P9BE] = { 1, 1 }, - [PIX_FMT_YUV422P9LE] = { 1, 1 }, - [PIX_FMT_YUV422P10BE] = { 1, 1 }, - [PIX_FMT_YUV422P10LE] = { 1, 1 }, - [PIX_FMT_YUV444P9BE] = { 1, 1 }, - [PIX_FMT_YUV444P9LE] = { 1, 1 }, - [PIX_FMT_YUV444P10BE] = { 1, 1 }, - [PIX_FMT_YUV444P10LE] = { 1, 1 }, - [PIX_FMT_GBRP] = { 1, 0 }, - [PIX_FMT_GBRP9LE] = { 1, 0 }, - [PIX_FMT_GBRP9BE] = { 1, 0 }, - [PIX_FMT_GBRP10LE] = { 1, 0 }, - [PIX_FMT_GBRP10BE] = { 1, 0 }, - [PIX_FMT_GBRP16LE] = { 1, 0 }, - [PIX_FMT_GBRP16BE] = { 1, 0 }, +static const FormatEntry format_entries[AV_PIX_FMT_NB] = { + [AV_PIX_FMT_YUV420P] = { 1, 1 }, + [AV_PIX_FMT_YUYV422] = { 1, 1 }, + [AV_PIX_FMT_RGB24] = { 1, 1 }, + [AV_PIX_FMT_BGR24] = { 1, 1 }, + [AV_PIX_FMT_YUV422P] = { 1, 1 }, + [AV_PIX_FMT_YUV444P] = { 1, 1 }, + [AV_PIX_FMT_YUV410P] = { 1, 1 }, + [AV_PIX_FMT_YUV411P] = { 1, 1 }, + [AV_PIX_FMT_GRAY8] = { 1, 1 }, + [AV_PIX_FMT_MONOWHITE] = { 1, 1 }, + [AV_PIX_FMT_MONOBLACK] = { 1, 1 }, + [AV_PIX_FMT_PAL8] = { 1, 0 }, + [AV_PIX_FMT_YUVJ420P] = { 1, 1 }, + [AV_PIX_FMT_YUVJ422P] = { 1, 1 }, + [AV_PIX_FMT_YUVJ444P] = { 1, 1 }, + [AV_PIX_FMT_UYVY422] = { 1, 1 }, + [AV_PIX_FMT_UYYVYY411] = { 0, 0 }, + [AV_PIX_FMT_BGR8] = { 1, 1 }, + [AV_PIX_FMT_BGR4] = { 0, 1 }, + [AV_PIX_FMT_BGR4_BYTE] = { 1, 1 }, + [AV_PIX_FMT_RGB8] = { 1, 1 }, + [AV_PIX_FMT_RGB4] = { 0, 1 }, + [AV_PIX_FMT_RGB4_BYTE] = { 1, 1 }, + [AV_PIX_FMT_NV12] = { 1, 1 }, + [AV_PIX_FMT_NV21] = { 1, 1 }, + [AV_PIX_FMT_ARGB] = { 1, 1 }, + [AV_PIX_FMT_RGBA] = { 1, 1 }, + [AV_PIX_FMT_ABGR] = { 1, 1 }, + [AV_PIX_FMT_BGRA] = { 1, 1 }, + [AV_PIX_FMT_GRAY16BE] = { 1, 1 }, + [AV_PIX_FMT_GRAY16LE] = { 1, 1 }, + [AV_PIX_FMT_YUV440P] = { 1, 1 }, + [AV_PIX_FMT_YUVJ440P] = { 1, 1 }, + [AV_PIX_FMT_YUVA420P] = { 1, 1 }, + [AV_PIX_FMT_RGB48BE] = { 1, 1 }, + [AV_PIX_FMT_RGB48LE] = { 1, 1 }, + [AV_PIX_FMT_RGB565BE] = { 1, 1 }, + [AV_PIX_FMT_RGB565LE] = { 1, 1 }, + [AV_PIX_FMT_RGB555BE] = { 1, 1 }, + [AV_PIX_FMT_RGB555LE] = { 1, 1 }, + [AV_PIX_FMT_BGR565BE] = { 1, 1 }, + [AV_PIX_FMT_BGR565LE] = { 1, 1 }, + [AV_PIX_FMT_BGR555BE] = { 1, 1 }, + [AV_PIX_FMT_BGR555LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P16LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P16BE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P16LE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P16BE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P16LE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P16BE] = { 1, 1 }, + [AV_PIX_FMT_RGB444LE] = { 1, 1 }, + [AV_PIX_FMT_RGB444BE] = { 1, 1 }, + [AV_PIX_FMT_BGR444LE] = { 1, 1 }, + [AV_PIX_FMT_BGR444BE] = { 1, 1 }, + [AV_PIX_FMT_Y400A] = { 1, 0 }, + [AV_PIX_FMT_BGR48BE] = { 1, 1 }, + [AV_PIX_FMT_BGR48LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P9BE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P9LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P10BE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P10LE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P9BE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P9LE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P10BE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P10LE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P9BE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P9LE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P10BE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P10LE] = { 1, 1 }, + [AV_PIX_FMT_GBRP] = { 1, 0 }, + [AV_PIX_FMT_GBRP9LE] = { 1, 0 }, + [AV_PIX_FMT_GBRP9BE] = { 1, 0 }, + [AV_PIX_FMT_GBRP10LE] = { 1, 0 }, + [AV_PIX_FMT_GBRP10BE] = { 1, 0 }, + [AV_PIX_FMT_GBRP16LE] = { 1, 0 }, + [AV_PIX_FMT_GBRP16BE] = { 1, 0 }, }; -int sws_isSupportedInput(enum PixelFormat pix_fmt) +int sws_isSupportedInput(enum AVPixelFormat pix_fmt) { - return (unsigned)pix_fmt < PIX_FMT_NB ? + return (unsigned)pix_fmt < AV_PIX_FMT_NB ? format_entries[pix_fmt].is_supported_in : 0; } -int sws_isSupportedOutput(enum PixelFormat pix_fmt) +int sws_isSupportedOutput(enum AVPixelFormat pix_fmt) { - return (unsigned)pix_fmt < PIX_FMT_NB ? + return (unsigned)pix_fmt < AV_PIX_FMT_NB ? format_entries[pix_fmt].is_supported_out : 0; } extern const int32_t ff_yuv2rgb_coeffs[8][4]; -const char *sws_format_name(enum PixelFormat format) +const char *sws_format_name(enum AVPixelFormat format) { - if ((unsigned)format < PIX_FMT_NB && av_pix_fmt_descriptors[format].name) + if ((unsigned)format < AV_PIX_FMT_NB && av_pix_fmt_descriptors[format].name) return av_pix_fmt_descriptors[format].name; else return "Unknown format"; @@ -743,7 +743,7 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, } #endif /* HAVE_MMXEXT_INLINE */ -static void getSubSampleFactors(int *h, int *v, enum PixelFormat format) +static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format) { *h = av_pix_fmt_descriptors[format].log2_chroma_w; *v = av_pix_fmt_descriptors[format].log2_chroma_h; @@ -795,20 +795,20 @@ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, return 0; } -static int handle_jpeg(enum PixelFormat *format) +static int handle_jpeg(enum AVPixelFormat *format) { switch (*format) { - case PIX_FMT_YUVJ420P: - *format = PIX_FMT_YUV420P; + case AV_PIX_FMT_YUVJ420P: + *format = AV_PIX_FMT_YUV420P; return 1; - case PIX_FMT_YUVJ422P: - *format = PIX_FMT_YUV422P; + case AV_PIX_FMT_YUVJ422P: + *format = AV_PIX_FMT_YUV422P; return 1; - case PIX_FMT_YUVJ444P: - *format = PIX_FMT_YUV444P; + case AV_PIX_FMT_YUVJ444P: + *format = AV_PIX_FMT_YUV444P; return 1; - case PIX_FMT_YUVJ440P: - *format = PIX_FMT_YUV440P; + case AV_PIX_FMT_YUVJ440P: + *format = AV_PIX_FMT_YUV440P; return 1; default: return 0; @@ -839,8 +839,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 16, 16); int dst_stride_px = dst_stride >> 1; int flags, cpu_flags; - enum PixelFormat srcFormat = c->srcFormat; - enum PixelFormat dstFormat = c->dstFormat; + enum AVPixelFormat srcFormat = c->srcFormat; + enum AVPixelFormat dstFormat = c->dstFormat; cpu_flags = av_get_cpu_flags(); flags = c->flags; @@ -913,12 +913,12 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, * chroma interpolation */ if (flags & SWS_FULL_CHR_H_INT && isAnyRGB(dstFormat) && - dstFormat != PIX_FMT_RGBA && - dstFormat != PIX_FMT_ARGB && - dstFormat != PIX_FMT_BGRA && - dstFormat != PIX_FMT_ABGR && - dstFormat != PIX_FMT_RGB24 && - dstFormat != PIX_FMT_BGR24) { + dstFormat != AV_PIX_FMT_RGBA && + dstFormat != AV_PIX_FMT_ARGB && + dstFormat != AV_PIX_FMT_BGRA && + dstFormat != AV_PIX_FMT_ABGR && + dstFormat != AV_PIX_FMT_RGB24 && + dstFormat != AV_PIX_FMT_BGR24) { av_log(c, AV_LOG_ERROR, "full chroma interpolation for destination format '%s' not yet implemented\n", sws_format_name(dstFormat)); @@ -936,9 +936,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, /* drop every other pixel for chroma calculation unless user * wants full chroma */ if (isAnyRGB(srcFormat) && !(flags & SWS_FULL_CHR_H_INP) && - srcFormat != PIX_FMT_RGB8 && srcFormat != PIX_FMT_BGR8 && - srcFormat != PIX_FMT_RGB4 && srcFormat != PIX_FMT_BGR4 && - srcFormat != PIX_FMT_RGB4_BYTE && srcFormat != PIX_FMT_BGR4_BYTE && + srcFormat != AV_PIX_FMT_RGB8 && srcFormat != AV_PIX_FMT_BGR8 && + srcFormat != AV_PIX_FMT_RGB4 && srcFormat != AV_PIX_FMT_BGR4 && + srcFormat != AV_PIX_FMT_RGB4_BYTE && srcFormat != AV_PIX_FMT_BGR4_BYTE && ((dstW >> c->chrDstHSubSample) <= (srcW >> 1) || (flags & SWS_FAST_BILINEAR))) c->chrSrcHSubSample = 1; @@ -1199,9 +1199,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, av_log(c, AV_LOG_INFO, "from %s to %s%s ", sws_format_name(srcFormat), #ifdef DITHER1XBPP - dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 || - dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE || - dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE ? + dstFormat == AV_PIX_FMT_BGR555 || dstFormat == AV_PIX_FMT_BGR565 || + dstFormat == AV_PIX_FMT_RGB444BE || dstFormat == AV_PIX_FMT_RGB444LE || + dstFormat == AV_PIX_FMT_BGR444BE || dstFormat == AV_PIX_FMT_BGR444LE ? "dithered " : "", #else "", @@ -1236,8 +1236,8 @@ fail: // FIXME replace things by appropriate error codes } #if FF_API_SWS_GETCONTEXT -SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, - int dstW, int dstH, enum PixelFormat dstFormat, +SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, + int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) { @@ -1647,9 +1647,9 @@ void sws_freeContext(SwsContext *c) } struct SwsContext *sws_getCachedContext(struct SwsContext *context, int srcW, - int srcH, enum PixelFormat srcFormat, + int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, - enum PixelFormat dstFormat, int flags, + enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index 23d09d9ffe..ba7990e20b 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -111,7 +111,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]; @@ -351,7 +351,7 @@ switch(c->dstBpc){ \ default: vscalefn = ff_yuv2plane1_8_ ## opt1; break; \ } #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; \ @@ -363,23 +363,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); @@ -412,23 +412,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); @@ -468,16 +468,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 e9816cf0a6..0d5ba7ee69 100644 --- a/libswscale/x86/swscale_template.c +++ b/libswscale/x86/swscale_template.c @@ -1557,30 +1557,30 @@ 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; 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) { if (!(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; } } } else { 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; } } @@ -1588,23 +1588,23 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) } 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 af30ca96ee..b7d8f42583 100644 --- a/libswscale/x86/yuv2rgb.c +++ b/libswscale/x86/yuv2rgb.c @@ -74,39 +74,39 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) #if HAVE_INLINE_ASM int cpu_flags = av_get_cpu_flags(); - if (c->srcFormat != PIX_FMT_YUV420P && - c->srcFormat != PIX_FMT_YUVA420P) + if (c->srcFormat != AV_PIX_FMT_YUV420P && + c->srcFormat != AV_PIX_FMT_YUVA420P) return NULL; #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 a71fd13862..b028e93152 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; \ \ - if (c->srcFormat == PIX_FMT_YUV422P) { \ + if (c->srcFormat == AV_PIX_FMT_YUV422P) { \ srcStride[1] *= 2; \ srcStride[2] *= 2; \ } \ diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index f1ce4aaef4..1dbd0d8e10 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -124,7 +124,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; \ } \ @@ -582,44 +582,44 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) sws_format_name(c->srcFormat), sws_format_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: - if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P) + case AV_PIX_FMT_ARGB: + case AV_PIX_FMT_ABGR: + if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P) return yuva2argb_c; - case PIX_FMT_RGBA: - case PIX_FMT_BGRA: - if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P) + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_BGRA: + if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P) return yuva2rgba_c; else return 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 PIX_FMT_RGB555: - case PIX_FMT_BGR555: + case AV_PIX_FMT_RGB565: + case AV_PIX_FMT_BGR565: + case AV_PIX_FMT_RGB555: + case AV_PIX_FMT_BGR555: return yuv2rgb_c_16; - 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; default: assert(0); @@ -670,25 +670,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; @@ -856,8 +856,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); |