Video Compression Using Boundary Based Template Refinement
Encoding and/or decoding a block of a video frame may be based on a template associated with the block. The length of the template may be determined based on at least one of: a position of the block relative to a boundary, available reference samples above the boundary, and/or the length of a second template of one or more other template derivation algorithms. The length may be adjusted to improve prediction efficiencies and accuracies of template-based predictions.
1 . A method comprising:
determining, by a computing device and based on a quantity of lines of reconstructed samples above a current block of content, a template comprising at least one of the lines of reconstructed samples;
determining, based on a reference line of reconstructed samples above the template, a plurality of predictions of the template comprising a prediction of the template for each intra prediction mode of a plurality of intra prediction modes;
selecting, based on the plurality of predictions, an intra prediction mode of the plurality of intra prediction modes; and
coding, based on the selected intra prediction mode, the current block.
2 . The method of claim 1 , wherein the quantity of lines of reconstructed samples above the current block is based on a position of the current block relative to a boundary between a first coding tree unit (CTU) that includes the current block and a second CTU above the first CTU.
3 . The method of claim 1 , wherein the determining the plurality of predictions of the template is associated with a first intra mode derivation procedure, and wherein a quantity of lines of reconstructed reference samples of the template is based on a quantity of lines of reconstructed reference samples of a template associated with a second intra mode derivation procedure.
4 . The method of claim 1 , wherein the lines of reconstructed samples above the current block comprise a line of reconstructed reference samples above a top boundary of a coding tree unit (CTU) that includes the current block.
5 . The method of claim 1 , wherein the quantity of lines of reconstructed samples above the current block is based on a quantity of hardware line buffers storing lines of reconstructed samples of a first coding tree unit (CTU) above and adjacent to a second CTU that includes the current block.
6 . The method of claim 1 , further comprising sending an indication of the selected intra prediction mode.
7 . The method of claim 1 , further comprising receiving an indication of the selected intra prediction mode.
8 . A computing device comprising:
one or more processors; and
memory storing instructions that, when executed by the one or more processors, cause the computing device to:
determine, based on a quantity of lines of reconstructed samples above a current block of content, a template comprising at least one of the lines of reconstructed samples;
determine, based on a reference line of reconstructed samples above the template, a plurality of predictions of the template comprising a prediction of the template for each intra prediction mode of a plurality of intra prediction modes;
select, based on the plurality of predictions, an intra prediction mode of the plurality of intra prediction modes; and
code, based on the selected intra prediction mode, the current block.
9 . The computing device of claim 8 , wherein the quantity of lines of reconstructed samples above the current block is based on a position of the current block relative to a boundary between a first coding tree unit (CTU) that includes the current block and a second CTU above the first CTU.
10 . The computing device of claim 8 , wherein determination of the plurality of predictions of the template is associated with a first intra mode derivation procedure, and wherein a quantity of lines of reconstructed reference samples of the template is based on a quantity of lines of reconstructed reference samples of a template associated with a second intra mode derivation procedure.
11 . The computing device of claim 8 , wherein the lines of reconstructed samples above the current block comprise a line of reconstructed reference samples above a top boundary of a coding tree unit (CTU) that includes the current block.
12 . The computing device of claim 8 , wherein the quantity of lines of reconstructed samples above the current block is based on a quantity of hardware line buffers storing lines of reconstructed samples of a first coding tree unit (CTU) above and adjacent to a second CTU that includes the current block.
13 . The computing device of claim 8 , wherein the instructions, when executed by the one or more processors, further cause the computing device to send an indication of the selected intra prediction mode.
14 . The computing device of claim 8 , wherein the instructions, when executed by the one or more processors, further cause the computing device to receive an indication of the selected intra prediction mode.
15 . A method comprising:
determining, by a computing device and based on a position of a current block of content relative to a boundary between two coding units (CTUs), a template comprising one or more lines of reconstructed samples above the current block;
determining, based on a reference line of reconstructed samples above the template, a plurality of predictions of the template comprising a prediction of the template for each intra prediction mode of a plurality of intra prediction modes;
selecting, based on the plurality of predictions, an intra prediction mode of the plurality of intra prediction modes;
generating, based on the selected intra prediction mode, a prediction of the current block; and
coding the current block based on the prediction of the current block.
16 . The method of claim 15 , wherein a first CTU of the two CTUs comprises the current block, and wherein the boundary between the two CTUs is a top boundary of the first CTU a bottom boundary of a second CTU of the two CTUs.
17 . The method of claim 15 , wherein the current block is adjacent to the boundary between the two CTUs.
18 . The method of claim 15 , wherein the template comprises a quantity of lines of reconstructed samples that is one less than a quantity of lines of reconstructed samples above the current block and available for coding the current block.
19 . The method of claim 15 , wherein, based on the current block being adjacent to the boundary between the two CTUs, the template comprises two lines of reconstructed reference samples above the current block.
20 . The method of claim 15 , further comprising sending an indication of the selected intra prediction mode.
21 . The method of claim 15 , further comprising receiving an indication of the selected intra prediction mode.
22 . A computing device comprising:
one or more processors; and
memory storing instructions that, when executed by the one or more processors, cause the computing device to:
determine, based on a position of a current block of content relative to a boundary between two coding units (CTUs), a template comprising one or more lines of reconstructed samples above the current block;
determine, based on a reference line of reconstructed samples above the template, a plurality of predictions of the template comprising a prediction of the template for each intra prediction mode of a plurality of intra prediction modes;
select, based on the plurality of predictions, an intra prediction mode of the plurality of intra prediction modes;
generate, based on the selected intra prediction mode, a prediction of the current block; and
code the current block based on the prediction of the current block.
23 . The computing device of claim 22 , wherein a first CTU of the two CTUs comprises the current block, and wherein the boundary between the two CTUs is a top boundary of the first CTU a bottom boundary of a second CTU of the two CTUs.
24 . The computing device of claim 22 , wherein the current block is adjacent to the boundary between the two CTUs.
25 . The computing device of claim 22 , wherein the template comprises a quantity of lines of reconstructed samples that is one less than a quantity of lines of reconstructed samples above the current block and available for coding the current block.
26 . The computing device of claim 22 , wherein, based on the current block being adjacent to the boundary between the two CTUs, the template comprises two lines of reconstructed reference samples above the current block.
27 . The computing device of claim 22 , wherein the instructions, when executed by the one or more processors, further canse the computing device to send an indication of the selected intra prediction mode.
28 . The computing device of claim 22 , wherein the instructions, when executed by the one or more processors, further cause the computing device to receive an indication of the selected intra prediction mode.