Download presentation
Presentation is loading. Please wait.
1
第 四 章 VQ 加速運算與編碼表壓縮 4-
2
4.1 VQ Codeword Search 4-
3
Vector Quantization (VQ)
4-
4
Euclidean Distance The dimensionality of vector = k (= w*h)
An input vector x = (x1, x2, …, xk) A codeword yi = (yi1, yi2, …, yik) The Euclidean distance between x and yi 4-
5
4.2 PCA 4-
6
Principal component analysis (PCA)
Given a set of points Y1, Y2, …, and YM where every Yi is characterized by a set of variables X1, X2, …, and XN. We want to find a direction D = (d1, d2, …, dN), where such that the variance of points projected onto D is maximized. 4-
7
Principal component analysis (PCA)
D1 = [ ] D2 = [ ] 4-
8
PCA 40 samples with 2 variables, X1 and X2 Covariance matrix
λ1 = λ2 =36.780 4-
9
Principal component analysis (PCA)
λ1 = λ2 =36.780 D1 = (0.710, 0.703) D2 = (-0.703, 0.710) 4-
10
Principal component analysis (PCA)
Algorithm of PCA Start by coding the variables Y = (Y1, Y2, …YN) to have zero means and unit variances. Calculate the covariance matrix C of the samples. Find the eigenvalues λ1, λ2, …, λN, for C, where λi λi+1, i = 1, 2, …, N-1. Let D1, D2, … DN denote the corresponding eigenvectors. D1 is the first principal component direction, D2 is the second principal component direction, … , DN is the Nth principal component direction . 4-
11
The Encoding Algorithm Using PCA Technique
(A) the codebook processing: For each codeword cwi in codebook matrix B, evaluate projected value pi by pi=D1.cwi. Then, all the codewords in the matrix B are transformed into 256 real numbers. The set of these real numbers can be expressed as P = {p1, p2, …, p256}. Sort the values in P. We obtain the new ordered set P’ = {p’1, p’2, …, p’256} and their corresponding vector cw’1, cw’2 ,… cw’256 form an ordered codebook B’={cw’1, cw’2 ,… cw’256}. 4-
12
The Encoding Algorithm Using PCA Technique
(B) The Encoding Algorithm] For the input vector x, evaluate the projected value px by px = D1.x. Search the set P’ for r values P’i’s which are the r closest ones to Px. Compute their distances from the set {cw’k, cw’k+1 ,… cw’k+r-1} to find a vector cw’j such that (cw’j, x) has a minimum distortion. Here, let the searching range be r and assume that the corresponding codeword of P’j is cw’j. Store or transmit the index j of cw’j 4-
13
The Encoding algorithm using PCA
Codebook The covariance matrix 4-
14
The Encoding algorithm using PCA
From the covariance matrix, we compute D1: (0.5038, , , ), λ1=19552, D2: ( , , , ), λ2=151, D3: ( , , , ), λ3=86 and D4: (0.7098, , , ), λ4=6. D1: (0.5038, , , ) is a coordinate D1 reserves 98.77% information of the variance of the codewords. 4-
15
The Encoding algorithm using PCA
The new sorted codebook and the corresponding projected value of codewords Codebook The sorted codewords The projected values D1: (0.5038, , , ) 4-
16
Encode an input vector v = (150, 145, 121, 130) Transform v to ρ= D1.v
To search and find that is the closest value to 272 For P5’ = , d(v, cw’5)=63.2 For P4’ = , d(v, cw’4)=122.3 For P6’ = , d(v, cw’6)=114.2 So, we choose cw’5 to replace the input vector v. 4-
17
Experimental results The quality of the encoded image is evaluated by the peak signal-to noise ration PSNR, which is defined as For an m*m image, the mean-square error (MSE) is defined as Where xij and denote the original and quantized gray levels, respectively. 4-
18
4-
19
4.3 快速歐幾里德距離演算法 4-
20
Look-up Table (LUT) The content of each pixel belongs to [0, m-1] 4-
21
4.3.1 Truncated Look-up Table (TLUT)
4-
22
Truncated Look-up Table (TLUT)
1 2 … 4-
23
Truncated Look-up Table (TLUT)
For example, r = 256/32 = 8 (17-34)2= 289 Error = |289 – 576| = 287 4-
24
4.3.2 Reduced Code LUT (RCLUT)
Suppose m = 2t. Express xj (or yij) by Define low nibble L(xj) = the lowest bits of xj= Define high nibble H(xj) = the lowest bits of xj= 4-
25
Reduced Code LUT (RCLUT)
4-
26
Reduced Code LUT (RCLUT)
H(xj), H(yij), L(xj), L(yij) are within the range [0.21/2-1] Look-up Table (LUT) 4-
27
4-
28
Experimental Results 4-
29
4.4 VQ 編碼表的壓縮 4-
30
An example for indices of VQ
4-
31
4.4.1 Search-Order Coding (SOC)
4-
32
4.4.2. Locally Adaptive scheme
An example of segmentation with region size 4*4 for indices of VQ 4-
33
The block diagram of the proposed scheme
4-
34
The compressing steps of our example
10 10 01 31 207 211 8 7 35 10 11 11 100 011 011 4-
35
The decoding steps of our example
10 31 207 211 8 7 35 10 01 10 11 11 100 011 011 4-
36
Experimental results 4-
37
The comparison of two schemes in the unmatched index numbers
4-
38
The comparison of three schemes in compression results
4-
39
The comparison of proposed method and SOC scheme in bit rate (bit/pixel)
4-
40
Discussions 4-
41
Discussion of the VQ scheme
Advantage: The bit rate of the VQ scheme is low. bit rate = bpp. Example: When the codebook is composed of 256 codewords. Each block used is of 4*4 pixels. bit rate = 0.5 bpp VQ has a simple decoding structure. 4-
42
Discussion of the VQ scheme
Disadvantage: The reconstructed image quality highly depends on the codebook performance. Therefore, how to design a representative codebook is an important issue of VQ scheme. The VQ scheme requires a lot of computation cost in codebook generation process and VQ encoding process. 4-
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.