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

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

?? jdmaster.c

?? JPEG壓縮解壓縮源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
////////////////////////////////////////////////////////////////////////
//
//	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));

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
xnxx国产精品| 91麻豆免费看| 国产日韩av一区| 国产麻豆精品95视频| 久久五月婷婷丁香社区| 国产一区二区免费视频| 久久新电视剧免费观看| 国产99久久精品| 亚洲欧洲日韩av| 欧美日韩一卡二卡| 国产一区二区看久久| 亚洲欧洲一区二区三区| 欧美日韩国产免费一区二区| 免费成人你懂的| 国产清纯美女被跳蛋高潮一区二区久久w| 裸体健美xxxx欧美裸体表演| 精品国产1区二区| av男人天堂一区| 欧美aⅴ一区二区三区视频| 欧美国产综合色视频| 欧美欧美欧美欧美首页| 欧美不卡一区二区三区| 92国产精品观看| 精一区二区三区| 午夜精品福利在线| 亚洲视频一二三区| 久久夜色精品国产噜噜av| 欧美日韩亚洲综合在线| 懂色av一区二区三区免费观看| 一区二区成人在线| 中文字幕在线不卡一区 | 国产寡妇亲子伦一区二区| 亚洲乱码日产精品bd| 精品日本一线二线三线不卡| 色狠狠综合天天综合综合| 国产激情一区二区三区四区| 蜜桃在线一区二区三区| 五月天久久比比资源色| 亚洲精品免费在线| 亚洲日本护士毛茸茸| 中文字幕亚洲视频| 国产色婷婷亚洲99精品小说| 欧美草草影院在线视频| 欧美一区二区三区免费视频| 欧美日韩精品欧美日韩精品一| 97精品电影院| 92国产精品观看| 99视频国产精品| 99视频在线精品| 91性感美女视频| 欧美网站大全在线观看| 欧美日韩一区视频| 在线播放91灌醉迷j高跟美女 | 国产精品99久久久久久宅男| 国模冰冰炮一区二区| 丁香桃色午夜亚洲一区二区三区| av中文字幕在线不卡| 一本一道综合狠狠老| 欧美日韩精品一区二区天天拍小说| 欧美视频第二页| 日韩精品一区二区三区swag| 久久久久久9999| 日韩伦理电影网| 日韩中文字幕区一区有砖一区 | 日韩二区在线观看| 国产老女人精品毛片久久| 91黄色激情网站| 日韩午夜电影av| 亚洲免费伊人电影| 国产在线国偷精品产拍免费yy| 色视频一区二区| 久久精品亚洲一区二区三区浴池 | 亚洲婷婷综合久久一本伊一区| 婷婷开心久久网| 不卡av电影在线播放| 日韩一区二区三区精品视频| 国产精品视频免费| 欧美bbbbb| 欧美日韩精品一区二区在线播放| 国产肉丝袜一区二区| 日产精品久久久久久久性色| 成人黄色软件下载| 欧美激情一区三区| 蜜臀国产一区二区三区在线播放| av高清不卡在线| 精品免费视频.| 日本欧美肥老太交大片| 欧美午夜精品一区| 亚洲成人一区二区| 欧美日韩精品一区二区三区四区 | 国产精品久久久久久妇女6080| 蜜桃视频一区二区| 日韩欧美国产成人一区二区| 亚洲va欧美va人人爽午夜| 91黄视频在线| 亚洲午夜日本在线观看| 在线亚洲高清视频| 亚洲电影欧美电影有声小说| 欧美三电影在线| 麻豆久久一区二区| 久久久美女毛片| 99久免费精品视频在线观看 | 久久综合色播五月| 成人污视频在线观看| 国产精品污网站| 欧美色欧美亚洲另类二区| 肉肉av福利一精品导航| 国产亚洲自拍一区| 91农村精品一区二区在线| 亚洲福利视频导航| 久久久久久久久99精品| 色综合久久久久综合体| 亚洲444eee在线观看| 久久色在线视频| 欧美中文字幕一区二区三区 | 一区二区三区国产精品| 欧美一区二区三区四区久久| 国产精品亚洲视频| 亚洲成av人片一区二区| 国产欧美日韩精品一区| 欧美性猛交xxxx乱大交退制版| 精品一区二区免费| 亚洲国产精品人人做人人爽| 精品91自产拍在线观看一区| 91亚洲国产成人精品一区二三| 国模一区二区三区白浆 | 国产精品丝袜91| 欧美一二区视频| 精品1区2区3区| 91小视频在线免费看| 国产一区二区三区四| 青青草伊人久久| 午夜电影一区二区| 亚洲视频免费观看| 中文一区二区完整视频在线观看| 日韩欧美国产高清| 欧美疯狂性受xxxxx喷水图片| 91免费在线看| 色综合天天综合狠狠| av在线不卡免费看| 91麻豆6部合集magnet| 91视频国产观看| 91丨porny丨首页| 色老汉av一区二区三区| 91丨porny丨国产| 色94色欧美sute亚洲13| 欧洲另类一二三四区| 欧美色成人综合| 日韩一区二区精品| 国产精品久久三区| 国产精品不卡在线| 中文字幕佐山爱一区二区免费| 亚洲男人的天堂在线观看| 亚洲精品久久7777| 日韩不卡一区二区三区| 激情丁香综合五月| 不卡av在线免费观看| 欧美色手机在线观看| 欧美videossexotv100| 久久久久久久久久久久电影 | 亚洲人成网站精品片在线观看| 亚洲精品免费一二三区| 日本不卡高清视频| 成人网在线播放| 欧美日韩免费电影| 国产亚洲一区二区三区| 亚洲成人动漫一区| 成人一二三区视频| 欧美日韩一区成人| 中文字幕中文在线不卡住| 日韩精品免费专区| 一本一本久久a久久精品综合麻豆| 国产精品国产三级国产aⅴ入口| 亚洲国产成人高清精品| 白白色 亚洲乱淫| 欧美videossexotv100| 亚洲综合色区另类av| 懂色av一区二区夜夜嗨| 精品日韩在线观看| 天堂av在线一区| 欧美在线综合视频| 亚洲欧美怡红院| 国产成人综合网| 久久久精品免费免费| 麻豆高清免费国产一区| 日韩一区二区免费电影| 五月婷婷久久综合| 欧美亚洲国产一区二区三区 | 久久久久88色偷偷免费| 九色|91porny| 国产喷白浆一区二区三区| 国产裸体歌舞团一区二区| 精品国产乱码久久久久久免费 | 极品少妇一区二区| 日韩欧美国产一区二区三区 | 亚洲视频电影在线| 欧美亚洲高清一区二区三区不卡| 日韩理论片一区二区| 欧美日韩一级黄| 精品一区二区三区在线观看|