Digital Video Solutions to Midterm Exam 2012 Edited by Yang-Ting Chou Confirmed by Prof. Jar-Ferr Yang LAB: R, TEL: ext Page of MPL:
AVG: STDEV: MAX: 168 MIN: 21
(a) I These entropy encoders compress data by replacing each fixed- length input symbol by the corresponding variable-length prefix-free output codeword. The length of each codeword is approximately proportional to the negative logarithm of the probability. Therefore, the most common symbols use the shortest codes. According to Shannon's source coding theorem, the optimal code length for a symbol is −log b P, where b is the number of symbols used to make output codes and P is the probability of the input symbol. Two of the most common entropy encoding techniques are Huffman coding and arithmetic coding. If the approximate entropy characteristics of a data stream are known in advance, a simpler static code may be useful. These static codes include universal codes and Golomb codes.
(b) (c )
(d )
(e) (f)
II 2.1 Huffman code: A 0 (1) B 11 (00) C 100 (011) D 1011 (0100) E (01011) F (01010) A 0.85 B 0.05 C 0.05 D 0.02 E (a) p(A) = 0.85, p(B) = 0.05, p(C) = 0.05, p(D) = 0.02, p(E) = 0.02 p(F) = 1- p(A)- p(B)- p(C)- p(D)- p(E)=0.01 F
Optimal symmetrical RVLC A 0 B 11 C 101 D 1001 E F (b)
Prefix conflict Optimal asymmetrical RVLC A 0 B 11 C 101 D 1001 E F (c)
RLCSkipSSSSValueEncoded (1,4) (0,-1) (1,1) (3,3) EOB (a) (b) (c) 題目沒給
2.3 (a) Entropy: (b) Huffman code: A 2 A 2 0 (1) A 2 A 1 11 (00) A 1 A (011) A 1 A (010) A 2 A A 2 A A 1 A A 1 A
(c) {A 2 A 1 A 2 A 2 }:{110} ({001}) Huffman code: A 2 A 2 0 (1) A 2 A 1 11 (00) A 1 A (011) A 1 A (010) (d) Occurrence symbols: {A 2 A 1 A 2 A 2 } <W<
Synthesis Filter: n x[n]x[n] y 0 [2n] y 1 [2n+1] x0[n]x0[n] x1[n]x1[n] x’[n] The last row is the reconstructed synthesis data
2.5 (a) (c) They are not unitary transforms. 以 quantization or scaling 來做補償 AA -1 = AA T ≠ I (b)
2.6 p(A) = 0.7, p(B) =0.2, p(C) = 0.05, p(D)=p(E)=0.02, p(F)=0.01 Huffman code: A 0 (1) B 10 (01) C 110 (001) D 1111 (0000) E (00011) F (00010) A 0.7 B 0.2 C 0.05 D 0.02 E 0.02 F (a) RVL code: A 0 (1) B 101 (010) C (00100) D ( ) E ( ) F ( )
(b) Optimal symmetrical RVLC A 0 B 11 C 101 D 1001 E F optimal symmetrical RVLC : 從後面長
(c) Prefix conflict Optimal asymmetrical RVLC A 0 B 11 C 101 D 1001 E F optimal asymmetrical RVLC : 從前面長
2.7 Initialization: LIP: { (0,0) 42, (0,1) 17, (1,0) -19, (1,1) 13 } LIS: { D(0,1), D(1,0), D(1,1) } LSP: {} Significant Pass: Refinement Pass: LIP: { (0,0) 42, (0,1) 17, (1,0) -19, (1,1) 13 } LIS: {D(0,1), D(1,0), D(1,1) } LSP: { (0,0) 42 } (a) (b) SPIHT
Significant Pass: Refinement Pass: 0 LIP: { (0,1) 17, (1,0) -19, (1,1) 13} LIS: {D(0,1), D(1,0), D(1,1) } LSP: {(0,0) 42, (0,1) 17, (1,0) -19} Significant Pass: Refinement Pass: up to 25 bits Generated bitstream:
(c) Generated bitstream: (1) (2) (3) Generated bitstream:
2.8 JPEG-LS Block Diagram (a)
(b) Fixed Predictor
sc zc sc zc sc zc sc zc sc Significance Propagation Pass (Pass 1) : Coefficient which is already significant : Significance Propagation Pass (Pass 1) ZC: Zero Coding SC: Sign Coding (a) zc
Magnitude Refinement Pass (Pass 2) : Significance Propagation Pass (Pass 1) (a) : Magnitude Refinement Pass (Pass 2) sc zc sc zc sc zc sc zc sc zc
sc zc Clean-up Pass (Pass 3) (a) : Pass 1 : Pass 2 : Pass 3 (ZC & SC) : Pass 3 (RLC) sc zc sc zc sc zc sc zc sc zc
a: ZC, LL band kh[j] = 1, kv[j] = 1, kd[j] = 0, ksig[j]=7 b: SC h[j] = 0, v[j] = 0, ksign[j] = 9 c: ZC, LL band kh[j] = 1, kv[j] = 0, kd[j] = 0, ksig[j]=5 d: SC h[j] = 1, v[j] = 0, ksign[j] = 12 (b) sc zc sc zc sc zc sc zc sc zc sc zc (a)(b) (c) (d)
(b) sig [j] LL and LH blocksHL blocksHH blocks h[j]h[j] v[j]v[j] d[j]d[j] h[j]h[j] v[j]v[j] d[j]d[j] d[j]d[j] h [j]+ v [j] 82xxx2x≥3x 71≥1x 1x ≥2 402x20x11 301x10x Assignment of context labels for significant coding “x” means “don’t care.”
(b) h[j]h[j] v[j]v[j] sign flip Assignment of context labels and flipping factor for sign coding h [j], v [j]: neighborhood sign status -1: one or both negative. 0: both insignificant or both significant but opposite sign. 1: one or both positive. Current sample
(b) [j] sig [j] mag >015 1X16 Assignment of context labels and flipping factor for magnitude refinement coding [j]: remains zero until after the first magnitude refinement bit has been coded. For subsequent refinement bits, [j] = 1. sig [j]: context label for significant coding of sample j
2.10 (a) Diamond Search
(-2, 3): = 19 points
(2, -7): = 29 points
(b) Four Step Search
(-2, 3): = 22 points
(2, -7): = 28 points
(c) Enhanced Hexagon Search
(-2, 3): = 12 points
(2, -7): = 18 points
2.11