swscale: Add GRAY10
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 6 Nov 2018 05:08:05 +0000 (02:08 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 6 Nov 2018 15:39:15 +0000 (12:39 -0300)
Based on ab839054 by Luca Barbato.

Signed-off-by: James Almer <jamrial@gmail.com>
libswscale/input.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
libswscale/version.h
tests/ref/fate/filter-pixdesc-gray10be [new file with mode: 0644]
tests/ref/fate/filter-pixdesc-gray10le [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 761776c..3bc475d 100644 (file)
@@ -1136,6 +1136,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_GRAY10LE:
     case AV_PIX_FMT_GRAY12LE:
     case AV_PIX_FMT_GRAY16LE:
         c->lumToYV12 = bswap16Y_c;
@@ -1165,6 +1166,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_GRAY10BE:
     case AV_PIX_FMT_GRAY12BE:
     case AV_PIX_FMT_GRAY16BE:
         c->lumToYV12 = bswap16Y_c;
index adfe170..7232921 100644 (file)
@@ -600,6 +600,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_GRAY10BE    ||  \
+     (x) == AV_PIX_FMT_GRAY10LE    ||  \
      (x) == AV_PIX_FMT_GRAY12BE    ||  \
      (x) == AV_PIX_FMT_GRAY12LE    ||  \
      (x) == AV_PIX_FMT_GRAY16BE    ||  \
index f130ac5..06ad3a6 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_GRAY10) ||
         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)   ||
index d94be5a..f391bda 100644 (file)
@@ -108,6 +108,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_GRAY10BE]    = { 1, 1 },
+    [AV_PIX_FMT_GRAY10LE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY12BE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY12LE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY16BE]    = { 1, 1 },
index 5badd3d..e21758e 100644 (file)
@@ -28,7 +28,7 @@
 
 #define LIBSWSCALE_VERSION_MAJOR 5
 #define LIBSWSCALE_VERSION_MINOR 0
-#define LIBSWSCALE_VERSION_MICRO 0
+#define LIBSWSCALE_VERSION_MICRO 1
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
                                                LIBSWSCALE_VERSION_MINOR, \
diff --git a/tests/ref/fate/filter-pixdesc-gray10be b/tests/ref/fate/filter-pixdesc-gray10be
new file mode 100644 (file)
index 0000000..74bf8c6
--- /dev/null
@@ -0,0 +1 @@
+pixdesc-gray10be    64bfd85801ed894c86337d2c7a7efaff
diff --git a/tests/ref/fate/filter-pixdesc-gray10le b/tests/ref/fate/filter-pixdesc-gray10le
new file mode 100644 (file)
index 0000000..d32cf96
--- /dev/null
@@ -0,0 +1 @@
+pixdesc-gray10le    c1aa37491db157f32d589e66f020adee
index c23187c..baaf86c 100644 (file)
@@ -25,6 +25,8 @@ gbrp12le            654861b1837d312569395f598da1a2a1
 gbrp9be             cbe1bf8ead497a92362a749bd4b0a57e
 gbrp9le             f88c68df5d699a4a7f1b0152df9f25fe
 gray                8c941e9bbf6da5336384c57f15a4a454
+gray10be            69c8af356c3861792f9695fdff966629
+gray10le            a97b97107bf03f27136abbaca074aa88
 gray12be            aecffce8ea67ab93527dc74c1a523454
 gray12le            eac4b15c8686f04ea73751294f40b8e0
 gray16be            43bda75c197b0d59a9b87ee941553644
index c23187c..baaf86c 100644 (file)
@@ -25,6 +25,8 @@ gbrp12le            654861b1837d312569395f598da1a2a1
 gbrp9be             cbe1bf8ead497a92362a749bd4b0a57e
 gbrp9le             f88c68df5d699a4a7f1b0152df9f25fe
 gray                8c941e9bbf6da5336384c57f15a4a454
+gray10be            69c8af356c3861792f9695fdff966629
+gray10le            a97b97107bf03f27136abbaca074aa88
 gray12be            aecffce8ea67ab93527dc74c1a523454
 gray12le            eac4b15c8686f04ea73751294f40b8e0
 gray16be            43bda75c197b0d59a9b87ee941553644
index 0c73ec8..1744e0c 100644 (file)
@@ -25,6 +25,8 @@ gbrp12le            735061c07442657580577d1cede3a636
 gbrp9be             01c837e1def99abec205b80d21b68bf0
 gbrp9le             dd982d59c3d71c3b201f2d9363d8952c
 gray                4c571fb634a75f177b64cee168fbf3a1
+gray10be            6131685ecaf830d08d2e0dee7f9c9d41
+gray10le            6d398a3189f6b029a098393576af989c
 gray12be            d237d56e08482038ebc5f3943d6ec8d5
 gray12le            dcd15a0ed89bd019cc367b552fc9b1c0
 gray16be            9b57ff7d2090b47e4427bee79dba0d9e
index 1847930..b1c5f89 100644 (file)
@@ -25,6 +25,8 @@ gbrp12le            b7b27715bc9054a93ba81f110cf42ee5
 gbrp9be             2ae8f0d3b079d6550a2b1d4a7c4a6e4b
 gbrp9le             c62df0f386c957cc9cacb3c8014542eb
 gray                684ba667effbbf5983f46a9bea4afaae
+gray10be            394b31c05242c3a381f444a84bb327a1
+gray10le            21e14d72eb5b5d1adb2375e0a7417252
 gray12be            e33397832d19ec628f3e887e0a16ccc7
 gray12le            c8a8d7267e2595a0c4ce5d582bea23a1
 gray16be            112077b2f1c85cbd44907ed271901b28