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

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

?? jdmaster.c

?? JPEG source code converts the image into compressed format
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * jdmaster.c
 *
 * Copyright (C) 1991-1997, 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 */
{
#ifdef IDCT_SCALING_SUPPORTED
  int ci;
  jpeg_component_info *compptr;
#endif

  /* 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));
  MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
	  cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
}


/*
 * Master selection of decompression modules.
 * This is done once at jpeg_start_decompress time.  We determine
 * which modules will be used and give them appropriate initialization calls.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天综合网天天看片| 国产+成+人+亚洲欧洲自线| 欧美在线免费视屏| 亚洲成人激情社区| 欧美色大人视频| 日韩1区2区日韩1区2区| 日韩精品一区二| 成人久久18免费网站麻豆 | 精品免费国产二区三区| 精品在线播放免费| 国产精品热久久久久夜色精品三区| 成人免费毛片a| 一区二区三区视频在线看| 欧美猛男gaygay网站| 免费高清成人在线| 亚洲国产精华液网站w| 91视视频在线直接观看在线看网页在线看| 日韩毛片在线免费观看| 在线91免费看| 国产成人一级电影| 亚洲一区二区三区中文字幕 | 秋霞成人午夜伦在线观看| 91精品国产欧美日韩| 国产成人精品免费网站| 亚洲成人在线免费| 亚洲国产精品精华液ab| 欧美亚州韩日在线看免费版国语版| 美国十次综合导航| 亚洲欧洲日韩综合一区二区| 欧美精品久久一区| 9色porny自拍视频一区二区| 日韩高清一区二区| 亚洲另类色综合网站| 精品日本一线二线三线不卡| 色哟哟一区二区在线观看| 黄色日韩网站视频| 亚洲sss视频在线视频| 久久九九全国免费| 欧美精品丝袜久久久中文字幕| 东方欧美亚洲色图在线| 久久精品国产在热久久| 亚洲激情综合网| 亚洲国产精品精华液2区45| 日韩三级伦理片妻子的秘密按摩| 一本大道久久a久久精品综合| 韩国av一区二区| 日韩高清欧美激情| 亚洲综合无码一区二区| 国产精品第一页第二页第三页| 日韩欧美久久久| 欧美日韩一区二区三区四区| 99久久伊人网影院| 国产成a人无v码亚洲福利| 日本vs亚洲vs韩国一区三区二区| 亚洲人吸女人奶水| 国产精品免费视频一区| 久久久久国产精品麻豆ai换脸| 欧美一区二区三区性视频| 在线视频综合导航| 色偷偷成人一区二区三区91| 高清视频一区二区| 国产精品一二二区| 国产乱一区二区| 国内外成人在线| 捆绑紧缚一区二区三区视频| 天堂一区二区在线| 午夜激情久久久| 午夜电影网一区| 天天亚洲美女在线视频| 亚洲大片免费看| 偷窥少妇高潮呻吟av久久免费| 一区二区三区在线不卡| 亚洲精品成人少妇| 亚洲精品国久久99热| 亚洲免费色视频| 亚洲已满18点击进入久久| 一区二区三区欧美久久| 一区二区三区四区乱视频| 亚洲精品中文在线观看| 一区二区三区久久久| 亚洲一区二区视频在线| 午夜天堂影视香蕉久久| 日韩精品一二三四| 男人的天堂久久精品| 激情欧美一区二区三区在线观看| 狠狠色综合日日| 国产成人免费视频精品含羞草妖精 | 国产激情视频一区二区在线观看| 国产精品一区二区果冻传媒| 成人国产亚洲欧美成人综合网| 成人不卡免费av| 欧美视频第二页| 欧美一区二区三区播放老司机| 久久伊人中文字幕| 国产精品久久久久久久久图文区| 亚洲视频免费看| 亚洲高清视频中文字幕| 久久99久久99| 国产a区久久久| 欧美亚州韩日在线看免费版国语版| 欧美一区二区三区视频在线| 精品av综合导航| 亚洲欧美另类综合偷拍| 亚洲成人av电影在线| 久久99精品国产麻豆婷婷| 成人午夜av影视| 欧美性一区二区| 欧美精品一区二区在线播放| 中文字幕一区二区5566日韩| 天天色天天操综合| 国产成人高清在线| 欧美日韩精品一区二区三区四区| 精品久久国产老人久久综合| 最新日韩av在线| 久久精品国产网站| 91丨九色丨国产丨porny| 欧美高清视频一二三区| 国产精品久久久久久久岛一牛影视 | 国产日产欧美一区| 午夜精品久久久久久不卡8050| 国产一区二区三区最好精华液| 91免费观看在线| 欧美一区二区啪啪| 中文字幕日韩一区| 麻豆精品新av中文字幕| 91老师片黄在线观看| 精品国产免费人成电影在线观看四季| 亚洲日本免费电影| 国产精品亚洲一区二区三区妖精| 欧美视频在线一区二区三区| 国产午夜精品福利| 午夜精品一区二区三区免费视频| 粉嫩一区二区三区在线看| 8x福利精品第一导航| 亚洲精品欧美在线| 成人久久视频在线观看| 精品国产91九色蝌蚪| 亚洲成人av免费| 91国偷自产一区二区三区观看| wwww国产精品欧美| 日本亚洲欧美天堂免费| 在线观看av一区| 自拍偷拍国产精品| 国产东北露脸精品视频| 日韩欧美一级二级三级| 视频一区二区国产| 欧美中文字幕亚洲一区二区va在线| 亚洲国产精品高清| 国产在线精品国自产拍免费| 日韩午夜在线影院| 午夜日韩在线电影| 欧美撒尿777hd撒尿| 一区二区免费看| 色综合久久中文字幕| 综合网在线视频| zzijzzij亚洲日本少妇熟睡| 国产人久久人人人人爽| 国产99久久久国产精品潘金网站| 26uuu国产在线精品一区二区| 免费人成精品欧美精品| 欧美一级欧美一级在线播放| 亚洲大尺度视频在线观看| 欧美性做爰猛烈叫床潮| 亚洲成人免费视频| 在线成人高清不卡| 视频一区在线视频| 日韩视频在线永久播放| 精品伊人久久久久7777人| 日韩一区二区三区视频在线 | 国产精品一级二级三级| 国产亚洲一二三区| 丁香激情综合五月| 中文字幕佐山爱一区二区免费| 91蝌蚪porny| 亚洲在线视频一区| 3atv在线一区二区三区| 久久精品国产77777蜜臀| 日韩欧美一区二区三区在线| 久久爱www久久做| 国产日产欧产精品推荐色| aa级大片欧美| 亚洲永久免费视频| 日韩一区二区免费在线观看| 极品少妇一区二区三区精品视频 | 精品国产伦一区二区三区免费| 国产精品自在在线| 国产精品青草久久| 色综合久久88色综合天天免费| 一区二区免费在线| 日韩视频不卡中文| 成人午夜视频在线| 亚洲一区二区三区四区在线免费观看 | 亚洲精品一区在线观看| 大尺度一区二区| 亚洲最大成人综合| 精品久久久久久久一区二区蜜臀| 国产盗摄女厕一区二区三区| 亚洲欧美一区二区不卡| 制服.丝袜.亚洲.中文.综合| 国产福利一区二区三区在线视频|