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

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

?? jdsample.c

?? JPEG source code converts the image into compressed format
?? 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一区二区三区免费野_久草精品视频
波多野结衣的一区二区三区| 国产馆精品极品| 成人中文字幕在线| 日韩一区二区视频在线观看| 亚洲国产综合人成综合网站| 色婷婷亚洲一区二区三区| 久久免费看少妇高潮| 久久国产精品第一页| 欧美一区日本一区韩国一区| 亚洲成人先锋电影| 欧美亚洲一区二区在线观看| 亚洲免费成人av| 91在线精品一区二区三区| 国产精品天美传媒| 成人免费观看av| 国产精品午夜免费| av在线不卡电影| 亚洲美女一区二区三区| 99re成人在线| 一区二区三区四区av| 在线观看不卡一区| 亚洲成人在线免费| 欧美一区二区高清| 亚洲国产一区二区三区 | 久久久久久一级片| 国产精品资源站在线| 国产精品女上位| 成人高清av在线| 亚洲欧洲性图库| 99久久国产综合精品女不卡| 亚洲精品水蜜桃| 4438x成人网最大色成网站| 美女视频黄久久| 中文字幕中文字幕中文字幕亚洲无线| 97超碰欧美中文字幕| 一区二区三区久久久| 69av一区二区三区| 国产主播一区二区| 一区二区三区四区激情| 日韩欧美亚洲国产精品字幕久久久| 精彩视频一区二区三区| 亚洲欧美成人一区二区三区| 欧美日韩国产精选| 国产成人亚洲综合a∨婷婷图片| 久久蜜臀精品av| 色综合久久综合网欧美综合网 | 欧美日本一区二区在线观看| 国产最新精品免费| 亚洲另类春色校园小说| 欧美mv和日韩mv国产网站| 99国产欧美另类久久久精品| 日韩电影在线观看电影| 国产日韩欧美精品一区| 色8久久人人97超碰香蕉987| 国产裸体歌舞团一区二区| 1024成人网| 精品成人一区二区| 欧美视频自拍偷拍| 国产福利一区二区三区视频在线| 伊人色综合久久天天| 久久免费午夜影院| 欧美日韩亚洲综合一区| 国产成人8x视频一区二区| 五月激情丁香一区二区三区| 亚洲三级在线播放| 亚洲无线码一区二区三区| 成人动漫中文字幕| 综合自拍亚洲综合图不卡区| 精品午夜久久福利影院| 日韩亚洲欧美高清| 国产999精品久久久久久| 国产亚洲精品超碰| av电影天堂一区二区在线观看| 国产精品视频yy9299一区| 成人精品一区二区三区四区 | 亚洲永久精品国产| 丁香另类激情小说| 亚洲欧美国产三级| 91精品国产乱码久久蜜臀| 狠狠色2019综合网| 亚洲婷婷综合色高清在线| 国内精品伊人久久久久av一坑| 久久午夜老司机| 久久国内精品视频| 95精品视频在线| 欧美电影免费观看高清完整版| 久久综合久久综合九色| 国产精品911| 日韩中文欧美在线| 美脚の诱脚舐め脚责91 | 国产不卡高清在线观看视频| 国产精品视频在线看| 国产无人区一区二区三区| 日韩你懂的在线播放| 日韩欧美国产麻豆| 日韩免费观看高清完整版| 日韩精品中午字幕| 精品免费国产二区三区| 欧美日韩国产美| 色悠悠久久综合| 一本一道久久a久久精品综合蜜臀 一本一道综合狠狠老 | 国产乱人伦精品一区二区在线观看| 日韩国产在线观看一区| 日韩国产欧美在线播放| 亚洲成年人影院| 日韩在线一区二区三区| 视频在线观看一区二区三区| 三级久久三级久久| 亚洲第一主播视频| 天天爽夜夜爽夜夜爽精品视频| 亚洲一区二区三区四区的| 亚洲123区在线观看| 亚洲一线二线三线视频| 最新国产成人在线观看| 一区二区三区精品| 亚洲成av人片www| 精品一区二区综合| 成人黄色免费短视频| 91蜜桃婷婷狠狠久久综合9色| 色呦呦一区二区三区| 欧美日韩国产三级| 精品电影一区二区三区| 欧美激情一区二区三区全黄| 国产午夜精品久久久久久免费视| 国产精品素人视频| 亚洲国产精品精华液网站| 日本aⅴ免费视频一区二区三区| 精品系列免费在线观看| 成人av网站在线观看免费| 色哟哟精品一区| 色婷婷狠狠综合| 欧美变态凌虐bdsm| 亚洲欧洲在线观看av| 天堂蜜桃91精品| 国产99久久久精品| 欧美日韩精品福利| 国产精品视频一二三| 午夜精品视频一区| 色欲综合视频天天天| 国产精品麻豆一区二区| 国产精品99久久久久久似苏梦涵| 欧美日韩电影一区| 亚洲综合一二三区| 欧美性videosxxxxx| 国产精品久久久久久久岛一牛影视 | 亚洲高清视频在线| 成人三级伦理片| 久久久99精品免费观看不卡| 日韩精品久久久久久| 在线观看欧美精品| 亚洲欧洲日产国码二区| 国产不卡免费视频| 国产偷国产偷亚洲高清人白洁| 蜜臀91精品一区二区三区| 欧美日韩电影一区| 午夜欧美一区二区三区在线播放| 99re66热这里只有精品3直播 | 亚洲色图色小说| 成年人国产精品| 中文字幕亚洲视频| 91丨porny丨蝌蚪视频| 国产精品美女一区二区| 精品粉嫩aⅴ一区二区三区四区| 美日韩一区二区三区| 欧美精品一区二区三区在线 | 亚洲国产精品成人综合色在线婷婷| 奇米影视7777精品一区二区| 精品福利一区二区三区免费视频| 久久99国产精品免费| 国产丝袜在线精品| 欧美在线不卡视频| 国产成人综合亚洲网站| 亚洲卡通动漫在线| 精品国产一二三| 色综合久久66| 国产大陆精品国产| 亚洲一区欧美一区| 亚洲人成伊人成综合网小说| 欧美一区二区三区人| 欧美一区中文字幕| 欧美中文字幕一区| 欧美视频在线观看一区二区| 国产精品66部| 日韩一本二本av| 99久久综合精品| 久久国产综合精品| 亚洲国产精品综合小说图片区| 欧美不卡123| 九色综合国产一区二区三区| 欧美偷拍一区二区| 在线看日本不卡| 亚洲乱码中文字幕| 欧美丰满嫩嫩电影| 激情文学综合丁香| 中文字幕亚洲欧美在线不卡| 欧美三级日本三级少妇99| 毛片不卡一区二区| 国产精品久久久久久久久晋中 | 日韩欧美国产一区二区在线播放| 九九**精品视频免费播放|