Method and apparatus for processing video signal
A method for decoding a video according to the present invention may comprise: determining a first prediction mode for a first sub-block in a current block and a second intra prediction mode for a second sub-block, performing a first prediction for the first sub-block based on the first intra prediction mode, performing a second prediction for the second sub-block based on the second intra prediction mode, and obtaining a prediction sample of the current block according to a result of the first prediction and the second prediction.
1. A method of decoding a video, the method comprising:
determining a prediction mode of a current block, the prediction mode being determined as one of intra prediction and inter prediction;
obtaining a first prediction sample of the current block by performing the intra prediction or the inter prediction for the current block; and
obtaining a second prediction sample based on a weighted sum operation of the first prediction sample and a value derived by reference samples adjacent to the current block,
wherein the reference samples comprise at least one of a top neighboring sample which has a same x-coordinate as the first prediction sample or a left neighboring sample which has a same y-coordinate as the first prediction sample,
wherein the second prediction sample is obtained by applying a first weight to the first prediction sample and applying a second weight to the value derived by the reference samples,
wherein the first weight and the second weight are determined based on which one of the intra prediction and the inter prediction is applied to a neighboring block adjacent to the current block, the neighboring block being a top neighboring block or a left neighboring block, and
wherein the first weight and the second weight are determined differently between when the neighboring block is coded by the intra prediction and when the neighboring block is coded by the inter prediction.
2. The method of claim 1 , wherein the first weight is greater when the neighboring block is coded by the inter prediction than when the neighboring block is coded by the intra prediction, and
wherein the second weight is smaller when the neighboring block is coded by the inter prediction than when the neighboring block is coded by the intra prediction.
3. The method of claim 1 , wherein deriving the second prediction sample by using the weighted sum operation is allowed only when a size of the current block satisfies a pre-defined condition.
4. The method of claim 1 , wherein a set of the first weight and the second weight is determined as {½, ½} or {¼, ¾} depending on which one of the intra prediction and the inter prediction is applied to the neighboring block.
5. A method of encoding a video, the method comprising:
determining a prediction mode of a current block, the prediction mode being determined as one of intra prediction and inter prediction;
obtaining a first prediction sample of the current block by performing the intra prediction or the inter prediction for the current block; and
obtaining a second prediction sample based on a weighted sum operation of the first prediction sample and a value derived by reference samples adjacent to the current block,
wherein the reference samples comprise at least one of a top neighboring sample which has a same x-coordinate as the first prediction sample or a left neighboring sample which has a same y-coordinate as the first prediction sample,
wherein the second prediction sample is obtained by applying a first weight to the first prediction sample and applying a second weight to the value derived by the reference samples,
wherein the first weight and the second weight are determined based on whether which one of the intra prediction and the inter prediction is applied to a neighboring block adjacent to the current block, the neighboring block being a top neighboring block or a left neighboring block, and
wherein the first weight and the second weight are determined differently between when the neighboring block is coded by the intra prediction and when the neighboring block is coded by the inter prediction.
6. The method of claim 5 , wherein the first weight is greater when the neighboring block is coded by the inter prediction than when the neighboring block is coded by the intra prediction, and
wherein the second weight is smaller when the neighboring block is coded by the inter prediction than when the neighboring block is coded by the intra prediction.
7. The method of claim 5 , wherein deriving the second prediction sample by using the weighted sum operation is allowed only when a size of the current block satisfies a pre-defined condition.
8. The method of claim 5 , wherein a set of the first weight and the second weight is determined as {½, ½} or {¼, ¾} depending on which one of the intra prediction and the inter prediction is applied to the neighboring block.
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 being encoded by an encoding method which comprising:
determining a prediction mode of a current block, the prediction mode being determined as one of intra prediction and inter prediction;
obtaining a first prediction sample of the current block by performing the intra prediction or the inter prediction for the current block; and
obtaining a second prediction sample based on a weighted sum operation of the first prediction sample and a value derived by reference samples adjacent to the current block,
wherein the reference samples comprise at least one of a top neighboring sample which has a same x-coordinate as the first prediction sample or a left neighboring sample which has a same y-coordinate as the first prediction sample,
wherein the second prediction sample is obtained by applying a first weight to the first prediction sample and applying a second weight to the value derived by the reference samples,
wherein the first weight and the second weight are determined based on which one of the intra prediction and the inter prediction is applied to a neighboring block adjacent to the current block, the neighboring block being a top neighboring block or a left neighboring block, and
wherein the first weight and the second weight are determined differently between when the neighboring block is coded by the intra prediction and when the neighboring block is coded by the inter prediction.