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

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

?? jdmaster.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.
//
////////////////////////////////////////////////////////////////////////

/*
 * jdmaster.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 master control logic for the JPEG decompressor.
 * These routines are concerned with selecting the modules to be executed
 * and with determining the number of passes and the work to be done in each
 * pass.
 */

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


/* Private state */

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

  int pass_number;		/* # of passes completed */

  boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */

  /* Saved references to initialized quantizer modules,
   * in case we need to switch modes.
   */
  struct jpeg_color_quantizer * quantizer_1pass;
  struct jpeg_color_quantizer * quantizer_2pass;
} my_decomp_master;

typedef my_decomp_master * my_master_ptr;


/*
 * Determine whether merged upsample/color conversion should be used.
 * CRUCIAL: this must match the actual capabilities of jdmerge.c!
 */

LOCAL(boolean)
use_merged_upsample (j_decompress_ptr cinfo)
{
#ifdef UPSAMPLE_MERGING_SUPPORTED
  /* Merging is the equivalent of plain box-filter upsampling */
  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
    return FALSE;
  /* jdmerge.c only supports YCC=>RGB color conversion */
  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
      cinfo->out_color_space != JCS_RGB ||
      cinfo->out_color_components != RGB_PIXELSIZE)
    return FALSE;
  /* and it only handles 2h1v or 2h2v sampling ratios */
  if (cinfo->comp_info[0].h_samp_factor != 2 ||
      cinfo->comp_info[1].h_samp_factor != 1 ||
      cinfo->comp_info[2].h_samp_factor != 1 ||
      cinfo->comp_info[0].v_samp_factor >  2 ||
      cinfo->comp_info[1].v_samp_factor != 1 ||
      cinfo->comp_info[2].v_samp_factor != 1)
    return FALSE;
  /* furthermore, it doesn't work if we've scaled the IDCTs differently */
  if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
      cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
      cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size)
    return FALSE;
  /* ??? also need to test for upsample-time rescaling, when & if supported */
  return TRUE;			/* by golly, it'll work... */
#else
  return FALSE;
#endif
}


/*
 * Compute output image dimensions and related values.
 * NOTE: this is exported for possible use by application.
 * Hence it mustn't do anything that can't be done twice.
 * Also note that it may be called before the master module is initialized!
 */

GLOBAL(void)
jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
  int ci;
  jpeg_component_info *compptr;

  /* Prevent application from calling me at wrong times */
  if (cinfo->global_state != DSTATE_READY)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

#ifdef IDCT_SCALING_SUPPORTED

  /* Compute actual output image dimensions and DCT scaling choices. */
  if (cinfo->scale_num * 8 <= cinfo->scale_denom) {
    /* Provide 1/8 scaling */
    cinfo->output_width = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_width, 8L);
    cinfo->output_height = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_height, 8L);
    cinfo->min_DCT_scaled_size = 1;
  } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) {
    /* Provide 1/4 scaling */
    cinfo->output_width = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_width, 4L);
    cinfo->output_height = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_height, 4L);
    cinfo->min_DCT_scaled_size = 2;
  } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) {
    /* Provide 1/2 scaling */
    cinfo->output_width = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_width, 2L);
    cinfo->output_height = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_height, 2L);
    cinfo->min_DCT_scaled_size = 4;
  } else {
    /* Provide 1/1 scaling */
    cinfo->output_width = cinfo->image_width;
    cinfo->output_height = cinfo->image_height;
    cinfo->min_DCT_scaled_size = DCTSIZE;
  }
  /* In selecting the actual DCT scaling for each component, we try to
   * scale up the chroma components via IDCT scaling rather than upsampling.
   * This saves time if the upsampler gets to use 1:1 scaling.
   * Note this code assumes that the supported DCT scalings are powers of 2.
   */
  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    int ssize = cinfo->min_DCT_scaled_size;
    while (ssize < DCTSIZE &&
	   (compptr->h_samp_factor * ssize * 2 <=
	    cinfo->max_h_samp_factor * cinfo->min_DCT_scaled_size) &&
	   (compptr->v_samp_factor * ssize * 2 <=
	    cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size)) {
      ssize = ssize * 2;
    }
    compptr->DCT_scaled_size = ssize;
  }

  /* Recompute downsampled dimensions of components;
   * application needs to know these if using raw downsampled data.
   */
  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    /* Size in samples, after IDCT scaling */
    compptr->downsampled_width = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_width *
		    (long) (compptr->h_samp_factor * compptr->DCT_scaled_size),
		    (long) (cinfo->max_h_samp_factor * DCTSIZE));
    compptr->downsampled_height = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_height *
		    (long) (compptr->v_samp_factor * compptr->DCT_scaled_size),
		    (long) (cinfo->max_v_samp_factor * DCTSIZE));
  }

#else /* !IDCT_SCALING_SUPPORTED */

  /* Hardwire it to "no scaling" */
  cinfo->output_width = cinfo->image_width;
  cinfo->output_height = cinfo->image_height;
  /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
   * and has computed unscaled downsampled_width and downsampled_height.
   */

#endif /* IDCT_SCALING_SUPPORTED */

  /* Report number of components in selected colorspace. */
  /* Probably this should be in the color conversion module... */
  switch (cinfo->out_color_space) {
  case JCS_GRAYSCALE:
    cinfo->out_color_components = 1;
    break;
  case JCS_RGB:
#if RGB_PIXELSIZE != 3
    cinfo->out_color_components = RGB_PIXELSIZE;
    break;
#endif /* else share code with YCbCr */
  case JCS_YCbCr:
    cinfo->out_color_components = 3;
    break;
  case JCS_CMYK:
  case JCS_YCCK:
    cinfo->out_color_components = 4;
    break;
  default:			/* else must be same colorspace as in file */
    cinfo->out_color_components = cinfo->num_components;
    break;
  }
  cinfo->output_components = (cinfo->quantize_colors ? 1 :
			      cinfo->out_color_components);

  /* See if upsampler will want to emit more than one row at a time */
  if (use_merged_upsample(cinfo))
    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
  else
    cinfo->rec_outbuf_height = 1;
}


/*
 * Several decompression processes need to range-limit values to the range
 * 0..MAXJSAMPLE; the input value may fall somewhat outside this range
 * due to noise introduced by quantization, roundoff error, etc.  These
 * processes are inner loops and need to be as fast as possible.  On most
 * machines, particularly CPUs with pipelines or instruction prefetch,
 * a (subscript-check-less) C table lookup
 *		x = sample_range_limit[x];
 * is faster than explicit tests
 *		if (x < 0)  x = 0;
 *		else if (x > MAXJSAMPLE)  x = MAXJSAMPLE;
 * These processes all use a common table prepared by the routine below.
 *
 * For most steps we can mathematically guarantee that the initial value
 * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
 * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient.  But for the initial
 * limiting step (just after the IDCT), a wildly out-of-range value is 
 * possible if the input data is corrupt.  To avoid any chance of indexing
 * off the end of memory and getting a bad-pointer trap, we perform the
 * post-IDCT limiting thus:
 *		x = range_limit[x & MASK];
 * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
 * samples.  Under normal circumstances this is more than enough range and
 * a correct output will be generated; with bogus input data the mask will
 * cause wraparound, and we will safely generate a bogus-but-in-range output.
 * For the post-IDCT step, we want to convert the data from signed to unsigned
 * representation by adding CENTERJSAMPLE at the same time that we limit it.
 * So the post-IDCT limiting table ends up looking like this:
 *   CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
 *   MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
 *   0          (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
 *   0,1,...,CENTERJSAMPLE-1
 * Negative inputs select values from the upper half of the table after
 * masking.
 *
 * We can save some space by overlapping the start of the post-IDCT table
 * with the simpler range limiting table.  The post-IDCT table begins at
 * sample_range_limit + CENTERJSAMPLE.
 *
 * Note that the table is allocated in near data space on PCs; it's small
 * enough and used often enough to justify this.
 */

LOCAL(void)
prepare_range_limit_table (j_decompress_ptr cinfo)
/* Allocate and fill in the sample_range_limit table */
{
  JSAMPLE * table;
  int i;

  table = (JSAMPLE *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
		(5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
  table += (MAXJSAMPLE+1);	/* allow negative subscripts of simple table */
  cinfo->sample_range_limit = table;
  /* First segment of "simple" table: limit[x] = 0 for x < 0 */
  MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
  /* Main part of "simple" table: limit[x] = x */
  for (i = 0; i <= MAXJSAMPLE; i++)
    table[i] = (JSAMPLE) i;
  table += CENTERJSAMPLE;	/* Point to where post-IDCT table starts */
  /* End of simple table, rest of first half of post-IDCT table */
  for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
    table[i] = MAXJSAMPLE;
  /* Second half of post-IDCT table */
  MEMZERO(table + (2 * (MAXJSAMPLE+1)),
	  (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91视视频在线观看入口直接观看www| 亚洲精品国产成人久久av盗摄 | 91亚洲国产成人精品一区二区三| 日本一区二区动态图| 国产传媒日韩欧美成人| 欧美激情一区二区三区在线| 国产99久久久国产精品潘金| 亚洲欧洲日韩av| 欧美日韩综合在线免费观看| 日本va欧美va欧美va精品| 精品久久久久av影院| 国产成人综合在线| 亚洲美女一区二区三区| 欧美精选一区二区| 国产一区二区主播在线| 成人欧美一区二区三区视频网页| 在线观看www91| 精品在线免费视频| 亚洲欧洲99久久| 欧美电影在哪看比较好| 国产成人一级电影| 一区二区国产视频| 久久伊99综合婷婷久久伊| 91色porny蝌蚪| 老色鬼精品视频在线观看播放| 国产精品三级电影| 欧美日本在线一区| 成人av动漫网站| 麻豆精品一区二区三区| 亚洲欧美一区二区不卡| 日韩欧美国产1| 在线免费观看日本欧美| 国产一区二区三区精品欧美日韩一区二区三区| 国产日韩欧美不卡在线| 欧美日本一道本在线视频| 懂色av中文字幕一区二区三区| 亚洲国产日韩在线一区模特| 久久精品视频免费观看| 欧美日韩亚洲丝袜制服| av一二三不卡影片| 久久www免费人成看片高清| 亚洲精品免费在线观看| 久久久久久久免费视频了| 欧美三日本三级三级在线播放| 成人免费高清在线观看| 精品一区二区免费看| 夜夜爽夜夜爽精品视频| 国产精品色在线观看| 精品国内二区三区| 91精品欧美福利在线观看| 91高清视频免费看| k8久久久一区二区三区| 国产在线一区二区| 麻豆国产精品官网| 五月天婷婷综合| 亚洲电影在线播放| 亚洲激情欧美激情| 国产精品乱码一区二三区小蝌蚪| 精品少妇一区二区三区免费观看| 欧美乱妇15p| 欧美三级韩国三级日本一级| 91国偷自产一区二区三区观看| 成人午夜在线播放| 高清视频一区二区| 懂色av一区二区三区免费看| 国产精品91一区二区| 国内精品免费**视频| 美国av一区二区| 久久99久久久久| 欧美aa在线视频| 免费欧美日韩国产三级电影| 日韩中文欧美在线| 蜜桃一区二区三区在线观看| 日本中文字幕一区二区视频| 日本午夜精品视频在线观看 | 丝袜国产日韩另类美女| 亚洲午夜免费福利视频| 亚洲狠狠爱一区二区三区| 亚洲一区在线观看网站| 亚瑟在线精品视频| 日韩成人免费在线| 激情综合一区二区三区| 国产精品亚洲成人| 成人在线一区二区三区| 91免费小视频| 欧美丝袜丝交足nylons| 欧美日韩精品欧美日韩精品一| 欧美美女激情18p| 欧美大片国产精品| 久久免费看少妇高潮| 欧美国产日韩亚洲一区| 亚洲私人黄色宅男| 亚洲一区中文日韩| 伦理电影国产精品| 国产91对白在线观看九色| 99久久99精品久久久久久| 91官网在线观看| 91精品国产欧美一区二区成人| 日韩美女天天操| 中文字幕精品在线不卡| 亚洲摸摸操操av| 奇米精品一区二区三区在线观看 | 亚洲欧美日韩中文播放| 日日骚欧美日韩| 国产乱妇无码大片在线观看| 91亚洲国产成人精品一区二区三| 欧美日韩国产免费| 精品sm在线观看| 亚洲色图19p| 日韩国产在线观看| 国产精华液一区二区三区| 欧美在线你懂的| 精品国产91久久久久久久妲己| 一区免费观看视频| 免费成人美女在线观看| 成人动漫中文字幕| 91精品国产综合久久精品图片| 国产亚洲欧美一区在线观看| 亚洲午夜一区二区三区| 国产成人在线视频免费播放| 欧美视频第二页| 欧美激情一区二区三区| 天天av天天翘天天综合网色鬼国产 | 欧美日韩成人一区| 欧美激情一区在线观看| 免费观看日韩电影| 色88888久久久久久影院按摩| 日韩欧美综合一区| 一区二区三区欧美久久| 国产美女主播视频一区| 这里是久久伊人| 一区二区三区四区在线播放| 国产精品一区二区黑丝| 91精品国产福利在线观看| 一区二区三区中文字幕精品精品| 久久精品99国产精品日本| 欧美亚洲一区二区在线观看| 日本一区二区成人在线| 麻豆精品国产传媒mv男同| 欧美综合天天夜夜久久| 国产精品免费视频观看| 国产一区在线看| 欧美成人a视频| 日本美女一区二区| 欧美日韩精品三区| 亚洲自拍偷拍综合| 色哟哟精品一区| 国产精品久久毛片| 国产高清在线观看免费不卡| 欧美sm美女调教| 日本vs亚洲vs韩国一区三区| 欧美日韩精品一区二区在线播放 | 欧美挠脚心视频网站| 亚洲午夜免费视频| 色狠狠一区二区三区香蕉| 亚洲国产高清aⅴ视频| 国产激情一区二区三区| 久久久蜜桃精品| 国内精品不卡在线| 精品成人在线观看| 精品在线一区二区| 欧美精品一区二| 韩国一区二区三区| 国产亚洲精品7777| 国产精品中文字幕日韩精品 | 国产精品久久久久毛片软件| 在线观看国产精品网站| 18欧美乱大交hd1984| 丰满白嫩尤物一区二区| 国产亚洲欧美日韩俺去了| 国产麻豆日韩欧美久久| 国产日韩视频一区二区三区| 国产99一区视频免费| 国产精品电影院| 91老司机福利 在线| 亚洲国产中文字幕| 欧美精品视频www在线观看| 日韩黄色免费电影| 欧美电影免费观看高清完整版在| 免费视频最近日韩| 国产亚洲精品aa| 色哟哟一区二区在线观看| 亚洲第一电影网| 日韩免费观看2025年上映的电影| 韩国毛片一区二区三区| 中文字幕一区免费在线观看| 91捆绑美女网站| 日产国产欧美视频一区精品| 久久亚洲综合av| hitomi一区二区三区精品| 一区二区理论电影在线观看| 欧美一区二区三区性视频| 国产一区二区主播在线| 中文字幕五月欧美| 制服丝袜av成人在线看| 国内精品久久久久影院色| 亚洲色图视频免费播放| 3atv一区二区三区| 国产精品一级在线| 一区二区三区中文字幕精品精品|