flip 510 a multiplexer 520 an absolute difference calculator 530 and an accumulator 540 the d flip flop 510 receives a reference block pixel data r and outputs a first delayed reference block pixel data r 0 which is delayed by a predetermined period of time with respect to the reference block pixel data r or receives the first delayed reference block pixel data r 0 and outputs a second delayed reference block pixel data r 1 which is delayed by a predetermined period of time with respect to the first delayed reference block pixel data r 0 generally the d flip flop 510 receives an n th delayed reference block pixel data r n u2212 1 and outputs an n 1 th delayed reference block pixel data r n which is delayed by a predetermined period of time with respect to the n th delayed reference block pixel data r n u2212 1 however the n 2 th pe which is the last pe of the pe unit 430 does not have the d flip flop 510 and thus it does not output a signal delayed by a predetermined period of time with respect to the n 1 th delayed reference block pixel data r n the multiplexer mux 520 selectively outputs the candidate block pixel data s 1 or s 2 the absolute difference calculator 530 calculates absolute differences between the reference block pixel data r r 0 or r n u2212 1 and the candidate block pixel data s 1 or s 2 output from the multiplexer.