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

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

?? jcmarker.c

?? windows CE下jpeg壓縮源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * jcmarker.c
 *
 * Copyright (C) 1991-1998, 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 routines to write JPEG datastream markers.
 */

#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.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;


/* Private state */

typedef struct {
  struct jpeg_marker_writer pub; /* public fields */

  unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
} my_marker_writer;

typedef my_marker_writer * my_marker_ptr;


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

LOCAL(void)
emit_byte (j_compress_ptr cinfo, int val)
/* Emit a byte */
{
  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);
  }
}


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, int index)
/* Emit a DQT marker */
/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
{
  JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
  int prec;
  int i;

  if (qtbl == NULL)
    ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);

  prec = 0;
  for (i = 0; i < DCTSIZE2; i++) {
    if (qtbl->quantval[i] > 255)
      prec = 1;
  }

  if (! qtbl->sent_table) {
    emit_marker(cinfo, M_DQT);

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

    emit_byte(cinfo, index + (prec<<4));

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

    qtbl->sent_table = TRUE;
  }

  return prec;
}


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

  if (htbl == NULL)
    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
  
  if (! htbl->sent_table) {
    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, htbl->bits[i]);
    
    for (i = 0; i < length; i++)
      emit_byte(cinfo, htbl->huffval[i]);
    
    htbl->sent_table = TRUE;
  }
}


LOCAL(void)
emit_dac (j_compress_ptr cinfo)
/* Emit a DAC marker */
/* Since the useful info is so small, we want to emit all the tables in */
/* one DAC marker.  Therefore this routine does its own scan of the table. */
{
#ifdef C_ARITH_CODING_SUPPORTED
  char dc_in_use[NUM_ARITH_TBLS];
  char ac_in_use[NUM_ARITH_TBLS];
  int length, i;
  jpeg_component_info *compptr;
  
  for (i = 0; i < NUM_ARITH_TBLS; i++)
    dc_in_use[i] = ac_in_use[i] = 0;
  
  for (i = 0; i < cinfo->comps_in_scan; i++) {
    compptr = cinfo->cur_comp_info[i];
    dc_in_use[compptr->dc_tbl_no] = 1;
    ac_in_use[compptr->ac_tbl_no] = 1;
  }
  
  length = 0;
  for (i = 0; i < NUM_ARITH_TBLS; i++)
    length += dc_in_use[i] + ac_in_use[i];
  
  emit_marker(cinfo, M_DAC);
  
  emit_2bytes(cinfo, length*2 + 2);
  
  for (i = 0; i < NUM_ARITH_TBLS; i++) {
    if (dc_in_use[i]) {
      emit_byte(cinfo, i);
      emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
    }
    if (ac_in_use[i]) {
      emit_byte(cinfo, i + 0x10);
      emit_byte(cinfo, cinfo->arith_ac_K[i]);
    }
  }
#endif /* C_ARITH_CODING_SUPPORTED */
}


LOCAL(void)
emit_dri (j_compress_ptr cinfo)
/* Emit a DRI marker */
{
  emit_marker(cinfo, M_DRI);
  
  emit_2bytes(cinfo, 4);	/* fixed length */

  emit_2bytes(cinfo, (int) cinfo->restart_interval);
}


LOCAL(void)
emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
/* Emit a SOF marker */
{
  int ci;
  jpeg_component_info *compptr;
  
  emit_marker(cinfo, code);
  
  emit_2bytes(cinfo, 3 * cinfo->num_components + 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)
    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);

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

  emit_byte(cinfo, cinfo->num_components);

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    emit_byte(cinfo, compptr->component_id);
    emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
    emit_byte(cinfo, compptr->quant_tbl_no);
  }
}


LOCAL(void)
emit_sos (j_compress_ptr cinfo)
/* Emit a SOS marker */
{
  int i, td, ta;
  jpeg_component_info *compptr;
  
  emit_marker(cinfo, M_SOS);
  
  emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
  
  emit_byte(cinfo, cinfo->comps_in_scan);
  
  for (i = 0; i < cinfo->comps_in_scan; i++) {
    compptr = cinfo->cur_comp_info[i];
    emit_byte(cinfo, compptr->component_id);
    td = compptr->dc_tbl_no;
    ta = compptr->ac_tbl_no;
    if (cinfo->progressive_mode) {
      /* Progressive mode: only DC or only AC tables are used in one scan;
       * furthermore, Huffman coding of DC refinement uses no table at all.
       * We emit 0 for unused field(s); this is recommended by the P&M text
       * but does not seem to be specified in the standard.
       */
      if (cinfo->Ss == 0) {
	ta = 0;			/* DC scan */
	if (cinfo->Ah != 0 && !cinfo->arith_code)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品人在线二区三区| 在线成人免费视频| 国产美女av一区二区三区| 极品销魂美女一区二区三区| 亚洲福利视频一区| 全国精品久久少妇| 免费的成人av| 成人午夜视频免费看| 在线观看一区二区视频| 337p亚洲精品色噜噜| 日韩亚洲欧美综合| 亚洲视频1区2区| 久久福利资源站| 91美女片黄在线观看91美女| 欧美最新大片在线看| 51精品久久久久久久蜜臀| 亚洲精品v日韩精品| 欧美精品三级在线观看| 国产日韩欧美不卡在线| 久久国产麻豆精品| 91久久免费观看| 精品久久久久久久久久久院品网| 中文字幕在线不卡一区二区三区| 亚洲成人av福利| av成人老司机| 日本在线观看不卡视频| 亚洲国产精品久久艾草纯爱| 久久精品一区四区| 日韩中文字幕亚洲一区二区va在线| 国产精品一区二区在线看| 日韩一卡二卡三卡| 亚洲成国产人片在线观看| 91欧美一区二区| 国产精品成人一区二区三区夜夜夜 | 久久精品国产网站| 欧美亚洲愉拍一区二区| 中文字幕一区二区5566日韩| 国产一区二区0| 国产欧美一区二区精品秋霞影院 | 亚洲人一二三区| 极品少妇一区二区| 久久综合久久鬼色中文字| 久久国产精品第一页| 日韩天堂在线观看| 国产一本一道久久香蕉| 久久久久久影视| 成人自拍视频在线观看| xnxx国产精品| jizz一区二区| 亚洲精品视频在线观看网站| 欧美影视一区二区三区| 视频一区二区三区在线| 欧美不卡激情三级在线观看| 精彩视频一区二区三区| 国产精品视频你懂的| 在线这里只有精品| 久久er精品视频| 亚洲欧洲av在线| 欧美精选午夜久久久乱码6080| 人妖欧美一区二区| 国产精品激情偷乱一区二区∴| 在线免费观看日韩欧美| 激情六月婷婷久久| 中文字幕一区二区三区色视频| 欧美日韩国产综合一区二区| 精品伊人久久久久7777人| 亚洲视频狠狠干| 欧美激情在线一区二区| 欧美日韩一区二区在线观看| 韩国午夜理伦三级不卡影院| 一区二区三区四区蜜桃| 中文字幕免费观看一区| 精品国产亚洲在线| 欧美精品色综合| 91麻豆免费看| 99久久99久久精品免费观看| 国产精品影视在线观看| 久久99久久99| 久久97超碰国产精品超碰| 天天综合网天天综合色| 日韩高清不卡一区二区三区| 丝袜亚洲另类欧美| 久久99精品久久久久久久久久久久| 亚洲成av人片观看| 天天色综合天天| 蜜臀久久99精品久久久久久9| 国产一区二区三区免费播放| 国产精品嫩草99a| 日本一区二区免费在线| 综合婷婷亚洲小说| 亚洲午夜精品在线| 日日夜夜精品免费视频| 日本va欧美va欧美va精品| 国产精品综合在线视频| 国产精品1区2区3区| 99久久国产综合精品女不卡| 一本大道av一区二区在线播放| 色综合久久久久久久| 欧美精品久久一区| 国产亚洲精品中文字幕| 亚洲免费在线看| 亚洲成av人片在www色猫咪| 久久狠狠亚洲综合| 在线观看一区二区精品视频| 日韩一区国产二区欧美三区| 久久久久88色偷偷免费| 五月婷婷另类国产| www.av亚洲| 精品国产网站在线观看| 亚洲福利一区二区三区| 99国产精品国产精品久久| 91精品国产麻豆国产自产在线 | 亚洲福利一区二区| 成人av在线资源网| 久久久久久久综合日本| 免费一区二区视频| 欧美艳星brazzers| 亚洲欧美一区二区三区孕妇| 国产精品一二三四区| 精品日韩一区二区三区| 视频一区中文字幕| 欧美精品色综合| 亚洲va欧美va天堂v国产综合| av成人老司机| 亚洲视频1区2区| 大白屁股一区二区视频| 久久天堂av综合合色蜜桃网| 日本伊人午夜精品| 欧美日韩精品三区| 视频一区二区三区中文字幕| 91国内精品野花午夜精品| 一区二区三区四区乱视频| 97精品视频在线观看自产线路二| 国产人成一区二区三区影院| 久久99深爱久久99精品| 久久亚洲精品国产精品紫薇| 麻豆一区二区三| 久久久www成人免费无遮挡大片| 国产一区亚洲一区| 国产精品无圣光一区二区| 欧美一级理论性理论a| 中文字幕亚洲一区二区av在线 | 国产精品久久久爽爽爽麻豆色哟哟 | 精品在线播放免费| 中文字幕一区二区三区四区不卡| 99久久er热在这里只有精品15| 亚洲午夜精品网| 久久精品这里都是精品| 天堂一区二区在线| 欧美韩国日本综合| 欧美麻豆精品久久久久久| 国产成人鲁色资源国产91色综 | 床上的激情91.| 日本视频在线一区| 国产欧美精品一区aⅴ影院 | 日本高清视频一区二区| 成人美女在线视频| 91丨porny丨国产| 91国偷自产一区二区三区观看| 色婷婷久久综合| 成人av在线电影| 美国十次综合导航| 美女视频一区在线观看| 日欧美一区二区| 日韩成人免费电影| 三级欧美韩日大片在线看| 一区二区在线观看免费视频播放| 中文字幕在线不卡一区二区三区| 国产日韩欧美一区二区三区乱码| 欧美日韩国产综合一区二区 | 国产成人精品影视| 国产一本一道久久香蕉| 久久国产精品露脸对白| 麻豆精品久久久| 国产精品911| 免费成人av在线| 国产99一区视频免费| 91蝌蚪porny| 欧美另类一区二区三区| 中文字幕电影一区| 亚洲福利电影网| 91美女精品福利| 久久久久久99久久久精品网站| 一区二区三区中文免费| 日本vs亚洲vs韩国一区三区二区| 高清日韩电视剧大全免费| 欧美日韩一级黄| 亚洲精品一二三| 久久99精品国产麻豆不卡| 91在线高清观看| 国产亚洲欧美日韩日本| 午夜不卡在线视频| 成人精品视频一区二区三区尤物| 欧美日韩三级一区| 亚洲欧美另类在线| 国产激情一区二区三区| 8x福利精品第一导航| 亚洲欧洲制服丝袜| 色悠久久久久综合欧美99| 国产欧美日韩精品在线|