sws/output: fix ordered dither threshold for mono output
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 Feb 2016 09:01:02 +0000 (10:01 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 Feb 2016 16:22:26 +0000 (17:22 +0100)
This makes sure that white stays white and black black

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
22 files changed:
libswscale/output.c
tests/ref/fate/filter-pixdesc-monob
tests/ref/fate/filter-pixdesc-monow
tests/ref/fate/filter-pixfmts-copy
tests/ref/fate/filter-pixfmts-field
tests/ref/fate/filter-pixfmts-il
tests/ref/fate/filter-pixfmts-null
tests/ref/fate/filter-pixfmts-scale
tests/ref/fate/filter-pixfmts-vflip
tests/ref/lavf/pam
tests/ref/lavf/pbmpipe
tests/ref/lavf/pixfmt
tests/ref/lavf/xbm
tests/ref/lavf/xwd
tests/ref/vsynth/vsynth1-bpp1
tests/ref/vsynth/vsynth1-xface
tests/ref/vsynth/vsynth2-bpp1
tests/ref/vsynth/vsynth2-xface
tests/ref/vsynth/vsynth3-bpp1
tests/ref/vsynth/vsynth3-xface
tests/ref/vsynth/vsynth_lena-bpp1
tests/ref/vsynth/vsynth_lena-xface

index 5811814..0c763c3 100644 (file)
@@ -313,7 +313,7 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS
 
 #define accumulate_bit(acc, val) \
     acc <<= 1; \
-    acc |= (val) >= (128 + 110)
+    acc |= (val) >= 234
 #define output_pixel(pos, acc) \
     if (target == AV_PIX_FMT_MONOBLACK) { \
         pos = acc; \
index 00df9ef..63a4b62 100644 (file)
@@ -1 +1 @@
-pixdesc-monob       e795648f4f5054ca133437570cf5ba5f
+pixdesc-monob       e69e4b6e48dd419bb199312727f60a47
index 429c5b4..c73f327 100644 (file)
@@ -1 +1 @@
-pixdesc-monow       e7d8142228a04d9ef3cdc4473ef8a69f
+pixdesc-monow       51a45d1d34b95373fffdd79fc3abf457
index 7bab4b8..5f4b162 100644 (file)
@@ -31,8 +31,8 @@ gbrp9le             bc80da439638c59f1d822037f52739af
 gray                188590b1231afd231ea910815aef2b25
 gray16be            08d997a3faa25a3db9d6be272d282eef
 gray16le            df65eb804360795e3e38a2701fa9641a
-monob               a6869bab4f6e64fe13dcab13b41775b3
-monow               0404328f1838a6503371478a559ca20d
+monob               8b04f859fee6a0be856be184acd7a0b5
+monow               54d16d2c01abfd72ecdb5e51e283937c
 nv12                8e24feb2c544dc26a20047a71e4c27aa
 nv21                335d85c9af6110f26ae9e187a82ed2cf
 pal8                ff5929f5b42075793b2c34cb441bede5
index e599571..9e04db4 100644 (file)
@@ -31,8 +31,8 @@ gbrp9le             1654c79e38dc78fdf106239ed2a7bd4f
 gray                57fd8e6e00f6be8752726005974cce1b
 gray16be            e1700e056de9917744a7ff4ab2ca63fd
 gray16le            338de7ac5f7d36d5ad5ac2c8d5bbea68
-monob               599b938a6207de81bd96c902c2511676
-monow               8486b94cd7c498b0effd33cb7e8e63df
+monob               2129cc72a484d7e10a44de9117aa9f80
+monow               03d783611d265cae78293f88ea126ea1
 nv12                16f7a46708ef25ebd0b72e47920cc11e
 nv21                7294574037cc7f9373ef5695d8ebe809
 pal8                0658c18dcd8d052d59dfbe23f5b368d9
index f61ed58..a9a3c7b 100644 (file)
@@ -31,8 +31,8 @@ gbrp9le             7e79b4bbb589095c925d65cb7c037d44
 gray                52ae18648161ac43144f5c9cd2127786
 gray16be            92c3b09f371b610cc1b6a9776034f4d0
 gray16le            1db278d23a554e01910cedacc6c02521
-monob               ee0012e4df0bf06a09cefb49be68e850
-monow               5e0868812e25cc867cdc78d5252cbb81
+monob               faba75df28033ba7ce3d82ff2a99ee68
+monow               6e9cfb8d3a344c5f0c3e1d5e1297e580
 nv12                3c3ba9b1b4c4dfff09c26f71b51dd146
 nv21                ab586d8781246b5a32d8760a61db9797
 rgb0                cfaf68671e43248267d8cd50cae8c13f
index 7bab4b8..5f4b162 100644 (file)
@@ -31,8 +31,8 @@ gbrp9le             bc80da439638c59f1d822037f52739af
 gray                188590b1231afd231ea910815aef2b25
 gray16be            08d997a3faa25a3db9d6be272d282eef
 gray16le            df65eb804360795e3e38a2701fa9641a
-monob               a6869bab4f6e64fe13dcab13b41775b3
-monow               0404328f1838a6503371478a559ca20d
+monob               8b04f859fee6a0be856be184acd7a0b5
+monow               54d16d2c01abfd72ecdb5e51e283937c
 nv12                8e24feb2c544dc26a20047a71e4c27aa
 nv21                335d85c9af6110f26ae9e187a82ed2cf
 pal8                ff5929f5b42075793b2c34cb441bede5
index 1e4503c..241e839 100644 (file)
@@ -31,8 +31,8 @@ gbrp9le             0ed709f7828f0be5f828596f0720a82b
 gray                221201cc7cfc4964eacd8b3e426fd276
 gray16be            32891cb0928b1119d8d43a6e1bef0e2b
 gray16le            f96cfb5652b090dad52615930f0ce65f
-monob               337d236f59b891b16dd17c5267cf874b
-monow               3cb791057cf735930f97fe67e5125c45
+monob               f01cb0b623357387827902d9d0963435
+monow               35c68b86c226d6990b2dcb573a05ff6b
 nv12                b118d24a3653fe66e5d9e079033aef79
 nv21                c74bb1c10dbbdee8a1f682b194486c4d
 pal8                29e10892009b2cfe431815ec3052ed3b
index 2c35a23..c7cc0c7 100644 (file)
@@ -31,8 +31,8 @@ gbrp9le             cff296346d93e430cbc0acfbc91482ab
 gray                41811422d5819ed69389357294384c10
 gray16be            29f24ba7cb0fc4fd2ae78963d008f6e6
 gray16le            a37e9c4ea76e8eeddc2af8f600ba2c10
-monob               f51f07ba50f4398233106f0e81494170
-monow               ee414089983b5be0f76b9d962757d900
+monob               7810c4857822ccfc844d78f5e803269a
+monow               90a947bfcd5f2261e83b577f48ec57b1
 nv12                261ebe585ae2aa4e70d39a10c1679294
 nv21                2909feacd27bebb080c8e0fa41795269
 pal8                450b0155d0f2d5628bf95a442db5f817
index abb2974..97893f6 100644 (file)
@@ -13,6 +13,6 @@
 032538f0313b4f240b44a5bef115f5bf *./tests/data/images/pam/02.pam
 ./tests/data/images/pam/%02d.pam CRC=0x5984c023
 608321 ./tests/data/images/pam/02.pam
-e8bd9f1830e6a9db201386e96580f869 *./tests/data/images/pam/02.pam
-./tests/data/images/pam/%02d.pam CRC=0x65707c37
+d2f5eb2f959ca3a90c02f1887b6e0c4f *./tests/data/images/pam/02.pam
+./tests/data/images/pam/%02d.pam CRC=0xab19200d
 101447 ./tests/data/images/pam/02.pam
index d50ed71..284f90b 100644 (file)
@@ -1,3 +1,3 @@
-8ced96f5b6b7362358199ae993b4ceb7 *./tests/data/lavf/pbmpipe.pbm
+8b974da7f48f9e6d5ae327b4444a71fb *./tests/data/lavf/pbmpipe.pbm
 317075 ./tests/data/lavf/pbmpipe.pbm
-./tests/data/lavf/pbmpipe.pbm CRC=0xfae0a1ba
+./tests/data/lavf/pbmpipe.pbm CRC=0xfc010c66
index 8803087..ec75d4c 100644 (file)
@@ -28,9 +28,9 @@ efa7c0337cc00c796c6df615223716f1 *./tests/data/pixfmt/rgb565.yuv
 304128 ./tests/data/pixfmt/rgb555.yuv
 1e080c12bd9755c41ecb8e19b756f406 *./tests/data/pixfmt/gray.yuv
 304128 ./tests/data/pixfmt/gray.yuv
-6c719671e39f1bcf67b47eab98fa529b *./tests/data/pixfmt/monow.yuv
+d87cf0c2e7a13cc693fe6ece22461c83 *./tests/data/pixfmt/monow.yuv
 304128 ./tests/data/pixfmt/monow.yuv
-6c719671e39f1bcf67b47eab98fa529b *./tests/data/pixfmt/monob.yuv
+d87cf0c2e7a13cc693fe6ece22461c83 *./tests/data/pixfmt/monob.yuv
 304128 ./tests/data/pixfmt/monob.yuv
 00b85790df5740bab95e2559d81603a7 *./tests/data/pixfmt/yuv440p.yuv
 304128 ./tests/data/pixfmt/yuv440p.yuv
index 4cc4be6..705713b 100644 (file)
@@ -1,3 +1,3 @@
-99c20fff5d17b698b4a25282aebc3c51 *./tests/data/images/xbm/02.xbm
-./tests/data/images/xbm/%02d.xbm CRC=0x0f5aa5cb
+0629055fd82366317c651a0af4bb82d7 *./tests/data/images/xbm/02.xbm
+./tests/data/images/xbm/%02d.xbm CRC=0xc9a20204
 76411 ./tests/data/images/xbm/02.xbm
index 5e593b5..3d63821 100644 (file)
@@ -19,6 +19,6 @@ fe1af954966a40c2cd35fc27094ff823 *./tests/data/images/xwd/02.xwd
 85e9b8b814a1dea71d143aac2e487037 *./tests/data/images/xwd/02.xwd
 ./tests/data/images/xwd/%02d.xwd CRC=0x0ff205be
 101487 ./tests/data/images/xwd/02.xwd
-2131b4c41fe35178b0c7d121223af549 *./tests/data/images/xwd/02.xwd
-./tests/data/images/xwd/%02d.xwd CRC=0x0f5aa5cb
+796e2e309ac0844cfb2f4959816508ee *./tests/data/images/xwd/02.xwd
+./tests/data/images/xwd/%02d.xwd CRC=0xc9a20204
 12783 ./tests/data/images/xwd/02.xwd
index 32dab11..0bd1a77 100644 (file)
@@ -1,4 +1,4 @@
-3e5e0f4afb3a0350440e86b1ea56cec9 *tests/data/fate/vsynth1-bpp1.avi
+611de0803ff6bd0ef385dde59964a105 *tests/data/fate/vsynth1-bpp1.avi
 640452 tests/data/fate/vsynth1-bpp1.avi
-ccef5f5d5b0392f1d01c200499dac657 *tests/data/fate/vsynth1-bpp1.out.rawvideo
-stddev:   97.30 PSNR:  8.37 MAXDIFF:  237 bytes:  7603200/  7603200
+576b690e8a8921c54d777463b63a8307 *tests/data/fate/vsynth1-bpp1.out.rawvideo
+stddev:   97.41 PSNR:  8.36 MAXDIFF:  238 bytes:  7603200/  7603200
index 3b916c6..f4d3821 100644 (file)
@@ -1,4 +1,4 @@
-487c3e53249f7b9f16e04257295998de *tests/data/fate/vsynth1-xface.nut
-19746 tests/data/fate/vsynth1-xface.nut
-42d8261bb538b8789840ac085f7fc4d2 *tests/data/fate/vsynth1-xface.out.rawvideo
-stddev:  103.88 PSNR:  7.80 MAXDIFF:  254 bytes:  7603200/  7603200
+98a6c85c83454c3209eedbe704a09cb5 *tests/data/fate/vsynth1-xface.nut
+19800 tests/data/fate/vsynth1-xface.nut
+cb1d399fcf818a70e5bc5769934d0094 *tests/data/fate/vsynth1-xface.out.rawvideo
+stddev:  103.97 PSNR:  7.79 MAXDIFF:  254 bytes:  7603200/  7603200
index d010bbd..d283d6c 100644 (file)
@@ -1,4 +1,4 @@
-771437c9038b44f4e2d4ff764c1c3821 *tests/data/fate/vsynth2-bpp1.avi
+b51ad49892eb8f8912c5a983718a17bb *tests/data/fate/vsynth2-bpp1.avi
 640452 tests/data/fate/vsynth2-bpp1.avi
-ba70b5aebc786e625af6bd7f7ec82717 *tests/data/fate/vsynth2-bpp1.out.rawvideo
-stddev:   81.63 PSNR:  9.89 MAXDIFF:  237 bytes:  7603200/  7603200
+338fb9039a4564e471bf8179f0c48a95 *tests/data/fate/vsynth2-bpp1.out.rawvideo
+stddev:   80.40 PSNR: 10.02 MAXDIFF:  238 bytes:  7603200/  7603200
index 4544269..54dc29e 100644 (file)
@@ -1,4 +1,4 @@
-dc0ff0ba9588dbec10580941529b77a2 *tests/data/fate/vsynth2-xface.nut
-16866 tests/data/fate/vsynth2-xface.nut
-71a54876bc79746cc8c36f3f02aea4ef *tests/data/fate/vsynth2-xface.out.rawvideo
-stddev:   86.58 PSNR:  9.38 MAXDIFF:  250 bytes:  7603200/  7603200
+c498ec3b58b86b8164cef9d63184fa6d *tests/data/fate/vsynth2-xface.nut
+16423 tests/data/fate/vsynth2-xface.nut
+9106961054b226c360f284272cfd4474 *tests/data/fate/vsynth2-xface.out.rawvideo
+stddev:   85.41 PSNR:  9.50 MAXDIFF:  250 bytes:  7603200/  7603200
index f84808a..5a65728 100644 (file)
@@ -1,4 +1,4 @@
-a5e6d1eff2f6fc3bba31e3bb8753b905 *tests/data/fate/vsynth3-bpp1.avi
+98852649c5201df7d85d0e9b5a5b9f15 *tests/data/fate/vsynth3-bpp1.avi
 15352 tests/data/fate/vsynth3-bpp1.avi
-75e8ee0c0b0ada4515455d9f29377a16 *tests/data/fate/vsynth3-bpp1.out.rawvideo
-stddev:   97.70 PSNR:  8.33 MAXDIFF:  248 bytes:    86700/    86700
+0b1ea21b69d384564dd3a978065443b2 *tests/data/fate/vsynth3-bpp1.out.rawvideo
+stddev:   97.64 PSNR:  8.34 MAXDIFF:  248 bytes:    86700/    86700
index f98a5c5..b6ef097 100644 (file)
@@ -1,4 +1,4 @@
-f399a6b312d0a2d873b8a3bc761c5eba *tests/data/fate/vsynth3-xface.nut
-15696 tests/data/fate/vsynth3-xface.nut
-eafdc027c9c36f96e71e91a5682a0d2e *tests/data/fate/vsynth3-xface.out.rawvideo
-stddev:   97.22 PSNR:  8.37 MAXDIFF:  236 bytes:    86700/    86700
+367fa226e570b30935305a22982a54ba *tests/data/fate/vsynth3-xface.nut
+15772 tests/data/fate/vsynth3-xface.nut
+83a8c44631fbc8b185df932679db0e5b *tests/data/fate/vsynth3-xface.out.rawvideo
+stddev:   97.23 PSNR:  8.37 MAXDIFF:  238 bytes:    86700/    86700
index d4570c7..63ab9e1 100644 (file)
@@ -1,4 +1,4 @@
-d53d08c755ffde5fca744f0f941bfcb1 *tests/data/fate/vsynth_lena-bpp1.avi
+2859022fac452b59e49a1189c4fbb3ec *tests/data/fate/vsynth_lena-bpp1.avi
 640452 tests/data/fate/vsynth_lena-bpp1.avi
-9a66df9009670b0a593d889975246c00 *tests/data/fate/vsynth_lena-bpp1.out.rawvideo
-stddev:   96.36 PSNR:  8.45 MAXDIFF:  233 bytes:  7603200/  7603200
+3be3497f8ca548c9196dcecc5bc7cb2b *tests/data/fate/vsynth_lena-bpp1.out.rawvideo
+stddev:   96.52 PSNR:  8.44 MAXDIFF:  231 bytes:  7603200/  7603200
index 61031f9..a38fed5 100644 (file)
@@ -1,4 +1,4 @@
-6a1a7b467eeab2795510e7dd1ca528ff *tests/data/fate/vsynth_lena-xface.nut
-17504 tests/data/fate/vsynth_lena-xface.nut
-6d87881d630439d02c7a97f468d67a1c *tests/data/fate/vsynth_lena-xface.out.rawvideo
-stddev:   99.01 PSNR:  8.22 MAXDIFF:  238 bytes:  7603200/  7603200
+0dd4e19b989cb102ffb06768740d940f *tests/data/fate/vsynth_lena-xface.nut
+17551 tests/data/fate/vsynth_lena-xface.nut
+88ff6155a8b88872e6581d08febdb050 *tests/data/fate/vsynth_lena-xface.out.rawvideo
+stddev:   99.20 PSNR:  8.20 MAXDIFF:  238 bytes:  7603200/  7603200