| @@ -1283,6 +1283,28 @@ static av_always_inline void grayf32ToY16_c(uint8_t *_dst, const uint8_t *_src, · 1282 unmodified lines |
| 1283 | 1283 | } |
| 1284 | 1284 | } |
| 1285 | 1285 | |
| 1286 | +static av_always_inline void read_yaf32_gray_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, |
| 1287 | + const uint8_t *unused2, int width, int is_be, uint32_t *unused) |
| 1288 | +{ |
| 1289 | + int i; |
| 1290 | + const float *src = (const float *)_src; |
| 1291 | + uint16_t *dst = (uint16_t *)_dst; |
| 1292 | + |
| 1293 | + for (i = 0; i < width; ++i) |
| 1294 | + dst[i] = lrintf(av_clipf(65535.0f * rdpx(src + i*2), 0.0f, 65535.0f)); |
| 1295 | +} |
| 1296 | + |
| 1297 | +static av_always_inline void read_yaf32_alpha_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, |
| 1298 | + const uint8_t *unused2, int width, int is_be, uint32_t *unused) |
| 1299 | +{ |
| 1300 | + int i; |
| 1301 | + const float *src = (const float *)_src; |
| 1302 | + uint16_t *dst = (uint16_t *)_dst; |
| 1303 | + |
| 1304 | + for (i = 0; i < width; ++i) |
| 1305 | + dst[i] = lrintf(av_clipf(65535.0f * rdpx(src + i*2 + 1), 0.0f, 65535.0f)); |
| 1306 | +} |
| 1307 | + |
| 1286 | 1308 | #undef rdpx |
| 1287 | 1309 | |
| 1288 | 1310 | #define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \ |
| @@ -1363,6 +1385,18 @@ static void grayf32##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, · 74 unmodified lines |
| 1363 | 1385 | int width, uint32_t *unused, void *opq) \ |
| 1364 | 1386 | { \ |
| 1365 | 1387 | grayf32ToY16_c(dst, src, unused1, unused2, width, endian, unused); \ |
| 1388 | +} \ |
| 1389 | +static void read_yaf32##endian_name##_gray_c(uint8_t *dst, const uint8_t *src, \ |
| 1390 | + const uint8_t *unused1, const uint8_t *unused2, \ |
| 1391 | + int width, uint32_t *unused, void *opq) \ |
| 1392 | +{ \ |
| 1393 | + read_yaf32_gray_c(dst, src, unused1, unused2, width, endian, unused); \ |
| 1394 | +} \ |
| 1395 | +static void read_yaf32##endian_name##_alpha_c(uint8_t *dst, const uint8_t *src, \ |
| 1396 | + const uint8_t *unused1, const uint8_t *unused2, \ |
| 1397 | + int width, uint32_t *unused, void *opq) \ |
| 1398 | +{ \ |
| 1399 | + read_yaf32_alpha_c(dst, src, unused1, unused2, width, endian, unused); \ |
| 1366 | 1400 | } |
| 1367 | 1401 | |
| 1368 | 1402 | rgbf32_funcs_endian(le, 0) |
| @@ -1421,6 +1455,24 @@ static av_always_inline void grayf16ToY16_c(uint8_t *dst, const uint8_t *src, co · 52 unmodified lines |
| 1421 | 1455 | } |
| 1422 | 1456 | } |
| 1423 | 1457 | |
| 1458 | +static av_always_inline void read_yaf16_gray_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, |
| 1459 | + const uint8_t *unused2, int width, int is_be, uint32_t *unused, Half2FloatTables *h2f_tbl) |
| 1460 | +{ |
| 1461 | + uint16_t *dst = (uint16_t *)_dst; |
| 1462 | + |
| 1463 | + for (int i = 0; i < width; i++) |
| 1464 | + dst[i] = lrintf(av_clipf(65535.0f * rdpx2(src + 4*i), 0.0f, 65535.0f)); |
| 1465 | +} |
| 1466 | + |
| 1467 | +static av_always_inline void read_yaf16_alpha_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, |
| 1468 | + const uint8_t *unused2, int width, int is_be, uint32_t *unused, Half2FloatTables *h2f_tbl) |
| 1469 | +{ |
| 1470 | + uint16_t *dst = (uint16_t *)_dst; |
| 1471 | + |
| 1472 | + for (int i = 0; i < width; i++) |
| 1473 | + dst[i] = lrintf(av_clipf(65535.0f * rdpx2(src + 4*i + 2), 0.0f, 65535.0f)); |
| 1474 | +} |
| 1475 | + |
| 1424 | 1476 | static av_always_inline void rgbaf16ToUV_half_endian(uint16_t *dstU, uint16_t *dstV, int is_be, |
| 1425 | 1477 | const uint16_t *src, int width, |
| 1426 | 1478 | int32_t *rgb2yuv, Half2FloatTables *h2f_tbl) |
| @@ -1557,6 +1609,19 @@ static void grayf16##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, · 130 unmodified lines |
| 1557 | 1609 | { \ |
| 1558 | 1610 | grayf16ToY16_c(dst, src, unused1, unused2, width, endian, unused, opq); \ |
| 1559 | 1611 | } \ |
| 1612 | +static void read_yaf16##endian_name##_gray_c(uint8_t *dst, const uint8_t *src, \ |
| 1613 | + const uint8_t *unused1, const uint8_t *unused2, \ |
| 1614 | + int width, uint32_t *unused, void *opq) \ |
| 1615 | +{ \ |
| 1616 | + read_yaf16_gray_c(dst, src, unused1, unused2, width, endian, unused, opq); \ |
| 1617 | +} \ |
| 1618 | +static void read_yaf16##endian_name##_alpha_c(uint8_t *dst, const uint8_t *src, \ |
| 1619 | + const uint8_t *unused1, const uint8_t *unused2, \ |
| 1620 | + int width, uint32_t *unused, void *opq) \ |
| 1621 | +{ \ |
| 1622 | + read_yaf16_alpha_c(dst, src, unused1, unused2, width, endian, unused, opq); \ |
| 1623 | +} \ |
| 1624 | + \ |
| 1560 | 1625 | static void rgbaf16##endian_name##ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \ |
| 1561 | 1626 | const uint8_t *src1, const uint8_t *src2, \ |
| 1562 | 1627 | int width, uint32_t *_rgb2yuv, void *opq) \ |
| @@ -2244,6 +2309,12 @@ av_cold void ff_sws_init_input_funcs(SwsInternal *c, · 681 unmodified lines |
| 2244 | 2309 | case AV_PIX_FMT_YA16BE: |
| 2245 | 2310 | *lumToYV12 = read_ya16be_gray_c; |
| 2246 | 2311 | break; |
| 2312 | + case AV_PIX_FMT_YAF16LE: |
| 2313 | + *lumToYV12 = read_yaf16le_gray_c; |
| 2314 | + break; |
| 2315 | + case AV_PIX_FMT_YAF16BE: |
| 2316 | + *lumToYV12 = read_yaf16be_gray_c; |
| 2317 | + break; |
| 2247 | 2318 | case AV_PIX_FMT_VUYA: |
| 2248 | 2319 | case AV_PIX_FMT_VUYX: |
| 2249 | 2320 | *lumToYV12 = read_vuyx_Y_c; |
| @@ -2400,6 +2471,12 @@ av_cold void ff_sws_init_input_funcs(SwsInternal *c, · 150 unmodified lines |
| 2400 | 2471 | case AV_PIX_FMT_GRAYF32BE: |
| 2401 | 2472 | *lumToYV12 = grayf32beToY16_c; |
| 2402 | 2473 | break; |
| 2474 | + case AV_PIX_FMT_YAF32LE: |
| 2475 | + *lumToYV12 = read_yaf32le_gray_c; |
| 2476 | + break; |
| 2477 | + case AV_PIX_FMT_YAF32BE: |
| 2478 | + *lumToYV12 = read_yaf32be_gray_c; |
| 2479 | + break; |
| 2403 | 2480 | case AV_PIX_FMT_GRAYF16LE: |
| 2404 | 2481 | *lumToYV12 = grayf16leToY16_c; |
| 2405 | 2482 | break; |
| @@ -2473,6 +2550,18 @@ av_cold void ff_sws_init_input_funcs(SwsInternal *c, · 67 unmodified lines |
| 2473 | 2550 | case AV_PIX_FMT_YA16BE: |
| 2474 | 2551 | *alpToYV12 = read_ya16be_alpha_c; |
| 2475 | 2552 | break; |
| 2553 | + case AV_PIX_FMT_YAF16LE: |
| 2554 | + *alpToYV12 = read_yaf16le_alpha_c; |
| 2555 | + break; |
| 2556 | + case AV_PIX_FMT_YAF16BE: |
| 2557 | + *alpToYV12 = read_yaf16be_alpha_c; |
| 2558 | + break; |
| 2559 | + case AV_PIX_FMT_YAF32LE: |
| 2560 | + *alpToYV12 = read_yaf32le_alpha_c; |
| 2561 | + break; |
| 2562 | + case AV_PIX_FMT_YAF32BE: |
| 2563 | + *alpToYV12 = read_yaf32be_alpha_c; |
| 2564 | + break; |
| 2476 | 2565 | case AV_PIX_FMT_VUYA: |
| 2477 | 2566 | case AV_PIX_FMT_UYVA: |
| 2478 | 2567 | *alpToYV12 = read_vuya_A_c; |