ing to the maximum value to determine whether filtering should be performed; and a filtering module 6 for using the boundary pixel and each set of M pixels on each side of the boundary pixel to perform filtering if the determination module 5 determines that filtering should be performed, where N is a positive integer and M is a positive integer smaller than N. A buffer may be provided for temporar