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

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

?? jdhuff.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.
//
////////////////////////////////////////////////////////////////////////

/*
 * jdhuff.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 Huffman entropy decoding routines.
 *
 * Much of the complexity here has to do with supporting input suspension.
 * If the data source module demands suspension, we want to be able to back
 * up to the start of the current MCU.  To do this, we copy state variables
 * into local working storage, and update them back to the permanent
 * storage only upon successful completion of an MCU.
 */

#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jdhuff.h"		/* Declarations shared with jdphuff.c */


/*
 * Expanded entropy decoder object for Huffman decoding.
 *
 * The savable_state subrecord contains fields that change within an MCU,
 * but must not be updated permanently until we complete the MCU.
 */

typedef struct {
  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
} savable_state;

/* This macro is to work around compilers with missing or broken
 * structure assignment.  You'll need to fix this code if you have
 * such a compiler and you change MAX_COMPS_IN_SCAN.
 */

#ifndef NO_STRUCT_ASSIGN
#define ASSIGN_STATE(dest,src)  ((dest) = (src))
#else
#if MAX_COMPS_IN_SCAN == 4
#define ASSIGN_STATE(dest,src)  \
	((dest).last_dc_val[0] = (src).last_dc_val[0], \
	 (dest).last_dc_val[1] = (src).last_dc_val[1], \
	 (dest).last_dc_val[2] = (src).last_dc_val[2], \
	 (dest).last_dc_val[3] = (src).last_dc_val[3])
#endif
#endif


typedef struct {
  struct jpeg_entropy_decoder pub; /* public fields */

  /* These fields are loaded into local variables at start of each MCU.
   * In case of suspension, we exit WITHOUT updating them.
   */
  bitread_perm_state bitstate;	/* Bit buffer at start of MCU */
  savable_state saved;		/* Other state at start of MCU */

  /* These fields are NOT loaded into local working state. */
  unsigned int restarts_to_go;	/* MCUs left in this restart interval */

  /* Pointers to derived tables (these workspaces have image lifespan) */
  d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
  d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
} huff_entropy_decoder;

typedef huff_entropy_decoder * huff_entropy_ptr;


/*
 * Initialize for a Huffman-compressed scan.
 */

METHODDEF(void)
start_pass_huff_decoder (j_decompress_ptr cinfo)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  int ci, dctbl, actbl;
  jpeg_component_info * compptr;

  /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
   * This ought to be an error condition, but we make it a warning because
   * there are some baseline files out there with all zeroes in these bytes.
   */
  if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 ||
      cinfo->Ah != 0 || cinfo->Al != 0)
    WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);

  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
    compptr = cinfo->cur_comp_info[ci];
    dctbl = compptr->dc_tbl_no;
    actbl = compptr->ac_tbl_no;
    /* Make sure requested tables are present */
    if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS ||
	cinfo->dc_huff_tbl_ptrs[dctbl] == NULL)
      ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);
    if (actbl < 0 || actbl >= NUM_HUFF_TBLS ||
	cinfo->ac_huff_tbl_ptrs[actbl] == NULL)
      ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);
    /* Compute derived values for Huffman tables */
    /* We may do this more than once for a table, but it's not expensive */
    jpeg_make_d_derived_tbl(cinfo, cinfo->dc_huff_tbl_ptrs[dctbl],
			    & entropy->dc_derived_tbls[dctbl]);
    jpeg_make_d_derived_tbl(cinfo, cinfo->ac_huff_tbl_ptrs[actbl],
			    & entropy->ac_derived_tbls[actbl]);
    /* Initialize DC predictions to 0 */
    entropy->saved.last_dc_val[ci] = 0;
  }

  /* Initialize bitread state variables */
  entropy->bitstate.bits_left = 0;
  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
  entropy->bitstate.printed_eod = FALSE;

  /* Initialize restart counter */
  entropy->restarts_to_go = cinfo->restart_interval;
}


/*
 * Compute the derived values for a Huffman table.
 * Note this is also used by jdphuff.c.
 */

GLOBAL(void)
jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, JHUFF_TBL * htbl,
			 d_derived_tbl ** pdtbl)
{
  d_derived_tbl *dtbl;
  int p, i, l, si;
  int lookbits, ctr;
  char huffsize[257];
  unsigned int huffcode[257];
  unsigned int code;

  /* Allocate a workspace if we haven't already done so. */
  if (*pdtbl == NULL)
    *pdtbl = (d_derived_tbl *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  SIZEOF(d_derived_tbl));
  dtbl = *pdtbl;
  dtbl->pub = htbl;		/* fill in back link */
  
  /* Figure C.1: make table of Huffman code length for each symbol */
  /* Note that this is in code-length order. */

  p = 0;
  for (l = 1; l <= 16; l++) {
    for (i = 1; i <= (int) htbl->bits[l]; i++)
      huffsize[p++] = (char) l;
  }
  huffsize[p] = 0;
  
  /* Figure C.2: generate the codes themselves */
  /* Note that this is in code-length order. */
  
  code = 0;
  si = huffsize[0];
  p = 0;
  while (huffsize[p]) {
    while (((int) huffsize[p]) == si) {
      huffcode[p++] = code;
      code++;
    }
    code <<= 1;
    si++;
  }

  /* Figure F.15: generate decoding tables for bit-sequential decoding */

  p = 0;
  for (l = 1; l <= 16; l++) {
    if (htbl->bits[l]) {
      dtbl->valptr[l] = p; /* huffval[] index of 1st symbol of code length l */
      dtbl->mincode[l] = huffcode[p]; /* minimum code of length l */
      p += htbl->bits[l];
      dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */
    } else {
      dtbl->maxcode[l] = -1;	/* -1 if no codes of this length */
    }
  }
  dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */

  /* Compute lookahead tables to speed up decoding.
   * First we set all the table entries to 0, indicating "too long";
   * then we iterate through the Huffman codes that are short enough and
   * fill in all the entries that correspond to bit sequences starting
   * with that code.
   */

  MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));

  p = 0;
  for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
    for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {
      /* l = current code's length, p = its index in huffcode[] & huffval[]. */
      /* Generate left-justified code followed by all possible bit sequences */
      lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
      for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
	dtbl->look_nbits[lookbits] = l;
	dtbl->look_sym[lookbits] = htbl->huffval[p];
	lookbits++;
      }
    }
  }
}


/*
 * Out-of-line code for bit fetching (shared with jdphuff.c).
 * See jdhuff.h for info about usage.
 * Note: current values of get_buffer and bits_left are passed as parameters,
 * but are returned in the corresponding fields of the state struct.
 *
 * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width
 * of get_buffer to be used.  (On machines with wider words, an even larger
 * buffer could be used.)  However, on some machines 32-bit shifts are
 * quite slow and take time proportional to the number of places shifted.
 * (This is true with most PC compilers, for instance.)  In this case it may
 * be a win to set MIN_GET_BITS to the minimum value of 15.  This reduces the
 * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.
 */

#ifdef SLOW_SHIFT_32
#define MIN_GET_BITS  15	/* minimum allowable value */
#else
#define MIN_GET_BITS  (BIT_BUF_SIZE-7)
#endif


GLOBAL(boolean)
jpeg_fill_bit_buffer (bitread_working_state * state,
		      register bit_buf_type get_buffer, register int bits_left,
		      int nbits)
/* Load up the bit buffer to a depth of at least nbits */
{
  /* Copy heavily used state fields into locals (hopefully registers) */
  register const JOCTET * next_input_byte = state->next_input_byte;
  register size_t bytes_in_buffer = state->bytes_in_buffer;
  register int c;

  /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
  /* (It is assumed that no request will be for more than that many bits.) */

  while (bits_left < MIN_GET_BITS) {
    /* Attempt to read a byte */
    if (state->unread_marker != 0)
      goto no_more_data;	/* can't advance past a marker */

    if (bytes_in_buffer == 0) {
      if (! (*state->cinfo->src->fill_input_buffer) (state->cinfo))
	return FALSE;
      next_input_byte = state->cinfo->src->next_input_byte;
      bytes_in_buffer = state->cinfo->src->bytes_in_buffer;
    }
    bytes_in_buffer--;
    c = GETJOCTET(*next_input_byte++);

    /* If it's 0xFF, check and discard stuffed zero byte */
    if (c == 0xFF) {
      do {
	if (bytes_in_buffer == 0) {
	  if (! (*state->cinfo->src->fill_input_buffer) (state->cinfo))
	    return FALSE;
	  next_input_byte = state->cinfo->src->next_input_byte;
	  bytes_in_buffer = state->cinfo->src->bytes_in_buffer;
	}
	bytes_in_buffer--;
	c = GETJOCTET(*next_input_byte++);
      } while (c == 0xFF);

      if (c == 0) {
	/* Found FF/00, which represents an FF data byte */
	c = 0xFF;
      } else {
	/* Oops, it's actually a marker indicating end of compressed data. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
7777女厕盗摄久久久| 337p粉嫩大胆噜噜噜噜噜91av | 亚洲午夜激情网站| 日本人妖一区二区| 91美女片黄在线观看| 日韩欧美国产精品| 亚洲午夜成aⅴ人片| bt7086福利一区国产| 精品日韩成人av| 日日噜噜夜夜狠狠视频欧美人| 成人app下载| 欧美精品一区二区久久久| 亚洲国产精品欧美一二99| 午夜激情久久久| 在线视频你懂得一区二区三区| 国产日产欧美一区二区视频| 美女网站一区二区| 欧美日韩成人一区| 亚洲sss视频在线视频| 91麻豆国产精品久久| 国产精品久久久久久久久动漫 | 国产精品国产三级国产aⅴ入口| 日韩av高清在线观看| 欧洲精品一区二区| 亚洲精品国产品国语在线app| 岛国精品在线观看| 国产欧美日产一区| 成人免费观看视频| 久久久99精品免费观看不卡| 国产一区二区三区视频在线播放| 日韩欧美一二区| 韩日av一区二区| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美在线观看视频一区二区三区| 国产精品美女久久久久久久| 国产激情一区二区三区| 国产欧美精品国产国产专区| 国产不卡视频在线观看| 亚洲国产高清不卡| 成人精品在线视频观看| 国产精品伦理在线| 在线影视一区二区三区| 亚洲福利视频一区| 日韩欧美国产高清| 丁香网亚洲国际| 亚洲婷婷在线视频| 欧美猛男男办公室激情| 免费在线观看不卡| 久久精子c满五个校花| av电影一区二区| 一区二区三区中文字幕电影| 欧美日韩激情一区二区三区| 奇米影视7777精品一区二区| 久久蜜桃香蕉精品一区二区三区| www.欧美日韩国产在线| 一区二区激情小说| 欧美一卡2卡三卡4卡5免费| 精品亚洲aⅴ乱码一区二区三区| 久久九九久精品国产免费直播| 91丨九色丨尤物| 首页国产欧美日韩丝袜| 国产欧美一区二区三区沐欲| 日本道精品一区二区三区| 日韩在线观看一区二区| 国产午夜久久久久| 欧美色倩网站大全免费| 国模冰冰炮一区二区| 亚洲综合小说图片| 久久久av毛片精品| 欧美性感一类影片在线播放| 国产一区美女在线| 亚洲自拍偷拍麻豆| 久久久久9999亚洲精品| 欧美视频一区二区三区在线观看| 经典三级视频一区| 一级特黄大欧美久久久| 国产亚洲午夜高清国产拍精品| 在线观看视频一区| 国产一区二区视频在线| 亚洲成av人综合在线观看| 国产欧美一区二区精品性色超碰| 欧美日韩一区在线| 成人av电影在线网| 另类综合日韩欧美亚洲| 亚洲一区二区视频在线| 欧美国产精品一区二区| 日韩限制级电影在线观看| 欧美性极品少妇| 色94色欧美sute亚洲线路二| 欧美乱熟臀69xxxxxx| 国产成人啪免费观看软件| 久久国内精品视频| 亚洲成人中文在线| 亚洲综合小说图片| 亚洲三级电影全部在线观看高清| 2020国产成人综合网| 日韩午夜精品电影| 欧美精品粉嫩高潮一区二区| 在线观看成人小视频| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品综合网| 麻豆91在线播放| 日韩和欧美一区二区三区| 亚洲免费观看高清完整版在线 | 国产成人在线视频免费播放| 裸体在线国模精品偷拍| 亚洲国产日韩精品| 亚洲精品成a人| 亚洲理论在线观看| 一区二区三区在线观看网站| 国产精品精品国产色婷婷| 中文无字幕一区二区三区| 久久综合久久鬼色| 国产欧美日韩精品一区| 日本一区二区三区免费乱视频| 精品国内二区三区| 日韩欧美国产系列| 精品国产制服丝袜高跟| 久久综合九色综合97婷婷| 久久亚洲春色中文字幕久久久| 精品av综合导航| 久久午夜电影网| 国产日韩欧美精品电影三级在线 | 粉嫩av一区二区三区粉嫩| 国产一区二区三区四区五区美女 | 美女被吸乳得到大胸91| 成人v精品蜜桃久久一区| 99免费精品视频| 91麻豆自制传媒国产之光| 色综合激情五月| 91麻豆精品国产91久久久资源速度| 欧美精品在线观看播放| 欧美成人性战久久| 国产精品午夜春色av| 国产精品久久久久久久久快鸭| 一区二区三区精品视频在线| 亚洲h在线观看| 久久成人免费电影| 粉嫩嫩av羞羞动漫久久久| 色八戒一区二区三区| 欧美人体做爰大胆视频| 久久亚洲精品小早川怜子| 《视频一区视频二区| 亚洲成人自拍偷拍| 国产美女精品在线| 91福利视频在线| 日韩一区二区免费电影| 国产欧美精品一区二区三区四区| 一区二区三区四区激情| 麻豆精品国产传媒mv男同| 99国产精品一区| 日韩欧美一级在线播放| 国产精品短视频| 免费成人在线视频观看| av一区二区三区在线| 日韩一区二区在线播放| 中文字幕 久热精品 视频在线| 午夜不卡av免费| 成人天堂资源www在线| 欧美日韩成人在线| 136国产福利精品导航| 免费在线观看日韩欧美| 91久久国产综合久久| 久久亚洲一区二区三区四区| 亚洲乱码中文字幕综合| 国产一级精品在线| 欧美久久久久久蜜桃| 国产精品视频在线看| 麻豆国产欧美一区二区三区| 欧美亚日韩国产aⅴ精品中极品| 欧美mv和日韩mv国产网站| 亚洲精品国产无天堂网2021| 丁香婷婷深情五月亚洲| 日韩三级精品电影久久久| 夜夜嗨av一区二区三区网页| 国产成人一区在线| 亚洲精品在线电影| 亚洲成人一二三| 日本丶国产丶欧美色综合| 国产精品免费视频网站| 久久国产精品色| 91精品国产入口| 一区二区三区丝袜| 97se狠狠狠综合亚洲狠狠| 久久国产尿小便嘘嘘| www国产精品av| 成人一道本在线| 秋霞影院一区二区| 日韩一区欧美小说| 欧美裸体一区二区三区| 久久99九九99精品| 久久久青草青青国产亚洲免观| 国产麻豆9l精品三级站| 亚洲精品乱码久久久久久| 日韩免费高清电影| 欧美视频你懂的| 99久久国产综合色|国产精品| 久久国产精品99久久人人澡| 亚洲精品成人a在线观看| 国产精品高潮呻吟|