Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Integer transform Wen - Chih Hong E-mail: [email protected] Graduate Institute of Communication Engineering National Taiwan University, Taipei, Taiwan, ROC 1 Outline 1. Introduction what is integer why integer 2. General method 3. Matrix factorization 4. Modified matrix factorization 5. Conclusions 6. Reference 2 Introduce : what is integer transform 1. all entries are integer i.e. -5,-3,0,2,… 2.all entries are sum of power of 2 i.e. 1 3 2 2 2 2 2 0 3 Introduction : Why integer transform We can use the fix-point multiplication operation to replace floating-point one to implement it 4 Introduction : The constraints of approximated integer transform 1. if A(m,n1)=τA(m,n2) , τ=1,-1,j,-j then B(m,n1)=τB(m,n2) 2. if Re(A(m,n1)) ≥ Re(A(m,n2)) Im(A(m,n1)) ≥ Im(A(m,n2)) then Re(B(m,n1)) ≥ Re(B(m,n2)) Im(B(m,n1)) ≥ Im(B(m,n2)) 5 Introduction : The constraints of Approximated integer transform 3. if sgn(Re(A(m,n1)))=sgn((Re(A(m,n1))) then sgn(Re(B(m,n1)))=sgn((Re(B(m,n1))) N 1 4. B(m, k ) B(n, k ) C k 0 m mn (*) 6 Introduction : algorithms We have three algorithms to approximate noninteger transform 1. General method 2. Matrix factorization 3. Modified matrix factorization 7 General method 1. Forming the prototype matrix 2. Constraints for Orthogonality 3. Constraints for Inequality (Inequality Constraints) 4. Assign the values (Equality Constraints) 8 Appendix - Principle of Dyadic symmetry(1/2) Definition: a vector [a0,a1,…,am-1] m=2^n we say it has the ith dyadic symmetry i.i.f. aj=s.a i j where i,j in the range [0,m-1] s= 1 when symmetry is even s=-1 when symmetry is odd 9 Appendix - Principle of Dyadic symmetry (2/2) For a vector of eight elements, there are seven possible dyadic symmetries. 10 General method : Generation of the order-8 ICTs(1/8) Take 8-order discrete cosine transform for example for i =0 T8 i, j 1/ 8 (2 / 8)cos{(i 0.5) j / 8} for i =1~7 where j=0,1,…,6,7 (1) 11 General method : Generation of the order-8 ICTs (2/8) 0.35 36 0.4904 0.4619 0.4157 0.3536 0.2778 0.1913 0.0975 0.3536 0 . 41 5 7 0.1913 -0.0975 -0.3536 -0.4904 -0.4619 -0.2778 0.3536 0.2778 -0.1913 -0.4904 -0.3536 0.0975 0.4619 0.4157 0.3536 0 . 0 97 5 -0.4619 -0.2778 0.3536 0.4157 -0.1913 -0.4904 0.3536 - 0 . 09 7 5 -0.4619 0.2778 0.3536 -0.4157 -0.1913 0.4904 0.3536 -0.2778 -0.1913 0.4904 -0.3536 -0.0975 0.4619 -0.4157 0.3536 -0.4157 0.1913 0.0975 -0.3536 0.4904 -0.4619 0.2778 0.3536 -0.4904 0.4619 -0.4157 0.3536 -0.2778 0.1913 -0.0975 Let T=kJ , k is diagonal matrix 12 General method : Generation of the order-8 ICTs(3/8) 1. Forming the prototype 13 General method : Generation of the order-8 ICTs(4/8) 2. Constraints for Orthogonality Sth dyadic symmetry type in basis vector Ji 14 General method : Generation of the order-8 ICTs(5/8) 2. Constraints for Orthogonality (i) Totally C(8,2)=28 equations must be satisfied (ii) Using principle of dyadic symmetry*, we can reduce 28 to 1 equation: a.b=a.c + b.d + c.d (2) 15 General method : Generation of the order-8 ICTs (6/8) 3. Constraints for Inequality the equation in page.8 imply a ≥ b ≥ c ≥ d ,and e ≥ f (3) 16 General method : Generation of the order-8 ICTs(7/8) 4. Assign the values : use computer to find all possible values (of course the values must be integer) 17 General method : Generation of the order-8 ICTs(8/8) Some example of (a, b, c, d, e, f): (3,2,1,1,3,1) ,(5,3,2,1,3,1),… infinity set solutions we need to define a tool to recognize which one is better 18 General method : Performance(1/2) In the transform coding of pictures n Efficiency: where s i 1 n n s p 1 q 1 (5) ii pq s11 [CY ] E[Y Y t ] [T ][Cx ][T ]t s n1 s1n snn 19 General method : Performance(2/2) The twelve order-8 ICTs that have the highest transform efficiencies for p equal 0.9 and a less than or equal to 255 20 General method : Disadvantage of general method 1. 2. 3. Too much unknowns. need to satisfy a lot of equations ,C(n,2). It has no reversibility. A’≈A , (A^-1)’≈(A^-1), but (A’)^-1≠ (A^-1)’ 21 Matrix Factorization Reversible integer mapping is essential for lossless source coding by transformation. General method can not solve the problem of reversibility 22 Matrix Factorization : algorithm(1/9) Goal : A PS N S N 1 S1S0 1. Suppose A , and det(A) ≠ 0 a11 A a n1 a1n ann (6) 23 Matrix Factorization : algorithm(2/9) 2. There must exist a permutation matrix P1 for row interchanges s.t. (1) (1) p1,1 p1,2 (1) (1) p p P1 A 2,1 2,2 p (1) p (1) N ,1 N ,2 and (1) 1, N p p1,(1)N (1) p2, N pN(1), N (7) 0 24 Matrix Factorization : algorithm(3/9) (1) (1) p s p s 3. There must exist a number 1 s.t. 1,1 1 1, N 1 then we get s1 ( p1,1(1) 1) p1,(1)N and a product 1 P1 AS0,1 P1 A I s 0 1 1 (1) 1 p1,2 (1) (1) p2,1 s1 p2,(1)N p2,2 (1) p s p (1) p (1) N ,1 1 N , N N ,2 p1,(1)N p2,(1)N pN(1), N (8) 25 Matrix Factorization : algorithm(4/9) 4. Multiplying an elementary Gauss matrix 1 s p (1) p (1) 1 1 2, N 2,1 L1P1 AS0,1 (1) (1) s1 pN , N pN ,1 (2) 1 a1,2 (2) 0 a2,2 0 a (2) N ,2 a1,(2)N (2) a2, N (2) aN , N I L1 P AS 1 0,1 1 (9) 26 Matrix Factorization : algorithm(5/9) 5. Continuing in this way for k=1,2,…,N-1. Pk defines the row interchanges among the kth through the Nth rows to guarantee pk( k, N) 0 then we get LN 1PN 1 L2 P2 L1 AS0,1S0,2 where aN( N, N1) ei 1 0 0, N 1 0 S ( N 1) a1,2 1 0 a1,( NN1) a2,( NN1) ( N 1) aN , N DRU (10) 27 Matrix Factorization : algorithm(6/9) DRU where DR diag (1,1, ,1, ei ) 1 0 U 0 ( N 1) a1,2 1 0 a1,( NN1) ( N 1) a2, N 1 (11) 28 Matrix Factorization : algorithm(7/9) 6. Multiplying all the SERMs (S0,k ) together S0,1S0,2 1 S0, N 1 s1 I 1 sN 1 S 1 0 1 (12) 29 Matrix Factorization : algorithm(8/9) 7. LN 1PN 1 L2 P2 L1P1 LN 1 ( PN 1LN 2 PNT1 ) ( PN 1 P2 L1P2T 1 T L P where L1 LN 1 ( PN 1LN 2 PNT1 ) PT PN 1 PNT1 )( PN 1 (13) ( PN 1 P2 L1P2T P2 P1 ) PNT1 ) P2 P1 30 Matrix Factorization : algorithm 8. we obtain 9. Theorem (9/9) L1PT AS01 DRUor A PLDRUS0 LU ( LUS11 ) S1 ( LUS11S21 ) S 2 S1 ( LUS11S21 S N11 ) S N 1 S2 S1 S N S N 1 S2 S1 (14) i.i.f. det(LU) is integer. 31 Matrix Factorization : Advantage if det(A) is integer then A PS N S N 1 S1S0 It is easy to derive the inverse of A 32 Modified matrix factorization: algorithm(1/6) If A is a NxN reversible transform 1. First, scale A by a constant det A 1/ N such that G A ,where det G :1 (15) 33 Modified matrix factorization: algorithm(2/6) 2. Do permutation and sign-changing operations for G: R D1PGQD2 P, Q:arbitrary permutation matrix D1 , D2:diagonal matrix D1[n, n] 1 D 2 [n, n] 1 (16) 34 Modified matrix factorization: algorithm(3/6) 3. Do triangular matrix decomposition. First, we find L1such that has the following form: H RL1 where h1,1 h2,1 h 3,1 H RL1 hN 1,1 h N ,1 1 0 0 L1 0 0 h1,2 h1,3 1 0 h3,2 1 h1, N 1 h1, N 0 0 0 0 1 0 hN , N 1 1 hN 1,2 hN 1,3 hN ,2 hN ,3 1,2 1,3 1, N 1 1, N 1 2,3 2, N 1 0 1 3, N 1 0 0 1 0 0 0 2, N 3, N N 1, N 1 (17) r2,1 r2,2 r r I n Sn1 ( zˆn tˆn ) Sn 3,1 3,2 r r n ,1 n ,2 I n [ 1,n 2,n r2,n1 r3,n1 rn ,n1 n2,n n1,n ]T tˆn [r2,n r3,n rn1,n rn ,n ]T zˆn [0 0 0 1]T 35 Modified matrix factorization: algorithm(4/6) 1 T L 4. 1 1 : Note that 1 0 T1 L11 0 0 T1is also an upper-triangular matrix. 1,2 1,3 1 2,3 0 1 0 0 1, N 1 1, N 2, N 1 2, N (18) 3, N 1 3, N 0 1 36 Modified matrix factorization: algorithm(5/6) 5. Decompose H into T2and T3 . H T3T2 1 h 2,1 h3,1 T2 h N 1,1 h N ,1 where [ 12 0 0 1 0 h3,2 1 hN 1,2 hN 1,3 hN ,2 hN ,3 N ] [h1,1h1,2 0 0 0 0 0 1 0 hN , N 1 1 0 1 0 0 T3 0 0 h1, N ] T2,1 2 3 N 1 N 1 0 0 0 1 0 (19) 0 0 1 0 0 0 0 0 0 1 1 det( R) 1 From (8)(9)(10) we decompose R T3T2T1,then, G PT D1T3T2T1D2QT 37 Modified matrix factorization: algorithm(6/6) 6. Approximates T1, T2, and T3 by binary valued matrices J 1, J 2 , and J 3: 1 0 J1 0 0 t1,2 t1,3 1 t2,3 0 1 0 0 t1,N -1 t1, N t2, N 1 t2, N t3, N 1 t3, N 0 1 tm,n Qb (m,n ) 1 c 2,1 c3,1 J2 c N 1,1 c N ,1 0 0 1 0 c3,2 1 cN 1,2 cN 1,3 cN ,2 cN ,3 cm,n Qb (hm,n ) 0 0 0 0 0 1 0 cN , N 1 1 0 1 0 0 J3 0 0 s2 s3 1 0 0 1 0 0 0 0 s N 1 s N 0 0 0 0 1 0 0 1 sm Qb ( m ) Qb (a) 2b round (2b a) 38 Modified matrix factorization: the process of forward transform Step 1: x1 D2QT x N Step 2: x2[n] x1[n] Qr { tn,m x1[m]} for m n 1 n 1 ~ N 1 x2 [ N ] x1[ N ] 39 Modified matrix factorization: the process of forward transform n 1 Step 3: x3[n] x2[n] Qr { cn,m x2[m]} m 1 for n 2 ~ N x3[1] x2 [1] Step 4: N x4 [1] x3[1] Qr { sk x3[k ]} k 2 x4 [n] x3[n] when n 1 40 Modified matrix factorization: the process of forward transform Step 5: z PT D1x4 41 Modified matrix factorization: Accuracy analysis Preliminaries 1. Qr [a ] a where 2r1 2r1 2. is a random variable and uniformly distribute in [ 2 r ,1 2r 1 ] 3. E[] 0 and E[2 ] 4 r 12 42 Modified matrix factorization: Accuracy analysis The process in step (2)-(4) can be rewritten as: z PT D1{J 3[ J 2 ( J1D2QT x 1 ) 2 ] 3} 43 Modified matrix factorization: Accuracy analysis If y=Gx=σAx then the difference between z, y is: z y P DT 1 3T2 1 P DT 1 3 2 P D13 (20) T T T if b is very large in page.39 44 Modified matrix factorization: Accuracy analysis Using (20) to estimate the normalized root mean square error (NRMSE) and use it to measure the accuracy: E[( z y ) H ( z y )] NRMSE E[ y H y ] 45 Modified matrix factorization: Accuracy analysis Notice (20) ,we find the NRMSE which is dominated by T2 and T3 . So we let the entries of T2 and T3 as small as possible . That why we multiply P, D, and Q to G. 46 Modified matrix factorization: Accuracy analysis Example 47 Modified matrix factorization: Advantages Compare to matrix factorization : 1. simpler and faster way to derive the integer transform 2. Easier to design 3. Higher accuracy 48 Conclusions If a transform A ,which det(A) is an integer factor, we can convert it into integer transform. Integer transform is easy to implement, but is less accuracy than non-integer transform. It is a trade-off. 49 Reference 1. W.-K. Cham, PhD “Development of integer cosine transforms by the principle of dyadic symmetry” 2. W. K. Cham and Y. T. Chan” An Order-16 Integer Cosine Transform” 3. Pengwei Hao and Qingyun Shi “Matrix Factorizations for Reversible Integer Mapping” 4. Soo-Chang Pei and Jian-Jiun Ding” The Integer Transforms Analogous to Discrete Trigonometric Transforms” 5. Soo-Chang Pei and Jian-Jiun Ding” Improved Reversible Integer Transform” 50