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

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

?? jdsample.c

?? 一款最完整的工業組態軟源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * jdsample.c
 *
 * Copyright (C) 1991-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 upsampling routines.
 *
 * Upsampling input data is counted in "row groups".  A row group
 * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
 * sample rows of each component.  Upsampling will normally produce
 * max_v_samp_factor pixel rows from each row group (but this could vary
 * if the upsampler is applying a scale factor of its own).
 *
 * An excellent reference for image resampling is
 *   Digital Image Warping, George Wolberg, 1990.
 *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
 */

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


/* Pointer to routine to upsample a single component */
typedef JMETHOD(void, upsample1_ptr,
		(j_decompress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));

/* Private subobject */

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

  /* Color conversion buffer.  When using separate upsampling and color
   * conversion steps, this buffer holds one upsampled row group until it
   * has been color converted and output.
   * Note: we do not allocate any storage for component(s) which are full-size,
   * ie do not need rescaling.  The corresponding entry of color_buf[] is
   * simply set to point to the input data array, thereby avoiding copying.
   */
  JSAMPARRAY color_buf[MAX_COMPONENTS];

  /* Per-component upsampling method pointers */
  upsample1_ptr methods[MAX_COMPONENTS];

  int next_row_out;		/* counts rows emitted from color_buf */
  JDIMENSION rows_to_go;	/* counts rows remaining in image */

  /* Height of an input row group for each component. */
  int rowgroup_height[MAX_COMPONENTS];

  /* These arrays save pixel expansion factors so that int_expand need not
   * recompute them each time.  They are unused for other upsampling methods.
   */
  UINT8 h_expand[MAX_COMPONENTS];
  UINT8 v_expand[MAX_COMPONENTS];
} my_upsampler;

typedef my_upsampler * my_upsample_ptr;


/*
 * Initialize for an upsampling pass.
 */

METHODDEF(void)
start_pass_upsample (j_decompress_ptr cinfo)
{
  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;

  /* Mark the conversion buffer empty */
  upsample->next_row_out = cinfo->max_v_samp_factor;
  /* Initialize total-height counter for detecting bottom of image */
  upsample->rows_to_go = cinfo->output_height;
}


/*
 * Control routine to do upsampling (and color conversion).
 *
 * In this version we upsample each component independently.
 * We upsample one row group into the conversion buffer, then apply
 * color conversion a row at a time.
 */

METHODDEF(void)
sep_upsample (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_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  int ci;
  jpeg_component_info * compptr;
  JDIMENSION num_rows;

  /* Fill the conversion buffer, if it's empty */
  if (upsample->next_row_out >= cinfo->max_v_samp_factor) {
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      /* Invoke per-component upsample method.  Notice we pass a POINTER
       * to color_buf[ci], so that fullsize_upsample can change it.
       */
      (*upsample->methods[ci]) (cinfo, compptr,
	input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),
	upsample->color_buf + ci);
    }
    upsample->next_row_out = 0;
  }

  /* Color-convert and emit rows */

  /* How many we have in the buffer: */
  num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);
  /* Not more than the distance to the end of the image.  Need this test
   * in case the image height is not a multiple of max_v_samp_factor:
   */
  if (num_rows > upsample->rows_to_go) 
    num_rows = upsample->rows_to_go;
  /* And not more than what the client can accept: */
  out_rows_avail -= *out_row_ctr;
  if (num_rows > out_rows_avail)
    num_rows = out_rows_avail;

  (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
				     (JDIMENSION) upsample->next_row_out,
				     output_buf + *out_row_ctr,
				     (int) num_rows);

  /* Adjust counts */
  *out_row_ctr += num_rows;
  upsample->rows_to_go -= num_rows;
  upsample->next_row_out += num_rows;
  /* When the buffer is emptied, declare this input row group consumed */
  if (upsample->next_row_out >= cinfo->max_v_samp_factor)
    (*in_row_group_ctr)++;
}


/*
 * These are the routines invoked by sep_upsample to upsample pixel values
 * of a single component.  One row group is processed per call.
 */


/*
 * For full-size components, we just make color_buf[ci] point at the
 * input buffer, and thus avoid copying any data.  Note that this is
 * safe only because sep_upsample doesn't declare the input row group
 * "consumed" until we are done color converting and emitting it.
 */

METHODDEF(void)
fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
		   JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  *output_data_ptr = input_data;
}


/*
 * This is a no-op version used for "uninteresting" components.
 * These components will not be referenced by color conversion.
 */

METHODDEF(void)
noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  *output_data_ptr = NULL;	/* safety check */
}


/*
 * This version handles any integral sampling ratios.
 * This is not used for typical JPEG files, so it need not be fast.
 * Nor, for that matter, is it particularly accurate: the algorithm is
 * simple replication of the input pixel onto the corresponding output
 * pixels.  The hi-falutin sampling literature refers to this as a
 * "box filter".  A box filter tends to introduce visible artifacts,
 * so if you are actually going to use 3:1 or 4:1 sampling ratios
 * you would be well advised to improve this code.
 */

METHODDEF(void)
int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	      JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  JSAMPARRAY output_data = *output_data_ptr;
  register JSAMPROW inptr, outptr;
  register JSAMPLE invalue;
  register int h;
  JSAMPROW outend;
  int h_expand, v_expand;
  int inrow, outrow;

  h_expand = upsample->h_expand[compptr->component_index];
  v_expand = upsample->v_expand[compptr->component_index];

  inrow = outrow = 0;
  while (outrow < cinfo->max_v_samp_factor) {
    /* Generate one output row with proper horizontal expansion */
    inptr = input_data[inrow];
    outptr = output_data[outrow];
    outend = outptr + cinfo->output_width;
    while (outptr < outend) {
      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
      for (h = h_expand; h > 0; h--) {
	*outptr++ = invalue;
      }
    }
    /* Generate any additional output rows by duplicating the first one */
    if (v_expand > 1) {
      jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
			v_expand-1, cinfo->output_width);
    }
    inrow++;
    outrow += v_expand;
  }
}


/*
 * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.
 * It's still a box filter.
 */

METHODDEF(void)
h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  JSAMPARRAY output_data = *output_data_ptr;
  register JSAMPROW inptr, outptr;
  register JSAMPLE invalue;
  JSAMPROW outend;
  int inrow;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲av一区二区三区久久| 在线播放日韩导航| 亚洲视频电影在线| 91搞黄在线观看| 午夜精品一区二区三区免费视频| 一本久道久久综合中文字幕| 午夜精彩视频在线观看不卡| 91麻豆精品国产自产在线观看一区 | 色综合天天综合| 亚洲高清三级视频| 欧美第一区第二区| 成人av网址在线| 伊人一区二区三区| 日韩欧美视频一区| 国产成人午夜视频| 亚洲免费伊人电影| 欧美一区二区三区爱爱| 国产一区欧美二区| ㊣最新国产の精品bt伙计久久| 在线日韩一区二区| 久久电影网站中文字幕| 国产精品福利一区| 国产人久久人人人人爽| a级高清视频欧美日韩| 亚洲韩国精品一区| 精品国产凹凸成av人导航| 成人av在线播放网址| 日本午夜精品视频在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 欧美日韩小视频| 福利一区二区在线| 日韩 欧美一区二区三区| 国产午夜亚洲精品理论片色戒| 91猫先生在线| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品高潮呻吟| 日韩一级片在线观看| 91视视频在线观看入口直接观看www| 午夜伦欧美伦电影理论片| 欧美国产乱子伦| 日韩一级黄色片| 欧美亚洲动漫精品| 成人自拍视频在线| 免费观看成人鲁鲁鲁鲁鲁视频| 自拍偷拍欧美精品| 国产日韩欧美亚洲| 日韩一区二区视频| 在线视频一区二区三| 国产成人亚洲综合a∨猫咪| 青青草国产精品亚洲专区无| 一区二区三区四区在线免费观看| 精品国产网站在线观看| 欧美日韩免费一区二区三区| 91浏览器在线视频| 成人性生交大片免费| 韩日欧美一区二区三区| 婷婷久久综合九色综合伊人色| 亚洲乱码精品一二三四区日韩在线| 亚洲精品一区二区三区99| 欧美一卡在线观看| 欧美日韩成人在线| 欧美视频在线一区二区三区| 91亚洲永久精品| 成人av在线看| 成人久久视频在线观看| 丁香婷婷综合五月| 国产精品99久久久久| 国产综合色视频| 另类成人小视频在线| 麻豆国产精品视频| 精品一区二区在线看| 久久不见久久见免费视频1| 日韩精品成人一区二区三区| 亚洲成av人片一区二区三区 | 26uuu国产日韩综合| 日韩视频在线永久播放| 国产亚洲欧美激情| 日韩欧美色综合网站| 日韩精品在线网站| 欧美电影免费观看高清完整版在| 欧美一区二区观看视频| 欧美高清你懂得| 欧美日韩综合在线| 欧美乱熟臀69xxxxxx| 欧美一级理论性理论a| 91精品国产欧美一区二区18| 日韩美女天天操| 精品国产一区二区三区四区四| 亚洲精品一区二区三区影院| 久久久久久久久一| 国产欧美精品一区aⅴ影院 | 国产剧情一区二区| 国产福利一区在线| 91在线视频18| 欧美午夜不卡在线观看免费| 欧美吻胸吃奶大尺度电影| 欧美一区二区三区日韩视频| 日韩午夜电影在线观看| 国产片一区二区| 亚洲综合色区另类av| 青青草伊人久久| 成人国产一区二区三区精品| 91国在线观看| 精品日韩欧美一区二区| 国产精品女人毛片| 亚洲国产裸拍裸体视频在线观看乱了| 日韩电影一区二区三区四区| 国产精品羞羞答答xxdd| 一本久久a久久免费精品不卡| 911精品产国品一二三产区| 亚洲精品一区二区三区精华液 | 久久精品av麻豆的观看方式| 国产成人免费在线观看| 在线观看欧美精品| 久久久久青草大香线综合精品| 国产精品久久久久aaaa樱花| 天天综合天天做天天综合| 国产高清精品久久久久| 欧美亚洲国产一卡| 26uuu国产在线精品一区二区| 亚洲另类在线一区| 国产一区二区三区免费观看| 在线观看视频欧美| 久久蜜桃av一区精品变态类天堂| 中文字幕亚洲电影| 经典一区二区三区| 欧美性高清videossexo| 国产丝袜在线精品| 日韩精品电影一区亚洲| 91啪亚洲精品| 2019国产精品| 天堂久久久久va久久久久| 99久久精品费精品国产一区二区| 日韩免费观看高清完整版| 一区二区三区四区高清精品免费观看| 国产呦萝稀缺另类资源| 欧美三级日韩三级| 国产精品毛片高清在线完整版 | 狠狠色综合日日| 欧美日韩视频在线一区二区| 国产精品你懂的在线| 极品美女销魂一区二区三区| 欧美亚洲动漫另类| 《视频一区视频二区| 国产91丝袜在线播放0| 精品国内二区三区| 日本不卡视频在线| 欧美中文字幕久久| 亚洲青青青在线视频| www.欧美色图| 国产亚洲成aⅴ人片在线观看 | 欧美巨大另类极品videosbest | 久久精品一区八戒影视| 日韩精品电影在线观看| 欧美三级韩国三级日本一级| 成人免费一区二区三区在线观看| 国产精品一区二区在线播放| 欧美va亚洲va在线观看蝴蝶网| 日韩成人dvd| 欧美精选一区二区| 日韩电影在线一区二区三区| 欧美日韩精品系列| 香蕉影视欧美成人| 欧美日韩免费视频| 五月天国产精品| 欧美亚洲丝袜传媒另类| 亚洲黄色av一区| 欧美影视一区在线| 亚洲成人激情av| 7777女厕盗摄久久久| 日韩影院在线观看| 91精品国产福利| 久色婷婷小香蕉久久| 日韩三区在线观看| 激情小说欧美图片| 国产亚洲成av人在线观看导航| 国产v日产∨综合v精品视频| 欧美国产成人精品| 99re这里只有精品首页| 中文字幕佐山爱一区二区免费| 色视频成人在线观看免| 五月综合激情婷婷六月色窝| 欧美日韩三级一区二区| 久久精品理论片| 亚洲国产成人一区二区三区| 成人av高清在线| 亚洲一区在线免费观看| 欧美一级在线免费| 国产一区二区三区不卡在线观看| 国产欧美一区二区在线| 色婷婷久久久综合中文字幕| 午夜精品一区二区三区电影天堂| 日韩欧美国产不卡| 成人丝袜高跟foot| 午夜影视日本亚洲欧洲精品| 欧美tickling网站挠脚心| 成人毛片视频在线观看| 亚洲成人手机在线| 久久精品一区四区| 欧美在线不卡一区|