A direction is detected for each block in which a pixel value is changed which is represented by an edge that indicates a direction of change in pixel value in each block, a direction in which a deblocking filter is to be applied to a block boundary is determined based on a direction of an edge detected for a block to be processed which includes the block boundary subject to deblocking and on a direction of an edge detected for a block contacting the block to be processed, and the deblocking filter is applied to the block boundary in accordance with the determined direction.
展开▼