[FFmpeg-devel] [PATCH 1/2] swscale: fix dithers table for DITHER_COPY macro

Mateusz mateuszb at poczta.onet.pl
Tue Oct 24 11:02:16 EEST 2017


The Bayer matrix 8x8 used in DITHER_COPY macro is table dithers[5].
Remaining dithers[] matrixes are generated from this matrix by
downshift or upshift.

This patch fixes dithers[6] and dithers[7] matrixes -- they were
too dark.

Signed-off-by: Mateusz Brzostek <mateuszb at poczta.onet.pl>
---
 libswscale/swscale_unscaled.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 5d81cd5af9..6ffde1ec59 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -90,15 +90,6 @@ DECLARE_ALIGNED(8, static const uint8_t, dithers)[8][8][8]={
   {  48,  0, 60, 12, 51,  3, 63, 15,},
   {  24, 40, 20, 36, 27, 43, 23, 39,},
   {  56,  8, 52,  4, 59, 11, 55,  7,},
-},{
-  {  18, 34, 30, 46, 17, 33, 29, 45,},
-  {  50,  2, 62, 14, 49,  1, 61, 13,},
-  {  26, 42, 22, 38, 25, 41, 21, 37,},
-  {  58, 10, 54,  6, 57,  9, 53,  5,},
-  {  16, 32, 28, 44, 19, 35, 31, 47,},
-  {  48,  0, 60, 12, 51,  3, 63, 15,},
-  {  24, 40, 20, 36, 27, 43, 23, 39,},
-  {  56,  8, 52,  4, 59, 11, 55,  7,},
 },{
   {  36, 68, 60, 92, 34, 66, 58, 90,},
   { 100,  4,124, 28, 98,  2,122, 26,},
@@ -108,6 +99,15 @@ DECLARE_ALIGNED(8, static const uint8_t, dithers)[8][8][8]={
   {  96,  0,120, 24,102,  6,126, 30,},
   {  48, 80, 40, 72, 54, 86, 46, 78,},
   { 112, 16,104,  8,118, 22,110, 14,},
+},{
+  {  72,136,120,184, 68,132,116,180,},
+  { 200,  8,248, 56,196,  4,244, 52,},
+  { 104,168, 88,152,100,164, 84,148,},
+  { 232, 40,216, 24,228, 36,212, 20,},
+  {  64,128,112,176, 76,140,124,188,},
+  { 192,  0,240, 48,204, 12,252, 60,},
+  {  96,160, 80,144,108,172, 92,156,},
+  { 224, 32,208, 16,236, 44,220, 28,},
 }};
 
 
-- 
2.14.2.windows.3



More information about the ffmpeg-devel mailing list