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

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

?? jcsample.c

?? About JPEG, executable on Visual C++
?? C
?? 第 1 頁 / 共 2 頁
字號:
////////////////////////////////////////////////////////////////////////
//
//	Note : this file is included as part of the Smaller Animals Software
//	JpegFile package. Though this file has not been modified from it's 
//	original IJG 6a form, it is not the responsibility on the Independent
//	JPEG Group to answer questions regarding this code.
//	
//	Any questions you have about this code should be addressed to :
//
//	CHRISDL@PAGESZ.NET	- the distributor of this package.
//
//	Remember, by including this code in the JpegFile package, Smaller 
//	Animals Software assumes all responsibilities for answering questions
//	about it. If we (SA Software) can't answer your questions ourselves, we 
//	will direct you to people who can.
//
//	Thanks, CDL.
//
////////////////////////////////////////////////////////////////////////

/*
 * 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)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美r级在线观看| 亚洲视频 欧洲视频| 亚洲欧美色一区| 久久国产精品免费| 色综合婷婷久久| 国产亚洲婷婷免费| 人禽交欧美网站| 色老汉一区二区三区| 亚洲国产成人一区二区三区| 裸体一区二区三区| 欧美偷拍一区二区| 国产精品久久久久久久久搜平片| 美女视频黄久久| 欧美高清视频在线高清观看mv色露露十八| 亚洲国产高清不卡| 国产馆精品极品| xfplay精品久久| 六月丁香婷婷久久| 日韩一级欧美一级| 日韩成人午夜电影| 欧美丰满一区二区免费视频 | 亚洲国产aⅴ天堂久久| 成人av在线一区二区三区| 久久综合999| 久久99久久久欧美国产| 日韩视频免费观看高清完整版 | 日韩一区二区高清| 亚洲夂夂婷婷色拍ww47| 91久久线看在观草草青青| 亚洲欧美一区二区在线观看| 粉嫩av亚洲一区二区图片| 国产午夜亚洲精品羞羞网站| 国产一区二区三区免费播放| 2021中文字幕一区亚洲| 国产黄人亚洲片| 国产精品麻豆99久久久久久| 成人动漫精品一区二区| 国产精品国产精品国产专区不片| 成人影视亚洲图片在线| 日韩一区中文字幕| 91久久精品一区二区| 亚洲欧美经典视频| 欧美三级韩国三级日本一级| 午夜精品福利在线| 欧美一二三区在线| 国产一区不卡视频| 精品一区二区三区在线观看国产| 精品国产乱码久久久久久免费 | 国产欧美一二三区| jlzzjlzz亚洲女人18| 亚洲色大成网站www久久九九| 色综合天天综合网天天看片| 亚洲一级在线观看| 日韩一区二区三区四区五区六区 | 日韩影院免费视频| 久久亚洲欧美国产精品乐播| 国产91精品欧美| 亚洲一级不卡视频| 日韩免费电影网站| 成人在线视频一区| 日韩在线一区二区| 中文字幕精品在线不卡| 欧美中文字幕一区二区三区 | eeuss国产一区二区三区| 成人黄色网址在线观看| 伊人一区二区三区| 日韩欧美国产一区在线观看| 成人av动漫网站| 日本va欧美va瓶| 最新国产精品久久精品| 制服丝袜亚洲精品中文字幕| 国产91精品一区二区麻豆网站| 亚洲高清免费在线| 国产精品女同互慰在线看| 欧美日韩在线电影| 成人午夜激情片| 麻豆中文一区二区| 亚洲人精品午夜| 久久综合九色综合97_久久久| 日本道在线观看一区二区| 国产一区二区三区四区五区美女 | 精品国产露脸精彩对白| 91色|porny| 国产一区二区三区四区五区美女| 亚洲国产日韩一区二区| 国产精品的网站| 国产午夜精品久久| 日韩一级二级三级| 欧美电影在线免费观看| 99精品欧美一区| 国产69精品久久久久毛片| 久草在线在线精品观看| 亚洲丶国产丶欧美一区二区三区| 中文字幕高清一区| 精品国产髙清在线看国产毛片| 欧美无砖专区一中文字| 91丨九色porny丨蝌蚪| 岛国一区二区在线观看| 国产一区二区在线电影| 日本在线播放一区二区三区| 亚洲一区二区偷拍精品| 国产在线一区二区综合免费视频| 亚洲一区二区三区视频在线播放| 国产精品嫩草久久久久| 久久精品亚洲精品国产欧美kt∨| 欧美二区在线观看| 91精品国产综合久久久蜜臀粉嫩 | 欧美日韩免费一区二区三区视频 | 国产精品一区二区你懂的| 亚洲第一精品在线| 在线精品视频一区二区三四| 99精品桃花视频在线观看| 亚洲va韩国va欧美va| 亚洲激情在线播放| 亚洲精品国产品国语在线app| 国产精品成人一区二区三区夜夜夜| 国产午夜精品一区二区三区嫩草| wwwwww.欧美系列| 久久久影视传媒| 久久精品一区二区三区av| 久久色在线视频| 国产日产欧美一区二区视频| 久久精品免视看| 日本一区二区三区四区 | 日韩国产精品91| 日韩成人av影视| 日韩电影在线一区二区三区| 日韩精品久久理论片| 麻豆精品一区二区| 国产乱子伦视频一区二区三区| 国产综合久久久久影院| 国产成人免费av在线| 成人av午夜电影| 在线视频一区二区三区| 欧美精品日韩精品| 日韩欧美国产一二三区| 久久精品免视看| 亚洲精品高清在线观看| 性欧美疯狂xxxxbbbb| 免费成人在线视频观看| 国产一区二区看久久| a4yy欧美一区二区三区| 在线视频欧美精品| 日韩美女天天操| 亚洲欧洲av色图| 欧美aaaaa成人免费观看视频| 国产主播一区二区| 一本大道久久a久久综合| 91精品婷婷国产综合久久性色| 精品久久久久久久久久久久久久久久久 | 日韩丝袜美女视频| 国产日韩三级在线| 亚洲免费电影在线| 久久国产免费看| 色哟哟国产精品| 精品国产露脸精彩对白| 亚洲精品va在线观看| 另类成人小视频在线| 99r国产精品| 久久中文字幕电影| 亚洲综合在线视频| 国产乱码精品1区2区3区| 欧美性猛交xxxx黑人交| 亚洲精品一区二区三区香蕉 | 日本一区二区三区电影| 亚洲777理论| 成人午夜激情影院| 欧美一区二区啪啪| 国产精品久久福利| 久久成人av少妇免费| 欧美日韩另类国产亚洲欧美一级| 国产欧美视频在线观看| 免费人成在线不卡| 欧美在线视频日韩| 中文字幕制服丝袜一区二区三区 | 国产精品毛片无遮挡高清| 免费人成精品欧美精品| 91成人在线观看喷潮| 日本一区二区三区在线不卡| 麻豆成人91精品二区三区| 欧美色倩网站大全免费| 中文字幕一区二区三区视频| 国产一区二区日韩精品| 欧美一区二区三区在线视频| 亚洲一区二区三区在线看| 99久久99久久综合| 1024成人网| 成人av免费在线| 国产精品女主播在线观看| 国产a区久久久| 国产亚洲人成网站| 国产高清精品久久久久| 久久久影视传媒| 国产成人8x视频一区二区| 久久免费视频一区| 国产精品一区二区91| 精品久久人人做人人爰| 韩国成人精品a∨在线观看| 精品欧美一区二区久久| 久久疯狂做爰流白浆xx|