History

swscale/output: add XV48 output support

James Almer committed 2 years ago

Commit a67ba3c1 parent 2f13f7415 files · +49 −16Browse files

Unified · Split

15 files
  1. libswscale/output.c +24 −13
  2. libswscale/utils.c +2 −2
  3. libswscale/version.h +1 −1
  4. tests/ref/fate/filter-pixdesc-xv48be +1 −0
  5. tests/ref/fate/filter-pixdesc-xv48le +1 −0
  6. tests/ref/fate/filter-pixfmts-copy +2 −0
  7. tests/ref/fate/filter-pixfmts-crop +2 −0
  8. tests/ref/fate/filter-pixfmts-field +2 −0
  9. tests/ref/fate/filter-pixfmts-fieldorder +2 −0
  10. tests/ref/fate/filter-pixfmts-hflip +2 −0
  11. tests/ref/fate/filter-pixfmts-il +2 −0
  12. tests/ref/fate/filter-pixfmts-null +2 −0
  13. tests/ref/fate/filter-pixfmts-scale +2 −0
  14. tests/ref/fate/filter-pixfmts-transpose +2 −0
  15. tests/ref/fate/filter-pixfmts-vflip +2 −0
libswscale/output.c+24−13
@@ -2577,7 +2577,8 @@ yuv2ayuv64_X_c(SwsInternal *c, const int16_t *lumFilter, · 2576 unmodified lines
2577 const int16_t **_lumSrc, int lumFilterSize,2577 const int16_t **_lumSrc, int lumFilterSize,
2578 const int16_t *chrFilter, const int16_t **_chrUSrc,2578 const int16_t *chrFilter, const int16_t **_chrUSrc,
2579 const int16_t **_chrVSrc, int chrFilterSize,2579 const int16_t **_chrVSrc, int chrFilterSize,
2580 const int16_t **_alpSrc, uint8_t *dest, int dstW, int y, int is_be)2580 const int16_t **_alpSrc, uint8_t *dest, int dstW, int y,
2581 int A_offset, int Y_offset, int U_offset, int V_offset, int is_be)
2581{2582{
2582 const int32_t **lumSrc = (const int32_t **) _lumSrc,2583 const int32_t **lumSrc = (const int32_t **) _lumSrc,
2583 **chrUSrc = (const int32_t **) _chrUSrc,2584 **chrUSrc = (const int32_t **) _chrUSrc,
@@ -2612,20 +2613,19 @@ yuv2ayuv64_X_c(SwsInternal *c, const int16_t *lumFilter, · 28 unmodified lines
2612 Y = 0x8000 + av_clip_int16(Y >> 15);2613 Y = 0x8000 + av_clip_int16(Y >> 15);
2613 U = 0x8000 + av_clip_int16(U >> 15);2614 U = 0x8000 + av_clip_int16(U >> 15);
2614 V = 0x8000 + av_clip_int16(V >> 15);2615 V = 0x8000 + av_clip_int16(V >> 15);
2615 A = 0x8000 + av_clip_int16(A >> 15);2616 if (hasAlpha)
2617 A = 0x8000 + av_clip_int16(A >> 15);
2616 2618
2617 output_pixels(dest + 8 * i, hasAlpha ? A : 65535);2619 output_pixels(dest + 8 * i + A_offset, hasAlpha ? A : 65535);
2618 output_pixels(dest + 8 * i + 2, Y);2620 output_pixels(dest + 8 * i + Y_offset, Y);
2619 output_pixels(dest + 8 * i + 4, U);2621 output_pixels(dest + 8 * i + U_offset, U);
2620 output_pixels(dest + 8 * i + 6, V);2622 output_pixels(dest + 8 * i + V_offset, V);
2621 }2623 }
2622}2624}
2623 2625
2624#undef output_pixels2626#define YUV2AYUV64(pixfmt, BE_LE, A, Y, U, V, is_be) \
2625
2626#define YUV2AYUV64(BE_LE, is_be) \
2627static void \2627static void \
2628yuv2ayuv64 ## BE_LE ##_X_c(SwsInternal *c, const int16_t *lumFilter, \2628yuv2 ## pixfmt ## BE_LE ##_X_c(SwsInternal *c, const int16_t *lumFilter, \
2629 const int16_t **lumSrc, int lumFilterSize, \2629 const int16_t **lumSrc, int lumFilterSize, \
2630 const int16_t *chrFilter, const int16_t **chrUSrc, \2630 const int16_t *chrFilter, const int16_t **chrUSrc, \
2631 const int16_t **chrVSrc, int chrFilterSize, \2631 const int16_t **chrVSrc, int chrFilterSize, \
@@ -2633,11 +2633,16 @@ yuv2ayuv64 ## BE_LE ##_X_c(SwsInternal *c, const int16_t *lumFilter, \ · 1 unmodified line
2633{ \2633{ \
2634 yuv2ayuv64_X_c(c, lumFilter, lumSrc, lumFilterSize, \2634 yuv2ayuv64_X_c(c, lumFilter, lumSrc, lumFilterSize, \
2635 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \2635 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
2636 alpSrc, dest, dstW, y, is_be); \2636 alpSrc, dest, dstW, y, A, Y, U, V, is_be); \
2637}2637}
2638 2638
2639YUV2AYUV64(le, 0)2639YUV2AYUV64(ayuv64, le, 0, 2, 4, 6, 0)
2640YUV2AYUV64(be, 1)2640YUV2AYUV64(ayuv64, be, 0, 2, 4, 6, 1)
2641
2642YUV2AYUV64(xv48, le, 6, 2, 0, 4, 0)
2643YUV2AYUV64(xv48, be, 6, 2, 0, 4, 1)
2644
2645#undef output_pixels
2641 2646
2642static av_always_inline void2647static av_always_inline void
2643yuv2v30_X_c_template(SwsInternal *c, const int16_t *lumFilter,2648yuv2v30_X_c_template(SwsInternal *c, const int16_t *lumFilter,
@@ -3692,6 +3697,12 @@ av_cold void ff_sws_init_output_funcs(SwsInternal *c, · 1048 unmodified lines
3692 case AV_PIX_FMT_XV36BE:3697 case AV_PIX_FMT_XV36BE:
3693 *yuv2packedX = yuv2xv36be_X_c;3698 *yuv2packedX = yuv2xv36be_X_c;
3694 break;3699 break;
3700 case AV_PIX_FMT_XV48LE:
3701 *yuv2packedX = yuv2xv48le_X_c;
3702 break;
3703 case AV_PIX_FMT_XV48BE:
3704 *yuv2packedX = yuv2xv48be_X_c;
3705 break;
3695 case AV_PIX_FMT_Y210LE:3706 case AV_PIX_FMT_Y210LE:
3696 *yuv2packedX = yuv2y210le_X_c;3707 *yuv2packedX = yuv2y210le_X_c;
3697 break;3708 break;
libswscale/utils.c+2−2
@@ -277,8 +277,8 @@ static const FormatEntry format_entries[] = { · 276 unmodified lines
277 [AV_PIX_FMT_XV30LE] = { 1, 1 },277 [AV_PIX_FMT_XV30LE] = { 1, 1 },
278 [AV_PIX_FMT_XV36LE] = { 1, 1 },278 [AV_PIX_FMT_XV36LE] = { 1, 1 },
279 [AV_PIX_FMT_XV36BE] = { 1, 1 },279 [AV_PIX_FMT_XV36BE] = { 1, 1 },
280 [AV_PIX_FMT_XV48LE] = { 1, 0 },280 [AV_PIX_FMT_XV48LE] = { 1, 1 },
281 [AV_PIX_FMT_XV48BE] = { 1, 0 },281 [AV_PIX_FMT_XV48BE] = { 1, 1 },
282 [AV_PIX_FMT_AYUV] = { 1, 1 },282 [AV_PIX_FMT_AYUV] = { 1, 1 },
283 [AV_PIX_FMT_UYVA] = { 1, 1 },283 [AV_PIX_FMT_UYVA] = { 1, 1 },
284 [AV_PIX_FMT_VYU444] = { 1, 1 },284 [AV_PIX_FMT_VYU444] = { 1, 1 },
libswscale/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "version_major.h"29#include "version_major.h"
30 30
31#define LIBSWSCALE_VERSION_MINOR 931#define LIBSWSCALE_VERSION_MINOR 9
32#define LIBSWSCALE_VERSION_MICRO 10032#define LIBSWSCALE_VERSION_MICRO 101
33 33
34#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \34#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
35 LIBSWSCALE_VERSION_MINOR, \35 LIBSWSCALE_VERSION_MINOR, \
tests/ref/fate/filter-pixdesc-xv48be+1−0
@@ -0,0 +1 @@
1pixdesc-xv48be 9d848c07ad49d025b9d1421b906ee191
tests/ref/fate/filter-pixdesc-xv48le+1−0
@@ -0,0 +1 @@
1pixdesc-xv48le 35c1874574e1cf438ea3e97ef2a5a85e
tests/ref/fate/filter-pixfmts-copy+2−0
@@ -109,6 +109,8 @@ x2rgb10le c1e3ac21be04a16bb157b22784524520 · 108 unmodified lines
109xv30le 7dfdd664a9792bb06a19a63353828da0109xv30le 7dfdd664a9792bb06a19a63353828da0
110xv36be 9f556ee59a672fd8725f0bb36ce3e4b0110xv36be 9f556ee59a672fd8725f0bb36ce3e4b0
111xv36le e08dcbde02f1c28a3554f372ad1278e2111xv36le e08dcbde02f1c28a3554f372ad1278e2
112xv48be ce34993b4b4411bba1d852b9b86aa39e
113xv48le 30b5271d569d1ad6aba916fa5cdf82bd
112xyz12be a1ef56bf746d71f59669c28e48fc8450114xyz12be a1ef56bf746d71f59669c28e48fc8450
113xyz12le 831ff03c1ba4ef19374686f16a064d8c115xyz12le 831ff03c1ba4ef19374686f16a064d8c
114y210le 04e9487b6cce38e7531437e946cdd586116y210le 04e9487b6cce38e7531437e946cdd586
tests/ref/fate/filter-pixfmts-crop+2−0
@@ -106,6 +106,8 @@ x2rgb10le f4265aca7a67dbfa9354370098ca6f33 · 105 unmodified lines
106xv30le 7e2350aea136c6fb76dae54e9d3fe1f8106xv30le 7e2350aea136c6fb76dae54e9d3fe1f8
107xv36be 23b6f253fcb375e4145cfcb562268c5f107xv36be 23b6f253fcb375e4145cfcb562268c5f
108xv36le 778286003497f92b84d0bd8258d6b85d108xv36le 778286003497f92b84d0bd8258d6b85d
109xv48be c90889b2cf54cc78bd58e8c47d4eb791
110xv48le 60d81aa388fd40e5bf8aa3323bc4e60f
109xyz12be cb4571f9aaa7b59f999ef327276104b7111xyz12be cb4571f9aaa7b59f999ef327276104b7
110xyz12le cd6aae8d26b18bdb4b9d068586276d91112xyz12le cd6aae8d26b18bdb4b9d068586276d91
111ya16be a3d18014454942a96f15a49947c0c55d113ya16be a3d18014454942a96f15a49947c0c55d
tests/ref/fate/filter-pixfmts-field+2−0
@@ -109,6 +109,8 @@ x2rgb10le a18bc4ae5274e0a8cca9137ecd50c677 · 108 unmodified lines
109xv30le a8e8bfb66178ad5cbef5c82cedc1d3da109xv30le a8e8bfb66178ad5cbef5c82cedc1d3da
110xv36be bcc7bda2d0a5d43db4464af6a4cb5d65110xv36be bcc7bda2d0a5d43db4464af6a4cb5d65
111xv36le ba99f258370f2a56993e8760e6b30194111xv36le ba99f258370f2a56993e8760e6b30194
112xv48be 2abcd986a34789ba4310be3969020d0d
113xv48le 90591fca801a6d0ee3fb19bf3c8587f8
112xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437114xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437
113xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5115xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5
114y210le 4c2fba1dc40322584977d15dd07c9146116y210le 4c2fba1dc40322584977d15dd07c9146
tests/ref/fate/filter-pixfmts-fieldorder+2−0
@@ -98,6 +98,8 @@ x2rgb10le cdf6a9e8a8d081aa768c6ae2e6221676 · 97 unmodified lines
98xv30le 8d1921d4a210d8107c20a805cb9a811798xv30le 8d1921d4a210d8107c20a805cb9a8117
99xv36be 962386c88268f4382004c3a7a82c5eb899xv36be 962386c88268f4382004c3a7a82c5eb8
100xv36le bcceffc985aaa8414c4b8072aa0889bd100xv36le bcceffc985aaa8414c4b8072aa0889bd
101xv48be 4d6e4004b03767f12df8bb4e76c98ddf
102xv48le f1b19076ff69cb8d587454615015297a
101xyz12be 15f5cda71de5fef9cec5e75e3833b6bc103xyz12be 15f5cda71de5fef9cec5e75e3833b6bc
102xyz12le 7be6c8781f38c21a6b8f602f62ca31e6104xyz12le 7be6c8781f38c21a6b8f602f62ca31e6
103y210le 22b1a02a39c4b325726bf8793bf1e8f2105y210le 22b1a02a39c4b325726bf8793bf1e8f2
tests/ref/fate/filter-pixfmts-hflip+2−0
@@ -106,6 +106,8 @@ x2rgb10le d4a8189b65395a88d0a38a7053f3359f · 105 unmodified lines
106xv30le 7370eadd13a2fc79186443713a639332106xv30le 7370eadd13a2fc79186443713a639332
107xv36be 98f578df965eed369f46cb135e2d1345107xv36be 98f578df965eed369f46cb135e2d1345
108xv36le e478b4b54698beb3ce1b9a2dd691d544108xv36le e478b4b54698beb3ce1b9a2dd691d544
109xv48be e030a2c7b1b600cfacb691b6e90c2e3d
110xv48le d2fd726fcd96a696ea67cb6281c45b6b
109xyz12be 25f90259ff8a226befdaec3dfe82996e111xyz12be 25f90259ff8a226befdaec3dfe82996e
110xyz12le 926c0791d59aaff61b2778e8ada3316d112xyz12le 926c0791d59aaff61b2778e8ada3316d
111ya16be d5b342355bdd9e3197e01b13b7c6301e113ya16be d5b342355bdd9e3197e01b13b7c6301e
tests/ref/fate/filter-pixfmts-il+2−0
@@ -108,6 +108,8 @@ x2rgb10le 517fb186f523dc7cdc5c5c6967cfbe94 · 107 unmodified lines
108xv30le ccd81ba2ba845917d5d1c9fa2a6e2fc6108xv30le ccd81ba2ba845917d5d1c9fa2a6e2fc6
109xv36be 3bbb949278ea55cc947ee03bd9c27c2d109xv36be 3bbb949278ea55cc947ee03bd9c27c2d
110xv36le 102c0e817d375ddd6b2cfbb4262dec95110xv36le 102c0e817d375ddd6b2cfbb4262dec95
111xv48be 4d7376651fb7b3e84d00abad6c785aad
112xv48le 7280a114df023964bdba651a9c2ca752
111xyz12be 7c7d54c55f136cbbc50b18029f3be0b3113xyz12be 7c7d54c55f136cbbc50b18029f3be0b3
112xyz12le 090ba6b1170baf2b1358b43b971d33b0114xyz12le 090ba6b1170baf2b1358b43b971d33b0
113y210le d4cf9b53cd7ff22f087743d483e88480115y210le d4cf9b53cd7ff22f087743d483e88480
tests/ref/fate/filter-pixfmts-null+2−0
@@ -109,6 +109,8 @@ x2rgb10le c1e3ac21be04a16bb157b22784524520 · 108 unmodified lines
109xv30le 7dfdd664a9792bb06a19a63353828da0109xv30le 7dfdd664a9792bb06a19a63353828da0
110xv36be 9f556ee59a672fd8725f0bb36ce3e4b0110xv36be 9f556ee59a672fd8725f0bb36ce3e4b0
111xv36le e08dcbde02f1c28a3554f372ad1278e2111xv36le e08dcbde02f1c28a3554f372ad1278e2
112xv48be ce34993b4b4411bba1d852b9b86aa39e
113xv48le 30b5271d569d1ad6aba916fa5cdf82bd
112xyz12be a1ef56bf746d71f59669c28e48fc8450114xyz12be a1ef56bf746d71f59669c28e48fc8450
113xyz12le 831ff03c1ba4ef19374686f16a064d8c115xyz12le 831ff03c1ba4ef19374686f16a064d8c
114y210le 04e9487b6cce38e7531437e946cdd586116y210le 04e9487b6cce38e7531437e946cdd586
tests/ref/fate/filter-pixfmts-scale+2−0
@@ -109,6 +109,8 @@ x2rgb10le d56bdb23fa6a8e12a0b4394987f89935 · 108 unmodified lines
109xv30le a2a351cbf936651b558abfc70a925057109xv30le a2a351cbf936651b558abfc70a925057
110xv36be 4d084adca0228d7750d1e2e877e0d79b110xv36be 4d084adca0228d7750d1e2e877e0d79b
111xv36le de9c74e94dc19c828e1572aa283d8aca111xv36le de9c74e94dc19c828e1572aa283d8aca
112xv48be 9e58d1a045df100b0dec116e13be5b4e
113xv48le c739efbfc98e9944911ffb7861b176b7
112xyz12be c7ba8345998c0141ddc079cdd29b1a40114xyz12be c7ba8345998c0141ddc079cdd29b1a40
113xyz12le 95f5d3a0de834cc495c9032a14987cde115xyz12le 95f5d3a0de834cc495c9032a14987cde
114y210le 7c2aef142d88ab343ec01acd45f38466116y210le 7c2aef142d88ab343ec01acd45f38466
tests/ref/fate/filter-pixfmts-transpose+2−0
@@ -98,6 +98,8 @@ x2rgb10le 09cb1d98fe17ad8a6d9d3bec97ddc845 · 97 unmodified lines
98xv30le ebe26bf75c64406dea8b8a160c978fd998xv30le ebe26bf75c64406dea8b8a160c978fd9
99xv36be 2261a0e3db5ee607d37f68d19704ae1599xv36be 2261a0e3db5ee607d37f68d19704ae15
100xv36le 9202133de91bf64c76ca27d5cd0c816a100xv36le 9202133de91bf64c76ca27d5cd0c816a
101xv48be 14373b7fe123225689e76fe2ce43fb93
102xv48le ad174a65871cacf64275f7f7cef8467d
101xyz12be 68e5cba640f6e4ef72dff950e88b5342103xyz12be 68e5cba640f6e4ef72dff950e88b5342
102xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9104xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9
103ya16be 3e161cb5f225922a80fefdc9cc02a4f9105ya16be 3e161cb5f225922a80fefdc9cc02a4f9
tests/ref/fate/filter-pixfmts-vflip+2−0
@@ -109,6 +109,8 @@ x2rgb10le 262c502230cf3724f8e2cf4737f18a42 · 108 unmodified lines
109xv30le f61ddeb49ba8fb7c92294ad621cbf896109xv30le f61ddeb49ba8fb7c92294ad621cbf896
110xv36be c0272372d3e1a59adb3931ee433a5d5b110xv36be c0272372d3e1a59adb3931ee433a5d5b
111xv36le ffe6ab75ebc09134c3451f8f6ef0d501111xv36le ffe6ab75ebc09134c3451f8f6ef0d501
112xv48be bdfc3217ae456b370dbdcf4d52606a3f
113xv48le 5e603d6635ddeba02f3201c70437cb9d
112xyz12be 23fa9fb36d49dce61e284d41b83e0e6b114xyz12be 23fa9fb36d49dce61e284d41b83e0e6b
113xyz12le ef73e6d1f932a9a355df1eedd628394f115xyz12le ef73e6d1f932a9a355df1eedd628394f
114y210le f8847bedd3ae6e1c0cf84a823f275e31116y210le f8847bedd3ae6e1c0cf84a823f275e31

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t