Image encoding method, image decoding method, image processing apparatus, and storage medium
By determining matching reference blocks of multiple target templates and fusing them in video coding, the problem of inaccurate intra-frame prediction results is solved, coding efficiency is improved and extra transmission bits are reduced.
Patent Information
- Application Number
- PCT/CN2023/119773
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-14
- Filing Date
- 2023-09-19
- Publication Date
- 2024-10-17
AI Technical Summary
Existing intra-frame template matching prediction technology may not be able to find the best matching reference block or find multiple best-matching reference blocks in video coding, resulting in inaccurate intra-frame prediction results and affecting coding efficiency.
By obtaining the to-be-predicted coding block and the predicted coding block in the image frame, determining the matching reference blocks of multiple target templates in the reconstructed area, and fusing at least one matching reference block to obtain the predicted value of the to-be-predicted coding block, This improves the accuracy and efficiency of intra-frame prediction.
It improves the accuracy and efficiency of intra-frame prediction results and solves the problem that IntraTMP encoding tools cannot be applied to video content without adding too many extra transmission bits.
Smart Images

Figure CN2023119773_17102024_PF_FP_ABST
Abstract
Description
Image encoding method, image decoding method, image processing device, and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on the Chinese patent application with application number 202310420115.5 and application date April 14, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field
[0003] The embodiments of the present application relate to the field of image processing, and in particular to an image encoding method, an image decoding method, an image processing device, a computer-readable storage medium, and a computer program product. Background Art
[0004] With the continuous improvement of video quality and the continuous expansion of video application scenarios, the amount of data transmitted and stored in video has also greatly increased. In order to improve the transmission and storage efficiency of video, video coding technology has been proposed. That is, various coding tools are used to remove spatial and temporal redundant information in the original video as much as possible, effectively reducing the amount of video data while ensuring video quality.
[0005] In related technologies, intra-frame prediction technology is used to remove the spatial correlation of video images, that is, to use the pixel information of adjacent reconstructed blocks that have been encoded within the frame to predict the pixel value of the current coding block to be predicted. Among them, the intra-frame template matching prediction (IntraTMP, Intra Template Matching Prediction) technology uses a preset template to perform template matching within a set search area, that is, by searching for a matching template similar to the preset template, and using the corresponding block of the matching template as the prediction value of the current coding block to be predicted. However, in actual applications, the best matching reference block may not be found or multiple best matching reference blocks may be found, and the matching reference block found may not necessarily be the best matching reference block, which leads to inaccurate intra-frame prediction results. Therefore, how to improve the accuracy of intra-frame prediction results is a problem that needs to be solved urgently.
[0006] Summary of the Invention
[0007] Embodiments of the present application provide an image encoding method, an image decoding method, an image processing device, a computer-readable storage medium, and a computer program product.
[0008] In a first aspect, an embodiment of the present application provides an image coding method, comprising: obtaining a block to be predicted and a predicted coding block in an image frame, wherein the area corresponding to the predicted coding block is a reconstructed area; determining multiple target templates corresponding to the block to be predicted; determining a matching reference block corresponding to each of the target templates in the reconstructed area, and fusing at least one of the matching reference blocks to obtain a predicted value corresponding to the block to be predicted; obtaining a residual value based on the original value of the block to be predicted and the predicted value; encoding the residual value, and writing the coded bits into a bitstream.
[0009] In a second aspect, an embodiment of the present application provides an image decoding method, comprising: parsing a code stream to obtain a residual value corresponding to a to-be-predicted decoding block; determining, in a reconstructed area, a matching reference block corresponding to each target template based on multiple target templates, and fusing at least one of the matching reference blocks to obtain a predicted value corresponding to the to-be-predicted decoding block; wherein the area corresponding to the predicted decoding block is a reconstructed area; obtaining a decoding value corresponding to the to-be-predicted decoding block based on the predicted value of the to-be-predicted decoding block and the residual value; and obtaining a decoding recovery value of the to-be-predicted decoding block based on the decoding value.
[0010] In a third aspect, an embodiment of the present application provides an image processing device, comprising: at least one processor; at least one memory for storing at least one program; and when at least one of the programs is executed by at least one of the processors, an image encoding method as described in the first aspect, or an image decoding method as described in the second aspect, is implemented.
[0011] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to implement the image encoding method as described in the first aspect, or the image decoding method as described in the second aspect.
[0012] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program or computer instructions, wherein the computer program or the computer instructions are stored in a computer-readable storage medium, a processor of a computer device reads the computer program or the computer instructions from the computer-readable storage medium, and the processor executes the computer program or the computer instructions, so that the computer device performs the image encoding method as described in the first aspect, or the image decoding method as described in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] FIG1 is a block-based hybrid coding framework provided by this application;
[0014] FIG2 is a schematic diagram showing the principle of the IntraTMP technology provided by this application;
[0015] FIG3 is a schematic diagram of three templates in the IntraTMP technology provided by this application;
[0016] FIG4 is a schematic diagram of a video image transmission system architecture provided by an embodiment of the present application;
[0017] FIG5 is a flowchart of an image encoding method provided by an embodiment of the present application;
[0018] FIG6 is a flowchart of a method for determining a matching reference block corresponding to each target template provided by an embodiment of the present application;
[0019] FIG7 is a schematic diagram of the IntraTMP BV provided in an embodiment of the present application;
[0020] FIG8 is a flowchart of a method for determining a matching reference block corresponding to each target template provided by an embodiment of the present application;
[0021] FIG9 is a schematic diagram of the IntraTMP-fusion solution flow chart of the encoding end provided in the example of this application;
[0022] FIG10 is a schematic diagram of the fusion process of the multi-modal IntraTMP-fusion solution provided in the example of this application;
[0023] FIG11 is a template SAD of a position-dependent fusion solution provided in an example of this application;
[0024] FIG12 is a flowchart of an image decoding method provided by an embodiment of the present application;
[0025] FIG13 is a schematic diagram of the IntraTMP-fusion solution flow chart of the encoding end provided in the example of this application;
[0026] FIG14 is a schematic diagram of a grammatical structure provided by an example of this application;
[0027] FIG15 is a schematic diagram of a grammatical structure provided by an example of this application;
[0028] FIG16 is a schematic diagram of a grammatical structure provided by an example of this application; and
[0029] FIG17 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0031] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0032] In the embodiments of the present application, words such as "further," "exemplarily," or "optionally" are used to indicate examples, illustrations, or descriptions and should not be interpreted as being more preferred or advantageous over other embodiments or designs. The use of words such as "further," "exemplarily," or "optionally" is intended to present related concepts in a concrete manner.
[0033] Today's world is a multimedia society surrounded by images and videos. For example, advertising, healthcare, security, entertainment, and conference video are all ubiquitous, all of which involve media content such as images and videos. Simultaneously, with the improvement of video quality, the transition from HD to ultra-HD video such as 4K and 8K, the increase in various video types such as screen content and panoramic video, and the widespread use of network streaming and real-time communication, the amount of data required for video transmission or storage has increased significantly, placing higher demands on video transmission bandwidth. To improve video transmission and storage efficiency, it is necessary to reduce the amount of video data, hence the development of video compression technology. Video compression technology, also known as video coding technology, uses various coding tools to remove as much spatial and temporal redundant information as possible from the original video. This effectively reduces the amount of video data while maintaining video quality. Therefore, video coding technology is currently one of the hottest research areas in multimedia technology.
[0034] The Joint Video Expert Teams (JVET), comprised of the Moving Pictures Experts Group (MPEG) of the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC), and the Video Coding Experts Group (VCEG) of the International Telecommunication Union's Telecommunication Standardization Sector, ITU-T, released the Versatile Video Coding (H.266 / VVC) standard. This standard supports a variety of new video types, including 8K ultra-high definition, screen content, high dynamic range, and 360-degree panoramic video, as well as applications such as adaptive bandwidth and resolution streaming and real-time communication. The JVET has since continued its exploration of next-generation video coding standards, launching a follow-up to VVC, the Enhanced Compression Model (ECM).
[0035] The ECM standard adopts the coding framework of H.266 / VVC: a block-based hybrid coding framework. Figure 1 shows the block-based hybrid coding framework provided by this application. Referring to Figure 1, the hybrid coding framework mainly includes modules such as intra-frame prediction, inter-frame prediction, transform, quantization, entropy coding, and loop filtering. Each module covers a variety of new coding technologies. Therefore, the ECM standard requires a lot of memory, but compared with H.266 / VVC, it further improves the coding gain.
[0036] The following is a brief introduction to the various modules of the H.266 / VVC coding framework: the intra-frame prediction module mainly removes the spatial correlation of video images and uses the pixel information of adjacent reconstructed blocks that have been encoded within the frame to predict the pixel value of the current predicted coding block, with a low compression rate; the inter-frame prediction module mainly removes the temporal correlation of video images and uses the inter-frame encoded image as the reference image of the current frame to obtain the motion information of each block in the current frame. It can use unidirectional and bidirectional reference images for prediction, and generally speaking, the compression rate is higher than that of intra-frame prediction coding. After the video image passes through the intra-frame / inter-frame prediction module, the prediction value of the current block to be predicted is obtained. The residual data of the image block can be obtained by subtracting the original image block from the prediction block. Transforming the residual data can effectively remove the frequency domain correlation of the image. By transforming from the time domain described in pixel form to the frequency domain, the image energy is concentrated in the low-frequency area, that is, the correlation of the transformation coefficients is small; usually, the coefficients after transformation have a large dynamic range, and the quantization module is needed to reduce the dynamic range and achieve better compression; the entropy coding module encodes intra-frame prediction data, motion information, quantization coefficients, coding control and other data into a binary stream for storage or transmission, that is, the output data of the entropy coding is the compressed code stream of the original video.
[0037] Furthermore, the hybrid coding framework implements an image reconstruction process to build a decoded image cache for use as a reference image for inter-frame prediction. This process primarily involves dequantization, inverse transformation, and loop filtering. The quantized transform coefficients are dequantized and inverse transformed to obtain residual data, which is then added to the prediction information to reconstruct the image data. Because video coding is block-based, reconstructed images often exhibit blockiness and ringing artifacts. Therefore, the loop filtering module is necessary to improve subjective image quality and compression efficiency, minimizing decoding errors. The loop filtering module of H.266 / VVC mainly includes the following filtering technologies: Luma Mapping Chroma Scaling (LMCS), Deblocking Filter (DBF), Sample Adaptive Offset (SAO) and Adaptive Loop Filter (ALF). Luma mapping and chroma scaling redistribute codewords for information within the dynamic range, which can improve compression efficiency; deblocking filtering smoothes block boundaries, which can effectively reduce and remove block effects; sample adaptive offset uses different compensation values for different categories of reconstructed pixels, which can improve the ringing effect caused by high-frequency information loss and effectively improve the subjective and objective quality of the reconstructed image; adaptive loop filtering performs Wiener filtering on the reconstructed image pixels, which can effectively reduce decoding errors.
[0038] The overall framework process of the encoding end is as follows:
[0039] The input video frame (image) is divided into blocks: the frame is first divided into multiple Coding Tree Units (CTUs). Each CTU can be divided into four Coding Units (CUs) of equal size using a quadtree, or recursively divided into CUs of varying sizes using a binary or ternary tree structure using a Multiple Type Tree (MTT). A CTU contains all color channels, meaning a CTU consists of one luma CTB (Coding Tree Block) and two chroma CTBs. A CU is the basic unit of video coding, with a maximum luma CU size of 128*128 and a minimum of 4*4. A chroma CU has a maximum size of 64*64 and a minimum of 2*2. The size of the final coding unit (CU) depends on the video image content.
[0040] The intra / inter prediction mode decision determines whether the coding block is to be intra-frame prediction coded or inter-frame prediction coded. The main purpose of intra-frame prediction coding is to remove the spatial correlation of the image; the main purpose of inter-frame prediction coding is to remove the temporal correlation of the image.
[0041] The prediction block obtained by intra-frame / inter-frame coding is subtracted from the original coding block to obtain the residual data of the current coding block to be predicted. The residual data is transformed and quantized to remove frequency domain correlation, achieve lossy compression of image residual data, and further improve compression efficiency.
[0042] The quantized two-dimensional transform coefficients are Z-scanned and run-length encoded to obtain one-dimensional transform coefficients. Finally, the transform coefficients, coding control information, prediction data, motion vector data and other information are used as input to the entropy coding module and encoded into a binary stream, that is, the compressed code stream of the original video, for storage or transmission.
[0043] The quantized transform coefficients are dequantized and inversely transformed to obtain the residual data of the reconstructed block, which is then added to the predicted value obtained by intra-frame / inter-frame coding to obtain the reconstructed value of the coding block, thereby obtaining the reconstructed image.
[0044] The reconstructed image needs to be filtered through the loop filter module to obtain the final reconstructed image and build a decoded image cache as a reference image for inter-frame prediction.
[0045] In fact, the image reconstruction process of the hybrid coding framework is the image decoding process, which only adds a bitstream parsing step at the decoding end.
[0046] At the January 2021 JVET-U conference, Intra Template Matching Prediction (IntraTMP) technology was first proposed and incorporated into ECM 1.0 at the following conference. IntraTMP is a specialized intra-frame prediction coding tool initially applicable only to screen content coding (SCC). While it offered significant compression gains for natural sequences (Camera Captured Contents), its high complexity significantly impacted encoding timeliness. Subsequently, improvements to the template matching search process within IntraTMP significantly reduced its complexity, making the technology applicable to full-sequence content.
[0047] FIG2 is a schematic diagram of the principle of the IntraTMP technology provided by this application. As shown in FIG2, the upper area 220, the left area 230, and the upper left corner area 240 of the current block to be predicted 210 constitute an L-shape template. The encoder uses the L-shape template to perform template matching within the set search area (the reconstructed area of the current frame) to search for the template most similar to this template, that is, the Sum of Absolute Differences (SAD) between the current block to be predicted and the reference template is the smallest, and the corresponding block 250 of the searched similar template is used as the prediction value of the current block to be predicted. The pre-set search areas are R1, R2, R3, and R4 in FIG2. R1 is inside the CTU where the current block to be predicted is located, R2 to R4 are all outside the current CTU, and may include multiple CTUs, that is, R2 is located in the upper left area (Top-left) outside the current CTU, R3 is located in the upper area (Above) outside the current CTU, and R4 is located in the left area (Left) outside the current CTU.
[0048] If the intra-frame prediction mode of the current coding block to be predicted enables IntraTMP, the encoder needs to identify the syntax element tmp_enabled_flag of this coding tool and transmit it to the decoding end; the decoder will perform the same operation as the encoder: search for the template that is most similar to the L-shape template of the current coding block to be predicted in the predefined four areas (R1~R4), that is, the template with the smallest SAD, and use its corresponding block as the prediction of the current coding block to be predicted.
[0049] In the process of searching for the most similar L-shape template, that is, the template matching process, the four search areas set are a rough range, and the search width (SearchRange_w) and height (SearchRange_h) of each area are also limited. If the width and height of the current block to be predicted are (BlkW, BlkH) respectively, then the search width / height is 5 times the width / height of the current block to be predicted: (a=5) SearchRange_w=a*BlkW SearchRange_h=a*BlkH
[0050] The specific search process is carried out in two steps:
[0051] A coarse search is performed in the four regions R1 to R4, with a search step size, i.e., a downsampling factor of 2. After the coarse search is completed, the best "matching reference block" at that time, i.e., the corresponding block of the "most similar template" is obtained;
[0052] A fine search is performed around the best "matching reference block" obtained in the coarse search stage. The search range is min(BlkW, BlkH) / 2, and the search step is 1, that is, an integer pixel search. The best matching reference block finally obtained is used as the prediction of the current coding block to be predicted.
[0053] Currently, the templates used in IntraTMP technology include three shapes: L-shape, Above, and Left. The Above template has the same width as the current coding block to be predicted and the same height as the area above the L-shape template; the Left template has the same height as the current coding block to be predicted and the same width as the area to the left of the L-shape template. Figure 3 is a schematic diagram of the three IntraTMP modes provided by this application. As shown in Figure 3, three different template shapes result in three different IntraTMP modes: L-shape IntraTMP, Above IntraTMP, and Left IntraTMP. However, in the related art, only one template is ultimately selected to search for the best matching reference block, that is, the current coding block to be predicted only uses one IntraTMP mode, which may result in the searched best matching reference block not being the best. In addition, for some video content, the best matching reference block may not be found, or multiple best matching reference blocks may be found. However, the related art requires directly outputting a best matching reference block based on the template matching process, which results in the inability to output the searched best matching reference block, which in turn seriously affects the performance of the IntraTMP encoding tool.
[0054] Based on this, the embodiments of the present application provide an image encoding method, an image decoding method, an image processing device, a computer-readable storage medium, and a computer program product. The encoding end obtains a block to be predicted and a predicted block in an image frame, wherein the area corresponding to the predicted block is a reconstructed area, and then determines multiple target templates corresponding to the block to be predicted, and determines a matching reference block corresponding to each target template in the reconstructed area, and then fuses at least one matching reference block to obtain an intra-frame prediction value corresponding to the block to be predicted, and then obtains a residual value based on the original value of the block to be predicted and the intra-frame prediction value, and then encodes the residual value, and writes the coded bits into the code stream and sends it to the decoding end. Through the above-mentioned image encoding method, the accuracy of the intra-frame prediction result and the efficiency of the intra-frame prediction can be improved.
[0055] Figure 4 is a schematic diagram of the video image transmission system architecture provided by an embodiment of the present application. As shown in Figure 4, the video image transmission system includes an encoder 410 and a decoder 420. After obtaining a video image, the encoder 410 encodes the video image and then sends the bitstream to the decoder 420. After receiving the bitstream, the decoder 420 decodes the video image and displays it.
[0056] In the embodiments of the present application, the encoding end or decoding end may be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, an Internet of Things (IoT) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a user equipment (UE), an on-board communication device, an on-board communication chip, a roadside unit or a communication device in a roadside unit, etc. It may also be a wearable device / wearable smart device, such as a wristband, glasses, gloves, a watch, clothing, or other portable device integrated into the user's clothing or accessories.
[0057] In order to fully illustrate the present technical solution, the image encoding method of the embodiment of the present application is further described.
[0058] Figure 5 is a flow chart of an image encoding method provided in an embodiment of the present application. As shown in Figure 5, the image encoding method includes but is not limited to S100, S200, S300, S400, and S500. It should be noted that the embodiment of the present application does not strictly limit the following steps.
[0059] S100: Obtain a block to be predicted and a block that has been predicted in an image frame, wherein an area corresponding to the block that has been predicted is a reconstructed area.
[0060] In this step, after the original video is input into the hybrid coding framework of the encoding end, the image frame is divided into multiple CTUs. The size of the CTUs can be set according to actual needs, and then each CTU can be further divided into coding blocks CU according to needs or no longer divided. The coding blocks to be predicted and the predicted coding blocks in the image frame are obtained, where the predicted coding blocks are coding blocks that have completed prediction, and the corresponding area is the reconstructed area. The coding blocks to be predicted are coding blocks that have not completed prediction. The embodiment of the present application provides an intra-frame prediction method for the coding blocks to be predicted.
[0061] In one embodiment, a frame image is divided into CTUs of size 128*128, and then each CTU is divided into coding blocks (CUs) of size 64*64 according to a quadtree or multi-type tree recursive structure.
[0062] In another embodiment, a frame of image is divided into CTUs of size 128*128, and the CTU is no longer divided. That is, in this embodiment, the CU size is the same as the CTU size, both of which are 128*128.
[0063] It should be noted that the IntraTMP encoding tool has requirements for the CU size, that is, the width and height of the CU are both less than or equal to 64. Therefore, whether to further divide the CTU to obtain a smaller CU depends on the actual needs of the encoding tool.
[0064] S200: Determine multiple target templates corresponding to the to-be-predicted coding block.
[0065] In this step, it is first necessary to make an intra-frame or inter-frame prediction mode decision for the current block to be predicted. After it is determined that intra-frame prediction coding is adopted for the current block to be predicted, a coding tool for intra-frame prediction is further determined.
[0066] In one embodiment, it is determined that the IntraTMP coding tool is enabled for intra prediction of the current coding block to be predicted. The specific determination method is to judge whether the syntax element tmp_enabled_flag is marked as on. The latest ECM standard includes a variety of intra prediction tools, such as: Decoder Side Intra Mode Derivation (DIMD), Template-based Intra Mode Derivation Fusion (TIMD), Spatial Geometric Partitioning Mode (SGPM), Convolutional Cross-Component Intra Prediction Model (CCCM), etc. After determining that the IntraTMP coding tool is enabled for intra prediction of the current coding block to be predicted, the three shapes of target templates corresponding to the current coding block to be predicted can be determined, namely, L-shape template, Above template and Left template.
[0067] It should be noted that the embodiment of the present application uses target templates of three shapes as an example for illustration, but in actual use, target templates of other shapes may be used, or less than three or more than three target templates may be used for prediction at the same time. The embodiment of the present application does not impose any restrictions on this.
[0068] S300: determining a matching reference block corresponding to each target template in the reconstructed area, and fusing at least one matching reference block to obtain a prediction value corresponding to the block to be predicted.
[0069] In this step, the multiple target templates determined in step S200 are used to determine the matching reference blocks corresponding to each target template in the reconstructed area. Since there are multiple target templates, there are multiple matching reference blocks. The matching reference block can be understood as the best "matching reference block" corresponding to the target template. According to different requirements and definitions, the method for determining the best "matching reference block" may be different. After determining the matching reference block corresponding to each target template, it may also be necessary to screen these matching reference blocks to obtain matching reference blocks that meet the fusion conditions, and those matching reference blocks that do not meet the fusion conditions will be discarded. Then, these matching reference blocks that meet the fusion conditions are fused to obtain the intra-frame prediction value corresponding to the block to be predicted.
[0070] The following describes in detail how to determine the matching reference block corresponding to each target template. FIG6 is a flowchart of the method for determining the matching reference block corresponding to each target template provided in an embodiment of the present application. As shown in FIG6 , the method includes but is not limited to S310 and S320. It should be noted that the following steps are not strictly limited in this embodiment of the present application.
[0071] S310: Determine at least one reference template corresponding to each target template in the reconstructed area.
[0072] In this step, in the reconstructed area, each target template can generally find multiple corresponding reference templates, and there can be multiple search strategies for the reference templates.
[0073] S320: Determine a candidate reference block corresponding to each reference template.
[0074] In this step, after each reference template is searched, the similarity between the reference template and its target template is calculated. The similarity is used to screen which candidate reference blocks corresponding to the reference template are matching reference blocks.
[0075] S330: Determine a matching reference block for each target template based on the candidate reference blocks.
[0076] In this step, the candidate reference blocks obtained in step S320 are further screened to further determine the matching reference blocks.
[0077] It should be noted that the matching reference block corresponding to each target template finally obtained can be directly selected from the candidate reference blocks, or can be obtained by further processing the candidate reference blocks.
[0078] In one embodiment, a search with a determined step length is first performed in the reconstructed area to obtain a plurality of candidate reference blocks, and then the matching degrees of the candidate reference blocks are calculated, and one of them is selected as the matching reference block.
[0079] In another embodiment, the existing search strategy of IntraTMP is adopted, and a coarse search with a step size of 2 is first performed in the reconstructed area to preliminarily determine the intermediate process matching reference block corresponding to this coarse search process, and then a fine search with a step size of 1 is performed around the determined intermediate process matching reference block. At this time, the search area is limited to the minimum value of half the width or height of the current predicted coding block: min(BlkW,BlkH) / 2, and the final matching reference block, that is, the matching reference block corresponding to the target template, is determined.
[0080] In another embodiment, after determining the multiple candidate reference blocks corresponding to each target template, a candidate list corresponding to each target template is constructed based on these candidate reference blocks. The candidate list of each target template allows the presence of multiple candidate block vectors IntraTMP BVs, where IntraTMP BV is a vector of the matching reference block pointed to by the current coding block to be predicted. Figure 7 is a schematic diagram of the IntraTMP BV provided in an embodiment of the present application. As shown in Figure 7, different IntraTMP BVs correspond to different reference blocks, which means that each target template can search or save multiple candidate reference blocks. At the same time, the candidate IntraTMP BVs in each candidate list are arranged in ascending order according to the template SAD. Then, a rate-distortion decision is made on the candidate reference blocks pointed to by the block vector in each candidate list to determine the matching reference blocks corresponding to each target template.
[0081] It should be noted that the absolute error and SAD are measures of similarity between image blocks. They are calculated by taking the absolute difference between each pixel in the original block and the corresponding pixel in the block used for comparison. These differences are added to create a simple measure of block similarity, the L1 norm of the difference image or the Manhattan distance between two image blocks. The sum of absolute differences can be used for various purposes, such as object recognition, generation of disparity maps for stereo images, and motion estimation for video compression. In the embodiment of the present application, the use of calculating the SAD value to measure the similarity between blocks is only an exemplary illustration. In actual application scenarios, other measurement algorithms can also be used, such as the sum of squared differences (SSD) algorithm or the semi-global matching (SGM) algorithm, etc., and the embodiment of the present application is not limited here.
[0082] In another embodiment, after determining multiple candidate reference blocks corresponding to each target template, a candidate list corresponding to each target template is constructed based on these candidate reference blocks. The candidate list for each target template allows for multiple candidate block vectors IntraTMP BVs, where IntraTMP BV is a vector of a matching reference block pointed to by the current block to be predicted. The difference from the previous embodiment is that in this embodiment, the candidate reference blocks pointed to by the block vectors in each candidate list are first fused, and the resulting fused reference blocks are determined as the matching reference blocks corresponding to each target template.
[0083] After determining the matching reference blocks corresponding to each target template, these matching reference blocks need to be fused to obtain the intra-frame prediction value corresponding to the reference block to be predicted. Before fusion, matching reference blocks that meet the fusion conditions need to be selected, and these matching reference blocks that meet the fusion conditions are called reference blocks to be fused.
[0084] The following describes in detail how to determine the reference block to be fused.
[0085] In one embodiment, all matching reference blocks obtained by matching all target templates are the same. In this case, any matching reference block can be selected as the reference block to be fused. In other words, there is no need for fusion and traditional IntraTMP processing can be used.
[0086] In another embodiment, there are at least two different matching reference blocks. In this case, according to a preset algorithm, the degree of difference between the target templates corresponding to the at least two different matching reference blocks is determined, and according to the degree of difference, at least one matching reference block is selected as the reference block to be fused.
[0087] In a more specific embodiment, among the three matching reference blocks corresponding to the three target templates, two matching reference blocks are the same and the other is different. In order to compare the degree of difference between the target templates corresponding to the different matching reference blocks, the absolute error sum algorithm is used to measure the degree of difference. The specific process includes: determining the target templates corresponding to the two different matching reference blocks as the templates to be compared, and then determining the absolute error sums corresponding to the two templates to be compared respectively, and the degree of difference between the absolute error sums corresponding to the two templates to be compared is greater than a preset threshold. In this case, the two matching reference blocks are selected together as the reference blocks to be fused.
[0088] In a more specific embodiment, among the three matching reference blocks corresponding to the three target templates, two matching reference blocks are identical and the other is different. In order to compare the degree of difference between the target templates corresponding to the different matching reference blocks, an absolute error sum algorithm is used to measure the degree of difference. The specific process includes: determining the target templates corresponding to the two different matching reference blocks as the templates to be compared, and then determining the absolute error sums corresponding to the two templates to be compared respectively, and the degree of difference between the absolute error sums corresponding to the two templates to be compared is less than a preset threshold. In this case, a matching reference block is selected as the reference block to be fused. It can be understood that in actual application scenarios, the matching reference block corresponding to the template with a smaller SAD value is often selected as the reference block to be fused. That is, the matching reference block corresponding to the template with a larger SAD value is abandoned and does not participate in the fusion.
[0089] In a more specific embodiment, among the three matching reference blocks corresponding to the three target templates, the three matching reference blocks are different from each other. In order to compare the degree of difference between the target templates corresponding to the different matching reference blocks, the absolute error sum algorithm is used to measure the degree of difference. The specific process includes: among the target templates corresponding to all the different matching reference blocks, a reference template and the remaining multiple non-reference templates are determined, and then the absolute error sum corresponding to the reference template and each non-reference template is determined. Then, the absolute error sum corresponding to the reference template is compared with the absolute error sum corresponding to each non-reference template one by one, and it is found that the difference degree of the absolute error sum corresponding to the two is greater than a preset threshold. In this case, the matching reference blocks corresponding to the reference template and the non-reference template are used as reference blocks to be fused.
[0090] In a more specific embodiment, among the three matching reference blocks corresponding to the three target templates, the three matching reference blocks are different from each other. In order to compare the degree of difference between the target templates corresponding to the different matching reference blocks, the absolute error sum algorithm is used to measure the degree of difference. The specific process includes: among the target templates corresponding to all the different matching reference blocks, a reference template and the remaining multiple non-reference templates are determined, and then the absolute error sum corresponding to the reference template and each non-reference template is determined. Then, the absolute error sum corresponding to the reference template is compared with the absolute error sum corresponding to each non-reference template one by one, and it is found that the difference degree of the absolute error sum between the two is less than a preset threshold. In this case, only the matching reference block corresponding to the reference template is used as the reference block to be fused, that is, the matching reference block corresponding to the non-reference template is abandoned and does not participate in the fusion.
[0091] It can be understood that in the above embodiment, by screening out reference blocks to be fused that meet the fusion conditions, the number of matching reference blocks to be fused can be reduced in some cases, which can improve the overall fusion efficiency.
[0092] After determining the reference blocks to be fused, the fusion of the reference blocks can be started. The following describes in detail how to fuse these reference blocks to be fused. Figure 8 is a flowchart of the method for determining the matching reference blocks corresponding to each target template provided by an embodiment of the present application. As shown in Figure 8, the method includes but is not limited to S340 and S350. It should be noted that the embodiment of the present application does not strictly limit the following steps.
[0093] S340: Determine a target fusion weight corresponding to each target template according to the intra-frame template fusion weight.
[0094] In one embodiment, a fixed target fusion weight may be determined for each target template. For example, a predetermined preset target fusion weight may be set for each target template. The preset target fusion weight may be a common coefficient value, such as {22 / 64, 21 / 64, 21 / 64} corresponding to the three modes of L-shape, Above, and Left.
[0095] In another embodiment, the preset target fusion weight can be determined according to the number of samples included in the target template. The number of samples here can be understood as the number of pixels. For example, the target fusion weights corresponding to the three modes of L-shape, Above, and Left are: Where W represents the width of the L-shape template, that is, the width of the current coding block to be predicted or the Above template, and H represents the height of the L-shape template, that is, the height of the current coding block to be predicted or the Left template.
[0096] In another embodiment, the intra-frame template fusion weight can be determined based on the absolute error and the number of samples corresponding to the target template. The specific process includes: respectively determining the target absolute error and the target number of samples corresponding to each target template and each target template, and then normalizing the SAD corresponding to each target template according to the SAD of the target template and the target number of samples to obtain the normalized SAD corresponding to each target template, and then summing all normalized SADs to obtain the normalized absolute error sum, and then determining the target fusion weight corresponding to each target template according to the normalized SAD corresponding to each target template and the normalized absolute error sum. Among them, the normalized SAD corresponding to each target template can be obtained according to the ratio of the SAD of the target template to the target number of samples. It can be understood that normalizing the SAD of each target template can make the SAD value unaffected by the number of samples contained in the template, thereby ensuring the accuracy of the weight calculation.
[0097] In another embodiment, the intra-frame template fusion weight can be determined based on the positional relationship between the pixel to be predicted in the coding block to be predicted and the target template. The specific process includes: determining the target absolute error sum corresponding to each target template, and determining the weight base value corresponding to each target template based on the target absolute error sum, and then determining the target positional relationship between the pixel to be predicted and each target template, and determining the weight relative value corresponding to each target template based on the target positional relationship, and then determining the target fusion weight corresponding to each target template based on the weight base value and the weight relative value.
[0098] S350: performing weighted calculation on the reference blocks to be fused corresponding to all target templates according to the target fusion weight corresponding to each target template, and obtaining an intra-frame prediction value corresponding to the block to be predicted.
[0099] In this step, the target fusion weight corresponding to each target template obtained in step 330 is weightedly calculated with the matching reference block to obtain the intra-frame prediction value corresponding to the block to be predicted.
[0100] S400: Obtain a residual value according to the original value and the predicted value of the block to be predicted.
[0101] S500: Encode the residual value and write the encoded bits into the bitstream.
[0102] Steps S400 and S500 are not the key points of the embodiment of the present application, and therefore will not be described in detail.
[0103] According to the image coding method provided in the embodiments of the present application, when the encoder transmits the indication information for intra-frame template fusion, there are two main scenarios: one is implicit fusion, which does not require the transmission of the block-level intra-frame template fusion indicator to the decoder; the other is non-implicit fusion, which requires the transmission of the block-level intra-frame template fusion indicator to the decoder. The following describes in detail the two methods of indicating fusion.
[0104] The following first explains implicit fusion:
[0105] In one embodiment, when determining the matching reference block, a method is adopted in which one is directly selected from a plurality of candidate reference blocks as the matching reference block corresponding to the target template. The encoding end does not need to transmit any information to the decoding end, and the decoding end can automatically use the same method to determine the matching reference block, thereby completing decoding.
[0106] In one embodiment, when determining the matching reference block, a candidate list corresponding to each target template is constructed, and the candidate reference block pointed to by the block vector in the list is re-decided to determine the matching reference block. The encoding end can transmit the block vector index value to the decoding end, and the decoding end can determine the matching reference block based on this block vector index value, thereby completing decoding.
[0107] In one embodiment, when determining the matching reference block, a method is adopted to construct a candidate list corresponding to each target template, and fuse the candidate reference blocks pointed to by the block vector in each candidate list to determine the matching reference block. The encoding end can transmit the intra-frame template reference block vector fusion identifier to the decoding end, and the decoding end can determine whether to enable the fusion of the candidate reference blocks based on this intra-frame template reference block vector fusion identifier, thereby completing the decoding.
[0108] The image coding method using implicit fusion provided in the above embodiment can save transmission bits to a certain extent.
[0109] The following first explains non-implicit fusion:
[0110] In one embodiment, when determining a matching reference block, a method is adopted in which one is directly selected from a plurality of candidate reference blocks as a matching reference block corresponding to a target template. The encoder instructs the decoder to perform decoding by transmitting a high-level syntax element fusion flag and a block-level intra-frame template fusion flag. The specific process includes: the encoder sets both the high-level syntax element fusion flag and the block-level intra-frame template fusion flag to an on state. When the decoder receives and parses the high-level syntax element fusion flag, it first determines whether the high-level syntax element fusion flag is in an on state, and when the high-level syntax element fusion flag is in an on state, it continues to check whether the block-level intra-frame template fusion flag is in an on state. If the block-level intra-frame template fusion flag is in an on state, the matching reference block is determined and fused in the same manner as the encoder, thereby completing decoding.
[0111] In one embodiment, when determining a matching reference block, a method is adopted of constructing a candidate list corresponding to each target template and re-deciding the matching reference block for the candidate reference block pointed to by the block vector in the list. The encoding end instructs the decoding end to perform decoding by transmitting a high-level syntax element fusion flag, a block-level intra-frame template fusion flag and a block vector index value. The specific process includes: the encoding end sets both the high-level syntax element fusion flag and the block-level intra-frame template fusion flag to an on state. When the decoding end receives and parses the high-level syntax element fusion flag, it first determines whether the high-level syntax element fusion flag is on, and when the high-level syntax element fusion flag is on, it continues to check whether the block-level intra-frame template fusion flag is on. If the block-level intra-frame template fusion flag is on, the matching reference block is determined and fused according to the block vector index value, thereby completing decoding.
[0112] In one embodiment, when determining a matching reference block, a method is adopted in which a candidate list corresponding to each target template is constructed and candidate reference blocks pointed to by block vectors in each candidate list are fused to determine the matching reference block. The encoder instructs the decoder to perform decoding by transmitting a high-level syntax element fusion flag, a block-level intra-frame template fusion flag, and an intra-frame template reference block vector fusion flag. The specific process includes: the encoder sets both the high-level syntax element fusion flag and the block-level intra-frame template fusion flag to an on state. When the decoder receives and parses the high-level syntax element fusion flag, it first determines whether the high-level syntax element fusion flag is on. If the high-level syntax element fusion flag is on, it continues to check whether the block-level intra-frame template fusion flag is on. If the block-level intra-frame template fusion flag is on, it continues to check whether the intra-frame template reference block vector fusion flag is on. If the intra-frame template reference block vector fusion flag is on, the decoder first fuses the candidate reference blocks to obtain a matching reference block, and then fuses the matching reference block to complete decoding.
[0113] The image encoding method provided by the embodiment of the present application can improve the accuracy of IntraTMP prediction, solve the problem that the IntraTMP encoding tool cannot be applied to certain video content, and does not increase too many additional transmission bits.
[0114] In order to further illustrate the image encoding method provided in the embodiments of the present application, the following examples are used for detailed description.
[0115] Example 1
[0116] This example details the entire image encoding process at the image encoding end, and this process is used for encoding in subsequent examples.
[0117] FIG9 is a flow chart of the IntraTMP-fusion solution provided by the example of this application. As shown in the figure, the IntraTMP-fusion process of the encoding end includes steps S910-S970. Specifically:
[0118] S910: Input a video image and divide it into coding blocks.
[0119] When the original video is input into the hybrid coding framework, a frame is first divided into 128*128 CTUs. Each CTU is then recursively divided into coding blocks (CUs) using a quadtree or multi-type tree structure. Alternatively, no further division is required, meaning the CU size remains the same as the CTU. However, there are two important points to note: First, quadtree division cannot be performed after recursive multi-type tree division; second, the IntraTMP encoding tool has a CU size requirement: both the width and height of the CU must be less than or equal to 64; otherwise, IntraTMP cannot be enabled.
[0120] S920: Determine whether to enable the IntraTMP coding tool for intra-frame prediction of the current block to be predicted and coded.
[0121] Perform an intra / inter prediction mode decision on the current block to be predicted, and determine whether the current block to be predicted uses intra or inter prediction. If the current block to be predicted uses intra prediction, further determine the coding tool for intra prediction. The latest ECM standard includes a variety of intra prediction tools, such as: Decoder Side Intra Mode Derivation (DIMD), Template-based Intra Mode Derivation Fusion (TIMD), Spatial Geometric Partitioning Mode (SGPM), Convolutional Cross-Component Intra Prediction Model (CCCM), etc. Determine whether the IntraTMP tool is enabled for the current block to be predicted, that is, whether the syntax element tmp_enabled_flag is marked as on.
[0122] Steps S930, S940, and S950 are parallel steps. That is, in practice, only one of these methods is used to determine the matching reference block. However, those skilled in the art will appreciate that simultaneously using two or three of these methods is also within the scope of the present invention.
[0123] Step S930: Activate the multi-mode IntraTMP-fusion method and determine matching reference blocks of different templates respectively using a conventional search strategy.
[0124] Step S940: Activate the multi-mode multi-candidate IntraTMP-fusion method 1, and use a candidate item in each template candidate list to determine matching reference blocks of different templates.
[0125] Step S950: activating the multi-mode multi-candidate IntraTMP-fusion method 2, and determining matching reference blocks of different templates respectively by fusing the candidates in each template candidate list.
[0126] Step S960: Fusing the matching reference blocks of different modes in a selected fusion manner to obtain a final matching reference block as a prediction value of the current block to be predicted.
[0127] Step S970: Transmitting syntax elements related to the enabled IntraTMP-fusion method to the decoding end.
[0128] Example 2
[0129] This example elaborates on an intra-frame prediction method in the image coding process, and calls this intra-frame prediction method a multi-mode IntraTMP-fusion method. In summary, this method first searches for the best "matching reference block" of each of the three IntraTMP modes with different shape templates: L-shape, Above, and Left. Then, the three best "matching reference blocks" are fused in a certain optimal fusion method to obtain the final matching reference block as the prediction of the current coding block to be predicted, thereby improving the accuracy of the prediction.
[0130] The specific implementation process is as follows:
[0131] Step 1: Input video image and divide it into coding blocks CU.
[0132] Step 2: Determine whether the IntraTMP coding tool is enabled for intra-frame prediction of the current block to be predicted and coded.
[0133] Step 3: Enable the multi-mode IntraTMP-fusion method for the current block to be predicted and use the conventional search strategy to determine the best “matching reference block” corresponding to different modes.
[0134] After the multi-mode IntraTMP-fusion method is enabled for the current block to be predicted, the best "matching reference blocks" corresponding to the three templates of L-shape, Above and Left are searched respectively. If the best "matching reference block" of a certain mode is not available, the matching reference block is discarded.
[0135] The search strategy is consistent with the traditional IntraTMP, that is, a coarse search with a step size of 2 is first performed in the four search areas R1 to R4 to preliminarily determine the best matching reference block at this time, and then a fine search with a step size of 1 is performed around the determined best matching reference block to determine the best "matching reference block". At this time, the search area is limited to the minimum value of half the width or height of the current predicted coding block: min(BlkW,BlkH) / 2.
[0136] Step 4: Fuse the best matching reference blocks of different modes in a certain optimal fusion method to obtain the final matching reference block as the prediction of the current coding block to be predicted;
[0137] Before fusing the best "matching reference blocks" from different modes, it is necessary to determine whether the matching reference blocks meet the fusion conditions. There are mainly three situations:
[0138] (1) If these matching reference blocks are the same, no fusion is required and they are processed according to the traditional IntraTMP method;
[0139] (2) If there are two identical blocks and one different block among these matching reference blocks, it is necessary to compare the template SAD of the two different matching reference blocks. If the ratio of the two is greater than a certain threshold, the two matching reference blocks meet the fusion condition; otherwise, no fusion is required, and one of the matching reference blocks is selected and processed according to the traditional IntraTMP method.
[0140] (3) If these matching reference blocks are different, that is, all three matching reference blocks are different, then the reference block corresponding to the L-shape IntraTMP template is assumed to meet the fusion condition. Then, the SAD of the Above template is compared with the SAD of the upper area of the L-shape template. If the ratio of the two is greater than a certain threshold, the reference block corresponding to the Above template meets the fusion condition. Otherwise, no fusion is required. The SAD of the Left template is compared with the SAD of the left area of the L-shape template. If the ratio of the two is greater than a certain threshold, the reference block corresponding to the Left template meets the fusion condition. Otherwise, no fusion is required.
[0141] The best matching reference blocks that meet the fusion criteria are fused together using a specific fusion method to obtain the final matching reference block, which is the prediction of the current block to be predicted. There are various fusion methods available, such as those based on predefined fixed weights, template matching SAD, and position dependency.
[0142] The fusion process of the best “matching reference blocks” from different modes can be expressed by the following formula:
[0143] Among them, n represents the number of best matching reference blocks for fusion, which can be 2 or 3, indicating the best "matching reference blocks" corresponding to different IntraTMP modes (the default is L-shape, Above and Left IntraTMP), w i represents the weight coefficient of the best matching reference block in the corresponding mode, as shown in Figure 10.
[0144] Step 5: Transmit syntax elements related to the multi-mode IntraTMP-fusion method to the decoding end.
[0145] The identifier of the multi-mode IntraTMP-fusion method is intra_tmp_template_fusion_flag, which is located at the CU level. If this identifier is 1, the multi-mode IntraTMP-fusion method is enabled, otherwise the traditional IntraTMP is enabled.
[0146] In addition, an additional high-level syntax element fusion_enabled can be added to any one or more of the video parameter set (VPS), sequence parameter set (SPS), picture parameter set (PPS), adaptive parameter set (APS) or SEI (Supplemental enhancement information) to control whether fusion is enabled. For example, if the sps_fusion_enabled fusion flag is added to the SPS, it can be determined whether fusion is turned on at the sequence level. If sps_fusion_enabled is 0, fusion is prohibited for all coding blocks of this sequence, and there is no need to further determine the CU-level flag. If sps_fusion_enabled is 1, it is necessary to enable fusion for each coding block based on the CU-level flag intra_tmp_template_fusion_flag.
[0147] These syntax elements need to be transmitted to the decoding end in the code stream. After receiving the relevant identifier, the decoding end can determine whether to enable the multi-mode IntraTMP-fusion method and complete the correct decoding process according to the same operation as the encoding end.
[0148] Example 3:
[0149] This example details another intra-frame prediction method for image coding, termed the multi-mode, multi-candidate IntraTMP-fusion method 1. In summary, candidate lists are first constructed for each of the three IntraTMP modes (L-shape, Above, and Left). Each mode's candidate list allows for multiple candidate IntraTMP BVs, where an IntraTMP BV is a vector pointing from the current block to be predicted to the best matching reference block. (Referring to Figure 7, different IntraTMP BVs correspond to different reference blocks, meaning each mode can search for or store multiple matching reference blocks.) The candidate IntraTMP BVs in each candidate list are sorted in ascending order by template SAD. Then, the best IntraTMP BV is selected from each candidate list for each mode and identified by its index in the candidate list. This yields the best "matching reference block" for each of the three modes. Finally, the best "matching reference blocks" from the different modes are fused using a specific fusion method to obtain the final matching reference block, which serves as the prediction for the current block to be predicted.
[0150] Step 1: Input video image and divide it into coding blocks CU.
[0151] Step 2: Determine whether the IntraTMP coding tool is enabled for intra-frame prediction of the current block to be predicted and coded.
[0152] Step 3: Enable the multi-mode multi-candidate IntraTMP-fusion method 1 for the current block to be predicted and build candidate lists of different modes respectively.
[0153] After determining that the IntraTMP coding tool has been enabled for the current block to be predicted, the multi-mode multi-candidate IntraTMP-fusion method 1 is used for the current block to be predicted. Candidate lists under the three templates of L-shape, Above, and Left are constructed respectively. The search strategy used in constructing the candidate list is consistent with the traditional IntraTMP. The specific process is as follows:
[0154] First, a coarse search with a step size of 2 is performed in the four search areas R1 to R4 shown in Figure 2. The template SAD between the reference block and the current block to be predicted is calculated and sorted in ascending order. At the end of the search, the first 25 reference blocks with the smallest template SAD are preliminarily determined and represented as IntraTMP BVs. Then, a fine search with a step size of 1 is performed on each of the reference blocks pointed to by the 25 IntraTMP BVs. The template SAD between the reference block and the current block to be predicted is also calculated and sorted in ascending order. The first 10 IntraTMP BVs are selected to form a candidate list. The reference blocks pointed to by these 10 IntraTMP BVs are the multiple candidate matching reference blocks for the corresponding mode. It should be noted that when selecting the first 10 IntraTMP BVs, if the reference block pointed to by an IntraTMP BV is unavailable, this IntraTMP BV should be discarded and a supplementary IntraTMP BV should be added from the subsequent BVs.
[0155] Step 4: According to the reference block RDO decision pointed by the candidate BVs, select a best IntraTMP BV from the candidate list of different modes respectively to determine the best matching reference block of the corresponding mode.
[0156] After building the candidate lists in different modes, it is necessary to perform RDO decisions on the reference blocks pointed to by these 10 IntraTMP BVs, select one of the best IntraTMP BVs, and use the reference block it points to as the best "matching reference block" for the corresponding mode; at the same time, it is necessary to transmit the index intra_tmp_template_candidates1_idx of the best IntraTMP BV in the candidate list in the bitstream to identify the selected best IntraTMP BV, so that the decoding end can select the same IntraTMP BV to complete decoding.
[0157] Step 5: The best matching reference blocks are fused in a certain optimal fusion method as the prediction of the current block to be predicted.
[0158] Before fusing the best "matching reference blocks" of different modes, it is also necessary to determine whether these matching reference blocks meet the fusion conditions. There are mainly three situations, which are the same as step 4 of Example 2 and will not be repeated here.
[0159] These matching reference blocks are fused in some optimal fusion method, and the final matching reference block obtained is used as the prediction of the current coding block to be predicted. Please refer to the implementation methods of Examples 5, 6, and 7 below. There are also many options for fusion methods, which will not be repeated here.
[0160] Step 6: Transmit syntax elements related to the multi-mode multi-candidate IntraTMP-fusion method 1 to the decoding end.
[0161] The multi-mode multi-candidate IntraTMP-fusion method 1 involves the following syntax elements: mode identifier intra_tmp_template_candidates1_fusion_flag and index identifier of the best IntraTMP BV in different mode candidate lists: intra_tmp_template_candidates1_LA_idx, intra_tmp_template_candidates1_A_idx and intra_tmp_template_candidates1_L_idx. The mode identifier and index identifier are both at the CU level. If the mode identifier is 1, the multi-mode multi-candidate IntraTMP-fusion method 1 is enabled, otherwise the traditional IntraTMP is enabled; the index identifier is to allow the decoding end to determine the best "matching reference block" for different modes.
[0162] In addition, an additional high-level syntax element fusion_enabled may be added to any one or more of VPS, SPS, PPS, APS or SEI to control whether fusion is enabled, refer to step 5 of Example 2.
[0163] These syntax elements need to be transmitted in the bitstream. After receiving the relevant identifier, the decoding end can determine whether to enable the multi-mode multi-candidate IntraTMP-fusion method 1. If enabled, the best "matching reference block" of different modes is first determined based on the three index identifiers, and then the correct decoding process is completed according to the same operation as the encoding end.
[0164] Example 4:
[0165] This example elaborates on another intra-frame prediction method in the image coding process, and calls this intra-frame prediction method multi-mode multi-candidate IntraTMP-fusion method 2. In summary, first, candidate lists are constructed for the three IntraTMP modes (L-shape, Above and Left). The candidate list of each mode allows multiple candidate IntraTMP BVs, and the candidate IntraTMP BVs in each candidate list are arranged in ascending order according to the template SAD; then, the reference blocks pointed to by multiple IntraTMP BVs in the same candidate list are fused, and the fused reference block is used as the best "matching reference block" of the corresponding mode; finally, the best "matching reference blocks" of different modes are fused in a certain optimal fusion method to obtain the final matching reference block as the prediction of the current coding block to be predicted.
[0166] Step 1: Input video image and divide it into coding blocks CU.
[0167] Step 2: Determine whether the IntraTMP coding tool is enabled for intra-frame prediction of the current block to be predicted and coded.
[0168] Step 3: Enable the multi-mode multi-candidate IntraTMP-fusion method 2 for the current block to be predicted and build candidate lists under different modes respectively.
[0169] The candidate list is constructed in the same way as step 3 of the multi-mode multi-candidate IntraTMP-fusion method 1. The only difference is that in the fine search stage, only the first five IntraTMP BVs are selected to construct the candidate list. The reference blocks pointed to by these five IntraTMP BVs are the multiple candidate matching reference blocks in the corresponding mode.
[0170] Step 4: Fuse the reference blocks pointed to by the IntraTMP BVs of different mode candidate lists to determine the best matching reference block for the corresponding mode.
[0171] The reference blocks pointed to by the five IntraTMP BVs in the candidate lists of different modes are fused separately, and the results are used as the best “matching reference blocks” of the corresponding modes.
[0172] Step 5: In a certain optimal fusion method, the best matching reference blocks are fused to obtain a final matching reference block as the prediction of the current coding block to be predicted.
[0173] Before fusing the best "matching reference blocks" of different modes, it is also necessary to determine whether these matching reference blocks meet the fusion conditions. There are mainly three situations, which are the same as step 4 of Example 2 and will not be repeated here.
[0174] These matching reference blocks are fused in some optimal fusion method, and the final matching reference block obtained is used as the prediction of the current coding block to be predicted. Please refer to the implementation methods of Examples 5, 6, and 7 below. There are also many options for fusion methods, which will not be repeated here.
[0175] Step 6: Transmit syntax elements related to the multi-mode multi-candidate IntraTMP-fusion method 2 to the decoding end.
[0176] The multi-mode multi-candidate IntraTMP-fusion method 2 involves the following syntax elements: mode identifier intra_tmp_template_candidates2_fusion_flag and the fusion identifier of the candidate IntraTMP BVs intra_tmp_template_bv_fusion_flag. The mode identifier and the candidate fusion identifier are both at the CU level. If the mode identifier is 1, the multi-mode multi-candidate IntraTMP-fusion method 2 is enabled, otherwise the traditional IntraTMP is enabled; the candidate fusion identifier is used to instruct the decoding end to fuse the mode candidates and determine the best "matching reference block" for different modes.
[0177] In addition, an additional high-level syntax element fusion_enabled may be added to any one or more of VPS, SPS, PPS, APS or SEI to control whether fusion is enabled, refer to step 5 of Example 2.
[0178] These syntax elements need to be transmitted in the bitstream. After receiving the relevant identifier, the decoder can determine whether to enable the multi-mode multi-candidate IntraTMP-fusion method 2. If enabled, the candidate list is constructed according to the same operation as the encoder, and the candidate items are fused to the reference blocks, and the best "matching reference blocks" in different modes are fused to complete the correct decoding process.
[0179] Example 5:
[0180] This example details the process of determining the weight corresponding to each target template in the intra-frame prediction method.
[0181] In this example, fixed-weight-based fusion is to fuse the best matching reference blocks in the three modes according to predefined fixed weights, and finally obtain the best matching reference block for predicting the current coding block to be predicted. The fixed-weight method does not require tedious weight calculations and can greatly reduce complexity.
[0182] There are two ways to set fixed weights:
[0183] The fixed weight is determined based on the number of reference samples of the template. The weights corresponding to the three modes of L-shape, Above, and Left are: Where W represents the width of the L-shape template, that is, the width of the current coding block to be predicted or the Above template, and H represents the height of the L-shape template, that is, the height of the current coding block to be predicted or the Left template;
[0184] Use common coefficient values as fixed weights. For example, the weights corresponding to the three modes L-shape, Above, and Left are {22 / 64, 21 / 64, 21 / 64}.
[0185] Example 6:
[0186] This example details the process of determining the weight corresponding to each target template in the intra-frame prediction method.
[0187] In this example, the fusion based on template matching SAD determines the weight according to the template SAD of the three templates (L-shape, Above, Left) between the current coding block to be predicted and the reference block in the search area. Let the SAD of L-shape IntraTMP be expressed as Sad_LA, the SAD of Above IntraTMP be expressed as Sad_A, and the SAD of Left IntraTMP be expressed as Sad_L. The number of template samples of the three modes are expressed as n_LA, n_A and n_L respectively. Then, the template SAD of the three modes are normalized based on the number of their respective reference samples. Because the number of template samples will affect the SAD value, the normalization process is as follows: SAD1=Sad_LA / n_LA SAD2=Sad_A / n_A SAD3=Sad_L / n_L
[0188] After normalization, the weight of each template can be determined by the following formula:
[0189] Where n represents the number of best matching reference blocks used for fusion, which can be 2 or 3. It represents the normalized template SAD under different modes and represents the weight coefficient under the corresponding mode. In addition, the calculation of weights involves division operations. In order to reduce complexity, a table lookup method is used instead of division operations.
[0190] Example 7:
[0191] This example details the process of determining the weight corresponding to each target template in the intra-frame prediction method.
[0192] In this example, position-dependent fusion takes into account the influence of the distance between the predicted pixel position and the template. If a predicted pixel is closer to the area above the current block to be predicted, that is, closer to the Above template, the weight coefficient of the reference block corresponding to the Above template needs to be assigned a larger coefficient value, and the weight coefficient of the area above the L-shape template needs to be reduced accordingly, which means that the predicted pixel is more dependent on the Above template. Conversely, if the predicted pixel is farther from the area above the current block to be predicted, the weight coefficient of the reference block corresponding to the Above template needs to be assigned a smaller coefficient value, and the weight coefficient of the area above the L-shape template needs to be increased. Similarly, if the predicted pixel is closer to the left of the current block to be predicted, that is, closer to the Left template, the weight coefficient of the reference block corresponding to the Left template needs to be assigned a larger coefficient value, and the weight coefficient of the area to the left of the L-shape template needs to be reduced accordingly. Conversely, if the predicted pixel is farther from the left of the current block to be predicted, the weight coefficient of the reference block corresponding to the Left template needs to be assigned a smaller coefficient value, and the weight coefficient of the area to the left of the L-shape template needs to be increased.
[0193] It should be noted that the position of the predicted pixel is two-dimensional, that is, it includes the horizontal position (x, that is, the position from the left boundary of the current coding block to be predicted) and the vertical position (y, that is, the position from the upper boundary of the current coding block to be predicted). This means that for a certain predicted pixel, it is necessary to consider the influence of vertical distance and horizontal distance on the weight at the same time, that is, it is necessary to discuss the degree to which the predicted pixel depends on the Above template and the Left template respectively, determine the corresponding weight coefficients of different templates of L-shape, Above and Left, and finally select the best fusion method to realize the fusion of reference blocks corresponding to different modes (usually three modes) as the prediction of the current coding block to be predicted.
[0194] The specific steps are as follows:
[0195] Step 1: Determine the template SAD of different modes (usually three modes: L-shape, Above, and Left IntraTMP);
[0196] When searching for the best "matching reference block" for different IntraTMP modes, the SAD between the reference matching reference block template of each mode and the current template of the coding block to be predicted can be obtained, as shown in Figure 11. Let a0 represent the template SAD of the upper area of the L-shape IntraTMP mode, b0 represent the template SAD of the left area of the L-shape IntraTMP mode, a1 represent the template SAD of the Above IntraTMP mode, and b1 represent the template SAD of the Left IntraTMP mode.
[0197] First, according to the SAD of the templates in different modes above, the basic weight values of the L-shape, Above, and Left templates are obtained as the weight base values based on location-dependent fusion:
[0198] Step 2: Determine the weight values corresponding to different modes based on the predicted pixel positions;
[0199] If the predicted pixel position is (x, y), where x represents the distance between the pixel position and the left edge of the current block to be predicted, that is, the distance from the Left template area, and y represents the distance between the pixel position and the upper edge of the current block to be predicted, that is, the distance from the Above template area, then the weights depending on the L-shape, Above, and Left templates are:
[0200] Where BlkH and BlkW represent the height and width of the current block to be predicted, respectively, and Δi is a predefined range related to the deviation of the basic weight value and the position-dependent weight part, such as: w LAbase and w LAloc The larger the Δi value is, the greater the weight of the current block to be predicted depends on the position.
[0201] Considering that different IntraTMP modes are affected by the basic weight, the position-dependent weights of the three different modes (L-shape, Above, and Left IntraTMP modes) are:
[0202] Step 3: Calculate the fusion of reference blocks in different modes and corresponding weight coefficient values as the prediction of the current block to be predicted.
[0203] The reference blocks corresponding to the three modes and the corresponding weight coefficient values are fused to achieve the prediction of the current coding block to be predicted: fusion =w LA *p L-shape +w A *p Above +w L *p Left
[0204] In the aforementioned embodiments of the present application, the image encoding process performed by the encoding end is described. Correspondingly, in the following embodiments of the present application, the image decoding process performed by the decoding end will be described.
[0205] Figure 12 is a flow chart of an image decoding method provided in an embodiment of the present application. As shown in Figure 12, the image encoding method includes but is not limited to S600, S700, S800, and S900. It should be noted that the embodiment of the present application does not strictly limit the following steps.
[0206] S600: Parse the code stream to obtain a residual value corresponding to the to-be-predicted decoding block.
[0207] In this step, the decoder reads the bitstream (bitstream), processes the Network Abstraction Layer (NAL), reads the Network Abstraction Layer Unit (NALU), and checks whether the NALU is normal. If it is normal, it means that a new frame of image has been input into the bitstream and the new image needs to be decoded; otherwise, it means that no new image has been input. When a new image to be decoded is read, the residual value used for image reconstruction can be obtained. The process of obtaining the residual value is not the focus of this application, so it will not be described here.
[0208] The decoder performs loop filtering and a series of deconstruction operations on the decoded frame, and performs different types of decoding according to different NAL types; when the decoder decodes a frame of picture, it first traverses the slice and then traverses each CTU. Each CTU needs to be divided to obtain coding blocks CUs. Before decoding each CU, it is necessary to check whether the current CU is in Skip mode, palette mode, intra-frame or inter-frame prediction mode; after determining that the current CU uses intra-frame prediction mode, check whether the CU-level flag of the traditional IntraTMP mode is enabled. After determining that the current CU enables the traditional IntraTMP mode, that is, tmp_enabled_flag = 1; then check which IntraTMP-fusion method is enabled for the current CU, which can be determined by the relevant syntax elements of the method. After determining that the IntraTMP coding tool is enabled for the intra-frame prediction of the current coding block to be predicted, the three shapes of target templates corresponding to the current coding block to be predicted can be determined, namely L-shape template, Above template and Left template.
[0209] It should be noted that the embodiment of the present application uses target templates of three shapes as an example for illustration, but in actual use, target templates of other shapes may be used, or less than three or more than three target templates may be used for prediction at the same time. The embodiment of the present application does not impose any restrictions on this.
[0210] S700: Determine a matching reference block corresponding to each template in the reconstructed area based on multiple target templates, and fuse at least one reference block to obtain a predicted value corresponding to the predicted decoding block; wherein the area corresponding to the predicted decoding block is the reconstructed area.
[0211] In this step, the matching reference blocks corresponding to each target template are determined in the reconstructed area using the determined multiple target templates. Since there are multiple target templates, there are multiple matching reference blocks. The matching reference block can be understood as the best "matching reference block" corresponding to the target template. According to different requirements and definitions, the method for determining the best "matching reference block" may be different. After determining the matching reference block corresponding to each target template, it may also be necessary to screen these matching reference blocks to obtain matching reference blocks that meet the fusion conditions, and those matching reference blocks that do not meet the fusion conditions will be discarded. Then, these matching reference blocks that meet the fusion conditions are fused to obtain the intra-frame prediction value corresponding to the block to be predicted.
[0212] It should be noted that the process of determining the matching reference block and the process of fusing the matching reference blocks at the decoding end are the same as those at the encoding end. Therefore, the following embodiment is used for a brief description.
[0213] First, in the reconstructed area, each target template can generally find multiple corresponding reference templates, and there are various search strategies for reference templates. Then, after searching for each reference template, the similarity between the reference template and its target template is calculated. The similarity is used to screen which candidate reference blocks corresponding to the reference template are matching reference blocks. Finally, by further screening the candidate reference blocks, a matching reference block is determined for each target template. It should be noted that the matching reference block corresponding to each target template can be directly selected from the candidate reference blocks, or it can be obtained after further processing of the candidate reference blocks.
[0214] In one embodiment, a search with a determined step length is first performed in the reconstructed area to obtain a plurality of candidate reference blocks, and then the matching degrees of the candidate reference blocks are calculated, and one of them is selected as the matching reference block.
[0215] In another embodiment, the existing search strategy of IntraTMP is adopted, and a coarse search with a step size of 2 is first performed in the reconstructed area to preliminarily determine the intermediate process matching reference block corresponding to this coarse search process, and then a fine search with a step size of 1 is performed around the determined intermediate process matching reference block. At this time, the search area is limited to the minimum value of half the width or height of the current predicted coding block: min(BlkW,BlkH) / 2, and the final matching reference block, that is, the matching reference block corresponding to the target template, is determined.
[0216] In another embodiment, after determining multiple candidate reference blocks corresponding to each target template, a candidate list corresponding to each target template is constructed based on these candidate reference blocks. Each target template's candidate list allows for multiple candidate block vectors, IntraTMP BVs (BVs), where the IntraTMP BV is a vector of the matching reference block pointed to by the current block to be predicted. Different IntraTMP BVs correspond to different reference blocks, meaning that each target template can search for or store multiple candidate reference blocks. The candidate IntraTMP BVs in each candidate list are sorted in ascending order by the template SAD. A rate-distortion decision is then performed on the candidate reference blocks pointed to by the block vectors in each candidate list to determine the matching reference block corresponding to each target template.
[0217] It should be noted that the absolute error and SAD are measures of similarity between image blocks. They are calculated by taking the absolute difference between each pixel in the original block and the corresponding pixel in the block used for comparison. These differences are added to create a simple measure of block similarity, the L1 norm of the difference image or the Manhattan distance between two image blocks. The sum of absolute differences can be used for various purposes, such as object recognition, generation of disparity maps for stereo images, and motion estimation for video compression. In the embodiment of the present application, the use of calculating the SAD value to measure the similarity between blocks is only an exemplary illustration. In actual application scenarios, other measurement algorithms can also be used, such as the sum of squared differences (SSD) algorithm or the semi-global matching (SGM) algorithm, etc., and the embodiment of the present application is not limited here.
[0218] In another embodiment, after determining multiple candidate reference blocks corresponding to each target template, a candidate list corresponding to each target template is constructed based on these candidate reference blocks. The candidate list for each target template allows for multiple candidate block vectors IntraTMP BVs, where IntraTMP BV is the vector of the matching reference block pointed to by the current block to be predicted. The difference from the previous embodiment is that in this embodiment, the candidate reference blocks pointed to by the block vectors in each candidate list are first fused, and the fused reference blocks are determined as the matching reference blocks corresponding to each target template.
[0219] After determining the matching reference blocks corresponding to each target template, these matching reference blocks need to be fused to obtain the intra-frame prediction value corresponding to the reference block to be predicted. Before fusion, matching reference blocks that meet the fusion conditions need to be selected, and these matching reference blocks that meet the fusion conditions are called reference blocks to be fused.
[0220] The following describes in detail how to determine the reference block to be fused.
[0221] In one embodiment, all matching reference blocks obtained by matching all target templates are the same. In this case, any matching reference block can be selected as the reference block to be fused. In other words, there is no need for fusion and traditional IntraTMP processing can be used.
[0222] In another embodiment, there are at least two different matching reference blocks. In this case, according to a preset algorithm, the degree of difference between the target templates corresponding to the at least two different matching reference blocks is determined, and according to the degree of difference, at least one matching reference block is selected as the reference block to be fused.
[0223] In a more specific embodiment, among the three matching reference blocks corresponding to the three target templates, two matching reference blocks are the same and the other is different. In order to compare the degree of difference between the target templates corresponding to the different matching reference blocks, the absolute error sum algorithm is used to measure the degree of difference. The specific process includes: determining the target templates corresponding to the two different matching reference blocks as the templates to be compared, and then determining the absolute error sums corresponding to the two templates to be compared respectively, and the degree of difference between the absolute error sums corresponding to the two templates to be compared is greater than a preset threshold. In this case, the two matching reference blocks are selected together as the reference blocks to be fused.
[0224] In a more specific embodiment, among the three matching reference blocks corresponding to the three target templates, two matching reference blocks are identical and the other is different. In order to compare the degree of difference between the target templates corresponding to the different matching reference blocks, an absolute error sum algorithm is used to measure the degree of difference. The specific process includes: determining the target templates corresponding to the two different matching reference blocks as the templates to be compared, and then determining the absolute error sums corresponding to the two templates to be compared respectively, and the degree of difference between the absolute error sums corresponding to the two templates to be compared is less than a preset threshold. In this case, a matching reference block is selected as the reference block to be fused. It can be understood that in actual application scenarios, the matching reference block corresponding to the template with a smaller SAD value is often selected as the reference block to be fused. That is, the matching reference block corresponding to the template with a larger SAD value is abandoned and does not participate in the fusion.
[0225] In a more specific embodiment, among the three matching reference blocks corresponding to the three target templates, the three matching reference blocks are different from each other. In order to compare the degree of difference between the target templates corresponding to the different matching reference blocks, the absolute error sum algorithm is used to measure the degree of difference. The specific process includes: among the target templates corresponding to all the different matching reference blocks, a reference template and the remaining multiple non-reference templates are determined, and then the absolute error sum corresponding to the reference template and each non-reference template is determined. Then, the absolute error sum corresponding to the reference template is compared with the absolute error sum corresponding to each non-reference template one by one, and it is found that the difference degree of the absolute error sum corresponding to the two is greater than a preset threshold. In this case, the matching reference blocks corresponding to the reference template and the non-reference template are used as reference blocks to be fused.
[0226] In a more specific embodiment, among the three matching reference blocks corresponding to the three target templates, the three matching reference blocks are different from each other. In order to compare the degree of difference between the target templates corresponding to the different matching reference blocks, the absolute error sum algorithm is used to measure the degree of difference. The specific process includes: among the target templates corresponding to all the different matching reference blocks, a reference template and the remaining multiple non-reference templates are determined, and then the absolute error sum corresponding to the reference template and each non-reference template is determined. Then, the absolute error sum corresponding to the reference template is compared with the absolute error sum corresponding to each non-reference template one by one, and it is found that the difference degree of the absolute error sum between the two is less than a preset threshold. In this case, only the matching reference block corresponding to the reference template is used as the reference block to be fused, that is, the matching reference block corresponding to the non-reference template is abandoned and does not participate in the fusion.
[0227] It can be understood that in the above embodiment, by screening out reference blocks to be fused that meet the fusion conditions, the number of matching reference blocks to be fused can be reduced in some cases, which can improve the overall fusion efficiency.
[0228] After determining the reference blocks to be fused, the fusion of the reference blocks can be started. The following describes in detail how to fuse these reference blocks to be fused.
[0229] First, the target fusion weight corresponding to each target template is determined according to the intra-frame template fusion weight.
[0230] In one embodiment, a fixed target fusion weight may be determined for each target template. For example, a predetermined preset target fusion weight may be set for each target template. The preset target fusion weight may be a common coefficient value, such as {22 / 64, 21 / 64, 21 / 64} corresponding to the three modes of L-shape, Above, and Left.
[0231] In another embodiment, the preset target fusion weight can be determined according to the number of samples included in the target template. The number of samples here can be understood as the number of pixels. For example, the target fusion weights corresponding to the three modes of L-shape, Above, and Left are: Where W represents the width of the L-shape template, that is, the width of the current decoding block to be predicted or the Above template, and H represents the height of the L-shape template, that is, the height of the current decoding block to be predicted or the Left template.
[0232] In another embodiment, the intra-frame template fusion weight can be determined based on the absolute error and the number of samples corresponding to the target template. The specific process includes: respectively determining the target absolute error and the target number of samples corresponding to each target template and each target template, and then normalizing the SAD corresponding to each target template according to the SAD of the target template and the target number of samples to obtain the normalized SAD corresponding to each target template, and then summing all normalized SADs to obtain the normalized absolute error sum, and then determining the target fusion weight corresponding to each target template according to the normalized SAD corresponding to each target template and the normalized absolute error sum. Among them, the normalized SAD corresponding to each target template can be obtained according to the ratio of the SAD of the target template to the target number of samples. It can be understood that normalizing the SAD of each target template can make the SAD value unaffected by the number of samples contained in the template, thereby ensuring the accuracy of the weight calculation.
[0233] In another embodiment, the intra-frame template fusion weight can be determined based on the positional relationship between the pixel to be predicted in the decoding block to be predicted and the target template. The specific process includes: determining the target absolute error sum corresponding to each target template, and determining the weight base value corresponding to each target template based on the target absolute error sum, and then determining the target positional relationship between the pixel to be predicted and each target template, and determining the weight relative value corresponding to each target template based on the target positional relationship, and then determining the target fusion weight corresponding to each target template based on the weight base value and the weight relative value.
[0234] Next, according to the target fusion weight corresponding to each target template, a weighted calculation is performed on the reference blocks to be fused corresponding to all target templates to obtain the intra-frame prediction value corresponding to the decoded block to be predicted.
[0235] S800: Obtaining a decoding value corresponding to a decoding block to be predicted according to a prediction value and a residual value of a reference block to be predicted.
[0236] S900: Obtain a decoding recovery value of a to-be-predicted decoding block according to the decoding value.
[0237] Steps S800 and S900 are not the key points of the embodiment of the present application, and therefore will not be described in detail.
[0238] According to the image coding method provided in the embodiments of the present application, when the encoder transmits the indication information for intra-frame template fusion, there are two main scenarios: one is implicit fusion, that is, no block-level intra-frame template fusion indicator is transmitted to the decoder; the other is to transmit the block-level intra-frame template fusion indicator to the decoder. The following describes in detail the two methods of indicating fusion.
[0239] The following first explains implicit fusion:
[0240] In one embodiment, when determining the matching reference block, a method is adopted in which one is directly selected from a plurality of candidate reference blocks as the matching reference block corresponding to the target template. The encoding end does not need to transmit any information to the decoding end, and the decoding end can automatically use the same method to determine the matching reference block, thereby completing decoding.
[0241] In one embodiment, when determining the matching reference block, a candidate list corresponding to each target template is constructed, and the candidate reference block pointed to by the block vector in the list is re-decided to determine the matching reference block. The encoding end can transmit the block vector index value to the decoding end, and the decoding end can determine the matching reference block based on this block vector index value, thereby completing decoding.
[0242] In one embodiment, when determining the matching reference block, a method is adopted to construct a candidate list corresponding to each target template, and fuse the candidate reference blocks pointed to by the block vector in each candidate list to determine the matching reference block. The encoding end can transmit the intra-frame template reference block vector fusion identifier to the decoding end, and the decoding end can determine whether to enable the fusion of the candidate reference blocks based on this intra-frame template reference block vector fusion identifier, thereby completing the decoding.
[0243] The image coding method using implicit fusion provided in the above embodiment can save transmission bits to a certain extent.
[0244] The following first explains non-implicit fusion:
[0245] In one embodiment, when determining a matching reference block, a method is adopted in which one is directly selected from a plurality of candidate reference blocks as a matching reference block corresponding to a target template. The encoder instructs the decoder to perform decoding by transmitting a high-level syntax element fusion flag and a block-level intra-frame template fusion flag. The specific process includes: the encoder sets both the high-level syntax element fusion flag and the block-level intra-frame template fusion flag to an on state. When the decoder receives and parses the high-level syntax element fusion flag, it first determines whether the high-level syntax element fusion flag is in an on state, and when the high-level syntax element fusion flag is in an on state, it continues to check whether the block-level intra-frame template fusion flag is in an on state. If the block-level intra-frame template fusion flag is in an on state, the matching reference block is determined and fused in the same manner as the encoder, thereby completing decoding.
[0246] In one embodiment, when determining a matching reference block, a method is adopted of constructing a candidate list corresponding to each target template and re-deciding the matching reference block for the candidate reference block pointed to by the block vector in the list. The encoding end instructs the decoding end to perform decoding by transmitting a high-level syntax element fusion flag, a block-level intra-frame template fusion flag and a block vector index value. The specific process includes: the encoding end sets both the high-level syntax element fusion flag and the block-level intra-frame template fusion flag to an on state. When the decoding end receives and parses the high-level syntax element fusion flag, it first determines whether the high-level syntax element fusion flag is on, and when the high-level syntax element fusion flag is on, it continues to check whether the block-level intra-frame template fusion flag is on. If the block-level intra-frame template fusion flag is on, the matching reference block is determined and fused according to the block vector index value, thereby completing decoding.
[0247] In one embodiment, when determining a matching reference block, a method is adopted in which a candidate list corresponding to each target template is constructed and candidate reference blocks pointed to by block vectors in each candidate list are fused to determine the matching reference block. The encoder instructs the decoder to perform decoding by transmitting a high-level syntax element fusion flag, a block-level intra-frame template fusion flag, and an intra-frame template reference block vector fusion flag. The specific process includes: the encoder sets both the high-level syntax element fusion flag and the block-level intra-frame template fusion flag to an on state. When the decoder receives and parses the high-level syntax element fusion flag, it first determines whether the high-level syntax element fusion flag is on. If the high-level syntax element fusion flag is on, it continues to check whether the block-level intra-frame template fusion flag is on. If the block-level intra-frame template fusion flag is on, it continues to check whether the intra-frame template reference block vector fusion flag is on. If the intra-frame template reference block vector fusion flag is on, the decoder first fuses the candidate reference blocks to obtain a matching reference block, and then fuses the matching reference block to complete decoding.
[0248] The image decoding method provided by the embodiment of the present application can improve the accuracy of IntraTMP prediction, solve the problem that the IntraTMP encoding tool cannot be applied to certain video content, and does not increase too many additional transmission bits.
[0249] Example 8
[0250] This example describes in detail the entire process of image decoding at the image decoding end, and this process is used for decoding in subsequent examples.
[0251] FIG13 is a schematic diagram of the IntraTMP-fusion solution flow at the encoding end provided by the example of this application. As shown in the figure, the IntraTMP-fusion process at the encoding end includes steps S1310-S1350. Specifically:
[0252] S1310: Parse the code stream and determine the IntraTMP-fusion decoding type of the current block to be predicted and decoded.
[0253] In this step, the decoder reads the bitstream (bitstream), processes the Network Abstraction Layer (NAL), reads the Network Abstraction Layer Unit (NALU), and checks whether the NALU is normal. If it is normal, it means that a new frame of image has been input into the bitstream and the new image needs to be decoded; otherwise, it means that no new image has been input. When a new image to be decoded is read, the residual value used for image reconstruction can be obtained. The process of obtaining the residual value is not the focus of this application, so it will not be described here.
[0254] The decoder performs loop filtering and a series of deconstruction operations on the decoded frame, and performs different types of decoding according to different NAL types; when the decoder decodes a frame of picture, it first traverses the slice and then traverses each CTU. Each CTU needs to be divided to obtain coding blocks CUs. Before decoding each CU, it is necessary to check whether the current CU is in Skip mode, palette mode, intra-frame or inter-frame prediction mode; after determining that the current CU uses intra-frame prediction mode, check whether the CU-level flag of the traditional IntraTMP mode is enabled. After determining that the current CU enables the traditional IntraTMP mode, that is, tmp_enabled_flag = 1; then check which IntraTMP-fusion method is enabled for the current CU, which can be determined by the relevant syntax elements of the method. After determining that the IntraTMP coding tool is enabled for the intra-frame prediction of the current coding block to be predicted, the three shapes of target templates corresponding to the current coding block to be predicted can be determined, namely L-shape template, Above template and Left template.
[0255] It should be noted that the embodiment of the present application uses target templates of three shapes as an example for illustration, but in actual use, target templates of other shapes may be used, or less than three or more than three target templates may be used for prediction at the same time. The embodiment of the present application does not impose any restrictions on this.
[0256] S1320: Multi-mode IntraTMP-fusion method: Use conventional search strategies to determine matching reference blocks corresponding to different modes.
[0257] S1330: Multi-mode multi-candidate IntraTMP-fusion method 1: Determine the matching reference block of the corresponding mode by the candidate index identifiers of different modes.
[0258] S1340: Multi-mode multi-candidate IntraTMP-fusior method 2: Fuse candidates from different modes and determine matching reference blocks of corresponding modes.
[0259] Steps S1320, S1330, and S1340 are parallel steps. That is, in actual applications, only one of these methods is used to determine the matching reference block. However, those skilled in the art will appreciate that simultaneously using two or three of these methods is also within the scope of the present invention.
[0260] S1350: Fusing matching reference blocks of different modes in a fusion manner at the encoding end to serve as prediction values of the current decoding block to be predicted.
[0261] The fusion method at the decoding end can refer to the embodiment of the encoding end in this application, so it will not be described in detail here.
[0262] Example 9
[0263] This example provides an intra-frame prediction method for a video decoding process, which is the decoding process of the multi-mode IntraTMP-fusion method of Example 2, and describes the syntax elements in the bitstream related to the method.
[0264] The decoder first determines whether there are high-level syntax elements in the bitstream, indicating whether fusion is enabled for the current sequence or image; if the high-level syntax elements are enabled, it further checks whether the CU-level flag of the multi-mode IntraTMP-fusion method is enabled. The multi-mode IntraTMP-fusion method is considered to be a subset of the traditional IntraTMP mode, that is, only when the traditional IntraTMP is enabled for the current predicted decoding block is it determined whether the multi-mode IntraTMP-fusion is enabled. The syntax structure is shown in Figure 14.
[0265] Semantic explanation:
[0266] intra_tmp_template_fusion_flag: equal to 1 indicates that the current coding block enables the multi-mode IntraTMP-fusion method; equal to 0 indicates that the current coding block does not enable the multi-mode IntraTMP-fusion method.
[0267] The decoding end uses the same search method as the encoding end to derive the prediction block. The specific implementation process is as follows:
[0268] Step 2: Use conventional search strategies to determine the best matching reference blocks corresponding to different modes.
[0269] When the CU identifier intra_tmp_template_fusion_flag is 1, decoding is performed according to the multi-mode IntraTMP-fusion method. The search strategy refers to step 3 of Example 2. Otherwise, decoding is performed according to the traditional IntraTMP mode.
[0270] Step 3: The best matching reference blocks of different modes are fused in the encoding end fusion method to determine the prediction of the current decoding block.
[0271] The check before fusion is the same as that at the encoding end. It is also necessary to determine whether the three best "matching reference blocks" meet the fusion conditions. Refer to step 4 of Example 2. The fusion method at the decoding end is determined according to the fusion method selected by the encoding end.
[0272] Example 10
[0273] This embodiment provides an intra-frame prediction method for a video decoding process, which is the decoding process of the multi-mode multi-candidate IntraTMP-fusion method 1 in Example 3, and describes the syntax elements related to the method in the bitstream.
[0274] The decoder first determines whether there are high-level syntax elements in the bitstream, indicating whether fusion is enabled for the current sequence or image. If the high-level syntax elements are enabled, the decoder further checks whether the CU-level flag of the multi-mode multi-candidate IntraTMP-fusion method 1 is enabled. The multi-mode multi-candidate IntraTMP-fusion method 1 is considered to be a subset of the traditional IntraTMP mode. That is, only when the traditional IntraTMP is enabled for the current predicted decoding block is the decision made whether the multi-mode multi-candidate IntraTMP-fusion method 1 is enabled. After determining that it is enabled, the best "matching reference block" pointed to by each mode is determined based on the index identifier of the best IntraTMP BV in the candidate list of different modes. The syntax structure is shown in Figure 15:
[0275] Semantic explanation:
[0276] intra_tmp_template_candidates1_fusion_flag: equal to 1 indicates that the current coding block enables multi-mode multi-candidate IntraTMP-fusion method 1, and equal to 0 indicates that the current coding block does not enable this method.
[0277] intra_tmp_template_candidates1_LA_idx: indicates the best IntraTMP BV index value of the current coding block in the L-shape IntraTMP mode candidate list.
[0278] intra_tmp_template_candidates1_A_idx: indicates the best IntraTMP BV index value of the current coding block in the Above IntraTMP mode candidate list.
[0279] intra_tmp_template_candidates1_L_idx: indicates the best IntraTMP BV index value of the current coding block in the Left IntraTMP mode candidate list.
[0280] The decoding end uses the same implementation operation as the encoding end to derive the prediction block. The specific implementation process is as follows:
[0281] Step 2: Construct a candidate list for each mode respectively, and determine the best matching reference block of different modes based on the candidate index identifier of each mode.
[0282] When the CU identifier intra_tmp_template_candidates1_fusion_flag is 1, decoding is completed according to the multi-mode multi-candidate IntraTMP-fusion method 1. First, a candidate list is constructed. The construction process refers to step 3 of the multi-mode multi-candidate IntraTMP-fusion method 1 in Example 3; otherwise, decoding is performed according to the traditional IntraTMP mode.
[0283] The reference block pointed to by the best IntraTMP BV index identifier in each mode candidate list determines the best "matching reference block" of the corresponding mode.
[0284] Step 3: The best matching reference blocks of different modes are fused in the encoding end fusion method to determine the prediction of the current decoding block.
[0285] The check before fusion is the same as that at the encoding end. It is also necessary to determine whether the three best "matching reference blocks" meet the fusion conditions. Refer to step 4 of Example 2. The fusion method at the decoding end is determined according to the fusion method selected by the encoding end.
[0286] Example 11
[0287] This embodiment provides an intra-frame prediction method for a video decoding process, which is the decoding process of the multi-mode multi-candidate IntraTMP-fusion method 2 in Example 4, and describes the syntax elements related to the method in the bitstream.
[0288] The decoder first determines whether there are high-level syntax elements in the bitstream, indicating whether fusion is enabled for the current sequence or image. If the high-level syntax elements are enabled, the decoder further checks whether the CU-level flag of the multi-mode multi-candidate IntraTMP-fusion method 2 is enabled. The multi-mode multi-candidate IntraTMP-fusion method 2 is considered to be a subset of the traditional IntraTMP mode. That is, only when the traditional IntraTMP is enabled for the current predicted decoding block is the decision made whether the multi-mode multi-candidate IntraTMP-fusion method 2 is enabled. After it is determined to be enabled, the best "matching reference block" of different modes is determined according to the fusion flag of the candidate IntraTMP BVs. The syntax structure is shown in Figure 16:
[0289] Semantics:
[0290] intra_tmp_template_candidates2_fusion_flag: equal to 1 indicates that the current coding block enables multi-mode multi-candidate IntraTMP-fusion method 2, and equal to 0 indicates that the current coding block does not enable this method.
[0291] intra_tmp_template_bv_fusion_flag: equal to 1 indicates that the current coding block needs to fuse the candidate IntraTMP BVs in the multi-mode candidate list as the best "matching reference block" of the corresponding mode; equal to 0 indicates that the current coding block does not need to fuse the candidate IntraTMP BVs.
[0292] The decoding end uses the same implementation operation as the encoding end to derive the prediction block. The specific implementation process is as follows:
[0293] Step 2: Build candidate lists for each mode respectively, fuse the reference blocks pointed to by candidates of different modes, and determine the best matching reference blocks of different modes.
[0294] When the CU identifier intra_tmp_template_candidates2_fusion_flag is 1, decoding is completed according to the multi-mode multi-candidate IntraTMP-fusion method 2. First, a candidate list is constructed. The construction process refers to step 3 of the multi-mode multi-candidate IntraTMP-fusion method 2 in Example 4; otherwise, decoding is performed according to the traditional IntraTMP mode.
[0295] The candidate IntraTMP BVs fusion flag intra_tmp_template_bv_fusion_flag determines whether the current CU needs to fuse the candidates in the multi-mode candidate list to obtain the best "matching reference block" of the corresponding mode.
[0296] Step 3: The best matching reference blocks from different modes are fused using the encoding-side fusion method to determine the prediction of the current decoding block.
[0297] The check before fusion is the same as that at the encoding end. It is also necessary to determine whether the three best "matching reference blocks" meet the fusion conditions. Refer to step 4 of Example 2. The fusion method at the decoding end is determined according to the fusion method selected by the encoding end.
[0298] FIG17 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. As shown in FIG17 , the image processing device includes a processor 1710 and a memory 1720. The number of processors 1710 and memory 1720 can be one or more. FIG17 uses one processor 1710 and one memory 1720 as an example. The processor 1710 and memory 1720 in the device can be connected via a bus or other means. FIG17 uses a bus connection as an example.
[0299] An embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions for executing the image encoding method provided in the encoding end embodiment of the present application, or the image decoding method provided in the decoding end embodiment of the present application.
[0300] An embodiment of the present application also provides a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, so that the computer device executes the image encoding method provided in the encoding-end embodiment of the present application, or the image decoding method provided in the decoding-end embodiment of the present application.
[0301] The system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of the system architecture and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
[0302] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0303] In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0304] As used in this specification, the terms "component," "module," "system," and the like are used to refer to computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, or a computer. By way of illustration, both applications running on a computing device and a computing device can be components. One or more components can reside in a process or execution thread, and a component can be located on one computer or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can communicate, for example, through local or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component on a local system, a distributed system, or a network, such as the Internet interacting with other systems via signals).
[0305] The above description of some embodiments of the present application with reference to the accompanying drawings does not limit the scope of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present application shall be within the scope of the present application.
Claims
1. An image encoding method, comprising: Acquire a block to be predicted and a predicted block in an image frame, wherein an area corresponding to the predicted block is a reconstructed area; Determine a plurality of target templates corresponding to the coding block to be predicted; Determine a matching reference block corresponding to each of the target templates in the reconstructed area, and fuse at least one of the matching reference blocks to obtain a prediction value corresponding to the to-be-predicted coding block; Obtaining a residual value according to the original value of the to-be-predicted coding block and the predicted value; and The residual value is encoded, and the encoded bits are written into a bitstream.
2. The image encoding method according to claim 1, wherein: Determining a matching reference block corresponding to each target template in the reconstructed area includes: Determine at least one reference template corresponding to each of the target templates in the reconstructed area; Determine a candidate reference block corresponding to each reference template; and A matching reference block is determined for each target template based on the candidate reference blocks.
3. The image encoding method according to claim 2, wherein: Determining a matching reference block for each target template according to the candidate reference blocks includes: A candidate reference block is selected from the candidate reference blocks as a matching reference block corresponding to the target template.
4. The image encoding method according to claim 2, wherein: Determining a matching reference block for each target template according to the candidate reference blocks includes: Constructing a candidate list corresponding to each target template according to at least one candidate reference block corresponding to the target template; and A rate-distortion decision is performed on each candidate reference block pointed to by the block vector in the candidate list to determine a matching reference block corresponding to each target template.
5. The image encoding method according to claim 4, further comprising: Determine the block vector index value of the matching reference block corresponding to each of the target templates as the intra-frame template fusion information corresponding to the to-be-predicted coding block; as well as The block vector index value is encoded, and the encoded bits are written into a bitstream.
6. The image encoding method according to claim 2, wherein: Determining a matching reference block for each target template according to the candidate reference blocks includes: According to at least one candidate reference block corresponding to the target template, a candidate reference block corresponding to each target template is constructed. Selection list; and The candidate reference blocks pointed to by the block vectors in each of the candidate lists are merged to determine a matching reference block corresponding to each of the target templates.
7. The image encoding method according to claim 6, further comprising: Determine the intra-frame template reference block vector fusion identifier as the intra-frame template fusion information corresponding to the to-be-predicted coding block; as well as The intra-frame template reference block vector fusion identifier is encoded, and the encoded bits are written into a bitstream.
8. The image encoding method according to claim 1, wherein: The fusing at least one of the matching reference blocks to obtain a prediction value corresponding to the to-be-predicted coding block includes: Selecting at least one of the matching reference blocks as a reference block to be fused; and All the reference blocks to be merged are merged to obtain the intra-frame prediction value corresponding to the coding block to be predicted.
9. The image encoding method according to claim 8, wherein: The selecting at least one of the matching reference blocks as a reference block to be fused includes: When all the matching reference blocks are the same, selecting any matching reference block as the reference block to be fused; and In the case that there are at least two different matching reference blocks, the degree of difference between the reference templates corresponding to the at least two different matching reference blocks is determined according to a preset algorithm, and at least one of the matching reference blocks is selected as the reference block to be fused according to the degree of difference.
10. The image encoding method according to claim 9, wherein: There are two matching reference blocks that are different, and the preset algorithm includes an absolute error sum algorithm; determining the difference between the reference templates corresponding to at least two different matching reference blocks according to the preset algorithm, and selecting at least one matching reference block as a reference block to be fused according to the difference, including: Determining the reference templates corresponding to the two matching reference blocks as templates to be compared; Determine the sum of absolute errors corresponding to the two templates to be compared; When the difference between the sum of absolute errors corresponding to the two templates to be compared is greater than a preset threshold, selecting the two matching reference blocks as reference blocks to be fused; and When the difference between the sums of absolute errors corresponding to the two templates to be compared is less than or equal to a preset threshold, one of the matching reference blocks is selected as a reference block to be fused.
11. The image encoding method according to claim 9, wherein: There are at least three matching reference blocks that are different from each other, and the preset algorithm includes an absolute error sum algorithm; determining the difference between the reference templates corresponding to at least two different matching reference blocks according to the preset algorithm, and selecting at least one matching reference block as a reference block to be fused according to the difference, including: Determine a reference template and the remaining plurality of non-reference templates among the reference templates corresponding to all the different matching reference blocks; Determine the sum of absolute errors corresponding to the reference template and each of the non-reference templates; and The absolute error sum corresponding to the reference template is compared with the absolute error sum corresponding to each of the non-reference templates one by one. When the difference between the absolute error sums corresponding to the two is greater than a preset threshold, the matching reference block corresponding to the reference template and the non-reference template is used as the reference block to be fused; when the difference between the absolute error sums corresponding to the two is less than or equal to the preset threshold, the matching reference block corresponding to the reference template is used as the reference block to be fused.
12. The image encoding method according to claim 8, wherein: The fusing at least one of the matching reference blocks to obtain an intra-frame prediction value corresponding to the to-be-predicted coding block includes: Determining a target fusion weight corresponding to each target template according to the intra-frame template fusion weight; and According to the target fusion weight corresponding to each of the target templates, weighted calculation is performed on the matching reference blocks corresponding to all the target templates to obtain the intra-frame prediction value corresponding to the to-be-predicted coding block.
13. The image encoding method according to claim 12, wherein: The intra-frame template fusion weight includes a preset target fusion weight; The process of determining the preset target fusion weight includes: Determining a preset target fusion weight according to the number of samples included in the target template; or, A predetermined preset target fusion weight is set for each target template.
14. The image encoding method according to claim 12, wherein: The intra-frame template fusion weight is determined according to the absolute error sum and the number of samples corresponding to the target template; The step of determining the target fusion weight corresponding to each target template according to the intra-frame template fusion weight includes: Determine the target absolute error corresponding to each target template and the number of target samples included in each target template; According to the absolute error sum of the target template and the number of target samples, the absolute error sum corresponding to each target template is normalized to obtain the normalized absolute error sum corresponding to each target template, and the normalized absolute error sum is obtained according to all the normalized absolute error sums; and The target fusion weight corresponding to each target template is determined according to the normalized absolute error corresponding to each target template and the sum of the normalized absolute errors.
15. The image encoding method according to claim 12, wherein: The intra-frame template fusion weight is determined according to the positional relationship between the pixel to be predicted in the coding block to be predicted and the target template; The step of determining the target fusion weight corresponding to each target template according to the intra-frame template fusion weight includes: Determine a target absolute error sum corresponding to each of the target templates, and determine a weight base value corresponding to each of the target templates according to the target absolute error sum; Determining a target position relationship between the pixel to be predicted and each of the target templates, and determining a relative weight value corresponding to each of the target templates according to the target position relationship; and The target fusion weight corresponding to each target template is determined according to the weight base value and the weight relative value.
16. The image encoding method according to any one of claims 1 to 15, wherein: The target template includes at least one of an L-shape template, an Above template, and a Left template.
17. The image encoding method according to any one of claims 1 to 15, further comprising: Setting the high-level syntax element fusion flag to on; as well as The high-level syntax element fusion flag set to the on state is encoded, and the encoded bits are written into the bitstream.
18. The image encoding method according to claim 17, further comprising: Set the block-level intra-frame template fusion flag to on; as well as The block-level intra-frame template fusion flag set to the on state is encoded, and the encoded bits are written into the bitstream.
19. The image encoding method according to any one of claims 1 to 15, further comprising: Set the block-level intra-frame template fusion flag to on; as well as The block-level intra-frame template fusion flag set to the on state is encoded, and the encoded bits are written into the bitstream.
20. An image decoding method, comprising: Parse the bitstream to obtain the residual value corresponding to the decoded block to be predicted; According to the multiple target templates, a matching reference block corresponding to each target template is determined in the reconstructed area, and at least one matching reference block is fused to obtain a prediction value corresponding to the decoded block to be predicted; wherein the area corresponding to the predicted decoded block is the reconstructed area; Obtaining a decoding value corresponding to the to-be-predicted decoding block according to the prediction value of the to-be-predicted decoding block and the residual value; and A decoding recovery value of the to-be-predicted decoding block is obtained according to the decoding value.
21. The image decoding method according to claim 20, wherein: The determining, in the reconstructed area, a matching reference block corresponding to each target template comprises: Determine at least one reference template corresponding to each of the target templates in the reconstructed area; Determine a candidate reference block corresponding to each reference template; and A matching reference block is determined for each target template based on the candidate reference blocks.
22. The image decoding method according to claim 21, wherein: The step of determining a matching reference block for each target template according to the candidate reference blocks includes: A candidate reference block is selected from the candidate reference blocks corresponding to each of the target templates as a matching reference block corresponding to the target template.
23. The image decoding method according to claim 21, wherein: The step of determining a matching reference block for each target template according to the candidate reference blocks includes: According to at least one candidate reference block corresponding to the target template, construct a candidate list corresponding to each target template; and A rate-distortion decision is performed on each candidate reference block pointed to by the block vector in the candidate list to determine a matching reference block corresponding to each target template.
24. The image decoding method according to claim 21, wherein: The step of determining a matching reference block for each target template according to the candidate reference blocks includes: According to at least one candidate reference block corresponding to the target template, construct a candidate list corresponding to each target template; and The candidate reference blocks pointed to by the block vectors in each of the candidate lists are merged to determine a matching reference block corresponding to each of the target templates.
25. The image decoding method according to claim 20, wherein: The fusing at least one of the matching reference blocks to obtain a prediction value corresponding to the to-be-predicted decoding block includes: Selecting at least one of the matching reference blocks as a reference block to be fused; and All the reference blocks to be merged are merged to obtain the intra-frame prediction value corresponding to the decoded block to be predicted.
26. An image processing device, comprising: at least one processor; as well as at least one memory for storing at least one program; Wherein, when at least one of the programs is executed by at least one of the processors, the image encoding method as described in any one of claims 1 to 19, or the image decoding method as described in any one of claims 20 to 32 is implemented.
27. A computer-readable storage medium storing a program executable by a processor, wherein: The processor-executable program is used to implement the image encoding method as described in any one of claims 1 to 19, or the image decoding method as described in any one of claims 20 to 25 when executed by the processor.
28. A computer program product comprising a computer program or computer instructions, wherein: The computer program or the computer instructions are stored in a computer-readable storage medium, and the processor of a computer device reads the computer program or the computer instructions from the computer-readable storage medium. The processor executes the computer program or the computer instructions, so that the computer device executes the image encoding method as described in any one of claims 1 to 19, or the image decoding method as described in any one of claims 20 to 25.
Citation Information
Patent Citations
Video coding and decoding method and device and storage medium
CN110708541A
Video encoding method and device, video decoding method and device, computer equipment and storage medium
CN111050177A
Method of performing prediction for multiview video processing
US20130329800A1
Template matching for JVET intra prediction
US20170339404A1
Cited By
Intra template matching prediction fusion
EP4773609A1
Intra template matching prediction fusion
WO2026145983A1
