History

swscale/output: add AYUV64BE output support

James Almer committed 2 years ago

Commit 08c632e1 parent 5a699c813 files · +49 −11Browse files

Unified · Split

13 files
  1. libswscale/output.c +37 −10
  2. libswscale/utils.c +1 −1
  3. tests/ref/fate/filter-pixdesc-ayuv64be +1 −0
  4. tests/ref/fate/filter-pixfmts-copy +1 −0
  5. tests/ref/fate/filter-pixfmts-crop +1 −0
  6. tests/ref/fate/filter-pixfmts-field +1 −0
  7. tests/ref/fate/filter-pixfmts-fieldorder +1 −0
  8. tests/ref/fate/filter-pixfmts-hflip +1 −0
  9. tests/ref/fate/filter-pixfmts-il +1 −0
  10. tests/ref/fate/filter-pixfmts-null +1 −0
  11. tests/ref/fate/filter-pixfmts-scale +1 −0
  12. tests/ref/fate/filter-pixfmts-transpose +1 −0
  13. tests/ref/fate/filter-pixfmts-vflip +1 −0
libswscale/output.c+37−10
@@ -2564,12 +2564,19 @@ yuv2ya8_X_c(SwsContext *c, const int16_t *lumFilter, · 2563 unmodified lines
25642564 }
25652565 }
25662566
2567−static void
2568−yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,
2569− const int16_t **_lumSrc, int lumFilterSize,
2570− const int16_t *chrFilter, const int16_t **_chrUSrc,
2571− const int16_t **_chrVSrc, int chrFilterSize,
2572− const int16_t **_alpSrc, uint8_t *dest, int dstW, int y)
2567+#define output_pixels(pos, val) \
2568+ if (is_be) { \
2569+ AV_WB16(pos, val); \
2570+ } else { \
2571+ AV_WL16(pos, val); \
2572+ }
2573+
2574+static av_always_inline void
2575+yuv2ayuv64_X_c(SwsContext *c, const int16_t *lumFilter,
2576+ const int16_t **_lumSrc, int lumFilterSize,
2577+ const int16_t *chrFilter, const int16_t **_chrUSrc,
2578+ const int16_t **_chrVSrc, int chrFilterSize,
2579+ const int16_t **_alpSrc, uint8_t *dest, int dstW, int y, int is_be)
25732580 {
25742581 const int32_t **lumSrc = (const int32_t **) _lumSrc,
25752582 **chrUSrc = (const int32_t **) _chrUSrc,
@@ -2606,13 +2613,30 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter, · 30 unmodified lines
26062613 V = 0x8000 + av_clip_int16(V >> 15);
26072614 A = 0x8000 + av_clip_int16(A >> 15);
26082615
2609− AV_WL16(dest + 8 * i, hasAlpha ? A : 65535);
2610− AV_WL16(dest + 8 * i + 2, Y);
2611− AV_WL16(dest + 8 * i + 4, U);
2612− AV_WL16(dest + 8 * i + 6, V);
2616+ output_pixels(dest + 8 * i, hasAlpha ? A : 65535);
2617+ output_pixels(dest + 8 * i + 2, Y);
2618+ output_pixels(dest + 8 * i + 4, U);
2619+ output_pixels(dest + 8 * i + 6, V);
26132620 }
26142621 }
26152622
2623+#undef output_pixels
2624+
2625+#define YUV2AYUV64(BE_LE, is_be) \
2626+static void \
2627+yuv2ayuv64 ## BE_LE ##_X_c(SwsContext *c, const int16_t *lumFilter, \
2628+ const int16_t **lumSrc, int lumFilterSize, \
2629+ const int16_t *chrFilter, const int16_t **chrUSrc, \
2630+ const int16_t **chrVSrc, int chrFilterSize, \
2631+ const int16_t **alpSrc, uint8_t *dest, int dstW, int y) \
2632+{ \
2633+ yuv2ayuv64_X_c(c, lumFilter, lumSrc, lumFilterSize, \
2634+ chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
2635+ alpSrc, dest, dstW, y, is_be); \
2636+}
2637+
2638+YUV2AYUV64(le, 0)
2639+YUV2AYUV64(be, 1)
26162640
26172641 static av_always_inline void
26182642 yuv2v30_X_c_template(SwsContext *c, const int16_t *lumFilter,
@@ -3597,6 +3621,9 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 978 unmodified lines
35973621 case AV_PIX_FMT_AYUV64LE:
35983622 *yuv2packedX = yuv2ayuv64le_X_c;
35993623 break;
3624+ case AV_PIX_FMT_AYUV64BE:
3625+ *yuv2packedX = yuv2ayuv64be_X_c;
3626+ break;
36003627 case AV_PIX_FMT_AYUV:
36013628 *yuv2packed1 = yuv2ayuv_1_c;
36023629 *yuv2packed2 = yuv2ayuv_2_c;
libswscale/utils.c+1−1
@@ -231,7 +231,7 @@ static const FormatEntry format_entries[] = { · 230 unmodified lines
231231 [AV_PIX_FMT_XYZ12BE] = { 1, 1, 1 },
232232 [AV_PIX_FMT_XYZ12LE] = { 1, 1, 1 },
233233 [AV_PIX_FMT_AYUV64LE] = { 1, 1},
234− [AV_PIX_FMT_AYUV64BE] = { 1, 0},
234+ [AV_PIX_FMT_AYUV64BE] = { 1, 1 },
235235 [AV_PIX_FMT_P010LE] = { 1, 1 },
236236 [AV_PIX_FMT_P010BE] = { 1, 1 },
237237 [AV_PIX_FMT_P012LE] = { 1, 1 },
tests/ref/fate/filter-pixdesc-ayuv64be+1−0
@@ -0,0 +1 @@
1+pixdesc-ayuv64be a4311bdc59c9b7a48d911647845d8214
tests/ref/fate/filter-pixfmts-copy+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr 023ecf6396d324edb113e4a483b79ba2
44 argb f003b555ef429222005d33844cca9325
55 ayuv 631859cdc018cd9671482e435a87becc
6+ayuv64be 553477ffeeaf59d54fa12012ff13c783
67 ayuv64le 07b9c969dfbe4add4c0626773b151d4f
78 bgr0 6fcd67c8e6cec723dab21c70cf53dc16
89 bgr24 4cff3814819f02ecf5824edfd768d2b1
tests/ref/fate/filter-pixfmts-crop+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr 1d21f5b8a20186ac9dd54459c986a2a7
44 argb 8b822972049a1e207000763f2564d6e0
55 ayuv fb7bdb9f775c47099892c0588f5be426
6+ayuv64be aec88528e34e99fb8baa22ad58c97210
67 ayuv64le ab2f7bc8f150af47c42c778e3ea28bce
78 bgr0 38a84849a9198667c348c686802e3b52
89 bgr24 1dacd8e04bf0eff163e82250d01a9cc7
tests/ref/fate/filter-pixfmts-field+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr c0eb95959edf5d40ff8af315e62d0f8a
44 argb 6dca4f2987b49b7d63f702d17bace630
55 ayuv 25f429cbd3c1ac60851d69c262601415
6+ayuv64be 04b79237163bca61e040b5324552a4d3
67 ayuv64le d9836decca6323ba88b3b3d02257c0b6
78 bgr0 1da3fdbac616b3b410d081e39ed7a1f6
89 bgr24 573c76d77b1cbe6534ea7c0267dc1b13
tests/ref/fate/filter-pixfmts-fieldorder+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr 832924b5351361db68dbdbb96c60ae55
44 argb 80d08e68cb91bc8f2f817516e65f0bd0
55 ayuv 7fd34c9bd28c8ac7979eaa41c1a8ab9f
6+ayuv64be beb82e063e760c916ee5dbc054a9a32a
67 ayuv64le 84ef6260fe02427da946d4a2207fb54c
78 bgr0 d2c676224ea80ac3ce01afde325ea1a0
89 bgr24 b7fdbcd10f20e6ea2d40aae0f329f80d
tests/ref/fate/filter-pixfmts-hflip+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr d2da6c3ee72e4a89a7cd011dd08566b2
44 argb 36cf791c52c5463bfc52a070de54337e
55 ayuv ae787b7ee2a8b1f4af2335ddca56ff58
6+ayuv64be 9d613f9046e20009f5c4be3f4bd7c3cc
67 ayuv64le 4cedbc38b3d4dcb26cdab170ce6d667b
78 bgr0 66e9fda4e658d73bfe4fc9d792542271
89 bgr24 db074979bd684ca4547e28681ad3f6ab
tests/ref/fate/filter-pixfmts-il+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr 97603869e6248a8e5d8501563a11b114
44 argb 9e50e6ef02c83f28e97865a1f46ddfcd
55 ayuv 6e65a0b3bb18e89997dd558a7331df17
6+ayuv64be a9bec32e276bfb03b5673279beee5381
67 ayuv64le 6f45f683e99ddf4180c7c7f47719efcc
78 bgr0 590dcd1297d1dd4541eea217381db604
89 bgr24 73afe7b447b083a7c2d682abe8dd451a
tests/ref/fate/filter-pixfmts-null+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr 023ecf6396d324edb113e4a483b79ba2
44 argb f003b555ef429222005d33844cca9325
55 ayuv 631859cdc018cd9671482e435a87becc
6+ayuv64be 553477ffeeaf59d54fa12012ff13c783
67 ayuv64le 07b9c969dfbe4add4c0626773b151d4f
78 bgr0 6fcd67c8e6cec723dab21c70cf53dc16
89 bgr24 4cff3814819f02ecf5824edfd768d2b1
tests/ref/fate/filter-pixfmts-scale+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr 63f2eaa8712ea6108985f4a0b83587c9
44 argb f0e17c71a40643c33a5bcfb481f6d8f8
55 ayuv f20a5cc54f6459aad6b5f36ae092da5d
6+ayuv64be 8cfd8a03f74829efa5ff1c1acd6aa5fd
67 ayuv64le 59fb016f9874062d0be77cb3920ffed2
78 bgr0 243d58ca64f97b2f415b4c63cb79f0e1
89 bgr24 18744aaab4b8bce065a7144dc0ccf921
tests/ref/fate/filter-pixfmts-transpose+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr 6d6f896f853a6c6f93ee70dba9af3d17
44 argb 87bbd23debb94d486ac3a6b6c0b005f9
55 ayuv ba6a6588737f8ddffd2018d9c667e559
6+ayuv64be 07bcc9d722b57b60de56ab44a88cd07e
67 ayuv64le e4c07e0d5b333b3bc9eb4f3ce6af3a2c
78 bgr0 df3a6eedd4939ce09a357b655ac2962a
89 bgr24 f9a08135e5d58c0b2a5509c369a88414
tests/ref/fate/filter-pixfmts-vflip+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 abgr 8b94f489e68802d76f1e2844688a4911
44 argb 3fd6af7ef2364d8aa845d45db289a04a
55 ayuv c3bc52cd5ae5094c85bd465a259e2870
6+ayuv64be 2263f36f970c2a3d79d4971b56d107cf
67 ayuv64le 558671dd31d0754cfa6344eaf441df78
78 bgr0 7117438cf000254610f23625265769b5
89 bgr24 52b2c21cbc166978a38a646c354b6858

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