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

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

?? jdmainct.c

?? WinCE開發技巧與實例的配套源碼
?? 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一区二区三区免费野_久草精品视频
欧美日韩一级黄| 久久精品国产久精国产爱| 欧美一区二区视频网站| av资源站一区| 日韩福利电影在线| 久久久99精品久久| 日韩三级视频中文字幕| 亚洲精品一区二区三区四区高清| 丁香婷婷综合网| 国产成人精品影视| 韩国中文字幕2020精品| 国产一区二三区| 捆绑紧缚一区二区三区视频| 一区二区三区欧美激情| 一级精品视频在线观看宜春院 | 中文字幕不卡一区| 国产欧美日韩不卡免费| 日韩视频一区二区三区 | 国产成人亚洲综合a∨婷婷图片| 亚洲激情图片一区| 亚洲视频在线观看三级| 日韩毛片在线免费观看| 亚洲乱码日产精品bd| 欧美国产一区视频在线观看| 久久免费看少妇高潮| 国产欧美视频一区二区| 久久久亚洲欧洲日产国码αv| 欧美制服丝袜第一页| 欧美日韩国产精选| 欧美一级二级三级蜜桃| 在线观看91精品国产麻豆| 日韩一区二区电影在线| 欧美三级日韩三级| 日韩欧美精品在线视频| 国产欧美精品一区| 亚洲欧洲在线观看av| 亚洲一区二区三区四区的| 丝袜a∨在线一区二区三区不卡 | 国产视频一区二区在线| 国产精品无人区| 亚洲高清免费观看| 色网综合在线观看| 中文字幕一区二| 成人免费va视频| 日本一区二区三级电影在线观看| 国产一区二区精品在线观看| 欧美一区二区在线视频| 午夜精品福利一区二区三区av| 精品国产3级a| 亚洲欧美日韩国产一区二区三区 | 精品免费日韩av| 久久这里只有精品首页| 国产精品视频一区二区三区不卡| 成人午夜私人影院| 欧美日韩精品系列| 欧美激情一区三区| 日韩精品视频网站| 成人一区二区三区在线观看| 精品视频一区二区不卡| 久久综合成人精品亚洲另类欧美 | 中文字幕在线观看一区二区| 亚洲制服丝袜一区| 国产91精品精华液一区二区三区| 欧美午夜精品久久久| 国产日韩综合av| 久久精品国产精品青草| 成人午夜激情片| 欧美大胆人体bbbb| 亚洲a一区二区| 不卡免费追剧大全电视剧网站| 欧美xfplay| 国产乱人伦偷精品视频免下载| 日韩视频在线一区二区| 久草精品在线观看| 久久欧美一区二区| 国产成人av网站| 久久蜜桃av一区精品变态类天堂| 成人久久久精品乱码一区二区三区| 亚洲一区在线视频| 国产人成一区二区三区影院| 欧美视频中文一区二区三区在线观看| 国产自产v一区二区三区c| 国产精品大尺度| 久久夜色精品国产噜噜av| 在线免费不卡视频| 成人午夜精品在线| 国产毛片精品国产一区二区三区| 亚洲在线免费播放| 亚洲欧美综合网| 国产日韩欧美电影| 精品国产乱码久久久久久1区2区 | 亚洲一区二区偷拍精品| 国产精品拍天天在线| 精品美女一区二区三区| 欧美亚洲综合在线| 色偷偷久久人人79超碰人人澡| 国产精品91一区二区| 蜜桃久久久久久| 日本视频在线一区| 午夜亚洲国产au精品一区二区| 国产精品视频一区二区三区不卡| 精品对白一区国产伦| 欧美一区二区女人| 亚洲精品水蜜桃| 中文字幕在线免费不卡| 国产日韩影视精品| 国产欧美精品一区二区色综合| 精品国精品国产尤物美女| 欧美二区在线观看| 91精品欧美福利在线观看| 欧洲国产伦久久久久久久| 色婷婷久久久综合中文字幕| 99精品1区2区| 欧美性猛交一区二区三区精品| 一本色道久久综合精品竹菊| 91社区在线播放| 91麻豆国产精品久久| 99久久国产综合精品女不卡| 色综合久久88色综合天天6| 91在线视频免费观看| 在线精品国精品国产尤物884a| 色嗨嗨av一区二区三区| 欧美色图12p| 日韩精品中文字幕在线不卡尤物| 欧美一卡二卡在线| 久久久综合激的五月天| 国产欧美久久久精品影院| 国产午夜久久久久| 亚洲欧洲日产国产综合网| 亚洲伊人色欲综合网| 午夜不卡av在线| 狠狠色丁香久久婷婷综| 成人av小说网| 欧美性感一区二区三区| 精品人在线二区三区| 国产精品伦一区二区三级视频| 综合分类小说区另类春色亚洲小说欧美| 亚洲精品水蜜桃| 美女被吸乳得到大胸91| 懂色一区二区三区免费观看| 一本一道波多野结衣一区二区| 欧美精品久久天天躁| 久久色成人在线| 一区二区三区四区视频精品免费 | 国产精品乡下勾搭老头1| 日本在线不卡视频一二三区| 精品制服美女久久| 岛国一区二区三区| 欧美在线免费播放| 久久影视一区二区| 一区二区成人在线视频| 麻豆视频观看网址久久| 成人97人人超碰人人99| 久久久www成人免费无遮挡大片| 日本高清无吗v一区| 欧美日韩另类一区| 欧美国产激情一区二区三区蜜月| 国产精品不卡在线| 一区二区成人在线| 成人激情黄色小说| 蜜桃一区二区三区在线观看| 成人黄页在线观看| 欧美va亚洲va在线观看蝴蝶网| 国产色91在线| 日本亚洲电影天堂| 99久久婷婷国产综合精品电影| 欧美日韩小视频| 亚洲色大成网站www久久九九| 欧美视频在线一区二区三区 | 成人av手机在线观看| 色94色欧美sute亚洲线路一久| 91精品国产一区二区三区| 国产欧美一区二区三区网站| 天堂在线一区二区| 91无套直看片红桃| 亚洲国产精品ⅴa在线观看| 日日夜夜精品视频天天综合网| av电影天堂一区二区在线| 久久久久久久一区| 日韩av中文字幕一区二区三区| 色噜噜久久综合| 国产精品久久久久久久久久免费看| 麻豆视频一区二区| 91精品国产色综合久久| 亚洲精品亚洲人成人网 | 亚洲丝袜自拍清纯另类| 久久国产成人午夜av影院| 欧美一区二区久久| 爽好久久久欧美精品| 亚洲午夜成aⅴ人片| 日韩av一区二区三区| 国产一区二区三区免费在线观看| 成熟亚洲日本毛茸茸凸凹| 8x8x8国产精品| 国产一区二区看久久| 国产在线视视频有精品| 色婷婷综合久色| 亚洲国产精品久久久久秋霞影院| 久久国产尿小便嘘嘘| 在线免费不卡视频|