Method and device for encoding/decoding image
A device for encoding/decoding the image according to the present invention includes an intra prediction module configured to: determine an intra prediction mode of a current block; determine a scanning order of multiple sub blocks in the current block on the basis of the determined intra prediction mode; and perform intra prediction of the current block on the basis of the determined scanning order.
1. An image decoding method comprising:
determining an intra prediction mode of a current block;
determining whether to apply a first filter for neighboring samples of the current block based on the intra prediction mode of the current block and a size of the current block;
filtering the neighboring samples to generate filtered neighboring samples based on the determination that the first filter is applied to the neighboring samples;
applying a second filter for the filtered neighboring samples to generate reference samples;
generating a prediction block of the current block based on the reference samples;
generating a residual block of the current block by decoding a bitstream; and
reconstructing the current block based on the prediction block and the residual block,
wherein the second filter is an interpolation filter which uses four samples among the filtered neighboring samples.
2. The image decoding method of claim 1 ,
wherein the second filter is selected based on information signaled at a block level.
3. The image decoding method of claim 1 ,
wherein the second filter is selected based on the size of the current block.
4. The image decoding method of claim 3 ,
wherein the size of the current block is a sum of values, each representing a width and a height of the current block in a log scale.
5. The image decoding method of claim 1 ,
wherein the second filter is selected as one among a plurality of filters including a Gaussian interpolation filter.
6. An image encoding method comprising:
determining an intra prediction mode of a current block;
determining whether to apply a first filter for neighboring samples of the current block based on the intra prediction mode of the current block and a size of the current block;
filtering the neighboring samples to generate filtered neighboring samples based on the determination that the first filter is applied to the neighboring samples;
applying a second filter for the filtered neighboring samples to generate reference samples;
generating a prediction block of the current block based on the reference samples;
generating a residual block of the current block based on the prediction block; and
encoding the residual block of the current block into a bitstream,
wherein the second filter is an interpolation filter which uses four samples among the filtered neighboring samples.
7. A method of transmitting a bitstream that is generated by an image encoding method with an encoding apparatus, wherein the image encoding method comprises:
determining an intra prediction mode of a current block;
determining whether to apply a first filter for neighboring samples of the current block based on the intra prediction mode of the current block and a size of the current block;
filtering the neighboring samples to generate filtered neighboring samples based on the determination that the first filter is applied to the neighboring samples;
applying a second filter for the filtered neighboring samples to generate reference samples;
generating a prediction block of the current block based on the reference samples;
generating a residual block of the current block based on the prediction block; and
encoding the residual block of the current block into a bitstream,
wherein the second filter is an interpolation filter which uses four samples among the filtered neighboring samples.