Method, apparatus, and medium for video processing
View Patent ↗Embodiments of the present disclosure provide a solution for video processing. A method for video processing is proposed. The method comprises: determining, for a conversion between a current video block of a video and a bitstream of the video, motion information of the current video block, the current video block being coded with at least one of: an intra block copy (IBC) merge mode, an IBC with template matching mode, or an intra template matching mode; updating the motion information based on a constraint, the constraint indicating a target value of a component of the motion information; and performing the conversion based on the updated motion information.
1 . A method for video processing, comprising:
determining, for a conversion between a current video block of a video and a bitstream of the video, a reference template of the current video block based on coding information of the current video block, the current video block being coded with a sample reordering mode; and
performing the conversion based on the reference template.
2 . The method of claim 1 , wherein the coding information comprises at least one of:
a sample reordering type of the sample reordering mode, or
a template shape of the reference template.
3 . The method of claim 1 , further comprising: determining motion information of the current video block based on the coding information of the current video block,
wherein the motion information comprises one of: a motion vector of the current video block, or a block vector of the current video block,
wherein the coding information comprises at least one of: a sample reordering type of the sample reordering mode, a template shape of the reference template, a dimension of the current video block, a dimension of a template of the current video block, a dimension of a partial of the template, a location of the current video block, or a location of the template,
wherein the template of the current video block comprises at least one of: a current template of the current video block, or the reference template of the current video block,
wherein the dimension of the current video block comprises at least one of: a width of the current video block, or a height of the current video block,
wherein the dimension of the template or the dimension of the partial of the template comprises at least one of: a width of the template or a width of the partial of the template, or a height of the template or a height of the partial of the template, or
wherein a location of the current video block or a location of the template comprises at least one of: a location of a center sample of the current video block, a location of a center sample of the template, a location of a top-left sample of the current video block, or a location of a top-left sample of the template.
4 . The method of claim 1 , wherein a current template of the current video block and the reference template of a reference block of the current video block are horizontal templates, a width of the horizontal templates being the same with a width of the current video block, and the sample reordering mode comprises a horizontal flip reordering mode,
wherein the current template comprises a neighboring sample above to the current video block, and the reference template comprises a neighboring sample above to the reference block,
wherein a location difference between the current template and the current video block is the same with a location difference between the reference template and the reference block,
wherein a first horizontal distance between a top-left sample of the current template and a top-left sample of the current video block is the same with a second horizontal distance between a top-left sample of the reference template and a top-left sample of the reference block, and a first vertical distance between the top-left sample of the current template and the top-left sample of the current video block is the same with a second vertical distance between the top-left sample of the reference template and the top-left sample of the reference block,
wherein the first and second horizontal distances are zero, and the first and second vertical distances are a height of the current template or the reference template, or
wherein a distance between the top-left sample of the current template and the top-left sample of the reference template is the same with a distance between the top-left sample of the current video block and the top-left sample of the reference block.
5 . The method of claim 4 , wherein at least one of a sample in the current template or a sample in the reference template is flipped,
wherein a flip type of the current video block is horizontal flip, and at least one of a sample in the current template or a sample in the reference template is flipped, or
wherein a horizontal distance between the current video block and the reference block is the same with a horizontal distance between the current template and the reference template.
6 . The method of claim 1 , wherein a current template of the current video block and the reference template of a reference block of the current video block are vertical templates, a height of the vertical templates being the same with a height of the current video block, and the sample reordering mode comprises a horizontal flip reordering mode,
wherein the current template comprises a neighboring sample left to the current video block, and the reference template comprises a neighboring sample right to the reference block,
wherein a location difference between the current template and the current video block is different from a location difference between the reference template and the reference block,
wherein a first horizontal distance between a top-left sample of the current template and a top-left sample of the current video block is different from a second horizontal distance between a top-left sample of the reference template and a top-left sample of the reference block, and a first vertical distance between the top-left sample of the current template and the top-left sample of the current video block is the same with a second vertical distance between the top-left sample of the reference template and the top-left sample of the reference block,
wherein the first horizontal distance is a width of the current template, and the first vertical distance is zero,
wherein the second horizontal distance is a width of the current video block, the reference template being right to the reference block, and the second vertical distance is zero, or
wherein a sum of a first distance between the top-left sample of the current template and the top-left sample of the reference template, a width of the current video block and a width of the current template is equal to a second distance between the top-left sample of the current video block and the top-left sample of the reference block.
7 . The method of claim 6 , wherein at least one of a sample in the current template or a sample in the reference template is flipped,
wherein a flip type of the current video block is horizontal flip, and at least one of a sample in the current template or a sample in the reference template is flipped, or
wherein a sum of a first horizontal distance between the current video block and the reference block, a width of the current video block and a width of the current template is equal to a second horizontal distance between the current template and the reference template.
8 . The method of claim 1 , wherein a current template of the current video block comprises a horizontal current template and a vertical current template, the reference template of a reference block of the current video block comprises a horizontal reference template and a vertical reference template, and the sample reordering mode comprises a horizontal flip reordering mode.
9 . The method of claim 8 , wherein a width of the horizontal current template and a width of the horizontal reference template is the same with a width of the current video block,
wherein the current template comprises a neighboring sample above to the current video block and a neighboring sample left to the current video block, and the reference template comprises a neighboring sample above to the reference block and a neighboring sample right to the reference block,
wherein a location difference between the horizontal current template and the current video block is the same with a location difference between the horizontal reference template and the reference block,
wherein a first horizontal distance between a top-left sample of the horizontal current template and a top-left sample of the current video block is the same with a second horizontal distance between a top-left sample of the horizontal reference template and a top-left sample of the reference block, and a first vertical distance between the top-left sample of the horizontal current template and the top-left sample of the current video block is the same with a second vertical distance between the top-left sample of the horizontal reference template and the top-left sample of the reference block,
wherein the first horizontal distance is zero, and the first vertical distance is a height of the horizontal current template,
wherein a distance between the top-left sample of the horizontal current template and the top-left sample of the horizontal reference template is equal to a distance between the top-left sample of the current video block and the top-left sample of the reference block,
wherein a location difference between the vertical current template and the current video block is different from a location difference between the vertical reference template and the reference block,
wherein a third horizontal distance between a top-left sample of the vertical current template and a top-left sample of the current video block is different from a fourth horizontal distance between a top-left sample of the vertical reference template and a top-left sample of the reference block, and a third vertical distance between the top-left sample of the vertical current template and the top-left sample of the current video block is the same with a fourth vertical distance between the top-left sample of the vertical reference template and the top-left sample of the reference block,
wherein the third horizontal distance is a width of the vertical current template, and the third vertical distance is zero,
wherein the fourth horizontal distance is a width of the current video block, the vertical reference template being right to the reference block, and the fourth vertical distance is zero,
wherein at least one of a sample in the horizontal current template or a sample in the horizontal reference template is flipped,
wherein at least one of a sample in the vertical current template or a sample in the vertical reference template is flipped,
wherein a flip type of the current video block is horizontal flip, and a sample in the horizontal current template and a sample in the vertical current template are flipped,
wherein a flip type of the current video block is horizontal flip, and a sample in the horizontal reference template and a sample in the vertical reference template are flipped, or
wherein a horizontal distance between the current video block and the reference block is equal to a horizontal distance between the horizontal current template and the horizontal reference template.
10 . The method of claim 8 , wherein a width of the horizontal current template and a width of the horizontal reference template are the same, a width of the vertical current template and a width of the vertical reference template are the same, and the width of the horizontal current template is equal to a sum of a width of the current video block and a width of the vertical current template,
wherein the current template comprises a neighboring sample above to the current video block and a neighboring sample left to the current video block, and the reference template comprises a neighboring sample above to the reference block and a neighboring sample right to the reference block,
wherein a location difference between the horizontal current template and the current video block is different from a location difference between the horizontal reference template and the reference block,
wherein a first horizontal distance between a top-left sample of the horizontal current template and a top-left sample of the current video block is different from a second horizontal distance between a top-left sample of the horizontal reference template and a top-left sample of the reference block, and a first vertical distance between the top-left sample of the horizontal current template and the top-left sample of the current video block is the same with a second vertical distance between the top-left sample of the horizontal reference template and the top-left sample of the reference block,
wherein the first horizontal distance is a width of the vertical current template, and the first vertical distance is a height of the horizontal current template,
wherein the second horizontal distance is zero, and the second vertical distance is a height of the horizontal current template,
wherein a distance between the top-left sample of the horizontal current template and the top-left sample of the horizontal reference template is equal to a sum of a width of the vertical current template and a distance between the top-left sample of the current video block and the top-left sample of the reference block,
wherein a location difference between the vertical current template and the current video block is different from a location difference between the vertical reference template and the reference block,
wherein a third horizontal distance between a top-left sample of the vertical current template and a top-left sample of the current video block is different from a fourth horizontal distance between a top-left sample of the vertical reference template and a top-left sample of the reference block, and a third vertical distance between the top-left sample of the vertical current template and the top-left sample of the current video block is the same with a fourth vertical distance between the top-left sample of the vertical reference template and the top-left sample of the reference block,
wherein the third horizontal distance is a width of the vertical current template, and the third vertical distance is zero,
wherein the fourth horizontal distance is a width of the current video block, the vertical reference template being right to the reference block, and the fourth vertical distance is zero,
wherein at least one of a sample in the horizontal current template or a sample in the horizontal reference template is flipped,
wherein at least one of a sample in the vertical current template or a sample in the vertical reference template is flipped,
wherein a flip type of the current video block is horizontal flip, and a sample in the horizontal current template and a sample in the vertical current template are flipped,
wherein a flip type of the current video block is horizontal flip, and a sample in the horizontal reference template and a sample in the vertical reference template are flipped, or
wherein a horizontal distance between the horizontal current template and the horizontal reference template is equal to a sum of a width of the vertical current template and a horizontal distance between the current video block and the reference block.
11 . The method of claim 1 , wherein a current template of the current video block and the reference template of a reference block of the current video block are horizontal templates, a width of the horizontal templates being the same with a width of the current video block, and the sample reordering mode comprises a vertical flip reordering mode,
wherein the current template comprises a neighboring sample above to the current video block, and the reference template comprises a neighboring sample below to the reference block,
wherein a location difference between the current template and the current video block is different from a location difference between the reference template and the reference block,
wherein a first horizontal distance between a top-left sample of the current template and a top-left sample of the current video block is the same a second horizontal distance between a top-left sample of the reference template and a top-left sample of the reference block, and a first vertical distance between the top-left sample of the current template and the top-left sample of the current video block is different from a second vertical distance between the top-left sample of the reference template and the top-left sample of the reference block,
wherein the first horizontal distance is zero, and the first vertical distance is a height of the current template,
wherein the second horizontal distance is zero, and the second vertical distance is a height of the current video block, the reference template being below to the reference block,
wherein a sum of a first distance between the top-left sample of the current template and the top-left sample of the reference template, a height of the current video block and a height of the current template is equal to a second distance between the top-left sample of the current video block and the top-left sample of the reference block,
wherein at least one of a sample in the current template or a sample in the reference template is flipped,
wherein a flip type of the current video block is vertical flip, and at least one of a sample in the current template or a sample in the reference template is flipped, or
wherein a sum of a first vertical distance between the current video block and the reference block, a height of the current video block and a height of the current template is equal to a second vertical distance between the current template and the reference template.
12 . The method of claim 1 , wherein a current template of the current video block and the reference template of a reference block of the current video block are vertical templates, a height of the vertical templates being the same with a height of the current video block, and the sample reordering mode comprises a vertical flip reordering mode,
wherein the current template comprises a neighboring sample left to the current video block, and the reference template comprises a neighboring sample left to the reference block,
wherein a location difference between the current template and the current video block is the same with a location difference between the reference template and the reference block,
wherein a first horizontal distance between a top-left sample of the current template and a top-left sample of the current video block is the same with a second horizontal distance between a top-left sample of the reference template and a top-left sample of the reference block, and a first vertical distance between the top-left sample of the current template and the top-left sample of the current video block is the same with a second vertical distance between the top-left sample of the reference template and the top-left sample of the reference block,
wherein the first and second horizontal distances are a width of the current template or the reference template, and the first and second vertical distances are zero,
wherein a distance between the top-left sample of the current template and the top-left sample of the reference template is the same with a distance between the top-left sample of the current video block and the top-left sample of the reference block,
wherein at least one of a sample in the current template or a sample in the reference template is flipped,
wherein a flip type of the current video block is vertical flip, and at least one of a sample in the current template or a sample in the reference template is flipped, or
wherein a vertical distance between the current video block and the reference block is the same with a vertical distance between the current template and the reference template.
13 . The method of claim 1 , wherein a current template of the current video block comprises a horizontal current template and a vertical current template, the reference template of a reference block of the current video block comprises a horizontal reference template and a vertical reference template, and the sample reordering mode comprises a vertical flip reordering mode.
14 . The method of claim 13 , wherein a width of the horizontal current template and a width of the horizontal reference template is the same with a width of the current video block,
wherein the current template comprises a neighboring sample above to the current video block and a neighboring sample left to the current video block, and the reference template comprises a neighboring sample below to the reference block and a neighboring sample left to the reference block,
wherein a location difference between the horizontal current template and the current video block is different from a location difference between the horizontal reference template and the reference block,
wherein a first horizontal distance between a top-left sample of the horizontal current template and a top-left sample of the current video block is the same with a second horizontal distance between a top-left sample of the horizontal reference template and a top-left sample of the reference block, and a first vertical distance between the top-left sample of the horizontal current template and the top-left sample of the current video block is different from a second vertical distance between the top-left sample of the horizontal reference template and the top-left sample of the reference block,
wherein the first horizontal distance is zero, and the first vertical distance is a height of the horizontal current template,
wherein the second horizontal distance is zero, and the second vertical distance is a height of the current video block, the horizontal reference template being below to the reference block,
wherein a distance between the top-left sample of the horizontal current template and the top-left sample of the horizontal reference template is equal to a sum of a height of the current video block, a height of the horizontal current template and a distance between the top-left sample of the current video block and the top-left sample of the reference block,
wherein a location difference between the vertical current template and the current video block is the same with a location difference between the vertical reference template and the reference block,
wherein a third horizontal distance between a top-left sample of the vertical current template and a top-left sample of the current video block is the same with a fourth horizontal distance between a top-left sample of the vertical reference template and a top-left sample of the reference block, and a third vertical distance between the top-left sample of the vertical current template and the top-left sample of the current video block is the same with a fourth vertical distance between the top-left sample of the vertical reference template and the top-left sample of the reference block,
wherein the third horizontal distance is a width of the vertical current template, and the third vertical distance is zero,
wherein at least one of a sample in the horizontal current template or a sample in the horizontal reference template is flipped,
wherein at least one of a sample in the vertical current template or a sample in the vertical reference template is flipped,
wherein a flip type of the current video block is vertical flip, and a sample in the horizontal current template and a sample in the vertical current template are flipped,
wherein a flip type of the current video block is vertical flip, and a sample in the horizontal reference template and a sample in the vertical reference template are flipped, or
wherein a vertical distance between the horizontal current template and the horizontal reference template is equal to a sum of a height of the current video block, a height of the horizontal current template and a vertical distance between the current video block and the reference block.
15 . The method of claim 13 , wherein a width of the horizontal current template and a width of the horizontal reference template are the same, a width of the vertical current template and a width of the vertical reference template are the same, and the width of the horizontal current template is equal to a sum of a width of the current video block and a width of the vertical current template,
wherein the current template comprises a neighboring sample above to the current video block and a neighboring sample left to the current video block, and the reference template comprises a neighboring sample below to the reference block and a neighboring sample left to the reference block,
wherein a location difference between the horizontal current template and the current video block is different from a location difference between the horizontal reference template and the reference block,
wherein a first horizontal distance between a top-left sample of the horizontal current template and a top-left sample of the current video block is the same with a second horizontal distance between a top-left sample of the horizontal reference template and a top-left sample of the reference block, and a first vertical distance between the top-left sample of the horizontal current template and the top-left sample of the current video block is different from a second vertical distance between the top-left sample of the horizontal reference template and the top-left sample of the reference block,
wherein the first horizontal distance is a width of the vertical current template, and the first vertical distance is a height of the horizontal current template,
wherein the second horizontal distance is a width of the vertical current template, and the second vertical distance is a height of the current video block, the horizontal reference template being below the reference block,
wherein a distance between the top-left sample of the horizontal current template and the top-left sample of the horizontal reference template is equal to a sum of a height of the current video block, a height of the horizontal current template and a distance between the top-left sample of the current video block and the top-left sample of the reference block,
wherein a location difference between the vertical current template and the current video block is the same with a location difference between the vertical reference template and the reference block,
wherein a third horizontal distance between a top-left sample of the vertical current template and a top-left sample of the current video block is the same with a fourth horizontal distance between a top-left sample of the vertical reference template and a top-left sample of the reference block, and a third vertical distance between the top-left sample of the vertical current template and the top-left sample of the current video block is the same with a fourth vertical distance between the top-left sample of the vertical reference template and the top-left sample of the reference block,
wherein the third horizontal distance is a width of the vertical current template, and the third vertical distance is zero,
wherein at least one of a sample in the horizontal current template or a sample in the horizontal reference template is flipped,
wherein at least one of a sample in the vertical current template or a sample in the vertical reference template is flipped,
wherein a flip type of the current video block is vertical flip, and a sample in the horizontal current template and a sample in the vertical current template are flipped,
wherein a flip type of the current video block is vertical flip, and a sample in the horizontal reference template and a sample in the vertical reference template are flipped, or
wherein a vertical distance between the horizontal current template and the horizontal reference template is equal to a sum of a height of the current video block, a height of the horizontal current template and a vertical distance between the current video block and the reference block.
16 . The method of claim 1 , wherein the conversion includes encoding the current video block into the bitstream.
17 . The method of claim 1 , wherein the conversion includes decoding the current video block from the bitstream.
18 . An apparatus for processing video data comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to:
determine, for a conversion between a current video block of a video and a bitstream of the video, a reference template of the current video block based on coding information of the current video block, the current video block being coded with a sample reordering mode; and
perform the conversion based on the reference template.
19 . A non-transitory computer-readable storage medium storing instructions that cause a processor to:
determine, for a conversion between a current video block of a video and a bitstream of the video, a reference template of the current video block based on coding information of the current video block, the current video block being coded with a sample reordering mode; and
perform the conversion based on the reference template.
20 . A non-transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by a video processing apparatus, wherein the method comprises:
determining a reference template of a current video block of the video based on coding information of the current video block, the current video block being coded with a sample reordering mode; and
generating the bitstream based on the reference template.