More Efficient Ordered Dithering on the C6x
EXTU .S1 A4,16,24,A13 ; extract pixel #2 EXTU .S2 B4,16,24,B13 ; extract threshold #2[!B0] OR .L1 A5,A8,A5 ; output of pixel 1 CMPLTU .L2 A13,B13,B1 ; B1 = (A13 < B13) EXTU .S1 A4,8,24,A14 ; extract pixel #3 EXTU .S2 B4,8,24,B14 ; extract threshold #3[!B1] OR .L1 A5,A9,A5 ; output of pixels 1-2 CMPLTU .L2 A14,B14,B2 ; B2 = (A14 < B14) EXTU .S1 A4,0,24,A15 ; extract pixel #4 EXTU .S2 B4,0,24,B15 ; extract threshold #4[!B2] OR .L2 A5,B9,B5 ; output of pixels 1-3 CMPLTU .L1 A15,B15,A1 ; B2 = (A15 < B15)[!A1] OR .S1 B5,A11,A5 ; output of pixels 1-4 STW .D1 A5,*A6++ ; store results
[A2] SUB .L1 A2,1,A2 ; decrement loop count
[A2] B .L2 dith2 ; if A2 != 0, branch