little speed-up
authorThomas Bluemel <thomas@reactsoft.com>
Fri, 26 Mar 2004 23:48:47 +0000 (23:48 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Fri, 26 Mar 2004 23:48:47 +0000 (23:48 +0000)
svn path=/trunk/; revision=8878

reactos/subsys/win32k/dib/dib16bpp.c
reactos/subsys/win32k/dib/dib32bpp.c
reactos/subsys/win32k/dib/dib8bpp.c

index efb81a6..a9abbe9 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dib16bpp.c,v 1.19 2004/02/19 09:31:30 fireball Exp $ */
+/* $Id: dib16bpp.c,v 1.20 2004/03/26 23:48:47 weiden Exp $ */
 #undef WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <stdlib.h>
@@ -393,7 +393,7 @@ void ScaleLineAvg16(PIXEL *Target, PIXEL *Source, int SrcWidth, int TgtWidth)
   int NumPixels = TgtWidth;
   int IntPart = SrcWidth / TgtWidth;
   int FractPart = SrcWidth % TgtWidth;
-  int Mid = TgtWidth / 2;
+  int Mid = TgtWidth >> 1;
   int E = 0;
   int skip;
   PIXEL p;
@@ -422,9 +422,9 @@ void ScaleRectAvg16(PIXEL *Target, PIXEL *Source, int SrcWidth, int SrcHeight,
                   int TgtWidth, int TgtHeight, int srcPitch, int dstPitch)
 {
   int NumPixels = TgtHeight;
-  int IntPart = ((SrcHeight / TgtHeight) * srcPitch) / 2; //(SrcHeight / TgtHeight) * SrcWidth;
+  int IntPart = ((SrcHeight / TgtHeight) * srcPitch) >> 1; //(SrcHeight / TgtHeight) * SrcWidth;
   int FractPart = SrcHeight % TgtHeight;
-  int Mid = TgtHeight / 2;
+  int Mid = TgtHeight >> 1;
   int E = 0;
   int skip;
   PIXEL *ScanLine, *ScanLineAhead;
index 63e4005..500b878 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dib32bpp.c,v 1.12 2004/02/21 09:06:25 navaraf Exp $ */
+/* $Id: dib32bpp.c,v 1.13 2004/03/26 23:48:47 weiden Exp $ */
 #undef WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <stdlib.h>
@@ -64,7 +64,7 @@ DIB_32BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
 {
   PBYTE byteaddr = SurfObj->pvScan0 + y1 * SurfObj->lDelta;
   PDWORD addr = (PDWORD)byteaddr + x;
-  LONG lDelta = SurfObj->lDelta / sizeof(DWORD);
+  LONG lDelta = SurfObj->lDelta >> 2; /* >> 2 == / sizeof(DWORD) */
 
   byteaddr = (PBYTE)addr;
   while(y1++ < y2) {
@@ -309,7 +309,7 @@ void ScaleLineAvg32(PIXEL *Target, PIXEL *Source, int SrcWidth, int TgtWidth)
   int NumPixels = TgtWidth;
   int IntPart = SrcWidth / TgtWidth;
   int FractPart = SrcWidth % TgtWidth;
-  int Mid = TgtWidth / 2;
+  int Mid = TgtWidth >> 1;
   int E = 0;
   int skip;
   PIXEL p;
@@ -338,9 +338,9 @@ void ScaleRectAvg32(PIXEL *Target, PIXEL *Source, int SrcWidth, int SrcHeight,
                   int TgtWidth, int TgtHeight, int srcPitch, int dstPitch)
 {
   int NumPixels = TgtHeight;
-  int IntPart = ((SrcHeight / TgtHeight) * srcPitch) / 2; //(SrcHeight / TgtHeight) * SrcWidth;
+  int IntPart = ((SrcHeight / TgtHeight) * srcPitch) >> 1; //(SrcHeight / TgtHeight) * SrcWidth;
   int FractPart = SrcHeight % TgtHeight;
-  int Mid = TgtHeight / 2;
+  int Mid = TgtHeight >> 1;
   int E = 0;
   int skip;
   PIXEL *ScanLine, *ScanLineAhead;
index 20727dd..dcea5c2 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dib8bpp.c,v 1.14 2004/02/21 09:06:25 navaraf Exp $ */
+/* $Id: dib8bpp.c,v 1.15 2004/03/26 23:48:47 weiden Exp $ */
 #undef WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <stdlib.h>
@@ -364,7 +364,7 @@ void ScaleLineAvg8(PIXEL *Target, PIXEL *Source, int SrcWidth, int TgtWidth)
   int NumPixels = TgtWidth;
   int IntPart = SrcWidth / TgtWidth;
   int FractPart = SrcWidth % TgtWidth;
-  int Mid = TgtWidth / 2;
+  int Mid = TgtWidth >> 1;
   int E = 0;
   int skip;
   PIXEL p;
@@ -393,9 +393,9 @@ void ScaleRectAvg8(PIXEL *Target, PIXEL *Source, int SrcWidth, int SrcHeight,
                   int TgtWidth, int TgtHeight, int srcPitch, int dstPitch)
 {
   int NumPixels = TgtHeight;
-  int IntPart = ((SrcHeight / TgtHeight) * srcPitch) / 2; //(SrcHeight / TgtHeight) * SrcWidth;
+  int IntPart = ((SrcHeight / TgtHeight) * srcPitch) >> 1; //(SrcHeight / TgtHeight) * SrcWidth;
   int FractPart = SrcHeight % TgtHeight;
-  int Mid = TgtHeight / 2;
+  int Mid = TgtHeight >> 1;
   int E = 0;
   int skip;
   PIXEL *ScanLine, *ScanLineAhead;