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

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

?? jcprepct.c

?? MPEG4解碼程序源代碼(能夠對各種MPEG4文件進行解碼)
?? C
字號:
////////////////////////////////////////////////////////////////////////
//
//	Note : this file is included as part of the Smaller Animals Software
//	JpegFile package. Though this file has not been modified from it's 
//	original IJG 6a form, it is not the responsibility on the Independent
//	JPEG Group to answer questions regarding this code.
//	
//	Any questions you have about this code should be addressed to :
//
//	CHRISDL@PAGESZ.NET	- the distributor of this package.
//
//	Remember, by including this code in the JpegFile package, Smaller 
//	Animals Software assumes all responsibilities for answering questions
//	about it. If we (SA Software) can't answer your questions ourselves, we 
//	will direct you to people who can.
//
//	Thanks, CDL.
//
////////////////////////////////////////////////////////////////////////

/*
 * jcprepct.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 compression preprocessing controller.
 * This controller manages the color conversion, downsampling,
 * and edge expansion steps.
 *
 * Most of the complexity here is associated with buffering input rows
 * as required by the downsampler.  See the comments at the head of
 * jcsample.c for the downsampler's needs.
 */

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


/* At present, jcsample.c can request context rows only for smoothing.
 * In the future, we might also need context rows for CCIR601 sampling
 * or other more-complex downsampling procedures.  The code to support
 * context rows should be compiled only if needed.
 */
#ifdef INPUT_SMOOTHING_SUPPORTED
#define CONTEXT_ROWS_SUPPORTED
#endif


/*
 * For the simple (no-context-row) case, we just need to buffer one
 * row group's worth of pixels for the downsampling step.  At the bottom of
 * the image, we pad to a full row group by replicating the last pixel row.
 * The downsampler's last output row is then replicated if needed to pad
 * out to a full iMCU row.
 *
 * When providing context rows, we must buffer three row groups' worth of
 * pixels.  Three row groups are physically allocated, but the row pointer
 * arrays are made five row groups high, with the extra pointers above and
 * below "wrapping around" to point to the last and first real row groups.
 * This allows the downsampler to access the proper context rows.
 * At the top and bottom of the image, we create dummy context rows by
 * copying the first or last real pixel row.  This copying could be avoided
 * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the
 * trouble on the compression side.
 */


/* Private buffer controller object */

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

  /* Downsampling input buffer.  This buffer holds color-converted data
   * until we have enough to do a downsample step.
   */
  JSAMPARRAY color_buf[MAX_COMPONENTS];

  JDIMENSION rows_to_go;	/* counts rows remaining in source image */
  int next_buf_row;		/* index of next row to store in color_buf */

#ifdef CONTEXT_ROWS_SUPPORTED	/* only needed for context case */
  int this_row_group;		/* starting row index of group to process */
  int next_buf_stop;		/* downsample when we reach this index */
#endif
} my_prep_controller;

typedef my_prep_controller * my_prep_ptr;


/*
 * Initialize for a processing pass.
 */

METHODDEF(void)
start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;

  if (pass_mode != JBUF_PASS_THRU)
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);

  /* Initialize total-height counter for detecting bottom of image */
  prep->rows_to_go = cinfo->image_height;
  /* Mark the conversion buffer empty */
  prep->next_buf_row = 0;
#ifdef CONTEXT_ROWS_SUPPORTED
  /* Preset additional state variables for context mode.
   * These aren't used in non-context mode, so we needn't test which mode.
   */
  prep->this_row_group = 0;
  /* Set next_buf_stop to stop after two row groups have been read in. */
  prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
#endif
}


/*
 * Expand an image vertically from height input_rows to height output_rows,
 * by duplicating the bottom row.
 */

LOCAL(void)
expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
		    int input_rows, int output_rows)
{
  register int row;

  for (row = input_rows; row < output_rows; row++) {
    jcopy_sample_rows(image_data, input_rows-1, image_data, row,
		      1, num_cols);
  }
}


/*
 * Process some data in the simple no-context case.
 *
 * Preprocessor output data is counted in "row groups".  A row group
 * is defined to be v_samp_factor sample rows of each component.
 * Downsampling will produce this much data from each max_v_samp_factor
 * input rows.
 */

METHODDEF(void)
pre_process_data (j_compress_ptr cinfo,
		  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
		  JDIMENSION in_rows_avail,
		  JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
		  JDIMENSION out_row_groups_avail)
{
  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
  int numrows, ci;
  JDIMENSION inrows;
  jpeg_component_info * compptr;

  while (*in_row_ctr < in_rows_avail &&
	 *out_row_group_ctr < out_row_groups_avail) {
    /* Do color conversion to fill the conversion buffer. */
    inrows = in_rows_avail - *in_row_ctr;
    numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
    numrows = (int) MIN((JDIMENSION) numrows, inrows);
    (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
				       prep->color_buf,
				       (JDIMENSION) prep->next_buf_row,
				       numrows);
    *in_row_ctr += numrows;
    prep->next_buf_row += numrows;
    prep->rows_to_go -= numrows;
    /* If at bottom of image, pad to fill the conversion buffer. */
    if (prep->rows_to_go == 0 &&
	prep->next_buf_row < cinfo->max_v_samp_factor) {
      for (ci = 0; ci < cinfo->num_components; ci++) {
	expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
			   prep->next_buf_row, cinfo->max_v_samp_factor);
      }
      prep->next_buf_row = cinfo->max_v_samp_factor;
    }
    /* If we've filled the conversion buffer, empty it. */
    if (prep->next_buf_row == cinfo->max_v_samp_factor) {
      (*cinfo->downsample->downsample) (cinfo,
					prep->color_buf, (JDIMENSION) 0,
					output_buf, *out_row_group_ctr);
      prep->next_buf_row = 0;
      (*out_row_group_ctr)++;
    }
    /* If at bottom of image, pad the output to a full iMCU height.
     * Note we assume the caller is providing a one-iMCU-height output buffer!
     */
    if (prep->rows_to_go == 0 &&
	*out_row_group_ctr < out_row_groups_avail) {
      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	   ci++, compptr++) {
	expand_bottom_edge(output_buf[ci],
			   compptr->width_in_blocks * DCTSIZE,
			   (int) (*out_row_group_ctr * compptr->v_samp_factor),
			   (int) (out_row_groups_avail * compptr->v_samp_factor));
      }
      *out_row_group_ctr = out_row_groups_avail;
      break;			/* can exit outer loop without test */
    }
  }
}


#ifdef CONTEXT_ROWS_SUPPORTED

/*
 * Process some data in the context case.
 */

METHODDEF(void)
pre_process_context (j_compress_ptr cinfo,
		     JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
		     JDIMENSION in_rows_avail,
		     JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
		     JDIMENSION out_row_groups_avail)
{
  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
  int numrows, ci;
  int buf_height = cinfo->max_v_samp_factor * 3;
  JDIMENSION inrows;

  while (*out_row_group_ctr < out_row_groups_avail) {
    if (*in_row_ctr < in_rows_avail) {
      /* Do color conversion to fill the conversion buffer. */
      inrows = in_rows_avail - *in_row_ctr;
      numrows = prep->next_buf_stop - prep->next_buf_row;
      numrows = (int) MIN((JDIMENSION) numrows, inrows);
      (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
					 prep->color_buf,
					 (JDIMENSION) prep->next_buf_row,
					 numrows);
      /* Pad at top of image, if first time through */
      if (prep->rows_to_go == cinfo->image_height) {
	for (ci = 0; ci < cinfo->num_components; ci++) {
	  int row;
	  for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
	    jcopy_sample_rows(prep->color_buf[ci], 0,
			      prep->color_buf[ci], -row,
			      1, cinfo->image_width);
	  }
	}
      }
      *in_row_ctr += numrows;
      prep->next_buf_row += numrows;
      prep->rows_to_go -= numrows;
    } else {
      /* Return for more data, unless we are at the bottom of the image. */
      if (prep->rows_to_go != 0)
	break;
      /* When at bottom of image, pad to fill the conversion buffer. */
      if (prep->next_buf_row < prep->next_buf_stop) {
	for (ci = 0; ci < cinfo->num_components; ci++) {
	  expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
			     prep->next_buf_row, prep->next_buf_stop);
	}
	prep->next_buf_row = prep->next_buf_stop;
      }
    }
    /* If we've gotten enough data, downsample a row group. */
    if (prep->next_buf_row == prep->next_buf_stop) {
      (*cinfo->downsample->downsample) (cinfo,
					prep->color_buf,
					(JDIMENSION) prep->this_row_group,
					output_buf, *out_row_group_ctr);
      (*out_row_group_ctr)++;
      /* Advance pointers with wraparound as necessary. */
      prep->this_row_group += cinfo->max_v_samp_factor;
      if (prep->this_row_group >= buf_height)
	prep->this_row_group = 0;
      if (prep->next_buf_row >= buf_height)
	prep->next_buf_row = 0;
      prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
    }
  }
}


/*
 * Create the wrapped-around downsampling input buffer needed for context mode.
 */

LOCAL(void)
create_context_buffer (j_compress_ptr cinfo)
{
  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
  int rgroup_height = cinfo->max_v_samp_factor;
  int ci, i;
  jpeg_component_info * compptr;
  JSAMPARRAY true_buffer, fake_buffer;

  /* Grab enough space for fake row pointers for all the components;
   * we need five row groups' worth of pointers for each component.
   */
  fake_buffer = (JSAMPARRAY)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				(cinfo->num_components * 5 * rgroup_height) *
				SIZEOF(JSAMPROW));

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    /* Allocate the actual buffer space (3 row groups) for this component.
     * We make the buffer wide enough to allow the downsampler to edge-expand
     * horizontally within the buffer, if it so chooses.
     */
    true_buffer = (*cinfo->mem->alloc_sarray)
      ((j_common_ptr) cinfo, JPOOL_IMAGE,
       (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
		      cinfo->max_h_samp_factor) / compptr->h_samp_factor),
       (JDIMENSION) (3 * rgroup_height));
    /* Copy true buffer row pointers into the middle of the fake row array */
    MEMCOPY(fake_buffer + rgroup_height, true_buffer,
	    3 * rgroup_height * SIZEOF(JSAMPROW));
    /* Fill in the above and below wraparound pointers */
    for (i = 0; i < rgroup_height; i++) {
      fake_buffer[i] = true_buffer[2 * rgroup_height + i];
      fake_buffer[4 * rgroup_height + i] = true_buffer[i];
    }
    prep->color_buf[ci] = fake_buffer + rgroup_height;
    fake_buffer += 5 * rgroup_height; /* point to space for next component */
  }
}

#endif /* CONTEXT_ROWS_SUPPORTED */


/*
 * Initialize preprocessing controller.
 */

GLOBAL(void)
jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
{
  my_prep_ptr prep;
  int ci;
  jpeg_component_info * compptr;

  if (need_full_buffer)		/* safety check */
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);

  prep = (my_prep_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_prep_controller));
  cinfo->prep = (struct jpeg_c_prep_controller *) prep;
  prep->pub.start_pass = start_pass_prep;

  /* Allocate the color conversion buffer.
   * We make the buffer wide enough to allow the downsampler to edge-expand
   * horizontally within the buffer, if it so chooses.
   */
  if (cinfo->downsample->need_context_rows) {
    /* Set up to provide context rows */
#ifdef CONTEXT_ROWS_SUPPORTED
    prep->pub.pre_process_data = pre_process_context;
    create_context_buffer(cinfo);
#else
    ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
  } else {
    /* No context, just make it tall enough for one row group */
    prep->pub.pre_process_data = pre_process_data;
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE,
	 (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
			cinfo->max_h_samp_factor) / compptr->h_samp_factor),
	 (JDIMENSION) cinfo->max_v_samp_factor);
    }
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产原创一区二区| 91精品久久久久久蜜臀| 91国偷自产一区二区开放时间| 一本久道久久综合中文字幕| 欧美日韩小视频| 欧美精品一区男女天堂| 亚洲少妇屁股交4| 日产欧产美韩系列久久99| 国产盗摄一区二区| 91精品国产高清一区二区三区蜜臀 | 高清不卡一二三区| 欧美在线观看一区二区| 久久在线免费观看| 亚洲成人av福利| 成av人片一区二区| 日韩久久精品一区| 香蕉成人伊视频在线观看| 成人美女视频在线观看18| 6080午夜不卡| 亚洲夂夂婷婷色拍ww47| 成人精品视频一区二区三区 | 亚洲色图在线播放| 激情六月婷婷久久| 欧美丰满嫩嫩电影| 一区二区三区影院| 成人影视亚洲图片在线| 精品国产免费视频| 男人的j进女人的j一区| 欧美色网站导航| 亚洲免费高清视频在线| 成人aa视频在线观看| 精品国产一区二区三区四区四| 亚洲自拍都市欧美小说| 色综合天天综合在线视频| 国产欧美一区二区三区网站| 久久精品国产久精国产爱| 欧美精品丝袜久久久中文字幕| 夜夜嗨av一区二区三区网页 | 色94色欧美sute亚洲线路一ni| 亚洲精品在线观看视频| 免费观看久久久4p| 欧美一区二区精品久久911| 亚洲成人先锋电影| 欧美老人xxxx18| 午夜久久久影院| 欧美精品xxxxbbbb| 日韩国产欧美在线观看| 欧美一区二区视频在线观看2022| 亚洲午夜免费电影| 欧美日韩激情一区二区| 三级一区在线视频先锋| 欧美一卡二卡在线| 久久电影网电视剧免费观看| 精品国产伦理网| 国产suv精品一区二区6| 国产精品欧美经典| 91麻豆国产精品久久| 亚洲精品视频在线| 欧美精品欧美精品系列| 久久精品99国产精品| 2020国产精品| 成人免费电影视频| 亚洲美女在线一区| 欧美日本一区二区三区| 日韩av中文字幕一区二区| 日韩视频国产视频| 国产成人日日夜夜| 亚洲三级免费观看| 欧美精品在欧美一区二区少妇| 日韩精品久久久久久| 精品国产乱码久久久久久蜜臀| 国产精品一区二区三区四区| 日韩一区中文字幕| 欧美精品乱人伦久久久久久| 久久99热99| 中文字幕中文乱码欧美一区二区| 91国偷自产一区二区开放时间| 亚洲成人福利片| xfplay精品久久| 99麻豆久久久国产精品免费优播| 亚洲电影一区二区三区| 久久久久久久精| 欧洲视频一区二区| 国产最新精品免费| 亚洲一区二区三区国产| 久久九九久久九九| 欧美系列亚洲系列| 高清视频一区二区| 日韩高清在线电影| 亚洲欧洲日本在线| 日韩片之四级片| 91视频观看免费| 国产精品伊人色| 日韩1区2区日韩1区2区| 国产精品美女久久久久久2018| 91麻豆精品国产无毒不卡在线观看| 国产一区二区精品在线观看| 亚洲成av人片在线| 青青草国产成人av片免费| 国产精品午夜久久| 欧美日韩高清一区二区三区| 成人免费视频国产在线观看| 免费国产亚洲视频| 亚洲一区二区三区四区的| 国产精品三级视频| 久久久.com| 精品理论电影在线观看| 欧美三级视频在线观看| 不卡视频免费播放| 国产盗摄一区二区| 国内精品免费在线观看| 日本不卡视频一二三区| 亚洲制服丝袜在线| 国产精品萝li| 国产欧美日韩一区二区三区在线观看| 91麻豆精品国产91久久久久| 日本高清不卡在线观看| 成人av高清在线| 成人av网站免费观看| 国产成人精品影视| 国产美女一区二区三区| 久久精品国产第一区二区三区| 亚洲综合一二区| 依依成人精品视频| 亚洲精品伦理在线| 亚洲女性喷水在线观看一区| 亚洲欧美怡红院| 亚洲欧洲美洲综合色网| 国产精品动漫网站| 亚洲欧美怡红院| 亚洲男同性视频| 亚洲狠狠爱一区二区三区| 一区二区免费看| 亚洲午夜三级在线| 蜜桃视频一区二区三区 | 一区二区三区四区av| 国产精品久久久久久久第一福利| 中文字幕av一区 二区| 亚洲国产精品av| 中文字幕视频一区二区三区久| 国产精品国产a级| 亚洲色图丝袜美腿| 亚洲成av人片在线| 免费在线观看精品| 国产乱码字幕精品高清av| 国产mv日韩mv欧美| 一本久久综合亚洲鲁鲁五月天| 欧美自拍偷拍一区| 欧美一级高清片| 久久久精品国产免大香伊| 国产精品乱码一区二三区小蝌蚪| 亚洲人快播电影网| 午夜精品久久久久久久| 精品一区二区三区不卡| 风间由美一区二区av101 | 日韩一区二区三区视频在线 | av男人天堂一区| 欧美日韩在线播| 精品美女一区二区| 中文字幕在线不卡国产视频| 成人免费视频播放| 91精品福利视频| 欧美大片一区二区| 国产精品家庭影院| 日韩精品福利网| 成人美女视频在线看| 在线精品视频免费播放| 久久综合色天天久久综合图片| 中文字幕一区二区三区不卡| 五月婷婷激情综合网| 国产成人精品三级麻豆| 欧美在线不卡视频| 亚洲精品一区二区三区99| 亚洲欧美另类小说视频| 久久精品国产亚洲高清剧情介绍| 不卡一区中文字幕| 日韩女同互慰一区二区| 亚洲视频在线一区二区| 看电影不卡的网站| 91成人在线精品| 国产欧美精品在线观看| 奇米精品一区二区三区四区 | 国产成人av一区二区三区在线| 欧洲精品中文字幕| 国产精品丝袜91| 麻豆精品一区二区| 欧美亚洲综合色| 国产精品国产三级国产| 久久99精品国产.久久久久| 91国产福利在线| 中文字幕一区二区三区乱码在线| 麻豆精品在线观看| 欧美日韩国产大片| 亚洲丝袜自拍清纯另类| 成人综合在线网站| 欧美精品一区二区三区蜜桃| 三级影片在线观看欧美日韩一区二区 | 欧美一区二区日韩一区二区| 亚洲蜜桃精久久久久久久| 国产高清亚洲一区|