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
25772577 const int16_t **_lumSrc, int lumFilterSize,
25782578 const int16_t *chrFilter, const int16_t **_chrUSrc,
25792579 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)
25812582 {
25822583 const int32_t **lumSrc = (const int32_t **) _lumSrc,
25832584 **chrUSrc = (const int32_t **) _chrUSrc,
@@ -2612,20 +2613,19 @@ yuv2ayuv64_X_c(SwsInternal *c, const int16_t *lumFilter, · 28 unmodified lines
26122613 Y = 0x8000 + av_clip_int16(Y >> 15);
26132614 U = 0x8000 + av_clip_int16(U >> 15);
26142615 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);
26162618
2617− output_pixels(dest + 8 * i, hasAlpha ? A : 65535);
2618− output_pixels(dest + 8 * i + 2, Y);
2619− output_pixels(dest + 8 * i + 4, U);
2620− output_pixels(dest + 8 * i + 6, V);
2619+ output_pixels(dest + 8 * i + A_offset, hasAlpha ? A : 65535);
2620+ output_pixels(dest + 8 * i + Y_offset, Y);
2621+ output_pixels(dest + 8 * i + U_offset, U);
2622+ output_pixels(dest + 8 * i + V_offset, V);
26212623 }
26222624 }
26232625
2624−#undef output_pixels
2625−
2626−#define YUV2AYUV64(BE_LE, is_be) \
2626+#define YUV2AYUV64(pixfmt, BE_LE, A, Y, U, V, is_be) \
26272627 static void \
2628−yuv2ayuv64 ## BE_LE ##_X_c(SwsInternal *c, const int16_t *lumFilter, \
2628+yuv2 ## pixfmt ## BE_LE ##_X_c(SwsInternal *c, const int16_t *lumFilter, \
26292629 const int16_t **lumSrc, int lumFilterSize, \
26302630 const int16_t *chrFilter, const int16_t **chrUSrc, \
26312631 const int16_t **chrVSrc, int chrFilterSize, \
@@ -2633,11 +2633,16 @@ yuv2ayuv64 ## BE_LE ##_X_c(SwsInternal *c, const int16_t *lumFilter, \ · 1 unmodified line
26332633 { \
26342634 yuv2ayuv64_X_c(c, lumFilter, lumSrc, lumFilterSize, \
26352635 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
2636− alpSrc, dest, dstW, y, is_be); \
2636+ alpSrc, dest, dstW, y, A, Y, U, V, is_be); \
26372637 }
26382638
2639−YUV2AYUV64(le, 0)
2640−YUV2AYUV64(be, 1)
2639+YUV2AYUV64(ayuv64, le, 0, 2, 4, 6, 0)
2640+YUV2AYUV64(ayuv64, be, 0, 2, 4, 6, 1)
2641+
2642+YUV2AYUV64(xv48, le, 6, 2, 0, 4, 0)
2643+YUV2AYUV64(xv48, be, 6, 2, 0, 4, 1)
2644+
2645+#undef output_pixels
26412646
26422647 static av_always_inline void
26432648 yuv2v30_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
36923697 case AV_PIX_FMT_XV36BE:
36933698 *yuv2packedX = yuv2xv36be_X_c;
36943699 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;
36953706 case AV_PIX_FMT_Y210LE:
36963707 *yuv2packedX = yuv2y210le_X_c;
36973708 break;
libswscale/utils.c+2−2
@@ -277,8 +277,8 @@ static const FormatEntry format_entries[] = { · 276 unmodified lines
277277 [AV_PIX_FMT_XV30LE] = { 1, 1 },
278278 [AV_PIX_FMT_XV36LE] = { 1, 1 },
279279 [AV_PIX_FMT_XV36BE] = { 1, 1 },
280− [AV_PIX_FMT_XV48LE] = { 1, 0 },
281− [AV_PIX_FMT_XV48BE] = { 1, 0 },
280+ [AV_PIX_FMT_XV48LE] = { 1, 1 },
281+ [AV_PIX_FMT_XV48BE] = { 1, 1 },
282282 [AV_PIX_FMT_AYUV] = { 1, 1 },
283283 [AV_PIX_FMT_UYVA] = { 1, 1 },
284284 [AV_PIX_FMT_VYU444] = { 1, 1 },
libswscale/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "version_major.h"
3030
3131 #define LIBSWSCALE_VERSION_MINOR 9
32−#define LIBSWSCALE_VERSION_MICRO 100
32+#define LIBSWSCALE_VERSION_MICRO 101
3333
3434 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
3535 LIBSWSCALE_VERSION_MINOR, \
tests/ref/fate/filter-pixdesc-xv48be+1−0
@@ -0,0 +1 @@
1+pixdesc-xv48be 9d848c07ad49d025b9d1421b906ee191
tests/ref/fate/filter-pixdesc-xv48le+1−0
@@ -0,0 +1 @@
1+pixdesc-xv48le 35c1874574e1cf438ea3e97ef2a5a85e
tests/ref/fate/filter-pixfmts-copy+2−0
@@ -109,6 +109,8 @@ x2rgb10le c1e3ac21be04a16bb157b22784524520 · 108 unmodified lines
109109 xv30le 7dfdd664a9792bb06a19a63353828da0
110110 xv36be 9f556ee59a672fd8725f0bb36ce3e4b0
111111 xv36le e08dcbde02f1c28a3554f372ad1278e2
112+xv48be ce34993b4b4411bba1d852b9b86aa39e
113+xv48le 30b5271d569d1ad6aba916fa5cdf82bd
112114 xyz12be a1ef56bf746d71f59669c28e48fc8450
113115 xyz12le 831ff03c1ba4ef19374686f16a064d8c
114116 y210le 04e9487b6cce38e7531437e946cdd586
tests/ref/fate/filter-pixfmts-crop+2−0
@@ -106,6 +106,8 @@ x2rgb10le f4265aca7a67dbfa9354370098ca6f33 · 105 unmodified lines
106106 xv30le 7e2350aea136c6fb76dae54e9d3fe1f8
107107 xv36be 23b6f253fcb375e4145cfcb562268c5f
108108 xv36le 778286003497f92b84d0bd8258d6b85d
109+xv48be c90889b2cf54cc78bd58e8c47d4eb791
110+xv48le 60d81aa388fd40e5bf8aa3323bc4e60f
109111 xyz12be cb4571f9aaa7b59f999ef327276104b7
110112 xyz12le cd6aae8d26b18bdb4b9d068586276d91
111113 ya16be a3d18014454942a96f15a49947c0c55d
tests/ref/fate/filter-pixfmts-field+2−0
@@ -109,6 +109,8 @@ x2rgb10le a18bc4ae5274e0a8cca9137ecd50c677 · 108 unmodified lines
109109 xv30le a8e8bfb66178ad5cbef5c82cedc1d3da
110110 xv36be bcc7bda2d0a5d43db4464af6a4cb5d65
111111 xv36le ba99f258370f2a56993e8760e6b30194
112+xv48be 2abcd986a34789ba4310be3969020d0d
113+xv48le 90591fca801a6d0ee3fb19bf3c8587f8
112114 xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437
113115 xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5
114116 y210le 4c2fba1dc40322584977d15dd07c9146
tests/ref/fate/filter-pixfmts-fieldorder+2−0
@@ -98,6 +98,8 @@ x2rgb10le cdf6a9e8a8d081aa768c6ae2e6221676 · 97 unmodified lines
9898 xv30le 8d1921d4a210d8107c20a805cb9a8117
9999 xv36be 962386c88268f4382004c3a7a82c5eb8
100100 xv36le bcceffc985aaa8414c4b8072aa0889bd
101+xv48be 4d6e4004b03767f12df8bb4e76c98ddf
102+xv48le f1b19076ff69cb8d587454615015297a
101103 xyz12be 15f5cda71de5fef9cec5e75e3833b6bc
102104 xyz12le 7be6c8781f38c21a6b8f602f62ca31e6
103105 y210le 22b1a02a39c4b325726bf8793bf1e8f2
tests/ref/fate/filter-pixfmts-hflip+2−0
@@ -106,6 +106,8 @@ x2rgb10le d4a8189b65395a88d0a38a7053f3359f · 105 unmodified lines
106106 xv30le 7370eadd13a2fc79186443713a639332
107107 xv36be 98f578df965eed369f46cb135e2d1345
108108 xv36le e478b4b54698beb3ce1b9a2dd691d544
109+xv48be e030a2c7b1b600cfacb691b6e90c2e3d
110+xv48le d2fd726fcd96a696ea67cb6281c45b6b
109111 xyz12be 25f90259ff8a226befdaec3dfe82996e
110112 xyz12le 926c0791d59aaff61b2778e8ada3316d
111113 ya16be d5b342355bdd9e3197e01b13b7c6301e
tests/ref/fate/filter-pixfmts-il+2−0
@@ -108,6 +108,8 @@ x2rgb10le 517fb186f523dc7cdc5c5c6967cfbe94 · 107 unmodified lines
108108 xv30le ccd81ba2ba845917d5d1c9fa2a6e2fc6
109109 xv36be 3bbb949278ea55cc947ee03bd9c27c2d
110110 xv36le 102c0e817d375ddd6b2cfbb4262dec95
111+xv48be 4d7376651fb7b3e84d00abad6c785aad
112+xv48le 7280a114df023964bdba651a9c2ca752
111113 xyz12be 7c7d54c55f136cbbc50b18029f3be0b3
112114 xyz12le 090ba6b1170baf2b1358b43b971d33b0
113115 y210le d4cf9b53cd7ff22f087743d483e88480
tests/ref/fate/filter-pixfmts-null+2−0
@@ -109,6 +109,8 @@ x2rgb10le c1e3ac21be04a16bb157b22784524520 · 108 unmodified lines
109109 xv30le 7dfdd664a9792bb06a19a63353828da0
110110 xv36be 9f556ee59a672fd8725f0bb36ce3e4b0
111111 xv36le e08dcbde02f1c28a3554f372ad1278e2
112+xv48be ce34993b4b4411bba1d852b9b86aa39e
113+xv48le 30b5271d569d1ad6aba916fa5cdf82bd
112114 xyz12be a1ef56bf746d71f59669c28e48fc8450
113115 xyz12le 831ff03c1ba4ef19374686f16a064d8c
114116 y210le 04e9487b6cce38e7531437e946cdd586
tests/ref/fate/filter-pixfmts-scale+2−0
@@ -109,6 +109,8 @@ x2rgb10le d56bdb23fa6a8e12a0b4394987f89935 · 108 unmodified lines
109109 xv30le a2a351cbf936651b558abfc70a925057
110110 xv36be 4d084adca0228d7750d1e2e877e0d79b
111111 xv36le de9c74e94dc19c828e1572aa283d8aca
112+xv48be 9e58d1a045df100b0dec116e13be5b4e
113+xv48le c739efbfc98e9944911ffb7861b176b7
112114 xyz12be c7ba8345998c0141ddc079cdd29b1a40
113115 xyz12le 95f5d3a0de834cc495c9032a14987cde
114116 y210le 7c2aef142d88ab343ec01acd45f38466
tests/ref/fate/filter-pixfmts-transpose+2−0
@@ -98,6 +98,8 @@ x2rgb10le 09cb1d98fe17ad8a6d9d3bec97ddc845 · 97 unmodified lines
9898 xv30le ebe26bf75c64406dea8b8a160c978fd9
9999 xv36be 2261a0e3db5ee607d37f68d19704ae15
100100 xv36le 9202133de91bf64c76ca27d5cd0c816a
101+xv48be 14373b7fe123225689e76fe2ce43fb93
102+xv48le ad174a65871cacf64275f7f7cef8467d
101103 xyz12be 68e5cba640f6e4ef72dff950e88b5342
102104 xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9
103105 ya16be 3e161cb5f225922a80fefdc9cc02a4f9
tests/ref/fate/filter-pixfmts-vflip+2−0
@@ -109,6 +109,8 @@ x2rgb10le 262c502230cf3724f8e2cf4737f18a42 · 108 unmodified lines
109109 xv30le f61ddeb49ba8fb7c92294ad621cbf896
110110 xv36be c0272372d3e1a59adb3931ee433a5d5b
111111 xv36le ffe6ab75ebc09134c3451f8f6ef0d501
112+xv48be bdfc3217ae456b370dbdcf4d52606a3f
113+xv48le 5e603d6635ddeba02f3201c70437cb9d
112114 xyz12be 23fa9fb36d49dce61e284d41b83e0e6b
113115 xyz12le ef73e6d1f932a9a355df1eedd628394f
114116 y210le 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