MSRLE init + fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Günnewig continues his updates to the rewind MSRLE32 DLL
so here it goes

A+
Name:          msrle
ChangeLog:     Michael Günnewig
- prevent some segfaults in the msrle32
- add the necessary line to the sample system.ini for using
  this video codec.
License:       X11
GenDate:       2002/10/09 19:21:04 UTC
ModifiedFiles: dlls/msvideo/msrle32/msrle32.c documentation/samples/system.ini
AddedFiles:    
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/msvideo/msrle32/msrle32.c,v
retrieving revision 1.1
diff -u -u -r1.1 msrle32.c
--- dlls/msvideo/msrle32/msrle32.c	8 Oct 2002 00:40:06 -0000	1.1
+++ dlls/msvideo/msrle32/msrle32.c	9 Oct 2002 19:19:27 -0000
@@ -223,15 +223,15 @@
 
     switch (lpbiIn->biBitCount) {
     case 1:
-      for (x = 0; x < lpbiIn->biWidth; x += 8) {
+      for (x = 0; x < lpbiIn->biWidth / 8; x++) {
 	for (i = 0; i < 7; i++)
-	  lpOut[x + i] = wIntensityTbl[(lpIn[x] >> (7 - i)) & 1];
+	  lpOut[8 * x + i] = wIntensityTbl[(lpIn[x] >> (7 - i)) & 1];
       }
       break;
     case 4:
-      for (x = 0; x < lpbiIn->biWidth; x += 2) {
-	lpOut[x + 0] = wIntensityTbl[(lpIn[x] >> 4)];
-	lpOut[x + 1] = wIntensityTbl[(lpIn[x] & 0x0F)];
+      for (x = 0; x < lpbiIn->biWidth / 2; x++) {
+	lpOut[2 * x + 0] = wIntensityTbl[(lpIn[x] >> 4)];
+	lpOut[2 * x + 1] = wIntensityTbl[(lpIn[x] & 0x0F)];
       }
       break;
     case 8:
@@ -299,13 +299,13 @@
       /* FIXME */
 
       return count;
-    } else if (lpP && ColorCmp(lpP[pos], lpB[pos]) <= lDist) {
+    } else if (lpP != NULL && ColorCmp(lpP[pos], lpB[pos]) <= lDist) {
       /* 'compare' with previous frame for end of diff */
       INT count2 = 0;
 
       /* FIXME */
 
-      if (count2 >= 4)
+      if (count2 >= 8)
 	return count;
 
       pos -= count2;
@@ -388,9 +388,9 @@
     while (count > 2) {
       INT  i;
       INT  size       = min(count, 254);
-      BOOL extra_byte = size % 2;
+      BOOL extra_byte = (size/2) % 2;
 
-      *lpSizeImage += 2 + size + extra_byte;
+      *lpSizeImage += 2 + size/2 + extra_byte;
       count -= size;
       *lpOut++ = 0;
       *lpOut++ = size;
@@ -1413,7 +1413,6 @@
      * No need to recompute internal framedata, because we only swapped buffers */
     LPWORD pTmp = pi->pPrevFrame;
 
-    FIXME(": prev=%ld cur=%ld swap\n",pi->nPrevFrame,lpic->lFrameNum);
     pi->pPrevFrame = pi->pCurFrame;
     pi->pCurFrame  = pTmp;
   } else if ((lpic->dwFlags & ICCOMPRESS_KEYFRAME) == 0) {
Index: documentation/samples/system.ini
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/documentation/samples/system.ini,v
retrieving revision 1.8
diff -u -u -r1.8 system.ini
--- documentation/samples/system.ini	7 Oct 2002 18:21:45 -0000	1.8
+++ documentation/samples/system.ini	9 Oct 2002 19:19:59 -0000
@@ -10,3 +10,4 @@
 [drivers32]
 MSACM.imaadpcm=imaadp32.acm
 MSACM.msadpcm=msadp32.acm
+VIDC.MRLD=msrle32.dll

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux