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

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

?? jdmainct.c

?? windows CE下jpeg壓縮源碼
?? 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精品久久免费看蜜臀剧情介绍| 高清不卡一区二区在线| 一本色道久久综合亚洲精品按摩| 精品少妇一区二区三区日产乱码| 亚洲精品菠萝久久久久久久| 国产精品综合av一区二区国产馆| 欧美日韩一区久久| 亚洲青青青在线视频| 国产一区二区三区精品视频| 日韩一区二区在线观看| 亚洲午夜精品久久久久久久久| 成人亚洲精品久久久久软件| 久久午夜电影网| 美女被吸乳得到大胸91| 欧美日韩激情一区二区三区| 一区二区三区在线视频免费| 国产69精品久久久久毛片| 精品免费视频.| 久久精品国产在热久久| 91精品国产黑色紧身裤美女| 亚洲香蕉伊在人在线观| 91丨porny丨中文| 亚洲人被黑人高潮完整版| 99r精品视频| 亚洲日本护士毛茸茸| 成人黄色大片在线观看| 自拍偷在线精品自拍偷无码专区 | 国产凹凸在线观看一区二区| 日韩欧美国产成人一区二区| 日韩精品亚洲专区| 这里是久久伊人| 日韩高清不卡一区二区三区| 91精品国产福利在线观看 | 国产真实乱偷精品视频免| 欧美成人video| 精品一区二区在线视频| 久久久午夜精品| 国产精品影视在线观看| 久久综合九色综合97婷婷女人| 精品一区二区综合| 国产欧美一区二区精品秋霞影院| 成人综合激情网| 亚洲免费观看视频| 欧美美女一区二区| 麻豆精品久久精品色综合| 2欧美一区二区三区在线观看视频| 国产精品一区2区| 1024国产精品| 制服丝袜成人动漫| 老司机一区二区| 亚洲国产高清aⅴ视频| 91久久精品一区二区| 丝袜国产日韩另类美女| 久久久影视传媒| 色一情一乱一乱一91av| 日韩电影网1区2区| 中文天堂在线一区| 欧美在线短视频| 国产精品一区二区黑丝| 一区二区三区四区在线| 欧美一区二区三区视频| 成人深夜在线观看| 亚洲成在人线免费| 久久久久久久久岛国免费| 色狠狠综合天天综合综合| 免费的成人av| 亚洲精品免费视频| 精品电影一区二区三区| 91女人视频在线观看| 另类小说综合欧美亚洲| 一区二区三区欧美亚洲| 日韩精品在线看片z| 色婷婷国产精品久久包臀| 国产综合一区二区| 亚洲成av人片在线观看无码| 欧美国产精品专区| 欧美一区二区三区免费视频| 91视频精品在这里| 国产在线播放一区| 丝袜美腿亚洲一区二区图片| 国产精品久久久久桃色tv| 精品久久久久久久久久久久久久久| 成人av在线网站| 美腿丝袜亚洲一区| 午夜精品影院在线观看| 国产精品久久三区| 国产亚洲va综合人人澡精品| 欧美一区二区三区的| 日本国产一区二区| 波多野结衣中文字幕一区二区三区| 紧缚奴在线一区二区三区| 天堂va蜜桃一区二区三区| 亚洲日本va午夜在线影院| 中文字幕电影一区| 亚洲精品一区二区三区影院 | 99久久精品免费| 国产一区二区在线影院| 日韩电影一区二区三区| 亚洲国产日韩a在线播放| 国产精品久久久久永久免费观看 | 欧美激情在线观看视频免费| 欧美一区二区播放| 欧美精选在线播放| 欧美性受xxxx黑人xyx性爽| 97精品久久久午夜一区二区三区| 国产激情精品久久久第一区二区| 免费的成人av| 老色鬼精品视频在线观看播放| 一区二区三区日韩在线观看| 亚洲理论在线观看| 亚洲欧美日韩国产一区二区三区| 国产精品国产自产拍高清av王其 | 欧美一区二区三区日韩| 欧美电影在哪看比较好| 欧美裸体bbwbbwbbw| 91精品在线观看入口| 欧美不卡一区二区三区| 欧美成人精品1314www| 日韩免费在线观看| 久久久精品日韩欧美| 亚洲国产精品黑人久久久| 中文字幕免费观看一区| 日本一区二区三级电影在线观看| 精品精品欲导航| 久久久av毛片精品| 中文字幕电影一区| 亚洲男同1069视频| 一区二区三区四区中文字幕| 亚洲国产人成综合网站| 日韩avvvv在线播放| 国产在线精品一区二区三区不卡| 国产精品一区二区男女羞羞无遮挡 | 另类欧美日韩国产在线| 精品一区二区影视| www.日韩av| 在线欧美日韩精品| 精品伦理精品一区| 国产精品色眯眯| 亚洲午夜在线视频| 国产一区二区在线观看视频| 国产精品羞羞答答xxdd| 一本色道久久综合亚洲91| 欧美日本在线一区| 精品福利视频一区二区三区| 中文字幕欧美日韩一区| 亚洲一区成人在线| 国产精品一区二区三区网站| 色婷婷久久一区二区三区麻豆| 在线电影院国产精品| 国产人成一区二区三区影院| 亚洲最大色网站| 精品无码三级在线观看视频| 91福利精品第一导航| 欧美蜜桃一区二区三区| 国产欧美综合色| 视频一区在线播放| 成人毛片视频在线观看| 88在线观看91蜜桃国自产| 国产精品天美传媒沈樵| 日韩高清中文字幕一区| 91麻豆蜜桃一区二区三区| 91精品国产色综合久久不卡电影| 久久久亚洲午夜电影| 三级影片在线观看欧美日韩一区二区 | 91亚洲午夜精品久久久久久| 日韩欧美一卡二卡| 亚洲夂夂婷婷色拍ww47| 成人av在线看| 久久久亚洲精品石原莉奈| 午夜一区二区三区视频| caoporn国产精品| 国产亚洲精品资源在线26u| 爽爽淫人综合网网站| 91麻豆蜜桃一区二区三区| 国产日韩av一区二区| 蜜桃传媒麻豆第一区在线观看| 91官网在线免费观看| 国产精品三级久久久久三级| 激情综合网av| 欧美一级高清片| 日本亚洲欧美天堂免费| 日本道色综合久久| 国产精品青草综合久久久久99| 国产一区二区三区精品视频| 精品奇米国产一区二区三区| 免费在线观看视频一区| 欧美色区777第一页| 亚洲国产精品自拍| 欧美影视一区在线| 一区二区理论电影在线观看| 99精品国产视频| 亚洲三级在线免费观看| 91亚洲精华国产精华精华液| 中文字幕一区二区三中文字幕| 成人高清视频在线| 亚洲欧美视频在线观看| 色综合久久天天| 午夜精品久久久久久久久| 538prom精品视频线放|