Encoding method, decoding method, encoder, decoder, and storage medium

By constructing a candidate block vector list using temporal block vectors, the inefficiencies in IntraTMP and IBC modes are addressed, resulting in enhanced encoding and decoding efficiency.

AU2024439818A1Pending Publication Date: 2026-11-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
AU2024439818
Authority / Receiving Office
AU · AU
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-04-10
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Existing video coding technologies face inefficiencies due to incomplete candidate block vector lists and deviations in candidate block vectors, leading to poor prediction performance in Intra Template Matching Prediction (IntraTMP) and Intra Block Copy (IBC) modes.

Method used

Construct a candidate block vector list based on temporal block vectors, incorporating them into a motion information buffer to enhance the number of candidate vectors, thereby improving prediction performance in IntraTMP and IBC modes.

Benefits of technology

Enhances encoding and decoding efficiency by increasing the number of candidate block vectors, leading to improved prediction effects in IntraTMP and IBC modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000058_0000
    Figure 00000058_0000
  • Figure 00000059_0000
    Figure 00000059_0000
  • Figure 00000059_0001
    Figure 00000059_0001
Patent Text Reader

Abstract

Disclosed in the present application are an encoding method, a decoding method, an encoder, a decoder and a storage medium. A method comprises, for no matter a coding end or a decoding end: on the basis of first position indication information, determining in a current image one or more reference positions available for a current block to be decoded; on the basis of the one or more reference positions, determining one or more time domain block vectors in one or more co-located images of the current block; on the basis of the one or more time domain block vectors, determining a candidate block vector list of the current block; and on the basis of the candidate block vector list, determining a predicted block of the current block. Therefore, time domain block vectors in operating information caches of co-located images are added as newly added candidate block vectors to a candidate block vector list, so that the number of candidate block vectors is increased, thus improving prediction effects of prediction modes, such as an intra block copy mode or intra template matching prediction mode, thereby improving encoding and decoding efficiencies.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The disclosure relates to the technical field of video coding, and in particular to, an encoding method, a decoding method, an encoder, a decoder, and a storage medium. BACKGROUND

[0002] The Intra Template Matching Prediction (Intra TMP) technology searches, by using a template of a coding block, for a matching template with a minimum cost within a predefined search range in a current picture according to a preset cost function, and uses a reconstructed block corresponding to the matching template as a matching block to serve as a prediction block of the current coding block.

[0003] In addition to directly searching for the matching block, the IntraTMP may also construct a candidate block vector list according to encoded information, and determine the matching block by testing candidate block vectors in the candidate block vector list. However, in an actual encoding / decoding process, due to incomplete considerations, under certain scenarios, a candidate block vector list obtained by related technologies cannot be filled up, or there is a large deviation in obtained candidate block vectors, resulting in poor prediction performance and affecting encoding and decoding efficiency. SUMMARY

[0004] The disclosure provides an encoding method, a decoding method, an encoder, a decoder, and a storage medium. A candidate block vector list constructed based on temporal block vectors is used to improve prediction performance of related prediction modes, thereby enhancing encoding and decoding efficiency.

[0005] The technical solutions of the disclosure are implemented as follows.

[0006] In a first aspect, an embodiment of the disclosure provides a decoding method, applied to a decoder, and the method includes operations as follows.

[0007] One or more reference positions available for a current block to be decoded in a current picture are determined according to first position indication information.

[0008] One or more temporal block vectors are determined in one or more collocated pictures of the current block according to the one or more reference positions.

[0009] A candidate block vector list for the current block is determined according to the one or more temporal block vectors.

[0010] A prediction block of the current block is determined according to the candidate block vector list.

[0011] In a second aspect, an embodiment of the disclosure provides an encoding method, applied to an encoder, and the method includes operations as follows.

[0012] One or more reference positions available for a current block to be encoded in a current picture are determined according to first position indication information.

[0013] One or more temporal block vectors are determined in one or more collocated pictures of the current block according to the one or more reference positions.

[0014] A candidate block vector list for the current block is determined according to the one or more temporal block vectors.

[0015] A prediction block of the current block is determined according to the candidate block vector list.

[0016] In a third aspect, an embodiment of the disclosure provides an encoder including a first prediction unit and a first determination unit.

[0017] The first determination unit is configured to determine, according to first position indication information, one or more reference positions available for a current block to be encoded in a current picture.

[0018] The first determination unit is further configured to determine one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions, and determine a candidate block vector list for the current block according to the one or more temporal block vectors.

[0019] The first prediction unit is configured to determine a prediction block of the current block according to the candidate block vector list.

[0020] In a fourth aspect, an embodiment of the disclosure provides an encoder including a first memory and a first processor.

[0021] The first memory is configured to store a computer program executable on the first processor.

[0022] The first processor is configured to, when running the computer program, perform the method according to the second aspect.

[0023] In a fifth aspect, an embodiment of the disclosure provides a decoder including a second determination unit and a second prediction unit.

[0024] The second determination unit is configured to determine, according to first position indication information, one or more reference positions available for a current block to be decoded in a current picture.

[0025] The second determination unit is further configured to determine one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions, and determine a candidate block vector list for the current block according to the one or more temporal block vectors.

[0026] the second prediction unit is configured to determine a prediction block of the current block according to the candidate block vector list.

[0027] In a sixth aspect, an embodiment of the disclosure provides a decoder including a second memory and a second processor.

[0028] The second memory is configured to store a computer program executable on the second processor.

[0029] The second processor is configured to, when running the computer program, perform the method according to the first aspect.

[0030] In a seventh aspect, an embodiment of the disclosure provides a computer storage medium having stored thereon a computer program that, when executed, performs the method of the first aspect or the second aspect.

[0031] In an eighth aspect, an embodiment of the disclosure provides a computer-readable storage medium having stored thereon a bitstream generated by the encoding method.

[0032] Embodiments of the disclosure provide an encoding and decoding method, an encoder, a decoder, and a storage medium. Regardless of whether at an encoding side or a decoding side, one or more reference positions available for a current block to be decoded in a current picture are determined according to first position indication information; one or more temporal block vectors are determined in one or more collocated pictures of the current block according to the one or more reference positions; a candidate block vector list for the current block is determined according to the one or more temporal block vectors; and a prediction block of the current block is determined according to the candidate block vector list. In this way, a temporal block vector in a motion information buffer of a collocated picture is added to a candidate block vector list as a newly added candidate block vector, so as to increase a number of candidate block vectors, thereby improving a prediction effect of prediction modes such as IBC mode or IntraTMP mode, and thus improving encoding and decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] FIG. 1 is a schematic diagram showing a prediction process of an Intra TMP technology.

[0034] FIG. 2 is a schematic diagram showing a matching block of an Intra TMP technology.

[0035] FIG. 3 is a schematic diagram showing types of templates of an Intra TMP technology.

[0036] FIG. 4 is a schematic diagram showing a matching block pointed by a plurality of block vectors in a search region.

[0037] FIG. 5 is a schematic structural block diagram of an encoder according to an embodiment of the disclosure.

[0038] FIG. 6 is a schematic structural block diagram of a decoder according to an embodiment of the disclosure.

[0039] FIG. 7 is a schematic architecture diagram of a coding system according to an embodiment of the disclosure.

[0040] FIG. 8 is a schematic flowchart of a decoding method according to an embodiment of the disclosure.

[0041] FIG. 9 is a first schematic diagram of a set of reference positions defined by first position indication information according to an embodiment of the disclosure.

[0042] FIG. 10 is a second schematic diagram of a set of reference positions defined by first position indication information according to an embodiment of the disclosure.

[0043] FIG. 11 is a first schematic diagram of a set of reference positions defined by second position indication information according to an embodiment of the disclosure.

[0044] FIG. 12 is a second schematic diagram of a set of reference positions defined by second position indication information according to an embodiment of the disclosure.

[0045] FIG. 13 is a first schematic diagram of converting a motion vector (MV) pointing to a reference picture according to an embodiment of the disclosure.

[0046] FIG. 14 is a second schematic diagram of converting an MV pointing to a reference picture according to an embodiment of the disclosure.

[0047] FIG. 15 is a first schematic diagram of converting an MV pointing to a collocated picture according to an embodiment of the disclosure.

[0048] FIG. 16 is a second schematic diagram of converting an MV pointing to a collocated picture according to an embodiment of the disclosure.

[0049] FIG. 17 is a schematic flowchart of an encoding method according to an embodiment of the disclosure.

[0050] FIG. 18 is a schematic structural diagram of an encoder according to an embodiment of the disclosure.

[0051] FIG. 19 is a schematic hardware structural diagram of an encoder according to an embodiment of the disclosure.

[0052] FIG. 20 is a schematic structural diagram of a decoder according to an embodiment of the disclosure.

[0053] FIG. 21 is a schematic hardware structural diagram of a decoder according to an embodiment of the disclosure.

[0054] FIG. 22 is a schematic structural diagram of a coding system according to an embodiment of the disclosure. DETAILED DESCRIPTION

[0055] To gain a more comprehensive understanding of the characteristics and technical content of the embodiments of the disclosure, the implementation of the embodiments of the disclosure will be described in detail below with reference to the accompanying drawings, which are for reference and description only and are not intended to limit the embodiments of the disclosure.

[0056] Unless otherwise defined, meanings of all technical and scientific terms used in the embodiments of the disclosure are the same as those usually understood by a person skilled in the technical field to which the embodiments of the disclosure belong. Terms used in the embodiments of the disclosure are merely intended to describe objectives of the embodiments of the disclosure, and are not intended to limit the disclosure.

[0057] In the following description, the term "some embodiments" describes subsets of all possible embodiments, but it may be understood that "some embodiments" may be the same subset or different subsets of all the possible embodiments, and can be combined with each other without conflict. It is to be noted that the terms "first", "second", and "third” involved in the embodiments of the disclosure are merely intended to distinguish between similar objects rather than describe a specific order of objects. It can be understood that the "first", "second", and "third" are interchangeable in order in proper circumstances, so that embodiments of the disclosure described herein can be implemented in an order other than the order illustrated or described herein.

[0058] Before embodiments of the disclosure are further described in detail, terms in embodiments of the disclosure are described, and the following explanations are applicable to the terms in embodiments of the disclosure:

[0059] Coding Block (CB);

[0060] Block Matching (BM);

[0061] Coding Unit (CU);

[0062] Block Vector (BV);

[0063] BV at an adjacent position of the current block (Spatial BV);

[0064] BV at a current non-adjacent position (Non-adjacent BV);

[0065] History Block Vector Prediction (HBVP);

[0066] Auto-relocated Block Vector Prediction (ARBVP);

[0067] Sum of Absolute Differences (SAD);

[0068] Sum of Absolute Transformed Difference (SATD);

[0069] Mean Squared Error (MSE);

[0070] Sum of Squared Differences (SSD);

[0071] Mean Absolute Deviation (MAD);

[0072] Mean Squared Differences (MSD);

[0073] Normalized Correlation Coefficient (NCC);

[0074] Rate Distortion Optimization (RDO);

[0075] H.266 / Versatile Video Coding (VVC);

[0076] VVC Test Model (VTM);

[0077] Merge mode (Merge);

[0078] Intra Block Copy (IBC);

[0079] Intra Template Matching Prediction (Intra TMP);

[0080] Collocated picture;

[0081] Temporal Block Vector Prediction (TBVP);

[0082] Picture Order Count (POC); and

[0083] Beyond VVC's Enhanced Compression Model (ECM).

[0084] It is to be appreciated that in a video picture, a first colour component, a second colour component, and a third colour component are generally employed to characterize the coding block. The three colour components are one luma component, one blue chroma component, and one red chroma component, respectively, specifically, the luma component is usually denoted by a symbol Y, the blue chroma component is usually denoted by a symbol Cb or U, and the red chroma component is usually denoted by a symbol Cr or V. In this way, the video picture may be represented in the YCbCr format or in the YUV format.

[0085] 1) IntraTMP technology

[0086] The Intra TMP technology is a special Intra prediction technology. It is a special Intra prediction and coding tool, which is mainly used in screen content coding. The IntraTMP is mainly implemented by the following process: selecting part of the reconstructed samples adjacent to the current coding block as templates, searching for a most similar template in a given reconstructed region of a current picture, and using a reconstructed block corresponding to the most similar template as a matching block, which is used as a prediction block of the current coding block. The matching block may be represented by a BV that points from the current coding block to the matching block, which is specifically defined as a difference between top-left corner coordinates of the current block and top-left corner coordinates of the matching block. Herein, an adjacent reconstructed region of a current coding block is usually selected as the template of the coding block.

[0087] For example, taking an adjacent reconstructed region of the current block as an example, as shown in FIG. 1, the grid-filled region represents the reconstructed region. In the reconstructed region, R1, R2, R3 and R4 are search regions, and the matching block is searched sequentially from R1 to R4. The adjacent region of the current block is a first template (T); and an adjacent region of the matching block (which can also be called "reference block") is a second template (i.e., "reference template" or "matching template", T_BEST). As shown in FIG. 2, both the encoder and the decoder perform a search within a predefined search range in the current picture using the template (T) of the coding block, to determine a matching template (T_BEST) with the minimum template error value. Then, the reconstructed block (Ref Block) corresponding to the matching template is used as a prediction block of the current coding block (Cur Block). The similarity between templates is represented by the magnitude of the template error value, and the smaller the template error value, the higher the similarity. In the embodiments of the disclosure, the template error value may be SAD, SATD, MSE, SSD, MAD, MSD, NCC, etc., which is not specifically limited herein.

[0088] For example, taking the SAD as example, the template error value in this case is expressed by: SAD(T) = Y,m=o\Ti>m - Tm\,m = 0,1.....M - 1  (1)

[0089] Herein, T is a template in the search process, and M represents a number of samples in the template.

[0090] It is to be noted that the Intra TMP technology utilizes the adjacent reconstructed samples of the current block as a template to search for the matching template within the predefined search region. The adjacent reconstructed samples can be top reference samples, top-left reference samples, top-right reference samples, left reference samples, bottom-left reference samples, etc. of the current block. Therefore, the template types can be classified and the corresponding template type can be determined according to the availability of the adjacent reconstructed samples.

[0091] It is also to be noted that the template type can be represented by refTemplateType, and FIG. 3 shows a schematic diagram of a template type of the Intra TMP technology. As shown in FIG. 3, the grid-filled block is the current block, and the adjacent region of the current block is the template T, and six template types are shown here.

[0092] Exemplarily, these six template types are as follows.

[0093] When the top-left reference samples, top reference samples and left reference samples are all available, the value of refTemplateType is 1, and the shape of the template is shown in part (a) of FIG. 3.

[0094] When only the left reference samples are available, the value of refTemplateType is 2, and the value of the template is shown in part (b) of FIG. 3.

[0095] When only the top reference samples are available, the value of refTemplateType is 3, and the shape of the template is shown in part (c) of FIG. 3.

[0096] When only the left reference samples and the top-left reference samples are available, the value of refTemplateType is 4, and the shape of the template is shown in part (d) of FIG. 3.

[0097] When only the left reference samples and the bottom-left reference samples are available, the value of refTemplateType is 5, and the shape of the template is shown in part (e) of FIG. 3.

[0098] When only the top reference samples and the top-right reference samples are available, the value of refTemplateType is 6, and the shape of the template is shown in part (f) of FIG. 3.

[0099] In the Intra TMP technology, the codec uses the flag bit intra_tmp_flag to indicate whether the current coding block is encoded using an IntraTMP mode. If so, the same template matching process is performed at the decoding end to obtain the same prediction block at the decoding end, and it is not necessary to additionally encode information about the BV from the current coding block to the matching block.

[0100] In addition to directly searching for the matching block, the IntraTMP may also construct a candidate block vector list according to encoded information, and determine the matching block by testing candidate block vectors in the candidate block vector list. For example, the IntraTMP multi-candidate technology acquires N candidate matching blocks in the reference region through a template matching process, or constructs a candidate block list with a length of N, and the candidate matching blocks in the list can be sorted according to template error values with the current block. A certain candidate block in the list is selected by an index as the final prediction block. For coding blocks using the IntraTMP multi-candidate technology, after the decoded IntraTMP flag bit intra_tmp_flag is true, the intra_tmp_idx is further decoded, and the syntax element intra_tmp_idx may represent an index of the selected candidate block. intra_tmp_flag if (intra_tmp_flag) { intra_tmp_idx }

[0101] Exemplarily, a template matching process for constructing a candidate block list is as follows.

[0102] In a first operation, a first round of search is performed in a certain step size, for example, a horizontal step size and a vertical step size are both 4. N optimal matching blocks with certain spacing (the first N matching blocks with the smallest template error value) are obtained.

[0103] In a second operation, a second round of search is performed in regions adjacent to the N matching block obtained in the first operation, and these adjacent regions can be set as a plurality of non-overlapping regions according to the step size in the first operation. M optimal matching blocks (which may include the matching blocks obtained in the first operation) are obtained from these regions.

[0104] A same construction process is used at the encoding end and decoding end to obtain a consistent candidate block list.

[0105] The Intra_tmp_idx may be encoded using fixed-length encoding or variable-length encoding, for example, using truncated binary encoding.

[0106] A variable-length encoding method may be as follows.

[0107] The smaller the index (the smaller the value of intra_tmp_idx), the smaller the template error value of the corresponding candidate block, and the greater the probability of being statistically selected. A shorter codeword may be set for a smaller intra_tmp_idx. An example is shown below. intra_tmp_idx Binary symbol 0 1 1 0 1 2 0 0 Bin index 0 1

[0108] If the maximum value N of the intra_tmp_idx is relatively large, codewords of the same length may be allocated to larger intra_tmp_idx values. For example, N is 15. Intra_tmp_i dx Binary symbol 0 1 1 1 1 0 0 2 1 0 1 3~6 0 x x x 7~14 0 x x x x

[0109] Herein, x in the above table can be obtained by truncated binary.

[0110] 2) IBC Technology

[0111] Intra Block Copy (IBC) is an Intra prediction technology based on block matching to obtain prediction samples. Similar to inter prediction, prediction is achieved by a block vector pointing from the current block to the reference block, with the difference that the reference block of the inter prediction is from the encoded reconstructed picture, while the reference block of the IBC is from a reconstructed portion of the current picture. Block vector information needs to be transmitted by a bitstream, and thus, similar to intra prediction, there are an IBC-AMVP mode and an IBC-Merge mode.

[0112] The IBC-AMVP mode obtains a prediction block vector through a constructed candidate block vector list, also called "merge candidate list", and obtains the reference block of the current block and the corresponding final block vector through processes such as hash search and full search. The final block vector is encoded according to the prediction block vector to improve encoding efficiency.

[0113] The IBC-Merge mode performs prediction through a constructed candidate block vector list. The candidate block vector list may include block vectors at neighbouring and non-neighbouring positions, historical block vectors, auto-relocated block vectors, and average block vectors of candidate block vectors, etc. The encoding end and the decoding end determine candidate block vectors in the same order by constructing a merged list with the same length M, and obtain a selected final block vector from the merged list by encoding and decoding an index of the merged list. In addition to obtaining block vectors from neighbouring and non-neighbouring positions, historical positions, and auto-relocated positions, the merged list can also obtain other IBC-related information, such as block flipping information, illumination compensation and filtering information of blocks.

[0114] 3) Template matching of IBC and IntraTMP merge mode

[0115] FIG. 4 is a schematic diagram of matching blocks pointed by multiple block vectors in a search region. Candidate block vectors in the candidate block vector list constructed by IntraTMP and IBC can also be reordered based on template matching, and a candidate block vector in the list is selected as the final block vector through the index. For example, a merged list including N block vectors that can be used and are not repeated, the reordering of the candidate block vectors can be accomplished by: calculating cost values cost0, cost1, ..., costN-1 between a reconstructed sample value of a reference region pointed by each block vector and a reconstructed sample value of a template region of the current block, and sorting cost values of respective candidate blocks from small to large. Herein, the cost value may be SAD, SSE, Mean-Removed Sum of Absolute Differences (MRSAD), and the like.

[0116] 4) Motion information buffer

[0117] Normally, since the minimum size of the encoding unit of the reference software is 4x4, the existing method stores the corresponding motion information in the scale of each 4x4 region for a picture that has been encoded / decoded. According to the different coding units that each 4x4 region belongs to, they can be classified into those belonging to the intra coding unit, the inter coding unit, or the IBC coding unit. If the region belongs to an intra coding unit, the index of the intra prediction mode will be stored; if it belongs to an inter coding unit, the motion vector and corresponding reference picture information will be stored; if it belongs to an IBC coding unit or the IntraTMP mode, the block vector will be stored. In addition, some additional information is also stored, such as whether illumination compensation is used, whether it has been filtered, etc.

[0118] For an encoded / decoded picture, the above motion information is stored in a motion information buffer for use by a picture that is being temporally encoded / decoded. For the picture being encoded / decoded, the temporal reference information can only be acquired from the motion information buffer for a collocated picture in the reference picture list. In an ECM reference software, an inter-coded picture can have greater than or equal to one collocated picture at most. The collocated picture is usually a picture in the reference picture list, and the collocated picture of the current picture is determined by encoding / decoding an index for the reference picture list of the current picture.

[0119] In inter prediction, IBC or IntraTMP prediction, there is a case where multiple matching blocks are weighted to generate one prediction block. Therefore, if a block is obtained by weighted prediction, greater than or equal to one motion vector or block vector can be stored in the motion information buffer.

[0120] However, in an actual encoding / decoding process, due to incomplete considerations, under certain scenarios, a candidate block vector list obtained by related technologies cannot be filled up, or there is a large deviation in obtained candidate block vectors, resulting in poor prediction performance and affecting encoding and decoding efficiency.

[0121] Referring to FIG. 5, it shows a schematic structural block diagram of an encoder according to an embodiment of the disclosure. As shown in FIG. 5, an encoder (specifically, a "video encoder") 100 may include a transform and quantization unit 101, an intra estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control and analysis unit 107, a filtering unit 108, an encoding unit 109, a decoded picture buffer unit 110, and the like. The filtering unit 108 may implement deblocking filtering and Sample Adaptive Offset (SAO) filtering, and the encoding unit 109 may implement header information encoding and Context-based Adaptive Binary Arithmetic Coding (CABAC). For an input original video signal, a video coding block can be obtained through partitioning of a Coding Tree Unit (CTU). Then, for residual sample information obtained after intra or inter prediction, the transform and quantization unit 101 performs transformation on the video coding block, including transforming the residual information from a sample domain to a transform domain, and quantizes the obtained transform coefficients to further reduce a bit rate. The intra estimation unit 102 and the intra prediction unit 103 are configured to perform intra prediction on the video coding block; specifically, the intra estimation unit 102 and the intra prediction unit 103 are configured to determine an intra prediction mode to be used to encode the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are configured to perform inter prediction coding of the received video coding block relative to one or more blocks in one or more reference pictures, to provide temporal prediction information. Motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector that can estimate motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105. After the intra prediction mode is determined, the intra prediction unit 103 is further configured to provide selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 also sends calculated and determined motion vector data to the encoding unit 109. In addition, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block, reconstructing a residual block in the sample domain. Blockiness artifacts are removed from the reconstructed residual block through the filter control and analysis unit 107 and the filtering unit 108, and the reconstructed residual block is then added to a predictive block in a picture of the decoded picture buffer unit 110, so as to generate a reconstructed video coding block. The encoding unit 109 is configured to encode various encoding parameters and quantized transform coefficients; in a CABAC-based coding algorithm, context information may be based on neighbouring coding blocks and may be used to encode information indicating the determined intra prediction mode, so as to output a bitstream of the video signal. The decoded picture buffer unit 110 is configured to store reconstructed video coding blocks for prediction reference. As video picture encoding proceeds, new reconstructed video coding blocks are continuously generated, and all of these reconstructed video coding blocks are stored in the decoded picture buffer unit 110.

[0122] Referring to FIG. 6, it shows a schematic structural block diagram of a decoder according to an embodiment of the disclosure. As shown in FIG. 6, a decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, a decoded picture buffer unit 206, and the like. The decoding unit 201 may implement header information decoding and CABAC decoding, and the filtering unit 205 may implement deblocking filtering and SAO filtering. After an input video signal undergoes encoding processing in FIG. 5, a bitstream of the video signal is output. The bitstream is input into the decoder 200 and first passes through the decoding unit 201 to obtain decoded transform coefficients. The transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in a pixel domain. The intra prediction unit 203 may be used to generate prediction data of a current video decoding block based on a determined intra prediction mode and data of a previously decoded block from a current picture. The motion compensation unit 204 determines prediction information used for the video decoding block by parsing motion vectors and other associated syntax elements, and uses the prediction information to generate a predictive block of the video decoding block being decoded. A decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and a corresponding predictive block generated by the intra prediction unit 203 or the motion compensation unit 204. The decoded video signal passes through the filtering unit 205 to remove blockiness artifacts, thereby improving video quality. Then, the decoded video block is stored in the decoded picture buffer unit 206. The decoded picture buffer unit 206 stores reference pictures used for subsequent intra prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0123] Further, the embodiments of the disclosure further provide a network architecture of a codec system including an encoder and a decoder, and FIG. 7 shows a schematic diagram of the network architecture of the codec system according to an embodiment of the disclosure. As shown in FIG. 7, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, and the electronic devices 13 to 1N may perform video interaction through the communication network 01. In the implementation process, the electronic device can be various types of devices with video codec functions. For example, the electronic device may include a smartphone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital telephone, a video phone, a television, a sensing device, a server, etc., which is not specifically limited herein. In addition, the decoder or encoder described in the embodiments of the disclosure may be the above-described electronic device.

[0124] It is to be noted that the methods in the embodiments of the disclosure are mainly applied to the part of the intra prediction unit 103 shown in FIG. 5 and the part of the intra prediction unit 203 shown in FIG. 6. That is to say, the embodiments of the disclosure can be applied not only to an encoder, but also to a decoder, and even to both the encoder and the decoder at the same time, which is not specifically limited in the embodiments of the disclosure.

[0125] It is also to be noted that, when applied to the part of the intra prediction unit 103, the "current block" specifically refers to a coding block on which intra prediction is currently to be performed; when applied to the part of the intra prediction unit 203, the "current block" specifically refers to a decoding block on which intra prediction is currently to be performed.

[0126] In the technologies above, in an actual encoding / decoding process, due to incomplete considerations, under certain scenarios, a candidate block vector list obtained by related technologies cannot be filled up, or there is a large deviation in obtained candidate block vectors, resulting in poor prediction performance and affecting encoding and decoding efficiency.

[0127] Based on this, the embodiments of the disclosure provide a encoding method and a decoding method, which can specifically be a method for constructing a candidate block vector list based on a temporal block vector. A temporal block vector in a motion information buffer of a collocated picture is added to a candidate block vector list as a newly added candidate block vector, so as to increase a number of candidate block vectors, thereby improving a prediction effect of prediction modes such as IBC mode or IntraTMP mode, and thus improving encoding and decoding efficiency.

[0128] In order to facilitate understanding of the technical solutions of the embodiments of the disclosure, the technical solutions of the disclosure will be described in detail below with reference to specific examples. As optional solutions, the above related technologies can be arbitrarily combined with the technical solutions of the embodiments of the disclosure, and all combinations thereof belong to the scope of protection of the embodiments of the disclosure. Embodiments of the disclosure include at least some of the following contents.

[0129] In an embodiment of the disclosure, reference may be made to FIG. 8, which illustrates a schematic flowchart of a decoding method according to an embodiment of the disclosure. As shown in FIG. 8, the method may include operations as follows.

[0130] In an operation 801, one or more reference positions available for a current block to be decoded in a current picture are determined according to first position indication information.

[0131] It is to be noted that the first position indication information includes a predefined reference position, and specifically, one or more reference positions may be predefined according to information such as a position and / or a size parameter of the block to be decoded, and the reference positions are used to determine temporal block vector(s) in a collocated picture. In the decoding process, the one or more reference positions available for the current block are determined according to the position and / or the size parameter of the current block and reference positions predefined by the first position indication information.

[0132] In some embodiments, the operation of determining, according to the first position indication information, the one or more reference positions available for the current block to be decoded in the current picture includes: determining a first reference position of the current block according to the first position indication information, and a position and a size parameter of the current block; and determining that the first reference position is available in a case where the first reference position is within a first picture range associated with the current block; or, determining that the first reference position is unavailable in a case where the first reference position is outside of the first picture range associated with the current block. Herein, an edge of the first picture range may be included within the first picture range.

[0133] The first reference position may be understood as a reference position of the current block directly determined according to the first position indication information, and when the first reference position is available, it means that both the current picture and the collocated picture contain the first reference position, and one or more temporal block vectors in the collocated picture are acquired according to the first reference position. When the first reference position is unavailable, it means that neither the current picture nor the collocated picture contains the first reference position, and the reference position is ignored.

[0134] The first picture range is used to define a picture region in which the reference position(s) available for the current block is / are located, and the first picture range may include one of the following: the current block, a current CTU, a current sub-picture, and the current picture. That is, the reference position(s) available for the current block may include one or more reference positions within the current block, one or more reference positions within the current CTU, one or more reference positions within the current sub-picture, one or more reference positions within the current picture, or one or more reference positions within other picture ranges.

[0135] The first position indication information may also be used to indicate an index order of the reference positions, and a plurality of reference positions may be sequentially indexed according to the index order of the reference positions until a first number of temporal block vectors are obtained, or until indexing of all reference positions defined by the first position indication information is completed. The first number may be a preset number, or a number of temporal block vectors determined according to requirements of a candidate block vector list.

[0136] In some embodiments, the first position indication information includes a first position index, and one or more reference positions indicated by the first position index, wherein the first position index is used to indicate an index order of the reference positions.

[0137] When the first position index indicates one reference position, an index order of each reference position is determined according to each first position index. When the first position index indicates two or more reference positions, the two or more reference positions correspond to a default index order. Exemplarily, the first position index indicates a primary position and a secondary position, and an index order of the primary position precedes an index order of the secondary position.

[0138] In some embodiments, reference positions predefined by the first position indication information include at least one of: one or more reference positions within the current block, one or more reference positions within a bottom-right region of the current block, or one or more reference positions within a top-left region of the current block.

[0139] Exemplarily, the one or more reference positions within the current block may include at least one of: a center position, a top-left corner position, a top-right corner position, a bottom-left corner position, or a bottom-right corner position of the current block. The one or more reference positions within the bottom-right region of the current block may include one or more positions in an unreconstructed region of the current picture. The one or more reference positions within the top-left region of the current block may include one or more positions in a reconstructed region of the current picture.

[0140] FIG. 9 is a schematic diagram of a set of reference positions defined by the first position indication information in an embodiment of the disclosure. As shown in FIG. 9, a set of predefined reference positions includes 10 primary positions (C0) and 10 secondary positions (C1), and a total of 20 reference positions are defined. The coordinates of these positions in the current picture are shown in Table 1. Table 1 20 reference positions defined by the first position indication information Position index Primary position (abscissa, ordinate) Secondary position (abscissa, ordinate) 1 (X0 +1, Y0 +1) (X1, Y1) 2 (X0+1, Y0-3) (X0-3, Y0+1) 3 (X0+1+ W, Y0+1+ H) (X1+ W, Y1+ H) 4 (X0+1+ W, Y0+1-0.5H) (X0+1-0.5 W, Y0+1+ H) 5 (X0+1+2W, Y0+1+2H) (X1+2W, Y1+2H) 6 (X0+1+2W, Y0+1-0.5H) (X0+1-0.5W, Y0+1+2H) 7 (X0+1+3W, Y0+1+3H) (X1+3W, Y1+3H) 8 (X0+1+3W, Y0+1-0.5H) (X0+1-0.5W, Y0+1+3H) 9 (X0+1+4W, Y0+1+4H) (X1+4W, Y1+4H) 10 (X0+1+4W, Y0+1-0.5H) (X0+1-0.5W, Y0+1+4H)

[0141] Herein, X0 and Y0 represent an abscissa and an ordinate of the bottom-right corner position of the current block in the current picture (or the current sub-picture or the current CTU), X0 and Y0 represent the abscissa and the ordinate of the bottom-right corner position of the current block in the current sub-picture or the current CTU relative to the top-left corner of the current sub-picture or the current CTU. X1 and Y1 represent an abscissa and an ordinate of the center position of the current block in the current picture, the center position may also be a position close to the center of the current block, and W and H represent a width and a height of the current block.

[0142] It is to be noted that when 10 predefined primary positions and secondary positions are used as reference positions, corresponding primary positions are found one by one in the order of position indexes from 1 to 10, and it is determined whether the primary position is within an allowable range (for example, this range may be a current picture, a sub-picture, a CTU, or the like), and if the primary position satisfies the condition of being within the allowable range, the primary position is an available reference position, then a motion information buffer at the primary position of one or more collocated pictures is searched for a temporal block vector; otherwise, it is determined whether the secondary position satisfies the condition of being within the allowable range, and if the secondary position satisfies the condition of being within the allowable range, the secondary position is an available reference position, then a motion information buffer at the secondary position of one or more collocated pictures is searched for a block vector.

[0143] It is to be noted that Table 1 consists of 20 reference positions, and 20 position indexes can also be defined to indicate an index order of the reference positions.

[0144] FIG. 10 is a second schematic diagram of a set of reference positions defined by the first position indication information in an embodiment of the disclosure. As shown in FIG. 10, five reference positions are defined in advance, and the positions of these five reference positions in the current block are:

[0145] 1. coordinates of the center position of the current block in the current picture;

[0146] 2. coordinates of the top-left corner position of the current block in the current picture;

[0147] 3. coordinates of the top-right corner position of the current block in the current picture;

[0148] 4. coordinates of the bottom-left corner position of the current block in the current picture; and

[0149] 5. coordinates of the bottom-right corner position of the current block in the current picture.

[0150] In some embodiments, the operation of determining, according to the first position indication information, the one or more reference positions available for the current block to be decoded in the current picture further includes: shifting the first reference position according to a motion vector pointing to a first collocated picture to determine a second reference position of the current block, wherein the first collocated picture is any one of the one or more collocated pictures; and determining that the second reference position is available in a case where the second reference position is within a second picture range associated with the current block, wherein the second reference position is used to determine one or more temporal block vectors in the first collocated picture; or, determining that the second reference position is unavailable in a case where the second reference position is outside of the second picture range associated with the current block. Herein, an edge of the second picture range may be included within the second picture range.

[0151] The second reference position may be understood as a shifted reference position obtained by shifting the first reference position of the current block, or may be understood as a compensated reference position obtained by motion compensation of the first reference position of the current block. When the second reference position is available, it means that both the current picture and the collocated picture contain the second reference position, and one or more temporal block vectors in the collocated picture are acquired according to the second reference position. When the first reference position is unavailable, it means that neither the current picture nor the collocated picture contains the first reference position, and the reference position is ignored.

[0152] In some embodiments, after indexing of all the multiple reference positions predefined by the first position indication information is completed, the operation of shifting the first reference position according to the motion vector pointing to the first collocated picture is performed; alternatively, after indexing of each first reference position is completed, the operation of shifting the first reference position according to the motion vector pointing to the first collocated picture is performed. That is, when sufficient temporal block vectors cannot be obtained according to the first reference position, the temporal block vectors may be obtained in the collocated picture using the second reference position, thus the number of candidate block vectors may be further increased.

[0153] The second picture range is used to define a picture region in which the shifted reference position(s) available for the current block is / are located, and the second picture range may include one of the following: the current block, a current CTU, a current sub-picture, and the current picture. That is, the shifted reference position(s) available for the current block may include one or more reference positions within the current block, one or more reference positions within the current CTU, one or more reference positions within the current sub-picture, one or more reference positions within the current picture, or one or more reference positions within other picture ranges. The second picture range is the same as or not the same as the first picture range.

[0154] In some embodiments, the method may further include: in a case where it is determined according to a first prediction parameter that reference position shifting is allowed for the current block, the first reference position is shifted according to the motion vector pointing to the first collocated picture to determine the second reference position of the current block.

[0155] In some cases, the use of the shifted reference position has little effect on the acquisition of the temporal block vector, and in order to ensure the decoding efficiency, the use scenario of the shifted reference position may be limited, that is, the first prediction parameter of the current block may be used to indicate whether reference position shifting is allowed for the current block.

[0156] Exemplarily, the first prediction parameter includes at least one of: a first syntax element, or the size parameter of the current block. Correspondingly, it is determined that the reference position shifting is allowed for the current block, according to at least one of: a value of the first syntax element determining that the reference position shifting is allowed for the current block, or the size parameter being less than a first threshold value. It is determined that the reference position shifting is not allowed for the current block, according to: a value of the first syntax element determining that the reference position shifting is not allowed for the current block, or the size parameter being greater than or equal to the first threshold value.

[0157] The first syntax element is a high-level syntax element that controls whether reference position shifting is allowed for the current block. It can be a syntax element at the sequence level (sequence parameter set, SPS), picture level (picture header), or slice level (slice header). The first syntax element may be a newly added syntax element or may reuse an existing syntax element.

[0158] The size parameter of the current block can be one or more of: area, height and width of the current block. For large blocks, they generally do not contain detailed features and mostly appear in the background parts of the picture. These parts are also less prone to motion shifting, so the effect of finding the shifted reference position is not ideal. Therefore, the use of shifted reference positions can be restricted on large blocks, which can be blocks larger than 32x32, blocks larger than 64x64, etc.

[0159] The motion vector pointing to the first collocated picture may be a motion vector of the current block at an encoded reference position. In some embodiments, the method further includes: a reconstructed third reference position of the current block is determined according to second position indication information; in a case where the third reference position belongs to an inter block, one or more motion vectors and a reference picture index of the third reference position are acquired; and the motion vector pointing to the first collocated picture is determined according to the motion vectors and the reference picture index.

[0160] The second position indication information includes a predefined reference position, and specifically, a plurality of reference positions may be predefined according to a position and / or a size parameter of the block to be decoded, and the reference positions are used to determine a motion vector pointing to the first collocated picture. In the decoding process, one or more reference positions corresponding to the current block are determined according to the position and / or the size parameter of the current block and the predefined plurality of reference positions.

[0161] The reference position defined by the first position indication information can be shifted by a certain motion vector to obtain the shifted reference position. The motion vector involved in the shifting is obtained according to the reconstructed reference position of the current block, and the reconstructed reference position includes a reference picture that has been decoded or a region that has been decoded in the current picture. The specific method is to pre-define, through the second position indication information, a set of reference positions for obtaining motion vectors. A reconstructed third reference position of the current block is determined according to the position and / or size parameter of the current block. If the third reference position belongs to an inter block, an available motion vector is contained, and the motion vector is obtained to guide the shifting of the first reference position.

[0162] The second position indication information may also be used to indicate an index order of the reference positions, and a plurality of reference positions may be sequentially indexed according to the index order of the reference positions until a first number of temporal block vectors are obtained, or until indexing of all reference positions defined by the second position indication information is completed. The first number may be a preset number, or a number of temporal block vectors determined according to requirements of a candidate block vector list.

[0163] In some embodiments, the second position indication information includes a second position index, and one or more reference positions indicated by the second position index, wherein the second position index is used to indicate an index order of the reference positions.

[0164] In some embodiments, the plurality of reference positions predefined by the second position indication information include at least one of: a reconstructed reference position in the current picture, or a reconstructed reference position in a reference picture of the current block, wherein the reconstructed reference position in the current picture includes at least one of: a neighbouring reference position or a non-neighbouring reference position of the current block; and the reconstructed reference position in the reference picture includes at least one of: a neighbouring reference position or a non-neighbouring block reference position of a reference block corresponding to the current block.

[0165] Exemplarily, the neighbouring reference position may include at least one of: a left neighbouring position, a top neighbouring position, a top-left neighbouring position, a top-right neighbouring position, or a bottom-left neighbouring position. The non-neighbouring reference position may include at least one of: a left non-neighbouring position, a top non-neighbouring position, a top-left non-neighbouring position, a top-right non-neighbouring position, or a bottom-left non-neighbouring position.

[0166] If the third reference position belongs to an inter block (also called inter decoded block or inter decoding unit), one or more motion vectors and corresponding reference picture information will be stored in a motion information buffer. If the third reference position belongs to an intra block, an index of an intra prediction mode will be stored.

[0167] FIG. 11 is a first schematic diagram of a set of reference positions defined by the second position indication information in an embodiment of the disclosure. As shown in FIG. 11, 5 reference positions are defined in advance, and the motion vectors at the 5 positions are used to guide the reference positions to shift. The coordinates of these positions in the current picture are shown in Table 2. Table 2 5 reference positions defined by the second position indication information Position index Coordinates 1 (X2-1, Y2+ H-1) 2 (X2+ W-1, Y2-1) 3 (X2-1, Y2-1) 4 (X2-1, Y2+ H) 5 (X2+ W, Y2-1)

[0168] Herein, X0 and Y0 represent an abscissa and an ordinate of the bottom-right corner position of the current block in the current picture (or the current sub-picture or the current CTU), X0 and Y0 represent the abscissa and the ordinate of the bottom-right corner position of the current block in the current sub-picture or the current CTU relative to the top-left corner of the current sub-picture or the current CTU. X1 and Y1 represent an abscissa and an ordinate of the center position of the current block in the current picture, the center position may also be a position close to the center of the current block, and W and H represent a width and a height of the current block.

[0169] FIG. 12 is a second schematic diagram of a set of reference positions defined by the second position indication information in an embodiment of the disclosure. As shown in FIG. 12, 23 reference positions are defined in advance, and the motion vectors at the 23 positions are used to guide the reference positions to shift. The coordinates of these positions in the current picture are shown in Table 3. Table 3 23 reference positions defined by the second position indication information Position index Coordinates 1 (X2-1, Y2+ H-1) 2 (X2+ W-1, Y2-1) 3 (X2-1, Y2-1) 4 (X2-1, Y2+ H) 5 (X2+ W, Y2-1) 6 (X2-1-W, Y2+ 2H-1) 7 (X2+2W-1, Y2-1-H) 8 (X2-1-W, Y2-1-H) 9 (X2-1-2W, Y2+ 3H-1) 10 (X2+3W-1, Y2-1-2H) 11 (X2+0.5 W, Y2-1-2H) 12 (X2-1-2W, Y2+ 0.5H) 13 (X2-1-2W, Y2-1-2H) 14 (X2-1-3W, Y2+ 4H-1) 15 (X2+4W-1, Y2-1-3H) 16 (X2+0.5 W, Y2-1-3H) 17 (X2-1-3W, Y2+ 0.5H) 18 (X2-1-3W, Y2-1-3H) 19 (X2-1-4W, Y2+ 5H-1) 20 (X2+5W-1, Y2-1-4H) 21 (X2+0.5 W, Y2-1-4H) 22 (X2-1-4W, Y2+ 0.5H) 23 (X2-1-4W, Y2-1-4H)

[0170] If the predefined position for obtaining the shifted motion vector belongs to an inter block that has been reconstructed, motion information buffer at that position in the current picture contains one or more motion vectors pointing to its reference picture. The reference picture can be a collocated picture, or another picture in the reference picture list other than the collocated 5 picture.

[0171] In some embodiments, the operation of determining the motion vector pointing to the first collocated picture according to the motion vectors and the reference picture index includes: in a case where a reference picture indicated by the reference picture index is the first collocated picture of the current picture, determining the motion vector as the motion vector pointing to the 10 first collocated picture; or, in a case where the reference picture indicated by the reference picture index is not the first collocated picture of the current picture, converting a motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture to obtain a reference position shifting amount of the first collocated picture.

[0172] It is to be noted that if a motion vector obtained by searching based on the third reference position points to the first collocated picture, the motion vector can be directly used to shift the first reference position, so as to obtain the shifted reference position in the first collocated picture; if the motion vector does not point to the first collocated picture, it is necessary to convert the motion vector pointing to another reference picture to the one pointing to the first collocated picture, and then shift the first reference position.

[0173] In some embodiments, the operation of converting the motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture includes: determining a first difference between picture order counts (POCs) of the current picture and the reference picture according to the POC of the current picture and the POC of the reference picture; determining a second difference between POCs of the current picture and the first collocated picture according to the POC of the current picture and the POC of the first collocated picture; and converting the motion vector pointing to the reference picture according to the first difference and the second difference to obtain the motion vector pointing to the first collocated picture.

[0174] In some embodiments, the reference picture includes a first reference picture located in a same temporal direction as the first collocated picture, or a second reference picture located in an opposite temporal direction to the first collocated picture.

[0175] Exemplarily, converting formulas for the motion vector conversion are as follows. POCdiffl = CurPOC - RefPOC POCdiff2 = CurPOC - ColPOC Scaled Mv = Mp P POCdiffl + POCdiff2

[0176] For example, if the first difference and the second difference are positive numbers, in practical application, it is necessary to determine the sign of the motion vector according to whether the reference picture and the collocated picture are in the same temporal direction, and when the reference picture and the collocated picture are not in the same temporal direction, the converting formulas of the motion vector may also be as follows. POCdiffl = ICurPOC - RefPOCI POCdiff2 = ICurPOC - ColPOCI Scaled Mv = -(Mv P POCdiffl + POCdiff2)

[0177] Herein, POCdiffl is the first difference, POCdiff2 is the second difference, and Scaled Mv is the converted motion vector.

[0178] Further examples will be given below for each case.

[0179] In a case 1, the reference picture is the first collocated picture, i.e. the motion vector points to the first collocated picture.

[0180] If the motion vector Mv pointing to the collocated picture is acquired from the defined position(s) for acquiring the motion vector, a formula for calculating the shifted reference position from the Mv is as follows. PosShift = Pos + Mv = (x + x1,y + yl)

[0181] In the above formula, Pos represents the reference position, and its coordinates in the current picture are (x, y). The shifting amount of Mv is (x1, y1). According to the calculation, the coordinates of the shifted reference position PosShift in the current picture are (x + xl,y + yl).

[0182] In practical application, the motion vector can be changed into an integer motion vector first, and then the shifted reference position can be calculated. That is, the rounded motion vector is expressed as ShiftMv, its shift amount is expressed as (shiftx, shifty), and the coordinates of PosShift in the current picture are (x + shiftx, y + shifty). The formula for calculating the shifted reference position according to ShiftMv is as follows. PosShift = Pos + ShiftMv = (x + shiftx,y + shifty)

[0183] When the block vector at the shifted reference position in the collocated picture is acquired, reference positions in a defined reference position index order should be shifted one by one according to the acquired shifted motion vector, and if the shifted reference position is within an allowed range (e.g., this range may be the current picture, sub-picture, CTU or the like), it is further determined whether the motion information at the position in the collocated picture contains the available block vector, and if so, the block vector is further selected as a candidate for the merged list.

[0184] In a case 2, the reference picture is not the first collocated picture, and the reference picture is located in the same temporal direction as the first collocated picture.

[0185] If the acquired motion vector is a motion vector Mv on a reference picture pointing to a non-collocated picture in the reference picture list, the Mv on the reference picture can be scaled by temporal distances between the reference picture, the collocated picture and the current picture, so that the Mv on the reference picture is mapped into the Mv on the collocated picture.

[0186] FIG. 13 is a first schematic diagram of converting an MV pointing to a reference picture according to an embodiment of the disclosure. As shown in FIG. 13, the current picture (CurPic) corresponds to a collocated picture (ColPic) and a reference picture (RefPic). If the currently acquired motion vector Mv points to a reference picture, a scaled motion vector Mv0 scaled on a collocated picture can be deduced according to a temporal distance POC diffRef between the current picture and the reference picture and a temporal distance POC diff between the current picture and the collocated picture, and the calculation formula for the scaled Mv0 is as follows. Scaled Mv0 = Mv x POCdiff + POCdiffRef

[0187] POCdiff is a difference between the current picture and the collocated picture in terms of POC, and POCdiffRef is a difference between the current picture and the reference picture in terms of POC, and the two differences are a positive integer distance. For example, if the POC of ColPic is 10 and the POC of CurPic is 11, the POCdiff is 1. For example, if the POC of ColPic is 12 and the POC of CurPic is 11, the POCdiff is 1. In some embodiments, the division operation in the above formula for calculating the scaled motion vector ScaledMv0 can be simplified or approximated by methods such as motion shifting and table lookup.

[0188] When the motion vector scaled on the collocated picture is calculated, the block vector may be further obtained according to the steps in the case 1.

[0189] In a case 3, the reference picture and the first collocated picture are located in different temporal directions, and the reference picture is not the second collocated picture.

[0190] In some embodiments, the current picture may include two collocated pictures. When the collocated picture and the reference picture are not in the same temporal direction, corresponding scaling can also be performed to obtain a target motion vector on the collocated picture. FIG. 14 is a second schematic diagram of converting an MV pointing to the reference picture in an embodiment of the disclosure. As shown in FIG. 14, the current picture has two collocated pictures, namely, collocated picture 0 (ColPic0) and collocated picture 1 (ColPic1), respectively. A reference picture pointed by a motion vector MV found for the current picture is in the same temporal direction as the collocated picture ColPic0, so the method for calculating the scaled Mv0 is the same as that in FIG. 13. The collocated picture ColPic1 and the reference picture are in the opposite temporal direction with respect to the current picture, then the motion vector scaled Mv1 on the collocated picture is calculated as follows. Scaled Mil =-(Mi x POCdiffl + POCdiffRef)

[0191] When the motion vector scaled on the collocated picture is calculated, the block vector may be further obtained according to the steps in the case 1.

[0192] It is to be noted that when two motion vectors and reference picture indexes are obtained based on the third reference position, motion vectors pointing to the reference picture can be converted into motion vectors pointing to collocated pictures in the same temporal direction.

[0193] In a case 4, the reference picture is the second collocated picture, i.e. the motion vector does not point to the first collocated picture.

[0194] If there are a plurality of collocated pictures for the current picture, the shifted motion vector acquired in the case 1 may be further mapped from one collocated picture to another collocated picture.

[0195] If the second collocated picture to be mapped and the first collocated picture pointed by the obtained shifted motion vector are located in different temporal directions, the shifted motion vector can be obtained by motion vector mapping. FIG. 15 is a schematic diagram of converting an MV pointing to a collocated picture in an embodiment of the disclosure. As shown in FIG. 15, two collocated pictures ColPic0 and ColPic1 of the current picture CurPic are respectively located in opposite temporal directions. The mapped motion vector Mv1 can be calculated through the obtained motion vector Mv0 pointing to ColPic0, and the motion vector Mv1 on ColPic1 is calculated as follows. Mv1 = -(MvO x POCdiffl - POCdiffO)

[0196] FIG. 16 is a second schematic diagram of converting an MV pointing to the collocated picture in an embodiment of the disclosure. As shown in FIG. 16, if two collocated pictures ColPic0 and ColPic1 of the current picture CurPic are respectively located in the same temporal direction, the mapped motion vector Mv1 can be calculated through the acquired motion vector Mv0 pointing to ColPic0, and the motion vector Mv1 is calculated as follows. Mvl = (MvO x POCdiffl - POCdiffO)

[0197] When the motion vector scaled on the collocated picture is calculated, the block vector may be further obtained according to the steps in the case 1.

[0198] In an operation 802, one or more temporal block vectors are determined in one or more collocated pictures of the current block according to the one or more reference positions.

[0199] It is to be noted that a type of the current picture is an inter picture, and the collocated picture is a picture in a reference picture list of the current inter-encoded picture. Exemplarily, the collocated picture includes a previous reference picture, in the reference picture list, whose play order is before the current picture, and / or a next reference picture after the current picture. The collocated picture differs from other reference pictures in the reference picture list in that motion information of each position on the collocated is stored, and can be used as temporal reference information when a candidate block vector list is constructed for a current block.

[0200] In some embodiments, a motion information buffer of the collocated picture is looked up according to the reference position. When temporal block vectors are included, one or more temporal block vectors corresponding to the reference position are obtained. The plurality of temporal block vectors may be two temporal block vectors, and the plurality of block temporal block vectors may be three or more temporal block vectors.

[0201] In some embodiments, the one or more reference positions include a first reference position, and if the current picture includes a first collocated picture, corresponding one or more temporal block vectors are acquired, in the first collocated picture of the current block, according to the first reference position; if the current picture includes a second collocated picture, corresponding one or more temporal block vectors are acquired, in the second collocated picture of the current block, according to the first reference position. Exemplarily, the plurality of temporal block vectors may be two temporal block vectors, and the plurality of temporal block vectors may be three or more temporal block vectors.

[0202] In some embodiments, the one or more reference positions further include a second reference position, and when the second reference position is determined by shifting the first reference position according to a motion vector pointing to the first collocated picture, corresponding one or more temporal block vectors are acquired in the first collocated picture of the current block according to the second reference position; when the second reference position is determined by shifting the first reference position according to a motion vector pointing to the second collocated picture, corresponding one or more temporal block vectors are acquired in the second collocated picture of the current block according to the second reference position.

[0203] In an operation 803, a candidate block vector list for the current block is determined according to the one or more temporal block vectors.

[0204] In some embodiments, the operation of determining the candidate block vector list for the current block according to the one or more temporal block vectors includes: reordering the one or more temporal block vectors to obtain a reordered list; and adding the reordered list into the candidate block vector list.

[0205] In some embodiments, the operation of reordering the one or more temporal block vectors to obtain the reordered list includes: determining a distance reference value between a reference position of each temporal block vector and a specific position of the current block; and reordering the one or more temporal block vectors in ascending order of the distance reference value to obtain the reordered list.

[0206] Exemplarily, the distance reference value may characterize a distance between the reference position and a center position of the current block, and when the current position is the first reference position, the formula for calculating the distance reference value is as follows. D = abs(PosX - X1) + abs(PosY - Y1)

[0207] PosX is a horizontal coordinate of the reference position in the current picture, X1 is a horizontal coordinate of the center position of the current block in the current picture, PosY is a vertical coordinate of the reference position in the current picture, Y1 is a vertical coordinate of the center position of the current block in the current picture, D is the calculated distance value, and the reordering is performed according to the size of D.

[0208] When the current position is the second reference position, the formula for calculating the distance reference value is as follows. D = abs(PosShiftX — X1) + abs(PosShiftY — 71)

[0209] PosShiftX is a horizontal coordinate of a shifted reference position in the current picture, and PosShiftY is a vertical coordinate of the shifted reference position in the current picture.

[0210] In some embodiments, the operation of reordering the one or more temporal block vectors to obtain the reordered list includes: determining, based on template matching, a template matching cost value corresponding to each temporal block vector; and reordering the one or more temporal block vectors in ascending order of the template matching cost value to obtain the reordered list.

[0211] The candidate temporal block vectors are sorted according to the magnitude of the cost values between the reconstructed sample values on the template region and the reference region of the current block. After sorting, the temporal block vectors can be added to the candidate block vector list as final candidates according to ascending order of the cost value, and the cost value may be SAD, SATD, MSE, SSD, MAD, MSD, NCC, or the like, which is not specifically limited here.

[0212] In some embodiments, it is determined, according to a value of the third syntax element, whether to perform template matching-based reordering on temporal block vectors. If the value of the third syntax element is a first value, it is determined not to perform template matching-based reordering on temporal block vectors. If the value of the third syntax element is a second value, it is determined to perform template matching-based reordering on temporal block vectors. The third syntax element may be a newly added syntax element or may reuse an existing syntax element. For example, the third syntax element may be a syntax element for specifically controlling template matching of a temporal block vector, or may be a syntax element for uniformly controlling a plurality of template matching techniques.

[0213] In an operation 804, a prediction block of the current block is determined according to the candidate block vector list.

[0214] In some embodiments, one or more target block vectors for the current block are determined according to the candidate block vector list; one or more reference blocks of the current block are determined according to the one or more target block vectors of the current block; a prediction block of the current block is determined according to the one or more reference blocks of the current block; and a reconstructed block of the current block is determined according to the prediction block of the current block.

[0215] It is to be noted that the candidate block vector list containing temporal block vectors that is generated according to operations of the method provided in the embodiments of the disclosure can be applied to any prediction mode that needs to construct a candidate block vector list, for example, the IBC prediction mode, the IntraTMP prediction mode, etc. The candidate block vector list constructed based on temporal block vectors is used to improve prediction performance of related prediction modes, thereby enhancing decoding efficiency.

[0216] In some embodiments, the candidate block vector list further includes at least one of: a block vector of a reconstructed neighbouring block, a block vector of reconstructed non-neighbouring block, or an auto-relocated block vector.

[0217] It is to be noted that the temporal block vector searched out by the embodiment of the disclosure may be added to any position in the candidate block vector list. For example, the temporal block vector may be added after a block vector of a spatially neighbouring block, after a block vector of a spatially non-neighbouring block, or after an auto-relocated block vector.

[0218] In some embodiments, the method further includes: a bitstream is decoded to determine a residual block of the current block; and a reconstructed block of the current block is determined according to a reference block and the prediction block of the current block.

[0219] In some embodiments, the operation of determining, according to the first position indication information, the one or more reference positions available for the current block to be decoded in the current picture includes: in a case where it is determined according to a second prediction parameter that a temporal block vector is allowed to be added to the candidate block vector list, a first reference position available for the current block is determined according to the first position indication information.

[0220] Exemplarily, the second prediction parameter includes at least one of: a second syntax element for indicating whether a temporal block vector is allowed to be added to the candidate block vector list, a type of the current picture, whether a collocated picture exists for the current picture, a size parameter of the current block, or a number of temporal block vectors.

[0221] Accordingly, it is determined that the temporal block vector is allowed to be added to the candidate block vector list, according to one or more of: a value of the second syntax element determining that the temporal block vector is allowed to be added to the candidate block vector list, the type of the current picture being an inter picture, the size parameter of the current block being greater than a second threshold, and the number of temporal block vectors being non-zero.

[0222] The second syntax element is a high-level syntax element that controls whether the present scheme is allowed to be used. It can be a syntax element at the sequence level (sequence parameter set, SPS), picture level (picture header), or slice level (slice header). The second syntax element may be a newly added syntax element or may reuse an existing syntax element. For example, the second syntax element may be a high-level syntax element of the Temporal Motion Vector Prediction (TMVP) to control whether the use of TMVP is allowed, and whether the use of the present scheme is allowed, and when the high-level syntax element of the TMVP is enabled, it represents that the use of the TMVP is allowed and the use of the present scheme is allowed, and otherwise, the use of both is prohibited.

[0223] Specifically, the current picture type may be a bidirectional prediction picture (such as a B picture), and the current picture type may be a unidirectional prediction picture (such as an I picture or a P picture).

[0224] That is, performing the method steps provided by the embodiments of the disclosure needs to meet some general limitations, specifically as follows.

[0225] 1. The present technical scheme should allow the temporal block vector to be added when the current picture is an inter-coded picture and there is more than or equal to one collocated picture.

[0226] 2. The present technical scheme can be controlled by a high-level syntax element to allow its use. For example, it may be a syntax element at the sequence level (SPS), picture level (picture header), slice level (slice header).

[0227] 3. The present technical scheme can rely on a value of the high-level syntax element for TMVP to control whether it is allowed to use, and when a high-level syntax element table of TMVP is enabled, the present technical scheme can also be enabled together for both inter prediction and merge.

[0228] 4. The present technical scheme can be enabled for blocks of a particular shape or size. For example, the difference between small blocks is generally large, and it is usually difficult to find a suitable matching block for a small block to be encoded, so the use of the present technical scheme may be restricted on small blocks, and the small blocks may be blocks smaller than 8x8, blocks smaller than 16x16, etc. For another example, for large blocks, they generally do not contain detailed features and mostly appear in the background parts of the picture. These parts are also less prone to motion shifting, so the effect of finding the shifted reference position is not ideal. Therefore, the use of the present technical scheme can be restricted on large blocks, which can be blocks larger than 32x32, blocks larger than 64x64, etc.

[0229] 5. The present technical scheme can control the maximum number of temporal block vectors that can be allowed to be added to the merged list by encoding and decoding a syntax element or setting a predefined variable value, so as to avoid the addition of too many temporal block vectors in the merged list, which results in other types of block vectors being unable to be filled into the merged list.

[0230] 6. Adding a temporal block vector may include one or more of: a block vector at a reference position, a block vector at a reference position pointing to a collocated picture and shifted by a motion vector, a block vector at a reference position shifted by a scaled motion vector, and a block vector at a reference position shifted by a motion vector mapped on the collocated picture, and the addition order may be arbitrarily arranged and combined.

[0231] 7. Temporal block vectors can be added anywhere in the merged list. For example, when the existing IntraTMP merged list and IBC merged list are constructed, they include spatially neighbouring block vectors, spatially non-neighbouring block vectors, auto-relocated block vectors, etc., and the temporal block vectors can be added after the spatially neighbouring block vectors, after the spatially non-neighbouring block vectors or after the auto-relocated block vectors.

[0232] 8. Template-based reordering of the temporal block vectors may be used if the corresponding syntax element identifier based on template matching is true; otherwise, template-matching-based reordering of the temporal block vectors is not performed. Template matching techniques usually bring additional implementation complexity. The bit stream can contain relevant syntax elements to control its enabling or disabling. This syntax element can be a syntax element that uniformly controls multiple template matching techniques, or it can be a syntax element that specifically controls template matching for temporal block vectors.

[0233] With the technical schemes above, at the decoding end, a temporal block vector in a motion information buffer of a collocated picture is added to a candidate block vector list as a newly added candidate block vector, so as to increase a number of candidate block vectors, thereby improving a prediction effect of prediction modes such as IBC mode or IntraTMP mode, and thus improving encoding and decoding efficiency.

[0234] In an embodiment of the disclosure, there is provided an encoding method, reference may be made to FIG. 17, which illustrates a schematic flowchart of a decoding method according to an embodiment of the disclosure. As shown in FIG. 17, the method may include operations as follows.

[0235] In an operation 1701, one or more reference positions available for a current block to be encoded in a current picture are determined according to first position indication information.

[0236] The first position indication information includes a predefined reference position, and specifically, one or more reference positions may be predefined according to information such as a position and / or a size parameter of the block to be decoded, and the reference positions are used to determine temporal block vector(s) in a collocated picture. In the decoding process, the one or more reference positions available for the current block are determined according to the position and / or the size parameter of the current block and reference positions predefined by the first position indication information.

[0237] In some embodiments, the operation of determining, according to the first position indication information, the one or more reference positions available for the current block to be encoded in the current picture includes: determining a first reference position of the current block according to the first position indication information, and a position and a size parameter of the current block; and determining that the first reference position is available in a case where the first reference position is within a first picture range associated with the current block; or, determining that the first reference position is unavailable in a case where the first reference position is outside of the first picture range associated with the current block. Herein, an edge of the first picture range may be included within the first picture range.

[0238] The first reference position may be understood as a reference position of the current block directly determined according to the first position indication information, and when the first reference position is available, it means that both the current picture and the collocated picture contain the first reference position, and one or more temporal block vectors in the collocated picture are acquired according to the first reference position. When the first reference position is unavailable, it means that neither the current picture nor the collocated picture contains the first reference position, and the reference position is ignored.

[0239] The first picture range is used to define a picture region in which the reference position(s) available for the current block is / are located, and the first picture range may include one of the following: the current block, a current CTU, a current sub-picture, and the current picture. That is, the reference position(s) available for the current block may include one or more reference positions within the current block, one or more reference positions within the current CTU, one or more reference positions within the current sub-picture, one or more reference positions within the current picture, or one or more reference positions within other picture ranges.

[0240] The first position indication information may also be used to indicate an index order of the reference positions, and a plurality of reference positions may be sequentially indexed according to the index order of the reference positions until a first number of temporal block vectors are obtained, or until indexing of all reference positions defined by the first position indication information is completed. The first number may be a preset number, or a number of temporal block vectors determined according to requirements of a candidate block vector list.

[0241] In some embodiments, the first position indication information includes a first position index, and one or more reference positions indicated by the first position index, wherein the first position index is used to indicate an index order of the reference positions.

[0242] When the first position index indicates one reference position, an index order of each reference position is determined according to each first position index. When the first position index indicates two or more reference positions, the two or more reference positions correspond to a default index order. Exemplarily, the first position index indicates a primary position and a secondary position, and an index order of the primary position precedes an index order of the secondary position.

[0243] In some embodiments, reference positions predefined by the first position indication information include at least one of: one or more reference positions within the current block, one or more reference positions within a bottom-right region of the current block, or one or more reference positions within a top-left region of the current block.

[0244] Exemplarily, the one or more reference positions within the current block may include at least one of: a center position, a top-left corner position, a top-right corner position, a bottom-left corner position, or a bottom-right corner position of the current block. The one or more reference positions within the bottom-right region of the current block may include one or more positions in an unreconstructed region of the current picture. The one or more reference positions within the top-left region of the current block may include one or more positions in a reconstructed region of the current picture.

[0245] In some embodiments, the operation of determining, according to the first position indication information, the one or more reference positions available for the current block to be encoded in the current picture further includes: shifting the first reference position according to a motion vector pointing to a first collocated picture to determine a second reference position of the current block, wherein the first collocated picture is any one of the one or more collocated pictures; and determining that the second reference position is available in a case where the second reference position is within a second picture range associated with the current block, wherein the second reference position is used to determine one or more temporal block vectors in the first collocated picture; or, determining that the second reference position is unavailable in a case where the second reference position is outside of the second picture range associated with the current block. Herein, an edge of the second picture range may be included within the second picture range.

[0246] The second reference position may be understood as a shifted reference position obtained by shifting the first reference position of the current block, or may be understood as a compensated reference position obtained by motion compensation of the first reference position of the current block. When the second reference position is available, it means that both the current picture and the collocated picture contain the second reference position, and one or more temporal block vectors in the collocated picture are acquired according to the second reference position. When the first reference position is unavailable, it means that neither the current picture nor the collocated picture contains the first reference position, and the reference position is ignored.

[0247] In some embodiments, after indexing of all the multiple reference positions predefined by the first position indication information is completed, the operation of shifting the first reference position according to the motion vector pointing to the first collocated picture is performed; alternatively, after indexing of each first reference position is completed, the operation of shifting the first reference position according to the motion vector pointing to the first collocated picture is performed. That is, when sufficient temporal block vectors cannot be obtained according to the first reference position, the temporal block vectors may be obtained in the collocated picture using the second reference position, thus the number of candidate block vectors may be further increased.

[0248] The second picture range is used to define a picture region in which the shifted reference position(s) available for the current block is / are located, and the second picture range may include one of the following: the current block, a current CTU, a current sub-picture, and the current picture. That is, the shifted reference position(s) available for the current block may include one or more reference positions within the current block, one or more reference positions within the current CTU, one or more reference positions within the current sub-picture, one or more reference positions within the current picture, or one or more reference positions within other picture ranges. The second picture range is the same as or not the same as the first picture range.

[0249] In some embodiments, the method may further include: in a case where it is determined according to a first prediction parameter that reference position shifting is allowed for the current block, the first reference position is shifted according to the motion vector pointing to the first collocated picture to determine the second reference position of the current block.

[0250] In some cases, the use of the shifted reference position has little effect on the acquisition of the temporal block vector, and in order to ensure the encoding efficiency, the use scenario of the shifted reference position may be limited, that is, the first prediction parameter of the current block may be used to indicate whether reference position shifting is allowed for the current block.

[0251] Exemplarily, the first prediction parameter includes at least one of: a first syntax element, or the size parameter of the current block. Correspondingly, it is determined that the reference position shifting is allowed for the current block, according to at least one of: a value of the first syntax element determining that the reference position shifting is allowed for the current block, or the size parameter being less than a first threshold value. It is determined that the reference position shifting is not allowed for the current block, according to: a value of the first syntax element determining that the reference position shifting is not allowed for the current block, or the size parameter being greater than or equal to the first threshold value.

[0252] The first syntax element is a high-level syntax element that controls whether reference position shifting is allowed for the current block. It can be a syntax element at the sequence level (sequence parameter set, SPS), picture level (picture header), or slice level (slice header).

[0253] The size parameter of the current block can be one or more of: area, height and width of the current block. For large blocks, they generally do not contain detailed features and mostly appear in the background parts of the picture. These parts are also less prone to motion shifting, so the effect of finding the shifted reference position is not ideal. Therefore, the use of shifted reference positions can be restricted on large blocks, which can be blocks larger than 32x32, blocks larger than 64x64, etc.

[0254] The motion vector pointing to the first collocated picture may be a motion vector of the current block at an encoded reference position. In some embodiments, the method further includes: a reconstructed third reference position of the current block is determined according to second position indication information; in a case where the third reference position belongs to an inter block, one or more motion vectors and a reference picture index of the third reference position are acquired; and the motion vector pointing to the first collocated picture is determined according to the motion vectors and the reference picture index.

[0255] The second position indication information includes a predefined reference position, and specifically, one or more reference positions may be predefined according to information such as a position and / or a size parameter of the block to be encoded, and the reference positions are used to determine a motion vector pointing to the first collocated picture. In the encoding process, the reference position is predefined according to the position and / or the size parameter of the current block and the second position indication information, and a motion vector of the current block pointing to the first collocated picture is determined.

[0256] The reference position defined by the first position indication information can be shifted by a certain motion vector to obtain the shifted reference position. The motion vector involved in the shifting is obtained according to the reconstructed reference position of the current block, and the reconstructed reference position includes a reference picture that has been encoded or a region that has been encoded in the current picture. The specific method includes: predefining a set of reference positions through the second position indication information, which are used for obtaining motion vectors, searching the predefined reference positions, determining a third reference position that has completed reconstruction and contains a usable motion vector, and obtaining the motion vector for guiding the shifting of the first reference position.

[0257] The second position indication information may also be used to indicate an index order of the reference positions, and a plurality of reference positions may be sequentially indexed according to the index order of the reference positions until a first number of temporal block vectors are obtained, or until indexing of all reference positions defined by the second position indication information is completed. The first number may be a preset number, or a number of temporal block vectors determined according to requirements of a candidate block vector list.

[0258] In some embodiments, the second position indication information includes a second position index, and one or more reference positions indicated by the second position index, wherein the second position index is used to indicate an index order of the reference positions.

[0259] In some embodiments, the plurality of reference positions predefined by the second position indication information include at least one of: a reconstructed reference position in the current picture, or a reconstructed reference position in a reference picture of the current block, wherein the reconstructed reference position in the current picture includes at least one of: a neighbouring reference position or a non-neighbouring reference position of the current block; and the reconstructed reference position in the reference picture includes at least one of: a neighbouring reference position or a non-neighbouring block reference position of a reference block corresponding to the current block.

[0260] Exemplarily, the neighbouring reference position may include at least one of: a left neighbouring position, a top neighbouring position, a top-left neighbouring position, a top-right neighbouring position, or a bottom-left neighbouring position. The non-neighbouring reference position may include at least one of: a left non-neighbouring position, a top non-neighbouring position, a top-left non-neighbouring position, a top-right non-neighbouring position, or a bottom-left non-neighbouring position.

[0261] If the third reference position belongs to an inter block (also called inter encoded block or inter encoding unit), one or more motion vectors and corresponding reference picture information will be stored in a motion information buffer. If the third reference position belongs to an intra block, an index of an intra prediction mode will be stored.

[0262] In some embodiments, the operation of determining the motion vector pointing to the first collocated picture according to the motion vectors and the reference picture index includes: in a case where a reference picture indicated by the reference picture index is the first collocated picture of the current picture, determining the motion vector as the motion vector pointing to the first collocated picture; or, in a case where the reference picture indicated by the reference picture index is not the first collocated picture of the current picture, converting a motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture to obtain a reference position shifting amount of the first collocated picture.

[0263] It is to be noted that if a motion vector obtained by searching based on the third reference position points to the first collocated picture, the motion vector can be directly used to shift the first reference position, so as to obtain the shifted reference position in the first collocated picture; if the motion vector does not point to the first collocated picture, it is necessary to convert the motion vector pointing to another reference picture to the one pointing to the first collocated picture, and then shift the first reference position.

[0264] In some embodiments, the operation of converting the motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture includes: determining a first difference between picture order counts (POCs) of the current picture and the reference picture according to the POC of the current picture and the POC of the reference picture; determining a second difference between POCs of the current picture and the first collocated picture according to the POC of the current picture and the POC of the first collocated picture; and converting the motion vector pointing to the reference picture according to the first difference and the second difference to obtain the motion vector pointing to the first collocated picture.

[0265] In some embodiments, the reference picture includes a first reference picture located in a same temporal direction as the first collocated picture, or a second reference picture located in an opposite temporal direction to the first collocated picture.

[0266] In an operation 1702, one or more temporal block vectors are determined in one or more collocated pictures of the current block according to the one or more reference positions.

[0267] It is to be noted that a type of the current picture is an inter picture, and the collocated picture is a picture in a reference picture list of the current inter-encoded picture. Exemplarily, the collocated picture includes a previous reference picture, in the reference picture list, whose play order is before the current picture, and / or a next reference picture after the current picture. The collocated picture differs from other reference pictures in the reference picture list in that motion information of each position on the collocated is stored, and can be used as temporal reference information when a candidate block vector list is constructed for a current block.

[0268] In some embodiments, a motion information buffer of the collocated picture is looked up according to the reference position. When temporal block vectors are included, one or more temporal block vectors corresponding to the reference position are obtained. The plurality of temporal block vectors may be two temporal block vectors, and the plurality of block temporal block vectors may be three or more temporal block vectors.

[0269] In some embodiments, the one or more reference positions include a first reference position, and if the current picture includes a first collocated picture, one or more corresponding temporal block vectors are acquired, in the first collocated picture of the current block, according to the first reference position; if the current picture includes a second collocated picture, one or more corresponding temporal block vectors are acquired, in the second collocated picture of the current block, according to the first reference position. Exemplarily, the plurality of temporal block vectors may be two temporal block vectors, and the plurality of temporal block vectors may be three or more temporal block vectors.

[0270] In some embodiments, the one or more reference positions further include a second reference position, and when the second reference position is determined by shifting the first reference position according to a motion vector pointing to the first collocated picture, corresponding one or more temporal block vectors are acquired in the first collocated picture of the current block according to the second reference position; when the second reference position is determined by shifting the first reference position according to a motion vector pointing to the second collocated picture, corresponding one or more temporal block vectors are acquired in the second collocated picture of the current block according to the second reference position.

[0271] In an operation 1703, a candidate block vector list for the current block is determined according to the one or more temporal block vectors.

[0272] In some embodiments, the operation of determining the candidate block vector list for the current block according to the one or more temporal block vectors includes: reordering the one or more temporal block vectors to obtain a reordered list; and adding the reordered list into the candidate block vector list.

[0273] In some embodiments, the operation of reordering the one or more temporal block vectors to obtain the reordered list includes: determining a distance reference value between a reference position of each temporal block vector and a specific position of the current block; and reordering the one or more temporal block vectors in ascending order of the distance reference value to obtain the reordered list.

[0274] In some embodiments, the operation of reordering the one or more temporal block vectors to obtain the reordered list includes: determining, based on template matching, a template matching cost value corresponding to each temporal block vector; and reordering the one or more temporal block vectors in ascending order of the template matching cost value to obtain the reordered list.

[0275] In some embodiments, it is determined, according to a value of the third syntax element, whether to perform template matching-based reordering on temporal block vectors. If the value of the third syntax element is a first value, it is determined not to perform template matching-based reordering on temporal block vectors. If the value of the third syntax element is a second value, it is determined to perform template matching-based reordering on temporal block vectors. The third syntax element may be a newly added syntax element or may reuse an existing syntax element. For example, the third syntax element may be a syntax element for specifically controlling template matching of a temporal block vector, or may be a syntax element for uniformly controlling a plurality of template matching techniques.

[0276] In an operation 1704, a prediction block of the current block is determined according to the candidate block vector list.

[0277] In some embodiments, one or more target block vectors for the current block are determined according to the candidate block vector list; one or more reference blocks of the current block are determined according to the one or more target block vectors of the current block; a prediction block of the current block is determined according to the one or more reference blocks of the current block; and a reconstructed block of the current block is determined according to the prediction block of the current block.

[0278] It is to be noted that the candidate block vector list containing temporal block vectors that is generated according to operations of the method provided in the embodiments of the disclosure can be applied to any prediction mode that needs to construct a candidate block vector list, for example, the IBC prediction mode, the IntraTMP prediction mode, etc. The candidate block vector list constructed based on temporal block vectors is used to improve prediction performance of related prediction modes, thereby enhancing encoding efficiency.

[0279] In some embodiments, the candidate block vector list further includes at least one of: a block vector of a reconstructed neighbouring block, a block vector of reconstructed non-neighbouring block, or an auto-relocated block vector.

[0280] It is to be noted that the temporal block vector searched out by the embodiment of the disclosure may be added to any position in the candidate block vector list. For example, the temporal block vector may be added after a block vector of a spatially neighbouring block, after a block vector of a spatially non-neighbouring block, or after an auto-relocated block vector.

[0281] In some embodiments, the operation of determining, according to the first position indication information, the one or more reference positions available for the current block to be encoded in the current picture includes: in a case where it is determined according to a second prediction parameter that a temporal block vector is allowed to be added to the candidate block vector list, a first reference position available for the current block is determined according to the first position indication information.

[0282] Exemplarily, the second prediction parameter includes at least one of: a second syntax element for indicating whether a temporal block vector is allowed to be added to the candidate block vector list, a type of the current picture, whether a collocated picture exists for the current picture, a size parameter of the current block, or a number of temporal block vectors.

[0283] Accordingly, it is determined that the temporal block vector is allowed to be added to the candidate block vector list, according to one or more of: a value of the second syntax element determining that the temporal block vector is allowed to be added to the candidate block vector list, the type of the current picture being an inter picture, the size parameter of the current block being greater than a second threshold, and the number of temporal block vectors being non-zero.

[0284] The second syntax element is a high-level syntax element that controls whether the present scheme is allowed to be used. It can be a syntax element at the sequence level (sequence parameter set, SPS), picture level (picture header), or slice level (slice header).

[0285] Specifically, the current picture type may be a bidirectional prediction picture (such as a B picture), and the current picture type may be a unidirectional prediction picture (such as an I picture or a P picture).

[0286] In some embodiments, the method further includes: encoding an eighth syntax element. Herein, the eighth syntax element is used to indicate whether to encode some or all of the relevant syntax elements of the current block. In some embodiments, the eighth syntax element includes at least one of a sequence-level syntax element, a picture-level syntax element, a slice-level syntax element, a stripe-level syntax element, and a block-level syntax element.

[0287] In some embodiments, the method further includes: in a case where a prediction mode corresponding to the candidate block vector list is used by the current block, a residual block of the current block is determined according to the prediction block and an original block of the current block; and the residual block of the current block is encoded, and encoded bits are signalled.

[0288] With the above technical schemes, at the encoding end, a temporal block vector in a motion information buffer of a collocated picture is added to a candidate block vector list as a newly added candidate block vector, so as to increase a number of candidate block vectors, thereby improving a prediction effect of prediction modes such as IBC mode or IntraTMP mode, and thus improving encoding and decoding efficiency.

[0289] In yet another embodiment of the disclosure, based on the same inventive concept as the preceding embodiments, reference may be made to FIG. 18, which illustrates a schematic structural diagram of an encoder according to an embodiment of the disclosure. As shown in FIG. 18, the encoder 180 may include: a first determination unit 1801 and a first prediction unit 1802.

[0290] The first determination unit 1801 is configured to determine, according to first position indication information, one or more reference positions available for a current block to be encoded in a current picture.

[0291] The first determination unit 1801 is further configured to determine one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions, and determine a candidate block vector list for the current block according to the one or more temporal block vectors.

[0292] The first prediction unit 1802 is configured to determine a prediction block of the current block according to the candidate block vector list.

[0293] The encoder 180 further includes: an encoding unit 1803 configured to: in a case where a prediction mode corresponding to the candidate block vector list is used by the current block, determine a residual block of the current block according to the prediction block and an original block of the current block; and encode the residual block of the current block, and signal encoded bits.

[0294] It is to be understood that each functional unit of the encoder also performs the encoding method of any one of the preceding embodiments.

[0295] It is to be understood that in the embodiments of the disclosure, the "unit" may be a part of a circuit, a part of a processor, a part of a program or software, and the like, or certainly may be a module, or may also be non-modular. Moreover, the respective components in the embodiment may be integrated into one processing unit, or each of the units may exist physically alone, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or a software function module.

[0296] If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this embodiment essentially, or the part that makes a technical contribution relative to the prior art, or all or part of the technical solutions may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor to perform all or part of the operations of the methods described in the embodiments of the disclosure. The storage medium includes various media capable of storing program codes, such as USB flash drive, mobile hard disk, Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk or an optical disk.

[0297] Therefore, an embodiment of the disclosure provides a computer-readable storage medium, which applied to the encoder 180, having stored thereon a computer program that, when executed by a first processor, implements the encoding methods in any one of the embodiments above.

[0298] Referring to FIG. 19, based on the composition of the encoder 180 and the computer-readable storage medium described above, it illustrates a schematic diagram showing a specific hardware structure of a encoder 180 according to an embodiment of the disclosure. As shown in FIG. 19, the encoder 180 may include a first communication interface 1901, a first memory 1902, and a first processor 1903, where the various components are coupled together by a first bus system 1904. It may be understood that, the first bus system 1904 is configured to implement connection and communication between the components. In addition to a data bus, the first bus system 1904 includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the first bus system 1904 in FIG. 19.

[0299] The first communication interface 1901 is configured to receive and send signals in the process of sending and receiving information to or from other external network element(s).

[0300] The first memory 1902 is configured to store a computer program that can be run on the first processor 1903.

[0301] The first processor 1903 is configured to, when running the computer program, perform:

[0302] determining, according to first position indication information, one or more reference positions available for a current block to be encoded in a current picture;

[0303] determining one or more temporal block vectors in one or more collocated pictures of the current block from the one or more reference positions;

[0304] determining a candidate block vector list for the current block according to the one or more temporal block vectors; and

[0305] determining a prediction block of the current block according to the candidate block vector list.

[0306] It is to be understood that the first memory 1902 in the embodiments of the disclosure may be either volatile memory or non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory can be Read-Only Memory (ROM), Programmable ROM (PROM), Erasable Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or Flash memory. The volatile memory can be Random Access Memory (RAM), which serves as an external cache. By way of illustration, but not by way of limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchlink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DR RAM). The first memory 1902 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable type of memory.

[0307] The first processor 1903 of the embodiments of the disclosure may be an integrated circuit chip having signal processing capabilities. In the implementation process, the operations of the above-described methods may be performed by integrated logic circuits of hardware or instructions in the form of software in the first processor 1903. The first processor 1903 may be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The methods, steps, and logical block diagrams disclosed in the embodiments of the disclosure may be implemented or executed. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The steps of the method disclosed in the embodiments of the disclosure may be directly embodied as execution by a hardware decoding processor, or execution by hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable and writable programmable memory, or register, etc. The storage medium is located in the first memory 1902, and the first processor 1903 reads information in the first memory 1902, and performs the operations of the above methods in combination with its hardware.

[0308] It is to be understood that the embodiments described herein may be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field-Programmable Gate Arrays (FPGAs), general-purpose processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described in the disclosure, or a combination thereof. For software implementation, the techniques described herein may be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code may be stored in memory and executed by a processor. The memory may be implemented in the processor or external to the processor.

[0309] Optionally, as another embodiment, the first processor 1903 is further configured to perform the encoding method described in any one of the embodiments above, when executing the computer program.

[0310] The embodiment provides an encoder. In the encoder, a temporal block vector in a motion information buffer of a collocated picture is added to a candidate block vector list as a newly added candidate block vector, so as to increase a number of candidate block vectors, thereby improving a prediction effect of prediction modes such as IBC mode or IntraTMP mode, and thus improving encoding and decoding efficiency.

[0311] An embodiment of the disclosure provides a computer-readable storage medium having stored thereon a bitstream generated by the encoding method in any one of the embodiments above. The bitstream is generated by bit encoding according to information to be encoded.

[0312] In yet another embodiment of the disclosure, based on the same inventive concept as the preceding embodiments, reference may be made to FIG. 20, which illustrates a schematic structural diagram of a decoder according to an embodiment of the disclosure. As shown in FIG. 20, the decoder 200 may include: a second determination unit 2001 and a second prediction unit 2002.

[0313] The second determination unit 2001 is configured to determine, according to first position indication information, one or more reference positions available for a current block to be decoded in a current picture.

[0314] The second determination unit 2001 is further configured to determine one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions, and determine a candidate block vector list for the current block according to the one or more temporal block vectors.

[0315] The second prediction unit 2002 is configured to determine a prediction block of the current block according to the candidate block vector list.

[0316] The decoder 200 further includes: a decoding unit 2003 configured to decode a bitstream to determine a residual block of a current block; and determine a reconstructed block of the current block according to a reference block and the prediction block of the current block.

[0317] It is to be understood that each functional unit of the decoder also performs the decoding method of any one of the preceding embodiments.

[0318] It is to be understood that in the embodiments, the "unit" may be a part of a circuit, a part of a processor, a part of a program or software, and the like, or certainly may be a module, or may also be non-modular. Moreover, the respective components in the embodiment may be integrated into one processing unit, or each of the units may exist physically alone, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or a software function module.

[0319] When the integrated unit is implemented in the form of a software functional module and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, an embodiment of the disclosure provides a computer-readable storage medium, which applied to the decoder 200, having stored thereon a computer program that, when executed by a second processor, implements the decoding methods in any one of the embodiments above.

[0320] Referring to FIG. 21, based on the composition of the decoder 200 and the computer-readable storage medium described above, it illustrates a schematic diagram showing a specific hardware structure of a decoder according to an embodiment of the disclosure. As shown in FIG. 21, the decoder 200 may include a second communication interface 2101, a second memory 2102, and a second processor 2103, where the various components are coupled together by a second bus system 2104. It may be understood that, the second bus system 2104 is configured to implement connection and communication between the components. In addition to a data bus, the second bus system 2104 includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the second bus system 2104 in FIG. 21 .

[0321] The second communication interface 2101 is configured to receive and send signals in the process of sending and receiving information to or from other external network element(s).

[0322] The second memory 2102 is configured to store a computer program that can be run on the second processor 2103.

[0323] The second processor 2103 is configured to, when running the computer program, perform:

[0324] determining, according to first position indication information, one or more reference positions available for a current block to be decoded in a current picture;

[0325] determining one or more temporal block vectors in one or more collocated pictures of the current block from the one or more reference positions;

[0326] determining a candidate block vector list for the current block according to the one or more temporal block vectors; and

[0327] determining a prediction block of the current block according to the candidate block vector list.

[0328] Optionally, as another embodiment, the second processor 2103 is further configured to perform the decoding method described in any one of the embodiments above, when executing the computer program.

[0329] It is to be understood that hardware functions of the second memory 2102 are similar to those of the first memory 1902, and hardware functions of the second processor 2103 are similar to those of the first processor 1903; details are not described again herein.

[0330] The embodiment provides a decoder. In the decoder, a temporal block vector in a motion information buffer of a collocated picture is added to a candidate block vector list as a newly added candidate block vector, so as to increase a number of candidate block vectors, thereby improving a prediction effect of prediction modes such as IBC mode or IntraTMP mode, and thus improving encoding and decoding efficiency.

[0331] An embodiment further provides a computer program product, including a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the encoding method or the decoding method according to any one of the preceding embodiments is performed.

[0332] In yet another embodiment of the disclosure, reference may be made to FIG. 22, which illustrates a schematic structural diagram of an encoding and decoding system provided in an embodiment of the disclosure. As shown in FIG. 22, a coding system 220 may include an encoder 2201 and a decoder 2202.

[0333] In the embodiment of the disclosure, the encoder 2201 may be the encoder described in any one of the preceding embodiments, and the decoder 2202 may be the decoder described in any one of the preceding embodiments.

[0334] It should be noted that in the disclosure, the terms "comprising", "including" or any other variation thereof are intended to cover a non-exclusive inclusion such that a process, method, article or apparatus including a list of elements includes not only those elements, but also other elements not explicitly listed or elements inherent to such a process, method, article or apparatus. An element defined by the phrase 'comprising an / a...' does not, without further restriction, exclude the presence of additional identical elements in a process, method, article, or apparatus that includes the element.

[0335] The above serial numbers of the embodiments of the disclosure are only for the purpose of descriptions, and do not represent advantages and disadvantages of the embodiments.

[0336] The methods disclosed in several method embodiments provided in the disclosure can be arbitrarily combined without conflict to obtain new method embodiments.

[0337] The features disclosed in several product embodiments provided in the disclosure can be arbitrarily combined without conflict to obtain new product embodiments.

[0338] The features disclosed in several method or apparatus embodiments provided in the disclosure can be arbitrarily combined without conflict to obtain new method or apparatus embodiments.

[0339] What described above are only the specific implementations of the disclosure, but the scope of protection of the disclosure is not limited thereto. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the disclosure shall fall within the scope of protection of the disclosure. Therefore, the scope of protection of the disclosure is defined by the scope of protection of the claims. INDUSTRIAL APPLICABILITY

[0340] Embodiments of the disclosure provide an encoding and decoding method, an encoder, a decoder, and a storage medium. Regardless of whether at an encoding side or a decoding side, one 5 or more reference positions available for a current block to be decoded in a current picture are determined according to first position indication information; one or more temporal block vectors are determined in one or more collocated pictures of the current block according to the one or more reference positions; a candidate block vector list for the current block is determined according to the one or more temporal block vectors; and a prediction block of the current block is determined 10 according to the candidate block vector list. In this way, a temporal block vector in a motion information buffer of a collocated picture is added to a candidate block vector list as a newly added candidate block vector, so as to increase a number of candidate block vectors, thereby improving a prediction effect of prediction modes such as IBC mode or IntraTMP mode, and thus improving encoding and decoding efficiency.

Claims

1. A decoding method, applied to a decoder, the method comprising:determining, according to first position indication information, one or more reference positions available for a current block to be decoded in a current picture;determining one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions;determining a candidate block vector list for the current block according to the one or more temporal block vectors; anddetermining a prediction block of the current block according to the candidate block vector list.

2. The method of claim 1, wherein determining, according to the first position indication information, the one or more reference positions available for the current block to be decoded in the current picture comprises:determining a first reference position of the current block according to the first position indication information, and a position and a size parameter of the current block; anddetermining that the first reference position is available in a case where the first reference position is within a first picture range associated with the current block; or,determining that the first reference position is unavailable in a case where the first reference position is outside of the first picture range associated with the current block.

3. The method of claim 2, wherein the first picture range comprises one of: the current block, a current coding tree unit (CTU), a current sub-picture, and the current picture.

4. The method of any one of claims 1 to 3, wherein the first position indication information comprises a first position index, and one or more reference positions indicated by the first position index, wherein the first position index is used to indicate an index order of the reference positions.

5. The method of claim 4, wherein the first position index indicates a primary position and a secondary position, an index order of the primary position preceding an index order of the secondary position.

6. The method of any one of claims 1 to 5, wherein reference positions predefined by the firstposition indication information comprise at least one of: one or more reference positions within the current block, one or more reference positions within a bottom-right region of the current block, or one or more reference positions within a top-left region of the current block.

7. The method of claim 2, wherein determining, according to the first position indication information, the one or more reference positions available for the current block to be decoded in the current picture further comprises:shifting the first reference position according to a motion vector pointing to a first collocated picture to determine a second reference position of the current block, wherein the first collocated picture is any one of the one or more collocated pictures; anddetermining that the second reference position is available in a case where the second reference position is within a second picture range associated with the current block, wherein the second reference position is used to determine one or more temporal block vectors in the first collocated picture; or,determining that the second reference position is unavailable in a case where the second reference position is outside of the second picture range associated with the current block.

8. The method of claim 7, further comprising:in a case where it is determined according to a first prediction parameter that reference position shifting is allowed for the current block, shifting the first reference position according to the motion vector pointing to the first collocated picture to determine the second reference position of the current block.

9. The method of claim 8, wherein the first prediction parameter comprises at least one of: a first syntax element, or the size parameter of the current block,the method further comprises determining that the reference position shifting is allowed for the current block according to at least one of: a value of the first syntax element determining that the reference position shifting is allowed for the current block, or the size parameter being less than a first threshold value.

10. The method of claim 7, further comprising:determining a reconstructed third reference position of the current block according to second position indication information;in a case where the third reference position belongs to an inter block, acquiring one or moremotion vectors and a reference picture index of the third reference position; anddetermining the motion vector pointing to the first collocated picture according to the motion vectors and the reference picture index.

11. The method of claim 10, wherein the second position indication information comprises a second position index, and one or more reference positions indicated by the second position index, wherein the second position index is used to indicate an index order of the reference positions.

12. The method of claim 11, wherein reference positions predefined by the second position indication information comprise at least one of: a reconstructed reference position in the current picture, or a reconstructed reference position in a reference picture of the current block,wherein the reconstructed reference position in the current picture comprises at least one of: a neighbouring reference position or a non-neighbouring reference position of the current block; and the reconstructed reference position in the reference picture comprises at least one of: a neighbouring reference position or a non-neighbouring block reference position of a reference block corresponding to the current block.

13. The method of claim 10, wherein determining the motion vector pointing to the first collocated picture according to the motion vectors and the reference picture index comprises:in a case where a reference picture indicated by the reference picture index is the first collocated picture of the current picture, determining the motion vector as the motion vector pointing to the first collocated picture; or,in a case where the reference picture indicated by the reference picture index is not the first collocated picture of the current picture, converting a motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture to obtain a reference position shifting amount of the first collocated picture.

14. The method of claim 13, wherein converting the motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture comprises:determining a first difference between picture order counts (POCs) of the current picture and the reference picture according to the POC of the current picture and the POC of the reference picture;determining a second difference between POCs of the current picture and the first collocated picture according to the POC of the current picture and the POC of the first collocated picture; andconverting the motion vector pointing to the reference picture according to the first difference and the second difference to obtain the motion vector pointing to the first collocated picture.

15. The method of claim 14, wherein the reference picture comprises a first reference picture located in a same temporal direction as the first collocated picture, or a second reference picture located in an opposite temporal direction to the first collocated picture.

16. The method of any one of claims 1 to 15, wherein determining the candidate block vector list for the current block according to the one or more temporal block vectors comprises:reordering the one or more temporal block vectors to obtain a reordered list; and adding the reordered list into the candidate block vector list.

17. The method of claim 16, wherein reordering the one or more temporal block vectors to obtain the reordered list comprises:determining a distance reference value between a reference position of each temporal block vector and a specific position of the current block; andreordering the one or more temporal block vectors in ascending order of the distance reference value to obtain the reordered list;or,determining, based on template matching, a template matching cost value corresponding to each temporal block vector; andreordering the one or more temporal block vectors in ascending order of the template matching cost value to obtain the reordered list.

18. The method of any one of claims 1 to 17, wherein determining, according to the first position indication information, the one or more reference positions available for the current block to be decoded in the current picture comprises:in a case where it is determined according to a second prediction parameter that a temporal block vector is allowed to be added to the candidate block vector list, determining, according to the first position indication information, a first reference position available for the current block.

19. The method of claim 18, wherein the second prediction parameter comprises at least one of: a second syntax element for indicating whether a temporal block vector is allowed to be added to the candidate block vector list, a type of the current picture, whether a collocated picture exists for thecurrent picture, a size parameter of the current block, or a number of temporal block vectors,the method further comprises:determining that the temporal block vector is allowed to be added to the candidate block vector list, according to one or more of: a value of the second syntax element determining that the temporal block vector is allowed to be added to the candidate block vector list, the type of the current picture being an inter picture, the size parameter of the current block being greater than a second threshold, and the number of temporal block vectors being non-zero.

20. The method of claim 1, wherein the candidate block vector list further comprises at least one of: a block vector of a reconstructed neighbouring block, a block vector of reconstructed non-neighbouring block, or an auto-relocated block vector.

21. An encoding method, applied to an encoder, the method comprising:determining, according to first position indication information, one or more reference positions available for a current block to be encoded in a current picture;determining one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions;determining a candidate block vector list for the current block according to the one or more temporal block vectors; anddetermining a prediction block of the current block according to the candidate block vector list.

22. The method of claim 21, wherein determining, according to the first position indication information, the one or more reference positions available for the current block to be encoded in the current picture comprises:determining a first reference position of the current block according to the first position indication information, and a position and a size parameter of the current block; andusing the first reference position as an available reference position in a case where the first reference position is within a first picture range associated with the current block; or,determining that the first reference position is unavailable in a case where the first reference position is outside of the first picture range associated with the current block.

23. The method of any one of claims 21 to 22, wherein the first position indication information comprises a first position index, and one or more reference positions indicated by the first positionindex, wherein the first position index is used to indicate an index order of the reference positions.

24. The method of any one of claims 21 to 23, wherein a plurality of reference positions predefined by the first position indication information comprise at least one of: one or more reference positions within the current block, one or more reference positions within a bottom-right region of the current block, or one or more reference positions within a top-left region of the current block.

25. The method of claim 22, wherein determining, according to the first position indication information, the one or more reference positions available for the current block to be encoded in the current picture further comprises:shifting the first reference position according to a motion vector pointing to a first collocated picture to determine a second reference position of the current block, wherein the first collocated picture is any one of the one or more collocated pictures; anddetermining that the second reference position is available in a case where the second reference position is within a second picture range associated with the current block, wherein the second reference position is used to determine one or more temporal block vectors in the first collocated picture; or,determining that the second reference position is unavailable in a case where the second reference position is outside of the second picture range associated with the current block.

26. The method of claim 25, further comprising:determining a reconstructed third reference position of the current block according to second position indication information;in a case where the third reference position belongs to an inter block, acquiring one or more motion vectors and a reference picture index of the third reference position; anddetermining the motion vector pointing to the first collocated picture according to the motion vectors and the reference picture index.

27. The method of claim 26, wherein determining the motion vector pointing to the first collocated picture according to the motion vectors and the reference picture index comprises:in a case where a reference picture indicated by the reference picture index is the first collocated picture of the current picture, determining the motion vector as the motion vector pointing to the first collocated picture; or,in a case where the reference picture indicated by the reference picture index is not the firstcollocated picture of the current picture, converting a motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture to obtain a reference position shifting amount of the first collocated picture.

28. The method of any one of claims 21 to 27, wherein determining the candidate block vector list for the current block according to the one or more temporal block vectors comprises:reordering the one or more temporal block vectors to obtain a reordered list; andadding the reordered list into the candidate block vector list.

29. The method of any one of claims 21 to 28, wherein determining, according to the first position indication information, the one or more reference positions available for the current block to be encoded in the current picture comprises:in a case where it is determined according to a second prediction parameter that a temporal block vector is allowed to be added to the candidate block vector list, determining, according to the first position indication information, a first reference position available for the current block.

30. The method of claim 29, wherein the second prediction parameter comprises at least one of: a second syntax element for indicating whether a temporal block vector is allowed to be added to the candidate block vector list, a type of the current picture, whether a collocated picture exists for the current picture, a size parameter of the current block, or a number of temporal block vectors,the method further comprises:determining that the temporal block vector is allowed to be added to the candidate block vector list, according to one or more of: a value of the second syntax element determining that the temporal block vector is allowed to be added to the candidate block vector list, the type of the current picture being an inter picture, the size parameter of the current block being greater than a second threshold, and the number of temporal block vectors being non-zero.

31. The method of any one of claims 21 to 30, further comprising:in a case where a prediction mode corresponding to the candidate block vector list is used by the current block, determining a residual block of the current block according to the prediction block and an original block of the current block; andencoding the residual block of the current block, and signalling encoded bits.

32. An encoder, comprising a first determination unit and a first prediction unit,wherein the first determination unit is configured to determine, according to first position indication information, one or more reference positions available for a current block to be encoded in a current picture;the first determination unit is further configured to determine one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions, and determine a candidate block vector list for the current block according to the one or more temporal block vectors; andthe first prediction unit is configured to determine a prediction block of the current block according to the candidate block vector list.

33. An encoder, comprising a first memory and a first processor,wherein the first memory is configured to store a computer program executable on the first processor; andthe first processor is configured to perform the method of any one of claims 21 to 31 when executing the computer program.

34. A decoder, comprising a second determination unit and a second prediction unit,wherein the second determination unit is configured to determine, according to first position indication information, one or more reference positions available for a current block to be decoded in a current picture;the second determination unit is further configured to determine one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions, and determine a candidate block vector list for the current block according to the one or more temporal block vectors; andthe second prediction unit is configured to determine a prediction block of the current block according to the candidate block vector list.

35. A decoder, comprising a second memory and a second processor,wherein the second memory is configured to store a computer program executable on the second processor; andthe second processor is configured to perform the method of any one of claims 1 to 20 when executing the computer program.

36. A computer-readable storage medium having stored thereon a computer program that, when executed, implements the method of any one of claims 1 to 20, or implements the method of any one of claims 21 to 31.