Unified · Split
| @@ -56,6 +56,10 @@ void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size); · 55 unmodified lines | |||
| 56 | void (*shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); | 56 | void (*shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); |
| 57 | void (*shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); | 57 | void (*shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); |
| 58 | void (*shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); | 58 | void (*shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); |
| 59 | void (*shuffle_bytes_3102)(const uint8_t *src, uint8_t *dst, int src_size); | ||
| 60 | void (*shuffle_bytes_2013)(const uint8_t *src, uint8_t *dst, int src_size); | ||
| 61 | void (*shuffle_bytes_2130)(const uint8_t *src, uint8_t *dst, int src_size); | ||
| 62 | void (*shuffle_bytes_1203)(const uint8_t *src, uint8_t *dst, int src_size); | ||
| 59 | 63 | ||
| 60 | 64 | ||
| 61 | void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, | 65 | void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, |
| @@ -52,6 +52,10 @@ extern void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size · 51 unmodified lines | |||
| 52 | extern void (*shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); | 52 | extern void (*shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); |
| 53 | extern void (*shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); | 53 | extern void (*shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); |
| 54 | extern void (*shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); | 54 | extern void (*shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); |
| 55 | extern void (*shuffle_bytes_3102)(const uint8_t *src, uint8_t *dst, int src_size); | ||
| 56 | extern void (*shuffle_bytes_2013)(const uint8_t *src, uint8_t *dst, int src_size); | ||
| 57 | extern void (*shuffle_bytes_2130)(const uint8_t *src, uint8_t *dst, int src_size); | ||
| 58 | extern void (*shuffle_bytes_1203)(const uint8_t *src, uint8_t *dst, int src_size); | ||
| 55 | 59 | ||
| 56 | void rgb64tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); | 60 | void rgb64tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); |
| 57 | void rgb64tobgr48_bswap(const uint8_t *src, uint8_t *dst, int src_size); | 61 | void rgb64tobgr48_bswap(const uint8_t *src, uint8_t *dst, int src_size); |
| @@ -359,6 +359,10 @@ static void shuffle_bytes_##name (const uint8_t *src, \ · 358 unmodified lines | |||
| 359 | DEFINE_SHUFFLE_BYTES(1230_c, 1, 2, 3, 0) | 359 | DEFINE_SHUFFLE_BYTES(1230_c, 1, 2, 3, 0) |
| 360 | DEFINE_SHUFFLE_BYTES(3012_c, 3, 0, 1, 2) | 360 | DEFINE_SHUFFLE_BYTES(3012_c, 3, 0, 1, 2) |
| 361 | DEFINE_SHUFFLE_BYTES(3210_c, 3, 2, 1, 0) | 361 | DEFINE_SHUFFLE_BYTES(3210_c, 3, 2, 1, 0) |
| 362 | DEFINE_SHUFFLE_BYTES(3102_c, 3, 1, 0, 2) | ||
| 363 | DEFINE_SHUFFLE_BYTES(2013_c, 2, 0, 1, 3) | ||
| 364 | DEFINE_SHUFFLE_BYTES(2130_c, 2, 1, 3, 0) | ||
| 365 | DEFINE_SHUFFLE_BYTES(1203_c, 1, 2, 0, 3) | ||
| 362 | 366 | ||
| 363 | static inline void rgb24tobgr24_c(const uint8_t *src, uint8_t *dst, int src_size) | 367 | static inline void rgb24tobgr24_c(const uint8_t *src, uint8_t *dst, int src_size) |
| 364 | { | 368 | { |
| @@ -970,6 +974,10 @@ static av_cold void rgb2rgb_init_c(void) · 605 unmodified lines | |||
| 970 | shuffle_bytes_1230 = shuffle_bytes_1230_c; | 974 | shuffle_bytes_1230 = shuffle_bytes_1230_c; |
| 971 | shuffle_bytes_3012 = shuffle_bytes_3012_c; | 975 | shuffle_bytes_3012 = shuffle_bytes_3012_c; |
| 972 | shuffle_bytes_3210 = shuffle_bytes_3210_c; | 976 | shuffle_bytes_3210 = shuffle_bytes_3210_c; |
| 977 | shuffle_bytes_3102 = shuffle_bytes_3102_c; | ||
| 978 | shuffle_bytes_2013 = shuffle_bytes_2013_c; | ||
| 979 | shuffle_bytes_2130 = shuffle_bytes_2130_c; | ||
| 980 | shuffle_bytes_1203 = shuffle_bytes_1203_c; | ||
| 973 | rgb32tobgr16 = rgb32tobgr16_c; | 981 | rgb32tobgr16 = rgb32tobgr16_c; |
| 974 | rgb32tobgr15 = rgb32tobgr15_c; | 982 | rgb32tobgr15 = rgb32tobgr15_c; |
| 975 | yv12toyuy2 = yv12toyuy2_c; | 983 | yv12toyuy2 = yv12toyuy2_c; |
| @@ -1497,6 +1497,13 @@ static int bayer_to_yv12_wrapper(SwsInternal *c, const uint8_t *const src[], · 1496 unmodified lines | |||
| 1497 | || (x) == AV_PIX_FMT_BGR48BE \ | 1497 | || (x) == AV_PIX_FMT_BGR48BE \ |
| 1498 | ) | 1498 | ) |
| 1499 | 1499 | ||
| 1500 | #define isAYUV(x) ( \ | ||
| 1501 | (x) == AV_PIX_FMT_AYUV \ | ||
| 1502 | || (x) == AV_PIX_FMT_VUYA \ | ||
| 1503 | || (x) == AV_PIX_FMT_VUYX \ | ||
| 1504 | || (x) == AV_PIX_FMT_UYVA \ | ||
| 1505 | ) | ||
| 1506 | |||
| 1500 | /* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */ | 1507 | /* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */ |
| 1501 | typedef void (* rgbConvFn) (const uint8_t *, uint8_t *, int); | 1508 | typedef void (* rgbConvFn) (const uint8_t *, uint8_t *, int); |
| 1502 | static rgbConvFn findRgbConvFn(SwsInternal *c) | 1509 | static rgbConvFn findRgbConvFn(SwsInternal *c) |
| @@ -1569,6 +1576,16 @@ static rgbConvFn findRgbConvFn(SwsInternal *c) · 66 unmodified lines | |||
| 1569 | || CONV_IS(BGRA64LE, BGR48BE) | 1576 | || CONV_IS(BGRA64LE, BGR48BE) |
| 1570 | || CONV_IS(RGBA64BE, RGB48LE) | 1577 | || CONV_IS(RGBA64BE, RGB48LE) |
| 1571 | || CONV_IS(BGRA64BE, BGR48LE)) conv = rgb64to48_bswap; | 1578 | || CONV_IS(BGRA64BE, BGR48LE)) conv = rgb64to48_bswap; |
| 1579 | } else if (isAYUV(srcFormat) && isAYUV(dstFormat)) { | ||
| 1580 | /* VUYX only for dst, to avoid copying undefined bytes */ | ||
| 1581 | if ( CONV_IS(AYUV, VUYA) | ||
| 1582 | || CONV_IS(AYUV, VUYX) | ||
| 1583 | || CONV_IS(VUYA, AYUV)) conv = shuffle_bytes_3210; | ||
| 1584 | else if (CONV_IS(AYUV, UYVA)) conv = shuffle_bytes_2130; | ||
| 1585 | else if (CONV_IS(VUYA, UYVA)) conv = shuffle_bytes_1203; | ||
| 1586 | else if (CONV_IS(UYVA, AYUV)) conv = shuffle_bytes_3102; | ||
| 1587 | else if (CONV_IS(UYVA, VUYA) | ||
| 1588 | || CONV_IS(UYVA, VUYX)) conv = shuffle_bytes_2013; | ||
| 1572 | } else | 1589 | } else |
| 1573 | /* BGR -> BGR */ | 1590 | /* BGR -> BGR */ |
| 1574 | if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) || | 1591 | if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) || |
| @@ -2086,6 +2103,10 @@ void ff_get_unscaled_swscale(SwsInternal *c) · 511 unmodified lines | |||
| 2086 | !(flags & SWS_ACCURATE_RND) && !(dstW&1)) | 2103 | !(flags & SWS_ACCURATE_RND) && !(dstW&1)) |
| 2087 | c->convert_unscaled = bgr24ToYv12Wrapper; | 2104 | c->convert_unscaled = bgr24ToYv12Wrapper; |
| 2088 | 2105 | ||
| 2106 | /* AYUV/VUYA/UYVA -> AYUV/VUYA/UYVA */ | ||
| 2107 | if (isAYUV(srcFormat) && isAYUV(dstFormat) && findRgbConvFn(c)) | ||
| 2108 | c->convert_unscaled = rgbToRgbWrapper; | ||
| 2109 | |||
| 2089 | /* RGB/BGR -> RGB/BGR (no dither needed forms) */ | 2110 | /* RGB/BGR -> RGB/BGR (no dither needed forms) */ |
| 2090 | if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c) | 2111 | if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c) |
| 2091 | && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) | 2112 | && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) |