swscale: Add GRAY12
authorLuca Barbato <lu_zero@gentoo.org>
Thu, 3 Nov 2016 15:10:03 +0000 (16:10 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Mon, 7 Nov 2016 21:42:00 +0000 (22:42 +0100)
libswscale/input.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
tests/ref/fate/filter-pixdesc-gray12be [new file with mode: 0644]
tests/ref/fate/filter-pixdesc-gray12le [new file with mode: 0644]
tests/ref/fate/filter-pixfmts-copy
tests/ref/fate/filter-pixfmts-null
tests/ref/fate/filter-pixfmts-scale
tests/ref/fate/filter-pixfmts-vflip

index 9f2ef72..d8560a1 100644 (file)
@@ -1120,6 +1120,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_YUV420P16LE:
     case AV_PIX_FMT_YUV422P16LE:
     case AV_PIX_FMT_YUV444P16LE:
+    case AV_PIX_FMT_GRAY12LE:
     case AV_PIX_FMT_GRAY16LE:
         c->lumToYV12 = bswap16Y_c;
         break;
@@ -1148,6 +1149,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_YUV420P16BE:
     case AV_PIX_FMT_YUV422P16BE:
     case AV_PIX_FMT_YUV444P16BE:
+    case AV_PIX_FMT_GRAY12BE:
     case AV_PIX_FMT_GRAY16BE:
         c->lumToYV12 = bswap16Y_c;
         break;
index abcdb9f..e7a6eed 100644 (file)
@@ -603,6 +603,8 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
 #define isGray(x)                      \
     ((x) == AV_PIX_FMT_GRAY8       ||  \
      (x) == AV_PIX_FMT_YA8         ||  \
+     (x) == AV_PIX_FMT_GRAY12BE    ||  \
+     (x) == AV_PIX_FMT_GRAY12LE    ||  \
      (x) == AV_PIX_FMT_GRAY16BE    ||  \
      (x) == AV_PIX_FMT_GRAY16LE    ||  \
      (x) == AV_PIX_FMT_YA16BE      ||  \
index 24c65cc..d3863bb 100644 (file)
@@ -1097,6 +1097,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
         IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR555) ||
         IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR565) ||
         IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGRA64) ||
+        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY12) ||
         IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY16) ||
         IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YA16)   ||
         IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRAP12)||
index 1c3bbb3..6034b70 100644 (file)
@@ -107,6 +107,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
     [AV_PIX_FMT_RGBA]        = { 1, 1 },
     [AV_PIX_FMT_ABGR]        = { 1, 1 },
     [AV_PIX_FMT_BGRA]        = { 1, 1 },
+    [AV_PIX_FMT_GRAY12BE]    = { 1, 1 },
+    [AV_PIX_FMT_GRAY12LE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY16BE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY16LE]    = { 1, 1 },
     [AV_PIX_FMT_YUV440P]     = { 1, 1 },
diff --git a/tests/ref/fate/filter-pixdesc-gray12be b/tests/ref/fate/filter-pixdesc-gray12be
new file mode 100644 (file)
index 0000000..de99734
--- /dev/null
@@ -0,0 +1 @@
+pixdesc-gray12be    bff4fa5910e99725b275fb70270b0cf9
diff --git a/tests/ref/fate/filter-pixdesc-gray12le b/tests/ref/fate/filter-pixdesc-gray12le
new file mode 100644 (file)
index 0000000..c2c5f68
--- /dev/null
@@ -0,0 +1 @@
+pixdesc-gray12le    d0900fab4e757ef17fff8c1ffd0b3816
index d9a5166..bd16f11 100644 (file)
@@ -23,6 +23,8 @@ gbrp12le            654861b1837d312569395f598da1a2a1
 gbrp9be             cbe1bf8ead497a92362a749bd4b0a57e
 gbrp9le             f88c68df5d699a4a7f1b0152df9f25fe
 gray                8c941e9bbf6da5336384c57f15a4a454
+gray12be            aecffce8ea67ab93527dc74c1a523454
+gray12le            eac4b15c8686f04ea73751294f40b8e0
 gray16be            43bda75c197b0d59a9b87ee941553644
 gray16le            a4ea1369ef1efff0e1341a1dc42dbfdf
 monob               e13b2cbfb93d3ed6fdc1f256662ea959
index d9a5166..bd16f11 100644 (file)
@@ -23,6 +23,8 @@ gbrp12le            654861b1837d312569395f598da1a2a1
 gbrp9be             cbe1bf8ead497a92362a749bd4b0a57e
 gbrp9le             f88c68df5d699a4a7f1b0152df9f25fe
 gray                8c941e9bbf6da5336384c57f15a4a454
+gray12be            aecffce8ea67ab93527dc74c1a523454
+gray12le            eac4b15c8686f04ea73751294f40b8e0
 gray16be            43bda75c197b0d59a9b87ee941553644
 gray16le            a4ea1369ef1efff0e1341a1dc42dbfdf
 monob               e13b2cbfb93d3ed6fdc1f256662ea959
index 2a60f72..e1737f0 100644 (file)
@@ -23,6 +23,8 @@ gbrp12le            735061c07442657580577d1cede3a636
 gbrp9be             01c837e1def99abec205b80d21b68bf0
 gbrp9le             dd982d59c3d71c3b201f2d9363d8952c
 gray                4c571fb634a75f177b64cee168fbf3a1
+gray12be            d237d56e08482038ebc5f3943d6ec8d5
+gray12le            dcd15a0ed89bd019cc367b552fc9b1c0
 gray16be            9b57ff7d2090b47e4427bee79dba0d9e
 gray16le            17d2c00c6ffe346dfb632d927ebbf30a
 monob               e28955319a03f1850c467f8fe65b2a22
index 93a292d..11a48c7 100644 (file)
@@ -23,6 +23,8 @@ gbrp12le            b7b27715bc9054a93ba81f110cf42ee5
 gbrp9be             2ae8f0d3b079d6550a2b1d4a7c4a6e4b
 gbrp9le             c62df0f386c957cc9cacb3c8014542eb
 gray                684ba667effbbf5983f46a9bea4afaae
+gray12be            e33397832d19ec628f3e887e0a16ccc7
+gray12le            c8a8d7267e2595a0c4ce5d582bea23a1
 gray16be            112077b2f1c85cbd44907ed271901b28
 gray16le            1d7be18af19f4ff847ff4bc7c610c8cc
 monob               0e4946183903fea3ef246c16385e236c