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

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

?? lifting.h

?? 小波提升格式的源代碼
?? H
?? 第 1 頁 / 共 2 頁
字號:
   where the ordering is defined by the sub-classes.

 */
class liftingScheme {
   private:
    interpolation fourPtInterp;
   
   /** Enumerator for add and subtract operators */
   typedef enum { bad_dir, forward, inverse } direction;


  /**
    <p>
    Copy four points or <i>N</i> (which ever is less) data points from
    <i>vec</i> into <i>d</i> These points are the "known" points used
    in the polynomial interpolation.
    </p>

    @param vec[] the input data set on which the wavelet is calculated
    @param d[] an array into which <i>N</i> data points, starting at
               <i>start</i> are copied.
    @param N the number of polynomial interpolation points
    @param start the index in <i>vec</i> from which copying starts
   */
  void fill( DoubleVec& vec, double d[], int N, int start )
  {
    int n = 4;
    if (n > N)
      n = N;
    int end = start + n;
    int j = 0;

    for (int i = start; i < end; i++) {
      d[j] = vec[i];
      j++;
    }
  } // fill


  /**
    <p>
    Predict an odd point from the even points, using 4-point
    polynomial interpolation.
    </p>
    <p>
    The four points used in the polynomial interpolation are
    the even points.  We pretend that these four points
    are located at the x-coordinates 0,1,2,3.  The first 
    odd point interpolated will be located between the first
    and second even point, at 0.5.  The next N-3 points are
    located at 1.5 (in the middle of the four points).
    The last two points are located at 2.5 and 3.5.
    For complete documentation see
    </p>
    <pre>
  <a href="http://www.bearcave.com/misl/misl_tech/wavelets/lifting/index.html">
  http://www.bearcave.com/misl/misl_tech/wavelets/lifting/index.html</a>
    </pre>

    <p>
    The difference between the predicted (interpolated) value
    and the actual odd value replaces the odd value in the
    forward transform.
    </p>

    <p>
    As the recursive steps proceed, N will eventually be 4 and
    then 2.  When N = 4, linear interpolation is used.
    When N = 2, Haar interpolation is used (the prediction for
    the odd value is that it is equal to the even value).
    </p>

    @param vec the input data on which the forward or inverse
               transform is calculated.
    @param N the area of vec over which the transform is calculated
    @param direction forward or inverse transform

   */
  void interp( DoubleVec& vec, const int N, const direction dir )
  {
    int half = N >> 1;
    double d[4];

    for (int i = 0; i < half; i++) {
      double predictVal;

      if (i == 0) {
	if (half == 1) {
	  // e.g., N == 2, and we use Haar interpolation
	  predictVal = vec[0];
	}
	else {
	  fill( vec, d, N, 0 );
	  predictVal = fourPtInterp.interpPoint( 0.5, half, d );
	}
      }
      else if (i == 1) {
	predictVal = fourPtInterp.interpPoint( 1.5, half, d );
      }
      else if (i == half-2) {
	predictVal = fourPtInterp.interpPoint( 2.5, half, d );
      }
      else if (i == half-1) {
	predictVal = fourPtInterp.interpPoint( 3.5, half, d );
      }
      else {
	fill( vec, d, N, i-1);
	predictVal = fourPtInterp.interpPoint( 1.5, half, d );
      }

      int j = i + half;
      if (dir == forward) {
	vec[j] = vec[j] - predictVal;
      }
      else if (dir == inverse) {
	vec[j] = vec[j] + predictVal;
      }
      else {
	printf("interp: bad direction value\n");
	break;
      }
    } // for
  } // interp


   /**
      For the first <tt>N</tt> elements of <tt>ts</tt>, move the odd elements
      to the second half of the vector, leaving the even elements in the first
      half.

      In terms of the wavelet transform, this divides the vector
      into an average region and a coefficient (difference) region.

      For example, if we label the even elements with <i>a</i> and the 
      odd elements with <i>b</i> the input vector will contain

<pre>
  a<sub>0</sub> b<sub>0</sub> a<sub>1</sub> b<sub>1</sub> a<sub>2</sub> b<sub>2</sub> a<sub>3</sub> b<sub>3</sub> 
</pre>

      The split function will move the odd elements into the second half
      of the array, resulting in

<pre>
  a<sub>0</sub> a<sub>2</sub> a<sub>3</sub> a<sub>4</sub> b<sub>0</sub> b<sub>2</sub> b<sub>3</sub> b<sub>4</sub> 
</pre>

   */
   void split( DoubleVec& ts, const int N )
   {
      int start = 1;
      int end = N-1;

      while (start < end) {
         int i;
         double tmp;
         for (i = start; i < end; i = i + 2) {
            tmp = ts[i];
            ts[i] = ts[i+1];
            ts[i+1] = tmp;
         }
         start = start + 1;
         end = end - 1;
      }
   } // split


   /**
      Merge the odd and even values.  The is the inverse of the
      split.

      If the even values are labeled with <i>a</i> and the odd values
      are labeled with <i>b</i>, the input vector will contain

<pre>
  a<sub>0</sub> a<sub>2</sub> a<sub>3</sub> a<sub>4</sub> b<sub>0</sub> b<sub>2</sub> b<sub>3</sub> b<sub>4</sub> 
</pre>

      The merge function will re-order the odd and even element in the
      vector:

<pre>
  a<sub>0</sub> b<sub>0</sub> a<sub>1</sub> b<sub>1</sub> a<sub>2</sub> b<sub>2</sub> a<sub>3</sub> b<sub>3</sub> 
</pre>
    */
   void merge( DoubleVec& ts, int N)
   {
      int half = N >> 1;
      int start = half-1;
      int end = half;
      int i;
      double tmp;

      while (start > 0) {
         for (i = start; i < end; i = i + 2) {
            tmp = ts[i];
            ts[i] = ts[i+1];
            ts[i+1] = tmp;
         }
         start = start - 1;
         end = end + 1;
      }
   } // merge


   /**
      Predict step of the wavelet Lifting Scheme.

      The term "predict" comes from <i>Building Your Own Wavelets
      at Home</i>.

      <b>transform</b>

      In the wavelet transform, calculate the difference between even
      and odd element pairs.  This is a slightly modified version of
      the classic haar difference.  If the even elements are labeled
      as <i>a</i> and the odd elements are labeled as <i>b</i> (where
      we start counting at zero) the difference is simply

<pre>
       d<sub>i</sub> = b<sub>i</sub> - a<sub>i</sub>
</pre>

      Since an "in-place" algorithm is used, where we update the
      odd elements with the difference, we get
<pre>
       b<sub>i</sub> = b<sub>i</sub> - a<sub>i</sub>
</pre>

      <b>inverse transform</b>

      Reverse the transform predict step by adding the average
      (even element) to the difference (odd element).

    */
   void predict( DoubleVec& ts, const int N, const direction dir)
   {
      int i;
      int half = N >> 1;
      int j = 0;
      for (i = half; i < N; i++) {
         if (dir == forward) { // forward transform stage
	   ts[i] = ts[i] - ts[j];
         }
         else if (dir == inverse ) { // inverse transform stage
	   ts[i] = ts[i] + ts[j];
         }
	 else {
	   printf("predict: bad direction\n");
	   break;
	 }
         j++;
      }
   } // predict


   /**
      The update step of the wavelet Lifting Scheme

      <b>transform</b>

      In the Lifting Scheme transform the update step follows
      the predict step.  After the predict step, the differences
      have been calculated in-place writing over the even (b)
      values.  The update step calculates the Haar average using
      an even/odd pair.  The average is placed in the even member
      of the pair.

    */
   void update( DoubleVec& ts, int N, const direction dir)
   {
      int i;
      int half = N >> 1;
      int j = half;
      for (i = 0; i < half; i++) {
         if (dir == forward) {  // forward transform stage
            ts[i] = ts[i] + (ts[j]/2.0);
         }
         else if (dir == inverse) { // inverse transform step
            ts[i] = ts[i] - (ts[j]/2.0);
         }
	 else {
	   printf("update: bad direction value\n");
	   break;
	 }
         j++;
      } // for
   } // update


 public:
   /**
      Wavelet lifting scheme transform.

      The wavelet lifting scheme is an in-place wavelet algorithm.
      A time series of N elements is passed to the <tt>transform</tt>
      function.  The result of the wavelet lifting scheme is calculated
      in place (without any array temporaries) in the <tt>ts</tt>
      DoubleVec.

    */
   void transform( DoubleVec& ts )
   {
     const int N = ts.size();
     int n;
     for (n = N; n > 1; n = n >> 1) {
       split( ts, n );
       predict( ts, n, forward );
       update( ts, n, forward );
       interp( ts, n, forward );
     } // for
   } // transform

   /**
      Wavelet lifting Scheme inverse transform.

      Like the Lifting Scheme transform, the inverse transform is an
      in-place algorithm.  The result of the transform is passed to
      the inverse transform, which calculates the time series from
      the time series average and the coefficients.

    */
   void invTransform( DoubleVec& ts )
   {
     const int N = ts.size();
     int n;
     for (n = 2; n <= N; n = n << 1) {
       interp( ts, n, inverse );
       update( ts, n, inverse );
       predict( ts, n, inverse );
       merge( ts, n );
     }
   } // invTransform

}; // class liftingScheme


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av国产精品久久久久| 免费成人在线影院| 2020国产精品久久精品美国| 欧美少妇一区二区| 欧美性xxxxxx少妇| 精品视频在线免费| 欧美二区在线观看| 欧美一级日韩不卡播放免费| 7777精品伊人久久久大香线蕉经典版下载| 色视频欧美一区二区三区| 色综合久久综合中文综合网| 色综合久久综合中文综合网| 色哟哟日韩精品| 欧美日韩一级二级三级| 欧美人牲a欧美精品| 欧美一区二区三区在线观看视频| 8x8x8国产精品| 日韩精品中文字幕一区 | 亚洲精品一二三四区| 国产精品久久久久久妇女6080 | 日韩av中文在线观看| 丝袜诱惑制服诱惑色一区在线观看| 亚洲国产日韩在线一区模特| 午夜欧美视频在线观看| 日本女人一区二区三区| 黄色日韩三级电影| 成人永久aaa| 欧美在线视频全部完| 欧美精品aⅴ在线视频| 日韩免费看的电影| 欧美国产精品专区| 亚洲大片在线观看| 精品综合免费视频观看| 99re8在线精品视频免费播放| 91国产精品成人| 91精品国产麻豆国产自产在线| 精品免费日韩av| 亚洲日本青草视频在线怡红院| 亚洲五码中文字幕| 国产精品18久久久久久久网站| av不卡一区二区三区| 欧美精品自拍偷拍| 国产免费成人在线视频| 一区二区不卡在线播放 | 五月天视频一区| 国产大陆精品国产| 欧美影院一区二区三区| ww亚洲ww在线观看国产| 一区二区日韩av| 国产黄色成人av| 欧美日本一道本| 国产精品免费视频一区| 日韩高清国产一区在线| 国产1区2区3区精品美女| 欧美日韩日日骚| 国产精品区一区二区三区| 天堂资源在线中文精品| 成人网在线播放| 日韩一级高清毛片| 亚洲欧美激情在线| 国产iv一区二区三区| 91精品国产手机| 亚洲在线观看免费视频| 大胆亚洲人体视频| 欧美大肚乱孕交hd孕妇| 亚洲自拍都市欧美小说| 国产不卡在线视频| 日韩欧美你懂的| 亚洲va欧美va人人爽| 99视频精品全部免费在线| 欧美videossexotv100| 亚洲第一主播视频| 91免费观看国产| 国产精品天美传媒| 国产一本一道久久香蕉| 这里只有精品免费| 亚洲成a人在线观看| 一本大道久久精品懂色aⅴ| 国产精品视频一二| 国产成人午夜电影网| 欧美日韩国产首页在线观看| 亚洲精品国产无套在线观| 国产成人精品1024| 久久午夜羞羞影院免费观看| 蜜桃av一区二区三区| 欧美猛男男办公室激情| 亚洲黄色小说网站| 99久久99久久精品免费看蜜桃| 久久免费视频一区| 精品一二三四区| 精品乱人伦一区二区三区| 免费看日韩精品| 日韩一区二区免费电影| 午夜精品视频在线观看| 欧美日韩第一区日日骚| 一区二区三区中文字幕精品精品 | 欧美性猛交xxxx黑人交| 亚洲美女区一区| 在线观看视频一区二区| 玉米视频成人免费看| 在线免费观看日本一区| 亚洲黄色小视频| 欧美网站一区二区| 五月婷婷综合网| 日韩视频一区二区| 韩国女主播成人在线观看| 亚洲精品一区二区精华| 国产精品99久| 中文字幕亚洲不卡| 91免费视频观看| 亚洲一区视频在线| 777午夜精品视频在线播放| 日本sm残虐另类| 久久精品人人做人人爽97| 成人久久视频在线观看| 亚洲视频1区2区| 欧美日韩一级视频| 日本视频免费一区| 久久你懂得1024| 成人免费观看视频| 一区二区三区在线视频播放| 欧美吻胸吃奶大尺度电影| 青草av.久久免费一区| 精品国产乱码久久久久久免费| 国产一区二区不卡在线 | 国产精品亚洲一区二区三区妖精 | 91精品婷婷国产综合久久性色| 日本va欧美va精品| 国产亚洲欧洲997久久综合 | 亚洲国产精品高清| 在线一区二区三区做爰视频网站| 亚洲一区二区在线视频| 欧美一区二区福利在线| 国产毛片精品国产一区二区三区| 中文字幕精品在线不卡| 在线视频国内一区二区| 奇米综合一区二区三区精品视频 | 国产精品一线二线三线精华| 国产精品久久久久婷婷| 欧美日韩一级视频| 国产精品中文字幕日韩精品| 亚洲精品五月天| 日韩欧美中文字幕制服| 成人黄色软件下载| 视频一区视频二区中文字幕| 久久综合久久鬼色中文字| 在线免费观看日本欧美| 狠狠v欧美v日韩v亚洲ⅴ| 欧美激情一二三区| 精品国产伦理网| xnxx国产精品| 麻豆91免费观看| 91网站在线播放| 91尤物视频在线观看| 欧美日韩中文字幕一区二区| 99久久久精品| 欧美无人高清视频在线观看| 6080午夜不卡| 国产女人18毛片水真多成人如厕 | 亚洲一区免费在线观看| 一区二区三区不卡视频在线观看| 欧美日韩一区二区不卡| 国产精品99久| 轻轻草成人在线| 亚洲六月丁香色婷婷综合久久| 精品福利在线导航| 欧美色视频在线| 91视频在线看| 国产精品一级在线| 美日韩一级片在线观看| 亚洲自拍偷拍欧美| 亚洲国产高清不卡| 日韩精品一区二区三区四区| 欧美午夜一区二区三区免费大片| 成人午夜av电影| 国模无码大尺度一区二区三区| 亚洲成人福利片| 亚洲欧洲av在线| 中文成人综合网| 久久久影院官网| 欧美一二区视频| 欧美理论电影在线| 欧美性猛交xxxx乱大交退制版| 99精品国产99久久久久久白柏| 国产成a人无v码亚洲福利| 久久av资源站| 青青草国产成人av片免费| 亚洲高清一区二区三区| 亚洲另类在线制服丝袜| 亚洲色图欧美在线| 国产精品美女www爽爽爽| 久久色中文字幕| 亚洲精品在线电影| 久久众筹精品私拍模特| 日韩精品一区二区三区四区 | 欧美猛男gaygay网站| 91麻豆高清视频| 99久久久久免费精品国产 | 久久久777精品电影网影网| 日韩精品影音先锋|