Patent ID: 8369421

Claim:
A method for coding an image, said image being segmented into a plurality of motion compensation blocks, said motion compensation blocks being segmented into a plurality of coding blocks, the method comprising: coding the image on a coding block basis to obtain a coded image; determining a filter selection parameter for the image, wherein the filter selection parameter is used to determine a threshold value for a quantization parameter and the threshold value is used to judge whether a filter for a coding distortion removal is to be applied to a coding block; decoding the coded image to obtain a motion compensated image and a difference image; adding the motion compensated image and the difference image to obtain a reconstructed image; and removing a coding distortion, to output a decoded image, in an area disposed in both sides of a block boundary between a first coding block and a second coding block in the reconstructed image, the first coding block and the second coding block being adjacent each other and both a difference image of the first coding block and a difference image of the second coding block being zero, wherein the coding distortion is not removed if both the first coding block and the second coding block are inside a same motion compensation block, wherein the coding distortion is removed if the first coding block is inside a first motion compensation block and the second coding block is inside a second motion compensation block adjacent to the first motion compensation block, and if a difference between a first pixel and a second pixel is smaller than the threshold value, the first pixel being in the first coding block and the second pixel being in the second coding block, and wherein the coding distortion is not removed if the first coding block is inside a first motion compensation block and the second coding block is inside a second motion compensation block adjacent to the first motion compensation block, and if a difference between a first pixel and a second pixel is larger than the threshold value.