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

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

?? jdmainct.c

?? 一款最完整的工業組態軟源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * jdmainct.c
 *
 * Copyright (C) 1994-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 the main buffer controller for decompression.
 * The main buffer lies between the JPEG decompressor proper and the
 * post-processor; it holds downsampled data in the JPEG colorspace.
 *
 * Note that this code is bypassed in raw-data mode, since the application
 * supplies the equivalent of the main buffer in that case.
 */

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


/*
 * In the current system design, the main buffer need never be a full-image
 * buffer; any full-height buffers will be found inside the coefficient or
 * postprocessing controllers.  Nonetheless, the main controller is not
 * trivial.  Its responsibility is to provide context rows for upsampling/
 * rescaling, and doing this in an efficient fashion is a bit tricky.
 *
 * Postprocessor input data is counted in "row groups".  A row group
 * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
 * sample rows of each component.  (We require DCT_scaled_size values to be
 * chosen such that these numbers are integers.  In practice DCT_scaled_size
 * values will likely be powers of two, so we actually have the stronger
 * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)
 * Upsampling will typically produce max_v_samp_factor pixel rows from each
 * row group (times any additional scale factor that the upsampler is
 * applying).
 *
 * The coefficient controller will deliver data to us one iMCU row at a time;
 * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
 * exactly min_DCT_scaled_size row groups.  (This amount of data corresponds
 * to one row of MCUs when the image is fully interleaved.)  Note that the
 * number of sample rows varies across components, but the number of row
 * groups does not.  Some garbage sample rows may be included in the last iMCU
 * row at the bottom of the image.
 *
 * Depending on the vertical scaling algorithm used, the upsampler may need
 * access to the sample row(s) above and below its current input row group.
 * The upsampler is required to set need_context_rows TRUE at global selection
 * time if so.  When need_context_rows is FALSE, this controller can simply
 * obtain one iMCU row at a time from the coefficient controller and dole it
 * out as row groups to the postprocessor.
 *
 * When need_context_rows is TRUE, this controller guarantees that the buffer
 * passed to postprocessing contains at least one row group's worth of samples
 * above and below the row group(s) being processed.  Note that the context
 * rows "above" the first passed row group appear at negative row offsets in
 * the passed buffer.  At the top and bottom of the image, the required
 * context rows are manufactured by duplicating the first or last real sample
 * row; this avoids having special cases in the upsampling inner loops.
 *
 * The amount of context is fixed at one row group just because that's a
 * convenient number for this controller to work with.  The existing
 * upsamplers really only need one sample row of context.  An upsampler
 * supporting arbitrary output rescaling might wish for more than one row
 * group of context when shrinking the image; tough, we don't handle that.
 * (This is justified by the assumption that downsizing will be handled mostly
 * by adjusting the DCT_scaled_size values, so that the actual scale factor at
 * the upsample step needn't be much less than one.)
 *
 * To provide the desired context, we have to retain the last two row groups
 * of one iMCU row while reading in the next iMCU row.  (The last row group
 * can't be processed until we have another row group for its below-context,
 * and so we have to save the next-to-last group too for its above-context.)
 * We could do this most simply by copying data around in our buffer, but
 * that'd be very slow.  We can avoid copying any data by creating a rather
 * strange pointer structure.  Here's how it works.  We allocate a workspace
 * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
 * of row groups per iMCU row).  We create two sets of redundant pointers to
 * the workspace.  Labeling the physical row groups 0 to M+1, the synthesized
 * pointer lists look like this:
 *                   M+1                          M-1
 * master pointer --> 0         master pointer --> 0
 *                    1                            1
 *                   ...                          ...
 *                   M-3                          M-3
 *                   M-2                           M
 *                   M-1                          M+1
 *                    M                           M-2
 *                   M+1                          M-1
 *                    0                            0
 * We read alternate iMCU rows using each master pointer; thus the last two
 * row groups of the previous iMCU row remain un-overwritten in the workspace.
 * The pointer lists are set up so that the required context rows appear to
 * be adjacent to the proper places when we pass the pointer lists to the
 * upsampler.
 *
 * The above pictures describe the normal state of the pointer lists.
 * At top and bottom of the image, we diddle the pointer lists to duplicate
 * the first or last sample row as necessary (this is cheaper than copying
 * sample rows around).
 *
 * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1.  In that
 * situation each iMCU row provides only one row group so the buffering logic
 * must be different (eg, we must read two iMCU rows before we can emit the
 * first row group).  For now, we simply do not support providing context
 * rows when min_DCT_scaled_size is 1.  That combination seems unlikely to
 * be worth providing --- if someone wants a 1/8th-size preview, they probably
 * want it quick and dirty, so a context-free upsampler is sufficient.
 */


/* Private buffer controller object */

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

  /* Pointer to allocated workspace (M or M+2 row groups). */
  JSAMPARRAY buffer[MAX_COMPONENTS];

  boolean buffer_full;		/* Have we gotten an iMCU row from decoder? */
  JDIMENSION rowgroup_ctr;	/* counts row groups output to postprocessor */

  /* Remaining fields are only used in the context case. */

  /* These are the master pointers to the funny-order pointer lists. */
  JSAMPIMAGE xbuffer[2];	/* pointers to weird pointer lists */

  int whichptr;			/* indicates which pointer set is now in use */
  int context_state;		/* process_data state machine status */
  JDIMENSION rowgroups_avail;	/* row groups available to postprocessor */
  JDIMENSION iMCU_row_ctr;	/* counts iMCU rows to detect image top/bot */
} my_main_controller;

typedef my_main_controller * my_main_ptr;

/* context_state values: */
#define CTX_PREPARE_FOR_IMCU	0	/* need to prepare for MCU row */
#define CTX_PROCESS_IMCU	1	/* feeding iMCU to postprocessor */
#define CTX_POSTPONED_ROW	2	/* feeding postponed row group */


/* Forward declarations */
METHODDEF(void) process_data_simple_main
	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
METHODDEF(void) process_data_context_main
	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
#ifdef QUANT_2PASS_SUPPORTED
METHODDEF(void) process_data_crank_post
	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
#endif


LOCAL(void)
alloc_funny_pointers (j_decompress_ptr cinfo)
/* Allocate space for the funny pointer lists.
 * This is done only once, not once per pass.
 */
{
  my_main_ptr main = (my_main_ptr) cinfo->main;
  int ci, rgroup;
  int M = cinfo->min_DCT_scaled_size;
  jpeg_component_info *compptr;
  JSAMPARRAY xbuf;

  /* Get top-level space for component array pointers.
   * We alloc both arrays with one call to save a few cycles.
   */
  main->xbuffer[0] = (JSAMPIMAGE)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
  main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components;

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
      cinfo->min_DCT_scaled_size; /* height of a row group of component */
    /* Get space for pointer lists --- M+4 row groups in each list.
     * We alloc both pointer lists with one call to save a few cycles.
     */
    xbuf = (JSAMPARRAY)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
    xbuf += rgroup;		/* want one row group at negative offsets */
    main->xbuffer[0][ci] = xbuf;
    xbuf += rgroup * (M + 4);
    main->xbuffer[1][ci] = xbuf;
  }
}


LOCAL(void)
make_funny_pointers (j_decompress_ptr cinfo)
/* Create the funny pointer lists discussed in the comments above.
 * The actual workspace is already allocated (in main->buffer),
 * and the space for the pointer lists is allocated too.
 * This routine just fills in the curiously ordered lists.
 * This will be repeated at the beginning of each pass.
 */
{
  my_main_ptr main = (my_main_ptr) cinfo->main;
  int ci, i, rgroup;
  int M = cinfo->min_DCT_scaled_size;
  jpeg_component_info *compptr;
  JSAMPARRAY buf, xbuf0, xbuf1;

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
      cinfo->min_DCT_scaled_size; /* height of a row group of component */
    xbuf0 = main->xbuffer[0][ci];
    xbuf1 = main->xbuffer[1][ci];
    /* First copy the workspace pointers as-is */
    buf = main->buffer[ci];
    for (i = 0; i < rgroup * (M + 2); i++) {
      xbuf0[i] = xbuf1[i] = buf[i];
    }
    /* In the second list, put the last four row groups in swapped order */
    for (i = 0; i < rgroup * 2; i++) {
      xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];
      xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];
    }
    /* The wraparound pointers at top and bottom will be filled later
     * (see set_wraparound_pointers, below).  Initially we want the "above"
     * pointers to duplicate the first actual data line.  This only needs
     * to happen in xbuffer[0].
     */
    for (i = 0; i < rgroup; i++) {
      xbuf0[i - rgroup] = xbuf0[0];
    }
  }
}


LOCAL(void)
set_wraparound_pointers (j_decompress_ptr cinfo)
/* Set up the "wraparound" pointers at top and bottom of the pointer lists.
 * This changes the pointer list state from top-of-image to the normal state.
 */
{
  my_main_ptr main = (my_main_ptr) cinfo->main;
  int ci, i, rgroup;
  int M = cinfo->min_DCT_scaled_size;
  jpeg_component_info *compptr;
  JSAMPARRAY xbuf0, xbuf1;

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
      cinfo->min_DCT_scaled_size; /* height of a row group of component */
    xbuf0 = main->xbuffer[0][ci];
    xbuf1 = main->xbuffer[1][ci];
    for (i = 0; i < rgroup; i++) {
      xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
      xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区欧美在线观看| 26uuu亚洲婷婷狠狠天堂| 亚洲美女免费视频| 欧美性一二三区| 午夜精品久久久久久久久| 欧美高清hd18日本| 蜜桃视频一区二区三区 | 成人一区二区三区视频| 国产欧美日韩视频在线观看| 成人av在线一区二区| 怡红院av一区二区三区| 7777女厕盗摄久久久| 激情五月激情综合网| 国产精品毛片久久久久久| 欧美专区在线观看一区| 蜜桃视频在线一区| 国产精品福利av| 欧美女孩性生活视频| 国产在线视视频有精品| 中文字幕一区二区三区在线观看| 色天使色偷偷av一区二区| 奇米影视一区二区三区| 国产情人综合久久777777| 色天使久久综合网天天| 激情综合网最新| 亚洲视频1区2区| 欧美成人一区二区三区在线观看| 粉嫩一区二区三区性色av| 亚洲综合区在线| 国产午夜久久久久| 欧美日韩国产一二三| 成人综合激情网| 日韩一区精品字幕| 国产精品国产精品国产专区不蜜 | 秋霞午夜鲁丝一区二区老狼| 国产日韩欧美一区二区三区乱码 | 久久久精品国产免大香伊 | 欧美日韩在线不卡| 成人一二三区视频| 免费高清在线一区| 亚洲激情在线激情| 欧美国产一区二区在线观看| 欧美日本乱大交xxxxx| 成人深夜在线观看| 国模娜娜一区二区三区| 日韩国产在线观看一区| 国产精品美女一区二区三区 | 亚洲va国产va欧美va观看| 欧美国产乱子伦| 精品成人一区二区三区| 欧美日韩国产小视频在线观看| 成人激情视频网站| 国产大片一区二区| 久草在线在线精品观看| 日韩高清不卡在线| 亚洲一区二区黄色| 伊人性伊人情综合网| 中文字幕一区日韩精品欧美| 久久婷婷久久一区二区三区| 正在播放亚洲一区| 欧美日韩亚洲综合在线| 色网站国产精品| 99精品欧美一区| 成人免费毛片片v| 粉嫩久久99精品久久久久久夜| 久久国产人妖系列| 日本欧美久久久久免费播放网| 亚洲一区二区三区爽爽爽爽爽| 国产精品毛片久久久久久| 国产欧美精品区一区二区三区| 精品99久久久久久| 欧美精品一区二区三区高清aⅴ| 日韩免费一区二区三区在线播放| 欧美一级理论片| 日韩欧美一区在线| 日韩精品一区二区三区蜜臀| 欧美一区二区三区在线电影 | 国精产品一区一区三区mba视频| 美国三级日本三级久久99 | 一区二区三区在线不卡| 亚洲三级电影网站| 一区二区三区中文字幕电影| 亚洲国产一区在线观看| 亚洲va韩国va欧美va| 午夜不卡av免费| 麻豆精品国产传媒mv男同| 精品亚洲aⅴ乱码一区二区三区| 国产精品一卡二卡在线观看| 国产精品中文字幕日韩精品| 国产91丝袜在线播放九色| www.亚洲在线| 欧美午夜理伦三级在线观看| 欧美美女一区二区在线观看| 日韩一区二区免费在线观看| 久久久久久免费网| **欧美大码日韩| 亚洲va韩国va欧美va| 九九国产精品视频| 成人白浆超碰人人人人| 色综合天天综合狠狠| 欧美电影一区二区| 久久精品水蜜桃av综合天堂| 亚洲天堂免费在线观看视频| 亚洲一区二区中文在线| 毛片av一区二区| 99精品视频在线免费观看| 欧美性大战久久久久久久蜜臀| 日韩欧美一级二级三级| 国产精品色婷婷久久58| 日韩在线a电影| 国产精品1区2区3区在线观看| 91日韩在线专区| 日韩精品一区在线| 中文字幕一区三区| 奇米色777欧美一区二区| 菠萝蜜视频在线观看一区| 欧美日韩高清在线| 亚洲国产成人一区二区三区| 香蕉av福利精品导航| 国产风韵犹存在线视精品| 欧美视频一区二区三区| 国产日韩欧美电影| 日本91福利区| 91麻豆国产自产在线观看| 日韩片之四级片| 亚洲免费观看视频| 久久99国内精品| 欧美色大人视频| 国产精品天美传媒沈樵| 日本中文在线一区| 日本乱人伦一区| 欧美国产精品一区二区三区| 午夜av一区二区三区| 成人免费看黄yyy456| 日韩欧美久久久| 亚洲国产精品久久人人爱| 国产成人自拍网| 欧美日韩成人在线| 亚洲激情成人在线| 国产一区二区91| 日韩天堂在线观看| 婷婷六月综合网| 91免费版在线| 中文一区二区在线观看| 久久精品国产亚洲aⅴ| 欧美私人免费视频| 亚洲三级视频在线观看| 国产成人精品影视| 久久色在线观看| 毛片av一区二区| 日韩欧美aaaaaa| 日本不卡一二三| 欧美一激情一区二区三区| 亚洲va欧美va国产va天堂影院| 在线视频欧美区| 亚洲免费观看高清| 99视频在线精品| 亚洲三级视频在线观看| 91同城在线观看| 亚洲天堂成人网| 色哟哟一区二区在线观看| 亚洲欧美日韩国产另类专区| 成人黄色一级视频| 国产精品毛片a∨一区二区三区| 国产盗摄精品一区二区三区在线 | 不卡欧美aaaaa| 国产精品久久久久久亚洲毛片| 国产乱人伦偷精品视频不卡| 欧美成人三级电影在线| 久久成人av少妇免费| 日韩一区二区电影网| 久久精品国产在热久久| 26uuu国产日韩综合| 国产福利不卡视频| 中文字幕av免费专区久久| 91一区二区三区在线观看| 亚洲人午夜精品天堂一二香蕉| 色综合久久中文综合久久牛| 亚洲综合在线电影| 欧美久久一二三四区| 日韩av一二三| 欧美精品一区二区三区蜜臀| 国产999精品久久久久久| 国产精品免费视频网站| 在线视频中文字幕一区二区| 亚洲成av人片| 日韩欧美一区二区在线视频| 国产一区二三区| 国产精品丝袜在线| 色婷婷久久久久swag精品| 亚洲成人动漫精品| 欧美变态tickling挠脚心| 国产寡妇亲子伦一区二区| 亚洲三级在线免费观看| 在线观看91av| 国产成人一级电影| 亚洲一区二区三区四区中文字幕| 日韩一级免费一区| 91最新地址在线播放| 日韩 欧美一区二区三区|