亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jctrans.c

?? Trolltech公司發布的基于C++圖形開發環境
?? C
字號:
/* * jctrans.c * * Copyright (C) 1995-1998, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file contains library routines for transcoding compression, * that is, writing raw DCT coefficient arrays to an output JPEG file. * The routines in jcapimin.c will also be needed by a transcoder. */#define JPEG_INTERNALS#include "jinclude.h"#include "jpeglib.h"/* Forward declarations */LOCAL(void) transencode_master_selection	JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));LOCAL(void) transencode_coef_controller	JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));/* * Compression initialization for writing raw-coefficient data. * Before calling this, all parameters and a data destination must be set up. * Call jpeg_finish_compress() to actually write the data. * * The number of passed virtual arrays must match cinfo->num_components. * Note that the virtual arrays need not be filled or even realized at * the time write_coefficients is called; indeed, if the virtual arrays * were requested from this compression object's memory manager, they * typically will be realized during this routine and filled afterwards. */GLOBAL(void)jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays){  if (cinfo->global_state != CSTATE_START)    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);  /* Mark all tables to be written */  jpeg_suppress_tables(cinfo, FALSE);  /* (Re)initialize error mgr and destination modules */  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);  (*cinfo->dest->init_destination) (cinfo);  /* Perform master selection of active modules */  transencode_master_selection(cinfo, coef_arrays);  /* Wait for jpeg_finish_compress() call */  cinfo->next_scanline = 0;	/* so jpeg_write_marker works */  cinfo->global_state = CSTATE_WRCOEFS;}/* * Initialize the compression object with default parameters, * then copy from the source object all parameters needed for lossless * transcoding.  Parameters that can be varied without loss (such as * scan script and Huffman optimization) are left in their default states. */GLOBAL(void)jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,			       j_compress_ptr dstinfo){  JQUANT_TBL ** qtblptr;  jpeg_component_info *incomp, *outcomp;  JQUANT_TBL *c_quant, *slot_quant;  int tblno, ci, coefi;  /* Safety check to ensure start_compress not called yet. */  if (dstinfo->global_state != CSTATE_START)    ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);  /* Copy fundamental image dimensions */  dstinfo->image_width = srcinfo->image_width;  dstinfo->image_height = srcinfo->image_height;  dstinfo->input_components = srcinfo->num_components;  dstinfo->in_color_space = srcinfo->jpeg_color_space;  /* Initialize all parameters to default values */  jpeg_set_defaults(dstinfo);  /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.   * Fix it to get the right header markers for the image colorspace.   */  jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);  dstinfo->data_precision = srcinfo->data_precision;  dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;  /* Copy the source's quantization tables. */  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {    if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {      qtblptr = & dstinfo->quant_tbl_ptrs[tblno];      if (*qtblptr == NULL)	*qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);      MEMCOPY((*qtblptr)->quantval,	      srcinfo->quant_tbl_ptrs[tblno]->quantval,	      SIZEOF((*qtblptr)->quantval));      (*qtblptr)->sent_table = FALSE;    }  }  /* Copy the source's per-component info.   * Note we assume jpeg_set_defaults has allocated the dest comp_info array.   */  dstinfo->num_components = srcinfo->num_components;  if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)    ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,	     MAX_COMPONENTS);  for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;       ci < dstinfo->num_components; ci++, incomp++, outcomp++) {    outcomp->component_id = incomp->component_id;    outcomp->h_samp_factor = incomp->h_samp_factor;    outcomp->v_samp_factor = incomp->v_samp_factor;    outcomp->quant_tbl_no = incomp->quant_tbl_no;    /* Make sure saved quantization table for component matches the qtable     * slot.  If not, the input file re-used this qtable slot.     * IJG encoder currently cannot duplicate this.     */    tblno = outcomp->quant_tbl_no;    if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||	srcinfo->quant_tbl_ptrs[tblno] == NULL)      ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);    slot_quant = srcinfo->quant_tbl_ptrs[tblno];    c_quant = incomp->quant_table;    if (c_quant != NULL) {      for (coefi = 0; coefi < DCTSIZE2; coefi++) {	if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])	  ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);      }    }    /* Note: we do not copy the source's Huffman table assignments;     * instead we rely on jpeg_set_colorspace to have made a suitable choice.     */  }  /* Also copy JFIF version and resolution information, if available.   * Strictly speaking this isn't "critical" info, but it's nearly   * always appropriate to copy it if available.  In particular,   * if the application chooses to copy JFIF 1.02 extension markers from   * the source file, we need to copy the version to make sure we don't   * emit a file that has 1.02 extensions but a claimed version of 1.01.   * We will *not*, however, copy version info from mislabeled "2.01" files.   */  if (srcinfo->saw_JFIF_marker) {    if (srcinfo->JFIF_major_version == 1) {      dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;      dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;    }    dstinfo->density_unit = srcinfo->density_unit;    dstinfo->X_density = srcinfo->X_density;    dstinfo->Y_density = srcinfo->Y_density;  }}/* * Master selection of compression modules for transcoding. * This substitutes for jcinit.c's initialization of the full compressor. */LOCAL(void)transencode_master_selection (j_compress_ptr cinfo,			      jvirt_barray_ptr * coef_arrays){  /* Although we don't actually use input_components for transcoding,   * jcmaster.c's initial_setup will complain if input_components is 0.   */  cinfo->input_components = 1;  /* Initialize master control (includes parameter checking/processing) */  jinit_c_master_control(cinfo, TRUE /* transcode only */);  /* Entropy encoding: either Huffman or arithmetic coding. */  if (cinfo->arith_code) {    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);  } else {    if (cinfo->progressive_mode) {#ifdef C_PROGRESSIVE_SUPPORTED      jinit_phuff_encoder(cinfo);#else      ERREXIT(cinfo, JERR_NOT_COMPILED);#endif    } else      jinit_huff_encoder(cinfo);  }  /* We need a special coefficient buffer controller. */  transencode_coef_controller(cinfo, coef_arrays);  jinit_marker_writer(cinfo);  /* We can now tell the memory manager to allocate virtual arrays. */  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);  /* Write the datastream header (SOI, JFIF) immediately.   * Frame and scan headers are postponed till later.   * This lets application insert special markers after the SOI.   */  (*cinfo->marker->write_file_header) (cinfo);}/* * The rest of this file is a special implementation of the coefficient * buffer controller.  This is similar to jccoefct.c, but it handles only * output from presupplied virtual arrays.  Furthermore, we generate any * dummy padding blocks on-the-fly rather than expecting them to be present * in the arrays. *//* Private buffer controller object */typedef struct {  struct jpeg_c_coef_controller pub; /* public fields */  JDIMENSION iMCU_row_num;	/* iMCU row # within image */  JDIMENSION mcu_ctr;		/* counts MCUs processed in current row */  int MCU_vert_offset;		/* counts MCU rows within iMCU row */  int MCU_rows_per_iMCU_row;	/* number of such rows needed */  /* Virtual block array for each component. */  jvirt_barray_ptr * whole_image;  /* Workspace for constructing dummy blocks at right/bottom edges. */  JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];} my_coef_controller;typedef my_coef_controller * my_coef_ptr;LOCAL(void)start_iMCU_row (j_compress_ptr cinfo)/* Reset within-iMCU-row counters for a new row */{  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;  /* In an interleaved scan, an MCU row is the same as an iMCU row.   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.   * But at the bottom of the image, process only what's left.   */  if (cinfo->comps_in_scan > 1) {    coef->MCU_rows_per_iMCU_row = 1;  } else {    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;    else      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;  }  coef->mcu_ctr = 0;  coef->MCU_vert_offset = 0;}/* * Initialize for a processing pass. */METHODDEF(void)start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode){  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;  if (pass_mode != JBUF_CRANK_DEST)    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);  coef->iMCU_row_num = 0;  start_iMCU_row(cinfo);}/* * Process some data. * We process the equivalent of one fully interleaved MCU row ("iMCU" row) * per call, ie, v_samp_factor block rows for each component in the scan. * The data is obtained from the virtual arrays and fed to the entropy coder. * Returns TRUE if the iMCU row is completed, FALSE if suspended. * * NB: input_buf is ignored; it is likely to be a NULL pointer. */METHODDEF(boolean)compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf){  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;  JDIMENSION MCU_col_num;	/* index of current MCU within row */  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;  int blkn, ci, xindex, yindex, yoffset, blockcnt;  JDIMENSION start_col;  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];  JBLOCKROW buffer_ptr;  jpeg_component_info *compptr;  /* Align the virtual buffers for the components used in this scan. */  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {    compptr = cinfo->cur_comp_info[ci];    buffer[ci] = (*cinfo->mem->access_virt_barray)      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],       coef->iMCU_row_num * compptr->v_samp_factor,       (JDIMENSION) compptr->v_samp_factor, FALSE);  }  /* Loop to process one whole iMCU row */  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;       yoffset++) {    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;	 MCU_col_num++) {      /* Construct list of pointers to DCT blocks belonging to this MCU */      blkn = 0;			/* index of current DCT block within MCU */      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {	compptr = cinfo->cur_comp_info[ci];	start_col = MCU_col_num * compptr->MCU_width;	blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width						: compptr->last_col_width;	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {	  if (coef->iMCU_row_num < last_iMCU_row ||	      yindex+yoffset < compptr->last_row_height) {	    /* Fill in pointers to real blocks in this row */	    buffer_ptr = buffer[ci][yindex+yoffset] + start_col;	    for (xindex = 0; xindex < blockcnt; xindex++)	      MCU_buffer[blkn++] = buffer_ptr++;	  } else {	    /* At bottom of image, need a whole row of dummy blocks */	    xindex = 0;	  }	  /* Fill in any dummy blocks needed in this row.	   * Dummy blocks are filled in the same way as in jccoefct.c:	   * all zeroes in the AC entries, DC entries equal to previous	   * block's DC value.  The init routine has already zeroed the	   * AC entries, so we need only set the DC entries correctly.	   */	  for (; xindex < compptr->MCU_width; xindex++) {	    MCU_buffer[blkn] = coef->dummy_buffer[blkn];	    MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];	    blkn++;	  }	}      }      /* Try to write the MCU. */      if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {	/* Suspension forced; update state counters and exit */	coef->MCU_vert_offset = yoffset;	coef->mcu_ctr = MCU_col_num;	return FALSE;      }    }    /* Completed an MCU row, but perhaps not an iMCU row */    coef->mcu_ctr = 0;  }  /* Completed the iMCU row, advance counters for next one */  coef->iMCU_row_num++;  start_iMCU_row(cinfo);  return TRUE;}/* * Initialize coefficient buffer controller. * * Each passed coefficient array must be the right size for that * coefficient: width_in_blocks wide and height_in_blocks high, * with unitheight at least v_samp_factor. */LOCAL(void)transencode_coef_controller (j_compress_ptr cinfo,			     jvirt_barray_ptr * coef_arrays){  my_coef_ptr coef;  JBLOCKROW buffer;  int i;  coef = (my_coef_ptr)    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,				SIZEOF(my_coef_controller));  cinfo->coef = (struct jpeg_c_coef_controller *) coef;  coef->pub.start_pass = start_pass_coef;  coef->pub.compress_data = compress_output;  /* Save pointer to virtual arrays */  coef->whole_image = coef_arrays;  /* Allocate and pre-zero space for dummy DCT blocks. */  buffer = (JBLOCKROW)    (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,				C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));  jzero_far((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));  for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {    coef->dummy_buffer[i] = buffer + i;  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品久久久久久久久| 国产精品久久久久久户外露出| 欧美午夜电影在线播放| 国产精品中文字幕欧美| 国产原创一区二区| 精品亚洲成av人在线观看| 久久超碰97人人做人人爱| 精品一区二区影视| 国产一区二区免费看| 国产成人av电影| 北条麻妃国产九九精品视频| 一本大道av一区二区在线播放| 色婷婷综合中文久久一本| 欧美在线综合视频| 欧美伦理电影网| 欧美xxxx老人做受| 国产精品入口麻豆九色| 亚洲美女精品一区| 视频一区二区中文字幕| 精品亚洲欧美一区| 不卡电影一区二区三区| 欧美在线短视频| 欧美一区二区三区白人| 国产午夜精品在线观看| 综合激情成人伊人| 日韩成人dvd| 丁香婷婷综合色啪| 欧美性大战久久久久久久| 51精品秘密在线观看| 久久精品视频在线免费观看| 一区二区三区在线看| 日本欧美韩国一区三区| caoporm超碰国产精品| 欧美精品色一区二区三区| 精品国产凹凸成av人导航| 国产精品第一页第二页第三页| 亚洲午夜三级在线| 国精产品一区一区三区mba视频| 丁香激情综合国产| 欧美年轻男男videosbes| 中文字幕免费不卡| 午夜视频一区二区| 不卡影院免费观看| 日韩三级中文字幕| 一级特黄大欧美久久久| 国产乱妇无码大片在线观看| 欧美日韩一区久久| 中文字幕一区在线观看| 国内久久婷婷综合| 欧美日韩国产一区二区三区地区| 精品国产免费视频| 午夜精品久久久久久久久久| 97精品国产97久久久久久久久久久久 | 亚洲女人的天堂| 国产麻豆视频一区二区| 欧美理论片在线| 一区二区视频在线| 成人午夜在线免费| 久久久亚洲精华液精华液精华液| 视频一区中文字幕| 欧美综合在线视频| 亚洲欧洲性图库| 成人中文字幕电影| 国产色一区二区| 国产真实乱子伦精品视频| 这里只有精品免费| 天天av天天翘天天综合网色鬼国产| 成人18视频在线播放| 视频一区在线播放| 91福利国产精品| 亚洲精品美国一| 99re热这里只有精品免费视频| 国产日韩成人精品| 国产激情视频一区二区在线观看| 精品国产乱码久久久久久免费| 丝袜诱惑制服诱惑色一区在线观看 | 欧美一区二区在线播放| 天天综合色天天| 5566中文字幕一区二区电影| 亚洲成人自拍网| 欧美精品久久久久久久多人混战 | 中文字幕乱码一区二区免费| 国产成人综合亚洲网站| 国产欧美一区二区精品性色 | 久久综合九色综合97婷婷| 九九视频精品免费| 久久日一线二线三线suv| 国产黄色精品视频| 综合av第一页| 欧美日韩一区二区三区视频| 天天av天天翘天天综合网色鬼国产| 欧美另类变人与禽xxxxx| 久久国产欧美日韩精品| 亚洲国产成人一区二区三区| 99久久精品免费| 亚洲一区二区影院| 日韩写真欧美这视频| 国产裸体歌舞团一区二区| 综合中文字幕亚洲| 8x8x8国产精品| 国产宾馆实践打屁股91| 亚洲精品你懂的| 欧美一区二区三区四区视频 | 91视视频在线直接观看在线看网页在线看 | 美女视频一区二区三区| 欧美极品少妇xxxxⅹ高跟鞋 | 成人一级黄色片| 亚洲综合视频在线| 精品久久久久久久久久久院品网| 国产成都精品91一区二区三| 亚洲国产日韩一级| 久久久久久免费毛片精品| 色哟哟一区二区三区| 另类小说视频一区二区| 亚洲欧美日韩国产手机在线| 欧美大片拔萝卜| 91在线视频免费观看| 精品一区免费av| 一区二区视频在线| 国产三级欧美三级日产三级99 | 成人免费的视频| 图片区小说区国产精品视频| 久久精品男人天堂av| 欧美日韩小视频| 99久久精品免费看国产| 国产一区二区h| 视频一区免费在线观看| 亚洲理论在线观看| 国产欧美精品一区aⅴ影院| 日韩一级大片在线| 在线观看国产91| 欧美精品色一区二区三区| 91最新地址在线播放| 国产伦理精品不卡| 裸体在线国模精品偷拍| 亚洲精品videosex极品| 中文字幕欧美日韩一区| 欧美电影精品一区二区| 欧美日本国产视频| 色综合久久综合网欧美综合网| 国产精品一区二区在线看| 日韩电影免费一区| 午夜免费久久看| 亚洲美女一区二区三区| 1000精品久久久久久久久| 国产午夜亚洲精品午夜鲁丝片| 欧美mv日韩mv国产网站app| 欧美一级理论片| 欧美一区二区国产| 欧美剧情片在线观看| 欧美日韩精品欧美日韩精品| 精品视频一区二区不卡| 欧洲国产伦久久久久久久| 色香蕉成人二区免费| 94-欧美-setu| 欧美性色黄大片| 欧美色图在线观看| 91麻豆精品国产自产在线观看一区| 欧美视频一区二区三区| 欧美日韩国产高清一区二区三区| 欧美系列一区二区| 51精品秘密在线观看| 欧美v日韩v国产v| 久久精品一区二区三区不卡| 国产精品久久久久影院| 亚洲色图一区二区三区| 亚洲综合在线免费观看| 午夜国产精品一区| 久久电影网站中文字幕 | 一区二区中文字幕在线| 亚洲人成人一区二区在线观看| 亚洲一区二区在线免费看| 丝袜诱惑制服诱惑色一区在线观看 | 日韩欧美一级二级三级| 久久一二三国产| 国产精品网站导航| 一区二区在线观看视频| 亚洲一级二级在线| 极品美女销魂一区二区三区 | 色妹子一区二区| 欧美日韩精品专区| 久久天堂av综合合色蜜桃网| 1024成人网色www| 日本成人在线电影网| 成人午夜在线播放| 欧美高清www午色夜在线视频| 精品不卡在线视频| 亚洲欧美色一区| 国产中文字幕一区| 欧美人妖巨大在线| 欧美国产97人人爽人人喊| 天堂资源在线中文精品| 国产成都精品91一区二区三| 欧美男生操女生| 亚洲日本va在线观看| 久久精品国产秦先生| 色成年激情久久综合| 久久久国产一区二区三区四区小说| 一区二区三区资源| 国产不卡视频在线观看|