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

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

?? jcarith.c

?? It is possible that certain products which can be built using this software modules might form inve
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/* * jcarith.c * * Copyright (C) 1997, Guido Vollbeding <guivol@esc.de>. * This file is NOT part of the Independent JPEG Group's software * for legal reasons. * See the accompanying README file for conditions of distribution and use. * * This file contains portable arithmetic entropy encoding routines for JPEG * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81). * * Both sequential and progressive modes are supported in this single module. * * Suspension is not currently supported in this module. */#define JPEG_INTERNALS#include "jinclude.h"#include "jpeglib.h"/* Expanded entropy encoder object for arithmetic encoding. */typedef struct {  struct jpeg_entropy_encoder pub; /* public fields */  INT32 c; /* C register, base of coding interval, layout as in sec. D.1.3 */  INT32 a;               /* A register, normalized size of coding interval */  INT32 sc;        /* counter for stacked 0xFF values which might overflow */  INT32 zc;          /* counter for pending 0x00 output values which might *                          * be discarded at the end ("Pacman" termination) */  int ct;  /* bit shift counter, determines when next byte will be written */  int buffer;                /* buffer for most recent output byte != 0xFF */  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */  int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */  unsigned int restarts_to_go;	/* MCUs left in this restart interval */  int next_restart_num;		/* next restart number to write (0-7) */  /* Pointers to statistics areas (these workspaces have image lifespan) */  unsigned char * dc_stats[NUM_ARITH_TBLS];  unsigned char * ac_stats[NUM_ARITH_TBLS];} arith_entropy_encoder;typedef arith_entropy_encoder * arith_entropy_ptr;/* The following two definitions specify the allocation chunk size * for the statistics area. * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least * 49 statistics bins for DC, and 245 statistics bins for AC coding. * Note that we use one additional AC bin for codings with fixed * probability (0.5), thus the minimum number for AC is 246. * * We use a compact representation with 1 byte per statistics bin, * thus the numbers directly represent byte sizes. * This 1 byte per statistics bin contains the meaning of the MPS * (more probable symbol) in the highest bit (mask 0x80), and the * index into the probability estimation state machine table * in the lower bits (mask 0x7F). */#define DC_STAT_BINS 64#define AC_STAT_BINS 256/* NOTE: Uncomment the following #define if you want to use the * given formula for calculating the AC conditioning parameter Kx * for spectral selection progressive coding in section G.1.3.2 * of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4). * Although the spec and P&M authors claim that this "has proven * to give good results for 8 bit precision samples", I'm not * convinced yet that this is really beneficial. * Early tests gave only very marginal compression enhancements * (a few - around 5 or so - bytes even for very large files), * which would turn out rather negative if we'd suppress the * DAC (Define Arithmetic Conditioning) marker segments for * the default parameters in the future. * Note that currently the marker writing module emits 12-byte * DAC segments for a full-component scan in a color image. * This is not worth worrying about IMHO. However, since the * spec defines the default values to be used if the tables * are omitted (unlike Huffman tables, which are required * anyway), one might optimize this behaviour in the future, * and then it would be disadvantageous to use custom tables if * they don't provide sufficient gain to exceed the DAC size. * * On the other hand, I'd consider it as a reasonable result * that the conditioning has no significant influence on the * compression performance. This means that the basic * statistical model is already rather stable. * * Thus, at the moment, we use the default conditioning values * anyway, and do not use the custom formula. *#define CALCULATE_SPECTRAL_CONDITIONING *//* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32. * We assume that int right shift is unsigned if INT32 right shift is, * which should be safe. */#ifdef RIGHT_SHIFT_IS_UNSIGNED#define ISHIFT_TEMPS	int ishift_temp;#define IRIGHT_SHIFT(x,shft)  \	((ishift_temp = (x)) < 0 ? \	 (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \	 (ishift_temp >> (shft)))#else#define ISHIFT_TEMPS#define IRIGHT_SHIFT(x,shft)	((x) >> (shft))#endifLOCAL(void)emit_byte (int val, j_compress_ptr cinfo)/* Write next output byte; we do not support suspension in this module. */{  struct jpeg_destination_mgr * dest = cinfo->dest;  *dest->next_output_byte++ = (JOCTET) val;  if (--dest->free_in_buffer == 0)    if (! (*dest->empty_output_buffer) (cinfo))      ERREXIT(cinfo, JERR_CANT_SUSPEND);}/* * Finish up at the end of an arithmetic-compressed scan. */METHODDEF(void)finish_pass (j_compress_ptr cinfo){  arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;  INT32 temp;  /* Section D.1.8: Termination of encoding */  /* Find the e->c in the coding interval with the largest   * number of trailing zero bits */  if ((temp = (e->a - 1 + e->c) & 0xFFFF0000L) < e->c)    e->c = temp + 0x8000L;  else    e->c = temp;  /* Send remaining bytes to output */  e->c <<= e->ct;  if (e->c & 0xF8000000L) {    /* One final overflow has to be handled */    if (e->buffer >= 0) {      if (e->zc)	do emit_byte(0x00, cinfo);	while (--e->zc);      emit_byte(e->buffer + 1, cinfo);      if (e->buffer + 1 == 0xFF)	emit_byte(0x00, cinfo);    }    e->zc += e->sc;  /* carry-over converts stacked 0xFF bytes to 0x00 */    e->sc = 0;  } else {    if (e->buffer == 0)      ++e->zc;    else if (e->buffer >= 0) {      if (e->zc)	do emit_byte(0x00, cinfo);	while (--e->zc);      emit_byte(e->buffer, cinfo);    }    if (e->sc) {      if (e->zc)	do emit_byte(0x00, cinfo);	while (--e->zc);      do {	emit_byte(0xFF, cinfo);	emit_byte(0x00, cinfo);      } while (--e->sc);    }  }  /* Output final bytes only if they are not 0x00 */  if (e->c & 0x7FFF800L) {    if (e->zc)  /* output final pending zero bytes */      do emit_byte(0x00, cinfo);      while (--e->zc);    emit_byte((e->c >> 19) & 0xFF, cinfo);    if (((e->c >> 19) & 0xFF) == 0xFF)      emit_byte(0x00, cinfo);    if (e->c & 0x7F800L) {      emit_byte((e->c >> 11) & 0xFF, cinfo);      if (((e->c >> 11) & 0xFF) == 0xFF)	emit_byte(0x00, cinfo);    }  }}/* * The core arithmetic encoding routine (common in JPEG and JBIG). * This needs to go as fast as possible. * Machine-dependent optimization facilities * are not utilized in this portable implementation. * However, this code should be fairly efficient and * may be a good base for further optimizations anyway. * * Parameter 'val' to be encoded may be 0 or 1 (binary decision). * * Note: I've added full "Pacman" termination support to the * byte output routines, which is equivalent to the optional * Discard_final_zeros procedure (Figure D.15) in the spec. * Thus, we always produce the shortest possible output * stream compliant to the spec (no trailing zero bytes, * except for FF stuffing). * * I've also introduced a new scheme for accessing * the probability estimation state machine table, * derived from Markus Kuhn's JBIG implementation. */LOCAL(void)arith_encode (j_compress_ptr cinfo, unsigned char *st, int val) {  extern const INT32 jaritab[];  register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;  register unsigned char nl, nm;  register INT32 qe, temp;  register int sv;  /* Fetch values from our compact representation of Table D.2:   * Qe values and probability estimation state machine   */  sv = *st;  qe = jaritab[sv & 0x7F];	/* => Qe_Value */  nl = qe & 0xFF; qe >>= 8;	/* Next_Index_LPS + Switch_MPS */  nm = qe & 0xFF; qe >>= 8;	/* Next_Index_MPS */  /* Encode & estimation procedures per sections D.1.4 & D.1.5 */  e->a -= qe;  if (val != (sv >> 7)) {    /* Encode the less probable symbol */    if (e->a >= qe) {      /* If the interval size (qe) for the less probable symbol (LPS)       * is larger than the interval size for the MPS, then exchange       * the two symbols for coding efficiency, otherwise code the LPS       * as usual: */      e->c += e->a;      e->a = qe;    }    *st = (sv & 0x80) ^ nl;	/* Estimate_after_LPS */  } else {    /* Encode the more probable symbol */    if (e->a >= 0x8000L)      return;  /* A >= 0x8000 -> ready, no renormalization required */    if (e->a < qe) {      /* If the interval size (qe) for the less probable symbol (LPS)       * is larger than the interval size for the MPS, then exchange       * the two symbols for coding efficiency: */      e->c += e->a;      e->a = qe;    }    *st = (sv & 0x80) ^ nm;	/* Estimate_after_MPS */  }  /* Renormalization & data output per section D.1.6 */  do {    e->a <<= 1;    e->c <<= 1;    if (--e->ct == 0) {      /* Another byte is ready for output */      temp = e->c >> 19;      if (temp > 0xFF) {	/* Handle overflow over all stacked 0xFF bytes */	if (e->buffer >= 0) {	  if (e->zc)	    do emit_byte(0x00, cinfo);	    while (--e->zc);	  emit_byte(e->buffer + 1, cinfo);	  if (e->buffer + 1 == 0xFF)	    emit_byte(0x00, cinfo);	}	e->zc += e->sc;  /* carry-over converts stacked 0xFF bytes to 0x00 */	e->sc = 0;	/* Note: The 3 spacer bits in the C register guarantee	 * that the new buffer byte can't be 0xFF here	 * (see page 160 in the P&M JPEG book). */	e->buffer = temp & 0xFF;  /* new output byte, might overflow later */      } else if (temp == 0xFF) {	++e->sc;  /* stack 0xFF byte (which might overflow later) */      } else {	/* Output all stacked 0xFF bytes, they will not overflow any more */	if (e->buffer == 0)	  ++e->zc;	else if (e->buffer >= 0) {	  if (e->zc)	    do emit_byte(0x00, cinfo);	    while (--e->zc);	  emit_byte(e->buffer, cinfo);	}	if (e->sc) {	  if (e->zc)	    do emit_byte(0x00, cinfo);	    while (--e->zc);	  do {	    emit_byte(0xFF, cinfo);	    emit_byte(0x00, cinfo);	  } while (--e->sc);	}	e->buffer = temp & 0xFF;  /* new output byte (can still overflow) */      }      e->c &= 0x7FFFFL;      e->ct += 8;    }  } while (e->a < 0x8000L);}/* * Emit a restart marker & resynchronize predictions. */LOCAL(void)emit_restart (j_compress_ptr cinfo, int restart_num){  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;  int ci;  jpeg_component_info * compptr;  finish_pass(cinfo);  emit_byte(0xFF, cinfo);  emit_byte(JPEG_RST0 + restart_num, cinfo);  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {    compptr = cinfo->cur_comp_info[ci];    /* Re-initialize statistics areas */    if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {      MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);      /* Reset DC predictions to 0 */      entropy->last_dc_val[ci] = 0;      entropy->dc_context[ci] = 0;    }    if (cinfo->progressive_mode == 0 || cinfo->Ss) {      MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);    }  }  /* Reset arithmetic encoding variables */  entropy->c = 0;  entropy->a = 0x10000L;  entropy->sc = 0;  entropy->zc = 0;  entropy->ct = 11;  entropy->buffer = -1;  /* empty */}/* * MCU encoding for DC initial scan (either spectral selection, * or first pass of successive approximation). */METHODDEF(boolean)encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data){  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;  JBLOCKROW block;  unsigned char *st;  int blkn, ci, tbl;  int v, v2, m;  ISHIFT_TEMPS  /* Emit restart marker if needed */  if (cinfo->restart_interval) {    if (entropy->restarts_to_go == 0) {      emit_restart(cinfo, entropy->next_restart_num);      entropy->restarts_to_go = cinfo->restart_interval;      entropy->next_restart_num++;      entropy->next_restart_num &= 7;    }    entropy->restarts_to_go--;  }  /* Encode the MCU data blocks */  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {    block = MCU_data[blkn];    ci = cinfo->MCU_membership[blkn];    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;    /* Compute the DC value after the required point transform by Al.     * This is simply an arithmetic right shift.     */    m = IRIGHT_SHIFT((int) ((*block)[0]), cinfo->Al);    /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];    /* Figure F.4: Encode_DC_DIFF */    if ((v = m - entropy->last_dc_val[ci]) == 0) {      arith_encode(cinfo, st, 0);      entropy->dc_context[ci] = 0;	/* zero diff category */    } else {      entropy->last_dc_val[ci] = m;      arith_encode(cinfo, st, 1);      /* Figure F.6: Encoding nonzero value v */      /* Figure F.7: Encoding the sign of v */      if (v > 0) {	arith_encode(cinfo, st + 1, 0);	/* Table F.4: SS = S0 + 1 */	st += 2;			/* Table F.4: SP = S0 + 2 */	entropy->dc_context[ci] = 4;	/* small positive diff category */      } else {	v = -v;	arith_encode(cinfo, st + 1, 1);	/* Table F.4: SS = S0 + 1 */	st += 3;			/* Table F.4: SN = S0 + 3 */	entropy->dc_context[ci] = 8;	/* small negative diff category */      }      /* Figure F.8: Encoding the magnitude category of v */      m = 0;      if (v -= 1) {	arith_encode(cinfo, st, 1);	m = 1;	v2 = v;	st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */	while (v2 >>= 1) {	  arith_encode(cinfo, st, 1);	  m <<= 1;	  st += 1;	}      }      arith_encode(cinfo, st, 0);      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */      if (m < (int) (((INT32) 1 << cinfo->arith_dc_L[tbl]) >> 1))	entropy->dc_context[ci] = 0;	/* zero diff category */      else if (m > (int) (((INT32) 1 << cinfo->arith_dc_U[tbl]) >> 1))	entropy->dc_context[ci] += 8;	/* large diff category */      /* Figure F.9: Encoding the magnitude bit pattern of v */      st += 14;      while (m >>= 1)	arith_encode(cinfo, st, (m & v) ? 1 : 0);    }  }  return TRUE;}/* * MCU encoding for AC initial scan (either spectral selection, * or first pass of successive approximation). */METHODDEF(boolean)encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data){  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;  JBLOCKROW block;  unsigned char *st;  int tbl, k, ke;  int v, v2, m;  /* Emit restart marker if needed */  if (cinfo->restart_interval) {    if (entropy->restarts_to_go == 0) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品第四页| 欧美日精品一区视频| 一区二区国产视频| 日韩美一区二区三区| 成人a级免费电影| 蜜臀精品一区二区三区在线观看| 国产精品网友自拍| 欧美一级生活片| 欧美在线观看视频一区二区三区| 国产美女精品一区二区三区| 亚洲一区在线电影| 国产精品无码永久免费888| 欧美一级艳片视频免费观看| 色婷婷av一区二区三区之一色屋| 韩国精品在线观看| 日韩国产在线观看| 亚洲夂夂婷婷色拍ww47| 国产精品午夜在线| 精品久久久久久综合日本欧美| 欧美亚洲一区二区在线观看| 懂色一区二区三区免费观看| 经典一区二区三区| 日韩av一区二区三区| 亚洲va欧美va人人爽午夜| 日韩一区中文字幕| 国产精品电影一区二区三区| 久久久国产精品不卡| 日韩精品一区二区三区蜜臀| 欧美高清性hdvideosex| 在线观看亚洲一区| 色呦呦国产精品| 99久久精品国产一区二区三区| 国产精品自产自拍| 国产一区二区三区久久悠悠色av| 麻豆精品新av中文字幕| 欧美日韩一区三区四区| 91国产福利在线| 色94色欧美sute亚洲13| 91国偷自产一区二区三区成为亚洲经典 | 亚洲色图色小说| 中文字幕一区二区三中文字幕| 国产欧美日韩在线观看| 国产人妖乱国产精品人妖| 久久色中文字幕| 国产午夜一区二区三区| 国产亚洲午夜高清国产拍精品| 久久精品一区二区三区不卡| 久久久不卡网国产精品一区| 国产亚洲欧美日韩日本| 国产午夜精品福利| 国产精品福利影院| 亚洲男人电影天堂| 亚洲一区二区三区四区在线 | 在线中文字幕一区| 欧美色老头old∨ideo| 欧美日本国产一区| 日韩三级电影网址| 国产亚洲一区字幕| 中文字幕一区二区三区视频| 亚洲人成小说网站色在线| 亚洲一区二区在线播放相泽| 亚洲观看高清完整版在线观看| 天天色图综合网| 久久66热偷产精品| 国产高清精品网站| 色噜噜久久综合| 91精品国产一区二区三区香蕉| 精品日韩成人av| 国产精品第五页| 日韩成人一级大片| 高清不卡一二三区| 欧美午夜视频网站| 久久综合九色综合久久久精品综合 | 3atv在线一区二区三区| 久久久精品tv| 一区二区在线电影| 精品一区二区av| av电影在线观看一区| 欧美日韩国产一区二区三区地区| 欧美va亚洲va国产综合| 中文字幕中文字幕在线一区| 亚洲制服丝袜av| 国产精品影视网| 91国产福利在线| 久久精品欧美日韩精品| 亚洲一区二区三区在线播放| 经典三级在线一区| 欧美亚洲尤物久久| 国产日韩精品一区二区三区在线| 夜夜亚洲天天久久| 国产精品一区二区在线播放| 亚洲黄一区二区三区| 九九国产精品视频| 欧美中文字幕一二三区视频| 久久久久久久久久看片| 亚洲 欧美综合在线网络| 国产福利一区二区三区视频| 欧美日韩国产乱码电影| 欧美国产精品久久| 免费欧美日韩国产三级电影| 99riav一区二区三区| 精品国产一区a| 图片区小说区区亚洲影院| 成人精品国产福利| 精品动漫一区二区三区在线观看| 夜夜嗨av一区二区三区网页| 国产精品性做久久久久久| 欧美日本一区二区三区四区| 综合电影一区二区三区| 国产一区二区三区免费看| 4438x亚洲最大成人网| 一二三区精品福利视频| 不卡在线观看av| 国产欧美精品一区二区三区四区| 日韩av一区二| 欧美亚洲禁片免费| 亚洲欧美视频在线观看| 国产成人在线免费| 久久久亚洲午夜电影| 蜜臀av在线播放一区二区三区| 欧美日韩另类国产亚洲欧美一级| 日韩理论片一区二区| 成人理论电影网| 国产精品污www在线观看| 韩国理伦片一区二区三区在线播放| 欧美一卡二卡三卡四卡| 丝袜美腿成人在线| 欧美猛男男办公室激情| 亚洲一区二区偷拍精品| 91黄色免费网站| 一区二区三区高清不卡| 色丁香久综合在线久综合在线观看| 中文欧美字幕免费| 成人深夜福利app| 国产精品萝li| 99久久精品99国产精品| 亚洲视频1区2区| 色综合久久中文字幕| 亚洲丝袜另类动漫二区| jiyouzz国产精品久久| 中文字幕在线不卡一区二区三区| 99麻豆久久久国产精品免费优播| 国产精品你懂的在线欣赏| 成人av在线观| 亚洲欧美日韩小说| 欧美日韩一区二区三区四区 | 色综合天天天天做夜夜夜夜做| 亚洲视频你懂的| 欧美日韩一级二级三级| 视频一区中文字幕国产| 精品免费日韩av| 国产a精品视频| 亚洲精品乱码久久久久久日本蜜臀| 色乱码一区二区三区88| 日韩经典一区二区| www欧美成人18+| 99re成人在线| 午夜欧美在线一二页| 精品乱人伦小说| 波多野结衣欧美| 亚洲chinese男男1069| 日韩欧美一区在线| 成人动漫精品一区二区| 亚洲尤物在线视频观看| 日韩女同互慰一区二区| 成人免费视频播放| 亚洲成人免费av| 免费成人av在线| 国产精品乱码一区二区三区软件| 在线影院国内精品| 久久成人久久爱| 亚洲品质自拍视频| 欧美一二三四在线| 成人国产精品免费网站| 天天做天天摸天天爽国产一区| 亚洲精品一区二区三区精华液| 99久久久久久99| 麻豆精品蜜桃视频网站| 综合av第一页| 日韩精品一区二区三区视频| 99久久久精品| 狠狠狠色丁香婷婷综合激情| 国产精品欧美精品| 制服丝袜亚洲色图| 99久久婷婷国产综合精品电影| 日韩精品久久理论片| 日本高清免费不卡视频| 亚洲日本va午夜在线电影| 日韩视频中午一区| 99v久久综合狠狠综合久久| 奇米色777欧美一区二区| 亚洲三级在线看| 欧美精品一区二区高清在线观看 | 一区二区国产盗摄色噜噜| 精品国产百合女同互慰| 欧美在线不卡视频| 成人看片黄a免费看在线| 日本午夜一本久久久综合| 亚洲免费观看高清完整版在线观看 | 成人午夜精品在线|