Encoding method, decoding method, encoder, decoder, and storage medium
By utilizing the time domain block vectors in the running information cache of the co-located image during the encoding and decoding process to construct a candidate block vector list, the problem of insufficient utilization of the candidate block vector list in intra-frame template matching prediction is solved, and the encoding and decoding efficiency is improved.
Patent Information
- Application Number
- PCT/CN2024/087063
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2025-10-16
AI Technical Summary
In the existing intra-frame template matching prediction technology, the candidate block vector list is not fully utilized or has deviations, resulting in poor encoding and decoding efficiency.
By using the time domain block vectors in the running information cache of the same-position image during the encoding and decoding process, a candidate block vector list is constructed and the number of candidate block vectors is increased to improve the prediction effect of the intra-frame block copy mode or the intra-frame template matching prediction.
The encoding and decoding efficiency is improved, and the prediction effect of the intra-frame block copy mode and the intra-frame template matching prediction mode is enhanced.
Smart Images

Figure CN2024087063_16102025_PF_FP_ABST
Abstract
Description
Coding method, encoder, decoder and storage medium TECHNICAL FIELD
[0001] The present application relates to the technical field of video coding, in particular to a coding method, an encoder, a decoder and a storage medium. BACKGROUND
[0002] Intra Template Matching Prediction (Intra TMP) technology is to search a matching template with the minimum cost in a predefined search range of the current image according to a preset cost function through a template of a coding block, and to use a reconstructed block corresponding to the matching template as a matching block as a prediction block of the current coding block.
[0003] In addition to directly searching for a matching block, Intra TMP can also construct a candidate block vector list according to already coded information, and determine the matching block by trying candidate block vectors in the candidate block vector list. However, in the actual coding / decoding process, due to incomplete consideration, in some scenarios, the candidate block vector list obtained by the related technology cannot be filled, or the obtained candidate block vector has a large deviation, resulting in poor prediction effect and affecting the coding efficiency.
[0004] SUMMARY
[0005] The present application provides a coding method, an encoder, a decoder and a storage medium, which uses a candidate block vector list constructed based on a time domain block vector to improve the prediction effect of a related prediction mode and improve the coding efficiency.
[0006] The technical solution of the present application can be implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a decoding method applied to a decoder, and the method comprises:
[0008] determining one or more reference positions available for a current block to be decoded in a current image according to first position indication information;
[0009] determining one or more time domain block vectors in one or more co-located images of the current block according to the one or more reference positions;
[0010] determining a candidate block vector list of the current block according to the one or more time domain block vectors;
[0011] determining a prediction block of the current block according to the candidate block vector list.
[0012] In a second aspect, an embodiment of the present application provides an encoding method applied to an encoder, and the method comprises:
[0013] determining, according to the first position indication information, one or more reference positions available for a current block to be encoded in the current image;
[0014] determining one or more temporal block vectors in one or more co-located images of the current block based on the one or more reference positions;
[0015] Determine a candidate block vector list for the current block according to the one or more time-domain block vectors;
[0016] Determine a prediction block for the current block according to the candidate block vector list.
[0017] In a third aspect, an embodiment of the present application provides an encoder, comprising a first prediction unit and a first determination unit; wherein:
[0018] The first determining unit is configured to determine one or more reference positions available for a current block to be encoded in the current image according to the first position indication information;
[0019] The first determining unit is further configured to determine one or more time-domain block vectors in one or more co-located images of the current block according to the one or more reference positions; and determine a candidate block vector list for the current block according to the one or more time-domain block vectors;
[0020] The first prediction unit is configured to determine a prediction block of the current block according to the candidate block vector list.
[0021] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein:
[0022] a first memory for storing a computer program capable of running on the first processor;
[0023] The first processor is configured to execute the method according to the second aspect when running a computer program.
[0024] In a fifth aspect, an embodiment of the present application provides a decoder, comprising a second determination unit and a second prediction unit; wherein:
[0025] The second determining unit is configured to determine one or more reference positions available for a current block to be decoded in the current image according to the first position indication information;
[0026] The second determining unit is further configured to determine one or more time-domain block vectors in one or more co-located images of the current block according to the one or more reference positions; and determine a candidate block vector list for the current block according to the one or more time-domain block vectors;
[0027] The second prediction unit is configured to determine a prediction block of the current block according to the candidate block vector list.
[0028] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a second memory and a second processor; wherein:
[0029] The second memory is configured to store a computer program capable of running on the second processor.
[0030] The second processor is configured to execute the method according to the first aspect when running the computer program.
[0031] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed to implement the method according to the first aspect or the method according to the second aspect.
[0032] In an eighth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a bitstream generated by the encoding method.
[0033] The encoding and decoding method, the encoder, the decoder and the storage medium provided by the embodiments of the present application can determine one or more reference positions available for a current block to be decoded in a current image according to first position indication information, determine one or more temporal block vectors in one or more co-located pictures of the current block according to the one or more reference positions, determine a candidate block vector list of the current block according to the one or more temporal block vectors, and determine a prediction block of the current block according to the candidate block vector list. In this way, the temporal block vector in the running information buffer of the co-located picture is added to the candidate block vector list as a new candidate block vector, the number of candidate block vectors is increased, the prediction effect of the prediction mode such as the Intra Block Copy mode or the Intra Template Matching Prediction mode is improved, and the encoding and decoding efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0034] FIG. 1 is a schematic diagram of a prediction process of an Intra TMP technology;
[0035] FIG. 2 is a schematic diagram of a matching block of an Intra TMP technology;
[0036] FIG. 3 is a schematic diagram of a template type of an Intra TMP technology;
[0037] FIG. 4 is a schematic diagram of matching blocks pointed by multiple block vectors in a search area;
[0038] FIG. 5 is a schematic diagram of a component block diagram of an encoder provided by an embodiment of the present application;
[0039] FIG. 6 is a block diagram of a decoder according to an embodiment of the present application;
[0040] FIG. 7 is a network architecture diagram of a coding system according to an embodiment of the present application;
[0041] FIG. 8 is a flow diagram of a decoding method according to an embodiment of the present application;
[0042] FIG. 9 is a diagram of a set of reference positions defined by first position indication information according to an embodiment of the present application;
[0043] FIG. 10 is a diagram of a set of reference positions defined by first position indication information according to an embodiment of the present application;
[0044] FIG. 11 is a diagram of a set of reference positions defined by second position indication information according to an embodiment of the present application;
[0045] FIG. 12 is a diagram of a set of reference positions defined by second position indication information according to an embodiment of the present application;
[0046] FIG. 13 is a diagram of MV conversion to a reference image according to an embodiment of the present application;
[0047] FIG. 14 is a diagram of MV conversion to a reference image according to an embodiment of the present application;
[0048] FIG. 15 is a diagram of MV conversion to a co-sited image according to an embodiment of the present application;
[0049] FIG. 16 is a diagram of MV conversion to a co-sited image according to an embodiment of the present application;
[0050] FIG. 17 is a flow diagram of an encoding method according to an embodiment of the present application;
[0051] FIG. 18 is a block diagram of an encoder according to an embodiment of the present application;
[0052] FIG. 19 is a diagram of a specific hardware structure of an encoder according to an embodiment of the present application;
[0053] FIG. 20 is a block diagram of a decoder according to an embodiment of the present application;
[0054] FIG. 21 is a diagram of a specific hardware structure of a decoder according to an embodiment of the present application;
[0055] FIG. 22 is a block diagram of a coding system according to an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to enable more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below, and the attached drawings are only used for reference and are not intended to limit the embodiments of the present application.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing the embodiments of the present application only and is not intended to limit the present application.
[0058] In the following description, "some embodiments" are described, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. It should be noted that the terms "first, second, third" involved in the embodiments of the present application are only used to distinguish similar objects, and do not represent a specific order of the objects. It can be understood that "first, second, third" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0059] Before the embodiments of the present application are further described in detail, the terms and phrases involved in the embodiments of the present application are explained, and the terms and phrases involved in the embodiments of the present application are applicable to the following explanations:
[0060] Coding Block (CB);
[0061] Block Matching (BM);
[0062] Coding Unit (CU);
[0063] Block Vector (BV);
[0064] Spatial BV (block vector at the spatial neighboring position of the current block);
[0065] Non-adjacent BV (block vector at the non-adjacent position of the current block);
[0066] History block vector prediction (HBVP);
[0067] Auto-relocated block vector prediction (ARBVP);
[0068] Sum of Absolute Difference (SAD);
[0069] Sum of Absolute Transformed Difference (SATD);
[0070] Mean Square Error (MSE);
[0071] Sum of Squared Differences (SSD);
[0072] Mean Absolute Deviation (MAD);
[0073] Mean Square Differences (MSD);
[0074] Normalized Correlation Coefficient (NCC);
[0075] Rate Distortion Optimization (RDO);
[0076] H.266 / Versatile Video Coding (VVC);
[0077] VVC Test Model (VTM);
[0078] Merge;
[0079] Intra Block Copy (IBC);
[0080] Intra Template Matching Prediction (Intra TMP);
[0081] Collocated picture.
[0082] Temporal block vector prediction (TBVP);
[0083] Picture Order Count (POC);
[0084] Beyond VVC's reference software test platform (Enhanced Compression Model, ECM).
[0085] It can be understood that in a video image, a first color component, a second color component and a third color component are generally used to represent a coding block. Among them, the three color components are a luminance component, a blue chroma component and a red chroma component, respectively. Specifically, the luminance component is usually represented by the symbol Y, the blue chroma component is usually represented by the symbol Cb or U, and the red chroma component is usually represented by the symbol Cr or V. In this way, the video image can be represented in YCbCr format or YUV format.
[0086] 1) Intra TMP technology
[0087] Intra TMP technology is a special intra prediction technology, referred to as Intra TMP technology, which is a special intra prediction coding tool mainly applied to screen content coding. Intra TMP is mainly implemented through the following process: selecting part of the reconstructed pixels adjacent to the current coding block as a template, searching for the most similar template in the given reconstructed area of the current frame, and taking the reconstructed block corresponding to the most similar template as the matching block, which is used as the prediction block of the current coding block. The matching block can be represented by a block vector BV pointed to the matching block by the current coding block, specifically the difference between the top-left corner coordinates of the current block and the top-left corner coordinates of the matching block. The template of the coding block is usually selected from the adjacent reconstructed area of the current coding block.
[0088] Exemplarily, taking the adjacent reconstructed area of the current block as an example, as shown in FIG. 1, the area filled with grids represents the reconstructed area, R1, R2, R3 and R4 are the search areas in the reconstructed area, R1 to R4 are searched in turn to find the matching block, and the adjacent area of the current block is the first template (T). The adjacent area of the matching block (also referred to as the "reference block") is the second template (i.e. the "reference template" or "matching template", T_BEST). As shown in FIG. 2, the encoder and the decoder search the matching template (T_BEST) with the minimum template error value in the search range predefined in the current image through the template (T) of the coding block, and then take the reconstructed block (Ref Block) corresponding to the matching template as the prediction block of the current coding block (Cur Block). The similarity between the templates is represented by the size of the template error value, and the smaller the template error value, the higher the similarity. In the embodiments of the present application, the template error value can be absolute error SAD, absolute transform difference SATD, mean square error MSE, error square sum SSD, mean absolute difference MAD, mean error square sum MSD, normalized correlation coefficient NCC, etc., which are not limited here.
[0089] Exemplarily, taking absolute error and SAD as examples, the template error value at this time is as follows:
[0090] wherein, T i is a template in the search process, and M represents the number of pixels in the template.
[0091] It should be noted that the Intra TMP technology searches for a matching template in a predefined search area using the neighboring reconstructed pixels of the current block as the template, wherein the neighboring reconstructed pixels can be the upper reference pixel, the upper-left reference pixel, the upper-right reference pixel, the left reference pixel and the lower-left reference pixel of the current block, and the like, and thus the template types can be classified and the corresponding template types can be determined according to the availability of the neighboring reconstructed pixels.
[0092] It should be further noted that the template type can be represented by refTemplateType, and FIG. 3 shows a template type diagram of an Intra TMP technology. As shown in FIG. 3, the block filled with a grid is a current block, and the neighboring area of the current block is a template T, and six template types are shown here.
[0093] Exemplarily, the six template types are as follows:
[0094] When the upper-left reference pixel, the upper reference pixel and the left reference pixel are all available, the value of refTemplateType is 1, and the template shape is as shown in (a) of FIG. 3;
[0095] When only the left reference pixel is available, the value of refTemplateType is 2, and the template shape is as shown in (b) of FIG. 3;
[0096] When only the upper reference pixel is available, the value of refTemplateType is 3, and the template shape is as shown in (c) of FIG. 3;
[0097] When only the left reference pixel and the upper-left reference pixel are available, the value of refTemplateType is 4, and the template shape is as shown in (d) of FIG. 3;
[0098] When only the left reference pixel and the lower-left reference pixel are available, the value of refTemplateType is 5, and the template shape is as shown in (e) of FIG. 3;
[0099] When only the upper reference pixel and the upper-right reference pixel are available, the value of refTemplateType is 6, and the template shape is as shown in (f) of FIG. 3.
[0100] Intra TMP technology, a flag intra_tmp_flag is used to indicate whether the current block is coded using Intra TMP mode. If yes, the same template matching process is performed at the decoder side to obtain the same prediction block, and no extra block vector information is needed to code the current block to the matching block.
[0101] In addition to direct search of the matching block, Intra TMP can also construct a candidate block vector list according to the already coded information, and determine the matching block by trying the candidate block vector in the candidate block vector list. For example, Intra TMP multi-candidate technology obtains N candidate matching blocks in the reference region through the template matching process, or constructs a candidate block list with a length of N, and the candidate matching blocks in the list can be sorted according to the template error values between the candidate matching blocks and the current block. A candidate block in the list is selected as the final prediction block by indexing. For the coding block using Intra TMP multi-candidate technology, after the Intra TMP flag intra_tmp_flag is decoded to be true, intra_tmp_idx is further decoded. The intra_tmp_idx syntax element can indicate the index of the selected candidate block.
[0102] intra_tmp_flag
[0103] if(intra_tmp_flag)
[0104] {
[0105] intra_tmp_idx
[0106] }
[0107] For example, a template matching process for constructing a candidate block list is as follows:
[0108] First, a first search is performed at a certain step, for example, the horizontal step and the vertical step are both 4. N optimal matching blocks with a certain interval (the first N optimal matching blocks with the smallest template error values) are obtained.
[0109] Second, a second search is performed in the adjacent regions of the N matching blocks obtained in the first step. The adjacent regions can be set as multiple non-overlapping regions according to the step in the first step. M optimal matching blocks (which can include the matching blocks obtained in the first step) are obtained from the regions.
[0110] The same construction process is used at the encoder side and the decoder side to obtain consistent candidate block lists.
[0111] Intra_tmp_idx can be encoded using fixed-length coding or variable-length coding, for example, using truncated binary coding.
[0112] A variable length coding mode is:
[0113] The smaller the index (the smaller the intra_tmp_idx value), the smaller the template error value of the corresponding candidate block, and the greater the probability of being selected statistically. A shorter codeword can be set for a smaller intra_tmp_idx. For example:
[0114] If the maximum value N of intra_tmp_idx is large, the same length of codeword can be allocated to a larger intra_tmp_idx. For example, N is 15.
[0115] In the above table, x can be obtained by truncated binary.
[0116] 2) Intra block copy technology
[0117] Intra block copy (IBC) technology is an intra prediction technology based on block matching to obtain predicted pixels. Similar to inter prediction, prediction is achieved by a block vector pointing to a reference block from the current block, the difference being that the reference block of inter prediction comes from the reconstructed frame that has been encoded, while the reference block of IBC comes from the reconstructed part of the current frame. Block vector information needs to be transmitted by the code stream, so similar to intra prediction, there are IBC-AMVP mode and IBC-Merge mode.
[0118] IBC-AMVP mode obtains a predicted block vector through a constructed candidate block vector list, also known as a "merge candidate list", and obtains the reference block of the current block and the corresponding final block vector through a hash search, full search, etc. According to the prediction block vector, the final block vector is encoded to improve the coding efficiency;
[0119] IBC-Merge mode predicts through a constructed candidate block vector list, which can include block vectors at adjacent and non-adjacent positions, historical block vectors, automatically relocated block vectors, and average block vectors of candidate block vectors, etc. The encoding end and the decoding end determine the same order of candidate block vectors by constructing a merge list of the same length M, and obtain the selected final block vector from the merge list by encoding and decoding the index of the merge list. In addition to obtaining block vectors from adjacent and non-adjacent positions, history, and automatically relocated positions, the merge list can also obtain other IBC-related information, such as block flipping information, block illumination compensation and filtering information.
[0120] 3) Template matching of IBC and IntraTMP merge mode
[0121] Figure 4 is a schematic diagram of a matching block pointed to by multiple block vectors in a search area. The candidate block vector list constructed in IntraTMP and IBC can also reorder the candidate block vectors based on template matching, and select a candidate block vector in the list as the final block vector by index. For example, a merged list including N usable and non-repeated block vectors can be reordered by calculating the cost value cost0, cost1, ..., costN-1 between the reconstructed pixel value of the reference area pointed to by each block vector and the reconstructed pixel value of the current block template area, and sorting each candidate block cost value from small to large. The cost value can be the sum of absolute errors (SAD), the sum of squared absolute errors (SSE), the mean-removed sum of absolute errors (MRSAD), etc.
[0122] 4) Motion information cache
[0123] Normally, since the minimum size of the coding unit of the reference software is 4x4, the existing method will store the corresponding motion information of the encoded / decoded image at the scale of each 4x4 area. Depending on the different coding units to which each 4x4 area belongs, they can be divided into intra-frame coding units, inter-frame coding units or IBC coding units. If it belongs to an intra-frame coding unit, the index of the intra-frame prediction mode will be saved; if it belongs to an inter-frame coding unit, the motion vector and the corresponding reference image information will be saved; if it belongs to an IBC coding unit or IntraTMP mode, the block vector will be saved. In addition, some additional information will also be saved, such as whether illumination compensation is used, whether it has been filtered, etc.
[0124] The encoded / decoded picture stores the aforementioned motion information in a motion information buffer for use by the picture being encoded / decoded in the temporal domain. For the picture being encoded / decoded, temporal reference information can only be obtained from the motion information buffer of the co-located pictures in the reference picture list. In ECM reference software, an inter-coded picture can have at most one or more co-located pictures, which are typically pictures in the reference picture list. The co-located picture of the current picture is determined by the reference picture list index used to encode / decode the current picture.
[0125] In inter-frame prediction, IBC or IntraTMP prediction, there are cases where multiple matching blocks are weighted to generate a prediction block. Therefore, if a block is obtained by weighted prediction, the motion information cache can store more than or equal to one motion vector or block vector.
[0126] However, in the actual encoding / decoding process, due to incomplete considerations, in some scenarios, the list of candidate block vectors obtained by related technologies cannot be filled, or the candidate block vectors obtained have large deviations, resulting in poor prediction results and affecting encoding and decoding efficiency.
[0127] Referring to FIG. 5, a constituent block diagram of an encoder is shown. As shown in FIG. 5, the encoder (specifically, a "video encoder") 100 can include a transform and quantization unit 101, an intra estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filter unit 108, an encoding unit 109, and a decoded picture buffer unit 110, etc. The filter unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input raw video signal, a video coding block can be obtained by the division of a coding tree unit (CTU), and then the residual pixel information obtained after the intra or inter prediction is transformed by the transform and quantization unit 101 on the video coding block, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate; the intra estimation unit 102 and the intra prediction unit 103 are used for intra prediction of the video coding block; in particular, the intra estimation unit 102 and the intra prediction unit 103 are used to determine the intra prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter prediction encoding of the received video coding block relative to one or more blocks in one or more reference images to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector that can estimate the motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105; after determining the intra prediction mode, the intra prediction unit 103 is also used to provide the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated determined motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used for reconstruction of the video coding block, reconstructing the residual block in the pixel domain, which removes the blocking artifact by the filter control analysis unit 107 and the filtering unit 108, and then adds the reconstructed residual block to a predictive block in one of the frames of the decoded image buffer unit 110 to generate a reconstructed video coding block; the encoding unit 109 is used to encode various encoding parameters and quantized transform coefficients, and in the CABAC-based encoding algorithm, the context content can be based on the adjacent coding block, which can be used to encode the information indicating the determined intra prediction mode, and output the bitstream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video coding blocks will be continuously generated, which will be stored in the decoded image buffer unit 110.
[0128] Referring to FIG. 6, a constituent block diagram of a decoder is shown according to an embodiment of the present application. As shown in FIG. 6, the decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded picture buffer unit 206, etc. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is processed by the encoding process of FIG. 5, a bitstream of the video signal is output. The bitstream is input into the decoder 200, and first passes through the decoding unit 201 to obtain decoded transform coefficients. The transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain. The intra prediction unit 203 can be used to generate prediction data of a current video decoding block based on a determined intra prediction mode and data from previously decoded blocks of the current frame or picture. The motion compensation unit 204 determines prediction information for a video decoding block by parsing motion vectors and other associated syntax elements, and uses the prediction information to generate a predictive block of the video decoding block being decoded. A decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra prediction unit 203 or the motion compensation unit 204. The decoded video signal passes through the filtering unit 205 to remove blocking artifacts and improve video quality. The decoded video block is then stored in the decoded picture buffer unit 206, which stores reference pictures for subsequent intra prediction or motion compensation, and also for output of the video signal, i.e., the recovered original video signal.
[0129] Further, the present application also provides a network architecture of a codec system including an encoder and a decoder. FIG. 7 shows a network architecture of a codec system according to an embodiment of the present application. As shown in FIG. 7, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. The electronic devices can be various types of devices having video codec functions in the implementation process, for example, the electronic devices can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigation device, a digital telephone, a video telephone, a television, a sensor device, a server, etc., which are not limited specifically herein. In addition, the decoder or the encoder according to the present application can be the above-mentioned electronic devices.
[0130] It should be noted that the method of the embodiment of the present application is mainly applied to the intra-frame prediction unit 103 shown in Figure 5 and the intra-frame prediction unit 203 shown in Figure 6. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, and can even be applied to both the encoder and the decoder at the same time, but the embodiment of the present application is not specifically limited thereto.
[0131] It should also be noted that, when applied to the intra-frame prediction unit 103, the "current block" specifically refers to the coding block currently to be intra-frame predicted; when applied to the intra-frame prediction unit 203, the "current block" specifically refers to the decoding block currently to be intra-frame predicted.
[0132] In the above technologies, during the actual encoding / decoding process, due to incomplete considerations, in some scenarios, the list of candidate block vectors obtained by the relevant technologies cannot be filled, or the obtained candidate block vectors have large deviations, resulting in poor prediction results and affecting encoding and decoding efficiency.
[0133] Based on this, an embodiment of the present application provides a coding and decoding method, which can be specifically a method for constructing a candidate block vector list based on a time domain block vector, in which the time domain block vector in the running information cache of the co-located image is added as a new candidate block vector to the candidate block vector list, and the number of candidate block vectors is increased to improve the prediction effect of prediction modes such as the intra-frame block copy mode or the intra-frame template matching prediction mode, thereby improving the coding and decoding efficiency.
[0134] To facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The above related technologies can be combined arbitrarily with the technical solutions of the embodiments of the present application as optional solutions, and all of them fall within the scope of protection of the embodiments of the present application. The embodiments of the present application include at least part of the following contents.
[0135] In one embodiment of the present application, referring to FIG8 , a schematic flow chart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG8 , the method may include:
[0136] Step 801: determining one or more reference positions available for a current block to be decoded in a current image according to first position indication information;
[0137] It should be noted that the first position indication information includes predefined reference positions. Specifically, one or more reference positions may be predefined based on information such as the position and / or size parameters of the block to be decoded, for use in determining the time-domain block vector in the collocated image. During decoding, one or more available reference positions for the current block are determined based on the position and / or size parameters of the current block and the reference positions predefined in the first position indication information.
[0138] In some embodiments, determining one or more reference positions available for the current block in the current picture according to the first position indication information comprises: determining a first reference position of the current block according to the first position indication information and the position and size parameters of the current block; determining that the first reference position is available in a case that the first reference position is located within a first picture range associated with the current block; or determining that the first reference position is unavailable in a case that the first reference position is located outside the first picture range. The first picture range can include an edge of the first picture range.
[0139] The first reference position can be understood as a reference position of the current block determined directly according to the first position indication information. When the first reference position is available, it means that the current picture and the collocated picture both contain the first reference position, and one or more temporal block vectors in the collocated picture are obtained according to the first reference position. When the first reference position is unavailable, it means that neither the current picture nor the collocated picture contains the first reference position, and the reference position is ignored.
[0140] The first picture range is used to define a picture area in which the reference position available for the current block is located. The first picture range can include one of the following: the current block, a current coding tree unit, a current sub-picture, the current picture. That is, the reference position available for the current block can include one or more reference positions within the current block, one or more reference positions within the current coding tree unit, one or more reference positions within the current sub-picture, one or more reference positions within the current picture, or one or more reference positions within another picture range.
[0141] The first position indication information can also be used to indicate an index order of the reference positions. The plurality of reference positions are sequentially indexed according to the index order of the reference positions until a first number of temporal block vectors is obtained, or until the end of all reference position indexes defined by the first position indication information. The first number can be a preset number or a number of temporal block vectors determined according to the demand of the candidate block vector list.
[0142] In some embodiments, the first position indication information includes a first position index, and one or more reference positions indicated by the first position index. The first position index is used to indicate an index order of the reference positions.
[0143] When the first position index indicates one reference position, the index order of each reference position is determined according to each first position index. When the first position index indicates more than two reference positions, the more than two reference positions correspond to a default index order. For example, the first position index indicates a primary position and a secondary position, and the index order of the primary position is located before the index order of the secondary position.
[0144] The pre-defined reference positions of the first position indication information include at least one of the following: one or more reference positions in the current block, one or more reference positions in a lower-right region of the current block, and one or more reference positions in an upper-left region of the current block.
[0145] For example, the one or more reference positions in the current block include at least one of the following: a middle position of the current block, a top-left corner position, a top-right corner position, a bottom-left corner position, and a bottom-right corner position. The one or more reference positions in the lower-right region of the current block include one or more positions in a non-reconstructed region of the current picture. The one or more reference positions in the upper-left region of the current block include one or more positions in a reconstructed region of the current picture.
[0146] FIG. 9 is a schematic diagram of a set of reference positions defined by the first position indication information according to an embodiment of the present application. As shown in FIG. 9, the pre-defined set of reference positions includes 10 primary positions (C0) and 10 secondary positions (C1), and a total of 20 reference positions are defined. The positions are in the coordinates of the current picture as shown in Table 1.
[0147] Table 1: 20 reference positions defined by the first position indication information
[0148] Wherein, X0 and Y0 represent the horizontal and vertical coordinates of the right-bottom corner position of the current block in the current picture (or the current sub-picture or the current coding tree unit), and X0 and Y0 represent the horizontal and vertical coordinates of the right-bottom corner position of the current block in the current sub-picture or the current coding tree unit relative to the top-left corner of the current sub-picture or the current coding tree unit. X1 and Y1 represent the horizontal and vertical coordinates of the middle position of the current block in the current picture, and the middle position can also be a position close to the center of the current block. W and H represent the width and height of the current block.
[0149] It should be noted that when the pre-defined 10 primary positions and secondary positions are used as the reference positions, the corresponding primary positions are found one by one in the order of the position indexes 1 to 10, and it is determined whether the primary positions are in an allowed range (for example, the range can be in the current picture, sub-picture or CTU). If the primary position is in the allowed range, the primary position is a usable reference position, and the motion information buffer finds the block vector at the primary position of the one or more co-located pictures. Otherwise, it is determined whether the secondary position is in the allowed range. If the secondary position is in the allowed range, the secondary position is a usable reference position, and the motion information buffer finds the block vector at the secondary position of the one or more co-located pictures.
[0150] It should be noted that the 20 reference positions in Table 1 can also define 20 position indexes to indicate the index order of the reference positions.
[0151] FIG. 10 is a schematic diagram of a second set of reference positions defined by the first position indication information in the embodiments of the present application. As shown in FIG. 10, five reference positions are defined, and the positions of the five reference positions in the current block are respectively:
[0152] 1. the middle position of the current block in the coordinates of the current image;
[0153] 2. the top-left corner position of the current block in the coordinates of the current image;
[0154] 3. the top-right corner position of the current block in the coordinates of the current image;
[0155] 4. the bottom-left corner position of the current block in the coordinates of the current image;
[0156] 5. the bottom-right corner position of the current block in the coordinates of the current image.
[0157] In some embodiments, determining one or more reference positions available for the current block in the current image according to the first position indication information further comprises: offsetting the first reference position according to a motion vector pointing to a first collocated picture to determine a second reference position of the current block, wherein the first collocated picture is any one of the one or more collocated pictures; determining that the second reference position is available in a case that the second reference position is within a second image range associated with the current block, wherein the second reference position is used to determine one or more temporal block vectors in the first collocated picture; or determining that the second reference position is unavailable in a case that the second reference position is outside the second image range. The second image range can include the edge of the second image range.
[0158] The second reference position can be understood as a kind of offset reference position obtained by offsetting the first reference position of the current block, or can be understood as a kind of compensated reference position obtained by motion compensation on the first reference position of the current block. When the second reference position is available, it means that the current image and the collocated picture both contain the second reference position, and one or more temporal block vectors in the collocated picture are obtained according to the second reference position. When the first reference position is unavailable, it means that neither the current image nor the collocated picture contains the first reference position, and the reference position is ignored.
[0159] In some embodiments, the step of offsetting the first reference position according to a motion vector pointing to a first collocated picture is performed when all the reference positions defined by the first position indication information are indexed; or the step of offsetting the first reference position according to a motion vector pointing to a first collocated picture is performed when each first reference position is indexed. That is, when sufficient temporal block vectors cannot be obtained according to the first reference position, the second reference position can be used to obtain temporal block vectors in the collocated picture, further increasing the number of candidate block vectors.
[0160] The second image range is used to define an image area where the offset reference positions available to the current block are located, and the second image range can include one of the following: the current block, the current coding tree unit, the current sub-picture, and the current picture. That is, the offset reference positions available to the current block can include one or more reference positions within the current block, one or more reference positions within the current coding tree unit, one or more reference positions within the current sub-picture, one or more reference positions within the current picture, or one or more reference positions within another image range. The second image range can be the same as or different from the first image range.
[0161] In some embodiments, the method can further include, in a case where it is determined according to the first prediction parameter that the current block is allowed to perform reference position offset, offsetting the first reference position according to a motion vector pointing to a first co-located picture, and determining the second reference position of the current block.
[0162] In some cases, the use of the offset reference position has little effect on the acquisition of the temporal block vector, and in order to ensure decoding efficiency, the use scenario of the offset reference position can be limited, that is, whether the current block is allowed to perform reference position offset is indicated by a first prediction parameter of the current block.
[0163] For example, the first prediction parameter includes at least one of the following: a first syntax element, and a size parameter of the current block. Correspondingly, at least one of the following is determined: the current block is allowed to perform reference position offset according to a value of the first syntax element, the size parameter of the current block is less than a first threshold; the current block is not allowed to perform reference position offset according to the value of the first syntax element, or the size parameter of the current block is greater than or equal to the first threshold.
[0164] The first syntax element is a high-level syntax element for controlling whether the current block is allowed to perform reference position offset, and the first syntax element can be a syntax element at a sequence level (SPS), a picture level (Picture header), or a slice level (Slice header). The first syntax element can be a newly added syntax element or a reused existing syntax element.
[0165] The size parameter of the current block can be one or more of the following: an area, a length, and a width of the current block. For a large block, details are generally not included, and the large block is more likely to appear in the background of the image and is less likely to appear motion offset. Therefore, the use of the offset reference position on the large block is limited, and the large block can be a block larger than 32x32, a block larger than 64x64, and the like.
[0166] The motion vector pointing to the first collocated picture can be a motion vector of a coded reference position of the current block. In some embodiments, the method further comprises: determining a third reference position of the current block according to the second position indication information; in a case that the third reference position belongs to an inter block, obtaining one or more motion vectors and a reference picture index of the third reference position; and determining the motion vector pointing to the first collocated picture according to the motion vectors and the reference picture index.
[0167] The second position indication information comprises a predefined reference position, which can be a plurality of predefined reference positions according to a position and / or size parameter of the block to be decoded, for determining the motion vector pointing to the first collocated picture. In the decoding process, one or more reference positions corresponding to the current block are determined according to the position and / or size parameter of the current block and the plurality of predefined reference positions.
[0168] The reference position defined by the first position indication information can be offset by a motion vector to obtain an offset reference position, and the motion vector participating in the offset is obtained according to a reconstructed reference position of the current block, which includes a decoded reference picture or a decoded region in the current picture. The specific method is to predefine a set of reference positions for obtaining the motion vector by the second position indication information, determine a third reference position of the current block according to the position and / or size parameter of the current block, and if the third reference position belongs to an inter block, it contains a usable motion vector, and the motion vector is obtained to guide the offset of the first reference position.
[0169] The second position indication information can also be used to indicate the index order of the reference positions, and a plurality of reference positions are sequentially indexed according to the index order of the reference positions until a first number of temporal block vectors are obtained, or until the index of all reference positions defined by the second position indication information ends. The first number can be a preset number or a number of temporal block vectors determined according to the demand of the candidate block vector list.
[0170] In some embodiments, the second position indication information comprises a second position index, and one or more reference positions indicated by the second position index, wherein the second position index is used to indicate the index order of the reference positions.
[0171] In some embodiments, the plurality of reference positions predefined by the second position indication information comprises at least one of the following: a reconstructed reference position in the current picture, a reconstructed reference position in a reference picture of the current block, wherein the reconstructed reference position in the current picture comprises at least one of the following: a neighboring reference position, a non-neighboring reference position of the current block, and the reconstructed reference position in the reference picture comprises at least one of the following: a neighboring reference position, a non-neighboring block reference position of a reference block corresponding to the current block.
[0172] Exemplarily, the adjacent reference positions can include at least one of a left adjacent position, an upper adjacent position, a left upper adjacent position, a right upper adjacent position, and a left lower adjacent position. The non-adjacent reference positions can include at least one of a left non-adjacent position, an upper non-adjacent position, a left upper non-adjacent position, a right upper non-adjacent position, and a left lower non-adjacent position.
[0173] If the third reference position belongs to an inter block (also referred to as an inter decoded block or an inter decoded unit), one or more motion vectors and corresponding reference picture information are saved into a motion information buffer; if the third reference position belongs to an intra block, an index of an intra prediction mode is saved.
[0174] FIG. 11 is a schematic diagram of a set of reference positions defined by second position indication information according to an embodiment of the present application. As shown in FIG. 11, five reference positions are defined in advance, and the reference positions are guided to be offset by motion vectors at the five positions. The coordinates of the five positions in a current picture are shown in Table 2.
[0175] Table 2. Five reference positions defined by second position indication information
[0176] Wherein, X0 and Y0 represent the horizontal coordinate and the vertical coordinate of the right lower corner position of the current block in the current picture (or the current sub-picture or the current coding tree unit), and X0 and Y0 represent the horizontal coordinate and the vertical coordinate of the right lower corner position of the current block in the current sub-picture or the current coding tree unit relative to the left upper corner of the current sub-picture or the current coding tree unit. X1 and Y1 represent the horizontal coordinate and the vertical coordinate of the middle position of the current block in the current picture, and the middle position can also be a position close to the center of the current block. W and H represent the width and the height of the current block.
[0177] FIG. 12 is a schematic diagram of a set of reference positions defined by second position indication information according to an embodiment of the present application. As shown in FIG. 12, twenty-three reference positions are defined in advance, and the reference positions are guided to be offset by motion vectors at the twenty-three positions. The coordinates of the twenty-three positions in a current picture are shown in Table 3.
[0178] Table 3. Twenty-three reference positions defined by second position indication information
[0179] If the position defined for obtaining the offset motion vector belongs to an inter block and the reconstruction of the inter block is completed, the motion information buffer of the position in the current picture contains one or more motion vectors pointing to reference pictures, and the reference pictures can be a co-located picture or another picture in a reference picture list outside the co-located picture.
[0180] In some embodiments, determining the motion vector pointing to the first collocated picture according to the motion vector and the reference picture index comprises: in a case that the reference picture indicated by the reference picture index is the first collocated picture of the current picture, determining that the motion vector is the motion vector pointing to the first collocated picture; or in a case that the reference picture indicated by the reference picture index is not the first collocated picture of the current picture, converting the motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture to obtain a reference position offset of the first collocated picture.
[0181] It should be noted that if the motion vector searched by the third reference position points to the first collocated picture, the motion vector can be directly used to offset the first reference position to obtain the offset reference position in the first collocated picture; if it does not point to the first collocated picture, i.e., the motion vector pointing to other reference pictures needs to be converted to the motion vector pointing to the first collocated picture, and then the first reference position is offset.
[0182] In some embodiments, converting the motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture comprises: determining a first difference of image sequence numbers between the current picture and the reference picture according to an image sequence number (POC) of the current picture and an image sequence number of the reference picture; determining a second difference of image sequence numbers between the current picture and the first collocated picture according to the image sequence number of the current picture and an image sequence number of the first collocated picture; and converting the motion vector pointing to the reference picture into the motion vector pointing to the first collocated picture according to the first difference and the second difference.
[0183] In some embodiments, the reference picture comprises a first reference picture located in the same time domain direction as the first collocated picture, or a second reference picture located in the opposite time domain direction as the first collocated picture.
[0184] For example, the conversion formula of the motion vector is as follows: POCdiff1 = CurPOC - RefPOC POCdiff2 = CurPOC - ColPOC Scaled Mv = Mv x POCdiff1 ÷ POCdiff2
[0185] For example, if the first difference and the second difference are positive numbers, in actual application, the sign of the motion vector needs to be determined according to whether the reference picture and the collocated picture are in the same time domain direction, and when the reference picture and the collocated picture are not in the same time domain direction, the conversion formula of the motion vector can also be as follows: POCdiff1 = |CurPOC - RefPOC| POCdiff2 = |CurPOC - ColPOC| Scaled Mv = -(Mv x POCdiff1 ÷ POCdiff2)
[0186] Wherein, POCdiff1 is the first difference value, POCdiff2 is the second difference value, and Scaled Mv is the converted motion vector.
[0187] The following further illustrates different cases respectively.
[0188] Case 1, the reference image is the first collocated picture, i.e. the motion vector points to the first collocated picture
[0189] If the motion vector Mv pointing to the collocated picture is obtained from the defined position for obtaining the motion vector, the formula for calculating the offset reference position according to Mv is as follows: PosShift = Pos + Mv = (x + x1, y + y1)
[0190] In the above formula, Pos represents the reference position, the coordinates of which in the current picture are (x, y). The offset of Mv is (x1, y1). According to the calculation, the coordinates of the offset reference position PosShift in the current picture are (x + x1, y + y1).
[0191] In practical applications, the motion vector can be first converted into an integer motion vector, and then the offset reference position is calculated, i.e. the integer motion vector represents ShiftMv, the offset of which is represented as (shiftx, shifty), and the coordinates of PosShift in the current picture are (x + shiftx, y + shifty). The formula for calculating the offset reference position according to ShiftMv is as follows: PosShift = Pos + ShiftMv = (x + shiftx, y + shifty)
[0192] When obtaining the block vector at the offset reference position in the collocated picture, the offset reference position in the defined reference position index sequence should be offset according to the obtained offset motion vector, and if the offset reference position is within an allowed range (for example, the range can be within the current picture, sub-picture or CTU, etc.), the further determination of whether the motion information at the position in the collocated picture contains a usable block vector is made, and if it contains, the block vector is further taken as a candidate of the merge list.
[0193] Case 2, the reference image is not the first collocated picture, and the reference image and the first collocated picture are located in the same temporal domain direction
[0194] If the obtained motion vector is a motion vector Mv pointing to the reference image in the reference image list, the Mv on the reference image can be scaled through the distance of the reference image, the collocated picture and the current picture in the time domain, so that the Mv on the reference image is mapped to the Mv on the collocated picture.
[0195] Figure 13 is a schematic diagram of a method for converting a MV pointing to a reference picture according to an embodiment of the present application. As shown in Figure 13, a current picture (CurPic) has a collocated picture (ColPic) and a reference picture (RefPic). If the motion vector Mv obtained points to a reference picture, a scaled motion vector Scaled Mv0 on the collocated picture can be calculated according to the distance POCdiff between the current picture and the reference picture in the time domain and the distance POCdiff1 between the current picture and the collocated picture in the time domain. The formula for calculating the scaled motion vector Scaled Mv0 is as follows: Scaled Mv0 = Mv x POCdiff ÷ POCdiffRef
[0196] POCdiff is the difference between the picture sequence number of the current picture and the collocated picture, and POCdiffRef is the difference between the picture sequence number of the current picture and the reference picture. Both are positive integer distances. For example, if the POC of ColPic is 10 and the POC of CurPic is 11, then POCdiff is 1. For another example, if the POC of ColPic is 12 and the POC of CurPic is 11, then POCdiff is 1. In some embodiments, the division in the formula for calculating the scaled motion vector Scaled Mv0 can be simplified or approximated by motion shifting, table lookup, or the like.
[0197] When the scaled motion vector on the collocated picture is calculated, the block vector can be further obtained according to the steps in Case 1.
[0198] Case 3: the reference picture and the first collocated picture are in different time domain directions, and the reference picture is not the second collocated picture
[0199] In some embodiments, the current picture can include two collocated pictures. When the collocated picture and the reference picture are not in the same time domain direction, the target motion vector on the collocated picture can also be obtained by scaling. Figure 14 is a schematic diagram of a method for converting a MV pointing to a reference picture according to another embodiment of the present application. As shown in Figure 14, the current picture has two collocated pictures, namely a collocated picture 0 (ColPic0) and a collocated picture 1 (ColPic1). The motion vector Mv obtained by the current picture points to a reference picture that is in the same time domain direction as the collocated picture ColPic0, and the method for calculating Scaled Mv0 is the same as that in Figure 13. The collocated picture ColPic1 and the reference picture are in opposite time domain directions from the current picture, and the motion vector Scaled Mv1 on the collocated picture is calculated as follows: Scaled Mv1 = - (Mv x POCdiff1 ÷ POCdiffRef)
[0200] When the scaled motion vector on the collocated picture is calculated, the block vector can be further obtained according to the steps in Case 1.
[0201] It should be noted that, when two motion vectors and a reference image index are acquired according to the third reference position, the motion vector pointing to the reference image can be converted into a motion vector pointing to the co-located image in the same time domain direction.
[0202] Case 4: The reference image is the second co-located image, i.e. the motion vector does not point to the first co-located image.
[0203] If the current image has multiple co-located images, the offset motion vector obtained in case 1 may be further mapped from one co-located image to another co-located image.
[0204] If the second co-located image to be mapped and the first co-located image pointed to by the obtained offset motion vector are located in different directions in the time domain, the offset motion vector can be obtained by motion vector mapping. FIG15 is a schematic diagram of MV conversion pointing to the co-located image in an embodiment of the present application. As shown in FIG15 , the two co-located images ColPic0 and ColPic1 of the current image CurPic are respectively located in opposite directions in the time domain. The mapped motion vector Mv1 can be calculated by using the obtained motion vector Mv0 pointing to ColPic0. The motion vector Mv1 on ColPic1 is calculated as follows: Mv1 = -(Mv0 × POCdiff1 ÷ POCdiff0)
[0205] FIG16 is a second schematic diagram of MV conversion pointing to the co-located image in an embodiment of the present application. As shown in FIG16 , if the two co-located images ColPic0 and ColPic1 of the current image CurPic are respectively located in the same direction in the time domain, the mapped motion vector Mv1 can be calculated by the acquired motion vector Mv0 pointing to ColPic0. The motion vector Mv1 is calculated as follows: Mv1 = (Mv0 × POCdiff1 ÷ POCdiff0)
[0206] After the motion vector scaled on the co-located image is calculated, the block vector can be further obtained according to the steps in Case 1.
[0207] Step 802: Determine one or more time domain block vectors in one or more co-located images of the current block according to one or more reference positions;
[0208] It should be noted that the current image is an inter image, and the co-located image is an image in a reference image list of the current inter coded image. For example, the co-located image includes a previous frame reference image in the reference image list before the current image in the playback order and / or a next frame reference image after the current image in the playback order. The co-located image is different from other reference images in the reference image list in that motion information at each position of the co-located image is saved and can be used as temporal reference information when constructing a candidate block vector list for the current block.
[0209] In some embodiments, the motion information cache of the co-located image is searched according to the reference position; and if the temporal block vector is included, one or more temporal block vectors corresponding to the reference position are obtained; wherein the plurality of temporal block vectors can be two temporal block vectors, and the plurality of block temporal block vectors can be three or more temporal block vectors.
[0210] In some embodiments, the one or more reference positions include a first reference position, and if the current image includes a first co-located image, one or more temporal block vectors corresponding to the first reference position are obtained in the first co-located image of the current block; and if the current image includes a second co-located image, one or more temporal block vectors corresponding to the first reference position are obtained in the second co-located image of the current block. For example, the plurality of temporal block vectors can be two temporal block vectors, and the plurality of block temporal block vectors can be three or more temporal block vectors.
[0211] In some embodiments, the one or more reference positions further include a second reference position, and when the second reference position is determined by offsetting the first reference position according to a motion vector pointing to the first co-located image, one or more temporal block vectors corresponding to the second reference position are obtained in the first co-located image of the current block; and when the second reference position is determined by offsetting the first reference position according to a motion vector pointing to the second co-located image, one or more temporal block vectors corresponding to the second reference position are obtained in the second co-located image of the current block.
[0212] Step 803: determining a candidate block vector list of the current block according to the one or more temporal block vectors;
[0213] In some embodiments, determining the candidate block vector list of the current block according to the one or more temporal block vectors includes: reordering the one or more temporal block vectors to obtain a reordered list; and adding the reordered list to the candidate block vector list.
[0214] In some embodiments, reordering the one or more temporal block vectors to obtain a reordered list includes: determining a distance reference value of each temporal block vector and a specific position of the current block; and reordering the one or more temporal block vectors according to the distance reference value from near to far to obtain the reordered list.
[0215] For example, the distance reference value can represent the distance between the reference position and the middle position of the current block. When the current position is the first reference position, the distance reference value is calculated according to the following formula: D = abs(PosX - X1) + abs(PosY - Y1)
[0216] PosX is the horizontal coordinate of the reference position in the current image, X1 is the horizontal coordinate of the center position of the current block in the current image, PosY is the vertical coordinate of the reference position in the current image, Y1 is the vertical coordinate of the center position of the current block in the current image, and D is the calculated distance value. The distance value D is sorted according to its size.
[0217] When the current position is the second reference position, the distance reference value is calculated according to the following formula: D = abs(PosShiftX - X1) + abs(PosShiftY - Y1)
[0218] PosShiftX is the horizontal coordinate of the offset reference position in the current image, and PosShiftY is the vertical coordinate of the offset reference position in the current image.
[0219] In some embodiments, the one or more temporal block vectors are reordered to obtain a reordered list, including: determining a template matching cost value corresponding to each temporal block vector based on template matching; and reordering the one or more temporal block vectors according to the order of the template matching cost values from small to large to obtain the reordered list.
[0220] The candidate temporal block vectors are sorted according to the size of the cost value between the reconstructed pixel values on the template region of the current block and the reference region. After sorting, the temporal block vectors can be added to the candidate block vector list as the final candidate according to the order of the cost value from small to large. The cost value can be absolute error, SAD, absolute transform difference SATD, mean square error MSE, sum of squared error SSD, mean absolute difference MAD, mean sum of squared error MSD, normalized correlation coefficient NCC, etc., which are not limited here.
[0221] In some embodiments, it is determined whether to use template matching-based reordering of the temporal block vector according to the value of the third syntax element; if the value of the third syntax element is a first value, it is determined not to use template matching-based reordering of the temporal block vector; and if the value of the third syntax element is a second value, it is determined to use template matching-based reordering of the temporal block vector. The third syntax element can be a newly added syntax element, or can reuse an existing syntax element. For example, the third syntax element can be a syntax element specially used to control template matching of the temporal block vector, or can be a syntax element used to uniformly control multiple template matching technologies.
[0222] Step 804: determining a prediction block of the current block according to the candidate block vector list.
[0223] In some embodiments, one or more target block vectors of the current block are determined according to the candidate block vector list; one or more reference blocks of the current block are determined according to the one or more target block vectors of the current block; a prediction block of the current block is determined according to the one or more reference blocks of the current block; and a reconstructed block of the current block is determined according to the prediction block of the current block.
[0224] It should be noted that the candidate block vector list containing the time-domain block vector generated according to the method steps provided in the embodiments of the present application can be applied to any prediction mode that needs to construct a candidate block vector list, for example, IBC prediction mode, IntraTMP prediction mode, etc. Using the candidate block vector list constructed based on the time-domain block vector improves the prediction effect of the related prediction mode and improves the decoding efficiency.
[0225] In some embodiments, the candidate block vector list further includes at least one of the following: a block vector of a reconstructed neighboring block, a block vector of a reconstructed non-neighboring block, and an automatically relocated block vector.
[0226] It should be noted that the time-domain block vector searched in the embodiments of the present application can be added to any position in the candidate block vector list. For example, the time-domain block vector can be added after the block vector of the spatial neighboring block, after the block vector of the spatial non-neighboring block, or after the automatically relocated block vector.
[0227] In some embodiments, the method further includes: decoding the code stream to determine a residual block of the current block; and determining a reconstructed block of the current block according to the reference block and the prediction block of the current block.
[0228] In some embodiments, determining one or more reference positions available to the current block in the current image according to the first position indication information includes: in a case where the candidate block vector list is allowed to add the time-domain block vector according to the second prediction parameter, determining a first reference position available to the current block according to the first position indication information.
[0229] For example, the second prediction parameter includes at least one of the following: a second syntax element used to indicate whether the candidate block vector list is allowed to add the time-domain block vector, a current image type, whether a collocated picture exists for the current image, a size parameter of the current block, and a number of time-domain block vectors.
[0230] Correspondingly, it is determined that the candidate block vector list is allowed to add the time-domain block vector according to one or more of the following: a value of the second syntax element, the current image type being an inter image, the size parameter of the current block being greater than a second threshold, and the number of time-domain block vectors not being zero.
[0231] The second syntax element is a high-level syntax element for controlling whether to allow using the present scheme. The second syntax element can be a syntax element at a sequence level (SPS), a picture level (Picture header), or a slice level (Slice header). The second syntax element can be a newly added syntax element or a reused syntax element. For example, the second syntax element can be a high-level syntax element of temporal motion vector prediction (TMVP) for controlling whether to allow using TMVP and whether to allow using the present scheme. When the high-level syntax element of TMVP is enabled, it means that TMVP is allowed and the present scheme is allowed. Otherwise, both TMVP and the present scheme are prohibited.
[0232] The current picture type can be a bidirectional prediction frame (e.g., a B frame), or a unidirectional prediction frame (e.g., an I frame or a P frame).
[0233] That is, the method steps provided by the embodiments of the present application need to meet some general restrictions, which are as follows:
[0234] 1. The present scheme should be allowed to add a temporal block vector when the current picture is an inter-coded frame and there is one or more co-located pictures.
[0235] 2. The present scheme can be controlled by a high-level syntax element. For example, it can be a syntax element at a sequence level (SPS), a picture level (Picture header), or a slice level (Slice header).
[0236] 3. The present scheme can be controlled by the value of a high-level syntax element of TMVP. When the high-level syntax element of TMVP is enabled, the present scheme can also be turned on. Inter prediction can also be merge,
[0237] 4. The present scheme can be enabled for blocks of specific shapes or sizes. For example, the difference between small blocks is generally large, and it is not easy to find a suitable matching block for a small block to be encoded. Therefore, the use of the present scheme can be limited on small blocks. A small block can be a block smaller than 8x8, a block smaller than 16x16, etc. For example, a large block generally does not contain detailed features and often appears in the background of an image. These parts are not easy to appear motion offset, so the effect of finding an offset reference position is not ideal. Therefore, the use of the present scheme can be limited on large blocks. A large block can be a block larger than 32x32, a block larger than 64x64, etc.
[0238] 5. The technology can control the maximum number of time-domain block vectors that can be added to the merge list by encoding and decoding a syntax element or setting a predefined variable value, so as to avoid adding too many time-domain block vectors to the merge list, which prevents other types of block vectors from being filled into the merge list.
[0239] 6. When adding time-domain block vectors, one or more of the following can be included: a block vector at a reference position, a block vector at a reference position pointing to a co-located image motion vector offset, a block vector at a reference position through a scaled motion vector offset, and a block vector at a reference position through a mapped motion vector offset on a co-located image.
[0240] 7. The time-domain block vector can be added at any position in the merge list. For example, when constructing the existing IntraTMP merge list and IBC merge list, spatially adjacent block vectors, spatially non-adjacent block vectors, and automatically relocated block vectors are included. The time-domain block vector can be added after the spatially adjacent block vector, the spatially non-adjacent block vector, or the automatically relocated block vector.
[0241] 8. If the corresponding syntax element based on template matching is identified as true, template-based reordering of the time-domain block vector can be used, otherwise no template matching-based reordering of the time-domain block vector is performed. Template matching techniques usually bring additional implementation complexity, and the code stream can include a related syntax element to control its opening or closing. This syntax element can be a syntax element that controls multiple template matching techniques, or a syntax element that is specifically used to control template matching of the time-domain block vector.
[0242] With the above technical solution, at the decoding end, the time-domain block vector in the running information buffer of the co-located image is added to the candidate block vector list as a new candidate block vector, increasing the number of candidate block vectors to improve the prediction effect of the intra block copy mode or the intra template matching prediction mode, thereby improving the coding efficiency.
[0243] In still another embodiment of the present application, an encoding method is also provided, as shown in FIG. 17, which shows a flowchart of an encoding method according to an embodiment of the present application. As shown in FIG. 17, the method further includes:
[0244] Step 1701: determining one or more reference positions available to the current block to be encoded in the current image according to the first position indication information;
[0245] The first position indication information includes a predefined reference position. One or more reference positions can be predefined according to position and / or size parameters of the to-be-decoded block, and are used to determine the temporal block vector in the co-located picture. In the decoding process, one or more reference positions available for the current block are determined according to the position and / or size parameters of the current block and the reference position predefined by the first position indication information.
[0246] In some embodiments, according to the first position indication information, determining one or more reference positions available for the current block in the current picture includes: determining a first reference position of the current block according to the first position indication information, the position and size parameters of the current block; determining that the first reference position is available in a case that the first reference position is located within a first picture range associated with the current block; or determining that the first reference position is unavailable in a case that the first reference position is located outside the first picture range. The first picture range can include an edge of the first picture range.
[0247] The first reference position can be understood as a reference position of the current block directly determined according to the first position indication information. When the first reference position is available, it means that the current picture and the co-located picture both contain the first reference position, and one or more temporal block vectors in the co-located picture are obtained according to the first reference position. When the first reference position is unavailable, it means that neither the current picture nor the co-located picture contains the first reference position, and the reference position is ignored.
[0248] The first picture range is used to define the image area in which the reference position available for the current block is located. The first picture range can include one of the following: the current block, the current coding tree unit, the current sub-picture, and the current picture. That is, the reference position available for the current block can include one or more reference positions in the current block, one or more reference positions in the current coding tree unit, one or more reference positions in the current sub-picture, one or more reference positions in the current picture, or one or more reference positions in another picture range.
[0249] The first position indication information can also be used to indicate the index order of the reference positions. The multiple reference positions are sequentially indexed according to the index order of the reference positions until the first number of temporal block vectors is obtained, or until the end of the reference position index defined by the first position indication information. The first number can be a preset number or a number of temporal block vectors determined according to the demand of the candidate block vector list.
[0250] In some embodiments, the first position indication information includes a first position index, and one or more reference positions indicated by the first position index. The first position index is used to indicate the index order of the reference positions.
[0251] When the first position index indicates one reference position, the index order of each reference position is determined according to each first position index. When the first position index indicates more than two reference positions, the more than two reference positions correspond to a default index order. For example, the first position index indicates a primary position and a secondary position, and the index order of the primary position is before the index order of the secondary position.
[0252] The pre-defined reference positions of the first position indication information include at least one of the following: one or more reference positions in the current block, one or more reference positions in a lower-right region of the current block, and one or more reference positions in an upper-left region of the current block.
[0253] For example, the one or more reference positions in the current block can include at least one of the following: a middle position of the current block, a top-left corner position, a top-right corner position, a bottom-left corner position, and a bottom-right corner position. The one or more reference positions in the lower-right region of the current block can include one or more positions of a non-reconstructed region of the current picture. The one or more reference positions in the upper-left region of the current block can include one or more positions of a reconstructed region of the current picture.
[0254] In some embodiments, according to the first position indication information, determining one or more reference positions available for a current block to be encoded in a current picture further includes: offsetting a first reference position according to a motion vector pointing to a first collocated picture to determine a second reference position of the current block, wherein the first collocated picture is any one of the one or more collocated pictures; determining that the second reference position is available in a case that the second reference position is within a second image range associated with the current block, wherein the second reference position is used to determine one or more temporal block vectors in the first collocated picture; or determining that the second reference position is unavailable in a case that the second reference position is outside the second image range. The second image range can include an edge of the second image range.
[0255] The second reference position can be understood as an offset reference position obtained by offsetting the first reference position of the current block, or as a compensated reference position obtained by motion compensation of the first reference position of the current block. When the second reference position is available, it means that the current picture and the collocated picture both contain the second reference position, and one or more temporal block vectors in the collocated picture are obtained according to the second reference position. When the first reference position is unavailable, it means that neither the current picture nor the collocated picture contains the first reference position, and the reference position is ignored.
[0256] In some embodiments, the first position indication information is used to define a plurality of reference positions, and the step of offsetting the first reference position according to the motion vector pointing to the first collocated picture is performed when all the reference positions are indexed or when each of the reference positions is indexed.
[0257] The second image range is used to define an image area where the offset reference positions available to the current block are located, and the second image range can include one of the following: the current block, the current coding tree unit, the current sub-picture, and the current picture. That is, the offset reference positions available to the current block can include one or more reference positions within the current block, one or more reference positions within the current coding tree unit, one or more reference positions within the current sub-picture, one or more reference positions within the current picture, or one or more reference positions within another image range. The second image range can be the same as or different from the first image range.
[0258] In some embodiments, the method can further include, in the case where the current block is allowed to perform the reference position offset according to the first prediction parameter, offsetting the first reference position according to the motion vector pointing to the first collocated picture to determine the second reference position of the current block.
[0259] In some cases, the use of the offset reference position has little effect on the acquisition of the temporal block vector, and in order to ensure the coding efficiency, the use scenario of the offset reference position can be limited, i.e., whether the current block is allowed to perform the reference position offset is indicated by the first prediction parameter of the current block.
[0260] For example, the first prediction parameter includes at least one of the following: a first syntax element and a size parameter of the current block. Correspondingly, at least one of the following is determined: the current block is allowed to perform the reference position offset according to the value of the first syntax element, the size parameter of the current block is smaller than a first threshold; the current block is not allowed to perform the reference position offset according to the value of the first syntax element, or the size parameter of the current block is greater than or equal to the first threshold.
[0261] The first syntax element is a high-level syntax element for controlling whether the current block is allowed to perform the reference position offset, and the first syntax element can be a sequence level (SPS), a picture level (Picture header), or a slice level (Slice header) syntax element.
[0262] The size parameter of the current block can be one or more of the area, length and width of the current block. Generally, a large block does not contain detailed features, and often appears in the background part of the image, which is not prone to motion offset. Therefore, the use of offset reference positions on large blocks is limited. The large block can be a block larger than 32x32, a block larger than 64x64, etc.
[0263] The motion vector pointing to the first co-located image can be a motion vector of a reconstructed reference position of the current block. In some embodiments, the method further comprises: determining a third reference position of the current block according to the second position indication information; in the case that the third reference position belongs to an inter-frame block, obtaining one or more motion vectors and reference image indexes of the third reference position; and determining the motion vector pointing to the first co-located image according to the motion vectors and the reference image indexes.
[0264] The second position indication information includes a predefined reference position. One or more reference positions can be predefined according to the position and / or size parameter of the block to be encoded, etc., to determine the motion vector pointing to the first co-located image. In the encoding process, the motion vector pointing to the first co-located image of the current block is determined according to the position and / or size parameter of the current block and the predefined reference position of the second position indication information.
[0265] The reference position defined by the first position indication information can be offset by a certain motion vector to obtain an offset reference position. The motion vector participating in the offset is obtained according to the reconstructed reference position of the current block, which includes a reference image or a region of the current image that has been completed encoding. The specific method is to define a set of reference positions for obtaining motion vectors through the second position indication information, search the predefined reference positions, determine a third reference position that has been completed reconstruction and contains a usable motion vector, and obtain the motion vector for guiding the first reference position offset.
[0266] The second position indication information can also be used to indicate the index order of the reference positions. A plurality of reference positions are sequentially indexed according to the index order of the reference positions until the first number of temporal block vectors is obtained, or until the index of all reference positions defined by the second position indication information ends. The first number can be a preset number or a number of temporal block vectors determined according to the demand of the candidate block vector list.
[0267] In some embodiments, the second position indication information includes a second position index, and one or more reference positions indicated by the second position index, wherein the second position index is used to indicate the index order of the reference positions.
[0268] In some embodiments, the second position indication information pre-defines a plurality of reference positions, which include at least one of the following: a reconstructed reference position in the current picture, a reconstructed reference position in a reference picture of the current block; wherein the reconstructed reference position in the current picture includes at least one of the following: a neighboring reference position of the current block, a non-neighboring reference position; and the reconstructed reference position in the reference picture includes at least one of the following: a neighboring reference position of a reference block corresponding to the current block, a non-neighboring block reference position.
[0269] For example, the neighboring reference position can include at least one of the following: a left neighboring position, an upper neighboring position, a left upper neighboring position, a right upper neighboring position, and a left lower neighboring position. The non-neighboring reference position can include at least one of the following: a left non-neighboring position, an upper non-neighboring position, a left upper non-neighboring position, a right upper non-neighboring position, and a left lower non-neighboring position.
[0270] If the third reference position belongs to an inter block (also referred to as an inter coded block or an inter coded unit), one or more motion vectors and corresponding reference picture information are saved to a motion information buffer; if the third reference position belongs to an intra block, an index of an intra prediction mode is saved.
[0271] In some embodiments, the determining of the motion vector pointing to the first co-located picture according to the motion vector and the reference picture index includes: in a case where the reference picture indicated by the reference picture index is the first co-located picture of the current picture, determining that the motion vector is the motion vector pointing to the first co-located picture; or in a case where the reference picture indicated by the reference picture index is not the first co-located picture of the current picture, converting the motion vector pointing to the reference picture into a motion vector pointing to the first co-located picture to obtain a reference position offset of the first co-located picture.
[0272] It should be noted that if the motion vector searched by the third reference position points to the first co-located picture, the motion vector can be directly used to offset the first reference position to obtain an offset reference position in the first co-located picture; if it does not point to the first co-located picture, i.e., the motion vector pointing to other reference pictures needs to be converted to a motion vector pointing to the first co-located picture, and then the first reference position is offset.
[0273] In some embodiments, the converting of the motion vector pointing to the reference picture into the motion vector pointing to the first co-located picture includes: determining a first difference of image sequence numbers between the current picture and the reference picture according to an image sequence number (POC) of the current picture and an image sequence number of the reference picture; determining a second difference of image sequence numbers between the current picture and the first co-located picture according to the image sequence number of the current picture and an image sequence number of the first co-located picture; and converting the motion vector pointing to the reference picture into the motion vector pointing to the first co-located picture according to the first difference and the second difference.
[0274] In some embodiments, the reference picture comprises a first reference picture located in the same temporal direction as the first collocated picture, or a second reference picture located in the opposite temporal direction as the first collocated picture.
[0275] Step 1702: determining one or more temporal block vectors in one or more collocated pictures of the current block according to the one or more reference positions;
[0276] It should be noted that the current picture is an inter picture, and the collocated picture is a picture in a reference picture list of the current inter picture. For example, the collocated picture comprises a previous frame reference picture in the reference picture list and / or a next frame reference picture after the current picture in the order of play. The collocated picture is different from other reference pictures in the reference picture list in that the motion information of each position in the collocated picture is saved and can be used as temporal reference information when constructing a candidate block vector list of the current block.
[0277] In some embodiments, the motion information cache of the collocated picture is searched according to the reference position, and one or more temporal block vectors corresponding to the reference position are obtained if the temporal block vector is included. The plurality of temporal block vectors can be two temporal block vectors, or three or more temporal block vectors.
[0278] In some embodiments, the one or more reference positions comprise a first reference position, and one or more temporal block vectors corresponding to the first reference position are obtained in the first collocated picture of the current block according to the first reference position if the current picture comprises the first collocated picture, or one or more temporal block vectors corresponding to the first reference position are obtained in the second collocated picture of the current block according to the first reference position if the current picture comprises the second collocated picture. For example, the plurality of temporal block vectors can be two temporal block vectors, or three or more temporal block vectors.
[0279] In some embodiments, the one or more reference positions further comprise a second reference position, and one or more temporal block vectors corresponding to the second reference position are obtained in the first collocated picture of the current block according to the second reference position if the second reference position is determined by offsetting the first reference position according to a motion vector pointing to the first collocated picture, or one or more temporal block vectors corresponding to the second reference position are obtained in the second collocated picture of the current block according to the second reference position if the second reference position is determined by offsetting the first reference position according to a motion vector pointing to the second collocated picture.
[0280] Step 1703: determining a candidate block vector list of the current block according to the one or more temporal block vectors;
[0281] In some embodiments, the candidate block vector list of the current block is determined according to the one or more temporal block vectors, including: reordering the one or more temporal block vectors to obtain a reordered list; and adding the reordered list to the candidate block vector list.
[0282] In some embodiments, the one or more temporal block vectors are reordered to obtain a reordered list, including: determining a distance reference value of a reference position of each temporal block vector and a specific position of the current block; and reordering the one or more temporal block vectors according to an order from near to far of the distance reference values to obtain the reordered list.
[0283] In some embodiments, the one or more temporal block vectors are reordered to obtain a reordered list, including: determining a template matching cost value corresponding to each temporal block vector based on template matching; and reordering the one or more temporal block vectors according to an order from small to large of the template matching cost values to obtain the reordered list.
[0284] In some embodiments, it is determined whether to use template matching based reordering of the temporal block vectors according to a value of a third syntax element; if the value of the third syntax element is a first value, it is determined not to use the template matching based reordering of the temporal block vectors; and if the value of the third syntax element is a second value, it is determined to use the template matching based reordering of the temporal block vectors. The third syntax element can be a newly added syntax element, or can reuse an existing syntax element. For example, the third syntax element can be a syntax element specially used to control template matching of the temporal block vectors, or can be a syntax element used to control multiple template matching techniques.
[0285] Step 1704: determining a prediction block of the current block according to the candidate block vector list.
[0286] In some embodiments, one or more target block vectors of the current block are determined according to the candidate block vector list; one or more reference blocks of the current block are determined according to the one or more target block vectors of the current block; a prediction block of the current block is determined according to the one or more reference blocks of the current block; and a reconstructed block of the current block is determined according to the prediction block of the current block.
[0287] It should be noted that the candidate block vector list containing the temporal block vectors generated according to the method steps provided in the embodiments of the present application can be applied to any prediction mode that needs to construct a candidate block vector list, such as the IBC prediction mode, the IntraTMP prediction mode, etc. Using the candidate block vector list constructed based on the temporal block vectors improves the prediction effect of the related prediction mode and improves the coding efficiency.
[0288] In some embodiments, the candidate block vector list further comprises at least one of the following: a block vector of a reconstructed neighboring block, a block vector of a reconstructed non-neighboring block, an automatically relocated block vector.
[0289] It should be noted that the time-domain block vector searched by the embodiments of the present application can be added to any position in the candidate block vector list. For example, the time-domain block vector can be added after the block vector of the spatial neighboring block, after the block vector of the spatial non-neighboring block, or after the automatically relocated block vector.
[0290] In some embodiments, according to the first position indication information, one or more reference positions available to the current block in the current image are determined, comprising: in the case that the candidate block vector list is allowed to add the time-domain block vector according to the second prediction parameter, according to the first position indication information, a first reference position available to the current block is determined.
[0291] For example, the second prediction parameter comprises at least one of the following: a second syntax element used to indicate whether the candidate block vector list is allowed to add the time-domain block vector, a current image type, whether the current image has a co-located image, a size parameter of the current block, a number of time-domain block vectors;
[0292] Correspondingly, according to one or more of the following: a value of the second syntax element, the current image type being an inter-image, the size parameter of the current block being greater than a second threshold, and the number of time-domain block vectors not being zero, it is determined that the candidate block vector list is allowed to add the time-domain block vector.
[0293] The second syntax element is a high-level syntax element for controlling whether the present scheme is allowed to be used, and the second syntax element can be a sequence-level syntax element (SPS), a picture-level syntax element (Picture header), or a slice-level syntax element (Slice header).
[0294] The current image type can be specifically a bidirectional prediction frame (such as a B frame), and the current image type can also be a unidirectional prediction frame (such as an I frame or a P frame).
[0295] In some embodiments, the method further comprises: encoding an eighth syntax element; wherein the eighth syntax element is used to indicate whether part of the syntax elements or all of the syntax elements in the related syntax elements of the current block are encoded. In some embodiments, the eighth syntax element comprises at least one of the following: a sequence-level syntax element, a picture-level syntax element, a slice-level syntax element, a slice-level syntax element, a block-level syntax element.
[0296] In some embodiments, the method further comprises: in a case where the current block uses a prediction mode corresponding to the candidate block vector list, determining a residual block of the current block according to the prediction block of the current block and the original block; encoding the residual block of the current block, and writing the encoded bits into the bitstream.
[0297] With the above technical solution, at the encoding end, the time-domain block vector in the running information buffer of the co-located image is added to the candidate block vector list as a newly added candidate block vector, the number of candidate block vectors is increased, the prediction effect of the prediction mode such as the intra block copy mode or the intra template matching prediction mode is improved, and thus the coding and decoding efficiency is improved.
[0298] In still another embodiment of the present application, based on the same inventive concept as the foregoing embodiments, referring to FIG. 18, a constituent structure schematic diagram of an encoder provided in the embodiment of the present application is shown. As shown in FIG. 18, the encoder 180 can comprise a first determining unit 1801 and a first prediction unit 1802; wherein,
[0299] The first determining unit 1801 is configured to determine one or more reference positions available for a current block to be encoded in a current image according to first position indication information.
[0300] The first determining unit 1801 is further configured to determine one or more time-domain block vectors in one or more co-located images of the current block according to the one or more reference positions, and determine a candidate block vector list of the current block according to the one or more time-domain block vectors.
[0301] The first prediction unit 1802 is configured to determine a prediction block of the current block according to the candidate block vector list.
[0302] The encoder 180 further comprises an encoding unit 1803 configured to, in a case where the current block uses a prediction mode corresponding to the candidate block vector list, determine a residual block of the current block according to the prediction block of the current block and the original block, encode the residual block of the current block, and write the encoded bits into the bitstream.
[0303] It can be understood that the various functional units of the encoder also perform the encoding method of any one of the foregoing embodiments.
[0304] It can be understood that, in the embodiments of the present application, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the constituent parts in the embodiments can be integrated in one processing unit, or can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.
[0305] The integrated unit, if implemented in the form of a software function module and not sold or used as an independent product, can be stored in a computer readable storage medium based on such understanding. The technical solutions of the embodiments essentially or the parts that contribute to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the embodiments. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0306] Therefore, the embodiments of the present application provide a computer readable storage medium applied to the encoder 180, and the computer readable storage medium stores a computer program. When the computer program is executed by the first processor, the encoding method of any one of the foregoing embodiments is implemented.
[0307] Based on the composition of the encoder 180 and the computer readable storage medium, referring to FIG. 19, a specific hardware structure schematic diagram of the encoder 180 provided by the embodiments of the present application is shown. As shown in FIG. 19, the encoder 180 can include a first communication interface 1901, a first memory 1902 and a first processor 1903; each component is coupled together through a first bus system 1904. It can be understood that the first bus system 1904 is used to realize the connection communication between the components. The first bus system 1904 includes a data bus, a power supply bus, a control bus and a state signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the first bus system 1904 in FIG. 19. Among them,
[0308] The first communication interface 1901 is used for receiving and sending signals in the process of transceiving information with other external network elements;
[0309] The first memory 1902 is used for storing a computer program capable of running on the first processor 1903;
[0310] The first processor 1903 is used for executing the following when running the computer program:
[0311] According to the first position indication information, one or more reference positions available for the current block in the current image are determined;
[0312] According to the one or more reference positions, one or more temporal block vectors in one or more collocated pictures of the current block are determined;
[0313] determine a candidate block vector list of the current block according to one or more time domain block vectors;
[0314] determine a prediction block of the current block according to the candidate block vector list.
[0315] It can be understood that the first memory 1902 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or a flash memory. The volatile memory can be a random access memory (Random Access Memory, RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). The first memory 1902 of the system and method described in the present application is intended to include but not limited to these and any other suitable types of memory.
[0316] The first processor 1903 can be an integrated circuit chip, which has the processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the first processor 1903. The first processor 1903 described above can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment of the present application can be directly embodied as a hardware code processor to execute, or be executed by a combination of hardware and software modules in the code processor. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the first storage 1902, and the first processor 1903 reads the information in the first storage 1902, and combines the hardware to complete the steps of the above method.
[0317] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be realized in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for executing functions of the present application or a combination thereof. For software implementation, the technology of the present application can be realized by modules (such as processes, functions, etc.) for executing functions of the present application. The software code can be stored in the memory and executed by the processor. The memory can be implemented in the processor or outside the processor.
[0318] Optionally, as another embodiment, the first processor 1903 is further configured to, when running the computer program, perform the encoding method of any one of the preceding embodiments.
[0319] The embodiment provides an encoder, in which a time domain block vector in a run information buffer of a collocated picture is added to a candidate block vector list as a newly added candidate block vector, the number of candidate block vectors is increased, the prediction effect of a prediction mode such as an intra block copy mode or an intra template matching prediction mode is improved, and thus the coding efficiency is improved.
[0320] The embodiment of the present application further provides a computer readable storage medium, which stores a code stream generated by the encoding method of any one of the preceding embodiments. The code stream is generated by bit encoding according to to-be-encoded information.
[0321] In still another embodiment of the present application, based on the same inventive concept of the preceding embodiments, referring to FIG. 20, a constituent structure schematic diagram of a decoder provided by the embodiment of the present application is shown. As shown in FIG. 20, the decoder 200 can include a second determining unit 2001 and a second prediction unit 2002; wherein,
[0322] The second determining unit 2001 is configured to determine one or more reference positions available for a to-be-decoded current block in a current picture according to first position indication information.
[0323] The second determining unit 2001 is further configured to determine one or more time domain block vectors in one or more collocated pictures of the current block according to the one or more reference positions, and determine a candidate block vector list of the current block according to the one or more time domain block vectors.
[0324] The second prediction unit 2002 is configured to determine a prediction block of the current block according to the candidate block vector list.
[0325] The decoder 200 further includes a decoding unit 2003 configured to decode a code stream, determine a residual block of the current block, and determine a reconstructed block of the current block according to a reference block and a prediction block of the current block.
[0326] It can be understood that the various functional units of the decoder also perform the decoding method of any one of the preceding embodiments.
[0327] It can be understood that, in this embodiment, the "unit" can be a partial circuit, a partial processor, a partial program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in this embodiment can be integrated in a processing unit, or can be physically present as individual units, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.
[0328] The integrated unit, if realized in the form of a software function module and not sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the embodiment provides a computer readable storage medium applied to the decoder 200, which stores a computer program, and the computer program is executed by the second processor to realize the decoding method of any one of the foregoing embodiments.
[0329] Based on the components of the decoder 200 and the computer readable storage medium, referring to FIG. 21, a specific hardware structure schematic diagram of the decoder 200 provided by the embodiment of the application is shown. As shown in FIG. 21, the decoder 200 can include a second communication interface 2101, a second memory 2102 and a second processor 2103; and the components are coupled together through a second bus system 2104. It can be understood that the second bus system 2104 is used to realize the connection communication between the components. The second bus system 2104 includes not only a data bus, but also a power supply bus, a control bus and a state signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the second bus system 2104 in FIG. 21. Among them,
[0330] The second communication interface 2101 is configured to receive and send signals in the information transceiving process between other external network elements;
[0331] The second memory 2102 is configured to store a computer program capable of running on the second processor 2103;
[0332] The second processor 2103 is configured to, when running the computer program, perform:
[0333] According to the first position indication information, determine one or more reference positions available for the current block to be decoded in the current image;
[0334] According to the one or more reference positions, determine one or more temporal block vectors in one or more collocated pictures of the current block;
[0335] According to the one or more temporal block vectors, determine a candidate block vector list of the current block;
[0336] According to the candidate block vector list, a prediction block of the current block is determined.
[0337] Optionally, as another embodiment, the second processor 2103 is further configured to, when running the computer program, perform the decoding method in any one of the preceding embodiments.
[0338] It can be understood that the second memory 2102 has similar hardware functions as the first memory 1902, and the second processor 2103 has similar hardware functions as the first processor 1903; and details are not described herein.
[0339] The embodiment provides a decoder, in which a time-domain block vector in a running information buffer of a collocated picture is added to a candidate block vector list as a newly-added candidate block vector, the number of candidate block vectors is increased, the prediction effect of a prediction mode such as an intra block copy mode or an intra template matching prediction mode is improved, and thus the coding efficiency is improved.
[0340] The embodiment further provides a computer program product, including a computer program or instructions, which are executed by a processor to perform the encoding method or the decoding method in any one of the preceding embodiments.
[0341] In another embodiment of the present application, referring to FIG. 22, a constituent structure schematic diagram of a coding system provided by the embodiment of the present application is shown. As shown in FIG. 22, the coding system 220 can include an encoder 2201 and a decoder 2202.
[0342] In the embodiment of the present application, the encoder 2201 can be the encoder described in any one of the preceding embodiments, and the decoder 2202 can be the decoder described in any one of the preceding embodiments.
[0343] It should be noted that, in the present application, the terms "comprising", "containing" or any other variants thereof are intended to cover non-exclusive containing, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another same element in the process, method, article or device including the element.
[0344] The serial numbers of the above embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0345] The methods disclosed in the several method embodiments of the present application can be combined arbitrarily without conflict to obtain new method embodiments.
[0346] The features disclosed in several product embodiments of the present application can be arbitrarily combined, without conflict, to obtain new product embodiments.
[0347] The features disclosed in several method or device embodiments of the present application can be arbitrarily combined, without conflict, to obtain new method embodiments or device embodiments.
[0348] The above description is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims. Industrial applicability
[0349] The embodiment of the present application provides a coding method, an encoder, a decoder and a storage medium. Whether at the encoding end or the decoding end, one or more reference positions available for a current block to be decoded in a current image are determined according to first position indication information; one or more temporal block vectors in one or more co-located pictures of the current block are determined according to the one or more reference positions; a candidate block vector list of the current block is determined according to the one or more temporal block vectors; and a prediction block of the current block is determined according to the candidate block vector list. In this way, the temporal block vector in the running information buffer of the co-located picture is added to the candidate block vector list as a new candidate block vector, the number of candidate block vectors is increased, the prediction effect of a prediction mode such as an intra block copy mode or an intra template matching prediction mode is improved, and the coding efficiency is improved.
Claims
1. A decoding method, applied to a decoder, comprising: determining, according to the first position indication information, one or more reference positions available for a current block to be decoded in the current image; determining one or more time-domain block vectors in one or more co-located images of the current block based on the one or more reference positions; Determine a candidate block vector list for the current block according to the one or more time-domain block vectors; Determine a prediction block for the current block according to the candidate block vector list.
2. The method according to claim 1, wherein The determining, according to the first position indication information, one or more reference positions available for the current block to be decoded in the current image includes: determining a first reference position of the current block according to the first position indication information, the position and size parameters of the current block; In a case where the first reference position is located within a first image range associated with the current block, determining that the first reference position is available; or, In a case where the first reference position is outside a first image range associated with the current block, it is determined that the first reference position is unavailable.
3. The method according to claim 2, wherein: The first image range includes one of the following: the current block, the current coding tree unit, the current sub-image, and the current image.
4. The method according to any one of claims 1 to 3, wherein: The first position indication information includes a first position index and one or more reference positions indicated by the first position index, wherein the first position index is used to indicate an index order of the reference positions.
5. The method according to claim 4, wherein The first position index indicates a primary position and a secondary position, and an index order of the primary position precedes an index order of the secondary position.
6. The method according to any one of claims 1 to 5, wherein: The reference position predefined by the first position indication information includes at least one of the following: one or more reference positions within the current block, one or more reference positions within the lower right area of the current block, and one or more reference positions within the upper left area of the current block.
7. The method according to claim 2, wherein: The determining, according to the first position indication information, one or more reference positions available for the current block to be decoded in the current image further includes: offsetting the first reference position according to a motion vector pointing to a first co-located image to determine a second reference position of the current block, wherein the first co-located image is any one of the one or more co-located images; In a case where the second reference position is located within a range of a second image associated with the current block, determining that the second reference position is available, wherein the second reference position is used to determine one or more time domain block vectors in the first co-located image; or In a case where the second reference position is outside the second image range associated with the current block, it is determined that the second reference position is unavailable.
8. The method according to claim 7, wherein: The method further comprises: When it is determined according to the first prediction parameter that the current block allows a reference position offset, the first reference position is offset according to a motion vector pointing to the first co-located image to determine a second reference position of the current block.
9. The method according to claim 8, wherein The first prediction parameter includes at least one of the following: a first syntax element, a size parameter of the current block; The method further includes: determining, based on a value of the first syntax element, that the current block allows a reference position offset, and determining that a size parameter of the current block is smaller than at least one of a first threshold value, that the current block allows a reference position offset.
10. The method according to claim 7, wherein: The method further comprises: Determining a reconstructed third reference position of the current block according to the second position indication information; In a case where the third reference position belongs to an inter block, obtaining one or more motion vectors and reference image indexes of the third reference position; The motion vector pointing to the first co-located image is determined according to the motion vector and the reference image index.
11. The method according to claim 10, wherein: The second position indication information includes a second position index and one or more reference positions indicated by the second position index, wherein the second position index is used to indicate an index order of the reference positions.
12. The method according to claim 11, wherein The reference position predefined by the second position indication information includes at least one of the following: a reference position reconstructed in the current image, a reference position reconstructed in the reference image of the current block; Among them, the reconstructed reference position in the current image includes at least one of the following: an adjacent reference position and a non-adjacent reference position of the current block; the reconstructed reference position in the reference image includes at least one of the following: an adjacent reference position and a non-adjacent block reference position of the reference block corresponding to the current block.
13. The method according to claim 10, wherein: The step of determining the motion vector pointing to the first co-located image according to the motion vector and the reference image index includes: In a case where the reference image indicated by the reference image index is the first co-located image of the current image, determining the motion vector to be a motion vector pointing to the first co-located image; or When the reference image indicated by the reference image index is not the first co-located image of the current image, the motion vector pointing to the reference image is converted into a motion vector pointing to the first co-located image to obtain a reference position offset of the first co-located image.
14. The method according to claim 13, wherein: The converting the motion vector pointing to the reference image into a motion vector pointing to the first co-located image comprises: determining, according to an image sequence number of a current image and an image sequence number of the reference image, a first difference in image sequence numbers between the current image and the reference image; determining, according to an image sequence number of a current image and an image sequence number of the first co-located image, a second difference in image sequence numbers between the current image and the first co-located image; The motion vector pointing to the reference image is converted according to the first difference value and the second difference value to obtain a motion vector pointing to the first co-located image.
15. The method according to claim 14, wherein The reference image includes a first reference image located in the same temporal direction as the first co-located image, or a second reference image located in an opposite temporal direction as the first co-located image.
16. The method according to any one of claims 1 to 15, wherein: The determining, according to the one or more time-domain block vectors, a candidate block vector list for the current block includes: reordering the one or more time-domain block vectors to obtain a reordered list; The reordered list is added to the candidate block vector list.
17. The method according to claim 16, wherein The reordering of the one or more time-domain block vectors to obtain a reordered list includes: Determine a distance reference value between a reference position of each time-domain block vector and a specific position of the current block; Reordering the one or more time-domain block vectors according to the distance reference values in order from near to far to obtain the reordered list; or, Based on template matching, determining the template matching cost value corresponding to each time domain block vector; The one or more time-domain block vectors are reordered in ascending order according to the template matching cost values to obtain the reordered list.
18. The method according to any one of claims 1 to 17, wherein: The determining, according to the first position indication information, one or more reference positions available for the current block to be decoded in the current image includes: In a case where it is determined according to the second prediction parameter that the candidate block vector list allows the addition of a time domain block vector, a first reference position available for the current block is determined according to the first position indication information.
19. The method according to claim 18, wherein The second prediction parameter includes at least one of the following: a second syntax element for indicating whether the candidate block vector list allows the addition of a time domain block vector, a current picture type, whether a co-located picture exists in the current picture, a size parameter of the current block, and the number of time domain block vectors; The method further comprises: Determining, based on the value of the second syntax element, that the candidate block vector list allows the addition of a time domain block vector, that the current image type is an inter-frame image, that the size parameter of the current block is greater than a second threshold, and that the number of time domain block vectors is not zero, one or more of the following, determines that the candidate block vector list allows the addition of a time domain block vector.
20. The method according to claim 1, wherein The candidate block vector list further includes at least one of the following: a block vector of a reconstructed adjacent block, a block vector of a reconstructed non-adjacent block, and an automatically relocated block vector.
21. A coding method, applied to an encoder, comprising: determining, according to the first position indication information, one or more reference positions available for a current block to be encoded in the current image; determining one or more time-domain block vectors in one or more co-located images of the current block based on the one or more reference positions; Determine a candidate block vector list for the current block according to the one or more time-domain block vectors; Determine a prediction block for the current block according to the candidate block vector list.
22. The method according to claim 21, wherein The determining, according to the first position indication information, one or more reference positions available for the current block to be encoded in the current image includes: determining a first reference position of the current block according to the first position indication information, the position and size parameters of the current block; In a case where the first reference position is within the first image range associated with the current block, using the first reference position as an available reference position; or In a case where the first reference position is outside a first image range associated with the current block, it is determined that the first reference position is unavailable.
23. The method according to any one of claims 21 to 22, wherein: The first position indication information includes a first position index and one or more reference positions indicated by the first position index, wherein the first position index is used to indicate an index order of the reference positions.
24. The method according to any one of claims 21 to 23, wherein: The multiple reference positions predefined by the first position indication information include at least one of the following: one or more reference positions within the current block, one or more reference positions within the lower right area of the current block, and one or more reference positions within the upper left area of the current block.
25. The method according to claim 22, wherein The determining, according to the first position indication information, one or more reference positions available for the current block to be encoded in the current image further includes: offsetting the first reference position according to a motion vector pointing to a first co-located image to determine a second reference position of the current block, wherein the first co-located image is any one of the one or more co-located images; In a case where the second reference position is located within a range of a second image associated with the current block, determining that the second reference position is available, wherein the second reference position is used to determine one or more time domain block vectors in the first co-located image; or In a case where the second reference position is outside the second image range associated with the current block, it is determined that the second reference position is unavailable.
26. The method according to claim 25, wherein The method further comprises: Determining a reconstructed third reference position of the current block according to the second position indication information; In a case where the third reference position belongs to an inter block, obtaining one or more motion vectors and reference image indexes of the third reference position; The motion vector pointing to the first co-located image is determined according to the motion vector and the reference image index.
27. The method according to claim 26, wherein The step of determining the motion vector pointing to the first co-located image according to the motion vector and the reference image index includes: In a case where the reference image indicated by the reference image index is the first co-located image of the current image, determining the motion vector to be a motion vector pointing to the first co-located image; or When the reference image indicated by the reference image index is not the first co-located image of the current image, the motion vector pointing to the reference image is converted into a motion vector pointing to the first co-located image to obtain a reference position offset of the first co-located image.
28. The method according to any one of claims 21 to 27, wherein The determining, according to the one or more time-domain block vectors, a candidate block vector list for the current block includes: reordering the one or more time-domain block vectors to obtain a reordered list; The reordered list is added to the candidate block vector list.
29. The method according to any one of claims 21 to 28, wherein The determining, according to the first position indication information, one or more reference positions available for the current block to be encoded in the current image includes: In a case where it is determined according to the second prediction parameter that the candidate block vector list allows the addition of a time domain block vector, a first reference position available for the current block is determined according to the first position indication information.
30. The method according to claim 29, wherein The second prediction parameter includes at least one of the following: a second syntax element for indicating whether the candidate block vector list allows the addition of a time domain block vector, a current picture type, whether a co-located picture exists in the current picture, a size parameter of the current block, and the number of time domain block vectors; The method further comprises: Determining, based on the value of the second syntax element, that the candidate block vector list allows the addition of a time domain block vector, that the current image type is an inter-frame image, that the size parameter of the current block is greater than a second threshold, and that the number of time domain block vectors is not zero, one or more of the following, determines that the candidate block vector list allows the addition of a time domain block vector.
31. The method according to any one of claims 21 to 30, wherein The method further comprises: In a case where the current block uses a prediction mode corresponding to the candidate block vector list, determining a residual block of the current block according to the prediction block and the original block of the current block; The residual block of the current block is encoded, and the encoded bits are written into a bitstream.
32. An encoder comprising a first determining unit and a first predicting unit; wherein: The first determining unit is configured to determine one or more reference positions available for a current block to be encoded in the current image according to the first position indication information; The first determining unit is further configured to determine one or more time-domain block vectors in one or more co-located images of the current block according to the one or more reference positions; and determine a candidate block vector list for the current block according to the one or more time-domain block vectors; The first prediction unit is configured to determine a prediction block of the current block according to the candidate block vector list.
33. An encoder comprising a first memory and a first processor; wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 21 to 31 when running the computer program.
34. A decoder comprising a second determination unit and a second prediction unit; wherein: The second determining unit is configured to determine one or more reference positions available for a current block to be decoded in the current image according to the first position indication information; The second determining unit is further configured to determine one or more time-domain block vectors in one or more co-located images of the current block according to the one or more reference positions; and determine a candidate block vector list for the current block according to the one or more time-domain block vectors; The second prediction unit is configured to determine a prediction block of the current block according to the candidate block vector list.
35. A decoder comprising a second memory and a second processor; wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 20 when running the computer program.
36. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 20 is implemented, or the method according to any one of claims 21 to 31 is implemented.
Citation Information
Patent Citations
Historical candidate list-based image encoding method, historical candidate list-based image decoding method, encoder and decoder
CN110868613A
Signaling of triangle merge mode indexes in video coding
CN113508594A
Method, apparatus, and medium for video processing
WO2023025114A1
Ordering method and device, decoding method, encoding method, decoder, and encoder
WO2024000581A1
Method, device, and recording medium for image encoding / decoding
WO2024010377A1