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

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

?? jdmaster.c

?? MPEG4解碼程序源代碼(能夠對各種MPEG4文件進行解碼)
?? 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一区二区三区免费野_久草精品视频
欧美美女一区二区| 成人网在线播放| 欧美亚洲高清一区| 日韩电影在线免费| 国产亚洲1区2区3区| 94-欧美-setu| 午夜久久久久久久久久一区二区| 精品久久久久99| 一本大道久久a久久综合婷婷| 日本女人一区二区三区| 日韩主播视频在线| 一区视频在线播放| 欧美精品第1页| 欧美一区午夜视频在线观看| 国产suv精品一区二区883| 视频一区视频二区在线观看| 青椒成人免费视频| 亚洲一区国产视频| 国产精品乱人伦一区二区| 久久久噜噜噜久噜久久综合| 91影院在线免费观看| 韩国女主播一区| 日本在线不卡视频| 国产一区91精品张津瑜| 五月婷婷综合网| 精品一区二区免费| 日韩精品1区2区3区| 国产乱码字幕精品高清av| 婷婷中文字幕一区三区| 久久超碰97人人做人人爱| 天堂一区二区在线| 国产精品911| 91网页版在线| 欧美一区二区三区免费大片 | 欧美群妇大交群中文字幕| 99久久免费国产| 在线综合视频播放| 欧美精品v日韩精品v韩国精品v| 欧美tickling挠脚心丨vk| 日本一区二区三区四区在线视频| 欧美极品另类videosde| 久久亚洲综合av| 久久这里只有精品首页| 一区av在线播放| 亚洲综合一区二区三区| 国产美女精品人人做人人爽| 欧美亚洲综合网| 中文字幕精品三区| 久久国产精品色| 欧美亚洲一区二区三区四区| 国产欧美一区二区三区在线老狼| 午夜亚洲国产au精品一区二区| 盗摄精品av一区二区三区| 欧美v日韩v国产v| 亚洲1区2区3区4区| 精品在线视频一区| 欧美性大战久久久久久久蜜臀 | 色视频成人在线观看免| 久久久精品国产免大香伊| 日产国产欧美视频一区精品| 91美女视频网站| 国产精品理论在线观看| 亚洲永久精品国产| 成人精品亚洲人成在线| 精品福利一区二区三区| 国产精品蜜臀在线观看| 国产乱人伦精品一区二区在线观看 | 日韩欧美一区在线观看| 精品国产电影一区二区| 天堂久久一区二区三区| 91精品国产一区二区人妖| 亚洲一线二线三线久久久| 色婷婷综合久色| 亚洲青青青在线视频| 久久se精品一区二区| 91精品婷婷国产综合久久竹菊| 亚洲国产日产av| 成人免费高清在线观看| 久久精品夜色噜噜亚洲aⅴ| 国产在线看一区| 欧美精品一区二区不卡| 久99久精品视频免费观看| 欧美成人免费网站| 久国产精品韩国三级视频| 精品粉嫩aⅴ一区二区三区四区| 麻豆国产精品一区二区三区 | 国产成人综合精品三级| 日本久久精品电影| 久久久久国产精品麻豆| 国产精品一二一区| 国产精品麻豆视频| 欧美午夜不卡视频| 日韩影院精彩在线| 2021国产精品久久精品| 成人午夜短视频| 国产精品激情偷乱一区二区∴| 99久久国产综合精品色伊| 亚洲国产你懂的| 日韩免费成人网| 亚洲成人免费av| 精品国产污污免费网站入口 | 7777精品伊人久久久大香线蕉最新版| 亚洲高清在线精品| 精品免费日韩av| 99久久99久久久精品齐齐| 亚洲18女电影在线观看| www日韩大片| 一本一道波多野结衣一区二区| 调教+趴+乳夹+国产+精品| 久久婷婷一区二区三区| 色先锋aa成人| 久99久精品视频免费观看| 亚洲欧美一区二区三区极速播放| 欧美日产在线观看| 高清不卡在线观看av| 亚洲va欧美va人人爽| 久久精品视频一区二区三区| 在线看不卡av| 一区二区三区资源| 欧美精品一区视频| 欧美伊人精品成人久久综合97| 国产在线国偷精品免费看| 亚洲激情在线播放| 欧美日韩一区视频| 奇米精品一区二区三区在线观看| 久久精品在线免费观看| 91麻豆精品国产综合久久久久久| 成人午夜看片网址| 九九视频精品免费| 亚洲国产精品天堂| 日韩久久一区二区| 欧美色精品在线视频| 成人福利视频在线看| 亚洲欧洲制服丝袜| 国产精品久久久久久亚洲毛片 | 成熟亚洲日本毛茸茸凸凹| 日本伊人色综合网| 亚洲一区二区三区小说| 国产精品久久久久久久蜜臀| 精品国产91九色蝌蚪| 日韩欧美美女一区二区三区| 欧美三电影在线| 在线一区二区三区四区五区| 国产成人精品影院| 国产一区二区精品久久91| 免费成人小视频| 日本成人在线视频网站| 天堂影院一区二区| 日韩国产欧美在线播放| 天天色综合成人网| 五月天久久比比资源色| 亚洲成av人片一区二区| 亚洲成a人片在线不卡一二三区 | 国产亚洲一区二区三区四区| 精品粉嫩aⅴ一区二区三区四区| 日韩欧美国产电影| 久久久一区二区三区| 国产午夜一区二区三区| 国产亚洲欧美在线| 中文字幕av一区二区三区高| 国产欧美日本一区视频| 国产精品免费视频一区| 亚洲欧洲国产日本综合| 亚洲视频在线观看三级| 亚洲综合无码一区二区| 亚洲第一成年网| 免费视频一区二区| 精品一区二区三区免费毛片爱 | 亚洲成人精品一区二区| 偷拍日韩校园综合在线| 美腿丝袜亚洲综合| 国产99久久久精品| 色狠狠色狠狠综合| 91精品国产品国语在线不卡| 精品国产91九色蝌蚪| 一区视频在线播放| 日韩av二区在线播放| 丰满少妇久久久久久久| 在线国产亚洲欧美| 欧美成人一区二区三区片免费| 久久久久久久久99精品| 亚洲精品菠萝久久久久久久| 免费人成精品欧美精品| 国产91富婆露脸刺激对白| 91国产成人在线| 精品国产伦理网| 亚洲精品网站在线观看| 久久 天天综合| 色88888久久久久久影院按摩 | 99久久久久久| 日韩一区二区三| 亚洲欧洲精品天堂一级| 免费高清在线视频一区·| 99久久久免费精品国产一区二区| 欧美日本一道本在线视频| 国产日韩精品视频一区| 午夜伦理一区二区| av午夜一区麻豆| 9久草视频在线视频精品| 日韩一级高清毛片|