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

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

?? jrevdct.c

?? 杜比AC-3編碼解碼器(參考程序)
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
 * jrevdct.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 the basic inverse-DCT transformation subroutine.
 *
 * This implementation is based on an algorithm described in
 *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
 *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
 *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
 * The primary algorithm described there uses 11 multiplies and 29 adds.
 * We use their alternate method with 12 multiplies and 32 adds.
 * The advantage of this method is that no data path contains more than one
 * multiplication; this allows a very simple and accurate implementation in
 * scaled fixed-point arithmetic, with a minimal number of shifts.
 * 
 * I've made lots of modifications to attempt to take advantage of the
 * sparse nature of the DCT matrices we're getting.  Although the logic
 * is cumbersome, it's straightforward and the resulting code is much
 * faster.
 *
 * A better way to do this would be to pass in the DCT block as a sparse
 * matrix, perhaps with the difference cases encoded.
 */
#include "common.h"
#include "dsputil.h"

#define EIGHT_BIT_SAMPLES

#define DCTSIZE 8
#define DCTSIZE2 64

#define GLOBAL

#define RIGHT_SHIFT(x, n) ((x) >> (n))

typedef DCTELEM DCTBLOCK[DCTSIZE2];

#define CONST_BITS 13

/*
 * This routine is specialized to the case DCTSIZE = 8.
 */

#if DCTSIZE != 8
  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
#endif


/*
 * A 2-D IDCT can be done by 1-D IDCT on each row followed by 1-D IDCT
 * on each column.  Direct algorithms are also available, but they are
 * much more complex and seem not to be any faster when reduced to code.
 *
 * The poop on this scaling stuff is as follows:
 *
 * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
 * larger than the true IDCT outputs.  The final outputs are therefore
 * a factor of N larger than desired; since N=8 this can be cured by
 * a simple right shift at the end of the algorithm.  The advantage of
 * this arrangement is that we save two multiplications per 1-D IDCT,
 * because the y0 and y4 inputs need not be divided by sqrt(N).
 *
 * We have to do addition and subtraction of the integer inputs, which
 * is no problem, and multiplication by fractional constants, which is
 * a problem to do in integer arithmetic.  We multiply all the constants
 * by CONST_SCALE and convert them to integer constants (thus retaining
 * CONST_BITS bits of precision in the constants).  After doing a
 * multiplication we have to divide the product by CONST_SCALE, with proper
 * rounding, to produce the correct output.  This division can be done
 * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
 * as long as possible so that partial sums can be added together with
 * full fractional precision.
 *
 * The outputs of the first pass are scaled up by PASS1_BITS bits so that
 * they are represented to better-than-integral precision.  These outputs
 * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
 * with the recommended scaling.  (To scale up 12-bit sample data further, an
 * intermediate int32 array would be needed.)
 *
 * To avoid overflow of the 32-bit intermediate results in pass 2, we must
 * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
 * shows that the values given below are the most effective.
 */

#ifdef EIGHT_BIT_SAMPLES
#define PASS1_BITS  2
#else
#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
#endif

#define ONE	((INT32) 1)

#define CONST_SCALE (ONE << CONST_BITS)

/* Convert a positive real constant to an integer scaled by CONST_SCALE.
 * IMPORTANT: if your compiler doesn't do this arithmetic at compile time,
 * you will pay a significant penalty in run time.  In that case, figure
 * the correct integer constant values and insert them by hand.
 */

/* Actually FIX is no longer used, we precomputed them all */
#define FIX(x)	((INT32) ((x) * CONST_SCALE + 0.5)) 

/* Descale and correctly round an INT32 value that's scaled by N bits.
 * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
 * the fudge factor is correct for either sign of X.
 */

#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)

/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
 * For 8-bit samples with the recommended scaling, all the variable
 * and constant values involved are no more than 16 bits wide, so a
 * 16x16->32 bit multiply can be used instead of a full 32x32 multiply;
 * this provides a useful speedup on many machines.
 * There is no way to specify a 16x16->32 multiply in portable C, but
 * some C compilers will do the right thing if you provide the correct
 * combination of casts.
 * NB: for 12-bit samples, a full 32-bit multiplication will be needed.
 */

#ifdef EIGHT_BIT_SAMPLES
#ifdef SHORTxSHORT_32		/* may work if 'int' is 32 bits */
#define MULTIPLY(var,const)  (((INT16) (var)) * ((INT16) (const)))
#endif
#ifdef SHORTxLCONST_32		/* known to work with Microsoft C 6.0 */
#define MULTIPLY(var,const)  (((INT16) (var)) * ((INT32) (const)))
#endif
#endif

#ifndef MULTIPLY		/* default definition */
#define MULTIPLY(var,const)  ((var) * (const))
#endif


/* 
  Unlike our decoder where we approximate the FIXes, we need to use exact
ones here or successive P-frames will drift too much with Reference frame coding 
*/
#define FIX_0_211164243 1730
#define FIX_0_275899380 2260
#define FIX_0_298631336 2446
#define FIX_0_390180644 3196
#define FIX_0_509795579 4176
#define FIX_0_541196100 4433
#define FIX_0_601344887 4926
#define FIX_0_765366865 6270
#define FIX_0_785694958 6436
#define FIX_0_899976223 7373
#define FIX_1_061594337 8697
#define FIX_1_111140466 9102
#define FIX_1_175875602 9633
#define FIX_1_306562965 10703
#define FIX_1_387039845 11363
#define FIX_1_451774981 11893
#define FIX_1_501321110 12299
#define FIX_1_662939225 13623
#define FIX_1_847759065 15137
#define FIX_1_961570560 16069
#define FIX_2_053119869 16819
#define FIX_2_172734803 17799
#define FIX_2_562915447 20995
#define FIX_3_072711026 25172

/*
 * Perform the inverse DCT on one block of coefficients.
 */

void j_rev_dct(DCTBLOCK data)
{
  INT32 tmp0, tmp1, tmp2, tmp3;
  INT32 tmp10, tmp11, tmp12, tmp13;
  INT32 z1, z2, z3, z4, z5;
  INT32 d0, d1, d2, d3, d4, d5, d6, d7;
  register DCTELEM *dataptr;
  int rowctr;
   
  /* Pass 1: process rows. */
  /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
  /* furthermore, we scale the results by 2**PASS1_BITS. */

  dataptr = data;

  for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
    /* Due to quantization, we will usually find that many of the input
     * coefficients are zero, especially the AC terms.  We can exploit this
     * by short-circuiting the IDCT calculation for any row in which all
     * the AC terms are zero.  In that case each output is equal to the
     * DC coefficient (with scale factor as needed).
     * With typical images and quantization tables, half or more of the
     * row DCT calculations can be simplified this way.
     */

    register int *idataptr = (int*)dataptr;

    d0 = dataptr[0];
    d1 = dataptr[1];
    d2 = dataptr[2];
    d3 = dataptr[3];
    d4 = dataptr[4];
    d5 = dataptr[5];
    d6 = dataptr[6];
    d7 = dataptr[7];

    if ((d1 == 0) && (idataptr[1] | idataptr[2] | idataptr[3]) == 0) {
      /* AC terms all zero */
      if (d0) {
	  /* Compute a 32 bit value to assign. */
	  DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS);
	  register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
	  
	  idataptr[0] = v;
	  idataptr[1] = v;
	  idataptr[2] = v;
	  idataptr[3] = v;
      }
      
      dataptr += DCTSIZE;	/* advance pointer to next row */
      continue;
    }

    /* Even part: reverse the even part of the forward DCT. */
    /* The rotator is sqrt(2)*c(-6). */
{
    if (d6) {
	if (d4) {
	    if (d2) {
		if (d0) {
		    /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
		    z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
		    tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
		    tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);

		    tmp0 = (d0 + d4) << CONST_BITS;
		    tmp1 = (d0 - d4) << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp1 + tmp2;
		    tmp12 = tmp1 - tmp2;
		} else {
		    /* d0 == 0, d2 != 0, d4 != 0, d6 != 0 */
		    z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
		    tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
		    tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);

		    tmp0 = d4 << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp2 - tmp0;
		    tmp12 = -(tmp0 + tmp2);
		}
	    } else {
		if (d0) {
		    /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
		    tmp2 = MULTIPLY(-d6, FIX_1_306562965);
		    tmp3 = MULTIPLY(d6, FIX_0_541196100);

		    tmp0 = (d0 + d4) << CONST_BITS;
		    tmp1 = (d0 - d4) << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp1 + tmp2;
		    tmp12 = tmp1 - tmp2;
		} else {
		    /* d0 == 0, d2 == 0, d4 != 0, d6 != 0 */
		    tmp2 = MULTIPLY(-d6, FIX_1_306562965);
		    tmp3 = MULTIPLY(d6, FIX_0_541196100);

		    tmp0 = d4 << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp2 - tmp0;
		    tmp12 = -(tmp0 + tmp2);
		}
	    }
	} else {
	    if (d2) {
		if (d0) {
		    /* d0 != 0, d2 != 0, d4 == 0, d6 != 0 */
		    z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
		    tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
		    tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);

		    tmp0 = d0 << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp0 + tmp2;
		    tmp12 = tmp0 - tmp2;
		} else {
		    /* d0 == 0, d2 != 0, d4 == 0, d6 != 0 */
		    z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
		    tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
		    tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);

		    tmp10 = tmp3;
		    tmp13 = -tmp3;
		    tmp11 = tmp2;
		    tmp12 = -tmp2;
		}
	    } else {
		if (d0) {
		    /* d0 != 0, d2 == 0, d4 == 0, d6 != 0 */
		    tmp2 = MULTIPLY(-d6, FIX_1_306562965);
		    tmp3 = MULTIPLY(d6, FIX_0_541196100);

		    tmp0 = d0 << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp0 + tmp2;
		    tmp12 = tmp0 - tmp2;
		} else {
		    /* d0 == 0, d2 == 0, d4 == 0, d6 != 0 */
		    tmp2 = MULTIPLY(-d6, FIX_1_306562965);
		    tmp3 = MULTIPLY(d6, FIX_0_541196100);

		    tmp10 = tmp3;
		    tmp13 = -tmp3;
		    tmp11 = tmp2;
		    tmp12 = -tmp2;
		}
	    }
	}
    } else {
	if (d4) {
	    if (d2) {
		if (d0) {
		    /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
		    tmp2 = MULTIPLY(d2, FIX_0_541196100);
		    tmp3 = MULTIPLY(d2, FIX_1_306562965);

		    tmp0 = (d0 + d4) << CONST_BITS;
		    tmp1 = (d0 - d4) << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp1 + tmp2;
		    tmp12 = tmp1 - tmp2;
		} else {
		    /* d0 == 0, d2 != 0, d4 != 0, d6 == 0 */
		    tmp2 = MULTIPLY(d2, FIX_0_541196100);
		    tmp3 = MULTIPLY(d2, FIX_1_306562965);

		    tmp0 = d4 << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp2 - tmp0;
		    tmp12 = -(tmp0 + tmp2);
		}
	    } else {
		if (d0) {
		    /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
		    tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
		    tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
		} else {
		    /* d0 == 0, d2 == 0, d4 != 0, d6 == 0 */
		    tmp10 = tmp13 = d4 << CONST_BITS;
		    tmp11 = tmp12 = -tmp10;
		}
	    }
	} else {
	    if (d2) {
		if (d0) {
		    /* d0 != 0, d2 != 0, d4 == 0, d6 == 0 */
		    tmp2 = MULTIPLY(d2, FIX_0_541196100);
		    tmp3 = MULTIPLY(d2, FIX_1_306562965);

		    tmp0 = d0 << CONST_BITS;

		    tmp10 = tmp0 + tmp3;
		    tmp13 = tmp0 - tmp3;
		    tmp11 = tmp0 + tmp2;
		    tmp12 = tmp0 - tmp2;
		} else {
		    /* d0 == 0, d2 != 0, d4 == 0, d6 == 0 */
		    tmp2 = MULTIPLY(d2, FIX_0_541196100);
		    tmp3 = MULTIPLY(d2, FIX_1_306562965);

		    tmp10 = tmp3;
		    tmp13 = -tmp3;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区四区| 97aⅴ精品视频一二三区| 欧美人狂配大交3d怪物一区| 亚洲午夜久久久久久久久电影院 | 中文字幕乱码亚洲精品一区| 国产激情一区二区三区四区| 欧美国产欧美亚州国产日韩mv天天看完整| 日本一区二区三区免费乱视频| 日本不卡1234视频| 欧美剧情片在线观看| 青青草97国产精品免费观看无弹窗版| 欧美一区二区三区免费在线看| 精品一区中文字幕| 国产精品美女一区二区| 欧美日韩小视频| 国产美女精品一区二区三区| 国产精品久久久久久久久果冻传媒| 91老师片黄在线观看| 香蕉影视欧美成人| 国产亚洲福利社区一区| 99精品一区二区| 青青草一区二区三区| 欧美韩日一区二区三区| 一本色道久久综合狠狠躁的推荐| 日韩电影一区二区三区四区| 欧美精品一区二区三区蜜桃视频 | 青青青爽久久午夜综合久久午夜| 久久久久99精品国产片| 日本道免费精品一区二区三区| 日本不卡中文字幕| 国产精品天天摸av网| 欧美日韩视频在线观看一区二区三区| 毛片av中文字幕一区二区| 国产精品毛片无遮挡高清| 在线播放中文字幕一区| av激情亚洲男人天堂| 理论片日本一区| 一区二区三区中文免费| 精品国产青草久久久久福利| 色综合久久88色综合天天免费| 久热成人在线视频| 亚洲一二三专区| 欧美国产一区二区| 91精品国产一区二区三区| 99精品欧美一区| 精品制服美女丁香| 午夜国产精品一区| 亚洲欧美日韩国产一区二区三区| 2017欧美狠狠色| 欧美日韩国产欧美日美国产精品| 成人免费毛片高清视频| 久久99久久99| 亚洲成人av在线电影| 亚洲欧洲日韩av| 国产亚洲精品中文字幕| 日韩欧美成人午夜| 欧美三级乱人伦电影| 91在线国内视频| 成人亚洲一区二区一| 精品无人区卡一卡二卡三乱码免费卡 | 久久精子c满五个校花| 欧美美女黄视频| 色婷婷综合视频在线观看| 欧美高清视频不卡网| 成人黄色电影在线| 久久精品国产77777蜜臀| 亚洲午夜精品网| 亚洲免费观看高清完整| 国产精品国产自产拍高清av王其| 久久香蕉国产线看观看99| 欧美一区二区视频网站| 欧美人伦禁忌dvd放荡欲情| 欧美性色欧美a在线播放| 91成人免费电影| 91精彩视频在线观看| 欧美艳星brazzers| 在线精品视频免费播放| 在线观看av一区二区| 91久久国产最好的精华液| 欧美综合天天夜夜久久| 精品视频一区二区三区免费| 欧美视频一区在线观看| 欧美精品乱码久久久久久| 在线不卡中文字幕| 日韩欧美国产综合在线一区二区三区| 日韩欧美另类在线| 精品国产一二三| 国产人成亚洲第一网站在线播放| 国产日韩精品一区二区三区| 国产精品久久久久久久午夜片 | 麻豆91在线看| 国产精品一区二区在线看| 粉嫩一区二区三区性色av| 成人一道本在线| 欧日韩精品视频| 日韩一区国产二区欧美三区| 久久日韩精品一区二区五区| 欧美激情一二三区| 亚洲精品成人精品456| 日韩精品每日更新| 国产一区二区主播在线| 一本到不卡免费一区二区| 欧美在线观看一区| 日韩精品专区在线影院重磅| 中文字幕精品一区二区三区精品| 亚洲欧洲另类国产综合| 亚洲高清免费观看| 韩国一区二区三区| 92国产精品观看| 欧美一个色资源| 18成人在线观看| 日本一道高清亚洲日美韩| 国产精品综合视频| 91国产精品成人| 欧美日韩aaaaa| 欧美国产日本视频| 日韩二区三区四区| 成人app软件下载大全免费| 欧美人牲a欧美精品| 欧美激情一区二区在线| 一区二区三区免费网站| 精品在线播放免费| 一本在线高清不卡dvd| 精品第一国产综合精品aⅴ| 成人高清av在线| 欧美日韩国产一区| 中文字幕在线观看不卡视频| 日本一不卡视频| 色综合中文综合网| 91久久奴性调教| 久久综合久久综合亚洲| 性做久久久久久免费观看| 成人av资源站| 久久综合成人精品亚洲另类欧美| 亚洲一区影音先锋| 成人福利视频在线看| 久久综合精品国产一区二区三区| 亚洲综合丁香婷婷六月香| 成人理论电影网| 久久精品一区二区三区av| 天天操天天干天天综合网| 91麻豆自制传媒国产之光| 久久久精品免费网站| 免费观看在线综合| 欧美乱熟臀69xxxxxx| 一区二区三区中文字幕在线观看| 国产高清精品久久久久| 精品美女在线播放| 蜜桃久久精品一区二区| 欧美人体做爰大胆视频| 一区二区三区鲁丝不卡| 白白色亚洲国产精品| 国产亚洲福利社区一区| 国产一区激情在线| 久久婷婷久久一区二区三区| 青青草97国产精品免费观看 | 久久综合久久综合久久综合| 日韩中文字幕亚洲一区二区va在线| 91丨porny丨蝌蚪视频| 国产精品色呦呦| 成人毛片在线观看| 国产精品夫妻自拍| 福利一区福利二区| 中文字幕第一区| 97久久精品人人爽人人爽蜜臀| 国产亲近乱来精品视频| 国产成人免费在线观看| 久久先锋影音av鲁色资源| 国产精品一线二线三线| 久久天天做天天爱综合色| 国产麻豆欧美日韩一区| 久久理论电影网| 国产另类ts人妖一区二区| 久久久.com| 不卡的av中国片| 一区二区三区小说| 欧美日韩在线三区| 日本欧美加勒比视频| 精品国产亚洲一区二区三区在线观看 | 国产九色精品成人porny| 国产午夜精品久久久久久久| 成人性视频免费网站| 亚洲欧美激情插| 欧美日韩aaaaaa| 国产精品一区二区三区四区 | 久久久久久久久伊人| 成人中文字幕合集| 亚洲午夜激情网页| 日韩三级视频在线观看| 国产精品影视在线| 一区二区三区中文免费| 日韩一区二区三区精品视频 | 亚洲一区二区三区四区五区中文 | 久久看人人爽人人| jlzzjlzz国产精品久久| 亚洲gay无套男同| 久久日韩精品一区二区五区| 色综合色综合色综合色综合色综合 | 日韩一级精品视频在线观看| 国产suv精品一区二区6|