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

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

?? idwt.cpp

?? videoplayer 目錄中存放的是多路視頻回放實例的源程序; wvlt_videodecoding 目錄中存放的是視頻解碼的源程序。
?? CPP
字號:
/* $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)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91精品在线观看| 91美女片黄在线观看| 91精品欧美福利在线观看| 中文字幕综合网| 国产suv一区二区三区88区| 日韩美女视频在线| 日韩精品成人一区二区在线| 91啪九色porn原创视频在线观看| 久久色.com| 麻豆国产精品777777在线| 欧美午夜电影一区| 亚洲天堂2016| 欧美精品日韩综合在线| 亚洲一区二区三区四区五区中文| av网站一区二区三区| 自拍偷拍亚洲综合| 欧美三级欧美一级| 婷婷六月综合亚洲| 日韩欧美123| 国产精品一品二品| 中文字幕一区二| 9i看片成人免费高清| 综合亚洲深深色噜噜狠狠网站| 国产一区在线视频| 国产日产欧美精品一区二区三区| 久久成人综合网| 国产欧美精品一区| 欧洲精品在线观看| 久久成人精品无人区| 久久精品亚洲乱码伦伦中文| 91视视频在线直接观看在线看网页在线看 | 欧美性猛片aaaaaaa做受| 亚洲视频综合在线| 精品国产欧美一区二区| jlzzjlzz欧美大全| 精品夜夜嗨av一区二区三区| 亚洲一区二区在线观看视频| 久久亚洲私人国产精品va媚药| 色偷偷一区二区三区| 国产精品一卡二卡| 日日骚欧美日韩| 国产喂奶挤奶一区二区三区| 91捆绑美女网站| 国产不卡视频一区二区三区| 极品少妇一区二区| 精品一区二区免费视频| 麻豆精品一二三| 国内久久精品视频| 国内一区二区在线| 精品一区二区三区免费视频| 亚洲精品亚洲人成人网| 亚洲国产精品二十页| 精品国产伦一区二区三区免费| 91久久精品国产91性色tv| 成人天堂资源www在线| 成人激情免费电影网址| 白白色 亚洲乱淫| 激情文学综合插| 精品中文av资源站在线观看| 美女性感视频久久| 国产精品自在欧美一区| 成人h动漫精品一区二区| 国产 日韩 欧美大片| 成人午夜大片免费观看| 91视视频在线观看入口直接观看www | 91精品国产色综合久久久蜜香臀| 欧美情侣在线播放| 337p亚洲精品色噜噜噜| 久久蜜桃av一区精品变态类天堂| 久久综合久久久久88| 国产亚洲精品资源在线26u| 国产无一区二区| 中文字幕一区二区在线观看| 亚洲国产精品一区二区久久恐怖片 | 色94色欧美sute亚洲13| 欧美va亚洲va在线观看蝴蝶网| 欧美午夜片在线观看| 欧美日韩免费观看一区二区三区| 日韩免费在线观看| 国产精品丝袜黑色高跟| 天堂va蜜桃一区二区三区漫画版| 国产酒店精品激情| 欧美亚洲禁片免费| 亚洲视频在线一区| 国产精品资源在线| 91美女在线观看| 欧美日韩国产天堂| 国产精品国产a| 国产一区二区在线观看免费| 欧美日韩国产区一| 亚洲欧美日本韩国| 国产精品一区二区三区99| 在线观看91av| 亚洲欧美日韩国产另类专区 | 中文字幕欧美激情一区| 九九视频精品免费| 欧美日韩视频不卡| 一区二区三区中文字幕电影 | 亚洲成人激情社区| 99精品国产91久久久久久| 久久九九影视网| 五月天国产精品| 欧美高清视频在线高清观看mv色露露十八 | 日韩午夜在线观看| 另类小说图片综合网| 精品美女被调教视频大全网站| 亚洲国产精品自拍| 日韩一区二区在线看片| 日韩高清中文字幕一区| 日韩精品中午字幕| 精品一区在线看| 国产欧美视频一区二区| 成人性生交大合| 亚洲精品美国一| 欧美精品在线观看播放| 亚洲一区二区三区三| 成人高清免费观看| 亚洲一区二区在线免费看| 欧美二区三区91| 美腿丝袜一区二区三区| 欧美激情一区在线观看| 色噜噜狠狠色综合欧洲selulu| 日韩在线a电影| 欧美国产欧美亚州国产日韩mv天天看完整| 国产高清精品在线| 国产夜色精品一区二区av| 国产成人在线视频免费播放| 亚洲国产成人va在线观看天堂| 日韩一区二区三区av| 成人网在线免费视频| 另类小说图片综合网| 亚洲最色的网站| 成人欧美一区二区三区黑人麻豆 | 欧美一级搡bbbb搡bbbb| 成人福利视频在线看| 美腿丝袜亚洲综合| 亚洲精品少妇30p| 久久久www成人免费无遮挡大片 | 国产欧美综合在线观看第十页| 成人久久视频在线观看| 久久精品99国产精品| 视频在线在亚洲| 亚洲国产日产av| 亚洲乱码中文字幕综合| 国产精品视频线看| 国产日韩欧美一区二区三区乱码| 91精品国产一区二区三区蜜臀| 欧美精品精品一区| 91精品免费在线观看| 日韩一卡二卡三卡国产欧美| 欧美视频一区二区在线观看| 欧美在线视频全部完| 色94色欧美sute亚洲线路一久 | 亚洲制服丝袜一区| 亚洲香肠在线观看| 日本系列欧美系列| 伦理电影国产精品| 国产美女在线精品| 国产毛片精品国产一区二区三区| 激情文学综合网| av一区二区三区黑人| 色婷婷国产精品久久包臀| 欧美三级电影精品| 欧美一级久久久久久久大片| 久久久久亚洲综合| 亚洲色图.com| 久久精品免费观看| 成人高清在线视频| 欧美一区二区三区视频在线| 欧美激情综合网| 亚洲成a人片在线观看中文| 韩国av一区二区三区在线观看| 91亚洲精品久久久蜜桃网站| 在线播放一区二区三区| 国产精品国产a| 激情综合网av| 欧洲另类一二三四区| 国产欧美一区二区精品性色| 一区二区三区中文在线| 国产精品一区专区| 4438x亚洲最大成人网| 精品成人佐山爱一区二区| 亚洲一区二区三区在线| 在线免费观看日本欧美| 亚洲国产成人高清精品| 91精品国产91热久久久做人人| 奇米精品一区二区三区在线观看| 欧美一区二区啪啪| 日本特黄久久久高潮| 日韩精品一区二区三区中文不卡 | 亚洲小少妇裸体bbw| 日韩欧美在线观看一区二区三区| 亚洲伊人色欲综合网| 男人的j进女人的j一区| 在线成人免费视频| 免费久久精品视频| 精品美女被调教视频大全网站| 日韩av一区二| 精品久久久久久久久久久久久久久 | 亚洲综合男人的天堂|