History

swscale: add GBRAP14 format support

Paul B Mahol committed 3 years ago

Commit 29b673b1 parent 8e1ef7c20 files · +46 −1Browse files

Unified · Split

20 files
  1. libavcodec/raw.c +2 −0
  2. libavformat/nut.c +2 −0
  3. libswscale/input.c +7 −0
  4. libswscale/output.c +2 −0
  5. libswscale/swscale_unscaled.c +3 −0
  6. libswscale/utils.c +6 −0
  7. libswscale/version.h +1 −1
  8. tests/ref/fate/filter-pixdesc-gbrap14be +1 −0
  9. tests/ref/fate/filter-pixdesc-gbrap14le +1 −0
  10. tests/ref/fate/filter-pixfmts-copy +2 −0
  11. tests/ref/fate/filter-pixfmts-crop +2 −0
  12. tests/ref/fate/filter-pixfmts-field +2 −0
  13. tests/ref/fate/filter-pixfmts-fieldorder +2 −0
  14. tests/ref/fate/filter-pixfmts-hflip +2 −0
  15. tests/ref/fate/filter-pixfmts-il +2 −0
  16. tests/ref/fate/filter-pixfmts-null +2 −0
  17. tests/ref/fate/filter-pixfmts-pad +1 −0
  18. tests/ref/fate/filter-pixfmts-scale +2 −0
  19. tests/ref/fate/filter-pixfmts-transpose +2 −0
  20. tests/ref/fate/filter-pixfmts-vflip +2 −0
libavcodec/raw.c+2−0
@@ -206,6 +206,8 @@ static const PixelFormatTag raw_pix_fmt_tags[] = { · 205 unmodified lines
206206 { AV_PIX_FMT_GBRAP10BE, MKTAG(10 , 00 , '4', 'G') },
207207 { AV_PIX_FMT_GBRAP12LE, MKTAG('G', '4', 00 , 12 ) },
208208 { AV_PIX_FMT_GBRAP12BE, MKTAG(12 , 00 , '4', 'G') },
209+ { AV_PIX_FMT_GBRAP14LE, MKTAG('G', '4', 00 , 14 ) },
210+ { AV_PIX_FMT_GBRAP14BE, MKTAG(14 , 00 , '4', 'G') },
209211 { AV_PIX_FMT_GBRAP16LE, MKTAG('G', '4', 00 , 16 ) },
210212 { AV_PIX_FMT_GBRAP16BE, MKTAG(16 , 00 , '4', 'G') },
211213
libavformat/nut.c+2−0
@@ -184,6 +184,8 @@ const AVCodecTag ff_nut_video_tags[] = { · 183 unmodified lines
184184 { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 00 , '4', 'G') },
185185 { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 12 ) },
186186 { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 00 , '4', 'G') },
187+ { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 14 ) },
188+ { AV_CODEC_ID_RAWVIDEO, MKTAG(14 , 00 , '4', 'G') },
187189 { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 16 ) },
188190 { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 00 , '4', 'G') },
189191
libswscale/input.c+7−0
@@ -1149,6 +1149,7 @@ rgb9plus_planar_funcs(16) · 1148 unmodified lines
11491149
11501150 rgb9plus_planar_transparency_funcs(10)
11511151 rgb9plus_planar_transparency_funcs(12)
1152+rgb9plus_planar_transparency_funcs(14)
11521153 rgb9plus_planar_transparency_funcs(16)
11531154
11541155 #define rgbf32_planar_funcs_endian(endian_name, endian) \
@@ -1326,6 +1327,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 171 unmodified lines
13261327 case AV_PIX_FMT_GBRP12LE:
13271328 c->readChrPlanar = planar_rgb12le_to_uv;
13281329 break;
1330+ case AV_PIX_FMT_GBRAP14LE:
13291331 case AV_PIX_FMT_GBRP14LE:
13301332 c->readChrPlanar = planar_rgb14le_to_uv;
13311333 break;
@@ -1348,6 +1350,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 16 unmodified lines
13481350 case AV_PIX_FMT_GBRP12BE:
13491351 c->readChrPlanar = planar_rgb12be_to_uv;
13501352 break;
1353+ case AV_PIX_FMT_GBRAP14BE:
13511354 case AV_PIX_FMT_GBRP14BE:
13521355 c->readChrPlanar = planar_rgb14be_to_uv;
13531356 break;
@@ -1686,6 +1689,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 332 unmodified lines
16861689 case AV_PIX_FMT_GBRP12LE:
16871690 c->readLumPlanar = planar_rgb12le_to_y;
16881691 break;
1692+ case AV_PIX_FMT_GBRAP14LE:
1693+ c->readAlpPlanar = planar_rgb14le_to_a;
16891694 case AV_PIX_FMT_GBRP14LE:
16901695 c->readLumPlanar = planar_rgb14le_to_y;
16911696 break;
@@ -1712,6 +1717,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 20 unmodified lines
17121717 case AV_PIX_FMT_GBRP12BE:
17131718 c->readLumPlanar = planar_rgb12be_to_y;
17141719 break;
1720+ case AV_PIX_FMT_GBRAP14BE:
1721+ c->readAlpPlanar = planar_rgb14be_to_a;
17151722 case AV_PIX_FMT_GBRP14BE:
17161723 c->readLumPlanar = planar_rgb14be_to_y;
17171724 break;
libswscale/output.c+2−0
@@ -3047,6 +3047,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 3046 unmodified lines
30473047 case AV_PIX_FMT_GBRAP10LE:
30483048 case AV_PIX_FMT_GBRAP12BE:
30493049 case AV_PIX_FMT_GBRAP12LE:
3050+ case AV_PIX_FMT_GBRAP14BE:
3051+ case AV_PIX_FMT_GBRAP14LE:
30503052 *yuv2anyX = yuv2gbrp_full_X_c;
30513053 break;
30523054 case AV_PIX_FMT_GBRP16BE:
libswscale/swscale_unscaled.c+3−0
@@ -2073,6 +2073,7 @@ void ff_get_unscaled_swscale(SwsContext *c) · 2072 unmodified lines
20732073 dstFormat == AV_PIX_FMT_GBRP16LE || dstFormat == AV_PIX_FMT_GBRP16BE ||
20742074 dstFormat == AV_PIX_FMT_GBRAP10LE || dstFormat == AV_PIX_FMT_GBRAP10BE ||
20752075 dstFormat == AV_PIX_FMT_GBRAP12LE || dstFormat == AV_PIX_FMT_GBRAP12BE ||
2076+ dstFormat == AV_PIX_FMT_GBRAP14LE || dstFormat == AV_PIX_FMT_GBRAP14BE ||
20762077 dstFormat == AV_PIX_FMT_GBRAP16LE || dstFormat == AV_PIX_FMT_GBRAP16BE ))
20772078 c->convert_unscaled = Rgb16ToPlanarRgb16Wrapper;
20782079
@@ -2083,6 +2084,7 @@ void ff_get_unscaled_swscale(SwsContext *c) · 4 unmodified lines
20832084 srcFormat == AV_PIX_FMT_GBRP14LE || srcFormat == AV_PIX_FMT_GBRP14BE ||
20842085 srcFormat == AV_PIX_FMT_GBRAP10LE || srcFormat == AV_PIX_FMT_GBRAP10BE ||
20852086 srcFormat == AV_PIX_FMT_GBRAP12LE || srcFormat == AV_PIX_FMT_GBRAP12BE ||
2087+ srcFormat == AV_PIX_FMT_GBRAP14LE || srcFormat == AV_PIX_FMT_GBRAP14BE ||
20862088 srcFormat == AV_PIX_FMT_GBRAP16LE || srcFormat == AV_PIX_FMT_GBRAP16BE) &&
20872089 (dstFormat == AV_PIX_FMT_RGB48LE || dstFormat == AV_PIX_FMT_RGB48BE ||
20882090 dstFormat == AV_PIX_FMT_BGR48LE || dstFormat == AV_PIX_FMT_BGR48BE ||
@@ -2132,6 +2134,7 @@ void ff_get_unscaled_swscale(SwsContext *c) · 43 unmodified lines
21322134 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP16) ||
21332135 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRAP10) ||
21342136 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRAP12) ||
2137+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRAP14) ||
21352138 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRAP16) ||
21362139 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB444) ||
21372140 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB48) ||
libswscale/utils.c+6−0
@@ -204,6 +204,8 @@ static const FormatEntry format_entries[] = { · 203 unmodified lines
204204 [AV_PIX_FMT_GBRAP12BE] = { 1, 1 },
205205 [AV_PIX_FMT_GBRP14LE] = { 1, 1 },
206206 [AV_PIX_FMT_GBRP14BE] = { 1, 1 },
207+ [AV_PIX_FMT_GBRAP14LE] = { 1, 1 },
208+ [AV_PIX_FMT_GBRAP14BE] = { 1, 1 },
207209 [AV_PIX_FMT_GBRP16LE] = { 1, 1 },
208210 [AV_PIX_FMT_GBRP16BE] = { 1, 1 },
209211 [AV_PIX_FMT_GBRPF32LE] = { 1, 1 },
@@ -1228,6 +1230,9 @@ static enum AVPixelFormat alphaless_fmt(enum AVPixelFormat fmt) · 1018 unmodified lines
12281230 case AV_PIX_FMT_GBRAP12LE: return AV_PIX_FMT_GBRP12;
12291231 case AV_PIX_FMT_GBRAP12BE: return AV_PIX_FMT_GBRP12;
12301232
1233+ case AV_PIX_FMT_GBRAP14LE: return AV_PIX_FMT_GBRP14;
1234+ case AV_PIX_FMT_GBRAP14BE: return AV_PIX_FMT_GBRP14;
1235+
12311236 case AV_PIX_FMT_GBRAP16LE: return AV_PIX_FMT_GBRP16;
12321237 case AV_PIX_FMT_GBRAP16BE: return AV_PIX_FMT_GBRP16;
12331238
@@ -1496,6 +1501,7 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, · 262 unmodified lines
14961501 srcFormat != AV_PIX_FMT_GBRAP10BE && srcFormat != AV_PIX_FMT_GBRAP10LE &&
14971502 srcFormat != AV_PIX_FMT_GBRP12BE && srcFormat != AV_PIX_FMT_GBRP12LE &&
14981503 srcFormat != AV_PIX_FMT_GBRAP12BE && srcFormat != AV_PIX_FMT_GBRAP12LE &&
1504+ srcFormat != AV_PIX_FMT_GBRAP14BE && srcFormat != AV_PIX_FMT_GBRAP14LE &&
14991505 srcFormat != AV_PIX_FMT_GBRP14BE && srcFormat != AV_PIX_FMT_GBRP14LE &&
15001506 srcFormat != AV_PIX_FMT_GBRP16BE && srcFormat != AV_PIX_FMT_GBRP16LE &&
15011507 srcFormat != AV_PIX_FMT_GBRAP16BE && srcFormat != AV_PIX_FMT_GBRAP16LE &&
libswscale/version.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828
2929 #include "version_major.h"
3030
31−#define LIBSWSCALE_VERSION_MINOR 3
31+#define LIBSWSCALE_VERSION_MINOR 4
3232 #define LIBSWSCALE_VERSION_MICRO 100
3333
3434 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
tests/ref/fate/filter-pixdesc-gbrap14be+1−0
@@ -0,0 +1 @@
1+pixdesc-gbrap14be 31cab6d8ee655ff61cf44ea458268e4c
tests/ref/fate/filter-pixdesc-gbrap14le+1−0
@@ -0,0 +1 @@
1+pixdesc-gbrap14le db6b141efe8f0d9cfa8f77937e577b50
tests/ref/fate/filter-pixfmts-copy+2−0
@@ -23,6 +23,8 @@ gbrap10be edcffb185e44b6dae5c2ead5505b7125 · 22 unmodified lines
2323 gbrap10le 2a7392e14b21b1f9457526a071236a6d
2424 gbrap12be 0c4c1f8af361571265ca259d5f70f026
2525 gbrap12le 5f1d8c663d4c28863e687192433b34a4
26+gbrap14be 25694ddb34dceabec5143a7677c8072d
27+gbrap14le 0eba343fc6f713d310db3d67f7d5a06b
2628 gbrap16be e4edca4361d643794034e5aa9ef290b1
2729 gbrap16le 9a95b389d2bf556179e8f4b27fb550ab
2830 gbrapf32be d908f0950d3735863fe6f0793fa24f76
tests/ref/fate/filter-pixfmts-crop+2−0
@@ -23,6 +23,8 @@ gbrap10be 1880c4856d9cc6492b8b859f2711aaf1 · 22 unmodified lines
2323 gbrap10le c2b6e35f8b7ca363a7ec021ccdf31d1f
2424 gbrap12be c9769d18733cdc2664d8b9af09a03f6d
2525 gbrap12le 3f80453c1ac6c5d1b2febf3ef141b476
26+gbrap14be 11238485c208bd064730fd4469869e98
27+gbrap14le 59f0ae68812ac2c0b0ac04def7161ab7
2628 gbrap16be 21c98d0d7e7de2a93f9f095e5bb5c227
2729 gbrap16le ea9a96870c1b742dd9f065c5db568184
2830 gbrapf32be ec06b3b168dc74048100f29a4412da90
tests/ref/fate/filter-pixfmts-field+2−0
@@ -23,6 +23,8 @@ gbrap10be 29d46cbf021b233f5f1886e5d5fe21b4 · 22 unmodified lines
2323 gbrap10le 4017c5d8c124438eb9aefa107db58d3b
2424 gbrap12be e7f471132628b1c034199cc109b84bc2
2525 gbrap12le 886207e5aa379a0312485b94e5fd5edd
26+gbrap14be 6c56b7c47dbc7707e09d93f06eb34624
27+gbrap14le e6077974ee36f906987319364b2a72a8
2628 gbrap16be eaa0158f27ebc40cde9e3d6eef1e2ba1
2729 gbrap16le 6cf68992d4fcac2aa025d1014b669d24
2830 gbrapf32be 37c627796dee55ca6f4e7ca965460680
tests/ref/fate/filter-pixfmts-fieldorder+2−0
@@ -23,6 +23,8 @@ gbrap10be 8b27254a69cd0e25fa55262a743f95e6 · 22 unmodified lines
2323 gbrap10le 52278021718ec370903dccc923dc8bf6
2424 gbrap12be 302b353dff696ec9fd0d85a0cc14802b
2525 gbrap12le ae2d6db2c9c825f06d92389de21263d2
26+gbrap14be 1d28d4af2b00d08a17278ca0a316f24a
27+gbrap14le 07bc3e6abb0ee23876c9605fd81e8a83
2628 gbrap16be 52c10d8046d123dfc4a478276906467c
2729 gbrap16le 2317737b8f5140add27d121de8f5ba95
2830 gbrapf32be 6781751ef9d444d150cb0a1e1cefe141
tests/ref/fate/filter-pixfmts-hflip+2−0
@@ -23,6 +23,8 @@ gbrap10be f188dc23756469cbdd172fe97ad58121 · 22 unmodified lines
2323 gbrap10le 262f0501633ea4670020fae8ac6835e2
2424 gbrap12be ffe9aa4cbcc42f71757efe18826764ac
2525 gbrap12le 88a85c1b3c5e19e299fdd209b73ac1ba
26+gbrap14be e4aedeb3aadedbe93cc415db0a65c1a2
27+gbrap14le d6183b778f950a1255e27efe658127e4
2628 gbrap16be 3117e84b258433a7efb9288bbb8815d4
2729 gbrap16le 3ad08cf8b49d8eb31a1b356ec4b7b88b
2830 gbrapf32be d82e48eb62c1e2d2ce5d614aeda38a99
tests/ref/fate/filter-pixfmts-il+2−0
@@ -23,6 +23,8 @@ gbrap10be bafa57a2e4331d8a39f6f0087c85d4b1 · 22 unmodified lines
2323 gbrap10le 553a1f439d8184dc400432d3f786fbce
2424 gbrap12be 48609d6b61ff6313939fa2d9c3ebb6d9
2525 gbrap12le e3b5342c8e47820f2de7e2dd61872312
26+gbrap14be 213d656dd43193eac7711cdcc91ed2d1
27+gbrap14le 350ae0639e73f20efa867cfba5dd7afd
2628 gbrap16be 696c84c8b009c7320cad7f3847bb35da
2729 gbrap16le 9bacb81fbbe9cdfd04d71eb55a9719d2
2830 gbrapf32be 5995aba2bf66254f63d5413cd9860353
tests/ref/fate/filter-pixfmts-null+2−0
@@ -23,6 +23,8 @@ gbrap10be edcffb185e44b6dae5c2ead5505b7125 · 22 unmodified lines
2323 gbrap10le 2a7392e14b21b1f9457526a071236a6d
2424 gbrap12be 0c4c1f8af361571265ca259d5f70f026
2525 gbrap12le 5f1d8c663d4c28863e687192433b34a4
26+gbrap14be 25694ddb34dceabec5143a7677c8072d
27+gbrap14le 0eba343fc6f713d310db3d67f7d5a06b
2628 gbrap16be e4edca4361d643794034e5aa9ef290b1
2729 gbrap16le 9a95b389d2bf556179e8f4b27fb550ab
2830 gbrapf32be d908f0950d3735863fe6f0793fa24f76
tests/ref/fate/filter-pixfmts-pad+1−0
@@ -9,6 +9,7 @@ bgra 929aac15e848038e367c250037575f9f · 8 unmodified lines
99 gbrap 5f16cccab5a17cb766c882e865995167
1010 gbrap10le e63e0a1ae9afd7e6a732f18be194e761
1111 gbrap12le eb7a5ff44a9b5b46bb9829838224ed8e
12+gbrap14le 4c8b549942e66f442de0f5c1d21e9b8e
1213 gbrap16le d0f6fc33cb75588327aec1b5ad6ab4f0
1314 gbrp 3c94d39256db2409015df913fd330a90
1415 gbrp10le 5b356737cd8a396f39bbdadb7cb35e06
tests/ref/fate/filter-pixfmts-scale+2−0
@@ -23,6 +23,8 @@ gbrap10be 50735fbc471a5ac5a6645c85881f3670 · 22 unmodified lines
2323 gbrap10le 6e1cba57029fdf0f9d46b5e5cd55112b
2424 gbrap12be 58170165829484b3db4a3b9165198987
2525 gbrap12le 24f5ecb32435b73353517e017c165e31
26+gbrap14be 6addff84e986e7ea28aa3cdb80f44137
27+gbrap14le a753ce2fc6d36920d678411434bed9b1
2628 gbrap16be 31968e6872a46e8174fb57f8920ed10d
2729 gbrap16le 8c6758f33671b673b6d30969fc05a23d
2830 gbrapf32be 366b804d5697276e8c481c4bdf05a00b
tests/ref/fate/filter-pixfmts-transpose+2−0
@@ -23,6 +23,8 @@ gbrap10be 3e3be2d8f9aa5f449a1df404e27d0054 · 22 unmodified lines
2323 gbrap10le db4e4861010cbbf726492fad282d5813
2424 gbrap12be 1518c9a565d1ba1a45dd369acc1aa75e
2525 gbrap12le 714fe318af81a46f83655c6e7e13351e
26+gbrap14be 929c440a44fbeab41111ebbf1d724464
27+gbrap14le 577112fe137e056b4fb145403d5846e6
2628 gbrap16be 39d488528aacff466aac7539c9b948a8
2729 gbrap16le 5426ac9457289927bfe2ec03038a8780
2830 gbrapf32be ea02b3912372c8671ff4eacbcbda740a
tests/ref/fate/filter-pixfmts-vflip+2−0
@@ -23,6 +23,8 @@ gbrap10be e8134b72acc090b093b4d9b4d4703c7e · 22 unmodified lines
2323 gbrap10le 43bde7bd6a676c6ac33dbcc4c72762f3
2424 gbrap12be 16a3d105ba852a9fa23ea5232db51b48
2525 gbrap12le 6ef8a3ac4129ec23c34aec14ac41f249
26+gbrap14be b5a84309c1ca113d950ca7aa4e64bad4
27+gbrap14le 561babad7e222cc004250cabfd17a605
2628 gbrap16be 70b020b6b9e1896b72f890de3570ffda
2729 gbrap16le e0cf341cdbaf1f5c40016f181bc9d7d4
2830 gbrapf32be e82323abcb665014346a3a34a4b084c3

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