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

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

?? idwt.cpp

?? 《Visual C++小波變換技術(shù)與工程實(shí)踐》靳濟(jì)芳編著的光盤程序。
?? CPP
字號(hào):
/* $Id: idwt.c,v 1.7 1998/05/14 21:41:09 hjlee Exp $ */
/****************************************************************************/
/*   MPEG4 Visual Texture Coding (VTC) Mode Software                        */
/*                                                                          */
/*   This software was jointly developed by the following participants:     */
/*                                                                          */
/*   Single-quant,  multi-quant and flow control                            */
/*   are provided by  Sarnoff Corporation                                   */
/*     Iraj Sodagar   (iraj@sarnoff.com)                                    */
/*     Hung-Ju Lee    (hjlee@sarnoff.com)                                   */
/*     Paul Hatrack   (hatrack@sarnoff.com)                                 */
/*     Shipeng Li     (shipeng@sarnoff.com)                                 */
/*     Bing-Bing Chai (bchai@sarnoff.com)                                   */
/*     B.S. Srinivas  (bsrinivas@sarnoff.com)                               */
/*                                                                          */
/*   Bi-level is provided by Texas Instruments                              */
/*     Jie Liang      (liang@ti.com)                                        */
/*                                                                          */
/*   Shape Coding is provided by  OKI Electric Industry Co., Ltd.           */
/*     Zhixiong Wu    (sgo@hlabs.oki.co.jp)                                 */
/*     Yoshihiro Ueda (yueda@hlabs.oki.co.jp)                               */
/*     Toshifumi Kanamaru (kanamaru@hlabs.oki.co.jp)                        */
/*                                                                          */
/*   OKI, Sharp, Sarnoff, TI and Microsoft contributed to bitstream         */
/*   exchange and bug fixing.                                               */
/*                                                                          */
/*                                                                          */
/* In the course of development of the MPEG-4 standard, this software       */
/* module is an implementation of a part of one or more MPEG-4 tools as     */
/* specified by the MPEG-4 standard.                                        */
/*                                                                          */
/* The copyright of this software belongs to ISO/IEC. ISO/IEC gives use     */
/* of the MPEG-4 standard free license to use this  software module or      */
/* modifications thereof for hardware or software products claiming         */
/* conformance to the MPEG-4 standard.                                      */
/*                                                                          */
/* Those intending to use this software module in hardware or software      */
/* products are advised that use may infringe existing  patents. The        */
/* original developers of this software module and their companies, the     */
/* subsequent editors and their companies, and ISO/IEC have no liability    */
/* and ISO/IEC have no liability for use of this software module or         */
/* modification thereof in an implementation.                               */
/*                                                                          */
/* Permission is granted to MPEG members to use, copy, modify,              */
/* and distribute the software modules ( or portions thereof )              */
/* for standardization activity within ISO/IEC JTC1/SC29/WG11.              */
/*                                                                          */
/* Copyright 1995, 1996, 1997, 1998 ISO/IEC                                 */
/****************************************************************************/

/************************************************************/
/*     Sarnoff Very Low Bit Rate Still Image Coder          */
/*     Copyright 1995, 1996, 1997, 1998 Sarnoff Corporation */
/************************************************************/

/* Inverse DWT for MPEG-4 Still Texture Coding 
Original Coded by Shipeng Li, Sarnoff Corporation, Jan. 1998*/

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "basic.hpp"
#include "dwt.h"

/* Function:    iDWT()
   Description: Inverse DWT for MPEG-4 Still Texture Coding 
   Input:

   InCoeff -- Input Wavelet Coefficients at CurLevel decomposition
   InMask -- Input  Mask for InCoeff, if ==1, data inside object, 
              otherwise outside.
   Width  -- Width of Original Image (must be multiples of 2^nLevels);
   Height -- Height of Original Image (must be multiples of 2^nLevels);
   CurLevel -- Currect Decomposition Level of the input wavelet coefficients;
   DstLevel -- Destined decomposition level that the wavelet coefficient is 
               synthesized to. DstLevel always less than or equal to CurLevel;
   OutDataType -- OutData Type: 0 - BYTE; 1 -- SHORT
   Filter     -- Filter Used.
   UpdateInput -- Update the level of decomposition to DstLevel  
                  for InCoeff and/or InMask or Not.
                  0 = No  Update; 1 = Update InCoeff; 2: Update InCoeff and InMask;
   FullSizeOut -- 0 = Output image size equals to Width/2^DstLevel x Height/2^DstLevel;
                  1 = Output Image size equals to Width x Height; 
		  ( Highpass band filled with zero after DstLevel)

   Output:
 
   OutData -- Output Image data of Width x Height or Width/2^DstLevel x Height/2^DstLevel
              size depending on FullSizeOut, data type decided by OutDataType;
   OutMask    -- Output mask corresponding to OutData

   Return: DWT_OK if successful.  
*/
Int VTCIDWT:: do_iDWT(DATA *InCoeff, UChar *InMask, Int Width, Int Height, Int CurLevel,
	 Int DstLevel, Int OutDataType, FILTER **Filter,  Void *OutData, 
	 UChar *OutMask, Int UpdateInput, Int FullSizeOut)
{
  switch(Filter[0]->DWT_Type) {
  case DWT_INT_TYPE:
    return(iDWTInt(InCoeff, InMask, Width, Height, CurLevel, DstLevel,
		   OutDataType, Filter, OutData, OutMask, UpdateInput, FullSizeOut));
  case DWT_DBL_TYPE:
    return(iDWTDbl(InCoeff, InMask, Width, Height, CurLevel, DstLevel,
		   OutDataType, Filter, OutData, OutMask, UpdateInput, FullSizeOut));
  default:
    return(DWT_FILTER_UNSUPPORTED);
  }
}


/* Function: AddDCMean 
   Description: Add the Mean of DC coefficients
   Input:
   
   Mask -- Mask for the transformed coeffs
   Width -- Width of the original image
   Height -- Height of the original image
   nLevels -- levels of DWT decomposition performed
   DCMean -- Mean of the DC components

   Input/Output:

   Coeff -- DWT coefficients after nLevels of decomposition
   
   Return: None */

Void VTCIDWT:: AddDCMean(DATA *Coeff, UChar *Mask, Int Width, 
	       Int Height, Int nLevels, Int DCMean) // modified by Sharp (99/2/16)
{
  Int width = (Width >> nLevels), height = (Height >> nLevels);
  Int k;
  Int *a;
  UChar *c;
  DCMean = (DCMean<<nLevels);
  for(k=0; k<Width*height; k+=Width) {
    for(a=Coeff+k,c=Mask+k; a < Coeff+k+width; a++,c++)  {
      if(*c == DWT_IN) *a+=DCMean;
    }
  }
}


// begin: added by Sharp (99/2/16)
Void VTCIDWT::AddDCMeanTile(DATA *Coeff, UChar *Mask, Int Width,
	Int Height, Int nLevels, Int DCMean,
	Int TileWidth, Int TileHeight, Int TileX, Int TileY)
{
  Int width = (TileWidth >> nLevels), height = (TileHeight >> nLevels);
  Int k;
  DATA *a;
  DATA *p;
	Int i=0;

  p=Coeff+TileY*TileHeight*Width+TileX*TileWidth;


  DCMean = (DCMean<<nLevels);
  for(k=0; k<Width*height; k+=Width) {
    for(a=p+k; a<p+k+width; a++){
/*       for(a=Coeff+k,c=Mask+k; a < Coeff+k+width; a++,c++)   {*/
      *a += DCMean;
//           if(*c == DWT_IN) *a+=DCMean; //modified by SL@Sarnoff (03/03/99)
/*					 printf("%d\n", i++);*/
/*					}*/
//      *a += DCMean;
    }
  }
}

Int VTCIDWT::do_iDWT_Tile(DATA *InCoeff, UChar *InMask, Int Width, Int Height, Int CurLevel,
	Int DstLevel, Int OutDataType, FILTER **Filter,  Void *OutData,
	UChar *OutMask, Int TileWidth, Int TileHeight,
	Int UpdateInput, Int FullSizeOut, Int orgFlag, Int dcpTile1, Int dcpTile2)
{
  Int width, height;
  Int Flag = (orgFlag==0?0:3);

  Int nBits, MaxCoeff, MinCoeff;
  Int i,level, k, j, x, y;
  DATA *tempCoeff;
  Int ret;
  DATA *d_LL, *d_HL, *d_LH, *d_HH, *a;
  DATA *s_LL, *s_HL, *s_LH, *s_HH, *b;
  UChar *c;
  UShort *s;
  UChar *d,*e, *tempMask;
  Int nTilex, nTiley, x1, x2, y1, y2;

  /* Check filter class first */
  if(Filter[0]->DWT_Class != DWT_ODD_SYMMETRIC && Filter[0]->DWT_Class != DWT_EVEN_SYMMETRIC ) {
    return(DWT_FILTER_UNSUPPORTED);
  }
  /* check filter Type */
  if(Filter[0]->DWT_Type!=DWT_INT_TYPE) return(DWT_INTERNAL_ERROR);
  /* Check output coefficient buffer capacity */
  nBits = sizeof(DATA)*8;
  MaxCoeff = (1<<(nBits-1))-1;
  MinCoeff = -(1<<(nBits-1));
  /* Limit nLevels as: 0 - 15*/
  if(DstLevel < 0 || CurLevel >=16 || DstLevel >=16 || DstLevel > CurLevel)
    return(DWT_INVALID_LEVELS);
  /* Check Width and Height, must be multiples of 2^CurLevel */
  if((Width &( (1<<CurLevel)-1))!=0) return(DWT_INVALID_WIDTH);
  if((Height &( (1<<CurLevel)-1))!=0) return(DWT_INVALID_HEIGHT);

  /* calculate size of target area */
  nTilex = (Width+TileWidth-1)/TileWidth;
  nTiley = (Height+TileHeight-1)/TileHeight;
  x1 = dcpTile1%nTilex;
  y1 = dcpTile1/nTilex;
  x2 = dcpTile2%nTilex;
  y2 = dcpTile2/nTilex;
  /*  if ((1&Flag)==1) {*/
  /*    if (x1 != 0) x1--;*/
  /*    if (x2 != (nTilex-1)) x2++;*/
  /*  }*/
  /*  if ((2&Flag)==2) {*/
  /*    if (y1 != 0) y1--;*/
  /*    if (y2 != (nTiley-1)) y2++;*/
  /*  }*/

  width = (x2-x1+1)*TileWidth;
  height = (y2-y1+1)*TileHeight;
  /*   width = Width; */
  /*   height = Height; */

  /* copy mask */
  tempMask = (UChar *)malloc(sizeof(UChar)*width*height);
  if(tempMask==NULL) return(DWT_MEMORY_FAILED);
  /*   memcpy(tempMask, InMask, sizeof(UChar)*Width*Height); */
  memset(tempMask, (UChar)1, width*height);

  /* allocate temp  buffer */
  tempCoeff = (DATA *) malloc(sizeof(DATA)*width*height);
  if(tempCoeff == NULL) {
    free(tempMask);
    return(DWT_MEMORY_FAILED);
  }
  memset(tempCoeff, (UChar)0, width*height*sizeof(DATA));

  /* copy DC band */
  for(y=y1;y<=y2;y++){
    for(x=x1;x<=x2;x++){
      d_LL = tempCoeff+(y-y1)*(TileHeight>>CurLevel)*width+(x-x1)*(TileWidth>>CurLevel);
      /*       d_LL = tempCoeff+y*(TileHeight>>CurLevel)*width+x*(TileWidth>>CurLevel); */
      s_LL = InCoeff+y*TileHeight*Width+x*TileWidth;
      for(i=0;i<(TileHeight>>CurLevel);i++){
        for(j=0;j<(TileWidth>>CurLevel);j++){
          *(d_LL+j) = *(s_LL+j);
        }
        d_LL+= width;
        s_LL+= Width;
      }
    }
  }

  /* copy AC bands */
  for(level=CurLevel;level>DstLevel;level--){
    for(y=y1;y<=y2;y++){
      for(x=x1;x<=x2;x++){
        d_HL=tempCoeff+(width>>level)+(y-y1)*(TileHeight>>level)*width+(x-x1)*(TileWidth>>level);
        d_LH=tempCoeff+(height>>level)*width+(y-y1)*(TileHeight>>level)*width+(x-x1)*(TileWidth>>level);
        /*    d_HL=tempCoeff+(width>>level)+y*(TileHeight>>level)*width+x*(TileWidth>>level);  */
        /*    d_LH=tempCoeff+(height>>level)*width+y*(TileHeight>>level)*width+x*(TileWidth>>level
            ); */
        /*  d_HH=tempCoeff+(width>>level)+(height>>level)*width+(y-y1)*(TileHeight>>level)*width+



                                                      (x-x1)*(Tile
            Width>>level); */
        d_HH =d_HL+(height>>level)*width;

        s_HL=InCoeff+y*TileHeight*Width+x*TileWidth+(TileWidth>>level);   /* HL */
        s_LH=InCoeff+(y*TileHeight+(TileHeight>>level))*Width+x*TileWidth;  /* LH */
        s_HH=s_HL+(TileHeight>>level)*Width;          /* HH */

        for(i=0;i<(TileHeight>>level);i++){
          for(j=0;j<(TileWidth>>level);j++){

            /*      if( d_HL+j > tempCoeff+width*height || d_LH+j > tempCoeff+width*h
                eight || d_HH+j > tempCoeff+width*height ){ */
            /*        printf("level:%d, y:%d, x:%d, i:%d, j:%d\n", level, y, x, i, j)
                ; */
            /*        exit(1); */
            /*      } */
            *(d_LH+j) =  *(s_LH+j);
            *(d_HL+j) =  *(s_HL+j);
            *(d_HH+j) =  *(s_HH+j);
          }
          d_HL+=width;
          d_LH+=width;
          d_HH+=width;
          s_HL+=Width;
          s_LH+=Width;
          s_HH+=Width;
        }
      }
    }
  }


  /* Perform the  iDWT */
  for(level=CurLevel;level>DstLevel;level--) {
    /* Synthesize one level */

    ret=SynthesizeOneLevelInt(tempCoeff, tempMask, width, height,
        level, Filter[level], MaxCoeff, MinCoeff, DWT_NONZERO_HIGH);

    if(ret!=DWT_OK) {
      free(tempCoeff);
      free(tempMask);
      return(ret);
    }
  }
  /* check to see if required to update InCoeff and/or InMask */
  if(UpdateInput>0) {
    /* update InCoeff */
    for(k=0;k<Width*(Height>>DstLevel); k+=Width) {
      for(b=InCoeff+k,a=tempCoeff+k;b<InCoeff+k+(Width>>DstLevel);b++,a++) {

        *b = (DATA) *a;

      }
    }
  }
  if(UpdateInput>1) {
    /* Update InMask */
    for(k=0;k<Width*(Height>>DstLevel); k+=Width) {
      for(d=InMask+k,e=tempMask+k;d<InMask+k+(Width>>DstLevel);d++,e++) {
        *d = *e;
      }
    }
  }

  if(FullSizeOut) {
    /* Perform the rest of iDWT till fullsize */
    for(level=DstLevel;level>0;level--) {
      /* Synthesize one level */

      ret=SynthesizeOneLevelInt(tempCoeff, tempMask, Width, Height,
          level, Filter[level], MaxCoeff, MinCoeff, DWT_ZERO_HIGH);

      if(ret!=DWT_OK) {
        free(tempCoeff);
        free(tempMask);
        return(ret);
      }
    }
  }

  /* copy the output to OutData and OutMask */
  if(FullSizeOut) level=0;
  else level=DstLevel;

  for(i=0,k=0;k<width*(height >> level);k+=width,i++) {
    if(OutDataType==0) { /* Unsigned CHAR */
      c = (UChar *)OutData;
      c = c+y1*TileHeight*Width+x1*TileWidth;
      c+=i*Width;
      for(a=tempCoeff+k;a<tempCoeff+k+(width>>level);c++,a++) {
        Int iTmp;

        iTmp = (Int) *a;
        iTmp = level>0?((iTmp+(1<<(level-1))) >> level):iTmp; /* scale and round */

        iTmp = (iTmp >0) ? ((iTmp > 255)?255:iTmp):
        0; /* clipping */
        *c = (UChar) iTmp;
      }
    }
    else { /* UShort */
      s = (UShort *)OutData;
      s+=i;
      for(a=tempCoeff+k;a<tempCoeff+k+(width>>level);s++,a++) {
        Int iTmp;

        iTmp = (Int)*a;
        iTmp = level>0?((iTmp+(1<<(level-1))) >> level):iTmp; /* scale and round */

        iTmp = (iTmp >0) ? ((iTmp > 65535)?65535:iTmp):
        0; /* clipping */
        *s = (UShort) iTmp;
      }
    }
    d = OutMask + i;
    for(e=tempMask+k;e<tempMask+k+(width>>level);e++,d++)  *d=*e;
  }
  free(tempCoeff);
  free(tempMask);
  return(DWT_OK);
}
// begin: added by Sharp (99/2/16)

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产激情一区二区三区| 国产精品成人免费| 国产精品情趣视频| 成人免费毛片app| 国产女人aaa级久久久级 | 蜜桃久久久久久| 欧美一级生活片| 免费成人av资源网| 国产婷婷色一区二区三区| 国产成人精品影院| 亚洲女同一区二区| 欧日韩精品视频| 亚洲在线免费播放| 91麻豆精品国产91久久久资源速度 | 亚洲免费观看高清完整版在线观看| 成人教育av在线| 亚洲精品免费在线观看| 欧美久久一二三四区| 国产综合久久久久久鬼色| 国产精品电影一区二区| 欧美日韩一级视频| 国产一区美女在线| 亚洲裸体xxx| 欧美一卡二卡在线观看| 国产99久久久国产精品潘金| 亚洲免费观看高清完整版在线| 欧美精品乱码久久久久久| 国产一区91精品张津瑜| 亚洲伦理在线免费看| 精品精品国产高清一毛片一天堂| 国产999精品久久久久久绿帽| 亚洲猫色日本管| 精品国产自在久精品国产| 96av麻豆蜜桃一区二区| 午夜欧美一区二区三区在线播放| 久久久影视传媒| 欧洲另类一二三四区| 日产国产欧美视频一区精品| 国产欧美一区二区在线观看| 欧美在线免费观看视频| 国产一区二区三区在线观看免费 | 日韩一区二区三区高清免费看看| 国产一区二区在线观看免费| 国产精品久久福利| 91麻豆精品国产自产在线| 国产裸体歌舞团一区二区| 亚洲精品欧美专区| 中文字幕精品一区二区三区精品| 欧美伦理电影网| a美女胸又www黄视频久久| 美国毛片一区二区三区| 一区二区免费视频| 久久看人人爽人人| 在线电影院国产精品| 不卡视频在线看| 亚洲韩国精品一区| 中文字幕一区二区三区在线播放| 日韩欧美一级片| 欧美亚洲丝袜传媒另类| 99久久综合国产精品| 国内一区二区视频| 日韩激情一二三区| 亚洲综合一区二区| 亚洲婷婷在线视频| 中文幕一区二区三区久久蜜桃| 日韩一区二区在线观看视频| 欧洲一区在线观看| 色综合天天天天做夜夜夜夜做| 久草中文综合在线| 蜜臀91精品一区二区三区| 一区二区在线观看av| 亚洲蜜臀av乱码久久精品| 中文字幕亚洲视频| 中文字幕av不卡| 国产网红主播福利一区二区| 精品国产乱子伦一区| 日韩美一区二区三区| 日韩欧美国产综合| 精品国产三级电影在线观看| 日韩欧美精品在线视频| 精品欧美乱码久久久久久1区2区| 51精品秘密在线观看| 884aa四虎影成人精品一区| 日韩欧美国产综合在线一区二区三区| 欧美高清www午色夜在线视频| 欧美色涩在线第一页| 欧美人狂配大交3d怪物一区| 91丨九色丨蝌蚪富婆spa| av爱爱亚洲一区| 91麻豆国产精品久久| 欧美最新大片在线看| 欧美视频中文一区二区三区在线观看 | 在线电影国产精品| 制服丝袜中文字幕亚洲| 日韩欧美成人午夜| 国产亚洲综合色| 国产精品日日摸夜夜摸av| 1区2区3区欧美| 亚洲制服丝袜在线| 日本亚洲视频在线| 精品一区二区三区在线观看| 奇米精品一区二区三区四区 | 国产成人福利片| 不卡视频一二三四| 欧美中文字幕久久| 日韩一区二区不卡| 国产日产欧美一区| 亚洲激情五月婷婷| 美脚の诱脚舐め脚责91 | 在线91免费看| 欧美成人福利视频| 亚洲美女在线国产| 蜜臀91精品一区二区三区 | 免费成人性网站| 国产精品99久| 欧洲精品一区二区三区在线观看| 777xxx欧美| 国产精品久久久久9999吃药| 亚洲成人精品一区二区| 国产精品66部| 欧美日韩在线观看一区二区 | av高清不卡在线| 在线播放91灌醉迷j高跟美女| 久久久久久久一区| 亚洲精品免费看| 国产精品资源在线看| 欧美午夜电影网| 久久精品男人天堂av| 亚洲福利一区二区三区| 国产麻豆一精品一av一免费| 在线免费不卡电影| 国产亚洲视频系列| 免费在线观看一区二区三区| 99久久婷婷国产综合精品| 91精品国产一区二区三区香蕉| 欧美高清在线一区| 免费观看成人鲁鲁鲁鲁鲁视频| eeuss影院一区二区三区| 精品国产免费一区二区三区四区| 亚洲一区二区成人在线观看| 高清在线成人网| 日韩一区二区在线观看视频播放| 国产精品麻豆久久久| 日韩1区2区3区| 欧美精品在线观看播放| 国产精品久久久久aaaa樱花 | 国产高清亚洲一区| 91麻豆精品国产自产在线 | 中文字幕在线观看一区| 久久国产视频网| 欧美日韩电影一区| 亚洲色图在线视频| 成人永久免费视频| 精品人在线二区三区| 性久久久久久久久久久久| 波多野结衣中文字幕一区| 久久综合狠狠综合久久激情| 亚洲男女毛片无遮挡| 国产一区二区网址| 精品国产一区二区亚洲人成毛片 | 国产精品久久毛片| 国产91丝袜在线播放九色| 久久亚洲一区二区三区四区| 免费日韩伦理电影| 777亚洲妇女| 日本少妇一区二区| 欧美日韩二区三区| 日本美女一区二区| 69久久99精品久久久久婷婷| 蜜桃一区二区三区在线观看| 欧美一级黄色大片| 日韩福利视频网| 日韩一区国产二区欧美三区| 五月综合激情日本mⅴ| 91精品国产综合久久蜜臀 | 极品美女销魂一区二区三区免费| 91精品国产乱| 捆绑紧缚一区二区三区视频| 日韩女优av电影在线观看| 久久精品久久久精品美女| 久久在线免费观看| 国产成人精品免费网站| 一区视频在线播放| 欧美自拍偷拍午夜视频| 亚洲.国产.中文慕字在线| 精品国产三级a在线观看| 粉嫩一区二区三区在线看| 中文字幕在线观看一区| 欧美艳星brazzers| 免费观看91视频大全| 国产农村妇女毛片精品久久麻豆 | 国产欧美日韩三区| 99在线热播精品免费| 亚洲一区视频在线| 欧美一区二区不卡视频| 国产伦精品一区二区三区在线观看| 久久久精品天堂| 色综合久久中文综合久久牛| 丝袜诱惑亚洲看片 | 国产精品成人免费在线|