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

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

?? jdmainct.c

?? WinCE開發(fā)技巧與實(shí)例的配套源碼
?? 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];

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲美女视频一区| caoporen国产精品视频| 亚洲一区二区三区三| 天天色综合成人网| 亚洲成精国产精品女| 日本一区二区三区国色天香| 国产精品美女久久久久久久久 | 99久精品国产| 亚洲在线视频一区| 久久久久久电影| 日本韩国精品在线| 狠狠色2019综合网| 亚洲综合色视频| 欧美成人精品高清在线播放| 色老头久久综合| 丰满白嫩尤物一区二区| 美女久久久精品| 一区二区三区影院| 91麻豆精品国产| 色香蕉成人二区免费| 国产一区二区调教| 久久精品国产精品亚洲综合| 一区二区三区在线视频观看58 | 在线成人免费视频| 国内不卡的二区三区中文字幕| 亚洲444eee在线观看| 国产精品女同互慰在线看| 2020国产精品自拍| 欧美日韩大陆一区二区| 欧美综合在线视频| av不卡免费电影| 成人永久aaa| 韩国av一区二区三区四区 | 欧美日韩国产一区二区三区地区| 国产91在线|亚洲| 国产精品一卡二卡| 亚洲午夜精品一区二区三区他趣| 日韩三级视频中文字幕| 成人精品鲁一区一区二区| 夜夜精品视频一区二区| 精品精品欲导航| 久久国产精品99久久久久久老狼| 777欧美精品| 日韩福利电影在线| 色激情天天射综合网| 亚洲线精品一区二区三区八戒| 色偷偷88欧美精品久久久| 韩日欧美一区二区三区| 国产一区二区视频在线播放| 久久精品国产成人一区二区三区| 日韩电影在线观看一区| 性做久久久久久免费观看欧美| 久久久久久久综合日本| 国产精品视频麻豆| 久久精品网站免费观看| 国产拍欧美日韩视频二区| 欧美大片一区二区| 国产欧美日韩精品在线| 国产日韩欧美精品综合| 亚洲同性gay激情无套| 亚洲日本青草视频在线怡红院| 久久精品一区蜜桃臀影院| 国产精品热久久久久夜色精品三区| 中文字幕精品一区二区精品绿巨人| 欧美性大战久久| 国产成人精品1024| 亚洲影院免费观看| 国产精品久久久久久久久晋中| 欧美电影在线免费观看| 91久久一区二区| 不卡区在线中文字幕| 国产在线不卡一卡二卡三卡四卡| 欧美精品aⅴ在线视频| 久久aⅴ国产欧美74aaa| 极品尤物av久久免费看| 懂色av噜噜一区二区三区av| 国产盗摄精品一区二区三区在线| 99精品黄色片免费大全| 欧美日韩精品综合在线| 久久久久九九视频| 国产精品久久久久久久久晋中| 亚洲成人在线免费| 国内精品不卡在线| 91色九色蝌蚪| 欧美丰满一区二区免费视频| 欧美日韩激情一区二区三区| 久久亚洲精品小早川怜子| 国产精品国产自产拍在线| 偷拍日韩校园综合在线| 狠狠色丁香九九婷婷综合五月| 97se亚洲国产综合自在线| 欧美久久一二区| 国产精品视频一二三| 亚洲国产综合人成综合网站| 国产精品一二二区| 91福利精品视频| 国产免费观看久久| 亚洲成av人片一区二区| 国产精品一区二区黑丝| 欧美亚洲高清一区| 欧美日韩激情一区二区三区| 国产精品久久久久久亚洲毛片| 亚洲国产精品视频| www.一区二区| 日韩精品一区二区三区中文不卡| 亚洲欧美日韩成人高清在线一区| 日韩精品电影一区亚洲| 色婷婷激情综合| 久久久影院官网| 日本不卡不码高清免费观看 | 国产精品丝袜久久久久久app| 午夜精品aaa| 成人国产在线观看| 精品国产精品一区二区夜夜嗨| 亚洲精品成人少妇| 粉嫩绯色av一区二区在线观看 | 欧美电影免费观看高清完整版在线 | 亚洲天堂网中文字| 91丨国产丨九色丨pron| 91网站在线播放| 国产精品国产三级国产有无不卡 | 久久日一线二线三线suv| 亚洲一区二三区| 岛国精品在线播放| 26uuu另类欧美| 日本一区中文字幕| 欧美日韩在线播放三区| 亚洲日本乱码在线观看| 不卡的电视剧免费网站有什么| 欧美一区二区在线免费观看| 日韩视频中午一区| 日韩精品电影在线观看| 色菇凉天天综合网| 中文字幕在线观看不卡视频| 免费看精品久久片| 精品欧美乱码久久久久久| 亚洲第一狼人社区| 欧美在线观看视频在线| 中文字幕乱码一区二区免费| 粉嫩13p一区二区三区| 日韩精品一区二区在线观看| 六月婷婷色综合| 日韩一区二区三区精品视频| 五月婷婷另类国产| 欧美午夜片在线看| 亚洲成人在线免费| 欧美日韩一区视频| 国产精品电影一区二区三区| 99国产精品国产精品毛片| 国产亚洲综合在线| 成人aa视频在线观看| 国产女人18毛片水真多成人如厕| 成人精品视频一区二区三区尤物| 久久久精品欧美丰满| 成人国产亚洲欧美成人综合网| 久久久综合视频| 91同城在线观看| 亚洲色图视频网| 欧美日韩亚洲综合在线 | 久草精品在线观看| 久久―日本道色综合久久| 激情亚洲综合在线| 亚洲色图欧美在线| 色欧美88888久久久久久影院| 夜夜亚洲天天久久| 欧美美女视频在线观看| 激情综合色播激情啊| 国产日韩精品一区二区三区| 91色九色蝌蚪| 亚洲在线视频网站| 久久婷婷国产综合精品青草| 风间由美一区二区三区在线观看 | 国产精品不卡在线观看| 久久久久一区二区三区四区| 欧美福利一区二区| 国产精品18久久久久久久久| 精品亚洲国产成人av制服丝袜| 午夜伊人狠狠久久| 亚洲一二三级电影| 一区二区三区成人| 国产成人h网站| 国产精品一区在线观看你懂的| 亚洲一区二区三区小说| 日本一区二区成人| 亚洲视频在线一区二区| 亚洲欧洲99久久| 正在播放一区二区| 国产成人综合精品三级| 亚洲午夜精品17c| 亚洲精品一区二区精华| 色综合天天综合| 日本伊人午夜精品| 亚洲精品久久嫩草网站秘色| 欧美一区二区福利在线| 成人综合婷婷国产精品久久| 亚洲一区二区三区在线看| wwwwxxxxx欧美| 91精选在线观看| 99视频精品免费视频| 经典三级在线一区|