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

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

?? jdsample.c

?? WinCE開發技巧與實例的配套源碼
?? 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一区二区三区免费野_久草精品视频
免费观看久久久4p| 成人激情午夜影院| 国产精品污污网站在线观看| 欧洲亚洲国产日韩| 国产成人av电影免费在线观看| 亚洲午夜在线视频| 国产精品亲子乱子伦xxxx裸| 制服丝袜中文字幕一区| 欧美日本视频在线| 日韩免费福利电影在线观看| 1000部国产精品成人观看| 久久91精品国产91久久小草| 日韩欧美一级二级三级久久久| 亚洲高清一区二区三区| 欧美高清性hdvideosex| 亚洲成av人片在www色猫咪| 不卡一区在线观看| 欧美国产日产图区| 国产美女精品人人做人人爽| 久久先锋资源网| 不卡的av在线播放| 亚洲一区影音先锋| 欧美精品三级在线观看| 国产剧情一区二区三区| 国产亚洲制服色| 国产精品一色哟哟哟| 欧美三级日韩三级| 91精品国产综合久久小美女| 亚洲精品成人悠悠色影视| 欧美日韩国产小视频在线观看| 成人综合婷婷国产精品久久蜜臀| 国产麻豆午夜三级精品| 国产99久久久国产精品| 天天av天天翘天天综合网| 亚洲精品乱码久久久久久日本蜜臀| 欧美韩国日本一区| 国产偷国产偷精品高清尤物 | 久久精品久久99精品久久| 亚洲中国最大av网站| 国产精品1区2区| 国产精品欧美极品| 4438x亚洲最大成人网| 成人动漫精品一区二区| 亚洲自拍偷拍av| 精品日韩在线观看| 国产ts人妖一区二区| 一区二区三区中文字幕精品精品| 欧美一区二区三区小说| 成人国产亚洲欧美成人综合网| 午夜久久久影院| 亚洲欧美另类综合偷拍| 欧美精品一区二区久久久| 欧美在线观看禁18| 成人精品免费看| 婷婷六月综合网| 国产精品福利影院| 国产精品欧美一级免费| 国产精品免费视频观看| 丁香婷婷深情五月亚洲| 亚洲图片欧美一区| 亚洲蜜臀av乱码久久精品| 91超碰这里只有精品国产| 在线影视一区二区三区| 欧美日韩五月天| 国产激情视频一区二区在线观看| 免费成人结看片| 久久综合一区二区| 成人午夜激情在线| 亚洲国产成人高清精品| 亚洲人xxxx| 亚洲美女偷拍久久| 国产中文字幕一区| 精品国产精品网麻豆系列| 精品国产麻豆免费人成网站| 成人免费在线视频观看| 中文字幕亚洲综合久久菠萝蜜| 亚洲美女免费视频| 日韩和欧美一区二区| 国产91精品一区二区麻豆网站| 在线精品视频免费播放| 欧美精品一区二区三区高清aⅴ| 中文字幕日韩一区| 欧美一区二区三区的| 欧美一区二区三区公司| 欧美精品一区二区在线观看| 国产午夜精品一区二区三区四区| 18成人在线视频| 亚洲成人av一区二区| 亚洲综合成人网| 极品少妇一区二区| 99久久久国产精品免费蜜臀| 欧美日韩精品是欧美日韩精品| 欧美一二三区在线观看| 久久午夜国产精品| 亚洲一区二区在线观看视频| 日韩av一区二区三区四区| 国产精品1区二区.| 欧洲av一区二区嗯嗯嗯啊| 久久久久青草大香线综合精品| 亚洲桃色在线一区| 久久66热re国产| 欧美性生活影院| 欧美激情资源网| 极品美女销魂一区二区三区免费| 99精品欧美一区二区三区小说| 久久综合网色—综合色88| 婷婷久久综合九色综合伊人色| 在线看不卡av| 久久综合九色综合欧美就去吻| 国产盗摄一区二区| 欧美卡1卡2卡| 亚洲精品免费看| 综合久久给合久久狠狠狠97色| 国产精品成人网| 久久精品国产久精国产| 欧美性xxxxx极品少妇| 最新国产精品久久精品| 成人美女视频在线看| 久久精品夜色噜噜亚洲aⅴ| 岛国精品在线播放| 制服视频三区第一页精品| 久草这里只有精品视频| 美女性感视频久久| 亚洲人成小说网站色在线| 久久综合网色—综合色88| 青青草97国产精品免费观看 | 国产精品国产精品国产专区不蜜| 久久精品免费观看| 欧美一区二视频| 亚洲国产成人av网| 在线观看视频一区二区欧美日韩| 亚洲人成在线观看一区二区| 成人av动漫在线| 国产精品女主播在线观看| 成人精品一区二区三区四区| 国产精品毛片a∨一区二区三区| 国产精品亚洲综合一区在线观看| 2020国产精品| 狠狠色狠狠色综合系列| 精品国产一二三区| 激情综合色综合久久综合| 欧美成人官网二区| 韩国精品在线观看| 国产亚洲一区二区三区四区| 国产精品888| 国产精品久久久久一区二区三区共| 国产精品亚洲一区二区三区妖精| 国产欧美日韩在线观看| 成人av电影在线观看| 一区二区视频在线| 欧美视频一区在线观看| 日韩国产高清影视| 日韩一级免费观看| 国产精品99久久久久久似苏梦涵| 国产欧美精品一区二区三区四区 | 毛片av一区二区三区| 精品久久久久久久久久久院品网 | 蜜臀av性久久久久蜜臀aⅴ四虎| 26uuu国产电影一区二区| 国产suv精品一区二区6| 国产精品久久久久久久久久久免费看 | 另类小说综合欧美亚洲| 久久免费视频色| 91免费看片在线观看| 丝袜美腿一区二区三区| 日韩色在线观看| 国产成人免费视频| 亚洲综合一二三区| 精品国产成人系列| 成人av电影观看| 性久久久久久久| 久久久精品国产99久久精品芒果 | 久久99国内精品| 最新不卡av在线| 欧美丰满嫩嫩电影| 国产成人鲁色资源国产91色综| 国产乱理伦片在线观看夜一区| 国产精品久久午夜| 欧美精品久久久久久久多人混战 | 国产乱码精品一品二品| 伊人开心综合网| 久久久久久99久久久精品网站| 91丨九色丨蝌蚪富婆spa| 青椒成人免费视频| 亚洲欧洲日本在线| 日韩精品综合一本久道在线视频| 成人av小说网| 青青草原综合久久大伊人精品 | 91久久一区二区| 国产传媒欧美日韩成人| 亚洲成av人影院在线观看网| 亚洲国产精品黑人久久久| 在线观看91精品国产麻豆| 成人黄色av电影| 免费观看在线综合| 亚洲欧美日韩中文播放 | 日本精品一区二区三区高清 | 3d动漫精品啪啪1区2区免费| 99国产精品久久久| 国产一区美女在线|