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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jquant1.c

?? About JPEG, executable on Visual C++
?? C
?? 第 1 頁 / 共 3 頁
字號:
		      JSAMPARRAY output_buf, int num_rows)
/* Fast path for out_color_components==3, with ordered dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register int pixcode;
  register JSAMPROW input_ptr;
  register JSAMPROW output_ptr;
  JSAMPROW colorindex0 = cquantize->colorindex[0];
  JSAMPROW colorindex1 = cquantize->colorindex[1];
  JSAMPROW colorindex2 = cquantize->colorindex[2];
  int * dither0;		/* points to active row of dither matrix */
  int * dither1;
  int * dither2;
  int row_index, col_index;	/* current indexes into dither matrix */
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    row_index = cquantize->row_index;
    input_ptr = input_buf[row];
    output_ptr = output_buf[row];
    dither0 = cquantize->odither[0][row_index];
    dither1 = cquantize->odither[1][row_index];
    dither2 = cquantize->odither[2][row_index];
    col_index = 0;

    for (col = width; col > 0; col--) {
      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +
					dither0[col_index]]);
      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +
					dither1[col_index]]);
      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +
					dither2[col_index]]);
      *output_ptr++ = (JSAMPLE) pixcode;
      col_index = (col_index + 1) & ODITHER_MASK;
    }
    row_index = (row_index + 1) & ODITHER_MASK;
    cquantize->row_index = row_index;
  }
}


METHODDEF(void)
quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		    JSAMPARRAY output_buf, int num_rows)
/* General case, with Floyd-Steinberg dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register LOCFSERROR cur;	/* current error or pixel value */
  LOCFSERROR belowerr;		/* error for pixel below cur */
  LOCFSERROR bpreverr;		/* error for below/prev col */
  LOCFSERROR bnexterr;		/* error for below/next col */
  LOCFSERROR delta;
  register FSERRPTR errorptr;	/* => fserrors[] at column before current */
  register JSAMPROW input_ptr;
  register JSAMPROW output_ptr;
  JSAMPROW colorindex_ci;
  JSAMPROW colormap_ci;
  int pixcode;
  int nc = cinfo->out_color_components;
  int dir;			/* 1 for left-to-right, -1 for right-to-left */
  int dirnc;			/* dir * nc */
  int ci;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;
  JSAMPLE *range_limit = cinfo->sample_range_limit;
  SHIFT_TEMPS

  for (row = 0; row < num_rows; row++) {
    /* Initialize output values to 0 so can process components separately */
    jzero_far((void FAR *) output_buf[row],
	      (size_t) (width * SIZEOF(JSAMPLE)));
    for (ci = 0; ci < nc; ci++) {
      input_ptr = input_buf[row] + ci;
      output_ptr = output_buf[row];
      if (cquantize->on_odd_row) {
	/* work right to left in this row */
	input_ptr += (width-1) * nc; /* so point to rightmost pixel */
	output_ptr += width-1;
	dir = -1;
	dirnc = -nc;
	errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */
      } else {
	/* work left to right in this row */
	dir = 1;
	dirnc = nc;
	errorptr = cquantize->fserrors[ci]; /* => entry before first column */
      }
      colorindex_ci = cquantize->colorindex[ci];
      colormap_ci = cquantize->sv_colormap[ci];
      /* Preset error values: no error propagated to first pixel from left */
      cur = 0;
      /* and no error propagated to row below yet */
      belowerr = bpreverr = 0;

      for (col = width; col > 0; col--) {
	/* cur holds the error propagated from the previous pixel on the
	 * current line.  Add the error propagated from the previous line
	 * to form the complete error correction term for this pixel, and
	 * round the error term (which is expressed * 16) to an integer.
	 * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
	 * for either sign of the error value.
	 * Note: errorptr points to *previous* column's array entry.
	 */
	cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4);
	/* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.
	 * The maximum error is +- MAXJSAMPLE; this sets the required size
	 * of the range_limit array.
	 */
	cur += GETJSAMPLE(*input_ptr);
	cur = GETJSAMPLE(range_limit[cur]);
	/* Select output value, accumulate into output code for this pixel */
	pixcode = GETJSAMPLE(colorindex_ci[cur]);
	*output_ptr += (JSAMPLE) pixcode;
	/* Compute actual representation error at this pixel */
	/* Note: we can do this even though we don't have the final */
	/* pixel code, because the colormap is orthogonal. */
	cur -= GETJSAMPLE(colormap_ci[pixcode]);
	/* Compute error fractions to be propagated to adjacent pixels.
	 * Add these into the running sums, and simultaneously shift the
	 * next-line error sums left by 1 column.
	 */
	bnexterr = cur;
	delta = cur * 2;
	cur += delta;		/* form error * 3 */
	errorptr[0] = (FSERROR) (bpreverr + cur);
	cur += delta;		/* form error * 5 */
	bpreverr = belowerr + cur;
	belowerr = bnexterr;
	cur += delta;		/* form error * 7 */
	/* At this point cur contains the 7/16 error value to be propagated
	 * to the next pixel on the current line, and all the errors for the
	 * next line have been shifted over. We are therefore ready to move on.
	 */
	input_ptr += dirnc;	/* advance input ptr to next column */
	output_ptr += dir;	/* advance output ptr to next column */
	errorptr += dir;	/* advance errorptr to current column */
      }
      /* Post-loop cleanup: we must unload the final error value into the
       * final fserrors[] entry.  Note we need not unload belowerr because
       * it is for the dummy column before or after the actual array.
       */
      errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */
    }
    cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE);
  }
}


/*
 * Allocate workspace for Floyd-Steinberg errors.
 */

LOCAL(void)
alloc_fs_workspace (j_decompress_ptr cinfo)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  size_t arraysize;
  int i;

  arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
  for (i = 0; i < cinfo->out_color_components; i++) {
    cquantize->fserrors[i] = (FSERRPTR)
      (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
  }
}


/*
 * Initialize for one-pass color quantization.
 */

METHODDEF(void)
start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  size_t arraysize;
  int i;

  /* Install my colormap. */
  cinfo->colormap = cquantize->sv_colormap;
  cinfo->actual_number_of_colors = cquantize->sv_actual;

  /* Initialize for desired dithering mode. */
  switch (cinfo->dither_mode) {
  case JDITHER_NONE:
    if (cinfo->out_color_components == 3)
      cquantize->pub.color_quantize = color_quantize3;
    else
      cquantize->pub.color_quantize = color_quantize;
    break;
  case JDITHER_ORDERED:
    if (cinfo->out_color_components == 3)
      cquantize->pub.color_quantize = quantize3_ord_dither;
    else
      cquantize->pub.color_quantize = quantize_ord_dither;
    cquantize->row_index = 0;	/* initialize state for ordered dither */
    /* If user changed to ordered dither from another mode,
     * we must recreate the color index table with padding.
     * This will cost extra space, but probably isn't very likely.
     */
    if (! cquantize->is_padded)
      create_colorindex(cinfo);
    /* Create ordered-dither tables if we didn't already. */
    if (cquantize->odither[0] == NULL)
      create_odither_tables(cinfo);
    break;
  case JDITHER_FS:
    cquantize->pub.color_quantize = quantize_fs_dither;
    cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */
    /* Allocate Floyd-Steinberg workspace if didn't already. */
    if (cquantize->fserrors[0] == NULL)
      alloc_fs_workspace(cinfo);
    /* Initialize the propagated errors to zero. */
    arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
    for (i = 0; i < cinfo->out_color_components; i++)
      jzero_far((void FAR *) cquantize->fserrors[i], arraysize);
    break;
  default:
    ERREXIT(cinfo, JERR_NOT_COMPILED);
    break;
  }
}


/*
 * Finish up at the end of the pass.
 */

METHODDEF(void)
finish_pass_1_quant (j_decompress_ptr cinfo)
{
  /* no work in 1-pass case */
}


/*
 * Switch to a new external colormap between output passes.
 * Shouldn't get to this module!
 */

METHODDEF(void)
new_color_map_1_quant (j_decompress_ptr cinfo)
{
  ERREXIT(cinfo, JERR_MODE_CHANGE);
}


/*
 * Module initialization routine for 1-pass color quantization.
 */

GLOBAL(void)
jinit_1pass_quantizer (j_decompress_ptr cinfo)
{
  my_cquantize_ptr cquantize;

  cquantize = (my_cquantize_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_cquantizer));
  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
  cquantize->pub.start_pass = start_pass_1_quant;
  cquantize->pub.finish_pass = finish_pass_1_quant;
  cquantize->pub.new_color_map = new_color_map_1_quant;
  cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */
  cquantize->odither[0] = NULL;	/* Also flag odither arrays not allocated */

  /* Make sure my internal arrays won't overflow */
  if (cinfo->out_color_components > MAX_Q_COMPS)
    ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS);
  /* Make sure colormap indexes can be represented by JSAMPLEs */
  if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1))
    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1);

  /* Create the colormap and color index table. */
  create_colormap(cinfo);
  create_colorindex(cinfo);

  /* Allocate Floyd-Steinberg workspace now if requested.
   * We do this now since it is FAR storage and may affect the memory
   * manager's space calculations.  If the user changes to FS dither
   * mode in a later pass, we will allocate the space then, and will
   * possibly overrun the max_memory_to_use setting.
   */
  if (cinfo->dither_mode == JDITHER_FS)
    alloc_fs_workspace(cinfo);
}

#endif /* QUANT_1PASS_SUPPORTED */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产米奇在线777精品观看| 亚洲一区二区在线免费观看视频 | 欧美在线观看18| 久久久久久久久久久黄色| 亚洲国产日韩一级| 99精品热视频| 精品一区二区在线视频| 欧美三级在线视频| 亚洲欧洲成人av每日更新| 国产一区二区在线观看免费| 欧美日韩视频在线观看一区二区三区 | 白白色亚洲国产精品| 欧美mv日韩mv亚洲| 丝袜诱惑制服诱惑色一区在线观看| 国产老肥熟一区二区三区| 欧美另类一区二区三区| 亚洲精品免费一二三区| 成人精品国产免费网站| 26uuu国产日韩综合| 蜜臀av亚洲一区中文字幕| 欧美私模裸体表演在线观看| 亚洲精品久久7777| 91老司机福利 在线| 国产精品色眯眯| 国产一区二区福利| 欧美精品一区在线观看| 男女男精品视频| 91精品国产一区二区三区蜜臀 | 欧美va在线播放| 日韩成人av影视| 欧美日韩成人在线一区| 一二三区精品福利视频| 91亚洲精品久久久蜜桃| 亚洲欧美在线视频| 91丨porny丨国产| 亚洲日本在线视频观看| 91在线国产观看| 18涩涩午夜精品.www| 黄色日韩三级电影| 蜜臀a∨国产成人精品| 色婷婷亚洲综合| 亚洲天堂av老司机| 亚洲电影第三页| 亚洲精选免费视频| 91在线小视频| 亚洲视频中文字幕| 国产精品久久久一区麻豆最新章节| 久久国产婷婷国产香蕉| 欧美成人三级在线| 国产精品一区二区你懂的| 精品福利在线导航| 国产精品亚洲午夜一区二区三区| 国产欧美一区二区三区在线看蜜臀 | 亚洲自拍偷拍av| 欧美日韩国产精品自在自线| 爽好久久久欧美精品| 精品日韩欧美在线| 高清成人在线观看| 亚洲另类春色国产| 制服.丝袜.亚洲.中文.综合| 久久精品999| 国产午夜精品福利| 一本久久精品一区二区| 亚洲国产日日夜夜| 91精品国产综合久久精品图片| 紧缚捆绑精品一区二区| 国产日韩一级二级三级| 欧美日韩一区高清| 精品国产乱码久久久久久蜜臀| 亚洲国产aⅴ成人精品无吗| 欧美日韩国产成人在线免费| 麻豆成人av在线| 亚洲国产精品av| 色婷婷国产精品久久包臀| 奇米影视一区二区三区| 国产三级三级三级精品8ⅰ区| 91亚洲精品久久久蜜桃网站| 亚洲一区二区三区美女| 欧美电影免费观看高清完整版在 | 日本高清不卡在线观看| 日韩av一二三| 亚洲国产成人私人影院tom| 色综合久久久网| 美腿丝袜亚洲色图| 国产精品网友自拍| 欧美精品一二三| 国产精品996| 亚洲制服丝袜一区| 久久蜜臀中文字幕| 欧美日韩久久久一区| 国产99精品国产| 日韩高清在线观看| 日韩毛片高清在线播放| 日韩视频在线你懂得| 一本色道综合亚洲| 国产伦精品一区二区三区免费 | 国产欧美va欧美不卡在线| 在线观看亚洲成人| 国产一区二区三区黄视频| 在线视频国内自拍亚洲视频| 蜜桃视频在线观看一区二区| 亚洲婷婷综合久久一本伊一区 | 日本高清免费不卡视频| 精品一区二区三区免费毛片爱| 国产精品二三区| 日韩一级片网站| 91久久国产最好的精华液| 国产美女视频91| 午夜免费久久看| 亚洲人吸女人奶水| 久久久精品黄色| 91超碰这里只有精品国产| 91免费观看国产| 国产盗摄女厕一区二区三区 | 最新成人av在线| 精品日韩一区二区三区 | 国产精品亚洲一区二区三区在线| 亚洲超丰满肉感bbw| 国产精品家庭影院| 亚洲精品一区二区三区香蕉| 欧美图片一区二区三区| 97精品电影院| 成人免费电影视频| 国产麻豆成人传媒免费观看| 日本特黄久久久高潮| 亚洲国产综合色| 日韩一区有码在线| 久久精品免视看| 欧美成va人片在线观看| 91精品午夜视频| 欧美色中文字幕| 色吧成人激情小说| av在线一区二区| 不卡影院免费观看| 风间由美一区二区av101| 国产一区中文字幕| 黄色小说综合网站| 麻豆久久久久久| 美女www一区二区| 日产国产高清一区二区三区| 亚洲一区二区三区在线播放| 亚洲三级在线看| 亚洲欧美在线观看| 中文字幕在线不卡一区| 国产精品久久久久影视| 国产性做久久久久久| 久久久精品影视| 久久久亚洲精品一区二区三区| 精品国产乱子伦一区| 亚洲精品一区二区三区在线观看| 日韩精品中文字幕在线不卡尤物| 91精品国产综合久久久久久漫画| 欧美电影在线免费观看| 欧美日韩一本到| 51久久夜色精品国产麻豆| 91精品国产综合久久精品麻豆| 欧美丰满嫩嫩电影| 日韩女优制服丝袜电影| 欧美va在线播放| 国产网站一区二区三区| 日本一区二区三区在线不卡| 国产精品欧美久久久久一区二区 | 精品国产一区二区亚洲人成毛片| 日韩欧美中文字幕制服| 精品国产污污免费网站入口 | 国产人久久人人人人爽| 99视频一区二区| 不卡的电影网站| 91丝袜美女网| 在线看国产日韩| 欧美久久婷婷综合色| 欧美一区二区成人6969| 久久久久亚洲综合| 中文字幕日韩欧美一区二区三区| 亚洲精品你懂的| 日韩综合在线视频| 精彩视频一区二区| 成人美女视频在线看| 日本高清不卡aⅴ免费网站| 欧美日本一区二区三区| 欧美大黄免费观看| 中文字幕不卡在线播放| 一区二区在线免费观看| 日韩成人午夜电影| 国产一区二区三区av电影 | 日本午夜一本久久久综合| 久久不见久久见免费视频7| 国产精品一级在线| 91在线你懂得| 91精品国产综合久久蜜臀| 久久精品日产第一区二区三区高清版 | 欧美午夜免费电影| 精品日韩欧美在线| 18成人在线视频| 视频一区二区三区在线| 国产成人在线电影| 欧美最猛性xxxxx直播| 精品国偷自产国产一区| 日韩一区中文字幕| 日韩国产一区二|