1 / 57

第 三 章

第 三 章. 向量量化編碼法. 3.1 Vector Quantization (VQ) Concept Encoding and Decoding. Vector Quantization (VQ). Image compression technique. w. h. Image. Index table. Vector Quantization Encoder. Vector Quantization (VQ). Image compression technique. w. h. Image. Index table.

jzhou
Download Presentation

第 三 章

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第 三 章 向量量化編碼法 3-

  2. 3.1 Vector Quantization (VQ) Concept Encoding and Decoding 3-

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

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

  5. 3.2標準向量量化編碼法 3-

  6. Vector Quantization (VQ) Codebook Training • Codebook generation 0 1 . . . N-2 N-1 Training Images Training set Separating the image to vectors 3-

  7. Vector Quantization (VQ) Codebook Training • Codebook generation 0 1 . . . 0 1 . . . 254 255 N-2 N-1 Initial codebook Training set Codebook initiation 3-

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

  9. Codebook • Example 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) = 114.2 d(v, cw2) = 188.3 d(v, cw3) = 112.3 d(v, cw4) = 124.6 d(v, cw5) = 122.3 d(v, cw6) = 235.1 d(v, cw7) = 152.5 d(v, cw8) = 63.2 (2) So, we choose cw8 to replace the input vector v.

  10. 3.2.1 LBG Algorithm • 一次訓練 256 個 codewords • 做了100次 • 連續兩次 MSE 之差別已經夠小 3-

  11. 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} 3-

  12. 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 3-

  13. 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. 3-

  14. 3.3 細胞分裂法 3-

  15. 3.3.1 細胞分裂法 • 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. 3-

  16. 細胞分裂法 3-

  17. 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. 3-

  18. Table 1: Performance of image quality (PSNR) with the codebook sized 256 3-

  19. Table 2: Performance of image quality (PSNR) with the codebook sized 128 3-

  20. Test image ‘Lena’ Original image 8bpp 0.5 bpp PSNR = 29.930dB 3-

  21. Test image ‘Pepper’ Original image 8bpp 0.5 bpp PSNR = 30.869dB 3-

  22. 3.3.2 結論 • 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. 3-

  23. 3.4 邊緣吻合向量量化法 3-

  24. 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 3-

  25. SMVQ(cont.) 3-

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

  27. SMVQ(cont.) Implementation of SMVQ Seed Block Residual Block 3-

  28. SMVQ(cont.) • Derailment(出軌) Problem Error Error Error 3-

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

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

  31. 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. 3-

  32. CSMVQ(cont.) h 4hs 2hs hs Original codebook State codebooks 3-

  33. Edge Block Detection (b) vertical edge mask (VM) (a) horizontal edge mask (HM) (c) -45。 edge mask (DM-) (c) +45。 edge mask (DM+) 3-

  34. 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. 3-

  35. 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 3-

  36. PSMVQ(cont.) • The Generation of Edge Codebook and Non-edge Codebook 3-

  37. 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 3-

  38. PSMVQ(cont.) 3-

  39. 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 3-

  40. 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. 3-

  41. PSMVQ(cont.) • The definition of the order of seed block generation (cont.) (a) (b) (c) Different pattern sizes which are 2×2, 4×4, and 8×8, respectively 3-

  42. 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 3-

  43. 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. (a) The original order (b) the type of blocks (c) the result of reorder Figure4-6: An example of reorder a pattern 註: (a) 7, 14, 8, 3, 10, 15, 6 均為 smooth blocks (b) 值愈小表示優先權愈高 3-

  44. PSMVQ(cont.) • The encoding order of the residual blocks 3-

  45. PSMVQ(cont.) • Encoder of PSMVQ 3 1 2 3-

  46. PSMVQ(cont.) • Encoder of PSMVQ (cont.) 3 2 1 註:選愈多個seed block 壓縮出來的影像品質會愈高 3-

  47. PSMVQ(cont.) • Decoder of PSMVQ 3-

  48. 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 3-

  49. 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) 3-

More Related