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

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

?? jdsample.c

?? windows ce開發技巧與實例光盤代碼
?? 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一区二区三区免费野_久草精品视频
成人网在线播放| 国产精品毛片无遮挡高清| 日韩福利电影在线| 日韩一卡二卡三卡四卡| 久久99国产乱子伦精品免费| 欧美大白屁股肥臀xxxxxx| 国产在线视频一区二区| 国产日本亚洲高清| 色哟哟精品一区| 日韩中文字幕麻豆| 久久久久久久久蜜桃| 波波电影院一区二区三区| 亚洲精品自拍动漫在线| 91精品国产一区二区三区香蕉| 国产一区二区视频在线| 亚洲欧美日本在线| 欧美一区二区成人6969| 成人激情动漫在线观看| 亚洲国产精品视频| 精品国产123| 99re这里都是精品| 日韩激情一二三区| 日本一区二区电影| 欧美高清视频在线高清观看mv色露露十八 | 国产精品午夜春色av| 91精品福利视频| 免费的国产精品| 国产精品国产三级国产aⅴ原创 | 国产精品久久久久9999吃药| 欧美在线免费观看视频| 激情综合一区二区三区| 亚洲精品欧美专区| 26uuu成人网一区二区三区| 欧美性猛交xxxxxx富婆| 国产尤物一区二区在线| 亚洲一二三区在线观看| 国产欧美精品一区二区三区四区| 欧美日韩国产在线播放网站| 国产大陆亚洲精品国产| 香蕉久久一区二区不卡无毒影院| 国产欧美一区二区精品性色 | 欧美一区二区三区四区五区| av爱爱亚洲一区| 麻豆中文一区二区| 亚洲专区一二三| 国产精品青草久久| 久久综合成人精品亚洲另类欧美| 欧美在线观看你懂的| 国产69精品久久久久777| 美国av一区二区| 日韩高清不卡一区| 又紧又大又爽精品一区二区| 欧美激情中文字幕| 亚洲精品一区二区三区影院| 欧美日韩国产系列| 色妹子一区二区| 成人免费看视频| 国产美女主播视频一区| 麻豆精品新av中文字幕| 日韩精品国产欧美| 亚洲一区二区视频| 亚洲精品一二三四区| 国产精品乱码久久久久久| 精品福利av导航| 日韩欧美高清在线| 91精品国产一区二区人妖| 欧美日产国产精品| 911精品产国品一二三产区| 欧美视频在线播放| 欧美在线小视频| 欧美日韩午夜在线| 欧美久久久久久久久中文字幕| 日本电影欧美片| 在线观看国产91| 欧美午夜电影一区| 欧美男生操女生| 在线不卡免费av| 91精品欧美一区二区三区综合在| 欧美猛男gaygay网站| 欧美日韩国产精品自在自线| 欧美日韩的一区二区| 正在播放一区二区| 欧美一区二区观看视频| ww久久中文字幕| 国产精品水嫩水嫩| 亚洲免费毛片网站| 亚洲18女电影在线观看| 日本亚洲电影天堂| 久久精品国产免费| 国产激情偷乱视频一区二区三区| 成人黄色在线看| 色婷婷精品久久二区二区蜜臂av | 777xxx欧美| 欧美成人aa大片| 国产欧美一区二区在线| 日韩理论片中文av| 亚洲18影院在线观看| 韩国三级电影一区二区| 成人小视频免费观看| 色一情一乱一乱一91av| 欧美一区二区日韩| 久久久精品黄色| 亚洲一区二区三区在线| 久久国产精品色| 成人免费观看视频| 欧美日韩另类一区| 国产网站一区二区三区| 一区二区三区在线免费视频| 毛片av中文字幕一区二区| 成+人+亚洲+综合天堂| 欧美剧情片在线观看| 中文字幕不卡一区| 午夜精品福利一区二区蜜股av| 国产在线精品一区二区不卡了| av影院午夜一区| 91精品国产综合久久久久久久久久 | 国产精品久久看| 日精品一区二区| 成人免费毛片片v| 69av一区二区三区| 国产精品国模大尺度视频| 日本特黄久久久高潮| 成人小视频在线| 精品免费视频一区二区| 一区二区三区av电影| 国产一区二区三区免费在线观看| 一本到不卡免费一区二区| 欧美成人a在线| 亚洲第一狼人社区| 99久久精品国产毛片| 久久综合九色综合97婷婷女人 | 久久精品国产**网站演员| 92精品国产成人观看免费| 久久综合五月天婷婷伊人| 一区二区成人在线观看| 国产精品1区2区3区在线观看| 欧美日本国产视频| 亚洲欧洲99久久| 国产成人免费在线观看| 欧美xxxx老人做受| 亚洲国产毛片aaaaa无费看| 欧美r级在线观看| 亚洲精品写真福利| 成人三级伦理片| www国产精品av| 午夜视频在线观看一区二区| 丰满白嫩尤物一区二区| 精品伦理精品一区| 日本在线不卡一区| 欧美日本视频在线| 亚洲午夜激情av| 色天使色偷偷av一区二区| 国产精品白丝在线| 懂色av一区二区三区蜜臀| 久久网站热最新地址| 日本麻豆一区二区三区视频| 欧美三级在线视频| 亚洲一本大道在线| 欧美日韩视频不卡| 亚洲午夜电影在线观看| 欧美日韩一区三区四区| 夜夜精品浪潮av一区二区三区| 色综合一区二区三区| 亚洲男人电影天堂| 91国模大尺度私拍在线视频 | 亚洲欧洲av另类| 99久久免费精品| 中文字幕在线观看一区| 成人av免费在线| 亚洲日本成人在线观看| 一本大道久久a久久精品综合| 18成人在线观看| 在线视频欧美精品| 亚洲成人1区2区| 91精品国产丝袜白色高跟鞋| 青青草国产成人av片免费 | 亚洲精品一区二区三区四区高清| 激情欧美日韩一区二区| 久久这里只有精品6| 国产成人免费高清| 亚洲欧美在线视频观看| 色狠狠综合天天综合综合| 亚洲午夜免费电影| 日韩欧美亚洲另类制服综合在线| 极品少妇xxxx精品少妇偷拍| 欧美激情一区二区三区四区| www.视频一区| 亚洲国产精品综合小说图片区| 日韩限制级电影在线观看| 狠狠色丁香婷婷综合| 国产精品久久久久桃色tv| 色欧美片视频在线观看在线视频| 婷婷亚洲久悠悠色悠在线播放| 日韩欧美中文字幕制服| 成人丝袜视频网| 亚洲精品国产一区二区精华液| 3atv在线一区二区三区| 国产成人亚洲综合色影视| 亚洲综合偷拍欧美一区色| 欧美xfplay|