亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩免费成人网| 欧美精品一区二区三区高清aⅴ | 成人综合婷婷国产精品久久免费| 午夜欧美电影在线观看| 香蕉久久一区二区不卡无毒影院| 亚洲一二三级电影| 亚洲综合图片区| 亚洲chinese男男1069| 亚洲一二三四久久| 肉丝袜脚交视频一区二区| 亚洲第一狼人社区| 蜜桃免费网站一区二区三区| 精品一区二区三区在线播放视频| 久久99国内精品| 国产成人在线网站| 9i在线看片成人免费| 91精品91久久久中77777| 色综合咪咪久久| 正在播放一区二区| 久久免费电影网| 亚洲美女在线国产| 亚洲综合色网站| 久久成人羞羞网站| www.66久久| 日韩欧美第一区| 国产精品成人一区二区艾草| 亚洲一区二区三区视频在线播放| 肉肉av福利一精品导航| 国产不卡在线一区| 精品1区2区3区| 久久一夜天堂av一区二区三区| 亚洲天堂福利av| 欧美aaa在线| 9色porny自拍视频一区二区| 717成人午夜免费福利电影| 久久久久久久久久久久电影| 亚洲女女做受ⅹxx高潮| 奇米一区二区三区| caoporn国产精品| 日韩欧美的一区二区| 亚洲精品免费在线观看| 久久精品72免费观看| 色综合久久综合网97色综合 | 91福利在线免费观看| 日韩一区二区三区四区| 国产精品久久久久9999吃药| 日本午夜精品一区二区三区电影 | 人禽交欧美网站| 91在线视频观看| xnxx国产精品| 青青草原综合久久大伊人精品 | 精品成人免费观看| 一级做a爱片久久| 成人网男人的天堂| 日韩欧美视频在线| 午夜精品成人在线| 91官网在线免费观看| 国产精品久久久久桃色tv| 国精品**一区二区三区在线蜜桃| 欧美丝袜自拍制服另类| 亚洲视频一二三| 波波电影院一区二区三区| www国产成人| 麻豆国产精品视频| 777奇米四色成人影色区| 亚洲一区二区三区四区在线| 一本色道久久综合精品竹菊| 国产精品久久久久精k8| www.综合网.com| 中文字幕一区二区三区在线播放 | 国产色91在线| 国产乱一区二区| 国产日韩亚洲欧美综合| 国产乱子轮精品视频| 久久久五月婷婷| 国产电影精品久久禁18| 国产日产欧产精品推荐色| 国产成人综合在线观看| 欧美国产乱子伦 | 国产69精品久久99不卡| 久久精品人人爽人人爽| 国产成人h网站| 欧美国产日韩一二三区| 91一区一区三区| 亚洲一区二区三区视频在线播放| 欧美日韩电影一区| 精品制服美女久久| 日本一区二区在线不卡| 成人av电影在线观看| 亚洲男人天堂av网| 欧美日韩免费观看一区三区| 日韩在线观看一区二区| xnxx国产精品| 99这里只有精品| 日韩国产精品久久久久久亚洲| 欧美一级日韩一级| 岛国精品一区二区| 一区二区三区鲁丝不卡| 日韩一区二区三区四区五区六区| 国产精品影视在线| 一区二区在线免费观看| 欧美一区二区视频在线观看| 极品少妇xxxx偷拍精品少妇| 中文字幕日韩精品一区 | 欧美tk丨vk视频| 高清免费成人av| 亚洲国产欧美在线| 欧美不卡视频一区| 日本韩国视频一区二区| 老司机免费视频一区二区| 亚洲同性gay激情无套| 日韩亚洲欧美一区二区三区| 暴力调教一区二区三区| 日本一区中文字幕| 亚洲卡通动漫在线| 久久久亚洲高清| 3d成人动漫网站| 色呦呦网站一区| 激情综合色丁香一区二区| 一区二区三区影院| 国产欧美日韩麻豆91| 欧美精品免费视频| 成人动漫一区二区| 激情综合网av| 日韩国产在线观看| 一区二区三区精品在线观看| 国产视频911| 欧美哺乳videos| 欧美三级三级三级爽爽爽| 成人精品电影在线观看| 精品一区二区日韩| 日韩—二三区免费观看av| 亚洲另类色综合网站| 国产偷国产偷精品高清尤物 | 亚洲精品一区二区三区四区高清| 欧美色老头old∨ideo| 国产91精品一区二区麻豆亚洲| 青青草97国产精品免费观看无弹窗版| 亚洲免费av高清| 中文字幕一区二区三区蜜月| 久久久久久9999| 欧美大片国产精品| 欧美一级在线免费| 69久久99精品久久久久婷婷| 在线观看国产精品网站| gogo大胆日本视频一区| 国产99久久久精品| 成年人国产精品| 成人动漫视频在线| 91丝袜美腿高跟国产极品老师 | 欧美精三区欧美精三区| 欧洲一区二区三区在线| 色婷婷国产精品久久包臀| 99精品视频在线免费观看| www.在线成人| 欧美专区日韩专区| 在线综合视频播放| 欧美成人精品二区三区99精品| 欧美成人性战久久| 久久品道一品道久久精品| 久久久久久亚洲综合影院红桃| 日本一区二区三区四区在线视频| 亚洲国产精品传媒在线观看| 国产精品亲子伦对白| 亚洲欧洲日本在线| 亚洲大尺度视频在线观看| 婷婷综合在线观看| 国产主播一区二区三区| 不卡区在线中文字幕| 91视频在线看| 欧美丰满少妇xxxxx高潮对白| 91精品婷婷国产综合久久竹菊| 91精品国产91综合久久蜜臀| 欧美精品一区二区久久久| 久久久五月婷婷| 一区二区三区视频在线观看| 视频一区欧美精品| 国产麻豆成人精品| 91福利在线观看| 久久午夜免费电影| 亚洲精品自拍动漫在线| 日本不卡一区二区三区高清视频| 国产在线一区二区| 在线一区二区三区| 精品粉嫩aⅴ一区二区三区四区| 国产精品天美传媒| 日本在线不卡视频| 99re成人精品视频| 日韩三级在线观看| 一区二区激情视频| 国内精品国产成人| 欧美三级视频在线播放| 中文成人av在线| 日韩影院在线观看| 成人av动漫在线| 久久综合丝袜日本网| 一区二区三区在线观看国产| 国产精品91一区二区| 91精品国产综合久久香蕉的特点| 中日韩av电影|