]> source.dussan.org Git - tigervnc.git/commitdiff
Removed the code that prevented colorful rectangles from being encoded
authorConstantin Kaplinsky <const@tightvnc.com>
Tue, 27 Sep 2005 18:31:43 +0000 (18:31 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Tue, 27 Sep 2005 18:31:43 +0000 (18:31 +0000)
with JPEG. The code was introduced to solve the issue with notable
"JPEG trails" when moving windows, but it looks like it prevents too
many rectangles from being encoded with JPEG.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@330 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfb/tightEncode.h

index de0d3436eb48bf2cb4b3f10742346d0d981c74d6..7479d7e28c3b083668d2ee9b80d2300b79eb0043 100644 (file)
@@ -306,35 +306,6 @@ static bool DETECT_SMOOTH_IMAGE (PIXEL_T *buf, const Rect& r)
       s_pjconf == NULL)
     return 0;
 
-  // Quick-n-dirty code to prevent jpeg on images with vertical or
-  // horizontal outer-bands with the same color, such as updates in
-  // response to window moves. Without this code, window movements
-  // leaves dark "trails". The pixels used for this detection are
-  // illustrated below:
-  // *    *
-  //
-  // *         *
-  //
-  //      *    *
-  unsigned int row2_offset = r.height() / 2; row2_offset *= r.width();
-  unsigned int row3_offset = r.width() * (r.height() - 1);
-  PIXEL_T row1_first = buf[0];
-  PIXEL_T row1_middle = buf[r.width() / 2];
-  PIXEL_T row2_first = buf[row2_offset];
-  PIXEL_T row2_last = buf[row2_offset + r.width() - 1];
-  PIXEL_T row3_middle = buf[row3_offset + r.width() / 2];
-  PIXEL_T row3_last = buf[row3_offset + r.width() - 1];
-
-  if ( ((row1_first == row1_middle) || (row3_middle == row3_last)) 
-       && (row1_first != row3_middle) ) {
-      return 0;
-  }
-
-  if ( ((row1_first == row2_first) || (row2_last == row3_last)) 
-       && (row2_first != row2_last) ) {
-      return 0;
-  }
-
   return 1;
 }
 #endif