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

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

?? jcmarker.c

?? 常好且全面的jpeg圖像壓縮算法
?? C
字號(hào):
/*This program  is reedited from IJG code by Fujian Shi(fieagle@yahoo.com.cn)
 * jcmarker.c
 *
 * 
 *
 * This file contains routines to write JPEG datastream markers.
 */


#include "commondecls.h"



typedef enum {			/* JPEG marker codes */
  M_SOF0  = 0xc0,
  M_SOF1  = 0xc1,
  M_SOF2  = 0xc2,
  M_SOF3  = 0xc3,
  
  M_SOF5  = 0xc5,
  M_SOF6  = 0xc6,
  M_SOF7  = 0xc7,
  
  M_JPG   = 0xc8,
  M_SOF9  = 0xc9,
  M_SOF10 = 0xca,
  M_SOF11 = 0xcb,
  
  M_SOF13 = 0xcd,
  M_SOF14 = 0xce,
  M_SOF15 = 0xcf,
  
  M_DHT   = 0xc4,
  
  M_DAC   = 0xcc,
  
  M_RST0  = 0xd0,
  M_RST1  = 0xd1,
  M_RST2  = 0xd2,
  M_RST3  = 0xd3,
  M_RST4  = 0xd4,
  M_RST5  = 0xd5,
  M_RST6  = 0xd6,
  M_RST7  = 0xd7,
  
  M_SOI   = 0xd8,
  M_EOI   = 0xd9,
  M_SOS   = 0xda,
  M_DQT   = 0xdb,
  M_DNL   = 0xdc,
  M_DRI   = 0xdd,
  M_DHP   = 0xde,
  M_EXP   = 0xdf,
  
  M_APP0  = 0xe0,
  M_APP1  = 0xe1,
  M_APP2  = 0xe2,
  M_APP3  = 0xe3,
  M_APP4  = 0xe4,
  M_APP5  = 0xe5,
  M_APP6  = 0xe6,
  M_APP7  = 0xe7,
  M_APP8  = 0xe8,
  M_APP9  = 0xe9,
  M_APP10 = 0xea,
  M_APP11 = 0xeb,
  M_APP12 = 0xec,
  M_APP13 = 0xed,
  M_APP14 = 0xee,
  M_APP15 = 0xef,
  
  M_JPG0  = 0xf0,
  M_JPG13 = 0xfd,
  M_COM   = 0xfe,
  
  M_TEM   = 0x01,
  
  M_ERROR = 0x100
} JPEG_MARKER;




/*
 * Basic output routines.
 *
 * Note that we do not support suspension while writing a marker.
 * Therefore, an application using suspension must ensure that there is
 * enough buffer space for the initial markers (typ. 600-700 bytes) before
 * calling jpeg_start_compress, and enough space to write the trailing EOI
 * (a few bytes) before calling jpeg_finish_compress.  Multipass compression
 * modes are not supported at all with suspension, so those two are the only
 * points where markers will be written.
 */

void
empty_output_buffer (j_compress_ptr cinfo)
{
  jpeg_destination_mgr *dest =  cinfo->dest;

  if (JFWRITE(cinfo->outputfile, cinfo->outbuffer, OUTPUT_BUF_SIZE) !=
      (size_t) OUTPUT_BUF_SIZE)
    exit(0);

  dest->next_output_byte = cinfo->outbuffer;
  dest->free_in_buffer = OUTPUT_BUF_SIZE;

  
}





void
emit_byte (j_compress_ptr cinfo, int val)
/* Emit a byte */
{
  jpeg_destination_mgr * dest = cinfo->dest;

  *(dest->next_output_byte)++ = (JOCTET) val;
  if (--dest->free_in_buffer == 0) 
    empty_output_buffer (cinfo);
    
}


LOCAL(void)
emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)
/* Emit a marker code */
{
  emit_byte(cinfo, 0xFF);
  emit_byte(cinfo, (int) mark);
}


LOCAL(void)
emit_2bytes (j_compress_ptr cinfo, int value)
/* Emit a 2-byte integer; these are always MSB first in JPEG files */
{
  emit_byte(cinfo, (value >> 8) & 0xFF);
  emit_byte(cinfo, value & 0xFF);
}


/*
 * Routines to write specific marker types.
 */

LOCAL(int)
emit_dqt (j_compress_ptr cinfo)
/* Emit a DQT marker */
/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
{
  UINT16 * qtbl = cinfo->quant_tbl_ptrs;
  int prec=0;
  int i;

  if (qtbl == NULL)
    exit(0);

  
  

    emit_marker(cinfo, M_DQT);

    emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);

    emit_byte(cinfo, 0);

    for (i = 0; i < DCTSIZE2; i++) {
      /* The table entries must be emitted in zigzag order. */
      unsigned int qval = qtbl[jpeg_natural_order[i]];
      if (prec)
	emit_byte(cinfo, (int) (qval >> 8));
      emit_byte(cinfo, (int) (qval & 0xFF));
    }

}


LOCAL(void)
emit_dht (j_compress_ptr cinfo, int is_ac)
/* Emit a DHT marker */
{
  JHUFF_TBL * htbl;
  int length, i,index=0;
  
  if (is_ac) {
    htbl = cinfo->ac_huff_tbl_ptrs;
    index += 0x10;		/* output index has AC bit set */
  } else {
    htbl = cinfo->dc_huff_tbl_ptrs;
  }

  if (htbl == NULL)
    exit(0);
  
  
    emit_marker(cinfo, M_DHT);
    
    length = 0;
    for (i = 1; i <= 16; i++)
      length += htbl->bits[i];
    
    emit_2bytes(cinfo, length + 2 + 1 + 16);
    emit_byte(cinfo, index);
    
    for (i = 1; i <= 16; i++)
      emit_byte(cinfo, (int) htbl->bits[i]);
    
    for (i = 0; i < length; i++)
      emit_byte(cinfo,(int) htbl->huffval[i]);    /*?Do we need to int the huffval*/
    
      
}






LOCAL(void)
emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
/* Emit a SOF marker */
{
  int ci;
    
  emit_marker(cinfo, code);
  
  emit_2bytes(cinfo, 3 + 2 + 5 + 1); /* length */

  /* Make sure image isn't bigger than SOF field can handle */
  if ((long) cinfo->image_height > 65535L ||
      (long) cinfo->image_width > 65535L)
    exit(0);

  emit_byte(cinfo, 8);
  emit_2bytes(cinfo, (int) cinfo->image_height);
  emit_2bytes(cinfo, (int) cinfo->image_width);

  emit_byte(cinfo, 1);

  
    emit_byte(cinfo, 0);
    emit_byte(cinfo, ((int)1 << 4) + 1);
    emit_byte(cinfo, 0);
  
}


LOCAL(void)
emit_sos (j_compress_ptr cinfo)
/* Emit a SOS marker */
{
  int i, td, ta;
  
  emit_marker(cinfo, M_SOS);
  
  emit_2bytes(cinfo, 2 + 2 + 1 + 3); /* length */
  
  emit_byte(cinfo, 1);
  
  
    emit_byte(cinfo, 0);
    td = 0;
    ta = 0;
    
    emit_byte(cinfo, (td << 4) + ta);
  
  emit_byte(cinfo, 0);
  emit_byte(cinfo, 63);
  emit_byte(cinfo, 0);
}


LOCAL(void)
emit_jfif_app0 (j_compress_ptr cinfo)
/* Emit a JFIF-compliant APP0 marker */
{
  /*
   * Length of APP0 block	(2 bytes)
   * Block ID			(4 bytes - ASCII "JFIF")
   * Zero byte			(1 byte to terminate the ID string)
   * Version Major, Minor	(2 bytes - major first)
   * Units			(1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
   * Xdpu			(2 bytes - dots per unit horizontal)
   * Ydpu			(2 bytes - dots per unit vertical)
   * Thumbnail X size		(1 byte)
   * Thumbnail Y size		(1 byte)
   */
  
  emit_marker(cinfo, M_APP0);
  
  emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */

  emit_byte(cinfo, 0x4A);	/* Identifier: ASCII "JFIF" */
  emit_byte(cinfo, 0x46);
  emit_byte(cinfo, 0x49);
  emit_byte(cinfo, 0x46);
  emit_byte(cinfo, 0);
  emit_byte(cinfo,1);           /* Version fields */
  emit_byte(cinfo, 1);
  emit_byte(cinfo, 0);         /* Pixel size information */
  emit_2bytes(cinfo, 1);
  emit_2bytes(cinfo, 1);
  emit_byte(cinfo, 0);		/* No thumbnail image */
  emit_byte(cinfo, 0);
}







/*
 * Write datastream header.
 * This consists of an SOI and optional APPn markers.
 * We recommend use of the JFIF marker, but not the Adobe marker,
 * when using YCbCr or grayscale data.  The JFIF marker should NOT
 * be used for any other JPEG colorspace.  The Adobe marker is helpful
 * to distinguish RGB, CMYK, and YCCK colorspaces.
 * Note that an application can write additional header markers after
 * jpeg_start_compress returns.
 */

void
write_file_header (j_compress_ptr cinfo)
{
  
  emit_marker(cinfo, M_SOI);	/* first the SOI */

  
  emit_jfif_app0(cinfo);
}


/*
 * Write frame header.
 * This consists of DQT and SOFn markers.
 * Note that we do not emit the SOF until we have emitted the DQT(s).
 * This avoids compatibility problems with incorrect implementations that
 * try to error-check the quant table numbers as soon as they see the SOF.
 */

void
write_frame_header (j_compress_ptr cinfo)
{
  int ci, prec;
    
  /* Emit DQT for each quantization table.
   * Note that emit_dqt() suppresses any duplicate tables.
   */
   emit_dqt(cinfo);
  
  
  /* Emit the proper SOF marker */
  emit_sof(cinfo, M_SOF0);	/* SOF code for baseline implementation */
  
}


/*
 * Write scan header.
 * This consists of DHT or DAC markers, optional DRI, and SOS.
 * Compressed data will be written following the SOS.
 */

void
write_scan_header (j_compress_ptr cinfo)
{
  int i;
  
  
  /* Sequential mode: need both DC and AC tables */
  emit_dht(cinfo, 0);
  emit_dht(cinfo, 1);
  emit_sos(cinfo);
}


/*
 * Write datastream trailer.
 */

void
write_file_trailer (j_compress_ptr cinfo)
{
  emit_marker(cinfo, M_EOI);
}


?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情六月婷婷综合| 麻豆精品视频在线| 欧美国产一区在线| 日韩欧美不卡在线观看视频| 欧美日韩亚洲丝袜制服| 91美女福利视频| 福利视频网站一区二区三区| 日韩高清在线电影| 一区二区日韩av| 中文字幕亚洲成人| 日本一区二区免费在线观看视频 | 欧美日韩高清不卡| 99久久精品免费看| 国产成人综合亚洲91猫咪| 国内外成人在线| 亚洲成人免费看| 亚洲图片欧美视频| 中文字幕欧美三区| 久久亚洲私人国产精品va媚药| 在线播放亚洲一区| 91成人国产精品| 91浏览器打开| 91视视频在线观看入口直接观看www | 精品视频色一区| 在线一区二区视频| 在线看国产一区二区| 色综合中文字幕国产 | 亚洲一区二区三区四区不卡| 亚洲乱码国产乱码精品精可以看 | 国产精品九色蝌蚪自拍| 国产精品初高中害羞小美女文| 国产欧美日韩精品一区| 欧美激情综合五月色丁香小说| 国产日韩在线不卡| 一色屋精品亚洲香蕉网站| 国产精品免费av| 1024精品合集| 一区二区三区在线免费播放| 亚洲成人av福利| 日韩和欧美的一区| 日韩激情视频在线观看| 国产一区视频在线看| 麻豆一区二区三区| 福利一区二区在线观看| 91亚洲精品乱码久久久久久蜜桃| 91九色最新地址| 日韩一区二区精品在线观看| 久久久精品欧美丰满| 国产精品九色蝌蚪自拍| 亚洲一区在线视频观看| 麻豆91在线播放免费| 东方欧美亚洲色图在线| 在线精品亚洲一区二区不卡| 日韩一区二区三区观看| 国产人久久人人人人爽| 亚洲乱码中文字幕| 美女视频黄 久久| 成人av网址在线| 欧美在线视频全部完| 欧美偷拍一区二区| 精品国产乱码久久久久久牛牛| 91精品国产91久久久久久最新毛片| 久久久久久久久久久久电影| 欧美经典一区二区三区| 亚洲欧洲av另类| 日韩精品久久理论片| 国内精品国产成人国产三级粉色| 不卡在线视频中文字幕| 日本道色综合久久| 欧美喷水一区二区| 久久综合九色综合欧美亚洲| 最新不卡av在线| 久久精工是国产品牌吗| av午夜一区麻豆| 欧美一区二区三区白人| 日韩一区欧美小说| 久久国产精品区| 色婷婷一区二区| 91精品国产综合久久国产大片| 国产精品伦一区| 日本色综合中文字幕| 99久久免费国产| 亚洲精品在线免费观看视频| 亚洲色图制服诱惑| 日本免费新一区视频| 99精品国产视频| 精品国产乱码久久| 天天色图综合网| 色综合视频在线观看| 精品国产乱码久久久久久老虎| 亚洲一区免费视频| gogogo免费视频观看亚洲一| 91精品国产91综合久久蜜臀| 亚洲乱码日产精品bd| 成人禁用看黄a在线| 精品国产乱码久久久久久免费| 亚洲成av人片观看| 色综合久久九月婷婷色综合| 久久综合九色综合97婷婷| 亚洲国产精品综合小说图片区| 风流少妇一区二区| 555夜色666亚洲国产免| 亚洲男同1069视频| 99久久综合狠狠综合久久| 久久影视一区二区| 六月丁香综合在线视频| 91精品国产入口| 婷婷中文字幕综合| 色香蕉久久蜜桃| 久久久久久久久一| 精品一区二区综合| 日韩欧美一区二区久久婷婷| 日韩中文字幕91| 欧美丰满美乳xxx高潮www| 亚洲一卡二卡三卡四卡| 色av成人天堂桃色av| 国产精品福利av| 国产不卡免费视频| 久久久国际精品| 国产一区二区三区在线观看免费| 欧美成人三级在线| 免费成人在线观看视频| 欧美一区二区三区视频免费 | 日韩欧美亚洲一区二区| 日本不卡视频在线观看| 欧美日韩情趣电影| 亚洲色图一区二区| 成人福利视频网站| 国产网红主播福利一区二区| 国产一区二区在线视频| 久久久一区二区| 丁香激情综合五月| 国产精品嫩草影院av蜜臀| thepron国产精品| 亚洲日本免费电影| 在线观看视频一区| 日韩成人免费电影| 精品国产乱码久久久久久闺蜜 | 亚洲午夜视频在线观看| 欧美日韩精品系列| 麻豆精品视频在线观看视频| 精品国产伦一区二区三区观看方式 | 911精品国产一区二区在线| 亚洲第一二三四区| 日韩一区二区免费视频| 国产精品一区二区久久精品爱涩| 久久精品一区四区| av电影一区二区| 亚洲国产综合91精品麻豆| 日韩一区二区三区电影在线观看 | 欧美精品xxxxbbbb| 一区二区三区在线观看欧美| 色香蕉久久蜜桃| 日韩黄色免费电影| 国产午夜精品一区二区| 99久久精品久久久久久清纯| 亚洲午夜电影在线观看| 欧美大肚乱孕交hd孕妇| 国产69精品久久777的优势| 亚洲猫色日本管| 欧美欧美欧美欧美首页| 国产盗摄一区二区三区| 亚洲欧洲综合另类| 欧美久久高跟鞋激| 日本成人在线一区| 欧美高清在线精品一区| 欧美人伦禁忌dvd放荡欲情| 成人动漫av在线| 久久国产麻豆精品| 亚洲成人你懂的| 国产精品家庭影院| 久久综合久色欧美综合狠狠| 欧美日韩精品电影| 91亚洲精品久久久蜜桃| 国产精品综合二区| 欧美aaa在线| 亚洲综合丁香婷婷六月香| 国产亚洲婷婷免费| 欧美zozo另类异族| 欧美福利电影网| 91黄视频在线| 9i看片成人免费高清| 国产不卡视频在线播放| 狂野欧美性猛交blacked| 亚洲一区二区三区国产| **网站欧美大片在线观看| 国产午夜精品一区二区三区视频| 日韩视频一区二区三区在线播放| 欧美视频在线一区| 在线视频你懂得一区| 91麻豆精品一区二区三区| 国产精品综合视频| 国内一区二区在线| 精品一区二区三区在线观看| 日韩av一级片| 亚洲国产日日夜夜| 亚洲线精品一区二区三区| 一区二区三区在线视频观看| 亚洲另类在线一区| 亚洲精品视频一区二区|