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

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

?? jcarith.c~

?? 常好且全面的jpeg圖像壓縮算法
?? C~
字號:
/* * jcarith.c * * It can only acomplesh simple arithmetic coding. */#include "commondecls.h"#define RIGHT_SHIFT(x,shft) x>=0 ? x>>shft : -((-x)>>shft)/* 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). *//* 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. * * 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. *//* * Finish up at the end of an arithmetic-compressed scan. */voidflush_bits (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(cinfo,0x00);	while (--e->zc);      emit_byte(cinfo,e->buffer + 1);      if (e->buffer + 1 == 0xFF)	emit_byte(cinfo,0x00);    }    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(cinfo,0x00);	while (--e->zc);      emit_byte(cinfo,e->buffer);    }    if (e->sc) {      if (e->zc)	do emit_byte(cinfo,0x00);	while (--e->zc);      do {	emit_byte(cinfo,0xFF);	emit_byte(cinfo,0x00);      } 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(cinfo,0x00);      while (--e->zc);    emit_byte(cinfo,(e->c >> 19) & 0xFF);    if (((e->c >> 19) & 0xFF) == 0xFF)      emit_byte(cinfo,0x00);    if (e->c & 0x7F800L) {      emit_byte(cinfo,(e->c >> 11) & 0xFF);      if (((e->c >> 11) & 0xFF) == 0xFF)	emit_byte(cinfo,0x00);    }  }}/* * 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. */voidarith_encode (j_compress_ptr cinfo, unsigned char *st, int val) {  extern const INT32 jaritab[];  register arith_entropy_ptr e = 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) & (0x00000001))) {    /* 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: ,it is equal to code        * the LPS.*/      e->c += e->a;      e->a = qe;    }    *st = (sv & 0x80) ^ nm ;	/* Estimate_after_MPS ,no change of the sense of the MPS*/  }  /* Renormalization & data output per section D.1.6 */  do {    e->a <<= 1;    e->c <<= 1;    if (--e->ct == 0) {      /* The followning is the byte_out programe.*/      /* Another byte is ready for output */      temp = e->c >> 19;      if (temp > 0xFF) {	/*Handle overflow over all stacked 0xFF bytes */	if (e->buffer >= 0) {	  	   emit_byte(cinfo,e->buffer + 1);	  if (e->buffer + 1 == 0xFF)	  emit_byte(cinfo,0x00); 	}	/*e->zc += e->sc;*/  /* carry-over converts stacked 0xFF bytes to 0x00 and output them*/	while(e->sc-->0)	  emit_byte(cinfo,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) {           emit_byte(cinfo,e->buffer);	   if (e->sc) {	     while (e->sc--) {	       emit_byte(cinfo,0xFF);	       emit_byte(cinfo,0x00);	     } 	    e->sc=0;	    }	           }         e->buffer = temp & 0xFF;  /* new output byte (can still overflow) */      }      e->c &= 0x7FFFFL;      e->ct = 8;    }  } while (e->a < 0x8000L);  }/* * Encode and output one MCU's worth of arithmetic-compressed coefficients. */voidencode_row (j_compress_ptr cinfo,JSAMPROW row,int i){  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;  unsigned char * st;  unsigned char context_a=0;  int num,ci, tbl, k, ke;  int v, v2, m,last_val=0,Rc=0,predic_val;  entropy->context=0;  /* Encode the MCU data blocks */  for (num = 0; num < cinfo->image_width; num++) {        /* 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 + entropy->context*5+entropy->context_b[num];    /*predic_val=last_val+((entropy->val_b[num]-Rc)>>1);*/    /*predic_val=RIGHT_SHIFT(last_val+entropy->val_b[num],1);*/    v=get_errval(cinfo,last_val,entropy->val_b[num],Rc,entropy->val_b[num+1],row+num);    /* if (i==0)       printf("row[%d]:%x  v=%d\n",num,row[num],v);*/    /*v=row[num]-predic_val;*/    /* Figure F.4: Encode_DC_DIFF */    if ((v ) == 0) {      arith_encode(cinfo, st, 0);      entropy->context = 0;	                /* zero diff category */          } else {            arith_encode(cinfo, st, 1);      /* Figure F.6: Encoding nonzero value v */      /* Figure F.7: Encoding the sign of v */      if (v > 0) {	st +=1;	arith_encode(cinfo, st, 0);	/* Table F.4: SS = S0 + 1 */	st += 1;			/* Table F.4: SP = S0 + 2 */	entropy->context = 4;	                /* small positive diff category */      } else {	st +=1;	v = -v;	arith_encode(cinfo, st, 1);	/* Table F.4: SS = S0 + 1 */	st += 2;			/* Table F.4: SN = S0 + 3 */	entropy->context = 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;        if ( entropy->context_b[num]>8 )	  st=entropy->dc_stats+129;	else	  st = entropy->dc_stats + 100; /* Table H.3: X1 = X1_context(Db)*/	    /*st=entropy->dc_stats+20;*/	 while (v2 >>= 1) {	   arith_encode(cinfo, st, 1);	   m <<= 1;	   st += 1;	}      }      arith_encode(cinfo, st, 0);            /* v -=1;       *m=1;       *if (v>m){       *arith_encode(cinfo,st,1);       *if ( entropy->context_b[num]>8 )       *  st=entropy->dc_stats+129;       * else       *  st = entropy->dc_stats + 100; * Table H.3: X1 = X1_context(Db)*       *m=2;       * while (v>=m){	*  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) >> 1))	entropy->context = 0;	        /* zero diff category */      else if ((m) > (int) (((INT32) 1 << cinfo->arith_dc_U)>>1 ))	entropy->context += 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);    }    entropy->context_b[num]=entropy->context;    Rc=entropy->val_b[num];    last_val=entropy->val_b[num]=row[num];  }    }  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲短视频| 久久精品国产一区二区三 | 日本欧美肥老太交大片| 国产成人超碰人人澡人人澡| 在线观看欧美黄色| 国产三级欧美三级| 午夜精品免费在线| 不卡电影免费在线播放一区| 精品国产一区二区三区av性色| 亚洲精品综合在线| 国产乱人伦偷精品视频不卡| 在线电影院国产精品| 亚洲免费视频中文字幕| 国产麻豆午夜三级精品| 777午夜精品视频在线播放| 亚洲婷婷在线视频| 盗摄精品av一区二区三区| 依依成人精品视频| 国产91精品在线观看| 日韩欧美一二三四区| 亚洲成人在线网站| 欧美视频一二三区| 中文字幕一区日韩精品欧美| 国产精品主播直播| 精品国精品国产| 裸体一区二区三区| 欧美一区二区大片| 麻豆视频观看网址久久| 欧美精品久久一区| 亚洲一区二区免费视频| 91老师国产黑色丝袜在线| 国产日韩欧美激情| 国产精品一二三四区| 精品久久久久av影院| 免费成人你懂的| 日韩视频123| 麻豆精品国产传媒mv男同| 91精品久久久久久久99蜜桃 | 欧美亚男人的天堂| 亚洲精品第一国产综合野| 一本一本大道香蕉久在线精品| 亚洲欧美一区二区三区久本道91 | 国产精品亚洲午夜一区二区三区| 欧美成va人片在线观看| 国产一区二区三区免费| www久久精品| 国产成人免费高清| 亚洲乱码中文字幕综合| 在线免费不卡视频| 日韩影院在线观看| 精品国产123| 国产成人av自拍| 一区二区三区在线免费观看| 欧美日韩一区不卡| 黑人巨大精品欧美一区| 国产精品短视频| 欧美性做爰猛烈叫床潮| 激情综合一区二区三区| 国产精品网友自拍| 欧美日韩国产a| 国产伦精品一区二区三区视频青涩 | 精品理论电影在线| k8久久久一区二区三区| 亚洲国产日产av| 精品国产一区二区三区不卡| 成人av第一页| 日本一区中文字幕| 国产精品色哟哟| 欧美人伦禁忌dvd放荡欲情| 久久99久久久久| 亚洲欧美色一区| 日韩欧美的一区二区| 北条麻妃国产九九精品视频| 日本欧洲一区二区| 精品综合免费视频观看| 亚洲免费观看高清| 日韩免费视频一区| 91捆绑美女网站| 久久99国产精品尤物| 亚洲精品写真福利| 精品免费国产一区二区三区四区| 99久久免费精品| 久久精品国产**网站演员| 国产精品久久久久三级| 日韩午夜在线观看| 色婷婷久久久综合中文字幕| 激情文学综合丁香| 午夜电影久久久| 樱桃视频在线观看一区| 国产精品久久久久精k8| 日韩欧美一级特黄在线播放| 欧美视频自拍偷拍| 91小视频免费观看| 国产福利一区在线| 蓝色福利精品导航| 天天色天天操综合| 亚洲精品中文字幕在线观看| 亚洲国产高清在线| 久久精品一区四区| 日韩欧美一区二区在线视频| 欧美中文字幕一区二区三区亚洲| 国产乱码精品一区二区三区五月婷 | 国产高清精品网站| 国产真实精品久久二三区| 亚洲国产日产av| 午夜伦理一区二区| 亚洲国产欧美另类丝袜| 亚洲激情欧美激情| 最新久久zyz资源站| 国产精品久久久久久妇女6080| 久久无码av三级| 久久免费的精品国产v∧| 精品久久久久久久一区二区蜜臀| 日韩一区二区三区电影在线观看| 69久久夜色精品国产69蝌蚪网| 欧美日韩国产成人在线91| 欧美精品精品一区| 欧美一区二区福利在线| 欧美一卡在线观看| 精品噜噜噜噜久久久久久久久试看 | 韩国欧美一区二区| 国产一区二区三区国产| 国产精品一二三四| 99视频在线精品| 色乱码一区二区三区88| 欧美性淫爽ww久久久久无| 欧美日韩电影一区| 日韩精品一区二区三区视频 | 久久久久久久久久久久久夜| 久久理论电影网| 国产精品午夜电影| 一区二区在线观看不卡| 午夜视黄欧洲亚洲| 经典三级一区二区| 99久久综合国产精品| 欧美日韩一区国产| www一区二区| 伊人一区二区三区| 捆绑紧缚一区二区三区视频| 国产成人午夜电影网| 欧美这里有精品| 日韩欧美亚洲国产另类| 国产欧美日韩一区二区三区在线观看| 国产精品第13页| 午夜精品aaa| 国产成人h网站| 欧美人伦禁忌dvd放荡欲情| 精品国产乱码久久久久久浪潮| 亚洲欧美自拍偷拍| 五月综合激情婷婷六月色窝| 国产剧情一区二区| 欧美亚洲综合色| 日本一区二区三区dvd视频在线| 亚洲精品videosex极品| 麻豆91精品91久久久的内涵| 91看片淫黄大片一级在线观看| 91精品综合久久久久久| 国产精品久久久久久一区二区三区| 亚洲成人精品在线观看| 岛国精品在线播放| 日韩一区二区在线播放| 亚洲欧洲综合另类在线| 国内精品伊人久久久久影院对白| 色哟哟在线观看一区二区三区| 日韩视频免费观看高清完整版在线观看| 国产精品午夜在线观看| 美洲天堂一区二卡三卡四卡视频| 色综合欧美在线视频区| 久久免费美女视频| 伦理电影国产精品| 欧美午夜一区二区三区 | 久久久久国产精品厨房| 亚洲成a人在线观看| 99视频有精品| 国产亚洲短视频| 久久精品国产亚洲高清剧情介绍| 91欧美激情一区二区三区成人| 精品国产乱码久久久久久1区2区| 亚洲二区在线观看| 91国在线观看| 国产精品白丝在线| 国产高清视频一区| 久久久国产精品午夜一区ai换脸| 免费不卡在线视频| 欧美巨大另类极品videosbest| 亚洲三级理论片| 成人免费黄色在线| 久久精品视频免费观看| 久草中文综合在线| 日韩一卡二卡三卡国产欧美| 五月天亚洲精品| 欧美日韩亚洲不卡| 亚洲午夜成aⅴ人片| 久久国产精品色婷婷| 日韩你懂的在线播放| 久久99精品久久久久婷婷| 欧美草草影院在线视频| 国产一区二区三区在线观看精品 | 欧美va亚洲va国产综合| 免费欧美高清视频|