History

swscale/output: add Y216LE output support

James Almer committed 2 years ago

Commit b520d951 parent 7756cd911 files · +54 −2Browse files

Unified · Split

11 files
  1. libswscale/output.c +44 −0
  2. libswscale/utils.c +1 −1
  3. libswscale/version.h +1 −1
  4. tests/ref/fate/filter-pixdesc-y216le +1 −0
  5. tests/ref/fate/filter-pixfmts-copy +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-il +1 −0
  9. tests/ref/fate/filter-pixfmts-null +1 −0
  10. tests/ref/fate/filter-pixfmts-scale +1 −0
  11. tests/ref/fate/filter-pixfmts-vflip +1 −0
libswscale/output.c+44−0
@@ -2983,6 +2983,47 @@ AYUVPACKEDWRAPPER(uyva, AV_PIX_FMT_UYVA) · 2982 unmodified lines
2983yuv2y2xx_wrapper(10)2983yuv2y2xx_wrapper(10)
2984yuv2y2xx_wrapper(12)2984yuv2y2xx_wrapper(12)
2985 2985
2986static void
2987yuv2y216le_X_c(SwsContext *c, const int16_t *lumFilter,
2988 const int16_t **_lumSrc, int lumFilterSize,
2989 const int16_t *chrFilter,
2990 const int16_t **_chrUSrc,
2991 const int16_t **_chrVSrc, int chrFilterSize,
2992 const int16_t **_alpSrc,
2993 uint8_t *dest, int dstW, int y)
2994{
2995 const int32_t **lumSrc = (const int32_t **)_lumSrc;
2996 const int32_t **chrUSrc = (const int32_t **)_chrUSrc;
2997 const int32_t **chrVSrc = (const int32_t **)_chrVSrc;
2998 int shift = 15;
2999
3000 for (int i = 0; i < ((dstW + 1) >> 1); i++) {
3001 int Y1 = 1 << (shift - 1), Y2 = 1 << (shift - 1);
3002 int U = 1 << (shift - 1), V = 1 << (shift - 1);
3003
3004 /* See yuv2planeX_16_c_template for details. */
3005 Y1 -= 0x40000000;
3006 U -= 0x40000000;
3007 Y2 -= 0x40000000;
3008 V -= 0x40000000;
3009
3010 for (int j = 0; j < lumFilterSize; j++) {
3011 Y1 += lumSrc[j][i * 2] * (unsigned)lumFilter[j];
3012 Y2 += lumSrc[j][i * 2 + 1] * (unsigned)lumFilter[j];
3013 }
3014
3015 for (int j = 0; j < chrFilterSize; j++) {
3016 U += chrUSrc[j][i] * (unsigned)chrFilter[j];
3017 V += chrVSrc[j][i] * (unsigned)chrFilter[j];
3018 }
3019
3020 AV_WL16(dest + 8 * i + 0, 0x8000 + av_clip_int16(Y1 >> shift));
3021 AV_WL16(dest + 8 * i + 2, 0x8000 + av_clip_int16(U >> shift));
3022 AV_WL16(dest + 8 * i + 4, 0x8000 + av_clip_int16(Y2 >> shift));
3023 AV_WL16(dest + 8 * i + 6, 0x8000 + av_clip_int16(V >> shift));
3024 }
3025}
3026
2986static void3027static void
2987yuv2vyu444_1_c(SwsContext *c, const int16_t *buf0,3028yuv2vyu444_1_c(SwsContext *c, const int16_t *buf0,
2988 const int16_t *ubuf[2], const int16_t *vbuf[2],3029 const int16_t *ubuf[2], const int16_t *vbuf[2],
@@ -3656,5 +3697,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 667 unmodified lines
3656 case AV_PIX_FMT_Y212LE:3697 case AV_PIX_FMT_Y212LE:
3657 *yuv2packedX = yuv2y212le_X_c;3698 *yuv2packedX = yuv2y212le_X_c;
3658 break;3699 break;
3700 case AV_PIX_FMT_Y216LE:
3701 *yuv2packedX = yuv2y216le_X_c;
3702 break;
3659 }3703 }
3660}3704}
libswscale/utils.c+1−1
@@ -248,7 +248,7 @@ static const FormatEntry format_entries[] = { · 247 unmodified lines
248 [AV_PIX_FMT_NV42] = { 1, 1 },248 [AV_PIX_FMT_NV42] = { 1, 1 },
249 [AV_PIX_FMT_Y210LE] = { 1, 1 },249 [AV_PIX_FMT_Y210LE] = { 1, 1 },
250 [AV_PIX_FMT_Y212LE] = { 1, 1 },250 [AV_PIX_FMT_Y212LE] = { 1, 1 },
251 [AV_PIX_FMT_Y216LE] = { 1, 0 },251 [AV_PIX_FMT_Y216LE] = { 1, 1 },
252 [AV_PIX_FMT_X2RGB10LE] = { 1, 1 },252 [AV_PIX_FMT_X2RGB10LE] = { 1, 1 },
253 [AV_PIX_FMT_X2BGR10LE] = { 1, 1 },253 [AV_PIX_FMT_X2BGR10LE] = { 1, 1 },
254 [AV_PIX_FMT_P210BE] = { 1, 1 },254 [AV_PIX_FMT_P210BE] = { 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 631#define LIBSWSCALE_VERSION_MINOR 6
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-y216le+1−0
@@ -0,0 +1 @@
1pixdesc-y216le ff17fa6e341a5cfe0d549faa25c24257
tests/ref/fate/filter-pixfmts-copy+1−0
@@ -113,6 +113,7 @@ xyz12be a1ef56bf746d71f59669c28e48fc8450 · 112 unmodified lines
113xyz12le 831ff03c1ba4ef19374686f16a064d8c113xyz12le 831ff03c1ba4ef19374686f16a064d8c
114y210le 0736b017e0814daf38d3350c42796f7a114y210le 0736b017e0814daf38d3350c42796f7a
115y212le 825768be8fe92708ae80be84855066ed115y212le 825768be8fe92708ae80be84855066ed
116y216le 610cc638e695eb64f3004cc5f24c5a7b
116ya16be 37c07787e544f900c87b853253bfc8dd117ya16be 37c07787e544f900c87b853253bfc8dd
117ya16le e8cab8fad88cba6d285b224d8bf0d4df118ya16le e8cab8fad88cba6d285b224d8bf0d4df
118ya8 dbb99fbcdc204aaa1a7397ff561f1a67119ya8 dbb99fbcdc204aaa1a7397ff561f1a67
tests/ref/fate/filter-pixfmts-field+1−0
@@ -113,6 +113,7 @@ xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437 · 112 unmodified lines
113xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5113xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5
114y210le 025beb25f047a762e3788dbea4b60864114y210le 025beb25f047a762e3788dbea4b60864
115y212le ac2a47c45187dd54d0f55293cbffd954115y212le ac2a47c45187dd54d0f55293cbffd954
116y216le 332801737b0f779bdf14ff535fd925fd
116ya16be 40403b5277364777e0671da4d38e01ac117ya16be 40403b5277364777e0671da4d38e01ac
117ya16le 54f3295f5326a13d456ac53e973ba398118ya16le 54f3295f5326a13d456ac53e973ba398
118ya8 28cea4f98ed452bd3da9c752e5e3399c119ya8 28cea4f98ed452bd3da9c752e5e3399c
tests/ref/fate/filter-pixfmts-fieldorder+1−0
@@ -102,6 +102,7 @@ xyz12be 15f5cda71de5fef9cec5e75e3833b6bc · 101 unmodified lines
102xyz12le 7be6c8781f38c21a6b8f602f62ca31e6102xyz12le 7be6c8781f38c21a6b8f602f62ca31e6
103y210le ee45acfb1386288af98af5313162ff3e103y210le ee45acfb1386288af98af5313162ff3e
104y212le 2f08fb195b948056c844acb1eee8d649104y212le 2f08fb195b948056c844acb1eee8d649
105y216le 4176a190d167f0f6d7dbca7ff65d3f48
105ya16be 0f13e0f52586d172aaa07710fa3e8f31106ya16be 0f13e0f52586d172aaa07710fa3e8f31
106ya16le d481d93ea1a1a04d759d9994958983de107ya16le d481d93ea1a1a04d759d9994958983de
107ya8 055ac5ab5ff8533dd319edc17a398af1108ya8 055ac5ab5ff8533dd319edc17a398af1
tests/ref/fate/filter-pixfmts-il+1−0
@@ -112,6 +112,7 @@ xyz12be 7c7d54c55f136cbbc50b18029f3be0b3 · 111 unmodified lines
112xyz12le 090ba6b1170baf2b1358b43b971d33b0112xyz12le 090ba6b1170baf2b1358b43b971d33b0
113y210le 306ec4238b49dbc8625a97b678ea1c5f113y210le 306ec4238b49dbc8625a97b678ea1c5f
114y212le d5a2b4677ddb4a3bc3e5cd5cbb20f426114y212le d5a2b4677ddb4a3bc3e5cd5cbb20f426
115y216le ef6d5ebd8bf99809fb8ac658cf7acbf8
115ya16be 7bc720918bc0132e9717acbde89874e0116ya16be 7bc720918bc0132e9717acbde89874e0
116ya16le 61203295a8d39601b841de90f2c9797b117ya16le 61203295a8d39601b841de90f2c9797b
117ya8 a38d6e288f582f1a04310232ed764afc118ya8 a38d6e288f582f1a04310232ed764afc
tests/ref/fate/filter-pixfmts-null+1−0
@@ -113,6 +113,7 @@ xyz12be a1ef56bf746d71f59669c28e48fc8450 · 112 unmodified lines
113xyz12le 831ff03c1ba4ef19374686f16a064d8c113xyz12le 831ff03c1ba4ef19374686f16a064d8c
114y210le 0736b017e0814daf38d3350c42796f7a114y210le 0736b017e0814daf38d3350c42796f7a
115y212le 825768be8fe92708ae80be84855066ed115y212le 825768be8fe92708ae80be84855066ed
116y216le 610cc638e695eb64f3004cc5f24c5a7b
116ya16be 37c07787e544f900c87b853253bfc8dd117ya16be 37c07787e544f900c87b853253bfc8dd
117ya16le e8cab8fad88cba6d285b224d8bf0d4df118ya16le e8cab8fad88cba6d285b224d8bf0d4df
118ya8 dbb99fbcdc204aaa1a7397ff561f1a67119ya8 dbb99fbcdc204aaa1a7397ff561f1a67
tests/ref/fate/filter-pixfmts-scale+1−0
@@ -113,6 +113,7 @@ xyz12be c7ba8345998c0141ddc079cdd29b1a40 · 112 unmodified lines
113xyz12le 95f5d3a0de834cc495c9032a14987cde113xyz12le 95f5d3a0de834cc495c9032a14987cde
114y210le 1c2708a520477f955d1fedf6ca7a41bd114y210le 1c2708a520477f955d1fedf6ca7a41bd
115y212le 39a3c0c843041ad4501b3107dd91ef17115y212le 39a3c0c843041ad4501b3107dd91ef17
116y216le 21ead8be695827822e627df20ab49b1f
116ya16be 20d4842899d61068f5fb6af478bf26a6117ya16be 20d4842899d61068f5fb6af478bf26a6
117ya16le 6a05895adce85143ae1c1b3470cb4070118ya16le 6a05895adce85143ae1c1b3470cb4070
118ya8 0a9db5bb4b009de9197eede5e9d19e16119ya8 0a9db5bb4b009de9197eede5e9d19e16
tests/ref/fate/filter-pixfmts-vflip+1−0
@@ -113,6 +113,7 @@ xyz12be 23fa9fb36d49dce61e284d41b83e0e6b · 112 unmodified lines
113xyz12le ef73e6d1f932a9a355df1eedd628394f113xyz12le ef73e6d1f932a9a355df1eedd628394f
114y210le 9544c81f8e1fc95e9fa4009dbecfea25114y210le 9544c81f8e1fc95e9fa4009dbecfea25
115y212le c801725ae31e3b8f5be269359d49f191115y212le c801725ae31e3b8f5be269359d49f191
116y216le 0ca0f60d7fd78ec32f417d6209f18a5b
116ya16be 55b1dbbe4d56ed0d22461685ce85520d117ya16be 55b1dbbe4d56ed0d22461685ce85520d
117ya16le d5bf02471823a16dc523a46cace0101a118ya16le d5bf02471823a16dc523a46cace0101a
118ya8 4299c6ca3b470a7d8a420e26eb485b1d119ya8 4299c6ca3b470a7d8a420e26eb485b1d

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