PPT Slide
Ordered Dithering on a TMS320C62x
; remove next two lines if thresholds in linear array MVK .S1 0x0001,AMR ; modulo block size 2^2 MVKH .S1 0x4000,AMR ; modulo addr reg B6; initialize A6 and B6 .trip 100 ; minimum loop count
dith: LDB .D1 *A6++,A4 ; read pixel
|| LDB .D2 *B6++,B4 ; read threshold|| CMPGTU .L1x A4,B4,A1 ; threshold pixel|| ZERO .S1 A5 ; 0 if <= threshold [A1] MVK .S1 255,A5 ; 255 if > threshold|| STB .D1 A5,*A6++ ; store result||[B0] SUB .L2 B0,1,B0 ; decrement counter||[B0] B .S2 dith ; branch if not zero
periodicarray of thresholds