# 小波壓縮

## 壓縮方法

1.先沿n方向做離散小波轉換得
${\displaystyle {\mathit {v_{1,L}[m,n]}}=\sum _{k=0}^{K-1}x[m,2n-k]g[k]}$
${\displaystyle {\mathit {v_{1,H}[m,n]}}=\sum _{k=0}^{K-1}x[m,2n-k]h[k]}$
2.再沿m方向得
${\displaystyle {\mathit {x_{1,L}[m,n]}}=\sum _{k=0}^{K-1}v_{1,L}[2m-k,n]g[k]}$
${\displaystyle {\mathit {x_{1,H_{1}}[m,n]}}=\sum _{k=0}^{K-1}v_{1,L}[2m-k,n]h[k]}$
${\displaystyle {\mathit {x_{1,H_{2}}[m,n]}}=\sum _{k=0}^{K-1}v_{1,H}[2m-k,n]g[k]}$
${\displaystyle {\mathit {x_{1,H_{3}}[m,n]}}=\sum _{k=0}^{K-1}v_{1,H}[2m-k,n]h[k]}$

## JPEG 2000

### 向前小波轉換

k Analysis lowpass filter

${\displaystyle {\mathit {h_{L}}}(n)}$

Analysis highpass filter

${\displaystyle {\mathit {h_{H}}}(n)}$

Synthesis lowpass filter

${\displaystyle {\mathit {g_{L}}}(n)}$

Synthesis highpass filter

${\displaystyle {\mathit {g_{H}}}(n)}$

-2 -1/8 0 0 -1/8
-1 2/8 -1/2 1/2 -2/8
0 6/8 1 1 6/8
1 2/8 -1/2 1/2 -2/8
2 -1/8 0 0 -1/8

k Analysis lowpass filter

${\displaystyle {\mathit {h_{L}}}(n)}$

Analysis highpass filter

${\displaystyle {\mathit {h_{H}}}(n)}$

Synthesis lowpass filter

${\displaystyle {\mathit {g_{L}}}(n)}$

Synthesis highpass filter

${\displaystyle {\mathit {g_{H}}}(n)}$

-4 0.026748757411 0 0 0.026748757411
-3 -0.016864118443 0.091271763114 -0.091271763114 0.016864118443
-2 -0.078223266529 -0.057543526229 -0.057543526229 -0.078223266529
-1 0.266864118443 -0.591271763114 0.591271763114 -0.266864118443
0 0.602949018236 1.11508705 1.11508705 0.602949018236
1 0.266864118443 -0.591271763114 0.591271763114 -0.266864118443
2 -0.078223266529 -0.057543526229 -0.057543526229 -0.078223266529
3 -0.016864118443 0.091271763114 -0.091271763114 0.016864118443
4 0.026748757411 0 0 0.026748757411

### 量子化

${\displaystyle {\mathit {q_{b}}}(u,v)=sign[{\mathit {a_{b}}}(u,v)]}$ ${\displaystyle \left\lfloor {\frac {a_{b}(u,v)}{\triangle _{b}}}\right\rfloor }$

### Tier編碼器

tier編碼器將量子化後的資料分成相關的位元及不相關的位元，變成有連貫性的訊息後再經過算術編碼，最後以封包的形式傳送。

## 參考

• Jian-Jiun Ding, Time frequency analysis and wavelet transform class note, the Department of Electrical Engineering, National Taiwan University (NTU), Taipei, Taiwan, 2009.http://djj.ee.ntu.edu.tw/TFW.htm
• Wei-Yi Wei, “Image Coding by Adaptive Golomb Codes and the information of Adjacent Block,” Graduate Institute of Communication Engineering, College of Electrical Engineering and Computer Science, National Taiwan University, Master Thesis, June 2010.
• Rafael C. Gonzalez, Richard E. Woods, "Digital Image Processing", 2nd 2002, ISBN 0-20-118075-8
• N. C. Shen, “Sectioned Convolution for Discrete Wavelet Transform”, Graduate Institute of Communication Engineering, National Taiwan University, 2008.