diff mbox

[FFmpeg-devel,2/3] swscale: add gray14 support

Message ID 20180503204955.16369-2-onemda@gmail.com
State Accepted
Commit b9dd058f7a9df0119ad1cb7a0b115fbfa77d7cf4
Headers show

Commit Message

Paul B Mahol May 3, 2018, 8:49 p.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/raw.c                         | 2 ++
 libavformat/nut.c                        | 3 +++
 libswscale/input.c                       | 2 ++
 libswscale/swscale_unscaled.c            | 1 +
 libswscale/utils.c                       | 4 ++++
 tests/ref/fate/filter-pixdesc-gray14be   | 1 +
 tests/ref/fate/filter-pixdesc-gray14le   | 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-transpose  | 2 ++
 tests/ref/fate/filter-pixfmts-vflip      | 2 ++
 18 files changed, 35 insertions(+)
 create mode 100644 tests/ref/fate/filter-pixdesc-gray14be
 create mode 100644 tests/ref/fate/filter-pixdesc-gray14le

Comments

Michael Niedermayer May 5, 2018, 1:43 p.m. UTC | #1
On Thu, May 03, 2018 at 10:49:54PM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/raw.c                         | 2 ++
>  libavformat/nut.c                        | 3 +++
>  libswscale/input.c                       | 2 ++
>  libswscale/swscale_unscaled.c            | 1 +
>  libswscale/utils.c                       | 4 ++++
>  tests/ref/fate/filter-pixdesc-gray14be   | 1 +
>  tests/ref/fate/filter-pixdesc-gray14le   | 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-transpose  | 2 ++
>  tests/ref/fate/filter-pixfmts-vflip      | 2 ++
>  18 files changed, 35 insertions(+)
>  create mode 100644 tests/ref/fate/filter-pixdesc-gray14be
>  create mode 100644 tests/ref/fate/filter-pixdesc-gray14le

should be ok if you tested scaled and unscaled, ASM and C convert

thx

[...]
Michael Niedermayer May 5, 2018, 1:45 p.m. UTC | #2
On Sat, May 05, 2018 at 03:43:49PM +0200, Michael Niedermayer wrote:
> On Thu, May 03, 2018 at 10:49:54PM +0200, Paul B Mahol wrote:
> > Signed-off-by: Paul B Mahol <onemda@gmail.com>
> > ---
> >  libavcodec/raw.c                         | 2 ++
> >  libavformat/nut.c                        | 3 +++
> >  libswscale/input.c                       | 2 ++
> >  libswscale/swscale_unscaled.c            | 1 +
> >  libswscale/utils.c                       | 4 ++++
> >  tests/ref/fate/filter-pixdesc-gray14be   | 1 +
> >  tests/ref/fate/filter-pixdesc-gray14le   | 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-transpose  | 2 ++
> >  tests/ref/fate/filter-pixfmts-vflip      | 2 ++
> >  18 files changed, 35 insertions(+)
> >  create mode 100644 tests/ref/fate/filter-pixdesc-gray14be
> >  create mode 100644 tests/ref/fate/filter-pixdesc-gray14le
> 
> should be ok if you tested scaled and unscaled, ASM and C convert
> 
> thx

and fate needs an update for one of these patches, probably this one

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index 8da2a9735e..d731c087d1 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -125,6 +125,8 @@  const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { AV_PIX_FMT_GRAY10BE,    MKTAG(10 ,  0 , '1', 'Y') },
     { AV_PIX_FMT_GRAY12LE,    MKTAG('Y', '1',  0 , 12 ) },
     { AV_PIX_FMT_GRAY12BE,    MKTAG(12 ,  0 , '1', 'Y') },
+    { AV_PIX_FMT_GRAY14LE,    MKTAG('Y', '1',  0 , 14 ) },
+    { AV_PIX_FMT_GRAY14BE,    MKTAG(14 ,  0 , '1', 'Y') },
     { AV_PIX_FMT_GRAY16LE,    MKTAG('Y', '1',  0 , 16 ) },
     { AV_PIX_FMT_GRAY16BE,    MKTAG(16 ,  0 , '1', 'Y') },
     { AV_PIX_FMT_YUV420P9LE,  MKTAG('Y', '3', 11 ,  9 ) },
diff --git a/libavformat/nut.c b/libavformat/nut.c
index 592fe4dc28..e65f42438b 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -154,6 +154,9 @@  const AVCodecTag ff_nut_video_tags[] = {
     { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',   0,  16) },
     { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,    0, '4', 'Y') },
 
+    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '1',   0,  14) },
+    { AV_CODEC_ID_RAWVIDEO,         MKTAG(14,    0, '1', 'Y') },
+
     { AV_CODEC_ID_RAWVIDEO,         MKTAG('G', '3',   0,   8) },
 
     { AV_CODEC_ID_RAWVIDEO,         MKTAG('G', '3',   0,   9) },
diff --git a/libswscale/input.c b/libswscale/input.c
index bb2f4933ec..3fd3a5d81e 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -1365,6 +1365,7 @@  av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_GRAY9LE:
     case AV_PIX_FMT_GRAY10LE:
     case AV_PIX_FMT_GRAY12LE:
+    case AV_PIX_FMT_GRAY14LE:
     case AV_PIX_FMT_GRAY16LE:
 
     case AV_PIX_FMT_P016LE:
@@ -1404,6 +1405,7 @@  av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_GRAY9BE:
     case AV_PIX_FMT_GRAY10BE:
     case AV_PIX_FMT_GRAY12BE:
+    case AV_PIX_FMT_GRAY14BE:
     case AV_PIX_FMT_GRAY16BE:
 
     case AV_PIX_FMT_P016BE:
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 13f9cd83e3..6480070cbf 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -1852,6 +1852,7 @@  void ff_get_unscaled_swscale(SwsContext *c)
         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_GRAY14) ||
         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_AYUV64) ||
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 98a6b99476..61b47182f8 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -137,6 +137,8 @@  static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
     [AV_PIX_FMT_GRAY10LE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY12BE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY12LE]    = { 1, 1 },
+    [AV_PIX_FMT_GRAY14BE]    = { 1, 1 },
+    [AV_PIX_FMT_GRAY14LE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY16BE]    = { 1, 1 },
     [AV_PIX_FMT_GRAY16LE]    = { 1, 1 },
     [AV_PIX_FMT_YUV440P]     = { 1, 1 },
@@ -1024,6 +1026,8 @@  static int handle_jpeg(enum AVPixelFormat *format)
     case AV_PIX_FMT_GRAY10BE:
     case AV_PIX_FMT_GRAY12LE:
     case AV_PIX_FMT_GRAY12BE:
+    case AV_PIX_FMT_GRAY14LE:
+    case AV_PIX_FMT_GRAY14BE:
     case AV_PIX_FMT_GRAY16LE:
     case AV_PIX_FMT_GRAY16BE:
     case AV_PIX_FMT_YA16BE:
diff --git a/tests/ref/fate/filter-pixdesc-gray14be b/tests/ref/fate/filter-pixdesc-gray14be
new file mode 100644
index 0000000000..dc7836a10e
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-gray14be
@@ -0,0 +1 @@ 
+pixdesc-gray14be    6c9faae02a63f17d78ae6bff2866c0c1
diff --git a/tests/ref/fate/filter-pixdesc-gray14le b/tests/ref/fate/filter-pixdesc-gray14le
new file mode 100644
index 0000000000..9057875bd1
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-gray14le
@@ -0,0 +1 @@ 
+pixdesc-gray14le    713c6b98b8f22a0716bf3541fb311936
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index c45ce937b3..013b33f1c0 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -41,6 +41,8 @@  gray10be            d486558ecd2e27afc17930be861f0e4c
 gray10le            917d687103b2adcca7132bfc070ca54a
 gray12be            9685614450f1282be433d2b07234ca1f
 gray12le            2700bd7fb3fea56e54eb03e31d6d4e57
+gray14be            19ed2bf25878980d6f81f6ae699024ec
+gray14le            4b148b26b30040c05dc248a8852f31ac
 gray16be            08d997a3faa25a3db9d6be272d282eef
 gray16le            df65eb804360795e3e38a2701fa9641a
 gray9be             6382a14594a8b68f0ec7de25531f9334
diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop
index c5bb8a4135..750ea27404 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -41,6 +41,8 @@  gray10be            18ed76cab145ab9058cc353fcec6d3c4
 gray10le            fd83f7489880160783ddb125615b4638
 gray12be            472700c26cc49b8d5f74af141f6a0d38
 gray12le            4f6537fe1f32b3963350f8c435009433
+gray14be            302b5b534f64ee15fffe2d3818e8c29c
+gray14le            9c205ae791cbb9e479beb0ece236c05f
 gray16be            38f599da990224de86e3dc7a543121a9
 gray16le            9ff7c866bd98def4e6c91542c1c45f80
 gray9be             8ffcb18d699480f55414bfc21ab33321
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index df43ce6931..4fdc214781 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -41,6 +41,8 @@  gray10be            437713f3d081238cddb738e106e5a27d
 gray10le            c749b80049b152f4ba3e66a72c0c5acc
 gray12be            d34c50810b37e6f97dffdf6a8ab958de
 gray12le            cf71b8fee47ce7821f3ae9f9b62ae39a
+gray14be            2644f330259d70793d789b8dc3c01226
+gray14le            7776a471945d303088012cbc2ff2a2d0
 gray16be            e1700e056de9917744a7ff4ab2ca63fd
 gray16le            338de7ac5f7d36d5ad5ac2c8d5bbea68
 gray9be             25e50940fa300a8f09edfb6eba4fd250
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index 84a9e003c7..7fc158b0af 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -41,6 +41,8 @@  gray10be            c26c73de96b630f1207ff589b6553ebd
 gray10le            16e4db1d611ec3fa5c9fd8fbdbf1ffcc
 gray12be            1c3285c150e1dddcf0fbee405cfb068e
 gray12le            a57b6199f5690add0ac0150fa95c4988
+gray14be            1e3d0d0421cf84eac93d7ab1964207ff
+gray14le            04899f53627203bd1fe3f17fb0de199c
 gray16be            293a36548ce16543494790f8f7f76a05
 gray16le            84f83f5fcbb5d458efb8395a50a3797e
 gray9be             ec877f5bcf0ea275a6f36c12cc9adf11
diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip
index a98314b0b3..70a43d9959 100644
--- a/tests/ref/fate/filter-pixfmts-hflip
+++ b/tests/ref/fate/filter-pixfmts-hflip
@@ -41,6 +41,8 @@  gray10be            160dd03e30d33379de92c70ee52c01fd
 gray10le            6baac1da6be3789409b67cd506afe7da
 gray12be            de7b5ef4b513e7e8270c617249d1cbdf
 gray12le            e8d0739ff61649bd82722b3134cbe776
+gray14be            22560aaac37f5bb2982819b752bf4608
+gray14le            d4b2f5e7c4bbd39130655b8f2c55f010
 gray16be            cf7294d9aa23e1b838692ec01ade587b
 gray16le            d91ce41e304419bcf32ac792f01bd64f
 gray9be             ac8d260669479ae720a5b6d4d8639e34
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index 3ed6c46226..ba06851e24 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -41,6 +41,8 @@  gray10be            8400dec0eefb172849b785d35fc55674
 gray10le            b7d6e49e8d1291f2b0a57d55e9478ef1
 gray12be            c62bc3def5ea217dfb68433905cb9d64
 gray12le            5bd0fef836928e1e19a315782a8c1302
+gray14be            5b3a15c182e2daed65dc39c33fd62735
+gray14le            3573d6870b14256f01800066d36ad862
 gray16be            92c3b09f371b610cc1b6a9776034f4d0
 gray16le            1db278d23a554e01910cedacc6c02521
 gray9be             ed7db5bb2ddc09bc26068c8b858db204
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index c45ce937b3..013b33f1c0 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -41,6 +41,8 @@  gray10be            d486558ecd2e27afc17930be861f0e4c
 gray10le            917d687103b2adcca7132bfc070ca54a
 gray12be            9685614450f1282be433d2b07234ca1f
 gray12le            2700bd7fb3fea56e54eb03e31d6d4e57
+gray14be            19ed2bf25878980d6f81f6ae699024ec
+gray14le            4b148b26b30040c05dc248a8852f31ac
 gray16be            08d997a3faa25a3db9d6be272d282eef
 gray16le            df65eb804360795e3e38a2701fa9641a
 gray9be             6382a14594a8b68f0ec7de25531f9334
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index 68b83e7a61..4f16029551 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -18,6 +18,7 @@  gbrp9le             9e827f438e081d334a6cae7e282698b0
 gray                ddc663a0491df3959d9c5795dceaa72e
 gray10le            e6559c1c8c05ce89f44b465573db44e7
 gray12le            1e6c6757658c7ae8a1f830432c5b7722
+gray14le            1a25a0a3f064297b79d83c591898e638
 gray16le            468bda6155bdc7a7a20c34d6e599fd16
 gray9le             f8f3dfe31ca5fcba828285bceefdab9a
 nv12                381574979cb04be10c9168540310afad
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index 1611c60ea7..559355be49 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -41,6 +41,8 @@  gray10be            9452756d0b37f4f5c7cae7635e22d747
 gray10le            37fd2e1ec6b66410212d39a342e864df
 gray12be            950de5d1b6b943a26c51f6a157e19a14
 gray12le            9c3b154a8bb0a73a3b465892dbc23b36
+gray14be            db9094229f32fb22c5cf06471b9a1cfa
+gray14le            c33308eb8b40142dfd9273249c1cd73a
 gray16be            32891cb0928b1119d8d43a6e1bef0e2b
 gray16le            f96cfb5652b090dad52615930f0ce65f
 gray9be             779dec0c6c2df008128b91622a20daf8
diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose
index 49069d6e06..78218cda4e 100644
--- a/tests/ref/fate/filter-pixfmts-transpose
+++ b/tests/ref/fate/filter-pixfmts-transpose
@@ -41,6 +41,8 @@  gray10be            48b421da79c195fd91dffb8fca79a8a2
 gray10le            7774e3296916b896afa46f626334a280
 gray12be            89f1c4b7821b771f6d967f9db871f8ef
 gray12le            43d392c3dcbd79b47cce31f2006c5050
+gray14be            5e2d1eb84d6d375502b3210d572d7433
+gray14le            6114774e9d07b08ec52fabaf6d0ee85a
 gray16be            4aef307021a91b1de67f1d4381a39132
 gray16le            76f2afe156edca7ae05cfa4e5867126e
 gray9be             2c425fa532c940d226822da8b3592310
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index d49e50196e..3cb99e7d8d 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -41,6 +41,8 @@  gray10be            52710b3ab3ccf6101d28109f58cd48c4
 gray10le            9c432a163f0cfe9ee2a4b72ae8a7c307
 gray12be            7423ce8a77fbc40c5d4776eb28fec60a
 gray12le            808158633559d7deebc7dac2d79e88f8
+gray14be            68b14e31a089d6bd1fa2082d66d004da
+gray14le            3842b874a9b05ce2ae3cad9ef7131013
 gray16be            29f24ba7cb0fc4fd2ae78963d008f6e6
 gray16le            a37e9c4ea76e8eeddc2af8f600ba2c10
 gray9be             dda11d4ffd62b414012ffc4667fb4971