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

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

?? jcmaster.c

?? DigitalImageProcessing_base_on_Matlab 基于Matlab的數(shù)字圖像處理
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
 * jcmaster.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 master control logic for the JPEG compressor.
 * These routines are concerned with parameter validation, initial setup,
 * and inter-pass control (determining the number of passes and the work 
 * to be done in each pass).
 */

#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"


/* Private state */

typedef enum {
	main_pass,		/* input data, also do first output step */
	huff_opt_pass,		/* Huffman code optimization pass */
	output_pass		/* data output pass */
} c_pass_type;

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

  c_pass_type pass_type;	/* the type of the current pass */

  int pass_number;		/* # of passes completed */
  int total_passes;		/* total # of passes needed */

  int scan_number;		/* current index in scan_info[] */
} my_comp_master;

typedef my_comp_master * my_master_ptr;


/*
 * Support routines that do various essential calculations.
 */

LOCAL(void)
initial_setup (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
  int ci;
  jpeg_component_info *compptr;
  long samplesperrow;
  JDIMENSION jd_samplesperrow;

  /* Sanity check on image dimensions */
  if (cinfo->image_height <= 0 || cinfo->image_width <= 0
      || cinfo->num_components <= 0 || cinfo->input_components <= 0)
    ERREXIT(cinfo, JERR_EMPTY_IMAGE);

  /* Make sure image isn't bigger than I can handle */
  if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
      (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);

  /* Width of an input scanline must be representable as JDIMENSION. */
  samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;
  jd_samplesperrow = (JDIMENSION) samplesperrow;
  if ((long) jd_samplesperrow != samplesperrow)
    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);

  /* For now, precision must match compiled-in value... */
  if (cinfo->data_precision != BITS_IN_JSAMPLE)
    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);

  /* Check that number of components won't exceed internal array sizes */
  if (cinfo->num_components > MAX_COMPONENTS)
    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
	     MAX_COMPONENTS);

  /* Compute maximum sampling factors; check factor validity */
  cinfo->max_h_samp_factor = 1;
  cinfo->max_v_samp_factor = 1;
  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
	compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
      ERREXIT(cinfo, JERR_BAD_SAMPLING);
    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
				   compptr->h_samp_factor);
    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
				   compptr->v_samp_factor);
  }

  /* Compute dimensions of components */
  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    /* Fill in the correct component_index value; don't rely on application */
    compptr->component_index = ci;
    /* For compression, we never do DCT scaling. */
    compptr->DCT_scaled_size = DCTSIZE;
    /* Size in DCT blocks */
    compptr->width_in_blocks = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
		    (long) (cinfo->max_h_samp_factor * DCTSIZE));
    compptr->height_in_blocks = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
		    (long) (cinfo->max_v_samp_factor * DCTSIZE));
    /* Size in samples */
    compptr->downsampled_width = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
		    (long) cinfo->max_h_samp_factor);
    compptr->downsampled_height = (JDIMENSION)
      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
		    (long) cinfo->max_v_samp_factor);
    /* Mark component needed (this flag isn't actually used for compression) */
    compptr->component_needed = TRUE;
  }

  /* Compute number of fully interleaved MCU rows (number of times that
   * main controller will call coefficient controller).
   */
  cinfo->total_iMCU_rows = (JDIMENSION)
    jdiv_round_up((long) cinfo->image_height,
		  (long) (cinfo->max_v_samp_factor*DCTSIZE));
}


#ifdef C_MULTISCAN_FILES_SUPPORTED

LOCAL(void)
validate_script (j_compress_ptr cinfo)
/* Verify that the scan script in cinfo->scan_info[] is valid; also
 * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
 */
{
  const jpeg_scan_info * scanptr;
  int scanno, ncomps, ci, coefi, thisi;
  int Ss, Se, Ah, Al;
  boolean component_sent[MAX_COMPONENTS];
#ifdef C_PROGRESSIVE_SUPPORTED
  int * last_bitpos_ptr;
  int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
  /* -1 until that coefficient has been seen; then last Al for it */
#endif

  if (cinfo->num_scans <= 0)
    ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);

  /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;
   * for progressive JPEG, no scan can have this.
   */
  scanptr = cinfo->scan_info;
  if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {
#ifdef C_PROGRESSIVE_SUPPORTED
    cinfo->progressive_mode = TRUE;
    last_bitpos_ptr = & last_bitpos[0][0];
    for (ci = 0; ci < cinfo->num_components; ci++) 
      for (coefi = 0; coefi < DCTSIZE2; coefi++)
	*last_bitpos_ptr++ = -1;
#else
    ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
  } else {
    cinfo->progressive_mode = FALSE;
    for (ci = 0; ci < cinfo->num_components; ci++) 
      component_sent[ci] = FALSE;
  }

  for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {
    /* Validate component indexes */
    ncomps = scanptr->comps_in_scan;
    if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)
      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);
    for (ci = 0; ci < ncomps; ci++) {
      thisi = scanptr->component_index[ci];
      if (thisi < 0 || thisi >= cinfo->num_components)
	ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
      /* Components must appear in SOF order within each scan */
      if (ci > 0 && thisi <= scanptr->component_index[ci-1])
	ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
    }
    /* Validate progression parameters */
    Ss = scanptr->Ss;
    Se = scanptr->Se;
    Ah = scanptr->Ah;
    Al = scanptr->Al;
    if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
      if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
	  Ah < 0 || Ah > 13 || Al < 0 || Al > 13)
	ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
      if (Ss == 0) {
	if (Se != 0)		/* DC and AC together not OK */
	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
      } else {
	if (ncomps != 1)	/* AC scans must be for only one component */
	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
      }
      for (ci = 0; ci < ncomps; ci++) {
	last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
	if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
	for (coefi = Ss; coefi <= Se; coefi++) {
	  if (last_bitpos_ptr[coefi] < 0) {
	    /* first scan of this coefficient */
	    if (Ah != 0)
	      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
	  } else {
	    /* not first scan */
	    if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
	      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
	  }
	  last_bitpos_ptr[coefi] = Al;
	}
      }
#endif
    } else {
      /* For sequential JPEG, all progression parameters must be these: */
      if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
	ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
      /* Make sure components are not sent twice */
      for (ci = 0; ci < ncomps; ci++) {
	thisi = scanptr->component_index[ci];
	if (component_sent[thisi])
	  ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
	component_sent[thisi] = TRUE;
      }
    }
  }

  /* Now verify that everything got sent. */
  if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
    /* For progressive mode, we only check that at least some DC data
     * got sent for each component; the spec does not require that all bits
     * of all coefficients be transmitted.  Would it be wiser to enforce
     * transmission of all coefficient bits??
     */
    for (ci = 0; ci < cinfo->num_components; ci++) {
      if (last_bitpos[ci][0] < 0)
	ERREXIT(cinfo, JERR_MISSING_DATA);
    }
#endif
  } else {
    for (ci = 0; ci < cinfo->num_components; ci++) {
      if (! component_sent[ci])
	ERREXIT(cinfo, JERR_MISSING_DATA);
    }
  }
}

#endif /* C_MULTISCAN_FILES_SUPPORTED */


LOCAL(void)
select_scan_parameters (j_compress_ptr cinfo)
/* Set up the scan parameters for the current scan */
{
  int ci;

#ifdef C_MULTISCAN_FILES_SUPPORTED
  if (cinfo->scan_info != NULL) {
    /* Prepare for current scan --- the script is already validated */
    my_master_ptr master = (my_master_ptr) cinfo->master;
    const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;

    cinfo->comps_in_scan = scanptr->comps_in_scan;
    for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
      cinfo->cur_comp_info[ci] =
	&cinfo->comp_info[scanptr->component_index[ci]];
    }
    cinfo->Ss = scanptr->Ss;
    cinfo->Se = scanptr->Se;
    cinfo->Ah = scanptr->Ah;
    cinfo->Al = scanptr->Al;
  }
  else
#endif
  {
    /* Prepare for single sequential-JPEG scan containing all components */
    if (cinfo->num_components > MAX_COMPS_IN_SCAN)
      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
	       MAX_COMPS_IN_SCAN);
    cinfo->comps_in_scan = cinfo->num_components;
    for (ci = 0; ci < cinfo->num_components; ci++) {
      cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
    }
    cinfo->Ss = 0;
    cinfo->Se = DCTSIZE2-1;
    cinfo->Ah = 0;
    cinfo->Al = 0;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
69p69国产精品| 国产欧美日韩在线| 欧美在线不卡一区| 成人午夜精品在线| 国产99久久久久| 国产精品一区二区不卡| 日韩在线播放一区二区| 亚洲高清视频中文字幕| 亚洲欧美国产高清| 亚洲精品中文字幕在线观看| 国产精品色哟哟| 中文欧美字幕免费| 国产欧美一区二区三区在线看蜜臀| 欧美精品aⅴ在线视频| 欧美视频精品在线观看| 色综合久久久久综合体| www.综合网.com| 成人av在线网站| 一本色道久久综合狠狠躁的推荐 | 2014亚洲片线观看视频免费| 91精品久久久久久久久99蜜臂| 日韩一区二区三区在线| 日韩一区二区三区精品视频| 久久综合色8888| 26uuu精品一区二区在线观看| 日韩视频免费观看高清在线视频| 欧美tk—视频vk| 久久久亚洲欧洲日产国码αv| 国产精品不卡一区二区三区| 国产精品乱人伦| 亚洲午夜一区二区三区| 日本视频在线一区| 亚洲国产综合在线| 极品尤物av久久免费看| 国产一区日韩二区欧美三区| 99久久婷婷国产综合精品电影 | 成人激情文学综合网| 国产精品亚洲一区二区三区妖精| www.综合网.com| 在线观看三级视频欧美| 精品免费国产二区三区| 国产日韩av一区二区| 一区二区三区欧美| 日韩中文字幕av电影| 懂色av一区二区夜夜嗨| 日本道免费精品一区二区三区| 97国产一区二区| 日韩欧美高清一区| 国产婷婷色一区二区三区四区 | 欧美视频一二三区| 日韩欧美一二三四区| 精品国产成人系列| 国产精品网站在线观看| 国产精品久久久久久户外露出| 亚洲欧美一区二区三区极速播放 | k8久久久一区二区三区| 在线亚洲人成电影网站色www| 在线视频综合导航| 久久久影院官网| 亚洲影院久久精品| 国产一区二区免费视频| 97久久精品人人澡人人爽| 欧美精品日韩精品| 国产欧美一区二区精品忘忧草| 中文av一区特黄| 性欧美疯狂xxxxbbbb| 成人精品视频一区二区三区尤物| 91国偷自产一区二区三区成为亚洲经典 | 午夜电影久久久| 成人免费高清视频| 欧美夫妻性生活| 亚洲女同一区二区| 国产一区二区三区四| 欧美高清激情brazzers| 国产精品麻豆一区二区| 国产在线精品免费av| 日本高清无吗v一区| 国产欧美一区二区精品忘忧草| 专区另类欧美日韩| 国产在线精品一区在线观看麻豆| 91在线观看下载| 精品成人佐山爱一区二区| 亚洲免费观看高清| 99精品欧美一区二区三区小说 | 91精品国产91久久久久久一区二区 | 在线视频一区二区免费| 久久精品一区蜜桃臀影院| 亚洲国产精品一区二区久久| 日一区二区三区| 色一情一伦一子一伦一区| 国产精品成人免费在线| 狠狠色丁香久久婷婷综合_中| 91精品国产高清一区二区三区| 亚洲欧美偷拍另类a∨色屁股| 成人性生交大片免费看在线播放| 日韩精品一区二区三区视频播放 | 综合色中文字幕| 韩国欧美一区二区| 91麻豆精品国产自产在线| 亚洲国产高清在线观看视频| 国产成人免费视频网站高清观看视频 | 日韩av二区在线播放| 色综合天天狠狠| 欧美国产综合色视频| 欧美aaaaaa午夜精品| 日韩一级黄色片| 亚洲v中文字幕| 91国产免费看| 一区二区三区四区精品在线视频| av亚洲产国偷v产偷v自拍| 欧美激情综合五月色丁香| 国产激情视频一区二区三区欧美 | 亚洲精品日日夜夜| caoporen国产精品视频| 555www色欧美视频| 日韩va欧美va亚洲va久久| 在线观看成人免费视频| 亚洲尤物在线视频观看| 欧美视频在线观看一区| 亚洲一本大道在线| 欧美日韩午夜在线视频| 婷婷国产v国产偷v亚洲高清| 日韩欧美一区在线| 麻豆精品视频在线观看视频| 久久久久久夜精品精品免费| 国产揄拍国内精品对白| 中文无字幕一区二区三区| 成人精品免费看| 一区二区三区在线高清| 色av一区二区| 日本va欧美va欧美va精品| 91精品国产91热久久久做人人| 国模一区二区三区白浆| 亚洲国产精品黑人久久久| 色中色一区二区| 亚洲一级二级三级| 日韩欧美中文字幕制服| 国产经典欧美精品| 一区二区三区不卡视频| 欧美日韩在线免费视频| 狂野欧美性猛交blacked| 精品sm捆绑视频| 国产自产v一区二区三区c| 亚洲精品写真福利| 欧美图片一区二区三区| 国产麻豆欧美日韩一区| 国产三级一区二区三区| 在线精品视频免费播放| 免费一级片91| 亚洲激情在线播放| 制服.丝袜.亚洲.中文.综合| 暴力调教一区二区三区| 亚洲精品成人在线| 国产婷婷一区二区| 在线视频一区二区免费| 国产精品一区不卡| 一区二区三区在线免费观看| 久久这里只有精品首页| 国内精品久久久久影院薰衣草| 中文字幕日本乱码精品影院| 欧美日韩不卡在线| 东方欧美亚洲色图在线| 免费成人在线观看视频| 中文字幕一区二区5566日韩| 精品少妇一区二区三区日产乱码| 成人不卡免费av| 国产一区二区免费看| 亚洲自拍偷拍九九九| 亚洲国产精品t66y| 91麻豆精品国产| 在线看日本不卡| 国产一二三精品| 秋霞午夜av一区二区三区| 国产精品免费看片| 久久久精品日韩欧美| 在线观看日韩av先锋影音电影院| 成人爽a毛片一区二区免费| 午夜天堂影视香蕉久久| 亚洲视频1区2区| 26uuu精品一区二区三区四区在线| 欧美日韩一二三| 亚洲猫色日本管| 午夜精品久久久久久久蜜桃app| 国产精品888| 精品国产免费人成电影在线观看四季 | 成人综合日日夜夜| 蜜芽一区二区三区| 岛国精品在线观看| 欧美日韩一区 二区 三区 久久精品| 在线不卡免费av| 亚洲综合激情网| 久久国产视频网| 日韩欧美国产一区在线观看| av一区二区久久| 成人激情动漫在线观看| 麻豆免费看一区二区三区| 日韩黄色一级片| 夜夜亚洲天天久久| 一区二区三区免费| 国产精品久久久久久久久免费相片 |