Encoding method, decoding method, bitstream, encoder, decoder, and storage medium
By using temporal candidate block vectors from collocated pictures to construct merge lists, the inefficiencies in IntraTMP and IBC technologies are addressed, improving prediction accuracy and coding efficiency.
Patent Information
- Application Number
- AU2024437963
- Authority / Receiving Office
- AU · AU
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-25
- Publication Date
- 2026-11-05
AI Technical Summary
Existing video coding standards face inefficiencies due to insufficient candidate merge lists in intra template matching prediction (IntraTMP) and intra block copy (IBC) technologies, leading to poor prediction performance and reduced coding efficiency.
The proposed solution involves determining at least one collocated picture of a current block and constructing a candidate merge list based on one or more temporal candidate block vectors (BVs) from these pictures, which are used as candidate items in the merge list.
This approach effectively alleviates the issue of incomplete candidate merge lists and improves prediction accuracy without increasing software or hardware complexity, thereby enhancing coding efficiency.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
TECHNICAL FIELD
[0001] This disclosure relates to the field of video coding technology, in particular to an encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium. BACKGROUND
[0002] With the increasing demand for video display quality, high-resolution videos such as high-definition videos and ultra-high-definition videos have emerged. However, high-resolution videos usually contain more information and thus require more bandwidth. To reduce bandwidth requirements, video coding standards involving video compression have been introduced.
[0003] In video coding standards, for both an intra template matching prediction (IntraTMP) technology and an intra block copy (IBC) technology, prediction is performed based on a constructed candidate merge list. However, during construction of a candidate merge list, existing block vectors (BVs) are often insufficient to make the candidate merge list full, which results in insufficient candidate information and thus poor prediction performance, thereby reducing coding efficiency. SUMMARY
[0004] An encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium are provided in the disclosure, which can not only alleviate the problem that a candidate merge list is not full, but also improve prediction accuracy, thereby improving coding efficiency.
[0005] Technical solutions of the disclosure can be implemented as follows.
[0006] In a first aspect, a decoding method is provided in embodiments of the disclosure. The method is applied to a decoder. The method includes the following. At least one collocated picture of a current block is determined. One or more temporal candidate block vectors (BVs) of the current block are determined according to the at least one collocated picture. A candidate merge list is constructed based on the one or more temporal candidate BVs.
[0007] In a second aspect, an encoding method is provided in embodiments of the disclosure. The method is applied to an encoder. The method includes the following. At least one collocated picture of a current block is determined. One or more temporal candidate BVs of the current block are determined according to the at least one collocated picture. A candidate merge list is constructed based on the one or more temporal candidate BVs.
[0008] In a third aspect, a bitstream is provided in embodiments of the disclosure. The bitstream is generated through bit encoding based on information to be encoded. The information to be encoded includes at least one of: a residual value of a current block, a collocated-picture index of the current block, or a value of a first syntax element. The first syntax element indicates whether a temporal candidate BV is used as a candidate item for constructing a candidate merge list for the current block.
[0009] In a fourth aspect, an encoder is provided in embodiments of the disclosure. The encoder includes a first determining unit and a first construction unit. The first determining unit is configured to determine at least one collocated picture of a current block, and determine one or more temporal candidate BVs of the current block according to the at least one collocated picture. The first construction unit is configured to construct a candidate merge list based on the one or more temporal candidate BVs.
[0010] In a fifth aspect, an encoder is provided in embodiments of the disclosure. The encoder includes a first memory and a first processor. The first memory is configured to store a computer program executable on a first processor. The first processor is configured to, when executing the computer program, perform the method in the second aspect.
[0011] In a sixth aspect, a decoder is provided in embodiments of the disclosure. The decoder includes a second determining unit and a second construction unit. The second determining unit is configured to determine at least one collocated picture of a current block, and determine one or more temporal candidate BVs of the current block according to the at least one collocated picture. The second construction unit is configured to construct a candidate merge list based on the one or more temporal candidate BVs.
[0012] In a seventh aspect, a decoder is provided in embodiments of the disclosure. The decoder includes a second memory and a second processor. The second memory is configured to store a computer program executable on a second processor. The second processor is configured to, when executing the computer program, perform the method in the first aspect.
[0013] In an eighth aspect, a computer-readable storage medium is provided in embodiments of the disclosure. The computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement the method in the first aspect or the method in the second aspect.
[0014] In a ninth aspect, a computer program product is provided in embodiments of the disclosure. The computer program product includes a computer program or instructions which, when executed by a processor, cause the processor to implement the method in the first aspect or the method in the second aspect.
[0015] In embodiments of the disclosure, an encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium are provided. Whether for an encoding end or a decoding end, the at least one collocated picture of the current block is first determined, the one or more temporal candidate BVs of the current block are determined according to the at least one collocated picture, and then the candidate merge list is constructed based on the one or more temporal candidate BVs. That is, in the encoding method and the decoding method provided in embodiments of the disclosure, during construction of the candidate merge list, the one or more temporal candidate BVs are considered as candidate items in the candidate merge list, which can not only effectively alleviate the problem that the candidate merge list is not full, but also improve prediction accuracy with the candidate merge list, without introducing additional software and hardware implementation complexity, thereby improving coding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] FIG. 1 is a first schematic diagram illustrating template matching in an IntraTMP technology.
[0017] FIG. 2 is a schematic diagram illustrating determination of a matching block of a current block.
[0018] FIG. 3A is a second schematic diagram illustrating template matching in an IntraTMP technology.
[0019] FIG. 3B is a third schematic diagram illustrating template matching in an IntraTMP technology.
[0020] FIG. 4 is a schematic diagram illustrating adjacent positions and non-adjacent positions of a current block.
[0021] FIG. 5 is a schematic diagram illustrating relocating a new position according to a block vector (BV).
[0022] FIG. 6 is a schematic diagram illustrating searching for a BV according to multiple positions in a reference block.
[0023] FIG. 7 is a schematic diagram illustrating a network architecture of video coding provided in embodiments of the disclosure.
[0024] FIG. 8 is a schematic block diagram of a system of an encoder provided in embodiments of the disclosure.
[0025] FIG. 9 is a schematic block diagram of a system of a decoder provided in embodiments of the disclosure.
[0026] FIG. 10 is a first schematic flowchart of a decoding method provided in embodiments of the disclosure.
[0027] FIG. 11 is a schematic diagram illustrating searching for a reference position of a current block according to a collocated picture provided in embodiments of the disclosure.
[0028] FIG. 12 is a second schematic flowchart of a decoding method provided in embodiments of the disclosure.
[0029] FIG. 13 is a schematic diagram illustrating five candidate positions of a current block provided in embodiments of the disclosure.
[0030] FIG. 14 is a third schematic flowchart of a decoding method provided in embodiments of the disclosure.
[0031] FIG. 15 is a fourth schematic flowchart of a decoding method provided in embodiments of the disclosure.
[0032] FIG. 16 is a first schematic flowchart of an encoding method provided in embodiments of the disclosure.
[0033] FIG. 17 is a second schematic flowchart of an encoding method provided in embodiments of the disclosure.
[0034] FIG. 18 is a schematic structural diagram of an encoder provided in embodiments of the disclosure.
[0035] FIG. 19 is a schematic diagram of a specific hardware structure of an encoder provided in embodiments of the disclosure.
[0036] FIG. 20 is a schematic structural diagram of a decoder provided in embodiments of the disclosure.
[0037] FIG. 21 is a schematic diagram of a specific hardware structure of a decoder provided in embodiments of the disclosure.
[0038] FIG. 22 is a schematic structural diagram of an encoding and decoding system provided in embodiments of the disclosure. DETAILED DESCRIPTION
[0039] In order to understand characteristics and technical contents of embodiments of the disclosure more thoroughly, implementations of embodiments of the disclosure will be described in detail below with reference to the drawings. The drawings are only for reference and explanation, and are not intended to limit embodiments of the disclosure.
[0040] Unless otherwise defined, all technical and scientific terms used here have the same meanings as those usually understood by technicians in the technical field to which the disclosure belongs. The terms used herein are only for the purpose of describing embodiments of the disclosure, and are not intended to limit the disclosure.
[0041] In the following descriptions, reference is made to “some embodiments” which describe a subset of all possible embodiments; however, it may be understood that “some embodiments” may be the same or different subsets of all possible embodiments, and may be combined with each other without conflict. It can also be pointed out that terms “first / second / third” involved in embodiments of the disclosure are only intended to distinguish similar objects and do not represent a specific sequence of the objects. It may be understood that “first / second / third” may be interchanged in a specific order or sequence if allowable, such that embodiments of the disclosure described here may be implemented in an order besides that illustrated or described here.
[0042] Nouns and terms involved in embodiments of the disclosure are described first before further describing embodiments of the disclosure in detail. The nouns and terms involved in embodiments of the disclosure are applicable to the following explanations: coding block (CB); block matching (BM); motion vector (MV); block vector (BV); adjacent block vector (spatial BV); non-adjacent block vector (non-adjacent BV); history block vector prediction (HBVP); auto-relocated block vector prediction (ARBVP); collocated picture; sum of absolute difference (SAD); sum of absolute transformed difference (SATD); mean square error (MSE); sum of squared differences (SSD); mean absolute deviation (MAD); mean square differences (MSD); H.266 / versatile video coding (VVC); VVC test model (VTM), a reference software testing platform for VVC; intra block copy (IBC); intra template matching prediction (IntraTMP); and enhanced compression model (ECM), a reference software testing platform beyond VVC.
[0043] The following is a brief introduction to the IntraTMP technology and the intra block copy technology in the related art.
[0044] (1)Intra template matching prediction (IntraTMP) technology
[0045] The IntraTMP technology, referred to as “IntraTMP technology” for short, is a special intra prediction coding tool, which is mainly applied to screen content coding. The IntraTMP is mainly implemented through the following procedure: an L-shaped portion of reconstructed samples adjacent to a current block is selected as a template, the most similar template is searched for in a given reconstructed region of a current picture, and a reconstructed block corresponding to the most similar template is used as a matching block (or referred to as “reference block”), to obtain a prediction block of the current block. As illustrated in FIG. 1, R1 to R4 in FIG. 1 are available IntraTMP search regions, in which a matching block is searched for sample by sample in a raster scan order.
[0046] In addition, as illustrated in FIG. 2, the matching block can be represented by a BV pointing from the current block to the matching block, and a similarity between templates is represented by a magnitude of a template error value. A smaller template error value indicates a higher similarity. For example, the template error value is calculated by using an SAD, and a smaller SAD indicates a more similar template.
[0047] In the disclosure, a codec indicates, by a flag intra_tmp_flag, whether the current block is encoded in an IntraTMP mode. If the current block is encoded in the IntraTMP mode, the same template matching procedure is performed at a decoding end to obtain the same prediction block at the decoding end, without the need to additionally encode information of the BV pointing from the current block to the matching block.
[0048] (2) IntraTMP adaption for camera-captured content technology
[0049] Based on the existing IntraTMP technology, in IntraTMP adaptation for camera-captured content technology, template matching by step size S (i.e., template matching is performed every S samples in a horizontal direction or a vertical direction, where S > 1) is proposed, as illustrated in FIG. 3A. For example, in a search region, a matching block is searched for through sub-sampling in the horizontal direction or the vertical direction of the search region, instead of searching for the matching block sample by sample through raster scan. Exemplarily, if a BV currently used for template matching is (X0, Y0), a next BV for template matching can be (X0+S, Y0), and a vertical ordinate of a BV for template matching in the next row can be Y0+S. In addition, the template matching procedure can be divided into multiple rounds, and a search step size for each round can be different. For example, as illustrated in FIG. 3B, after the first round of search by step size S is completed, a range for the next round of search (e.g., in the neighboring regions of the first N matching blocks with the smallest template errors) can be determined according to matching results (e.g., taking the first N matching blocks with the smallest template errors), and template matching is performed by a smaller step size S', where 1 < S < S, thereby optimizing the matching results. This technology can effectively reduce the complexity of the IntraTMP mode while maintaining relatively good coding efficiency. As illustrated in FIG. 3A and FIG. 3B, grid-filled regions represent template regions, arrows represent BVs, and dashed boxes represent matching blocks.
[0050] (3) Multi-candidate IntraTMP technology
[0051] In a given search region, there may be multiple reference blocks similar to the current block. With the template matching technology, a target block may not be accurately found simply by comparing cost values of the template regions. Therefore, finding multiple candidate matching blocks from reference regions can improve the robustness of the search.
[0052] In the multi-candidate IntraTMP technology, N candidate matching blocks are found in the reference regions through template matching, in other words, a candidate block list with a length of N is constructed, and candidate blocks in the list may be sorted according to template error values between the candidate blocks and the current block. According to indices, a specific candidate block is selected from the list as a final prediction block. For a coding block to which the multi-candidate IntraTMP technology is applied, after an IntraTMP flag intra_tmp_flag is decoded as true, intra_tmp_idx is further decoded, where 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 }
[0053] In a possible implementation, the template matching procedure for constructing the candidate block list is as follows.
[0054] In a first step, the first round of search is performed by a certain step size, for example, a horizontal step size and a vertical step size are both 4, to find N best matching blocks with certain intervals (the first N matching blocks with smallest template error values).
[0055] In a second step, the second round of search is performed in neighboring regions of the N matching blocks found in the first step. These neighboring regions may be set as multiple non-overlapping regions according to the step size in the first step, to find M best matching blocks (which may include the matching blocks found in the first step) from the neighboring regions.
[0056] The same construction procedure is used at both the encoding end and the decoding end, to obtain the same candidate block list.
[0057] intra_tmp_idx can be encoded through fixed-length coding or variable-length coding, for example, through truncated binary coding.
[0058] In a possible implementation, a method for variable-length coding is as follows.
[0059] A smaller index (a smaller value of intra_tmp_idx) corresponds to a smaller template error value of a corresponding candidate block and higher probability of being selected statistically. A shorter bin may be assigned to a smaller intra_tmp_idx, as illustrated in Table 1. Table 1 intra tmp idx Binary symbol 0 1 1 0 1 2 0 0 Bin index 0 1
[0060] If the maximum value N of intra_tmp_idx is relatively large, a bin of the same length may be assigned to the relatively large intra_tmp_idx. For example, in the ECM-11.0 reference software, N is 15, as illustrated in Table 2. Table 2 Intra tmp idx 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
[0061] In Table 2 above, x can be obtained by using truncated binary.
[0062] (4) Other features included in the IntraTMP technology
[0063] In addition to the general features described above, the IntraTMP technology may further include the following features.
[0064] A. Sub-sample-based IntraTMP
[0065] In this feature, one or more integer-sample precision candidate blocks are found through template matching, and interpolation is further performed based on integer-sample precision, to find a sub-sample precision candidate target. When the sub-sample precision candidate target is selected, a selected sub-sample precision is identified by a corresponding identifier (ID) in a syntax element. For example, in ECM-11.0, the sub-sample precision may be 1 / 4 sample precision, 1 / 2 sample precision, or 3 / 4 sample precision.
[0066] B. Fusion of multiple candidate blocks
[0067] In this feature, multiple candidate blocks found through template matching are weighted, to obtain a weighted prediction block as a prediction value of a current block to be predicted. For example, in ECM-11.0, candidate blocks used for weighting are the multiple candidate blocks obtained in (3) above, and weights for weighting can be adaptively calculated by using a template of each weighted candidate block.
[0068] C. Luma compensation of the IntraTMP technology
[0069] Similar to an inter local illumination compensation (LIC) technology, in this feature, a linear model or a system of linear equations is constructed by using an L-shaped region around a candidate matching block and an L-shaped region around the current block, and parameters of the linear model or parameters of the system of equations are derived therefrom, for compensating a candidate block. The compensated candidate block is then determined as the prediction block of the current block.
[0070] (5) Intra block copy (IBC) technology
[0071] The IBC technology is an intra prediction technology in which prediction samples are obtained based on block matching. IBC is similar to inter prediction in that prediction is implemented by using a BV pointing from the current block to a reference block, with a difference that a reference block for inter prediction comes from an encoded reconstructed portion of a reference picture, while the reference block for IBC comes from an encoded reconstructed portion of the current picture. Information of the BV needs to be transmitted via the bitstream. As such, similar to intra prediction, IBC includes an IBC-advanced motion vector prediction (AMVP) mode and an IBC-Merge mode.
[0072] In the IBC-AMVP mode, a prediction BV is obtained from a constructed merge candidate list, and a reference block of the current block and a corresponding final BV are obtained through hash search, full search, etc. The final BV is encoded according to the prediction BV, thereby improving the encoding efficiency.
[0073] In the IBC-Merge mode, prediction is performed through a constructed candidate merge list, and the candidate merge list may include encoding information such as encoded blocks at adjacent and non-adjacent positions, history encoded blocks, and averages of candidate BVs. After the candidate merge list is constructed, the list can be reordered according to a template error value of each candidate in the list. A template error value can be obtained according to an error value (e.g., an SAD value) between a template of a reference block of each candidate and the template of the current block.
[0074] (6) IntraTMP with merge candidates
[0075] Since both inter prediction and IBC technology have their own merge modes, for the IntraTMP technology, a technology of constructing a candidate merge list as an enhancement to the multi-matching block list in (3) above has also been adopted into the ECM-12.0 reference software.
[0076] The IntraTMP with merge candidates (also referred to as “IntraTMP-Merge”) technology is similar to the IBC-Merge mode. For both of them, whether a corresponding mode is used can be predicted based on BVs used for encoded blocks in regions (left, top-left, bottomleft, top, top-right regions) around the current block. Specifically, similar to the IBC-Merge mode, encoded blocks at adjacent and non-adjacent positions, and history encoded blocks may be included.
[0077] In addition, IntraTMP-Merge can further include features similar to those of IBC-Merge, such as reordering the candidate merge list according to error values between templates of reference blocks and the template of the current block.
[0078] (7) Similarities and differences between IntraTMP-Merge and IBC-Merge
[0079] A. Similarities in constructing the candidate merge list:
[0080] © Both include a process of searching whether an available BV is present in five spatially adjacent positions; and
[0081] © Both include a process of searching whether an available BV is present in spatially non-adjacent positions.
[0082] B. Differences in constructing the candidate merge list:
[0083] © The spatially non-adjacent positions and the number of positions for search are different; and
[0084] © In IBC, information of history BVs is further included.
[0085] (8) Types of BVs in IntraTMP-Merge and IBC-Merge
[0086] BVs used for constructing a BV candidate merge list include: adjacent BVs, non adjacent BVs, history BVs, and auto-relocated BVs, etc. For adjacent BVs and non-adjacent BVs, reference can be made to several adjacent positions and non-adjacent positions of the current block in FIG. 4. If BVs are present in the adjacent positions, the BVs are determined as the adjacent BVs. If BVs are present in the non-adjacent positions, the BVs are determined as the non-adjacent BVs. As illustrated in FIG. 4, a small dot-filled block is the current block, positions labelled 1-5 are referred to as adjacent position candidates, and the remaining labeled positions are referred to as non-adjacent position candidates.
[0087] A history BV refers to a BV that is recorded and updated in a table of length N according to an encoding and decoding order.
[0088] In auto-relocated block vector prediction (AR-BVP) technology, a method for constructing a new BV by using a BV of a reference block is proposed. Exemplarily, a guiding BV (BV0,1) is determined for a current block B0, and a reference block B1 is determined according to BV0,1. If the reference block B1 has a BV (BV1,2) (an MV corresponding to a block with the highest similarity in neighboring regions of B1, or an MV corresponding to the best template-matching block), a new BV (BV0,2), given by BV0,2 = BV0,1 + BV1,2, can be constructed as a candidate BV of the current block. Recursively (with a stopping condition such as reaching a certain recursion depth, a block error corresponding to the newly constructed BV being less than a threshold, exceeding a preset region, meeting a maximum recursion time, etc.), a reference block Bn can be determined according to BV0,n. If Bn has a BV (BVn,n+1), a new BV (BV0,n+1), given by BV0,n+1 = BV0,1 + BV1,2 + —+ BVn,n+1, can be constructed, as illustrated in FIG. 5.
[0089] During determination of BVn,n+1 corresponding to the reference block Bn, multiple positions can be checked. For example, the center, top-left, top-right, bottom-left, and bottomright of the reference block are sequentially checked for the presence of an encoded block predicted in the IBC mode or the IntraTMP mode. If such an encoded block is present, a BV stored in the encoded block is taken as BVn,n+1, as illustrated in FIG. 6. In FIG. 6, CTR represents a center position of the reference block, LB represents a bottom-left position of the reference block, RB represents a bottom-right position of the reference block, LT represents a top-left position of the reference block, and RT represents a top-right position of the reference block.
[0090] In summary, during construction of the candidate merge list for IntraTMP and IBC, it is common in the related art that the candidate merge list cannot be fully filled by existing BVs, which leads to poor performance of the merge mode due to a lack of sufficient candidate information, thereby reducing coding efficiency.
[0091] Based on this, an encoding method and a decoding method are provided in embodiments of the disclosure. At least one collocated picture of a current block is first determined, one or more temporal candidate BVs of the current block are determined according to the at least one collocated picture, and then a candidate merge list is constructed based on the one or more temporal candidate BVs. That is, in the encoding method and the decoding method provided in embodiments of the disclosure, during construction of the candidate merge list, the one or more temporal candidate BVs are considered as candidate items in the candidate merge list, which can not only effectively alleviate the problem that the candidate merge list is not full, but also improve prediction accuracy with the candidate merge list, without introducing additional software and hardware implementation complexity, thereby improving coding efficiency and coding performance.
[0092] Various embodiments of the disclosure will be described in detail below with reference to the accompanying drawings.
[0093] FIG. 7 is a schematic diagram of a network architecture for video encoding and decoding provided in embodiments of the disclosure. As illustrated in FIG. 7, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01. Here, the electronic devices 13 to 1N may perform video interaction through the communication network 01. The electronic devices may be various types of devices with video encoding and decoding functions during implementation. For example, the electronic devices may include a mobile phone, a tablet computer, a personal computer, a personal digital assistant (PDA), a navigator, a digital phone, a video phone, a television, a sensor device, a server, etc., which are not limited in embodiments of the disclosure.
[0094] In embodiments of the disclosure, a network architecture of a video encoding and decoding system configured to perform a decoding method and an encoding method is provided. The decoder or the encoder in embodiments of the disclosure may be the electronic device mentioned above. In other words, the electronic devices in embodiments of the disclosure have video encoding and decoding functions, and generally include a video encoder (i.e., the encoder) and a video decoder (i.e., the decoder).
[0095] FIG. 8 is a schematic block diagram of an encoder provided in embodiments of the disclosure. As illustrated in FIG. 8, an encoder 100 may include a partitioning unit 101, a prediction unit 102, a first adder 107, a transform unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transform unit 111, a second adder 112, a filtering unit 113, a decoded picture buffer (DPB) unit 114, and an entropy coding unit 115. An input of the encoder 100 may be a video consisting of a series of pictures or a static picture. An output of the encoder 100 may be a stream of bits (also referred to as “bitstream”) representing a compressed version of the input video.
[0096] The partitioning unit 101 may partition a picture of the input video into one or more coding tree units (CTUs). The partitioning unit 101 may split the picture into multiple picture blocks (also referred to as tiles), and may further split a tile into one or more bricks. Here, a tile or a brick may include one or more complete and / or partial CTUs. In addition, the partitioning unit 101 may form one or more slices, where a slice may include one or more tiles in the picture arranged in a raster order, or one or more tiles covering a rectangular region in the picture. The partitioning unit 101 may further form one or more sub-pictures, where a sub-picture may include one or more slices, tiles, or bricks.
[0097] In an encoding process by the encoder 100, the partitioning unit 101 may transmit a CTU to the prediction unit 102. In general, the prediction unit 102 may be composed of a block partitioning unit 103, a motion estimation (ME) unit 104, a motion compensation (MC) unit 105, and an intra prediction unit 106. Specifically, the block partitioning unit 103 further partitions the input CTU into smaller coding units (CUs) by iteratively using quadtree partitioning, binary tree partitioning, and ternary tree partitioning. The prediction unit 102 may obtain an inter prediction block of a CU using the ME unit 104 and the MC unit 105. The intra prediction unit 106 may obtain an intra prediction block of a CU using various intra prediction modes including a matrixbased intra prediction (MIP) mode. In an example, a motion estimation mode based on rate distortion optimization (RDO) may be invoked by the ME unit 104 and the MC unit 105 to obtain an inter prediction block. A determination manner of a mode based on RDO may be invoked by the intra prediction unit 106 to obtain an intra prediction block. The prediction unit 102 may output a prediction block of a CU. The first adder 107 may calculate a difference between a CU in the output of the partitioning unit 101 and a prediction block of the CU, i.e., residual CU. The transform unit 108 may read the residual CU and perform one or more transforms on the residual CU to obtain coefficients. The quantization unit 109 may quantize the coefficients and output the quantization coefficients (i.e., levels). The inverse quantization unit 110 may scale the quantization coefficients to output reconstructed coefficients. The inverse transform unit 111 may perform one or more inverse transforms corresponding to the one or more transforms in the transform unit 108 and output a reconstructed residual. The second adder 112 may calculate a reconstructed CU by adding the reconstructed residual and the prediction block of the CU from the prediction unit 102. The second adder 112 may further send an output of the second adder to the prediction unit 102 as a reference for intra prediction. After all the CUs in a picture or sub-picture have been reconstructed, the filtering unit 113 may perform inloop filtering on the reconstructed picture or sub-picture. Here, the filtering unit 113 may include one or more filters such as a deblocking filter, a sample adaptive offset (SAO) filter, an adaptive loop filter (ALF), a luma mapping with chroma scaling (LMCS) filter, a filter based on a neural network, etc. Alternatively, when the filtering unit 113 determines that a CU is not used as a reference for coding another CU, the filtering unit 113 may perform in-loop filtering on one or more target samples in the CU. An output of the filtering unit 113 may be a decoded picture or sub-picture. The decoded picture or sub-picture may be cached in the DPB unit 114. The DPB unit 114 may output the decoded picture or sub-picture based on timing and control information. Here, a picture stored in the DPB unit 114 may further be used as a reference for inter prediction or intra prediction performed by the prediction unit 102. Finally, the entropy coding unit 115 may convert a parameter (such as a control parameter, supplemental information, etc.) required for decoding a picture from the encoder 100 into a binary form, and signal the binary form into the bitstream according to a syntax structure of each data unit. That is, the encoder 100 outputs a final bitstream.
[0098] Further, the encoder 100 may have a first processor and a first memory recording a computer program. When the first processor reads and runs the computer program, the encoder 100 may read an input video and generate a bitstream corresponding to the input video. In addition, the encoder 100 may further be a computing device having one or more chips. Units implemented as integrated circuits on a chip may have functions of connection and data exchange similar to those of respective units in FIG. 8.
[0099] FIG. 9 is a schematic block diagram of a decoder provided in embodiments of the disclosure. As illustrated in FIG. 9, the decoder 200 may include a parsing unit 201, a prediction unit 202, an inverse quantization unit 205, an inverse transform unit 206, an adder 207, a filtering unit 208, and a DPB unit 209. An input of the decoder 200 may be a bitstream representing a compressed version of a video or a static picture. An output of the decoder 200 may be a decoded video consisting of a series of pictures or a decoded static picture.
[0100] The input bitstream of the decoder 200 may be a bitstream generated by the encoder 100. The parsing unit 201 may parse the input bitstream and obtain a value of at least one syntax element from the input bitstream. The parsing unit 201 may convert a binary representation of the syntax element into a numerical value and send the numerical value to a unit in the decoder 200 to obtain one or more decoded pictures. The parsing unit 201 may further parse the input bitstream to obtain one or more syntax elements for displaying a decoded picture.
[0101] In a decoding process by the decoder 200, the parsing unit 201 may send the value of the at least one syntax element and one or more variables to a unit in the decoder 200, where the one or more variables may be set or determined according to the value of the at least one syntax element and configured to obtain one or more decoded pictures. The prediction unit 202 may determine a prediction block of a current coding block (such as a CU). The prediction unit 202 may include an MC unit 203 and an intra prediction unit 204. Specifically, when it is indicated that an inter prediction mode is used to decode the current coding block, the prediction unit 202 may transmit relevant parameters sent by the parsing unit 201 to the MC unit 203 to obtain an inter prediction block. When it is indicated that an intra prediction mode (including an MIP mode indicated by an MIP mode index) is used to decode the current coding block, the prediction unit 202 may transmit the relevant parameters from the parsing unit 201 to the intra prediction unit 204 to obtain an intra prediction block. The inverse quantization unit 205 may have a function same as that of the inverse quantization unit 110 in the encoder 100. The inverse quantization unit 205 may scale quantization coefficients (i.e., levels) from the parsing unit 201 to obtain reconstructed coefficients. The inverse transform unit 206 may have a function the same as that of the inverse transform unit 111 in the encoder 100. The inverse transform unit 206 may perform one or more transforms (i.e., the inverse operations of one or more transforms performed by the inverse transform unit 111 in the encoder 100) to obtain a reconstructed residual. The adder 207 may add its inputs (i.e., the prediction block from the prediction unit 202 and the reconstructed residual from the inverse transform unit 206), to obtain a reconstructed block of the current coding block. The reconstructed block may further be sent to the prediction unit 202 as a reference for another block to be coded in an intra prediction mode.
[0102] After all the CUs in a picture or sub-picture have been reconstructed, the filtering unit 208 may perform in-loop filtering on the reconstructed picture or sub-picture. The filtering unit 208 may include one or more filters such as a deblocking filter, an SAO filter, an ALF, an LMCS filter, a filter based on a neural network, etc. Alternatively, when the filtering unit 208 determines that a reconstructed block is not used as a reference for decoding another block, the filtering unit 208 may perform in-loop filtering on one or more target samples in the reconstructed block. Here, an output of the filtering unit 208 may be a decoded picture or sub-picture. The decoded picture or sub-picture may be cached in the DPB unit 209. The DPB unit 209 may output the decoded picture or sub-picture according to timing and control information. A picture stored in the DPB unit 209 may further be used as a reference for inter prediction or intra prediction performed by the prediction unit 202.
[0103] Further, the decoder 200 may have a second processor and a second memory recording a computer program. When the second processor reads and runs the computer program, the decoder 200 may read an input bitstream and generate a decoded video corresponding to the input bitstream. In addition, the decoder 200 may further be a computing device having one or more chips. Units implemented as integrated circuits on a chip may have functions of connection and data exchange similar to those of respective units in FIG. 9.
[0104] It can be noted that, the method of embodiments of the disclosure can be applied to the encoder, the decoder, or both the encoder and the decoder, which is not specifically limited herein. In addition, when embodiments of the disclosure are applied to the encoder 100, the “current block” specifically refers to a current block to be encoded in a video picture (also referred to as an “encoding block” for short). When embodiments of the disclosure are applied to the decoder 200, the “current block” specifically refers to a current block to be decoded in a video picture (also referred to as a “decoding block” for short).
[0105] In embodiments of the disclosure, FIG. 10 is a first schematic flowchart of a decoding method provided in embodiments of the disclosure. As illustrated in FIG. 10, the method may include the following.
[0106] At S1001, at least one collocated picture of a current block is determined.
[0107] It can be noted that, the decoding method of embodiments of the disclosure is applied to a decoder. The decoding method may specifically refer to a method for constructing a candidate merge list, and more specifically, a method for constructing a candidate merge list based on temporal BVs. As such, based on the composition structure of the decoder 200 as illustrated in FIG. 9, the decoding method of embodiments of the disclosure is mainly applicable to an IntraTMP mode or an IBC mode in an inter prediction picture. Therefore, during construction of the candidate merge list, the problem that the candidate merge list is not full can be alleviated according to a collocated picture(s) of the current block.
[0108] It can also be noted that, in embodiments of the disclosure, the collocated picture(s) of the current block may be one, two, or even more. Exemplarily, as illustrated in FIG. 11, the current block may have two collocated pictures, such as a forward collocated picture (Frame 0, reference picture 0) located before a current picture and a backward collocated picture (Frame 1, reference picture 1) located after the current picture. The current block is a block in the current picture, and reference positions of the current block can be found in Frame 0 and Frame 1, separately.
[0109] In embodiments of the disclosure, for the current block, it can be determined according to a collocated-picture index in a bitstream that there are one or more corresponding collocated pictures. In some embodiments, the at least one collocated picture of the current block may be determined as follows. The bitstream is parsed to determine a collocated-picture index of the current block. The at least one collocated picture of the current block is determined according to the collocated-picture index.
[0110] In embodiments of the disclosure, the current picture contains the current block. The current picture may have no collocated picture, in which case a temporal candidate BV(s) cannot be further obtained and the candidate merge list is still constructed according to the related art. When the current picture has a collocated picture(s), it can be determined according to the collocated-picture index signalled into the bitstream by an encoding end that there may be one or more collocated pictures.
[0111] It can be noted that, in embodiments of the disclosure, the collocated picture belongs to reference pictures, and temporal MVs / BVs can only be obtained according to the collocated picture.
[0112] It can also be noted that, in embodiments of the disclosure, each B-frame may have two reference picture lists, i.e., List 0 and List 1. The collocated-picture index specifically indicates whether the collocated picture is in List 0 or List 1, and thus the collocated-picture index is an index for obtaining List 0 and List 1. In addition, it is not excluded that a picture may have more collocated pictures, or that more than one picture in each of List 0 and List 1 may be the collocated picture. That is, the collocated-picture index indicates a position(s) of a collocated picture(s) in a reference picture list.
[0113] In a specific embodiment, the at least one collocated picture of the current block may be determined according to the collocated-picture index as follows. One collocated picture of the current block is determined when the collocated-picture index includes one index. Two collocated pictures of the current block are determined when the collocated-picture index includes two indices.
[0114] That is, for the current picture to which the current block belongs, if the current picture has no collocated-picture index, the current picture has no collocated picture, and the temporal candidate BV(s) of the current block cannot be further obtained. If the current picture has only one collocated-picture index, the current picture has only one collocated picture, and the temporal candidate BV(s) of the current block can be obtained according to the collocated picture. If the current picture has two collocated-picture indices, the current picture has two collocated pictures, and the temporal candidate BV(s) of the current block can be obtained according to the two collocated pictures. Moreover, if the current picture has more than two collocated-picture indices, the current picture has more than two collocated pictures, and the temporal candidate BV(s) of the current block can be obtained according to the collocated pictures.
[0115] Exemplarily, in existing reference software implementations, it can be supported that one inter picture of the current block may have two collocated frames (i.e., two collocated pictures). As such, the temporal candidate BV(s) of the current block may be obtained not only according to one of the collocated pictures but also according to both collocated pictures, which is not limited herein.
[0116] At S1002, one or more temporal candidate BVs of the current block are determined according to the at least one collocated picture.
[0117] In embodiments of the disclosure, the temporal candidate BVs may include a first-type temporal candidate BV and / or a second-type temporal candidate BV. The first-type temporal candidate BV is different from the second-type temporal candidate BV. The first-type temporal candidate BV indicates that a temporal BV is determined based on a reference position in the collocated picture, and the second-type temporal candidate BV indicates that an offset temporal BV is determined by offsetting a reference position indicated by an MV of the collocated picture.
[0118] In embodiments of the disclosure, for a collocated picture, a reference position in the collocated picture may be a block not predicted based on a BV, such that motion information of the reference position does not include a BV. Moreover, if all reference positions in the collocated picture are blocks not predicted based on a BV, none of motion information of the reference positions includes a BV, and thus 0 temporal BVs can be obtained according to the collocated picture.
[0119] That is, assuming that the at least one collocated picture includes a first collocated picture and a second collocated picture, 0 temporal BVs for the first collocated picture and 0 temporal BVs for the second collocated picture may be obtained, i.e., 0 temporal candidate BVs may be obtained according to the at least one collocated picture. In this case, the candidate merge list is still constructed according to the related art.
[0120] Considering that the technical solutions are intended to solve the problem that the candidate merge list is not full, and the obtained temporal candidate BVs are added to the candidate merge list, the following is elaborated with an example that at least one temporal candidate BV of the current block can be obtained according to the at least one collocated picture.
[0121] In a possible implementation, the one or more temporal candidate BVs of the current block may be determined according to the at least one collocated picture as follows. X first-type temporal candidate BVs are determined according to the at least one collocated picture. The one or more temporal candidate BVs of the current block are determined according to the X first-type temporal candidate BVs, where X is a positive integer.
[0122] In another possible implementation, the one or more temporal candidate BVs of the current block may be determined according to the at least one collocated picture as follows. Y second-type temporal candidate BVs are determined according to the at least one collocated picture. The one or more temporal candidate BVs of the current block are determined according to the Y second-type temporal candidate BVs, where Y is a positive integer.
[0123] In yet another possible implementation, the one or more temporal candidate BVs of the current block may be determined according to the at least one collocated picture as follows. X first-type temporal candidate BVs and Y second-type temporal candidate BVs are determined according to the at least one collocated picture. The one or more temporal candidate BVs of the current block are determined according to the X first-type temporal candidate BVs and the Y second-type temporal candidate BVs, where X and Y each are a positive integer.
[0124] That is, in embodiments of the disclosure, the one or more temporal candidate BVs of the current block may be obtained according to the X first-type temporal candidate BVs and / or the Y second-type temporal candidate BVs determined according to the at least one collocated picture.
[0125] In some embodiments, the X first-type temporal candidate BVs may be determined according to the at least one collocated picture as follows. K temporal BVs for each of the at least one collocated picture are determined, where K is an integer greater than or equal to 0. The X first-type temporal candidate BVs are determined according to the K temporal BVs for each of the at least one collocated picture.
[0126] In embodiments of the disclosure, when the at least one collocated picture includes only one collocated picture, a value of K may be set equal to a value of X.
[0127] In addition, in embodiments of the disclosure, for different collocated pictures, K may have the same value or different values. Exemplarily, when the at least one collocated picture includes the first collocated picture and the second collocated picture, 0 temporal BVs for the first collocated picture and non-zero temporal BV(s) for the second collocated picture may be obtained, or non-zero temporal BV(s) for the first collocated picture and non-zero temporal BV(s) for the second collocated picture may be obtained
[0128] In embodiments of the disclosure, the first collocated picture may be any one of the at least one collocated picture. For determining the one or more temporal BVs for each of the at least one collocated picture, taking the first collocated picture as an example, the method may include the following. One or more reference positions in the first collocated picture are determined. K temporal BVs for the first collocated picture are determined according to the one or more reference positions.
[0129] Exemplarily, for the first collocated picture, if all reference positions in the first collocated picture are blocks not predicted based on a BV, none of motion information of the reference positions includes a BV, and thus 0 temporal BVs for the first collocated picture can be obtained.
[0130] It can also be noted that, for each collocated picture, there may be one or more reference positions, and definitions of the reference positions are as illustrated in Table 3. Table 3 Position index Primary position (horizontal coordinate, vertical coordinate) Secondary position (horizontal coordinate, vertical coordinate) 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.5W, 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)
[0131] In Table 3, X0 and Y0 represent a horizontal coordinate and a vertical coordinate of a bottom-right position of the current block in the current picture, X1 and Y1 represent a horizontal coordinate and a vertical coordinate of a center position of the current block in the current picture, and W and H represent a width and a height of the current block.
[0132] It can be noted that, the reference positions in Table 3 are mostly positions of the current block or positions to the right, bottom-right, and below the current block. Since these positions have not yet been encoded / decoded in the current picture, required information cannot be obtained. However, a temporal reference picture (specifically, the collocated picture) has already been encoded / decoded, and required information can be stored and obtained. In some embodiments, in addition to the reference positions mentioned above, positions within the current block or positions in directions such as top-left, top, top-right, left, bottom-left, etc., may also be selected as temporal reference positions, which are not limited herein. In addition, it can be noted that, for a collocated picture, 0 reference positions may also be included, in which case temporal candidate BVs will not be obtained for the collocated picture.
[0133] In some embodiments, the K temporal BVs for the first collocated picture may be determined according to the one or more reference positions as follows. A current reference position corresponding to a current position index is determined. H temporal BVs are determined according to the current reference position when the current reference position satisfies a first condition, where H is an integer greater than or equal to 0. A reference position corresponding to a next position index is determined based on a first position-index order, the reference position corresponding to the next position index is determined as the current reference position, and whether the current reference position satisfies the first condition continues to be determined until the one or more reference positions have been traversed, to obtain the K temporal BVs for the first collocated picture.
[0134] In embodiments of the disclosure, determining the H temporal BVs according to the current reference position may, for example, be determining 0, 1, 2, or more temporal BVs. Exemplarily, if a non-BV-based prediction mode is used for the current reference position, 0 temporal BVs may be obtained. If an IBC weighted prediction mode is used for the current reference position, multiple (two) temporal BVs may be obtained. If an IntraTMP mode or an IBC non-weighted prediction mode is used for the current reference position, one temporal BV may be obtained.
[0135] In embodiments of the disclosure, the first position-index order may be the positionindex order in Table 3, such as 1, 2, 3, ... 10. A reference position corresponding to position index 1 is first determined as the current reference position corresponding to the current position index. When the current reference position satisfies the first condition, H temporal BVs are determined according to the current reference position. Then, a reference position corresponding to position index 2 is determined as the current reference position, and whether the current reference position satisfies the first condition continues to be determined. Then, a reference position corresponding to position index 3 is determined as the current reference position, and so on, until the 10 reference positions have been traversed, to obtain the K temporal BVs of the first collocated picture.
[0136] In embodiments of the disclosure, as illustrated in Table 3, each reference position may include a primary position and a secondary position. In some embodiments, reference may be made to FIG. 12, and the H temporal BVs may be determined according to the current reference position as follows.
[0137] At S1201, whether the primary position in the current reference position satisfies the first condition is determined.
[0138] At S1202, the H temporal BVs are determined according to the primary position in the current reference position when the primary position in the current reference position satisfies the first condition.
[0139] At S1203, whether the secondary position in the current reference position satisfies the first condition is determined when the primary position in the current reference position does not satisfy the first condition.
[0140] At S1204, the H temporal BVs are determined according to the secondary position in the current reference position when the secondary position in the current reference position satisfies the first condition.
[0141] At S1205, when the primary position in the current reference position does not satisfy the first condition and the secondary position in the current reference position does not satisfy the first condition, the current reference position is skipped, and the reference position corresponding to the next position index is determined based on the first position-index order.
[0142] It can be noted that, in embodiments of the disclosure, the primary position in the current reference position may satisfy the first condition as follows. The primary position in the current reference position is within a range of the first collocated picture. Correspondingly, the secondary position in the current reference position may satisfy the first condition as follows. The secondary position in the current reference position is within the range of the first collocated picture.
[0143] In some embodiments, the method may further include the following. When the current reference position does not satisfy the first condition, the current reference position is skipped, the reference position corresponding to the next position index is determined based on the first position-index order, the reference position corresponding to the next position index is determined as the current reference position, and whether the current reference position satisfies the first condition continues to be determined.
[0144] It can also be noted that, in embodiments of the disclosure, the current reference position may not satisfy the first condition as follows. The primary position in the current reference position does not satisfy the first condition, and the secondary position in the current reference position does not satisfy the first condition.
[0145] It can also be noted that, in embodiments of the disclosure, for the first condition, the first condition may be used for determining whether the primary position or the secondary position is within a range of a collocated picture, or the first condition may be used for determining whether the primary position or the secondary position is within a range of a collocated sub-picture, slice, CTU, etc., which is not limited herein.
[0146] It can also be noted that, in embodiments of the disclosure, for the variable H, the value of H may be the same or different in different situations. In addition, if 0 temporal BVs are obtained according to the primary position in the current reference position, the H temporal BVs may be further obtained according to the secondary position in the current reference position. If 0 temporal BVs are also obtained according to the secondary position, the current reference position is skipped, and the reference position corresponding to the next position index is determined based on the first position-index order.
[0147] That is, in embodiments of the disclosure, for each collocated picture, the reference positions in the collocated picture may include the 10 primary positions and 10 secondary positions in Table 3. The primary positions are added in an order of position indices 1 to 10. When a primary position does not satisfy the first condition (the primary position is not within a range of a collocated picture, or other conditions may also apply, such as not being within a range of a collocated sub-picture, slice, CTU, etc.), a corresponding secondary position is used to replace the primary position to determine a temporal BV(s). If the secondary position also does not satisfy the first condition, the position index is skipped, and a primary position or a secondary position of the next position index is directly added, so as to determine one or more first-type temporal candidate BVs.
[0148] In embodiments of the disclosure, in addition to determining the first-type temporal candidate BVs according to the reference positions in Table 3, the second-type temporal candidate BVs may also be determined in conjunction with searched MVs. In some embodiments, the Y second-type temporal candidate BVs may be determined according to the at least one collocated picture as follows. I offset temporal BVs for each of the at least one collocated picture are determined, where I is an integer greater than or equal to 0. The Y second-type temporal candidate BVs are determined according to the I offset temporal BVs for each of the at least one collocated picture.
[0149] In embodiments of the disclosure, when the at least one collocated picture includes only one collocated picture, a value of I may be set equal to a value of Y.
[0150] In addition, in embodiments of the disclosure, for different collocated pictures, I may have the same value or different values. For example, assuming that there is a first collocated picture and a second collocated picture, 0 offset temporal BV for the first collocated picture and non-zero offset temporal BV(s) for the second collocated picture may be obtained, or non-zero offset temporal BV(s) for the first collocated picture and non-zero offset temporal BV(s) for the second collocated picture may be obtained.
[0151] In embodiments of the disclosure, the first collocated picture may be any one of the at least one collocated picture. For determining the I offset temporal BVs for each of the at least one collocated picture, taking the first collocated picture as an example, the method may include the following. A first MV of the first collocated picture is determined, and one or more initial reference positions of the current block are determined. The one or more initial reference positions are offset according to the first MV, to obtain one or more offset reference positions in the first collocated picture. I offset temporal BVs for the first collocated picture are determined according to the one or more offset reference positions in the first collocated picture.
[0152] Exemplarily, for the first collocated picture, if all offset reference positions in the first collocated picture are blocks not predicted based on a BV, none of motion information of the offset reference positions includes a BV, and thus 0 offset temporal BV for the first collocated picture can be obtained.
[0153] In embodiments of the disclosure, a picture to which the current block belongs is the current picture. For the first collocated picture of the current picture, in some embodiments, the first MV of the first collocated picture may be determined as follows. Respective MVs of multiple candidate positions around the current block and reference-picture indices pointed to by the MVs are determined. A current candidate position from the multiple candidate positions is determined based on a preset position order, and an MV of the current candidate position is determined as the first MV of the first collocated picture according to a current reference-picture index pointed to by the MV of the current candidate position when a reference picture indicated by the current reference-picture index is the first collocated picture.
[0154] In embodiments of the disclosure, the preset position order may be an order of 0, 1, 2, 3, 4 as illustrated in FIG. 13, and the five positions are spatially adjacent blocks of the current block. Coordinates of the five positions in the current picture are defined as illustrated in Table 4 below. Table 4 Position index Position coordinates 0 (X2-1, Y2+H-1) 1 (X2+W-1, Y2-1) 2 (X2-1, Y2-1) 3 (X2-1, Y2+H) 4 (X2+W, Y2-1)
[0155] In Table 4, X2 and Y2 represent a horizontal coordinate and a vertical coordinate of a top-left position of the current block in the current picture, and W and H represent a width and a height of the current block.
[0156] In addition, in embodiments of the disclosure, in addition to the five positions in FIG. 13, the MV used for offsetting in the collocated picture may also be obtained according to other positions around the current block, and multiple MVs may be found for one collocated picture to guide the offset.
[0157] In some embodiments, when the reference picture indicated by the current referencepicture index is the first collocated picture, the method may further include the following. Correction is performed on the MV of the current candidate position, and the corrected MV is determined as the first MV of the first collocated picture.
[0158] In embodiments of the disclosure, taking the first MV of the first collocated picture as an example, when the reference picture indicated by the current reference-picture index is the first collocated picture, the MV of the current candidate position may be directly determined as the first MV of the first collocated picture, or the MV of the current candidate position may be corrected and then determined as the first MV of the first collocated picture. The correction operation may be a rounding operation, which is intended to avoid finding a sub-sample position.
[0159] In some embodiments, the I offset temporal BVs for each of the at least one collocated picture may be determined as follows. When the at least one collocated picture includes a first collocated picture and a second collocated picture, the first MV of the first collocated picture and a second MV of the second collocated picture are determined, and one or more initial reference positions of the current block are determined. The one or more initial reference positions are offset according to the first MV, to obtain one or more offset reference positions in the first collocated picture; and the one or more initial reference positions are offset according to the second MV, to obtain one or more offset reference positions in the second collocated picture. The I offset temporal BVs for each of the at least one collocated picture are determined according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture.
[0160] It can be noted that, in embodiments of the disclosure, assuming that the current picture has two collocated pictures, i.e., a first collocated picture Frame 0 and a second collocated picture Frame 1, and in this case two MVs, i.e., a first MV MV0' and a second MV MV1', can be found, then MV0' and MV1' are first rounded (to avoid finding a sub-sample position) to obtain MV0 and MV1, so as to determine the one or more offset reference positions. Then, the I offset temporal BVs are obtained according to whether each of the offset reference positions contains a BV. In addition, in embodiments of the disclosure, for one collocated picture, if multiple MVs can be found to offset initial reference positions, for example, MVs, i.e., MV00, MV01, etc., are found for the first collocated picture (Frame 0), there may be more offset reference positions accordingly, which is not limited herein.
[0161] It can also be noted that, for the two collocated pictures, each collocated picture has one or more offset reference positions, and definitions of the offset reference positions are as illustrated in Table 5 below. Table 5 Position index Collocated picture Primary position (horizontal coordinate, vertical coordinate) Secondary position (horizontal coordinate, vertical coordinate) 1 0 (X0+1+MV0.X, Y0+1+MV0.Y) (X1+MV0.X, Y1+MV0.Y) 2 1 (X0+1+MV1.X, Y0+1+MV1.Y) (X1+MV1.X, Y1+MV1.Y) 3 0 (X0+1+MV0.X, Y0-3+MV0.Y) (X0-3+MV0.X, Y0+1+MV0.Y) 4 1 (X0+1+MV1.X, Y0-3+MV1.Y) (X0-3+MV1.X, Y0+1+MV1.Y) 5 0 (X0+1+W+MV0.X, Y0+1+H+MV0.Y) (X1+W+MV0.X, Y1+H+MV0.Y) 6 1 (X0+1+W+MV1.X, Y0+1+H+MV1.Y) (X1+W+MV1.X, Y1+H+MV1.Y) 7 0 (X0+1+W+MV0.X, Y0+1-0.5H+MV0.Y) (X0+1-0.5W+MV0.X, Y0+1+H+MV0.Y) 8 1 (X0+1+W+MV1.X, Y0+1-0.5H+MV1.Y) (X0+1-0.5W+MV1.X, Y0+1+H+MV1.Y) 9 0 (X0+1+2W+MV0.X, Y0+1+2H+MV0.Y) (X1+2W+MV0.X, Y1+2H+MV0.Y) 10 1 (X0+1+2W+MV1.X, Y0+1+2H+MV1.Y) (X1+2W+MV1.X, Y1+2H+MV1.Y) 11 0 (X0+1+2W+MV0.X, Y0+1-0.5H+MV0.Y) (X0+1-0.5W+MV0.X, Y0+1+2H+MV0.Y) 12 1 (X0+1+2W+MV1.X, Y0+1-0.5H+MV1.Y) (X0+1-0.5W+MV1.X, Y0+1+2H+MV1.Y) 13 0 (X0+1+3W+MV0.X, Y0+1+3H+MV0.Y) (X1+3W+MV0.X, Y1+3H+MV0.Y) 14 1 (X0+1+3W+MV1.X, Y0+1+3H+MV1.Y) (X1+3W+MV1.X, Y1+3H+MV1.Y) 15 0 (X0+1+3W+MV0.X, Y0+1-0.5H+MV0.Y) (X0+1-0.5W+MV0.X, Y0+1+3H+MV0.Y) 16 1 (X0+1+3W+MV1.X, (X0+1-0.5W+MV1.X, Y0+1-0.5H+MV1.Y) Y0+1+3H+MV1.Y) 17 0 (X0+1+4W+MV0.X, Y0+1+4H+MV0.Y) (X1+4W+MV0.X, Y1+4H+MV0.Y) 18 1 (X0+1+4W+MV1.X, Y0+1+4H+MV1.Y) (X1+4W+MV1.X, Y1+4H+MV1.Y) 19 0 (X0+1+4W+MV0.X, Y0+1-0.5H+MV0.Y) (X0+1-0.5W+MV0.X, Y0+1+4H+MV0.Y) 20 1 (X0+1+4W+MV1.X, Y0+1-0.5H+MV1.Y) (X0+1-0.5W+MV1.X, Y0+1+4H+MV1.Y)
[0162] In Table 5, X0 and Y0 represent a horizontal coordinate and a vertical coordinate of a bottom-right position of the current block in the current picture, X1 and Y1 represent a horizontal coordinate and a vertical coordinate of a center position of the current block in the current picture, and W and H represent a width and a height of the current block. In addition, MV0.X and MV0.Y are a horizontal offset and a vertical offset of an integer MV corresponding to the first collocated picture (Frame 0), respectively, and MV1.X and MV1.Y are a horizontal offset and a vertical offset of an integer MV corresponding to the second collocated picture (Frame 1), respectively.
[0163] It can be noted that, in embodiments of the disclosure, in addition to the reference positions in Table 5, other reference positions may also be selected as the offset temporal reference positions, which is not limited herein. In addition, it can be noted that, for a collocated picture, 0 offset reference positions may also be included, in which case temporal candidate BVs will not be obtained for the collocated picture.
[0164] It can also be noted that, in embodiments of the disclosure, for one collocated picture, if multiple MVs can be found to offset the initial reference positions, for example, MVs, i.e., MV00, MV01, etc., are found for the first collocated picture (Frame 0), there may be more offset reference positions accordingly. In other words, when multiple MVs for offsetting are found for one collocated picture, defined offset reference positions will also increase accordingly.
[0165] In some embodiments, the I offset temporal BVs for each of the at least one collocated picture may be determined according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture as follows. A current offset reference position corresponding to a current position index is determined. J offset temporal BVs are determined according to the current offset reference position when the current offset reference position satisfies a second condition, where J is an integer greater than or equal to 0. An offset reference position corresponding to a next position index is determined based on a second position-index order, the offset reference position corresponding to the next position index is determined as the current offset reference position, and whether the current offset reference position satisfies the second condition continues to be determined until all offset reference positions have been traversed, to obtain the I offset temporal BVs for each of the at least one collocated picture.
[0166] In embodiments of the disclosure, the second position-index order may be the position-index order in Table 5. As illustrated in Table 5, the method may further include the following. The one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture are arranged alternately, to determine the second position-index order.
[0167] In embodiments of the disclosure, determining the J offset temporal BVs according to the current offset reference position may, for example, be determining 0, 1, 2, or more offset temporal BVs. Exemplarily, if a non-BV-based prediction mode is used for the current offset reference position, 0 offset temporal BVs may be obtained. If an IBC weighted prediction mode is used for the current offset reference position, multiple (two) offset temporal BVs may be obtained. If an IntraTMP mode or an IBC non-weighted prediction mode is used for the current offset reference position, one offset temporal BV may be obtained.
[0168] In embodiments of the disclosure, as illustrated in Table 5, each offset reference position may include a primary position and a secondary position. In some embodiments, reference may be made to FIG. 14, and the J offset temporal BVs may be determined according to the current offset reference position as follows.
[0169] At S1401, whether the primary position in the current offset reference position satisfies the second condition is determined.
[0170] At S1402, the J offset temporal BVs are determined according to the primary position in the current offset reference position when the primary position in the current offset reference position satisfies the second condition.
[0171] At S1403, whether the secondary position in the current offset reference position satisfies the second condition is determined when the primary position in the current offset reference position does not satisfy the second condition.
[0172] At S1404, the J offset temporal BVs are determined according to the secondary position in the current offset reference position when the secondary position in the current offset reference position satisfies the second condition.
[0173] At S1405, when the primary position in the current offset reference position does not satisfy the second condition and the secondary position in the current offset reference position does not satisfy the second condition, the current offset reference position is skipped, and the offset reference position corresponding to the next position index is determined based on the second position-index order.
[0174] It can be noted that, in embodiments of the disclosure, the primary position in the current offset reference position may satisfy the second condition as follows. The primary position in the current offset reference position is within the range of the first collocated picture. Correspondingly, the secondary position in the current offset reference position may satisfy the second condition as follows. The secondary position in the current offset reference position is within the range of the first collocated picture.
[0175] In some embodiments, the method may further include the following. When the current offset reference position does not satisfy the second condition, the current offset reference position is skipped, the offset reference position corresponding to the next position index is determined based on the second position-index order, the offset reference position corresponding to the next position index is determined as the current offset reference position, and whether the current offset reference position satisfies the second condition continues to be determined.
[0176] It can also be noted that, in embodiments of the disclosure, the current offset reference position may not satisfy the second condition as follows. The primary position in the current offset reference position does not satisfy the second condition and the secondary position in the current offset reference position does not satisfy the second condition.
[0177] It can also be noted that, in embodiments of the disclosure, for the second condition, the second condition may be used for determining whether the primary position or the secondary position is within a range of a collocated picture, or the second condition may be used for determining whether the primary position or the secondary position is within a range of a collocated sub-picture, slice, CTU, etc., which is not limited herein.
[0178] It can also be noted that, in embodiments of the disclosure, for the variable J, the value of J may be the same or different in different situations. In addition, if 0 offset temporal BVs are obtained according to the primary position in the current offset reference position, the J offset temporal BVs may be further obtained according to the secondary position in the current offset reference position. If 0 offset temporal BVs are also obtained according to the secondary position, the current offset reference position is skipped, and the offset reference position corresponding to the next position index is determined based on the first position-index order.
[0179] That is, in embodiments of the disclosure, the positions in Table 5 are obtained by alternately offsetting the original 10 reference positions according to the first collocated picture (Frame 0) and the second collocated picture (Frame 1). The primary positions are added in an order of positions 1 to 20 in Table 5. Similarly, if the primary position does not satisfy the second condition, the secondary position is used. If the secondary position also does not satisfy the second condition, the current position index is skipped, and the primary position or the secondary position corresponding to the next position index is directly added. The second condition is the same as the first condition described above, and the second condition can be used for determining whether corresponding offset temporal BVs are obtained according to the primary position or the secondary position, so as to determine one or more second-type temporal candidate BVs.
[0180] As such, after the first-type temporal candidate BVs and the second-type temporal candidate BVs are determined, the one or more temporal candidate BVs can be obtained according to the first-type temporal candidate BVs and the second-type temporal candidate BVs. Specifically, corresponding motion information can be obtained according to the reference positions and / or the offset reference positions of the at least one collocated picture, where the motion information includes, for example, a BV, a flip type of a block, whether illumination compensation is used, whether filtering is used, etc. Then, a BV is obtained according to the motion information obtained according to the at least one collocated picture. Exemplarily, if the current motion information contains one available BV, the BV is obtained as a temporal candidate BV. If the current motion information contains multiple available BVs, more than one BV is obtained as temporal candidate BVs.
[0181] That is, in embodiments of the disclosure, as many temporal candidate BVs as the number of BVs contained in the motion information can be obtained. For example, if a non-BV-based prediction mode is used for a reference position, there may be 0 BVs at the reference position, and the number of BVs stored in the motion information may also be 0. If an IBC mode that is also an IBC weighted prediction mode is used for the reference position, there may be multiple (two) BVs at the reference position, and the number of BVs stored in the motion information may also be multiple. Otherwise, when an IntraTMP mode or a non-weighted IBC prediction mode is used for the reference position, there may be one BV at the reference position, and the number of BVs stored in the motion information may also be one.
[0182] At S1003, a candidate merge list is constructed based on the one or more temporal candidate BVs.
[0183] It can be noted that, in embodiments of the disclosure, after the one or more temporal candidate BVs are obtained, the candidate merge list can be constructed according to the one or more temporal candidate BVs. Reference may be made to FIG. 15, and the method may include the following.
[0184] At S1501, an initial merge list for the current block is determined.
[0185] At S1502, the one or more temporal candidate BVs are added to the initial merge list, to obtain the candidate merge list.
[0186] In embodiments of the disclosure, the initial merge list is a merge list constructed according to the related art. For example, candidate BVs contained in the initial merge list may include adjacent BVs, non-adjacent BVs, history BVs, and auto-relocated BVs, etc. For adjacent positions and non-adjacent positions, reference may be made to the several adjacent positions and non-adjacent positions in FIG. 4. If BVs are present at the adjacent positions, the BVs are determined as the adjacent BVs. If BVs are present at the non-adjacent positions, the BVs are determined as the non-adjacent BVs.
[0187] It can be understood that, when the initial merge list is in an unfilled state (or is not full), the one or more temporal candidate BVs may be added to the initial merge list. In addition, during addition of the temporal candidate BVs to the initial merge list, a duplication check is further required, to avoid repeatedly adding a BV that is identical to an existing BV in the initial merge list.
[0188] In a specific embodiment, taking a current temporal candidate BV among the one or more temporal candidate BVs as an example, the method may further include the following. The current temporal candidate BV is discarded when the initial merge list contains a candidate item identical to the current temporal candidate BV. The current temporal candidate BV is added to the initial merge list when the initial merge list contains no candidate item identical to the current temporal candidate BV. That is, in embodiments of the disclosure, there are no duplicate BVs in a finally obtained candidate merge list.
[0189] It can also be understood that, in embodiments of the disclosure, for the first-type temporal candidate BVs and the second-type temporal candidate BVs, the first-type temporal candidate BVs may be added first (in the first position-index order), and then the second-type temporal candidate BVs may be added (in the second position-index order), until the initial merge list is full, and the addition stops.
[0190] In a specific embodiment, the one or more temporal candidate BVs may include X first-type temporal candidate BVs and Y second-type temporal candidate BVs, where X and Y each are a positive integer. Accordingly, the one or more temporal candidate BVs may be added to the initial merge list as follows. The X first-type temporal candidate BVs are added to the initial merge list. When the initial merge list is in an unfilled state, the Y second-type temporal candidate BVs continue to be added to the initial merge list until the initial merge list is full.
[0191] In a possible implementation, the one or more temporal candidate BVs may be added to the initial merge list as follows. N first-type temporal candidate BVs among the X first-type temporal candidate BVs and M second-type temporal candidate BVs among the Y second-type temporal candidate BVs are added to the initial merge list, where N is an integer greater than 0 and less than or equal to a first threshold, and M is an integer greater than 0 and less than or equal to a second threshold.
[0192] It can be noted that, in embodiments of the disclosure, the number of first-type temporal candidate BVs and the number of second-type temporal candidate BVs to be added to the initial merge list may be limited separately or jointly. The first threshold represents an upper limit on the number of first-type temporal candidate BVs to be added, and the second threshold represents an upper limit on the number of second-type temporal candidate BVs to be added. Exemplarily, at most N first-type temporal candidate BVs and M second-type temporal candidate BVs may be added to the initial merge list.
[0193] In another possible implementation, the one or more temporal candidate BVs may be added to the initial merge list as follows. P temporal candidate BVs among the one or more temporal candidate BVs are added to the initial merge list, where the P temporal candidate BVs include first-type temporal candidate BVs and second-type temporal candidate BVs, and P is an integer greater than 0 and less than or equal to a third threshold.
[0194] It can also be noted that, in embodiments of the disclosure, a total upper limit is set when temporal candidate BVs are added to the initial merge list, where the third threshold represents a total upper limit for adding the first-type temporal candidate BVs and the second-type temporal candidate BVs. Exemplarily, at most P temporal candidate BVs may be added to the initial merge list, and the P temporal candidate BVs include a certain number of first-type temporal candidate BVs and a certain number of second-type temporal candidate BVs.
[0195] It can also be understood that, in embodiments of the disclosure, a condition for executing the technical solutions, i.e., a condition for determining whether to add temporal candidate BVs to the candidate merge list, may also be set. In a possible implementation, the method may further include the following. A prediction mode for the current block is determined. The determination of the at least one collocated picture of the current block is performed when the prediction mode for the current block satisfies a preset condition.
[0196] In embodiments of the disclosure, the prediction mode for the current block may be determined by parsing the bitstream. In some embodiments, when the prediction mode for the current block satisfies the preset condition, it may be determined that an IntraTMP mode is used for the current block and the candidate merge list is constructed for prediction, or it may be determined that an IBC mode is used for the current block and the candidate merge list is constructed for prediction.
[0197] That is, in embodiments of the disclosure, when the decoding end determines that the IBC mode is used for the current block and a merge list needs to be constructed, or determines that the IntraTMP mode is used for the current block and a candidate merge list needs to be constructed, in the technical solutions, temporal candidate BVs may be applied to supplement the constructed candidate merge list.
[0198] In another possible implementation, the method may further include the following. A video sequence to which the current block belongs is determined. The determination of the at least one collocated picture of the current block is performed when the video sequence is of a screen content category. That is, in embodiments of the disclosure, the temporal candidate BVs may be used for supplementing the constructed candidate merge list only when the video sequence is of the screen content category.
[0199] In yet another possible implementation, the method may further include the following. A bitstream is parsed to determine a value of a first syntax element. The determination of the at least one collocated picture of the current block is performed when the first syntax element indicates that a temporal candidate BV is used as a candidate item for constructing the candidate merge list for the current block.
[0200] In embodiments of the disclosure, if the value of the first syntax element is a first value, it may be determined that the first syntax element indicates that the temporal candidate BV is used as the candidate item for constructing the candidate merge list for the current block. If the value of the first syntax element is a second value, it may be determined that the first syntax element indicates that the temporal candidate BV is not used as the candidate item for constructing the candidate merge list for the current block.
[0201] In embodiments of the disclosure, the first value is different from the second value. The first value may be set to 1, and the second value may be set to 0. Alternatively, the first value may be set to 0, and the second value may be set to 1. Alternatively, the first value may be set to true, and the second value may be set to false. Alternatively, the first value may be set to false, and the second value may be set to true.
[0202] For example, it is assumed that the first value is 1 and the second value is 0. When the value of the first syntax element obtained through parsing is 1, it is determined that the temporal candidate BV is used as the candidate item for constructing the candidate merge list for the current block. When the value of the first syntax element obtained through parsing is 0, it is determined that the temporal candidate BV is not used as the candidate item for constructing the candidate merge list for the current block.
[0203] That is, in embodiments of the disclosure, whether the temporal candidate BVs are added to the candidate merge list may be controlled by some syntax elements, which may be at a sequence level, a picture level, a slice level, a block level, etc. Only when the first syntax element obtained through parsing is enabled, the first-type temporal candidate BVs and the second-type temporal candidate BVs that are based on a time domain can be added to the candidate merge list.
[0204] It can also be understood that, in embodiments of the disclosure, for the initial merge list constructed according to the related art, exemplarily, an initial merge list for the IBC mode may include: BVs of adjacent blocks, BVs of non-adjacent blocks, history BVs, and autorelocated BVs, etc., and the initial merge list for the IntraTMP mode may include: BVs of adjacent blocks and BVs of non-adjacent blocks.
[0205] As such, the first-type temporal candidate BVs and the second-type temporal candidate BVs obtained above can be added to the candidate merge list in a certain order together with existing types of BVs.
[0206] Exemplarily, for the candidate merge list for the IBC mode, the first-type temporal candidate BVs and the second-type temporal candidate BVs need to be added before the autorelocated BVs and after the BVs of the adjacent blocks. The order may be as follows:
[0207] a. BVs of adjacent blocks, BVs of non-adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, history BVs, auto-relocated BVs, etc.;
[0208] b. BVs of adjacent blocks, first-type temporal candidate BVs, BVs of non-adjacent blocks, second-type temporal candidate BVs, history BVs, auto-relocated BVs, etc.; and
[0209] c. BVs of adjacent blocks, BVs of non-adjacent blocks, history BVs, first-type temporal candidate BVs, second-type temporal candidate BVs, auto-relocated BVs, etc.
[0210] For example, for the candidate merge list for the IntraTMP mode, the first-type temporal candidate BVs and the second-type temporal candidate BVs need to be located after the BVs of the adjacent blocks. The order may be as follows:
[0211] a. BVs of adjacent blocks, BVs of non-adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, etc.;
[0212] b. BVs of adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, BVs of non-adjacent blocks, etc.; and
[0213] c. BVs of adjacent blocks, first-type temporal candidate BVs, BVs of non-adjacent blocks, second-type temporal candidate BVs, etc.
[0214] In some embodiments, the auto-relocated BVs may also be added to the candidate merge list for the IntraTMP mode. In this case, similarly, the auto-relocated BVs can be added after the first-type temporal candidate BVs and the second-type temporal candidate BVs.
[0215] It can also be understood that, in embodiments of the disclosure, after the candidate merge list is constructed, prediction may further be performed according to the candidate merge list, and a reconstructed block of the current block may be further determined.
[0216] In some embodiments, the method may further include the following. One or more target BVs of the current block are determined according to the candidate merge list, and a prediction block of the current block is determined according to the one or more target BVs of the current block.
[0217] In embodiments of the disclosure, the one or more target BVs of the current block are determined according to the candidate merge list, which may mean, for example, that the candidate merge list is reordered according to a template error value of each candidate in the candidate merge list, and then BV indices obtained by parsing the bitstream are combined, so as to obtain one or more target BVs.
[0218] In embodiments of the disclosure, if one target BV is obtained, a reference block corresponding to the target BV is determined, and the prediction block of the current block is determined according to the reference block. Alternatively, if at least two target BVs are obtained, at least two reference blocks corresponding to the at least two target BVs are determined, and then the at least two reference blocks are weighted, to determine the prediction block of the current block.
[0219] In some embodiments, the method may further include the following. The bitstream is parsed to determine a residual block of the current block. A reconstructed block of the current block is determined according to the residual block of the current block and the prediction block of the current block.
[0220] In embodiments of the disclosure, after the residual block of the current block is obtained through parsing, the residual block of the current block and the prediction block of the current block may be added to determine the reconstructed block of the current block, thereby completing a reconstruction process of the current block.
[0221] A decoding method is provided in embodiments of the disclosure. At least one collocated picture of a current block is first determined, one or more temporal candidate BVs of the current block are determined according to the at least one collocated picture, and then a candidate merge list is constructed based on the one or more temporal candidate BVs. That is, during construction of the candidate merge list, the one or more temporal candidate BVs are considered as candidate items in the candidate merge list, which can not only effectively alleviate the problem that the candidate merge list is not full, but also improve prediction accuracy with the candidate merge list, e.g., prediction performance of IBC and / or IntraTMP in the merge list mode, without introducing additional software and hardware implementation complexity, thereby improving coding efficiency.
[0222] In another embodiment of the disclosure, FIG. 16 is a first schematic flowchart of an encoding method provided in embodiments of the disclosure. As illustrated in FIG. 16, the method may include the following.
[0223] At S1601, at least one collocated picture of a current block is determined.
[0224] It can be noted that, the encoding method of embodiments of the disclosure is applied to an encoder. The encoding method may specifically refer to a method for constructing a candidate merge list, and more specifically, a method for constructing a candidate merge list based on temporal BVs. As such, based on the composition structure of the encoder 100 illustrated in FIG. 8, the encoding method of embodiments of the disclosure is mainly applicable to an IntraTMP mode or an IBC mode in an inter prediction picture. Therefore, during construction of the candidate merge list, the problem that the candidate merge list is not full can be alleviated according to a collocated picture(s) of the current block.
[0225] It can also be noted that, in embodiments of the disclosure, the collocated picture of the current block may be one, two, or even more. Exemplarily, as illustrated in FIG. 11, the current block may have two collocated pictures, such as a forward collocated picture (Frame 0, reference picture 0) located before a current picture and a backward collocated picture (Frame 1, reference picture 1) located after the current picture. The current block is a block in the current picture, and reference positions of the current block can be found on Frame 0 and Frame 1, respectively.
[0226] In embodiments of the disclosure, for the current block, it can be determined according to a collocated-picture index in a bitstream that there are one or more collocated pictures corresponding to the current block. In some embodiments, the method may further include the following. A collocated-picture index of the current block is determined according to the at least one collocated picture of the current block. The collocated-picture index of the current block is encoded, and a resulting encoded bit is signalled into a bitstream.
[0227] It can be noted that, in embodiments of the disclosure, the collocated picture is one of reference pictures, and temporal MVs / BVs can only be obtained according to the collocated picture.
[0228] It can also be noted that, in embodiments of the disclosure, each B-frame may have two reference picture lists, i.e., List 0 and List 1. The collocated-picture index specifically indicates whether the collocated picture is in List 0 or List 1, and thus the collocated-picture index is an index for obtaining List 0 and List 1. In addition, it is not excluded that a picture may have more collocated pictures, or that more than one picture in each of List 0 and List 1 may be the collocated picture. That is, the collocated-picture index indicates a position(s) of a collocated picture(s) in a reference picture list.
[0229] It can be understood that, in embodiments of the disclosure, the current picture contains the current block. The current picture may have no collocated picture, in which case a temporal candidate BV(s) cannot be further obtained and the candidate merge list is still constructed according to the related art. When the current picture has a collocated picture(s), it can be determined according to the collocated-picture index signalled into the bitstream by an encoding end that there may be one or more collocated pictures. In a specific embodiment, the method may further include the following. One collocated picture of the current block is determined when the collocated-picture index includes one index. Two collocated pictures of the current block are determined when the collocated-picture index includes two indices.
[0230] That is, for the current picture to which the current block belongs, if the current picture has no collocated-picture index, the current picture has no collocated picture, and the temporal candidate BV(s) of the current block cannot be further obtained. If the current picture has only one collocated-picture index, the current picture has only one collocated picture, and the temporal candidate BV(s) of the current block can be obtained according to the collocated picture. If the current picture has two collocated-picture indices, the current picture has two collocated pictures, and the temporal candidate BV(s) of the current block can be obtained according to the two collocated pictures. Moreover, if the current picture has more than two collocated-picture indices, the current picture has more than two collocated pictures, and the temporal candidate BV(s) of the current block can be obtained according to the collocated pictures.
[0231] Exemplarily, in existing reference software implementations, it can be supported that one inter picture of the current block may have two collocated frames (i.e., two collocated pictures). As such, the temporal candidate BV(s) of the current block may be obtained not only according to one of the collocated pictures but also according to both collocated pictures, which is not limited herein.
[0232] At S1602, one or more temporal candidate BVs of the current block are determined according to the at least one collocated picture.
[0233] In embodiments of the disclosure, the temporal candidate BVs may include a first-type temporal candidate BV and / or a second-type temporal candidate BV. The first-type temporal candidate BV is different from the second-type temporal candidate BV. The first-type temporal candidate BV indicates that a temporal BV is determined based on a reference position in the collocated picture, and the second-type temporal candidate BV indicates that an offset temporal BV is determined by offsetting a reference position indicated by an MV of the collocated picture.
[0234] In embodiments of the disclosure, for a collocated picture, a reference position in the collocated picture may be a block not predicted based on a BV, such that motion information of the reference position does not include a BV. Moreover, if all reference positions in the collocated picture are blocks not predicted based on a BV, none of motion information of the reference positions includes a BV, and thus 0 temporal BVs can be obtained according to the collocated picture.
[0235] That is, assuming that the at least one collocated picture includes a first collocated picture and a second collocated picture, 0 temporal BVs for the first collocated picture and 0 temporal BVs for the second collocated picture may be obtained, i.e., 0 temporal candidate BVs may be obtained according to the at least one collocated picture. In this case, the candidate merge list is still constructed according to the related art.
[0236] Considering that the technical solutions are intended to solve the problem that the candidate merge list is not full, and the obtained temporal candidate BVs are added to the candidate merge list, the following is elaborated with an example that at least one temporal candidate BV of the current block can be obtained according to the at least one collocated picture.
[0237] In a possible implementation, the one or more temporal candidate BVs of the current block may be determined according to the at least one collocated picture as follows. X first-type temporal candidate BVs are determined according to the at least one collocated picture. The one or more temporal candidate BVs of the current block are determined according to the X first-type temporal candidate BVs, where X is a positive integer.
[0238] In another possible implementation, the one or more temporal candidate BVs of the current block may be determined according to the at least one collocated picture as follows. Y second-type temporal candidate BVs are determined according to the at least one collocated picture. The one or more temporal candidate BVs of the current block are determined according to the Y second-type temporal candidate BVs, where Y is a positive integer.
[0239] In yet another possible implementation, the one or more temporal candidate BVs of the current block may be determined according to the at least one collocated picture as follows. X first-type temporal candidate BVs and Y second-type temporal candidate BVs are determined according to the at least one collocated picture. The one or more temporal candidate BVs of the current block are determined according to the X first-type temporal candidate BVs and the Y second-type temporal candidate BVs, where X and Y each are a positive integer.
[0240] That is, in embodiments of the disclosure, the one or more temporal candidate BVs of the current block may be obtained according to the X first-type temporal candidate BVs and / or the Y second-type temporal candidate BVs determined according to the at least one collocated picture.
[0241] In some embodiments, the X first-type temporal candidate BVs may be determined according to the at least one collocated picture as follows. K temporal BVs for each of the at least one collocated picture are determined, where K is an integer greater than or equal to 0. The X first-type temporal candidate BVs are determined according to the K temporal BVs for each of the at least one collocated picture.
[0242] In embodiments of the disclosure, when the at least one collocated picture includes only one collocated picture, a value of K may be set equal to a value of X.
[0243] In addition, in embodiments of the disclosure, for different collocated pictures, K may have the same value or different values. Exemplarily, assuming that there is a first collocated picture and a second collocated picture, 0 temporal BVs for the first collocated picture and nonzero temporal BV(s) for the second collocated picture may be obtained, or non-zero temporal BV(s) for the first collocated picture and non-zero temporal BV(s) for the second collocated picture may be obtained.
[0244] In embodiments of the disclosure, the first collocated picture may be any one of the at least one collocated picture. For determining the one or more temporal BVs for each of the at least one collocated picture, taking the first collocated picture as an example, the method may include the following. One or more reference positions in the first collocated picture are determined. K temporal BVs for the first collocated picture are determined according to the one or more reference positions.
[0245] Exemplarily, for the first collocated picture, if all reference positions in the first collocated picture are blocks not predicted based on a BV, none of motion information of the reference positions includes a BV, and thus 0 temporal BVs for the first collocated picture can be obtained.
[0246] It can also be noted that, for each collocated picture, there may be one or more reference positions, and definitions of the reference positions are as illustrated in Table 3 above. In Table 3, X0 and Y0 represent a horizontal coordinate and a vertical coordinate of a bottomright position of the current block in the current picture, X1 and Y1 represent a horizontal coordinate and a vertical coordinate of a center position of the current block in the current picture, and W and H represent a width and a height of the current block.
[0247] It can be noted that, the reference positions in Table 3 are mostly positions of the current block or positions to the right, bottom-right, and below the current block. Since these positions have not yet been encoded / decoded in the current picture, required information cannot be obtained. However, a temporal reference picture (specifically, the collocated picture) has already been encoded / decoded, and required information can be stored and obtained. In some embodiments, in addition to the reference positions mentioned above, positions within the current block or positions in directions such as top-left, top, top-right, left, bottom-left, etc., may also be selected as temporal reference positions, which are not limited herein. In addition, it can be noted that, for a collocated picture, 0 reference positions may also be included, in which case temporal candidate BVs will not be obtained for the collocated picture.
[0248] In some embodiments, the K temporal BVs for the first collocated picture may be determined according to the one or more reference positions as follows. A current reference position corresponding to a current position index is determined. H temporal BVs are determined according to the current reference position when the current reference position satisfies a first condition, where H is an integer greater than or equal to 0. A reference position corresponding to a next position index is determined based on a first position-index order, the reference position corresponding to the next position index is determined as the current reference position, and whether the current reference position satisfies the first condition continues to be determined until the one or more reference positions have been traversed, to obtain the K temporal BVs for the first collocated picture.
[0249] In embodiments of the disclosure, determining the H temporal BVs according to the current reference position may, for example, be determining 0, 1, 2, or more temporal BVs. Exemplarily, if a non-BV-based prediction mode is used for the current reference position, 0 temporal BVs may be obtained. If an IBC weighted prediction mode is used for the current reference position, multiple (two) temporal BVs may be obtained. If an IntraTMP mode or an IBC non-weighted prediction mode is used for the current reference position, one temporal BV may be obtained.
[0250] In embodiments of the disclosure, the first position-index order may be the positionindex order in Table 3, such as 1, 2, 3, ... 10. A reference position corresponding to position index 1 is first determined as the current reference position corresponding to the current position index. When the current reference position satisfies the first condition, H temporal BVs are determined according to the current reference position. Then, a reference position corresponding to position index 2 is determined as the current reference position, and whether the current reference position satisfies the first condition continues to be determined. Then, a reference position corresponding to position index 3 is determined as the current reference position, and so on, until the 10 reference positions have been traversed, to obtain the K temporal BVs of the first collocated picture.
[0251] In embodiments of the disclosure, as illustrated in Table 3, each reference position may include a primary position and a secondary position. In some embodiments, reference may be made to FIG. 12, and the H temporal BVs may be determined according to the current reference position as follows. Whether the primary position in the current reference position satisfies the first condition is determined. The H temporal BVs are determined according to the primary position in the current reference position when the primary position in the current reference position satisfies the first condition. Whether the secondary position in the current reference position satisfies the first condition is determined when the primary position in the current reference position does not satisfy the first condition. The H temporal BVs are determined according to the secondary position in the current reference position when the secondary position in the current reference position satisfies the first condition. When the primary position in the current reference position does not satisfy the first condition and the secondary position in the current reference position does not satisfy the first condition, the current reference position is skipped, and the reference position corresponding to the next position index is determined based on the first position-index order.
[0252] It can be noted that, in embodiments of the disclosure, the primary position in the current reference position may satisfy the first condition as follows. The primary position in the current reference position is within a range of the first collocated picture. Correspondingly, the secondary position in the current reference position may satisfy the first condition as follows. The secondary position in the current reference position is within the range of the first collocated picture.
[0253] In some embodiments, the method may further include the following. When the current reference position does not satisfy the first condition, the current reference position is skipped, the reference position corresponding to the next position index is determined based on the first position-index order, the reference position corresponding to the next position index is determined as the current reference position, and whether the current reference position satisfies the first condition continues to be determined.
[0254] It can also be noted that, in embodiments of the disclosure, the current reference position may not satisfy the first condition as follows. The primary position in the current reference position does not satisfy the first condition, and the secondary position in the current reference position does not satisfy the first condition.
[0255] It can also be noted that, in embodiments of the disclosure, for the first condition, the first condition may be used for determining whether the primary position or the secondary position is within a range of a collocated picture, or the first condition may be used for determining whether the primary position or the secondary position is within a range of a collocated sub-picture, slice, CTU, etc., which is not limited herein.
[0256] It can also be noted that, in embodiments of the disclosure, for the variable H, the value of H may be the same or different in different situations. In addition, if 0 temporal BVs are obtained according to the primary position in the current reference position, the H temporal BVs may be further obtained according to the secondary position in the current reference position. If 0 temporal BVs are also obtained according to the secondary position, the current reference position is skipped, and the reference position corresponding to the next position index is determined based on the first position-index order.
[0257] That is, in embodiments of the disclosure, for each collocated picture, the reference positions in the collocated picture may include the 10 primary positions and 10 secondary positions in Table 3. The primary positions are added in an order of position indices 1 to 10. When a primary position does not satisfy the first condition (the primary position is not within a range of a collocated picture, or other conditions such as not being within a range of a collocated sub-picture, slice, CTU, etc.), a corresponding secondary position is used to replace the primary position to determine a temporal BV(s). If the secondary position also does not satisfy the first condition, the position index is skipped, and a primary position or a secondary position of the next position index is directly added, so as to determine one or more first-type temporal candidate BVs.
[0258] In embodiments of the disclosure, in addition to determining the first-type temporal candidate BVs according to the reference positions in Table 3, the second-type temporal candidate BVs may also be determined in conjunction with searched MVs. In some embodiments, the Y second-type temporal candidate BVs may be determined according to the at least one collocated picture as follows. I offset temporal BVs for each of the at least one collocated picture are determined, where I is an integer greater than or equal to 0. The Y second-type temporal candidate BVs are determined according to the I offset temporal BVs for each of the at least one collocated picture.
[0259] In embodiments of the disclosure, when the at least one collocated picture includes only one collocated picture, a value of I may be set equal to a value of Y.
[0260] In addition, in embodiments of the disclosure, for different collocated pictures, I may have the same value or different values. For example, assuming that there is a first collocated picture and a second collocated picture, 0 offset temporal BV for the first collocated picture and non-zero offset temporal BV(s) for the second collocated picture may be obtained, or non-zero offset temporal BV(s) for the first collocated picture and non-zero offset temporal BV(s) for the second collocated picture may be obtained.
[0261] In embodiments of the disclosure, the first collocated picture may be any one of the at least one collocated picture. For determining the I offset temporal BVs for each of the at least one collocated picture, taking the first collocated picture as an example, the method may include the following. A first MV of the first collocated picture is determined, and one or more initial reference positions of the current block are determined. The one or more initial reference positions are offset according to the first MV, to obtain one or more offset reference positions in the first collocated picture. I offset temporal BVs for the first collocated picture are determined according to the one or more offset reference positions in the first collocated picture.
[0262] Exemplarily, for the first collocated picture, if all offset reference positions in the first collocated picture are blocks not predicted based on a BV, none of motion information of the offset reference positions includes a BV, and thus 0 offset temporal BV for the first collocated picture can be obtained.
[0263] In embodiments of the disclosure, a picture to which the current block belongs is the current picture. For the first collocated picture of the current picture, in some embodiments, the first MV of the first collocated picture may be determined as follows. Respective MVs of multiple candidate positions around the current block and reference-picture indices pointed to by the MVs are determined. A current candidate position from the multiple candidate positions is determined based on a preset position order, and an MV of the current candidate position is determined as the first MV of the first collocated picture according to a current reference-picture index pointed to by the MV of the current candidate position when a reference picture indicated by the current reference-picture index is the first collocated picture.
[0264] In embodiments of the disclosure, the preset position order may be an order of 0, 1, 2, 3, 4 as illustrated in FIG. 13, and the five positions are spatially adjacent blocks of the current block. Coordinates of the five positions in the current picture are defined as illustrated in Table 4 above. In Table 4, X2 and Y2 represent a horizontal coordinate and a vertical coordinate of a topleft position of the current block in the current picture, and W and H represent a width and a height of the current block.
[0265] In addition, in embodiments of the disclosure, in addition to the five positions in FIG. 13, the MV used for offsetting in the collocated picture may also be obtained according to other positions around the current block, and multiple MVs may be found for one collocated picture to guide the offset.
[0266] In some embodiments, when the reference picture indicated by the current referencepicture index is the first collocated picture, the method may further include the following. Correction is performed on the MV of the current candidate position, and the corrected MV is determined as the first MV of the first collocated picture.
[0267] In embodiments of the disclosure, taking the first MV of the first collocated picture as an example, when the reference picture indicated by the current reference-picture index is the first collocated picture, the MV of the current candidate position may be directly determined as the first MV of the first collocated picture, or the MV of the current candidate position may be corrected and then determined as the first MV of the first collocated picture. The correction operation may be a rounding operation, which is intended to avoid finding a sub-sample position.
[0268] In some embodiments, the I offset temporal BVs for each of the at least one collocated picture may be determined as follows. When the at least one collocated picture includes a first collocated picture and a second collocated picture, the first MV of the first collocated picture and a second MV of the second collocated picture are determined, and one or more initial reference positions of the current block are determined. The one or more initial reference positions are offset according to the first MV, to obtain one or more offset reference positions in the first collocated picture; and the one or more initial reference positions are offset according to the second MV, to obtain one or more offset reference positions in the second collocated picture. The I offset temporal BVs for each of the at least one collocated picture are determined according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture.
[0269] It can be noted that, in embodiments of the disclosure, assuming that the current picture has two collocated pictures, i.e., a first collocated picture Frame 0 and a second collocated picture Frame 1, and in this case two MVs, i.e., a first MV MV0' and a second MV MV1', can be found, then MV0' and MV1' are first rounded (to avoid finding a sub-sample position) to obtain MV0 and MV1, so as to determine the one or more offset reference positions. Then, the I offset temporal BVs are obtained according to whether each of the offset reference positions contains a BV. In addition, in embodiments of the disclosure, for one collocated picture, if multiple MVs can be found to offset initial reference positions, for example, MVs, i.e., MV00, MV01, etc., are found for the first collocated picture (Frame 0), there may be more offset reference positions accordingly, which is not limited herein.
[0270] It can also be noted that, for the two collocated pictures, each collocated picture has one or more offset reference positions, and definitions of the offset reference positions are as illustrated in Table 5 above. In Table 5, X0 and Y0 represent a horizontal coordinate and a vertical coordinate of a bottom-right position of the current block in the current picture, X1 and Y1 represent a horizontal coordinate and a vertical coordinate of a center position of the current block in the current picture, and W and H represent a width and a height of the current block. In addition, MV0.X and MV0.Y are a horizontal offset and a vertical offset of an integer MV corresponding to the first collocated picture (Frame 0), respectively, and MV1.X and MV1.Y are a horizontal offset and a vertical offset of an integer MV corresponding to the second collocated picture (Frame 1), respectively.
[0271] It can be noted that, in embodiments of the disclosure, in addition to the reference positions in Table 5, other reference positions may also be selected as the offset temporal reference positions, which is not limited herein. In addition, it can be noted that, for a collocated picture, 0 offset reference positions may also be included, in which case temporal candidate BVs will not be obtained for the collocated picture.
[0272] It can also be noted that, in embodiments of the disclosure, for one collocated picture, if multiple MVs can be found to offset the initial reference positions, for example, MVs, i.e., MV00, MV01, etc., are found for the first collocated picture (Frame 0), there may be more offset reference positions accordingly. In other words, when multiple MVs for offsetting are found for one collocated picture, defined offset reference positions will also increase accordingly.
[0273] In some embodiments, the I offset temporal BVs for each of the at least one collocated picture may be determined according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture as follows. A current offset reference position corresponding to a current position index is determined. J offset temporal BVs are determined according to the current offset reference position when the current offset reference position satisfies a second condition, where J is an integer greater than or equal to 0. An offset reference position corresponding to a next position index is determined based on a second position-index order, the offset reference position corresponding to the next position index is determined as the current offset reference position, and whether the current offset reference position satisfies the second condition continues to be determined until all offset reference positions have been traversed, to obtain the I offset temporal BVs for each of the at least one collocated picture.
[0274] In embodiments of the disclosure, the second position-index order may be the position-index order in Table 5. As illustrated in Table 5, the method may further include the following. The one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture are arranged alternately, to determine the second position-index order.
[0275] In embodiments of the disclosure, determining the J offset temporal BVs according to the current offset reference position may, for example, be determining 0, 1, 2, or more offset temporal BVs. Exemplarily, if a non-BV-based prediction mode is used for the current offset reference position, 0 offset temporal BVs may be obtained. If an IBC weighted prediction mode is used for the current offset reference position, multiple (two) offset temporal BVs may be obtained. If an IntraTMP mode or an IBC non-weighted prediction mode is used for the current offset reference position, one offset temporal BV may be obtained.
[0276] In embodiments of the disclosure, as illustrated in Table 5, each offset reference position may include a primary position and a secondary position. In some embodiments, the J offset temporal BVs may be determined according to the current offset reference position as follows. Whether the primary position in the current offset reference position satisfies the second condition is determined. The J offset temporal BVs are determined according to the primary position in the current offset reference position when the primary position in the current offset reference position satisfies the second condition. Whether the secondary position in the current offset reference position satisfies the second condition is determined when the primary position in the current offset reference position does not satisfy the second condition. The J offset temporal BVs are determined according to the secondary position in the current offset reference position when the secondary position in the current offset reference position satisfies the second condition. When the primary position in the current offset reference position does not satisfy the second condition and the secondary position in the current offset reference position does not satisfy the second condition, the current offset reference position is skipped, and the offset reference position corresponding to the next position index is determined based on the second position-index order.
[0277] It can be noted that, in embodiments of the disclosure, the primary position in the current offset reference position may satisfy the second condition as follows. The primary position in the current offset reference position is within the range of the first collocated picture. Correspondingly, the secondary position in the current offset reference position may satisfy the second condition as follows. The secondary position in the current offset reference position is within the range of the first collocated picture.
[0278] In some embodiments, the method may further include the following. When the current offset reference position does not satisfy the second condition, the current offset reference position is skipped, the offset reference position corresponding to the next position index is determined based on the second position-index order, the offset reference position corresponding to the next position index is determined as the current offset reference position, and whether the current offset reference position satisfies the second condition continues to be determined.
[0279] It can also be noted that, in embodiments of the disclosure, the current offset reference position may not satisfy the second condition as follows. The primary position in the current offset reference position does not satisfy the second condition, and the secondary position in the current offset reference position does not satisfy the second condition.
[0280] It can also be noted that, in embodiments of the disclosure, for the second condition, the second condition may be used for determining whether the primary position or the secondary position is within a range of a collocated picture, or the second condition may be used for determining whether the primary position or the secondary position is within a range of a collocated sub-picture, slice, CTU, etc., which is not limited herein.
[0281] It can also be noted that, in embodiments of the disclosure, for the variable J, the value of J may be the same or different in different situations. In addition, if 0 offset temporal BVs are obtained according to the primary position in the current offset reference position, the J offset temporal BVs may be further obtained according to the secondary position in the current offset reference position. If 0 offset temporal BVs are also obtained according to the secondary position, the current offset reference position is skipped, and the offset reference position corresponding to the next position index is determined based on the first position-index order.
[0282] That is, in embodiments of the disclosure, the positions in Table 5 are obtained by alternately offsetting the original 10 reference positions according to the first collocated picture (Frame 0) and the second collocated picture (Frame 1). The primary positions are added in an order of positions 1 to 20 in Table 5. Similarly, if the primary position does not satisfy the second condition, the secondary position is used. If the secondary position also does not satisfy the second condition, the current position index is skipped, and the primary position or the secondary position corresponding to the next position index is directly added. The second condition is the same as the first condition described above, and the second condition can be used for determining whether corresponding offset temporal BVs are obtained according to the primary position or the secondary position, so as to determine one or more second-type temporal candidate BVs.
[0283] As such, after the first-type temporal candidate BVs and the second-type temporal candidate BVs are determined, the one or more temporal candidate BVs can be obtained according to the first-type temporal candidate BVs and the second-type temporal candidate BVs. Specifically, corresponding motion information can be obtained according to the reference positions and / or the offset reference positions of the at least one collocated picture, where the motion information includes, for example, a BV, a flip type of a block, whether illumination compensation is used, whether filtering is used, etc. Then, a BV is obtained according to the motion information obtained according to the at least one collocated picture. Exemplarily, if the current motion information contains one available BV, the BV is obtained as a temporal candidate BV. If the current motion information contains multiple available BVs, more than one BV is obtained as temporal candidate BVs.
[0284] That is, in embodiments of the disclosure, as many temporal candidate BVs as the number of BVs contained in the motion information can be obtained. For example, if a non-BV-based prediction mode is used for a reference position, there may be 0 BVs at the reference position, and the number of BVs stored in the motion information may also be 0. If an IBC mode that is also an IBC weighted prediction mode is used for the reference position, there may be multiple (two) BVs at the reference position, and the number of BVs stored in the motion information may also be multiple. Otherwise, when an IntraTMP mode or a non-weighted IBC prediction mode is used for the reference position, there may be one BV at the reference position, and the number of BVs stored in the motion information may also be one.
[0285] At S1603, a candidate merge list is constructed based on the one or more temporal candidate BVs.
[0286] It can be noted that, in embodiments of the disclosure, the candidate merge list can be constructed according to the one or more temporal candidate BVs, and the method may include the following. An initial merge list for the current block is determined. The one or more temporal candidate BVs are added to the initial merge list, to obtain the candidate merge list.
[0287] In embodiments of the disclosure, the initial merge list is a merge list constructed according to the related art. For example, candidate BVs contained in the initial merge list may include adjacent BVs, non-adjacent BVs, history BVs, and auto-relocated BVs, etc. For adjacent positions and non-adjacent positions, reference may be made to the several adjacent and nonadjacent positions in FIG. 4. If BVs are present at the adjacent positions, the BVs are determined as the adjacent BVs. If BVs are present at the non-adjacent positions, the BVs are determined as the non-adjacent BVs.
[0288] It can be understood that, when the initial merge list is in an unfilled state, the one or more temporal candidate BVs may be added to the initial merge list. In addition, during addition of the temporal candidate BVs to the initial merge list, a duplication check is further required, to avoid repeatedly adding a BV that is identical to an existing BV in the initial merge list.
[0289] In a specific embodiment, taking a current temporal candidate BV among the one or more temporal candidate BVs as an example, the method may further include the following. The current temporal candidate BV is discarded when the initial merge list contains a candidate item identical to the current temporal candidate BV. The current temporal candidate BV is added to the initial merge list when the initial merge list contains no candidate item identical to the current temporal candidate BV. That is, in embodiments of the disclosure, there are no duplicate BVs in a finally obtained candidate merge list.
[0290] It can also be understood that, in embodiments of the disclosure, for the first-type temporal candidate BVs and the second-type temporal candidate BVs, the first-type temporal candidate BVs may be added first (in the first position-index order), and then the second-type temporal candidate BVs may be added (in the second position-index order), until the initial merge list is full, and the addition stops.
[0291] In a specific embodiment, the one or more temporal candidate BVs may include X first-type temporal candidate BVs and Y second-type temporal candidate BVs, where X and Y each are a positive integer. Accordingly, the one or more temporal candidate BVs may be added to the initial merge list as follows. The X first-type temporal candidate BVs are added to the initial merge list. When the initial merge list is in an unfilled state, the Y second-type temporal candidate BVs continue to be added to the initial merge list until the initial merge list is full.
[0292] In a possible implementation, the one or more temporal candidate BVs may be added to the initial merge list as follows. N first-type temporal candidate BVs among the X first-type temporal candidate BVs and M second-type temporal candidate BVs among the Y second-type temporal candidate BVs are added to the initial merge list, where N is an integer greater than 0 and less than or equal to a first threshold, and M is an integer greater than 0 and less than or equal to a second threshold.
[0293] It can be noted that, in embodiments of the disclosure, the number of first-type temporal candidate BVs and the number of second-type temporal candidate BVs to be added to the initial merge list may be limited separately or jointly. The first threshold represents an upper limit on the number of first-type temporal candidate BVs to be added, and the second threshold represents an upper limit on the number of second-type temporal candidate BVs to be added. Exemplarily, at most N first-type temporal candidate BVs and M second-type temporal candidate BVs may be added to the initial merge list.
[0294] In another possible implementation, the one or more temporal candidate BVs may be added to the initial merge list as follows. P temporal candidate BVs among the one or more temporal candidate BVs are added to the initial merge list, where the P temporal candidate BVs include first-type temporal candidate BVs and second-type temporal candidate BVs, and P is an integer greater than 0 and less than or equal to a third threshold.
[0295] It can also be noted that, in embodiments of the disclosure, a total upper limit is set when temporal candidate BVs are added to the initial merge list, where the third threshold represents a total upper limit for adding the first-type temporal candidate BVs and the second-type temporal candidate BVs. Exemplarily, at most P temporal candidate BVs may be added to the initial merge list, and the P temporal candidate BVs include a certain number of first-type temporal candidate BVs and a certain number of second-type temporal candidate BVs.
[0296] It can also be understood that, in embodiments of the disclosure, a condition for executing the technical solutions, i.e., a condition for determining whether to add temporal candidate BVs to the candidate merge list, may also be set. In a possible implementation, the method may further include the following. A prediction mode for the current block is determined. The determination of the at least one collocated picture of the current block is performed when the prediction mode for the current block satisfies a preset condition.
[0297] In embodiments of the disclosure, after the encoding end determines the prediction mode for the current block, the prediction mode for the current block can be encoded into the bitstream, such that the decoding end can determine the prediction mode for the current block simply by parsing the bitstream. In some embodiments, when the prediction mode for the current block satisfies the preset condition, it may be determined that an IntraTMP mode is used for the current block and the candidate merge list is constructed for prediction, or it may be determined that an IBC mode is used for the current block and the candidate merge list is constructed for prediction.
[0298] That is, in embodiments of the disclosure, when the encoding end determines that the IBC mode is used for the current block and a merge list needs to be constructed, or determines that the IntraTMP mode is used for the current block and a candidate merge list needs to be constructed, in the technical solutions, temporal candidate BVs may be applied to supplement the constructed candidate merge list.
[0299] In another possible implementation, the method may further include the following. A video sequence to which the current block belongs is determined. The determination of the at least one collocated picture of the current block is performed when the video sequence is of a screen content category. That is, in embodiments of the disclosure, the temporal candidate BVs may be used for supplementing the constructed candidate merge list only when the video sequence is of the screen content category.
[0300] In yet another possible implementation, the method may further include the following. The determination of the at least one collocated picture of the current block is performed when a temporal candidate BV is used as a candidate item for constructing the candidate merge list for the current block.
[0301] In some embodiments, the method may further include the following. A value of a first syntax element is determined. The value of the first syntax element is encoded, and a resulting encoded bit is signalled into a bitstream.
[0302] In embodiments of the disclosure, the first syntax element may indicate whether the temporal candidate BV is used as the candidate item for constructing the candidate merge list for the current block. If the temporal candidate BV is used as the candidate item for constructing the candidate merge list for the current block, the value of the first syntax element may be determined as a first value. If the temporal candidate BV is not used as the candidate item for constructing the candidate merge list for the current block, the value of the first syntax element may be determined as a second value.
[0303] In embodiments of the disclosure, the first value is different from the second value. The first value may be set to 1, and the second value may be set to 0. Alternatively, the first value may be set to 0, and the second value may be set to 1. Alternatively, the first value may be set to true, and the second value may be set to false. Alternatively, the first value may be set to false, and the second value may be set to true.
[0304] For example, it is assumed that the first value is 1 and the second value is 0. If the temporal candidate BV is used as the candidate item for constructing the candidate merge list for the current block, the value of the first syntax element is set to 1 and then encoded into the bitstream. If the temporal candidate BV is not used as the candidate item for constructing the candidate merge list for the current block, the value of the first syntax element is set to 0 and then encoded into the bitstream.
[0305] That is, in embodiments of the disclosure, whether the temporal candidate BVs are added to the candidate merge list may be controlled by some syntax elements, which may be at a sequence level, a picture level, a slice level, a block level, etc. As such, only when the first syntax element decoded by the decoding end subsequently is enabled, the first-type temporal candidate BVs and the second-type temporal candidate BVs that are based on the time domain can be added to the candidate merge list. Otherwise, the first-type temporal candidate BVs and the second-type temporal candidate BVs that are based on the time domain will not be added.
[0306] It can also be understood that, in embodiments of the disclosure, for the initial merge list constructed according to the related art, exemplarily, an initial merge list for the IBC mode may include: BVs of adjacent blocks, BVs of non-adjacent blocks, history BVs, and autorelocated BVs, etc., and the initial merge list for the IntraTMP mode may include: BVs of adjacent blocks and BVs of non-adjacent blocks.
[0307] As such, the first-type temporal candidate BVs and the second-type temporal candidate BVs obtained above can be added to the candidate merge list in a certain order together with existing types of BVs.
[0308] Exemplarily, for the candidate merge list for the IBC mode, the first-type temporal candidate BVs and the second-type temporal candidate BVs need to be added before the autorelocated BVs and after the BVs of the adjacent blocks. The order may be as follows:
[0309] a. BVs of adjacent blocks, BVs of non-adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, history BVs, auto-relocated BVs, etc.;
[0310] b. BVs of adjacent blocks, first-type temporal candidate BVs, BVs of non-adjacent blocks, second-type temporal candidate BVs, history BVs, auto-relocated BVs, etc.; and
[0311] c. BVs of adjacent blocks, BVs of non-adjacent blocks, history BVs, first-type temporal candidate BVs, second-type temporal candidate BVs, auto-relocated BVs, etc.
[0312] For example, for the candidate merge list for the IntraTMP mode, the first-type temporal candidate BVs and the second-type temporal candidate BVs need to be located after the BVs of the adjacent blocks. The order may be as follows:
[0313] a. BVs of adjacent blocks, BVs of non-adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, etc.;
[0314] b. BVs of adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, BVs of non-adjacent blocks, etc.; and
[0315] c. BVs of adjacent blocks, first-type temporal candidate BVs, BVs of non-adjacent blocks, second-type temporal candidate BVs, etc.
[0316] In some embodiments, the auto-relocated BVs may also be added to the candidate merge list for the IntraTMP mode. In this case, similarly, the auto-relocated BVs can be added after the first-type temporal candidate BVs and the second-type temporal candidate BVs.
[0317] It can also be understood that, in embodiments of the disclosure, after the candidate merge list is constructed, reference may be made to FIG. 16, and the method further includes the following.
[0318] At S1604, a prediction block of the current block is determined by performing prediction according to the candidate merge list.
[0319] It can be noted that, in embodiments of the disclosure, the prediction block of the current block may be determined by performing prediction according to the candidate merge list as follows. One or more target BVs of the current block are determined according to the candidate merge list, and the prediction block of the current block is determined according to the one or more target BVs of the current block.
[0320] That is, in embodiments of the disclosure, the one or more target BVs of the current block are determined according to the candidate merge list, which may mean, for example, that the one or more target BVs are determined according to a template error value of each candidate in the candidate merge list. Further, the candidate merge list may be reordered according to the template error value of each candidate in the candidate merge list, and then BV indices corresponding to the one or more target BVs are determined and then signalled into the bitstream, such that the decoding end can obtain the one or more target BVs by combining the reordered candidate merge list with the BV indices obtained according to the bitstream.
[0321] It can also be noted that, in embodiments of the disclosure, if one target BV is obtained, a reference block corresponding to the target BV is determined, and the prediction block of the current block is determined according to the reference block. Alternatively, if at least two target BVs are obtained, at least two reference blocks corresponding to the at least two target BVs are determined, and then the at least two reference blocks are weighted, to determine the prediction block of the current block.
[0322] In some embodiments, after determining the prediction block of the current block, reference may be made to FIG. 17, and the method may further include the following.
[0323] At S1701, a residual block of the current block is determined according to the prediction block of the current block.
[0324] At S1702, the residual block of the current block is encoded, and a resulting encoded bit is signalled into the bitstream.
[0325] In embodiments of the disclosure, the residual block of the current block may be determined as follows. An original block of the current block is determined. The residual block of the current block is determined according to the original block of the current block and the prediction block of the current block. Specifically, the residual block of the current block is determined by subtracting the prediction block of the current block from the original block of the current block.
[0326] In embodiments of the disclosure, the residual block of the current block may also be transformed and quantized, and then encoded into the bitstream. As such, after the residual block of the current block is encoded into the bitstream, a reconstruction process of the current block can be facilitated at the decoding end.
[0327] It can also be understood that, a bitstream is provided in embodiments of the disclosure. The bitstream is generated through bit encoding based on information to be encoded. The information to be encoded includes at least one of: a residual value of a current block, a collocated-picture index of the current block, or a value of a first syntax element. The first syntax element indicates whether a temporal candidate BV is used as a candidate item for constructing a candidate merge list for the current block.
[0328] An encoding method is provided in embodiments of the disclosure. At least one collocated picture of a current block is first determined, one or more temporal candidate BVs of the current block are determined according to the at least one collocated picture, and then a candidate merge list is constructed based on the one or more temporal candidate BVs. That is, during construction of the candidate merge list, the one or more temporal candidate BVs are considered as candidate items in the candidate merge list, which can not only effectively alleviate the problem that the candidate merge list is not full, but also improve prediction accuracy with the candidate merge list, e.g., prediction performance of IBC and / or IntraTMP in the merge list mode, without introducing additional software and hardware implementation complexity, thereby improving coding efficiency.
[0329] In yet another embodiment of the disclosure, based on the encoding method and the decoding method described in the foregoing embodiments, the technical solutions of embodiments of the disclosure are applicable to the IntraTMP mode or the IBC mode in an inter prediction picture within the overall encoding and decoding framework.
[0330] In some embodiments, at an encoding end, when an encoder uses the IBC mode for the current block and a candidate merge list needs to be constructed, or when the encoder uses the IntraTMP mode for the current block and a candidate merge list needs to be constructed, in the technical solutions, temporal candidate BVs will be applied to supplement the constructed candidate merge list, i.e., to fill an IBC merge list or an IntraTMP merge list.
[0331] In some embodiments, at a decoding end, when a decoder determines that the IBC mode is used for the current block and a candidate merge list needs to be constructed, or determines that the IntraTMP mode is used for the current block and a candidate merge list needs to be constructed, in the technical solutions, temporal candidate BVs will be applied to supplement the constructed candidate merge list, i.e., to fill the IBC merge list or the IntraTMP merge list.
[0332] In a possible implementation, after encoding and decoding, each picture / each coding unit stores its motion information in a motion-information buffer. The motion information includes the following:
[0333] © When a reference position is an inter prediction block, the motion information needs to include information such as an MV; and
[0334] © When the reference position is an IBC prediction block or an IntraTMP prediction block, the motion information needs to include: a BV, a flip type of a block, whether illumination compensation is used, whether filtering is used, etc. In addition, since the IBC mode is used for the reference position and the IBC mode may be a weighted mode, there may be multiple (two) BVs, and thus multiple BVs may be stored in the motion information.
[0335] In another possible implementation, as illustrated in FIG. 11, in the technical solutions, temporal BVs may be obtained as follows.
[0336] Step 1, a buffer storing motion information of a collocated picture is found according to an index of the collocated picture.
[0337] Step 2, motion information is obtained from the motion-information buffer according to reference-position information.
[0338] Step 3, whether the motion information includes a BV is determined, and if the motion information includes an available BV, the BV is obtained.
[0339] Specifically, obtaining the temporal BVs may include the following features.
[0340] Feature A, the temporal BVs can be obtained according to a collocated picture(s). For an inter-coded picture, it can be determined, according to a collocated-picture index encoded into the bitstream or parsed from the bitstream, that there may be one or more collocated pictures (corresponding to the collocated picture at Step 1).
[0341] © If the current picture has no collocated picture, temporal BVs are not further obtained;
[0342] © If the current picture has only one collocated picture, BVs are further obtained according to the collocated picture; and
[0343] © If the current picture has more than one collocated picture, BVs are further obtained according to one or more of the collocated pictures.
[0344] Exemplarily, in reference software implementations, it can be supported that one inter picture has two collocated pictures. BVs may be obtained according to only one of the collocated pictures, or may be obtained according to both collocated pictures.
[0345] In embodiments of the disclosure, for an inter-coded picture, a corresponding collocated picture is obtained. According to a syntax element parsed from the bitstream, it is determined whether the number of collocated pictures for the current picture is one or two: (1) If it is one, the temporal BVs are obtained according to one collocated picture; and (2) If it is two, the temporal BVs are obtained according to both collocated pictures. That is, in the technical solutions, BVs can be searched for at reference positions in the one or more collocated pictures.
[0346] Feature B, BVs are obtained at one or more reference positions in the collocated picture(s), e.g., the reference positions defined in Table 3 above (corresponding to the reference positions in the collocated picture(s) at Step 2).
[0347] In Table 3, X0 and Y0 represent the horizontal coordinate and the vertical coordinate of the bottom-right position of the current block in the current picture, X1 and Y1 represent the horizontal coordinate and the vertical coordinate of the center position of the current block in the current picture, and W and H represent the width and the height of the current block. That is, in the technical solutions, BVs are searched for at a primary position / a secondary position in the collocated picture(s) in the order and manner as illustrated in Table 3.
[0348] It can be noted that, the temporal reference positions are mostly positions of the current block or positions to the right, bottom-right, and below the current block. Since these positions have not yet been encoded / decoded in the current picture, required information cannot be obtained. However, for a temporal reference picture, the collocated picture(s) has already been encoded / decoded, and required information can be stored and retrieved. In some embodiments, positions within the current block or positions in directions such as top-left, top, top-right, left, bottom-left, etc., may also be selected as temporal positions.
[0349] In embodiments of the disclosure, the reference positions in the collocated picture may include the 10 primary positions and 10 secondary positions in Table 3. The primary positions are added in an order of position indices 1 to 10. When a primary position does not satisfy a condition (the primary position is not within a range of the collocated picture, or other conditions such as not being within a range of a collocated sub-picture, slice, CTU, etc.), a corresponding secondary position is used to replace the primary position. If the secondary position also does not satisfy the condition, the position index is skipped, and a primary position or a secondary position of the next position index is directly added.
[0350] Further, in the technical solutions, in addition to BVs at the temporal reference positions (which may be referred to as “temporal BVs”), BVs at offset temporal reference positions (which may be referred to as “offset temporal BVs”) can be obtained by offsetting the reference positions according to searched MVs.
[0351] First, according to an order of indices 0-4, MVs of the five positions around the current block in FIG. 13 and reference-picture indices pointed to by the MVs are found, respectively. Coordinates of the five positions in the current picture are as illustrated in Table 4 above.
[0352] In some embodiments, an offset MV in the collocated picture may also be obtained according to other positions around the current block, and multiple offset MVs may be found for one collocated picture to guide the offset.
[0353] Second, when an accessed position is an inter-coded block, an MV of the accessed position and a reference-picture index pointed to by the MV are further obtained. If a pointed reference picture is the collocated picture, the MV is recorded for offsetting the reference positions. For all collocated pictures of the current picture, one MV corresponding to each collocated picture is found in order.
[0354] Third, the reference positions are offset according to the found MVs of the collocated pictures. For example, if the current picture has two collocated pictures, i.e., Frame 0 and Frame 1, and two found MVs are MV0' and MV1', MV0' and MV1' are first rounded (to avoid finding a sub-sample position) to obtain MV0 and MV1. Then, whether each of the reference positions contains a BV is checked in corresponding collocated pictures according to the order in Table 5 above.
[0355] In Table 5, MV0.X and MV0.Y are a horizontal offset and a vertical offset of an integer MV corresponding to collocated picture 0 (Frame 0), respectively, and MV1.X and MV1.Y are a horizontal offset and a vertical offset of an integer MV corresponding to collocated picture 1 (Frame 1), respectively. As can be seen from Table 5, the reference positions in Table 5 are obtained by alternately offsetting the original 10 reference positions according to collocated picture 0 and collocated picture 1. The primary positions are added in the order of positions 1-20 in Table 5. Similarly, if a primary position does not satisfy the condition, the secondary position is used. If the secondary position also does not satisfy the condition, the current position order is skipped. The condition is the same as described above.
[0356] In some embodiments, when multiple offset vectors are found for one collocated picture to offset the reference positions, e.g., offset vectors MV00, MV01, etc., are found for collocated picture 0, there may be more offset reference positions correspondingly. That is, in the technical solutions, when the multiple offset vectors are found for one collocated picture, defined offset reference positions can also be increased.
[0357] Feature C, when the motion information obtained according to the collocated picture contains one or more BVs (corresponding to obtaining the BVs at Step 3):
[0358] © If the current motion information contains one available BV, the BV is obtained; and
[0359] © If the current motion information contains multiple available BVs, more than one BV can be obtained.
[0360] That is, in embodiments of the disclosure, as many BVs as the number of BVs contained in the motion information can be obtained. Specifically, if the motion information includes multiple BVs, one or more BVs can be added as temporal BVs.
[0361] In the reference software, when IBC weighted prediction is used for a block, the block will have two BVs stored as motion information; and when the IntraTMP mode or the non weighted IBC prediction mode is used for a block, one BV will be stored as motion information. In embodiments of the disclosure, if motion information of a reference position in a collocated picture includes one BV, the BV can be added to the candidate merge list; and if there are two BVs, the two BVs can be added to the candidate merge list.
[0362] Further, in addition to the features for obtaining the temporal BVs described above, the following features may also be included:
[0363] © during addition of BVs to the initial merge list, a duplication check is required, to avoid repeatedly adding a BV that is identical to an existing BV in the initial merge list;
[0364] © temporal BVs (in an order of reference positions in a collocated picture) are added first, followed by offset temporal BVs (in an order of offset reference positions in the collocated picture). When the number of added BVs reaches an upper limit set for the candidate merge list, the addition stops;
[0365] © the number of temporal BVs and the number of offset temporal BVs may be limited separately or jointly. For example, at most N temporal BVs and M offset temporal BVs can be added, or the total number of temporal BVs and offset temporal BVs added does not exceed P; and
[0366] © temporal BVs and offset temporal BVs can be added only when the video sequence is of a screen content type. Whether the temporal BVs and the offset temporal BVs can be added to the candidate merge list may be controlled by some syntax elements, which may be at a sequence level, a picture level, a slice level, a block level, etc. Only when a syntax element obtained through encoding and decoding is enabled, the temporal BVs and the offset temporal BVs can be added to the candidate merge list.
[0367] In the related art, the initial merge list includes:
[0368] (1) an initial merge list for an IBC mode: BVs of adjacent blocks, BVs of non adjacent blocks, history BVs, and auto-relocated BVs, etc.; and
[0369] (2) an initial merge list for an IntraTMP mode: BVs of adjacent blocks and BVs of non-adjacent blocks.
[0370] In embodiments of the disclosure, the temporal BVs and the offset temporal BVs can be added to the initial merge list in a certain order together with existing types of BVs, to obtain the candidate merge list.
[0371] For example, for the candidate merge list for the IBC mode, the temporal BVs and the offset temporal BVs need to be added before the auto-relocated BVs and after the BVs of the adjacent blocks. The order may be as follows:
[0372] a. BVs of adjacent blocks, BVs of non-adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, history BVs, auto-relocated BVs, etc.;
[0373] b. BVs of adjacent blocks, first-type temporal candidate BVs, BVs of non-adjacent blocks, second-type temporal candidate BVs, history BVs, auto-relocated BVs, etc.; and
[0374] c. BVs of adjacent blocks, BVs of non-adjacent blocks, history BVs, first-type temporal candidate BVs, second-type temporal candidate BVs, auto-relocated BVs, etc.
[0375] For example, for the candidate merge list for the IntraTMP mode, the temporal BVs and the offset temporal BVs need to be located after the BVs of the adjacent blocks. The order may be as follows:
[0376] a. BVs of adjacent blocks, BVs of non-adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, etc.;
[0377] b. BVs of adjacent blocks, first-type temporal candidate BVs, second-type temporal candidate BVs, BVs of non-adjacent blocks, etc.; and
[0378] c. BVs of adjacent blocks, first-type temporal candidate BVs, BVs of non-adjacent blocks, second-type temporal candidate BVs, etc.
[0379] In some embodiments, the auto-relocated BVs may also be added to the candidate merge list for the IntraTMP mode. In this case, similarly, the auto-relocated BVs can be added after the temporal BVs and the offset temporal BVs.
[0380] In embodiments of the disclosure, the temporal BVs and the offset temporal BVs are taken as new types of BV candidates, which can not only effectively alleviate the problem that the merge list is not full, but also improve prediction performance of IBC and IntraTMP in the merge list mode, without introducing additional software and hardware implementation complexity. For example, in the ECM reference software, the total number of temporal BVs and offset temporal BVs used in an IBC merge list does not exceed 8, a list is constructed in an order of adjacent BVs, non-adjacent BVs, temporal BVs, offset temporal BVs, history BVs, autorelocated BVs, etc., and the following test results can be obtained. Table 6 Random Access Main 10 Over anchor Y U V EncT DecT EncVmPeak DecVmPeak Class F -0.06% -0.01% -0.11% 100.5% 100.4% 100.0% 99.6% Class TGM -0.39% -0.38% -0.48% 100.5% 100.3% 99.7% 100.2%
[0381] As can be seen from Table 6, since the temporal BVs are present only when the current picture is an inter-coded picture, Table 6 shows the results under a random access (RA) configuration. As can be seen, the method brings an improvement in encoding performance of Y / U / V three channels for Class F video sequence and Class TGM video sequence, and encoding time (EncT) / decoding time (DecT) and encoding memory overhead (e.g., EncVmPeak) / decoding memory overhead (e.g., DecVmPeak) do not bring changes to the complexity of encoding and decoding or memory overhead, thereby improving the encoding and decoding efficiency.
[0382] A method for constructing a candidate merge list based on temporal candidate BVs is provided in embodiments of the disclosure. As can be seen from elaborations of specific implementations of the foregoing embodiments, according to the technical solutions of the foregoing embodiments, it is proposed to use the temporal BVs and the offset temporal BVs as candidates for filling the candidate merge list. Temporal candidate BVs and offset temporal candidate BVs can be obtained according to one or more collocated pictures. When motion information found based on BVs includes multiple BVs, one or more BVs can be obtained. For the number of temporal BVs and offset temporal BVs, an upper limit can be set separately or jointly during the filling of the candidate merge list. Whether the temporal BVs and the offset temporal BVs are added as candidates to the candidate merge list may be determined based on encoded / decoded syntax elements. In addition, whether the temporal BVs and the offset temporal BVs are added as candidates to the candidate merge list may be determined based on whether a video sequence or a bitstream to be encoded / decoded is of a screen content category. Therefore, the one or more temporal candidate BVs are considered as candidate items in the candidate merge list, which can not only effectively alleviate the problem that the candidate merge list is not full, but also improve prediction accuracy with the candidate merge list, e.g., prediction performance of IBC and / or IntraTMP in the merge list mode, without introducing additional software and hardware implementation complexity, thereby improving coding efficiency.
[0383] In yet another embodiment of the disclosure, based on the same inventive concept as the foregoing embodiments, FIG. 18 is a schematic structural diagram of an encoder provided in embodiments of the disclosure. As illustrated in FIG. 18, the encoder 180 may include a first determining unit 1801 and a first construction unit 1802. The first determining unit 1801 is configured to determine at least one collocated picture of a current block, and determine one or more temporal candidate BVs of the current block according to the at least one collocated picture. The first construction unit 1802 is configured to construct a candidate merge list based on the one or more temporal candidate BVs.
[0384] In some embodiments, the first determining unit 1801 is further configured to determine X first-type temporal candidate BVs according to the at least one collocated picture, and determine the one or more temporal candidate BVs of the current block according to the X first-type temporal candidate BVs, where X is a positive integer.
[0385] In some embodiments, the first determining unit 1801 is further configured to determine Y second-type temporal candidate BVs according to the at least one collocated picture, and determine the one or more temporal candidate BVs of the current block according to the Y second-type temporal candidate BVs, where Y is a positive integer.
[0386] In some embodiments, the first determining unit 1801 is further configured to determine X first-type temporal candidate BVs and Y second-type temporal candidate BVs according to the at least one collocated picture, and determine the one or more temporal candidate BVs of the current block according to the X first-type temporal candidate BVs and the Y second-type temporal candidate BVs, where X and Y each are a positive integer.
[0387] In some embodiments, the first determining unit 1801 is further configured to determine K temporal BVs for each of the at least one collocated picture, where K is an integer greater than or equal to 0; and determine the X first-type temporal candidate BVs according to the K temporal BVs for each of the at least one collocated picture.
[0388] In some embodiments, the first determining unit 1801 is further configured to determine one or more reference positions in a first collocated picture, and determine K temporal BVs for the first collocated picture according to the one or more reference positions, where the first collocated picture is any one of the at least one collocated picture.
[0389] In some embodiments, the first determining unit 1801 is further configured to determine a current reference position corresponding to a current position index; determine H temporal BVs according to the current reference position when the current reference position satisfies a first condition, where H is an integer greater than or equal to 0; and determine a reference position corresponding to a next position index based on a first position-index order, determine the reference position corresponding to the next position index as the current reference position, and proceed to determining whether the current reference position satisfies the first condition until the one or more reference positions have been traversed, to obtain the K temporal BVs for the first collocated picture.
[0390] In some embodiments, reference may be made to FIG. 18, and the encoder 180 further includes a first deciding unit 1803. The first deciding unit 1803 is configured to determine whether a primary position in the current reference position satisfies the first condition. The first determining unit 1801 is further configured to determine the H temporal BVs according to the primary position in the current reference position when the primary position in the current reference position satisfies the first condition. The first deciding unit 1803 is further configured to determine whether a secondary position in the current reference position satisfies the first condition when the primary position in the current reference position does not satisfy the first condition. The first determining unit 1801 is further configured to determine the H temporal BVs according to the secondary position in the current reference position when the secondary position in the current reference position satisfies the first condition.
[0391] In some embodiments, the primary position in the current reference position satisfies the first condition as follows. The primary position in the current reference position is within a range of the first collocated picture. The secondary position in the current reference position satisfies the first condition as follows. The secondary position in the current reference position is within the range of the first collocated picture.
[0392] In some embodiments, the first determining unit 1801 is further configured to, when the current reference position does not satisfy the first condition, skip the current reference position, determine the reference position corresponding to the next position index based on the first position-index order, determine the reference position corresponding to the next position index as the current reference position, and proceed to determining whether the current reference position satisfies the first condition. The current reference position does not satisfy the first condition as follows. The primary position in the current reference position does not satisfy the first condition, and the secondary position in the current reference position does not satisfy the first condition.
[0393] In some embodiments, the first determining unit 1801 is further configured to determine I offset temporal BVs for each of the at least one collocated picture, where I is an integer greater than or equal to 0; and determine the Y second-type temporal candidate BVs according to the I offset temporal BVs for each of the at least one collocated picture.
[0394] In some embodiments, the first determining unit 1801 is further configured to determine a first MV of a first collocated picture, and determine one or more initial reference positions of the current block; offset the one or more initial reference positions according to the first MV, to obtain one or more offset reference positions in the first collocated picture; and determine I offset temporal BVs for the first collocated picture according to the one or more offset reference positions in the first collocated picture, where the first collocated picture is any one of the at least one collocated picture.
[0395] In some embodiments, the first determining unit 1801 is further configured to determine respective MVs of multiple candidate positions around the current block and reference-picture indices pointed to by the MVs; and determine a current candidate position from the multiple candidate positions based on a preset position order, and determine an MV of the current candidate position as the first MV of the first collocated picture according to a current reference-picture index pointed to by the MV of the current candidate position when a reference picture indicated by the current reference-picture index is the first collocated picture.
[0396] In some embodiments, the first determining unit 1801 is further configured to perform correction on the MV of the current candidate position, and determine the corrected MV as the first MV of the first collocated picture.
[0397] In some embodiments, the first determining unit 1801 is further configured to, when the at least one collocated picture includes a first collocated picture and a second collocated picture, determine a first MV of the first collocated picture and a second MV of the second collocated picture, and determine one or more initial reference positions of the current block. The first determining unit 1801 is further configured to offset the one or more initial reference positions according to the first MV, to obtain one or more offset reference positions in the first collocated picture; and offset the one or more initial reference positions according to the second MV, to obtain one or more offset reference positions in the second collocated picture. The first determining unit 1801 is further configured to determine the I offset temporal BVs for each of the at least one collocated picture according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture.
[0398] In some embodiments, the first determining unit 1801 is further configured to determine a current offset reference position corresponding to a current position index. The first determining unit 1801 is further configured to determine J offset temporal BVs according to the current offset reference position when the current offset reference position satisfies a second condition, where J is an integer greater than or equal to 0. The first determining unit 1801 is further configured to determine an offset reference position corresponding to a next position index based on a second position-index order, determine the offset reference position corresponding to the next position index as the current offset reference position, and proceed to determining whether the current offset reference position satisfies the second condition until all offset reference positions have been traversed, to obtain the I offset temporal BVs for each of the at least one collocated picture.
[0399] In some embodiments, the first determining unit 1801 is further configured to alternately arrange the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture, to determine the second position-index order.
[0400] In some embodiments, the first deciding unit 1803 is further configured to determine whether a primary position in the current offset reference position satisfies the second condition. The first determining unit 1801 is further configured to determine the J offset temporal BVs according to the primary position in the current offset reference position when the primary position in the current offset reference position satisfies the second condition. The first deciding unit 1803 is further configured to determine whether a secondary position in the current offset reference position satisfies the second condition when the primary position in the current offset reference position does not satisfy the second condition. The first determining unit 1801 is further configured to determine the J offset temporal BVs according to the secondary position in the current offset reference position when the secondary position in the current offset reference position satisfies the second condition.
[0401] In some embodiments, the primary position in the current offset reference position satisfies the second condition as follows. The primary position in the current offset reference position is within a range of the first collocated picture. The secondary position in the current offset reference position satisfies the second condition as follows. The secondary position in the current offset reference position is within the range of the first collocated picture.
[0402] In some embodiments, the first determining unit 1801 is further configured to, when the current offset reference position does not satisfy the second condition, skip the current offset reference position, determine the offset reference position corresponding to the next position index based on the second position-index order, determine the offset reference position corresponding to the next position index as the current offset reference position, and proceed to determining whether the current offset reference position satisfies the second condition. The current offset reference position does not satisfy the second condition as follows. The primary position in the current offset reference position does not satisfy the second condition, and the secondary position in the current offset reference position does not satisfy the second condition.
[0403] In some embodiments, the first determining unit 1801 is further configured to determine an initial merge list for the current block, and add the one or more temporal candidate BVs to the initial merge list, to obtain the candidate merge list.
[0404] In some embodiments, the first determining unit 1801 is further configured to discard the current temporal candidate BV when the initial merge list contains a candidate item identical to the current temporal candidate BV; and add the current temporal candidate BV to the initial merge list when the initial merge list contains no candidate item identical to the current temporal candidate BV.
[0405] In some embodiments, the one or more temporal candidate BVs include X first-type temporal candidate BVs and Y second-type temporal candidate BVs, where X and Y each are a positive integer. The first determining unit 1801 is further configured to add the X first-type temporal candidate BVs to the initial merge list. The first determining unit 1801 is further configured to, when the initial merge list is in an unfilled state, continue to add the Y second-type temporal candidate BVs to the initial merge list until the initial merge list is full.
[0406] In some embodiments, the first determining unit 1801 is further configured to add N first-type temporal candidate BVs among the X first-type temporal candidate BVs and M second-type temporal candidate BVs among the Y second-type temporal candidate BVs to the initial merge list, where N is an integer greater than 0 and less than or equal to a first threshold, and M is an integer greater than 0 and less than or equal to a second threshold.
[0407] In some embodiments, the first determining unit 1801 is further configured to add P temporal candidate BVs among the one or more temporal candidate BVs to the initial merge list, where the P temporal candidate BVs include first-type temporal candidate BVs and second-type temporal candidate BVs, and P is an integer greater than 0 and less than or equal to a third threshold.
[0408] In some embodiments, the first determining unit 1801 is further configured to determine a prediction mode for the current block; and perform the determination of the at least one collocated picture of the current block when the prediction mode for the current block satisfies a preset condition.
[0409] In some embodiments, the first construction unit 1802 is further configured to determine that an IntraTMP mode is used for the current block and the candidate merge list is constructed for prediction, or determine that an IBC mode is used for the current block and the candidate merge list is constructed for prediction.
[0410] In some embodiments, the first determining unit 1801 is further configured to determine a video sequence to which the current block belongs; and perform the determination of the at least one collocated picture of the current block when the video sequence is of a screen content category.
[0411] In some embodiments, the first determining unit 1801 is further configured to perform the determination of the at least one collocated picture of the current block when a temporal candidate BV is used as a candidate item for constructing the candidate merge list for the current block.
[0412] In some embodiments, reference may be made to FIG. 18, and the encoder 180 further includes an encoding unit 1804. The first determining unit 1801 is further configured to determine a value of a first syntax element, where the first syntax element indicates whether the temporal candidate BV is used as the candidate item for constructing the candidate merge list for the current block. The first determining unit 1801 is further configured to encode the value of the first syntax element, and signal a resulting encoded bit into a bitstream.
[0413] In some embodiments, the first determining unit 1801 is further configured to determine a collocated-picture index of the current block according to the at least one collocated picture of the current block. The first determining unit 1801 is further configured to encode the collocated-picture index of the current block, and signal a resulting encoded bit into a bitstream.
[0414] In some embodiments, the first determining unit 1801 is further configured to determine one or more target BVs of the current block according to the candidate merge list; determine a prediction block of the current block according to the one or more target BVs of the current block; and determine a residual block of the current block according to the prediction block of the current block.
[0415] In some embodiments, the encoding unit 1804 is further configured to encode the residual block of the current block, and signal a resulting encoded bit into a bitstream.
[0416] It can be understood that, in embodiments of the disclosure, a “unit” may be a part of a circuit, a part of a processor, a part of a program or software, etc., and may also be a module or non-modular. Moreover, the components in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated units may be implemented in the form of hardware or in the form of software functional modules.
[0417] In yet another embodiment of the disclosure, FIG. 19 is a schematic structural diagram of a specific hardware implementation of an encoder according to an embodiment of the disclosure. As illustrated in FIG. 19, the encoder 350 may include a first communication interface 1901, a first memory 1902, and a first processor 1903. These components are coupled together through a first bus system 1904. It can be understood that the first bus system 1904 is used to realize connection and communication among these components. In addition to a data bus, the first bus system 1904 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 1904 in FIG. 19.
[0418] The first communication interface 1901 is used for receiving and sending signals during the process of sending and receiving information with other external network elements.
[0419] The first memory 1902 is configured to store a computer program executable on the first processor 1903.
[0420] The first processor 1903 is configured to perform the following operations when executing the computer program: determining at least one collocated picture of a current block; determining one or more temporal candidate BVs of the current block according to the at least one collocated picture; and constructing a candidate merge list based on the one or more temporal candidate BVs.
[0421] It can be understood that the first memory 1902 in embodiments of the disclosure may be a volatile memory or a non-volatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random-access memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as static randomaccess 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), synchronous link dynamic random-access memory (SLDRAM), and direct rambus randomaccess memory (DRRAM). 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 types of memory.
[0422] The first processor 1903 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above methods may be completed by hardware integrated logic circuits or software instructions in the first processor 1903. The above 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 devices, discrete gate or transistor logic devices, or discrete hardware components. It may implement or execute the methods, steps, and logical block diagrams disclosed in embodiments of the disclosure. The general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc. The steps of the methods disclosed in conjunction with embodiments of the disclosure may be directly embodied as being executed by a hardware decoding processor, or executed by a combination of 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 programmable memory, or registers. The storage medium is located in the first memory 1902, and the first processor 1903 reads the information in the first memory 1902 and completes the steps of the above methods in combination with its hardware.
[0423] It can be understood that the embodiments described in the disclosure may be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in 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, microcontrollers, microprocessors, other electronic units for performing the functions described in the disclosure, or a combination thereof. For software implementation, the techniques described in the disclosure may be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described in the disclosure. Software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
[0424] Optionally, as another embodiment, the first processor 1903 is further configured to, when executing the computer program, perform the method described in any one of the foregoing embodiments.
[0425] An encoder is provided in embodiments of the disclosure. In the encoder, during construction of the candidate merge list, the one or more temporal candidate BVs are considered as candidate items in the candidate merge list, which can not only effectively alleviate the problem that the candidate merge list is not full, but also improve prediction accuracy with the candidate merge list, e.g., prediction performance of IBC and / or IntraTMP in the merge list mode, without introducing additional software and hardware implementation complexity, thereby improving coding efficiency.
[0426] In yet another embodiment of the disclosure, based on the same inventive concept as the previous embodiments, FIG. 20 is a schematic structural diagram of a decoder provided in embodiments of the disclosure. As illustrated in FIG. 20, the decoder 200 may include a second determining unit 2001 and a second construction unit 2002. The second determining unit 2001 is configured to determine at least one collocated picture of a current block, and determine one or more temporal candidate BVs of the current block according to the at least one collocated picture. The second construction unit 2002 is configured to construct a candidate merge list based on the one or more temporal candidate BVs.
[0427] In some embodiments, reference may be made to FIG. 20, and the decoder 200 further includes a decoding unit 2003. The decoding unit 2003 is configured to parse a bitstream to determine a collocated-picture index of the current block. The second determining unit 2001 is further configured to determine the at least one collocated picture of the current block according to the collocated-picture index.
[0428] In some embodiments, the second determining unit 2001 is further configured to determine one collocated picture of the current block when the collocated-picture index includes one index; and determine two collocated pictures of the current block when the collocated-picture index includes two indices.
[0429] In some embodiments, the second determining unit 2001 is further configured to determine X first-type temporal candidate BVs according to the at least one collocated picture; and determine the one or more temporal candidate BVs of the current block according to the X first-type temporal candidate BVs, where X is a positive integer.
[0430] In some embodiments, the second determining unit 2001 is further configured to determine Y second-type temporal candidate BVs according to the at least one collocated picture; and determine the one or more temporal candidate BVs of the current block according to the Y second-type temporal candidate BVs, where Y is a positive integer.
[0431] In some embodiments, the second determining unit 2001 is further configured to determine X first-type temporal candidate BVs and Y second-type temporal candidate BVs according to the at least one collocated picture; and determine the one or more temporal candidate BVs of the current block according to the X first-type temporal candidate BVs and the Y second-type temporal candidate BVs, where X and Y each are a positive integer.
[0432] In some embodiments, the second determining unit 2001 is further configured to determine K temporal BVs for each of the at least one collocated picture, where K is an integer greater than or equal to 0; and determine the X first-type temporal candidate BVs according to the K temporal BVs for each of the at least one collocated picture.
[0433] In some embodiments, the second determining unit 2001 is further configured to determine one or more reference positions in a first collocated picture, and determine K temporal BVs for the first collocated picture according to the one or more reference positions, where the first collocated picture is any one of the at least one collocated picture.
[0434] In some embodiments, the second determining unit 2001 is further configured to determine a current reference position corresponding to a current position index. The second determining unit 2001 is further configured to determine H temporal BVs according to the current reference position when the current reference position satisfies a first condition, where H is an integer greater than or equal to 0. The second determining unit 2001 is further configured to determine a reference position corresponding to a next position index based on a first positionindex order, determine the reference position corresponding to the next position index as the current reference position, and proceed to determining whether the current reference position satisfies the first condition until the one or more reference positions have been traversed, to obtain the K temporal BVs for the first collocated picture.
[0435] In some embodiments, the reference position includes a primary position and a secondary position. Reference may be made to FIG. 20, and the decoder 200 further includes a second deciding unit 2004. The second deciding unit 2004 is configured to determine whether the primary position in the current reference position satisfies the first condition. The second determining unit 2001 is further configured to determine the H temporal BVs according to the primary position in the current reference position when the primary position in the current reference position satisfies the first condition. The second deciding unit 2004 is further configured to determine whether the secondary position in the current reference position satisfies the first condition when the primary position in the current reference position does not satisfy the first condition. The second determining unit 2001 is further configured to determine the H temporal BVs according to the secondary position in the current reference position when the secondary position in the current reference position satisfies the first condition.
[0436] In some embodiments, the primary position in the current reference position satisfies the first condition as follows. The primary position in the current reference position is within a range of the first collocated picture. The secondary position in the current reference position satisfies the first condition as follows. The secondary position in the current reference position is within the range of the first collocated picture.
[0437] In some embodiments, the second determining unit 2001 is further configured to, when the current reference position does not satisfy the first condition, skip the current reference position, determine the reference position corresponding to the next position index based on the first position-index order, determine the reference position corresponding to the next position index as the current reference position, and proceed to determining whether the current reference position satisfies the first condition. The current reference position does not satisfy the first condition as follows. The primary position in the current reference position does not satisfy the first condition, and the secondary position in the current reference position does not satisfy the first condition.
[0438] In some embodiments, the second determining unit 2001 is further configured to determine I offset temporal BVs for each of the at least one collocated picture, where I is an integer greater than or equal to 0; and determine the Y second-type temporal candidate BVs according to the I offset temporal BVs for each of the at least one collocated picture.
[0439] In some embodiments, the second determining unit 2001 is further configured to determine a first MV of a first collocated picture, and determine one or more initial reference positions of the current block; offset the one or more initial reference positions according to the first MV, to obtain one or more offset reference positions in the first collocated picture; and determine I offset temporal BVs for the first collocated picture according to the one or more offset reference positions in the first collocated picture, where the first collocated picture is any one of the at least one collocated picture.
[0440] In some embodiments, the second determining unit 2001 is further configured to determine respective MVs of multiple candidate positions around the current block and reference-picture indices pointed to by the MVs. The second determining unit 2001 is further configured to determine a current candidate position from the multiple candidate positions based on a preset position order, and determine an MV of the current candidate position as the first MV of the first collocated picture according to a current reference-picture index pointed to by the MV of the current candidate position when a reference picture indicated by the current referencepicture index is the first collocated picture.
[0441] In some embodiments, the second determining unit 2001 is further configured to perform correction on the MV of the current candidate position, and determine the corrected MV as the first MV of the first collocated picture.
[0442] In some embodiments, the second determining unit 2001 is further configured to, when the at least one collocated picture includes a first collocated picture and a second collocated picture, determine a first MV of the first collocated picture and a second MV of the second collocated picture, and determine one or more initial reference positions of the current block. The second determining unit 2001 is further configured to offset the one or more initial reference positions according to the first MV, to obtain one or more offset reference positions in the first collocated picture; and offset the one or more initial reference positions according to the second MV, to obtain one or more offset reference positions in the second collocated picture. The second determining unit 2001 is further configured to determine the I offset temporal BVs for each of the at least one collocated picture according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture.
[0443] In some embodiments, the second determining unit 2001 is further configured to determine a current offset reference position corresponding to a current position index. The second determining unit 2001 is further configured to determine J offset temporal BVs according to the current offset reference position when the current offset reference position satisfies a second condition, where J is an integer greater than or equal to 0. The second determining unit 2001 is further configured to determine an offset reference position corresponding to a next position index based on a second position-index order, determine the offset reference position corresponding to the next position index as the current offset reference position, and proceed to determining whether the current offset reference position satisfies the second condition until all offset reference positions have been traversed, to obtain the I offset temporal BVs for each of the at least one collocated picture.
[0444] In some embodiments, the second determining unit 2001 is further configured to alternately arrange the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture, to determine the second position-index order.
[0445] In some embodiments, the offset reference position includes a primary position and a secondary position. The second deciding unit 2004 is further configured to determine whether the primary position in the current offset reference position satisfies the second condition. The second determining unit 2001 is further configured to determine the J offset temporal BVs according to the primary position in the current offset reference position when the primary position in the current offset reference position satisfies the second condition. The second deciding unit 2004 is further configured to determine whether the secondary position in the current offset reference position satisfies the second condition when the primary position in the current offset reference position does not satisfy the second condition. The second determining unit 2001 is further configured to determine the J offset temporal BVs according to the secondary position in the current offset reference position when the secondary position in the current offset reference position satisfies the second condition.
[0446] In some embodiments, the primary position in the current offset reference position satisfies the second condition as follows. The primary position in the current offset reference position is within a range of the first collocated picture. The secondary position in the current offset reference position satisfies the second condition as follows. The secondary position in the current offset reference position is within the range of the first collocated picture.
[0447] In some embodiments, the second determining unit 2001 is further configured to, when the current offset reference position does not satisfy the second condition, skip the current offset reference position, determine the offset reference position corresponding to the next position index based on the second position-index order, determine the offset reference position corresponding to the next position index as the current offset reference position, and proceed to determining whether the current offset reference position satisfies the second condition. The current offset reference position does not satisfy the second condition as follows. The primary position in the current offset reference position does not satisfy the second condition, and the secondary position in the current offset reference position does not satisfy the second condition.
[0448] In some embodiments, the second determining unit 2001 is further configured to determine an initial merge list for the current block, and add the one or more temporal candidate BVs to the initial merge list, to obtain the candidate merge list.
[0449] In some embodiments, the second determining unit 2001 is further configured to discard the current temporal candidate BV when the initial merge list contains a candidate item identical to the current temporal candidate BV; and add the current temporal candidate BV to the initial merge list when the initial merge list contains no candidate item identical to the current temporal candidate BV.
[0450] In some embodiments, the one or more temporal candidate BVs include X first-type temporal candidate BVs and Y second-type temporal candidate BVs, where X and Y each are a positive integer. The second determining unit 2001 is further configured to add the X first-type temporal candidate BVs to the initial merge list; and when the initial merge list is in an unfilled state, continue to add the Y second-type temporal candidate BVs to the initial merge list until the initial merge list is full.
[0451] In some embodiments, the second determining unit 2001 is further configured to add N first-type temporal candidate BVs among the X first-type temporal candidate BVs and M second-type temporal candidate BVs among the Y second-type temporal candidate BVs to the initial merge list, where N is an integer greater than 0 and less than or equal to a first threshold, and M is an integer greater than 0 and less than or equal to a second threshold.
[0452] In some embodiments, the second determining unit 2001 is further configured to add P temporal candidate BVs among the one or more temporal candidate BVs to the initial merge list, where the P temporal candidate BVs include first-type temporal candidate BVs and second-type temporal candidate BVs, and P is an integer greater than 0 and less than or equal to a third threshold.
[0453] In some embodiments, the second determining unit 2001 is further configured to determine a prediction mode for the current block; and perform the determination of the at least one collocated picture of the current block when the prediction mode for the current block satisfies a preset condition.
[0454] In some embodiments, the second construction unit 2002 is further configured to determine that an IntraTMP mode is used for the current block and the candidate merge list is constructed for prediction; or determine that an IBC mode is used for the current block and the candidate merge list is constructed for prediction.
[0455] In some embodiments, the second determining unit 2001 is further configured to determine a video sequence to which the current block belongs; and perform the determination of the at least one collocated picture of the current block when the video sequence is of a screen content category.
[0456] In some embodiments, the decoding unit 2003 is further configured to parse a bitstream to determine a value of a first syntax element. The second determining unit 2001 is further configured to perform the determination of the at least one collocated picture of the current block when the first syntax element indicates that a temporal candidate BV is used as a candidate item for constructing the candidate merge list for the current block.
[0457] In some embodiments, the second determining unit 2001 is further configured to determine one or more target BVs of the current block according to the candidate merge list, and determine a prediction block of the current block according to the one or more target BVs of the current block. The decoding unit 2003 is further configured to parse a bitstream to determine a residual block of the current block. The second determining unit 2001 is further configured to determine a reconstructed block of the current block according to the residual block of the current block and the prediction block of the current block.
[0458] It can be understood that, in this embodiment, a “unit” may be a part of a circuit, a part of a processor, a part of a program or software, etc., and certainly may also be a module or non-modular. Moreover, the components in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated units may be implemented in the form of hardware or in the form of software functional modules.
[0459] In yet another embodiment of the disclosure, FIG. 21 is a schematic structural diagram of a specific hardware implementation of a decoder according to an embodiment of the disclosure. As illustrated in FIG. 21, the decoder 370 may include a second communication interface 2101, a second memory 2102, and a second processor 2103. These components are coupled together through a second bus system 2104. It can be understood that the second bus system 2104 is used to realize connection and communication among these components. In addition to a data bus, the second bus system 2104 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 2104 in FIG. 21.
[0460] The second communication interface 2101 is used for receiving and sending signals during the process of sending and receiving information with other external network elements.
[0461] The second memory 2102 is configured to store a computer program executable on the second processor 2103.
[0462] The second processor 2103 is configured to, when executing the computer program, perform: determining at least one collocated picture of a current block; determining one or more temporal candidate BVs of the current block according to the at least one collocated picture; and constructing a candidate merge list based on the one or more temporal candidate BVs.
[0463] Optionally, as another embodiment, the second processor 2103 is further configured to: when executing the computer program, perform the method described in any one of the foregoing embodiments.
[0464] It can be understood that the second memory 2102 has hardware functions similar to those of the first memory 1902, and the second processor 2103 has hardware functions similar to those of the first processor 1903. Details are not repeated herein.
[0465] A decoder is provided in embodiments of the disclosure. In the decoder, during construction of the candidate merge list, the one or more temporal candidate BVs are considered as candidate items in the candidate merge list, which can not only effectively alleviate the problem that the candidate merge list is not full, but also improve prediction accuracy with the candidate merge list, e.g., prediction performance of IBC and / or IntraTMP in the merge list mode, without introducing additional software and hardware implementation complexity, thereby improving coding efficiency.
[0466] In yet another embodiment of the disclosure, FIG. 22 is a schematic structural diagram of an encoding and decoding system provided in embodiments of the disclosure. As illustrated in FIG. 22, the encoding and decoding system 220 may include an encoder 2201 and a decoder 2202.
[0467] In embodiments 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 foregoing embodiments.
[0468] In some embodiments, a computer-readable storage medium is further provided in embodiments of the disclosure. The computer-readable storage medium stores a computer program which, when executed by a processor (e.g., the first processor or the second processor), causes the processor to implement the method described in any one of the foregoing embodiments.
[0469] In some embodiments, a computer program product is further provided in embodiments of the disclosure. The computer program product includes a computer program or instructions which, when executed by a processor (e.g., the first processor or the second processor), cause the processor to implement the method described in any one of the foregoing embodiments.
[0470] In some embodiments, a computer program is further provided in embodiments of the disclosure. The computer program, when executed by a processor (e.g., the first processor or the second processor), causes the processor to implement the method described in any one of the foregoing embodiments.
[0471] Those of ordinary skill in the art may appreciate that units and algorithmic operations of various examples described in connection with embodiments of the disclosure may be implemented by electronic hardware or by a combination of computer software and electronic hardware. Whether these functions are performed by means of hardware or software depends on the application and the design constraints of the associated technical solution. Those skilled in the art may use different methods with regard to each particular application to implement the described functionality, but such methods cannot be regarded as lying beyond the scope of the disclosure.
[0472] It may be evident to those skilled in the art that, for the sake of convenience and brevity, in terms of the specific working processes of the foregoing systems, apparatuses, and units, reference can be made to the corresponding processes in the foregoing method embodiments, which will not be repeated herein.
[0473] It may be appreciated that the systems, apparatuses, and methods disclosed in embodiments of the disclosure may also be implemented in various other manners. For example, the apparatus embodiments are merely illustrative, e.g., the division of units is only a division of logical functions, and other manners of division may be available in practice, e.g., multiple units or assemblies may be combined or may be integrated into another system, or some features may be ignored or skipped. In other respects, the coupling or direct coupling or communication connection as illustrated or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or otherwise.
[0474] Separated units as illustrated may or may not be physically separated. Components displayed as units may or may not be physical units, and may reside at one location or may be distributed to multiple networked units. Some or all of the units may be selectively adopted according to practical needs to achieve desired objectives of the disclosure.
[0475] In addition, various functional units described in various embodiments of the disclosure may be integrated into one processing unit or may be present as a number of physically separated units, and two or more units may be integrated into one.
[0476] If the functions are implemented as software functional units and sold or used as standalone products, they may be stored in a computer-readable storage medium. Based on such an understanding, the essential technical solution, or the portion that contributes to the related art, or part of the technical solution of the disclosure may be embodied as software products. The computer software products can be stored in a storage medium and may include multiple instructions that, when executed, can cause a computer device, e.g., a personal computer, a server, a network device, etc., to execute some or all operations of the methods described in various embodiments of the disclosure. The storage medium may include various kinds of media that can store program codes, such as a universal serial bus (USB) flash disk, a mobile hard drive, an ROM, an RAM, a magnetic disk, or an optical disk.
[0477] It can be noted that, in the disclosure, the terms “include,” “comprise,” or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase “comprising a ...” does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0478] The serial numbers of embodiments of the disclosure are only for description and do not represent the superiority or inferiority of the embodiments.
[0479] The methods disclosed in the several method embodiments provided in the disclosure may be arbitrarily combined without conflict to obtain new method embodiments.
[0480] The features disclosed in the several product embodiments provided in the disclosure may be arbitrarily combined without conflict to obtain new product embodiments.
[0481] The features disclosed in the several method or device embodiments provided in the disclosure may be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0482] The above are only specific implementations of the disclosure, but the protection scope of the disclosure is not limited thereto. Any change or substitution that can be easily conceived by a person skilled in the art within the technical scope disclosed in the disclosure shall be covered by the protection scope of the disclosure. Therefore, the protection scope of the disclosure shall be subject to the protection scope of the claims. Industrial Applicability
[0483] In embodiments of the disclosure, whether for an encoding end or a decoding end, at least one collocated picture of a current block is first determined, one or more temporal candidate BVs of the current block are determined according to the at least one collocated picture, and then a candidate merge list is constructed based on the one or more temporal candidate BVs. That is, in an encoding method and a decoding method provided in embodiments of the disclosure, during construction of the candidate merge list, the one or more temporal candidate BVs are considered as candidate items in the candidate merge list, which can not only effectively alleviate the problem that the candidate merge list is not full, but also improve prediction accuracy with the candidate merge list, without introducing additional software and hardware implementation complexity, thereby improving coding efficiency and coding performance.
Claims
1. A decoding method, applied to a decoder and comprising:determining at least one collocated picture of a current block;determining one or more temporal candidate block vectors (BVs) of the current block according to the at least one collocated picture; andconstructing a candidate merge list based on the one or more temporal candidate BVs.
2. The method of claim 1, wherein determining the at least one collocated picture of thecurrent block comprises:parsing a bitstream to determine a collocated-picture index of the current block; and determining the at least one collocated picture of the current block according to the collocated-picture index.
3. The method of claim 2, wherein determining the at least one collocated picture of thecurrent block according to the collocated-picture index comprises:determining one collocated picture of the current block in response to the collocated-picture index comprising one index; anddetermining two collocated pictures of the current block in response to the collocated-picture index comprising two indices.
4. The method of claim 1, wherein determining the one or more temporal candidate BVs ofthe current block according to the at least one collocated picture comprises:determining X first-type temporal candidate BVs according to the at least one collocated picture; anddetermining the one or more temporal candidate BVs of the current block according to the X first-type temporal candidate BVs, wherein X is a positive integer.
5. The method of claim 1, wherein determining the one or more temporal candidate BVs ofthe current block according to the at least one collocated picture comprises:determining Y second-type temporal candidate BVs according to the at least one collocated picture; anddetermining the one or more temporal candidate BVs of the current block according to the Y second-type temporal candidate BVs, wherein Y is a positive integer.
6. The method of claim 1, wherein determining the one or more temporal candidate BVs ofthe current block according to the at least one collocated picture comprises:determining X first-type temporal candidate BVs and Y second-type temporal candidate BVs according to the at least one collocated picture; anddetermining the one or more temporal candidate BVs of the current block according to the X first-type temporal candidate BVs and the Y second-type temporal candidate BVs, wherein X and Y each are a positive integer.
7. The method of claim 4 or 6, wherein determining the X first-type temporal candidate BVsaccording to the at least one collocated picture comprises:determining K temporal BVs for each of the at least one collocated picture, wherein K is an integer greater than or equal to 0; anddetermining the X first-type temporal candidate BVs according to the K temporal BVs for each of the at least one collocated picture.
8. The method of claim 7, wherein determining the K temporal BVs for each of the at leastone collocated picture comprises:determining one or more reference positions in a first collocated picture; anddetermining K temporal BVs for the first collocated picture according to the one or more reference positions;wherein the first collocated picture is any one of the at least one collocated picture.
9. The method of claim 8, wherein determining the K temporal BVs for the first collocatedpicture according to the one or more reference positions comprises:determining a current reference position corresponding to a current position index;determining H temporal BVs according to the current reference position in response to the current reference position satisfying a first condition, wherein H is an integer greater than or equal to 0; anddetermining a reference position corresponding to a next position index based on a first position-index order, determining the reference position corresponding to the next position index as the current reference position, and proceeding to determining whether the current reference position satisfies the first condition until the one or more reference positions have been traversed, to obtain the K temporal BVs for the first collocated picture.
10. The method of claim 9, wherein the reference position comprises a primary position and a secondary position; and determining the H temporal BVs according to the current reference position in response to the current reference position satisfying the first condition comprises:determining whether the primary position in the current reference position satisfies the first condition;determining the H temporal BVs according to the primary position in the current reference position in response to the primary position in the current reference position satisfying the first condition;determining whether the secondary position in the current reference position satisfies the first condition in response to the primary position in the current reference position not satisfying the first condition; anddetermining the H temporal BVs according to the secondary position in the current reference position in response to the secondary position in the current reference position satisfying the first condition.
11. The method of claim 10, whereinthe primary position in the current reference position satisfying the first condition comprises: the primary position in the current reference position being within a range of the first collocated picture; andthe secondary position in the current reference position satisfying the first condition comprises: the secondary position in the current reference position being within the range of the first collocated picture.
12. The method of claim 10, further comprising:in response to the current reference position not satisfying the first condition, skipping thecurrent reference position, determining the reference position corresponding to the next position index based on the first position-index order, determining the reference position corresponding to the next position index as the current reference position, and proceeding to determining whether the current reference position satisfies the first condition;wherein the current reference position not satisfying the first condition comprises: the primary position in the current reference position not satisfying the first condition and the secondary position in the current reference position not satisfying the first condition.
13. The method of claim 5 or 6, wherein determining the Y second-type temporal candidate BVs according to the at least one collocated picture comprises:determining I offset temporal BVs for each of the at least one collocated picture, whereinI is an integer greater than or equal to 0; anddetermining the Y second-type temporal candidate BVs according to the I offset temporal BVs for each of the at least one collocated picture.
14. The method of claim 13, wherein determining the I offset temporal BVs for each of the at least one collocated picture comprises:determining a first motion vector (MV) of a first collocated picture, and determining one or more initial reference positions of the current block;offsetting the one or more initial reference positions according to the first MV, to obtain one or more offset reference positions in the first collocated picture; anddetermining I offset temporal BVs for the first collocated picture according to the one or more offset reference positions in the first collocated picture, wherein the first collocated picture is any one of the at least one collocated picture.
15. The method of claim 14, wherein determining the first MV of the first collocated picture comprises:determining respective MVs of a plurality of candidate positions around the current block and reference-picture indices pointed to by the MVs; anddetermining a current candidate position from the plurality of candidate positions based on a preset position order, and determining an MV of the current candidate position as the firstMV of the first collocated picture according to a current reference-picture index pointed to by the MV of the current candidate position in response to a reference picture indicated by the current reference-picture index being the first collocated picture.
16. The method of claim 15, further comprising:performing correction on the MV of the current candidate position, and determining the corrected MV as the first MV of the first collocated picture.
17. The method of claim 13, wherein determining the I offset temporal BVs for each of the at least one collocated picture comprises:in response to the at least one collocated picture comprising a first collocated picture and a second collocated picture, determining a first MV of the first collocated picture and a second MV of the second collocated picture, and determining one or more initial reference positions of the current block;offsetting the one or more initial reference positions according to the first MV, to obtain one or more offset reference positions in the first collocated picture; and offsetting the one or more initial reference positions according to the second MV, to obtain one or more offset reference positions in the second collocated picture; anddetermining the I offset temporal BVs for each of the at least one collocated picture according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture.
18. The method of claim 17, wherein determining the I offset temporal BVs for each of the at least one collocated picture according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture comprises:determining a current offset reference position corresponding to a current position index;determining J offset temporal BVs according to the current offset reference position in response to the current offset reference position satisfying a second condition, wherein J is an integer greater than or equal to 0; anddetermining an offset reference position corresponding to a next position index based ona second position-index order, determining the offset reference position corresponding to the next position index as the current offset reference position, and proceeding to determining whether the current offset reference position satisfies the second condition until all offset reference positions have been traversed, to obtain the I offset temporal BVs for each of the at least one collocated picture.
19. The method of claim 18, further comprising:arranging the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture alternately, to determine the second position-index order.
20. The method of claim 18, wherein the offset reference position comprises a primary position and a secondary position; and determining the J offset temporal BVs according to the current offset reference position in response to the current offset reference position satisfying the second condition comprises:determining whether the primary position in the current offset reference position satisfies the second condition;determining the J offset temporal BVs according to the primary position in the current offset reference position in response to the primary position in the current offset reference position satisfying the second condition;determining whether the secondary position in the current offset reference position satisfies the second condition in response to the primary position in the current offset reference position not satisfying the second condition; anddetermining the J offset temporal BVs according to the secondary position in the current offset reference position in response to the secondary position in the current offset reference position satisfying the second condition.
21. The method of claim 20, whereinthe primary position in the current offset reference position satisfying the second condition comprises: the primary position in the current offset reference position being within a range of the first collocated picture; andthe secondary position in the current offset reference position satisfying the second condition comprises: the secondary position in the current offset reference position being within the range of the first collocated picture.
22. The method of claim 20, further comprising:in response to the current offset reference position not satisfying the second condition, skipping the current offset reference position, determining the offset reference position corresponding to the next position index based on the second position-index order, determining the offset reference position corresponding to the next position index as the current offset reference position, and proceeding to determining whether the current offset reference position satisfies the second condition;wherein the current offset reference position not satisfying the second condition comprises: the primary position in the current offset reference position not satisfying the second condition and the secondary position in the current offset reference position not satisfying the second condition.
23. The method of claim 1, wherein constructing the candidate merge list based on the one or more temporal candidate BVs comprises:determining an initial merge list for the current block; andadding the one or more temporal candidate BVs to the initial merge list, to obtain the candidate merge list.
24. The method of claim 23, wherein based on a current temporal candidate BV among the one or more temporal candidate BVs, the method further comprises:discarding the current temporal candidate BV in response to the initial merge list containing a candidate item identical to the current temporal candidate BV; andadding the current temporal candidate BV to the initial merge list in response to the initial merge list containing no candidate item identical to the current temporal candidate BV.
25. The method of claim 23, whereinthe one or more temporal candidate BVs comprise X first-type temporal candidate BVsand Y second-type temporal candidate BVs, wherein X and Y each are a positive integer; and adding the one or more temporal candidate BVs to the initial merge list comprises: adding the X first-type temporal candidate BVs to the initial merge list; and in response to the initial merge list being in an unfilled state, continuing to add the Y second-type temporal candidate BVs to the initial merge list until the initial merge list is full.
26. The method of claim 25, wherein adding the one or more temporal candidate BVs to the initial merge list comprises:adding N first-type temporal candidate BVs among the X first-type temporal candidate BVs and M second-type temporal candidate BVs among the Y second-type temporal candidate BVs to the initial merge list, wherein N is an integer greater than 0 and less than or equal to a first threshold, and M is an integer greater than 0 and less than or equal to a second threshold.
27. The method of claim 25, wherein adding the one or more temporal candidate BVs to the initial merge list comprises:adding P temporal candidate BVs among the one or more temporal candidate BVs to the initial merge list, wherein the P temporal candidate BVs comprise first-type temporal candidate BVs and second-type temporal candidate BVs, and P is an integer greater than 0 and less than or equal to a third threshold.
28. The method of any one of claims 1 to 27, further comprising: determining a prediction mode for the current block; and performing the determination of the at least one collocated picture of the current block in response to the prediction mode for the current block satisfying a preset condition.
29. The method of claim 28, wherein the prediction mode for the current block satisfying the preset condition comprises:determining that an intra template matching prediction (IntraTMP) mode is used for the current block and the candidate merge list is constructed for prediction; ordetermining that an intra block copy (IBC) mode is used for the current block and thecandidate merge list is constructed for prediction.
30. The method of any one of claims 1 to 27, further comprising:determining a video sequence to which the current block belongs; andperforming the determination of the at least one collocated picture of the current block in response to the video sequence being of a screen content category.
31. The method of any one of claims 1 to 27, further comprising:parsing a bitstream to determine a value of a first syntax element; andperforming the determination of the at least one collocated picture of the current block in response to the first syntax element indicating that a temporal candidate BV is used as a candidate item for constructing the candidate merge list for the current block.
32. The method of any one of claims 1 to 27, further comprising:determining one or more target BVs of the current block according to the candidate merge list, and determining a prediction block of the current block according to the one or more target BVs of the current block;parsing a bitstream to determine a residual block of the current block; anddetermining a reconstructed block of the current block according to the residual block of the current block and the prediction block of the current block.
33. An encoding method, applied to an encoder and comprising:determining at least one collocated picture of a current block;determining one or more temporal candidate block vectors (BVs) of the current block according to the at least one collocated picture; andconstructing a candidate merge list based on the one or more temporal candidate BVs.
34. The method of claim 33, wherein determining the one or more temporal candidate BVs of the current block according to the at least one collocated picture comprises:determining X first-type temporal candidate BVs according to the at least one collocated picture; anddetermining the one or more temporal candidate BVs of the current block according to the X first-type temporal candidate BVs, wherein X is a positive integer.
35. The method of claim 33, wherein determining the one or more temporal candidate BVs of the current block according to the at least one collocated picture comprises:determining Y second-type temporal candidate BVs according to the at least one collocated picture; anddetermining the one or more temporal candidate BVs of the current block according to the Y second-type temporal candidate BVs, wherein Y is a positive integer.
36. The method of claim 33, wherein determining the one or more temporal candidate BVs of the current block according to the at least one collocated picture comprises:determining X first-type temporal candidate BVs and Y second-type temporal candidate BVs according to the at least one collocated picture; anddetermining the one or more temporal candidate BVs of the current block according to the X first-type temporal candidate BVs and the Y second-type temporal candidate BVs, wherein X and Y each are a positive integer.
37. The method of claim 34 or 36, wherein determining the X first-type temporal candidate BVs according to the at least one collocated picture comprises:determining K temporal BVs for each of the at least one collocated picture, wherein K is an integer greater than or equal to 0; anddetermining the X first-type temporal candidate BVs according to the K temporal BVs for each of the at least one collocated picture.
38. The method of claim 37, wherein determining the K temporal BVs for each of the at least one collocated picture comprises:determining one or more reference positions in a first collocated picture; anddetermining K temporal BVs for the first collocated picture according to the one or more reference positions;wherein the first collocated picture is any one of the at least one collocated picture.
39. The method of claim 38, wherein determining the K temporal BVs for the first collocated picture according to the one or more reference positions comprises:determining a current reference position corresponding to a current position index;determining H temporal BVs according to the current reference position in response to the current reference position satisfying a first condition, wherein H is an integer greater than or equal to 0; anddetermining a reference position corresponding to a next position index based on a first position-index order, determining the reference position corresponding to the next position index as the current reference position, and proceeding to determining whether the current reference position satisfies the first condition until the one or more reference positions have been traversed, to obtain the K temporal BVs for the first collocated picture.
40. The method of claim 39, wherein the reference position comprises a primary position and a secondary position; and determining the H temporal BVs according to the current reference position in response to the current reference position satisfying the first condition comprises:determining whether the primary position in the current reference position satisfies the first condition;determining the H temporal BVs according to the primary position in the current reference position in response to the primary position in the current reference position satisfying the first condition;determining whether the secondary position in the current reference position satisfies the first condition in response to the primary position in the current reference position not satisfying the first condition; anddetermining the H temporal BVs according to the secondary position in the current reference position in response to the secondary position in the current reference position satisfying the first condition.
41. The method of claim 40, whereinthe primary position in the current reference position satisfying the first condition comprises: the primary position in the current reference position being within a range of the firstcollocated picture; andthe secondary position in the current reference position satisfying the first condition comprises: the secondary position in the current reference position being within the range of the first collocated picture.
42. The method of claim 40, further comprising:in response to the current reference position not satisfying the first condition, skipping the current reference position, determining the reference position corresponding to the next position index based on the first position-index order, determining the reference position corresponding to the next position index as the current reference position, and proceeding to determining whether the current reference position satisfies the first condition;wherein the current reference position not satisfying the first condition comprises: the primary position in the current reference position not satisfying the first condition and the secondary position in the current reference position not satisfying the first condition.
43. The method of claim 35 or 36, wherein determining the Y second-type temporal candidate BVs according to the at least one collocated picture comprises:determining I offset temporal BVs for each of the at least one collocated picture, wherein I is an integer greater than or equal to 0; anddetermining the Y second-type temporal candidate BVs according to the I offset temporal BVs for each of the at least one collocated picture.
44. The method of claim 43, wherein determining the I offset temporal BVs for each of the at least one collocated picture comprises:determining a first motion vector (MV) of a first collocated picture, and determining one or more initial reference positions of the current block;offsetting the one or more initial reference positions according to the first MV, to obtain one or more offset reference positions in the first collocated picture; anddetermining I offset temporal BVs for the first collocated picture according to the one or more offset reference positions in the first collocated picture, wherein the first collocated picture is any one of the at least one collocated picture.
45. The method of claim 44, wherein determining the first MV of the first collocated picture comprises:determining respective MVs of a plurality of candidate positions around the current block and reference-picture indices pointed to by the MVs; anddetermining a current candidate position from the plurality of candidate positions based on a preset position order, and determining an MV of the current candidate position as the first MV of the first collocated picture according to a current reference-picture index pointed to by the MV of the current candidate position in response to a reference picture indicated by the current reference-picture index being the first collocated picture.
46. The method of claim 45, further comprising:performing correction on the MV of the current candidate position, and determining the corrected MV as the first MV of the first collocated picture.
47. The method of claim 43, wherein determining the I offset temporal BVs for each of the at least one collocated picture comprises:in response to the at least one collocated picture comprising a first collocated picture and a second collocated picture, determining a first MV of the first collocated picture and a second MV of the second collocated picture, and determining one or more initial reference positions of the current block;offsetting the one or more initial reference positions according to the first MV, to obtain one or more offset reference positions in the first collocated picture; and offsetting the one or more initial reference positions according to the second MV, to obtain one or more offset reference positions in the second collocated picture; anddetermining the I offset temporal BVs for each of the at least one collocated picture according to the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture.
48. The method of claim 47, wherein determining the I offset temporal BVs for each of the at least one collocated picture according to the one or more offset reference positions in the firstcollocated picture and the one or more offset reference positions in the second collocated picture comprises:determining a current offset reference position corresponding to a current position index;determining J offset temporal BVs according to the current offset reference position in response to the current offset reference position satisfying a second condition, wherein J is an integer greater than or equal to 0; anddetermining an offset reference position corresponding to a next position index based on a second position-index order, determining the offset reference position corresponding to the next position index as the current offset reference position, and proceeding to determining whether the current offset reference position satisfies the second condition until all offset reference positions have been traversed, to obtain the I offset temporal BVs for each of the at least one collocated picture.
49. The method of claim 48, further comprising:arranging the one or more offset reference positions in the first collocated picture and the one or more offset reference positions in the second collocated picture alternately, to determine the second position-index order.
50. The method of claim 48, wherein the offset reference position comprises a primary position and a secondary position; and determining the J offset temporal BVs according to the current offset reference position in response to the current offset reference position satisfying the second condition comprises:determining whether the primary position in the current offset reference position satisfies the second condition;determining the J offset temporal BVs according to the primary position in the current offset reference position in response to the primary position in the current offset reference position satisfying the second condition;determining whether the secondary position in the current offset reference position satisfies the second condition in response to the primary position in the current offset reference position not satisfying the second condition; anddetermining the J offset temporal BVs according to the secondary position in the currentoffset reference position in response to the secondary position in the current offset reference position satisfying the second condition.
51. The method of claim 50, whereinthe primary position in the current offset reference position satisfying the second condition comprises: the primary position in the current offset reference position being within a range of the first collocated picture; andthe secondary position in the current offset reference position satisfying the second condition comprises: the secondary position in the current offset reference position being within the range of the first collocated picture.
52. The method of claim 50, further comprising:in response to the current offset reference position not satisfying the second condition, skipping the current offset reference position, determining the offset reference position corresponding to the next position index based on the second position-index order, determining the offset reference position corresponding to the next position index as the current offset reference position, and proceeding to determining whether the current offset reference position satisfies the second condition;wherein the current offset reference position not satisfying the second condition comprises: the primary position in the current offset reference position not satisfying the second condition and the secondary position in the current offset reference position not satisfying the second condition.
53. The method of claim 33, wherein constructing the candidate merge list based on the one or more temporal candidate BVs comprises:determining an initial merge list for the current block; andadding the one or more temporal candidate BVs to the initial merge list, to obtain the candidate merge list.
54. The method of claim 53, wherein based on a current temporal candidate BV among the one or more temporal candidate BVs, the method further comprises:discarding the current temporal candidate BV in response to the initial merge list containing a candidate item identical to the current temporal candidate BV; andadding the current temporal candidate BV to the initial merge list in response to the initial merge list containing no candidate item identical to the current temporal candidate BV.
55. The method of claim 53, whereinthe one or more temporal candidate BVs comprise X first-type temporal candidate BVs and Y second-type temporal candidate BVs, wherein X and Y each are a positive integer; andadding the one or more temporal candidate BVs to the initial merge list comprises:adding the X first-type temporal candidate BVs to the initial merge list; and in response to the initial merge list being in an unfilled state, continuing to add the Y second-type temporal candidate BVs to the initial merge list until the initial merge list is full.
56. The method of claim 55, wherein adding the one or more temporal candidate BVs to the initial merge list comprises:adding N first-type temporal candidate BVs among the X first-type temporal candidate BVs and M second-type temporal candidate BVs among the Y second-type temporal candidate BVs to the initial merge list, wherein N is an integer greater than 0 and less than or equal to a first threshold, and M is an integer greater than 0 and less than or equal to a second threshold.
57. The method of claim 55, wherein adding the one or more temporal candidate BVs to the initial merge list comprises:adding P temporal candidate BVs among the one or more temporal candidate BVs to the initial merge list, wherein the P temporal candidate BVs comprise first-type temporal candidate BVs and second-type temporal candidate BVs, and P is an integer greater than 0 and less than or equal to a third threshold.
58. The method of any one of claims 33 to 57, further comprising:determining a prediction mode for the current block; andperforming the determination of the at least one collocated picture of the current block inresponse to the prediction mode for the current block satisfying a preset condition.
59. The method of claim 58, wherein the prediction mode for the current block satisfying the preset condition comprises:determining that an intra template matching prediction (IntraTMP) mode is used for the current block and the candidate merge list is constructed for prediction; ordetermining that an intra block copy (IBC) mode is used for the current block and the candidate merge list is constructed for prediction.
60. The method of any one of claims 33 to 57, further comprising:determining a video sequence to which the current block belongs; andperforming the determination of the at least one collocated picture of the current block in response to the video sequence being of a screen content category.
61. The method of any one of claims 33 to 57, further comprising:performing the determination of the at least one collocated picture of the current block in response to a temporal candidate BV being used as a candidate item for constructing the candidate merge list for the current block.
62. The method of claim 61, further comprising:determining a value of a first syntax element, wherein the first syntax element indicates whether the temporal candidate BV is used as the candidate item for constructing the candidate merge list for the current block; andencoding the value of the first syntax element, and signalling a resulting encoded bit into a bitstream.
63. The method of any one of claims 33 to 57, further comprising:determining a collocated-picture index of the current block according to the at least one collocated picture of the current block; andencoding the collocated-picture index of the current block, and signalling a resulting encoded bit into a bitstream.
64. The method of any one of claims 33 to 57, further comprising:determining one or more target BVs of the current block according to the candidate merge list;determining a prediction block of the current block according to the one or more target BVs of the current block; anddetermining a residual block of the current block according to the prediction block of the current block.
65. The method of claim 64, further comprising:encoding the residual block of the current block, and signalling a resulting encoded bit into a bitstream.
66. A bitstream, wherein the bitstream is generated through bit encoding based on information to be encoded, and the information to be encoded comprises at least one of: a residual value of a current block, a collocated-picture index of the current block, or a value of a first syntax element;wherein the first syntax element indicates whether a temporal candidate block vector (BV) is used as a candidate item for constructing a candidate merge list for the current block.
67. An encoder, comprising:a first determining unit configured to determine at least one collocated picture of a current block, and determine one or more temporal candidate block vectors (BVs) of the current block according to the at least one collocated picture; anda first construction unit configured to construct a candidate merge list based on the one or more temporal candidate BVs.
68. An encoder, comprising a first memory and a first processor, whereinthe first memory is configured to store a computer program executable on the first processor; andthe first processor is configured to, when executing the computer program, perform themethod of any one of claims 33 to 65.
69. A decoder, comprising:a second determining unit configured to determine at least one collocated picture of a current block, and determine one or more temporal candidate block vectors (BVs) of the current block according to the at least one collocated picture; anda second construction unit configured to construct a candidate merge list based on the one or more temporal candidate BVs.
70. A decoder, comprising a second memory and a second processor, whereinthe second memory is configured to store a computer program executable on the second processor; andthe second processor is configured to, when executing the computer program, perform the method of any one of claims 1 to 32.
71. A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to implement the method of any one of claims 1 to 32, or the method of any one of claims 33 to 65.
72. A computer program product comprising a computer program or instructions which, when executed by a processor, cause the processor to implement the method of any one of claims 1 to 32, or the method of any one of claims 33 to 65.
