.[.A method and apparatus to remove a block effect and a ring effect
appearing in a compression-coded image is disclosed. The present
invention is especially applicable to an image compression-coded at a low
bit rate. In particular, the present invention includes a variety of
masks for the removal of the block/ring effect. Thus, one mask is select
for a pixel to be filtered. Moreover, candidate pixels to be averaged
with the pixel to be filtered is selected from the pixels of the selected
mask to better maintain the details of the image, and a weight is applied
to improve the calculation speed of the averaging operation. More
particularly, the masks according to the present invention have longer
tabs toward adjacent blocks at boundaries of the given block to remove
the block and ring effect..]. .Iadd.In one embodiment, the apparatus
includes a filtering unit configured to filter a pixel of an image. The
filtering unit is configured to select at least four pixels of successive
pixels according to a position of a pixel to be filtered. The selected at
least four pixels include the pixel to be filtered. The filtering unit is
configured to perform at least one comparison. The comparison compares a
determined value and a threshold. The threshold is based on a
quantization information of at least a portion of the image including the
pixel to be filtered, the determined value is based on a difference
value, and the difference value is based on two of the successive
pixels..Iaddend.