Method and apparatus for processing video signal
A method for processing a video according to the present invention may comprise: generating a plurality of Most Probable Mode (MPM) candidates; determining whether there is an MPM candidate identical to an intra-prediction mode of a current block among the plurality of MPM candidates; obtaining the intra-prediction mode of the current block, based on a result of the determining; and performing an intra-prediction for the current block, based on the intra-prediction mode of the current block.
1. A method for decoding an image with a decoding apparatus, comprising:
determining, with the decoding apparatus, an intra prediction mode of a current block in the image from available intra prediction modes;
obtaining, with the decoding apparatus, prediction samples of the current block based on the determined intra prediction mode, a first prediction sample which is one of the prediction samples being obtained based on a first reference sample specified based on the determined intra prediction mode;
modifying, with the decoding apparatus, the first prediction sample based on an offset to generate a second prediction sample; and,
obtaining a reconstruction sample of the current block based on the second prediction sample,
wherein, in response to the first prediction sample belonging to a first sub-region in the current block, the offset is determined based on at least one neighboring sample adjacent to the current block,
wherein, in response to the first prediction sample belonging to a second sub-region in the current block, the offset is set equal to 0, and the second prediction sample is obtained to be the same as the first prediction sample,
wherein the first sub-region includes a plurality of sample lines, and
wherein at least one of a size or a shape of the first sub-region is differently determined according to whether the intra prediction mode of the current block is a directional mode or a non-directional mode.
2. The method of claim 1 , wherein, in response to the intra prediction mode of the current block being the directional mode, the at least one of the size or the shape of the first sub-region is differently determined according to an angle of the directional mode.
3. The method of claim 2 , wherein, in response to the intra prediction mode of the current block being the non-directional mode, one of the first sub-region and the second sub-region has a rectangle shape and the other of the first sub-region and the second sub-region has a non-rectangle shape, and
wherein, in response to the intra prediction mode of the current block being the directional mode, both the first sub-region and the second sub-region have the rectangle shape.
4. The method of claim 3 , wherein, a number of sample lines of the first sub-region, corresponding to a case where the intra prediction mode of the current block has a first angle, is greater than a number of sample lines of the first sub-region, corresponding to a case where the intra prediction mode of the current block has a second angle.
5. The method of claim 4 , wherein the available intra prediction modes are divided into a plurality of groups,
wherein the plurality of groups includes a first group including a Planar mode, a second group including a plurality of most probable mode (MPM) candidates, and a third group including remaining modes, and
wherein the MPM candidates in the second group are derived based on an intra prediction mode of a neighboring block adjacent to the current block.
6. The method of claim 5 , wherein a group to which the intra prediction mode of the current block belongs is selected, based on at least one of flags signaled from a bitstream, among the plurality of groups,
wherein the intra prediction mode of the current block is determined from the selected group of the plurality of groups, and
wherein the flags include a first flag indicating whether the intra prediction mode of the current block belongs to the first group and a second flag indicating whether the intra prediction mode of the current block belongs to the third groups.
7. The method of claim 6 , wherein, in response to a case where the intra prediction mode of the neighboring block is not available for deriving the MPM candidates of the current block, the MPM candidates of the current block are derived based on a pre-defined mode, and
wherein the pre-defined mode is representative of the Planar mode.
8. The method of claim 7 , wherein the Planar mode is included only in the first group and is not included in the MPM candidates in the second group.
9. The method of claim 8 , wherein a number of intra prediction modes in the first group is less than a number of the MPM candidates in the second group.
10. The method of claim 9 , wherein the number of the MPM candidates in the second group is equal to five.
11. A method for encoding an image with an encoding apparatus, comprising:
obtaining, with the encoding apparatus, prediction samples of a current block in the image based on an intra prediction mode of the current block, a first prediction sample which is one of the prediction samples being obtained based on a first reference sample specified based on the determined intra prediction mode;
modifying, with the encoding apparatus, the first prediction sample based on an offset to generate a second prediction sample;
generating, with the encoding apparatus, a residual sample of the current block, the residual sample being a difference between the second prediction sample and an original sample of the current block; and
generating, with the encoding apparatus, a bitstream by encoding the residual sample,
wherein, in response to the first prediction sample belonging to a first sub-region in the current block, the offset is determined based on at least one neighboring sample adjacent to the current block,
wherein, in response to the first prediction sample belonging to a second sub-region in the current block, the offset is set equal to 0, and the second prediction sample is obtained to be the same as the first prediction sample,
wherein the first sub-region includes a plurality of sample lines, and
wherein at least one of a size or a shape of the first sub-region is differently determined according to whether the intra prediction mode of the current block is a directional mode or a non-directional mode.
12. A non-transitory computer-readable medium for storing data associated with a video signal, comprising:
a data stream stored in the non-transitory computer-readable medium, the data stream including information generated by encoding a residual sample of a current block,
wherein the residual sample of the current block is a difference between a prediction sample and an original sample of the current block,
wherein the prediction sample is generated by modifying an initial prediction sample of the current block based on an offset,
wherein the initial prediction sample is obtained based on a first reference sample specified based on intra prediction mode of the current block,
wherein, in response to the initial prediction sample belonging to a first sub-region in the current block, the offset is determined based on at least one neighboring sample adjacent to the current block,
wherein, in response to the initial prediction sample belonging to a second sub-region in the current block, the offset is set equal to 0, and the prediction sample is obtained to be the same as the initial prediction sample,
wherein the first sub-region includes a plurality of sample lines, and
wherein at least one of a size or a shape of the first sub-region is differently determined according to whether the intra prediction mode of the current block is a directional mode or a non-directional mode.