Lines Matching refs:dinfo
95 struct jpeg_decompress_struct dinfo;
131 j_compress_ptr cinfo=NULL; j_decompress_ptr dinfo=NULL; \
134 cinfo=&this->cinfo; dinfo=&this->dinfo; \
143 j_decompress_ptr dinfo=NULL; \
146 dinfo=&this->dinfo; \
274 static int setDecompDefaults(struct jpeg_decompress_struct *dinfo,
282 dinfo->out_color_space=JCS_GRAYSCALE; break;
285 dinfo->out_color_space=JCS_EXT_RGB; break;
287 dinfo->out_color_space=JCS_EXT_BGR; break;
289 dinfo->out_color_space=JCS_EXT_RGBX; break;
291 dinfo->out_color_space=JCS_EXT_BGRX; break;
293 dinfo->out_color_space=JCS_EXT_XRGB; break;
295 dinfo->out_color_space=JCS_EXT_XBGR; break;
298 dinfo->out_color_space=JCS_EXT_RGBA; break;
300 dinfo->out_color_space=JCS_EXT_BGRA; break;
302 dinfo->out_color_space=JCS_EXT_ARGB; break;
304 dinfo->out_color_space=JCS_EXT_ABGR; break;
317 dinfo->out_color_space=JCS_RGB; break;
320 dinfo->out_color_space=JCS_CMYK; break;
325 if(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;
332 static int getSubsamp(j_decompress_ptr dinfo)
340 if(dinfo->num_components==1 && dinfo->jpeg_color_space==JCS_GRAYSCALE)
345 if(dinfo->num_components==pixelsize[i]
346 || ((dinfo->jpeg_color_space==JCS_YCCK
347 || dinfo->jpeg_color_space==JCS_CMYK)
348 && pixelsize[i]==3 && dinfo->num_components==4))
350 if(dinfo->comp_info[0].h_samp_factor==tjMCUWidth[i]/8
351 && dinfo->comp_info[0].v_samp_factor==tjMCUHeight[i]/8)
354 for(k=1; k<dinfo->num_components; k++)
357 if(dinfo->jpeg_color_space==JCS_YCCK && k==3)
361 if(dinfo->comp_info[k].h_samp_factor==href
362 && dinfo->comp_info[k].v_samp_factor==vref)
365 if(match==dinfo->num_components-1)
532 if(this->init&DECOMPRESS) jpeg_destroy_decompress(dinfo);
1219 this->dinfo.err=jpeg_std_error(&this->jerr.pub);
1231 jpeg_create_decompress(&this->dinfo);
1233 jpeg_mem_src_tj(&this->dinfo, buffer, 1);
1273 jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
1274 jpeg_read_header(dinfo, TRUE);
1276 *width=dinfo->image_width;
1277 *height=dinfo->image_height;
1278 *jpegSubsamp=getSubsamp(dinfo);
1279 switch(dinfo->jpeg_color_space)
1289 jpeg_abort_decompress(dinfo);
1365 jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
1366 jpeg_read_header(dinfo, TRUE);
1367 if(setDecompDefaults(dinfo, pixelFormat, flags)==-1)
1372 if(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;
1374 jpegwidth=dinfo->image_width; jpegheight=dinfo->image_height;
1387 dinfo->scale_num=sf[i].num;
1388 dinfo->scale_denom=sf[i].denom;
1390 jpeg_start_decompress(dinfo);
1391 if(pitch==0) pitch=dinfo->output_width*tjPixelSize[pixelFormat];
1408 *dinfo->output_height))==NULL)
1410 for(i=0; i<(int)dinfo->output_height; i++)
1413 row_pointer[i]=&dstBuf[(dinfo->output_height-i-1)*pitch];
1416 while(dinfo->output_scanline<dinfo->output_height)
1418 jpeg_read_scanlines(dinfo, &row_pointer[dinfo->output_scanline],
1419 dinfo->output_height-dinfo->output_scanline);
1421 jpeg_finish_decompress(dinfo);
1428 if(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);
1449 static int setDecodeDefaults(struct jpeg_decompress_struct *dinfo,
1454 dinfo->scale_num=dinfo->scale_denom=1;
1458 dinfo->num_components=dinfo->comps_in_scan=1;
1459 dinfo->jpeg_color_space=JCS_GRAYSCALE;
1463 dinfo->num_components=dinfo->comps_in_scan=3;
1464 dinfo->jpeg_color_space=JCS_YCbCr;
1467 dinfo->comp_info=(jpeg_component_info *)
1468 (*dinfo->mem->alloc_small)((j_common_ptr)dinfo, JPOOL_IMAGE,
1469 dinfo->num_components*sizeof(jpeg_component_info));
1471 for(i=0; i<dinfo->num_components; i++)
1473 jpeg_component_info *compptr=&dinfo->comp_info[i];
1480 dinfo->cur_comp_info[i]=compptr;
1482 dinfo->data_precision=8;
1485 if(dinfo->quant_tbl_ptrs[i]==NULL)
1486 dinfo->quant_tbl_ptrs[i]=jpeg_alloc_quant_table((j_common_ptr)dinfo);
1493 int my_read_markers(j_decompress_ptr dinfo)
1498 void my_reset_marker_reader(j_decompress_ptr dinfo)
1547 dinfo->image_width=width;
1548 dinfo->image_height=height;
1554 if(setDecodeDefaults(dinfo, pixelFormat, subsamp, flags)==-1)
1558 old_read_markers=dinfo->marker->read_markers;
1559 dinfo->marker->read_markers=my_read_markers;
1560 old_reset_marker_reader=dinfo->marker->reset_marker_reader;
1561 dinfo->marker->reset_marker_reader=my_reset_marker_reader;
1562 jpeg_read_header(dinfo, TRUE);
1563 dinfo->marker->read_markers=old_read_markers;
1564 dinfo->marker->reset_marker_reader=old_reset_marker_reader;
1566 if(setDecompDefaults(dinfo, pixelFormat, flags)==-1)
1570 dinfo->do_fancy_upsampling=FALSE;
1571 dinfo->Se=DCTSIZE2-1;
1572 jinit_master_decompress(dinfo);
1573 (*dinfo->upsample->start_pass)(dinfo);
1575 pw0=PAD(width, dinfo->max_h_samp_factor);
1576 ph0=PAD(height, dinfo->max_v_samp_factor);
1578 if(pitch==0) pitch=dinfo->output_width*tjPixelSize[pixelFormat];
1604 for(i=0; i<dinfo->num_components; i++)
1606 compptr=&dinfo->comp_info[i];
1619 pw[i]=pw0*compptr->h_samp_factor/dinfo->max_h_samp_factor;
1620 ph[i]=ph0*compptr->v_samp_factor/dinfo->max_v_samp_factor;
1631 for(row=0; row<ph0; row+=dinfo->max_v_samp_factor)
1634 for(i=0, compptr=dinfo->comp_info; i<dinfo->num_components; i++, compptr++)
1636 row*compptr->v_samp_factor/dinfo->max_v_samp_factor, tmpbuf[i], 0,
1638 (dinfo->upsample->upsample)(dinfo, tmpbuf, &inrow,
1639 dinfo->max_v_samp_factor, &row_pointer[row], &outrow,
1640 dinfo->max_v_samp_factor);
1642 jpeg_abort_decompress(dinfo);
1649 if(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);
1738 jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
1739 jpeg_read_header(dinfo, TRUE);
1742 jpegSubsamp=getSubsamp(dinfo);
1749 jpegwidth=dinfo->image_width; jpegheight=dinfo->image_height;
1761 if(dinfo->num_components>3)
1765 dinfo->scale_num=sf[i].num;
1766 dinfo->scale_denom=sf[i].denom;
1768 jpeg_calc_output_dimensions(dinfo);
1772 for(i=0; i<dinfo->num_components; i++)
1774 jpeg_component_info *compptr=&dinfo->comp_info[i];
1778 pw[i]=PAD(dinfo->output_width, dinfo->max_h_samp_factor)
1779 *compptr->h_samp_factor/dinfo->max_h_samp_factor;
1780 ph[i]=PAD(dinfo->output_height, dinfo->max_v_samp_factor)
1781 *compptr->v_samp_factor/dinfo->max_v_samp_factor;
1799 for(i=0; i<dinfo->num_components; i++)
1811 if(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;
1812 if(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;
1813 dinfo->raw_data_out=TRUE;
1815 jpeg_start_decompress(dinfo);
1816 for(row=0; row<(int)dinfo->output_height;
1817 row+=dinfo->max_v_samp_factor*dinfo->_min_DCT_scaled_size)
1821 for(i=0; i<dinfo->num_components; i++)
1823 jpeg_component_info *compptr=&dinfo->comp_info[i];
1839 compptr->v_samp_factor/dinfo->max_v_samp_factor;
1840 dinfo->idct->inverse_DCT[i] = dinfo->idct->inverse_DCT[0];
1842 crow[i]=row*compptr->v_samp_factor/dinfo->max_v_samp_factor;
1846 jpeg_read_raw_data(dinfo, yuvptr,
1847 dinfo->max_v_samp_factor*dinfo->_min_DCT_scaled_size);
1851 for(i=0; i<dinfo->num_components; i++)
1860 jpeg_finish_decompress(dinfo);
1863 if(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);
1888 jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
1889 jpeg_read_header(dinfo, TRUE);
1890 jpegSubsamp=getSubsamp(dinfo);
1894 jpegwidth=dinfo->image_width; jpegheight=dinfo->image_height;
1989 jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
2023 jcopy_markers_setup(dinfo, JCOPYOPT_ALL);
2024 jpeg_read_header(dinfo, TRUE);
2025 jpegSubsamp=getSubsamp(dinfo);
2031 if(!jtransform_request_workspace(dinfo, &xinfo[i]))
2048 srccoefs=jpeg_read_coefficients(dinfo);
2055 w=dinfo->image_width; h=dinfo->image_height;
2067 jpeg_copy_critical_parameters(dinfo, cinfo);
2068 dstcoefs=jtransform_adjust_parameters(dinfo, cinfo, srccoefs,
2073 jcopy_markers_execute(dinfo, cinfo, JCOPYOPT_ALL);
2076 jtransform_execute_transformation(dinfo, cinfo, srccoefs,
2090 JBLOCKARRAY barray=(dinfo->mem->access_virt_barray)
2091 ((j_common_ptr)dinfo, dstcoefs[ci], by, compptr->v_samp_factor,
2106 jpeg_finish_decompress(dinfo);
2110 if(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);