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

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

?? jccolor.c

?? JPEG壓縮解壓縮源代碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
////////////////////////////////////////////////////////////////////////
//
//	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.
//
////////////////////////////////////////////////////////////////////////
/*
 * jccolor.c
 *
 * Copyright (C) 1991-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 input colorspace conversion routines.
 */

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


/* Private subobject */

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

  /* Private state for RGB->YCC conversion */
  long * rgb_ycc_tab;		/* => table for RGB to YCbCr conversion */
} my_color_converter;

typedef my_color_converter * my_cconvert_ptr;


/**************** RGB -> YCbCr conversion: most common case **************/

/*
 * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
 * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
 * The conversion equations to be implemented are therefore
 *	Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B
 *	Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B  + CENTERJSAMPLE
 *	Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B  + CENTERJSAMPLE
 * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
 * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
 * rather than CENTERJSAMPLE, for Cb and Cr.  This gave equal positive and
 * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
 * were not represented exactly.  Now we sacrifice exact representation of
 * maximum red and maximum blue in order to get exact grayscales.
 *
 * To avoid floating-point arithmetic, we represent the fractional constants
 * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
 * the products by 2^16, with appropriate rounding, to get the correct answer.
 *
 * For even more speed, we avoid doing any multiplications in the inner loop
 * by precalculating the constants times R,G,B for all possible values.
 * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
 * for 12-bit samples it is still acceptable.  It's not very reasonable for
 * 16-bit samples, but if you want lossless storage you shouldn't be changing
 * colorspace anyway.
 * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
 * in the tables to save adding them separately in the inner loop.
 */

#define SCALEBITS	16	/* speediest right-shift on some machines */
#define CBCR_OFFSET	((long) CENTERJSAMPLE << SCALEBITS)
#define ONE_HALF	((long) 1 << (SCALEBITS-1))
#define FIX(x)		((long) ((x) * (1L<<SCALEBITS) + 0.5))

/* We allocate one big table and divide it up into eight parts, instead of
 * doing eight alloc_small requests.  This lets us use a single table base
 * address, which can be held in a register in the inner loops on many
 * machines (more than can hold all eight addresses, anyway).
 */

#define R_Y_OFF		0			/* offset to R => Y section */
#define G_Y_OFF		(1*(MAXJSAMPLE+1))	/* offset to G => Y section */
#define B_Y_OFF		(2*(MAXJSAMPLE+1))	/* etc. */
#define R_CB_OFF	(3*(MAXJSAMPLE+1))
#define G_CB_OFF	(4*(MAXJSAMPLE+1))
#define B_CB_OFF	(5*(MAXJSAMPLE+1))
#define R_CR_OFF	B_CB_OFF		/* B=>Cb, R=>Cr are the same */
#define G_CR_OFF	(6*(MAXJSAMPLE+1))
#define B_CR_OFF	(7*(MAXJSAMPLE+1))
#define TABLE_SIZE	(8*(MAXJSAMPLE+1))


/*
 * Initialize for RGB->YCC colorspace conversion.
 */

METHODDEF(void)
rgb_ycc_start (j_compress_ptr cinfo)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  long * rgb_ycc_tab;
  long i;

  /* Allocate and fill in the conversion tables. */
  cconvert->rgb_ycc_tab = rgb_ycc_tab = (long *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				(TABLE_SIZE * SIZEOF(long)));

  for (i = 0; i <= MAXJSAMPLE; i++) {
    rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
    rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
    rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i     + ONE_HALF;
    rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
    rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
    /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
     * This ensures that the maximum output will round to MAXJSAMPLE
     * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
     */
    rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
/*  B=>Cb and R=>Cr tables are the same
    rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
*/
    rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
    rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
  }
}


/*
 * Convert some rows of samples to the JPEG colorspace.
 *
 * Note that we change from the application's interleaved-pixel format
 * to our internal noninterleaved, one-plane-per-component format.
 * The input buffer is therefore three times as wide as the output buffer.
 *
 * A starting row offset is provided only for the output buffer.  The caller
 * can easily adjust the passed input_buf value to accommodate any row
 * offset required on that side.
 */

METHODDEF(void)
rgb_ycc_convert (j_compress_ptr cinfo,
		 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		 JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register long * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr0, outptr1, outptr2;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr0 = output_buf[0][output_row];
    outptr1 = output_buf[1][output_row];
    outptr2 = output_buf[2][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      r = GETJSAMPLE(inptr[RGB_RED]);
      g = GETJSAMPLE(inptr[RGB_GREEN]);
      b = GETJSAMPLE(inptr[RGB_BLUE]);
      inptr += RGB_PIXELSIZE;
      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
       * must be too; we do not need an explicit range-limiting operation.
       * Hence the value being shifted is never negative, and we don't
       * need the general RIGHT_SHIFT macro.
       */
      /* Y */
      outptr0[col] = (JSAMPLE)
		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
		 >> SCALEBITS);
      /* Cb */
      outptr1[col] = (JSAMPLE)
		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
		 >> SCALEBITS);
      /* Cr */
      outptr2[col] = (JSAMPLE)
		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
		 >> SCALEBITS);
    }
  }
}


/**************** Cases other than RGB -> YCbCr **************/


/*
 * Convert some rows of samples to the JPEG colorspace.
 * This version handles RGB->grayscale conversion, which is the same
 * as the RGB->Y portion of RGB->YCbCr.
 * We assume rgb_ycc_start has been called (we only use the Y tables).
 */

METHODDEF(void)
rgb_gray_convert (j_compress_ptr cinfo,
		  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		  JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register long * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr = output_buf[0][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      r = GETJSAMPLE(inptr[RGB_RED]);
      g = GETJSAMPLE(inptr[RGB_GREEN]);
      b = GETJSAMPLE(inptr[RGB_BLUE]);
      inptr += RGB_PIXELSIZE;
      /* Y */
      outptr[col] = (JSAMPLE)
		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
		 >> SCALEBITS);
    }
  }
}


/*
 * Convert some rows of samples to the JPEG colorspace.
 * This version handles Adobe-style CMYK->YCCK conversion,
 * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
 * conversion as above, while passing K (black) unchanged.
 * We assume rgb_ycc_start has been called.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品伊人久久久久影院对白| 欧美一区二区三区四区五区| 香蕉成人啪国产精品视频综合网| 久久久久久久久一| 精品久久久久久久久久久院品网| 在线视频欧美区| 懂色av一区二区三区蜜臀| 国产激情视频一区二区三区欧美| 国产一区激情在线| 国产91露脸合集magnet| av午夜一区麻豆| 色呦呦日韩精品| 欧美日韩国产首页在线观看| 国产成人福利片| 丁香激情综合国产| 91麻豆蜜桃一区二区三区| 在线精品亚洲一区二区不卡| 欧美日本视频在线| 欧美成人精品高清在线播放| 久久久久久影视| 国产精品丝袜一区| 亚洲美女免费在线| 日本亚洲电影天堂| 国v精品久久久网| 精品三级av在线| 91免费在线看| 国产乱子轮精品视频| 另类欧美日韩国产在线| 亚洲美女偷拍久久| 欧美一卡二卡在线观看| 色婷婷一区二区| 91麻豆视频网站| 欧美一区二区三区在线观看 | 国产精品人人做人人爽人人添| 国产精品国产三级国产普通话蜜臀 | 成人黄色小视频| 日本韩国一区二区| 欧美不卡激情三级在线观看| 欧美一区二区三区在线观看视频 | 综合欧美一区二区三区| 日韩精品亚洲一区二区三区免费| 国产乱码精品一区二区三区av| 99久久精品一区二区| 日韩一级完整毛片| 亚洲欧美福利一区二区| 国产综合色在线视频区| 欧美日韩精品电影| 中文字幕综合网| 国产一区二区免费看| 欧美色电影在线| 亚洲国产激情av| 久久99精品国产麻豆不卡| 色综合色综合色综合色综合色综合| 日韩色视频在线观看| 一区二区三区日韩精品视频| 成人免费高清视频在线观看| 日韩欧美在线观看一区二区三区| 亚洲精品成人少妇| 不卡一区二区在线| 久久久久久久久久久久久女国产乱 | 亚洲国产精品精华液ab| 久久99精品久久久| 日韩一区二区三区电影在线观看 | 一区二区三区成人在线视频| 国产99久久久久| 精品美女一区二区| 蜜桃在线一区二区三区| 欧美日韩成人一区| 亚洲人一二三区| 91丝袜美女网| 1区2区3区精品视频| 成人免费三级在线| 国产精品私人影院| 成人av资源在线观看| 国产精品麻豆欧美日韩ww| 国产黄色成人av| 国产日韩av一区二区| 国产精品538一区二区在线| www精品美女久久久tv| 国产综合久久久久影院| 精品盗摄一区二区三区| 国产一区亚洲一区| 国产丝袜美腿一区二区三区| 国产一区二区在线观看视频| 久久久久综合网| 懂色av噜噜一区二区三区av| 国产精品人成在线观看免费| 成人免费视频app| 亚洲精品大片www| 欧美日韩久久一区二区| 日韩国产精品久久久| 日韩精品资源二区在线| 国产一区二区三区美女| 国产精品情趣视频| 91精品福利视频| 日产国产欧美视频一区精品| 日韩免费一区二区| 成人午夜视频福利| 亚洲激情图片qvod| 欧美一区二区在线免费播放| 国产精品一区二区在线观看网站| 欧美激情在线一区二区三区| 91农村精品一区二区在线| 香蕉成人啪国产精品视频综合网| 日韩精品最新网址| 99久久精品免费| 日韩成人av影视| 中文字幕不卡在线播放| 欧美日韩一区三区四区| 狠狠色狠狠色合久久伊人| 国产精品视频看| 欧美肥妇free| 北条麻妃一区二区三区| 日韩vs国产vs欧美| 1区2区3区国产精品| 日韩区在线观看| 色婷婷激情综合| 国产精品综合二区| 亚洲国产视频网站| 日本一区二区三区免费乱视频| 欧美在线免费观看视频| 国产成人av在线影院| 午夜欧美电影在线观看| 国产精品国产三级国产普通话99 | 国产v日产∨综合v精品视频| 亚洲综合久久久| 中文字幕精品一区| 欧美va亚洲va在线观看蝴蝶网| 91一区二区在线| 国产乱码精品一区二区三| 亚洲成人综合网站| 亚洲欧美电影院| 国产精品久久久久四虎| 久久综合视频网| 日韩三级中文字幕| 欧美日韩午夜在线| 一本一道波多野结衣一区二区| 国产精品一级片| 久久精品国产亚洲a| 午夜伊人狠狠久久| 亚洲一区在线视频观看| 一区二区中文视频| 日本一区二区电影| 欧美国产综合色视频| 精品久久久久久无| 精品久久久久一区二区国产| 欧美精品粉嫩高潮一区二区| 91国内精品野花午夜精品| 成人精品视频.| 国产超碰在线一区| 成人美女视频在线观看| 国产福利91精品一区二区三区| 极品销魂美女一区二区三区| 麻豆一区二区在线| 激情丁香综合五月| 国产麻豆成人传媒免费观看| 黑人巨大精品欧美黑白配亚洲| 男人的j进女人的j一区| 美女一区二区三区在线观看| 蜜臀精品久久久久久蜜臀| 蜜乳av一区二区三区| 麻豆精品视频在线观看免费| 蜜臀av一级做a爰片久久| 美国十次了思思久久精品导航| 毛片基地黄久久久久久天堂| 精品一区二区在线视频| 国内不卡的二区三区中文字幕| 国产一区二区不卡在线| 国产成人av在线影院| av电影在线观看完整版一区二区| 91亚洲精品久久久蜜桃网站 | 亚洲天天做日日做天天谢日日欢| 亚洲另类在线制服丝袜| 亚洲成人精品一区二区| 丝袜亚洲另类欧美| 韩国v欧美v亚洲v日本v| 波多野结衣在线一区| 91视频免费观看| 欧美日韩一区二区在线观看视频| 6080yy午夜一二三区久久| 欧美xxxxx牲另类人与| 欧美国产精品一区| 亚洲国产精品影院| 精品一二三四区| 色网综合在线观看| 欧美一区二区高清| 亚洲色图在线视频| 免费成人在线影院| 成人av网站在线| 欧美精品丝袜久久久中文字幕| 久久久久久毛片| 午夜精品久久久久久久99水蜜桃| 激情五月婷婷综合网| 一本大道久久精品懂色aⅴ| 日韩色视频在线观看| 亚洲欧美偷拍另类a∨色屁股| 久久国产福利国产秒拍| 一本色道久久加勒比精品| 精品国产伦一区二区三区观看方式 | 91丨国产丨九色丨pron|