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

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

?? jdcolor.c

?? EVM板JPEG實現,Texas Instruments TMS320C54x EVM JPEG
?? C
字號:
/*
 * jdcolor.c
 *
 * Copyright (C) 1991, 1992, 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 output colorspace conversion routines.
 * These routines are invoked via the methods color_convert
 * and colorout_init/term.
 */

#include "jinclude.h"


/**************** YCbCr -> RGB 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
 *	R = Y                + 1.40200 * Cr
 *	G = Y - 0.34414 * Cb - 0.71414 * Cr
 *	B = Y + 1.77200 * Cb
 * where Cb and Cr represent the incoming values less MAXJSAMPLE/2.
 * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
 *
 * 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.
 * Notice that Y, being an integral input, does not contribute any fraction
 * so it need not participate in the rounding.
 *
 * For even more speed, we avoid doing any multiplications in the inner loop
 * by precalculating the constants times Cb and Cr 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 Cr=>R and Cb=>B values can be rounded to integers in advance; the
 * values for the G calculation are left scaled up, since we must add them
 * together before rounding.
 */

#ifdef SIXTEEN_BIT_SAMPLES
#define SCALEBITS	14	/* avoid overflow */
#else
#define SCALEBITS	16	/* speedier right-shift on some machines */
#endif
#define ONE_HALF	((INT32) 1 << (SCALEBITS-1))
#define FIX(x)		((INT32) ((x) * (1L<<SCALEBITS) + 0.5))

static int * Cr_r_tab;		/* => table for Cr to R conversion */
static int * Cb_b_tab;		/* => table for Cb to B conversion */
static INT32 * Cr_g_tab;	/* => table for Cr to G conversion */
static INT32 * Cb_g_tab;	/* => table for Cb to G conversion */


/*
 * Initialize for colorspace conversion.
 */

METHODDEF void
ycc_rgb_init (decompress_info_ptr cinfo)
{
  INT32 i, x2;
  SHIFT_TEMPS

  Cr_r_tab = (int *) (*cinfo->emethods->alloc_small)
				((MAXJSAMPLE+1) * SIZEOF(int));
  Cb_b_tab = (int *) (*cinfo->emethods->alloc_small)
				((MAXJSAMPLE+1) * SIZEOF(int));
  Cr_g_tab = (INT32 *) (*cinfo->emethods->alloc_small)
				((MAXJSAMPLE+1) * SIZEOF(INT32));
  Cb_g_tab = (INT32 *) (*cinfo->emethods->alloc_small)
				((MAXJSAMPLE+1) * SIZEOF(INT32));

  for (i = 0; i <= MAXJSAMPLE; i++) {
    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
    /* The Cb or Cr value we are thinking of is x = i - MAXJSAMPLE/2 */
    x2 = 2*i - MAXJSAMPLE;	/* twice x */
    /* Cr=>R value is nearest int to 1.40200 * x */
    Cr_r_tab[i] = (int)
		    RIGHT_SHIFT(FIX(1.40200/2) * x2 + ONE_HALF, SCALEBITS);
    /* Cb=>B value is nearest int to 1.77200 * x */
    Cb_b_tab[i] = (int)
		    RIGHT_SHIFT(FIX(1.77200/2) * x2 + ONE_HALF, SCALEBITS);
    /* Cr=>G value is scaled-up -0.71414 * x */
    Cr_g_tab[i] = (- FIX(0.71414/2)) * x2;
    /* Cb=>G value is scaled-up -0.34414 * x */
    /* We also add in ONE_HALF so that need not do it in inner loop */
    Cb_g_tab[i] = (- FIX(0.34414/2)) * x2 + ONE_HALF;
  }
}


/*
 * Convert some rows of samples to the output colorspace.
 */

METHODDEF void
ycc_rgb_convert (decompress_info_ptr cinfo, int num_rows, long num_cols,
		 JSAMPIMAGE input_data, JSAMPIMAGE output_data)
{
#ifdef SIXTEEN_BIT_SAMPLES
  register INT32 y;
  register UINT16 cb, cr;
#else
  register int y, cb, cr;
#endif
  register JSAMPROW inptr0, inptr1, inptr2;
  register JSAMPROW outptr0, outptr1, outptr2;
  register long col;
  /* copy these pointers into registers if possible */
  register JSAMPLE * range_limit = cinfo->sample_range_limit;
  register int * Crrtab = Cr_r_tab;
  register int * Cbbtab = Cb_b_tab;
  register INT32 * Crgtab = Cr_g_tab;
  register INT32 * Cbgtab = Cb_g_tab;
  int row;
  SHIFT_TEMPS
  
  for (row = 0; row < num_rows; row++) {
    inptr0 = input_data[0][row];
    inptr1 = input_data[1][row];
    inptr2 = input_data[2][row];
    outptr0 = output_data[0][row];
    outptr1 = output_data[1][row];
    outptr2 = output_data[2][row];
    for (col = 0; col < num_cols; col++) {
      y  = GETJSAMPLE(inptr0[col]);
      cb = GETJSAMPLE(inptr1[col]);
      cr = GETJSAMPLE(inptr2[col]);
      /* Note: if the inputs were computed directly from RGB values,
       * range-limiting would be unnecessary here; but due to possible
       * noise in the DCT/IDCT phase, we do need to apply range limits.
       */
      outptr0[col] = range_limit[y + Crrtab[cr]];	/* red */
      outptr1[col] = range_limit[y +			/* green */
				 ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
						    SCALEBITS))];
      outptr2[col] = range_limit[y + Cbbtab[cb]];	/* blue */
    }
  }
}


/*
 * Finish up at the end of the file.
 */

METHODDEF void
ycc_rgb_term (decompress_info_ptr cinfo)
{
  /* no work (we let free_all release the workspace) */
}


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


/*
 * Initialize for colorspace conversion.
 */

METHODDEF void
null_init (decompress_info_ptr cinfo)
/* colorout_init for cases where no setup is needed */
{
  /* no work needed */
}


/*
 * Color conversion for no colorspace change: just copy the data.
 */

METHODDEF void
null_convert (decompress_info_ptr cinfo, int num_rows, long num_cols,
	      JSAMPIMAGE input_data, JSAMPIMAGE output_data)
{
  short ci;

  for (ci = 0; ci < cinfo->num_components; ci++) {
    jcopy_sample_rows(input_data[ci], 0, output_data[ci], 0,
		      num_rows, num_cols);
  }
}


/*
 * Color conversion for grayscale: just copy the data.
 * This also works for YCbCr/YIQ -> grayscale conversion, in which
 * we just copy the Y (luminance) component and ignore chrominance.
 */

METHODDEF void
grayscale_convert (decompress_info_ptr cinfo, int num_rows, long num_cols,
		   JSAMPIMAGE input_data, JSAMPIMAGE output_data)
{
  jcopy_sample_rows(input_data[0], 0, output_data[0], 0,
		    num_rows, num_cols);
}


/*
 * Finish up at the end of the file.
 */

METHODDEF void
null_term (decompress_info_ptr cinfo)
/* colorout_term for cases where no teardown is needed */
{
  /* no work needed */
}



/*
 * The method selection routine for output colorspace conversion.
 */

GLOBAL void
jseldcolor (decompress_info_ptr cinfo)
{
  /* Make sure num_components agrees with jpeg_color_space */
  switch (cinfo->jpeg_color_space) {
  case CS_GRAYSCALE:
    if (cinfo->num_components != 1)
    {
/*      ERREXIT(cinfo->emethods, "Bogus JPEG colorspace"); */
      send_command(ERR9);
      receive_command();
      exit();
    }
    break;

  case CS_RGB:
  case CS_YCbCr:
  case CS_YIQ:
    if (cinfo->num_components != 3)
    {
/*      ERREXIT(cinfo->emethods, "Bogus JPEG colorspace"); */
      send_command(ERR9);
      receive_command();
      exit();
    }
    break;

  case CS_CMYK:
    if (cinfo->num_components != 4)
    {
/*      ERREXIT(cinfo->emethods, "Bogus JPEG colorspace"); */
      send_command(ERR9);
      receive_command();
      exit();
    }
    break;

  default:
   send_command(ERR9);
   receive_command();
   exit();
/*    ERREXIT(cinfo->emethods, "Unsupported JPEG colorspace"); */
    break;
  }

  /* Set color_out_comps and conversion method based on requested space */
  switch (cinfo->out_color_space) {
  case CS_GRAYSCALE:
    cinfo->color_out_comps = 1;
    if (cinfo->jpeg_color_space == CS_GRAYSCALE ||
	cinfo->jpeg_color_space == CS_YCbCr ||
	cinfo->jpeg_color_space == CS_YIQ) {
      cinfo->methods->color_convert = grayscale_convert;
      cinfo->methods->colorout_init = null_init;
      cinfo->methods->colorout_term = null_term;
    } else
    {
/*      ERREXIT(cinfo->emethods, "Unsupported color conversion request"); */
      send_command(ERR9);
      receive_command();
      exit();
    }
    break;

  case CS_RGB:
    cinfo->color_out_comps = 3;
    if (cinfo->jpeg_color_space == CS_YCbCr) {
      cinfo->methods->color_convert = ycc_rgb_convert;
      cinfo->methods->colorout_init = ycc_rgb_init;
      cinfo->methods->colorout_term = ycc_rgb_term;
    } else if (cinfo->jpeg_color_space == CS_RGB) {
      cinfo->methods->color_convert = null_convert;
      cinfo->methods->colorout_init = null_init;
      cinfo->methods->colorout_term = null_term;
    } else
    {
/*      ERREXIT(cinfo->emethods, "Unsupported color conversion request"); */
      send_command(ERR9);
      receive_command();
      exit();
    }
    break;

  default:
    /* Permit null conversion from CMYK or YCbCr to same output space */
    if (cinfo->out_color_space == cinfo->jpeg_color_space) {
      cinfo->color_out_comps = cinfo->num_components;
      cinfo->methods->color_convert = null_convert;
      cinfo->methods->colorout_init = null_init;
      cinfo->methods->colorout_term = null_term;
    } else			/* unsupported non-null conversion */
    {
/*      ERREXIT(cinfo->emethods, "Unsupported color conversion request"); */
      send_command(ERR9);
      receive_command();
      exit();
    }
    break;
  }

  if (cinfo->quantize_colors)
    cinfo->final_out_comps = 1;	/* single colormapped output component */
  else
    cinfo->final_out_comps = cinfo->color_out_comps;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品欧美成人高清一区二区| 国产精品久久久久久久岛一牛影视| 成人免费毛片a| 国产高清亚洲一区| 国产成人免费9x9x人网站视频| 蜜臀av一区二区| 国产美女久久久久| 成人免费黄色大片| 91麻豆免费观看| 欧美日韩成人综合在线一区二区| 欧美日韩免费电影| 精品区一区二区| 国产欧美日韩在线| 亚洲黄色在线视频| 亚洲gay无套男同| 老司机免费视频一区二区三区| 日本不卡不码高清免费观看| 久久成人免费网站| 成人的网站免费观看| 91美女片黄在线观看| 欧美日韩精品电影| 久久久99精品久久| 国产精品国产精品国产专区不蜜 | 亚洲精品国产a久久久久久| 亚洲一区中文日韩| 久久超碰97人人做人人爱| 成人免费黄色在线| 欧美激情一区二区三区不卡 | 99久久国产综合精品色伊| 91国模大尺度私拍在线视频| 欧美丰满少妇xxxxx高潮对白| 精品欧美久久久| 中文字幕精品一区二区精品绿巨人 | 欧美精品 国产精品| 久久久久久久电影| 一区二区免费看| 国产专区综合网| 欧美日韩精品一区二区天天拍小说| 欧美一区二区在线看| 1000精品久久久久久久久| 婷婷激情综合网| 99精品欧美一区二区蜜桃免费| 91精品欧美一区二区三区综合在 | 亚洲国产一区二区视频| 国精产品一区一区三区mba视频| 色综合 综合色| 久久久久高清精品| 青青草国产成人99久久| 91老师片黄在线观看| 欧美成人猛片aaaaaaa| 樱桃国产成人精品视频| 成人一道本在线| 久久综合久久鬼色中文字| 亚洲影视资源网| 91亚洲国产成人精品一区二三| 欧美成人vps| 日本伊人色综合网| 欧美日韩国产一区二区三区地区| 中文字幕中文字幕一区| 国产乱人伦偷精品视频免下载 | 日韩女优av电影在线观看| 亚洲综合一区二区| 91在线精品一区二区| 欧美国产精品专区| 国产精一区二区三区| 日韩欧美精品在线视频| 午夜精品免费在线观看| 欧美日韩精品是欧美日韩精品| 一区二区三区自拍| 色婷婷精品久久二区二区蜜臀av| 国产精品麻豆一区二区| aa级大片欧美| 亚洲精品国产品国语在线app| 9久草视频在线视频精品| 国产精品麻豆视频| 99久久精品99国产精品 | 日韩电影网1区2区| 欧美一二三区在线| 久99久精品视频免费观看| 精品欧美久久久| 国产麻豆视频精品| 国产精品亲子乱子伦xxxx裸| 成人妖精视频yjsp地址| 亚洲视频香蕉人妖| 欧美日韩一级二级三级| 男女激情视频一区| 久久久久亚洲蜜桃| 99久久99久久免费精品蜜臀| 亚洲天堂免费看| 欧美日韩成人在线| 国产乱人伦偷精品视频免下载| 久久久久国产免费免费 | 欧美成人vr18sexvr| 国产麻豆精品视频| 成人欧美一区二区三区黑人麻豆| 欧美午夜在线观看| 老司机一区二区| 成人欧美一区二区三区在线播放| 欧美影院一区二区三区| 久久精品99久久久| 国产精品高潮久久久久无| 欧美亚洲动漫精品| 久久99热99| 一区二区在线电影| ww久久中文字幕| 99久久免费精品高清特色大片| 亚洲va欧美va天堂v国产综合| 欧美v日韩v国产v| 97久久精品人人做人人爽50路| 亚洲成人先锋电影| 欧美激情在线一区二区| 在线观看亚洲一区| 国产精品99久久久久久似苏梦涵 | 激情综合色综合久久| 日韩一区在线免费观看| 日韩写真欧美这视频| 成人激情黄色小说| 蜜臀久久久99精品久久久久久| 国产欧美一区二区精品久导航 | 国产成人精品免费网站| 亚洲国产精品一区二区久久恐怖片| 精品黑人一区二区三区久久| 91首页免费视频| 国产美女主播视频一区| 天天av天天翘天天综合网色鬼国产| 国产日韩av一区| 精品国产免费一区二区三区香蕉| 91搞黄在线观看| youjizz国产精品| 国产一区在线不卡| 麻豆成人av在线| 亚洲国产精品人人做人人爽| 欧美国产国产综合| xvideos.蜜桃一区二区| 日韩欧美一区二区三区在线| 在线精品亚洲一区二区不卡| www.亚洲人| 成人高清av在线| 成人一区二区三区视频在线观看| 久久精品久久精品| 日本亚洲三级在线| 婷婷久久综合九色综合伊人色| 亚洲久草在线视频| 亚洲婷婷国产精品电影人久久| 国产亚洲一区二区三区在线观看 | 麻豆免费看一区二区三区| 亚洲一区电影777| 亚洲精品日日夜夜| 一区二区三区中文字幕| 亚洲免费色视频| 亚洲你懂的在线视频| 亚洲色图.com| 一区二区三区中文字幕在线观看| 亚洲欧美偷拍卡通变态| 亚洲啪啪综合av一区二区三区| 最新中文字幕一区二区三区| 自拍偷拍国产精品| 亚洲综合图片区| 日本欧美在线看| 看片网站欧美日韩| 国产91丝袜在线观看| 国产成人亚洲综合色影视| 成人av网址在线观看| 91论坛在线播放| 欧美日韩在线三区| 日韩美一区二区三区| 久久久www成人免费无遮挡大片| 国产欧美一区二区精品性| 亚洲天堂2014| 视频精品一区二区| 久久se精品一区二区| 成人亚洲精品久久久久软件| 99精品久久只有精品| 欧美日韩日本视频| 26uuu久久天堂性欧美| 亚洲欧美在线另类| 日日骚欧美日韩| 成人久久18免费网站麻豆| 91蜜桃网址入口| 日韩欧美在线1卡| 国产日产欧美一区二区视频| 亚洲欧美激情一区二区| 日韩1区2区3区| 福利视频网站一区二区三区| 91免费国产在线观看| 日韩一级高清毛片| 亚洲精选免费视频| 久久草av在线| 在线视频你懂得一区| 久久免费美女视频| 亚洲综合久久av| 成人免费视频一区| 69久久夜色精品国产69蝌蚪网| 中文无字幕一区二区三区| 亚洲国产精品久久人人爱蜜臀| 国产麻豆精品视频| 91精品国产色综合久久不卡电影| 中文字幕高清一区| 免费在线欧美视频| 色噜噜夜夜夜综合网|