Order-based updating for intra block copy in video coding
A method of visual media processing includes determining, for a conversion between a current video block of visual media data and a bitstream representation of the current video block, a buffer that stores reference samples for prediction in an intra block copy mode; for a sample spatially located at location of the current video block relative to an upper-left position of a coding tree unit including the current video block and having a block vector, computing a corresponding reference in the buffer at a reference location, wherein the reference location is determined using the block vector and the location; and upon determining that the reference location lies outside the buffer, re-computing the reference location based at least in part on a location of the current video block relative to the coding tree unit including the current video block.
1. A method of processing visual data, comprising:
determining, for a conversion between a current video block and a bitstream of the current video block, a buffer that is used to store reconstructed samples for prediction in an intra block copy mode, wherein the conversion is performed in the intra block copy mode which is based on motion information related to a reconstructed block located in same video region with the current video block; and
updating the reconstructed samples stored in the buffer in accordance with an order,
wherein the reconstructed samples stored in the buffer are assigned priority values, and wherein the reconstructed samples stored in the buffer are replaced according to the priority values,
wherein a flag included in the bitstream indicates the priority values that satisfy one or more conditions, and wherein the one of more conditions relate to a percentage of the reconstructed samples coded using a palette mode and/or an intra block coding (IBC) mode and/or a transform-skip mode.
2. The method of claim 1 , wherein the buffer is updated in accordance with a sequential order.
3. The method of claim 1 , wherein the buffer is updated in accordance with an order of reconstructed blocks.
4. The method of claim 1 , further comprising:
upon determining that the buffer is full, replacing the reconstructed samples stored in the buffer with recently reconstructed samples.
5. The method of claim 4 , wherein determining that a number of available samples in the buffer is equal or larger than a threshold is indicative of the buffer being full, and wherein the threshold is 64×64×3 luma samples.
6. The method of claim 1 , wherein the reconstructed samples stored in the buffer are replaced in a first-in-first-out order.
7. The method of claim 1 , wherein an oldest set of the reconstructed samples stored in the buffer are replaced.
8. The method of claim 1 , wherein a subset of the reconstructed samples stored in the buffer are marked for replacement in future, and wherein samples not included in the subset are replaced initially.
9. The method of claim 1 , wherein the priority values are assigned based on a characteristic of the current video block.
10. The method of claim 1 , wherein the conversion includes encoding the current video block into the bitstream.
11. The method of claim 1 , wherein the conversion includes decoding the current video block from the bitstream.
12. The method of claim 1 , wherein, in response to determining that the percentage of the reconstructed samples coded using the palette mode and/or the intra block coding (IBC) mode and/or the transform-skip mode exceed a threshold, assigning all samples in the current video block as high priority.
13. The method of claim 12 , wherein the threshold is based on a size of the current video block and/or a color component of the current video block and/or a size of a coding tree unit (CTU) including the current video block.
14. The method of claim 13 , wherein the threshold is included as a field in the bitstream.
15. The method of claim 14 , wherein the field is included in a sequence parameter set (SPS), a picture parameter set (PPS), a sequence header, a slice header, a tile group, a tile level, or a video region.
16. 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 and a bitstream of the current video block, a buffer that is used to store reconstructed samples for prediction in an intra block copy mode, wherein the conversion is performed in the intra block copy mode which is based on motion information related to a reconstructed block located in same video region with the current video block; and
update the reconstructed samples stored in the buffer in accordance with an order,
wherein the reconstructed samples stored in the buffer are assigned priority values, and
wherein the reconstructed samples stored in the buffer are replaced according to the priority values, wherein a flag included in the bitstream indicates the priority values that satisfy one or more conditions, and wherein the one of more conditions relate to a percentage of the reconstructed samples coded using a palette mode and/or an intra block coding (IBC) mode and/or a transform-skip mode.
17. The apparatus of claim 16 , wherein the buffer is updated in accordance with a sequential order or the buffer is updated in accordance with an order of reconstructed blocks.
18. The apparatus of claim 16 , wherein the instructions upon execution by the processor further cause the processor to:
upon determining that the buffer is full, replace the reconstructed samples stored in the buffer with recently reconstructed samples.
19. 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, for a generation of the bitstream from a current video block, a buffer that is used to store reconstructed samples for prediction in an intra block copy mode, wherein the generation is performed in the intra block copy mode which is based on motion information related to a reconstructed block located in same video region with the current video block;
updating the reconstructed samples stored in the buffer in accordance with an order; and
generating the bitstream based on the determining,
wherein the reconstructed samples stored in the buffer are assigned priority values, and wherein the reconstructed samples stored in the buffer are replaced according to the priority values,
wherein a flag included in the bitstream indicates the priority values that satisfy one or more conditions, and wherein the one of more conditions relate to a percentage of the reconstructed samples coded using a palette mode and/or an intra block coding (IBC) mode and/or a transform-skip mode.
20. The non-transitory computer-readable recording medium of claim 19 , wherein the buffer is updated in accordance with a sequential order or the buffer is updated in accordance with an order of reconstructed blocks.