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

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

?? sfjcjpeg.c

?? 常好且全面的jpeg圖像壓縮算法
?? C
字號:
/*sfjjpeg.c is reedited from IJG code by Fujian Shi(fieagle@yahoo.com.cn). *This file is used to finish the compression of a gray image *sfjcpeg.c ,quanhuff.c,jum.c,jcmarker.c ,jfdctint.c and jchuff.c need to combined together. */#include "commondecls.h"void  *alloc_one_row(j_compress_ptr cinfo,size_t size_object){  void *buffer_ptr;   buffer_ptr=cinfo->buffer[cinfo->buffer_count++]=(void *)     malloc(size_object);  return buffer_ptr;}/*arrage several rows buffer,that is a array*/JSAMPARRAYalloc_sarray (JDIMENSION samplesperrow, JDIMENSION numrows,j_compress_ptr cinfo)/* Allocate a 2-D sample array */{  JSAMPARRAY result;  JSAMPROW workspace;  int currow;   /* Get space for row pointers (small object) */  result = (JSAMPARRAY) alloc_one_row(cinfo,((size_t) numrows) * SIZEOF(JSAMPROW));  /* Get the rows themselves (large objects) */  currow = 0;  while (currow < numrows) {    workspace = (JSAMPROW) alloc_one_row(cinfo,((size_t) (samplesperrow)		  * SIZEOF(JSAMPLE)));    result[currow++] = workspace;      }  return result;}LOCAL(void)free_mem(j_compress_ptr cinfo){  int i;    for (i=0;i<cinfo->buffer_count;i++)       free(cinfo->buffer[i]);   }/*the fowllowing function is used to input image data to the inbuffer*/voidinput_image_data(j_compress_ptr cinfo,int i){  int j,k,input_lines;  JSAMPARRAY in_array=cinfo->inbuffer;  input_lines=(i==(cinfo->block_height-1))?(8-cinfo->height_blank):8;    for(j=0;j<input_lines;j++){    JFREAD(cinfo->inputfile,in_array[j],cinfo->image_width);    for(k=0;k<cinfo->width_blank;k++)      in_array[j][cinfo->image_width+k]=0;                    /*produce dump colume*/  }  if (input_lines<8){    MEMZERO(in_array[input_lines],cinfo->image_width);       /*produce dump line*/    input_lines++;  }} /*the following function acomplish the DCT and entropy coding*/voidcompress_data(j_compress_ptr cinfo){  int i;  DCTELEM * divisors=cinfo->divisors ;  DCTELEM workspace[DCTSIZE2];	/* work area for FDCT subroutine */  JDIMENSION bi;  JDIMENSION start_col=0;  JCOEF  coef_blocks[DCTSIZE2];    /*dipose a row of block*/  for (bi = 0; bi < cinfo->block_width; bi++, start_col += DCTSIZE) {    /* Load data into workspace, applying unsigned->signed conversion */      register DCTELEM *workspaceptr;      register JSAMPROW elemptr;      register int elemr;      workspaceptr = workspace;      for (elemr = 0; elemr < 8; elemr++) {	elemptr = cinfo->inbuffer[elemr] + start_col;	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;      }          /* Perform the DCT */    jpeg_fdct_islow (workspace);    /* Quantize/descale the coefficients */    { register DCTELEM temp, qval;      register int i;      register JCOEFPTR output_ptr = coef_blocks;      for (i = 0; i < DCTSIZE2; i++) {	qval = divisors[i];	temp = workspace[i];	/* Divide the coefficient value by qval, ensuring proper rounding.	 * Since C does not specify the direction of rounding for negative	 * quotients, we have to force the dividend positive for portability.	 *	 * In most files, at least half of the output values will be zero	 * (at default quantization settings, more like three-quarters...)	 * so we should ensure that this case is fast.  On many machines,	 * a comparison is enough cheaper than a divide to make a special test	 * a win.  Since both inputs will be nonnegative, we need only test	 * for a < b to discover whether a/b is 0.	 * If your machine's division is fast enough, define FAST_DIVIDE.	 */#ifdef FAST_DIVIDE#define DIVIDE_BY(a,b)	a /= b#else#define DIVIDE_BY(a,b)	if (a >= b) a /= b; else a = 0#endif	if (temp < 0) {	  temp = -temp;	  temp += qval>>1;	/* for rounding */	  DIVIDE_BY(temp, qval);	  temp = -temp;	} else {	  temp += qval>>1;	/* for rounding */	  DIVIDE_BY(temp, qval);	}	output_ptr[i] = (JCOEF) temp;     }             /*this marker is  for the defination of variaty*/    encode_one_block(cinfo,output_ptr,cinfo->saved.last_dc_val,                             cinfo->d_dc_huff_tbl_ptr,cinfo->d_ac_huff_tbl_ptr);    }  }           /*finish a row of block*/}main(int argc,char *argv[]){      j_compress_struct main_cinfo;      int i,p,quality;      char c;      jpeg_destination_mgr main_dest;      unsigned char fileheader[4];            /*the compact image data include only height and width*/      j_compress_ptr cinfo=&main_cinfo;            cinfo->dest=&main_dest;      cinfo->buffer_count=0;      main_cinfo.outbuffer=(JOCTET *) alloc_one_row(cinfo,(size_t) (OUTPUT_BUF_SIZE));      main_dest.next_output_byte =cinfo->outbuffer;      main_dest.free_in_buffer = OUTPUT_BUF_SIZE;      cinfo->saved.put_buffer=cinfo->saved.put_bits=\      cinfo->saved.last_dc_val=0;     if((cinfo->inputfile=fopen(argv[1],"rb"))==NULL){	printf("The %s can't be opended\n",argv[1]);	exit(0);      }      if((cinfo->outputfile=fopen(argv[2],"wb+"))==NULL){	printf("The %s can't be created\n",argv[2]);	exit(0);      }                  #define UCH(x) ((int)(x))      #define GET_2B(array,offset)  ((unsigned int) UCH(array[offset]) + \			       (((unsigned int) UCH(array[offset+1])) << 8))      if (! ReadOK(cinfo->inputfile, fileheader, 4)){         printf("error when read the head of file");         exit(0);      }      cinfo->block_width=cinfo->image_width = (UINT16) GET_2B(fileheader,0);      cinfo->block_height=cinfo->image_height = (UINT16) GET_2B(fileheader,2);      cinfo->width_blank=cinfo->height_blank=0;      while(cinfo->block_width & 7){	cinfo->block_width++;	cinfo->width_blank++;      }      cinfo->block_width>>=3;      while(cinfo->block_height & 7){	cinfo->block_height++;	cinfo->height_blank++;      }       cinfo->block_height>>=3;      cinfo->inbuffer=alloc_sarray((JDIMENSION) (8*cinfo->block_width),				  8,cinfo);                /*the inbuffer is a row of block*/            /*create the quality and huff table*/      if (sscanf(argv[3],"%d",&quality)!=1)	exit(0);      create_quality (cinfo,quality);       cinfo->divisors = (DCTELEM *)\	  alloc_one_row (cinfo,DCTSIZE2 * SIZEOF(DCTELEM));      for (i = 0; i < DCTSIZE2; i++) 			 cinfo->divisors[i] = ((DCTELEM) cinfo->quant_tbl_ptrs[i]) << 3;         /* mutitude by 8 is for couteract scale in DCT transform*/        create_huff (cinfo);                      /*write the proper file ,frame,scan and table header*/      write_file_header (cinfo);      write_frame_header (cinfo);      write_scan_header (cinfo);            /*prepare for the compresion*/     jpeg_make_c_derived_tbl (cinfo, 1,			      &(cinfo->d_dc_huff_tbl_ptr));     jpeg_make_c_derived_tbl (cinfo, 0,			      &(cinfo->d_ac_huff_tbl_ptr));     /*DCT transform and write to the JPEG file*/                          for (i=0;i<(cinfo->block_height);i++){       input_image_data(cinfo,i);       compress_data(cinfo);                   /*include DCT and entropy coding*/            }                  /*kill all the buffer and output EOI marker*/      flush_bits (cinfo);                      /*out put the patial image data*/     write_file_trailer (cinfo);      JFWRITE(cinfo->outputfile, cinfo->outbuffer,        (((size_t) (OUTPUT_BUF_SIZE))-cinfo->dest->free_in_buffer));          free_mem(cinfo);     /*fseek(cinfo->inputfile,-2,2);*/     p=0;      while(getc(cinfo->inputfile)!=EOF)		    p++;      printf("the mumber is%d\n",p);      fclose(cinfo->inputfile);      fclose(cinfo->outputfile);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品美腿丝袜| 国产精品久久久久久久岛一牛影视 | 亚洲国产一区二区三区青草影视| 日韩精品综合一本久道在线视频| 成人av在线网| 久久99精品国产麻豆婷婷| 亚洲美女屁股眼交3| 久久久久久**毛片大全| 亚洲色图另类专区| 欧美一区二区三区公司| 色诱视频网站一区| 极品销魂美女一区二区三区| 亚洲国产精品人人做人人爽| 国产精品视频线看| 精品奇米国产一区二区三区| 在线观看日韩精品| 97成人超碰视| 成人av在线播放网址| 黑人巨大精品欧美黑白配亚洲| 亚洲sss视频在线视频| 亚洲欧美激情视频在线观看一区二区三区 | 日韩欧美资源站| 欧美主播一区二区三区美女| 成人理论电影网| 国产做a爰片久久毛片| 日本系列欧美系列| 亚洲超碰97人人做人人爱| 久久久久亚洲综合| 成人精品小蝌蚪| 国产精品一区二区男女羞羞无遮挡 | 高清在线观看日韩| 精品在线观看免费| 久久精品国产一区二区| 亚洲国产精品一区二区久久| 1000精品久久久久久久久| 国产欧美日韩三区| 国产午夜一区二区三区| 久久欧美一区二区| 久久久国产精品麻豆| 精品盗摄一区二区三区| 日韩三级视频在线看| 日韩精品一区二区三区中文精品| 欧美日韩国产系列| 欧美精品123区| 欧美一区二区二区| 日韩丝袜情趣美女图片| 精品国产一区二区三区不卡| 精品国产一区久久| 国产日产欧美一区二区视频| 日本丰满少妇一区二区三区| 麻豆传媒一区二区三区| 日本欧美一区二区三区乱码| 久久精品国产精品青草| 精品一区二区三区蜜桃| 国产xxx精品视频大全| 国产成人福利片| 波多野结衣欧美| 在线国产电影不卡| 欧美日韩一级片网站| 91.com在线观看| www国产精品av| 国产精品色婷婷| 夜夜嗨av一区二区三区| 日日摸夜夜添夜夜添精品视频| 婷婷开心激情综合| 国产真实精品久久二三区| 国产91在线观看丝袜| 色婷婷av久久久久久久| 欧美酷刑日本凌虐凌虐| 久久综合国产精品| 最新热久久免费视频| 午夜精品久久久久久久久久久| 美日韩一区二区| 性做久久久久久久久| 亚洲精品欧美二区三区中文字幕| 亚洲黄色免费网站| 免费高清在线一区| 成人永久aaa| 欧美三级三级三级| 久久久久9999亚洲精品| 玉足女爽爽91| 老司机精品视频在线| av欧美精品.com| 91精品国产高清一区二区三区| 国产日产欧美一区| 亚洲自拍另类综合| 国产成人无遮挡在线视频| 欧美怡红院视频| 久久精品一区二区三区四区| 一区二区三区四区亚洲| 激情综合色播激情啊| 欧美在线观看18| 国产亚洲精品资源在线26u| 亚洲不卡在线观看| 99久久er热在这里只有精品15| 欧美一区二区三区免费在线看| 欧美激情艳妇裸体舞| 日韩精品亚洲一区| 91在线播放网址| 久久精品人人做人人爽人人| 丝袜美腿亚洲一区二区图片| 高清国产一区二区| 88在线观看91蜜桃国自产| ●精品国产综合乱码久久久久 | eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧美本精品男人aⅴ天堂| 亚洲精品国产一区二区三区四区在线| 精品一区二区三区不卡| 欧美三区免费完整视频在线观看| 中文在线免费一区三区高中清不卡| 日韩精品色哟哟| 91福利在线看| 国产精品电影院| 亚洲自拍与偷拍| 丝袜诱惑亚洲看片| 91免费国产在线观看| 中文字幕欧美国产| 狠狠色丁香婷综合久久| 777xxx欧美| 亚洲成人综合视频| 在线观看亚洲专区| 亚洲视频电影在线| heyzo一本久久综合| 久久精品人人做人人爽97| 久久精品国产精品青草| 日韩欧美国产高清| 蜜桃av一区二区三区| 欧美男生操女生| 亚洲 欧美综合在线网络| 欧美亚洲高清一区| 一区二区三区中文免费| 91蜜桃视频在线| 亚洲女同女同女同女同女同69| 99热这里都是精品| 亚洲视频一区二区免费在线观看| 成人午夜视频免费看| 国产日韩欧美综合一区| 国产99久久精品| 中文字幕的久久| 99视频超级精品| 欧美一区二区三区电影| 中文字幕国产精品一区二区| 成人一级黄色片| 国产精品网曝门| 成人午夜在线播放| 中文字幕第一区二区| 91香蕉视频黄| 亚洲综合在线观看视频| 欧美性猛交一区二区三区精品| 亚洲一区二区高清| 9191精品国产综合久久久久久 | 成人一级片网址| 中文字幕视频一区二区三区久| 99久久精品国产麻豆演员表| 亚洲私人黄色宅男| 欧美日韩精品专区| 国内精品久久久久影院薰衣草| 久久久久综合网| 99久久er热在这里只有精品15| 亚洲综合激情小说| 日韩无一区二区| 国产99久久久精品| 亚洲精品国产视频| 欧美久久久久久久久中文字幕| 麻豆成人久久精品二区三区小说| 久久精品视频一区二区三区| 91丝袜美女网| 日韩av网站免费在线| 国产亚洲精久久久久久| 欧美精品丝袜中出| 717成人午夜免费福利电影| 精品亚洲成av人在线观看| 国产精品美女久久福利网站| 日本久久精品电影| 久久97超碰国产精品超碰| 欧美国产激情二区三区 | 99精品桃花视频在线观看| 亚洲综合在线视频| 久久久夜色精品亚洲| 91丨九色porny丨蝌蚪| 日本系列欧美系列| 亚洲欧美自拍偷拍色图| 538在线一区二区精品国产| 国产很黄免费观看久久| 亚洲一区欧美一区| 欧美—级在线免费片| 欧美日韩视频第一区| 国产精品资源网| 香蕉久久夜色精品国产使用方法| 国产日韩三级在线| 91精品国产乱| 色哟哟国产精品免费观看| 国产一区二区三区精品欧美日韩一区二区三区 | 99久久国产综合精品麻豆| 日韩高清在线不卡| 中文字幕永久在线不卡| 日韩免费视频一区二区| 在线观看免费亚洲| 成人av电影免费在线播放| 九一久久久久久|