Encoding and decoding method
The encoding and decoding method dynamically determines an optimal blending width for each mode candidate, enhancing prediction accuracy and reducing artifacts in Versatile Video Coding by adapting to complex textures and boundary regions.
Patent Information
- Application Number
- PCT/CN2024/096908
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-06-01
- Publication Date
- 2025-12-04
AI Technical Summary
The fixed blending width based on block size in Versatile Video Coding (VVC) is inflexible for complex textures, suboptimal for boundary regions, and limited in adaptability, leading to inaccurate predictions and artifacts.
An encoding and decoding method that determines an optimal blending width for each mode candidate by applying multiple blending width candidates to a current block or template, deriving the optimal blending width based on prediction results, and generating a prediction using the selected mode and blending width.
Improves prediction accuracy by adapting to varying textures and boundary regions, reducing artifacts in reconstructed images.
Smart Images

Figure CN2024096908_04122025_PF_FP_ABST
Abstract
Description
ENCODING AND DECODING METHOD
[0001] BACKGROUND OF DISCLOSURE
[0002] 1. Field of Disclosure
[0003] The present disclosure relates to the field of image processing, and more particularly, to an encoding and decoding method.
[0004] 2. Description of Related Art
[0005] Because intra predicted coding unit (CU) in Versatile Video Coding (VVC) can use angular and non-linear prediction modes, the non-horizontal and non-vertical edges are handled well. When geometric partitioning mode (GPM) is applied to a CU, the CU is split into two parts by a straight partitioning boundary. The location of the partitioning boundary is mathematically defined by an angel and an offset.Technical Problem
[0006] A blending width for blending the two parts is determined based on a block size of the CU. While using block size for determining blending width has some simplicity, it can lead to several drawbacks:
[0007] Inflexible for complex textures: Block size is a very coarse measure of image complexity. Textures with high detail within a block might not be well-represented by a single blending width, potentially leading to inaccurate predictions.
[0008] Suboptimal for boundary regions: Blending is particularly important at block boundaries where information from neighboring blocks needs to be combined. A fixed blending width based on block size might not be ideal for these regions, potentially leading to artifacts or discontinuities in the reconstructed image.
[0009] Limited adaptability: Images can contain a variety of textures with different levels of detail. A fixed blending width based on block size wouldn't be able to adapt to these variations, potentially leading to suboptimal prediction accuracy across the entire image.
[0010] Hence, an encoding method and a decoding method for address the challenge are desirable.SUMMARY
[0011] An object of the present disclosure is to propose an encoding and decoding method.
[0012] In a first aspect, an embodiment of the disclosure provides an encoding method, comprising:
[0013] providing input video frames;
[0014] determining a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes;
[0015] determining a plurality of blending width candidates;
[0016] for each mode candidate of the plurality of mode candidates:
[0017] applying the plurality of blending width candidates to a current block or a template of the current block in the input video frames to acquire a plurality of prediction results; and
[0018] deriving an optimal blending width from the blending width candidates based on the plurality of prediction results of the current block or the template; and
[0019] generating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width.
[0020] In a second aspect, an embodiment of the disclosure provides a decoding method, comprising:
[0021] obtaining a bitstream, wherein the bitstream comprises information for a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes;
[0022] determining a plurality of blending width candidates;
[0023] for a current mode candidate among the plurality of mode candidates:
[0024] applying the plurality of blending width candidates to a template of a current block in the bitstream to acquire a plurality of prediction results; and
[0025] deriving an optimal blending width from the blending width candidates based on the plurality of prediction results; and
[0026] generating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width.
[0027] In third aspect, an embodiment of the disclosure provides a decoding method, comprising:
[0028] obtaining a bitstream, wherein the bitstream comprises information for a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes, and the bitstream comprises an indication for an optimal blending width for each of the plurality of mode candidates; and generating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width;
[0029] wherein the optimal blending width is selected, at a decoder side, from a plurality of blending width candidates for the plurality of mode candidates based on their corresponding prediction results.
[0030] In a fourth aspect, an embodiment of the disclosure provides an encoding method, comprising: providing input video frames;
[0031] performing image or video coding that uses template-based derivation for a current block in the input video frames; and
[0032] determining whether a reference area selection for template-based prediction (RAST) is available for a current block based on at least one of:
[0033] a prediction mode used for the current block;
[0034] a block size of the current block;
[0035] a control flag in a block, slice, picture, or group of picture level; or
[0036] a template cost associated with the current block;
[0037] wherein the current block and the template share common reference samples.
[0038] In a fifth aspect, an embodiment of the disclosure provides a decoding method, comprising:
[0039] providing input video frames;
[0040] performing image or video coding that uses template-based derivation for a current block in the input video frames; and
[0041] determining whether a reference area selection for template-based prediction (RAST) is available for a current block based on at least one of:
[0042] a prediction mode used for the current block;
[0043] a block size of the current block;
[0044] a control flag in a block, slice, picture, or group of picture level; or
[0045] a template cost associated with the current block;
[0046] wherein the current block and the template share common reference samples.
[0047] In a sixth aspect, an embodiment of the disclosure provides an encoding device comprising a processor configured to call and run a computer program stored in a memory, to cause a device in which the processor is installed to execute the disclosed method.
[0048] In a seventh aspect, an embodiment of the disclosure provides a decoding device comprising a processor configured to call and run a computer program stored in a memory, to cause a device in which the chip is installed to execute the disclosed method and any combination of embodiments of the disclosed method.
[0049] The disclosed method may be programmed as computer executable instructions stored in non-transitory computer readable medium. The non-transitory computer readable medium, when loaded to a computer, directs a processor of the computer to execute the disclosed method.
[0050] The non-transitory computer readable medium may comprise at least one from a group consisting of: a hard disk, a CD-ROM, an optical storage device, a magnetic storage device, a Read Only Memory, a Programmable Read Only Memory, an Erasable Programmable Read Only Memory, EPROM, an Electrically Erasable Programmable Read Only Memory and a Flash memory.
[0051] The disclosed method may be programmed as a computer program product that causes a computer to execute the disclosed method.
[0052] The disclosed method may be programmed as a computer program that causes a computer to execute the disclosed method.BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present disclosure or related art, the following figures will be described in the embodiments are briefly introduced. It is obvious that the drawings are merely some embodiments of the present disclosure, a person having ordinary skill in this field may obtain other figures according to these figures without paying the premise.
[0054] FIG. 1 illustrates a schematic view of an encoding system.
[0055] FIG. 2 illustrates a schematic view of a decoding system.
[0056] FIG. 3 illustrates a schematic view of an example of a communication system.
[0057] FIG. 4 illustrates a schematic view of another example of a communication system.
[0058] FIG. 5 illustrates a schematic view showing an embodiment of an encoding method.
[0059] FIG. 6 illustrates a schematic view showing an embodiment of a decoding method.
[0060] FIG. 7 illustrates a schematic view showing an embodiment of a decoding method.
[0061] FIG. 8 illustrates a schematic view showing an embodiment of a decoding method.
[0062] FIG. 9 illustrates a schematic view showing an embodiment of a decoding method.
[0063] FIG. 10 illustrates a schematic view showing a current block, a partition line, and two partitions of the current block.
[0064] FIG. 11 illustrates a schematic view showing a current block, a partition line, and blending weights.
[0065] FIG. 12 illustrates a schematic view showing a blending area and a blending width.
[0066] FIG. 13 illustrates a schematic view showing reference samples for a template and reference samples for a current block.
[0067] FIG. 14 illustrates a schematic view showing an example of a decoding process for SGPM.
[0068] FIG. 15 illustrates a schematic view showing an example of a decoding process for SGPM including TDBW applied after a TM candidate is determined.
[0069] FIG. 16 illustrates a schematic view showing a partition line, a current block, and templates of the current block.
[0070] FIG. 17 illustrates a schematic view showing reference samples shared by the template and the current block.
[0071] FIG. 18 illustrates a schematic view showing an extended portion of reference samples.
[0072] FIG. 19 illustrates a schematic view showing an extended portion of reference samples.
[0073] FIG. 20 illustrates a schematic view showing reference samples and corresponding prediction angles.
[0074] FIG. 21 illustrates a schematic view showing reference samples and corresponding prediction angles.
[0075] FIG. 22 illustrates a schematic view showing reference samples and corresponding prediction angles.
[0076] FIG. 23 illustrates a schematic view showing a chip or executing the disclosed method in an encoder.
[0077] FIG. 24 illustrates a schematic view showing a chip or executing the disclosed method in a decoder.
[0078] DETAILED DESCRIPTION OF EMBODIMENTS
[0079] Embodiments of the disclosure are described in detail with the technical matters, structural features, achieved objects, and effects with reference to the accompanying drawings as follows. Specifically, the terminologies in the embodiments of the present disclosure are merely for describing the purpose of the certain embodiment, but not to limit the disclosure.
[0080] Blending width derivation methods for line partitioning modes which includes blending for intra and inter prediction, which include (1) applying template derived blending width for line partitioning modes, where the blending width is selected for each candidate or the retrieved candidate in a candidate list; (2) using the reference area near the block for template derivation.
[0081] Under the context of video compression, colour image or a frame of a colour video usually consists of three colour components, namely a luma component Y and two chroma components Cb and Cr. Each component is represented as a data matrix. The data matrix for each component is decomposed into blocks associated with specific encoding parameters. A block is usually a square or rectangle of which dimensions are integer powers of 2. The coding of an image is processed in raster scanning order: from left to right, then from top to bottom.
[0082] In video coding standards such as Versatile Video Coding (VVC) , intra prediction (also known as intra-frame prediction) refers to predicting current block (i.e., the block to be coded) using coded blocks or coded areas within the same frame. When performing intra prediction, an encoder tries multiple intra prediction modes available according to a coding standard for the current block to computes corresponding prediction blocks, compares corresponding prediction blocks, and chooses the best prediction mode. The difference between original current block and the prediction block generated for the current block by the selected prediction mode, namely the residual, will also be coded. By transmitting the selected prediction modes and residuals only, the encoder is able to instruct a decoder to decode and reconstruct the original colour image or video or its approximation.
[0083] To facilitate understanding of the technical solutions presented in this application’s embodiments, a concise overview of the video encoding and decoding system will be given in the following.
[0084] As shown in FIG. 1, a video encoding system 110 is composed of multiple modules, including a block partitioning unit 1101, transform and quantization unit 1102, intra-frame estimation unit 1103, intra-frame prediction unit 1104, motion compensation unit 1105, motion estimation unit 1106, an inverse transformation and inverse quantization unit 1107, a filter control analysis unit 1108, a filtering unit 1109, an encoding unit 1110, an encoded image buffer unit 1111, and a subtractor 1112. The video encoding system 110 may be implemented as an encoder, an encoding device, a computer program, a system on chip (SIC) , an integrated circuit (IC) , or a chip. The intra-frame prediction unit 1104 may be implemented as a computer program, a system on chip (SIC) , an integrated circuit (IC) , or a chip.
[0085] Original video signals comprise video frames. Each video frame can be divided into blocks by the block partitioning unit 1101. For each of the video frames, the subtractor 1112 generates residual pixel information of a residual frame by subtracting the video frame by prediction blocks output by the intra-frame prediction unit 1104 or the motion compensation unit 1105. The residual pixel information obtained after intra-frame prediction or inter-frame prediction (motion compensation) , is transformed by the transformation and quantization unit 1102. The transformation includes transforming the residual pixel information from the pixel domain to a transform domain to generate resulting transform coefficients, and the resulting transform coefficients are quantized to further reduce the bit rate. The intra-frame estimation unit 1103 performs intra-frame estimation, and the intra-frame prediction unit 1104 performs intra-frame prediction on the video reconstruction blocks. Motion estimation performed by the motion estimation unit 1106 is a process of generating a motion vector that can estimate the motion of the video reconstruction block, and then motion compensation is performed by the motion compensation unit 1105 based on the determined motion vector. After determining an intra-frame prediction mode, the intra-frame prediction unit 1104 provides selected intra-frame predicted data to the encoding unit 1110, and the motion estimation unit 1106 also sends calculated motion vector data to the encoding unit 1110. The inverse transform and inverse quantization unit 1107 reconstructs the video reconstruction blocks and reconstructs a residual block in the pixel domain, and the filtering unit 1109 is controlled by the filter analysis unit 1108 to remove the blocking artifacts in the reconstructed residual block, and the encoding unit 1110 adds the reconstructed residual block to the prediction block of the encoded image buffer unit 1111 to generate a reconstructed block. The encoding unit 1110 is used for encoding various encoding parameters and quantized transform coefficients (quantized transform coefficients) into bitstream, and outputs the bitstream of the video signals. The encoded image buffer unit 1111 is used for storing reconstructed blocks as the reference blocks for intra-frame prediction. As the video image encoding progresses, new reconstructed blocks are continuously generated, and these blocks will be stored in the encoded image buffer unit 1111.
[0086] As shown in FIG. 2, the video decoding system 120 is composed of multiple modules comprising a decoding unit 1201, an inverse transform and inverse quantization unit 1202, an intra-frame prediction unit 1203, a motion compensation unit 1204, a filtering unit 1205, a decoded image buffer unit 1206 and a post filtering unit 1207. The video decoding system 120 may be implemented as a decoder, a decoding device, a computer program, a system on chip (SIC) , an integrated circuit (IC) , or a chip. The intra-frame prediction unit 1203 may be implemented as a computer program, a system on chip (SIC) , an integrated circuit (IC) , or a chip.
[0087] The input signals of video frames are encoded by the video encoding system 110 to obtain an output bitstream. The video encoding system 110 transmits the bitstream to the video decoding system 120. The video decoding system 120 receives the bitstream representing the video frames in an encoded format (i.e., in a compressed format) . In the video decoding system 120, the bitstream is processed by the decoding unit 1201 to obtain decoded transform coefficients. The inverse transform and inverse quantization unit 1202 process the transform coefficients to generate a residual block in the pixel domain. The intra-frame prediction unit 1203 is operable to generate an intra-frame prediction block for a current video decoding block (i.e., current video block that undergoes video decoding) based on a determined intra-frame prediction mode and data from previously decoded blocks of the current video frame or picture. The motion compensation unit 1204 determines the inter-frame prediction information for the current video decoding block and generates an inter-frame prediction block by parsing the motion vector and other associated syntax elements. Finally, the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 1202 and the corresponding prediction block generated by the intra-frame prediction unit 1203 or the motion compensation unit 1204. In order to improve video quality, the decoded video blocks are filtered through the filtering unit 1205 to remove blocking artifacts. The decoded video block is then stored in the decoded image buffer unit 1206 as the reference block for subsequent intra-prediction or motion compensation, and for video output, i.e., to reproduce and reconstruct the original video signals. The output video can be optionally further processed by a post filtering unit 1207 for more suitable or enhanced viewing experiences.
[0088] The embodiments of the present disclosure are mainly used for the intra-frame prediction unit 1104 of the video encoding system 110 and the intra-frame prediction unit 1203 of the video decoding system 120. If a better prediction effect can be obtained in the video encoding system 110 through the encoding and decoding method provided by the embodiments of the present application, the quality of video decoding and reconstruction can also be improved. The video decoding system 120 receives the bitstream representing the video frames.
[0089] The following are several implementation examples, demonstrating possible executions for this disclosure within video codec standards.
[0090] With reference to FIG. 3, a system including a first image processing device 10a and a second image processing device 10b. The first image processing device 10a may operates as an encoding device comprising a processor 75a. The processor 75a comprises an encoder configured to execute the disclosed encoding method. The encoder encodes image or video frames into bit streams, and the processor 75a transmits the bit steam to the processor 75b. The second image processing device 10b may operates as a decoding device comprising a processor 75b. The processor 75b comprises a decoder configured to execute the disclosed decoding method.
[0091] Similarly, the second image processing device 10b may operates as an encoding device comprising a processor 75b. The processor 75b comprises an encoder configured to execute the disclosed encoding method. The encoder encodes image or video frames into bit streams, and the processor 75b transmits the bit steam to the processor 75a. The first image processing device 10a may operates as a decoding device comprising a processor 75b. The processor 75b comprises a decoder configured to execute the disclosed decoding method.
[0092] In some embodiments of the disclosure, the encoder and the decoder may be implemented into computer readable programs or instructions. A device when executing the programs or instructions performs embodiments of the disclosed method. An example of the electronic device in the description may include one of the device 10a or device 10b. The device 10a may communicate with the device 10b through a direct connection or through a base station and / or a network device entity.
[0093] With reference to FIG. 4, the electronic device 10a may communicate with the electronic device 10b through a wireline or a wireless communication connection. One of the electronic device 10a or electronic device 10b may serve as an image encoder and the other may serve as an image decoder. Each of the electronic device 10a and electronic device 10b may include both an image encoder and an image decoder.
[0094] An image encoder may be implemented as an intra-frame prediction unit, a chip, an electronic device, or a video encoding system, such as the video encoding system 110. An image decoder may be implemented as an intra-frame prediction unit, a chip, an electronic device, or a video decoding system, such as the video decoding system 120. The intra-frame prediction unit in an image encoder and / or an image decoder performs encoding and decoding method.
[0095] In the description, a coding unit (CU) may comprise a block of an image or a video frame. The CU input to an encoder or a decoder for processing may be referred to as a current block, a current coding block, or a coding block.
[0096] With reference to FIG. 5, an embodiment of an encoding method can be performed by an image encoder. The encoding method comprises:
[0097] Step A001: providing input video frames;
[0098] Step A002: determining a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes;
[0099] Step A003: determining a plurality of blending width candidates;
[0100] Step A004: for each mode candidate of the plurality of mode candidates:
[0101] applying the plurality of blending width candidates to a current block or a template of the current block in the input video frames to acquire a plurality of prediction results; and
[0102] deriving an optimal blending width from the blending width candidates based on the plurality of prediction results of the current block or the template; and
[0103] Step A005: generating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width.
[0104] In some embodiments of the disclosure, the encoding method further comprises:
[0105] generating a bitstream, wherein the bitstream comprises an indication for the optimal blending width for each of the plurality of mode candidates.
[0106] In some embodiments of the disclosure, the encoding method further comprises:
[0107] determining whether to apply template-derived blending width (TDBW) for the current block based on a lookup table (LUT) , wherein the LUT establishes a correspondence between:
[0108] a block size of the current block;
[0109] a partition mode of the current block; and
[0110] and the application of TDBW.
[0111] In some embodiments of the disclosure, if the LUT indicates TDBW is applicable for the current block based on the block size and partition mode, the method further comprises:
[0112] deriving a template size for TDBW based on the same LUT; and
[0113] applying TDBW to the current block using the derived template size.
[0114] In some embodiments of the disclosure, the deriving the optimal blending width from the blending width candidates comprises:
[0115] applying the plurality of blending width candidates to a template;
[0116] calculating a cost as a template cost for each of the applied blending width candidates, wherein the cost is a difference metric between prediction values of the template and reconstructed samples of the template; and
[0117] selecting a blending width candidate that minimizes the calculated cost as the optimal blending width.
[0118] In some embodiments of the disclosure, the difference metric is at least one of a sum of absolute transformed differences (SATD) , sum of squared differences (SSE) , sum of absolute difference (SAD) , or mean squared error (MSE) .
[0119] In some embodiments of the disclosure, the prediction values for each blending width candidate are obtained by applying the mode candidate of a geometric partitioning mode (GPM) / spatial geometric partitioning mode (SGPM) mode in the template and blending resultant partitions of the template according to the blending width candidate.
[0120] In some embodiments of the disclosure, selecting the blending width candidate comprises selecting from a pre-defined set of blending width indices.
[0121] In some embodiments of the disclosure, selecting the blending width candidate comprises selecting from a pre-defined subset of blending width candidates available for the current block, wherein the subset is determined based on one or more of a prediction mode, partition mode, and a block size.
[0122] In some embodiments of the disclosure, the encoding method further comprises:
[0123] performing a candidate list expansion process on a first candidate list of the plurality of mode candidates to determine a second candidate list along with the respective optimal blending width candidate.
[0124] In some embodiments of the disclosure, the candidate list expansion process comprises for each candidate in the first candidate list of the partition mode:
[0125] adding the candidate to the first candidate list to form a derived candidate list if the optimal blending width differs from a blending width associated with the candidate, wherein candidates added to the derived candidate list are ordered based on ascending template cost.
[0126] In some embodiments of the disclosure, the second candidate list is generated by inserting a predetermined number N of derived candidates with the lowest template costs into the first candidate list.
[0127] In some embodiments of the disclosure, the second candidate list comprises derived candidate list reordered based on updated template costs of the derived candidate list.
[0128] In some embodiments of the disclosure, the encoding method further comprises:
[0129] determining whether a reference area selection for template-based prediction (RAST) is available for the current block based on at least one of:
[0130] a prediction mode used for the current block;
[0131] a block size of the current block;
[0132] a control flag in a block, slice, picture, or group of picture level; or
[0133] a template cost associated with the current block;
[0134] wherein the current block and the template share common reference samples.
[0135] In some embodiments of the disclosure, the encoding method further comprises:
[0136] enabling a reference area selection for template-based prediction (RAST) for the current block based on at least one of:
[0137] always being enabled when the RAST is available;
[0138] an explicit indication flag;
[0139] dependency on legacy template-based derivation signals;
[0140] a decoder-derived decision based on the template cost; or
[0141] a control flag in a block, slice, picture, or group of picture level.
[0142] selecting reference samples for predicting a template area, wherein the reference samples include one or several lines of pixels adjacent to the current block;
[0143] wherein the current block and the template share common reference samples.
[0144] In some embodiments of the disclosure, the encoding method further comprises:
[0145] extending the reference samples by adding one or more columns or rows of pixels to adjust the size of the reference area.
[0146] In some embodiments of the disclosure, extending the reference samples comprises adding pixels obtained by at least one of:
[0147] reconstruction;
[0148] interpolation using closest available reference samples;
[0149] extrapolation using closest available reference samples; or
[0150] calculating average sample values of a reference line or an average pixel values in an image of the bitstream.
[0151] In some embodiments of the disclosure, the encoding method further comprises:
[0152] defining the template area for RAST based on at least one of:
[0153] one or several lines of pixels located above or / and left to the lines of reference samples;
[0154] the reference samples; or
[0155] the extended reference samples.
[0156] In some embodiments of the disclosure, the encoding method further comprises:
[0157] generating prediction samples for the template area using an intra prediction mode with the selected reference samples;
[0158] wherein in generating the prediction samples for the template area,
[0159] an intra prediction angle used in the current block and an intra prediction angle used in the template area target to the reference samples, if the intra prediction mode is an intra angular mode and the reference samples are located between the current block and the template area.
[0160] With reference to FIG. 6, an embodiment of a decoding method can be performed by an image decoder. The decoding method comprises:
[0161] Step B001: obtaining a bitstream, wherein the bitstream comprises information for a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes;
[0162] Step B002: determining a plurality of blending width candidates;
[0163] Step B003: for a current mode candidate among the plurality of mode candidates:
[0164] applying the plurality of blending width candidates to a template of a current block in the bitstream to acquire a plurality of prediction results; and
[0165] deriving an optimal blending width from the blending width candidates based on the plurality of prediction results; and
[0166] Step B004: generating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width.
[0167] In some embodiments of the disclosure, the current mode candidate comprises each of the plurality of mode candidates, and the applying and deriving are performed for each of the plurality of mode candidates; or
[0168] the current mode candidate comprises a specific mode candidate indicated by a mode indication among the plurality of mode candidates, and the applying and deriving are performed for the specific mode candidate.
[0169] In some embodiments of the disclosure, the encoding method further comprises:
[0170] determining whether to apply template-derived blending width (TDBW) for the current block based on a lookup table (LUT) , wherein the LUT establishes a correspondence between:
[0171] a block size of the current block;
[0172] a partition mode of the current block; and
[0173] and the application of TDBW.
[0174] In some embodiments of the disclosure, if the LUT indicates TDBW is applicable for the current block based on the block size and partition mode, the method further comprises:
[0175] deriving a template size for TDBW based on the same LUT; and
[0176] applying TDBW to the current block using the derived template size.
[0177] In some embodiments of the disclosure, the deriving the optimal blending width from the blending width candidates comprises:
[0178] applying the plurality of blending width candidates to a template;
[0179] calculating a cost as a template cost for each of the applied blending width candidates, wherein the cost is a difference metric between prediction values of the template and reconstructed samples of the template; and
[0180] selecting a blending width candidate that minimizes the calculated cost as the optimal blending width.
[0181] In some embodiments of the disclosure, the difference metric is at least one of a sum of absolute transformed differences (SATD) , sum of squared differences (SSE) , sum of absolute difference (SAD) , or mean squared error (MSE) .
[0182] In some embodiments of the disclosure, the prediction values for each blending width candidate are obtained by applying the mode candidate of a geometric partitioning mode (GPM) / spatial geometric partitioning mode (SGPM) mode in the template and blending resultant partitions of the template according to the blending width candidate.
[0183] In some embodiments of the disclosure, selecting the blending width candidate comprises selecting from a pre-defined set of blending width indices.
[0184] In some embodiments of the disclosure, selecting the blending width candidate comprises selecting from a pre-defined subset of blending width candidates available for the current block, wherein the subset is determined based on one or more of a prediction mode, partition mode, and a block size.
[0185] In some embodiments of the disclosure, the encoding method further comprises:
[0186] performing a candidate list expansion process on a first candidate list of the plurality of mode candidates to determine a second candidate list along with the respective optimal blending width.
[0187] In some embodiments of the disclosure, the candidate list expansion process comprises for each candidate in the first candidate list of the partition mode:
[0188] adding the candidate to the first candidate list to form a derived candidate list if the optimal blending width differs from a blending width associated with the candidate, wherein candidates added to the derived candidate list are ordered based on ascending template cost.
[0189] In some embodiments of the disclosure, the second candidate list is generated by inserting a predetermined number N of derived candidates with the lowest template costs into the first candidate list.
[0190] In some embodiments of the disclosure, the second candidate list comprises derived candidate list reordered based on updated template costs of the derived candidate list.
[0191] In some embodiments of the disclosure, the encoding method further comprises:
[0192] determining whether a reference area selection for template-based prediction (RAST) is available for the current block based on at least one of:
[0193] a prediction mode used for the current block;
[0194] a block size of the current block;
[0195] a control flag in a block, slice, picture, or group of picture level; or
[0196] a template cost associated with the current block;
[0197] wherein the current block and the template share common reference samples.
[0198] In some embodiments of the disclosure, the encoding method further comprises:
[0199] enabling a reference area selection for template-based prediction (RAST) for the current block based on at least one of:
[0200] always being enabled when the RAST is available;
[0201] an explicit indication flag;
[0202] dependency on legacy template-based derivation signals;
[0203] a decoder-derived decision based on the template cost; or
[0204] a control flag in a block, slice, picture, or group of picture level.
[0205] selecting reference samples for predicting a template area, wherein the reference samples include one or several lines of pixels adjacent to the current block;
[0206] wherein the current block and the template share common reference samples.
[0207] In some embodiments of the disclosure, the encoding method further comprises:
[0208] extending the reference samples by adding one or more columns or rows of pixels to adjust the size of the reference area.
[0209] In some embodiments of the disclosure, extending the reference samples comprises adding pixels obtained by at least one of:
[0210] reconstruction;
[0211] interpolation using closest available reference samples;
[0212] extrapolation using closest available reference samples; or
[0213] calculating average sample values of a reference line or an average pixel values in an image of the bitstream.
[0214] In some embodiments of the disclosure, the encoding method further comprises:
[0215] defining the template area for RAST based on at least one of:
[0216] one or several lines of pixels located above or / and left to the lines of reference samples;
[0217] the reference samples; or
[0218] the extended reference samples.
[0219] In some embodiments of the disclosure, the encoding method further comprises:
[0220] generating prediction samples for the template area using an intra prediction mode with the selected reference samples;
[0221] wherein in generating the prediction samples for the template area,
[0222] an intra prediction angle used in the current block and an intra prediction angle used in the template area target to the reference samples, if the intra prediction mode is an intra angular mode and the reference samples are located between the current block and the template area.
[0223] With reference to FIG. 7 an embodiment of a decoding method can be performed by an image decoder. The decoding method comprises:
[0224] Step C001: obtaining a bitstream, wherein the bitstream comprises information for a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes, the bitstream comprises an indication for an optimal blending width for each of the plurality of mode candidates; and
[0225] Step C002: generating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width;
[0226] wherein the optimal blending width is selected, at a decoder side, from a plurality of blending width candidates for the plurality of mode candidates based on their corresponding prediction results.
[0227] With reference to FIG. 8, an embodiment of an encoding method can be performed by an image encoder. The encoding method comprises:
[0228] Step D001: providing input video frames;
[0229] Step D002: performing image or video coding that uses template-based derivation for a current block in the input video frames; and
[0230] Step D003: determining whether a reference area selection for template-based prediction (RAST) is available for a current block based on at least one of:
[0231] a prediction mode used for the current block;
[0232] a block size of the current block;
[0233] a control flag in a block, slice, picture, or group of picture level; or
[0234] a template cost associated with the current block;
[0235] wherein the current block and the template share common reference samples.
[0236] With reference to FIG. 9, an embodiment of a decoding method can be performed by an image decoder. The decoding method comprises:
[0237] Step E001: providing input video frames;
[0238] Step E002: performing image or video coding that uses template-based derivation for a current block in the input video frames; and
[0239] Step E003: determining whether a reference area selection for template-based prediction (RAST) is available for a current block based on at least one of:
[0240] a prediction mode used for the current block;
[0241] a block size of the current block;
[0242] a control flag in a block, slice, picture, or group of picture level; or
[0243] a template cost associated with the current block;
[0244] wherein the current block and the template share common reference samples.
[0245] 1 Partitioning mode
[0246] 1.1 Geometric partitioning mode (GPM) and Spatial GPM (SGPM)
[0247] In VVC and recent studies on future video coding standards, several prediction modes, such as the Geometric Partitioning Mode (GPM) and Spatial GPM (SGPM) , use line partitioning and multiple predictions to create prediction blocks. These modes divide a coding block into two regions with predefined straight lines, generate predicted samples for each region, and then blend them within a restricted area to obtain the final predicted samples.
[0248] In recent studies on future video coding standards, GPM is signaled by a single Coding Unit (CU) level flag as a special merge mode. In the current GPM design, each possible CU size can support up to 64 partition modes, provided that both the width and height of the block are between 4 and 64 pixels, the block contains at least 32 pixels, and the longer side is less than eight times the shorter side. When GPM modes are used, a CU is divided into two parts by a geometrically positioned straight line, as illustrated in FIG. 10. The location of the dividing line is mathematically derived based on the angle and offset parameters specific to the chosen partition. There are 64 different partitions available in GPM, distinguished by 24 angles that are non-uniformly quantized between 0°and 360°. Additionally, up to 4 line locations can be associated with each partition angle.
[0249] Each geometric partition in the CU uniquely employs its motion vector (MV) for inter-prediction purposes. The couple of MVs are retrieved from merge candidate list. Only uni-directional prediction is permitted for each partition, meaning each partition has one motion vector and one reference index. The uni-prediction motion constraint is also applied to ensure that, like in the conventional bi-prediction, only up to two motion compensated predictions are needed for each CU.
[0250] If the GPM is used for the current CU, then a geometric partition index indicating the partition mode of the geometric partition (angle and offset) , and two merge indices (one for each partition) are further signalled. The maximum number of GPM candidate sizes is explicitly signalled at the sequence level.
[0251] SGPM builds upon GPM for intra prediction. Unlike GPM, which can handle two inter predictions, one inter and one intra prediction, or two intra predictions, SGPM is specifically designed for two intra predictions. Similar to GPM, it partitions a block and generates two corresponding intra prediction modes. However, SGPM utilizes a candidate list approach to encode these modes instead of explicit signaling. Additionally, while GPM requires an additional signal for the blending width, SGPM derives its blending width solely from the block size of the current block.
[0252] 1.1.1 Obtaining candidate list by templated matching (TM) based reordering
[0253] Within SGPM, in order to reduce signalling cost of the geometric partition mode and intra prediction modes, a Templated matching (TM) based reordering strategy is applied to construct a candidate list. Firstly, an encoder / decoder goes through all possible combinations of geometric partition modes and intra prediction modes to generate predictions for each combination within the template area. This template, as shown in FIG. 11, comprises the left and top neighboring areas of the current block.
[0254] In the blending process applied to templates, a prediction is generated for the template with the same partitioning line extended from the current block to the template. However, for computational simplification, the blending weights in TM are mapped to 0 or 1 depending on which value the blending weights are closer to. This mapping ensures that the edges on templates are clean cut while simplifying the computation process.
[0255] While sacrificing some precision in the blending weights, this computational shortcut avoids more complex blending calculations for the template. Instead, it produces a template prediction with two distinct regions separated by the extended partition boundary. Template blending starts with the original partition line, but then uses a simple 0 / 1 mapping of weights to cleanly divide the template into two non-blended prediction regions. This trades off some accuracy for significantly lower computational complexity compared to performing full blended predictions on the template area.
[0256] Subsequently, the encoder / decoder calculates the SAD / SATD of the predictions on the template against the actual reconstructed samples on the template as the TM costs. Candidates are then sorted in ascending order based on their respective TM costs, and the first sixteen candidates, having the smallest TM costs, form the candidate list. Each candidate includes information about a geometric partition mode and two intra prediction modes. The SGPM mode index, when decoded at the decoding side, indicates a corresponding candidate from the sorted candidate list. This allows the decoder to determine the geometric partition mode that splits the current coding block, as well as the two intra prediction modes that are applied to each partition of the block based on the index.
[0257] For GPM, the same template matching (TM) cost calculation method is applied as before. However, the reordering process is modified-it only reorders all the geometric partition modes themselves into ascending order based on their respective TM costs. An index is signaled using the Golomb-Rice code to indicate the GPM geometric partition mode from the list of reordered geometric partition modes. Consequently, GPM geometric partition modes are not treated as equal-probable events after reordering, and a variable-length code (e.g., Golomb-Rice code) is applied to signal the aforementioned index for each GPM geometric partition mode.
[0258] 1.1.2 Blending process
[0259] After predicting each of the two geometric partitions, the predicted values in a blending area can be adjusted using a blending process. The blending weight for each position in the block is determined by the distance from that position to the partition line (denoted as in FIG. 12) . And (xc, yc) denotes the position, such as a position relative to the center of the block. In addition, there is a blending area on both sides of the partitioning boundary with a width ofτluma samples. The purpose of this blending region is to allow for smooth transitions between the two partitions created by the geometric partitioning. The widthτof the blending area is either fixed or explicitly signaled as part of the GPM mode specification. Applying this blending along the partition boundary aims to improve the perceived prediction quality for blocks coded using the GPM mode. An illustration is shown in FIG. 12.
[0260] For theτwide blending area specified along the geometric partition boundary, the blending weight values are determined using a ramp function. Within this soft blending region on each side of the boundary, the weights transition gradually using the ramp function instead of being fully hard binary values.
[0261] However, outside of the defined blending areas, only the specific weight values of 0 or 8 (maximum weight) can be selected.
[0262] where are the weighting values in currentblock, andτis the pre-defined value of blending width. In some examples, τcan be 2. In some examples, τcan be selected from a set of pre-defined values, e.g., {0,1, 2, 4, 8, 16} with corresponding indices of the blending widths being equal to {0, 1, 2, 3, 4, 5} . Usually, the blending width is chosen as power of 2 (i.e., 2n, with n equals to 1, 2, 3…) which may simplify the hardware implementation.
[0263] The ramp function should be quantized to an integer value to obtain the final weighting value ω (m, n) :
[0264] ω (m, n) =Clip3 (0, 8, (D (m, n) +32+4) >>3) (2)
[0265] where D (m, n) is the quantized result of and the continues position (xc, yc) is quantized to integer position (m, n) and>>indicates a right shift operation. The relationship between D (m, n) and is:
[0266] where is the round-down operation.
[0267] In another example of a blending method, the maximum value of the weight can be set to 32 instead of 8.
[0268] Consequently, the ramp functionω (m, n) becomes:
[0269] Finally, the two intra predictions in SGPM are blended to generate the prediction block:
[0270] Predcur (x, y) =W0 (x, y) ×P0 (x, y) +W1 (x, y) ×P1 (x, y) (6)
[0271] where P0 and P1 are two prediction results generated by two intra prediction modes, W0 and W1 are blending matrices of blending weightsω (m, n) for each geometric partition, normalized additionally to sum up to 1 for each position inside the prediction block. For example, when the maximum value of the weight is 32, W0 is and W1 is 1-W0.
[0272] In SGPM implementations, the blending widthτis determined from a set of pre-defined widths based on the shorter side of current block (either width W or height H) , e.g.:
[0273] 1. If the minimum of W and H is4, thenτ / 2 is selected.
[0274] 2. If the minimum of W and H is 8, thenτis selected.
[0275] 3. If the minimum of W and H is 16, then 2τis selected.
[0276] 4. If the minimum of W and H is 32, then 4τis selected.
[0277] 5. Otherwise, 8τis selected.
[0278] In GPM implementations, an additional signal is transmitted to indicate the blending width. The blending width is determined from a predefined set with five fixed candidates, i.e., {τ / 4, τ / 2, τ, 2τ, 4τ} .
[0279] The approach in "Lei Zhao, Kai Zhang, Li Zhang: JVET-AG0150 EE2-related: Adaptive GPM blending" proposed an adaptive GPM blending method with two alternative blending width candidate lists. In particular, list#0 ( {τ / 4, τ / 2, τ,2τ, 4τ} ) comprises the same blending candidates as the GPM, and list#1 ( {τ / 2, τ, 2τ, 4τ, 8τ} ) is designed for larger blocks, where at most 16 samples are blended on each side of the split boundary. The selection of the candidate list is adaptively based on the block size. If min (width, height) <32, list#0 is used. Otherwise list#1 is used.
[0280] 1.1.3 Generation of prediction block
[0281] For SGPM, after applying the TM based reordering, a candidate list is formed. Each candidate in the list includes at least one partition mode and two associated intra prediction modes. A corresponding SGPM mode index is used to signal which specific candidate from the candidate list is being utilized for the current block. Next, two predicted samples are generated from reference samples by using the two intra prediction modes of current block. The final prediction block is calculated by blending the two intra predicted samples. The blending width is selected from a set of pre-defined widths based on the shorter side of the current block.
[0282] For GPM, each of the two geometric partitions resulting from the geometric partitioning can be predicted using one of three prediction modes:
[0283] 1) Inter Prediction Mode: A uni-prediction signal is generated by using motion vector (s) from the merge candidate list.
[0284] 2) Intra Prediction Mode: A uni-prediction signal is generated from the reference pixels surrounding the partition, where the specific intra prediction mode is indicated by an index for indexing into an intra prediction mode (IPM) candidate list.
[0285] 3) Intra Block Copy (IBC) Mode: A uni-prediction signal is generated based on the candidate list for either the regular IBC merge mode or the IBC template matching merge mode.
[0286] The final prediction block is calculated by blending the two uni-prediction signals where the blending width is indicated by an additional signal.
[0287] 1.2 Template-based prediction
[0288] Template-based prediction refers to a family of intra prediction techniques that derive the intra prediction mode for a current coding block based on its reconstructed neighboring samples. Two examples of such modes are Template-based Intra Mode Derivation (TIMD) and Decoder-Side Intra Mode Derivation (DIMD) . Taking TIMD as an example, the use of TIMD to implicitly derive an intra prediction mode for a current block is shown in FIG. 13. As depicted, the neighbouring pixels of the current block serve as a template. A cost is calculated based on a difference (e.g., Sum of Absolute Transformed Differences-SATD) between the prediction and the reconstructed samples of the template. After evaluating all intra prediction modes this way, the intra prediction mode with the minimum cost is selected and used for intra prediction of the CU.
[0289] When performing intra prediction, the encoder and / or decoder generates prediction samples for each candidate intra prediction mode using reference samples from the lines above and to the left of the block being encoded. The list of candidate modes considered includes the most probable modes (MPM) determined from neighboring blocks. In the VVC standard, there are 67 possible intra prediction modes that can be candidates. However, this approach can be extended to consider an expanded set of 131 candidate intra prediction modes.
[0290] 1.3 Intra prediction mode
[0291] In VVC and in recent studies towards future video coding standards, the Intra prediction mode, through the combined application of but not limited to the Intra Planar, Intra DC, and Intra Angular modes, provide a flexible and efficient approach to encoding diverse image content.
[0292] Intra Planar Mode
[0293] This mode generates predicted pixel values by averaging the values of adjacent, encoded pixels along both horizontal and vertical boundaries of the current block. Specifically, it employs a weighted average of the pixels to the left and above the block to create a smoothly transitioning prediction block.
[0294] Intra DC Mode
[0295] The Intra DC mode, standing for Direct Current prediction, Unlike the Intra Planar mode, the Intra DC mode simplifies the prediction process by calculating the mean value of the adjacent, encoded pixels, without distinguishing between horizontal and vertical directions. The average value thus obtained is applied uniformly across current prediction block.
[0296] Intra Angular Mode
[0297] The Intra Angular mode, indicative of Angular prediction, supports up to 65 distinct predictive directions, encompassing both horizontal and vertical orientations. This mode predicts pixel values by simulating linear textures and edges present within the image, across various directions.
[0298] 1.4 Decoding process of legacy technologies
[0299] FIG. 14 illustrates a decoding process of the above-mentioned prediction mode in legacy technologies, with SGPM as an example.
[0300] Issue 1: Insufficient adaptability of blending for SGPM
[0301] While determining the blending width based solely on the block size can be a straightforward approach, it may not adequately account for the varying complexities present within an image's content, potentially leading to suboptimal blending results in areas with intricate details or textures. For example, screen content images usually contain more sharp edges, preferring a narrower blending area to preserve the high-frequency information. On the other hand, natural images typically contain smoother transitions, thus benefiting from usage of a wider blending area. Moreover, variable character of content within a single image may also require to adapt the blending width to achieve better prediction results. Consequently, it seems important to design a more suitable blending method that can use information from the specific content within the coded block or the neighbouring area of the block.
[0302] Issue 2: Signal overhead on adaptive blending for Geometric partitioning mode
[0303] In the current adaptive blending method for GPM, the index of the blending width is signalled in the bitstream (for each block that utilizes GPM) . This results in some signalling overhead, that could potentially affect the efficiency of the encoding process. Employing a more adaptive approach, that uses contextual information such as block size, block content or template area-based derivation, could allow to reduce the number of indices that need to be encoded and help to lower the signalling overhead.
[0304] Issue 3: distinct reference used for prediction in template and predicted block
[0305] In legacy template-based prediction methods, reference samples used for prediction in template area differ from reference samples used for prediction in current block. Consequently, prediction accuracy may vary significantly depending on the discrepancy between image content corresponding to the template area and current block. This discrepancy can be especially sound when template size (calculated as number of lines or columns) increases, which is usually motivated by making template matching more accurate. As a result, minimizing the above-mentioned discrepancy should improve the accuracy of template-based prediction methods.
[0306] The invention aims to provide two key improvements to intra prediction coding techniques:
[0307] 1. An improved blending method for GPM and SGPM that can efficiently adapt to the image content being coded.
[0308] 2. Enhancements to the template-based derivation methods used for intra prediction.
[0309] To achieve these objectives, the invention introduces two novel schemes into the coding process:
[0310] 1. Template Derived Blending Width (TDBW) -This technique selects the optimal blending width (SGPM or GPM) based on analysis of the current block and its corresponding template.
[0311] 2. Co-Predictive Sampling Scheme-This scheme, which comprises Reference Area Selection for Template-based Prediction (RAST) , ensures consistent prediction sample derivation for both the current block and its corresponding template.
[0312] 1) Template derived blending width:
[0313] The technique of Template Derived Blending Width (TDBW) selects the blending index based on characteristics of the current block and its neighboring area. TDBW can be applied during the TM reordering step, where either the SGPM blending width or GPM blending width is chosen for each candidate in the TM candidate list, at both the encoder and decoder.
[0314] The selection process tests each available blending width option for the first N candidates in the TM list, or all combinations of geometric partition modes and intra prediction modes explored during TM. Alternatively, TDBW can be used after a TM candidate is determined, selecting either SGPM or GPM blending width for the retrieved candidate.
[0315] FIG. 15. illustrates an example decoding process for SGPM that applies TDBW after the TM candidate is identified.
[0316] TDBW adaptively chooses the blending width (SGPM or GPM) for intra prediction based on analysis of the current and neighboring blocks, either during the TM reordering step or after the final TM candidate selection.
[0317] 2) Reference area selection for template-based prediction
[0318] The Reference Area Selection for Template-based prediction (RAST) technique ensures consistent prediction of samples for both the current block being coded and a corresponding template of the current block. With RAST, one or more lines of pixels near the current coding block are used for prediction of both the current block itself and its template.
[0319] RAST can be applied during the template derivation process, where the reference area used to reconstruct the template differs from the reference area used to predict the current block's samples. Additionally, the finalized template is used for calculating the coding cost of the template.
[0320] The finalized template can take two forms: 1) The predicted template comprising one or more lines of pixels located above and / or to the left of the reference sample lines used for prediction. 2) The original template consisting of one or more lines of pixels adjacent to the current coding block.
[0321] RAST ensures consistency by using the same set of reference pixels for both block and template prediction, while allowing flexibility in determining the final template form used for coding.
[0322] 2 Embodiment#1: Template derived blending width for SGPM
[0323] This embodiment describes the decoding process for SGPM with template derived blending width. The encoding method and / or a decoding method comprises:
[0324] 1. Obtaining the SGPM candidate index.
[0325] 2. Obtaining a first candidate list by template matching (TM) based reordering.
[0326] 3. Checking whether template derived blending width (TDBW) is available or decode whether TDBW is enabled for the current block. Details are described in section 9.1 titled “Checking whether TDBW is available and / or is enabled. ”
[0327] 4. Determining the size of TDBW template area for each candidate in the first candidate list. Details are described in section 8.1.1 titled “Template composition. ”
[0328] 5. Selecting the TDBW blending width for each candidate in the first candidate list based on the cost. Details are described in section 9.2 titled “Determination of the blending width. ”
[0329] 6. Reordering the first candidate list to get the second candidate list based on the updated cost after applying blending with TDBW. Details are described in section 9.4 titled “Reordering of the candidate list. ” .
[0330] 7. Retrieving the corresponding candidate from the second candidate list upon the decoded SGPM candidate index and extract the partition mode and two intra prediction modes associated with the retrieved candidate.
[0331] 8. Generating two intra prediction blocks to the respective partitioned blocks.
[0332] 9. Generating the final prediction block for the current block by weighted combining the two prediction blocks based on the partition mode and blending width where the blending width is the first TDBW blending width. Details are described in section 9.5 titled “Generation of prediction block with derived blending width. ”
[0333] 3 Embodiment#2: Template derived blending width for SGPM after candidate is determined
[0334] This embodiment describes the decoding process for SGPM with template derived blending width. The encoding method and / or a decoding method comprises:
[0335] 1. Obtaining the SGPM candidate index.
[0336] 2. Obtaining the candidate list by template matching (TM) based reordering.
[0337] 3. Retrieving the corresponding candidate from the candidate list upon the decoded SGPM candidate index and extract the partition mode and two intra prediction modes associated with the retrieved candidate.
[0338] 4. Checking whether template derived blending width (TDBW) is available or decode whether TDBW is enabled for the current block. Details are described in section 9.1 titled “Checking whether TDBW is available and / or is enabled. ”
[0339] 5. Determining the size of template area for current block. Details are described in section 8.1.1 titled “Template composition. ”
[0340] 6. Selecting the TDBW blending width for the retrieved candidate based on the cost. Details are described in section 9.2 titled “Determination of the blending width. ”
[0341] 7. Generating two intra prediction blocks to the respective partitioned blocks.
[0342] 8. Generating the final prediction block for the current block by weighted combining the two prediction blocks based on the partition mode and blending width where the blending width is the first TDBW blending width. Details are described in section 9.5 titled “Generation of prediction block with derived blending width. ”
[0343] 4 Embodiment#3: Template derived blending width for GPM
[0344] This embodiment describes the decoding process for GPM with template derived blending width. The encoding method and / or a decoding method comprises:
[0345] 1. Obtaining the GPM candidate index.
[0346] 2. Obtaining a first candidate list by template matching (TM) based reordering.
[0347] 3. Checking whether template derived blending width (TDBW) is available or decode whether TDBW is enabled for the current block. Details are described in section 9.1 titled “Checking whether TDBW is available and / or is enabled. ”
[0348] 4. Determining the size of template area for current block. Details are described in section 8.1.1 titled “Template composition. ”
[0349] 5. Selecting the TDBW blending width for each candidate in the first candidate list based on the cost. Details are described in section 9.2 titled “Determination of the blending width. ”
[0350] 6. Reordering the first candidate list to get the second candidate list based on the updated cost after applying blending with TDBW. Details are described in section 9.4 titled “Reordering of the candidate list. ”
[0351] 7. Retrieving the corresponding candidate from the second candidate list upon the decoded GPM candidate index and extract the partition mode associated with the retrieved candidate.
[0352] 8. Generating two prediction blocks for each part of partitioned blocks. Each prediction block is derived by its own motion vector or its own intra prediction mode.
[0353] 9. Generating the final prediction block for the current block by weighted combining the two prediction blocks based on the partition mode and blending width where the blending width is the first TDBW blending width. Details are described in section 9.5 titled “Generation of prediction block with derived blending width. ”
[0354] 5 Embodiment#4: Template derived blending width for GPM after candidate is determined
[0355] This embodiment describes the decoding process for GPM with template derived blending width. The encoding method and / or a decoding method comprises:
[0356] 1. Obtaining the GPM candidate index.
[0357] 2. Obtaining the candidate list by template matching based reordering.
[0358] 3. Retrieving the corresponding candidate from the candidate list upon the decoded GPM candidate index and extract the partition mode associated with the retrieved candidate.
[0359] 4. Checking whether template derived blending width (TDBW) is available or decode whether TDBW is enabled for the current block. Details are described in section 9.1 titled “Checking whether TDBW is available and / or is enabled. ”
[0360] 5. Determining the size of template area for current block. Details are described in section 8.1.1 titled “Template composition. ”
[0361] 6. Selecting the TDBW blending width for the retrieved candidate based on the cost. Details are described in section 9.2 titled “Determination of the blending width. ”
[0362] 7. Generating two prediction blocks for each part of partitioned blocks. Each prediction block is derived by its own motion vector or its own intra prediction mode.
[0363] -Generating the final prediction block for the current block by weighted combining the two prediction blocks based on the partition mode and blending width where the blending width is the first TDBW blending width.Details are described in section 9.5 titled “Generation of prediction block with derived blending width. ”
[0364] 6 Embodiment#5: Lookup table for template derived blending width
[0365] This embodiment describes an encoding method and / or a decoding method using the lookup table that can be used for deciding whether template derived blending width is available for GPM / SGPM and / or for determining the size of template area used for current block. The encoding method and / or a decoding method comprises:
[0366] 1. Obtaining the partition mode of GPM / SGPM.
[0367] 2. Checking whether template derived blending width (TDBW) is available and / or determine the size of template area for current block based on the lookup table. Details are described in section 9.1 titled “Checking whether TDBW is available and / or is enabled. ”
[0368] 7 Embodiment#6: Reference area selection for template-based prediction
[0369] This embodiment describes the Reference Area Selection for Template-based prediction (RAST) to be used as an alternative solution to the location of reference samples used for prediction in the template area. The encoding method and / or a decoding method comprises:
[0370] 1. Determining the size of template area for current block. Details are described in section 8.1.1 titled “Template composition. ”
[0371] 2. Determining the reference samples which are one or several lines of pixels adjacent to the current block used for prediction in the template area. Details are described in section 10 titled “Reference area selection for template-based prediction. ”
[0372] 3. Generating prediction samples of the template using the reference samples. Details are described in section 10 titled “Reference area selection for template-based prediction. ” .
[0373] 4. Selecting the first TDBW blending width to be applied in GPM / SGPM based on the cost derived from the template. Details are described in section 9.2 titled “Determination of the blending width. ”
[0374] This method is not restricted to TDBW exclusively and, in fact, can be used to perform prediction in the template area in any image or video coding method that uses template-based derivation.
[0375] 8 Solutions
[0376] 8.1 Definition of template for deriving blending width
[0377] A template is used to select the best blending width or to generate a candidate list of blending widths. The template is characterized by the following features.
[0378] 8.1.1 Template composition
[0379] The template can be defined as rectangular coded areas to the left of and above the current block.
[0380] The template can be defined as rectangular coded areas to the left of, above and above-left of the current block.
[0381] The template can be one template part (above or to the left of current block) in which the partition border is present. The partition border is the blending area extended to the template.
[0382] Each template area is composed of pixels that have reconstruction values.
[0383] 8.1.2 Size of template
[0384] The size of the template is defined as the number of rows for a template area located above the current block or the number of columns in case of a template area located to the left of the current block.
[0385] The size of the template can be decided by various factors such as frame resolution, block size, pixel count or partitioning mode.
[0386] For example, the template size may be set to a specific number if the block size satisfies a certain condition (e.g., less than, greater than, equal to, etc. ) a specified value. In cases where the block size is smaller than 8x8, the corresponding template may include one row above or one column to the left of the current block. Conversely, if the block size is larger than 16x16, the template may include all the available rows above or columns to the left of the current block, where the maximum of available rows or columns is set according to specific codec settings.
[0387] For example, larger template sizes may be applied to higher resolution content (e.g., 4K content) in order to derive the blending width.
[0388] For example, the template size can be the same as the one used in TM based reordering, which typically includes one row above or one column to the left of the current block.
[0389] For example, the template size can also be determined based on the block size and partitioning mode, e.g. by using a lookup table that specifies the template size for each allowed combination of block size and partitioning mode.
[0390] 8.1.3 Applying blending weights in template
[0391] In addition, the blending weights are extended from current block to the template. This allows for application of blending weights that vary with the changing blending width in the template area. FIG. 16 shows a partition line, a current block, and templates of the current block. In order to derive the weights for each sample in the template, distance of each of these samples to the partition border is used (see FIG. 12) .
[0392] Therefore, theramp function can be used to deriveω (m, n) inthetemplate:
[0393] where (m, n) ∈R, R is the set of coordinates of all pixels in the template area, d (m, n) is the distance from one position to the partition line, andτis the value of blending width.
[0394] 9 Template derived blending width
[0395] This invention introduces template derived blending width (TDBW) for GPM / SGPM, an operation that derives SGPM blending width before or after SGPM candidate list is constructed and / or before prediction of current block is calculated. It allows to determine a blending width of the current block among a set of blending widths. The derived blending width should either be the width of the blending area or an index, which is used to select the width of the blending area from a predefined set of values.
[0396] 9.1 Checking whether TDBW is available and / or is enabled
[0397] 9.1.1 Factors or parameters for TDBW determination
[0398] TDBW is available to either GPM or SGPM modes, or both. At least one of the following factors can be used for deciding whether TDBW is available:
[0399] 1. Prediction mode: A specific algorithm or method used in the encoding or decoding processes, where a predictor is employed to estimate or predict the value of a data element based on available information. The prediction mode can include but is not limited to, e.g., intra planar mode, intra DC mode, intra angular modes, inter modes, or IBC mode. One or several prediction modes with which the two geometric partitions are predicted.
[0400] 2. Block size: The dimensions or size of a block in an MxN array of samples.
[0401] 3. Partition mode: A geometric partition index indicating the geometric partition (angle and offset) .
[0402] 4. High level syntax: A control flag signalled in a block, slice, picture or group of picture level.
[0403] 9.1.2 TDBW available determination methods or approaches
[0404] Based on those given factors or parameters as presented in section 9.1.1 titled “Factors or parameters for TDBW determination” , one of the following method or approaches is used for TDBW determination, as shown in the following,
[0405] 1. Determined by prediction mode: TDBW is made available to either all or a subset containing at least one of the prediction modes: 1) inter prediction mode 2) intra prediction mode 3) IBC mode.
[0406] For example, if the obtained prediction modes (with which the two geometric partitions are predicted) are, or ifone of them is, the intra angular mode, then TDBW is used; otherwise, TDBW is not used.
[0407] For example, if the obtained prediction modes are, or if one of them is, the IBC mode, then TDBW is not used; otherwise, TDBW is used.
[0408] Different prediction modes (e.g., intra-prediction modes, inter-prediction modes) have varying characteristics and efficiencies. Applying TDBW selectively can maximize its benefits.
[0409] 2. Determined by block size. TDBW is made available to either all or certain block sizes. TDBW is applied when the block size meets specific criteria related to its dimensions.
[0410] For example, if the block has a minimum block dimension of 8 luma pixels and / or a maximum block dimension of 32 luma pixels, TDBW is used; otherwise, TDBW is not used.
[0411] For example, if the block has a larger-to-smaller dimensions ratio that is smaller or equal to 4, TDBW is used; otherwise, TDBW is not used.
[0412] For example, if the block consists of a square shape with equal dimensions, TDBW is used; otherwise, TDBW is not used.
[0413] 3. Determined by partition mode. TDBW is made available to either all or certain partition modes.
[0414] For example, if the partition mode has a partition border that does not cross any corner of current block, TDBW is not used; otherwise, TDBW is used.
[0415] For example, if the partition mode has vertical and / or horizontal partition lines, TDBW is used; otherwise, TDBW is not used.
[0416] 4. Determined by block size and partition mode. Alternatively, the availability of TDBW may be jointly determined by a block size, and / or a partition mode. This determination can be based on a specific set of rules, whereby TDBW is used only when certain combinations of the block size, and / or the partition mode are concurrently satisfied.
[0417] For example, TDBW can be available based on a lookup table (LUT) , establishing a correspondence between the block size, partition mode, or other relevant parameters and the application of TDBW. If the specific combination of block size and partition mode matches an entry in the lookup table, TDBW is used; otherwise, TDBW is not used.
[0418] For example, this LUT can further determine the size of the template based on a block size and a partitioning mode when enabling TDBW. If the specific combination of block size and partition mode matches an entry in the LUT, TDBW is used and the template size of TDBW is set to the value in the LUT.
[0419] The construction of such LUT can be based on, but is not limited to, statistical analysis of prediction error of TDBW under varying conditions, such as whether TDBW is enabled, and the size of the TDBW template. The table below shows an example of LUT. It allows for indexing the size of the template by the corresponding partitioning mode in each row and the block size in each column. Indexed value of” N / A” indicates that TDBW is not enabled.
[0420] Table 1
[0421] Jointly considering these factors for TDBW application allows for a more sophisticated optimization strategy.
[0422] 5. Determined by block size and prediction mode. Alternatively, the availability of TDBW may be jointly determined by a block size, and / or a prediction mode. This determination can be based on a specific set of rules, whereby TDBW is used only when certain combinations of the block size, and / or the prediction mode are concurrently satisfied.
[0423] For example, TDBW can be available based on a LUT, establishing a correspondence between the block size, prediction mode, or other relevant parameters and the application of TDBW. If the specific combination of block size and prediction mode matches an entry in the LUT, TDBW is used; otherwise, TDBW is not used.
[0424] For example, this LUT can further determine the size of the template based on a block size and a prediction mode when enabling TDBW. If the specific combination of block size and prediction mode matches an entry in the LUT, TDBW is used and the template size of TDBW is set to the value in the LUT.
[0425] 6. Determined by block size, partition mode and prediction mode. Alternatively, the availability of TDBW may be jointly determined by a block size and / or a partition mode, and / or a prediction mode. This determination can be based on a specific set of rules, whereby TDBW is used only when certain combinations of the block size and / or a partition mode, and / or the prediction mode are concurrently satisfied.
[0426] For example, a specific LUT can be established for each prediction mode or a selected set of prediction modes. If the specific combination of block size and partition mode matches an entry in the corresponding LUT specific to the prediction mode, TDBW is used; otherwise, TDBW is not used.
[0427] 7. Determined by high level syntax. Utilize a control flag to indicate the availability of TDBW. The control flag can be signalled at block, slice, picture or group of picture level (e.g. in slice header) to indicate the availability of TDBW.
[0428] For example, if the decoded TDBW flag for the current block is true, TDBW is used.
[0429] As an optimization, the additional control flag can be signalled e.g. only when TDBW is available to the current block. Besides, the size of the TDBW template can be determined by other factors, such as block size, partition mode, prediction modes and so on. Providing a high-level syntax allows for easier integration and adaptation of TDBW in various encoding scenarios.
[0430] 9.2 Determination of the blending width
[0431] In order to achieve the determination of blending width at the video decoding, various implementation methods are provided in this invention, including blending width determination based on indication information and blending width determination based on derivation.
[0432] 1. Blending width indication: An indication is used to indicate the blending width for each block. For a detailed description of the implementation method, please refer to section 9.2.1 titled “Blending width indication. ”
[0433] 2. Blending width Derivation: The blending width is derived from several factors or parameters. For a detailed description of the implementation method, please refer to section 9.2.2 titled “Blending width Derivation. ”
[0434] 9.2.1 Blending width indication
[0435] Indication is used to indicate the blending width for each block, several approaches are provided in the following,
[0436] For example, a flag is used to select the blending width for the current block from a pre-defined indices set(on the encoding side, it is the blending width with which the prediction of current block has a smaller prediction error, e.g. SATD) . The pre-defined indices set can be the two adjacent indices of the blending width, one blending width determined by the default method, such as being determined by the shorter side of current block and another blending width smaller than the first one.
[0437] For example, a flag is used to select the blending width for the current block from a pre-defined indices set. The pre-defined indices set can be the two adjacent indices of the blending width, one blending width determined by the default method, such as being determined by the shorter side of current block and another blending width larger than the first one.
[0438] For example, an additional flag (sgeo_bld_enable_flag) is firstly signaled to indicate the method of signaling blending width. When the flag is one, it indicates the indication method is applied. Otherwise, the blending width of current block is the first blending width, which can be determined by the default method, such as being determined by the shorter side of current block. When the flag is one, another flag (sgeo_bld_offset_flag) can be further signaled to indicate whether the blending width is lower than or higher than the first blending width, respectively.
[0439] Coding method for blending width indication
[0440] Fixed length code: Use binarized index with fixed length code to indicate the blending width.
[0441] For example, the flag for blending width indication is coded by binarized index with fixed length code.
[0442] For example, the blend width is first sorted based on some criteria (e.g., template cost) to obtain a list. The flag used to indicate the index in the list is then encoded by a fixed length code.
[0443] Variable length code: Use binarized index with variable length code to indicate the blending width. The variable length code can be, but not limited to, truncated unary code, truncated rice code or exp-golomb code.
[0444] For example, the flag for blending width indication is coded by truncated unary code.
[0445] For example, the blend width is first sorted based on some criteria (e.g., template cost) to obtain a list. The flag used to indicate the index in the list is then encoded by truncated unary code.
[0446] Available blending widths for indication:
[0447] In some examples, the indication is among a set of pre-defined indices of widths. These indices represent all the blending widths that can be used in the GPM / SGPM prediction of the current block.
[0448] In some examples, the available widths may be a reduced subset of the width candidates. This reduction is based on the pre-defined widths, and the number of width candidates in the subset may be less than the one in the pre-defined set. For example, three width candidates, which include the first blending width and its two adjacent blending widths, can be selected from the pre-defined widths as the available width candidates.
[0449] In another example, blending width is selected among a pre-defined subset of blending widths available to the predicted block. This subset can be determined e.g. based on the prediction mode, partition mode, block size, acombination of any of the above factors or using a dedicated look-up table.
[0450] 9.2.2 Blending width Derivation
[0451] In TDBW, the blending width is derived by comparing costs calculated for multiple widths in the template. The derivation includes two steps: template cost calculation and blending width selection.
[0452] The specific steps are as follows:
[0453] Step 1: Template cost calculation. Apply multiple blending widths to template, and calculate costs for each choice. The cost of each blending width in template is defined as a difference metric between the prediction values of the template and the reconstructed samples of the template. The prediction values for each blending width are obtained by applying GPM / SGPM mode in the template area and blending the resultant partitions according to the inspected blending width.
[0454] One can use various types of metrics as a difference metric, including SATD, SSE, SAD, MSE or other relevant quality assessment metric as the difference metric.
[0455] Step 2: Blending width selection. In some implementations, the selected blending width βopt∈ {β0, β1, …, βn} is the oneminimizing the cost among all available widths.
[0456] where R is the set of coordinates of all pixels in the template area, which include one or several rows of pixels adjacent to the top of the current block and / or one or several columns of pixels adjacent to the left of the current block, PredC is the prediction in the template area, and Rec' Cis the reconstruction in the template area.
[0457] With the two intra predictions and one blending width, the prediction in the template area Predc (x, y, β) can be calculated by Eq. (6) , where P0 and P1 are two prediction results generated by two intra prediction modes in template area, W0 and W1 are two blending matrices for each geometric partition using normalizedω (m, n) in different positions of the template.
[0458] In some examples, when using SAD as a difference metric, the derived blending widthβopt is obtained by a SAD minimization formula:
[0459] In the formula, arg outputs or returns an argument which refers to the input valueβthat produce a particular output for a function, and min outputs or returns for a minimum value that minimize the function's output.
[0460] Alternatively, the blending width is selected by comparing the cost of the first blending widthβ1 with the costs of other candidate blending widthsΒC={β2, β3, …, βn}. The selected blending width is the one that has the lowest cost. In some examples, the first blending width can be the blending width determined based on the block size. If the costs of these candidate blending widths are lower than that of the first blending width, then the blending width is chosen as the one with the smallest cost among the candidates. Otherwise, the first blending width is selected as the blending width.
[0461] In some examples, the selection is among a set of pre-defined indices of blending widths. These indices represent all the blending widths that can be used in the GPM / SGPM prediction of the current block.
[0462] In some examples, the available widths may be a reduced subset of the width candidates. This reduction is based on the pre-defined widths, and the number of width candidates in the subset may be less than the one in the pre-defined set. For example, three width candidates, which include the first blending width and its two adjacent blending widths, can be selected from the pre-defined widths as the available width candidates.
[0463] In another example, blending width is selected among a pre-defined subset of blending widths available to the predicted block. This subset can be determined e.g. based on the prediction mode, partition mode, block size, acombination of any of the above factors or using a dedicated look-up table.
[0464] 9.3 Extend the candidate list
[0465] After the blending width is derived in the template, a corresponding candidate list expansion process can be performed on GPM / SGPM candidates to determine the second merge candidate list along with the selected blending width. Each of the video encoding system 110 and video decoding system 120 may perform the candidate list expansion process for a candidate, such as the first candidate list. The candidate list expansion process can be performed by intra-frame prediction 1104 in the video encoding system 110and / or intra prediction 1203 in the video decoding system 120. For example, the first candidate list is an input of the candidate list expansion process, in which, each candidate in the first candidate list is used as a current candidate to derive an updated candidate list. After processing each candidate in the first candidate list, the candidate list expansion process outputs a resulting derived candidate list as the second candidate.
[0466] For each element referred to as a current candidate in the first candidate list, the encoder and / or the decoder performs the blending width derivation as detailed in section 9.2.2 titled “Blending width Derivation. ” . If the derived blending width of the current candidate differs from the first blending width (the first blending width is the blending width determined based on the block size, as illustrated in section 1.1.2) , add the current candidate to the first candidate list to form the derived candidate list, following the ascending order of template cost. The candidate (s) added to the derived candidate list is referred to as derived candidate (s) .
[0467] The second merge candidate list is generated by inserting the derived candidates into the first candidate list. The derived candidates include the first N elements in the derived candidate list with lowest template costs, where N is at least 1, depending on the settings.
[0468] For example, in SGPM, the first candidate list comprises 16 candidates, each candidate including information about a geometric partition mode and two intra prediction modes. The second merge candidate list is generated by inserting 1 (in an example where N=1) candidate into the first candidate list. This candidate includes information about a geometric partition mode, two intra prediction modes and a derived blending width.
[0469] 9.4 Reordering of the candidate list
[0470] After the blending width is derived in the template, a corresponding candidate reordering method is performed on GPM / SGPM candidates to determine the second merge candidate list along with the selected blending width. The second merge candidate list includes information of blending width, in which each candidate has one blending width derived.
[0471] The second merge candidate list is generated by reordering the first candidate list in ascending ordering based on the updated cost after applying the derived blending width. The reordering process may involve reordering the first N candidates or all candidates in the TM candidate list, depending on the settings.
[0472] 9.5 Generation of prediction block with derived blending width
[0473] In TDBW, the generation of the current prediction block follows the same process as described in Section 1.1.3. However, the main difference lies in the blending process where the blending width is derived from the template, which is different from GPM / SGPM.
[0474] 10 Reference area selection for template-based prediction
[0475] This invention introduces a method of reference area selection for template-based prediction (RAST) by selecting different reference samples to be used to generate prediction samples of the template. This method can be applied to the blending width derivation process described in section 9.2.2 titled “Blending width Derivation” but is not restricted to TDBW. In fact, the reference area selection method can be used in any image or video coding method that uses template-based derivation.
[0476] 10.1 Checking whether RAST is available and / or is enabled
[0477] 10.1.1 Checking whether RAST is available
[0478] In general, RAST is available to any image or video coding method that uses template-based derivation. At least one of the following factors can be used for deciding whether RAST is available:
[0479] 1. Prediction mode. RAST is made available to all or a non-empty subset of the prediction modes: TIMD, DIMD, GPM / SGPM, TDBW, or other prediction modes that use template-based derivation.
[0480] 2. Block size. The dimensions or size of a block are indicated by its block width (W) and the block height (H) . RAST is made available to either all or certain block sizes. RAST is applied when the block size meets specific criteria related to its dimensions.
[0481] 3. High level syntax. A control flag indicating whether RAST is available may be signalled in block, slice, picture or group of picture level.
[0482] 4. Template cost. Availability of RAST may depends on the template cost, which is defined as a difference metric between the prediction values and the reconstructed samples in a template.
[0483] 10.1.2 Checking whether RAST is enabled
[0484] Whether RAST is enabled for the current block can be derived from at least one of the following criteria:
[0485] 1. Always on. RAST is enabled as long as template-based derivation is available to the current block.
[0486] 2. Explicit indication.
[0487] For example: a flag is used to indicate whether RAST is enabled.
[0488] For example: a first flag is used to indicate that either a legacy template-based prediction method or RAST is enabled. If the first flag is true, a second flag is used to indicate which one of legacy template-based prediction methods and RAST is enabled and the other is disabled.
[0489] For example: a flag is used to indicate that both the legacy template-based prediction method and RAST are enabled as a combination.
[0490] 3. Dependent on legacy signals. RAST can be enabled if a prediction mode that uses template-based derivation is selected. RAST can be made available to all or certain block sizes.
[0491] In an example, RAST is enabled whenever template-based derivation is enabled. Alternatively, in another example, RAST is enabled whenever template-based derivation is disabled.
[0492] In an example, RAST is applied when the block size meets specific criteria related to its dimensions. For example, if the block has a minimum block dimension of 8 luma pixels and / or a maximum block dimension of 32 luma pixels, TDBW is used; otherwise, TDBW is not used.
[0493] 4. Decoder derivation. From a reconstructed image, decoder determines if RAST is enabled for the current block based on the template cost.
[0494] For example: RAST is enabled when the template cost of RAST is less than the template cost of another template-based derivation method.
[0495] 5. High level syntax. A control flag that indicates whether RAST is enabled is signalled in block, slice, picture or group of picture level indicates the conditions of enabling RAST.
[0496] For example: if the decoded RAST flag for the current block is true, RAST is used.
[0497] For example: if the decoded RAST flag for the current slice is true, RAST is used for current slice.
[0498] 10.2 Selection of reference samples for template prediction
[0499] The prediction samples of the template are generated using the reference samples, which are one or several lines of pixels adjacent to the current block. The reference samples include both rows above the current block or columns to the left of the current block. These same reference samples are also used for the prediction of the current block. FIG. 17 shows the reference samples. This positioning is crucial to ensure that the selected reference samples are common to both the template area and the current block, thereby facilitating a more accurate prediction process.
[0500] 10.2.1 Extension of reference samples
[0501] The technique extends the reference line used for intra prediction by adding one or more columns or rows of pixels. This reference line extension adjusts the size of the reference area, enabling a broader range of intra prediction directions to be utilized for the template area.
[0502] The extension process operates similar to how the reference area is constructed for traditional intra angular prediction modes or the intra planar mode. By expanding the reference line, more angular intra prediction directions can be employed when predicting the samples within the template region.
[0503] This allows greater flexibility and accuracy in template prediction by providing access to a wider spatial region of already-coded neighboring pixels as reference data for the prediction process.
[0504] The extension could be added to the top of the left reference area and / or to the left of the above reference area. The number of pixels added to the reference line may be greater than or equal to the size of the template. The exact number of pixels being added may depend on the prediction mode used in template area and its prediction direction (e.g. Intra Angular mode) and should allow for valid prediction according to the selected prediction mode.
[0505] In cases where the reference area cannot be extended by the requested number of pixels, such as when encountering the picture border or reaching the maximum available reference lines or columns for the current block, padded sample values are used in place of the missing samples.
[0506] In other words, if the technique attempts to extend the reference area beyond the actual coded data available (due to limits like the picture boundary) , it substitutes padded or synthesized sample values for any samples that cannot be obtained from the neighboring regions. This allows the prediction to proceed despite hitting the reference area extension limits.
[0507] For example, concerning a current template to be predicted, the number of rows for a template area located above the current block is ht, and the number of columns for a template area located to the left of the currentblock is wt. The left column of reference samples canbe extended upwardby ht pixels, and the above row can be extended to the left by wt pixels. As illustrated in FIG. 18, the extended portion of the reference line is shown.
[0508] The reference area extension can additionally be applied to the bottom of the left reference area and / or to the right of the above reference area. This allows intra planar prediction or angular prediction along the top-right / bottom-left directions for samples in the right-bottom region of the current coding block, if the desired prediction direction requires such an extension.
[0509] In simpler terms, in addition to extending the main reference line, the technique can also grow the reference area to the bottom of the left neighboring region and / or to the right of the above neighboring region. This expanded reference area enables intra planar or angular intra prediction modes that need to reference samples in the top-right or bottom-left directions relative to the current coding block.
[0510] The optional extra extension of the reference area provides the necessary neighboring pixels to support a wider range of intra prediction directions, including those angled toward the top-right and bottom-left corners of the block.
[0511] For example, the left column of reference samples can be extended upward by ht+n pixels, where n is at least 0 and downward by H pixels, and the above row can be extended to the left by wt+n pixels, where n is at least 0 and to the right by W pixels. As illustrated in FIG. 19, the extended portion of the reference line is shown.
[0512] Extending the reference samples is an optional step, and many prediction methods used in template-based intra prediction can operate without applying the extension. For example, the Intra DC prediction mode does not require the reference sample extension.
[0513] However, the ability to extend the reference samples still exists as a tool that can potentially improve prediction accuracy for certain modes or block configurations. While not mandatory, the decoder and / or the encoder may choose to utilize the reference sample extension if it proves beneficial for improving the accuracy of the template prediction process.
[0514] There are several ways the reference samples in the extended portion of the reference line can be derived:
[0515] 1. Reconstructed Samples: Using the actual reconstructed samples, if they are available.
[0516] 2. Interpolated Samples: Interpolating the values using the closest available reference samples from the reference row and column as a basis.
[0517] 3. Extrapolated Samples: Extrapolating the values using the closest available reference samples from the reference row and column.
[0518] 4. DC Values: Using a constant DC value calculated as either the average of the reference line samples or the average of all pixel values in the entire image.
[0519] The choice of which derivation method to use for the extended reference line samples can be made adaptively based on factors like coding efficiency, complexity, or properties of the video content itself. Having multiple options provides flexibility in determining the most suitable approach for generating the extra required reference data.
[0520] 10.3 Defining the template area for RAST
[0521] The detailed definition of the template area for RAST is similar to that for TDBW, as illustrated in section 8.1.
[0522] For effective application of RAST, the template area can be positioned in one of several ways:
[0523] 1. Above and / or to the left of the lines of reference samples used for prediction.
[0524] 2. Encompassing not only the lines above and / or to the left, but also the reference sample lines themselves.
[0525] 3. Encompassing not only the lines above and / or to the left, but also any extended reference samples (see section 10.2.1) .
[0526] This flexibility allows the template area to be constructed in the optimal configuration to best leverage the reference data for accurate prediction, based on the characteristics of the coding block, available reference areas, and desired prediction modes. The RAST technique provides multiple ways to associate the template with the reference data.
[0527] 10.4 Generating prediction within the template using RAST
[0528] The final step in the RAST process is to generate the prediction samples for the template itself based on the selected reference samples.
[0529] This is done by employing the chosen intra prediction mode on the template area, using the reference samples selected through the RAST process (described in section 10.2) as the reference data for that intra prediction mode.
[0530] In other words, after determining the optimal reference area through RAST, the encoder / decoder performs intra prediction specifically for the template region, using samples from the RAST-selected reference area as the starting point for whichever angular, planar, or other intra prediction mode is being utilized.
[0531] This final prediction step produces the reconstructed sample values for the template area itself, complementing the earlier intra prediction performed on the coding block using the same selected reference area. Ensuring consistent reference data is used for both block and template prediction is a key aspect of the RAST technique.
[0532] For the detailed definition of the intra prediction modes refer to section 1.3.
[0533] For the specific case when the intra prediction mode is the Intra DC (Direct Current) mode, the encoder / decoder calculates the mean value across all the reference samples selected through the RAST process.
[0534] This single average value is then used to populate all samples uniformly across the entire current template area being predicted.
[0535] For the intra planar prediction mode, RAST may not be applicable, or could be implemented through linear extrapolation of sample values in the template area based on the RAST-selected reference samples.
[0536] In some cases, an extension is added to the top of the left reference area and / or to the left of the above reference area. The number of pixels in this extension may exceed the size of the template itself.
[0537] When such extensions occur, there are a few ways to predict the template samples:
[0538] 1. For the top-left part of the template, original interpolation using the reference samples can be employed.
[0539] 2. For the top template area, extrapolation from the reference samples can generate the predictions.
[0540] 3. For the left template area, extrapolation from the reference samples can also produce the predictions.
[0541] For intra angular prediction modes, the prediction angle used for the current coding block must be reversed before applying that same angular mode to predict the template area.
[0542] Specifically, if a prediction angular mode at angleθwas used to predict the samples of the current block, then the Same mode at the reversed angle (π-θ) should be employed to generate the prediction samples for the corresponding template region.
[0543] This angle reversal ensures that the intra angular prediction direction points into the template area from the reference samples, rather than away from them as it did for the current block itself.
[0544] Reversing the angle direction allows the same geometrically-defined angular intra mode to be accurately applied to the template, producing sample predictions consistent with those of the current block but adapted to the template's orientation relative to the reference area.
[0545] 10.4.1 Reversing the intra prediction angle
[0546] In some cases, the intra prediction direction applied to the template area needs to be reversed compared to the direction used for the current coding block. This prediction direction is typically specified by an angular mode and corresponding prediction angle, as is done for intra angular prediction modes.
[0547] Specifically for intra angular modes, when one part of the template area and the current block are located on opposite sides of the reference columns / rows, the prediction angle should be reversed before applying it to that part of the template area.
[0548] However, if the template area and current block are on the same side relative to the reference columns / rows, then the same prediction angle can be used without reversal.
[0549] As shown in FIG. 20, in an example, consider horizontal angular prediction where the columns to the left of the current block are the reference samples:
[0550] 1. If the mode for the current block uses an angle pointing leftwards
[0551] 2. Then the top template area can use that same leftward angle
[0552] 3. But the left and left-above template areas would use the reversed, rightward pointing angle.
[0553] As another example, consider if the intra angular mode used for the current coding block employs an angle that points in a "bottom-left" direction, as shown in FIG. 21.
[0554] In this case, the top template area located above the current block can use that same "bottom-left" angled prediction.
[0555] However, for the left template area and the left-above template area, the prediction angle would need to be reversed to point in the "top-right" direction instead.
[0556] So the template areas above the current block can directly utilize the same angular prediction direction. But the template regions to the left require reversing the angle to correctly point into those areas from the reference samples used for prediction.
[0557] As shown in FIG. 22, in another example, consider the case when the rows above the current coding block are used as the reference samples.
[0558] If the intra angular mode employed for the current block uses an angle pointing in the "top-left" direction, then:
[0559] For the left template area, that same "top-left" angled prediction can be applied directly.
[0560] For the top template area above the current block, the prediction angle would need to be reversed to point in the "bottom-right" direction instead.
[0561] Similarly, for the left-top template area, the "bottom-right" reversed angle would be used.
[0562] So when the reference samples are above the current block, the template areas to the top and top-left require reversing the original angular prediction direction used for the current block. But the left template area can utilize the same angular mode direction.
[0563] This reversal is crucial for aligning the prediction process with the orientation and positioning of the template area relative to the current block.
[0564] With reference to FIG. 23, the embodiment of the disclosure also provides a chip 70 that may correspond to an encoder in the embodiments of the disclosure. The chip 70 may implement a corresponding process realized by the encoder (i.e., video encoding system 110) in various methods of the embodiments of the disclosure. The chip 70 includes a processor 71, and the processor 71 may call and run a computer program from memory to implement the methods in the embodiments of the present application.
[0565] Optionally, the chip 70 may also include a memory 72. In particular, the processor 71 may call and run the computer program from the memory 72 to implement the methods in the embodiments of the present application.
[0566] Moreover, the memory 72 may be a separate device from the processor 71 or may be integrated into the processor 71.
[0567] Optionally, the chip 70 may further include an input interface 73. Note that the processor 71 may control the input interface 73 to communicate with other devices or chips, specifically, to obtain messages or data sent by other devices or chips.
[0568] Optionally, the chip 70 may further include an output interface 74. Note that the processor 71 may control the output interface 74 to communicate with other devices or chips, specifically, to output messages or data to other devices or chips.
[0569] With reference to FIG. 24, the embodiment of the disclosure also provides another chip 80 that may correspond to a decoder (i.e., video decoding system 120) in the description, and the chip 80 may implement the corresponding processes implemented by the decoder in the various methods of the embodiments of the disclosure. The chip 80 includes a processor 81, and the processor 81 may call and run a computer program from the memory 82 to implement the methods in the embodiments of the present application.
[0570] Optionally, the chip 80 may further include a memory 82. In particular, the processor 81 may call and run the computer program from the memory 82 to implement the methods in the embodiments of the present application.
[0571] Wherein the memory 82 may be a separate device from the processor 81 or may be integrated into the processor 81.
[0572] Optionally, the chip 80 may also include an input interface 83. In particular, the processor 81 may control the input interface 83 to communicate with other devices or chips, specifically, to obtain messages or data sent by other devices or chips.
[0573] Optionally, the chip may further include an output interface 84. In particular, the processor 81 may control the output interface 84 to communicate with other devices or chips, specifically, to output messages or data to other devices or chips.
[0574] The disclosed method may be programmed as computer executable instructions stored in non-transitory computer readable medium. The non-transitory computer readable medium, when loaded to a computer, directs a processor of the computer to execute the disclosed method.
[0575] The non-transitory computer readable medium may comprise at least one from a group consisting of: ahard disk, a CD-ROM, an optical storage device, a magnetic storage device, a Read Only Memory, a Programmable Read Only Memory, an Erasable Programmable Read Only Memory, EPROM, an Electrically Erasable Programmable Read Only Memory and a Flash memory.
[0576] The disclosed method may be programmed as a computer program product that causes a computer to execute the disclosed method.
[0577] The disclosed method may be programmed as a computer program that causes a computer to execute the disclosed method.
[0578] By using a template cost derived from the actual content within the block, the blending width can be more finely tuned to the specific needs of that region, potentially leading to improved prediction accuracy and image quality.
[0579] While the present disclosure has been described in connection with what is considered the most practical and preferred embodiments, it is understood that the present disclosure is not limited to the disclosed embodiments but is intended to cover various arrangements made without departing from the scope of the broadest interpretation of the appended claims.
Claims
1.An encoding method, comprising:providing input video frames;determining a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes;determining a plurality of blending width candidates;for each mode candidate of the plurality of mode candidates:applying the plurality of blending width candidates to a current block or a template of the current block in the input video frames to acquire a plurality of prediction results; andderiving an optimal blending width from the blending width candidates based on the plurality of prediction results of the current block or the template; andgenerating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width.2.The method of claim 1, further comprising:generating a bitstream, wherein the bitstream comprises an indication for the optimal blending width for each of the plurality of mode candidates.3.The method of claim 1, further comprising:determining whether to apply template-derived blending width (TDBW) for the current block based on a lookup table (LUT) , wherein the LUT establishes a correspondence between:a block size of the current block;a partition mode of the current block; andand the application of TDBW.4.The method of claim 3, wherein if the LUT indicates TDBW is applicable for the current block based on the block size and partition mode, the method further comprises:deriving a template size for TDBW based on the same LUT; andapplying TDBW to the current block using the derived template size.5.The method of claim 1, wherein the deriving the optimal blending width from the blending width candidates comprises:applying the plurality of blending width candidates to a template;calculating a cost as a template cost for each of the applied blending width candidates, wherein the cost is a difference metric between prediction values of the template and reconstructed samples of the template; andselecting a blending width candidate that minimizes the calculated cost as the optimal blending width.6.The method of claim 5, wherein the difference metric is at least one of a sum of absolute transformed differences (SATD) , sum of squared differences (SSE) , sum of absolute difference (SAD) , or mean squared error (MSE) .7.The method of claim 5, wherein the prediction values for each blending width candidate are obtained by applying the mode candidate of a geometric partitioning mode (GPM) / spatial geometric partitioning mode (SGPM) mode in the template and blending resultant partitions of the template according to the blending width candidate.8.The method of claim 5, wherein selecting the blending width candidate comprises selecting from a pre-defined set of blending width indices.9.The method of claim 5, wherein selecting the blending width candidate comprises selecting from a pre-defined subset of blending width candidates available for the current block, wherein the subset is determined based on one or more of a prediction mode, partition mode, and a block size.10.The method of claim 5, further comprising:performing a candidate list expansion process on a first candidate list of the plurality of mode candidates to determine a second candidate list along with the respective optimal blending width candidate.11.The method of claim 10, wherein the candidate list expansion process comprises for each candidate in the first candidate list of the partition mode:adding the candidate to the first candidate list to form a derived candidate list if the optimal blending width differs from a blending width associated with the candidate, wherein candidates added to the derived candidate list are ordered based on ascending template cost.12.The method of claim 11, wherein the second candidate list is generated by inserting a predetermined number N of derived candidates with the lowest template costs into the first candidate list.13.The method of claim 11, wherein the second candidate list comprises derived candidate list reordered based on updated template costs of the derived candidate list.14.The method of claim 5, further comprising:determining whether a reference area selection for template-based prediction (RAST) is available for the current block based on at least one of:a prediction mode used for the current block;a block size of the current block;a control flag in a block, slice, picture, or group of picture level; ora template cost associated with the current block;wherein the current block and the template share common reference samples.15.The method of claim 14, further comprising:enabling a reference area selection for template-based prediction (RAST) for the current block based on at least one of:always being enabled when the RAST is available;an explicit indication flag;dependency on legacy template-based derivation signals;a decoder-derived decision based on the template cost; ora control flag in a block, slice, picture, or group of picture level.selecting reference samples for predicting a template area, wherein the reference samples include one or several lines of pixels adjacent to the current block;wherein the current block and the template share common reference samples.16.The method of any of claim 15, further comprising:extending the reference samples by adding one or more columns or rows of pixels to adjust the size of the reference area.17.The method of claim 16, wherein extending the reference samples comprises adding pixels obtained by at least one of:reconstruction;interpolation using closest available reference samples;extrapolation using closest available reference samples; orcalculating average sample values of a reference line or an average pixel values in an image of the bitstream.18.The method of claim 16, further comprising:defining the template area for RAST based on at least one of:one or several lines of pixels located above or / and left to the lines of reference samples;the reference samples; orthe extended reference samples.19.The method of claim 16, further comprising:generating prediction samples for the template area using an intra prediction mode with the selected reference samples;wherein in generating the prediction samples for the template area,an intra prediction angle used in the current block and an intra prediction angle used in the template area target to the reference samples, if the intra prediction mode is an intra angular mode and the reference samples are located between the current block and the template area.20.An encoding method, comprising:providing input video frames;performing image or video coding that uses template-based derivation for a current block in the input video frames; anddetermining whether a reference area selection for template-based prediction (RAST) is available for a current block based on at least one of:a prediction mode used for the current block;a block size of the current block;a control flag in a block, slice, picture, or group of picture level; ora template cost associated with the current block;wherein the current block and the template share common reference samples.21.A chip, comprising:a processor, configured to call and run a computer program stored in a memory, to cause a device in which the chip is installed to execute the method of any of claims 1 to 20.22.A computer-readable storage medium, in which a computer program is stored, wherein the computer program causes a computer to execute the method of any of claims 1 to 20.23.A computer program product, comprising a computer program, wherein the computer program causes a computer to execute the method of any of claims 1 to 20.24.A computer program, wherein the computer program causes a computer to execute the method of any of claims 1 to 20.25.An encoding device comprising:a processor configured to execute the method of any of claims 1 to 20.26.A decoding method, comprising:obtaining a bitstream, wherein the bitstream comprises information for a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes;determining a plurality of blending width candidates;for a current mode candidate among the plurality of mode candidates:applying the plurality of blending width candidates to a template of a current block in the bitstream to acquire a plurality of prediction results; andderiving an optimal blending width from the blending width candidates based on the plurality of prediction results; andgenerating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width.27.The method of claim 26, wherein the current mode candidate comprises each of the plurality of mode candidates, and the applying and deriving are performed for each of the plurality of mode candidates; orthe current mode candidate comprises a specific mode candidate indicated by a mode indication among the plurality of mode candidates, and the applying and deriving are performed for the specific mode candidate.28.The method of claim 26, further comprising:determining whether to apply template-derived blending width (TDBW) for the current block based on a lookup table (LUT) , wherein the LUT establishes a correspondence between:a block size of the current block;a partition mode of the current block; andand the application of TDBW.29.The method of claim 28, wherein if the LUT indicates TDBW is applicable for the current block based on the block size and partition mode, the method further comprises:deriving a template size for TDBW based on the same LUT; andapplying TDBW to the current block using the derived template size.30.The method of claim 26, wherein the deriving the optimal blending width from the blending width candidates comprises:applying the plurality of blending width candidates to a template;calculating a cost as a template cost for each of the applied blending width candidates, wherein the cost is a difference metric between prediction values of the template and reconstructed samples of the template; andselecting a blending width candidate that minimizes the calculated cost as the optimal blending width.31.The method of claim 30, wherein the difference metric is at least one of a sum of absolute transformed differences (SATD) , sum of squared differences (SSE) , sum of absolute difference (SAD) , or mean squared error (MSE) .32.The method of claim 30, wherein the prediction values for each blending width candidate are obtained by applying the mode candidate of a geometric partitioning mode (GPM) / spatial geometric partitioning mode (SGPM) mode in the template and blending resultant partitions of the template according to the blending width candidate.33.The method of claim 30, wherein selecting the blending width candidate comprises selecting from a pre-defined set of blending width indices.34.The method of claim 30, wherein selecting the blending width candidate comprises selecting from a pre-defined subset of blending width candidates available for the current block, wherein the subset is determined based on one or more of a prediction mode, partition mode, and a block size.35.The method of claim 30, further comprising:performing a candidate list expansion process on a first candidate list of the plurality of mode candidates to determine a second candidate list along with the respective optimal blending width.36.The method of claim 35, wherein the candidate list expansion process comprises for each candidate in the first candidate list of the partition mode:adding the candidate to the first candidate list to form a derived candidate list if the optimal blending width differs from a blending width associated with the candidate, wherein candidates added to the derived candidate list are ordered based on ascending template cost.37.The method of claim 36, wherein the second candidate list is generated by inserting a predetermined number N of derived candidates with the lowest template costs into the first candidate list.38.The method of claim 36, wherein the second candidate list comprises derived candidate list reordered based on updated template costs of the derived candidate list.39.The method of claim 30, further comprising:determining whether a reference area selection for template-based prediction (RAST) is available for the current block based on at least one of:a prediction mode used for the current block;a block size of the current block;a control flag in a block, slice, picture, or group of picture level; ora template cost associated with the current block;wherein the current block and the template share common reference samples.40.The method of claim 39, further comprising:enabling a reference area selection for template-based prediction (RAST) for the current block based on at least one of:always being enabled when the RAST is available;an explicit indication flag;dependency on legacy template-based derivation signals;a decoder-derived decision based on the template cost; ora control flag in a block, slice, picture, or group of picture level.selecting reference samples for predicting a template area, wherein the reference samples include one or several lines of pixels adjacent to the current block;wherein the current block and the template share common reference samples.41.The method of any of claim 40, further comprising:extending the reference samples by adding one or more columns or rows of pixels to adjust the size of the reference area.42.The method of claim 41, wherein extending the reference samples comprises adding pixels obtained by at least one of:reconstruction;interpolation using closest available reference samples;extrapolation using closest available reference samples; orcalculating average sample values of a reference line or an average pixel values in an image of the bitstream.43.The method of claim 41, further comprising:defining the template area for RAST based on at least one of:one or several lines of pixels located above or / and left to the lines of reference samples;the reference samples; orthe extended reference samples.44.The method of claim 41, further comprising:generating prediction samples for the template area using an intra prediction mode with the selected reference samples;wherein in generating the prediction samples for the template area,an intra prediction angle used in the current block and an intra prediction angle used in the template area target to the reference samples, if the intra prediction mode is an intra angular mode and the reference samples are located between the current block and the template area.45.A decoding method, comprising:obtaining a bitstream, wherein the bitstream comprises information for a plurality of mode candidates, wherein each of the mode candidates comprises a geometric partition mode and two different prediction modes, and the bitstream comprises an indication for an optimal blending width for each of the plurality of mode candidates; andgenerating a prediction of the current block based on one mode selected from the plurality of mode candidates and the respective optimal blending width;wherein the optimal blending width is selected, at a decoder side, from a plurality of blending width candidates for the plurality of mode candidates based on their corresponding prediction results.46.A decoding method, comprising:providing input video frames;performing image or video coding that uses template-based derivation for a current block in the input video frames; anddetermining whether a reference area selection for template-based prediction (RAST) is available for a current block based on at least one of:a prediction mode used for the current block;a block size of the current block;a control flag in a block, slice, picture, or group of picture level; ora template cost associated with the current block;wherein the current block and the template share common reference samples.47.A chip, comprising:a processor, configured to call and run a computer program stored in a memory, to cause a device in which the chip is installed to execute the method of any of claims 26 to 46.48.A computer-readable storage medium, in which a computer program is stored, wherein the computer program causes a computer to execute the method of any of claims 26 to 46.49.A computer program product, comprising a computer program, wherein the computer program causes a computer to execute the method of any of claims 26 to 46.50.A computer program, wherein the computer program causes a computer to execute the method of any of claims 26 to 46.51.A decoding device comprising:a processor configured to execute the method of any of claims 26 to 46.
Citation Information
Patent Citations
Device and method for decoding video data
US20230412801A1
Efficient geometric partitioning mode video coding
WO2023208131A1
Method, apparatus, and medium for video processing
WO2023246893A1