Intra-frame template matching prediction method and device
By integrating fractional pixel interpolation and multiple hypothesis methods into frame-intra template matching prediction, the inefficiencies in existing video coding technologies are addressed, leading to enhanced prediction accuracy and coding efficiency.
Patent Information
- Application Number
- CN202380082775.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-02
- Filing Date
- 2023-12-04
- Publication Date
- 2025-07-15
AI Technical Summary
Existing intra-template matching prediction methods have problems of inefficiency and insufficient prediction accuracy in video encoding and decoding, especially ignoring the importance of fractional interpolation and multiple assumptions.
The intra-template matching prediction method of fractional pixel template matching and multiple assumptions is used to interpolate fractional pixels by matching integer pixel templates, and the final prediction block is generated by weighting using multiple prediction block candidates.
The encoding and codec efficiency and prediction accuracy of intra-template matching prediction are improved, and the compression performance of video encoding is enhanced.
Smart Images

Figure CN120323009A_ABST
Abstract
Description
[0001] Cross - Reference to Related Applications
[0002] This application is filed and claims priority to U.S. Provisional Application No. 63 / 429,971, entitled "Methods and Apparatus for Intra - Template Matching Prediction", filed on December 2, 2022, the entire content of which is incorporated herein by reference. Technical Field
[0003] This disclosure relates to video encoding and compression, and in particular but not limited to, methods and apparatus for improving the encoding and decoding efficiency of intra - template matching prediction modes. Background Art
[0004] Various electronic devices (such as digital televisions, laptop or desktop computers, tablet computers, digital cameras, digital recording devices, digital media players, video game consoles, smart phones, video teleconferencing devices, video streaming devices, etc.) support digital video. The electronic devices send and receive or otherwise convey digital video data through a communication network and / or store the digital video data on a storage device. Since the bandwidth capacity of the communication network is limited and the memory resources of the storage device are limited, video encoding and decoding can be used to compress the video data according to one or more video encoding and decoding standards before the video data is transmitted or stored. For example, video encoding and decoding standards include Versatile Video Coding (VVC), Joint Exploration Test Model (JEM), High Efficiency Video Coding (HEVC / H.265), Advanced Video Coding (AVC / H.264), Moving Picture Experts Group (MPEG) coding, etc. Video encoding and decoding typically employs prediction methods (such as inter - frame prediction, intra - frame prediction, etc.) that utilize the redundancy inherent in the video data. Video encoding and decoding aims to compress the video data into a form that uses a lower bitrate while avoiding or minimizing the degradation of video quality. Summary of the Invention
[0005] This disclosure provides examples of techniques related to improving the encoding and decoding efficiency of the intra - template matching prediction (TMP) method in the video encoding or decoding process.
[0006] According to a first aspect of the present disclosure, a video decoding method is provided. In this method, the decoder can obtain the current template of the current coding unit (CU) encoded in the intra - template matching prediction (TMP) mode. In addition, the decoder can obtain the best integer prediction template. In addition, the decoder can obtain the fractional - pixel prediction template. In addition, the decoder can obtain the final prediction of the current CU based on the distances between the current template and the best integer prediction template and the fractional - pixel prediction template.
[0007] According to a second aspect of the present disclosure, a video encoding method is provided. In this method, the encoder may encode the current template of a current coding unit (CU) encoded in an intra-frame template matching prediction (TMP) mode. In addition, the encoder may obtain an optimal integer prediction template. In addition, the encoder may obtain a fractional pixel prediction template. In addition, the encoder may obtain a final prediction of the current CU based on the distances between the current template and the optimal integer prediction template and the fractional pixel prediction template. In addition, the encoder may transmit the current CU encoded based on the intra-frame TMP mode to the decoder.
[0008] According to a third aspect of the present disclosure, a video decoding method is provided. In this method, the decoder may obtain a current coding unit (CU) encoded based on an intra-frame template matching prediction (TMP) mode. In addition, the decoder may obtain a plurality of predicted CU candidates. In addition, the decoder may obtain a final prediction of the current CU based on the plurality of predicted CU candidates.
[0009] According to a fourth aspect of the present disclosure, a video encoding method is provided. In this method, the encoder may encode a current coding unit (CU) based on an intra-frame template matching prediction (TMP) mode. In addition, the encoder may further obtain a plurality of predicted CU candidates. In addition, the encoder may further obtain a final prediction of the current CU based on the plurality of predicted CU candidates. In addition, the encoder may further transmit the current CU encoded based on the intra-frame TMP mode to the decoder.
[0010] According to a fifth aspect of the present disclosure, a video decoding apparatus is provided. The apparatus may include one or more processors and a memory coupled to the one or more processors, the memory being configured to store instructions executable by the one or more processors. In addition, the one or more processors are configured to execute the method according to the first or third aspect above when executing the instructions.
[0011] According to a sixth aspect of the present disclosure, a video encoding apparatus is provided. The apparatus may include one or more processors and a memory coupled to the one or more processors, the memory being configured to store instructions executable by the one or more processors. In addition, the one or more processors are configured to execute the method according to the second or fourth aspect above when executing the instructions.
[0012] According to a seventh aspect of the present disclosure, a non-transitory computer-readable storage medium for storing computer-executable instructions is provided, the computer-executable instructions causing the one or more computer processors to execute the method according to the first or third aspect above when executed by the one or more computer processors.
[0013] According to an eighth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium for storing computer-executable instructions that, when executed by one or more computer processors, cause the one or more computer processors to execute the method according to the second or fourth aspect above.
[0014] According to a ninth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium for storing a bitstream to be decoded by the method according to the first or third aspect above.
[0015] According to a tenth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium for storing a bitstream generated by the method according to the second or fourth aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] A more specific description of the examples of the present disclosure will be presented by referring to specific examples shown in the accompanying drawings. Given that these drawings only depict some examples, they should not be regarded as limiting the scope. These examples will be described and explained with additional specificity and detail by using the drawings.
[0017] Figure 1 is a block diagram showing an exemplary system for encoding and decoding video blocks according to some embodiments of the present disclosure.
[0018] Figure 2 is a block diagram showing an exemplary video encoder according to some embodiments of the present disclosure.
[0019] Figure 3 is a block diagram showing an exemplary video decoder according to some embodiments of the present disclosure.
[0020] Figures 4A to 4E is a block diagram showing how a frame is recursively divided into multiple video blocks of different sizes and shapes according to some embodiments of the present disclosure.
[0021] Figure 5 is a diagram showing a computing environment coupled to a user interface according to some embodiments of the present disclosure.
[0022] Figure 6 shows a schematic diagram of an intra mode defined in VVC according to some examples of the present disclosure.
[0023] Figure 7 shows a schematic diagram of multiple reference lines for intra prediction according to some examples of the present disclosure.
[0024] Figure 8A and Figure 8BSchematic diagrams showing reference samples for position-dependent intra prediction combination (PDPC) in upper right diagonal mode and lower left diagonal mode according to some examples of the present disclosure.
[0025] Figure 9A Schematic diagrams showing sub-partitions of 4×8 and 8×4 CUs according to some examples of the present disclosure.
[0026] Figure 9B Schematic diagrams showing sub-partitions of CUs other than 4×8, 8×4, and 4×4 CUs according to some examples of the present disclosure.
[0027] Figure 10 Schematic diagrams showing positions of left samples and above samples of CUs involved in cross-component linear model (CCLM) prediction according to some examples of the present disclosure.
[0028] Figure 11 Schematic diagrams showing the matrix weighted intra prediction (MIP) process according to some examples of the present disclosure.
[0029] Figure 12 Schematic diagrams showing the intra-template matching search region used according to some examples of the present disclosure.
[0030] Figure 13 Schematic diagrams showing half-pixel interpolation and template matching search according to some examples of the present disclosure.
[0031] Figure 14 Flowcharts showing video decoding methods according to some examples of the present disclosure.
[0032] Figure 15 Flowcharts showing video encoding methods corresponding to the video decoding methods as shown in Figure 14 Flowcharts showing video encoding methods corresponding to the video decoding methods as shown.
[0033] Figure 16 Flowcharts showing video decoding methods according to some examples of the present disclosure.
[0034] Figure 17 Flowcharts showing video encoding methods corresponding to the video decoding methods as shown in Figure 16 Flowcharts showing video encoding methods corresponding to the video decoding methods as shown. Detailed implementation manners
[0035] Reference will now be made in detail to the specific embodiments, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous non-limiting specific details are set forth in order to assist in understanding the subject matter presented herein. However, the subject matter may be practiced without these specific details and various alternatives may be used without departing from the scope of the claims. For example, the subject matter presented herein may be implemented on many classes of electronic devices having digital video capabilities.
[0036] The terms used in this disclosure are for the purpose of describing particular embodiments only and are not intended to limit the disclosure. The singular forms "a / an", "the", and "said" in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise throughout the disclosure. It should also be understood that the term "and / or" as used in this disclosure refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0037] References throughout this specification to "one embodiment", "an embodiment", "an example", "some embodiments", "some examples", or similar language mean that a particular feature, structure, or characteristic described is included in at least one embodiment or example. Unless otherwise explicitly stated, the features, structures, elements, or characteristics described in connection with one or some embodiments are also applicable to other embodiments.
[0038] Throughout this disclosure, "first", "second", "third", etc. are used as nomenclature only for referring to related elements, such as devices, components, constituents, steps, etc., and do not imply any spatial or temporal order unless otherwise explicitly stated. For example, "a first device" and "a second device" may refer to two separately formed devices, or two parts, components, or operating states of the same device, and may be named arbitrarily.
[0039] The terms "module", "sub-module", "circuit", "sub-circuit", "circuitry", "sub-circuitry", "unit", or "sub-unit" may include a memory (shared, dedicated, or group) that stores code or instructions executable by one or more processors. A module may include one or more circuits with or without stored code or instructions. A module or circuit may include one or more components directly or indirectly connected. These components may or may not be physically attached to each other or adjacent to each other.
[0040] As used herein, depending on the context, the terms "if" or "when" may be understood to mean "at the time of" or "in response to". When these terms appear in a claim, they may not indicate that the relevant limitation or feature is conditional or optional. For example, a method may include the following steps: i) performing function or action X' when or if condition X exists, and ii) performing function or action Y' when or if condition Y exists. The method may have the ability to perform both function or action X' and function or action Y'. Thus, functions X' and Y' may be performed at different times during multiple executions of the method.
[0041] A unit or module may be implemented purely in software, purely in hardware, or in a combination of hardware and software. For example, in a purely software implementation, a unit or module may include code blocks or software components related to functions that are directly or indirectly linked together to perform a specific function.
[0042] Figure 1 is a block diagram showing an exemplary system 10 for encoding and decoding video blocks in parallel according to some embodiments of the present disclosure. As Figure 1 shown, the system 10 includes a source device 12 that generates and encodes video data that will later be decoded by a destination device 14. The source device 12 and the destination device 14 may include any of a variety of electronic devices, including cloud servers, server computers, desktop or laptop computers, tablet computers, smart phones, set-top boxes, digital televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, etc. In some embodiments, the source device 12 and the destination device 14 are equipped with wireless communication capabilities.
[0043] In some embodiments, the destination device 14 may receive the encoded video data to be decoded via a link 16. The link 16 may include any type of communication medium or device capable of moving the encoded video data from the source device 12 to the destination device 14. In one example, the link 16 may include a communication medium that enables the source device 12 to send the encoded video data directly to the destination device 14 in real time. The encoded video data may be modulated according to a communication standard (e.g., a wireless communication protocol) and sent to the destination device 14. The communication medium may include any wireless or wired communication medium, such as the radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network (e.g., a local area network, a wide area network, or a global network such as the Internet). The communication medium may include routers, switches, base stations, or any other device that may facilitate communication from the source device 12 to the destination device 14.
[0044] In some other embodiments, the encoded video data can be sent from the output interface 22 to the storage device 32. Subsequently, the encoded video data in the storage device 32 can be accessed by the target device 14 via the input interface 28. The storage device 32 can include any data storage medium among various distributed or locally accessible data storage media, such as a hard disk drive, a Blu-ray disc, a digital versatile disc (DVD), a compact disc read-only memory (CD-ROM), a flash memory, a volatile or non-volatile memory, or any other suitable digital storage medium for storing the encoded video data. In another example, the storage device 32 can correspond to a file server or another intermediate storage device that can hold the encoded video data generated by the source device 12. The target device 14 can access the stored video data from the storage device 32 via streaming or downloading. The file server can be any type of computer capable of storing the encoded video data and sending the encoded video data to the target device 14. Exemplary file servers include web servers (e.g., for websites), File Transfer Protocol (FTP) servers, Network Attached Storage (NAS) devices, or local disk drives. The target device 14 can access the encoded video data through any standard data connection suitable for accessing the encoded video data stored on the file server, and the standard data connections include wireless channels (e.g., Wi-Fi connections), wired connections (e.g., Digital Subscriber Line (DSL), cable modems, etc.), or a combination of both wireless channels and wired connections. The transmission of the encoded video data from the storage device 32 can be streaming, download transmission, or a combination of both streaming and download transmission.
[0045] As Figure 1 shown, the source device 12 includes a video source 18, a video encoder 20, and an output interface 22. The video source 18 can include sources such as, or a combination of such sources: a video capture device (e.g., a camera), a video archive containing previously captured video, a video feed interface for receiving video from a video content provider, and / or a computer graphics system for generating computer graphics data as source video. As an example, if the video source 18 is a camera of a security monitoring system, the source device 12 and the target device 14 can form a camera phone or a video phone. However, the embodiments described in this application can generally be applicable to video coding and decoding, and can be applied to wireless and / or wired applications.
[0046] Video encoder 20 may encode captured, pre-captured, or computer-generated video. The encoded video data may be sent directly to the target device 14 via the output interface 22 of the source device 12. The encoded video data may also (or alternatively) be stored on the storage device 32 for later access by the target device 14 or other devices for decoding and / or playback. The output interface 22 may further include a modem and / or a transmitter.
[0047] The target device 14 includes an input interface 28, a video decoder 30, and a display device 34. The input interface 28 may include a receiver and / or a modem and receives the encoded video data via the link 16. The encoded video data transmitted via the link 16 or provided on the storage device 32 may include various syntax elements generated by the video encoder 20 for use by the video decoder 30 when decoding the video data. Such syntax elements may be included in the encoded video data transmitted on a communication medium, stored on a storage medium, or stored on a file server.
[0048] In some embodiments, the target device 14 may include a display device 34, which may be an integrated display device and an external display device configured to communicate with the target device 14. The display device 34 displays the decoded video data to the user and may include any of a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.
[0049] The video encoder 20 and the video decoder 30 may operate according to proprietary standards or industry standards (e.g., VVC, HEVC, Part 10 of MPEG-4, AVC) or extensions of such standards. It should be understood that the present application is not limited to specific video coding / decoding standards and may be applicable to other video coding / decoding standards. It is generally believed that the video encoder 20 of the source device 12 may be configured to encode video data according to any of these current or future standards. Similarly, it is also generally believed that the video decoder 30 of the target device 14 may be configured to decode video data according to any of these current or future standards.
[0050] The video encoder 20 and the video decoder 30 can be implemented respectively as any of various suitable encoder and / or decoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic devices, software, hardware, firmware, or any combination thereof. When implemented partially in software, the electronic device can store instructions for the software in a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the video encoding / decoding operations disclosed in this disclosure. Each of the video encoder 20 and the video decoder 30 can be included in one or more encoders or decoders, and either of the encoders or decoders can be integrated as part of a combined encoder / decoder (CODEC) in the corresponding device.
[0051] In some embodiments, at least some components of the components of the source device 12 (e.g., the video source 18, the video encoder 20, or the components included in the video encoder 20 described below with reference to Figure 2 and the output interface 22) and / or some components of the components of the destination device 14 (e.g., the input interface 28, the video decoder 30, or the following reference Figure 3At least a portion of the components described as being included in video decoder 30, as well as in display device 34, may operate in a cloud computing service network such as software as a service (SaaS), platform as a service (PaaS), or infrastructure as a service (IaaS), where the cloud computing service network may provide software, platform, and / or infrastructure. In some embodiments, one or more components not included in the cloud computing service network in source device 12 and / or target device 14 may be provided in one or more client devices, and the one or more client devices may communicate with a server computer in the cloud computing service network via a wireless communication network (e.g., a cellular communication network, a short-range wireless communication network, or a global navigation satellite system (GNSS) communication network) or a wired communication network (e.g., a local area network (LAN) communication network or a power line communication (PLC) network). In an embodiment, at least a portion of the operations described herein may be implemented as cloud-based services provided by one or more server computers, where the one or more server computers are implemented by at least a portion of the components in source device 12 and / or at least a portion of the components in target device 14 in the cloud computing service network; and one or more other operations described herein may be implemented by one or more client devices. In some embodiments, the cloud computing service network may be a private cloud, a public cloud, or a hybrid cloud. Without departing from the scope of the present disclosure, terms such as "cloud", "cloud computing", "cloud-based", etc. may be used interchangeably herein as appropriate. It should be understood that the present disclosure is not limited to implementation in the above-described cloud computing service network. Instead, the present disclosure may also be implemented in any other type of computing environment known currently or developed in the future.
[0052] Figure 2 FIG. is a block diagram showing an exemplary video encoder 20 in accordance with some embodiments described in the present application. Video encoder 20 may perform intra prediction coding and inter prediction coding on video blocks within a video frame. Intra prediction coding relies on spatial prediction to reduce or remove spatial redundancy in the video data within a given video frame or picture. Inter prediction coding relies on temporal prediction to reduce or remove temporal redundancy in the video data within adjacent video frames or pictures of a video sequence. It should be noted that in the field of video coding and decoding, the term "frame" may be used as a synonym for the term "image" or "picture".
[0053] As Figure 2As shown in FIG. 0, the video encoder 20 includes a video data memory 40, a prediction processing unit 41, a decoded picture buffer (DPB) 64, an adder 50, a transform processing unit 52, a quantization unit 54, and an entropy coding unit 56. The prediction processing unit 41 further includes a motion estimation unit 42, a motion compensation unit 44, a segmentation unit 45, an intra prediction processing unit 46, and an intra block copy (BC) unit 48. In some embodiments, the video encoder 20 further includes an inverse quantization unit 58, an inverse transform processing unit 60, and an adder 62 for video block reconstruction. A loop filter such as a deblocking filter 63 may be located between the adder 62 and the DPB 64 to filter block boundaries to remove block artifacts from the reconstructed video. In addition to the deblocking filter, another loop filter (e.g., a sample adaptive offset (SAO) filter, a cross-component sample adaptive offset (CCSAO) filter, and / or an adaptive loop filter (ALF)) may be used to filter the output of the adder 62. It should be noted that for the CCSAO technology, the present application is not limited to the embodiments described herein, but may also be applied to cases where an offset is selected for any one of the luminance component, the Cb chrominance component, and the Cr chrominance component from any one of the other components of the luminance component, the Cb chrominance component, and the Cr chrominance component, and the other component is modified based on the selected offset. In addition, it should be noted that the first component mentioned in the text may be any one of the luminance component, the Cb chrominance component, and the Cr chrominance component, the second component may be any one of the other components of the luminance component, the Cb chrominance component, and the Cr chrominance component, and the third component may be the remaining component of any one of the luminance component, the Cb chrominance component, and the Cr chrominance component. In some examples, the in-loop filter may be omitted, and the decoded video block may be directly provided to the DPB 64 by the adder 62. The video encoder 20 may take the form of a fixed or programmable hardware unit, or may be distributed among one or more of the illustrated fixed or programmable hardware units.
[0054] The video data memory 40 may store video data to be encoded by components of the video encoder 20. The video data in the video data memory 40 may be obtained, for example, from Figure 1 the video source 18 shown in FIG. The DPB 64 is a buffer that stores reference video data (e.g., reference frames or pictures) for use by the video encoder 20 (e.g., in intra or inter prediction coding modes) when encoding video data. The video data memory 40 and the DPB 64 may be formed of any of a variety of memory devices. In various examples, the video data memory 40 may be on-chip with other components of the video encoder 20, or off-chip relative to those components.
[0055] As Figure 2As shown, after receiving video data, the segmentation unit 45 within the prediction processing unit 41 segments the video data into video blocks. This segmentation may also include segmenting a video frame into strips, tiles (e.g., a set of video blocks), or other larger coding units (CUs) according to a predefined splitting structure associated with the video data (such as a quadtree (QT) structure). A video frame is or can be regarded as a two-dimensional sample array or matrix having sample values. Samples in the array can also be referred to as pixels or picture elements (pels). The number of samples in the horizontal and vertical directions (or axes) of the array or picture defines the size and / or resolution of the video frame. For example, a video frame can be divided into multiple video blocks by using QT segmentation. A video block is again or can be regarded as a two-dimensional sample array or matrix having sample values, but its dimensions are smaller than those of the video frame. The number of samples in the horizontal and vertical directions (or axes) of the video block defines the size of the video block. By, for example, iteratively using QT segmentation, binary tree (BT) segmentation, or ternary tree (TT) segmentation or any combination thereof, the video block can be further segmented into one or more block partitions or sub-blocks (which can again form blocks). It should be noted that the term "block" or "video block" as used herein can be a part of a frame or picture, especially a rectangular (square or non-square) part. Referring to, for example, HEVC and VVC, a block or video block can be or correspond to a coding tree unit (CTU), CU, prediction unit (PU), or transform unit (TU) and / or can be or correspond to the corresponding block (such as a coding tree block (CTB), coding block (CB), prediction block (PB), or transform block (TB)) and / or sub-block.
[0056] The prediction processing unit 41 can select one of multiple feasible prediction coding modes for the current video block based on error results (such as coding rate and distortion level), such as one of multiple intra-prediction coding modes or one of multiple inter-prediction coding modes. The prediction processing unit 41 can provide the resulting intra-prediction coded block or inter-prediction coded block to the adder 50 to generate a residual block, and to the adder 62 to reconstruct the coded block for subsequent use as part of a reference frame. The prediction processing unit 41 also provides syntax elements (such as motion vectors, intra-mode indicators, segmentation information, and other such syntax information) to the entropy coding unit 56.
[0057] To select a suitable intra prediction coding mode for the current video block, the intra prediction processing unit 46 within the prediction processing unit 41 may perform intra prediction coding of the current video block in relation to one or more neighboring blocks in the same frame as the current block to be encoded to provide spatial prediction. The motion estimation unit 42 and the motion compensation unit 44 within the prediction processing unit 41 perform inter prediction coding of the current video block in relation to one or more prediction blocks in one or more reference frames to provide temporal prediction. The video encoder 20 may perform multiple encoding passes, for example, to select a suitable coding mode for each block of video data.
[0058] In some embodiments, the motion estimation unit 42 determines an inter prediction mode for the current video frame by generating a motion vector according to a predetermined pattern within the video frame sequence, and the motion vector indicates the displacement of a video block within the current video frame relative to a prediction block within a reference video frame. The motion estimation performed by the motion estimation unit 42 is a process of generating a motion vector that estimates the motion for the video block. For example, the motion vector may indicate the displacement of a video block within the current video frame or picture relative to a prediction block within a reference frame related to the current block being encoded within the current frame. The predetermined pattern may designate video frames in the sequence as P frames or B frames. The intra BC unit 48 may determine a vector (e.g., a block vector) for intra BC coding in a manner similar to the motion vector determined by the motion estimation unit 42 for inter prediction, or may utilize the motion estimation unit 42 to determine the block vector.
[0059] In terms of pixel difference, the prediction block for a video block may be or may correspond to a block or reference block of a reference frame considered to closely match the video block to be encoded, and the pixel difference may be determined by the sum of absolute differences (SAD), the sum of squared differences (SSD), or other difference metrics. In some embodiments, the video encoder 20 may calculate values for sub-integer pixel positions of the reference frames stored in the DPB 64. For example, the video encoder 20 may interpolate values for quarter-pixel positions, eighth-pixel positions, or other fractional pixel positions of the reference frame. Thus, the motion estimation unit 42 may perform a motion search with respect to both full pixel positions and fractional pixel positions and output a motion vector with fractional pixel accuracy.
[0060] The motion estimation unit 42 calculates a motion vector for a video block in an inter prediction coded frame by comparing the position of the video block with the position of a prediction block of a reference frame selected from a first reference frame list (list 0) or a second reference frame list (list 1), and each of the first reference frame list and the second reference frame list identifies one or more reference frames stored in the DPB 64. The motion estimation unit 42 sends the calculated motion vector to the motion compensation unit 44 and then to the entropy coding unit 56.
[0061] The motion compensation performed by motion compensation unit 44 may involve obtaining or generating a prediction block based on the motion vector determined by motion estimation unit 42. After receiving the motion vector for the current video block, motion compensation unit 44 may locate the prediction block pointed to by the motion vector in one of the reference frame lists in the reference frame list, retrieve the prediction block from DPB 64, and forward the prediction block to adder 50. Then, adder 50 forms a residual video block of pixel differences by subtracting the pixel values of the prediction block provided by motion compensation unit 44 from the pixel values of the current video block being encoded. The pixel differences forming the residual video block may include luminance component differences or chrominance component differences or both. Motion compensation unit 44 may also generate syntax elements associated with the video blocks of the video frame for use by video decoder 30 when decoding the video blocks of the video frame. The syntax elements may include, for example, syntax elements defining the motion vectors for identifying the prediction blocks, any flags indicating the prediction mode, or any other syntax information described herein. It should be noted that motion estimation unit 42 and motion compensation unit 44 may be highly integrated but are shown separately for conceptual purposes.
[0062] In some embodiments, the intra BC unit 48 may generate vectors and obtain prediction blocks in a manner similar to that described above in connection with motion estimation unit 42 and motion compensation unit 44, but these prediction blocks are in the same frame as the current block being encoded, and these vectors are referred to as block vectors rather than motion vectors. Specifically, the intra BC unit 48 may determine the intra prediction mode to be used for encoding the current block. In some examples, the intra BC unit 48 may, for example, use various intra prediction modes to encode the current block during a separate encoding pass and test their performance through rate-distortion analysis. Next, the intra BC unit 48 may select a suitable intra prediction mode from among the various tested intra prediction modes to use and generate an intra mode indicator accordingly. For example, the intra BC unit 48 may calculate rate-distortion values for the various tested intra prediction modes using rate-distortion analysis and select the intra prediction mode having the best rate-distortion characteristics among the tested modes as the suitable intra prediction mode to use. Rate-distortion analysis generally determines the amount of distortion (or error) between the encoded block and the original unencoded block that was encoded to produce the encoded block, as well as the bitrate (i.e., the number of bits) used to produce the encoded block. The intra BC unit 48 may calculate a ratio based on the distortion and rate for the various encoded blocks to determine which intra prediction mode exhibits the best rate-distortion value for the block.
[0063] In other examples, the intra BC unit 48 can perform such functions for intra BC prediction according to the embodiments described herein, in whole or in part, using the motion estimation unit 42 and the motion compensation unit 44. In either case, for intra block copy, in terms of pixel differences, the predicted block can be a block that is considered to closely match the block to be encoded, the pixel differences can be determined by SAD, SSD, or other difference metrics, and identifying the predicted block can include calculating values for sub-integer pixel positions.
[0064] Regardless of whether the predicted block is from the same frame according to intra prediction or a different frame according to inter prediction, the video encoder 20 can form a pixel difference value by subtracting the pixel values of the predicted block from the pixel values of the current video block being encoded, thereby forming a residual video block. The pixel difference values for forming the residual video block can include both the luminance component difference and the chrominance component difference.
[0065] As an alternative to the inter prediction performed by the motion estimation unit 42 and the motion compensation unit 44 or the intra block copy prediction performed by the intra BC unit 48 as described above, the intra prediction processing unit 46 can perform intra prediction on the current video block. Specifically, the intra prediction processing unit 46 can determine an intra prediction mode for encoding the current block. To this end, the intra prediction processing unit 46 can, for example, encode the current block using various intra prediction modes during a separate encoding pass, and the intra prediction processing unit 46 (or in some examples, the mode selection unit) can select a suitable intra prediction mode from the tested intra prediction modes for use. The intra prediction processing unit 46 can provide information indicating the intra prediction mode selected for the block to the entropy encoding unit 56. The entropy encoding unit 56 can encode the information indicating the selected intra prediction mode into the bitstream.
[0066] After the prediction processing unit 41 determines a predicted block for the current video block via inter prediction or intra prediction, the adder 50 forms a residual video block by subtracting the predicted block from the current video block. The residual video data in the residual block can be included in one or more TUs and provided to the transform processing unit 52. The transform processing unit 52 transforms the residual video data into residual transform coefficients using a transform (such as a discrete cosine transform (DCT) or a conceptually similar transform).
[0067] The transform processing unit 52 can send the resulting transform coefficients to the quantization unit 54. The quantization unit 54 quantizes the transform coefficients to further reduce the bit rate. The quantization process can also reduce the bit depth associated with some or all of the coefficients. The degree of quantization can be modified by adjusting the quantization parameter. In some examples, the quantization unit 54 can subsequently perform a scan on the matrix including the quantized transform coefficients. Alternatively, the entropy encoding unit 56 can perform the scan.
[0068] After quantization, entropy encoding unit 56 entropy encodes the quantized transform coefficients into a video bitstream using, for example, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy coding method or technique. Then, the encoded bitstream can be sent to video decoder 30 as shown in Figure 1 and as shown in Figure 1 or archived in storage device 32 as shown in
[0069] for later sending to or retrieval by video decoder 30. Entropy encoding unit 56 can also entropy encode the motion vectors and other syntax elements for the current video frame being encoded.
[0070] Inverse quantization unit 58 and inverse transform processing unit 60 respectively apply inverse quantization and inverse transform to reconstruct the residual video block in the pixel domain for generating a reference block for predicting other video blocks. As noted above, motion compensation unit 44 can generate a motion compensation prediction block from one or more reference blocks of frames stored in DPB 64. Motion compensation unit 44 can also apply one or more interpolation filters to the prediction block to calculate sub-integer pixel values for use in motion estimation.
[0071] Figure 3 is a block diagram showing an exemplary video decoder 30 according to some embodiments of the present application. Video decoder 30 includes video data memory 79, entropy decoding unit 80, prediction processing unit 81, inverse quantization unit 86, inverse transform processing unit 88, adder 90, and DPB 92. Prediction processing unit 81 further includes motion compensation unit 82, intra prediction unit 84, and intra BC unit 85. Video decoder 30 can perform a decoding process that is substantially inverse to the encoding process described above in connection with Figure 2 video encoder 20. For example, motion compensation unit 82 can generate prediction data based on the motion vectors received from entropy decoding unit 80, while intra prediction unit 84 can generate prediction data based on the intra prediction mode indicator received from entropy decoding unit 80.
[0072] In some examples, the units of the video decoder 30 may be assigned tasks to perform embodiments of the present application. Additionally, in some examples, the embodiments of the present disclosure may be distributed across one or more of the units of the video decoder 30. For example, the intra BC unit 85 may perform embodiments of the present application alone or in combination with other units of the video decoder 30 (such as the motion compensation unit 82, the intra prediction unit 84, and the entropy decoding unit 80). In some examples, the video decoder 30 may not include the intra BC unit 85, and the functions of the intra BC unit 85 may be performed by other components of the prediction processing unit 81 (such as the motion compensation unit 82).
[0073] The video data memory 79 may store video data to be decoded by other components of the video decoder 30, such as an encoded video bitstream. The video data stored in the video data memory 79 may be obtained, for example, from the storage device 32, from a local video source (such as a camera), via wired or wireless network communication of video data, or by accessing a physical data storage medium (such as a flash drive or a hard disk). The video data memory 79 may include an encoded picture buffer (CPB) that stores encoded video data from the encoded video bitstream. The DPB 92 of the video decoder 30 stores reference video data for use by the video decoder 30 (such as in an intra or inter prediction coding mode) when decoding video data. The video data memory 79 and the DPB 92 may be formed of any of a variety of memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM)), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. For illustrative purposes, the video data memory 79 and the DPB 92 are depicted in Figure 3 as two different components of the video decoder 30. However, it will be apparent to those skilled in the art that the video data memory 79 and the DPB 92 may be provided by the same memory device or separate memory devices. In some examples, the video data memory 79 may be on-chip with other components of the video decoder 30 or off-chip relative to those components.
[0074] During the decoding process, the video decoder 30 receives an encoded video bitstream representing video blocks of an encoded video frame and associated syntax elements. The video decoder 30 may receive syntax elements at the video frame level and / or the video block level. The entropy decoding unit 80 of the video decoder 30 performs entropy decoding on the bitstream to generate quantized coefficients, motion vectors, or intra prediction mode indicators, as well as other syntax elements. The entropy decoding unit 80 then forwards the motion vectors or intra prediction mode indicators, as well as other syntax elements, to the prediction processing unit 81.
[0075] When a video frame is encoded as an intra prediction encoded (I) frame or for an intra-coded prediction block in other types of frames, the intra prediction unit 84 of the prediction processing unit 81 may generate prediction data for a video block of the current video frame based on the signaled intra prediction mode and reference data from previously decoded blocks of the current frame.
[0076] When a video frame is encoded as an inter prediction encoded (i.e., B or P) frame, the motion compensation unit 82 of the prediction processing unit 81 generates one or more prediction blocks for a video block of the current video frame based on the motion vector and other syntax elements received from the entropy decoding unit 80. Each of the prediction blocks may be generated from a reference frame within one of the reference frame lists. The video decoder 30 may construct the reference frame lists using a default construction technique based on the reference frames stored in the DPB 92, i.e., list 0 and list 1.
[0077] In some examples, when a video block is encoded according to the intra BC mode described herein, the intra BC unit 85 of the prediction processing unit 81 generates a prediction block for the current video block based on the block vector and other syntax elements received from the entropy decoding unit 80. The prediction block may be within the reconstructed region of the same picture as the current video block defined by the video encoder 20.
[0078] The motion compensation unit 82 and / or the intra BC unit 85 determine prediction information for a video block of the current video frame by parsing the motion vector and other syntax elements, and then use the prediction information to generate a prediction block for the current video block being decoded. For example, the motion compensation unit 82 uses some of the received syntax elements to determine the prediction mode (e.g., intra prediction or inter prediction) for encoding the video block of the video frame, the inter prediction frame type (e.g., B or P), the construction information for one or more of the reference frame lists for the frame, the motion vector for each inter prediction encoded video block of the frame, the inter prediction state for each inter prediction encoded video block of the frame, and other information for decoding the video block in the current video frame.
[0079] Similarly, the intra BC unit 85 may use some of the received syntax elements, such as flags, to determine that the current video block is predicted using the intra BC mode, the construction information of which video blocks of the frame are within the reconstructed region and should be stored in the DPB 92, the block vector for each intra BC predicted video block of the frame, the intra BC prediction state for each intra BC predicted video block of the frame, and other information for decoding the video block in the current video frame.
[0080] The motion compensation unit 82 may also perform interpolation using an interpolation filter such as that used by the video encoder 20 during encoding of a video block to calculate interpolation values for sub-integer pixels of a reference block. In this case, the motion compensation unit 82 may determine the interpolation filter used by the video encoder 20 based on received syntax elements and use these interpolation filters to generate a prediction block.
[0081] The inverse quantization unit 86 inverse quantizes the quantized transform coefficients provided in the bitstream and entropy decoded by the entropy decoding unit 80 using the same quantization parameters calculated by the video encoder 20 for each video block in the video frame to determine the degree of quantization. The inverse transform processing unit 88 applies an inverse transform (e.g., inverse DCT, inverse integer transform, or conceptually similar inverse transform process) to the transform coefficients in order to reconstruct the residual block in the pixel domain.
[0082] After the motion compensation unit 82 or the intra BC unit 85 generates a prediction block for the current video block based on vectors and other syntax elements, the adder 90 reconstructs the decoded video block for the current video block by adding the residual block from the inverse transform processing unit 88 to the corresponding prediction block generated by the motion compensation unit 82 and the intra BC unit 85. A loop filter 91 (e.g., deblocking filter, SAO filter, CCSAO filter, and / or ALF) may be located between the adder 90 and the DPB 92 to further process the decoded video block. In some examples, the loop filter 91 may be omitted and the decoded video block may be provided directly by the adder 90 to the DPB 92. Then, the decoded video blocks in a given frame are stored in the DPB 92, which stores reference frames for subsequent motion compensation of the next video blocks. The DPB 92 or a memory device separate from the DPB 92 may also store the decoded video for later presentation on a display device (e.g., Figure 1 display device 34).
[0083] In a typical video coding / decoding process, a video sequence generally includes an ordered collection of frames or pictures. Each frame may include three sample arrays, denoted as SL, SCb, and SCr. SL is a two-dimensional array of luminance samples. SCb is a two-dimensional array of Cb chrominance samples. SCr is a two-dimensional array of Cr chrominance samples. In other instances, a frame may be monochrome and thus include only one two-dimensional array of luminance samples.
[0084] As Figure 4AAs shown, video encoder 20 (or more specifically, splitting unit 45) generates an encoded representation of a frame by first splitting the frame into a set of CTUs. A video frame may include an integer number of CTUs that are sequentially ordered from left to right and top to bottom in raster scan order. Each CTU is the largest logical coding unit, and the width and height of the CTU are signaled by video encoder 20 in the sequence parameter set such that all CTUs in the video sequence have the same size of one of 128×128, 64×64, 32×32, and 16×16. However, it should be noted that the present application need not be limited to a specific size. As Figure 4B As shown, each CTU may include one CTB of luminance samples, two corresponding coding tree blocks of chrominance samples, and syntax elements for coding the samples of the coding tree blocks. The syntax elements describe the nature of different types of units that encode pixel blocks and how the video sequence can be reconstructed at video decoder 30, including inter-frame prediction or intra-frame prediction, intra-frame prediction mode, motion vectors, and other parameters. In a monochrome picture or a picture with three separate color planes, a CTU may include a single coding tree block and syntax elements for coding the samples of the coding tree block. A coding tree block may be a block of N×N samples.
[0085] To achieve better performance, video encoder 20 may recursively perform tree splitting, such as binary tree splitting, ternary tree splitting, quadtree splitting, or a combination thereof, on the coding tree blocks of a CTU and divide the CTU into smaller CUs. As Figure 4C As depicted, a 64×64 CTU 400 is first divided into four smaller CUs, each CU having a block size of 32×32. Among the four smaller CUs, CU 410 and CU 420 are respectively divided into four CUs with a block size of 16×16. The two 16×16 CUs 430 and 440 are respectively further divided into four CUs with a block size of 8×8. Figure 4D depicts a quadtree data structure showing the final result of the splitting process of CTU 400 as depicted in Figure 4C Each leaf node of the quadtree corresponds to a CU with a corresponding size ranging from 32×32 to 8×8. Similar to the CTU depicted in Figure 4B Each CU may include a CB of luminance samples of a frame of the same size and two corresponding coding blocks of chrominance samples, and syntax elements for coding the samples of the coding blocks. In a monochrome picture or a picture with three separate color planes, a CU may include a single coding block and a syntax structure for coding the samples of the coding block. It should be noted that Figure 4C and Figure 4DThe quadtree splitting depicted is for illustrative purposes only, and a CTU can be split into multiple CUs based on quadtree splitting / tritree splitting / binary tree splitting to adapt to varying local characteristics. In a multi-type tree structure, a CTU is split according to a quadtree structure, and each quadtree leaf CU can be further split according to binary and tritree structures. As Figure 4E shown, there are five possible splitting types for a coding block with width W and height H, namely, quaternary splitting, horizontal binary splitting, vertical binary splitting, horizontal ternary splitting, and vertical ternary splitting.
[0086] In some embodiments, the video encoder 20 may further split the coding block of a CU into one or more (M×N) PBs. A PB is a rectangular (square or non-square) sample block to which the same prediction (inter-frame or intra-frame) is applied. The PU of a CU may include a PB of luminance samples, two corresponding PBs of chrominance samples, and syntax elements for predicting the PB. In a monochrome picture or a picture with three separate color planes, the PU may include a single PB and a syntax structure for predicting the PB. The video encoder 20 may generate a predicted luminance block, a predicted Cb block, and a predicted Cr block for the luminance PB, Cb PB, and Cr PB of each PU of the CU.
[0087] The video encoder 20 may use intra-frame prediction or inter-frame prediction to generate a predicted block for the PU. If the video encoder 20 uses intra-frame prediction to generate a predicted block for the PU, the video encoder 20 may generate the predicted block for the PU based on the decoded samples of the frame associated with the PU. If the video encoder 20 uses inter-frame prediction to generate a predicted block for the PU, the video encoder 20 may generate the predicted block for the PU based on the decoded samples of one or more frames other than the frame associated with the PU.
[0088] After the video encoder 20 generates a predicted luminance block, a predicted Cb block, and a predicted Cr block for one or more PUs of the CU, the video encoder 20 may generate a luminance residual block for the CU by subtracting the predicted luminance block of the CU from the original luminance coding block of the CU, such that each sample in the luminance residual block of the CU indicates the difference between the luminance sample in one of the predicted luminance blocks of the CU and the corresponding sample in the original luminance coding block of the CU. Similarly, the video encoder 20 may generate a Cb residual block and a Cr residual block for the CU, respectively, such that each sample in the Cb residual block of the CU indicates the difference between the Cb sample in one of the predicted Cb blocks of the CU and the corresponding sample in the original Cb coding block of the CU, and each sample in the Cr residual block of the CU may indicate the difference between the Cr sample in one of the predicted Cr blocks of the CU and the corresponding sample in the original Cr coding block of the CU.
[0089] In addition, as Figure 4CAs shown in, video encoder 20 can use quadtree partitioning to separately decompose the luminance residual block, Cb residual block, and Cr residual block of a CU into one or more luminance transform blocks, Cb transform blocks, and Cr transform blocks. A transform block is a rectangular (square or non-square) sample block to which the same transform is applied. The TU of a CU can include a transform block of luminance samples, two corresponding transform blocks of chrominance samples, and syntax elements for transforming the samples of the transform block. Thus, each TU of a CU can be associated with a luminance transform block, a Cb transform block, and a Cr transform block. In some examples, the luminance transform block associated with a TU can be a sub-block of the luminance residual block of the CU. The Cb transform block can be a sub-block of the Cb residual block of the CU. The Cr transform block can be a sub-block of the Cr residual block of the CU. In a monochrome picture or a picture with three separate color planes, a TU can include a single transform block and the syntax structure for transforming the samples of the transform block.
[0090] Video encoder 20 can apply one or more transforms to the luminance transform block of a TU to generate a luminance coefficient block for the TU. A coefficient block can be a two-dimensional array of transform coefficients. The transform coefficients can be scalars. Video encoder 20 can apply one or more transforms to the Cb transform block of the TU to generate a Cb coefficient block for the TU. Video encoder 20 can apply one or more transforms to the Cr transform block of the TU to generate a Cr coefficient block for the TU.
[0091] After generating the coefficient block (e.g., luminance coefficient block, Cb coefficient block, or Cr coefficient block), video encoder 20 can quantize the coefficient block. Quantization generally refers to the process by which transform coefficients are quantized to potentially reduce the amount of data used to represent the transform coefficients, thereby providing further compression. After video encoder 20 quantizes the coefficient block, video encoder 20 can entropy code the syntax elements indicating the quantized transform coefficients. For example, video encoder 20 can perform CABAC on the syntax elements indicating the quantized transform coefficients. Finally, video encoder 20 can output a bitstream including a bit sequence that forms a representation of the encoded frame and associated data, and the bitstream is stored in storage device 32 or sent to destination device 14.
[0092] After receiving the bitstream generated by the video encoder 20, the video decoder 30 may parse the bitstream to obtain syntax elements from the bitstream. The video decoder 30 may reconstruct the frames of the video data at least in part based on the syntax elements obtained from the bitstream. The process of reconstructing the video data is generally inverse to the encoding process performed by the video encoder 20. For example, the video decoder 30 may perform an inverse transform on the coefficient block associated with the TU of the current CU to reconstruct the residual block associated with the TU of the current CU. The video decoder 30 also reconstructs the encoded block of the current CU by adding the samples of the predicted block of the PU of the current CU to the corresponding samples of the transform block of the TU of the current CU. After reconstructing the encoded blocks of each CU for the frame, the video decoder 30 may reconstruct the frame.
[0093] As described above, video coding mainly uses two modes (i.e., intra-frame prediction (or intra prediction) and inter-frame prediction (or inter prediction)) to achieve video compression. It should be noted that IBC can be regarded as intra prediction or a third mode. Between the two modes, since motion vectors are used to predict the current video block based on reference video blocks, inter-frame prediction contributes more to the coding efficiency than intra-frame prediction.
[0094] However, with continuously improving video data capture techniques and finer video block sizes for preserving details in video data, the amount of data required to represent the motion vectors for the current frame has also increased significantly. One way to overcome this challenge benefits from the fact that not only does a set of neighboring CUs in both the spatial domain and the temporal domain have similar video data for prediction purposes, but the motion vectors between these neighboring CUs are also similar. Therefore, the motion information of spatial neighboring CUs and / or temporal co-located CUs can be used as an approximation of the motion information (e.g., motion vectors) of the current CU (which is also referred to as the "motion vector prediction value" (MVP) of the current CU) by exploring their spatial and temporal correlations.
[0095] Instead of encoding the actual motion vector of the current CU determined by the motion estimation unit 42 into the video bitstream as described above in conjunction with Figure 2 The motion vector difference (MVD) for the current CU is generated by subtracting the motion vector prediction value of the current CU from the actual motion vector of the current CU. By doing so, it is not necessary to encode the motion vectors determined by the motion estimation unit 42 for each CU of the frame into the video bitstream, and the amount of data used to represent the motion information in the video bitstream can be significantly reduced.
[0096] Similar to the process of selecting a prediction block in a reference frame during inter prediction of a coding block, both the video encoder 20 and the video decoder 30 need to adopt a set of rules for constructing a motion vector candidate list (also referred to as a "merge list") for the current CU using those potential candidate motion vectors associated with spatially neighboring CUs and / or temporally collocated CUs of the current CU, and then selecting a member from the motion vector candidate list as the motion vector prediction value for the current CU. By doing so, it is not necessary to send the motion vector candidate list itself from the video encoder 20 to the video decoder 30, and the index of the selected motion vector prediction value within the motion vector candidate list is sufficient for the video encoder 20 and the video decoder 30 to use the same motion vector prediction value within the motion vector candidate list to encode and decode the current CU.
[0097] Figure 5 FIG. shows a computing environment (or computing device) 1610 coupled to a user interface 1650. In some embodiments, the computing device 1610 may perform any one of the various methods or processes (such as decoding / encoding methods or processes) according to various examples of the present disclosure as described above. The computing environment 1610 may be part of a data processing server. The computing environment 1610 includes a processor 1620, a memory 1630, and an input / output (I / O) interface 1640.
[0098] The processor 1620 generally controls the overall operation of the computing environment 1610, such as operations associated with display, data acquisition, data communication, and image processing. The processor 1620 may include one or more processors for executing instructions to perform all or some of the steps of the above methods. In addition, the processor 1620 may include one or more modules that facilitate the interaction between the processor 1620 and other components. The processor may be a central processing unit (CPU), a microprocessor, a single-chip microcomputer, a graphics processing unit (GPU), etc.
[0099] The memory 1630 is configured to store various types of data to support the operation of the computing environment 1610. The memory 1630 may include a predetermined software 1632. Examples of the above data include instructions for any application or method operating on the computing environment 1610, video data sets, image data, etc. The memory 1630 may be implemented using any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disks, or optical disks.
[0100] The I / O interface 1640 provides an interface between the processor 1620 and peripheral interface modules (such as a keyboard, click wheel, buttons, etc.). The buttons can include but are not limited to a home button, a start scan button, and a stop scan button. The I / O interface 1640 can be coupled to an encoder and a decoder.
[0101] Generally, the basic intra prediction scheme applied in VVC is almost the same as that of HEVC, except that several prediction tools are further extended, added, and / or improved. For example, extended intra prediction using wide-angle intra modes, multi-reference line (MRL) intra prediction, PDPC, intra sub-partition (ISP) prediction, CCLM prediction, MIP, and intra template matching prediction (TMP).
[0102] Extended Intra Prediction Using Wide Angle Intra Mode
[0103] Similar to HEVC, VVC uses a set of reference samples adjacent to the current CU (i.e., above the current CU or to the left of the current CU) to predict the samples of the current CU. However, to capture the finer edge directions present in natural videos (especially for high-resolution (e.g., 4K) video content), the number of angular intra modes is extended from 33 in HEVC to 93 in VVC. Figure 6 The figure shows a schematic diagram of the intra modes defined in VVC. As Figure 6 shown, among the 93 angular intra modes, modes 2 to 66 are traditional angular intra modes, and modes -1 to -14 and modes 67 to 80 are wide-angle intra modes. In addition to the angular intra modes, the planar mode ( Figure 6 mode 0 in Figure 6 ) and the direct current (DC) mode (
[0104] Since a quadtree / binary tree / trinary tree partitioning structure is applied in VVC, in addition to square video blocks, there are also rectangular video blocks for intra prediction in VVC. Since the width and height of a given video block are not equal, for different block shapes, different sets of angular intra modes can be selected from 93 angular intra modes. More specifically, for both square video blocks and rectangular video blocks, in addition to the planar mode and the DC mode, each block shape supports 65 out of 93 angular intra modes. When the rectangular block shape of a video block meets specific conditions, the video decoder 30 can adaptively determine the index of the wide-angle intra mode of the video block according to the mapping relationship shown in Table 1 below based on the index of the conventional angular intra mode received from the video encoder 20. That is, for non-square blocks, the video encoder 20 uses the index of the conventional angular intra mode to signal the wide-angle intra mode, and this index is mapped to the index of the wide-angle intra mode by the video decoder 30 after being parsed, so as to ensure that the total number of intra modes (i.e., the planar mode, the DC mode, and 65 out of 93 angular intra modes) (i.e., 67) remains unchanged and the intra mode encoding and decoding method remains unchanged. Therefore, while providing a consistent design across different block sizes, good signaling efficiency of intra modes is achieved.
[0105] Table 1 shows the mapping relationship between the index of the conventional angular intra mode and the index of the wide-angle intra mode for intra prediction of different block shapes in VCC, where W represents the width of the video block and H represents the height of the video block.
[0106] Table 1
[0107]
[0108] MRL Intra Prediction
[0109] Similar to intra prediction in HEVC, all intra modes (i.e., the planar mode, the DC mode, and the angular intra mode) in VVC use a set of reference sample points above and to the left of the current video block for intra prediction. However, different from HEVC which only uses the nearest reference sample row / column (i.e., the zeroth row 201 in Figure 7 ), MRL intra prediction is introduced in VVC, in which, in addition to the nearest reference sample row / column, two additional reference sample rows / columns (i.e., the first row 203 and the third row 205 in Figure 7 ) can also be used for intra prediction. The index of the selected reference sample row / column is signaled from the video encoder 20 to the video decoder 30. When a non-nearest reference sample row / column is selected (e.g., Figure 7When in the first row 203 or the third row 205), the planar mode is excluded from the set of intra prediction modes that can be used to predict the current video block. For the first row / column video blocks within the current CTU, MRL intra prediction is disabled to prevent the use of extended reference samples outside the current CTU.
[0110] PDPC
[0111] As mentioned before, the intra prediction samples are generated based on a set of neighboring reference samples, which may introduce discontinuities at the block boundaries between the current video block and its neighboring video blocks. The PDPC tool is introduced in VVC to address such issues by adopting a weighted combination of the intra prediction samples and the boundary reference samples. In VVC, PDPC can be enabled for the following intra modes without signaling: planar mode, DC mode, angular intra modes with indices less than or equal to the index of the horizontal intra mode (i.e., mode 18), and angular intra modes with indices greater than or equal to the index of the vertical intra mode (i.e., mode 50) and less than or equal to 80. If the block differential pulse code modulation (BDPCM) mode is applied to the current block or the index of the selected reference sample row / column for MRL intra prediction is greater than 0, PDPC is not applied. Assuming that the predicted sample of the current sample located at coordinates (x, y) is pred(x,y), the corrected predicted sample pred'(x,y) after performing PDPC can be calculated as follows:
[0112] pred'(x,y) = Clip3(0, (1 << BitDepth) – 1, (wL × R -1,y' + wT × R x',-1 +(64 - wL - wT) × pred(x,y)+32) >> 6) (1)
[0113] where Bitdepth represents the bit depth of the sample, Rx',-1 and R-1,y' represent the reference samples located at the upper boundary and the left boundary of the current sample respectively, wL and wT are weights adaptively selected according to the intra mode and block size of the current block, ">>" represents the bitwise right shift operation, and "<<" represents the bitwise left shift operation.
[0114] The function Clip3(x,y,z) in Equation (1) can be defined as follows:
[0115]
[0116] Figure 8A and Figure 8BSketches of reference samples for PDPC in the upper - right diagonal mode and the lower - left diagonal mode are shown respectively. The prediction sample pred(x, y) is located at (x, y) within the prediction block. The reference sample Rx', - 1 has an abscissa x' = x + y + 1 and an ordinate - 1, and the reference sample R - 1, y' has an abscissa - 1 and an ordinate y' = x + y + 1.
[0117] ISP Prediction
[0118] ISP prediction is a tool applied to the intra - prediction mode of the luminance frame. This tool divides the luminance video block vertically or horizontally into 2 or 4 sub - partitions according to the block size of the luminance video block, as shown in Table 2. For example, the minimum block size of ISP is 4×8 or 8×4. Figure 9A and Figure 9B Sketches of sub - partitions depending on the block size are shown. If the block size W×H of the video block (e.g., the video block 401 as Figure 9A shown) is equal to 4×8 or 8×4, the video block is divided into 2 sub - partitions. If the block size W×H of the video block (e.g., the video block 403 as Figure 9B shown) is greater than 4×8 or 8×4, the video block is divided into 4 sub - partitions. The CU size that can use ISP is limited to a maximum of 64×64. All sub - partitions meet the condition of having at least 16 samples.
[0119] Table 2
[0120] Block Size Number of Sub - partitions 4×4 Not Divided 4×8 and 8×4 2 All Other Feasible Cases 4
[0121] For each sub - partition, the reconstructed sample is obtained by adding the residual signal to the prediction signal. Here, the residual signal is generated through processes such as entropy decoding, inverse quantization, and inverse transformation. The reconstructed samples of each sub - partition can be used to generate the prediction of the next sub - partition. Additionally, the first sub - partition to be processed is the sub - partition containing the upper - left sample of the CU, and after processing the first sub - partition, continue downward (for horizontal splits such as Figure 9A and Figure 9B shown) or to the right (for vertical splits such as Figure 9A and Figure 9B shown) for ISP prediction. All sub - partitions share the same intra - prediction mode.
[0122] CCLM Prediction
[0123] To reduce cross - component redundancy, the CCLM prediction mode is used in VVC, where the chrominance samples of the CU are predicted based on the reconstructed luminance samples rec L (i, j) using the following linear model:
[0124] pred C (i,j) = α·rec L ′(i,j) + β (3)
[0125] where pred C (i,j) represents the predicted chrominance sample in the CU, and rec L ′(i,j) represents the downsampled reconstructed luminance sample of the CU obtained by downsampling the reconstructed luminance sample rec L (i,j), and α and β are linear model coefficients, which are obtained based on at most four neighboring chrominance samples and their corresponding downsampled luminance samples. Assuming the size of the current chrominance block is W×H, then W' and H' can be obtained as follows::
[0126] When applying the LM mode, W' = W, H' = H;
[0127] When applying the LM_A mode, W' = W + H;
[0128] When applying the LM_L mode, H' = H + W.
[0129] Among them, in the LM mode, the upper sample and the left sample of the CU are used together to calculate the linear model coefficients; in the LM_A mode, only the upper sample of the CU is used to calculate the linear model coefficients; and in the LM_L mode, only the left sample of the CU is used to calculate the linear model coefficients.
[0130] If the positions of the upper samples of the chrominance block are represented as S[0, -1]…S[W' - 1, -1] and the positions of the left samples of the chrominance block are represented as S[-1, 0]…S[-1, H' - 1], then the positions of the four neighboring chrominance samples are selected as follows::
[0131] When applying the LM mode and both the upper sample and the left sample are available, select S[W' / 4, -1], S[3*W' / 4, -1], S[-1, H' / 4], and S[-1, 3*H' / 4] as the positions of the four neighboring chrominance samples;
[0132] When applying the LM_A mode and the upper sample is available or when only the upper sample is available, select S[W' / 8, -1], S[3*W' / 8, -1], S[5*W' / 8, -1], and S[7*W' / 8, -1] as the positions of the four neighboring chrominance samples;
[0133] When applying the LM_L mode and the left sample is available or when only the left sample is available, select S[-1, H' / 8], S[-1, 3*H' / 8], S[-1, 5*H' / 8], and S[-1, 7*H' / 8] as the positions of the four neighboring chrominance samples.
[0134] Four neighboring luma samples corresponding to the selected position are obtained through a downsampling operation, and the four obtained neighboring luma samples are compared four times to find two larger values: X0A and X1A, and two smaller values: X0B and X1B. The chroma sample values corresponding to these two larger values and these two smaller values are represented as y0A, y1A, y0B, and y1B, respectively. Then Xa, Xb, Ya, and Yb are obtained as follows:
[0135]
[0136] Finally, the linear model coefficients α and β are obtained according to the following formula.
[0137]
[0138] β = Y b -α·X b
[0139] Figure 10 The position diagrams of the left samples and the upper samples of the CUs involved in the CCLM mode are shown, including the positions of the left samples and the upper samples of the N×N chroma block 501 in the CU and the positions of the left samples and the upper samples of the 2N×2N luma block 503 in the CU.
[0140] The above parameter calculation is performed as part of the decoding process, so no syntax elements are used to transfer the values of α and β from the video encoder 20 to the video decoder 30.
[0141] MIP
[0142] MIP is a newly added intra prediction method in VVC. In the MIP prediction method, a column of H reconstructed neighboring boundary samples on the left of a rectangular block with width W and height H and a row of W reconstructed neighboring boundary samples above the rectangular block are used as inputs, and the prediction signal of the samples of the rectangular block is generated based on the following three steps: averaging, matrix-vector multiplication, and linear interpolation, as Figure 11 shown.
[0143] The first step: averaging neighboring samples
[0144] Four samples or eight samples are determined by averaging the neighboring boundary samples bdrytop and bdryleft based on the block size and shape. For example, by averaging the neighboring boundary samples bdrytop and bdryleft according to a predefined rule, the neighboring boundary samples bdrytop and bdryleft are reduced to boundary samples and The predefined rule is determined based on the block size. Then, the reduced boundary sample points and are concatenated to form the reduced boundary vector bdry red . Thus, for a 4×4 block, the size of the reduced boundary vector bdry red is 4, while for blocks of all other shapes, the size of the reduced boundary vector bdry red is 8. If Indexmode refers to the MIP mode, the concatenation is defined as follows:
[0145]
[0146] Second step: Matrix-vector multiplication
[0147] By taking the averaged sample points in the reduced boundary vector bdry red as input, performing matrix-vector multiplication, and then adding an offset, a reduced prediction signal for the downsampled sample set in the original block is generated. In one or more examples, the reduced prediction signal pred red is calculated as:
[0148] pred red = A·bdry red + b (7)
[0149] Here, A is a matrix with W red ·H red rows and 4 columns (in the case of W = H = 4) or 8 columns (in all other cases). b is an offset vector of size W red ·H red .
[0150] Here, W red and H red are defined as:
[0151]
[0152] The matrix A and the offset vector b are taken from one of the sets S0, S1, S 2. . The index idx of the set S idx from which the matrix A and the offset vector b are taken is defined as follows:
[0153]
[0154] Here, each coefficient of the matrix A is represented with 8-bit precision. The set S0 consists of 16 matrices and 16 offset vectors Constitution, where each matrix has 16 rows and 4 columns, and the size of each offset vector is 16, i ∈ {0, …, 15}. The matrices and offset vectors of this set are used for blocks of size 4×4. Set S1 consists of 8 matrices and 8 offset vectors Constitution, where each matrix has 16 rows and 8 columns, and the size of each offset vector is 16, i ∈ {0, …, 7}. Set S2 consists of 6 matrices and 6 offset vectors Constitution, where each matrix has 64 rows and 8 columns, and the size of each offset vector is 64, i ∈ {0, …, 5}.
[0155] Third step: Interpolation
[0156] The predicted signals at the remaining positions are generated by linear interpolation based on the reduced predicted signals of the downsampled sample set, where the linear interpolation is single-step linear interpolation in each direction. Regardless of the block shape or block size, the interpolation is first performed in the horizontal direction and then in the vertical direction.
[0157] Intra Template Matching Prediction
[0158] Intra Template Matching Prediction (Intra TMP) is a special intra prediction mode that copies the best predicted block that matches the L-shaped template from the reconstructed part of the current frame. For a predefined search range, the encoder searches for the template most similar to the current template in the reconstructed part of the current frame and uses the corresponding block as the predicted block. The encoder then signals the use of this mode, and the same prediction operation is performed on the decoder side.
[0159] By matching the L-shaped causal neighbors of the current block with Figure 12 another block in the predefined search area in, the predefined search area consists of the following:
[0160] · R1: Current CTU
[0161] · R2: Top-left CTU
[0162] · R3: Upper CTU
[0163] · R4: Left CTU
[0164] Sum of Absolute Differences (SAD) is used as the cost function.
[0165] Within each region, the decoder searches for the template with the minimum SAD relative to the current template and uses its corresponding block as the predicted block.
[0166] The sizes of all regions (SearchRange_w, SearchRange_h) are set proportionally to the block sizes (BlkW, BlkH) so that each pixel has a fixed number of SAD comparisons. That is:
[0167] SearchRange_w = a * BlkW
[0168] SearchRange_h = a * BlkH
[0169] Where 'a' is a constant that controls the gain / complexity trade-off. In practice, 'a' is equal to 5.
[0170] For CUs with width and height dimensions less than or equal to 64, the intra-frame template matching tool is enabled. This maximum CU size for intra-frame template matching is configurable.
[0171] When the current CU does not use DIMD, the intra-frame template matching prediction mode is signaled at the CU level through a dedicated flag.
[0172] Although existing intra-frame TMP schemes can provide significant improvements in intra-frame coding and decoding in ECM, their designs can still be further improved. For example, the present disclosure realizes that the current intra-frame TMP design has the following defects:
[0173] In the current intra-frame TMP, only integer-pixel-based template search is utilized, while fractional interpolation is ignored, that is, only integer-pixel template matching blocks are used as prediction blocks. As is well known, fractional interpolation can improve the prediction accuracy of inter-frame prediction. Therefore, ignoring fractional interpolation makes the current intra-frame TMP less effective.
[0174] In the current intra-frame TMP, only one hypothesis is utilized, that is, the best matching block that results in the minimum matching cost is selected as the final prediction. However, a single hypothesis may be vulnerable to noise, making the prediction less accurate. In addition, it has been shown that in inter-frame prediction, introducing multiple hypotheses can improve the prediction accuracy. Based on the above analysis, it is reasonable to provide examples of implementing intra-frame TMP based on multiple hypotheses.
[0175] In the present disclosure, methods for further improving the compression efficiency of intra-frame TMP in ECM are provided. Overall, the main features of the methods provided in the present disclosure are summarized as follows:
[0176] To improve the prediction accuracy of intra-frame TMP, the decoder / encoder can utilize fractional-pixel template matching. The integer template matching block can be further refined by using fractional interpolation.
[0177] To improve the accuracy of intra-frame TMP, examples of intra-frame TMP schemes based on multiple hypotheses are provided. In some examples, multiple template matching blocks are searched and weighted to generate a final prediction block. According to the derivation of the weighting factor, the provided multiple-hypothesis intra-frame TMP can be classified into two categories: fixed multiple-hypothesis intra-frame TMP and adaptive intra-frame TMP.
[0178] Fractional Intra TMP
[0179] In the current intra-frame TMP mode, an L-shaped template is used to search for a prediction block from the reconstructed region in the current frame. During the template matching process, the best prediction block that results in the minimum matching cost is identified and used as the final prediction block. In the current example of intra-frame TMP, the template matching is based on integer pixels. To further improve the codec performance of the intra-frame TMP mode, in the present disclosure, examples of using fractional pixel template matching for the intra-frame TMP mode are provided. The interpolation accuracy of the fractional pixel template matching can be, but is not limited to, half-pixels, quarter-pixels, etc.
[0180] In one or another embodiment, an index value can be signaled in the bitstream to indicate the interpolation accuracy used. The interpolation accuracy index can be signaled at the PPS, SPS, or slice header.
[0181] In one or another embodiment, fractional intra-frame TMP can be divided into two steps. In the first step, the template matching process in the current ECM is performed to identify the best integer prediction template. In the second step, interpolation is performed on the fractional templates around the integer template, and fractional pixel template matching is performed. Figure 13 Examples of half-pixel template matching are provided, where A i,j represents an integer pixel, and b i,j , h i,j and j i,j represent half-pixels. After the best integer prediction template is identified, interpolation is then performed on eight half-pixel prediction templates. The distances between the current template and the best integer prediction template and the eight half-pixel prediction templates are calculated and compared. The prediction template that results in the minimum template matching cost is identified and used as the best prediction template. The corresponding prediction block of the best prediction template is used as the final prediction of the current block.
[0182] Multiple Hypothesis Intra TMP
[0183] In the current ECM, only the best template matching block that results in the minimum template matching cost is used for prediction. In some examples, optional template matching blocks are selected based on the ascending order of the template matching cost, and the template that results in a lower template matching cost than the template matching costs of other candidates is selected as the best template matching block / CU. To further improve the prediction accuracy of intra TMP, a multiple hypothesis prediction method is provided in the present disclosure. In multiple hypothesis intra TMP, more than one prediction block candidate is used and weighted to generate the final prediction of the current block. Assume that N prediction block candidates are used.
[0184] Derivation of prediction block candidates
[0185] In one and another embodiment, prediction block candidates are searched for and selected according to the criterion of minimizing the template matching cost, that is, the top N candidates with the minimum template matching cost are selected. The template matching cost may not be limited to SAD (Sum of Absolute Differences) and SSE (Sum of Squared Errors).
[0186] Fixed multiple hypothesis intra TMP
[0187] In this embodiment, the weighting factors used to generate the final prediction block are predefined and fixed on both the encoder side and the decoder side. As an example, equal weighting factors can be used, that is, the weighting factor for all candidate blocks is 1 / N.
[0188] Adaptive multiple hypothesis intra TMP
[0189] To adapt to different characteristics of video content, examples of the adaptive multiple hypothesis intra TMP method are also provided.
[0190] Method 1
[0191] In one and another embodiment, the weighting factors can be derived based on the template matching cost. Represent the template matching costs of the N candidates as C1, C2, …, C N , and the weighting factors are calculated according to the following formula.
[0192]
[0193] It should be noted that SAD and SSE (but not limited to) can be used to measure the template matching cost.
[0194] Method 2
[0195] In yet another embodiment, the weighting factors can be derived on the encoder side and then signaled in the bitstream to the decoder. Represent the N prediction block candidates as P1, P2, …, P N and represent the current block as X, then the weighting factors can be solved by the following formula:
[0196]
[0197] Equation (12) can be solved using the Wiener-Hopf equation as the ALF. Then, the derived filter coefficients are quantized to an integer type and transmitted with the signal at the block level.
[0198] Method 3
[0199] In yet another embodiment, the weighting factors are derived based on templates, and the derived weighting factors are applied to the prediction block candidates to generate the final prediction block. Represent the templates of the prediction candidates as T1, T2, …, T N and represent the template of the current block as T. Then, the weighting factors can be derived using the following formula:
[0200]
[0201] Equation (13) can be solved using the Wiener-Hopf equation. Then, the final prediction block can be calculated as where P i represents the i-th prediction block candidate.
[0202] Method 4
[0203] The Intra TMP mode utilizes non-local correlation to improve the prediction accuracy, where similar blocks are searched for and used to generate the final prediction block. In this embodiment, an example of combining non-local mean filtering with multiple hypothesis Intra TMP is provided and described as follows. In the first step, N prediction block candidates are searched for and identified as in the Intra TMP of ECM. In the second step, the weighting factors are calculated according to the following formula.
[0204]
[0205] where D i is used to measure the distance between the template of the i-th prediction block candidate and the template of the current block, h is used as the weighting strength, and Z[i] is the normalization constant:
[0206]
[0207] To calculate the weighting factors in Equation (14), the weighting strength or the weighting intensity should be determined first. In the present disclosure, several methods are provided to determine the weighting intensity.
[0208] In the first method, a weighting intensity candidate list composed of some typical weighting intensity values is defined and fixed on both the encoder and decoder sides. On the encoder side, rate-distortion optimization is used to check the weighting intensity values, identify the optimal weighting intensity value, and signal it to the decoder side in the bitstream.
[0209] In the second method, the weighted strength value is estimated using the templates of the prediction block candidates and the template of the current block. Denote the templates of the prediction candidates as t1, T2, …, T N and denote the template of the current block as T. Then, the weighted strength value can be solved using the following formula:
[0210]
[0211] In the third method, the weighted strength value can be estimated using the QP value and the variance of the template of the current block, that is, the relationship between the weighted strength value, the QP value, and the template variance can be fitted offline.
[0212] Method 5
[0213] To better utilize the non-local correlation in the intra-TMP, in this embodiment, singular value decomposition (SVD) is used to generate the final prediction block from the prediction block candidates. Denote the width and height of the current block as W and H, and the area of the current block as d = H × W.
[0214] Step 1. Search for and identify K prediction block candidates y i , as performed in the intra-TMP of ECM.
[0215] Step 2. The K prediction block candidates of the current block y form a block group G and are arranged as a matrix:
[0216]
[0217] where, Y G is a matrix of size d × K by arranging each candidate in group G as a column vector.
[0218] Step 3. Perform SVD decomposition on the matrix Y G
[0219]
[0220] Step 4. Apply a soft-thresholding operation to the singular value matrix Λ G
[0221]
[0222] where, softTh() is a function that shrinks the diagonal elements of Λ G using the threshold τ. For the k-th diagonal element in Λ G , it is shrunk through a non-linear function D τ(k) at the level τ(k):
[0223] D τ(k) : λ k,τ(k) = max(|λ k | - τ(k), 0) (20)
[0224] Λ G,τ is a matrix composed of the post - contraction singular values λ k,τ(k) located on the diagonal positions.
[0225] Step 5. Perform the inverse SVD to obtain the filtered block group.
[0226]
[0227] One of the key steps is to determine the threshold for each diagonal element in Step 4. In the present disclosure, the threshold is calculated as follows. For each group of image blocks, the threshold is estimated using the following formula:
[0228]
[0229] where σ n,G is the standard deviation of the noise, and σ x,G,k is the standard deviation of the original block in the k - th dimension of the SVD space of group G. The deviation of the original block in the SVD space is estimated according to the following formula.
[0230]
[0231] where is the k - th singular value. When σ x,G,k is zero, the soft - threshold operation is skipped. Additionally, a power function parameterized by α and β is used to estimate the deviation of the noise using the deviation of the predicted block.
[0232] σ n = α×σ y β (24)
[0233] where σ y is calculated as follows,
[0234]
[0235] Here, y k (i) represents the i - th pixel of the predicted block candidate vector y k .
[0236] Multi - hypothesis intra - frame TMP signal transmission
[0237] In the present disclosure, the provided multi - hypothesis intra - frame TMP can be used as an alternative to the current intra - frame TMP mode, or the encoder can adaptively select the intra - frame TMP mode or the multi - hypothesis intra - frame TMP mode.
[0238] In one and another embodiment, the provided multiple hypothesis intra TMP is used as an alternative to the current intra TMP mode, i.e., multiple hypotheses are always used for prediction.
[0239] In yet another embodiment, one of the multiple hypothesis intra TMP methods in the above section is used in combination with the current intra TMP mode in ECM. A flag is signaled in the bitstream to indicate whether the multiple hypothesis intra TMP mode is applied to a CU.
[0240] In yet another embodiment, more than one multiple hypothesis intra TMP method in the above section is used in combination with the current intra TMP mode in ECM. First, a flag is signaled in the bitstream to indicate whether the multiple hypothesis intra TMP mode is applied. Then, an index is signaled to indicate which one of the multiple hypothesis intra TMP methods is applied to a CU.
[0241] Figure 14 A flowchart of a video decoding method according to an example of the present disclosure is shown.
[0242] In step 1401, at the decoder side, the processor 1620 may obtain a current template of a current coding unit (CU) encoded using an intra template matching prediction (TMP) mode. Intra TMP is a special intra prediction mode that copies an L-shaped template from the reconstructed part of the current frame to match the best prediction block with the current template.
[0243] In step 1402, the processor 1620 may obtain the best integer prediction template. In some examples, the processor 1620 may obtain the best integer prediction template by performing a template matching process in the current ECM.
[0244] In step 1403, the processor 1620 may obtain a fractional pixel prediction template.
[0245] In step 1404, the processor 1620 may obtain a final prediction of the current CU based on the distances between the current template and the best integer prediction template and the fractional pixel prediction template.
[0246] In some examples, the fractional pixel prediction template may include a half-pixel template and / or a quarter-pixel template. For example, the fractional pixel prediction template may include a half-pixel template, a quarter-pixel template, or both a half-pixel template and a quarter-pixel template. In some examples, the processor 1620 may use a fractional value between 0 and 1 for the fractional pixel prediction template, where the fractional value is not 1 / 2 or 1 / 4.
[0247] In some examples, the processor 1620 may obtain an index value signaled in a bitstream, where the index value indicates interpolation accuracy. In some examples, the processor 1620 may further obtain a fractional pixel prediction template based on the interpolation accuracy. In some examples, the index value may be signaled at a specific level including a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), or a slice header.
[0248] In some examples, the processor 1620 may interpolate fractional templates around the best integer prediction template in step 1403 and may perform fractional pixel template matching in step 1404. In some examples, the processor 1620 may interpolate eight half-pixel prediction templates. In some examples, the processor 1620 may perform fractional template matching as Figure 13 shown, where A i,j represents an integer pixel, and b i,j 、h i,j and j i,j represent half pixels.
[0249] In some examples, to perform fractional pixel template matching in step 1404, the processor 1620 may calculate a first distance between the current template and the best integer prediction template, calculate a number of second distances between the current template and fractional pixel prediction templates, compare the first distance with the number of second distances, identify the best prediction template that results in the minimum template matching cost and the predicted CU corresponding to the best prediction template, and set the predicted CU as the final prediction.
[0250] Figure 15 is a flowchart illustrating a video encoding method corresponding to the video decoding method as Figure 14 shown.
[0251] In step 1501, on the encoder side, the processor 1620 may encode the current template of the current coding unit (CU) encoded in the Intra Template Matching Prediction (TMP) mode. In some examples, the processor 1620 may encode the current template of the current coding unit (CU) based on the Intra TMP mode. Intra TMP is a special intra prediction mode that copies the best prediction block where an L-shaped template in the reconstructed part of the current frame matches the current template.
[0252] In step 1502, the processor 1620 may obtain the best integer prediction template. In some examples, the processor 1620 may obtain the best integer prediction template by performing a template matching process in the current ECM.
[0253] In step 1503, the processor 1620 may obtain the fractional pixel prediction template.
[0254] In step 1504, the processor 1620 may obtain the final prediction of the current CU based on the distance between the current template and the best integer prediction template and the fractional pixel prediction template.
[0255] In step 1505, the processor 1620 may transmit the current CU encoded based on the intra TMP mode to the decoder.
[0256] In some examples, the fractional pixel prediction template may include a half - pixel template and / or a quarter - pixel template. For example, the fractional pixel prediction template may include a half - pixel template, a quarter - pixel template, or both a half - pixel template and a quarter - pixel template. In some examples, the processor 1620 may use a fractional value between 0 and 1 for the fractional pixel prediction template, where the fractional value is not 1 / 2 or 1 / 4.
[0257] In some examples, the processor 1620 may signal an index value in the bitstream, where the index value indicates interpolation accuracy. In some examples, the processor 1620 may further obtain the fractional pixel prediction template based on the interpolation accuracy. In some examples, the index value may be signaled at a specific level including a picture parameter set (PPS), a sequence parameter set (SPS), or a slice header.
[0258] In some examples, the processor 1620 may interpolate the fractional templates around the best integer prediction template in step 1503 and may perform fractional pixel template matching in step 1504. In some examples, the processor 1620 may interpolate eight half - pixel prediction templates. In some examples, the processor 1620 may perform fractional template matching as Figure 13 shown, where A i,j represents an integer pixel, and b i,j 、h i,j and j i,j represent half - pixels.
[0259] In some examples, to perform fractional pixel template matching in step 1504, the processor 1620 may calculate a first distance between the current template and the best integer prediction template, calculate a number of second distances between the current template and the fractional pixel prediction templates, compare the first distance and the number of second distances, identify the best prediction template resulting in the minimum template matching cost and the predicted CU corresponding to the best prediction template, and set the predicted CU as the final prediction.
[0260] Figure 16 is a flowchart illustrating a video decoding method according to an example of the present disclosure.
[0261] In step 1601, on the decoder side, the processor 1620 may obtain a current coding unit (CU) encoded in an intra template matching prediction (TMP) mode. Intra TMP is a special intra prediction mode that copies an L-shaped template from the reconstructed part of the current frame to match the best prediction block with the current template.
[0262] In step 1602, the processor 1620 may obtain a plurality of predicted CU candidates. In some examples, performing step 1602 may improve the prediction accuracy of intra TMP.
[0263] In step 1603, the processor 1620 may obtain a final prediction of the current CU based on the plurality of predicted CU candidates.
[0264] In some examples, in step 1602, the processor 1620 may search for a plurality of CU candidates whose template matching cost is lower than the template matching costs of other candidates, and then select these plurality of CU candidates as the above-mentioned plurality of predicted CU candidates. In some examples, the template matching cost may be measured by one of the sum of absolute differences (SAD) or the sum of squared errors (SSE).
[0265] In some examples, in step 1603, the processor 1620 may obtain a plurality of weights corresponding to the above-mentioned plurality of predicted CU candidates, and obtain a final prediction of the current CU based on the above-mentioned plurality of predicted CU candidates and the above-mentioned plurality of weights. In some examples, the processor 1620 may obtain the above-mentioned plurality of weights based on fixed multiple hypothesis intra TMP. In some examples, the processor 1620 may obtain the above-mentioned plurality of weights based on adaptive multiple hypothesis intra TMP.
[0266] In some examples, in step 1603, the processor 1620 may set each of the above-mentioned plurality of weights to the reciprocal of an integer N, where N is the number of the above-mentioned plurality of predicted CU candidates. In the example described in this paragraph, the processor 1620 obtains the above-mentioned plurality of weights based on fixed multiple hypothesis intra TMP.
[0267] In some examples, in step 1603, the processor 1620 may calculate the above-mentioned plurality of weights based on a plurality of template matching costs. In some examples, the processor 1620 may obtain a plurality of predicted CU template matching costs of the above-mentioned plurality of predicted CU candidates, and obtain the above-mentioned plurality of weights based on the above-mentioned plurality of predicted CU template matching costs. In some examples, the above-mentioned plurality of template matching costs may be measured by one of the sum of absolute differences (SAD) or the sum of squared errors (SSE). In the example described in this paragraph, the processor 1620 obtains the above-mentioned plurality of weights based on adaptive multiple hypothesis intra TMP.
[0268] In some examples, at step 1603, the processor 1620 may receive the above-mentioned multiple weights signaled by the encoder in the bitstream. In the example described in this paragraph, the processor 1620 obtains the above-mentioned multiple weights based on the adaptive multiple hypothesis intra TMP.
[0269] In some examples, at step 1603, the processor 1620 may obtain the above-mentioned multiple weights based on multiple templates. In some examples, the processor 1620 may obtain multiple prediction CU templates of the above-mentioned multiple prediction CU candidates, obtain a current CU template of the current CU, and obtain the above-mentioned multiple weights based on the above-mentioned multiple prediction CU templates and the above-mentioned current CU template. In some examples, the processor 1620 may solve the Wiener-Hopf equation to obtain the above-mentioned multiple weights based on the above-mentioned multiple prediction CU templates and the above-mentioned current CU template. In the example described in this paragraph, the processor 1620 obtains the above-mentioned multiple weights based on the adaptive multiple hypothesis intra TMP.
[0270] In some examples, at step 1603, the processor 1620 may use non-local mean filtering to obtain the above-mentioned multiple weights. In some examples, in order to use non-local mean filtering to obtain the above-mentioned multiple weights, the processor 1620 may obtain multiple distances based on the above-mentioned multiple prediction CU candidates and the current CU, and obtain the above-mentioned multiple weights based on the above-mentioned multiple distances and the weighting degree. In some examples, the processor 1620 may further determine the weighting strength or the strength of weighting. In the example described in this paragraph, the processor 1620 obtains the above-mentioned multiple weights based on the adaptive multiple hypothesis intra TMP.
[0271] In some examples, in order to determine the weighting strength, the processor 1620 may define and fix a list of weighting strength candidates including multiple typical weighting strength values, and select one typical weighting strength value as the optimal weighting strength value based on a flag signaled in the bitstream. Alternatively or additionally, the processor 1620 may receive the optimal weighting strength value identified by the encoder and signaled in the bitstream.
[0272] In some examples, in order to determine the weighting strength, the processor 1620 may obtain multiple prediction CU templates of the above-mentioned multiple prediction CU candidates, obtain a current CU template of the current CU, and estimate the weighting strength based on the above-mentioned multiple prediction CU templates and the above-mentioned current CU template.
[0273] In some examples, in order to determine the weighting strength, the processor 1620 may use the quantization parameter (QP) value and the variance of the current CU template of the current CU to estimate the weighting strength. In some examples, the processor 1620 may further fit the relationship between the weighting strength, the QP value and the variance of the current CU template offline.
[0274] In some examples, in step 1603, the processor 1620 may perform singular value decomposition (SVD) on a matrix generated from the multiple predicted CU candidates described above, and obtain a final prediction based on the result of performing the SVD.
[0275] In some examples, to perform the SVD, the processor 1620 may obtain a block group matrix based on the multiple predicted CU candidates described above, perform the SVD on the block group matrix, obtain a first decomposition result matrix, a second decomposition result matrix, and a third decomposition result matrix, obtain a fourth decomposition result matrix from the second decomposition result matrix, perform inverse SVD on the first decomposition result matrix, the fourth decomposition result matrix, and the third decomposition result matrix, and obtain a filtered block group. Additionally, in these examples, the processor 1620 may obtain the final prediction of the current CU based on the filtered block group in step 1603.
[0276] In some examples, to perform the SVD, the processor 1620 may apply a soft threshold operation to the second decomposition result matrix. In some examples, the processor 1620 may further determine a plurality of thresholds corresponding to the diagonal elements of the second decomposition result matrix.
[0277] In some examples, the processor 1620 may receive a flag signaled in a bitstream, where the flag indicates that the multiple hypothesis intra TMP mode is applied to the current CU. In some examples, the processor 1620 may further receive an index signaled in the bitstream, where the index indicates the multiple hypothesis intra TMP method applied to the current CU.
[0278] Figure 17 is a flowchart illustrating a video encoding method corresponding to a video decoding method as Figure 16 shown.
[0279] In step 1701, on the encoder side, the processor 1620 may encode a current coding unit (CU) based on an intra template matching prediction (TMP) mode. Intra TMP is a special intra prediction mode that copies an L-shaped template from a reconstructed portion of the current frame to match the best prediction block of the current template.
[0280] In step 1702, the processor 1620 may obtain multiple predicted CU candidates. In some examples, performing step 1702 may improve the prediction accuracy of intra TMP.
[0281] In step 1703, the processor 1620 may obtain the final prediction of the current CU based on the multiple predicted CU candidates.
[0282] In step 1704, the processor 1620 may transmit the current CU encoded based on the intra TMP mode to the decoder.
[0283] In some examples, in step 1702, the processor 1620 may search for multiple CU candidates whose template matching cost is lower than that of other candidates, and then select the multiple CU candidates as the multiple predicted CU candidates. In some examples, the template matching cost may be measured by one of the sum of absolute differences (SAD) or the sum of squared errors (SSE).
[0284] In some examples, in step 1703, the processor 1620 may obtain multiple weights corresponding to the multiple predicted CU candidates, and obtain the final prediction of the current CU based on the multiple predicted CU candidates and the multiple weights. In some examples, the processor 1620 may obtain the multiple weights based on fixed multiple hypothesis intra TMP. In some examples, the processor 1620 may obtain the multiple weights based on adaptive multiple hypothesis intra TMP.
[0285] In some examples, in step 1703, the processor 1620 may set each weight among the multiple weights to the reciprocal of an integer N, where N is the number of the multiple predicted CU candidates. In these examples, the processor 1620 obtains the multiple weights based on fixed multiple hypothesis intra TMP.
[0286] In some examples, in step 1703, the processor 1620 may calculate the multiple weights based on multiple template matching costs. In some examples, the processor 1620 may obtain multiple predicted CU template matching costs of the multiple predicted CU candidates, and obtain the multiple weights based on the multiple predicted CU template matching costs. In some examples, the multiple template matching costs may be measured by one of the sum of absolute differences (SAD) or the sum of squared errors (SSE). In the examples described in this paragraph, the processor 1620 obtains the multiple weights based on adaptive multiple hypothesis intra TMP.
[0287] In some examples, in step 1703, the processor 1620 may obtain the multiple weights based on the multiple predicted CU candidates and the current CU, and may signal the multiple weights in the bitstream. In the examples described in this paragraph, the processor 1620 obtains the multiple weights based on adaptive multiple hypothesis intra TMP.
[0288] In some examples, in step 1703, the processor 1620 may obtain the above-mentioned multiple weights based on multiple templates. In some examples, the processor 1620 may obtain multiple prediction CU templates of the above-mentioned multiple predicted CU candidates, obtain a current CU template of the current CU, and obtain the above-mentioned multiple weights based on the above-mentioned multiple prediction CU templates and the above-mentioned current CU template. In some examples, the processor 1620 may obtain the above-mentioned multiple weights based on the above-mentioned multiple prediction CU templates and the above-mentioned current CU template by solving the Wiener-Hopf equation. In the examples described in this paragraph, the processor 1620 obtains the above-mentioned multiple weights based on the adaptive multiple hypothesis intra TMP.
[0289] In some examples, in step 1703, the processor 1620 may use non-local means filtering to obtain the above-mentioned multiple weights. In some examples, in order to use non-local means filtering to obtain the above-mentioned multiple weights, the processor 1620 may obtain multiple distances based on the above-mentioned multiple predicted CU candidates and the current CU, and obtain the above-mentioned multiple weights based on the above-mentioned multiple distances and the weighting degree. In some examples, the processor 1620 may further determine the weighting strength or the strength of weighting. In the examples described in this paragraph, the processor 1620 obtains the above-mentioned multiple weights based on the adaptive multiple hypothesis intra TMP.
[0290] In some examples, in order to determine the weighting strength, the processor 1620 may define and fix a weighting strength candidate list including multiple typical weighting strength values, check the above-mentioned multiple typical weighting strength values using rate-distortion optimization, identify the best weighting strength value, and signal the best weighting strength value in the bitstream.
[0291] In some examples, in order to determine the weighting strength, the processor 1620 may obtain multiple prediction CU templates of the above-mentioned multiple predicted CU candidates, obtain a current CU template of the current CU, and estimate the weighting strength based on the above-mentioned multiple prediction CU templates and the above-mentioned current CU template.
[0292] In some examples, in order to determine the weighting strength, the processor 1620 may use the quantization parameter (QP) value and the variance of the current CU template of the current CU to estimate the weighting strength. In some examples, the processor 1620 may further offline fit the relationship between the weighting strength, the QP value, and the variance of the current CU template.
[0293] In some examples, in step 1703, the processor 1620 may perform singular value decomposition (SVD) on the matrix generated by the above-mentioned multiple predicted CU candidates, and obtain a final prediction based on the result of performing the SVD.
[0294] In some examples, to perform SVD, the processor 1620 may obtain a group-of-blocks matrix based on the multiple predicted CU candidates described above, perform SVD on the group-of-blocks matrix, obtain a first decomposition result matrix, a second decomposition result matrix, and a third decomposition result matrix, obtain a fourth decomposition result matrix from the second decomposition result matrix, perform inverse SVD on the first decomposition result matrix, the fourth decomposition result matrix, and the third decomposition result matrix, and obtain a filtered group of blocks. Additionally, in these examples, the processor 1620 may obtain a final prediction for the current CU based on the filtered group of blocks in step 1703.
[0295] In some examples, to perform SVD, the processor 1620 may apply a soft threshold operation to the second decomposition result matrix. In some examples, the processor 1620 may further determine a plurality of thresholds corresponding to the diagonal elements of the second decomposition result matrix.
[0296] In some examples, the processor 1620 may receive a flag signaled in a bitstream, where the flag indicates that the multiple-hypothesis intra TMP mode is applied to the current CU. In some examples, the processor 1620 may further receive an index signaled in the bitstream, where the index indicates the multiple-hypothesis intra TMP method applied to the current CU.
[0297] In some examples, there is provided an apparatus for video coding and decoding. The apparatus includes a processor 1620 and a memory 1640, the memory being configured to store instructions executable by the processor; wherein, when executing the instructions, the processor is configured to perform any of the methods as Figures 14 to 17 shown.
[0298] In an embodiment, there is also provided a non-transitory computer-readable storage medium including, for example, a plurality of programs in a memory 1630 and / or storing a bitstream generated by the above encoding method or a bitstream to be decoded by the above decoding method, the plurality of programs being executable by a processor 1620 in a computing environment 1610 for performing the above methods. In one example, the plurality of programs may be executable by a processor 1620 in a computing environment 1610 to (e.g., from Figure 2The video encoder 20) in receives a bitstream or data stream including encoded video information (e.g., video blocks representing encoded video frames, and / or one or more associated syntax elements, etc.), and can also be executed by the processor 1620 in the computing environment 1610 to perform the above decoding method according to the received bitstream or data stream. In another example, multiple programs can be executed by the processor 1620 in the computing environment 1610 to perform the above encoding method to encode video information (e.g., video blocks representing video frames, and / or one or more associated syntax elements, etc.) into a bitstream or data stream, and can also be executed by the processor 1620 in the computing environment 1610 to (e.g., send Figure 3 the video decoder 30) in the bitstream or data stream. Alternatively, a non-transitory computer-readable storage medium can store a bitstream or data stream generated by an encoder (e.g., Figure 2 the video encoder 20) in using, for example, the above encoding method for use by a decoder (e.g., Figure 3 the video decoder 30) in in decoding video data, the bitstream or data stream including encoded video information (e.g., video blocks representing encoded video frames, and / or one or more associated syntax elements, etc.). The non-transitory computer-readable storage medium can be, for example, ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
[0299] In an embodiment, there is provided a bitstream generated by the above encoding method or a bitstream to be decoded by the above decoding method. In an embodiment, there is provided a bitstream including encoded video information generated by the above encoding method or encoded video information to be decoded by the above decoding method.
[0300] In an embodiment, there is further provided a computing device, the computing device including: one or more processors (e.g., the processor 1620); and a non-transitory computer-readable storage medium or memory 1630 in which multiple programs that can be executed by the one or more processors are stored, wherein the one or more processors are configured to execute the above method when executing the multiple programs.
[0301] In an embodiment, there is further provided a computer program product having instructions for storing or transmitting a bitstream, the bitstream including encoded video information generated by the above encoding method or encoded video information to be decoded by the above decoding method. In an embodiment, there is further provided a computer program product including multiple programs in, for example, the memory 1630, the multiple programs being executable by the processor 1620 in the computing environment 1610 to perform the above method. For example, the computer program product can include a non-transitory computer-readable storage medium.
[0302] In an embodiment, the computing environment 1610 may be implemented by one or more ASICs, DSPs, digital signal processing devices (DSPDs), programmable logic devices (PLDs), FPGAs, GPUs, controllers, microcontrollers, microprocessors, or other electronic components for performing the above methods.
[0303] In an embodiment, a method for storing a bitstream is also provided, including: storing a bitstream on a digital storage medium, where the bitstream includes encoded video information generated by the above encoding method or encoded video information to be decoded by the above decoding method.
[0304] In an embodiment, a method for transmitting the bitstream generated by the above encoder is also provided. In an embodiment, a method for receiving the bitstream to be decoded by the above decoder is also provided.
[0305] The description of the present disclosure is presented for purposes of illustration and is not intended to be exhaustive or limiting of the present disclosure. Many modifications, variations, and alternative embodiments will be apparent to those of ordinary skill in the art from the above description and the associated drawings.
[0306] Unless otherwise specifically stated, the order of the steps of the method according to the present disclosure is only illustrative, and the steps of the method according to the present disclosure are not limited to the specific order described above, but may be changed according to the actual situation. In addition, at least one of the steps of the method according to the present disclosure may be adjusted, combined, or deleted according to actual needs.
[0307] The examples are selected and described to explain the principles of the present disclosure and enable other technicians in the art to understand various embodiments of the present disclosure and best utilize the basic principles and various embodiments with various modifications suitable for the intended specific uses. Therefore, it should be understood that the scope of the present disclosure is not limited to the specific examples of the disclosed embodiments, and modifications and other embodiments are intended to be included within the scope of the present disclosure.
Claims
1. A video decoding method, comprising: obtaining, by a decoder, a current template of a current coding unit (CU) encoded in an intra-frame template matching prediction (TMP) mode; obtaining, by the decoder, an optimal integer prediction template; obtaining, by the decoder, a fractional pixel prediction template; and obtaining, by the decoder, a final prediction of the current CU based on distances between the current template, the optimal integer prediction template, and the fractional pixel prediction template.
2. The method according to claim 1, wherein The fractional pixel prediction template includes at least one of a half-pixel template or a quarter-pixel template.
3. The method according to claim 1, further comprising: obtaining, by the decoder, an index value signaled in a bitstream, wherein the index value indicates interpolation accuracy.
4. The method according to claim 3, wherein, Obtaining, by the decoder, the fractional pixel prediction template includes: obtaining, by the decoder, the fractional pixel prediction template based on the interpolation accuracy.
5. The method according to claim 3, wherein The index value is signaled at a specific level including a picture parameter set (PPS), a sequence parameter set (SPS), or a slice header.
6. The method according to claim 1, wherein, Obtaining, by the decoder, the fractional pixel prediction template includes: interpolating, by the decoder, fractional templates around the optimal integer prediction template; and wherein obtaining, by the decoder, the final prediction of the current CU includes: performing, by the decoder, template matching.
7. The method according to claim 6, wherein, Interpolating, by the decoder, fractional templates around the optimal integer prediction template includes: interpolating, by the decoder, eight half-pixel prediction templates.
8. The method according to claim 6, wherein, Performing, by the decoder, template matching includes: calculating, by the decoder, a first distance between the current template and the optimal integer prediction template; calculating, by the decoder, a plurality of second distances between the current template and the fractional pixel prediction template; comparing, by the decoder, the first distance with the plurality of second distances; identifying, by the decoder, an optimal prediction template that results in a minimum template matching cost and a prediction CU corresponding to the optimal prediction template based on a result of comparing, by the decoder, the first distance with the plurality of second distances; and setting, by the decoder, the prediction CU as the final prediction.
9. A video encoding method, comprising: encoding, by an encoder, a current template of a current coding unit (CU) encoded in an intra-frame template matching prediction (TMP) mode; obtaining, by the encoder, an optimal integer prediction template; obtaining, by the encoder, a fractional pixel prediction template; obtaining, by the encoder, a final prediction of the current CU based on distances between the current template, the optimal integer prediction template, and the fractional pixel prediction template; and transmitting, by the encoder, the current CU encoded based on the intra-frame TMP mode to a decoder.
10. The method according to claim 9, wherein, The fractional pixel prediction template includes at least one of a half-pixel template or a quarter-pixel template.
11. The method according to claim 9, further comprising: signaling, by the encoder, an index value in a bitstream, wherein the index value indicates interpolation accuracy.
12. The method according to claim 11, further comprising: The fractional pixel prediction template is obtained by the encoder based on the interpolation accuracy.
13. The method according to claim 11, wherein, The index value is signaled at a specific level including a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), or a slice header.
14. The method according to claim 9, wherein, Obtaining the fractional pixel prediction template by the encoder includes: the encoder interpolating a fractional template around the best integer prediction template; and wherein obtaining the final prediction of the current CU by the encoder includes: the encoder performing template matching.
15. The method according to claim 14, wherein, The encoder interpolating a fractional template around the best integer prediction template includes: The encoder interpolating eight half-pixel prediction templates.
16. The method according to claim 14, wherein, The encoder performing template matching includes: The encoder calculating a first distance between the current template and the best integer prediction template; The encoder calculating a second distance between the current template and the fractional pixel prediction template; The encoder comparing the first distance with the second distance; The encoder identifying the best prediction template that results in the minimum template matching cost and the prediction CU corresponding to the best prediction template based on the result of the decoder comparing the first distance with the plurality of second distances; and The encoder setting the prediction CU as the final prediction.
17. A video decoding method, comprising: The decoder obtaining a current coded unit (CU) encoded based on an intra-template matching prediction (TMP) mode; The decoder obtaining a plurality of prediction CU candidates; and The decoder obtaining the final prediction of the current CU based on the plurality of prediction CU candidates.
18. The method according to claim 17, further comprising: The decoder obtaining a plurality of weights corresponding to the plurality of prediction CU candidates; and wherein obtaining the final prediction of the current CU by the decoder based on the plurality of prediction CU candidates includes: The decoder obtaining the final prediction of the current CU based on the plurality of prediction CU candidates and the plurality of weights.
19. The method according to claim 17, wherein The decoder obtaining a plurality of prediction CU candidates includes: The decoder searching for a plurality of CU candidates having a lower template matching cost than the template matching costs of other candidates; and The decoder selecting the plurality of CU candidates as the plurality of prediction CU candidates.
20. The method according to claim 19, wherein, The template matching cost is measured by one of the Sum of Absolute Differences (SAD) or the Sum of Squared Errors (SSE).
21. The method according to claim 18, wherein, The decoder obtaining a plurality of weights corresponding to the plurality of prediction CU candidates includes: Setting each weight among the plurality of weights to the reciprocal of an integer N, where N is the number of the plurality of prediction CU candidates.
22. The method according to claim 18, wherein, The decoder obtaining a plurality of weights corresponding to the plurality of prediction CU candidates includes: The decoder calculating the plurality of weights based on a plurality of template matching costs.
23. The method according to claim 22, wherein, The decoder obtaining a plurality of weights corresponding to the plurality of prediction CU candidates further includes: Obtaining the plurality of prediction CU template matching costs of the plurality of prediction CU candidates as the plurality of template matching costs.
24. The method according to claim 22, wherein, The multiple template matching costs are measured by one of the sum of absolute differences (SAD) or the sum of squared errors (SSE).
25. The method according to claim 18, wherein, Obtaining, by the decoder, a plurality of weights corresponding to the plurality of predicted CU candidates includes: Receiving, by the decoder, the plurality of weights signaled by the encoder in the bitstream.
26. The method according to claim 18, wherein, Obtaining, by the decoder, a plurality of weights corresponding to the plurality of predicted CU candidates includes: Obtaining, by the decoder, the plurality of weights based on a plurality of templates.
27. The method according to claim 26, wherein, Obtaining, by the decoder, a plurality of weights corresponding to the plurality of predicted CU candidates further includes: Obtaining a plurality of predicted CU templates of the plurality of predicted CU candidates as the plurality of templates; and Obtaining a current CU template of the current CU; Wherein, obtaining, by the decoder, the plurality of weights based on a plurality of templates includes: Obtaining the plurality of weights based on the plurality of predicted CU templates and the current CU template.
28. The method according to claim 18, wherein Obtaining, by the decoder, a plurality of weights corresponding to the plurality of predicted CU candidates further includes: Obtaining, by the decoder, the plurality of weights using non-local mean filtering.
29. The method according to claim 28, wherein, Obtaining, by the decoder, the plurality of weights using non-local mean filtering includes: Obtaining a plurality of distances based on the plurality of predicted CU candidates and the current CU; and Obtaining the plurality of weights based on the plurality of distances and the weighting strength.
30. The method according to claim 29, wherein, Before obtaining, by the decoder, a plurality of weights corresponding to the plurality of predicted CU candidates, the method further includes: Determining, by the decoder, the weighting strength.
31. The method according to claim 30, wherein, Determining, by the decoder, the weighting strength includes: Defining and fixing, by the decoder, a weighting strength candidate list including a plurality of typical weighting strength values; and Selecting, by the decoder, one typical weighting strength value as the optimal weighting strength value based on a flag signaled in the bitstream.
32. The method according to claim 30, wherein, Determining, by the decoder, the weighting strength includes: Receiving, by the decoder, the optimal weighting strength value identified by the encoder and signaled in the bitstream.
33. The method according to claim 30, wherein, Determining, by the decoder, the weighting strength includes: Obtaining, by the decoder, a plurality of predicted CU templates of the plurality of predicted CU candidates; Obtaining, by the decoder, a current CU template of the current CU; and Estimating, by the decoder, the weighting strength based on the plurality of predicted CU templates and the current CU template.
34. The method according to claim 30, wherein, Determining, by the decoder, the weighting strength includes: Estimating, by the decoder, the weighting strength using a quantization parameter (QP) value and the variance of the current CU template of the current CU.
35. The method according to claim 34, further comprising: Offline fitting, by the decoder, the relationship between the weighting strength, the QP value and the variance of the current CU template.
36. The method according to claim 17, wherein, Obtaining, by the decoder, the final prediction of the current CU based on the plurality of predicted CU candidates includes: Performing, by the decoder, a singular value decomposition (SVD) on a matrix generated from the plurality of predicted CU candidates; and Obtaining, by the decoder, the final prediction based on the result of performing the SVD.
37. The method according to claim 36, wherein, Performing, by the decoder, an SVD on a matrix generated from the plurality of predicted CU candidates includes: Obtain a block group matrix based on the multiple predicted CU candidates; Perform the SVD on the block group matrix, and obtain a first decomposition result matrix, a second decomposition result matrix, and a third decomposition result matrix; Obtain a fourth decomposition result matrix from the second decomposition result matrix; Perform an inverse SVD on the first decomposition result matrix, the third decomposition result matrix, and the fourth decomposition result matrix, and obtain a filtered block group; and wherein, the decoder obtaining the final prediction based on the result of performing the SVD includes: Obtain the final prediction of the current CU based on the filtered block group.
38. The method according to claim 37, wherein, Obtaining a fourth decomposition result matrix from the second decomposition result matrix includes: Apply a soft threshold operation to the second decomposition result matrix.
39. The method according to claim 38, wherein, Applying a soft threshold operation to the second decomposition result matrix includes: Determine a plurality of thresholds corresponding to the diagonal elements of the second decomposition result matrix.
40. The method according to claim 17, further comprising: The decoder receives a flag signaled in the bitstream, wherein the flag indicates that the multiple hypothesis intra TMP mode is applied to the current CU.
41. The method according to claim 40, further comprising: The decoder receives an index signaled in the bitstream, wherein the index indicates the multiple hypothesis intra TMP method applied to the current CU.
42. A video coding method, comprising: The encoder encodes a current coding unit (CU) based on an intra template matching prediction (TMP) mode; The encoder obtains a plurality of predicted CU candidates; The encoder obtains the final prediction of the current CU based on the plurality of predicted CU candidates; and The encoder transmits the current CU encoded based on the intra TMP mode to the decoder.
43. The method according to claim 42, further comprising: The encoder obtains a plurality of weights corresponding to the plurality of predicted CU candidates; and The encoder obtains the final prediction of the current CU based on the plurality of predicted CU candidates and the plurality of weights.
44. The method according to claim 42, wherein, The encoder obtaining a plurality of predicted CU candidates includes: The encoder searches for a plurality of CU candidates having a template matching cost lower than that of other candidates; and The encoder selects the plurality of CU candidates as the plurality of predicted CU candidates.
45. The method according to claim 44, wherein, The template matching cost is measured by one of the sum of absolute differences (SAD) or the sum of squared errors (SSE).
46. The method according to claim 43, wherein, The encoder obtaining a plurality of weights corresponding to the plurality of predicted CU candidates includes: Set each weight of the plurality of weights to the reciprocal of an integer N, where N is the number of the plurality of predicted CU candidates.
47. The method according to claim 43, wherein, The encoder obtaining a plurality of weights corresponding to the plurality of predicted CU candidates includes: The encoder calculates the plurality of weights based on a plurality of template matching costs.
48. The method according to claim 47, wherein, The encoder calculating the plurality of weights based on a plurality of template matching costs includes: Obtain a plurality of predicted CU template matching costs of the plurality of predicted CU candidates; and Obtain the plurality of weights based on the plurality of predicted CU template matching costs.
49. The method according to claim 47, wherein, The plurality of template matching costs are measured by one of sum of absolute differences (SAD) or sum of squared errors (SSE).
50. The method according to claim 43, wherein The obtaining of the plurality of weights corresponding to the plurality of predicted CU candidates by the encoder includes: The encoder obtaining the plurality of weights based on the plurality of predicted CU candidates and the current CU; and The encoder signaling the plurality of weights in the bitstream.
51. The method according to claim 43, wherein, The obtaining of the plurality of weights corresponding to the plurality of predicted CU candidates by the encoder includes: The encoder obtaining the plurality of weights based on a plurality of templates.
52. The method according to claim 51, wherein, The encoder obtaining the plurality of weights based on a plurality of templates includes: Obtaining a plurality of predicted CU templates of the plurality of predicted CU candidates; Obtaining a current CU template of the current CU; and Obtaining the plurality of weights based on the plurality of predicted CU templates and the current CU template.
53. The method according to claim 43, wherein, The obtaining of the plurality of weights corresponding to the plurality of predicted CU candidates by the encoder further includes: The encoder obtaining the plurality of weights using non-local means filtering.
54. The method according to claim 53, wherein, The encoder obtaining the plurality of weights using non-local means filtering includes: Obtaining a plurality of distances based on the plurality of predicted CU candidates and the current CU; and Obtaining the plurality of weights based on the plurality of distances and the weighting strength.
55. The method according to claim 54, wherein, Before the encoder obtains the plurality of weights corresponding to the plurality of predicted CU candidates, the method further includes: The encoder determining the weighting strength.
56. The method according to claim 55, wherein, The encoder determining the weighting strength includes: The encoder defining and fixing a list of weighting strength candidates including a plurality of typical weighting strength values; The encoder checking the plurality of typical weighting strength values using rate-distortion optimization; The encoder identifying the optimal weighting strength value; and The encoder signaling the optimal weighting strength value in the bitstream.
57. The method according to claim 55, wherein, The encoder determining the weighting strength includes: The encoder obtaining a plurality of predicted CU templates of the plurality of predicted CU candidates; The encoder obtaining a current CU template of the current CU; and The encoder estimating the weighting strength based on the plurality of predicted CU templates and the current CU template.
58. The method according to claim 55, wherein, The encoder determining the weighting strength includes: The encoder estimating the weighting strength using a quantization parameter (QP) value and the variance of the current CU template of the current CU.
59. The method according to claim 58, further comprising: The encoder offline fitting the relationship between the weighting strength, the QP value, and the variance of the current CU template.
60. The method according to claim 42, wherein, The encoder obtaining the final prediction of the current CU based on the plurality of predicted CU candidates includes: The encoder performing singular value decomposition (SVD) on a matrix generated from the plurality of predicted CU candidates; and The encoder obtaining the final prediction based on the result of performing the SVD.
61. The method according to claim 60, wherein, The encoder performing SVD on a matrix generated from the plurality of predicted CU candidates includes: Obtaining a block group matrix based on the plurality of predicted CU candidates; Perform the SVD on the block group matrix, and obtain a first decomposition result matrix, a second decomposition result matrix, and a third decomposition result matrix; Obtain a fourth decomposition result matrix from the second decomposition result matrix; Perform an inverse SVD on the first decomposition result matrix, the fourth decomposition result matrix, and the third decomposition result matrix, and obtain a filtered block group; and wherein, the encoder obtaining the final prediction based on the result of performing the SVD includes: Obtaining the final prediction of the current CU based on the filtered block group.
62. The method according to claim 61, wherein, Obtaining a fourth decomposition result matrix from the second decomposition result matrix includes: Applying a soft threshold operation to the second decomposition result matrix.
63. The method according to claim 62, wherein, Applying a soft threshold operation to the second decomposition result matrix further includes: Determining a plurality of thresholds corresponding to the diagonal elements of the second decomposition result matrix.
64. The method according to claim 42, further comprising: The encoder receiving a flag signaled in a bitstream, wherein the flag indicates that the multiple hypothesis intra TMP mode is applied to the current CU.
65. The method according to claim 64, further comprising: The encoder receiving an index signaled in the bitstream, wherein the index indicates the multiple hypothesis intra TMP method applied to the current CU.
66. A video decoding apparatus, comprising: One or more processors; And A memory coupled to the one or more processors, the memory being configured to store instructions executable by the one or more processors, wherein the one or more processors are configured to perform the method according to any one of claims 1-8 and 17-41 when executing the instructions.
67. A video encoding apparatus, comprising: One or more processors; And A memory coupled to the one or more processors, the memory being configured to store instructions executable by the one or more processors, wherein the one or more processors are configured to perform the method according to any one of claims 9-16 and 42-65 when executing the instructions.
68. A non-transitory computer-readable storage medium for storing computer-executable instructions, the computer-executable instructions causing the one or more computer processors to perform the method according to any one of claims 1-8 and 17-41 when executed by the one or more computer processors.
69. A non-transitory computer-readable storage medium for storing computer-executable instructions, the computer-executable instructions causing the one or more computer processors to perform the method according to any one of claims 9-16 and 42-65 when executed by the one or more computer processors.
70. A non-transitory computer-readable storage medium for storing a bitstream to be decoded by the method according to any one of claims 1-8 and 17-41.
71. A non-transitory computer-readable storage medium for storing a bitstream generated by the method according to any one of claims 9-16 and 42-65.