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

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

?? jquant1.c

?? WinCE開發(fā)技巧與實(shí)例的配套源碼
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
  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 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频在线观看一区| 免费成人结看片| 91在线视频在线| 亚洲欧美怡红院| 91激情五月电影| 午夜精品久久久久久| 日韩视频免费观看高清完整版在线观看| 欧美日韩免费在线视频| 水野朝阳av一区二区三区| 日韩欧美的一区二区| 国产成人精品亚洲777人妖| 国产精品盗摄一区二区三区| 欧美性大战xxxxx久久久| 婷婷中文字幕综合| 欧美成人性战久久| 国产成a人亚洲精品| 亚洲一区二区三区四区中文字幕| 91精品婷婷国产综合久久竹菊| 狠狠狠色丁香婷婷综合久久五月| 日韩免费视频一区二区| 成人在线综合网| 亚洲高清视频的网址| 日韩欧美aaaaaa| 93久久精品日日躁夜夜躁欧美| 午夜精品福利一区二区蜜股av | av在线播放一区二区三区| 亚洲男人都懂的| 精品国产乱码久久久久久闺蜜| bt欧美亚洲午夜电影天堂| 日本色综合中文字幕| 国产精品网站一区| 91精品国产综合久久福利| 99综合影院在线| 玖玖九九国产精品| 亚洲精品乱码久久久久久久久 | 亚洲一二三四久久| 久久久精品日韩欧美| 欧美亚洲动漫精品| jiyouzz国产精品久久| 美日韩一区二区三区| 一区二区三区四区高清精品免费观看| 精品免费一区二区三区| 欧美自拍偷拍一区| 岛国精品在线播放| 蜜桃av一区二区三区| 亚洲成年人网站在线观看| 中文无字幕一区二区三区| 日韩免费视频一区二区| 久久久精品天堂| 欧美日韩国产另类不卡| 99久久久免费精品国产一区二区| 国产一区二区成人久久免费影院| 亚洲成人午夜影院| 亚洲精品一二三区| 国产精品久久夜| 久久久久国产成人精品亚洲午夜| 欧美久久一区二区| 欧美这里有精品| 色老头久久综合| 一本大道久久精品懂色aⅴ| 成人激情免费网站| 国产成人a级片| 国产精品自在欧美一区| 激情成人综合网| 久久91精品久久久久久秒播| 日韩精品1区2区3区| 日韩国产欧美视频| 肉色丝袜一区二区| 日韩av电影天堂| 蜜臀av一区二区在线观看| 亚洲韩国一区二区三区| 亚洲午夜久久久| 亚洲成av人**亚洲成av**| 夜夜嗨av一区二区三区四季av| 国产欧美日韩另类一区| 国产校园另类小说区| 久久久91精品国产一区二区三区| 久久久99久久| 国产精品二三区| 亚洲欧洲中文日韩久久av乱码| 中文字幕在线不卡一区| 综合久久国产九一剧情麻豆| 亚洲欧美视频在线观看| 亚洲精品高清在线| 午夜精品免费在线观看| 免费观看一级欧美片| 久久99精品国产.久久久久久 | 中文字幕欧美国产| 国产精品久久夜| 亚洲午夜一区二区| 日韩精品电影在线| 国产在线一区二区| 成人精品一区二区三区中文字幕| 99久久久久免费精品国产| 色国产综合视频| 欧美丰满少妇xxxxx高潮对白 | 日本女人一区二区三区| 国产在线视视频有精品| av动漫一区二区| 欧美区一区二区三区| 精品国产成人在线影院| 中文字幕 久热精品 视频在线| 亚洲欧美激情小说另类| 日韩电影在线观看电影| 丁香天五香天堂综合| 欧美视频中文字幕| 日韩精品在线网站| 国产精品久久久久久久久快鸭| 亚洲一区二区三区四区在线免费观看 | 欧美精品v国产精品v日韩精品| 欧美成人官网二区| 亚洲欧洲99久久| 日本视频在线一区| 不卡的电视剧免费网站有什么| 欧美日韩另类国产亚洲欧美一级| 久久品道一品道久久精品| 亚洲综合在线第一页| 国产一区二区免费在线| 欧美怡红院视频| 国产女人aaa级久久久级| 午夜不卡av免费| 丁香桃色午夜亚洲一区二区三区| 欧美视频在线播放| 国产精品乱人伦中文| 日本在线播放一区二区三区| 波多野结衣中文字幕一区| 欧美一区二区二区| 亚洲精品免费电影| 国产**成人网毛片九色 | 福利一区在线观看| 在线成人免费观看| 亚洲日本在线视频观看| 国产一区二区三区| 欧美一级爆毛片| 亚洲一区二区三区四区在线观看| 国产91精品一区二区麻豆亚洲| 欧美一区二区在线免费观看| 亚洲精品日韩专区silk| 国产精品中文有码| 日韩精品专区在线影院重磅| 亚洲成人一二三| 91麻豆国产精品久久| 国产日韩精品一区| 国内精品在线播放| 日韩一区二区三区免费观看| 亚洲线精品一区二区三区八戒| 国产91丝袜在线播放| 久久久久久久网| 久久99最新地址| 日韩一区二区三区精品视频| 亚洲大片免费看| 色哟哟国产精品免费观看| 国产精品无人区| 国产成人精品免费视频网站| 精品国产一区a| 麻豆精品新av中文字幕| 欧美电影一区二区| 丝袜美腿高跟呻吟高潮一区| 欧美精品久久99| 99久久精品国产导航| 欧美国产精品劲爆| 成人丝袜高跟foot| 日本一区二区视频在线| 成人一区二区三区视频| 国产亚洲欧美在线| 国产成人av一区二区| 国产午夜亚洲精品羞羞网站| 国产一区二区看久久| 国产亚洲精品bt天堂精选| 国产一区高清在线| 国产欧美综合色| 99久久久免费精品国产一区二区| 亚洲人成亚洲人成在线观看图片| 色噜噜狠狠一区二区三区果冻| 亚洲日本丝袜连裤袜办公室| 色又黄又爽网站www久久| 亚洲国产精品久久久男人的天堂 | 久久精品国产亚洲aⅴ| 日韩写真欧美这视频| 久久成人久久鬼色| 国产亚洲精品aa| 色噜噜狠狠色综合中国| 亚洲gay无套男同| 日韩欧美成人激情| 国产91富婆露脸刺激对白| 亚洲女同一区二区| 91精品麻豆日日躁夜夜躁| 韩国女主播成人在线| 国产精品网站在线观看| 欧美性猛交一区二区三区精品| 日本不卡不码高清免费观看| 2023国产一二三区日本精品2022| 国产成人自拍在线| 一区二区在线免费观看| 日韩欧美一二三| 成人福利视频网站| 亚洲成av人**亚洲成av**| 精品国产sm最大网站| 不卡电影免费在线播放一区| 三级不卡在线观看|