summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-09 03:20:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-09 03:36:38 +0200
commited962414bd66027ce67ded912c17e08970163f52 (patch)
tree27a07264d5e7d5194c9a2df07882b8cdb75790a3
parent0a1cc04e6c09295cf06a1ca96d9a5a6e8bd85acb (diff)
parent92b099daf4b8ef93513e38b43899cb8458a2fde3 (diff)
downloadffmpeg-streaming-ed962414bd66027ce67ded912c17e08970163f52.zip
ffmpeg-streaming-ed962414bd66027ce67ded912c17e08970163f52.tar.gz
Merge commit '92b099daf4b8ef93513e38b43899cb8458a2fde3'
* commit '92b099daf4b8ef93513e38b43899cb8458a2fde3': swscale: support converting YVYU422 pixel format Conflicts: libswscale/input.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswscale/input.c17
-rw-r--r--libswscale/output.c13
-rw-r--r--libswscale/swscale_internal.h1
-rw-r--r--libswscale/utils.c1
-rw-r--r--tests/ref/fate/filter-pixdesc1
-rw-r--r--tests/ref/fate/filter-pixfmts-copy1
-rw-r--r--tests/ref/fate/filter-pixfmts-field1
-rw-r--r--tests/ref/fate/filter-pixfmts-fieldorder1
-rw-r--r--tests/ref/fate/filter-pixfmts-il1
-rw-r--r--tests/ref/fate/filter-pixfmts-null1
-rw-r--r--tests/ref/fate/filter-pixfmts-scale1
-rw-r--r--tests/ref/fate/filter-pixfmts-vflip1
12 files changed, 38 insertions, 2 deletions
diff --git a/libswscale/input.c b/libswscale/input.c
index 1539bd9..62a2495 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -531,7 +531,18 @@ static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con
av_assert1(src1 == src2);
}
-static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width,
+static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
+ const uint8_t *src2, int width, uint32_t *unused)
+{
+ int i;
+ for (i = 0; i < width; i++) {
+ dstV[i] = src1[4 * i + 1];
+ dstU[i] = src1[4 * i + 3];
+ }
+ assert(src1 == src2);
+}
+
+static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width,
uint32_t *unused)
{
int i;
@@ -818,6 +829,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUYV422:
c->chrToYV12 = yuy2ToUV_c;
break;
+ case AV_PIX_FMT_YVYU422:
+ c->chrToYV12 = yvy2ToUV_c;
+ break;
case AV_PIX_FMT_UYVY422:
c->chrToYV12 = uyvyToUV_c;
break;
@@ -1202,6 +1216,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
break;
#endif
case AV_PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YVYU422:
case AV_PIX_FMT_Y400A:
c->lumToYV12 = yuy2ToY_c;
break;
diff --git a/libswscale/output.c b/libswscale/output.c
index 4083c73..eee6b48 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -526,7 +526,12 @@ YUV2PACKEDWRAPPER(yuv2mono,, black, AV_PIX_FMT_MONOBLACK)
dest[pos + 1] = U; \
dest[pos + 2] = Y2; \
dest[pos + 3] = V; \
- } else { \
+ } else if (target == AV_PIX_FMT_YVYU422) { \
+ dest[pos + 0] = Y1; \
+ dest[pos + 1] = V; \
+ dest[pos + 2] = Y2; \
+ dest[pos + 3] = U; \
+ } else { /* AV_PIX_FMT_UYVY422 */ \
dest[pos + 0] = U; \
dest[pos + 1] = Y1; \
dest[pos + 2] = V; \
@@ -661,6 +666,7 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
#undef output_pixels
YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, AV_PIX_FMT_YUYV422)
+YUV2PACKEDWRAPPER(yuv2, 422, yvyu422, AV_PIX_FMT_YVYU422)
YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, AV_PIX_FMT_UYVY422)
#define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE) ? R : B)
@@ -2205,6 +2211,11 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
*yuv2packed2 = yuv2yuyv422_2_c;
*yuv2packedX = yuv2yuyv422_X_c;
break;
+ case AV_PIX_FMT_YVYU422:
+ *yuv2packed1 = yuv2yvyu422_1_c;
+ *yuv2packed2 = yuv2yvyu422_2_c;
+ *yuv2packedX = yuv2yvyu422_X_c;
+ break;
case AV_PIX_FMT_UYVY422:
*yuv2packed1 = yuv2uyvy422_1_c;
*yuv2packed2 = yuv2uyvy422_2_c;
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 921b892..0b3e687 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -783,6 +783,7 @@ static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
#define isPacked(x) ( \
(x)==AV_PIX_FMT_PAL8 \
|| (x)==AV_PIX_FMT_YUYV422 \
+ || (x)==AV_PIX_FMT_YVYU422 \
|| (x)==AV_PIX_FMT_UYVY422 \
|| (x)==AV_PIX_FMT_Y400A \
|| isRGBinInt(x) \
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 7680dbf..b3e117f 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -97,6 +97,7 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_YUVJ411P] = { 1, 1 },
[AV_PIX_FMT_YUVJ422P] = { 1, 1 },
[AV_PIX_FMT_YUVJ444P] = { 1, 1 },
+ [AV_PIX_FMT_YVYU422] = { 1, 1 },
[AV_PIX_FMT_UYVY422] = { 1, 1 },
[AV_PIX_FMT_UYYVYY411] = { 0, 0 },
[AV_PIX_FMT_BGR8] = { 1, 1 },
diff --git a/tests/ref/fate/filter-pixdesc b/tests/ref/fate/filter-pixdesc
index 7b65294..da4dffe 100644
--- a/tests/ref/fate/filter-pixdesc
+++ b/tests/ref/fate/filter-pixdesc
@@ -115,3 +115,4 @@ yuvj422p aa97862b57f47c5a6506156e9aaf129a
yuvj440p ff8b9884a49d546b035f5d2ac1e673df
yuvj444p b8142888d80b8065c54045839e79b331
yuyv422 f06a4fbbdb32807d05de825daa2c3a1b
+yvyu422 168d69661ced61f5f58cca8977d99cb3
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index 4fa4a06..95f7f3a 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -116,3 +116,4 @@ yuvj422p aa97862b57f47c5a6506156e9aaf129a
yuvj440p ff8b9884a49d546b035f5d2ac1e673df
yuvj444p b8142888d80b8065c54045839e79b331
yuyv422 f06a4fbbdb32807d05de825daa2c3a1b
+yvyu422 168d69661ced61f5f58cca8977d99cb3
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index 75333fd..00fd3e1 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -116,3 +116,4 @@ yuvj422p 8cec955c1c62b00b6798361ef82962b7
yuvj440p 7b469444994d8b52766ee461bcb795ea
yuvj444p b395162325af489c465a3e6a31fbb0e7
yuyv422 1efb17cd0a48d2e956fd574ea6f412e7
+yvyu422 e3f928a98fb7e67c7d77d2a6a4eb0a24
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index 33f8e41..a7cab2c 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -89,3 +89,4 @@ yuvj411p 09f79c56109a13eefb68ee729d9a624b
yuvj422p 942043a34ac7d0f65edced1f6361259c
yuvj444p 7e4758df8eb9b18ad60e1b69a913f8c8
yuyv422 6b0c70d5ebf1685857b65456c547ea1c
+yvyu422 c19796b4f14fe72bbb5bbefa3566f444
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index cd55a1b..dadb9e1 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -115,3 +115,4 @@ yuvj422p d20df6138cdf62d7f3b93eb1277827d6
yuvj440p 17a24a86f279febaebb66d65509088e8
yuvj444p 326bb83d1aec23d941894a1324984c56
yuyv422 f9121733169ca5437e95e7600a7c5aea
+yvyu422 d38458e602ed958a262c38d757a7e560
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index 4fa4a06..95f7f3a 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -116,3 +116,4 @@ yuvj422p aa97862b57f47c5a6506156e9aaf129a
yuvj440p ff8b9884a49d546b035f5d2ac1e673df
yuvj444p b8142888d80b8065c54045839e79b331
yuyv422 f06a4fbbdb32807d05de825daa2c3a1b
+yvyu422 168d69661ced61f5f58cca8977d99cb3
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index a2e942d..0b4de4e 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -116,3 +116,4 @@ yuvj422p 492452e50a3fe66724840cad29be4098
yuvj440p 7632893e81d3f4f3ace3755f97479897
yuvj444p 389388dd5d623f660c30ab840807ce82
yuyv422 518be9b5ac93c365c0962453770fbe73
+yvyu422 bd9cfd830d357321864836f1afdf2e36
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index cc3d68c..0ebd19e 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -116,3 +116,4 @@ yuvj422p a19a89ef145305cf224ef5aa247d075a
yuvj440p 4240c9348d28af5f3edd0e642002bd2c
yuvj444p 9e11298ba9c4faae0f5c81420d2123f2
yuyv422 867fff568fa4170503779c48e5f25e6e
+yvyu422 074a44d1d74c4417f70290f6b31bdf2e
OpenPOWER on IntegriCloud