msrle32: Constify some variables.

This commit is contained in:
Andrew Talbot 2007-06-14 20:47:14 +01:00 committed by Alexandre Julliard
parent 077e9c22b8
commit bea2ba50cf

View file

@ -60,23 +60,27 @@ static BOOL isSupportedMRLE(LPCBITMAPINFOHEADER lpbi);
static BYTE MSRLE32_GetNearestPaletteIndex(UINT count, const RGBQUAD *clrs, RGBQUAD clr); static BYTE MSRLE32_GetNearestPaletteIndex(UINT count, const RGBQUAD *clrs, RGBQUAD clr);
/* compression functions */ /* compression functions */
static void computeInternalFrame(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, LPBYTE lpIn); static void computeInternalFrame(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, const BYTE *lpIn);
static LONG MSRLE32_GetMaxCompressedSize(LPCBITMAPINFOHEADER lpbi); static LONG MSRLE32_GetMaxCompressedSize(LPCBITMAPINFOHEADER lpbi);
static LRESULT MSRLE32_CompressRLE4(CodecInfo *pi, LPBITMAPINFOHEADER lpbiIn, LPBYTE lpIn, LPBITMAPINFOHEADER lpbiOut, LPBYTE lpOut, BOOL isKey); static LRESULT MSRLE32_CompressRLE4(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
static LRESULT MSRLE32_CompressRLE8(CodecInfo *pi, LPBITMAPINFOHEADER lpbiIn, LPBYTE lpIn, LPBITMAPINFOHEADER lpbiOut, LPBYTE lpOut, BOOL isKey); const BYTE *lpIn, LPBITMAPINFOHEADER lpbiOut,
LPBYTE lpOut, BOOL isKey);
static LRESULT MSRLE32_CompressRLE8(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
const BYTE *lpIn, LPBITMAPINFOHEADER lpbiOut,
LPBYTE lpOut, BOOL isKey);
/* decompression functions */ /* decompression functions */
static LRESULT MSRLE32_DecompressRLE4(CodecInfo *pi, LPCBITMAPINFOHEADER lpbi, static LRESULT MSRLE32_DecompressRLE4(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbi,
LPBYTE lpIn, LPBYTE lpOut); const BYTE *lpIn, LPBYTE lpOut);
static LRESULT MSRLE32_DecompressRLE8(CodecInfo *pi, LPCBITMAPINFOHEADER lpbi, static LRESULT MSRLE32_DecompressRLE8(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbi,
LPBYTE lpIn, LPBYTE lpOut); const BYTE *lpIn, LPBYTE lpOut);
/* API functions */ /* API functions */
static LRESULT CompressGetFormat(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, static LRESULT CompressGetFormat(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
LPBITMAPINFOHEADER lpbiOut); LPBITMAPINFOHEADER lpbiOut);
static LRESULT CompressGetSize(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, static LRESULT CompressGetSize(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
LPCBITMAPINFOHEADER lpbiOut); LPCBITMAPINFOHEADER lpbiOut);
static LRESULT CompressQuery(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, static LRESULT CompressQuery(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
LPCBITMAPINFOHEADER lpbiOut); LPCBITMAPINFOHEADER lpbiOut);
static LRESULT CompressBegin(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, static LRESULT CompressBegin(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
LPCBITMAPINFOHEADER lpbiOut); LPCBITMAPINFOHEADER lpbiOut);
@ -183,7 +187,7 @@ static BYTE MSRLE32_GetNearestPaletteIndex(UINT count, const RGBQUAD *clrs, RGBQ
/*****************************************************************************/ /*****************************************************************************/
void computeInternalFrame(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, LPBYTE lpIn) void computeInternalFrame(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, const BYTE *lpIn)
{ {
WORD wIntensityTbl[256]; WORD wIntensityTbl[256];
DWORD lInLine, lOutLine; DWORD lInLine, lOutLine;
@ -258,7 +262,7 @@ static LONG MSRLE32_GetMaxCompressedSize(LPCBITMAPINFOHEADER lpbi)
* lpA => previous pos in current frame * lpA => previous pos in current frame
* lpB => current pos in current frame * lpB => current pos in current frame
*/ */
static INT countDiffRLE4(LPWORD lpP, LPWORD lpA, LPWORD lpB, INT pos, LONG lDist, LONG width) static INT countDiffRLE4(const WORD *lpP, const WORD *lpA, const WORD *lpB, INT pos, LONG lDist, LONG width)
{ {
INT count; INT count;
WORD clr1, clr2; WORD clr1, clr2;
@ -317,7 +321,7 @@ static INT countDiffRLE4(LPWORD lpP, LPWORD lpA, LPWORD lpB, INT pos, LONG lDist
* lpA => previous pos in current frame * lpA => previous pos in current frame
* lpB => current pos in current frame * lpB => current pos in current frame
*/ */
static INT countDiffRLE8(LPWORD lpP, LPWORD lpA, LPWORD lpB, INT pos, LONG lDist, LONG width) static INT countDiffRLE8(const WORD *lpP, const WORD *lpA, const WORD *lpB, INT pos, LONG lDist, LONG width)
{ {
INT count; INT count;
@ -346,7 +350,11 @@ static INT countDiffRLE8(LPWORD lpP, LPWORD lpA, LPWORD lpB, INT pos, LONG lDist
return count; return count;
} }
static INT MSRLE32_CompressRLE4Line(CodecInfo *pi, LPWORD lpP, LPWORD lpC, LPCBITMAPINFOHEADER lpbi, BYTE *lpIn, LONG lDist, INT x, LPBYTE *ppOut, DWORD *lpSizeImage) static INT MSRLE32_CompressRLE4Line(const CodecInfo *pi, const WORD *lpP,
const WORD *lpC, LPCBITMAPINFOHEADER lpbi,
const BYTE *lpIn, LONG lDist,
INT x, LPBYTE *ppOut,
DWORD *lpSizeImage)
{ {
LPBYTE lpOut = *ppOut; LPBYTE lpOut = *ppOut;
INT count, pos; INT count, pos;
@ -445,7 +453,11 @@ static INT MSRLE32_CompressRLE4Line(CodecInfo *pi, LPWORD lpP, LPWORD lpC, LPCBI
return x; return x;
} }
static INT MSRLE32_CompressRLE8Line(CodecInfo *pi, LPWORD lpP, LPWORD lpC, LPCBITMAPINFOHEADER lpbi, BYTE *lpIn, LONG lDist, INT x, LPBYTE *ppOut, DWORD *lpSizeImage) static INT MSRLE32_CompressRLE8Line(const CodecInfo *pi, const WORD *lpP,
const WORD *lpC, LPCBITMAPINFOHEADER lpbi,
const BYTE *lpIn, LONG lDist,
INT x, LPBYTE *ppOut,
DWORD *lpSizeImage)
{ {
LPBYTE lpOut = *ppOut; LPBYTE lpOut = *ppOut;
INT count, pos; INT count, pos;
@ -528,7 +540,9 @@ static INT MSRLE32_CompressRLE8Line(CodecInfo *pi, LPWORD lpP, LPWORD lpC, LPCBI
return x; return x;
} }
LRESULT MSRLE32_CompressRLE4(CodecInfo *pi, LPBITMAPINFOHEADER lpbiIn, LPBYTE lpIn, LPBITMAPINFOHEADER lpbiOut, LPBYTE lpOut, BOOL isKey) LRESULT MSRLE32_CompressRLE4(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
const BYTE *lpIn, LPBITMAPINFOHEADER lpbiOut,
LPBYTE lpOut, BOOL isKey)
{ {
LPWORD lpC; LPWORD lpC;
LONG lLine, lInLine, lDist; LONG lLine, lInLine, lDist;
@ -680,7 +694,9 @@ LRESULT MSRLE32_CompressRLE4(CodecInfo *pi, LPBITMAPINFOHEADER lpbiIn, LPBYTE lp
return ICERR_OK; return ICERR_OK;
} }
LRESULT MSRLE32_CompressRLE8(CodecInfo *pi, LPBITMAPINFOHEADER lpbiIn, LPBYTE lpIn, LPBITMAPINFOHEADER lpbiOut, LPBYTE lpOut, BOOL isKey) LRESULT MSRLE32_CompressRLE8(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
const BYTE *lpIn, LPBITMAPINFOHEADER lpbiOut,
LPBYTE lpOut, BOOL isKey)
{ {
LPWORD lpC; LPWORD lpC;
LONG lDist, lInLine, lLine; LONG lDist, lInLine, lLine;
@ -820,8 +836,8 @@ LRESULT MSRLE32_CompressRLE8(CodecInfo *pi, LPBITMAPINFOHEADER lpbiIn, LPBYTE lp
/*****************************************************************************/ /*****************************************************************************/
static LRESULT MSRLE32_DecompressRLE4(CodecInfo *pi, LPCBITMAPINFOHEADER lpbi, static LRESULT MSRLE32_DecompressRLE4(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbi,
LPBYTE lpIn, LPBYTE lpOut) const BYTE *lpIn, LPBYTE lpOut)
{ {
int bytes_per_pixel; int bytes_per_pixel;
int line_size; int line_size;
@ -982,8 +998,8 @@ static LRESULT MSRLE32_DecompressRLE4(CodecInfo *pi, LPCBITMAPINFOHEADER lpbi,
return ICERR_OK; return ICERR_OK;
} }
static LRESULT MSRLE32_DecompressRLE8(CodecInfo *pi, LPCBITMAPINFOHEADER lpbi, static LRESULT MSRLE32_DecompressRLE8(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbi,
LPBYTE lpIn, LPBYTE lpOut) const BYTE *lpIn, LPBYTE lpOut)
{ {
int bytes_per_pixel; int bytes_per_pixel;
int line_size; int line_size;
@ -1153,7 +1169,7 @@ static LRESULT Close(CodecInfo *pi)
return 1; return 1;
} }
static LRESULT GetInfo(CodecInfo *pi, ICINFO *icinfo, DWORD dwSize) static LRESULT GetInfo(const CodecInfo *pi, ICINFO *icinfo, DWORD dwSize)
{ {
/* pre-condition */ /* pre-condition */
assert(pi != NULL); assert(pi != NULL);
@ -1192,7 +1208,7 @@ static LRESULT SetQuality(CodecInfo *pi, LONG lQuality)
return ICERR_OK; return ICERR_OK;
} }
static LRESULT Configure(CodecInfo *pi, HWND hWnd) static LRESULT Configure(const CodecInfo *pi, HWND hWnd)
{ {
/* pre-condition */ /* pre-condition */
assert(pi != NULL); assert(pi != NULL);
@ -1313,7 +1329,7 @@ static LRESULT CompressGetSize(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
return MSRLE32_GetMaxCompressedSize(lpbiOut); return MSRLE32_GetMaxCompressedSize(lpbiOut);
} }
static LRESULT CompressQuery(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, static LRESULT CompressQuery(const CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
LPCBITMAPINFOHEADER lpbiOut) LPCBITMAPINFOHEADER lpbiOut)
{ {
/* pre-condition */ /* pre-condition */