[FFmpeg-cvslog] libswscale: add gray9 support

Paul B Mahol git at videolan.org
Mon Aug 7 14:35:09 EEST 2017


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Aug  5 14:28:45 2017 +0200| [de48710c11cebd4c50bb51ebf3cb5fd0e6a79d40] | committer: Paul B Mahol

libswscale: add gray9 support

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de48710c11cebd4c50bb51ebf3cb5fd0e6a79d40
---

 libavcodec/raw.c                         | 2 ++
 libswscale/input.c                       | 2 ++
 libswscale/swscale_unscaled.c            | 1 +
 libswscale/utils.c                       | 4 ++++
 libswscale/version.h                     | 2 +-
 tests/ref/fate/filter-pixdesc-gray9be    | 1 +
 tests/ref/fate/filter-pixdesc-gray9le    | 1 +
 tests/ref/fate/filter-pixfmts-copy       | 2 ++
 tests/ref/fate/filter-pixfmts-crop       | 2 ++
 tests/ref/fate/filter-pixfmts-field      | 2 ++
 tests/ref/fate/filter-pixfmts-fieldorder | 2 ++
 tests/ref/fate/filter-pixfmts-hflip      | 2 ++
 tests/ref/fate/filter-pixfmts-il         | 2 ++
 tests/ref/fate/filter-pixfmts-null       | 2 ++
 tests/ref/fate/filter-pixfmts-pad        | 1 +
 tests/ref/fate/filter-pixfmts-scale      | 2 ++
 tests/ref/fate/filter-pixfmts-vflip      | 2 ++
 17 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index c6be686c53..8da2a9735e 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -119,6 +119,8 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { AV_PIX_FMT_RGB48BE,  MKTAG( 48, 'R', 'G', 'B') },
     { AV_PIX_FMT_BGR48LE,  MKTAG('B', 'G', 'R', 48 ) },
     { AV_PIX_FMT_BGR48BE,  MKTAG( 48, 'B', 'G', 'R') },
+    { AV_PIX_FMT_GRAY9LE,     MKTAG('Y', '1',  0 ,  9 ) },
+    { AV_PIX_FMT_GRAY9BE,     MKTAG( 9 ,  0 , '1', 'Y') },
     { AV_PIX_FMT_GRAY10LE,    MKTAG('Y', '1',  0 , 10 ) },
     { AV_PIX_FMT_GRAY10BE,    MKTAG(10 ,  0 , '1', 'Y') },
     { AV_PIX_FMT_GRAY12LE,    MKTAG('Y', '1',  0 , 12 ) },
diff --git a/libswscale/input.c b/libswscale/input.c
index 04a5190711..bb2f4933ec 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -1362,6 +1362,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_YUV422P16LE:
     case AV_PIX_FMT_YUV444P16LE:
 
+    case AV_PIX_FMT_GRAY9LE:
     case AV_PIX_FMT_GRAY10LE:
     case AV_PIX_FMT_GRAY12LE:
     case AV_PIX_FMT_GRAY16LE:
@@ -1400,6 +1401,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_YUV422P16BE:
     case AV_PIX_FMT_YUV444P16BE:
 
+    case AV_PIX_FMT_GRAY9BE:
     case AV_PIX_FMT_GRAY10BE:
     case AV_PIX_FMT_GRAY12BE:
     case AV_PIX_FMT_GRAY16BE:
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index ba3d688a26..3b1b3667ce 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -1796,6 +1796,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_GRAY9)  ||
         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) ||
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 17c996734a..b75510d206 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -131,6 +131,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
     [AV_PIX_FMT_RGB0]        = { 1, 1 },
     [AV_PIX_FMT_0BGR]        = { 1, 1 },
     [AV_PIX_FMT_BGR0]        = { 1, 1 },
+    [AV_PIX_FMT_GRAY9BE]     = { 1, 1 },
+    [AV_PIX_FMT_GRAY9LE]     = { 1, 1 },
     [AV_PIX_FMT_GRAY10BE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY10LE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY12BE]    = { 1, 1 },
@@ -1016,6 +1018,8 @@ static int handle_jpeg(enum AVPixelFormat *format)
         return 1;
     case AV_PIX_FMT_GRAY8:
     case AV_PIX_FMT_YA8:
+    case AV_PIX_FMT_GRAY9LE:
+    case AV_PIX_FMT_GRAY9BE:
     case AV_PIX_FMT_GRAY10LE:
     case AV_PIX_FMT_GRAY10BE:
     case AV_PIX_FMT_GRAY12LE:
diff --git a/libswscale/version.h b/libswscale/version.h
index dcdc85bc74..8dff77e48a 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -28,7 +28,7 @@
 
 #define LIBSWSCALE_VERSION_MAJOR   4
 #define LIBSWSCALE_VERSION_MINOR   7
-#define LIBSWSCALE_VERSION_MICRO 101
+#define LIBSWSCALE_VERSION_MICRO 102
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
                                                LIBSWSCALE_VERSION_MINOR, \
diff --git a/tests/ref/fate/filter-pixdesc-gray9be b/tests/ref/fate/filter-pixdesc-gray9be
new file mode 100644
index 0000000000..bf92e299b5
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-gray9be
@@ -0,0 +1 @@
+pixdesc-gray9be     19aef736657607fdc6191f5338860580
diff --git a/tests/ref/fate/filter-pixdesc-gray9le b/tests/ref/fate/filter-pixdesc-gray9le
new file mode 100644
index 0000000000..4c65fb97c2
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-gray9le
@@ -0,0 +1 @@
+pixdesc-gray9le     f2a28bb71966f5d6e44eedef67e0118a
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index 927c8b74f3..124dddeacb 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -43,6 +43,8 @@ gray12be            9685614450f1282be433d2b07234ca1f
 gray12le            2700bd7fb3fea56e54eb03e31d6d4e57
 gray16be            08d997a3faa25a3db9d6be272d282eef
 gray16le            df65eb804360795e3e38a2701fa9641a
+gray9be             6382a14594a8b68f0ec7de25531f9334
+gray9le             4eb1dda58706436e3b69aef29b0089db
 monob               8b04f859fee6a0be856be184acd7a0b5
 monow               54d16d2c01abfd72ecdb5e51e283937c
 nv12                8e24feb2c544dc26a20047a71e4c27aa
diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop
index cc588b1a96..e21479ceb0 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -43,6 +43,8 @@ gray12be            472700c26cc49b8d5f74af141f6a0d38
 gray12le            4f6537fe1f32b3963350f8c435009433
 gray16be            38f599da990224de86e3dc7a543121a9
 gray16le            9ff7c866bd98def4e6c91542c1c45f80
+gray9be             8ffcb18d699480f55414bfc21ab33321
+gray9le             4d1932d4968a248584f5e39c25f1dd43
 nv12                92cda427f794374731ec0321ee00caac
 nv21                1bcfc197f4fb95de85ba58182d8d2f69
 p010be              8b2de2eb6b099bbf355bfc55a0694ddc
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index 7799a28f67..ba2af6e76f 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -43,6 +43,8 @@ gray12be            d34c50810b37e6f97dffdf6a8ab958de
 gray12le            cf71b8fee47ce7821f3ae9f9b62ae39a
 gray16be            e1700e056de9917744a7ff4ab2ca63fd
 gray16le            338de7ac5f7d36d5ad5ac2c8d5bbea68
+gray9be             25e50940fa300a8f09edfb6eba4fd250
+gray9le             1146cfc1b92bfd07ed238e65ffcd134f
 monob               2129cc72a484d7e10a44de9117aa9f80
 monow               03d783611d265cae78293f88ea126ea1
 nv12                16f7a46708ef25ebd0b72e47920cc11e
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index c837cb5236..84a9e003c7 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -43,6 +43,8 @@ gray12be            1c3285c150e1dddcf0fbee405cfb068e
 gray12le            a57b6199f5690add0ac0150fa95c4988
 gray16be            293a36548ce16543494790f8f7f76a05
 gray16le            84f83f5fcbb5d458efb8395a50a3797e
+gray9be             ec877f5bcf0ea275a6f36c12cc9adf11
+gray9le             fba944fde7923d5089f4f52d12988b9e
 rgb0                2e3d8c91c7a83d451593dfd06607ff39
 rgb24               b82577f8215d3dc2681be60f1da247af
 rgb444be            1c3afc3a0c53c51139c76504f59bb1f4
diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip
index dddda78aa0..875980d892 100644
--- a/tests/ref/fate/filter-pixfmts-hflip
+++ b/tests/ref/fate/filter-pixfmts-hflip
@@ -43,6 +43,8 @@ gray12be            de7b5ef4b513e7e8270c617249d1cbdf
 gray12le            e8d0739ff61649bd82722b3134cbe776
 gray16be            cf7294d9aa23e1b838692ec01ade587b
 gray16le            d91ce41e304419bcf32ac792f01bd64f
+gray9be             ac8d260669479ae720a5b6d4d8639e34
+gray9le             424fc581947bc8c357c9ec5e3c1c04d1
 nv12                801e58f1be5fd0b5bc4bf007c604b0b4
 nv21                9f10dfff8963dc327d3395af21f0554f
 p010be              744b13e44d39e1ff7588983fa03e0101
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index f05b321dde..c6885b970e 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -43,6 +43,8 @@ gray12be            c62bc3def5ea217dfb68433905cb9d64
 gray12le            5bd0fef836928e1e19a315782a8c1302
 gray16be            92c3b09f371b610cc1b6a9776034f4d0
 gray16le            1db278d23a554e01910cedacc6c02521
+gray9be             ed7db5bb2ddc09bc26068c8b858db204
+gray9le             2ec9188f0dcfefef76a09f371d7beb8e
 monob               faba75df28033ba7ce3d82ff2a99ee68
 monow               6e9cfb8d3a344c5f0c3e1d5e1297e580
 nv12                3c3ba9b1b4c4dfff09c26f71b51dd146
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index 927c8b74f3..124dddeacb 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -43,6 +43,8 @@ gray12be            9685614450f1282be433d2b07234ca1f
 gray12le            2700bd7fb3fea56e54eb03e31d6d4e57
 gray16be            08d997a3faa25a3db9d6be272d282eef
 gray16le            df65eb804360795e3e38a2701fa9641a
+gray9be             6382a14594a8b68f0ec7de25531f9334
+gray9le             4eb1dda58706436e3b69aef29b0089db
 monob               8b04f859fee6a0be856be184acd7a0b5
 monow               54d16d2c01abfd72ecdb5e51e283937c
 nv12                8e24feb2c544dc26a20047a71e4c27aa
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index 072a0611a0..2f8e4dd7cf 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -19,6 +19,7 @@ gray                ddc663a0491df3959d9c5795dceaa72e
 gray10le            fcec0e9ca335941047bf624d3ad39765
 gray12le            f9ebea57dd9931fd833a278f2e5fa38b
 gray16le            468bda6155bdc7a7a20c34d6e599fd16
+gray9le             d06fab97364d7d480232426facfc362c
 nv12                381574979cb04be10c9168540310afad
 nv21                0fdeb2cdd56cf5a7147dc273456fa217
 rgb0                78d500c8361ab6423a4826a00268c908
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index dcc34bd4d1..f43c519428 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -43,6 +43,8 @@ gray12be            950de5d1b6b943a26c51f6a157e19a14
 gray12le            9c3b154a8bb0a73a3b465892dbc23b36
 gray16be            32891cb0928b1119d8d43a6e1bef0e2b
 gray16le            f96cfb5652b090dad52615930f0ce65f
+gray9be             779dec0c6c2df008128b91622a20daf8
+gray9le             fa87a96ca275f82260358635f838b514
 monob               f01cb0b623357387827902d9d0963435
 monow               35c68b86c226d6990b2dcb573a05ff6b
 nv12                b118d24a3653fe66e5d9e079033aef79
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index 4e2df90c54..84b9d56858 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -43,6 +43,8 @@ gray12be            7423ce8a77fbc40c5d4776eb28fec60a
 gray12le            808158633559d7deebc7dac2d79e88f8
 gray16be            29f24ba7cb0fc4fd2ae78963d008f6e6
 gray16le            a37e9c4ea76e8eeddc2af8f600ba2c10
+gray9be             dda11d4ffd62b414012ffc4667fb4971
+gray9le             159bf6482d217b2b8276eb2216cd7a09
 monob               7810c4857822ccfc844d78f5e803269a
 monow               90a947bfcd5f2261e83b577f48ec57b1
 nv12                261ebe585ae2aa4e70d39a10c1679294



More information about the ffmpeg-cvslog mailing list