Method and device for processing video signal
A method of video decoding according to the present invention may comprise determining an intra prediction mode of a current block, determining a DC value based on at least one of top reference samples or left reference samples of the current block when the intra prediction mode of the current block is a DC mode, and deriving a prediction sample of the current block based on the DC value.
1. A method of decoding a video, the method comprising:
determining an intra prediction mode of a current block;
when it is determined that the intra prediction mode of the current block is a directional intra prediction mode, obtaining a first prediction value for a current sample in the current block based on a first reference sample located on a forward direction of the directional intra prediction mode from the current sample; and
generating a final prediction value of the current sample in the current block by modifying the first prediction value based on a second reference sample,
wherein the intra prediction mode of the current block is determined as one of either conventional intra-prediction modes or extended intra prediction modes,
wherein whether the intra prediction mode of the current block is determined as one of the conventional intra prediction modes or the extended intra prediction modes is determined based on a shape of the current block,
wherein the second reference sample is located on an opposite direction of the directional intra prediction mode from the current sample,
wherein the final prediction value is generated based on a weighted sum of the first prediction value and the second reference sample,
wherein modifying the first prediction value is performed in response that a size of the current block is greater than a threshold value.
2. The method of claim 1 , wherein modifying the first prediction value is allowed only when the directional prediction mode is one of intra prediction modes pre-defined in a decoder.
3. The method of claim 2 , wherein prediction values of samples belonging to a first region in the current block are modified but prediction values of samples belonging to a second region in the current block are output as they are.
4. The method of claim 3 , wherein a size of the first region and the second region is determined differently based on the intra prediction mode of the current block.
5. The method of claim 4 , wherein a position of the second reference sample is determined based on a value resulting from adding a x-coordinate or a y-coordinate of the current sample to an offset value, and
wherein the offset value is determined based on an angle of the directional intra prediction mode of the current block.
6. The method of claim 5 , wherein the first prediction value for the current sample is obtained based on a weight sum of a plurality of first reference samples while the second prediction value is obtained by copying a value of the second reference sample.
7. The method of claim 1 , wherein when the shape of the current block is a non-square, the intra prediction mode of the current block is determined as one of the extended intra prediction mode, and
wherein when the shape of the current block is a square, the intra prediction mode of the current block is determined as one of the non-extended intra prediction mode.
8. A method of encoding a video, the method comprising:
obtaining a first prediction value for a current sample in a current block based an intra prediction mode of the current block and a first reference sample, the intra prediction mode being representative of a directional intra prediction mode, the first reference sample being located on a forward direction of the directional intra prediction mode from the current sample; and
generating a final prediction value of the current sample in the current block by modifying the first prediction value based on a second reference sample,
wherein the intra prediction mode of the current block is determined as one of either conventional intra prediction modes or extended intra prediction modes,
wherein whether the intra prediction mode of the current block is determined as one of the conventional intra prediction modes or the extended intra prediction modes is determined based on a shape of the current block,
wherein the second reference sample is located on an opposite direction of the directional intra prediction mode from the current sample,
wherein the final prediction value is generated based on a weighted sum of the first prediction value and the second reference sample, and
wherein modifying the first prediction value is performed in response that a size of the current block is greater than a threshold value.
9. 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 comprising intra prediction mode information for intra prediction of a current block,
wherein an intra prediction mode of a current block is determined based on the intra prediction mode information,
wherein the intra prediction mode of the current block is determined as one of either conventional intra prediction modes or extended intra prediction modes,
wherein whether the intra prediction mode of the current block is determined as one of the conventional intra prediction modes or the extended intra prediction modes is determined based on a shape of the current block,
wherein, in response to a case that the intra prediction mode of the current block is a directional intra prediction mode, a first prediction value for a current sample in the current block is obtained based on a first reference sample located on a forward direction of the directional intra prediction mode from the current sample,
wherein a final prediction value of the current sample in the current block is generated by modifying the first prediction value based on a second reference sample,
wherein the second reference sample is located on an opposite direction of the directional intra prediction mode from the current sample,
wherein the final prediction value is generated based on a weighted sum of the first prediction value and the second prediction value, and
wherein the modification of the first prediction value is performed in response that a size of the current block is greater than a threshold value.