* from the Cornell lossless JPEG code
*/
/*
- * $Id: decomp.c,v 1.2 2003/10/29 18:24:40 malaterre Exp $
+ * $Id: decomp.c,v 1.3 2004/08/18 02:26:08 malaterre Exp $
*/
#include <stdio.h>
#include <stdlib.h>
#include "mcu.h"
#include "proto.h"
-DecompressInfo dcInfo;
-StreamIN JpegInFile;
+static DecompressInfo dcInfo;
+static StreamIN JpegInFile;
/*
*--------------------------------------------------------------
* software
*/
/*
- * $Id: huffd.c,v 1.2 2004/01/07 10:07:28 regrain Exp $
+ * $Id: huffd.c,v 1.3 2004/08/18 02:26:08 malaterre Exp $
*/
#include <stdio.h>
#include <stdlib.h>
* The following variables keep track of the input buffer
* for the JPEG data, which is read by ReadJpegData.
*/
-Uchar *inputBuffer; /* Input buffer for JPEG data */
+Uchar *inputBuffer = 0; /* Input buffer for JPEG data */
int inputBufferOffset = 0; /* Offset of current byte */
/*
/* The upper neighbors are predictors for the first column. */
for (curComp = 0; curComp < compsInScan; curComp++)
- {
+ {
ci = dcPtr->MCUmembership[curComp];
compptr = dcPtr->curCompInfo[ci];
dctbl = dcPtr->dcHuffTblPtrs[compptr->dcTblNo];
for (col=1; col < numCOL; col++)
{
for (curComp = 0; curComp < compsInScan; curComp++)
- {
+ {
ci = dcPtr->MCUmembership[curComp];
compptr = dcPtr->curCompInfo[ci];
dctbl = dcPtr->dcHuffTblPtrs[compptr->dcTblNo];
* are stolen from the IJG code
*/
/*
- * $Id: jpegutil.c,v 1.1 2003/10/21 12:08:54 jpr Exp $
+ * $Id: jpegutil.c,v 1.2 2004/08/18 02:26:08 malaterre Exp $
*/
#include <stdio.h>
#include <stdlib.h>
* Enough memory is reserved to accomodate up to 1024-wide images
* with up to 4 components.
*/
-char mcuROW1Memory[1024 * sizeof(MCU)];
-char mcuROW2Memory[1024 * sizeof(MCU)];
-char buf1Memory[1024 * 4 * sizeof(ComponentType)];
-char buf2Memory[1024 * 4 * sizeof(ComponentType)];
+static char mcuROW1Memory[1024 * sizeof(MCU)];
+static char mcuROW2Memory[1024 * sizeof(MCU)];
+static char buf1Memory[1024 * 4 * sizeof(ComponentType)];
+static char buf2Memory[1024 * 4 * sizeof(ComponentType)];
unsigned int bitMask[] = { 0xffffffff, 0x7fffffff, 0x3fffffff, 0x1fffffff,
*
*/
/*
- * $Id: mcu.c,v 1.1 2003/10/21 12:08:54 jpr Exp $
+ * $Id: mcu.c,v 1.2 2004/08/18 02:26:08 malaterre Exp $
*/
#include <stdio.h>
#include <stdlib.h>
#include "mcu.h"
#include "proto.h"
-MCU *mcuTable; /* the global mcu table that buffers the source image */
+MCU *mcuTable=NULL; /* the global mcu table that buffers the source image */
MCU *mcuROW1=NULL; /* point to two rows of MCU in encoding & decoding */
MCU *mcuROW2=NULL;
-int numMCU; /* number of MCUs in mcuTable */
+int numMCU=0; /* number of MCUs in mcuTable */
/*
*--------------------------------------------------------------
* from the IJG software
*/
/*
- * $Id: read.c,v 1.1 2003/10/21 12:08:54 jpr Exp $
+ * $Id: read.c,v 1.2 2004/08/18 02:26:08 malaterre Exp $
*/
#include <stdio.h>
#include <stdlib.h>
* Huffman tables once here, then pointers set later as needed
*/
-HuffmanTable HuffmanTableMemory[4];
+static HuffmanTable HuffmanTableMemory[4];
/*
* Enumerate all the JPEG marker codes