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

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

?? jquant1.c

?? MPEG4解碼程序源代碼(能夠對各種MPEG4文件進行解碼)
?? 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一区二区三区免费野_久草精品视频
成人自拍视频在线| 91精品国产品国语在线不卡| 欧美三日本三级三级在线播放| 精品国产一区二区在线观看| 亚洲精品欧美激情| 国产a精品视频| 欧美大片日本大片免费观看| 亚洲精品成a人| 国产传媒日韩欧美成人| 欧美日韩精品电影| 亚洲人成精品久久久久久 | 国产一区二区三区不卡在线观看| 在线免费观看日本欧美| 国产精品系列在线| 国产在线播放一区二区三区 | 972aa.com艺术欧美| 精品乱码亚洲一区二区不卡| 午夜伦理一区二区| 91色在线porny| 国产精品成人网| 成人开心网精品视频| 久久青草欧美一区二区三区| 日韩欧美一级在线播放| 亚洲午夜电影网| 色久优优欧美色久优优| 成人免费小视频| 成人动漫视频在线| 中文字幕乱码久久午夜不卡| 精彩视频一区二区| 精品国产精品一区二区夜夜嗨| 偷窥少妇高潮呻吟av久久免费| 色网综合在线观看| 一区二区三区精密机械公司| 91免费看片在线观看| 亚洲视频中文字幕| 色八戒一区二区三区| 亚洲三级免费电影| 91看片淫黄大片一级| 亚洲黄色小视频| 色激情天天射综合网| 午夜亚洲国产au精品一区二区| 欧美日韩免费不卡视频一区二区三区 | 成人高清视频在线| 中文字幕一区二区三区乱码在线| 成人免费视频app| 亚洲欧美电影一区二区| 日本高清不卡视频| 亚欧色一区w666天堂| 欧美一区二区黄色| 国产白丝精品91爽爽久久| 国产精品久久久久精k8| 一本一道久久a久久精品综合蜜臀| 亚洲综合免费观看高清在线观看| 91福利国产精品| 免费精品视频最新在线| 国产视频一区二区在线观看| 99久久精品免费| 亚洲香肠在线观看| 欧美本精品男人aⅴ天堂| 国产麻豆精品theporn| 蜜桃视频免费观看一区| 久久免费国产精品| 欧美久久一二区| 亚洲成人高清在线| 日韩一区二区在线播放| 国产精品资源在线看| 中文字幕欧美激情一区| 欧美无砖专区一中文字| 精品一区二区三区影院在线午夜| 国产视频在线观看一区二区三区| 色婷婷久久99综合精品jk白丝| 蜜臀av在线播放一区二区三区| 国产亚洲女人久久久久毛片| 欧洲一区二区av| 国产精品一区2区| 一区二区三区四区在线| 26uuu久久天堂性欧美| 在线观看国产91| 国产一区二区三区免费观看| 亚洲综合成人网| 中文字幕不卡在线| 日韩写真欧美这视频| 99re66热这里只有精品3直播| 日韩电影一二三区| 亚洲婷婷国产精品电影人久久| 日韩一二三区视频| 一本色道久久综合狠狠躁的推荐 | 国产精品1区2区3区在线观看| 亚洲人成网站精品片在线观看| 精品少妇一区二区三区日产乱码 | 91精品视频网| 99国内精品久久| 国产精品亚洲第一区在线暖暖韩国| 亚洲成人av中文| 亚洲免费看黄网站| 国产精品欧美经典| 久久综合成人精品亚洲另类欧美| 欧美日韩黄色影视| 色婷婷久久综合| av中文字幕一区| 国产成人免费在线观看不卡| 男男gaygay亚洲| 午夜成人在线视频| 亚洲黄色在线视频| 亚洲区小说区图片区qvod| 国产欧美在线观看一区| 精品福利一二区| 精品欧美一区二区久久| 欧美一区二区免费观在线| 欧美精品v国产精品v日韩精品| 一本大道av伊人久久综合| 99在线视频精品| 97精品视频在线观看自产线路二| 国产二区国产一区在线观看 | 日韩黄色在线观看| 亚洲电影在线播放| 一区二区三区在线免费观看| 亚洲女人小视频在线观看| 亚洲特级片在线| 夜夜操天天操亚洲| 亚洲国产视频网站| 午夜一区二区三区视频| 免费看日韩a级影片| 喷水一区二区三区| 精品一区二区三区免费毛片爱| 久久精工是国产品牌吗| 九九**精品视频免费播放| 精品一区二区免费视频| 国产精品亚洲午夜一区二区三区| 国产乱对白刺激视频不卡| 粉嫩av一区二区三区| 99久久99久久久精品齐齐| 欧美中文字幕一区| 欧美一区二区三区不卡| 欧美成人女星排名| 中文字幕 久热精品 视频在线| 亚洲欧洲国产专区| 亚洲在线观看免费视频| 日产欧产美韩系列久久99| 国产另类ts人妖一区二区| 99re这里只有精品6| 精品视频999| 26uuu色噜噜精品一区二区| 欧美激情综合网| 亚洲v日本v欧美v久久精品| 麻豆91精品视频| www.综合网.com| 欧美日韩国产小视频在线观看| 精品国产免费一区二区三区香蕉| 日本一区二区不卡视频| 亚洲一区在线观看免费观看电影高清 | 亚洲欧洲国产日韩| 蜜桃久久av一区| 成人黄色大片在线观看| 欧美日韩电影在线| 欧美国产在线观看| 亚洲在线观看免费视频| 国产成人自拍在线| 欧美精品一卡两卡| 国产精品―色哟哟| 美女久久久精品| 一本色道亚洲精品aⅴ| 精品国产区一区| 亚洲国产精品综合小说图片区| 精品一区二区在线播放| 欧美主播一区二区三区| 中文字幕免费不卡| 蜜桃精品视频在线观看| 色中色一区二区| 国产精品第一页第二页第三页| 麻豆免费精品视频| 在线视频一区二区三区| 中文字幕va一区二区三区| 男女男精品视频网| 欧美日韩一区不卡| 亚洲色欲色欲www| 国产精品白丝jk白祙喷水网站| 欧美精品 国产精品| 亚洲午夜成aⅴ人片| 91麻豆国产自产在线观看| 欧美国产欧美综合| 韩国欧美一区二区| 日韩女优制服丝袜电影| 日日夜夜一区二区| 欧美日韩国产小视频在线观看| 一区二区国产盗摄色噜噜| 99riav久久精品riav| 国产精品你懂的在线| 国产不卡视频在线观看| 欧美电影免费观看高清完整版在 | 99精品久久只有精品| 日本一区二区三区高清不卡| 天天影视涩香欲综合网| 9l国产精品久久久久麻豆| 日韩一区欧美小说| 国产美女一区二区三区| 欧美一区二区三区公司| 玖玖九九国产精品| 欧美日韩国产三级| 日韩欧美一区二区免费|