Encoding and decoding method, apparatus, and device
The present invention provides an encoding and decoding method, apparatus and device. The method comprises: when a reference pixel of a current block is not available, removing a target prediction mode from an initial prediction mode list corresponding to the current block, so as to obtain a target prediction mode list; and encoding and decoding the current block on the basis of the target prediction mode list. The present invention can improve the encoding performance and the decoding performance.
1 . A decoding method, performed by a decoding device, wherein when an intra block copy prediction mode is enabled for a current block, the method comprises:
when reference pixels outside a left boundary of the current block are not available, and reference pixels outside an upper boundary of the current block are available, determining a first search region corresponding to a first sub block of the current block based on reconstructed pixels outside the upper boundary, and determining reconstructed pixels of the first sub block based on reference pixels of the first search region; and
after obtaining the reconstructed pixels of the first sub block, determining a second search region corresponding to a second sub block of the current block based on reconstructed pixels outside the upper boundary, and determining reconstructed pixels of the second sub block based on reference pixels of the second search region;
wherein the current block comprises the first sub block and the second sub block.
2 . The method according to claim 1 , wherein
determining the first search region corresponding to the first sub block of the current block based on the reconstructed pixels outside the upper boundary comprises: determining the reconstructed pixels outside the upper boundary as the first search region corresponding to the first sub block; and
determining the second search region corresponding to the second sub block of the current block based on the reconstructed pixels outside the upper boundary comprises: determining the reconstructed pixels outside the upper boundary as the second search region corresponding to the second sub block.
3 . The method according to claim 1 , wherein the first sub block comprises at least one first prediction block; wherein
when the reference pixels outside the left boundary of the current block are not available, and the reference pixels outside the upper boundary of the current block are available, determining the first search region corresponding to the first sub block of the current block based on the reconstructed pixels outside the upper boundary, and determining the reconstructed pixels of the first sub block based on the reference pixels of the first search region comprises:
when the reference pixels outside the left boundary of the current block are not available and the reference pixels outside the upper boundary of the current block are available, determining the first search region corresponding to the first sub block of the current block based on the reconstructed pixels outside the upper boundary, and determining reconstructed pixels of each of the at least one first prediction block in the first sub block based on reference pixels of the first search region.
4 . The method according to claim 3 , wherein the second sub block comprises at least one second prediction block; wherein
after obtaining the reconstructed pixels of the first sub block, determining the second search region corresponding to the second sub block of the current block based on the reconstructed pixels outside the upper boundary, and determining the reconstructed pixels of the second sub block based on the reference pixels of the second search region comprises:
after obtaining the reconstructed pixels of the first sub block, determining the second search region corresponding to the second sub block of the current block based on the reconstructed pixels outside the upper boundary and/or the reconstructed pixels of the first sub block, and determining reconstructed pixels of each of the at least one second prediction block of the second sub block based on reference pixels of the second search region.
5 . The method according to claim 3 , wherein determining the reconstructed pixels of each of the at least one first prediction block in the first sub block based on the reference pixels of the first search region comprises:
for each of the at least one first prediction block, finding a reference block that matches the first prediction block from the first search region, wherein a size of the reference block is same as a size of the first prediction block; and determining the reconstructed pixels of the first prediction block based on the reference block.
6 . The method according to claim 3 , wherein when a size of the current block is 16*2 and a size of the first sub block is 8*2, a size of one of the at least one first prediction block is 4*1.
7 . The method according to claim 4 , wherein determining the reconstructed pixels of each of the at least one second prediction block in the second sub block based on the reference pixels of the second search region comprises:
for each of the at least one second prediction block, finding a reference block that matches the second prediction block from the second search region, wherein a size of the reference block is same as a size of the second prediction block; and determining the reconstructed pixels of the second prediction block based on the reference block.
8 . The method according to claim 4 , wherein a size of the at least one second prediction block is same as a size of the at least one first prediction block; wherein when a size of the current block is 16*2 and sizes of the first sub block and the second sub block are 8*2,
a size of each of the at least one first prediction block is 4*1, and a size of each of the at least one second prediction block is 4*1.
9 . An encoding method, performed by an encoding device, wherein when an intra block copy prediction mode is enabled for a current block, the method comprises:
when reference pixels outside a left boundary of the current block are not available, and reference pixels outside an upper boundary of the current block are available, determining a first search region corresponding to a first sub block of the current block based on reconstructed pixels outside the upper boundary, and determining reconstructed pixels of the first sub block based on reference pixels of the first search region; and
after obtaining the reconstructed pixels of the first sub block, determining a second search region corresponding to a second sub block of the current block based on reconstructed pixels outside the upper boundary, and determining reconstructed pixels of the second sub block based on reference pixels of the second search region;
wherein the current block comprises the first sub block and the second sub block.
10 . A decoding device, comprising:
one or more memories configured to store video data; and
a decoder configured to implement the method according to claim 1 .
11 . A decoding device, comprising: one or more processors and one or more machine-readable storage media, wherein the one or more machine-readable storage media store machine executable instructions that can be executed by the one or more processors; and
the one or more processors are configured to execute the machine executable instructions to implement the method according to claim 1 .
12 . An encoding device comprising: one or more processors and one or more machine-readable storage media, wherein the one or more machine-readable storage media store machine executable instructions that can be executed by the one or more processors, and the one or more processors execute the machine executable instructions to implement the method claim 9 .
13 . A non-transitory machine-readable storage medium storing instructions that are executable by one or more processors, wherein when the one or more processors execute the instructions, the method according to claim 1 is implemented.