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

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

?? rdswitch.c

?? 常好且全面的jpeg圖像壓縮算法
?? C
字號:
/*
 * rdswitch.c
 *
 * Copyright (C) 1991-1996, 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 process some of cjpeg's more complicated
 * command-line switches.  Switches processed here are:
 *	-qtables file		Read quantization tables from text file
 *	-scans file		Read scan script from text file
 *	-qslots N[,N,...]	Set component quantization table selectors
 *	-sample HxV[,HxV,...]	Set component sampling factors
 */

#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
#include <ctype.h>		/* to declare isdigit(), isspace() */


LOCAL(int)
text_getc (FILE * file)
/* Read next char, skipping over any comments (# to end of line) */
/* A comment/newline sequence is returned as a newline */
{
  register int ch;
  
  ch = getc(file);
  if (ch == '#') {
    do {
      ch = getc(file);
    } while (ch != '\n' && ch != EOF);
  }
  return ch;
}


LOCAL(boolean)
read_text_integer (FILE * file, long * result, int * termchar)
/* Read an unsigned decimal integer from a file, store it in result */
/* Reads one trailing character after the integer; returns it in termchar */
{
  register int ch;
  register long val;
  
  /* Skip any leading whitespace, detect EOF */
  do {
    ch = text_getc(file);
    if (ch == EOF) {
      *termchar = ch;
      return FALSE;
    }
  } while (isspace(ch));
  
  if (! isdigit(ch)) {
    *termchar = ch;
    return FALSE;
  }

  val = ch - '0';
  while ((ch = text_getc(file)) != EOF) {
    if (! isdigit(ch))
      break;
    val *= 10;
    val += ch - '0';
  }
  *result = val;
  *termchar = ch;
  return TRUE;
}


GLOBAL(boolean)
read_quant_tables (j_compress_ptr cinfo, char * filename,
		   int scale_factor, boolean force_baseline)
/* Read a set of quantization tables from the specified file.
 * The file is plain ASCII text: decimal numbers with whitespace between.
 * Comments preceded by '#' may be included in the file.
 * There may be one to NUM_QUANT_TBLS tables in the file, each of 64 values.
 * The tables are implicitly numbered 0,1,etc.
 * NOTE: does not affect the qslots mapping, which will default to selecting
 * table 0 for luminance (or primary) components, 1 for chrominance components.
 * You must use -qslots if you want a different component->table mapping.
 */
{
  FILE * fp;
  int tblno, i, termchar;
  long val;
  unsigned int table[DCTSIZE2];

  if ((fp = fopen(filename, "r")) == NULL) {
    fprintf(stderr, "Can't open table file %s\n", filename);
    return FALSE;
  }
  tblno = 0;

  while (read_text_integer(fp, &val, &termchar)) { /* read 1st element of table */
    if (tblno >= NUM_QUANT_TBLS) {
      fprintf(stderr, "Too many tables in file %s\n", filename);
      fclose(fp);
      return FALSE;
    }
    table[0] = (unsigned int) val;
    for (i = 1; i < DCTSIZE2; i++) {
      if (! read_text_integer(fp, &val, &termchar)) {
	fprintf(stderr, "Invalid table data in file %s\n", filename);
	fclose(fp);
	return FALSE;
      }
      table[i] = (unsigned int) val;
    }
    jpeg_add_quant_table(cinfo, tblno, table, scale_factor, force_baseline);
    tblno++;
  }

  if (termchar != EOF) {
    fprintf(stderr, "Non-numeric data in file %s\n", filename);
    fclose(fp);
    return FALSE;
  }

  fclose(fp);
  return TRUE;
}


#ifdef C_MULTISCAN_FILES_SUPPORTED

LOCAL(boolean)
read_scan_integer (FILE * file, long * result, int * termchar)
/* Variant of read_text_integer that always looks for a non-space termchar;
 * this simplifies parsing of punctuation in scan scripts.
 */
{
  register int ch;

  if (! read_text_integer(file, result, termchar))
    return FALSE;
  ch = *termchar;
  while (ch != EOF && isspace(ch))
    ch = text_getc(file);
  if (isdigit(ch)) {		/* oops, put it back */
    if (ungetc(ch, file) == EOF)
      return FALSE;
    ch = ' ';
  } else {
    /* Any separators other than ';' and ':' are ignored;
     * this allows user to insert commas, etc, if desired.
     */
    if (ch != EOF && ch != ';' && ch != ':')
      ch = ' ';
  }
  *termchar = ch;
  return TRUE;
}


GLOBAL(boolean)
read_scan_script (j_compress_ptr cinfo, char * filename)
/* Read a scan script from the specified text file.
 * Each entry in the file defines one scan to be emitted.
 * Entries are separated by semicolons ';'.
 * An entry contains one to four component indexes,
 * optionally followed by a colon ':' and four progressive-JPEG parameters.
 * The component indexes denote which component(s) are to be transmitted
 * in the current scan.  The first component has index 0.
 * Sequential JPEG is used if the progressive-JPEG parameters are omitted.
 * The file is free format text: any whitespace may appear between numbers
 * and the ':' and ';' punctuation marks.  Also, other punctuation (such
 * as commas or dashes) can be placed between numbers if desired.
 * Comments preceded by '#' may be included in the file.
 * Note: we do very little validity checking here;
 * jcmaster.c will validate the script parameters.
 */
{
  FILE * fp;
  int scanno, ncomps, termchar;
  long val;
  jpeg_scan_info * scanptr;
#define MAX_SCANS  100		/* quite arbitrary limit */
  jpeg_scan_info scans[MAX_SCANS];

  if ((fp = fopen(filename, "r")) == NULL) {
    fprintf(stderr, "Can't open scan definition file %s\n", filename);
    return FALSE;
  }
  scanptr = scans;
  scanno = 0;

  while (read_scan_integer(fp, &val, &termchar)) {
    if (scanno >= MAX_SCANS) {
      fprintf(stderr, "Too many scans defined in file %s\n", filename);
      fclose(fp);
      return FALSE;
    }
    scanptr->component_index[0] = (int) val;
    ncomps = 1;
    while (termchar == ' ') {
      if (ncomps >= MAX_COMPS_IN_SCAN) {
	fprintf(stderr, "Too many components in one scan in file %s\n",
		filename);
	fclose(fp);
	return FALSE;
      }
      if (! read_scan_integer(fp, &val, &termchar))
	goto bogus;
      scanptr->component_index[ncomps] = (int) val;
      ncomps++;
    }
    scanptr->comps_in_scan = ncomps;
    if (termchar == ':') {
      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
	goto bogus;
      scanptr->Ss = (int) val;
      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
	goto bogus;
      scanptr->Se = (int) val;
      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
	goto bogus;
      scanptr->Ah = (int) val;
      if (! read_scan_integer(fp, &val, &termchar))
	goto bogus;
      scanptr->Al = (int) val;
    } else {
      /* set non-progressive parameters */
      scanptr->Ss = 0;
      scanptr->Se = DCTSIZE2-1;
      scanptr->Ah = 0;
      scanptr->Al = 0;
    }
    if (termchar != ';' && termchar != EOF) {
bogus:
      fprintf(stderr, "Invalid scan entry format in file %s\n", filename);
      fclose(fp);
      return FALSE;
    }
    scanptr++, scanno++;
  }

  if (termchar != EOF) {
    fprintf(stderr, "Non-numeric data in file %s\n", filename);
    fclose(fp);
    return FALSE;
  }

  if (scanno > 0) {
    /* Stash completed scan list in cinfo structure.
     * NOTE: for cjpeg's use, JPOOL_IMAGE is the right lifetime for this data,
     * but if you want to compress multiple images you'd want JPOOL_PERMANENT.
     */
    scanptr = (jpeg_scan_info *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  scanno * SIZEOF(jpeg_scan_info));
    MEMCOPY(scanptr, scans, scanno * SIZEOF(jpeg_scan_info));
    cinfo->scan_info = scanptr;
    cinfo->num_scans = scanno;
  }

  fclose(fp);
  return TRUE;
}

#endif /* C_MULTISCAN_FILES_SUPPORTED */


GLOBAL(boolean)
set_quant_slots (j_compress_ptr cinfo, char *arg)
/* Process a quantization-table-selectors parameter string, of the form
 *     N[,N,...]
 * If there are more components than parameters, the last value is replicated.
 */
{
  int val = 0;			/* default table # */
  int ci;
  char ch;

  for (ci = 0; ci < MAX_COMPONENTS; ci++) {
    if (*arg) {
      ch = ',';			/* if not set by sscanf, will be ',' */
      if (sscanf(arg, "%d%c", &val, &ch) < 1)
	return FALSE;
      if (ch != ',')		/* syntax check */
	return FALSE;
      if (val < 0 || val >= NUM_QUANT_TBLS) {
	fprintf(stderr, "JPEG quantization tables are numbered 0..%d\n",
		NUM_QUANT_TBLS-1);
	return FALSE;
      }
      cinfo->comp_info[ci].quant_tbl_no = val;
      while (*arg && *arg++ != ',') /* advance to next segment of arg string */
	;
    } else {
      /* reached end of parameter, set remaining components to last table */
      cinfo->comp_info[ci].quant_tbl_no = val;
    }
  }
  return TRUE;
}


GLOBAL(boolean)
set_sample_factors (j_compress_ptr cinfo, char *arg)
/* Process a sample-factors parameter string, of the form
 *     HxV[,HxV,...]
 * If there are more components than parameters, "1x1" is assumed for the rest.
 */
{
  int ci, val1, val2;
  char ch1, ch2;

  for (ci = 0; ci < MAX_COMPONENTS; ci++) {
    if (*arg) {
      ch2 = ',';		/* if not set by sscanf, will be ',' */
      if (sscanf(arg, "%d%c%d%c", &val1, &ch1, &val2, &ch2) < 3)
	return FALSE;
      if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */
	return FALSE;
      if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {
	fprintf(stderr, "JPEG sampling factors must be 1..4\n");
	return FALSE;
      }
      cinfo->comp_info[ci].h_samp_factor = val1;
      cinfo->comp_info[ci].v_samp_factor = val2;
      while (*arg && *arg++ != ',') /* advance to next segment of arg string */
	;
    } else {
      /* reached end of parameter, set remaining components to 1x1 sampling */
      cinfo->comp_info[ci].h_samp_factor = 1;
      cinfo->comp_info[ci].v_samp_factor = 1;
    }
  }
  return TRUE;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美专区在线| 国产精品一区二区91| 在线观看网站黄不卡| 中文字幕视频一区二区三区久| 国产老妇另类xxxxx| 久久女同性恋中文字幕| 国产福利不卡视频| 国产精品成人在线观看| 成人app在线| 一区二区三区欧美日韩| 欧美视频在线一区二区三区| 三级在线观看一区二区| 日韩欧美激情一区| 国产不卡视频一区二区三区| 国产精品久久久久国产精品日日| 99re视频精品| 日韩中文字幕亚洲一区二区va在线 | 欧美一区二区三区视频在线观看| 日本美女视频一区二区| xvideos.蜜桃一区二区| 成人国产电影网| 亚洲综合在线电影| 日韩精品一区二区三区在线| 国产传媒久久文化传媒| 一区二区不卡在线播放 | 91麻豆精品国产91久久久更新时间| 人人超碰91尤物精品国产| 精品国产精品一区二区夜夜嗨| 粉嫩13p一区二区三区| 一级中文字幕一区二区| 日韩精品一区二区三区四区| 成人福利在线看| 午夜视频在线观看一区| 亚洲在线视频网站| 精品日韩在线一区| 91丨porny丨户外露出| 天堂精品中文字幕在线| 国产欧美1区2区3区| 欧美色爱综合网| 风间由美性色一区二区三区| 亚洲va天堂va国产va久| 欧美国产成人在线| 欧美日韩极品在线观看一区| 国产河南妇女毛片精品久久久 | 国内国产精品久久| 亚洲一区二区综合| 国产欧美一区二区三区在线看蜜臀| 欧美无砖专区一中文字| 高清成人免费视频| 麻豆精品蜜桃视频网站| 一区二区三区免费在线观看| 国产亚洲美州欧州综合国| 欧美三级日本三级少妇99| 成人一区二区视频| 精品无人码麻豆乱码1区2区| 亚洲福中文字幕伊人影院| 国产精品午夜电影| 久久综合九色综合97婷婷| 欧美剧在线免费观看网站| aaa亚洲精品| 国产乱妇无码大片在线观看| 日韩国产一区二| 亚洲午夜激情av| 一区二区三区在线视频免费观看 | 国产精品久99| 国产亚洲精品aa午夜观看| 日韩三级在线观看| 3d成人h动漫网站入口| 91国产福利在线| 91丝袜美腿高跟国产极品老师 | 国产精品麻豆久久久| 久久亚洲一区二区三区明星换脸 | 在线免费观看成人短视频| 成人久久久精品乱码一区二区三区| 麻豆一区二区三| 美腿丝袜亚洲一区| 美女一区二区在线观看| 日本亚洲视频在线| 免费成人深夜小野草| 日韩av网站在线观看| 日韩制服丝袜先锋影音| 视频一区二区国产| 水野朝阳av一区二区三区| 亚洲成人免费观看| 日韩电影免费在线看| 久久精品久久综合| 久久99精品久久久久婷婷| 久久99精品久久久久| 精品一区二区三区视频在线观看| 久久电影网电视剧免费观看| 激情图片小说一区| 国产二区国产一区在线观看| 国产精品1024| 99精品黄色片免费大全| 欧洲在线/亚洲| 91精品在线免费| 日韩亚洲欧美一区| 久久久久久免费毛片精品| 国产精品情趣视频| 亚洲欧美区自拍先锋| 亚洲午夜电影在线| 美国十次了思思久久精品导航| 狠狠色狠狠色综合| 成人网在线免费视频| 99久久精品国产麻豆演员表| 色8久久精品久久久久久蜜| 91麻豆精品国产91久久久使用方法| 日韩欧美国产一区二区三区| 久久久久久久网| 一区二区成人在线| 狠狠色伊人亚洲综合成人| 成人在线视频一区| 欧美日韩国产影片| 久久精子c满五个校花| 亚洲精品一二三四区| 日本成人超碰在线观看| 高清国产午夜精品久久久久久| 色婷婷综合在线| 精品欧美久久久| 亚洲激情在线激情| 精品亚洲欧美一区| 在线精品国精品国产尤物884a| 日韩欧美国产三级电影视频| 国产精品色呦呦| 肉色丝袜一区二区| 成人激情小说网站| 88在线观看91蜜桃国自产| 国产免费久久精品| 视频精品一区二区| 一本久道中文字幕精品亚洲嫩| 欧美一区二区网站| 亚洲欧美韩国综合色| 久久精品国产澳门| 欧美亚洲国产一卡| 国产精品日韩成人| 狠狠色丁香九九婷婷综合五月| 91激情在线视频| 久久久一区二区三区捆绑**| 成人免费毛片高清视频| 3751色影院一区二区三区| 亚洲青青青在线视频| 激情五月婷婷综合网| 欧美日韩国产一二三| 亚洲欧洲av色图| 国产成人免费视频一区| 337p亚洲精品色噜噜狠狠| 亚洲激情网站免费观看| 成人毛片在线观看| 久久综合久久综合久久| 久久精品免费观看| 制服丝袜成人动漫| 亚洲午夜在线电影| 在线观看视频一区二区欧美日韩| 国产精品黄色在线观看| 国产精品一级黄| 久久综合久久99| 国产美女视频一区| 精品国产91亚洲一区二区三区婷婷 | 色伊人久久综合中文字幕| 久久久www成人免费无遮挡大片| 亚洲国产日韩在线一区模特| 国产成人综合网| 久久久久国产精品麻豆| 婷婷国产v国产偷v亚洲高清| 91丨九色porny丨蝌蚪| 久久精品视频免费| 国产精品888| 日韩一区二区视频在线观看| 亚洲自拍偷拍网站| av不卡免费在线观看| 中文字幕亚洲一区二区av在线 | 欧美成人bangbros| 午夜精品在线看| 18欧美乱大交hd1984| 不卡的电视剧免费网站有什么| 欧美精品一区二区三区蜜臀| 日韩av电影免费观看高清完整版在线观看| 成人晚上爱看视频| 国产精品丝袜黑色高跟| 国产福利91精品一区二区三区| 精品国产凹凸成av人网站| 亚洲美女在线一区| 欧日韩精品视频| 亚洲精品国产一区二区三区四区在线| 风间由美一区二区三区在线观看| 中文字幕高清不卡| 国产.精品.日韩.另类.中文.在线.播放| 欧美一区二区啪啪| 免费一区二区视频| 国产亚洲欧美日韩在线一区| 国产成人综合精品三级| wwwwww.欧美系列| 国产在线视频精品一区| 亚洲人成影院在线观看| 色综合久久综合网欧美综合网| 亚洲免费在线视频| 97se狠狠狠综合亚洲狠狠| 亚洲大片在线观看| 日韩一二三区视频| 国产精品一区二区x88av|