[Swfdec] 2 commits - libswfdec/jpeg

David Schleef ds at kemper.freedesktop.org
Sat Feb 10 18:25:35 PST 2007


 libswfdec/jpeg/jpeg_rgb_decoder.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

New commits:
diff-tree f4932b1cc75a7e82fa6af103371579096454eb8e (from parents)
Merge: 4656cc03b8ae5802af707fc3a4efbba9d1c2db0a bca06937c45d0d89271681e0dbd3a2fbeeaa9dd0
Author: Debian User <ds at gromit.(none)>
Date:   Sat Feb 10 18:12:52 2007 -0800

    Merge branch 'master' of git+ssh://git.freedesktop.org/git/swfdec

diff-tree 4656cc03b8ae5802af707fc3a4efbba9d1c2db0a (from 17f85210c89d16ae4824771d41ea5bf41988b123)
Author: Debian User <ds at gromit.(none)>
Date:   Sat Feb 10 18:11:35 2007 -0800

    Change chroma upscaling from nearest neighbor to bilinear
    interpolation.

diff --git a/libswfdec/jpeg/jpeg_rgb_decoder.c b/libswfdec/jpeg/jpeg_rgb_decoder.c
index e3b42c7..5240b08 100644
--- a/libswfdec/jpeg/jpeg_rgb_decoder.c
+++ b/libswfdec/jpeg/jpeg_rgb_decoder.c
@@ -229,7 +229,17 @@ scanlinescale2_u8 (unsigned char *dest, 
 {
   int i;
 
-  for (i = 0; i < len; i++) {
-    dest[i] = src[i / 2];
+  for (i = 0; i < len - 3; i += 2){
+    dest[i] = src[i/2];
+    dest[i+1] = (src[i/2] + src[i/2+1] + 1)/2;
   }
+  if (len & 1) {
+    dest[i] = src[i/2];
+    dest[i+1] = (src[i/2] + src[i/2+1] + 1)/2;
+    dest[i+2] = src[i/2 + 1];
+  } else {
+    dest[i] = src[i/2];
+    dest[i+1] = src[i/2];
+  }
+
 }


More information about the Swfdec mailing list