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

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

?? jdmaster.c

?? DigitalImageProcessing_base_on_Matlab 基于Matlab的數字圖像處理
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * 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));
  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.
 * We also initialize the decompressor input side to begin consuming data.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人动漫一区二区| 欧美老女人第四色| 国产日韩高清在线| 97久久人人超碰| 亚洲午夜免费电影| 在线不卡欧美精品一区二区三区| 琪琪一区二区三区| 国产欧美日产一区| 精品视频在线免费| 国产精品一品二品| 一区二区三区中文在线| 欧美一区二区美女| 99久久久精品免费观看国产蜜| 一二三四区精品视频| 欧美成人乱码一区二区三区| 91网站在线播放| 久久91精品国产91久久小草| 国产精品色在线观看| 在线播放/欧美激情| 91福利区一区二区三区| 成人精品一区二区三区四区| 免费精品视频最新在线| 亚洲午夜精品网| 亚洲尤物视频在线| 亚洲精品乱码久久久久久| 国产亚洲一二三区| 精品国产乱码久久久久久老虎| 在线观看亚洲专区| 色综合天天综合给合国产| 精品一区二区三区视频在线观看| 亚洲国产一区二区视频| 亚洲精品伦理在线| 亚洲人午夜精品天堂一二香蕉| 久久久综合网站| 日本一二三不卡| 亚洲日穴在线视频| 亚洲一区二区三区影院| 成人免费在线观看入口| 精品日韩在线观看| 久久久99精品免费观看不卡| 日韩精品一区二区三区视频在线观看| 91黄色免费观看| 欧美高清你懂得| 国产区在线观看成人精品| 欧美韩国日本一区| 亚洲成在线观看| 精品写真视频在线观看| 国产 欧美在线| 欧美视频一区二区| 久久婷婷国产综合国色天香| 亚洲人xxxx| 另类的小说在线视频另类成人小视频在线 | 日本免费在线视频不卡一不卡二| 免费在线观看成人| 99久久精品一区| 精品乱人伦一区二区三区| 中文字幕一区二区三区精华液 | 日韩精品一区二区三区在线观看| 欧美α欧美αv大片| 一区二区在线观看视频| 人人狠狠综合久久亚洲| 91美女视频网站| 久久久亚洲国产美女国产盗摄| 亚洲国产视频一区| 99国产精品一区| 国产精品久久久久一区| 韩国精品主播一区二区在线观看| 欧美色精品在线视频| 国产精品久久久久久亚洲伦| 韩国v欧美v日本v亚洲v| 欧美日韩你懂的| 午夜精品久久久久久不卡8050| 91网站在线观看视频| 亚洲欧美日韩小说| 91亚洲精华国产精华精华液| 国产欧美精品一区aⅴ影院| 国内成人精品2018免费看| 日韩欧美aaaaaa| 国产69精品久久久久毛片| 国产亚洲综合色| 成人免费视频免费观看| 国产精品三级电影| 色老汉一区二区三区| 亚洲成av人片一区二区| 欧美一区二区三区免费大片| 蜜乳av一区二区| 中文字幕久久午夜不卡| 欧美亚洲动漫另类| 激情伊人五月天久久综合| 国产午夜精品理论片a级大结局| 成人精品电影在线观看| 亚洲午夜三级在线| 国产亚洲成av人在线观看导航| 97久久久精品综合88久久| 亚洲1区2区3区4区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 丁香五精品蜜臀久久久久99网站| 亚洲欧美另类图片小说| 精品久久久久久久一区二区蜜臀| 成人午夜短视频| 精品午夜一区二区三区在线观看| 亚洲制服丝袜av| 国产精品美女久久久久av爽李琼| 精品视频1区2区3区| 国产精品一品二品| 久久se精品一区精品二区| 偷拍自拍另类欧美| 亚洲欧美另类在线| 亚洲婷婷综合久久一本伊一区| 欧美成人官网二区| 欧美成人性福生活免费看| 日本高清免费不卡视频| 91在线小视频| 91在线播放网址| 色悠悠亚洲一区二区| 成人精品视频网站| 国产成人夜色高潮福利影视| 免费观看在线综合| 奇米777欧美一区二区| 捆绑紧缚一区二区三区视频| 麻豆精品视频在线观看| 理论片日本一区| 成人午夜精品在线| 99国产精品久| 欧美丰满嫩嫩电影| 精品剧情v国产在线观看在线| 精品动漫一区二区三区在线观看| 欧美大胆一级视频| 亚洲视频1区2区| 日韩影院精彩在线| 国产精品亚洲一区二区三区在线| caoporn国产精品| 欧美人妖巨大在线| 国产欧美日韩麻豆91| 亚洲午夜精品在线| 国产一区不卡精品| 日韩一区二区免费高清| 亚洲欧洲日产国产综合网| 美女视频黄久久| 欧美在线短视频| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 成人性生交大片免费 | 精品成人一区二区三区四区| 国产精品久久影院| 国产激情一区二区三区桃花岛亚洲| 不卡的av在线| 久久只精品国产| 欧美a一区二区| 精品视频在线免费| 亚洲激情自拍视频| 99久久er热在这里只有精品15 | 日韩欧美视频一区| 日韩中文字幕不卡| 欧美喷潮久久久xxxxx| 日韩国产精品大片| 欧美久久一区二区| 日本中文字幕一区| 56国语精品自产拍在线观看| 亚洲国产日日夜夜| 欧美精选在线播放| 一区二区三区欧美日| 欧美性猛交xxxx黑人交| 国产精品家庭影院| 日本久久电影网| 亚洲成人久久影院| 欧美大片国产精品| 国产成人在线看| 亚洲中国最大av网站| 欧美肥妇bbw| 91亚洲精品乱码久久久久久蜜桃| 一区二区三区高清不卡| 欧美精品在欧美一区二区少妇| 美女一区二区久久| 国产精品五月天| 欧美日产在线观看| 国产一区 二区 三区一级| 一区二区三区四区在线| 欧美日韩国产经典色站一区二区三区| 日韩专区在线视频| 国产精品美女久久久久久2018 | 精品夜夜嗨av一区二区三区| 国产精品色哟哟| 日韩一区二区三区在线视频| 成人一区二区三区视频在线观看| 亚洲一区二区三区美女| 国产欧美日韩视频一区二区| 欧美特级限制片免费在线观看| 国产乱码精品1区2区3区| 日韩影视精彩在线| 亚洲国产另类精品专区| 综合久久给合久久狠狠狠97色 | 国产精品热久久久久夜色精品三区| 欧洲在线/亚洲| 色丁香久综合在线久综合在线观看| 久久国内精品自在自线400部| 亚洲成av人影院在线观看网| 亚洲欧美激情在线| 亚洲永久精品大片| 亚洲图片欧美一区| 日韩 欧美一区二区三区|