[FFmpeg-cvslog] sws: Only reset dither state for bitexact mode

Michael Niedermayer git at videolan.org
Sat Jan 19 02:39:56 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jan 19 01:40:10 2013 +0100| [8045c0167dbe9779f75d1c23a97f501eca92d33e] | committer: Michael Niedermayer

sws: Only reset dither state for bitexact mode

the output looks better with a random initial state than
all 0

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libswscale/swscale.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index dbe61c7..bf0c130 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -910,7 +910,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
         src2[0] = base;
     }
 
-    if (!srcSliceY && (c->flags & SWS_ERROR_DIFFUSION))
+    if (!srcSliceY && (c->flags & SWS_BITEXACT) && (c->flags & SWS_ERROR_DIFFUSION))
         for (i = 0; i < 4; i++)
             memset(c->dither_error[i], 0, sizeof(c->dither_error[0][0]) * (c->dstW+2));
 



More information about the ffmpeg-cvslog mailing list