亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美性一级生活| 国产亚洲一区二区三区在线观看| 欧美二区乱c少妇| 久久综合五月天婷婷伊人| 一区二区三区在线视频观看| 国内精品第一页| 欧美影院精品一区| 国产精品久久久久久久久免费相片| 日韩电影在线一区二区三区| 一本在线高清不卡dvd| 久久日韩精品一区二区五区| 亚洲午夜久久久久久久久久久 | 欧美激情中文不卡| 欧美aaaaa成人免费观看视频| 色综合一个色综合| |精品福利一区二区三区| 五月天国产精品| 色激情天天射综合网| 国产精品乱码久久久久久| 美女尤物国产一区| 欧美一区二区三区系列电影| 一区二区三区国产| 色综合激情五月| 中文字幕一区二| 懂色av一区二区三区免费看| 26uuu色噜噜精品一区二区| 日韩电影在线一区二区三区| 欧美日韩国产一级二级| 亚洲一区二区三区精品在线| 99精品久久久久久| 成人欧美一区二区三区白人| 国产高清久久久久| 国产视频一区二区在线| 大白屁股一区二区视频| 国产精品视频在线看| 国产精品香蕉一区二区三区| 久久亚洲春色中文字幕久久久| 美女视频一区二区三区| 日韩一区二区三区电影在线观看 | 日韩精品久久理论片| 欧美日韩卡一卡二| 日韩二区三区在线观看| 日韩精品在线一区二区| 久草精品在线观看| 日本一区二区不卡视频| 成人动漫在线一区| 一区二区三区欧美日韩| 欧美日韩精品系列| 蜜桃传媒麻豆第一区在线观看| 欧美一区二区日韩一区二区| 九色综合国产一区二区三区| 精品处破学生在线二十三| 国产经典欧美精品| 国产精品伦理一区二区| 欧美亚洲自拍偷拍| 经典一区二区三区| 亚洲日本va在线观看| 欧美日韩一区三区四区| 视频一区视频二区中文| 久久综合99re88久久爱| 99久久久无码国产精品| 亚洲电影一级黄| 久久免费看少妇高潮| 91亚洲国产成人精品一区二三 | 欧美视频精品在线| 极品尤物av久久免费看| 136国产福利精品导航| 欧美日韩国产一二三| 国产精品一二三区在线| 亚洲一二三区在线观看| 久久伊人中文字幕| 在线精品视频免费播放| 国产乱对白刺激视频不卡| 一区二区视频免费在线观看| 精品国偷自产国产一区| 91麻豆精品秘密| 久久电影网站中文字幕| 亚洲视频一区二区在线| 欧美一区日本一区韩国一区| 懂色av一区二区三区免费看| 石原莉奈在线亚洲三区| 中文字幕一区二区三| 日韩精品一区二区三区三区免费| 成人爱爱电影网址| 捆绑调教美女网站视频一区| 一区二区三区四区在线播放 | 一区二区三区免费看视频| 欧美精品一区二区三区久久久| 91福利视频在线| 成人禁用看黄a在线| 国产在线视视频有精品| 亚洲成人www| 亚洲日本成人在线观看| 国产精品色在线| 久久午夜电影网| 91精品国产综合久久精品性色| 色综合天天做天天爱| 不卡一区中文字幕| 国产精品一二三区在线| 免播放器亚洲一区| 三级不卡在线观看| 亚洲网友自拍偷拍| ...av二区三区久久精品| 欧美国产一区二区| 久久久久国产精品麻豆| 精品国产sm最大网站| 欧美精品vⅰdeose4hd| 欧美吞精做爰啪啪高潮| 色8久久精品久久久久久蜜| av中文字幕不卡| av在线不卡观看免费观看| 国产精品99久久久久| 经典三级视频一区| 国产精品一二三区在线| 国产精品1区2区3区在线观看| 精品一区二区三区蜜桃| 韩国成人在线视频| 黑人巨大精品欧美一区| 国产一区三区三区| 国产一区二区免费视频| 国产精品99久| 福利视频网站一区二区三区| 国产99久久久国产精品潘金网站| 国产伦精品一区二区三区免费迷 | 日本高清成人免费播放| 99久精品国产| 在线观看中文字幕不卡| 欧美日韩1区2区| 91精品国产综合久久久久久漫画| 日韩丝袜情趣美女图片| 日韩精品一区二区三区视频| 久久久蜜桃精品| 国产精品色眯眯| 亚洲精品高清视频在线观看| 亚洲欧美日韩国产中文在线| 午夜视黄欧洲亚洲| 老司机一区二区| 成年人国产精品| 欧美三级中文字幕| 日韩欧美国产麻豆| 欧美激情资源网| 亚洲福利一区二区| 国产综合久久久久久久久久久久| 国产乱码精品一区二区三区忘忧草| 国产99久久久久| 欧美色国产精品| 精品国产乱码久久久久久牛牛 | 97久久精品人人澡人人爽| 色婷婷av一区二区三区之一色屋| 欧美日韩aaaaa| 中文字幕欧美三区| 亚洲高清中文字幕| 国产乱码精品一品二品| 精品视频全国免费看| 久久久久国产精品麻豆ai换脸 | 69堂精品视频| 久久天堂av综合合色蜜桃网| 亚洲欧美色一区| 久久99精品国产麻豆婷婷| 99久久免费精品高清特色大片| 91精品国产福利| **性色生活片久久毛片| 精品一区二区三区香蕉蜜桃| 一本色道久久综合狠狠躁的推荐 | 国产精品18久久久久久久网站| 色婷婷精品大视频在线蜜桃视频| 日韩欧美电影在线| 亚洲一区中文在线| 岛国精品在线观看| 精品sm在线观看| 午夜精品一区二区三区免费视频| 豆国产96在线|亚洲| 欧美一区二区三区精品| 一区二区国产视频| 懂色一区二区三区免费观看| 欧美成人在线直播| 视频一区二区三区入口| 在线观看视频欧美| 中文字幕在线一区| 黄色精品一二区| 日韩欧美国产系列| 男男视频亚洲欧美| 欧美精品九九99久久| 亚洲三级久久久| av高清久久久| 日本一区二区三区在线观看| 麻豆精品视频在线观看免费| 欧美日韩国产高清一区二区| 亚洲日韩欧美一区二区在线| 国产iv一区二区三区| 国产校园另类小说区| 黄色精品一二区| 精品国产乱码久久久久久夜甘婷婷 | 日韩影视精彩在线| 在线观看一区日韩| 亚洲一区二区三区四区的| 91在线免费看| 亚洲三级电影网站| 在线视频综合导航| 洋洋成人永久网站入口|