Video encoding method, video decoding method and storage medium
Intra template matching prediction methods enhance video compression efficiency by constructing candidate lists for intra prediction, addressing the need for improved data reduction in high-resolution video transmission.
Patent Information
- Application Number
- JP2025540024
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-01-04
- Publication Date
- 2026-01-16
AI Technical Summary
Existing digital video compression standards face challenges in achieving further reduction of video data to alleviate bandwidth and traffic pressure, particularly in high-resolution video transmission.
Intra template matching prediction methods are introduced, including candidate list construction and video encoding/decoding techniques that utilize intra template matching prediction (intraTMP) to improve coding efficiency by using a candidate list of reference blocks for intra prediction, determining the smallest coding cost through rate-distortion optimization.
Enhances coding efficiency by reducing redundancy and improving compression performance in video data transmission, particularly for screen content with sharp boundaries and overlapping areas.
Smart Images

Figure 2026501769000001_ABST
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to video technology, but is not limited thereto, and more particularly to an intra template matching prediction method, a video encoding and decoding method, an apparatus, and a system. [Background technology]
[0002] Digital video compression technology primarily compresses massive amounts of digital video data for easier transmission and storage. Current general-purpose video encoding and decoding standards, such as H.266 / Versatile Video Coding (VVC), employ a block-based hybrid coding framework. Each frame of video is divided into square largest coding units (LCUs) of the same size (e.g., 128x128, 64x64, etc.). Each LCU can then be divided into rectangular coding units (CUs) according to a set of rules. Coding units can then be further divided into prediction units (PUs), transform units (TUs), etc. The hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, and in-loop filters. The prediction module includes intra-prediction and inter-prediction for reducing or removing redundancy within video. Inter-prediction involves motion estimation and motion compensation. Because there is strong correlation between adjacent pixels within a frame of video, video coding and decoding technologies use intra-prediction methods to remove spatial redundancy between adjacent pixels. Because there is strong similarity between adjacent frames of video, video coding and decoding technologies use inter-prediction methods to remove temporal redundancy between adjacent frames and improve coding efficiency. Residual information from the prediction signal is transformed, quantized, and entropy coded on a block-by-block basis to generate a codestream.
[0003] With the rapid growth of Internet video and increasing user demand for video resolution, although existing digital video compression standards have achieved a large amount of video data reduction, there is still a need to pursue better digital video compression technologies to reduce the bandwidth and traffic pressure of digital video transmission. Summary of the Invention [Means for solving the problem]
[0004] The following is a summary of the subject matter described in detail herein. This summary does not limit the scope of the claims.
[0005] An embodiment of the present disclosure provides a candidate list construction method for intra template matching prediction, the method comprising: determining a first search range for intra template matching prediction intraTMP of the current block; searching for a reference block template based on the first search range and calculating a difference between the searched reference block template and a current block template, the reference block template having a one-to-one correspondence with the reference block; constructing a candidate list of intraTMP based on the difference, and determining N reference blocks in the candidate list and an order of the N reference blocks, where N≧2.
[0006] An embodiment of the present disclosure further provides a video decoding method, the method comprising: decoding an intra template matching prediction intraTMP mode use flag of the current block; If it is determined that the current block uses intraTMP mode based on the intraTMP mode usage flag, continue decoding an intraTMP index of the current block, where the intraTMP index indicates that the reference block used by the current block is at a position in an intraTMP candidate list; constructing a candidate list, determining reference blocks to be used by the current block based on the intraTMP index and the candidate list, and performing intra prediction on the current block based on the reference blocks to be used by the current block.
[0007] An embodiment of the present disclosure further provides a video encoding method, the method comprising: When determining that the current block is allowed to use the multi-candidate intra template matching prediction intraTMP mode, constructing an intraTMP candidate list according to the intraTMP candidate list construction method described in any embodiment of the present disclosure, the candidate list includes N reference blocks, where N≧2; Calculating coding costs for predicting the current block based on the N reference blocks in the candidate list, and determining the smallest coding cost among the N reference blocks as the coding cost of the intraTMP mode among the multiple candidates for rate-distortion optimization; If it is determined that the current block is to be intra predicted using the intraTMP mode, encoding syntax elements related to the intraTMP mode of the current block.
[0008] An embodiment of the present disclosure further provides a candidate list construction method for intra template matching prediction, the method comprising: determining a first search range for intra template matching prediction intraTMP of the current block; searching for a reference block template based on the first search range, and calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, wherein the reference block template corresponds to the reference block one-to-one, and the combination of the reference block template corresponds to the combination of the reference block one-to-one; constructing a candidate list of intraTMP based on the difference, and determining a number of candidate items in the candidate list and an order of the number of candidate items.
[0009] An embodiment of the present disclosure further provides a candidate list construction method for intra template matching prediction, the method comprising: determining a first search range for intra template matching prediction (intraTMP) of the current block, the first search range being located within a reconstruction area of the current image; determining a set of BVs based on a first search step size and the first search range, where the positions indicated by the set of BVs are within the first search range; searching for a corresponding reference block template based on the set of BVs; and calculating a difference between the searched reference block template and a current block template; filling the candidate list with BVs corresponding to the N reference block templates with the smallest differences in ascending order of corresponding differences, where N is the length of the candidate list and N≧2; The reference block template corresponds one-to-one with the reference block, and the difference of the reference block template with respect to the current block template is determined based on the SAD, SATD, or MSE between the reconstructed value of the reference block template and the reconstructed value of the current block template, and the BV of the reference block is used to indicate the position of the reference block with respect to the current block, and the BV corresponding to the reference block template is the BV of the reference block corresponding to the reference block template.
[0010] An embodiment of the present disclosure also provides a video decoding method, the method comprising: decoding an intra template matching prediction intraTMP mode use flag of the current block; If it is determined that the current block uses the intraTMP mode based on the intraTMP mode usage flag, continuing to decode syntax elements of the intraTMP mode of the current block; constructing a candidate list of intraTMP, determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, and performing intra prediction on the current block based on the reference block or the combination of reference blocks to be used by the current block.
[0011] An embodiment of the present disclosure further provides a video encoding method, the method comprising: If it is determined that the current block is allowed to use the multi-candidate intra template matching prediction intraTMP mode, constructing an intraTMP candidate list according to the method described in any embodiment of the present disclosure; calculating coding costs for predicting the current block based on the reference blocks or combinations of reference blocks in the candidate list, and determining the smallest coding cost among the coding costs as the intraTMP mode coding cost of the multiple candidates, and using it in rate-distortion optimization; If it is determined that the current block is to be intra predicted using the intraTMP mode, encoding syntax elements related to the intraTMP mode of the current block.
[0012] An embodiment of the present disclosure further provides a codestream, which is generated according to the video encoding method described in any of the embodiments of the present disclosure.
[0013] An embodiment of the present disclosure further provides a candidate list construction device for intra template matching prediction, the device including a processor and a memory storing a computer program, and capable of implementing the candidate list construction method for intra template matching prediction described in any embodiment of the present disclosure when the processor executes the computer program.
[0014] An embodiment of the present disclosure further provides a video decoding device, which includes a processor and a memory storing a computer program, and is capable of implementing the video decoding method described in any of the embodiments of the present disclosure when the processor executes the computer program.
[0015] An embodiment of the present disclosure further provides a video encoding device, which includes a processor and a memory storing a computer program, and is capable of implementing the video encoding method described in any of the embodiments of the present disclosure when the processor executes the computer program.
[0016] An embodiment of the present disclosure further provides a video encoding / decoding system, the system including: a video encoding device according to any one of the embodiments of the present disclosure; and a video decoding device according to any one of the embodiments of the present disclosure.
[0017] An embodiment of the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored therein, the computer program being capable of implementing the method according to any one of the embodiments of the present disclosure when executed by a processor.
[0018] An embodiment of the present disclosure further provides a computer program product, which includes a computer program, which, when executed by a processor, can implement the method according to any of the embodiments of the present disclosure.
[0019] An embodiment of the present disclosure further provides a method for determining a search range for an intraTMP, the method comprising: If the current block allows the use of intraTMP mode, the first search distance in the width direction and the second search distance in the height direction of the first search range relative to the base point representing the position of the current block are: Calculating the product of the width of the current block and a first scale factor, and determining the larger value of this product and the set minimum search distance in the width direction as the first search distance; calculating the product of the height of the current block and a second scale factor, and determining the larger value of this product and the set minimum search distance in the height direction as the second search distance, wherein the first scale factor and the second scale factor are equal or unequal; or determining the larger value of the width of the current block and the set minimum search distance in the width direction, and setting the product of the larger value and a first scale factor as the first search distance; determining the larger value of the height of the current block and the set minimum search distance in the height direction, and setting the product of the larger value and a second scale factor as the second search distance, wherein the first scale factor and the second scale factor are equal or unequal; or The first search distance is obtained by multiplying by a first scale factor corresponding to the width of the current block, where there are multiple first scale factors, and the larger the first scale factor, the larger the width of the corresponding current block; and the second search distance is obtained by multiplying by a second scale factor corresponding to the height of the current block, where there are multiple second scale factors, and the larger the second scale factor, the larger the height of the corresponding current block.
[0020] Other aspects will become apparent after reading and understanding the accompanying drawings and detailed description. [Brief explanation of the drawings]
[0021] The accompanying drawings are intended to provide an understanding of the embodiments of the present disclosure and constitute a part of the specification, and are used to explain the technical means of the present disclosure together with the embodiments of the present disclosure, but are not intended to limit the technical means of the present disclosure. [Figure 1A] 1 is a schematic diagram of an encoding / decoding system according to an embodiment of the present disclosure. [Figure 1B] FIG. 1 is a framework diagram of the encoding side according to an embodiment of the present disclosure. [Figure 1C] FIG. 10 is a framework diagram on the decoding side according to an embodiment of the present disclosure. [Figure 2A] 1 is a schematic diagram illustrating a current block predicted using an intra prediction method; [Figure 2B] 1 is a schematic diagram illustrating a current block predicted using a multi-reference row intra prediction method; [Figure 3] FIG. 1 is a schematic diagram of conventional intra prediction modes used in non-wide angle modes in VVC. [Figure 4] FIG. 1 is a schematic diagram of a conventional intra-prediction mode used in wide-angle mode in VVC. [Figure 5] FIG. 1 is a schematic diagram of conventional intra-prediction modes used in AVS3. [Figure 6] FIG. 1 is a schematic diagram illustrating intra prediction based on IBC mode. [Figure 7] FIG. 1 is a schematic diagram of inter prediction based on template matching technology. [Figure 8] 1 is a schematic diagram illustrating intra prediction based on the intraTMP mode. [Figure 9] 1 is a flowchart of a method for constructing a candidate list for intraTMP according to an embodiment of the present disclosure. [Figure 10] FIG. 10 is a schematic diagram illustrating setting of a search distance according to an embodiment of the present disclosure. [Figure 11] 1 is a flowchart of a video decoding method according to an embodiment of the present disclosure. [Figure 12] 1 is a flowchart of a video encoding method according to an embodiment of the present disclosure. [Figure 13A]FIG. 10 is a schematic diagram of a position indicated by a BV during a first stage search according to an embodiment of the present disclosure. [Figure 13B] FIG. 10 is a schematic diagram illustrating a method for determining a local search range in a second-stage search based on a BV reserved in a first-stage search according to an embodiment of the present disclosure. [Figure 14] FIG. 2 is a module diagram of an intra-prediction device according to an embodiment of the present disclosure. [Figure 15] 10 is a flowchart of a candidate list construction method for intraTMP according to another embodiment of the present disclosure. [Figure 16] 10 is a flowchart of a candidate list construction method for intraTMP according to another embodiment of the present disclosure. [Figure 17] 10 is a flowchart of a video decoding method according to another embodiment of the present disclosure. [Figure 18] 10 is a flowchart of a video encoding method according to another embodiment of the present disclosure. [Figure 19] FIG. 10 is a schematic diagram of obtaining a second reference block template according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE INVENTION
[0022] While this disclosure describes multiple embodiments, the description is illustrative and not restrictive, and those skilled in the art will recognize that there are many more embodiments and implementations that are within the scope of the embodiments described in this disclosure.
[0023] In describing the present disclosure, terms such as "exemplary" or "for example" are used as examples, examples, or explanations. Any embodiment described as "exemplary" or "for example" in the present disclosure should not be construed as preferred or advantageous over other embodiments. In this specification, "and / or" is an expression expressing a relationship between related objects and indicates that three types of relationships may exist. For example, "A and / or B" refers to three cases: the presence of only A, the simultaneous presence of A and B, and the presence of only B. "Plurality" means two or more. Furthermore, to clearly describe the technical means of the embodiments of the present disclosure, terms such as "first" and "second" are used to distinguish between identical or similar items that essentially have the same function and operation. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, nor do they necessarily limit different items.
[0024] As used herein, "including any one or more of the following: Alternative 1, Alternative 2, ..." or "including any one or more of Alternative 1, Alternative 2, ..." means including any one of the listed alternatives or any combination of multiple listed alternatives. For example, "including any one or more of the following: A, B" or "including any one or more of A and B" means including only A, including only B, or including A and B. Also, for example, "including any one or more of the following: A, B, C" or "including any one or more of A, B, C" means including only A, including only B, including only C, including A and B, including A and C, including B and C, or including A, B, and C. Similar analogy can be applied to cases where there are more alternatives.
[0025] In describing representative illustrative embodiments, the specification may present a method and / or process as having a particular order of steps. However, unless the method or process relies on the particular order of steps described herein, the method or process should not be limited to the particular order of steps described. As one of ordinary skill in the art will understand, other order of steps are possible. Thus, the particular order of steps described in the specification should not be construed as limiting the claims. Additionally, method and / or process claims should not be limited to performing the steps in the order described; one of ordinary skill in the art will readily understand that these orders can be changed and still remain within the spirit and scope of the embodiments of the present disclosure.
[0026] The intra prediction method and the video encoding / decoding method according to the embodiments of the present disclosure are applicable to various video encoding / decoding standards, such as H.264 / Advanced Video Coding (AVC), H.265 / High Efficiency Video Coding (HEVC), H.266 / Versatile Video Coding (VVC), AVS (Audio Video Coding Standard), and other standards formulated by MPEG (Moving Picture Experts Group), AOM (Alliance for Open Media), JVET (Joint Video Experts Team), extensions of these standards, or any other customized standards.
[0027] FIG. 1A is a block diagram of a video encoding / decoding system applicable to an embodiment of the present disclosure. As shown in the figure, the system is divided into an encoding side 1 and a decoding side 2. The encoding side 1 generates a codestream. The decoding side 2 can decode the codestream. The decoding side 2 can receive the codestream from the encoding side 1 via a link 3. The link 3 includes one or more media or devices that can transfer the codestream from the encoding side 1 to the decoding side 2. In one example, the link 3 includes one or more communication media that can enable the encoding side 1 to directly transmit the codestream to the decoding side 2. The encoding side 1 modulates the codestream according to a communication standard and transmits the modulated codestream to the decoding side 2. The one or more communication media can include wireless and / or wired communication media and can form part of a packet network. In another example, the codestream can be output from an output interface 15 to a storage device, and the decoding side 2 can read the stored data from the storage device by streaming or downloading.
[0028] As shown in the figure, the encoding side 1 includes a data source 11, a video encoding device 13, and an output interface 15. The data source 11 may include a video capture device (e.g., a camera), an archive containing pre-captured data, a feed-in interface for receiving data from a content provider, a computer graphics system for generating data, or a combination of these sources. The video encoding device 13, also referred to as the video encoding side, is used to encode data from the data source 11 and then output it to the output interface 15. The output interface 15 may include at least one of a regulator, a modem, and a transmitter. The decoding side 2 includes an input interface 21, a video decoding device 23, and a display device 25. The input interface 21 may include at least one of a receiver and a modem. The input interface 21 may receive a codestream from the link 3 or a storage device. The video decoding device 23, also referred to as the video decoding side, is used to decode the received codestream. The display device 25 is used to display the decoded data. The display device 25 may be integrated with other devices in the decoding side 2 or installed separately. The display device 25 is optional for the decoding side 2. In other examples, the decryption side may include other devices or equipment that apply the decrypted data.
[0029] 1B is a block diagram of an exemplary video encoding device applicable to embodiments of the present disclosure. As shown in the figure, the video encoding device 10 includes:
[0030] The division unit 101 is configured to cooperate with the prediction unit 100 to divide the received video data into slices, coding tree units (CTUs), or other large units, and the received video data may be a video sequence including video frames, such as I-frames, P-frames, or B-frames.
[0031] The prediction unit 100 is configured to divide the CTU into coding units (CUs) and perform intra-prediction coding or inter-prediction coding on the CUs. When performing intra-prediction and inter-prediction on the CUs, the CUs may be divided into one or more prediction units (PUs).
[0032] The prediction unit 100 includes an inter prediction unit 121 and an intra prediction unit 126 .
[0033] The inter prediction unit 121 is configured to perform inter prediction on the PU and generate prediction data for the PU. The prediction data includes a prediction block of the PU, motion information of the PU, and various syntax elements. The inter prediction unit 121 may include a motion estimation (ME) unit and a motion compensation (MC) unit. The motion estimation unit may be used to perform motion estimation and generate a motion vector, and the motion compensation unit may be used to obtain or generate a prediction block based on the motion vector.
[0034] The intra prediction unit 126 is configured to perform intra prediction on the PU and generate prediction data for the PU. The prediction data for the PU may include a prediction block and various syntax elements for the PU.
[0035] The residual generation unit 102 (represented by a circle with a plus sign after the division unit 101 in the figure) is configured to generate a residual block of the CU by subtracting a prediction block of the PU divided by the CU from the original block of the CU.
[0036] The transform processing unit 104 is configured to divide a CU into one or more transform units (TUs). The division of prediction units and transform units may be different. The residual block associated with a TU is a sub-block into which the residual block of the CU is divided. Coefficient blocks associated with the TU are generated by applying one or more transforms to the residual block associated with the TU.
[0037] The quantization unit 106 is configured to quantize the coefficients in the coefficient block based on a quantization parameter, and may change the degree of quantization of the coefficient block by adjusting the quantizer parameter (QP).
[0038] Inverse Quantization Unit 108 and Inverse Transform process The units 110 are configured to apply inverse quantization and inverse transform to the coefficient blocks, respectively, to obtain reconstructed residual blocks associated with the TUs.
[0039] The reconstruction unit 112 (represented in the figure by a circle with a plus sign after the inverse transform processing unit 110) is configured to generate a reconstructed image by adding the reconstructed residual block and the prediction block generated by the prediction unit 100.
[0040] The filter unit 113 is configured to perform a loop filter on the reconstructed image.
[0041] The decoded image buffer 114 is configured to store the reconstructed image after the loop filter. The intra prediction unit 126 may perform intra prediction by extracting reference images of blocks adjacent to the current block from the decoded image buffer 114. The inter prediction unit 121 performs inter prediction on the PU of the current frame using the reference image of the previous frame cached in the decoded image buffer 114.
[0042] The entropy coding unit 115 is configured to perform an entropy coding process on the received data (eg, syntax elements, quantized coefficient blocks, motion information, etc.) to generate a video codestream.
[0043] In other examples, video encoding device 10 may include more, fewer, or different functional components than those illustrated here, for example, transform processing unit 104 and / or inverse transform unit 110 may be omitted.
[0044] 1C is a block diagram of an exemplary video decoding device applicable to embodiments of the present disclosure. As shown in the figure, the video decoding device 15 includes:
[0045] The entropy decoding unit 150 is configured to entropy decode the received encoded video code stream and extract syntax elements, quantized coefficient blocks, motion information of PUs, etc. The prediction unit 152, the inverse quantization unit 154, the inverse transform processing unit 155 , reconstruction unit 158, and filter unit 159 all perform corresponding operations based on syntax elements extracted from the codestream.
[0046] The inverse quantization unit 154 is configured to inverse quantize the coefficient blocks associated with the quantized TUs.
[0047] Inverse Transformation Processing Unit 155 is configured to generate a reconstructed residual block of the TU by applying one or more inverse transforms to the inverse-quantized coefficient block.
[0048] The prediction unit 152 includes an inter prediction unit 162 and an intra prediction unit 164. If the current block uses intra prediction coding, the intra prediction unit 164 determines an intra prediction mode of the PU based on syntax elements decoded from the codestream, and performs intra prediction by combining reconstructed reference information neighboring the current block obtained from the decoded image buffer 160. If the current block uses inter prediction coding, the inter prediction unit 162 determines a reference block of the current block based on motion information and corresponding syntax elements of the current block, and performs inter prediction on the reference block obtained from the decoded image buffer 160.
[0049] The reconstruction unit 158 (represented in the figure by a circle with a plus sign after the inverse transform processing unit 155) is configured to obtain a reconstructed image based on a reconstructed residual block associated with the TU and a predicted block of the current block generated by the prediction unit 152 performing intra prediction or inter prediction.
[0050] The filter unit 159 is configured to perform loop filtering on the reconstructed image.
[0051] The decoded image buffer 160 is configured to store the reconstructed image after loop filtering and use it as a reference image for subsequent motion compensation, intra-prediction, inter-prediction, etc., or to output the reconstructed image after filtering as decoded video data for display on a display device.
[0052] In other embodiments, video decoder device 15 may include more, fewer, or different functional components. For example, inverse transform processing unit 155 may be omitted in certain cases.
[0053] Based on the above-described video encoding device and video decoding device, the following basic encoding and decoding flow can be performed. On the encoding side, a frame image is divided into blocks, or first divided into multiple slices and then divided into blocks. Slices within the same image can be processed in parallel. A current block is subjected to intra-prediction, inter-prediction, or other algorithm to generate a predicted block of the current block, and the predicted block is subtracted from the original block of the current block to obtain a residual block. The residual block is transformed and quantized to obtain a quantized coefficient matrix, and the quantized coefficient matrix is then entropy coded to generate a code stream. On the decoding side, intra-prediction or inter-prediction is performed on the current block to generate a predicted block of the current block, while inverse quantization and inverse transform are performed on the quantized coefficient matrix obtained from the decoded code stream to obtain a residual block. The predicted block and residual block are added together to obtain a reconstructed block. The reconstructed block forms a reconstructed image, and a decoded image is obtained by performing loop filtering on the reconstructed image based on the image or block. The encoding side also obtains a decoded image (also called a reconstructed image after loop filtering) using operations similar to those on the decoding side. The reconstructed image after loop filtering is used as a reference frame for inter-prediction of the following frame. Block partition information, mode information for prediction, transformation, quantization, entropy coding, loop filter, etc. determined by the encoding side, and parameter information are written to the codestream. The decoding side determines the block partition information, mode information for prediction, transformation, quantization, entropy coding, loop filter, etc. used by the encoding side by decoding the codestream or by analyzing it based on known information, so that the decoded image obtained by the encoding side is the same as the decoded image obtained by the decoding side.
[0054] The above is an example of a block-based hybrid coding framework, but the embodiments of the present disclosure are not limited thereto. As technology advances, one or more modules in the framework or one or more steps in the flow may be replaced or optimized. The embodiments of the present disclosure include, but are not limited to, the above-mentioned intra prediction units and corresponding intra prediction methods on the encoding and decoding sides.
[0055] In this specification, the "current block" may be a block-level coding unit such as a coding unit (CU), a prediction unit (PU), or a sub-block divided by a CU or PU that is currently being coded or decoded.
[0056] Intra prediction
[0057] Intra prediction predicts a current block using coded and decoded reconstructed pixels around the current block as reference pixels. For example, as shown in Figure 2A, the current block is a 4x4 block, and the pixels in the left column and the top row of the current block are the reference pixels for the current block. Intra prediction predicts the current block using these reference pixels. All of these reference pixels may have already been coded or decoded, and some may not be available. For example, if the current block is located at the leftmost edge of the entire frame, the reference pixels to the left of the current block are unavailable. Furthermore, if the lower left portion of the current block has not yet been coded or decoded when coding or decoding the current block, the reference pixels to the lower left are also unavailable. When reference pixels are unavailable, available reference pixels, specific values, or a specific method may be used for filling, or no filling may be performed.
[0058] The multi-reference line (MRL) intra prediction method can improve coding efficiency by using more reference pixels. Figure 2B shows an example using four reference rows / columns.
[0059] Traditional intra prediction mode
[0060] There are multiple prediction modes for intra prediction, and the number of prediction modes is increasing with technological advances and the expansion of block sizes. For example, the intra prediction modes used in HEVC are 35 in total, including the planar mode, the average mode (DC mode), and 33 angle modes. prediction As shown in Figure 3, there are 67 modes in total, including planar mode, DC mode, and 65 angle modes. In addition to these 67 modes, VVC provides a wide-angle mode for some rectangular blocks with a large difference between length and width, and modes in two intervals, -14 to -1 and 67 to 80, shown by dashed lines in Figure 4, replace some of the normal modes. As shown in Figure 5, AVS3 uses a total of 66 prediction modes, including DC mode, planar mode, bilinear mode, pulse code modulation mode (PCM mode), and 62 angle modes.
[0061] Inter Prediction
[0062] Video is composed of multiple images. To ensure smooth video, each second of video contains dozens to hundreds of frames (e.g., 24, 30, 50, 60, or 120 frames per second). This creates significant temporal redundancy, or in other words, a high degree of temporal correlation. Inter-frame prediction exploits this temporal correlation to improve compression efficiency. Inter-frame prediction typically exploits temporal correlation using "motion." One very simple "motion" model is one in which an object exists at a specific location in a corresponding image at a given time, and then, over a period of time, it horizontally shifts to another location in the corresponding image at that time. This is horizontal shifting in video encoding and decoding. In inter-frame prediction, "motion" is represented using motion information. Basic motion information includes information about a reference frame (or reference picture) and a motion vector (MV). The codec identifies the reference frame based on the reference picture information and determines the coordinates of the reference block based on the motion vector information and the coordinates of the current block. The most basic method of inter prediction is to determine a reference block using the coordinates of the reference block in the reference image, and use the determined reference block as the predicted block.
[0063] Not all motion in video is this simple. Even if motion can be considered horizontal, subtle changes, including slight changes in shape, brightness, and noise, can occur over time. Better prediction results can be achieved by predicting the current block using one or more reference blocks. For example, currently commonly used bidirectional prediction predicts the current block using two reference blocks. The two reference blocks may be one forward reference block and one backward reference block. In future, both reference blocks may be forward reference blocks or two backward reference blocks. Future video coding and decoding standards may support prediction using multiple reference blocks. A simple way to generate a prediction block using two reference blocks is to average the pixel values of corresponding positions in the two reference blocks to obtain the prediction block. To achieve even higher prediction accuracy, weighted averaging, such as bi-prediction with CU-level weighting (BCW), currently used in VVC, may also be used. Geometric partitioning mode (GPM) in VVC may also be considered a special form of bidirectional prediction. To realize bidirectional prediction, it is naturally necessary to find two reference blocks, and therefore information on two sets of reference images and motion vectors is required.
[0064] Intra-Block Copy (IBC)
[0065] Intra Block Copy (IBC) technology significantly improves the compression efficiency of screen content coding, and IBC mode is used for screen content coding from HEVC to VVC. Screen content is generated by a computer, unlike camera-captured content. Screen content has less noise, includes text and computer graphics, and has clear boundaries. In addition, screen content often contains a large amount of overlapping content, as shown in Figure 6.
[0066] In inter prediction, a reference block in a reference picture is used as a prediction block for the current block, but the reference picture is different from the current picture. On the other hand, IBC mode applies the inter prediction technique to intra prediction, and in IBC mode, a block is found as a prediction block for the current block from the coded and decoded part of the current picture (also called the reconstructed part). IBC mode is also called intra picture block compensation mode or current picture referencing (CPR) mode.
[0067] In IBC mode, a block vector (BV) is used to represent the positional relationship between a current block and a reference block. This is similar to a motion vector (MV) in inter prediction. The encoding side determines the best match block for the current block within a search range using a block matching technique, and then encodes the BV. IBC can be considered a type of intra prediction method, or a separate type of prediction method independent of intra prediction and inter prediction.
[0068] Template Matching (TM)
[0069] Template matching (TM) technology is primarily used for inter prediction, exploiting the correlation between neighboring pixels and using several regions surrounding the current block as templates. When encoding and decoding a current block, the regions to the left and above the current block have already been encoded and decoded according to the encoding order. In actual hardware decoding implementations, the left and above regions are not necessarily already decoded when decoding of the current block begins. For example, in HEVC, an inter-coded block does not require neighboring reconstructed pixels to generate a predicted block, so the prediction process for the inter block can be performed in parallel. However, an intra-coded block requires reconstructed pixels to the left and above as reference pixels. Therefore, corresponding adjustments in the hardware design enable the reconstructed pixels to the left and above of the current block to be obtained. However, in the encoding order of current standards such as VVC, reconstructed pixels to the right and below of the current block are not available.
[0070] As shown in FIG. 7, rectangular regions on the left and top of the current block are used as templates. The height of the left template is usually the same as the height of the current block, and the width of the top template is usually the same as the width of the current block, but may differ. The motion information or motion vector of the current block is determined by searching the best-matching position of the template in a reference frame. This process can be broadly described as searching a certain range from a starting position in a reference frame. Search rules such as the search range and search step size may be preset. Each time a position is moved, the degree of match between the template corresponding to this position and templates surrounding the current block is calculated. The degree of match can be measured by difference, and a smaller value, for example, the sum of absolute difference (SAD), sum of absolute transformed difference (SATD), or mean-square error (MSE), indicates a higher degree of match. A cost is calculated based on the predicted block of the template corresponding to this position and the reconstructed blocks of the template surrounding the current block. The motion information of the current block is determined based on the position with the highest degree of match of the searched template. By utilizing the correlation between neighboring pixels, the motion information suitable for the template may also be suitable for the current block.
[0071] Because template matching methods are not necessarily applicable to all blocks, several methods may be used to determine whether the current block uses template matching, such as a control switch for the current block to determine whether to use template matching. A conventional template matching technique is called decoder-side motion vector derivation (DMVD). Both the encoding and decoding sides can perform searches using templates to derive motion information or find better motion information based on the original motion information. This eliminates the need to transmit specific motion vectors or motion vector differences, and ensures consistency between encoding and decoding by performing searches according to the same rules on both the encoding and decoding sides. While template matching can improve compression performance, it also requires a search on the decoding side, which increases the complexity of the decoding side.
[0072] Intra-template matching prediction (intraTMP)
[0073] Intra template matching prediction (intraTMP) is a technique that combines IBC and TM. Applying TM to inter prediction reduces the coding overhead of MVs. Similarly, applying TM to IBC can reduce the coding overhead of BVs. For example, there is no need to code BVs. The block with the highest matching degree by TM is used as the intraTMP mode prediction block for the current block, and this block is then used in rate-distortion optimization to determine the intra prediction mode used by the current block.
[0074] As shown in FIG. 8, an example of intraTMP is shown in which the inverted L-shaped area in the upper left corner of the current block is the template for the current block, and the subarea R1 of the current CTU, the CTU area R2 on the upper left side of the current block, the CTU area R3 above the current block, and the CTU area R4 on the left side of the current block are available reconstruction areas during the search. The template for the reference block is searched within this available reconstruction area, but the actual search range may be smaller than this reconstruction area. However, this is merely an example, and the available reconstruction area may differ in actual applications. In the illustrated example, the search finds the best matching block within R2, i.e., the reference block corresponding to the reference block template that has the smallest difference (highest degree of match) from the template for the searched current block. The reference block within area R2 in the figure is the best matching block, and the shaded area surrounding the left and top of the reference block is the template for the reference block (also referred to as the reference block template corresponding to the reference block).
[0075] As mentioned above, one of the key reasons why IBC significantly improves the compression efficiency of screen content coding is that many overlapping blocks are found in screen content, which typically has sharp boundaries, and color-sliced areas may have the same color (luminance and chrominance). In contrast, camera-captured content rarely experiences this situation. Camera-captured content inevitably contains noise, and even if a certain area of camera-captured content appears to have uniform color at first glance, there may be slight variations in luminance and chrominance, and camera-captured content rarely has sharp boundaries. On the other hand, while it is difficult to find completely identical blocks in camera-captured content due to perspective angles, repeating textures do exist in camera-captured content, and camera-captured content does indeed have approximately overlapping blocks with only noise or slight variations in luminance between blocks.
[0076] In intraTMP, the best matching block found by intra template matching is determined as the final predicted block. That is, when decoding the current block, a flag is decoded to determine whether the current block uses intraTMP. If the current block uses intraTMP, the decoder searches for a best matching block within the reconstruction region using intra template matching, and the reconstructed value of that best matching block is used as the predicted value for the current block. Because the decoder does not have the original value of the current block during the search, it can only determine the block with the highest degree of template matching as the best matching block found by intraTMP. However, although the template has a strong correlation with the current block, it is not the current block, and therefore the best matching block found by template matching may not necessarily be the best matching block for the actual current block. There is room for further improvement in coding efficiency in intraTMP mode.
[0077] Therefore, one embodiment of the present disclosure is Candidate list construction for intra-template matching prediction A method is provided, as shown in FIG. 9, including the following steps:
[0078] Step S110: Intra template matching prediction of the current block (intraTMP) No. 1 Determine the search range.
[0079] Step S120, No. 1 A reference block template is searched for based on the search range, and a difference between the searched reference block template and the template of the current block is calculated. The reference block template has one-to-one correspondence with the reference block.
[0080] Step S130: constructing a candidate list of intraTMP based on the difference, and determining N reference blocks in the candidate list and the order of the N reference blocks, where N≧2.
[0081] In this specification, the reference block template corresponding to one reference block is the template of that reference block. As shown in FIG. 8, one reference block and its template are shown in the R2 region. The template of that reference block is indicated by the shaded region in the figure and is also referred to as the reference block template corresponding to that reference block. The size and shape of this reference block template are the same as those of the template of the current block, and the relative positional relationship between the template of that reference block and the reference block is also the same as the relative positional relationship between the template of the current block and the current block. In the example shown in the figure, the current block template is an L-shaped region surrounding the left and upper sides of the current block, while the template of that reference block is also an L-shaped region surrounding the left and upper sides of the reference block. In the embodiments of the present disclosure, there is no limitation on the number of rows and columns included in the reference block template and the current block template. In addition, the template of one block may extend to the upper right or lower left side of the block.
[0082] In an embodiment of the present disclosure, a candidate list including multiple reference blocks is constructed using disparity-based template matching. All of the multiple reference blocks in the candidate list may be used as reference blocks for intra-prediction of the current block in intraTMP mode. The first option in the candidate list is the best-matching block determined by template matching, but this best-matching block may not necessarily have the highest coding efficiency when used to predict the current block. Using other reference blocks in the candidate list may result in higher overall coding efficiency. By constructing the candidate list, a reference block with the highest coding efficiency may be indicated by a single index. The encoding side also constructs a candidate list in a similar manner, finds the indicated reference block based on the index, and predicts the current block, thereby improving coding efficiency.
[0083] In an exemplary embodiment of the present disclosure, the search range is located within a reconstruction region of the current image, and the difference of the reference block template from the current block template is determined based on the SAD, SATD, or MSE between the reconstructed values of the reference block template and the reconstructed values of the current block template. In this embodiment, the SAD, SATD, or MSE between the reconstructed values of the reference block template and the reconstructed values of the current block template can be used to represent the difference of the reference block template from the current block template, thereby expressing the similarity between the two templates.
[0084] In an exemplary embodiment of the present disclosure, the order of the N reference blocks in the candidate list is determined in ascending order from the one with the smallest difference to the corresponding reference block template. There is a strong correlation between a reference block template and a reference block, and the reference block template with the highest similarity determined by template matching (i.e., calculating the template difference) has a high probability that the corresponding reference block is the reference block with the highest similarity to the current block. Therefore, in an embodiment of the present disclosure, the order of the N reference blocks in the candidate list is determined in ascending order from the one with the smallest difference to the corresponding reference block template, thereby increasing the probability that the leading candidate reference block is selected, shortening the codeword at this time, and reducing the coding overhead.
[0085] In one exemplary embodiment of the present disclosure, the reference blocks in the candidate list are identified by their block vectors BV, which are used to indicate the positions of the reference blocks relative to the current block, and the BV corresponding to the reference block template is the BV of the reference block corresponding to the reference block template.
[0086] In this embodiment, a reference block in a candidate list is identified by its BV; that is, it is the BV that is actually entered into the candidate list. The position of the current block may be represented by a specified base point, which may be a pixel point in the current block. In this embodiment, the base point is the upper left corner (pixel point) of the current block, but the present disclosure is not limited thereto and may be the upper right corner, center point, or a point adjacent to the center point of the current block. In another example, a point on the current block template may be used as the base point. If the relative position between the base point and the current block is fixed, it can be used to position the current block. In this embodiment, if the coordinates of the base point are (50,50) and the coordinates of the upper left corner point of a searched reference block are (120,120), the BV used to search for the reference block can be expressed as (70,70). That is, the displacement amount relative to the base point can be represented graphically by a vector pointing from the base point to the upper left corner point of the reference block (see FIG. 8). The point obtained by adding the position offset represented by BV to the coordinates of the base point is called the position indicated by the BV. In Figure 8, it is the point at the upper left corner of the reference block. For convenience of explanation, in this specification, the BV of the reference block corresponding to one reference block template is called the BV corresponding to the reference block template, and the two have a one-to-one correspondence.
[0087] In one exemplary embodiment of the present disclosure, the steps of searching for a reference block template based on the first search range, calculating the difference between the searched reference block template and the current block template, and constructing the candidate list of intraTMP based on the difference include the steps of determining a set of BVs based on a first search step size and the first search range, where the positions indicated by the set of BVs are within the first search range; searching for corresponding reference block templates based on the set of BVs; calculating the difference between the searched reference block template and the current block template; and entering BVs corresponding to the N reference block templates with the smallest difference into the candidate list.
[0088] In this embodiment, a reference block template is searched for based on a BV. As described above, a BV indicates the position of a reference block. For example, when the upper left corner of the current block is used as the base point, the BV may indicate the upper left corner of the reference block. Because the size and shape of the reference block are the same as those of the current block, the area in which the reference block is located or the reconstructed pixel points included in the reference block can be determined based on the position indicated by a BV. Because the relative positions of the reference block template and the reference block are fixed, a BV can also determine the area in which a reference block template is located. Meanwhile, a reference block template can be searched for based on a set of BVs. Because a BV uniquely determines a reference block, the BV of the reference block is entered as the reference block identifier in the candidate list.
[0089] In this embodiment, when constructing a candidate list, the N reference blocks in the candidate list and the order of the N reference blocks are determined based on the differences between the searched reference block templates and the template of the current block. For example, the first N searched reference block templates are entered into the candidate list, and the difference between the currently searched reference block template from the (N+1)th searched reference block template is compared with the differences between the N reference block templates in the candidate list. For example, if the difference between the currently searched reference block template is smaller than the largest difference among the N reference block templates in the candidate list, the candidate list is updated, the BV corresponding to the largest difference is deleted, and the BV corresponding to the currently searched reference block template is added to the candidate list. After the last searched reference block template is processed, the construction of the candidate list is completed. During construction, the N BVs in the candidate list are sorted in ascending order of the magnitude of the corresponding difference to facilitate comparison. For another example, after all reference block templates are searched, the N reference block templates with the smallest differences are entered into the candidate list based on the differences between the reference block templates, and the construction of the candidate list is completed.
[0090] In this specification, the difference of the reference block template refers to the difference of the reference block template from the current block template, and for convenience of notation, is referred to as the difference of the reference block template.
[0091] In an exemplary embodiment of the present disclosure, the steps of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a current block template, and constructing the candidate list of intraTMP based on the difference include: determining a set of BVs based on a first search step size and the first search range, performing a search based on the set of BVs, calculating differences between the searched reference block templates and the current block template, and entering BVs corresponding to the N reference block templates with the smallest differences into the candidate list; determining M second search ranges based on BVs corresponding to the M reference block templates with the smallest differences found in a first search; determining M sets of BVs based on a second search step size and the M second search ranges; searching for corresponding reference block templates within the M second search ranges based on the M sets of BVs; calculating differences between the searched reference block templates and the current block template; and updating the candidate list based on the differences, wherein the second search step size is smaller than the first search step size, the second search ranges are smaller than the first search ranges, the second search ranges do not overlap with each other, and M≧N.
[0092] In one example of this embodiment, the BV is expressed as a position offset amount relative to a base point, and the base point is a point (a pixel point or a sub-pixel point) in the current block. The M second search ranges respectively cover positions indicated by the BVs corresponding to the M reference block templates, and the positions indicated by the BVs are determined based on the base point and the position offset amount.
[0093] This embodiment is a hierarchical search method divided into two stages, with the search step size of the next stage being smaller than that of the previous stage. The next stage includes multiple search ranges, each of which is a part of the search range of the previous stage. First, a first-stage search is performed within the first search range with a large search step size, and N BVs are entered into a candidate list based on the magnitude of the difference between the searched reference block templates. In the second-stage search, M second search ranges are determined based on the M BVs recorded after the first-stage search. Searches are performed within the second search range with a small step size, and the candidate list is updated based on the difference between the searched reference block templates. The hierarchical search is a coarse-to-fine search method, which can relatively quickly and accurately search for a reference block template with a high degree of matching within the reconstruction region and complete the construction of the candidate list.
[0094] In one example of this embodiment, after updating the candidate list based on the difference, the method further includes the following steps: determining M' third search ranges based on BVs corresponding to the M' reference block templates with the smallest differences found in the second search, and determining M' sets of BVs based on a third search step size and the M' third search ranges; M’ and searching for corresponding reference block templates within third search ranges based on the M' sets of BVs, calculating differences between the searched reference block templates and a template of the current block, and updating the candidate list based on the differences, wherein the third search step size is smaller than the second search step size, the third search ranges are smaller than the second search ranges and do not overlap, and M'≧N. Here, the set of BVs determined for each third search range are BVs of the whole pixel, or the set of BVs determined for each third search range are BVs of the sub-pixel, and the reconstructed values of the reference block template corresponding to the BVs of the sub-pixel are obtained by interpolation.
[0095] This embodiment is a three-stage search method, and by performing a more precise third-stage search based on the second search, it is possible to search for reference block templates at more positions, thereby increasing the possibility of finding a reference block template with a higher actual matching degree. The reference block corresponding to the reference block template is more likely to be closer to the current block. Therefore, the method of this embodiment can improve coding efficiency.
[0096] In an exemplary embodiment of the present disclosure, the step of updating the candidate list based on the difference includes: The minimum difference d1 among the differences of the reference block templates searched within the same local search range is determined, and d1 <D N If so, update the candidate list and N and adding a BV corresponding to d1 to the candidate list, D N is the maximum difference among the differences corresponding to the N BVs in the candidate list before updating, the difference corresponding to the BV refers to the difference of the reference block template corresponding to the BV, and the local search range includes a step of being the second search range or the third search range.
[0097] As described above, one local search range is determined based on a BV corresponding to one reference block template previously searched, and the BV for determining the local search range is also a BV in the local search range, and the reference block template previously searched based on the BV also belongs to the reference block templates searched within the local search range. In this specification, the reference block templates searched within the same local search range include not only the reference block templates searched after determining the local search range, but also the reference block templates corresponding to the BV for determining the local search range. TemplatesTaking the second search range as an example, the reference block templates searched within the same second search range include the reference block templates searched within the second search range during the second-stage search, and further include a reference block template (searched during the first-stage search) corresponding to the BV for determining the second search range. Similarly, for the third search range, the reference block templates searched within the same third search range include the reference block templates searched within the third search range during the third-stage search, and further include a reference block template (searched during the first or second stage search) corresponding to the BV for determining the third search range.
[0098] In this embodiment, the candidate list update process may be applied after the second-stage search or the third-stage search. In this embodiment, during the update, a maximum of one BV corresponding to a reference block template searched by the same set of BVs, i.e., a BV of a reference block template searched within one local search range, is added to the candidate list. This local search range may be a second search range, a third search range, etc. In the second-stage search, this process is performed for each of the determined M sets of BVs, and in the third-stage search, this process is performed for each of the determined M' sets of BVs. In addition, in each embodiment, when adding a new BV to the candidate list, the N BVs in the updated candidate list may be sorted in ascending order from the smallest corresponding difference.
[0099] In this embodiment, the maximum number of BVs corresponding to reference block templates searched within one local search range that can be added to a candidate list is limited to one. This is because the differences between nearby reference block templates are usually relatively similar, making it easy to add BVs of multiple nearby reference block templates to the candidate list. This can lead to excessive concentration of reference blocks in a certain position in the candidate list. If one reference block at that position is not highly similar to the current block, the candidate list will contain multiple reference blocks with low similarity to the current block, reducing the adaptability of the candidate list. By limiting the number, the positions of reference blocks added to the candidate list are not excessively concentrated, and differences in the texture features of these reference blocks can occur, avoiding a situation in which the positions of reference blocks become excessively concentrated to a certain extent, making it impossible to find a block in the candidate list that closely matches the current block.
[0100] In an exemplary embodiment of the present disclosure, updating the candidate list based on the difference includes: determining the smallest K differences among the differences of the reference block templates searched within the same local search range, and at least one of the K differences is D N updating the candidate list if the difference is smaller than the K, and the N BVs in the candidate list after updating are the N BVs with the smallest differences between the K BVs corresponding to the differences and the N BVs in the candidate list before updating, where K is a set threshold and K≧2; D N is the maximum difference among the differences corresponding to the N BVs in the candidate list before updating, the difference corresponding to the BV refers to the difference of the reference block template corresponding to the BV, and the local search range is the second search range or the third search range.
[0101] This embodiment differs from the previous embodiment in that the maximum number of BVs corresponding to reference block templates searched within one local search range that are added to a candidate list is limited to K (K is an integer equal to or greater than 2). This threshold value may be set to a certain value, i.e., a default value, or may be set at the encoding side and transmitted from the encoding side to the decoding side.
[0102] In an exemplary embodiment of the present disclosure, updating the candidate list based on the difference includes: For each searched reference block template, the difference of the reference block template is D N If the candidate list is smaller than D, update the candidate list. N and adding a BV corresponding to the reference block template to the candidate list; D N is the maximum difference among the differences corresponding to the N BVs in the candidate list before updating, and the difference corresponding to a BV refers to the difference of the reference block template corresponding to the BV.
[0103] In this embodiment, the number of BVs corresponding to the reference block templates found within one local search range that are added to the candidate list is not limited, and the BVs of each reference block template found within the local search range can be added to the candidate list if the corresponding difference is sufficiently small. In this embodiment, multiple BVs added to the candidate list may be concentrated in one local area, which may cause problems in adaptability. However, if the reference block at that position has a high degree of matching with the current block, it is possible to find a reference block that is closest to the highest degree of matching. The candidate list update process in this embodiment includes a case where it is determined not to update the candidate list based on the difference comparison, and a case where it is determined to update the candidate list based on the difference comparison.
[0104] In this embodiment, the difference comparison and update process may be performed each time the difference between the reference block templates is calculated, or the difference comparison and update process may be performed sequentially after the difference between the reference block templates searched within one local search range is calculated, or the difference comparison and update process may be performed sequentially after the difference between the reference block templates searched within all local search ranges is calculated. The first processing method requires fewer cache resources.
[0105] In one exemplary embodiment of the present disclosure, the size of the first search range is determined based on the size of the current block.
[0106] In this example, the first search distance in the width direction and the second search distance in the height direction of the first search range relative to the base point representing the position of the current block are: calculating the product of the width of the current block and a first scale factor, and determining the larger value of either this product or the set minimum search distance in the width direction as the first search distance; calculating the product of the height of the current block and a second scale factor, and determining the larger value of either this product or the set minimum search distance in the height direction as the second search distance, wherein the first scale factor and the second scale factor are equal or unequal; or determining the larger value of the width of the current block and the set minimum search distance in the width direction, and setting the product of the larger value and a first scale factor as the first search distance; determining the larger value of the height of the current block and the set minimum search distance in the height direction, and setting the product of the larger value and a second scale factor as the second search distance, wherein the first scale factor and the second scale factor are equal or unequal; or The first search distance is obtained by multiplying by a first scale factor corresponding to the width of the current block, where there are multiple first scale factors, and the larger the first scale factor, the larger the width of the corresponding current block; and the second search distance is obtained by multiplying by a second scale factor corresponding to the height of the current block, where there are multiple second scale factors, and the larger the second scale factor, the larger the height of the corresponding current block.
[0107] In this embodiment, the size of the search range is represented by the search distance in the width direction and the search distance in the height direction. As shown in Figure 10, searchRangeWidth in the figure represents the first search distance in the width direction of the first search range relative to the base point (the upper left corner of the current block), and searchRangeHeight represents the second search distance in the height direction of the first search range relative to the base point. Of course, the size of the search range in this embodiment may be represented in other ways, such as by defining the search distance in the width direction as twice the searchRangeWidth in the figure and the search distance in the height direction as twice the searchRangeHeight.
[0108] In this embodiment, different search ranges are adopted according to different current blocks. Because the reference block and the current block have the same size, this method ensures that the number of searched reference blocks does not vary significantly depending on the size of the current block, and ensures that there are a sufficient number of reference blocks available for matching, thereby ensuring the coding effect of the intraTMP mode.
[0109] In one exemplary embodiment of the present disclosure, the step of determining the first search range in which the current block performs intraTMP includes a step of determining the area covered by the first search range based on a base point representing the position of the current block, a search distance from the base point, and a reconstruction area available at the time of search. In this embodiment, when determining the area actually covered by the first search range, referring to Figures 8 and 10, it is necessary to consider the base point and the search distance (including two directions) from the base point, as well as the reconstruction area available at the time of search. Rebuild The region is related to the set search direction. In the example shown in FIG. 10, the search can be performed only on the left, top, upper left, lower left, and upper right sides of the current block (i.e., the reference block template at the corresponding position is searched based on the BV). In other examples, the search direction can be limited to the left, top, and upper left sides, but the present disclosure is not limited thereto. The reconstruction region available during the search can also be set directly. In the example of FIG. 8, the reconstruction regions within the CTU in which the current block is located and the CTUs above, left, and upper left of the current block are permitted to be used during the search. In addition, other restrictions are possible, such as disallowing the use of the regions above and to the left of the current block within the CTU in which the current block is located.
[0110] After determining a set of BVs based on the search range and the search step size, if the reference block sample searched based on the BVs is not within the available reconstruction area, the reference block template may be discarded; or, when determining the BVs, it is determined whether the reference block template searched based on a BV is within the available reconstruction area, and if not, the BV is discarded, so that the searched reference block template is within the available reconstruction area.
[0111] An embodiment of the present disclosure further provides a video decoding method, and as shown in FIG. 11, the video decoding method includes the following steps:
[0112] In step S210, the intra template matching prediction intraTMP mode use flag of the current block is decoded.
[0113] In step S220, if it is determined that the current block uses intraTMP mode based on the intraTMP mode usage flag, continue decoding the intraTMP index of the current block, which is used to indicate the position in the intraTMP candidate list of the reference block used by the current block.
[0114] In step S230, a candidate list is constructed, a reference block used by the current block is determined based on the intraTMP index and the candidate list, and intra prediction is performed on the current block based on the reference block used by the current block.
[0115] The intraTMP mode in this embodiment is a multi-candidate intraTMP mode. During decoding, a candidate list is constructed, and a reference block used by the current block is determined based on the intraTMP index and the candidate list. Intra prediction is performed on the current block based on the reference block used by the current block. Since the candidate list contains multiple reference blocks, the current block may find a reference block with a higher matching degree during prediction, thereby improving coding efficiency.
[0116] In one exemplary embodiment of the present disclosure, the candidate list is constructed by an intraTMP candidate list construction method according to any embodiment of the present disclosure. Note that when constructing a candidate list by an intraTMP candidate list construction method according to any embodiment of the present disclosure, it is not necessary to construct a candidate list of length N; a candidate list of length less than N may be constructed to simplify processing. For example, if it is determined based on the intraTMP index that the reference block used by the current block is at the third position in the candidate list, and N=5, the decoding side can construct a candidate list of length 3. The construction method is the same, only the length is different.
[0117] In one exemplary embodiment of the present disclosure, after decoding the intraTMP index of the current block, the method comprises: If the intraTMP index indicates that the current block is at the first position in the candidate list, performing intra prediction on the current block according to a single-candidate intraTMP mode without constructing the candidate list; If the intraTMP index indicates that the current block is located at a position other than the first position in the candidate list, constructing the candidate list and determining a reference block to be used by the current block based on the intraTMP index and the candidate list.
[0118] In this embodiment, if the intraTMP index indicates the first position in the candidate list, the reference block used by the current block can be found in single-candidate intraTMP mode, so there is no need to build a candidate list, thereby reducing the decoding complexity.
[0119] In one exemplary embodiment of the present disclosure, the method further includes a step of decoding an intraTMP multi-candidate flag and determining whether use of a multi-candidate intraTMP mode is allowed based on the intraTMP multi-candidate flag, wherein the intraTMP multi-candidate flag is a sequence-level, image-level, or slice-level flag.
[0120] After determining that the current block uses the intraTMP mode based on the intraTMP mode use flag, the method includes: if determining that use of multi-candidate intraTMP mode is allowed based on the intraTMP multi-candidate flag, continuing to decode the intraTMP index of the current block; If it is determined based on the intraTMP multi-candidate flag that the use of multi-candidate intraTMP mode is not allowed, the method further includes skipping decoding of the intraTMP index of the current block and performing intra prediction on the current block according to the single-candidate intraTMP mode.
[0121] In this embodiment, the intraTMP multi-candidate flag of the upper layer is used to indicate whether the use of the multi-candidate intraTMP mode is permitted. Thus, if the intraTMP multi-candidate flag indicates that the use of the multi-candidate intraTMP mode is not permitted, when the intraTMP mode use flag is decoded to determine that the current block uses the intraTMP mode, intra prediction for the current block can be performed according to the single-candidate intraTMP mode without needing to decode the intraTMP index, thereby simplifying the processing flow of the decoder.
[0122] In one exemplary embodiment of the present disclosure, the step of decoding the intraTMP index of the current block includes: performing de-binarization of the intraTMP index by an analysis method corresponding to variable length coding, fixed length coding, truncated unary code, or truncated binary code; or The method includes a step of analyzing the value of the first binary code in the intraTMP index, and if the value indicates that the intraTMP index employs variable-length coding or truncated unary code, de-binarizing the intraTMP index using an analysis method corresponding to variable-length coding or truncated unary code; and if the value indicates that the intraTMP index is coded using fixed-length coding or truncated binary code, de-binarizing the intraTMP index using an analysis method corresponding to fixed-length coding or truncated binary code.
[0123] In this embodiment, the analysis method for debinarizing the intraTMP index is determined based on the value of the first binary code in the intraTMP index. This allows for simple and convenient decoding of the intraTMP index when the intraTMP index uses multiple encoding methods.
[0124] In one exemplary embodiment of the present disclosure, before constructing the candidate list, the method further includes decoding an intraTMP mode search step size index, the search step size index being used to indicate an index among a plurality of candidate search step sizes for the search step size to use.
[0125] When constructing the candidate list, a reference block template is searched for within the first search range using a search step size determined based on the search step size index.
[0126] In this embodiment, the intraTMP mode search can be performed on the current block using different step sizes, so it has better adaptability to different images.
[0127] The present disclosure further provides a video encoding method, as shown in FIG. 12, which includes the following steps:
[0128] Step S310: if the current block decides to allow the use of multiple candidate intraTMP modes, construct a candidate list of intraTMP according to the method described in any embodiment of the present disclosure.
[0129] In step S320, the coding costs for predicting the current block based on the N reference blocks in the candidate list are calculated, and the smallest coding cost among them is used as the coding cost of the intraTMP mode among the multiple candidates for rate-distortion optimization.
[0130] Step S330: if it is determined that the current block performs intra prediction using the intraTMP mode, encode the syntax elements related to the intraTMP mode of the current block.
[0131] In this embodiment, the minimum coding cost is the rate-distortion cost.
[0132] The coding cost when predicting the current block using the reference blocks in the candidate list may be calculated based on the difference between the reconstructed values of the reference blocks and the original values of the current block, or may be determined based on the rate-distortion cost (including the code rate portion and the distortion portion) when predicting the current block using the reference blocks. Alternatively, these two methods may be combined, in which the reference blocks in the candidate list are first sorted according to the coding costs determined by the first type of method, and then the coding costs of some of the previously sorted reference blocks are calculated according to the second type of method, and then these some reference blocks are sorted again.
[0133] After determining the coding cost of the multi-candidate intraTMP mode, the coding cost of the multi-candidate intraTMP mode is compared with the coding cost (e.g., rate-distortion cost) when the current block uses another intra prediction mode, and if the coding cost of the multi-candidate intraTMP mode is the smallest, it can be determined that the current block will use the multi-candidate intraTMP mode.
[0134] The intraTMP mode in this embodiment is a multi-candidate intraTMP mode. A candidate list is constructed during encoding, and when the intraTMP mode is selected for rate-distortion optimization, a syntax element related to the intraTMP mode of the current block is coded to indicate the reference blocks used by the current block under the multi-candidate intraTMP mode. Because the candidate list includes multiple reference blocks, the current block may find a reference block with a higher matching degree during prediction, thereby improving coding efficiency.
[0135] In one exemplary embodiment of the present disclosure, the step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses intraTMP mode; and c) encoding an intraTMP index of the current block to indicate the position in said candidate list of the reference block or combination of reference blocks that the current block uses.
[0136] In this embodiment, by encoding the intraTMP mode usage flag and the intraTMP index, the decoding side can determine the reference block used by the current block based on these two syntax elements, and perform intra prediction on the current block based on the reference block used by the current block.
[0137] In one exemplary embodiment of the present disclosure, the step of encoding the intraTMP index of the current block comprises: binarizing the intraTMP index by variable length coding, fixed length coding, truncated unary coding, or truncated binary coding; or The method includes a step of binarizing the intraTMP index by variable length coding or truncated unary code when the value of the intraTMP index is in a first value range, and by fixed length coding or truncated binary code when the value of the intraTMP index is in a second value range, wherein the value of the first value range is smaller than the value of the second value range.
[0138] In this embodiment, when the intraTMP index value is small during encoding, variable length encoding or truncated unary encoding is used to shorten the code length. On the other hand, when the intraTMP index value is large, fixed length encoding or truncated binary encoding is used. This reduces the encoding overhead.
[0139] In one exemplary embodiment of the present disclosure, the step of determining that the current block allows the use of multi-candidate intraTMP mode includes a step of determining that the current block allows the use of multi-candidate intraTMP mode if none of the conditions for disallowing the use of multi-candidate intraTMP mode are met, and the conditions for disallowing the use of multi-candidate intraTMP mode include a sequence-level, image-level, or slice-level intraTMP multi-candidate flag disallowing the use of multi-candidate intraTMP mode.
[0140] In one example of this embodiment, when encoding screen content, the intraTMP multiple candidate flag is set to a value that does not allow the use of multiple candidate intraTMP mode, and when encoding video images collected by a camera, the intraTMP multiple candidate flag is set to a value that allows the use of multiple candidate intraTMP mode.
[0141] In this embodiment, for different usage scenarios, if it is suitable to use the multi-candidate intraTMP mode, encoding the intraTMP multi-candidate flag indicates that the use of the multi-candidate intraTMP mode is allowed, thereby improving the coding effect; if it is not suitable to use the multi-candidate intraTMP mode, encoding the intraTMP multi-candidate flag indicates that the use of the multi-candidate intraTMP mode is not allowed, thereby avoiding unnecessary coding complexity.
[0142] In an exemplary embodiment of the present disclosure, the method further includes the steps of: when performing intra prediction coding on the current block according to a single-candidate intraTMP mode, encoding an intraTMP mode usage flag of the current block to indicate that the current block uses the intraTMP mode; and encoding an intraTMP index of the current block to indicate the first position in the candidate list of the reference block used by the current block. In this embodiment, there is no need to use an additional flag to indicate whether the current block uses the single-candidate intraTMP mode or the multi-candidate intraTMP mode, and the determination can be made by the intraTMP index, thereby simplifying the complexity on the decoding side.
[0143] An embodiment of the present disclosure further provides a method for multi-candidate intra template matching prediction (intraTMP). In this embodiment, N (N≧2) candidates are set in the intraTMP. That is, a candidate list of the intraTMP with length N is set, which is denoted as intraTMPCandList[N].
[0144] The encoding side finds multiple reference block templates within a set search range according to a set search rule, calculates the differences between the multiple reference block templates and the current block template based on the reconstructed pixel values of the multiple reference block templates and the reconstructed pixel values of the current block template, and enters the position identifiers of the reference blocks corresponding to the N reference block templates in ascending order of the smallest difference into an intraTMP candidate list.
[0145] The encoding side calculates the difference between each of the N reference blocks in the candidate list and the current block based on the reconstructed pixel values of the N reference blocks and the original pixel values of the current block, and determines the value of the intraTMP index based on the position in the candidate list of the reference block with the smallest difference. This reference block with the smallest difference is the reference block used by the current block in intraTMP mode, i.e., the best matching block found. If a BV is entered in the candidate list as the position identifier of the reference block, the BV at the position indicated by the intraTMP index in the candidate list is also called the BV used by the current block in intraTMP mode.
[0146] If the encoding side selects intraTMP mode for the current block from among multiple intra prediction modes after rate distortion optimization (i.e., if it decides that the current block will use intraTMP mode), it encodes a flag indicating that the current block will use intraTMP, and then continues encoding the intraTMP index, thereby indicating the position in the candidate list of reference blocks used by the current block.
[0147] Correspondingly, the decryption syntax is: intraTMPFlag if(intraTMPFlag) { intraTMPIndex }
[0148] Here, intraTMPFlag is a flag indicating whether the current block uses the intraTMP mode, and intraTMPIndex is an intraTMP index, which is used to indicate the position in the candidate list of the reference block to be used by the current block.
[0149] During decoding, if intraTMPFlag is true (e.g., 1), continue analyzing intraTMPIndex. The decoding side may use the same method to construct an intraTMP candidate list intraTMPCandList, find the position identifier at the position indicated by intraTMPIndex in intraTMPCandList, find the corresponding reference block based on this position identifier, and use the reconstructed value of the reference block as the predicted value of the current block.
[0150] In this embodiment, when constructing the intraTMPCandList, the difference between the reference block template corresponding to the BV and the current block template is calculated every time a BV is searched within the search range. The reference block template is a block with the same shape and size as the current block searched within the reconstruction area. The difference is calculated by SAD, SATD, MSE etc. When constructing the intraTMPCandList, BVs corresponding to reference block templates searched in ascending order from smallest to largest difference may be entered into the intraTMPCandList. Alternatively, the searched reference block templates may be sorted in ascending order from smallest to largest difference, and the reference blocks corresponding to the top N reference block templates are set as the N reference blocks in the intraTMPCandList. Also, the amount of calculation can be reduced by keeping only the first N candidates with the smallest difference and directly discarding the ordered reference block templates exceeding N.
[0151] Usually, blocks corresponding to adjacent BVs are relatively close to each other, especially when the BVs support sub-pixel accuracy such as 1 / 2, 1 / 4, 1 / 8, or 1 / 16 accuracy. The reference block template corresponding to the sub-pixel BV needs to be obtained by interpolation. When interpolating the intra template (intraTmp), the same filter as the inter-interpolation filter can be used, thereby reducing the storage of additional filters through multiplexing. Alternatively, a simpler interpolation method may be used. For example, while a 12-tap filter is used in inter-interpolation, in this embodiment, an 8-tap, 4-tap, or 2-tap filter can be used to reduce the amount of calculation.
[0152] If the BV supports sub-pixel accuracy, sorting based on the difference between the reference block templates alone may result in multiple candidates concentrating in a very narrow range unless control is performed. In this embodiment, control is performed using the following method to avoid excessive concentration of the BVs of candidates in the intraTMPCandList.
[0153] The first method is as follows.
[0154] In the search process, instead of sequentially searching based on each possible BV, if a normal search order, for example, from left to right and top to bottom, is adopted, the BVs of all pixels may be sequentially searched. As shown in FIGS. 13A and 13B, if the currently searched BV is (x0, y0), the next BV is (x0+1, y0), assuming that the boundary of the search range has not been reached. In the first type of method, a sparse search is first performed. For example, in the case of all pixel BVs, if the currently searched BV is (x0, y0), the next BV is (x0+4, y0), assuming that the boundary of the search range has not been reached. Template matching is performed every certain number of pixels (i.e., a reference block template is searched and the difference between the searched reference block template and the template of the current block is calculated), and template matching is performed according to a set search step size. The search step size is a preset value, such as 2, 3, 4, or 8. Similar processing can be performed in the vertical direction.
[0155] First, the N BVs with the smallest difference are found. Then, based on the N BVs with the smallest corresponding difference (the difference is also called cost or distortion cost), a search is performed again within a small local search range based on each BV to improve the results. For example, the search interval in the x and y directions in the first search stage is set to 4 pixels, and the local search range here is set to 4x4. If the difference between the reference block templates searched within the local search range is small, the BV in the candidate list is replaced with the corresponding BV, and the N candidates in the candidate list are rearranged. This allows the BVs corresponding to the N reference blocks in the candidate list to maintain a certain distance.
[0156] As shown in FIG. 13A, a first-stage search is performed with a preset step size, and the upper left corner of the searched reference block is designated as the point marked with an "X" in the figure. After the search, three sorted BVs are found, and the upper left corners of the reference block corresponding to these three BVs (i.e., the positions indicated by the BVs) are designated as the points marked with an "X" in FIG. 13B. In this example, the horizontal search step size is 4, and the vertical search step size is also 4. In the second-stage search, a local search range is determined based on the three sorted BVs. In this example, the local search range is a 4×4 rectangular area covering the positions indicated by the three sorted BVs in FIG. 13B (small boxes marked with an "X"). If the difference between the reference block templates searched within each 4×4 local search range is smaller than the difference between the corresponding sorted BVs, the BV corresponding to the newly searched reference block template replaces the sorted BV in the candidate list and is used to sort the intraTMPCandList. Otherwise, the candidate list is not updated.
[0157] In this embodiment, the horizontal and vertical sizes of the local search ranges are set to be the same as the search step size of the first step, thereby making it possible to avoid overlapping of the local search ranges.
[0158] To support subpixel accuracy, a third-stage search may be performed after the second-stage search. The BVs used in the third-stage search are subpixel BVs. For example, based on the position indicated by the full-pixel BVs selected in the second-stage search, a half-pixel search is performed within a range of one pixel above, below, left, and right. Then, based on the full-pixel BVs selected in the second stage, a half-pixel search is performed within a range of one pixel above, below, left, and right. Four BVs are then set by shifting the x coordinates of the full-pixel BVs by ±½ pixel and the y coordinates of the full-pixel BVs by ±½ pixel. In another example, the x and y coordinates are simultaneously shifted by ±½ pixel to set four more BVs. Thus, a total of four or eight BVs can be searched within the local search range. In other embodiments, subpixel BVs may be used in the second-stage search, or subpixel BVs may be used only in the fourth-stage search.
[0159] When determining one local search range based on one BV, the position indicated by the BV may be the center point or a point close to the center of the local search range, but is not limited to this. As shown in Fig. 13B, the position indicated by the BV used in the first-stage search may be located at a point close to the center of a 4x4 local search range, and the coordinates in this local search range may be written as (2,2). Alternatively, the local search range may be determined by setting the position indicated by the BV used in the first-stage search to the lower right corner of the local search range.
[0160] Constructing the candidate list is a process that must be performed on both the encoding and decoding sides, ensuring that the candidate list obtained on the encoding side matches the candidate list obtained on the decoding side.
[0161] In this embodiment, the number required for intraTMPCandList is N, and N BVs (recorded in the candidate list) are recorded after the first stage of search. In the second stage of search, N local search ranges are determined based on these N BVs to continue the search. In another embodiment, more BVs (except for the N BVs recorded in the BV candidate list, other BVs may be saved) can be recorded after the first stage of search, such as M BVs, M>N, for example, M=2N. This provides more opportunities for improvement search and reduces the areas suitable for the second stage of search that are missed in the sparse search in the first stage.
[0162] In this embodiment, a threshold value for the maximum number of BVs that can be reserved for each local search range, i.e., the number of BVs that can be entered into the intraTMPCandList from each local search range, may be set. This threshold value may be determined based on the length N of the candidate list and the size of the local search range. For example, when N is small, more BVs are reserved in each local search range to avoid excessive concentration of candidate reference blocks. When N is large, i.e., when the number of candidate reference blocks is large, more BVs are reserved in each local search range, thereby maintaining a certain level of resolution while ensuring coverage.
[0163] As a method for determining the number of BVs to be reserved in each local search range, any of the following methods may be adopted.
[0164] Method one Each local search range can hold a maximum of one BV number in the intraTMPCandList.
[0165] Method 2 Each improvement area can reserve any number of BVs in the intraTMPCandList, i.e., each improvement search area does not limit the number of BVs that can be reserved most frequently. If the number of candidates is sufficiently large, this setting can improve the precision.
[0166] Method three A threshold K is set so that the number of BVs retained in each local search range in the intraTMPCandList is equal to or less than K. In each local search range, we first sort to determine the K BVs with the smallest difference, and then try to add these K BVs to the intraTMPCandList.
[0167] The encoder and decoder must perform the same search, so that the lists they build are consistent. Generally, the larger the search range, the more BVs can be searched, increasing the possibilities, but also increasing the complexity. Therefore, by setting a reasonable search range, we can balance performance and complexity.
[0168] IntraTMP itself is a type of intrablock copying technology that copies blocks of the same size as the current block. This means that the larger the current block, the larger the copy area; the smaller the current block, the smaller the copy area. One way to do this is to associate the search range with the block size. For example, the horizontal search range is set as searchRangeWidth = ratio × width, and the vertical search range is set as searchRangeHeight = ratio × height (where ratio is a multiple of 4, 5, 6, etc., and width is the width of the current block, and height is the height of the current block). However, the search range must not exceed the available reconstruction area. Considering that current decoders support a minimum of 4x4 small blocks, for example, if the ratio is set to 5 without considering the maximum available area, searchRangeWidth and searchRangeHeight would be 20. Because this range is very narrow, the intraTMP search should ideally find a texture that overlaps with the current block. Therefore, a threshold can be set to ensure that the minimum search range is not too small. Specifically, the size of the search range may be set by any of the following methods, and the size of the search range is expressed as a search distance relative to a base point that represents the position of the current block.
[0169] Method one searchRangeWidth=max(ratio*width,thrLowerBoundary) searchRangeHeight=max(ratio*height,thrLowerBoundary) Here, thrLowerBoundary is the lowest search range, such as 64, 128, etc.
[0170] Method 2 The following method may also be used. searchRangeWidth=ratio*max(width,thrLowerBoundary) searchRangeHeight=ratio*max(height,thrLowerBoundary) However, thrLowerBoundary is 16, 32, etc. where width and height are the width and height of the current block, ratio is the set scale factor in the width and height directions, searchRangeWidth and searchRangeHeight are the search distance in the width and height directions, and thrLowerBoundary is the minimum search distance in the width and height directions.
[0171] Method three In this method, we set a larger ratio for small blocks, for example, if the width or height is less than 16, the corresponding ratio is 10, otherwise the ratio is 5.
[0172] Since the setting of the search range does not depend on multiple candidates, the search range may also be set in the same manner as above for a single candidate intraTMP.
[0173] In one embodiment, the search step size of the first step may be controlled using a control statement in a higher layer. For example, the search step size of the first step is controlled by the sps_intraTmp_search_step_idx control of one sps (sequence parameter set). For example, if sps_intraTmp_search_step_idx is 0, the search step size is set to 3, and if sps_intraTmp_search_step_idx is 1, the search step size is set to 4. A larger search step size may be set for a video with a larger resolution, and a smaller search step size may be set for a video with a smaller resolution.
[0174] In this embodiment, the intraTMPCandList is sorted, and according to statistical rules, the earlier a candidate is sorted, the more likely it is to be selected. The binarization and de-binarization of the intraTMPIndex may use variable length coding or truncated unary (TU) coding as follows: JPEG2026501769000038.jpg42121
[0175] If the probability of selecting each candidate reference block is approximately the same, binarization of intraTMPCandList can be achieved using fixed-length truncated binary coding. In the above table, BiNindex indicates the index of the binary code, where BiNindex 0 represents the first binary code, BiNindex 1 represents the second binary code, and so on.
[0176] In a scenario where N is relatively large, the probability of the earlier candidate items is high, the probability of the later candidate items is low, and the probabilities of the later candidate items are gradually getting closer, the encoding code may be short when the intraTMPIndex value is small, and long when the intraTMPIndex value is large, and the same code length may be used for some nearby candidates in the candidate list. For example, as shown in the following example: JPEG2026501769000039.jpg52156
[0177] In this example, N=15, and the same length codes are used for indexes 3 to 6, and the same length codes are used for indexes 7 to 14. The x in the table above can be obtained by truncated binary encoding.
[0178] In this embodiment, the use of the multi-candidate technique may be controlled using a control syntax of a higher layer. If the multi-candidate technique is not used, the conventional technique, i.e., the single-candidate method, may be used. In one example, a flag of one SPS (sequence parameter set) such as sps_intra_tmp_multi_cand_enabled_flag is used. If the value of sps_intra_tmp_multi_cand_enabled_flag is 1, the intraTMP multi-candidate method is used in the current sequence; otherwise, the intraTMP single-candidate method is used.
[0179] The corresponding syntax is: intra_tmp_flag If(sps_intra_tmp_multi_cand_enabled_flag && intra_tmp_flag) { intra_tmp_index }
[0180] One usage scenario of the above mentioned upper layer control syntax is to set sps_intra_tmp_multi_cand_enabled_flag to 1 for camera collected sequences and to 0 for screen content sequences. Of course, picture level or slice level control may also be achieved using flags such as PPS (picture parameter set), picture header, slice header etc.
[0181] According to an embodiment of the present disclosure, by setting more candidates in intraTMP, it is possible to reduce the situation where the best matching block found by template matching is not ideal, thereby improving compression performance.
[0182] When encoding content collected by a camera, repeated textures are rarely identical due to factors such as lighting, noise, and geometric deformation, making it difficult for intraTMP to find a perfectly matching block. Ideally, intraTMP can find repeated textures. Repeated textures also appear in content collected by a camera, such as floor patterns, fabric patterns, and wall lattices. For some complex textures, intraTMP can copy them to obtain the complex texture and improve compression efficiency. However, if an ideal matching block cannot be found, intraTMP cannot achieve its full potential. Providing a better matching block can improve intraTMP's encoding performance and further increase compression efficiency.
[0183] An embodiment of the present disclosure provides a candidate list construction method for intra template matching prediction. As shown in Figure 15, the method includes the following steps:
[0184] In step S410, a first search range for intra template matching prediction intraTMP of the current block is determined.
[0185] In step S420, a reference block template is searched for based on the first search range, and a difference between the searched reference block template and a combination of the reference block template and a current block template is calculated, where the reference block template corresponds one-to-one with the reference block, and the combination of the reference block template corresponds one-to-one with the combination of the reference block.
[0186] Step S430: constructing a candidate list of intraTMP based on the difference, and determining a number of candidate items in the candidate list and an order of the number of candidate items.
[0187] In addition to the above-mentioned embodiment, this embodiment adds a combination of reference block templates as a candidate list option, thereby providing more options when performing intra prediction in intraTMP mode and effectively improving compression efficiency. For the same processes and terms in this embodiment as in the above-mentioned embodiment, please refer to the description of the above-mentioned embodiment. If this embodiment adopts the same or similar means as the above-mentioned embodiment, the same technical effect can be achieved.
[0188] In an exemplary embodiment of the present disclosure, the searched reference block templates are all located in the reconstruction region of the current image.
[0189] The difference of the reference block template to the current block template is determined based on the SAD, SATD, or MSE between the reconstructed values of the reference block template and the reconstructed values of the current block template.
[0190] The difference of the combination of reference block templates with respect to the current block template is determined based on the SAD, SATD, or MSE between the reconstructed value after fusion of the combined multiple reference block templates and the reconstructed value of the current block template, where the reconstructed value after fusion of the multiple reference block templates is equal to the average or weighted average of the reconstructed values of the multiple reference block templates.
[0191] In one embodiment of the present disclosure, the candidate list includes a first candidate list of length N1, and the N1 candidate items in the first candidate list include reference blocks and / or combinations of reference blocks.
[0192] The order of the N1 candidate items is determined in ascending order of the difference between the corresponding reference block template and / or the corresponding combination of reference block templates and the current block, where the reference blocks correspond to the reference block templates and the combinations of reference blocks correspond to the combinations of reference block templates.
[0193] In an exemplary embodiment of the present disclosure, the reference block is identified by a block vector BV of the reference block, where the BV of the reference block is used to indicate the position of the reference block relative to the current block, and the BV corresponding to the reference block template is the BV of the reference block corresponding to the reference block template.
[0194] In one example of this embodiment, the steps of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, and constructing the candidate list based on the difference include: determining a set of BVs based on a first search step size and the first search range, the set of BVs indicating positions within the first search range; searching for a corresponding reference block template based on the set of BVs, and calculating a first difference between the searched reference block template and the current block template; calculating a second difference between the P reference block templates with the smallest difference and the current block template, where P≧1; sorting the first differences and the second differences and entering identifiers corresponding to the reference block templates and / or combinations of reference block templates corresponding to the smallest N differences into a first candidate list; The identifier corresponding to the reference block template is a BV corresponding to the reference block template, and the identifier corresponding to the combination of reference block templates is an identifier of a combination of reference blocks corresponding to the combination of reference block templates.
[0195] In one example of this embodiment, the steps of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, and constructing the candidate list based on the difference include: determining a set of BVs based on a first search step size and the first search range, the set of BVs indicating positions within the first search range; searching for a corresponding reference block template based on the set of BVs, and calculating a first difference between the searched reference block template and the current block template; filling a first candidate list with BVs corresponding to the N1 reference block templates with the smallest first differences, wherein the first candidate list includes the N1 reference blocks; The identifier corresponding to the reference block template is the BV corresponding to the reference block template.
[0196] In this embodiment, a reference block template is searched for based on the first search range, a difference between the searched reference block template and a combination of the reference block template and a current block template is calculated, and a previous block template is calculated based on the difference. Record The step of constructing the complement list comprises: calculating a second difference between the current block template and a combination of the reference block templates obtained by combining the P reference block templates having the smallest first difference with other reference block templates; and filling a second candidate list with identifiers corresponding to the combinations of N2 reference block templates with the second smallest difference, wherein the second candidate list includes the N2 reference block combinations; The identifier corresponding to the combination of reference block templates is an identifier of a combination of reference blocks corresponding to the combination of reference block templates, where P≧N2, N2≧1, or N2≧2.
[0197] In one example of this embodiment, the combination of reference blocks includes one first reference block and L-1 second reference blocks, and the L-1 second reference blocks are the L-1 reference blocks closest to the BV of the first reference block. The distance between the two BVs is determined based on the distance between the positions indicated by the two BVs, where L is the number of reference blocks in the combination of reference blocks, and L≧2; or The combination of reference blocks includes one first reference block and L-1 second reference blocks, where the L-1 second reference blocks are reference blocks obtained by performing prediction on the current block based on the set intra prediction mode, and L≧2. The reference block corresponding to the P reference block templates is the first reference block.
[0198] In this embodiment, the combination of reference block templates obtained by combining P reference block templates with the smallest first difference with other reference block templates is a combination of different reference block templates, and it can be guaranteed that the combinations of reference block templates obtained by performing the overlap removal process are different from each other.
[0199] In this embodiment, the combination of reference blocks is identified by the BVs of the reference blocks in the combination, or the combination of reference blocks is identified by the BV of the first reference block in the combination plus a fusion flag.
[0200] In one embodiment of the present disclosure, the searched reference block template includes a first reference block template and / or a second reference block template; the first reference block template is a template having the same shape and size as the current block template in a reconstruction area, the reconstruction area being a reconstruction area of an image in which the current block is located; the second reference block template is a template obtained by performing an affine transformation on a local region within the reconstruction region and has the same shape and size as the current block template, and the reference block corresponding to the second reference block template is a reference block obtained by performing an affine transformation on the local region, or the second reference block template is a template in the reconstruction region that has the same shape and size as the current block template after the affine transformation, and the reference block corresponding to the second reference block template is a block within the reconstruction region; The affine transformation includes one or more of a reflection, a rotation, and a scaling.
[0201] In one embodiment of the present disclosure, the size of the first search range is determined based on the size of the current block.
[0202] In this example, the first search distance in the width direction and the second search distance in the height direction of the first search range relative to the base point representing the position of the current block are: A method of calculating the product of the width of the current block and a first scale factor, and setting the larger value of this product and the minimum search distance in the width direction as the first search distance, and calculating the product of the height of the current block and a second scale factor, and setting the larger value of this product and the minimum search distance in the height direction as the second search distance, wherein the first scale factor and the second scale factor are equal or unequal, or A method of determining the larger value of the width of the current block and the set minimum search distance in the width direction, and setting the first search distance to the product of the larger value and a first scale factor, and determining the larger value of the height of the current block and the set minimum search distance in the height direction, and setting the second search distance to the product of the larger value and a second scale factor, wherein the first scale factor and the second scale factor are equal or unequal, or The first search distance is determined by multiplying the first search distance by a first scale factor corresponding to the width of the current block, where there are a plurality of first scale factors, and the larger the first scale factor, the larger the corresponding width of the current block; and the second search distance is determined by multiplying the second search distance by a second scale factor corresponding to the height of the current block, where there are a plurality of second scale factors, and the larger the second scale factor, the larger the corresponding height of the current block.
[0203] The embodiment of the present disclosure further provides a candidate list construction method for intra template matching prediction. As shown in FIG. 16, the method includes the following steps:
[0204] In step S510, a first search range for intra template matching prediction intraTMP of the current block is determined, where the first search range is located within the reconstruction area of the current image.
[0205] In step S520, a set of BVs is determined based on a first search step size and the first search range, the positions indicated by the set of BVs are within the first search range, a corresponding reference block template is searched based on the set of BVs, and a difference between the searched reference block template and the current block template is calculated.
[0206] Step S530: BVs corresponding to the N reference block templates with the smallest difference are entered into the candidate list in ascending order of the corresponding difference, where N is the length of the candidate list, and N≧2.
[0207] Here, the reference block template corresponds one-to-one with the reference block, the difference of the reference block template with respect to the current block template is determined based on the SAD, SATD or MSE between the reconstructed value of the reference block template and the reconstructed value of the current block template, the BV of the reference block is used to indicate the position of the reference block with respect to the current block, and the BV corresponding to the reference block template is the BV of the reference block corresponding to the reference block template.
[0208] As is clear from the above analysis, this embodiment can improve the compression efficiency.
[0209] In one embodiment of the present disclosure, the searched reference block template includes a first reference block template and / or a second reference block template; the first reference block template is a template having the same shape and size as the current block template in a reconstruction area, the reconstruction area being a reconstruction area of an image in which the current block is located; the second reference block template is a template obtained by performing an affine transformation on a local region within the reconstruction region and has the same shape and size as the current block template, and the reference block corresponding to the second reference block template is a reference block obtained by performing an affine transformation on the local region, or the second reference block template is a template in the reconstruction region that has the same shape and size as the current block template after the affine transformation, and the reference block corresponding to the second reference block template is a block within the reconstruction region; The affine transformation includes one or more of a reflection, a rotation, and a scaling.
[0210] Increasing the number of types of reference block templates can provide more possibilities, and when there are multiple blocks in an image that are affine transformed, it is possible to find the block with the highest degree of matching, thereby improving coding efficiency.
[0211] An embodiment of the present disclosure further provides a video decoding method, as shown in Figure 17. The method includes the following steps.
[0212] In step S610, the intra template matching prediction intraTMP mode use flag of the current block is decoded.
[0213] Step S620: if it is determined that the current block uses the intraTMP mode based on the intraTMP mode use flag, continue decoding the syntax elements of the intraTMP mode of the current block.
[0214] Step S630: construct a candidate list for intraTMP, determine a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, and perform intra prediction on the current block based on the reference block or the combination of reference blocks to be used by the current block.
[0215] In this embodiment, when decoding the current block, a multi-candidate intraTMP mode is adopted, and prediction can be performed by combining fusion methods, thereby improving compression efficiency.
[0216] In one embodiment of the present disclosure, the candidate list is constructed by the intraTMP candidate list construction method described in any of the embodiments of the present disclosure.
[0217] In one embodiment of the present disclosure, template matching is performed using a second reference block template; After determining that the current block is to be decoded using intraTMP mode based on the intraTMP mode usage flag, the method further includes a step of decoding a syntax element related to a type of reference block template, the syntax element related to the type of reference block template being used to indicate whether or not an affine transformation is allowed to be used to obtain the reference block template and / or to indicate the type of affine transformation to be used, the type of affine transformation including one or more of inversion, rotation, and scaling.
[0218] In an exemplary embodiment of the present disclosure, the step of performing intra prediction on the current block based on a combination of reference blocks used by the current block includes a step of using a reconstructed value obtained by combining multiple reference blocks in the combination of reference blocks as a predicted value of the current block, wherein the reconstructed value obtained by combining the multiple reference blocks is equal to an average or weighted average of the reconstructed values of the multiple reference blocks.
[0219] In an exemplary embodiment of the present disclosure, the candidate list is constructed by the candidate list construction method for constructing only the first candidate list described above; Continuing to decode syntax elements of the current block in intraTMP mode and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: continuing to decode an intraTMP index, said intraTMP index being used to indicate the position in said candidate list of the reference block or combination of reference blocks used by the current block; determining a reference block or a combination of reference blocks to be used by the current block based on the intraTMP index and the first candidate list.
[0220] In an exemplary embodiment of the present disclosure, the candidate list is constructed by a candidate list construction method using the reference blocks as candidate items; Continuing to decode syntax elements of the current block in intraTMP mode and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: Continuing to decode an intraTMP fusion flag, the intraTMP fusion flag being used to indicate whether the current block uses a fusion scheme under intraTMP mode; If it is determined that the current block uses the merging method based on the intraTMP merging flag, skipping decoding of the intraTMP index and determining that the current block predicts using reconstructed values obtained by merging the first Q reference blocks in the candidate list, where Q is a set number of merging, and Q≧2; If it is determined based on the intraTMP fusion flag that the current block does not use the fusion method, the method includes a step of continuing to decode the intraTMP index and determining a reference block to be used by the current block based on the intraTMP index and the candidate list, wherein the intraTMP index is used to indicate the position in the candidate list of the reference block to be used by the current block.
[0221] In this embodiment, a candidate list is constructed that includes only reference blocks and does not include combinations of reference blocks. The merging method of this embodiment directly merges the first few reference blocks in the candidate list, so the encoding side does not need to compare the differences between the combinations of reference blocks with the differences between the reference blocks to construct a first candidate list, nor does it need to specifically construct a second candidate list that includes combinations of reference blocks.
[0222] In an exemplary embodiment of the present disclosure, the candidate list is constructed by a candidate list construction method using the reference blocks as candidate items; Continuing to decode syntax elements of the current block in intraTMP mode and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: continuing to decrypt the intraTMP index; If the intraTMP index is 0, a combination of reference blocks used by the current block is a combination of the first Q reference blocks in the candidate list, where Q is a set fusion number, and Q≧2; and if the intraTMP index indicates a position other than the first position in the candidate list, determining a reference block to be used by the current block based on the intraTMP index and the candidate list, wherein the intraTMP index is used to indicate the position in the candidate list of the reference block to be used by the current block.
[0223] In the above embodiment, if the current block uses the intraTMP mode, whether to use the fusion scheme under the intraTMP mode may be determined based on the result of rate-distortion optimization.
[0224] In one embodiment of the present disclosure, the candidate list includes a first candidate list or a second candidate list, and the first candidate list or the second candidate list is constructed by a method for constructing the first candidate list or the second candidate list in the method for constructing the two candidate lists described above; Continuing to decode syntax elements of the current block in intraTMP mode and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: continuing to decode the intraTMP fusion flag and the intraTMP index; determining, when determining based on an intraTMP merging flag that the current block does not use a multiple reference block merging method, a position in the first candidate list of a reference block to be used by the current block based on the first candidate list and the intraTMP index, wherein the intraTMP index is used to indicate a position in the first candidate list of a reference block to be used by the current block; When it is determined that the current block uses a multiple reference block merging method based on the intraTMP merging flag, the method includes a step of determining a position in the second candidate list of a combination of reference blocks to be used by the current block based on the second candidate list and the intraTMP index, wherein the intraTMP index is used to indicate a position in the second candidate list of a combination of reference blocks to be used by the current block.
[0225] In one embodiment of the present disclosure, the method further includes the steps of decoding an intraTMP multi-candidate flag and determining whether to allow use of a multi-candidate intraTMP mode based on the intraTMP multi-candidate flag, wherein the intraTMP multi-candidate flag is a sequence-level, image-level, or slice-level flag; After determining that the current block uses the intraTMP mode based on the intraTMP mode use flag, the method includes: if it is determined based on the intraTMP multi-candidate flag that the use of the multi-candidate intraTMP mode is permitted, continue decoding the intraTMP index of the current block; If it is determined based on the intraTMP multi-candidate flag that the use of the multi-candidate intraTMP mode is not allowed, the method further includes skipping decoding of the intraTMP index of the current block and performing intra prediction on the current block according to the single-candidate intraTMP mode.
[0226] In one embodiment of the present disclosure, the step of decoding the intraTMP index of the current block includes: or performing de-binarization of the intraTMP index by an analysis method corresponding to variable length coding, fixed length coding, truncated unary code or truncated binary code; The method includes a step of analyzing the value of the first binary code in the intraTMP index, and if the value is one of 0 and 1, de-binarizing the intraTMP index using an analysis method corresponding to variable length coding or truncated unary code, and if the value is the other of 0 and 1, de-binarizing the intraTMP index using an analysis method corresponding to fixed length coding or truncated binary code.
[0227] An embodiment of the present disclosure further provides a video encoding method, as shown in Figure 18. The method includes the following steps. S 710, if it is determined that the current block is allowed to use the multi-candidate intra template matching prediction intraTMP mode, construct an intraTMP candidate list according to the intraTMP candidate list construction method described in any embodiment of the present disclosure. S 720, calculating the coding costs for predicting the current block based on the reference blocks or combinations of reference blocks in the candidate list, and selecting the smallest coding cost among them as the coding cost of the intraTMP mode of the multiple candidates for rate-distortion optimization. S 730, if it is determined that the current block performs intra prediction using the intraTMP mode, encode syntax elements related to the intraTMP mode of the current block.
[0228] In this embodiment, when encoding the current block, multiple candidate intraTMP modes are adopted and fusion methods can be combined, thereby improving compression efficiency.
[0229] In one embodiment of the present disclosure, the candidate list is constructed by the candidate list construction method for constructing only the first candidate list described above; The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode usage flag of the current block to indicate that the current block uses intraTMP mode; and c) encoding an intraTMP index of the current block to indicate the position in said candidate list of the reference block or combination of reference blocks that the current block uses.
[0230] In an exemplary embodiment of the present disclosure, the candidate list is constructed by a candidate list construction method using the reference blocks as candidate items; The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses intraTMP mode; Continuing to encode an intraTMP fusion flag to indicate whether the current block uses the fusion method under intraTMP mode; if the intraTMP fusion flag indicates that the current block does not use the fusion scheme, continue encoding an intraTMP index to indicate the position in said candidate list of the reference block that the current block will use; skipping encoding of the intraTMP index if the intraTMP fusion flag indicates that the current block uses the fusion method; The current block using the fusion method refers to the current block performing intra prediction using a reconstructed value obtained by fusing the first Q reference blocks in the candidate list, where Q is a set number of fusions and Q≧2.
[0231] In one embodiment of the present disclosure, the candidate list is constructed by the candidate list construction method using the reference block as a candidate item; The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses intraTMP mode; encoding an intraTMP index, wherein the intraTMP index is 0 when it is currently determined to use the merging method under the intraTMP mode, and the intraTMP index is used to indicate the position in the candidate list of the reference block to be used by the current block when it is currently determined to use the reference block in the candidate list; The current block using the fusion method means that the current block performs intra prediction using reconstructed values obtained by fusing the first Q reference blocks in the candidate list, where Q is the set number of fusions and Q≧2.
[0232] In an exemplary embodiment of the present disclosure, the candidate list includes a first candidate list and a second candidate list, and the first candidate list and the second candidate list are constructed by the method for constructing the two candidate lists described above; The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses intraTMP mode; continuing to encode the intraTMP fusion flag and the intraTMP index; When the current block uses a reference block in the first candidate list, the intraTMP merging flag indicates that a multiple reference block merging method is not used, and the intraTMP index indicates a position in the first candidate list of the reference block used by the current block; When the current block uses a combination of reference blocks in the second candidate list, the intraTMP fusion flag indicates that a multiple reference block fusion method is used, and the intraTMP index indicates the position in the second candidate list of the combination of reference blocks used by the current block.
[0233] In an exemplary embodiment of the present disclosure, the reconstruction block template has multiple types: the step of encoding a syntax element related to the intraTMP mode of the current block further includes a step of encoding a syntax element related to a type of reference block template after encoding an intraTMP mode use flag of the current block, wherein the syntax element related to the type of reference block template is used to indicate whether or not it is permitted to obtain the reference block template using an affine transformation and / or to indicate the type of affine transformation to be used; The type of affine transformation includes one or more of reflection, rotation, and scaling.
[0234] In one embodiment of the present disclosure, the step of encoding the intraTMP index of the current block includes: or - realizing binarization of said intraTMP index by variable length coding, fixed length coding, truncated unary code or truncated binary code; The method includes a step of binarizing the intraTMP index by variable length coding or truncated unary code when the value of the intraTMP index is in a first value range, and by fixed length coding or truncated binary code when the value of the intraTMP index is in a second value range, wherein the value of the first value range is smaller than the value of the second value range.
[0235] In one embodiment of the present disclosure, the step of determining that the current block allows the use of multi-candidate intraTMP mode includes a step of determining that the current block allows the use of multi-candidate intraTMP mode if none of the conditions for disallowing the use of multi-candidate intraTMP mode are met, wherein the conditions for disallowing the use of multi-candidate intraTMP mode include a step of indicating that a sequence-level, image-level, or slice-level intraTMP multi-candidate flag does not allow the use of multi-candidate intraTMP mode.
[0236] In one embodiment of the present disclosure, the method further includes, when intra-prediction coding is performed on the current block according to a single-candidate intraTMP mode, a step of indicating that the current block uses the intraTMP mode by encoding an intraTMP mode usage flag of the current block, and a step of indicating the first position in the candidate list of the reference block used by the current block by encoding an intraTMP index of the current block.
[0237] An embodiment of the present disclosure further provides a candidate list construction method for intra template matching prediction and a corresponding video encoding and decoding method.
[0238] In this embodiment, the number of possible matching blocks may be increased by fusing multiple blocks. For example, two or more reference blocks may be fused. One fusion method involves averaging or weighted averaging the reconstructed values of multiple reference blocks to obtain a predicted value for the current block. That is, the fused block can be obtained by averaging or weighted averaging the pixel values at corresponding positions in the two or more reference blocks. In other words, a new block can be constructed by the fusion method.
[0239] In another embodiment, another fusion scheme is adopted, namely, one BV is used to find one reference block or a combination of reference blocks from the reconstructed image, and one intra prediction mode (e.g., Planar mode) is used to predict the current block, and the obtained prediction block is used as another reference block, and the pixel values of these two reference blocks are averaged or weighted averaged to obtain the prediction block of the current block.
[0240] In this embodiment, a different type of reference block template and reference block can be obtained by affine transformation, which may be one or more of rotation, flip, and zoom.
[0241] In some embodiments, when searching for a reference block template within a reconstruction region, the reconstructed image is directly compared with the template of the current block, and when used, the reconstructed value of the reference block in the reconstructed image is directly used as the predicted value of the current block. This format can be called a basic format, and the searched reference block template is the first reference block template in the above-mentioned embodiments. In this embodiment, the reconstructed image of a local region within the reconstruction region is subjected to affine transformation, such as horizontal flipping, vertical flipping, and rotation by 45 degrees, 90 degrees, or 180 degrees clockwise or counterclockwise, to obtain a template with the same shape and size as the template of the current block, i.e., a second reference block template, through affine transformation. In this case, the reference block corresponding to the second reference block template is a reference block obtained by performing an affine transformation on the local region, and the reference block obtained after the affine transformation must be used to predict the current block.
[0242] Furthermore, as another method for obtaining the second reference block template, a template having the same shape and size as the template of the current block after affine transformation can be found within the reconstruction region by searching, and the reference block corresponding to the second reference block template is a block within the reconstruction region.
[0243] In one example, flipping is easier to implement than rotation, so when used, flipping can be used alone without rotation. In another example, rotation can be used if the computational budget allows.
[0244] In this embodiment, when searching for the second reference block template, the BVs used when searching for the first reference block template may be used. As shown in FIG. 19, the small cells marked with "x" in the figure indicate the positions indicated by the BVs used to search for the reference block in the figure. Based on this position, a local region within the reconstruction region from which the second reference block template can be obtained by inversion can be found. In another embodiment, the set of BVs used to search for the second reference block template is different from the set of BVs used to search for the first reference block template. The set of BVs used to search for the second reference block template can also be determined based on a search step size and a search range. The search step size and search range may be the same as those used to determine the set of BVs used to search for the first reference block template, but there is an offset between them. When determining the set of BVs used to search for the second reference block template, it is necessary to ensure that the local region from which the second reference block template obtained through affine transformation can be obtained is located within the available reconstruction region.
[0245] In one embodiment of this embodiment, the second reference block template may be obtained by scaling. That is, more reference block templates can be obtained by zooming in or out on the reconstructed image of the searched local region or the block corresponding to the searched BV. Several zooming or shrinking ratios, for example, 1.5, 2, 4, etc., may be set. When zooming in, an upsampling algorithm such as an interpolation filter may be used, and when shrinking, a downsampling algorithm may be used, thereby obtaining the reconstructed value of the second reference block template after scaling and the reconstructed value of the corresponding reference block. When scaling, the position indicated by the BV may be used as the base point, or another position may be used as the base point for scaling.
[0246] In this embodiment, based on the multi-candidate intraTMP mode of the reference block, more possibilities are provided. The decoder may determine whether the current block uses the merging scheme, whether the second reference block template is used, etc. based on the relevant syntax elements.
[0247] One way is to use a flag bit (flag). For example, intraTmpFusionFlag may be used to indicate whether fusion is used or not. The corresponding decoding example is as follows, where the bolded parts are the syntax elements to be parsed: intraTmpFlag if(intraTmpFlag){ intraTmpFusionFlag }
[0248] The decoder parses intraTmpFlag, and if the value of intraTmpFlag is 1, continues parsing intraTmpFusionFlag. If the value of intraTmpFusionFlag is 1, it performs intraTMP prediction using the fusion format; otherwise, it performs intraTMP prediction using another method, such as the default format.
[0249] A typical decoding syntax that combines the fusion method and the method of the second reference block template obtained by multiple affine transformations is as follows: intraTmpFlag if(intraTmpFlag){ intraTmpFusionFlag if(!intraTmpFusionFlag){ intraTmpFlipFlag if(intraTmpFlipFlag){ intraTmpFlipIdx }else{ intraTmpZoomFlag if(intraTmpZoomFlag){ intraTmpZoomIdx } } } }
[0250] The decoder parses intraTmpFlag, and if the value of intraTmpFlag is 1, continues parsing intraTmpFusionFlag. If the value of intraTmpFusionFlag is 1, the decoder performs intraTmp prediction using the fusion method; otherwise (if the value of intraTmpFusionFlag is 0), the decoder parses intraTmpFlipFlag. If the value of intraTmpFlipFlag is 1, the decoder parses intraTmpFlipIdx, where a value of 0 for intraTmpFlipIdx indicates that horizontal flipping is used and a value of 1 for intraTmpFlipIdx indicates that vertical flipping is used. Otherwise ( intraTmpFlipFlag If the value of intraTmpZoomFlag is 0, parse intraTmpZoomFlag. If the value of intraTmpZoomFlag is 1, parse intraTmpZoomIdx, where intraTmpZoomIdxA value of 0 for intraTmpZoomIdx indicates that 2x magnification is used, and a value of 1 for intraTmpZoomIdx indicates that 2x minification is used.
[0251] As mentioned above, using more candidate items (e.g., reference blocks or combinations of reference blocks) in the candidate list can reduce the situation where the best matching block found by template matching is not ideal. More candidate items can be understood as candidate BVs, where each BV corresponds to one block. Therefore, the fusion method may be used in combination with the multi-candidate intraTMP mode.
[0252] Method one An example is shown below. intraTmpFlag if(intraTmpFlag){ intraTmpFusionFlag if(!intraTmpFusionFlag){ intraTmpIdx } }
[0253] The decoder analyzes intraTmpFlag and, if the value of intraTmpFlag is 1, continues analyzing intraTmpFusionFlag. If the value of intraTmpFusionFlag is 1, intraTMP prediction is performed using the fusion method. Otherwise (if the value of intraTmpFusionFlag is 0), the decoder analyzes intraTmpIdx. An intraTMPCandList is constructed, and each item in intraTMPCandList determines one BV. The decoder performs intraTMP prediction using the BV determined by intraTMPCandList[intraTmpIdx]. An example of a fusion method is fusing the blocks corresponding to the BVs determined by the first three items in intraTMPCandList. That is, if fusion is not used, the appropriate BV may be selected using the multi-candidate intraTmpIdx mode. In this example, the multi-candidate method and the fusion method are separated, and only the basic form (non-fusion) uses multi-candidates. Multi-candidates refer to candidates provided from a sorted list of possible BVs.
[0254] Method 2 Another example is shown below. intraTmpFlag if(intraTmpFlag){ intraTmpFusionFlag intraTmpIdx }
[0255] The decoder analyzes intraTmpFlag, and if the value of intraTmpFlag is 1, it continues analyzing intraTmpFusionFlag. If the value of intraTmpFusionFlag is 1, it performs intraTMP prediction using the fusion method. Then, the decoder analyzes intraTmpIdx. The difference from the previous example is that the decoder analyzes intraTmpIdx regardless of the value of intraTmpFusionFlag.
[0256] When constructing intraTMPCandList, if the value of intraTmpFusionFlag is 0, each item in intraTMPCandList determines one BV and performs intraTMP prediction using the BV determined by intraTMPCandList[intraTmpIdx]. If the value of intraTmpFusionFlag is 1, each item in intraTMPCandList determines a set of BVs and performs intraTMP fusion prediction using the set of BVs determined by intraTMPCandList[intraTmpIdx].
[0257] Each item in intraTMPCandList not only determines a set of BVs, but may also determine the weight of each BV or set a default weight. That is, in this example, multiple formats can be combined to use multiple candidates. The multiple candidates here refer to candidates provided from a sorted list of possible candidates for the current format. These multiple candidates are sorted and are different from multiple candidates set based on fixed rules, such as in the previous example where intraTmpFlipIdx=0 indicates horizontal flip and intraTmpFlipIdx=1 indicates vertical flip. The sorting is based on the cost on the template.
[0258] In the above example, multiple formats are still separated, for example, a flag is used to distinguish between methods that select reference blocks as candidate items and methods that select combinations of reference blocks as candidate items, and separate candidate lists are constructed for reference blocks and combinations of reference blocks. The candidate items in one candidate list are reference blocks, and the candidate items in the other candidate list are combinations of reference blocks.
[0259] Method three The fusion method and the multi-candidate method may be combined in other ways, and one candidate list may support multiple types of candidate items, such as a combination of reference blocks. When combining the fusion method and the multi-candidate method, the reference block template to be searched may be the first reference block template, the second reference block template, or both the first reference block template and the second reference block template.
[0260] An example of decoding is shown below. intraTmpFlag if(intraTmpFlag){ intraTmpIdx }
[0261] In this case, instead of using various flags to distinguish between different methods, one candidate list supports multiple types of candidate items. For example, one item in the candidate list may be a reference block, and another item may be a fusion-type combination of reference blocks. The reference block templates corresponding to these reference blocks may be a first reference block template and / or a second reference block template, and these second reference block templates may be obtained by methods such as inversion. In terms of data structure, each item in the candidate list may include information indicating the type of the current candidate item, such as whether it is a reference block, a fusion of reference blocks, or a template obtained by inversion. This information may be determined based on the position of the candidate item in the candidate list, with the encoding and decoding sides constructing the same list. A candidate item in the reference block type may be represented by the BV of the reference item, and a candidate item in the reference block combination type may be represented by multiple BVs or a BV of one reference block plus a fusion flag; details will be omitted. A candidate item in the reference block combination type includes BV information of the current candidate (which may be one valid BV or multiple valid BVs), and multiple valid BVs are used to support the fusion type.
[0262] When constructing a candidate list, the remaining possible candidate items can be sorted based on the difference (also called cost) between the current block template and the candidate. In the case of fusion formats, i.e., combinations of reference block templates, one possible method is to fuse several reference block templates in the combination. In the case of inversion formats, the templates can be correspondingly inverted or the corresponding template can be found from the inverted reconstructed image. In the case of scaling formats, the templates can be correspondingly scaled or the corresponding template can be found from the scaled reconstructed image. This provides more flexibility because video content is diverse and one format may be effective for one block and another format for another. Candidates of multiple formats can be put into one candidate list and sorted by an algorithm, such as sorting in ascending order of lowest cost on the template, so that candidates with lower costs on the template are sorted earlier and candidates with higher costs are sorted later, regardless of the format. Candidates sorted earlier are usually assigned shorter codes, and candidates sorted later are more suitable. long Therefore, the length of the code is not directly determined by the format, but depends on the cost of the candidate template.
[0263] Method 4 This method adopts a compromise approach. For example, one format can be flagged and another format can be included in the candidate list. When constructing the candidate list, it is possible to use templates or similar to make the sort order of the candidates as close as possible to the actual possible order. Of course, statistically, this is certainly close, but because the original information of the current block cannot be used during sorting, and because it relies solely on information such as templates, it is not possible to achieve complete accuracy for each individual. Therefore, as an artificial control, it is possible to flag clearly superior formats and combine other formats into the candidate list. An example is shown below. intraTmpFlag if(intraTmpFlag){ intraTmpFusionFlag if(!intraTmpFusionFlag){ intraTmpIdx } }
[0264] The decoder parses intraTmpFlag, and if the value of intraTmpFlag is 1, it continues parsing intraTmpFusionFlag. If the value of intraTmpFusionFlag is 1, it performs intraTMP prediction using the fusion method, otherwise (if the value of intraTmpFusionFlag is 0), the decoder parses intraTmpIdx.
[0265] The parsed syntax is the same as in Method 1, but the difference is that the candidate list intraTMPCandList in Method 1 supports only the basic format, whereas the candidate list in this application supports multiple formats such as the basic format, inversion, and scaling.
[0266] Another example is shown below. intraTmpFlag if(intraTmpFlag){ intraTmpIdx }
[0267] Syntactically, no flag is used. If intraTmpIdx=0, the merged format is selected, and if intraTmpIdx>0, the candidate intraTMPCandList[intraTmpIdx-1] is selected. intraTMPCandList supports multiple formats other than merged. In this case, the merger may merge intraTMPCandList[0], intraTMPCandList[1], and intraTMPCandList[2].
[0268] How to binarize IntraTmpIdx Since the intraTMPCandList is already sorted, candidates that are sorted earlier have a higher probability of being selected statistically. Therefore, variable length coding, such as truncated unary, may be used for binarization and de-binarization of intraTmpIdx. JPEG2026501769000040.jpg33119
[0269] Of course, if the probabilities are roughly equal, fixed length coding or truncated binary may be used.
[0270] When N is large, the probability of the earlier candidate is high, and the probability decreases as you go later, and the probability tends to get closer as you go further later. Therefore, you can make the earlier code shorter and the later code longer, and you can use the same code length for some later candidates. For example, as shown in the example below. JPEG2026501769000041.jpg36156
[0271] In this example, N=15, and the same length code is used for indexes 3 to 6, and the same length code is used for indexes 7 to 14. The x in the above table can be obtained by truncated binary.
[0272] In the second type of method, artificial control can be added in addition to sorting. For example, certain candidates can be forced to be placed first, certain candidates can be forced to be placed at certain bits, candidates can be grouped, or special code lengths can be artificially set for certain indexes. For example, it is possible to assign a short code while forcing the fused form to be placed last.
[0273] In this embodiment, we set multiple types of candidate items and multiple types of reference block templates for intraTMP and propose several methods for combining the multiple types with multiple candidates. Using more types increases the number of possibilities. Combining multiple types and multiple candidates enriches the set of possible candidates while also making more effective use of the candidate list. For example, if the basic type (using reference blocks as candidate items and the first reference block template) does not have suitable candidate items or has insufficient candidate items, other types can provide suitable candidate items, and suitable candidate items can be used to replace inappropriate candidate items, thereby improving the candidate quality of the entire candidate list and improving compression efficiency.
[0274] An embodiment of the present disclosure further provides a codestream generated based on the video encoding method described in any embodiment of the present disclosure.
[0275] An embodiment of the present disclosure further provides a candidate list construction device for intra template matching prediction, as shown in Fig. 14. The device includes a processor 71 and a memory 73 storing a computer program, and when the processor 71 executes the computer program, the device can realize the candidate list construction method for intra template matching prediction described in any embodiment of the present disclosure.
[0276] An embodiment of the present disclosure further provides a video decoding device, including a processor and a memory storing a computer program, with reference to Figure 14. When the processor executes the computer program, the video decoding method described in any embodiment of the present disclosure can be realized.
[0277] An embodiment of the present disclosure further provides a video encoding device, including a processor and a memory storing a computer program, with reference to Figure 14. When the processor executes the computer program, the video encoding method described in any embodiment of the present disclosure can be realized.
[0278] The processor in the above embodiments of the present disclosure may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a microprocessor, or other conventional processor. The processor may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a distributed logic circuit or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or an equivalent integrated or distributed logic circuit, or a combination of the above devices. That is, the processor in the above embodiments is any processor device or combination of devices that implements the methods, steps, and logical block diagrams disclosed in the embodiments of the present disclosure. When the embodiments of the present disclosure are implemented in part by software, the method of the embodiments of the present disclosure can be realized by storing software instructions in a suitable non-volatile computer-readable storage medium and executing the instructions on hardware by one or more processors. As used herein, the term "processor" refers to the above-mentioned structure or any other structure suitable for implementing the techniques described herein.
[0279] An embodiment of the present disclosure further provides a video encoding / decoding system including the video encoding device and the video decoding device described in any of the embodiments of the present disclosure.
[0280] An embodiment of the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon, the computer program being capable of implementing a method according to any of the embodiments of the present disclosure when executed by a processor.
[0281] An embodiment of the present disclosure further provides a computer program product including a computer program, which when executed by a processor is capable of implementing a method according to any of the embodiments of the present disclosure.
[0282] In one or more exemplary embodiments above, the functions described may be implemented by hardware, software, firmware, or any combination thereof. If implemented by software, the functions are stored on or transmitted via a computer-readable medium as one or more instructions or code and executed by a hardware-based processing unit. Computer-readable media include computer-readable storage media corresponding to tangible media, such as data storage media, or communication media facilitating computer programs, such as any medium transmitting from one place to another according to a communication protocol. In this manner, computer-readable media typically correspond to non-transitory tangible computer-readable storage media or communication media, such as signals or carrier waves. Data storage media are any available media accessible by one or more computers or one or more processors to retrieve instructions, code, and / or data structures to implement the techniques described in this disclosure. A computer program product includes a computer-readable medium.
[0283] For example, such computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that stores desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, when instructions are transmitted from a website, server, or other remote source via coaxial cable, fiber optic cable, bipolar line, digital subscriber line (DSL), or wireless technologies such as infrared, radio, or microwave, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, or microwave are included in the definition of media. However, computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media; only non-transitory tangible storage media are covered. As used herein, "magnetic disk" and "optical disk" include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs. Magnetic discs typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0284] In some aspects, the functionality described herein may be provided in dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a combined encoding and decoding device, or the techniques may be implemented entirely within one or more circuits or logic elements.
[0285] The technical means of the embodiments of the present disclosure may be implemented in a wide variety of devices or equipment, including a wireless mobile phone, an integrated circuit (IC), or a set of ICs (e.g., a chipset). The various components, modules, or units described in the embodiments of the present disclosure are described to emphasize functional aspects of devices configured to perform the described techniques, but are not necessarily realized by different hardware units. Rather, as described above, the various units may be combined into a hardware unit of an encoding / decoding device, or may be provided in combination with appropriate software and / or firmware in a collection of interoperable hardware units (including one or more processors as described above). Appendix 1 A method for constructing a candidate list for intra template matching prediction, comprising: determining a first search range for intra template matching prediction intraTMP of the current block; searching for a reference block template based on the first search range, and calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, wherein the reference block template corresponds to the reference block one-to-one, and the combination of the reference block template corresponds to the combination of the reference block one-to-one; constructing a candidate list of intraTMP based on the difference, and determining a number of candidate items in the candidate list and an order of the number of candidate items; A candidate list construction method for intra-template matching prediction. Appendix 2 The searched reference block templates are all located in the reconstruction area of the current image; The difference of the reference block template with respect to the current block template is determined based on a sum of average differences (SAD), sum of average differences (SATD), or mean squared differences (MSE) between the reconstructed values of the reference block template and the reconstructed values of the current block template; The difference of the combination of reference block templates to the current block template is determined based on SAD, SATD or MSE between the reconstructed value after fusion of the combined multiple reference block templates and the reconstructed value of the current block template, and the reconstructed value after fusion of the multiple reference block templates is equal to the average or weighted average of the reconstructed values of the multiple reference block templates; The method described in Appendix 1. Appendix 3 The candidate list has length N 1 N in the first candidate list 1 the candidate items include reference blocks and / or combinations of reference blocks; N 1 The order of the candidate items is determined in ascending order of the difference between the corresponding reference block template and / or the corresponding combination of reference block templates and the current block, the reference block corresponds to the reference block template, and the combination of reference blocks corresponds to the combination of reference block templates. The method described in Appendix 1. Appendix 4 The reference block is identified by a block vector BV of the reference block, and the BV of the reference block is used to indicate the position of the reference block relative to the current block, and the BV corresponding to the reference block template is the BV of the reference block corresponding to the reference block template. The method described in Appendix 1. Appendix 5 The step of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, and constructing the candidate list based on the difference, determining a set of BVs based on a first search step size and the first search range, the set of BVs indicating positions within the first search range; searching for a corresponding reference block template based on the set of BVs, and calculating a first difference between the searched reference block template and the current block template; calculating a second difference between the current block template and a combination of reference block templates obtained by combining the P reference block templates with the smallest difference with other reference block templates, where P≧1; sorting the first differences and the second differences and entering identifiers corresponding to the reference block templates and / or combinations of reference block templates corresponding to the smallest N differences into a first candidate list; The identifier corresponding to the reference block template is a BV corresponding to the reference block template, and the identifier corresponding to the combination of reference block templates is an identifier of a combination of reference blocks corresponding to the combination of reference block templates. The method described in Appendix 4. Appendix 6 The step of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, and constructing the candidate list based on the difference, determining a set of BVs based on a first search step size and the first search range, the set of BVs indicating positions within the first search range; searching for a corresponding reference block template based on the set of BVs, and calculating a first difference between the searched reference block template and the current block template; N with the smallest first difference 1 a step of entering BVs corresponding to N reference block templates into a first candidate list, the first candidate list including N 1 reference blocks are included; The identifier corresponding to the reference block template is a BV corresponding to the reference block template; The method described in Appendix 4. Appendix 7 The steps of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, and constructing the first candidate list based on the difference include: calculating a second difference between the current block template and a combination of the reference block templates obtained by combining the P reference block templates having the smallest first difference with other reference block templates; N with the smallest second difference 2 entering identifiers corresponding to combinations of N reference block templates into a second candidate list, wherein the second candidate list includes N 2 a combination of reference blocks; The identifier corresponding to the combination of reference block templates is an identifier of a combination of reference blocks corresponding to the combination of reference block templates, and P≧N 2 、N 2 ≧1 or N 2 ≧2, The method described in Appendix 6. Appendix 8 The combination of reference blocks includes one first reference block and L-1 second reference blocks, and the L-1 second reference blocks are the L-1 reference blocks whose BVs are closest to the BV of the first reference block, and the distance between the two BVs is determined based on the distance between the positions indicated by the two BVs, where L is the number of reference blocks in the combination of reference blocks, and L≧2; or The combination of reference blocks includes one first reference block and L-1 second reference blocks, and the L-1 second reference blocks are reference blocks obtained by performing prediction on the current block based on a set intra prediction mode, where L≧2; The reference block corresponding to the P reference block templates is the first reference block. 8. The method according to claim 5 or 7. Appendix 9 The combination of reference blocks is identified by the BVs of the reference blocks in the combination, or the combination of reference blocks is identified by the BV of the first reference block in the combination plus a fusion flag. The method described in Appendix 8. Appendix 10 the searched reference block template includes a first reference block template and / or a second reference block template; the first reference block template is a template having the same shape and size as the current block template in a reconstruction area, the reconstruction area being a reconstruction area of an image in which the current block is located; the second reference block template is a template obtained by performing an affine transformation on a local region within the reconstruction region and has the same shape and size as the current block template, and the reference block corresponding to the second reference block template is a reference block obtained by performing an affine transformation on the local region, or the second reference block template is a template in the reconstruction region that has the same shape and size as the current block template after the affine transformation, and the reference block corresponding to the second reference block template is a block within the reconstruction region; The affine transformation includes one or more of a reflection, a rotation, and a scaling. The method described in Appendix 1. Appendix 11 The size of the first search range is determined based on the size of the current block. The method described in Appendix 1. Appendix 12 The first search distance in the width direction and the second search distance in the height direction of the first search range relative to the base point representing the position of the current block are A method of calculating the product of the width of the current block and a first scale factor, and setting the larger value of this product and the minimum search distance in the width direction as the first search distance, and calculating the product of the height of the current block and a second scale factor, and setting the larger value of this product and the minimum search distance in the height direction as the second search distance, wherein the first scale factor and the second scale factor are equal or unequal, or A method of determining the larger value of the width of the current block and the set minimum search distance in the width direction, and setting the first search distance to the product of the larger value and a first scale factor, and determining the larger value of the height of the current block and the set minimum search distance in the height direction, and setting the second search distance to the product of the larger value and a second scale factor, wherein the first scale factor and the second scale factor are equal or unequal, or The first search distance is determined by a method of multiplying a width of a current block by a corresponding first scale factor, where there are a plurality of first scale factors, and the larger the first scale factor, the larger the width of the corresponding current block; and the second search distance is determined by a method of multiplying a height of a current block by a corresponding second scale factor, where there are a plurality of second scale factors, and the larger the second scale factor, the larger the height of the corresponding current block. The method described in Appendix 11. Appendix 13 A method for constructing a candidate list for intra template matching prediction, comprising: determining a first search range for intra template matching prediction (intraTMP) of the current block, the first search range being located within a reconstruction area of the current image; determining a set of BVs based on a first search step size and the first search range, where the positions indicated by the set of BVs are within the first search range; searching for a corresponding reference block template based on the set of BVs; and calculating a difference between the searched reference block template and a current block template; filling the candidate list with BVs corresponding to the N reference block templates with the smallest differences in ascending order of corresponding differences, where N is the length of the candidate list and N≧2; The reference block template has a one-to-one correspondence with the reference block, and the difference of the reference block template with respect to the current block template is determined based on SAD, SATD, or MSE between the reconstructed value of the reference block template and the reconstructed value of the current block template, and the BV of the reference block is used to indicate the position of the reference block with respect to the current block, and the BV corresponding to the reference block template is the BV of the reference block corresponding to the reference block template. A candidate list construction method for intra-template matching prediction. Appendix 14 the searched reference block template includes a first reference block template and / or a second reference block template; the first reference block template is a template having the same shape and size as the current block template in a reconstruction area, the reconstruction area being a reconstruction area of an image in which the current block is located; the second reference block template is a template obtained by performing an affine transformation on a local region within the reconstruction region and has the same shape and size as the current block template, and the reference block corresponding to the second reference block template is a reference block obtained by performing an affine transformation on the local region, or the second reference block template is a template in the reconstruction region that has the same shape and size as the current block template after the affine transformation, and the reference block corresponding to the second reference block template is a block within the reconstruction region; The affine transformation includes one or more of a reflection, a rotation, and a scaling. The method described in Appendix 13. Appendix 15 1. A video decoding method comprising: decoding an intra template matching prediction intraTMP mode use flag of the current block; If it is determined that the current block uses the intraTMP mode based on the intraTMP mode usage flag, continuing to decode syntax elements of the intraTMP mode of the current block; constructing a candidate list of intraTMP, determining a reference block or a combination of reference blocks to be used by a current block based on the syntax elements and the candidate list, and performing intra prediction on the current block based on the reference block or the combination of reference blocks to be used by the current block; Video decoding methods. Appendix 16 The candidate list is constructed by the intraTMP candidate list construction method described in any one of Supplementary Notes 1 to 14. The method described in Appendix 15. Appendix 17 performing intra prediction on the current block based on a combination of reference blocks used by the current block, the step of using a reconstructed value obtained by combining a plurality of reference blocks in the combination of reference blocks as a predicted value of the current block, wherein the reconstructed value obtained by combining the plurality of reference blocks is equal to an average value or a weighted average value of the reconstructed values of the plurality of reference blocks; The method described in Appendix 15. Appendix 18 the candidate list is a first candidate list constructed by the method described in Appendix 5; Continuing to decode syntax elements of the current block in intraTMP mode and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: continuing to decode an intraTMP index, said intraTMP index being used to indicate the position in said candidate list of the reference block or combination of reference blocks used by the current block; determining a reference block or a combination of reference blocks to be used by the current block based on the intraTMP index and the first candidate list; The method described in Appendix 17. Appendix 19 The candidate list is constructed by the method described in Appendix 13 or 14, Continuing to decode syntax elements of the current block in intraTMP mode and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: Continuing to decode an intraTMP fusion flag, the intraTMP fusion flag being used to indicate whether the current block uses a fusion scheme under intraTMP mode; If it is determined that the current block uses the merging method based on the intraTMP merging flag, skipping decoding of the intraTMP index and determining that the current block predicts using reconstructed values obtained by merging the first Q reference blocks in the candidate list, where Q is a set number of merging, and Q≧2; if it is determined based on the intraTMP merging flag that the current block does not use the merging scheme, continuing to decode the intraTMP index and determining a reference block to be used by the current block based on the intraTMP index and the candidate list, wherein the intraTMP index is used to indicate a position in the candidate list of the reference block to be used by the current block; The method described in Appendix 15. Appendix 20 The candidate list is constructed by the method described in Appendix 13 or 14, Continuing to decode syntax elements of the current block in intraTMP mode and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: continuing to decrypt the intraTMP index; If the intraTMP index is 0, a combination of reference blocks used by the current block is a combination of the first Q reference blocks in the candidate list, where Q is a set fusion number, and Q≧2; if the intraTMP index indicates a position other than the first position in the candidate list, determining a reference block to be used by the current block based on the intraTMP index and the candidate list, the intraTMP index being used to indicate the position in the candidate list of the reference block to be used by the current block; The method described in Appendix 15. Appendix 21 the candidate list comprises a first candidate list or a second candidate list, the first candidate list or the second candidate list being constructed by the method described in Appendix 7; Continuing to decode syntax elements of the current block in intraTMP mode and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: continuing to decode the intraTMP fusion flag and the intraTMP index; determining, when determining based on an intraTMP merging flag that the current block does not use a multiple reference block merging method, a position in the first candidate list of a reference block to be used by the current block based on the first candidate list and the intraTMP index, wherein the intraTMP index is used to indicate a position in the first candidate list of a reference block to be used by the current block; and when determining based on an intraTMP merging flag that the current block uses a multiple reference block merging method, determining based on the second candidate list and the intraTMP index a position in the second candidate list of a combination of reference blocks to be used by the current block, wherein the intraTMP index is used to indicate a position in the second candidate list of a combination of reference blocks to be used by the current block. The method described in Appendix 15. Appendix 22 The method further includes the steps of decoding an intraTMP multiple candidate flag and determining whether to allow use of a multiple candidate intraTMP mode based on the intraTMP multiple candidate flag, wherein the intraTMP multiple candidate flag is a sequence-level, picture-level, or slice-level flag; After determining that the current block uses the intraTMP mode based on the intraTMP mode use flag, the method includes: if it is determined based on the intraTMP multi-candidate flag that the use of the multi-candidate intraTMP mode is permitted, continue decoding the intraTMP index of the current block; If it is determined not to allow the use of the multi-candidate intraTMP mode based on the intraTMP multi-candidate flag, skipping decoding of the intraTMP index of the current block and performing intra prediction on the current block according to the single-candidate intraTMP mode. The method described in Appendix 15. Appendix 23 The step of decoding the intraTMP index of the current block includes: or performing de-binarization of the intraTMP index by an analysis method corresponding to variable length coding, fixed length coding, truncated unary code or truncated binary code; a step of analyzing the value of a first binary code in the intraTMP index, and if the value is one of 0 and 1, realizing de-binarization of the intraTMP index by an analysis method corresponding to variable length coding or truncated unary code, and if the value is the other of 0 and 1, realizing de-binarization of the intraTMP index by an analysis method corresponding to fixed length coding or truncated binary code; The method according to any one of Appendices 18 to 22. Appendix 24 1. A video encoding method comprising: If the current block determines that a multi-candidate intra template matching prediction intraTMP mode is allowed to be used, constructing an intraTMP candidate list according to the method described in any one of Supplementary Notes 1 to 14; calculating coding costs for predicting the current block based on the reference blocks or combinations of reference blocks in the candidate list, and determining the smallest coding cost among the coding costs as the intraTMP mode coding cost of the multiple candidates, and using it in rate-distortion optimization; If it is determined that the current block performs intra prediction using the intraTMP mode, encoding a syntax element related to the intraTMP mode of the current block. Video coding methods. Appendix 25 the candidate list is a first candidate list constructed by the method described in Appendix 5; The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode usage flag of the current block to indicate that the current block uses intraTMP mode; and encoding an intraTMP index of the current block to indicate the position in the candidate list of the reference block or combination of reference blocks used by the current block. The method described in Appendix 24. Appendix 26 The candidate list is constructed by the method described in Appendix 13 or 14, The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses intraTMP mode; Continuing to encode an intraTMP fusion flag to indicate whether the current block uses the fusion method under intraTMP mode; if the intraTMP fusion flag indicates that the current block does not use the fusion scheme, continue encoding an intraTMP index to indicate the position in said candidate list of the reference block that the current block will use; skipping encoding of the intraTMP index if the intraTMP fusion flag indicates that the current block uses the fusion method; The current block using the fusion scheme refers to performing intra prediction on the current block using reconstructed values obtained by fusing the first Q reference blocks in the candidate list, where Q is a set number of fusions, and Q≧2. The method described in Appendix 24. Appendix 27 The candidate list is constructed by the method described in Appendix 13 or 14, The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses intraTMP mode; encoding an intraTMP index, wherein the intraTMP index is 0 when it is currently determined to use the merging method under the intraTMP mode, and the intraTMP index is used to indicate the position in the candidate list of the reference block to be used by the current block when it is currently determined to use the reference block in the candidate list; The current block uses the fusion scheme to perform intra prediction using a reconstructed value obtained by fusing the first Q reference blocks in the candidate list, where Q is a set number of fusions, and Q≧2. The method described in Appendix 24. Appendix 28 the candidate lists include a first candidate list and a second candidate list, the first candidate list and the second candidate list being constructed by the method described in Appendix 7; The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses intraTMP mode; continuing to encode the intraTMP fusion flag and the intraTMP index; When the current block uses a reference block in the first candidate list, the intraTMP merging flag indicates that a multiple reference block merging method is not used, and the intraTMP index indicates a position in the first candidate list of the reference block used by the current block; When the current block uses a combination of reference blocks in the second candidate list, the intraTMP fusion flag indicates that a multiple reference block fusion method is used, and the intraTMP index indicates a position in the second candidate list of the combination of reference blocks used by the current block. The method described in Appendix 24. Appendix 29 The candidate list is constructed by the method described in Appendix 10 or 14; the step of encoding a syntax element related to the intraTMP mode of the current block further includes a step of encoding a syntax element related to a type of reference block template after encoding an intraTMP mode use flag of the current block, wherein the syntax element related to the type of reference block template is used to indicate whether or not it is permitted to obtain the reference block template using an affine transformation and / or to indicate the type of affine transformation to be used; The type of affine transformation includes one or more of inversion, rotation, and scaling. The method according to any one of Appendices 25 to 28. Appendix 30 The step of encoding the intraTMP index of the current block comprises: or - realizing binarization of said intraTMP index by variable length coding, fixed length coding, truncated unary code or truncated binary code; a step of binarizing the intraTMP index by variable length coding or truncated unary code when the value of the intraTMP index is in a first value range, and by fixed length coding or truncated binary code when the value of the intraTMP index is in a second value range, wherein the value of the first value range is smaller than the value of the second value range; The method according to any one of Appendices 25 to 28. Appendix 31 The step of determining that the current block allows use of the multi-candidate intraTMP mode includes a step of determining that the current block allows use of the multi-candidate intraTMP mode if none of the conditions for disallowing use of the multi-candidate intraTMP mode are met, wherein the conditions for disallowing use of the multi-candidate intraTMP mode include a step of indicating that a sequence-level, image-level, or slice-level intraTMP multi-candidate flag does not allow use of the multi-candidate intraTMP mode. The method described in Appendix 24. Appendix 32 When intra prediction coding is performed on the current block according to a single candidate intraTMP mode, the method further includes the steps of: encoding an intraTMP mode usage flag of the current block to indicate that the current block uses the intraTMP mode; and encoding an intraTMP index of the current block to indicate that the reference block used by the current block is at the first position in the candidate list. The method described in Appendix 24.
Claims
1. A method for constructing a candidate list for intra template matching prediction, comprising: determining a first search range for intra template matching prediction intraTMP of the current block; searching for a reference block template based on the first search range, and calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, wherein the reference block template corresponds to the reference block one-to-one, and the combination of the reference block template corresponds to the combination of the reference block one-to-one; constructing a candidate list of intraTMPs based on the difference, and determining a number of candidate items in the candidate list and an order for the number of candidate items; A candidate list construction method for intra-template matching prediction.
2. The searched reference block templates are all located in the reconstruction area of the current image; The difference of the reference block template with respect to the current block template is determined based on a sum of average differences (SAD), sum of average differences (SATD), or mean squared differences (MSE) between the reconstructed values of the reference block template and the reconstructed values of the current block template; The difference of the combination of reference block templates to the current block template is determined based on SAD, SATD or MSE between a reconstructed value after fusion of the combined multiple reference block templates and a reconstructed value of the current block template, and the reconstructed value after fusion of the multiple reference block templates is equal to an average or weighted average of the reconstructed values of the multiple reference block templates.
2. The method of claim 1 .
3. The candidate list has length N 1 N in the first candidate list 1 the candidate items include reference blocks and / or combinations of reference blocks; The N 1 The order of the candidate items is determined in ascending order of the difference between the corresponding reference block template and / or the corresponding combination of reference block templates and the current block, the reference block corresponds to the reference block template, and the combination of reference blocks corresponds to the combination of reference block templates.
2. The method of claim 1 .
4. The reference block is identified by a block vector BV of the reference block, the BV of the reference block is used to indicate the position of the reference block relative to the current block, and the BV corresponding to the reference block template is the BV of the reference block corresponding to the reference block template.
2. The method of claim 1 .
5. The step of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, and constructing the candidate list based on the difference, determining a set of BVs based on a first search step size and the first search range, the set of BVs indicating positions within the first search range; searching for a corresponding reference block template based on the set of BVs, and calculating a first difference between the searched reference block template and the current block template; calculating a second difference between the current block template and a combination of reference block templates obtained by combining the P reference block templates with the smallest difference with other reference block templates, where P≧1; sorting the first differences and the second differences and entering identifiers corresponding to the reference block templates and / or combinations of reference block templates corresponding to the smallest N differences into a first candidate list; The identifier corresponding to the reference block template is a BV corresponding to the reference block template, and the identifier corresponding to the combination of reference block templates is an identifier of a combination of reference blocks corresponding to the combination of reference block templates.
5. The method of claim 4.
6. The step of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, and constructing the candidate list based on the difference, determining a set of BVs based on a first search step size and the first search range, the set of BVs indicating positions within the first search range; searching for a corresponding reference block template based on the set of BVs, and calculating a first difference between the searched reference block template and the current block template; N with the smallest first difference 1 a step of entering BVs corresponding to N reference block templates into a first candidate list, the first candidate list including N 1 reference blocks are included; The identifier corresponding to the reference block template is a BV corresponding to the reference block template.
5. The method of claim 4.
7. The step of searching for a reference block template based on the first search range, calculating a difference between the searched reference block template and a combination of the reference block template and a current block template, and constructing the first candidate list based on the difference, calculating a second difference between the current block template and a combination of the reference block templates obtained by combining the P reference block templates having the smallest first difference with other reference block templates; N with the smallest second difference 2 entering identifiers corresponding to combinations of N reference block templates into a second candidate list, wherein the second candidate list includes N 2 a combination of reference blocks; The identifier corresponding to the combination of reference block templates is an identifier of a combination of reference blocks corresponding to the combination of reference block templates, and P≧N 2 , N 2 ≧1 or N 2 ≧2, 7. The method of claim 6.
8. The combination of reference blocks includes one first reference block and L-1 second reference blocks, and the L-1 second reference blocks are the L-1 reference blocks whose BVs are closest to the BV of the first reference block, and the distance between the two BVs is determined based on the distance between the positions indicated by the two BVs, where L is the number of reference blocks in the combination of reference blocks, and L≧2; or The combination of reference blocks includes one first reference block and L-1 second reference blocks, and the L-1 second reference blocks are reference blocks obtained by performing prediction on the current block based on a set intra prediction mode, where L≧2; The reference block corresponding to the P reference block templates is the first reference block.
8. The method according to claim 5 or 7.
9. The combination of reference blocks is identified by BVs of multiple reference blocks in the combination, or the combination of reference blocks is identified by BV of a first reference block in the combination plus a fusion flag.
9. The method of claim 8.
10. the searched reference block templates include a first reference block template and / or a second reference block template; the first reference block template is a template having the same shape and size as the current block template in a reconstruction area, the reconstruction area being a reconstruction area of an image in which the current block is located; the second reference block template is a template obtained by performing an affine transformation on a local region within the reconstruction region and has the same shape and size as the current block template, and the reference block corresponding to the second reference block template is a reference block obtained by performing an affine transformation on the local region, or the second reference block template is a template in the reconstruction region that has the same shape and size as the current block template after the affine transformation, and the reference block corresponding to the second reference block template is a block within the reconstruction region; The affine transformation includes one or more of a reflection, a rotation, and a scaling.
2. The method of claim 1 .
11. The size of the first search range is determined based on the size of the current block.
2. The method of claim 1 .
12. A first search distance in the width direction and a second search distance in the height direction of the first search range relative to a base point representing the position of the current block are A method of calculating the product of the width of the current block and a first scale factor, and setting the larger value of either this product or a set minimum search distance in the width direction as the first search distance, and calculating the product of the height of the current block and a second scale factor, and setting the larger value of either this product or a set minimum search distance in the height direction as the second search distance, wherein the first scale factor and the second scale factor are equal or unequal, or A method of determining the larger value of the width of the current block and the set minimum search distance in the width direction, and setting the first search distance to the product of the larger value and a first scale factor, and determining the larger value of the height of the current block and the set minimum search distance in the height direction, and setting the second search distance to the product of the larger value and a second scale factor, wherein the first scale factor and the second scale factor are equal or unequal, or the first search distance is determined by a method of multiplying a width of a current block by a corresponding first scale factor, where there are a plurality of first scale factors, and the larger the first scale factor, the larger the width of the corresponding current block; and the second search distance is determined by a method of multiplying a height of a current block by a corresponding second scale factor, where there are a plurality of second scale factors, and the larger the second scale factor, the larger the height of the corresponding current block.
12. The method of claim 11 .
13. A method for constructing a candidate list for intra template matching prediction, comprising: determining a first search range for intra template matching prediction (intraTMP) of the current block, the first search range being located within a reconstruction area of the current image; determining a set of BVs based on a first search step size and the first search range, where the positions indicated by the set of BVs are within the first search range; searching for a corresponding reference block template based on the set of BVs; and calculating a difference between the searched reference block template and a current block template; filling the candidate list with BVs corresponding to the N reference block templates with the smallest differences in ascending order of corresponding differences, where N is the length of the candidate list and N≧2; The reference block template has a one-to-one correspondence with the reference block, and the difference of the reference block template with respect to the current block template is determined based on SAD, SATD, or MSE between a reconstructed value of the reference block template and a reconstructed value of the current block template, and the BV of the reference block is used to indicate the position of the reference block with respect to the current block, and the BV corresponding to the reference block template is the BV of the reference block corresponding to the reference block template. A candidate list construction method for intra-template matching prediction.
14. the searched reference block templates include a first reference block template and / or a second reference block template; the first reference block template is a template having the same shape and size as the current block template in a reconstruction area, the reconstruction area being a reconstruction area of an image in which the current block is located; the second reference block template is a template obtained by performing an affine transformation on a local region within the reconstruction region and has the same shape and size as the current block template, and the reference block corresponding to the second reference block template is a reference block obtained by performing an affine transformation on the local region, or the second reference block template is a template in the reconstruction region that has the same shape and size as the current block template after the affine transformation, and the reference block corresponding to the second reference block template is a block within the reconstruction region; The affine transformation includes one or more of a reflection, a rotation, and a scaling.
14. The method of claim 13.
15. 1. A video decoding method comprising: decoding an intra template matching prediction intraTMP mode use flag of the current block; If it is determined that the current block uses the intraTMP mode based on the intraTMP mode usage flag, continuing to decode syntax elements of the intraTMP mode of the current block; constructing a candidate list of intraTMP, determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, and performing intra prediction on the current block based on the reference block or the combination of reference blocks to be used by the current block; Video decoding methods.
16. The candidate list is constructed by a method for constructing an intraTMP candidate list according to any one of claims 1 to 14.
16. The method of claim 15.
17. performing intra prediction on the current block based on a combination of reference blocks used by the current block, the step of using a reconstructed value obtained by combining a plurality of reference blocks in the combination of reference blocks as a predicted value of the current block, wherein the reconstructed value obtained by combining the plurality of reference blocks is equal to an average value or a weighted average value of the reconstructed values of the plurality of reference blocks; 16. The method of claim 15.
18. The candidate list is a first candidate list constructed by the method of claim 5 ; Continuing to decode syntax elements of the current block in intraTMP mode, and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: continuing to decode an intraTMP index, said intraTMP index being used to indicate the position in said candidate list of the reference block or combination of reference blocks used by the current block; determining a reference block or a combination of reference blocks to be used by the current block based on the intraTMP index and the first candidate list; 18. The method of claim 17.
19. The candidate list is constructed by a method according to claim 13 or 14, Continuing to decode syntax elements of the current block in intraTMP mode, and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: Continuing to decode an intraTMP fusion flag, the intraTMP fusion flag being used to indicate whether the current block uses a fusion scheme under intraTMP mode; If it is determined that the current block uses the merging scheme based on the intraTMP merging flag, skipping decoding of the intraTMP index and determining that the current block predicts using a reconstructed value obtained by merging the first Q reference blocks in the candidate list, where Q is a set number of merging, and Q≧2; If it is determined based on the intraTMP merging flag that the current block does not use the merging scheme, continuing to decode the intraTMP index and determining a reference block to be used by the current block based on the intraTMP index and the candidate list, wherein the intraTMP index is used to indicate a position in the candidate list of the reference block to be used by the current block.
16. The method of claim 15.
20. The candidate list is constructed by a method according to claim 13 or 14, Continuing to decode syntax elements of the current block in intraTMP mode, and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: continuing to decode the intraTMP index; If the intraTMP index is 0, a combination of reference blocks used by the current block is a combination of the first Q reference blocks in the candidate list, where Q is a set merging number, and Q≧2; determining a reference block to be used by the current block based on the intraTMP index and the candidate list when the intraTMP index indicates that the current block is located at a position other than the first position in the candidate list, wherein the intraTMP index is used to indicate the position in the candidate list of the reference block to be used by the current block; 16. The method of claim 15.
21. The candidate list comprises a first candidate list or a second candidate list, the first candidate list or the second candidate list being constructed by the method of claim 7; Continuing to decode syntax elements of the current block in intraTMP mode, and determining a reference block or a combination of reference blocks to be used by the current block based on the syntax elements and the candidate list, the step of: Continuing to decode the intraTMP fusion flag and the intraTMP index; determining a position in the first candidate list of a reference block to be used by the current block based on the first candidate list and the intraTMP index when determining that the current block does not use a multiple reference block merging method based on the intraTMP merging flag, wherein the intraTMP index is used to indicate a position in the first candidate list of a reference block to be used by the current block; and when it is determined that the current block uses a multiple reference block merging method based on an intraTMP merging flag, determining a position in the second candidate list of a combination of reference blocks to be used by the current block based on the second candidate list and the intraTMP index, wherein the intraTMP index is used to indicate a position in the second candidate list of a combination of reference blocks to be used by the current block.
16. The method of claim 15.
22. The method further includes the steps of decoding an intraTMP multiple candidate flag and determining whether to allow use of a multiple candidate intraTMP mode based on the intraTMP multiple candidate flag, wherein the intraTMP multiple candidate flag is a sequence level, picture level, or slice level flag; After determining that the current block uses the intraTMP mode based on the intraTMP mode use flag, the method: if it is determined based on the intraTMP multiple candidate flag that the use of the multi-candidate intraTMP mode is allowed, continue decoding the intraTMP index of the current block; If it is determined not to allow use of the multi-candidate intraTMP mode based on the intraTMP multi-candidate flag, skipping decoding of the intraTMP index of the current block and performing intra prediction on the current block according to the single-candidate intraTMP mode.
16. The method of claim 15.
23. The step of decoding the intraTMP index of the current block includes: or performing de-binarization of the intraTMP index by an analysis method corresponding to variable length coding, fixed length coding, truncated unary code, or truncated binary code; a step of analyzing the value of a first binary code in the intraTMP index, and if the value is one of 0 and 1, realizing de-binarization of the intraTMP index by an analysis method corresponding to variable length coding or truncated unary code, and if the value is the other of 0 and 1, realizing de-binarization of the intraTMP index by an analysis method corresponding to fixed length coding or truncated binary code; 23. The method according to any one of claims 18 to 22.
24. 1. A video encoding method comprising: If it is determined that the current block is allowed to use the multi-candidate intra template matching prediction intraTMP mode, constructing a candidate list of intraTMP according to the method of any one of claims 1 to 14; calculating coding costs for predicting the current block based on the reference blocks or combinations of reference blocks in the candidate list, and determining the smallest coding cost among the coding costs as the intraTMP mode coding cost of the multiple candidates and using it in rate-distortion optimization; If it is determined that the current block is to be intra-predicted using the intraTMP mode, encoding syntax elements related to the intraTMP mode of the current block; Video coding methods.
25. The candidate list is a first candidate list constructed by the method of claim 5 ; The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode usage flag of the current block to indicate that the current block uses intraTMP mode; and encoding an intraTMP index of the current block to indicate the position in the candidate list of the reference block or combination of reference blocks used by the current block.
25. The method of claim 24.
26. The candidate list is constructed by a method according to claim 13 or 14, The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses the intraTMP mode; Continuing to encode the intraTMP fusion flag to indicate whether the current block uses the fusion scheme under the intraTMP mode; If the intraTMP merging flag indicates that the current block does not use the merging scheme, continue encoding an intraTMP index to indicate the position in the candidate list of the reference block that the current block will use; If the intraTMP fusion flag indicates that the current block uses the fusion scheme, skipping the coding of the intraTMP index; The current block using the fusion scheme refers to performing intra prediction on the current block using a reconstructed value obtained by fusing the first Q reference blocks in the candidate list, where Q is a set number of fusions, and Q≧2.
25. The method of claim 24.
27. The candidate list is constructed by a method according to claim 13 or 14, The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses the intraTMP mode; encoding an intraTMP index, wherein the intraTMP index is 0 when it is determined to use a merging scheme under the current intraTMP mode, and the intraTMP index is used to indicate a position in the candidate list of a reference block to be used by the current block when it is determined to use a reference block currently in the candidate list; The current block uses the fusion scheme to perform intra prediction using a reconstructed value obtained by fusing the first Q reference blocks in the candidate list, where Q is a set number of fusions, and Q≧2.
25. The method of claim 24.
28. The candidate lists include a first candidate list and a second candidate list, the first candidate list and the second candidate list being constructed by the method of claim 7; The step of encoding syntax elements related to the intraTMP mode of the current block comprises: encoding an intraTMP mode use flag of the current block to indicate that the current block uses the intraTMP mode; and continuing to encode the intraTMP fusion flag and the intraTMP index; If the current block uses a reference block in the first candidate list, the intraTMP merging flag indicates that a multiple reference block merging method is not used, and the intraTMP index indicates a position in the first candidate list of the reference block used by the current block; When the current block uses a combination of reference blocks in the second candidate list, the intraTMP merging flag indicates that a multiple reference block merging method is used, and the intraTMP index indicates a position in the second candidate list of the combination of reference blocks used by the current block.
25. The method of claim 24.
29. The candidate list is constructed by a method according to claim 10 or 14, The step of encoding a syntax element related to the intraTMP mode of the current block further includes the step of encoding a syntax element related to a type of reference block template after encoding an intraTMP mode use flag of the current block, wherein the syntax element related to the type of reference block template is used to indicate whether or not it is permitted to obtain the reference block template using an affine transformation and / or to indicate the type of affine transformation to be used; The type of the affine transformation includes one or more of reflection, rotation, and scaling. The method according to any one of claims 25 to 28.
30. The step of encoding the intraTMP index of the current block comprises: or - realizing binarization of the intraTMP index by variable length coding, fixed length coding, truncated unary code or truncated binary code; When the value of the intraTMP index is in a first value range, the intraTMP index is binarized by variable length coding or truncated unary code, and when the value of the intraTMP index is in a second value range, the intraTMP index is binarized by fixed length coding or truncated binary code, wherein the value of the first value range is smaller than the value of the second value range. The method according to any one of claims 25 to 28.
31. The step of determining that the current block is allowed to use the multi-candidate intraTMP mode includes a step of determining that the current block is allowed to use the multi-candidate intraTMP mode if none of the conditions for disallowing the use of the multi-candidate intraTMP mode are met, wherein the conditions for disallowing the use of the multi-candidate intraTMP mode include a step of indicating that a sequence-level, picture-level, or slice-level intraTMP multi-candidate flag does not allow the use of the multi-candidate intraTMP mode.
25. The method of claim 24.
32. The method further includes the steps of: when intra prediction coding is performed on the current block according to a single candidate intraTMP mode, indicating that the current block uses the intraTMP mode by encoding an intraTMP mode usage flag of the current block; and indicating that the reference block used by the current block is at the first position in the candidate list by encoding an intraTMP index of the current block.
25. The method of claim 24.
33. a codestream, The codestream is generated according to a video coding method according to any one of claims 24 to 32.
1. A codestream characterized in that:
34. A candidate list construction device for intra template matching prediction, comprising: The candidate list construction method according to any one of claims 1 to 14 can be realized by including a processor and a memory in which a computer program is stored, when the processor executes the computer program. A candidate list construction device for intra-template matching prediction.
35. 1. A video decoding device, comprising: a processor and a memory storing a computer program, the processor being capable of implementing the video decoding method according to any one of claims 15 to 23 when executing the computer program; Video decoder.
36. 1. A video encoding device, comprising: The video encoding method according to any one of claims 24 to 32 can be implemented by including a processor and a memory in which a computer program is stored, when the processor executes the computer program. Video coding device.
37. 37. A video encoding apparatus according to claim 36 and a video decoding apparatus according to claim 35. Video encoding and decoding systems.
38. 1. A non-transitory computer-readable storage medium, comprising: The computer-readable storage medium stores a computer program, which, when executed by a processor, realizes the method according to any one of claims 1 to 32. A non-transitory computer-readable storage medium.
39. a computer program, which, when executed by a processor, enables the method according to any one of claims 1 to 32 to be realized; Computer program products.