Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 3 向量量化編碼法.

Similar presentations


Presentation on theme: "Chapter 3 向量量化編碼法."— Presentation transcript:

1 Chapter 3 向量量化編碼法

2 3.1 Vector Quantization (VQ) Concept Encoding and Decoding

3 Vector Quantization (VQ)
Image compression technique w h Image Index table Vector Quantization Encoder

4 Vector Quantization (VQ)
Image compression technique w h Image Index table Vector Quantization Decoder

5

6 3.2 標準向量量化編碼法

7 Vector Quantization (VQ) Codebook Training
Codebook generation 1 . N-1 N Training Images Training set Separating the image to vectors

8 Vector Quantization (VQ) Codebook Training
Codebook generation 1 . 1 . 254 255 N-1 N Initial codebook Training set Codebook initiation

9 Vector Quantization (VQ) Codebook Training
1 . Index sets 1 . 254 255 (1, 2, 5, 9, 45, …) (101, 179, 201, …) (8, 27, 38, 19, 200, …) N-1 N (23, 0, 67, 198, 224, …) Codebook Ci Training set 1 . Compute mean values 254 255 Replace the old vectors New Codebook Ci+1 Training using iteration algorithm

10 Example Codebook To encode an input vector, for example, v = (150,145,121,130) (1) Compute the distance between v with all vectors in codebook d(v, cw1) = d(v, cw2) = d(v, cw3) = 112.3 d(v, cw4) = d(v, cw5) = d(v, cw6) = 235.1 d(v, cw7) = d(v, cw8) = 63.2 (2) So, we choose cw8 to replace the input vector v.

11 LBG Algorithm 一次訓練 256 個 codewords 做了100次 連續兩次 MSE 之差別已經夠小

12 3.2.2 Full Search (FS) For example: Let the codebook size be 256
# of searched nodes per image vector = 256 Time consuming The closest codeword Image vector C = {c1, c2, …, cnc}

13 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

14 Problem of FS VQ encoding process (i.e., codebook search) is time-consuming. How to speed up the VQ encoder (i.e., codebook search) is thus an important problem.

15 3.3 細胞分裂法

16 細胞分裂法 Motivation The distribution of the codewords in the codebook has great influence on the codebook performance. The codebook initialization is an important part of the VQ codebook design process. Solve the codebook initialization problem using a tree-structured codebook design process.

17 細胞分裂法

18 Example of tree growing function
Let the displacement thresholdδbe set to be four and the branch number equals two. Given X = [126, 128, 126, 124]. Step 1: Y = [126, 128, 126, 124] – [4, 4, 4, 4] = [122, 124, 122, 120] Z = [126, 128, 126, 124] + [4, 4, 4, 4] = [130, 132, 130, 128] Step 2: Return vector Y, Z to the caller.

19 Table 1: Performance of image quality (PSNR) with the codebook sized 256

20 Table 2: Performance of image quality (PSNR) with the codebook sized 128

21 Test image ‘Lena’ Original image 8bpp 0.5 bpp PSNR = dB

22 Test image ‘Pepper’ Original image 8bpp 0.5 bpp PSNR = dB

23 3.3.2 結論 Progressively design the codebook using a tree structure.
結論 Progressively design the codebook using a tree structure. Develop a simple tree growing procedure to generate initial codewords in the training process. Provide better codebook performance than that of the LBG algorithm.

24 3.4 邊緣吻合向量量化法

25 3.4.1 Side Match Vector Quantization (SMVQ)
Main Idea: Neighbor pixels within an image are similar unless there is an edge across Figure 4-1: Side match for the the block X

26 SMVQ(cont.)

27 SMVQ(cont.) (40+38)/2 找出最接近 (36, x, x, x, 47, x, x, x, 92, x, x, x, 39, 47, 92, 33) 的codeword!!

28 SMVQ(cont.) Implementation of SMVQ Seed Block Residual Block

29 SMVQ(cont.) Derailment(出軌) Problem Error Error Error

30 的前 16 個codeword,組成 smaller codebook
SMVQ(cont.) 解決Derailment(出軌) Problem 找出最接近 (x1,x2,x3,x4,x5,x,x,x,x9,x,x,x,x13,x,x,x) 的前 16 個codeword,組成 smaller codebook

31 SMVQ(cont.) 解決Derailment(出軌) Problem
Error =< TH 0010 Error > TH 計算原始圖的black vector與smaller codebook 的誤差 Error If Error =< Threshold,選擇 smaller codebook 的index If Error > Threshold,選擇 原始 codebook 的index

32 3.4.2 Variable-rate SMVQ with a Block Classifer (CSMVQ)
CSMVQ use two thresholds THc and THs. THc is used to choose size of a state codebook. THs is used to control the derailment problem.

33 CSMVQ(cont.) h 4hs 2hs hs Original codebook State codebooks

34 Edge Block Detection -1 1 -1 1 -1 1 -1 1 Z1 Z2 Z3 Z4 Z5 Z6 Z7 Z8 Z9
(b) vertical edge mask (VM) (a) horizontal edge mask (HM) -1 1 -1 1 (c) +45。 edge mask (DM+) (c) -45。 edge mask (DM-)

35 Edge Block Detection (cont.)
Define a threshold THe. For a block Z. If one of the RHM, RVM, RDM+ and RDM- is larger than THe, Z is considered to be an edge block. Otherwise, Z is a non-edge block.

36 3.4.3 Pattern-based SMVQ (PSMVQ)
What is a pattern? A pattern is a group of w×w blocks. Why is it called a pattern? The encoding order of blocks within a pattern is defined. PSMVQ The Generation of Edge Codebook and Non-edge Codebook The Encoder of PSMVQ The Decoder of PSMVQ

37 PSMVQ (cont.) The Generation of Edge Codebook and Non-edge Codebook

38 PSMVQ (cont.) PSMVQ The map of the block type
The definition of the order of seed block generation The adjustment of the order of the seed blocks The encoding order of the residual blocks

39 PSMVQ (cont.)

40 PSMVQ (cont.) The map of the block type (cont.)
Table 4-1: The numbers of edge blocks and non-edge blocks, the size of the map of block type with THe=70, and the compression ratio of the map of block type

41 PSMVQ (cont.) The definition of the order of seed block generation
Two principles: (1) Uniform (2) The priority of blocks in the right end column and the bottom row will be higher than the other blocks.

42 PSMVQ (cont.) The definition of the order of seed block generation (cont.) 1 49 17 61 4 52 20 64 33 9 45 25 36 12 51 28 13 57 5 53 16 60 8 56 41 21 37 29 42 22 38 30 3 50 19 63 2 18 62 35 10 46 26 34 11 47 27 15 59 7 54 14 58 6 55 43 23 39 31 44 24 40 32 1 4 3 2 (a) 1 13 4 16 9 5 12 7 2 15 3 14 11 6 10 8 (b) (c) Different pattern sizes which are 2×2, 4×4, and 8×8, respectively

43 Non-edge block Edge block
PSMVQ (cont.) The adjustment of the order of the seed blocks A non-edge block is predicted easily. An edge block is predicted hardly. Non-edge block Edge block

44 Figure4-6: An example of reorder a pattern
PSMVQ (cont.) The adjustment of the order of the seed blocks (cont.) Add the priority of the block and the number of the blocks to change the encoding order. 1 13 4 16 9 5 12 7 2 15 3 14 11 6 10 8 +16 1 13 4 16 9 5 12 23 2 31 19 30 11 22 26 24 (a) The original order (b) the type of blocks (c) the result of reorder Figure4-6: An example of reorder a pattern

45 PSMVQ (cont.) The encoding order of the residual blocks 1 3 2 1 2 1 2

46 PSMVQ (cont.) Encoder of PSMVQ 3 1 2

47 PSMVQ (cont.) Encoder of PSMVQ (cont.) 3 2 1

48 PSMVQ (cont.) Decoder of PSMVQ

49 Experimental results of PSMVQ
Experimental Environment Linux operation system Pentium 233 Training set: “Airplane”, “Lena”, “Barb”, “Boat”, and “Toys” Testing images: “Airplane”, “Lena”, “Toys”, “Girl” and “Pepper” Images size: 512×512 pixels Image color: 256 gray levels Block size: 4×4 pixels

50 Experimental results of PSMVQ (cont.)
The image quality, the bit rate, and the encoding time of VQ(h=256), SMVQ(h=256, hs=64), CSMVQ(h=256, hs=16 THc=50, and THs=500), and PSMVQ(THe=70, THp=6000, and 2×2 blocks in a pattern)

51 Experimental results of PSMVQ (cont.)
Figure 4-7: Average results of test images when the pattern size is 2×2 blocks (T:time, B:bit rate)

52 Experimental results of PSMVQ (cont.)
Figure 4-8: Average results of test images when the pattern size is 4×4 blocks (T:time, B:bit rate)

53 Experimental results of PSMVQ (cont.)
Figure 4-9: Average results of test images when the pattern size is 8×8 blocks (T:time, B:bit rate)

54 Experimental results of PSMVQ (cont.)
Figure 4-10: Average results of test images for the different pattern sizes

55 Experimental results of PSMVQ (cont.)
Figure 4-12: The reconstructed image of SMVQ(h=256, hs=16; PSNR=28.574dB, and bit rate=0.3125bpp) Figure 4-13: The reconstructed image of CSMVQ(h=256, hs=16, THc=50, and THs=500; PSNR=30.657dB, and bit rate=0.355bpp)

56 Experimental results of PSMVQ (cont.)
Figure 4-14(a): The reconstructed image of PSMVQ(THp=1000; PSNR=31.536dB, and bit rate=0.39bpp) Figure 4-14(b): The reconstructed image of PSMVQ(THp=3000; PSNR=31.225dB, and bit rate=0.315bpp)

57 Experimental results of PSMVQ (cont.)
Figure 4-14(c): The reconstructed image of PSMVQ(THp=6000; PSNR=30.712dB, and bit rate=0.274bpp) Figure 4-14(d): The reconstructed image of PSMVQ(THp=10000; PSNR=30.1dB, and bit rate=0.247bpp)


Download ppt "Chapter 3 向量量化編碼法."

Similar presentations


Ads by Google