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

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

?? jdhuff.c

?? Evc編的一個(gè)在wince5.0上運(yùn)行的flash播放器
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
 * jdhuff.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 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];

  /* Precalculated info set up by start_pass for use in decode_mcu: */

  /* Pointers to derived tables to be used for each block within an MCU */
  d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];
  d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];
  /* Whether we care about the DC and AC coefficient values for each block */
  boolean dc_needed[D_MAX_BLOCKS_IN_MCU];
  boolean ac_needed[D_MAX_BLOCKS_IN_MCU];
} 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, blkn, 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;
    /* 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, TRUE, dctbl,
			    & entropy->dc_derived_tbls[dctbl]);
    jpeg_make_d_derived_tbl(cinfo, FALSE, actbl,
			    & entropy->ac_derived_tbls[actbl]);
    /* Initialize DC predictions to 0 */
    entropy->saved.last_dc_val[ci] = 0;
  }

  /* Precalculate decoding info for each block in an MCU of this scan */
  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
    ci = cinfo->MCU_membership[blkn];
    compptr = cinfo->cur_comp_info[ci];
    /* Precalculate which table to use for each block */
    entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
    entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
    /* Decide whether we really care about the coefficient values */
    if (compptr->component_needed) {
      entropy->dc_needed[blkn] = TRUE;
      /* we don't need the ACs if producing a 1/8th-size image */
      entropy->ac_needed[blkn] = (compptr->DCT_scaled_size > 1);
    } else {
      entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;
    }
  }

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

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


/*
 * Compute the derived values for a Huffman table.
 * This routine also performs some validation checks on the table.
 *
 * Note this is also used by jdphuff.c.
 */

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

  /* Note that huffsize[] and huffcode[] are filled in code-length order,
   * paralleling the order of the symbols themselves in htbl->huffval[].
   */

  /* Find the input Huffman table */
  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
  htbl =
    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
  if (htbl == NULL)
    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);

  /* 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 */

  p = 0;
  for (l = 1; l <= 16; l++) {
    i = (int) htbl->bits[l];
    if (i < 0 || p + i > 256)	/* protect against table overrun */
      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
    while (i--)
      huffsize[p++] = (char) l;
  }
  huffsize[p] = 0;
  numsymbols = p;
  
  /* Figure C.2: generate the codes themselves */
  /* We also validate that the counts represent a legal Huffman code tree. */
  
  code = 0;
  si = huffsize[0];
  p = 0;
  while (huffsize[p]) {
    while (((int) huffsize[p]) == si) {
      huffcode[p++] = code;
      code++;
    }
    /* code is now 1 more than the last code used for codelength si; but
     * it must still fit in si bits, since no code is allowed to be all ones.
     */
    if (((INT32) code) >= (((INT32) 1) << si))
      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
    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]) {
      /* valoffset[l] = huffval[] index of 1st symbol of code length l,
       * minus the minimum code of length l
       */
      dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];
      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++;
      }
    }
  }

  /* Validate symbols as being reasonable.
   * For AC tables, we make no check, but accept all byte values 0..255.
   * For DC tables, we require the symbols to be in range 0..15.
   * (Tighter bounds could be applied depending on the data depth and mode,
   * but this is sufficient to ensure safe decoding.)
   */
  if (isDC) {
    for (i = 0; i < numsymbols; i++) {
      int sym = htbl->huffval[i];
      if (sym < 0 || sym > 15)
	ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
    }
  }
}


/*
 * 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;
  j_decompress_ptr cinfo = state->cinfo;

  /* 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.) */
  /* We fail to do so only if we hit a marker or are forced to suspend. */

  if (cinfo->unread_marker == 0) {	/* cannot advance past a marker */
    while (bits_left < MIN_GET_BITS) {
      register int c;

      /* Attempt to read a byte */
      if (bytes_in_buffer == 0) {
	if (! (*cinfo->src->fill_input_buffer) (cinfo))
	  return FALSE;
	next_input_byte = cinfo->src->next_input_byte;
	bytes_in_buffer = 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) {
	/* Loop here to discard any padding FF's on terminating marker,
	 * so that we can save a valid unread_marker value.  NOTE: we will
	 * accept multiple FF's followed by a 0 as meaning a single FF data
	 * byte.  This data pattern is not valid according to the standard.
	 */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av性久久久久蜜臀aⅴ流畅| 日韩国产精品久久久久久亚洲| 在线视频欧美精品| 久久国产精品无码网站| 亚洲色图20p| 欧美成人一级视频| 欧美日韩亚洲不卡| 成人污污视频在线观看| 欧美aⅴ一区二区三区视频| 国产精品美女久久久久高潮| 日韩欧美国产一二三区| 91色婷婷久久久久合中文| 国产一区二区按摩在线观看| 亚洲成人免费在线观看| 中文字幕日韩av资源站| 久久亚洲精精品中文字幕早川悠里| 色8久久精品久久久久久蜜| 国产精品亚洲人在线观看| 亚洲二区在线观看| 亚洲欧美综合在线精品| 国产性天天综合网| 欧美www视频| 在线播放一区二区三区| 91成人在线精品| 99久久99精品久久久久久| 国产精品资源网站| 免费成人你懂的| 日本一不卡视频| 污片在线观看一区二区| 亚洲精品国产无天堂网2021| 国产精品美女一区二区| 欧美国产精品久久| 国产午夜精品福利| 久久久三级国产网站| 亚洲第一综合色| 亚洲黄色小视频| 亚洲精品成人悠悠色影视| 中文字幕一区二区在线播放| 久久精品人人做人人综合| 久久影院电视剧免费观看| 精品日韩在线观看| 日韩精品影音先锋| 欧美一级电影网站| 91精品一区二区三区在线观看| 欧美在线视频全部完| 色综合一个色综合亚洲| 色综合天天做天天爱| 色婷婷综合五月| 欧美三级资源在线| 欧美日韩国产精选| 91精品国产色综合久久| 日韩西西人体444www| 精品精品国产高清a毛片牛牛| 精品少妇一区二区三区在线播放| 精品毛片乱码1区2区3区| 精品久久人人做人人爰| 久久精品一区蜜桃臀影院| 国产精品沙发午睡系列990531| 国产精品美女一区二区在线观看| 亚洲人成在线观看一区二区| 亚洲综合色视频| 免费高清在线一区| 国产在线视视频有精品| 不卡一卡二卡三乱码免费网站| 91网站视频在线观看| 欧美日韩久久一区| 欧美成人aa大片| 日本一二三四高清不卡| 亚洲在线中文字幕| 韩国一区二区视频| 99久久免费国产| 69堂成人精品免费视频| 久久色.com| 亚洲精品中文字幕在线观看| 日韩精品成人一区二区三区| 国产九色精品成人porny| 97精品国产露脸对白| 欧美另类videos死尸| 久久久一区二区| 亚洲一区欧美一区| 国产一区二区不卡在线| 欧亚洲嫩模精品一区三区| 欧美videos大乳护士334| 亚洲欧美日韩人成在线播放| 蜜桃av一区二区在线观看| 9i看片成人免费高清| 91精品国产综合久久久久| 国产精品视频免费| 午夜精品福利一区二区三区av| 国产福利一区二区三区视频 | 久久国产免费看| 不卡的av网站| 精品卡一卡二卡三卡四在线| 一区二区三区中文字幕电影| 国精品**一区二区三区在线蜜桃| 一本在线高清不卡dvd| 久久夜色精品国产噜噜av| 亚洲自拍偷拍图区| 国产成人亚洲精品青草天美| 欧美日韩国产系列| 中文字幕中文字幕一区| 久久黄色级2电影| 欧美视频在线一区二区三区| 国产精品理论片| 狠狠色狠狠色综合系列| 欧美色图激情小说| 国产精品久久久久久久岛一牛影视| 裸体一区二区三区| 欧美日韩亚洲综合一区 | 成人免费一区二区三区视频| 免费一区二区视频| 在线观看一区不卡| 国产精品国产精品国产专区不蜜| 国产一区二区三区电影在线观看 | 九九视频精品免费| 欧美日免费三级在线| 中文字幕一区二区三区四区不卡| 精品一区二区三区在线观看国产| 欧美日韩午夜影院| 一区二区三区精品视频在线| www.日韩在线| 国产精品网站在线播放| 国产制服丝袜一区| 久久这里只有精品首页| 久久精品国产亚洲5555| 欧美久久久久久久久中文字幕| 亚洲国产美国国产综合一区二区| 91老司机福利 在线| 日韩一区有码在线| 99久久免费精品高清特色大片| 国产精品麻豆久久久| 成人免费视频网站在线观看| 国产欧美日韩在线| 国产不卡一区视频| 久久精品人人做人人爽人人| 成人一区二区三区| 国产精品天干天干在观线| 丁香婷婷综合网| 国产精品天美传媒| 97精品电影院| 一区二区三区在线视频免费| 极品少妇xxxx偷拍精品少妇| 日韩精品一区二区三区蜜臀| 激情文学综合网| 国产色综合久久| 成人午夜激情在线| 17c精品麻豆一区二区免费| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 激情都市一区二区| 亚洲精品一区二区三区福利| 国精产品一区一区三区mba视频| 午夜精品久久久久久不卡8050| 欧美日韩高清在线播放| 美日韩一区二区三区| 久久久亚洲精华液精华液精华液| 国产二区国产一区在线观看| 中文字幕一区不卡| 在线中文字幕一区| 三级欧美韩日大片在线看| 欧美tickling挠脚心丨vk| 国产高清亚洲一区| 亚洲视频一区二区免费在线观看| 欧美系列亚洲系列| 日本不卡的三区四区五区| www久久精品| 色综合久久天天| 日韩中文欧美在线| 中文字幕欧美激情一区| 在线亚洲欧美专区二区| 久久精品国产久精国产| 中文无字幕一区二区三区| 在线观看三级视频欧美| 麻豆成人免费电影| 国产精品美女久久福利网站| 欧美日韩视频第一区| 国产一区二区不卡在线| 亚洲综合精品久久| 日韩美女视频一区二区在线观看| 国产盗摄一区二区| 午夜激情一区二区三区| 久久综合久久综合久久综合| 色婷婷av一区二区三区之一色屋| 日本va欧美va瓶| 亚洲视频你懂的| 日韩精品一区二区三区四区视频| 99精品视频一区二区| 美女一区二区三区在线观看| 中文字幕日韩一区| 精品国产91乱码一区二区三区| 91色乱码一区二区三区| 国产一区二区三区视频在线播放| 夜夜亚洲天天久久| 久久美女艺术照精彩视频福利播放| 色综合一个色综合| 国产精品自在在线| 日韩综合在线视频| 亚洲欧美日韩在线播放| 久久精品男人天堂av| 欧美一区2区视频在线观看| 色婷婷精品大视频在线蜜桃视频|