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
2564 }2564 }
2565}2565}
2566 2566
2567static void2567#define output_pixels(pos, val) \
2568yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,2568 if (is_be) { \
2569 const int16_t **_lumSrc, int lumFilterSize,2569 AV_WB16(pos, val); \
2570 const int16_t *chrFilter, const int16_t **_chrUSrc,2570 } else { \
2571 const int16_t **_chrVSrc, int chrFilterSize,2571 AV_WL16(pos, val); \
2572 const int16_t **_alpSrc, uint8_t *dest, int dstW, int y)2572 }
2573
2574static av_always_inline void
2575yuv2ayuv64_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)
2573{2580{
2574 const int32_t **lumSrc = (const int32_t **) _lumSrc,2581 const int32_t **lumSrc = (const int32_t **) _lumSrc,
2575 **chrUSrc = (const int32_t **) _chrUSrc,2582 **chrUSrc = (const int32_t **) _chrUSrc,
@@ -2606,13 +2613,30 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter, · 30 unmodified lines
2606 V = 0x8000 + av_clip_int16(V >> 15);2613 V = 0x8000 + av_clip_int16(V >> 15);
2607 A = 0x8000 + av_clip_int16(A >> 15);2614 A = 0x8000 + av_clip_int16(A >> 15);
2608 2615
2609 AV_WL16(dest + 8 * i, hasAlpha ? A : 65535);2616 output_pixels(dest + 8 * i, hasAlpha ? A : 65535);
2610 AV_WL16(dest + 8 * i + 2, Y);2617 output_pixels(dest + 8 * i + 2, Y);
2611 AV_WL16(dest + 8 * i + 4, U);2618 output_pixels(dest + 8 * i + 4, U);
2612 AV_WL16(dest + 8 * i + 6, V);2619 output_pixels(dest + 8 * i + 6, V);
2613 }2620 }
2614}2621}
2615 2622
2623#undef output_pixels
2624
2625#define YUV2AYUV64(BE_LE, is_be) \
2626static void \
2627yuv2ayuv64 ## 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
2638YUV2AYUV64(le, 0)
2639YUV2AYUV64(be, 1)
2616 2640
2617static av_always_inline void2641static av_always_inline void
2618yuv2v30_X_c_template(SwsContext *c, const int16_t *lumFilter,2642yuv2v30_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
3597 case AV_PIX_FMT_AYUV64LE:3621 case AV_PIX_FMT_AYUV64LE:
3598 *yuv2packedX = yuv2ayuv64le_X_c;3622 *yuv2packedX = yuv2ayuv64le_X_c;
3599 break;3623 break;
3624 case AV_PIX_FMT_AYUV64BE:
3625 *yuv2packedX = yuv2ayuv64be_X_c;
3626 break;
3600 case AV_PIX_FMT_AYUV:3627 case AV_PIX_FMT_AYUV:
3601 *yuv2packed1 = yuv2ayuv_1_c;3628 *yuv2packed1 = yuv2ayuv_1_c;
3602 *yuv2packed2 = yuv2ayuv_2_c;3629 *yuv2packed2 = yuv2ayuv_2_c;
libswscale/utils.c+1−1
@@ -231,7 +231,7 @@ static const FormatEntry format_entries[] = { · 230 unmodified lines
231 [AV_PIX_FMT_XYZ12BE] = { 1, 1, 1 },231 [AV_PIX_FMT_XYZ12BE] = { 1, 1, 1 },
232 [AV_PIX_FMT_XYZ12LE] = { 1, 1, 1 },232 [AV_PIX_FMT_XYZ12LE] = { 1, 1, 1 },
233 [AV_PIX_FMT_AYUV64LE] = { 1, 1},233 [AV_PIX_FMT_AYUV64LE] = { 1, 1},
234 [AV_PIX_FMT_AYUV64BE] = { 1, 0},234 [AV_PIX_FMT_AYUV64BE] = { 1, 1 },
235 [AV_PIX_FMT_P010LE] = { 1, 1 },235 [AV_PIX_FMT_P010LE] = { 1, 1 },
236 [AV_PIX_FMT_P010BE] = { 1, 1 },236 [AV_PIX_FMT_P010BE] = { 1, 1 },
237 [AV_PIX_FMT_P012LE] = { 1, 1 },237 [AV_PIX_FMT_P012LE] = { 1, 1 },
tests/ref/fate/filter-pixdesc-ayuv64be+1−0
@@ -0,0 +1 @@
1pixdesc-ayuv64be a4311bdc59c9b7a48d911647845d8214
tests/ref/fate/filter-pixfmts-copy+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr 023ecf6396d324edb113e4a483b79ba23abgr 023ecf6396d324edb113e4a483b79ba2
4argb f003b555ef429222005d33844cca93254argb f003b555ef429222005d33844cca9325
5ayuv 631859cdc018cd9671482e435a87becc5ayuv 631859cdc018cd9671482e435a87becc
6ayuv64be 553477ffeeaf59d54fa12012ff13c783
6ayuv64le 07b9c969dfbe4add4c0626773b151d4f7ayuv64le 07b9c969dfbe4add4c0626773b151d4f
7bgr0 6fcd67c8e6cec723dab21c70cf53dc168bgr0 6fcd67c8e6cec723dab21c70cf53dc16
8bgr24 4cff3814819f02ecf5824edfd768d2b19bgr24 4cff3814819f02ecf5824edfd768d2b1
tests/ref/fate/filter-pixfmts-crop+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr 1d21f5b8a20186ac9dd54459c986a2a73abgr 1d21f5b8a20186ac9dd54459c986a2a7
4argb 8b822972049a1e207000763f2564d6e04argb 8b822972049a1e207000763f2564d6e0
5ayuv fb7bdb9f775c47099892c0588f5be4265ayuv fb7bdb9f775c47099892c0588f5be426
6ayuv64be aec88528e34e99fb8baa22ad58c97210
6ayuv64le ab2f7bc8f150af47c42c778e3ea28bce7ayuv64le ab2f7bc8f150af47c42c778e3ea28bce
7bgr0 38a84849a9198667c348c686802e3b528bgr0 38a84849a9198667c348c686802e3b52
8bgr24 1dacd8e04bf0eff163e82250d01a9cc79bgr24 1dacd8e04bf0eff163e82250d01a9cc7
tests/ref/fate/filter-pixfmts-field+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr c0eb95959edf5d40ff8af315e62d0f8a3abgr c0eb95959edf5d40ff8af315e62d0f8a
4argb 6dca4f2987b49b7d63f702d17bace6304argb 6dca4f2987b49b7d63f702d17bace630
5ayuv 25f429cbd3c1ac60851d69c2626014155ayuv 25f429cbd3c1ac60851d69c262601415
6ayuv64be 04b79237163bca61e040b5324552a4d3
6ayuv64le d9836decca6323ba88b3b3d02257c0b67ayuv64le d9836decca6323ba88b3b3d02257c0b6
7bgr0 1da3fdbac616b3b410d081e39ed7a1f68bgr0 1da3fdbac616b3b410d081e39ed7a1f6
8bgr24 573c76d77b1cbe6534ea7c0267dc1b139bgr24 573c76d77b1cbe6534ea7c0267dc1b13
tests/ref/fate/filter-pixfmts-fieldorder+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr 832924b5351361db68dbdbb96c60ae553abgr 832924b5351361db68dbdbb96c60ae55
4argb 80d08e68cb91bc8f2f817516e65f0bd04argb 80d08e68cb91bc8f2f817516e65f0bd0
5ayuv 7fd34c9bd28c8ac7979eaa41c1a8ab9f5ayuv 7fd34c9bd28c8ac7979eaa41c1a8ab9f
6ayuv64be beb82e063e760c916ee5dbc054a9a32a
6ayuv64le 84ef6260fe02427da946d4a2207fb54c7ayuv64le 84ef6260fe02427da946d4a2207fb54c
7bgr0 d2c676224ea80ac3ce01afde325ea1a08bgr0 d2c676224ea80ac3ce01afde325ea1a0
8bgr24 b7fdbcd10f20e6ea2d40aae0f329f80d9bgr24 b7fdbcd10f20e6ea2d40aae0f329f80d
tests/ref/fate/filter-pixfmts-hflip+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr d2da6c3ee72e4a89a7cd011dd08566b23abgr d2da6c3ee72e4a89a7cd011dd08566b2
4argb 36cf791c52c5463bfc52a070de54337e4argb 36cf791c52c5463bfc52a070de54337e
5ayuv ae787b7ee2a8b1f4af2335ddca56ff585ayuv ae787b7ee2a8b1f4af2335ddca56ff58
6ayuv64be 9d613f9046e20009f5c4be3f4bd7c3cc
6ayuv64le 4cedbc38b3d4dcb26cdab170ce6d667b7ayuv64le 4cedbc38b3d4dcb26cdab170ce6d667b
7bgr0 66e9fda4e658d73bfe4fc9d7925422718bgr0 66e9fda4e658d73bfe4fc9d792542271
8bgr24 db074979bd684ca4547e28681ad3f6ab9bgr24 db074979bd684ca4547e28681ad3f6ab
tests/ref/fate/filter-pixfmts-il+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr 97603869e6248a8e5d8501563a11b1143abgr 97603869e6248a8e5d8501563a11b114
4argb 9e50e6ef02c83f28e97865a1f46ddfcd4argb 9e50e6ef02c83f28e97865a1f46ddfcd
5ayuv 6e65a0b3bb18e89997dd558a7331df175ayuv 6e65a0b3bb18e89997dd558a7331df17
6ayuv64be a9bec32e276bfb03b5673279beee5381
6ayuv64le 6f45f683e99ddf4180c7c7f47719efcc7ayuv64le 6f45f683e99ddf4180c7c7f47719efcc
7bgr0 590dcd1297d1dd4541eea217381db6048bgr0 590dcd1297d1dd4541eea217381db604
8bgr24 73afe7b447b083a7c2d682abe8dd451a9bgr24 73afe7b447b083a7c2d682abe8dd451a
tests/ref/fate/filter-pixfmts-null+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr 023ecf6396d324edb113e4a483b79ba23abgr 023ecf6396d324edb113e4a483b79ba2
4argb f003b555ef429222005d33844cca93254argb f003b555ef429222005d33844cca9325
5ayuv 631859cdc018cd9671482e435a87becc5ayuv 631859cdc018cd9671482e435a87becc
6ayuv64be 553477ffeeaf59d54fa12012ff13c783
6ayuv64le 07b9c969dfbe4add4c0626773b151d4f7ayuv64le 07b9c969dfbe4add4c0626773b151d4f
7bgr0 6fcd67c8e6cec723dab21c70cf53dc168bgr0 6fcd67c8e6cec723dab21c70cf53dc16
8bgr24 4cff3814819f02ecf5824edfd768d2b19bgr24 4cff3814819f02ecf5824edfd768d2b1
tests/ref/fate/filter-pixfmts-scale+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr 63f2eaa8712ea6108985f4a0b83587c93abgr 63f2eaa8712ea6108985f4a0b83587c9
4argb f0e17c71a40643c33a5bcfb481f6d8f84argb f0e17c71a40643c33a5bcfb481f6d8f8
5ayuv f20a5cc54f6459aad6b5f36ae092da5d5ayuv f20a5cc54f6459aad6b5f36ae092da5d
6ayuv64be 8cfd8a03f74829efa5ff1c1acd6aa5fd
6ayuv64le 59fb016f9874062d0be77cb3920ffed27ayuv64le 59fb016f9874062d0be77cb3920ffed2
7bgr0 243d58ca64f97b2f415b4c63cb79f0e18bgr0 243d58ca64f97b2f415b4c63cb79f0e1
8bgr24 18744aaab4b8bce065a7144dc0ccf9219bgr24 18744aaab4b8bce065a7144dc0ccf921
tests/ref/fate/filter-pixfmts-transpose+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr 6d6f896f853a6c6f93ee70dba9af3d173abgr 6d6f896f853a6c6f93ee70dba9af3d17
4argb 87bbd23debb94d486ac3a6b6c0b005f94argb 87bbd23debb94d486ac3a6b6c0b005f9
5ayuv ba6a6588737f8ddffd2018d9c667e5595ayuv ba6a6588737f8ddffd2018d9c667e559
6ayuv64be 07bcc9d722b57b60de56ab44a88cd07e
6ayuv64le e4c07e0d5b333b3bc9eb4f3ce6af3a2c7ayuv64le e4c07e0d5b333b3bc9eb4f3ce6af3a2c
7bgr0 df3a6eedd4939ce09a357b655ac2962a8bgr0 df3a6eedd4939ce09a357b655ac2962a
8bgr24 f9a08135e5d58c0b2a5509c369a884149bgr24 f9a08135e5d58c0b2a5509c369a88414
tests/ref/fate/filter-pixfmts-vflip+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3abgr 8b94f489e68802d76f1e2844688a49113abgr 8b94f489e68802d76f1e2844688a4911
4argb 3fd6af7ef2364d8aa845d45db289a04a4argb 3fd6af7ef2364d8aa845d45db289a04a
5ayuv c3bc52cd5ae5094c85bd465a259e28705ayuv c3bc52cd5ae5094c85bd465a259e2870
6ayuv64be 2263f36f970c2a3d79d4971b56d107cf
6ayuv64le 558671dd31d0754cfa6344eaf441df787ayuv64le 558671dd31d0754cfa6344eaf441df78
7bgr0 7117438cf000254610f23625265769b58bgr0 7117438cf000254610f23625265769b5
8bgr24 52b2c21cbc166978a38a646c354b68589bgr24 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