#define dec_huffdc (dhuff + 0)
#define dec_huffac (dhuff + 2)
-static struct in in;
+static struct in glob_in;
static int readtables(int till)
{
{
int i;
- if (dec_readmarker(&in) != info.rm)
+ if (dec_readmarker(&glob_in) != info.rm)
return -1;
info.nm = info.dri;
info.rm = (info.rm + 1) & ~0x08;
return 1;
}
-int jpeg_decode(unsigned char *buf, unsigned char *pic,
+int jpeg_decode(unsigned char *buf, unsigned char *pic,
int width, int height, int depth, struct jpeg_decdata *decdata)
{
int i, j, m, tac, tdc;
idctqtab(quant[dscans[1].tq], decdata->dquant[1]);
idctqtab(quant[dscans[2].tq], decdata->dquant[2]);
initcol(decdata->dquant);
- setinput(&in, datap);
+ setinput(&glob_in, datap);
#if 0
/* landing zone */
if (dec_checkmarker())
return ERR_WRONG_MARKER;
- decode_mcus(&in, decdata->dcts, 6, dscans, max);
+ decode_mcus(&glob_in, decdata->dcts, 6, dscans, max);
idct(decdata->dcts, decdata->out, decdata->dquant[0], IFIX(128.5), max[0]);
idct(decdata->dcts + 64, decdata->out + 64, decdata->dquant[0], IFIX(128.5), max[1]);
idct(decdata->dcts + 128, decdata->out + 128, decdata->dquant[0], IFIX(128.5), max[2]);
}
}
- m = dec_readmarker(&in);
+ m = dec_readmarker(&glob_in);
if (m != M_EOI)
return ERR_NO_EOI;
6, 13, 17, 24, 32, 38, 47, 49
};
-void idct(int *in, int *out, PREC *quant, PREC off, int max)
+void idct(int *in, int *out, PREC *lquant, PREC off, int max)
{
PREC t0, t1, t2, t3, t4, t5, t6, t7, t;
PREC tmp[64], *tmpp;
t0 = off;
if (max == 1) {
- t0 += in[0] * quant[0];
+ t0 += in[0] * lquant[0];
for (i = 0; i < 64; i++)
out[i] = ITOINT(t0);
return;
tmpp = tmp;
for (i = 0; i < 8; i++) {
j = *zig2p++;
- t0 += in[j] * quant[j];
+ t0 += in[j] * lquant[j];
j = *zig2p++;
- t5 = in[j] * quant[j];
+ t5 = in[j] * lquant[j];
j = *zig2p++;
- t2 = in[j] * quant[j];
+ t2 = in[j] * lquant[j];
j = *zig2p++;
- t7 = in[j] * quant[j];
+ t7 = in[j] * lquant[j];
j = *zig2p++;
- t1 = in[j] * quant[j];
+ t1 = in[j] * lquant[j];
j = *zig2p++;
- t4 = in[j] * quant[j];
+ t4 = in[j] * lquant[j];
j = *zig2p++;
- t3 = in[j] * quant[j];
+ t3 = in[j] * lquant[j];
j = *zig2p++;
- t6 = in[j] * quant[j];
+ t6 = in[j] * lquant[j];
IDCT;
tmpp[0 * 8] = t0;
tmpp[1 * 8] = t1;