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

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

?? jdpostct.c

?? WinCE開發技巧與實例的配套源碼
?? C
字號:
/*
 * jdpostct.c
 *
 * Copyright (C) 1994-1996, 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 the decompression postprocessing controller.
 * This controller manages the upsampling, color conversion, and color
 * quantization/reduction steps; specifically, it controls the buffering
 * between upsample/color conversion and color quantization/reduction.
 *
 * If no color quantization/reduction is required, then this module has no
 * work to do, and it just hands off to the upsample/color conversion code.
 * An integrated upsample/convert/quantize process would replace this module
 * entirely.
 */

#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"


/* Private buffer controller object */

typedef struct {
  struct jpeg_d_post_controller pub; /* public fields */

  /* Color quantization source buffer: this holds output data from
   * the upsample/color conversion step to be passed to the quantizer.
   * For two-pass color quantization, we need a full-image buffer;
   * for one-pass operation, a strip buffer is sufficient.
   */
  jvirt_sarray_ptr whole_image;	/* virtual array, or NULL if one-pass */
  JSAMPARRAY buffer;		/* strip buffer, or current strip of virtual */
  JDIMENSION strip_height;	/* buffer size in rows */
  /* for two-pass mode only: */
  JDIMENSION starting_row;	/* row # of first row in current strip */
  JDIMENSION next_row;		/* index of next row to fill/empty in strip */
} my_post_controller;

typedef my_post_controller * my_post_ptr;


/* Forward declarations */
METHODDEF(void) post_process_1pass
	JPP((j_decompress_ptr cinfo,
	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
	     JDIMENSION in_row_groups_avail,
	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
	     JDIMENSION out_rows_avail));
#ifdef QUANT_2PASS_SUPPORTED
METHODDEF(void) post_process_prepass
	JPP((j_decompress_ptr cinfo,
	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
	     JDIMENSION in_row_groups_avail,
	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
	     JDIMENSION out_rows_avail));
METHODDEF(void) post_process_2pass
	JPP((j_decompress_ptr cinfo,
	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
	     JDIMENSION in_row_groups_avail,
	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
	     JDIMENSION out_rows_avail));
#endif


/*
 * Initialize for a processing pass.
 */

METHODDEF(void)
start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;

  switch (pass_mode) {
  case JBUF_PASS_THRU:
    if (cinfo->quantize_colors) {
      /* Single-pass processing with color quantization. */
      post->pub.post_process_data = post_process_1pass;
      /* We could be doing buffered-image output before starting a 2-pass
       * color quantization; in that case, jinit_d_post_controller did not
       * allocate a strip buffer.  Use the virtual-array buffer as workspace.
       */
      if (post->buffer == NULL) {
	post->buffer = (*cinfo->mem->access_virt_sarray)
	  ((j_common_ptr) cinfo, post->whole_image,
	   (JDIMENSION) 0, post->strip_height, TRUE);
      }
    } else {
      /* For single-pass processing without color quantization,
       * I have no work to do; just call the upsampler directly.
       */
      post->pub.post_process_data = cinfo->upsample->upsample;
    }
    break;
#ifdef QUANT_2PASS_SUPPORTED
  case JBUF_SAVE_AND_PASS:
    /* First pass of 2-pass quantization */
    if (post->whole_image == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    post->pub.post_process_data = post_process_prepass;
    break;
  case JBUF_CRANK_DEST:
    /* Second pass of 2-pass quantization */
    if (post->whole_image == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    post->pub.post_process_data = post_process_2pass;
    break;
#endif /* QUANT_2PASS_SUPPORTED */
  default:
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    break;
  }
  post->starting_row = post->next_row = 0;
}


/*
 * Process some data in the one-pass (strip buffer) case.
 * This is used for color precision reduction as well as one-pass quantization.
 */

METHODDEF(void)
post_process_1pass (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION num_rows, max_rows;

  /* Fill the buffer, but not more than what we can dump out in one go. */
  /* Note we rely on the upsampler to detect bottom of image. */
  max_rows = out_rows_avail - *out_row_ctr;
  if (max_rows > post->strip_height)
    max_rows = post->strip_height;
  num_rows = 0;
  (*cinfo->upsample->upsample) (cinfo,
		input_buf, in_row_group_ctr, in_row_groups_avail,
		post->buffer, &num_rows, max_rows);
  /* Quantize and emit data. */
  (*cinfo->cquantize->color_quantize) (cinfo,
		post->buffer, output_buf + *out_row_ctr, (int) num_rows);
  *out_row_ctr += num_rows;
}


#ifdef QUANT_2PASS_SUPPORTED

/*
 * Process some data in the first pass of 2-pass quantization.
 */

METHODDEF(void)
post_process_prepass (j_decompress_ptr cinfo,
		      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		      JDIMENSION in_row_groups_avail,
		      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		      JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION old_next_row, num_rows;

  /* Reposition virtual buffer if at start of strip. */
  if (post->next_row == 0) {
    post->buffer = (*cinfo->mem->access_virt_sarray)
	((j_common_ptr) cinfo, post->whole_image,
	 post->starting_row, post->strip_height, TRUE);
  }

  /* Upsample some data (up to a strip height's worth). */
  old_next_row = post->next_row;
  (*cinfo->upsample->upsample) (cinfo,
		input_buf, in_row_group_ctr, in_row_groups_avail,
		post->buffer, &post->next_row, post->strip_height);

  /* Allow quantizer to scan new data.  No data is emitted, */
  /* but we advance out_row_ctr so outer loop can tell when we're done. */
  if (post->next_row > old_next_row) {
    num_rows = post->next_row - old_next_row;
    (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
					 (JSAMPARRAY) NULL, (int) num_rows);
    *out_row_ctr += num_rows;
  }

  /* Advance if we filled the strip. */
  if (post->next_row >= post->strip_height) {
    post->starting_row += post->strip_height;
    post->next_row = 0;
  }
}


/*
 * Process some data in the second pass of 2-pass quantization.
 */

METHODDEF(void)
post_process_2pass (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION num_rows, max_rows;

  /* Reposition virtual buffer if at start of strip. */
  if (post->next_row == 0) {
    post->buffer = (*cinfo->mem->access_virt_sarray)
	((j_common_ptr) cinfo, post->whole_image,
	 post->starting_row, post->strip_height, FALSE);
  }

  /* Determine number of rows to emit. */
  num_rows = post->strip_height - post->next_row; /* available in strip */
  max_rows = out_rows_avail - *out_row_ctr; /* available in output area */
  if (num_rows > max_rows)
    num_rows = max_rows;
  /* We have to check bottom of image here, can't depend on upsampler. */
  max_rows = cinfo->output_height - post->starting_row;
  if (num_rows > max_rows)
    num_rows = max_rows;

  /* Quantize and emit data. */
  (*cinfo->cquantize->color_quantize) (cinfo,
		post->buffer + post->next_row, output_buf + *out_row_ctr,
		(int) num_rows);
  *out_row_ctr += num_rows;

  /* Advance if we filled the strip. */
  post->next_row += num_rows;
  if (post->next_row >= post->strip_height) {
    post->starting_row += post->strip_height;
    post->next_row = 0;
  }
}

#endif /* QUANT_2PASS_SUPPORTED */


/*
 * Initialize postprocessing controller.
 */

GLOBAL(void)
jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
{
  my_post_ptr post;

  post = (my_post_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_post_controller));
  cinfo->post = (struct jpeg_d_post_controller *) post;
  post->pub.start_pass = start_pass_dpost;
  post->whole_image = NULL;	/* flag for no virtual arrays */
  post->buffer = NULL;		/* flag for no strip buffer */

  /* Create the quantization buffer, if needed */
  if (cinfo->quantize_colors) {
    /* The buffer strip height is max_v_samp_factor, which is typically
     * an efficient number of rows for upsampling to return.
     * (In the presence of output rescaling, we might want to be smarter?)
     */
    post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;
    if (need_full_buffer) {
      /* Two-pass color quantization: need full-image storage. */
      /* We round up the number of rows to a multiple of the strip height. */
#ifdef QUANT_2PASS_SUPPORTED
      post->whole_image = (*cinfo->mem->request_virt_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
	 cinfo->output_width * cinfo->out_color_components,
	 (JDIMENSION) jround_up((long) cinfo->output_height,
				(long) post->strip_height),
	 post->strip_height);
#else
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif /* QUANT_2PASS_SUPPORTED */
    } else {
      /* One-pass color quantization: just make a strip buffer. */
      post->buffer = (*cinfo->mem->alloc_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE,
	 cinfo->output_width * cinfo->out_color_components,
	 post->strip_height);
    }
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影一区二区三区四区| 91精品久久久久久蜜臀| 国产精品全国免费观看高清| 国产精品99久久久久| 国产精品嫩草影院com| 国产精品亚洲第一区在线暖暖韩国| 国产午夜精品一区二区三区嫩草 | 一区二区三区在线不卡| 91美女蜜桃在线| 午夜精品久久久久久久久久| 欧美日韩在线电影| 一区二区三区91| 国产一区二区中文字幕| 精品毛片乱码1区2区3区| 国产欧美一区二区精品仙草咪| 欧美国产成人精品| 亚洲国产精品久久久男人的天堂| 日本成人在线不卡视频| 成人国产精品免费网站| 在线电影一区二区三区| 国产精品麻豆视频| 日韩一卡二卡三卡四卡| 奇米精品一区二区三区四区| 久久日韩粉嫩一区二区三区| av不卡在线播放| 日韩国产欧美一区二区三区| 国产色一区二区| 欧美亚洲禁片免费| 国产高清在线精品| 亚洲成a人v欧美综合天堂| 精品美女在线播放| 欧美性猛交xxxxxx富婆| 国产美女一区二区三区| 亚洲一区二区三区视频在线播放| 欧美一级片在线| 99视频一区二区| 精品综合久久久久久8888| 亚洲精品中文在线影院| www国产精品av| 欧洲一区在线观看| 福利一区二区在线观看| 蜜乳av一区二区| 悠悠色在线精品| 亚洲国产精品ⅴa在线观看| 欧美一区二区三区四区五区| 91丨porny丨中文| 国产一区二区三区综合| 天天操天天干天天综合网| 中文字幕在线不卡| 2023国产精品| 日韩精品在线网站| 欧美日韩国产a| 一本大道综合伊人精品热热| 国产精品自拍三区| 男女性色大片免费观看一区二区| 一区二区在线观看av| 亚洲国产精品精华液ab| 2欧美一区二区三区在线观看视频| 欧美在线观看视频一区二区| 成人av手机在线观看| 国产成人午夜视频| 国产做a爰片久久毛片| 蜜桃久久久久久久| 天天综合网天天综合色 | 久久精品这里都是精品| 日韩美女在线视频| 欧美一区二区三区色| 欧美日韩色一区| 91国偷自产一区二区使用方法| 99久久精品国产网站| 丰满放荡岳乱妇91ww| 国产精品一卡二卡| 国产成人欧美日韩在线电影| 激情小说亚洲一区| 国产乱码精品一区二区三区av | 韩日精品视频一区| 韩国av一区二区| 久草中文综合在线| 极品少妇xxxx精品少妇偷拍| 日本成人中文字幕| 蜜臀av性久久久久蜜臀av麻豆| 日韩影院免费视频| 蜜桃av一区二区三区电影| 久久机这里只有精品| 国模冰冰炮一区二区| 国产精品亚洲午夜一区二区三区 | 日本亚洲电影天堂| 美女高潮久久久| 老司机午夜精品99久久| 韩国av一区二区三区四区 | 亚洲色大成网站www久久九九| 中文字幕av在线一区二区三区| 日本一区二区电影| 亚洲免费av网站| 天堂一区二区在线免费观看| 日本不卡一区二区三区高清视频| 久久精品国产澳门| 国产suv精品一区二区6| 色婷婷精品久久二区二区蜜臀av | 曰韩精品一区二区| 日韩黄色在线观看| 国产九色sp调教91| 91免费国产视频网站| 欧美三区在线视频| 精品国产免费久久| 中文字幕中文字幕一区| 亚洲一区在线视频观看| 黄色日韩三级电影| 91丨九色丨黑人外教| 欧美一区午夜视频在线观看| 久久香蕉国产线看观看99| 亚洲欧美综合网| 成人免费视频视频在线观看免费| 天天综合色天天| 国产99久久久国产精品免费看| 色屁屁一区二区| 日韩一区二区三| 亚洲欧洲av一区二区三区久久| 风流少妇一区二区| 欧美日本在线看| 欧美极品xxx| 天天色 色综合| 99国产精品久| 久久综合九色综合久久久精品综合| 17c精品麻豆一区二区免费| 日韩avvvv在线播放| 波多野结衣中文一区| 337p亚洲精品色噜噜| 亚洲色图一区二区| 国产精品系列在线观看| 制服丝袜一区二区三区| 亚洲靠逼com| 大桥未久av一区二区三区中文| 欧美性猛交xxxxxxxx| 国产无遮挡一区二区三区毛片日本| 亚洲欧洲国产专区| 玉米视频成人免费看| 黄色日韩三级电影| 91丨porny丨在线| 日韩精品中文字幕在线一区| 亚洲免费看黄网站| 狠狠色丁香久久婷婷综合丁香| 成人h动漫精品一区二| 欧美高清精品3d| 精品少妇一区二区三区日产乱码| 亚洲女同ⅹxx女同tv| 国产一区二区三区免费播放| 色狠狠综合天天综合综合| 日韩精品中午字幕| 石原莉奈在线亚洲二区| 成人午夜精品一区二区三区| 99精品视频一区二区| 日韩手机在线导航| 日韩一区在线看| 国产专区欧美精品| 欧美日韩在线不卡| 亚洲欧美国产高清| 国产高清精品在线| 欧美一级艳片视频免费观看| 视频一区视频二区中文| 色综合天天综合狠狠| wwww国产精品欧美| 免费观看一级欧美片| 欧洲精品视频在线观看| 中文字幕中文乱码欧美一区二区| 久久国产精品第一页| 欧美三级日韩在线| 久久九九国产精品| 成人午夜视频在线| 2020国产精品| 精品在线免费视频| 91麻豆蜜桃一区二区三区| 亚洲免费观看在线观看| 国产激情视频一区二区在线观看 | 成人激情免费视频| 日韩美女一区二区三区| 狠狠色丁香久久婷婷综合丁香| 欧美久久久久久蜜桃| 亚洲电影在线播放| 91精品国产入口| 日韩不卡手机在线v区| 欧美日韩中文字幕一区二区| 国产欧美日韩中文久久| 91伊人久久大香线蕉| 亚洲视频一二三区| 91久久精品日日躁夜夜躁欧美| 国产精品白丝在线| 94色蜜桃网一区二区三区| 亚洲图片有声小说| 欧美日韩精品一二三区| 视频一区二区中文字幕| 欧美在线观看视频在线| 久久超碰97人人做人人爱| 日韩一级二级三级| 韩国精品久久久| 亚洲精品乱码久久久久久黑人| 91久久精品一区二区二区| 亚洲一区二区三区不卡国产欧美| 欧美午夜一区二区三区免费大片| 久久99深爱久久99精品|