Video signal processing method and apparatus therefor
A video signal decoding apparatus comprises a processor, wherein the processor: obtains first motion information for the current block; obtains second motion information for the current block; configures a first template set including adjacent blocks of the current block; obtain a first cost value by comparing the first template set with a second template set including adjacent blocks of a first reference block corresponding to the first motion information; obtains a second cost value by comparing the first template with a third template set including adjacent blocks of a second reference block corresponding to the second motion information; configures motion information corresponding to a smaller cost value from among the first cost value and the second cost value as final motion information; and generates a prediction block for the current block on the basis of the final motion information.
1 . A video signal decoding apparatus comprising a processor,
wherein the processor is configured to:
obtain first motion information of a current block,
wherein the first motion information corresponds to a first reference block,
obtain second motion information of the current block,
wherein the second motion information corresponds to a second reference block,
obtain a first template set comprising neighboring samples of the current block,
obtain a second template set comprising neighboring samples of the first reference block,
obtain a third template set comprising neighboring samples of the second reference block,
obtain partition information for a GPM (Geometric Partitioning Mode) by comparing the first template set with the second template set and the third template set, and
reconstruct the current block using the GPM based on the partition information.
2 . The video signal decoding apparatus of claim 1 ,
wherein the first template set is partitioned into a first template and a second template based on a first reference line,
wherein the first template set is partitioned into a third template and a fourth template based on a second reference line,
wherein the second template set is partitioned into a first plurality of templates based on the first reference line,
wherein the second template set is partitioned into a second plurality of templates based on the second reference line,
wherein the third template set is partitioned into a third plurality of templates based on the first reference line,
wherein the third template set is partitioned into a fourth plurality of templates based on the second reference line,
wherein the processor is configured to:
obtain a first cost value by comparing the first template with a first corresponding template, wherein the first corresponding template is a template corresponding to the first template among the first plurality of templates,
obtain a second cost value by comparing the second template with a second corresponding template, wherein the second corresponding template is a template corresponding to the second template among the third plurality of templates,
obtain a first intermediate cost value based on the first cost value and the second cost value,
obtain a third cost value by comparing the third template with a third corresponding template, wherein the third corresponding template is a template corresponding to the third template among the second plurality of templates,
obtain a fourth cost value by comparing the fourth template with a fourth corresponding template, wherein the fourth corresponding template is a template corresponding to the fourth template among the fourth plurality of templates,
obtain a second intermediate cost value based on the third cost value and the fourth cost value, and
obtain the partition information based on at least one of the first intermediate cost value or the second intermediate cost value.
3 . The video signal decoding apparatus of claim 2 ,
when the partition information for the current block is obtained based on the first intermediate cost value:
the current block is partitioned into a first plurality of sub-blocks,
a prediction block for the current block is obtained based on the first plurality of sub-blocks,
when the partition information for the current block is obtained based on the second intermediate cost value:
the current block is partitioned into a second plurality of sub-blocks,
a prediction block for the current block is obtained based on the second plurality of sub-blocks.
4 . The video signal decoding apparatus of claim 2 ,
wherein the first intermediate cost value is a value obtained by summing the first cost value and the second cost value,
wherein the second intermediate cost value is a value obtained by summing the third cost value and the fourth cost value.
5 . The video signal decoding apparatus of claim 2 ,
wherein the processor is configured to:
parse a syntax element related to the partition information.
6 . A video signal encoding apparatus comprising a processor,
wherein the processor is configured to obtain a bitstream to be decoded by a decoding method, the decoding method comprising:
obtaining first motion information of a current block,
wherein the first motion information corresponds to a first reference block;
obtaining second motion information of the current block,
wherein the second motion information corresponds to a second reference block;
obtaining a first template set comprising neighboring samples of the current block;
obtaining a second template set comprising neighboring samples of the first reference block;
obtaining a third template set comprising neighboring samples of the second reference block;
obtaining partition information for a GPM (Geometric Partitioning Mode) by comparing the first template set with the second template set and the third template set; and
reconstructing the current block using the GPM based on the partition information.
7 . The video signal encoding apparatus of claim 6 ,
wherein the first template set is partitioned into a first template and a second template based on a first reference line,
wherein the first template set is partitioned into a third template and a fourth template based on a second reference line,
wherein the second template set is partitioned into a first plurality of templates based on the first reference line,
wherein the second template set is partitioned into a second plurality of templates based on the second reference line,
wherein the third template set is partitioned into a third plurality of templates based on the first reference line,
wherein the third template set is partitioned into a fourth plurality of templates based on the second reference line,
the decoding method comprising:
obtaining a first cost value by comparing the first template with a first corresponding template, wherein the first corresponding template is a template corresponding to the first template among the first plurality of templates;
obtaining a second cost value by comparing the second template with a second corresponding template, wherein the second corresponding template is a template corresponding to the second template among the third plurality of templates;
obtaining a first intermediate cost value based on the first cost value and the second cost value;
obtaining a third cost value by comparing the third template with a third corresponding template, wherein the third corresponding template is a template corresponding to the third template among the second plurality of templates;
obtaining a fourth cost value by comparing the fourth template with a fourth corresponding template, wherein the fourth corresponding template is a template corresponding to the fourth template among the fourth plurality of templates;
obtaining a second intermediate cost value based on the third cost value and the fourth cost value; and
obtaining the partition information based on at least one of the first intermediate cost value or the second intermediate cost value.
8 . The video signal encoding apparatus of claim 7 ,
when the partition information for the current block is obtained based on the first intermediate cost value:
the current block is partitioned into a first plurality of sub-blocks,
a prediction block for the current block is obtained based on the first plurality of sub-blocks,
when the partition information for the current block is obtained based on the second intermediate cost value:
the current block is partitioned into a second plurality of sub-blocks,
a prediction block for the current block is obtained based on the second plurality of sub-blocks.
9 . The video signal encoding apparatus of claim 7 ,
wherein the first intermediate cost value is a value obtained by summing the first cost value and the second cost value,
wherein the second intermediate cost value is a value obtained by summing the third cost value and the fourth cost value.
10 . The video signal encoding apparatus of claim 7 ,
the decoding method comprising:
parsing a syntax element related to the partition information.
11 . A non-transitory computer-readable storage medium storing a bitstream, wherein the bitstream is to be decoded by a decoding method, and the decoding method comprising:
obtaining first motion information of a current block,
wherein the first motion information corresponds to a first reference block;
obtaining e-second motion information of the current block,
wherein the second motion information corresponds to a second reference block;
obtaining a first template set comprising neighboring samples of the current block;
obtaining a second template set comprising neighboring samples of the first reference block;
obtaining a third template set comprising neighboring samples of the second reference block;
obtaining partition information for a GPM (Geometric Partitioning Mode) by comparing the first template set with the second template set and the third template set; and
reconstructing the current block using the GPM based on the partition information.
12 . The non-transitory computer-readable storage medium of claim 11 ,
wherein the first template set is partitioned into a first template and a second template based on a first reference line,
wherein the first template set is partitioned into a third template and a fourth template based on a second reference line,
wherein the second template set is partitioned into a first plurality of templates based on the first reference line,
wherein the second template set is partitioned into a second plurality of templates based on the second reference line,
wherein the third template set is partitioned into a third plurality of templates based on the first reference line,
wherein the third template set is partitioned into a fourth plurality of templates based on the second reference line,
the decoding method comprising:
obtaining a first cost value by comparing the first template with a first corresponding template, wherein the first corresponding template is a template corresponding to the first template among the first plurality of templates;
obtaining a second cost value by comparing the second template with a second corresponding template, wherein the second corresponding template is a template corresponding to the second template among the third plurality of templates;
obtaining a first intermediate cost value based on the first cost value and the second cost value;
obtaining a third cost value by comparing the third template with a third corresponding template, wherein the third corresponding template is a template corresponding to the third template among the second plurality of templates;
obtaining a fourth cost value by comparing the fourth template with a fourth corresponding template, wherein the fourth corresponding template is a template corresponding to the fourth template among the fourth plurality of templates;
obtaining a second intermediate cost value based on the third cost value and the fourth cost value; and
obtaining the partition information based on at least one of the first intermediate cost value or the second intermediate cost value.
13 . The non-transitory computer-readable storage medium of claim 12 ,
:
the current block when the partition information for the current block is obtained based on the first intermediate cost valueis partitioned into a first plurality of sub-blocks,
a prediction block for the current block is obtained based on the first plurality of sub-blocks,
when the partition information for the current block is obtained based on the second intermediate cost value:
the current block is partitioned into a second plurality of sub-blocks,
a prediction block for the current block is obtained based on the second plurality of sub-blocks.
14 . The non-transitory computer-readable storage medium of claim 12 ,
wherein the first intermediate cost value is a value obtained by summing the first cost value and the second cost value,
wherein the second intermediate cost value is a value obtained by summing the third cost value and the fourth cost value.
15 . The non-transitory computer-readable storage medium of claim 12 ,
the decoding method comprising:
parsing a syntax element related to the partition information.