80 likes | 187 Views
RGB to YUV(CDFG). 林鼎原 Department of Electrical Engineering National Cheng Kung University Tainan, Taiwan, R.O.C. 2012.3.16. v oid main(void) { int a, b, c; ……. RGB_2_Y( I_Frame , O_Frame ); ……. } void RGB_2_Y( I_Frame , O_Frame ); { int y; for ( i =1, i <64, i ++) {
E N D
RGB to YUV(CDFG) 林鼎原 Department of Electrical Engineering National Cheng Kung University Tainan, Taiwan, R.O.C 2012.3.16
void main(void) { int a, b, c; ……. RGB_2_Y(I_Frame, O_Frame); ……. } void RGB_2_Y(I_Frame, O_Frame); { int y; for (i=1, i<64, i++) { y=0.257*a +0.504*b+0.098*c+16; write(y) to O_Frame;} }
一、Simple Operation description • Y=0.257a +0.504 b +0.098 c +16 • i=1----------------------------------------------------------(1) L1: If(i>=64) goto L2-----------------------------------------(2) • a=I_P()-----------------------------------------------------(3) • b=I_P()-----------------------------------------------------(4) • c=I_P()-----------------------------------------------------(5) • v1 = 0.257 a---------------------------------------------(6) • v2 = 0.504 b --------------------------------------------(7) • v3 = 0.098 c --------------------------------------------(8) • v4 = v1 + v2 ------------------------------------------------(9) • v5 = v3 + 16 -----------------------------------------------(10) • y = v4 + v5 -----------------------------------------------(11) • O_P()=y----------------------------------------------------(12) • i++ ----------------------------------------------------------(13) • goto L1-----------------------------------------------------(14) L2: Nop----------------------------------------------------------(15)
1 Mux 一、CDFG size i ++ Control line < I_P() I_P() I_P() ← ← ← a b c 0.257 0.504 0.098 * * * v3 v1 16 v2 + + v5 v4 + y ← O_P()
二、Simple Operation description(resource) • Y=(0.257a +16)+0.504 b +0.098 c • i=1----------------------------------------------------------(1) L1: If(i>=64) goto L2-----------------------------------------(2) • a=I_P()-----------------------------------------------------(3) • b=I_P()-----------------------------------------------------(4) • c=I_P()-----------------------------------------------------(5) • v1 = 0.257 a---------------------------------------------(6) • v2 = 0.504 b --------------------------------------------(7) • v3 = 0.098 c --------------------------------------------(8) • v4 = v1 + v2 ------------------------------------------------(9) • v5 = v3 + 16 -----------------------------------------------(10) • y = v4 + v5 -----------------------------------------------(11) • O_P()=y----------------------------------------------------(12) • i++ ----------------------------------------------------------(13) • goto L1-----------------------------------------------------(14) L2: Nop----------------------------------------------------------(15)
二、Resource constrained(2乘1加) I_P() I_P() I_P() ← ← ← a b 0.257 s1 * 0.504 s2 * v1 16 0.098 c + * s3 v2 v4 + s4 v3 v5 s5 + y ← O_P()
三、Time –Constrained Scheduling I_P() I_P() I_P() ← ← ← a b 0.257 c 0.098 0.504 s1 * * * s2 16 v3 v1 v2 + s3 + v4 v5 + s4 y ← O_P()
四、Pipelining Scheduling I_P() I_P() I_P() ← ← ← a 0.257 b s1 c * 0.504 I_P() I_P() I_P() s2 * 0.098 V1 16 ← ← ← s3 * + 0.257 V2 V4 a c s4 b + v * 0.504 V5 V3 s5 * + 0.098 16 y V1 s6 * + ← V2 V4 s7 + O_P() V3 V5 s8 + y ← O_P()