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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jcsample.c

?? 一款最完整的工業(yè)組態(tài)軟源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
 * jcsample.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 downsampling routines.
 *
 * Downsampling input data is counted in "row groups".  A row group
 * is defined to be max_v_samp_factor pixel rows of each component,
 * from which the downsampler produces v_samp_factor sample rows.
 * A single row group is processed in each call to the downsampler module.
 *
 * The downsampler is responsible for edge-expansion of its output data
 * to fill an integral number of DCT blocks horizontally.  The source buffer
 * may be modified if it is helpful for this purpose (the source buffer is
 * allocated wide enough to correspond to the desired output width).
 * The caller (the prep controller) is responsible for vertical padding.
 *
 * The downsampler may request "context rows" by setting need_context_rows
 * during startup.  In this case, the input arrays will contain at least
 * one row group's worth of pixels above and below the passed-in data;
 * the caller will create dummy rows at image top and bottom by replicating
 * the first or last real pixel row.
 *
 * 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.
 *
 * The downsampling algorithm used here is a simple average of the source
 * pixels covered by the output pixel.  The hi-falutin sampling literature
 * refers to this as a "box filter".  In general the characteristics of a box
 * filter are not very good, but for the specific cases we normally use (1:1
 * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not
 * nearly so bad.  If you intend to use other sampling ratios, you'd be well
 * advised to improve this code.
 *
 * A simple input-smoothing capability is provided.  This is mainly intended
 * for cleaning up color-dithered GIF input files (if you find it inadequate,
 * we suggest using an external filtering program such as pnmconvol).  When
 * enabled, each input pixel P is replaced by a weighted sum of itself and its
 * eight neighbors.  P's weight is 1-8*SF and each neighbor's weight is SF,
 * where SF = (smoothing_factor / 1024).
 * Currently, smoothing is only supported for 2h2v sampling factors.
 */

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


/* Pointer to routine to downsample a single component */
typedef JMETHOD(void, downsample1_ptr,
		(j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data));

/* Private subobject */

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

  /* Downsampling method pointers, one per component */
  downsample1_ptr methods[MAX_COMPONENTS];
} my_downsampler;

typedef my_downsampler * my_downsample_ptr;


/*
 * Initialize for a downsampling pass.
 */

METHODDEF(void)
start_pass_downsample (j_compress_ptr cinfo)
{
  /* no work for now */
}


/*
 * Expand a component horizontally from width input_cols to width output_cols,
 * by duplicating the rightmost samples.
 */

LOCAL(void)
expand_right_edge (JSAMPARRAY image_data, int num_rows,
		   JDIMENSION input_cols, JDIMENSION output_cols)
{
  register JSAMPROW ptr;
  register JSAMPLE pixval;
  register int count;
  int row;
  int numcols = (int) (output_cols - input_cols);

  if (numcols > 0) {
    for (row = 0; row < num_rows; row++) {
      ptr = image_data[row] + input_cols;
      pixval = ptr[-1];		/* don't need GETJSAMPLE() here */
      for (count = numcols; count > 0; count--)
	*ptr++ = pixval;
    }
  }
}


/*
 * Do downsampling for a whole row group (all components).
 *
 * In this version we simply downsample each component independently.
 */

METHODDEF(void)
sep_downsample (j_compress_ptr cinfo,
		JSAMPIMAGE input_buf, JDIMENSION in_row_index,
		JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
{
  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
  int ci;
  jpeg_component_info * compptr;
  JSAMPARRAY in_ptr, out_ptr;

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    in_ptr = input_buf[ci] + in_row_index;
    out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
    (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
  }
}


/*
 * Downsample pixel values of a single component.
 * One row group is processed per call.
 * This version handles arbitrary integral sampling ratios, without smoothing.
 * Note that this version is not actually used for customary sampling ratios.
 */

METHODDEF(void)
int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
  JDIMENSION outcol, outcol_h;	/* outcol_h == outcol*h_expand */
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  JSAMPROW inptr, outptr;
  INT32 outvalue;

  h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
  v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
  numpix = h_expand * v_expand;
  numpix2 = numpix/2;

  /* Expand input data enough to let all the output samples be generated
   * by the standard loop.  Special-casing padded output would be more
   * efficient.
   */
  expand_right_edge(input_data, cinfo->max_v_samp_factor,
		    cinfo->image_width, output_cols * h_expand);

  inrow = 0;
  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
    outptr = output_data[outrow];
    for (outcol = 0, outcol_h = 0; outcol < output_cols;
	 outcol++, outcol_h += h_expand) {
      outvalue = 0;
      for (v = 0; v < v_expand; v++) {
	inptr = input_data[inrow+v] + outcol_h;
	for (h = 0; h < h_expand; h++) {
	  outvalue += (INT32) GETJSAMPLE(*inptr++);
	}
      }
      *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
    }
    inrow += v_expand;
  }
}


/*
 * Downsample pixel values of a single component.
 * This version handles the special case of a full-size component,
 * without smoothing.
 */

METHODDEF(void)
fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		     JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  /* Copy the data */
  jcopy_sample_rows(input_data, 0, output_data, 0,
		    cinfo->max_v_samp_factor, cinfo->image_width);
  /* Edge-expand */
  expand_right_edge(output_data, cinfo->max_v_samp_factor,
		    cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
}


/*
 * Downsample pixel values of a single component.
 * This version handles the common case of 2:1 horizontal and 1:1 vertical,
 * without smoothing.
 *
 * A note about the "bias" calculations: when rounding fractional values to
 * integer, we do not want to always round 0.5 up to the next integer.
 * If we did that, we'd introduce a noticeable bias towards larger values.
 * Instead, this code is arranged so that 0.5 will be rounded up or down at
 * alternate pixel locations (a simple ordered dither pattern).
 */

METHODDEF(void)
h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int outrow;
  JDIMENSION outcol;
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  register JSAMPROW inptr, outptr;
  register int bias;

  /* Expand input data enough to let all the output samples be generated
   * by the standard loop.  Special-casing padded output would be more
   * efficient.
   */
  expand_right_edge(input_data, cinfo->max_v_samp_factor,
		    cinfo->image_width, output_cols * 2);

  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
    outptr = output_data[outrow];
    inptr = input_data[outrow];
    bias = 0;			/* bias = 0,1,0,1,... for successive samples */
    for (outcol = 0; outcol < output_cols; outcol++) {
      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
			      + bias) >> 1);
      bias ^= 1;		/* 0=>1, 1=>0 */
      inptr += 2;
    }
  }
}


/*
 * Downsample pixel values of a single component.
 * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
 * without smoothing.
 */

METHODDEF(void)
h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int inrow, outrow;
  JDIMENSION outcol;
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  register JSAMPROW inptr0, inptr1, outptr;
  register int bias;

  /* Expand input data enough to let all the output samples be generated
   * by the standard loop.  Special-casing padded output would be more
   * efficient.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频一区二区三区| 中文字幕av一区二区三区| 久久精品国产亚洲高清剧情介绍| 欧美一级爆毛片| 国产一区二区在线看| 中文乱码免费一区二区| 91免费观看国产| 亚洲永久精品国产| 日韩欧美123| 国产成人午夜视频| 一区二区三区在线视频免费| 欧美精品日韩一本| 国产一区二区三区综合| 亚洲婷婷综合久久一本伊一区| 欧美自拍丝袜亚洲| 蜜臀国产一区二区三区在线播放| 精品国产乱码久久久久久老虎| 高清shemale亚洲人妖| 一区二区视频在线| 日韩欧美国产三级电影视频| 国产成人精品免费网站| 一区二区三区四区中文字幕| 欧美一级在线观看| 国产99久久久久| 亚洲成av人片在www色猫咪| 精品国产亚洲在线| 色综合久久综合网97色综合| 美女性感视频久久| 1024亚洲合集| 日韩一级二级三级| 99热99精品| 麻豆久久一区二区| 亚洲欧洲综合另类| 精品久久久久久久久久久久包黑料| 成人国产精品免费观看视频| 亚洲sss视频在线视频| 久久久高清一区二区三区| 欧美午夜精品久久久久久超碰| 国产麻豆精品在线观看| 亚洲成人av福利| 国产欧美日韩不卡| 欧美另类久久久品| www.欧美.com| 久久国产尿小便嘘嘘| 亚洲激情自拍偷拍| 337p日本欧洲亚洲大胆色噜噜| 一本大道久久a久久综合婷婷| 久久成人免费网站| 亚洲一区二区三区四区的| 久久久精品免费网站| 欧美日韩国产美女| av网站一区二区三区| 久久不见久久见免费视频7| 一区二区三区四区在线免费观看| 久久久久久黄色| 欧美精品一二三四| 91黄色免费网站| 福利电影一区二区| 裸体在线国模精品偷拍| 亚洲福利一区二区| 国产精品国产a级| 久久亚洲一区二区三区四区| 欧美日韩免费视频| 91丨九色丨黑人外教| 国产黑丝在线一区二区三区| 男男成人高潮片免费网站| 亚洲欧美日韩国产手机在线| 久久久久久久久久久99999| 91精品国产入口| 在线观看不卡视频| 91在线观看高清| 岛国av在线一区| 国产自产视频一区二区三区| 日韩国产高清影视| 亚洲综合免费观看高清完整版| 欧美国产日韩在线观看| 精品国产乱码91久久久久久网站| 欧美日韩国产高清一区二区| 在线一区二区三区| 91女人视频在线观看| 成人国产视频在线观看| 国产电影一区在线| 国产一区二区久久| 精品一区二区三区在线播放视频| 天天综合色天天综合色h| 一区二区三区 在线观看视频| 国产精品传媒在线| 国产精品人人做人人爽人人添| 26uuu精品一区二区在线观看| 日韩三级免费观看| 日韩一区二区免费高清| 欧美福利视频导航| 777奇米四色成人影色区| 欧美喷潮久久久xxxxx| 欧美日本国产视频| 欧美日韩国产片| 欧美疯狂性受xxxxx喷水图片| 欧美蜜桃一区二区三区| 欧美日本一区二区三区四区| 欧美日韩极品在线观看一区| 在线观看91视频| 欧美日韩一区二区在线观看| 欧美三级电影精品| 欧美日韩免费观看一区三区| 欧美日韩一卡二卡| 欧美美女激情18p| 91麻豆精品国产无毒不卡在线观看| 欧美久久久影院| 欧美一区二区黄| 欧美mv和日韩mv的网站| 精品人在线二区三区| 久久久久久久久免费| 国产精品污污网站在线观看| 中文字幕一区av| 亚洲激情图片qvod| 亚洲成a人片在线不卡一二三区| 日韩av电影免费观看高清完整版 | 9人人澡人人爽人人精品| 成人妖精视频yjsp地址| 成人av片在线观看| 日本道色综合久久| 欧美日韩一区国产| 日韩精品在线看片z| 久久九九影视网| 国产精品成人在线观看| 一区二区三区欧美亚洲| 午夜精品久久一牛影视| 麻豆精品国产传媒mv男同| 国产老肥熟一区二区三区| 丁香另类激情小说| 色综合久久88色综合天天6| 欧美日韩在线综合| 日韩美女一区二区三区四区| 国产丝袜欧美中文另类| 亚洲日本在线看| 无吗不卡中文字幕| 国产精品资源站在线| 99久久精品国产麻豆演员表| 欧美视频一区二区在线观看| 日韩一区二区在线看片| 国产色综合久久| 亚洲一区二区影院| 另类小说一区二区三区| 不卡的av网站| 欧美精品免费视频| 国产亚洲福利社区一区| 一区二区三区在线视频免费| 美女脱光内衣内裤视频久久影院| 成人性生交大片免费看在线播放| 色视频成人在线观看免| 日韩欧美一区电影| 国产精品久久福利| 奇米精品一区二区三区在线观看一| 国产一区二区h| 91国内精品野花午夜精品 | 精品剧情在线观看| 中文字幕一区二区三区不卡| 日日夜夜一区二区| 国产suv精品一区二区三区| 欧美日韩在线电影| 国产亚洲精品超碰| 午夜视频在线观看一区二区| 国产高清亚洲一区| 欧美色图一区二区三区| 欧美—级在线免费片| 亚洲国产另类av| 国产成人8x视频一区二区 | 久久久91精品国产一区二区三区| 一区二区久久久久| 国产一区二区影院| 欧美日韩国产一级二级| 国产精品久久午夜夜伦鲁鲁| 日韩—二三区免费观看av| 99久久综合精品| 欧美成人官网二区| 亚洲激情图片小说视频| 国产成人8x视频一区二区| 欧美片网站yy| 亚洲男同1069视频| 国产伦理精品不卡| 欧美疯狂性受xxxxx喷水图片| 中文字幕制服丝袜成人av| 美女视频黄久久| 欧美三区免费完整视频在线观看| 国产日韩欧美一区二区三区综合 | 午夜在线电影亚洲一区| 国产.欧美.日韩| 日韩视频在线永久播放| 亚洲精品国产一区二区精华液| 国产精品影视天天线| 欧美精品久久天天躁| 日韩毛片高清在线播放| 国产综合色视频| 日韩一区二区精品| 亚洲一区二区精品3399| av在线不卡电影| 久久久www成人免费无遮挡大片| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美做爰猛烈大尺度电影无法无天| 国产欧美一区二区精品性|