Lines Matching +full:- +full:- +full:exit +full:- +full:code

1 /*----------------------------------------------------------------------------/
2 / TJpgDec - Tiny JPEG Decompressor R0.03 (C)ChaN, 2021
3 /-----------------------------------------------------------------------------/
12 / personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
13 / * Redistributions of source code must retain the above copyright notice.
15 /-----------------------------------------------------------------------------/
25 /----------------------------------------------------------------------------*/
34 #define HUFF_MASK (HUFF_LEN - 1)
38 /*-----------------------------------------------*/
39 /* Zigzag-order to raster-order conversion table */
40 /*-----------------------------------------------*/
42 static const uint8_t Zig[64] = { /* Zigzag-order to raster-order conversion table */
51 /*-------------------------------------------------*/
54 /*-------------------------------------------------*/
69 /*---------------------------------------------*/
71 /*---------------------------------------------*/
96 /* -512..-257 */
105 /* -256..-1 */
129 /*-----------------------------------------------------------------------*/
131 /*-----------------------------------------------------------------------*/
143 if(jd->sz_pool >= ndata) { in alloc_pool()
144 jd->sz_pool -= ndata; in alloc_pool()
145 rp = (char *)jd->pool; /* Get start of available memory pool */ in alloc_pool()
146 jd->pool = (void *)(rp + ndata); /* Allocate required bytes */ in alloc_pool()
155 /*-----------------------------------------------------------------------*/
156 /* Create de-quantization and prescaling tables with a DQT segment */
157 /*-----------------------------------------------------------------------*/
172 ndata -= 65; in create_qt_tbl()
174 if(d & 0xF0) return JDR_FMT1; /* Err: not 8-bit resolution */ in create_qt_tbl()
178 jd->qttbl[i] = pb; /* Register the table */ in create_qt_tbl()
180 zi = Zig[i]; /* Zigzag-order to raster-order conversion */ in create_qt_tbl()
181 …t)((uint32_t) * data++ * Ipsf[zi]); /* Apply scale factor of Arai algorithm to the de-quantizers */ in create_qt_tbl()
191 /*-----------------------------------------------------------------------*/
192 /* Create huffman code tables with a DHT segment */
193 /*-----------------------------------------------------------------------*/
209 ndata -= 17; in create_huffman_tbl()
216 jd->huffbits[num][cls] = pb; in create_huffman_tbl()
217 for(np = i = 0; i < 16; i++) { /* Load number of patterns for 1 to 16-bit code */ in create_huffman_tbl()
218 np += (pb[i] = *data++); /* Get sum of code words for each code */ in create_huffman_tbl()
220 … ph = alloc_pool(jd, np * sizeof(uint16_t)); /* Allocate a memory block for the code word table */ in create_huffman_tbl()
222 jd->huffcode[num][cls] = ph; in create_huffman_tbl()
224 for(j = i = 0; i < 16; i++) { /* Re-build huffman code word table */ in create_huffman_tbl()
226 while(b--) ph[j++] = hc++; in create_huffman_tbl()
231 ndata -= np; in create_huffman_tbl()
234 jd->huffdata[num][cls] = pd; in create_huffman_tbl()
235 for(i = 0; i < np; i++) { /* Load decoded data corresponds to each code word */ in create_huffman_tbl()
249 jd->hufflut_ac[num] = tbl_ac; in create_huffman_tbl()
250 …set(tbl_ac, 0xFF, HUFF_LEN * sizeof(uint16_t)); /* Default value (0xFFFF: may be long code) */ in create_huffman_tbl()
255 jd->hufflut_dc[num] = tbl_dc; in create_huffman_tbl()
256 …emset(tbl_dc, 0xFF, HUFF_LEN * sizeof(uint8_t)); /* Default value (0xFF: may be long code) */ in create_huffman_tbl()
259 for(j = pb[b]; j; j--) { in create_huffman_tbl()
260 … ti = ph[i] << (HUFF_BIT - 1 - b) & HUFF_MASK; /* Index of input pattern for the code */ in create_huffman_tbl()
262 … td = pd[i++] | ((b + 1) << 8); /* b15..b8: code length, b7..b0: zero run and data length */ in create_huffman_tbl()
263 … for(span = 1 << (HUFF_BIT - 1 - b); span; span--, tbl_ac[ti++] = (uint16_t)td) ; in create_huffman_tbl()
266 … td = pd[i++] | ((b + 1) << 4); /* b7..b4: code length, b3..b0: data length */ in create_huffman_tbl()
267 … for(span = 1 << (HUFF_BIT - 1 - b); span; span--, tbl_dc[ti++] = (uint8_t)td) ; in create_huffman_tbl()
271 jd->longofs[num][cls] = i; /* Code table offset for long code */ in create_huffman_tbl()
282 /*-----------------------------------------------------------------------*/
284 /*-----------------------------------------------------------------------*/
286 static int huffext( /* >=0: decoded data, <0: error code */ in huffext()
292 size_t dc = jd->dctr; in huffext()
293 uint8_t * dp = jd->dptr; in huffext()
298 const uint8_t * hb = jd->huffbits[id][cls]; /* Bit distribution table */ in huffext()
299 const uint16_t * hc = jd->huffcode[id][cls]; /* Code word table */ in huffext()
300 const uint8_t * hd = jd->huffdata[id][cls]; /* Data table */ in huffext()
303 bm = jd->dbit; /* Bit mask to extract */ in huffext()
305 bl = 16; /* Max code length */ in huffext()
308 if(!dc) { /* No input data is available, re-fill input buffer */ in huffext()
309 dp = jd->inbuf; /* Top of input buffer */ in huffext()
310 dc = jd->infunc(jd, dp, JD_SZBUF); in huffext()
311 … if(!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ in huffext()
316 dc--; /* Decrement number of available bytes */ in huffext()
318 flg = 0; /* Exit flag sequence */ in huffext()
319 …if(*dp != 0) return 0 - (int)JDR_FMT1; /* Err: unexpected flag is detected (may be corrupted data… in huffext()
334 for(nd = *hb++; nd; nd--) { /* Search the code word in this bit length */ in huffext()
336 jd->dbit = bm; in huffext()
337 jd->dctr = dc; in huffext()
338 jd->dptr = dp; in huffext()
343 bl--; in huffext()
349 unsigned int nc, bl, wbit = jd->dbit % 32; in huffext()
350 uint32_t w = jd->wreg & ((1UL << wbit) - 1); in huffext()
354 if(jd->marker) { in huffext()
358 if(!dc) { /* Buffer empty, re-fill input buffer */ in huffext()
359 dp = jd->inbuf; /* Top of input buffer */ in huffext()
360 dc = jd->infunc(jd, dp, JD_SZBUF); in huffext()
361 … if(!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ in huffext()
364 dc--; in huffext()
366 flg = 0; /* Exit flag sequence */ in huffext()
367 if(d != 0) jd->marker = d; /* Not an escape of 0xFF but a marker */ in huffext()
380 jd->dctr = dc; in huffext()
381 jd->dptr = dp; in huffext()
382 jd->wreg = w; in huffext()
386 d = (unsigned int)(w >> (wbit - HUFF_BIT)); /* Short code as table index */ in huffext()
388 d = jd->hufflut_ac[id][d]; /* Table decode */ in huffext()
389 if(d != 0xFFFF) { /* It is done if hit in short code */ in huffext()
390 jd->dbit = wbit - (d >> 8); /* Snip the code length */ in huffext()
395 d = jd->hufflut_dc[id][d]; /* Table decode */ in huffext()
396 if(d != 0xFF) { /* It is done if hit in short code */ in huffext()
397 jd->dbit = wbit - (d >> 4); /* Snip the code length */ in huffext()
403 hb = jd->huffbits[id][cls] + HUFF_BIT; /* Bit distribution table */ in huffext()
404 hc = jd->huffcode[id][cls] + jd->longofs[id][cls]; /* Code word table */ in huffext()
405 hd = jd->huffdata[id][cls] + jd->longofs[id][cls]; /* Data table */ in huffext()
409 hb = jd->huffbits[id][cls]; /* Bit distribution table */ in huffext()
410 hc = jd->huffcode[id][cls]; /* Code word table */ in huffext()
411 hd = jd->huffdata[id][cls]; /* Data table */ in huffext()
417 d = w >> (wbit - bl); in huffext()
418 do { /* Search the code word in this bit length */ in huffext()
420 jd->dbit = wbit - bl; /* Snip the huffman code */ in huffext()
424 } while(--nc); in huffext()
429 return 0 - (int)JDR_FMT1; /* Err: code not found (may be corrupted data) */ in huffext()
435 /*-----------------------------------------------------------------------*/
437 /*-----------------------------------------------------------------------*/
439 static int bitext( /* >=0: extracted data, <0: error code */ in bitext()
444 size_t dc = jd->dctr; in bitext()
445 uint8_t * dp = jd->dptr; in bitext()
449 uint8_t mbit = jd->dbit; in bitext()
454 if(!dc) { /* No input data is available, re-fill input buffer */ in bitext()
455 dp = jd->inbuf; /* Top of input buffer */ in bitext()
456 dc = jd->infunc(jd, dp, JD_SZBUF); in bitext()
457 … if(!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ in bitext()
462 dc--; /* Decrement number of available bytes */ in bitext()
464 flg = 0; /* Exit flag sequence */ in bitext()
465 …if(*dp != 0) return 0 - (int)JDR_FMT1; /* Err: unexpected flag is detected (may be corrupted data… in bitext()
479 nbit--; in bitext()
482 jd->dbit = mbit; in bitext()
483 jd->dctr = dc; in bitext()
484 jd->dptr = dp; in bitext()
488 unsigned int wbit = jd->dbit % 32; in bitext()
489 uint32_t w = jd->wreg & ((1UL << wbit) - 1); in bitext()
493 if(jd->marker) { in bitext()
497 if(!dc) { /* Buffer empty, re-fill input buffer */ in bitext()
498 dp = jd->inbuf; /* Top of input buffer */ in bitext()
499 dc = jd->infunc(jd, dp, JD_SZBUF); in bitext()
500 … if(!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ in bitext()
503 dc--; in bitext()
505 flg = 0; /* Exit flag sequence */ in bitext()
506 if(d != 0) jd->marker = d; /* Not an escape of 0xFF but a marker */ in bitext()
519 jd->wreg = w; in bitext()
520 jd->dbit = wbit - nbit; in bitext()
521 jd->dctr = dc; in bitext()
522 jd->dptr = dp; in bitext()
524 return (int)(w >> ((wbit - nbit) % 32)); in bitext()
531 /*-----------------------------------------------------------------------*/
533 /*-----------------------------------------------------------------------*/
541 uint8_t * dp = jd->dptr; in jd_restart()
542 size_t dc = jd->dctr; in jd_restart()
549 if(!dc) { /* No input data is available, re-fill input buffer */ in jd_restart()
550 dp = jd->inbuf; in jd_restart()
551 dc = jd->infunc(jd, dp, JD_SZBUF); in jd_restart()
557 dc--; in jd_restart()
560 jd->dptr = dp; in jd_restart()
561 jd->dctr = dc; in jd_restart()
562 jd->dbit = 0; in jd_restart()
573 if(jd->marker) { /* Generate a maker if it has been detected */ in jd_restart()
574 marker = 0xFF00 | jd->marker; in jd_restart()
575 jd->marker = 0; in jd_restart()
580 if(!dc) { /* No input data is available, re-fill input buffer */ in jd_restart()
581 dp = jd->inbuf; in jd_restart()
582 dc = jd->infunc(jd, dp, JD_SZBUF); in jd_restart()
586 dc--; in jd_restart()
588 jd->dptr = dp; in jd_restart()
589 jd->dctr = dc; in jd_restart()
597 jd->dbit = 0; /* Discard stuff bits */ in jd_restart()
600 jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Reset DC offset */ in jd_restart()
607 /*-----------------------------------------------------------------------*/
608 /* Apply Inverse-DCT in Arai Algorithm (see also aa_idct.png) */
609 /*-----------------------------------------------------------------------*/
612 int32_t * src, /* Input block data (de-quantized and pre-scaled for Arai Algorithm) */ in block_idct()
630 t12 = v0 - v2; in block_idct()
631 t11 = (v1 - v3) * M13 >> 12; in block_idct()
633 t11 -= v3; in block_idct()
635 v3 = t10 - v3; in block_idct()
637 v2 = t12 - t11; in block_idct()
644 t10 = v5 - v4; /* Process the odd elements */ in block_idct()
646 t12 = v6 - v7; in block_idct()
648 v5 = (t11 - v7) * M13 >> 12; in block_idct()
651 v4 = t13 - (t10 * M2 >> 12); in block_idct()
652 v6 = t13 - (t12 * M4 >> 12) - v7; in block_idct()
653 v5 -= v6; in block_idct()
654 v4 -= v5; in block_idct()
656 src[8 * 0] = v0 + v7; /* Write-back transformed values */ in block_idct()
657 src[8 * 7] = v0 - v7; in block_idct()
659 src[8 * 6] = v1 - v6; in block_idct()
661 src[8 * 5] = v2 - v5; in block_idct()
663 src[8 * 4] = v3 - v4; in block_idct()
669 src -= 8; in block_idct()
671 v0 = src[0] + (128L << 8); /* Get even elements (remove DC offset (-128) here) */ in block_idct()
677 t12 = v0 - v2; in block_idct()
678 t11 = (v1 - v3) * M13 >> 12; in block_idct()
680 t11 -= v3; in block_idct()
682 v3 = t10 - v3; in block_idct()
684 v2 = t12 - t11; in block_idct()
691 t10 = v5 - v4; /* Process the odd elements */ in block_idct()
693 t12 = v6 - v7; in block_idct()
695 v5 = (t11 - v7) * M13 >> 12; in block_idct()
698 v4 = t13 - (t10 * M2 >> 12); in block_idct()
699 v6 = t13 - (t12 * M4 >> 12) - v7; in block_idct()
700 v5 -= v6; in block_idct()
701 v4 -= v5; in block_idct()
706 dst[7] = (int16_t)((v0 - v7) >> 8); in block_idct()
708 dst[6] = (int16_t)((v1 - v6) >> 8); in block_idct()
710 dst[5] = (int16_t)((v2 - v5) >> 8); in block_idct()
712 dst[4] = (int16_t)((v3 - v4) >> 8); in block_idct()
715 dst[7] = BYTECLIP((v0 - v7) >> 8); in block_idct()
717 dst[6] = BYTECLIP((v1 - v6) >> 8); in block_idct()
719 dst[5] = BYTECLIP((v2 - v5) >> 8); in block_idct()
721 dst[4] = BYTECLIP((v3 - v4) >> 8); in block_idct()
732 /*-----------------------------------------------------------------------*/
734 /*-----------------------------------------------------------------------*/
740 int32_t * tmp = (int32_t *)jd->workbuf; /* Block working buffer for de-quantize and IDCT */ in jd_mcu_load()
747 nby = jd->msx * jd->msy; /* Number of Y blocks (1, 2 or 4) */ in jd_mcu_load()
748 bp = jd->mcubuf; /* Pointer to the first block of MCU */ in jd_mcu_load()
751 cmp = (blk < nby) ? 0 : blk - nby + 1; /* Component number 0:Y, 1:Cb, 2:Cr */ in jd_mcu_load()
753 if(cmp && jd->ncomp != 3) { /* Clear C blocks if not exist (monochrome image) */ in jd_mcu_load()
762 if(d < 0) return (JRESULT)(0 - d); /* Err: invalid code or input */ in jd_mcu_load()
764 d = jd->dcv[cmp]; /* DC value of previous block */ in jd_mcu_load()
767 if(e < 0) return (JRESULT)(0 - e); /* Err: input */ in jd_mcu_load()
768 bc = 1 << (bc - 1); /* MSB position */ in jd_mcu_load()
769 if(!(e & bc)) e -= (bc << 1) - 1; /* Restore negative value if needed */ in jd_mcu_load()
771 jd->dcv[cmp] = (int16_t)d; /* Save current DC value for next block */ in jd_mcu_load()
773 dqf = jd->qttbl[jd->qtid[cmp]]; /* De-quantizer table ID for this component */ in jd_mcu_load()
774 …tmp[0] = d * dqf[0] >> 8; /* De-quantize, apply scale factor of Arai algorithm and d… in jd_mcu_load()
778 z = 1; /* Top of the AC elements (in zigzag-order) */ in jd_mcu_load()
782 if(d < 0) return (JRESULT)(0 - d); /* Err: invalid code or input error */ in jd_mcu_load()
788 if(d < 0) return (JRESULT)(0 - d); /* Err: input device */ in jd_mcu_load()
789 bc = 1 << (bc - 1); /* MSB position */ in jd_mcu_load()
790 if(!(d & bc)) d -= (bc << 1) - 1; /* Restore negative value if needed */ in jd_mcu_load()
791 i = Zig[z]; /* Get raster-order index */ in jd_mcu_load()
792 …tmp[i] = d * dqf[i] >> 8; /* De-quantize, apply scale factor of Arai algorithm and descale 8… in jd_mcu_load()
798 jd->scale == in jd_mcu_load()
823 /*-----------------------------------------------------------------------*/
825 /*-----------------------------------------------------------------------*/
834 …const int CVACC = (sizeof(int) > 2) ? 1024 : 128; /* Adaptive accuracy for both 16-/32-bit syste… in jd_mcu_output()
842 mx = jd->msx * 8; in jd_mcu_output()
843 my = jd->msy * 8; /* MCU size (pixel) */ in jd_mcu_output()
844 rx = (x + mx <= jd->width) ? mx : jd->width - in jd_mcu_output()
846 ry = (y + my <= jd->height) ? my : jd->height - y; in jd_mcu_output()
848 rx >>= jd->scale; in jd_mcu_output()
849 ry >>= jd->scale; in jd_mcu_output()
851 x >>= jd->scale; in jd_mcu_output()
852 y >>= jd->scale; in jd_mcu_output()
855 rect.right = x + rx - 1; /* Rectangular area in the frame buffer */ in jd_mcu_output()
857 rect.bottom = y + ry - 1; in jd_mcu_output()
860 if(!JD_USE_SCALE || jd->scale != 3) { /* Not for 1/8 scaling */ in jd_mcu_output()
861 pix = (uint8_t *)jd->workbuf; in jd_mcu_output()
865 pc = py = jd->mcubuf; in jd_mcu_output()
875 cb = pc[0] - 128; /* Get Cb/Cr component and remove offset */ in jd_mcu_output()
876 cr = pc[64] - 128; in jd_mcu_output()
878 if(ix == 8) py += 64 - 8; /* Jump to next block if double block height */ in jd_mcu_output()
886 … *pix++ = /*G*/ BYTECLIP(yy - ((int)(0.344 * CVACC) * cb + (int)(0.714 * CVACC) * cr) / CVACC); in jd_mcu_output()
894 mx >>= jd->scale; in jd_mcu_output()
899 s = d = (uint8_t *)jd->workbuf; in jd_mcu_output()
908 s += (mx - rx) * (JD_FORMAT != 2 ? 3 : 1); /* Skip truncated pixels */ in jd_mcu_output()
914 uint8_t * s = (uint8_t *)jd->workbuf; in jd_mcu_output()
919 w = (*s++ & 0xF8) << 8; /* RRRRR----------- */ in jd_mcu_output()
920 w |= (*s++ & 0xFC) << 3; /* -----GGGGGG----- */ in jd_mcu_output()
921 w |= *s++ >> 3; /* -----------BBBBB */ in jd_mcu_output()
923 } while(--n); in jd_mcu_output()
927 if(outfunc) return outfunc(jd, jd->workbuf, &rect) ? JDR_OK : JDR_INTR; in jd_mcu_output()
934 /*-----------------------------------------------------------------------*/
936 /*-----------------------------------------------------------------------*/
958 jd->pool = pool; /* Work memory */ in jd_prepare()
959 jd->pool_original = pool; in jd_prepare()
960 jd->sz_pool = sz_pool; /* Size of given work memory */ in jd_prepare()
961 jd->infunc = infunc; /* Stream input function */ in jd_prepare()
962 jd->device = dev; /* I/O device identifier */ in jd_prepare()
964 jd->inbuf = seg = alloc_pool(jd, JD_SZBUF); /* Allocate stream input buffer */ in jd_prepare()
969 if(jd->infunc(jd, seg, 1) != 1) return JDR_INP; /* Err: SOI was not detected */ in jd_prepare()
976 if(jd->infunc(jd, seg, 4) != 4) return JDR_INP; in jd_prepare()
980 len -= 2; /* Segment content size */ in jd_prepare()
986 if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ in jd_prepare()
988 jd->width = LDB_WORD(&seg[3]); /* Image width in unit of pixel */ in jd_prepare()
989 jd->height = LDB_WORD(&seg[1]); /* Image height in unit of pixel */ in jd_prepare()
990 jd->ncomp = seg[5]; /* Number of color components */ in jd_prepare()
991 …if(jd->ncomp != 3 && jd->ncomp != 1) return JDR_FMT3; /* Err: Supports only Grayscale and Y/Cb/C… in jd_prepare()
994 for(i = 0; i < jd->ncomp; i++) { in jd_prepare()
1000 jd->msx = b >> 4; in jd_prepare()
1001 jd->msy = b & 15; /* Size of MCU [blocks] */ in jd_prepare()
1006 … jd->qtid[i] = seg[8 + 3 * i]; /* Get dequantizer table ID for this component */ in jd_prepare()
1007 if(jd->qtid[i] > 3) return JDR_FMT3; /* Err: Invalid ID */ in jd_prepare()
1011 case 0xDD: /* DRI - Define Restart Interval */ in jd_prepare()
1013 if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ in jd_prepare()
1015 jd->nrst = LDB_WORD(seg); /* Get restart interval (MCUs) */ in jd_prepare()
1018 case 0xC4: /* DHT - Define Huffman Tables */ in jd_prepare()
1020 if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ in jd_prepare()
1026 case 0xDB: /* DQT - Define Quantizer Tables */ in jd_prepare()
1028 if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ in jd_prepare()
1030 rc = create_qt_tbl(jd, seg, len); /* Create de-quantizer tables */ in jd_prepare()
1034 case 0xDA: /* SOS - Start of Scan */ in jd_prepare()
1036 if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ in jd_prepare()
1038 if(!jd->width || !jd->height) return JDR_FMT1; /* Err: Invalid image size */ in jd_prepare()
1039 if(seg[0] != jd->ncomp) return JDR_FMT3; /* Err: Wrong color components */ in jd_prepare()
1042 for(i = 0; i < jd->ncomp; i++) { in jd_prepare()
1046 … if(!jd->huffbits[n][0] || !jd->huffbits[n][1]) { /* Check huffman table for this component */ in jd_prepare()
1049 … if(!jd->qttbl[jd->qtid[i]]) { /* Check dequantizer table for this component */ in jd_prepare()
1055 n = jd->msy * jd->msx; /* Number of Y blocks in the MCU */ in jd_prepare()
1059 jd->workbuf = alloc_pool(jd, in jd_prepare()
1061 if(!jd->workbuf) return JDR_MEM1; /* Err: not enough memory */ in jd_prepare()
1062 … jd->mcubuf = alloc_pool(jd, (n + 2) * 64 * sizeof(jd_yuv_t)); /* Allocate MCU working buffer */ in jd_prepare()
1063 if(!jd->mcubuf) return JDR_MEM1; /* Err: not enough memory */ in jd_prepare()
1067 jd->dctr = jd->infunc(jd, seg + ofs, (size_t)(JD_SZBUF - ofs)); in jd_prepare()
1069 jd->dptr = seg + ofs - (JD_FASTDECODE ? 0 : 1); in jd_prepare()
1090 if(jd->infunc(jd, 0, len) != len) return JDR_INP; in jd_prepare()
1098 /*-----------------------------------------------------------------------*/
1100 /*-----------------------------------------------------------------------*/
1105 uint8_t scale /* Output de-scaling factor (0 to 3) */ in jd_decomp()
1114 jd->scale = scale; in jd_decomp()
1116 mx = jd->msx * 8; in jd_decomp()
1117 my = jd->msy * 8; /* Size of the MCU (pixel) */ in jd_decomp()
1119 jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Initialize DC values */ in jd_decomp()
1123 for(y = 0; y < jd->height; y += my) { /* Vertical loop of MCUs */ in jd_decomp()
1124 for(x = 0; x < jd->width; x += mx) { /* Horizontal loop of MCUs */ in jd_decomp()
1125 if(jd->nrst && rst++ == jd->nrst) { /* Process restart interval if enabled */ in jd_decomp()