{
register JSAMPROW inptr, outptr;
JSAMPLE *maxinptr;
- register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
int rindex = rgb_red[cinfo->out_color_space];
int gindex = rgb_green[cinfo->out_color_space];
if((hnd=tjInitDecompress())==NULL)
_throwtj("executing tjInitDecompress()");
+ bufsize=(yuv==YUVDECODE? yuvsize:pitch*h);
if(rgbbuf==NULL)
{
- bufsize=(yuv==YUVDECODE? yuvsize:pitch*h);
if((rgbbuf=(unsigned char *)malloc(bufsize)) == NULL)
_throwunix("allocating image buffer");
rgbbufalloc=1;
char *filename)
{
char tempstr[1024];
- FILE *outfile=NULL; tjhandle hnd;
+ FILE *outfile=NULL; tjhandle hnd=NULL;
unsigned char **jpegbuf=NULL, *rgbbuf=NULL;
double start, elapsed;
- int jpgbufsize=0, i, j, tilesizex, tilesizey, numtilesx, numtilesy, ITER;
+ int jpgbufsize=0, i, j, tilesizex=w, tilesizey=h, numtilesx=1, numtilesy=1,
+ ITER;
unsigned long *comptilesize=NULL;
int flags=(forcemmx?TJ_FORCEMMX:0)|(forcesse?TJ_FORCESSE:0)
|(forcesse2?TJ_FORCESSE2:0)|(forcesse3?TJ_FORCESSE3:0)
|(fastupsample?TJ_FASTUPSAMPLE:0);
int ps=_ps[pf], tilen;
- int pitch=w*ps, yuvsize;
+ int pitch=w*ps, yuvsize=0;
flags |= _flags[pf];
if(bu) flags |= TJ_BOTTOMUP;
int main(int argc, char *argv[])
{
unsigned char *bmpbuf=NULL; int w, h, i;
- int qual, hiqual=-1; char *temp;
+ int qual=-1, hiqual=-1; char *temp;
int minarg=2;
if(argc<minarg) usage(argv[0]);
ptr=_tmpbuf;
for(i=0; i<dinfo->num_components; i++)
{
- jpeg_component_info *compptr=&dinfo->comp_info[i];
if((tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*th[i]))==NULL)
_throw("Memory allocation failed in tjDecompress()");
for(row=0; row<th[i]; row++)
int j;
for(i=0; i<dinfo->num_components; i++)
{
- jpeg_component_info *compptr=&dinfo->comp_info[i];
for(j=0; j<min(th[i], ch[i]-crow[i]); j++)
{
memcpy(outbuf[i][crow[i]+j], tmpbuf[i][j], cw[i]);