Prediction method and apparatus, codec, and medium
By adjusting the filter coefficients of inter-frame convolution cross-component prediction and utilizing prediction samples outside the residual sub-block region, the fitting relationship between luminance and chrominance components is optimized, solving the problem of insufficient prediction accuracy in existing technologies and improving video encoding and decoding efficiency.
Patent Information
- Application Number
- PCT/CN2025/096875
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2026-11-26
AI Technical Summary
In existing video encoding and decoding technologies, the inter-frame convolutional cross-component prediction mode, under sub-block transformation conditions, cannot effectively fit the relationship between luminance and chrominance components, affecting prediction accuracy and encoding/decoding efficiency.
By adjusting the derived filter coefficients and using the predicted samples located outside the residual sub-block region in the first prediction block of the current block as reference samples, the filter coefficients of the convolution cross-component filter are determined, and the fitting relationship between the first and second color components is optimized.
It improves the accuracy of cross-component prediction and encoding/decoding performance, and optimizes video encoding/decoding efficiency.
Smart Images

Figure CN2025096875_26112026_PF_FP_ABST
Abstract
Description
Prediction methods, devices, codecs and media Technical Field
[0001] This application relates to the field of video encoding and decoding technology, and in particular to a prediction method, apparatus, codec, and medium. Background Technology
[0002] In video encoding and decoding, during the encoding and decoding of the current block, intra-frame prediction and inter-frame prediction methods can be used. Intra-frame prediction utilizes the spatial correlation within the current frame to reduce redundancy; inter-frame prediction utilizes the temporal correlation between the reference frame and the current frame to compress the video and reduce the amount of data.
[0003] In related technologies, the inter-frame prediction process can include motion estimation (ME) and motion compensation (MC). Motion estimation refers to finding the best matching block in the reference frame for each block in the current frame and generating the corresponding motion vector (MV). Motion compensation refers to obtaining the prediction block from the reference frame based on the motion vector, which is then used to predict the current block. Summary of the Invention
[0004] This application provides a prediction method, apparatus, codec, and medium. The technical solution is as follows:
[0005] On one hand, embodiments of this application provide a prediction method applied to a decoder, the method comprising:
[0006] Based on reference samples, the filter coefficients of the convolutional cross-component filter are determined, wherein the reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block.
[0007] Based on the filter coefficients and the reconstructed value of the first color component of the current block, a second predicted value of the second color component of the current block is determined.
[0008] On the other hand, embodiments of this application provide a prediction method applied to an encoder, the method comprising:
[0009] Based on reference samples, the filter coefficients of the convolutional cross-component filter are determined, wherein the reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block.
[0010] Based on the filter coefficients and the reconstructed value of the first color component of the current block, a second predicted value of the second color component of the current block is determined.
[0011] On the other hand, embodiments of this application provide a prediction device, the device comprising:
[0012] A decoding unit is used to determine the filter coefficients of a convolutional cross-component filter based on reference samples, said reference samples including at least one prediction sample in the first prediction block of at least one color component of the current block located outside the residual sub-block region;
[0013] The decoding unit is further configured to determine a second predicted value of the second color component of the current block based on the filter coefficients and the reconstructed value of the first color component of the current block.
[0014] On the other hand, embodiments of this application provide a prediction device, the device comprising:
[0015] The encoding unit is used to determine the filter coefficients of the convolutional cross-component filter based on reference samples, said reference samples including at least one prediction sample in the first prediction block of at least one color component of the current block located outside the residual sub-block region;
[0016] The encoding unit is further configured to determine a second predicted value of the second color component of the current block based on the filter coefficients and the reconstructed value of the first color component of the current block.
[0017] On the other hand, embodiments of this application provide a decoder, the decoder including a memory and a processor, the memory for storing a computer program running on the processor; the processor for executing the prediction method as described above when running the computer program.
[0018] On the other hand, embodiments of this application provide an encoder, the encoder including a memory and a processor, the memory for storing a computer program running on the processor; the processor for executing the prediction method as described above when running the computer program.
[0019] On the other hand, embodiments of this application provide a non-volatile computer-readable storage medium for storing a bitstream, the bitstream being generated by using a prediction method of an encoder, or the bitstream being decoded by using a prediction method of a decoder, wherein the prediction method includes the prediction method described above.
[0020] On the other hand, embodiments of this application provide a computer program product including computer instructions stored in a computer-readable storage medium, wherein a processor retrieves the computer instructions from the computer-readable storage medium and executes the computer instructions to implement the prediction method as described above.
[0021] In this embodiment, by adjusting the reference samples used to derive the filter coefficients, and using the reference samples of the prediction samples located outside the residual sub-block region in the first prediction block that includes at least one color component of the current block, the filter coefficients of the convolutional cross-component filter are determined. Based on the filter coefficients and the reconstructed value of the first color component, the second prediction value of the second color component is determined. This can optimize the fitting relationship between the first color component and the second color component, improve the accuracy of cross-component prediction, and thus improve the encoding and decoding performance. Attached Figure Description
[0022] Figure 1 is a schematic diagram illustrating the encoding process at the encoding end in an exemplary embodiment of this application;
[0023] Figure 2 is a schematic diagram illustrating the decoding process at the decoding end in an exemplary embodiment of this application;
[0024] Figure 3 is a flowchart illustrating a prediction method in an exemplary embodiment of this application;
[0025] Figure 4 is a schematic diagram of sub-block division corresponding to different sub-block transformation modes, as shown in an exemplary embodiment of this application.
[0026] Figure 5 is a schematic diagram of determining the location of the residual sub-block region according to an exemplary embodiment of this application;
[0027] Figure 6 is a schematic diagram of sub-block division corresponding to different sub-block transformation modes, as shown in another exemplary embodiment of this application;
[0028] Figure 7 is a schematic diagram illustrating the determination of the location of the residual sub-block region according to another exemplary embodiment of this application;
[0029] Figure 8 is a schematic diagram of sub-block division shown in an exemplary embodiment of this application;
[0030] Figure 9 is a schematic diagram showing the correspondence between a chromaticity reference sample and a luminance reference sample provided in an exemplary embodiment of this application;
[0031] Figure 10 is a schematic diagram of the convolutional cross-component prediction process provided in an exemplary embodiment of this application;
[0032] Figure 11 is a flowchart illustrating a prediction method in another exemplary embodiment of this application;
[0033] Figure 12 shows a structural block diagram of a prediction device provided in an exemplary embodiment of this application;
[0034] Figure 13 shows a structural block diagram of a prediction device provided in another exemplary embodiment of this application;
[0035] Figure 14 shows a structural block diagram of a decoder provided in an exemplary embodiment of this application;
[0036] Figure 15 shows a structural block diagram of an encoder provided in an exemplary embodiment of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0038] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0039] Currently, most common video codec standards employ a block-based hybrid coding framework. Images in a video are divided into squares of equal size (e.g., 256×256, 128×128, 64×64) called Largest Coding Units (LCUs) or Coding Tree Units (CTUs). These LCUs or CTUs can be further subdivided into rectangular Coding Units (CUs) according to rules. Coding units may also be further divided into Prediction Units (PUs), Transform Units (TUs), etc.
[0040] The hybrid coding framework includes modules such as prediction, transformation, quantization, entropy coding, and in-loop filtering. The prediction module includes intra-prediction and inter-prediction. Inter-prediction includes motion estimation and motion compensation. Because there is a strong correlation between adjacent samples in the same image, intra-prediction can be used in video coding and decoding techniques to eliminate spatial redundancy between adjacent samples. Because there is a strong similarity between adjacent images in a video, inter-prediction can be used in video coding and decoding techniques to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.
[0041] At the encoding end, as shown in Figure 1, the encoder first divides the image into multiple coding blocks. Then, it uses intra-frame or inter-frame prediction (including motion estimation and motion compensation) algorithms to generate a prediction block for the current block. The encoder then subtracts the prediction block from the original block to obtain a residual block. This residual block is then transformed and quantized to obtain quantization coefficients. Finally, entropy coding is used to encode these quantization coefficients into the bitstream. Furthermore, the encoder reconstructs the image based on the inverse quantization / inverse transform results and the prediction block to obtain a reconstructed block. Loop filtering is then applied to the reconstructed block to compensate for distortion information and provide a better reference for subsequent encoding.
[0042] At the decoding end, as shown in Figure 2, the decoder uses intra-frame or inter-frame prediction algorithms to predict the prediction block for the current block. Simultaneously, it parses the bitstream, obtains quantization coefficients through entropy decoding, and performs inverse quantization and inverse transform on these coefficients to obtain the residual block. The prediction block and the residual block are then added together to obtain the reconstructed block. For the reconstructed block, the decoder further performs loop filtering, and finally generates the decoded image based on the loop-filtered reconstructed block.
[0043] In related technologies, to improve video encoding and decoding efficiency, the Inter Convolutional Cross-Component Model (Inter CCCM) is used during the prediction of the current block to leverage the correlation between the luminance and chrominance components, thereby improving prediction accuracy and video compression efficiency. However, when performing Inter Convolutional Cross-Component Prediction on the current block and applying sub-block transformation, the filter coefficients of the convolutional cross-component filter are derived using prediction samples located in the residual sub-block region of the first prediction block of the current block. This results in the convolutional cross-component filter being unable to accurately fit the relationship between the luminance and chrominance components, thus affecting the accuracy of the convolutional cross-component prediction.
[0044] In this embodiment, by adjusting the reference samples used to derive the filter coefficients, and using the reference samples of the prediction samples located outside the residual sub-block region in the first prediction block that includes at least one color component of the current block, the filter coefficients of the convolutional cross-component filter are determined. Based on the filter coefficients and the reconstructed value of the first color component, the second prediction value of the second color component is determined. This can optimize the fitting relationship between the first color component and the second color component, improve the accuracy of cross-component prediction, and thus improve the encoding and decoding performance.
[0045] Please refer to Figure 3, which illustrates a flowchart of a prediction method provided in an exemplary embodiment of this application. The method is applied to a decoder and may include the following steps:
[0046] Step 301: Based on the reference samples, determine the filter coefficients of the convolutional cross-component filter. The reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block.
[0047] In a block-based hybrid coding framework, images in a video are divided into multiple control blocks (CUs). The current block refers to the block that the decoder is currently processing, i.e., the CU.
[0048] During the decoding process, the decoder uses intra-frame or inter-frame prediction algorithms to predict the prediction block of the current block. On the other hand, it parses the bitstream, obtains the quantization coefficients through entropy decoding, and performs inverse quantization and inverse transformation on the quantization coefficients to obtain the residual block. The prediction block and the residual block are then added together to obtain the reconstructed block.
[0049] In this embodiment of the application, in order to improve the efficiency of video encoding and decoding, the predicted block obtained by using intra-frame or inter-frame prediction algorithm is used as the first predicted block of the current block. Based on this, considering the correlation between the first color component and the second color component, convolutional cross-component prediction is performed on the current block to obtain the second predicted value of the second color component of the current block.
[0050] In this process, the first color component can be the luminance component, and the second color component can be the chrominance component. That is, in the convolutional cross-component prediction process, the correlation between the luminance component and the chrominance component is considered, and the second predicted value of the chrominance component is determined by combining the reconstructed value of the luminance component, so as to improve the prediction accuracy of the luminance component.
[0051] Optionally, the first prediction block is obtained by predicting the current block using either inter-frame prediction mode or intra-frame block copy mode. Optionally, the first prediction block can also be referred to as the original prediction block.
[0052] During the decoding process, the decoder can obtain the first predicted block of the current block by using the inter-frame prediction mode or by using the intra-block copy (IBC) mode.
[0053] In one possible implementation, the decoder performs inter-frame prediction on the current block to obtain the motion vector (MV) corresponding to the current block, and then determines the first predicted block of the current block based on the motion vector. In another possible implementation, the decoder performs intra-frame block copying on the current block to obtain the block vector (BV) corresponding to the current block, and then determines the first predicted block of the current block based on the block vector.
[0054] Optionally, when using Sub-Block Transform (SBT) mode on the current block, the current block can be divided into two regions. One region contains residual information and can be called a residual sub-block, while the other region does not contain residual information and can be called a non-residual sub-block. Based on this, in the first prediction block of the current block, the prediction accuracy of the predicted samples located within the residual sub-block region is obviously lower than the prediction accuracy of the predicted samples located outside the residual sub-block region. Therefore, in some embodiments, to better fit the relationship between the first color component and the second color component, the decoder can determine a reference sample based on the predicted samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block. This reference sample is then used to determine the filter coefficients of the convolutional cross-component filter.
[0055] The reference sample must include at least the predicted samples located outside the residual sub-block region of the first prediction block. Optionally, the reference sample may include a portion of the predicted samples located outside the residual sub-block region of the first prediction block, or it may include all the predicted samples located outside the residual sub-block region of the first prediction block. Optionally, in addition to including the predicted samples located outside the residual sub-block region of the first prediction block, the reference sample may also include the predicted samples located within the residual sub-block region of the first prediction block.
[0056] In some embodiments, after determining the reference sample, the decoder can derive the filter coefficients of the convolutional cross-component filter based on the reference sample, thereby using the convolutional cross-component filter to perform inter-frame convolutional cross-component prediction for the current block, so as to improve the prediction accuracy for the current block.
[0057] Step 302: Based on the filter coefficients and the reconstructed value of the first color component of the current block, determine the second predicted value of the second color component of the current block.
[0058] In some embodiments, after determining the filter coefficients of the convolutional cross-component filter, the decoder can apply the convolutional cross-component filter, using the reconstructed value of the first color component of the current block as the input of the convolutional cross-component filter, thereby filtering the reconstructed value of the first color component through the convolutional cross-component filter and outputting the second predicted value of the second color component of the current block.
[0059] Optionally, the reconstructed value of the first color component is obtained based on the predicted samples located in the residual sub-block region of the first prediction block of the first color component and the residual value of the first color component. That is, convolutional cross-component prediction is a process of processing the predicted samples located in the residual sub-block region of the first prediction block.
[0060] Here, the second predicted value of the second color component refers to the second predicted value of the predicted sample located in the residual sub-block region within the first predicted block of the second color component. Optionally, the second color component is a chromaticity component, and the convolutional cross-component filter can output the second predicted values of the chromaticity Cb component and the second predicted values of the chromaticity Cr component, respectively.
[0061] In summary, in the embodiments of this application, by adjusting the reference samples used to derive the filter coefficients, and utilizing the reference samples of the prediction samples located outside the residual sub-block region in the first prediction block that includes at least one color component of the current block, the filter coefficients of the convolutional cross-component filter are determined. Thus, based on the filter coefficients and the reconstructed value of the first color component, the second predicted value of the second color component is determined. This optimizes the fitting relationship between the first and second color components, improves the accuracy of cross-component prediction, and thereby improves encoding and decoding performance.
[0062] During the decoding process, it is necessary to determine whether to perform convolutional cross-component prediction on the current block and to explain the sub-block transformation.
[0063] Due to considerations of encoding / decoding costs and quality, convolutional cross-component prediction and sub-block transformation are not required for the current block in all scenarios. In other words, the process of determining the filter coefficients of the convolutional cross-component filter based on reference samples proposed in this application is not applicable in all scenarios. Therefore, before the decoder determines the filter coefficients of the convolutional cross-component filter based on reference samples, it first needs to determine whether convolutional cross-component prediction and sub-block transformation are enabled for the current block.
[0064] In some embodiments, the decoder parses the bitstream, determines a first syntax element and a second syntax element, and determines the filter coefficients of the convolutional cross-component filter based on reference samples, provided that the value of the first syntax element indicates that the current block convolutional cross-component prediction is enabled and the value of the second syntax element indicates that the current block sub-block transformation is enabled.
[0065] The first syntax element indicates whether convolutional cross-component prediction is enabled for the current block, and the second syntax element indicates whether sub-block transformation is enabled for the current block. Both the first and second syntax elements are encoded into the bitstream by the encoder. Optionally, the first syntax element is `interCccm_flag`, and the second syntax element is `sbt_flag`.
[0066] Optionally, when the value of the first syntax element is true (or 1) and the value of the second syntax element is true (or 1), the decoder can determine to perform convolutional cross-component prediction and sub-block transformation on the current block, thus allowing the decoder to determine the filter coefficients of the convolutional cross-component filter based on the reference samples. When the value of the first syntax element is false (or 0) and / or the value of the second syntax element is false (or 0), the decoder determines to disable convolutional cross-component prediction and / or disable sub-block transformation on the current block, thus allowing the decoder to determine the filter coefficients of the convolutional cross-component filter without relying on the reference samples.
[0067] In some embodiments, different blocks in the same image may correspond to their respective first syntax elements, or different blocks within the same slice in the same image may correspond to a unified first syntax element, or different blocks in the same image may correspond to a unified first syntax element, or different blocks in different images within the same Group of Pictures (GOP) may correspond to a unified first syntax element.
[0068] In some embodiments, different blocks in the same image may correspond to their respective second syntax elements, or different blocks within the same slice in the same image may correspond to a unified second syntax element, or different blocks in the same image may correspond to a unified second syntax element, or different blocks in different images in the same image group may correspond to a unified second syntax element.
[0069] Optionally, the correspondence between different blocks and the first syntax element, and the correspondence between different blocks and the second syntax element, can be the same or different. For example, different blocks in the same image correspond to their respective first syntax elements, and different blocks in the same image correspond to their respective second syntax elements. Another example is that different blocks in the same image correspond to their respective first syntax elements, and different blocks in the same image correspond to a unified second syntax element. Yet another example is that different blocks within the same slice of the same image correspond to a unified first syntax element, and different blocks in the same image correspond to a unified second syntax element.
[0070] The description of the reference sample is determined based on the value of the third syntax element.
[0071] In some embodiments, when residuals exist in the current block, sub-block transformations can be performed on the current block. This allows the encoder to transform only the regions with larger residuals in the current block, setting the residuals in other regions to zero. This reduces the number of transformation coefficients required for encoding and improves coding efficiency. In other words, when residuals exist in the current block and sub-block transformations are enabled, the encoder only needs to encode the residuals in a portion of the current block and perform transform quantization.
[0072] Optionally, considering that blocks in different images may have different residual distribution characteristics, or different blocks in the same image may have different residual distribution characteristics, multiple sub-block transformation modes can be set to more flexibly transform different blocks. This allows the encoder to select an appropriate sub-block transformation mode for the current block based on its residual distribution characteristics.
[0073] Optionally, when sub-block transformation is enabled for the current block, in order to facilitate the decoder in determining the applicable sub-block transformation mode for the current block, the encoder can also encode the value of the third syntax element into the bitstream, using the value of the third syntax element to indicate the sub-block transformation mode of the current block. The value of the third syntax element differs for different sub-block transformation modes.
[0074] Optionally, different blocks in the same image may correspond to their own third syntax elements, or different blocks in the same slice of the same image may correspond to a unified third syntax element, or different blocks in the same image may correspond to a unified third syntax element, or different blocks in different images of the same image group may correspond to a unified third syntax element.
[0075] In some embodiments, the decoder parses the bitstream, determines a second syntax element, and further determines a third syntax element if the value of the second syntax element indicates that the sub-block transformation of the current block is enabled. The value of the third syntax element is used to indicate the sub-block transformation mode of the current block, so that the decoder determines the reference sample in the first prediction block of the current block based on the value of the third syntax element.
[0076] Optionally, the location of the residual sub-block region differs under different sub-block transformation modes. Based on this, the decoder can first determine the location of the residual sub-block region in the first prediction block based on the value of the third syntax element, and then determine the reference sample in the first prediction block based on the location of the residual sub-block region. Optionally, the location of the residual sub-block region can be indicated by a two-dimensional array and its index.
[0077] Optionally, based on the different partitioning methods corresponding to the residual sub-block regions, sub-block transformations can be divided into two categories. The first type of sub-block transformation corresponds to eight sub-block transformation modes, and under these modes, the height of the residual sub-block is the same as the height of the current block, or the width of the residual sub-block is the same as the width of the current block. The second type of sub-block transformation also corresponds to eight sub-block transformation modes, and under these modes, the height and width of the residual sub-block are the same.
[0078] For the first type of sub-block transformation, there can be two partition ratios, two partition directions, and two partition positions. By combining these pairs, eight sub-block transformation modes can be obtained. Among them, the partition ratio of the residual sub-block refers to the height partition ratio or the width partition ratio, which can be 1 / 2 or 1 / 4; the partition direction can be horizontal or vertical; and the partition position refers to the relative position of the residual sub-block region in the current block, which can be left (top) or right (bottom).
[0079] Optionally, the third syntax element representing the partition ratio can be cu_sbt_quad_flag. When the value of cu_sbt_quad_flag is true (or 1), it represents that the height partition ratio or width partition ratio of the residual sub-block is 1 / 4, that is, the width or height of the residual sub-block is 1 / 4 of the current block. For example, the width of the residual sub-block is 1 / 4, and the height remains unchanged. When the value of cu_sbt_quad_flag is false (or 0), it represents that the height partition ratio or width partition ratio of the residual sub-block is 1 / 2, that is, the width or height of the residual sub-block is 1 / 2 of the current block. For example, the height of the residual sub-block is 1 / 4, and the width remains unchanged.
[0080] Optionally, the third syntax element representing the partitioning direction can be cu_sbt_horizontal_flag. When the value of cu_sbt_horizontal_flag is true (or 1), it indicates that the partitioning direction of the residual sub-block is horizontal, that is, the residual sub-block is obtained by horizontally partitioning the current block; when the value of cu_sbt_horizontal_flag is false (or 0), it indicates that the partitioning direction of the residual sub-block is vertical, that is, the residual sub-block is obtained by vertically partitioning the current block.
[0081] Optionally, the third syntax element representing the partition position can be cu_sbt_pos_flag. When the value of cu_sbt_pos_flag is true (or 1), it indicates that the partition position of the residual sub-block is later, located on the right side when partitioning vertically, and on the bottom side when partitioning horizontally. When the value of cu_sbt_pos_flag is false (or 0), it indicates that the partition position of the residual sub-block is earlier, located on the left side when partitioning vertically, and on the top side when partitioning horizontally.
[0082] As illustrated in FIG4, it shows a schematic diagram of sub-block partitioning corresponding to different sub-block transformation modes provided in an exemplary embodiment of this application.
[0083] For residual sub-block region 401, the values of its corresponding third syntax elements cu_sbt_quad_flag, cu_sbt_horizontal_flag, and cu_sbt_pos_flag are all 0. This means that residual sub-block region 401 is vertically divided, located to the left of the current block, with a width division ratio of 1 / 2. The width w1 of residual sub-block region 401 is equal to 1 / 2w, while the height remains unchanged. For residual sub-block region 405, the values of its corresponding third syntax elements cu_sbt_quad_flag are all 1, cu_sbt_horizontal_flag, and cu_sbt_pos_flag are all 0. This means that residual sub-block region 405 is vertically divided, located to the left of the current block, with a width division ratio of 1 / 4. The width w1 of residual sub-block region 405 is equal to 1 / 4w, while the height remains unchanged.
[0084] The two sub-block transformation modes described above can be represented as (SBT-V, Position 0). When using this sub-block transformation mode, for the luminance component in the residual sub-block, a DCT-8 (Discrete Cosine Transform) kernel can be used for transformation in the horizontal direction, and a DST-7 (Discrete Sine Transform) kernel can be used for transformation in the vertical direction; for the chrominance component in the residual sub-block, a DCT-2 kernel is used for transformation.
[0085] For residual sub-block region 402, the values of its corresponding third syntax elements cu_sbt_quad_flag are 0, cu_sbt_horizontal_flag is 0, and cu_sbt_pos_flag is 1. This means that residual sub-block region 402 is vertically divided, located to the right of the current block, with a width division ratio of 1 / 2. The width w1 of residual sub-block region 402 is equal to 1 / 2w, while the height remains unchanged. For residual sub-block region 406, the values of its corresponding third syntax elements cu_sbt_quad_flag are 1, cu_sbt_horizontal_flag is 0, and cu_sbt_pos_flag is 1. This means that residual sub-block region 406 is vertically divided, located to the right of the current block, with a width division ratio of 1 / 4. The width w1 of residual sub-block region 406 is equal to 1 / 4w, while the height remains unchanged.
[0086] The two sub-block transformation modes described above can be represented as (SBT-V, Position1). When using this sub-block transformation mode, the luminance component in the residual sub-block can be transformed using the DST-7 transform kernel in both the horizontal and vertical directions; the chrominance component in the residual sub-block is transformed using the DCT-2 transform kernel.
[0087] For residual sub-block region 403, the values of its corresponding third syntax elements cu_sbt_quad_flag are 0, cu_sbt_horizontal_flag is 1, and cu_sbt_pos_flag is 0. This means residual sub-block region 403 is horizontally partitioned, located above the current block, with a height partition ratio of 1 / 2. The height h1 of residual sub-block region 403 is equal to 1 / 2h, while the width remains unchanged. For residual sub-block region 407, the values of its corresponding third syntax elements cu_sbt_quad_flag are 1, cu_sbt_horizontal_flag is 1, and cu_sbt_pos_flag is 0. This means residual sub-block region 407 is horizontally partitioned, located above the current block, with a height partition ratio of 1 / 4. The height h1 of residual sub-block region 407 is equal to 1 / 4h, while the width remains unchanged.
[0088] The two sub-block transformation modes described above can be represented as (SBT-H, Position0). When using this sub-block transformation mode, for the luminance component in the residual sub-block, the DST-7 transform kernel can be used for transformation in the horizontal direction, and the DCT-8 transform kernel can be used for transformation in the vertical direction; for the chrominance component in the residual sub-block, the DCT-2 transform kernel is used for transformation.
[0089] For residual sub-block region 404, the values of its corresponding third syntax elements cu_sbt_quad_flag are 0, cu_sbt_horizontal_flag is 1, and cu_sbt_pos_flag is 1. This means that residual sub-block region 404 is horizontally divided, located below the current block, with a height division ratio of 1 / 2. The height h1 of residual sub-block region 404 is equal to 1 / 2h, while the width remains unchanged. For residual sub-block region 408, the values of its corresponding third syntax elements cu_sbt_quad_flag are 1, cu_sbt_horizontal_flag is 1, and cu_sbt_pos_flag is 1. This means that residual sub-block region 408 is horizontally divided, located below the current block, with a height division ratio of 1 / 4. The height h1 of residual sub-block region 408 is equal to 1 / 4h, while the width remains unchanged.
[0090] The two sub-block transformation modes described above can be represented as (SBT-H, Position1). When using this sub-block transformation mode, the luminance component in the residual sub-block can be transformed using the DST-7 transform kernel in both the horizontal and vertical directions; the chrominance component in the residual sub-block is transformed using the DCT-2 transform kernel.
[0091] In one possible implementation, with the current sub-block transformation enabled, the decoder can determine at least one of the partitioning ratio, partitioning direction, and partitioning position of the residual sub-block region based on the value of the third syntax element, thereby determining the position of the residual sub-block region based on at least one of the partitioning ratio, partitioning direction, and partitioning position.
[0092] Optionally, a two-dimensional array (0,0) represents the sample located at the top left corner of the current block, and a two-dimensional array (pos.x, pos.y) represents the sample located at the top left corner of the residual sub-block region. The width of the residual sub-block region is represented by size.width, and the height by size.height. Thus, the position of the residual sub-block region can be determined based on the two-dimensional array (pos.x, pos.y), size.width, and size.height. Specifically, the horizontal position range of the residual sub-block region is [sbtXStart, sbtXEnd], where sbtXStart = pos.x, sbtXEnd = sbtXStart + size.width - 1; the vertical position range of the residual sub-block region is [sbtYStart, sbtYEnd], where sbtYStart = pos.y, sbtYEnd = sbtYStart + size.height - 1.
[0093] Optionally, the horizontal position of the sample located at the upper left corner of the residual sub-block region can be represented as sbtXStart=xTb0Sub, and the vertical position can be represented as sbtYStart=yTb0Sub. The width of the residual sub-block region can be represented as nTbWSub=w*wPartIdx / 4, and the height can be represented as nTbHSub=h*hPartIdx / 4. Thus, the horizontal position range of the residual sub-block region is xTb0Sub~xTb0Sub+nTbWSub-1, and the vertical position range is yTb0Sub~yTb0Sub+nTbHSub–1.
[0094] The derivation of the width and height of the residual sub-block region is as follows: wPartIdx = cu_sbt_horizontal_flag? 4:sbtMinNumFourths, hPartIdx = ! cu_sbt_horizontal_flag? 4:sbtMinNumFourths,
[0095] Among them, sbtMinNumFourths=cu_sbt_quad_flag? 1:2,SbtNumFourthsTb0=cu_sbt_pos_flag? (4-sbtMinNumFourths):sbtMinNumFourths.
[0096] The derivation of the position of the top-left sample in the residual sub-block region is as follows: xTb0Sub=w*xPartIdx / 4, yTb0Sub=h*yPartIdx / 4.
[0097] When the value of cu_sbt_pos_flag is 0, xPartIdx = 0 and yPartIdx = 0.
[0098] When the value of cu_sbt_pos_flag is 1, xPartIdx = cu_sbt_horizontal_flag? 0:(4-sbtMinNumFourths), yPartIdx = ! cu_sbt_horizontal_flag? 0:(4-sbtMinNumFourths).
[0099] As illustrated in FIG5, it shows a schematic diagram of determining the position of the residual sub-block region provided by an exemplary embodiment of the present application. Taking the residual sub-block region 510 as an example, sbtXStart=w*1 / 2, sbtYStart=0, nTbWSub=w*1 / 2, nTbHSub=h, so the horizontal position range is [1 / 2w, w-1], and the vertical position range is [0, h-1].
[0100] For the second type of sub-block transformation, there can be two partition ratios, two horizontal positions, and two vertical positions. By combining these pairs, eight sub-block transformation patterns can be obtained. The partition ratio of the residual sub-block refers to the height and width partition ratios, which can be 1 / 2 or 1 / 4. The horizontal position refers to the relative horizontal position of the residual sub-block region within the current block, which can be left or right. The vertical position refers to the relative vertical position of the residual sub-block region within the current block, which can be up or down.
[0101] Optionally, the third syntax element representing the partition ratio can be cu_sbt_quad_flag. When the value of cu_sbt_quad_flag is true (or 1), it represents that the height partition ratio and width partition ratio of the residual sub-block are 1 / 4, that is, the height and width of the residual sub-block are 1 / 4 of the height and width of the current block; when the value of cu_sbt_quad_flag is false (or 0), it represents that the height partition ratio and width partition ratio of the residual sub-block are 1 / 2, that is, the height and width of the residual sub-block are 1 / 2 of the height and width of the current block.
[0102] Optionally, the third syntax element representing the horizontal position can be cu_sbt_horizontal_flag. When the value of cu_sbt_horizontal_flag is true (or 1), it represents the horizontal relative position of the residual sub-block in the current block as the right side; when the value of cu_sbt_horizontal_flag is false (or 0), it represents the horizontal relative position of the residual sub-block in the current block as the left side.
[0103] Optionally, the third syntax element representing the vertical position can be cu_sbt_vertical_flag. When the value of cu_sbt_vertical_flag is true (or 1), it represents the vertical relative position of the residual sub-block in the current block as the bottom; when the value of cu_sbt_vertical_flag is false (or 0), it represents the vertical relative position of the residual sub-block in the current block as the top.
[0104] As illustrated in FIG6, it shows a schematic diagram of sub-block partitioning corresponding to different sub-block transformation modes provided in another exemplary embodiment of this application.
[0105] For residual sub-block region 601, the values of its corresponding third syntax elements cu_sbt_quad_flag, cu_sbt_horizontal_flag, and cu_sbt_vertical_flag are all 0, meaning the width and height division ratio of residual sub-block region 601 is 1 / 2, and it is located on the upper left side of the current block. For residual sub-block region 605, the values of its corresponding third syntax elements cu_sbt_quad_flag, cu_sbt_horizontal_flag, and cu_sbt_vertical_flag are all 1, meaning the width and height division ratio of residual sub-block region 605 is 1 / 4, and it is located on the upper left side of the current block. When using this sub-block transformation mode, the luminance component in the residual sub-block can be transformed using a DCT-8 transform kernel in both the horizontal and vertical directions; the chrominance component in the residual sub-block is transformed using a DCT-2 transform kernel.
[0106] For residual sub-block region 602, the values of its corresponding third syntax elements cu_sbt_quad_flag are 0, cu_sbt_horizontal_flag is 1, and cu_sbt_vertical_flag is 0, meaning that the width and height division ratio of residual sub-block region 602 is 1 / 2, and it is located on the upper right side of the current block. For residual sub-block region 606, the values of its corresponding third syntax elements cu_sbt_quad_flag are 1, cu_sbt_horizontal_flag is 1, and cu_sbt_vertical_flag is 0, meaning that the width and height division ratio of residual sub-block region 606 is 1 / 4, and it is located on the upper right side of the current block. When using this sub-block transformation mode, the luminance component in the residual sub-block can be transformed using the DST-7 transform kernel in the horizontal direction and the DCT-8 transform kernel in the vertical direction; the chrominance component in the residual sub-block is transformed using the DCT-2 transform kernel.
[0107] For residual sub-block region 603, the values of its corresponding third syntax element cu_sbt_quad_flag are 0, cu_sbt_horizontal_flag is 0, and cu_sbt_vertical_flag is 1, meaning that the width and height division ratio of residual sub-block region 603 is 1 / 2, and it is located on the lower left side of the current block. For residual sub-block region 607, the values of its corresponding third syntax element cu_sbt_quad_flag are 1, cu_sbt_horizontal_flag is 0, and cu_sbt_vertical_flag is 1, meaning that the width and height division ratio of residual sub-block region 607 is 1 / 4, and it is located on the lower left side of the current block. When using this sub-block transformation mode, the luminance component in the residual sub-block can be transformed using the DCT-8 transform kernel in the horizontal direction and the DST-7 transform kernel in the vertical direction; the chrominance component in the residual sub-block is transformed using the DCT-2 transform kernel.
[0108] For residual sub-block region 604, the values of its corresponding third syntax elements cu_sbt_quad_flag are 0, cu_sbt_horizontal_flag is 1, and cu_sbt_vertical_flag is 1, meaning that the width and height division ratio of residual sub-block region 604 is 1 / 2, and it is located on the lower right side of the current block. For residual sub-block region 608, the values of its corresponding third syntax elements cu_sbt_quad_flag are 1, cu_sbt_horizontal_flag is 1, and cu_sbt_vertical_flag is 1, meaning that the width and height division ratio of residual sub-block region 608 is 1 / 4, and it is located on the lower right side of the current block. When using this sub-block transformation mode, the luminance component in the residual sub-block can be transformed using the DST-7 transform kernel in both the horizontal and vertical directions; the chrominance component in the residual sub-block is transformed using the DCT-2 transform kernel.
[0109] In another possible implementation, with the current block-to-subblock transformation enabled, the decoder can determine at least one of the partition ratio, horizontal position, and vertical position of the residual subblock region based on the value of the third syntax element, thereby determining the position of the residual subblock region based on at least one of the partition ratio, horizontal position, and vertical position.
[0110] Optionally, a two-dimensional array (0,0) represents the sample located at the top left corner of the current block, and a two-dimensional array (pos.x, pos.y) represents the sample located at the top left corner of the residual sub-block region. The width of the residual sub-block region is represented by size.width, and the height by size.height. Thus, the position of the residual sub-block region can be determined based on the two-dimensional array (pos.x, pos.y), size.width, and size.height. Specifically, the horizontal position range of the residual sub-block region is [sbtXStart, sbtXEnd], where sbtXStart = pos.x, sbtXEnd = sbtXStart + size.width - 1; the vertical position range of the residual sub-block region is [sbtYStart, sbtYEnd], where sbtYStart = pos.y, sbtYEnd = sbtYStart + size.height - 1.
[0111] As illustrated in FIG7, this invention provides a schematic diagram of determining the position of a residual sub-block region according to another exemplary embodiment of the present application. Taking residual sub-block region 710 as an example, sbtXStart=w*1 / 2, sbtYStart=0, nTbWSub=w*1 / 2, nTbHSub=h*1 / 2, therefore the horizontal position range is [1 / 2w, w-1], and the vertical position range is [0, 1 / 2h-1].
[0112] In some embodiments, after determining the location of the residual sub-block region in the first prediction block, in order to ensure that the reference sample includes at least the prediction sample located outside the residual sub-block region in the first prediction block, the decoder can determine whether to use the prediction sample as the reference sample by judging whether the prediction sample is located outside the residual sub-block region.
[0113] Optionally, the decoder can traverse the two-dimensional array (x, y) corresponding to each predicted sample in the first prediction block and determine whether the predicted sample is within the position range of the residual sub-block region. If sbtXStart≤x≤sbtXEnd and sbtYStart≤y≤sbtYEnd, it means that the predicted sample is located in the residual sub-block region; otherwise, it means that the predicted sample is located outside the residual sub-block region.
[0114] For example, for the residual sub-block region 510 shown in Figure 5, if 1 / 2w≤x≤w-1 and 0≤y≤h-1, it means that the predicted sample is located in the residual sub-block region 510; if 0≤x<1 / 2w-1 and 0≤y≤h-1, it means that the predicted sample is located outside the residual sub-block region 510.
[0115] Illustratively, for the residual sub-block region 710 shown in FIG. 7, when 1 / 2w ≤ x ≤ w-1 and 0 ≤ y ≤ 1 / 2h-1, it indicates that the prediction sample is located in the residual sub-block region 710; when 0 ≤ x < 1 / 2w-1 and 0 ≤ y ≤ h-1, or 1 / 2w ≤ x ≤ w-1 and 1 / 2h-1 < y ≤ h-1, it indicates that the prediction sample is located outside the residual sub-block region 710.
[0116] Optionally, the reference samples include all prediction samples in the first prediction block that are located outside the residual sub-block region, so that the decoder can determine, based on the position of the residual sub-block region, the prediction samples in the first prediction block that are located outside the residual sub-block region as reference samples.
[0117] Illustratively, as shown in FIG. 5, the decoder may determine all prediction samples located in the sub-block region 501 as reference samples, that is, the decoder traverses the two-dimensional array (x, y) corresponding to each prediction sample in the first prediction block, and records the two-dimensional arrays satisfying 0 ≤ x < 1 / 2w-1 and 0 ≤ y ≤ h-1, thereby determining the prediction samples corresponding to the two-dimensional arrays satisfying this condition as reference samples.
[0118] Illustratively, as shown in FIG. 7, the decoder may determine all prediction samples located in the sub-block region 701 as reference samples, that is, the decoder traverses the two-dimensional array (x, y) corresponding to each prediction sample in the first prediction block, and records the two-dimensional arrays satisfying 0 ≤ x < 1 / 2w-1 and 0 ≤ y ≤ h-1, or 1 / 2w ≤ x ≤ w-1 and 1 / 2h-1 < y ≤ h-1, thereby determining the prediction samples corresponding to the two-dimensional arrays satisfying this condition as reference samples.
[0119] Optionally, the reference samples include a part of prediction samples in the first prediction block that are located outside the residual sub-block region, so that the decoder can determine, based on the position of the residual sub-block region, the part of prediction samples in the first prediction block that are located outside the residual sub-block region as reference samples.
[0120] In a possible implementation, when a part of prediction samples located outside the residual sub-block region are selected as reference samples, the decoder may first delimit a sample range of the part of prediction samples, and the sample range is located outside the residual sub-block region, so that each prediction sample located in the sample range is used as a reference sample.
[0121] Illustratively, as shown in FIG. 5, the sample range 502 is 0 ≤ x < 1 / 2w-1 and 0 ≤ y ≤ y1, where 0 < y1 < h-1. Obviously, the sample range 502 is located outside the residual sub-block region, so that the decoder can determine each prediction sample located in the sample range 502 as a reference sample.
[0122] Illustratively, as shown in FIG. 7, a sample range 702 is 0≤x<1 / 2w-1 and 0≤y≤h-1. Obviously, the sample range 702 is located outside the residual sub-block region, such that the decoder may determine each prediction sample within the sample range 702 as a reference sample.
[0123] Optionally, the reference samples include all prediction samples in the first prediction block located outside the residual sub-block region, and a part of prediction samples in the residual sub-block region. Thus, the decoder may determine, based on the position of the residual sub-block region, the prediction samples in the first prediction block located outside the residual sub-block region and the part of prediction samples in the residual sub-block region as the reference samples.
[0124] In a possible implementation, in a case where the part of prediction samples in the residual sub-block region is selected as the reference samples, the decoder may first delimit a sample range of the part of prediction samples in the residual sub-block region, and the sample range is smaller than the residual sub-block region, such that each prediction sample within the sample range is taken as the reference sample.
[0125] Illustratively, as shown in FIG. 5, a sample range 503 is 0≤x<1 / 2w-1 and 0≤y≤h-1, and 1 / 2w-1≤x≤w-1 and 0≤y≤y2, where 0<y2<h-1. Obviously, the sample range 503 includes a sub-block region located outside the residual sub-block region and a part of region located in the residual sub-block region, such that the decoder may determine each prediction sample within the sample range 503 as a reference sample.
[0126] Illustratively, as shown in FIG. 7, a sample range 703 is 0≤x<1 / 2w-1 and 0≤y≤h-1, and 1 / 2w-1≤x≤w-1 and y3≤y≤h-1, where 0<y3<1 / 2h-1. Obviously, the sample range 703 includes a sub-block region located outside the residual sub-block region and a part of region located in the residual sub-block region, such that the decoder may determine each prediction sample within the sample range 703 as a reference sample.
[0127] Optionally, the reference samples include a part of prediction samples in the first prediction block located outside the residual sub-block region, and all prediction samples in the residual sub-block region. Thus, the decoder may determine, based on the position of the residual sub-block region, the part of prediction samples in the first prediction block located outside the residual sub-block region and the prediction samples in the residual sub-block region as the reference samples.
[0128] In a possible implementation, in a case that partial prediction samples outside the residual sub-block region are selected as reference samples, the decoder may first delimit a sample range of the partial prediction samples, and the sample range is outside the residual sub-block region, so that each prediction sample within the sample range is taken as a reference sample.
[0129] Illustratively, as shown in FIG. 5, a sample range 504 is 0≤x<1 / 2w−1 and 0≤y≤y4, where 0<y4<h−1; and 1 / 2w≤x≤w−1 and 0≤y≤h−1. Obviously, the sample range 504 includes a partial sub-block region outside the residual sub-block region and the entire region located in the residual sub-block region, so that the decoder may determine each prediction sample within the sample range 504 as a reference sample.
[0130] Illustratively, as shown in FIG. 7, a sample range 704 is 0≤x≤w−1 and 0≤y≤1 / 2h−1. Obviously, the sample range 704 includes a partial sub-block region outside the residual sub-block region and the entire region located in the residual sub-block region, so that the decoder may determine each prediction sample within the sample range 704 as a reference sample.
[0131] Optionally, the reference samples include partial prediction samples of the first prediction block outside the residual sub-block region, and partial prediction samples located in the residual sub-block region, so that the decoder may, based on a position of the residual sub-block region, determine the partial prediction samples of the first prediction block outside the residual sub-block region, and the partial prediction samples located in the residual sub-block region as the reference samples.
[0132] In a possible implementation, in a case that partial prediction samples outside the residual sub-block region and partial prediction samples inside the residual sub-block region are selected as reference samples, the decoder may first delimit a sample range of the partial prediction samples, and the sample range includes both a partial region outside the residual sub-block region and a partial region located in the residual sub-block region, so that each prediction sample within the sample range is taken as a reference sample.
[0133] Illustratively, as shown in FIG. 5, a sample range 505 is 0≤x≤w−1 and 0≤y≤y5, where 0<y5<h−1. Obviously, the sample range 505 includes a partial sub-block region outside the residual sub-block region and a partial region located in the residual sub-block region, so that the decoder may determine each prediction sample within the sample range 505 as a reference sample.
[0134] Illustratively, as shown in FIG. 7, the sample range 705 is 0≤x<1 / 2w-1 and 0≤y≤h-1, and 1 / 2w-1≤x≤w-1 and 0≤y≤y6, where 0<y6<1 / 2h-1. Obviously, the sample range 705 includes a partial sub-block region outside the residual sub-block region and a partial region within the residual sub-block region, such that the decoder may determine each prediction sample within the sample range 705 as a reference sample.
[0135] In some embodiments, considering that the residual of the current block may also have other distribution characteristics, i.e., other sub-block transform modes may also be adopted for the current block, the decoder determines the residual sub-block region of the current block according to the sub-block transform mode of the current block, and determines the reference sample in combination with the foregoing several reference sample selection manners, such that the reference sample at least includes a prediction sample in the first prediction block that is located outside the residual sub-block region.
[0136] Illustratively, as shown in FIG. 8, in a case where a sub-block transform mode shown in FIG. 8 is adopted for the current block, taking pos.x=1 / 4w, pos.y=0, size.width=1 / 2w, and size.height=h as an example, a horizontal position range of the residual sub-block region is [1 / 4w, 3 / 4w-1], and a vertical position range is [0, h-1]. Further, in a case where all prediction samples outside the residual sub-block region are determined as reference samples, the sample range is 0≤x<1 / 4w-1 and 0≤y≤h-1, and 3 / 4w-1<x≤w-1 and 0≤y≤h-1.
[0137] Description of determining all prediction samples as reference samples.
[0138] In some embodiments, in order to better fit the relationship between the first color component and the second color component while improving the determination efficiency of the reference sample, the decoder may also directly determine all prediction samples in the first prediction block of the current block as reference samples. That is, the reference samples include all prediction samples in the first prediction block that are located outside the residual sub-block region, and all prediction samples located within the residual sub-block region.
[0139] In a possible implementation, the decoder directly traverses each prediction sample in the first prediction block, so as to use each prediction sample as a reference sample. Optionally, the first prediction block has a width of w and a height of h, then the sample range of the reference samples is 0≤x≤w-1 and 0≤y≤h-1.
[0140] Description of selecting a determination manner of the reference sample during the decoding process.
[0141] To ensure consistency between the decoding and encoding ends in determining reference samples, considering both encoding and decoding costs and quality, a fourth syntax element can be set. The value of the fourth syntax element indicates whether the reference sample in the first prediction block is determined based on the value of the third syntax element, or whether all prediction samples in the first prediction block of the current block are determined as reference samples.
[0142] In some embodiments, the decoder parses the bitstream, determines the fourth syntax element, and determines the reference sample in the first prediction block of the current block based on the value of the third syntax element, according to the method of determining the reference sample indicated by the value of the fourth syntax element, or determines all the prediction samples in the first prediction block of the current block as reference samples.
[0143] Optionally, when the value of the fourth syntax element is true (or 1), it indicates that the reference sample in the first prediction block of the current block is determined based on the value of the third syntax element. The decoder then obtains the third syntax element and determines the position of the residual sub-block region in the first prediction block based on its value. Furthermore, based on the position of the residual sub-block region, it determines the reference sample from the first prediction block. When the value of the fourth syntax element is false (or 0), it indicates that all predicted samples in the first prediction block of the current block are determined as reference samples. The decoder then directly traverses each predicted sample in the first prediction block and uses all predicted samples as reference samples.
[0144] Optionally, the correspondence between different blocks and the fourth syntax element can be the same as the correspondence between different blocks and the second syntax element, or it can be different from the correspondence between different blocks and the second syntax element.
[0145] The derivation of filter coefficients and an explanation of convolutional cross-component prediction for the current block are presented.
[0146] In some embodiments, after determining the reference sample, the decoder can use the reference sample to derive the filter coefficients of the convolutional cross-component filter, thereby applying the convolutional cross-component filter to the convolutional cross-component prediction process for the current block.
[0147] Optionally, the decoder extracts reference samples from the first prediction block of the first color component and from the first prediction block of the second color component, thereby determining the filter coefficients of the convolutional cross-component filter based on the reference samples of the first color component and the reference samples of the second color component.
[0148] The method of extracting reference samples from the first prediction block of the first color component can be consistent with the method of extracting reference samples from the first prediction block of the second color component.
[0149] Optionally, the convolutional cross-component filter can be an 8-tap filter, meaning it consists of six reference samples corresponding to the first color component, a nonlinear term, and a bias term. The bias term is related to the chromaticity values of the reference samples for the second color component.
[0150] Wherein, the first color component is the luminance component, and the second color component is the chrominance component. The reference sample for the first color component is the luminance reference sample, and the reference sample for the second color component is the chrominance reference sample. Optionally, the correspondence between the luminance reference sample and the chrominance reference sample is determined based on the sampling format.
[0151] In one possible implementation, when applying the convolutional cross-component filter to output the second predicted value of the second color component, the reconstructed value of the first color component can be used as the input to the convolutional cross-component filter.
[0152] Optionally, the decoder first determines the reconstructed value of the first color component based on the predicted samples located in the residual sub-block region of the first prediction block of the first color component and the residual value of the first color component. Then, based on the filter coefficients and the reconstructed value of the first color component, the decoder performs filtering processing on the reconstructed value of the first color component through a convolutional cross-component filter to obtain the second prediction value of the second color component of the current block. Optionally, the process of deriving the second predicted value of the second color component using a convolutional cross-component filter can be expressed as: predChromaVal=c0*L0+c1*L1+c2*L2+c3*L3+c4*L4+c5*L5+c6*nonlinear((L0+L3+1)>>1)+c7*B, where * is a multiplication operation, L0~5 are luminance samples, c0~7 are filter coefficients, nonlinear is a nonlinear term, and B is a bias term. The bias term B can be set to the intermediate value of the chrominance value, midVal. The value of midVal is determined according to the bit depth value. For example, when the bit depth is 10, the value of midVal is 512.
[0153] As illustrated in Figure 9, this embodiment of the present application provides a schematic diagram of the correspondence between chromaticity reference samples and luminance reference samples. Taking sampling format 420 as an example, the two-dimensional array corresponding to the chromaticity reference sample C is (x, y), and the two-dimensional arrays corresponding to the luminance reference samples L0, L1, L2, L3, L4, and L5 are (2x, 2y), (2x-1, 2y), (2x+1, 2y), (2x, 2y+1), (2x-1, 2y+1), and (2x+1, 2y+1), respectively.
[0154] Schematic illustration, as shown in Figure 10, illustrates a process for convolutional cross-component prediction provided in an exemplary embodiment of this application. After determining the luminance Y reference sample, chrominance Cb reference sample, and chrominance Cr reference sample, the decoder can derive and determine the filter coefficients of the convolutional cross-component filter.
[0155] Furthermore, after obtaining the second predicted value of the second color component output by the convolutional cross-component filter, the decoder can obtain the third predicted value of the second color component through weighted fusion, and then use the third predicted value to determine the reconstructed value.
[0156] In some embodiments, the decoder performs weighted processing on the predicted samples located in the residual sub-block region of the first predicted block of the second color component and the second predicted value of the second color component to obtain a third predicted value of the second color component of the current block. Then, based on the third predicted value of the second color component of the current block and the residual value of the second color component, the reconstructed value of the second color component can be determined.
[0157] As illustrated in Figure 10, after applying a convolutional cross-component filter to output the second predicted value of the second color component, the decoder needs to perform a weighted fusion of the output second predicted value with the first predicted value of the predicted samples in the first prediction block of the second color component to obtain the third predicted value of the second color component. Specifically, a weighting value of 0.75 can be used for the second predicted value output by the filter, and a weighting value of 0.25 can be used for the first predicted value of the predicted samples in the first prediction block.
[0158] After obtaining the third predicted value of the second color component, the predicted samples located outside the residual sub-block region and the predicted samples located within the residual sub-block region are combined to obtain the target predicted block of the current block. Then, the target predicted block of the second color component is added to the residual block to obtain the reconstructed block of the second color component of the current block. Specifically, the predicted value of the predicted samples located outside the residual sub-block region in the target predicted block is the first predicted value, and the predicted value of the predicted samples located within the residual sub-block region is the third predicted value.
[0159] Furthermore, the residual value corresponding to the predicted sample located outside the residual sub-block region is zero, so the reconstructed value after reconstruction is equal to the first predicted value; the residual value corresponding to the predicted sample located inside the residual sub-block region is not zero, so the reconstructed value after reconstruction is equal to the third predicted value plus the residual value.
[0160] In the above embodiments, the filter coefficients of the convolutional cross-component filter are derived using reference samples that include at least the predicted samples located outside the residual sub-block region in the first prediction block. By increasing the number of accurate predicted samples included in the reference samples, the relationship between the first color component and the second color component can be better fitted, thereby improving the accuracy of the filter coefficients and thus improving the encoding and decoding performance.
[0161] Please refer to Figure 11, which shows a flowchart of a prediction method provided in an exemplary embodiment of this application. The method is applied to an encoder and may include the following steps:
[0162] Step 1101: Based on the reference samples, determine the filter coefficients of the convolutional cross-component filter. The reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block.
[0163] In a block-based hybrid coding framework, images in a video are divided into multiple control blocks (CUs). The current block refers to the block that the decoder is currently processing, i.e., the CU.
[0164] During the encoding process, the encoder first divides the image into multiple coding blocks, and then uses intra-frame or inter-frame prediction (including motion estimation and motion compensation) algorithms to generate a prediction block for the current block. In this embodiment, to improve video encoding and decoding efficiency, the prediction block obtained by using intra-frame or inter-frame prediction algorithms is used as the first prediction block of the current block. Based on this, considering the correlation between the first color component and the second color component, convolutional cross-component prediction is performed on the current block to obtain the second prediction value of the second color component of the current block.
[0165] Then, the encoder subtracts the target prediction block from the original block of the current block to obtain the residual block. In addition, the encoder reconstructs the block based on the inverse quantization / inverse transform result and the target prediction block to obtain the reconstructed block.
[0166] In this process, the first color component can be the luminance component, and the second color component can be the chrominance component. That is, in the convolutional cross-component prediction process, the correlation between the luminance component and the chrominance component is considered, and the second predicted value of the chrominance component is determined by combining the reconstructed value of the luminance component, so as to improve the prediction accuracy of the luminance component.
[0167] Optionally, the first prediction block is obtained by predicting the current block using either inter-frame prediction mode or intra-frame block copy mode. During the encoding process, the encoder can obtain the first prediction block of the current block by applying inter-frame prediction mode to the current block, or by applying intra-frame block copy mode to the current block.
[0168] In one possible implementation, the encoder performs inter-frame prediction on the current block to obtain the motion vector corresponding to the current block, and then determines the first predicted block of the current block based on the motion vector. In another possible implementation, the encoder performs intra-frame block copying on the current block to obtain the block vector corresponding to the current block, and then determines the first predicted block of the current block based on the block vector.
[0169] Optionally, when a sub-block transformation mode is applied to the current block, the current block can be divided into two regions. One region contains residual information and can be called a residual sub-block, while the other region does not contain residual information and can be called a non-residual sub-block. Based on this, in the first prediction block of the current block, the prediction accuracy of the prediction samples located within the residual sub-block region is obviously lower than the prediction accuracy of the prediction samples located outside the residual sub-block region. Therefore, in some embodiments, to better fit the relationship between the first color component and the second color component, the encoder can determine a reference sample based on the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block. This reference sample is then used to determine the filter coefficients of the convolutional cross-component filter.
[0170] The reference sample must include at least the predicted samples located outside the residual sub-block region of the first prediction block. Optionally, the reference sample may include a portion of the predicted samples located outside the residual sub-block region of the first prediction block, or it may include all the predicted samples located outside the residual sub-block region of the first prediction block. Optionally, in addition to including the predicted samples located outside the residual sub-block region of the first prediction block, the reference sample may also include the predicted samples located within the residual sub-block region of the first prediction block.
[0171] In some embodiments, after determining the reference sample, the encoder can derive the filter coefficients of the convolutional cross-component filter based on the reference sample, thereby using the convolutional cross-component filter to perform inter-frame convolutional cross-component prediction for the current block, so as to improve the prediction accuracy for the current block.
[0172] Step 1102: Based on the filter coefficients and the reconstructed value of the first color component of the current block, determine the second predicted value of the second color component of the current block.
[0173] In some embodiments, after determining the filter coefficients of the convolutional cross-component filter, the encoder can apply the convolutional cross-component filter, using the reconstructed value of the first color component of the current block as the input of the convolutional cross-component filter, thereby filtering the reconstructed value of the first color component through the convolutional cross-component filter and outputting the second predicted value of the second color component of the current block.
[0174] Optionally, the reconstructed value of the first color component is obtained based on the predicted samples located in the residual sub-block region of the first prediction block of the first color component and the residual value of the first color component. That is, convolutional cross-component prediction is a process of processing the predicted samples located in the residual sub-block region of the first prediction block.
[0175] Here, the second predicted value of the second color component refers to the second predicted value of the predicted sample located in the residual sub-block region within the first predicted block of the second color component. Optionally, the second color component is a chromaticity component, and the convolutional cross-component filter can output the second predicted values of the chromaticity Cb component and the second predicted values of the chromaticity Cr component, respectively.
[0176] In summary, in the embodiments of this application, by adjusting the reference samples used to derive the filter coefficients, and utilizing the reference samples of the prediction samples located outside the residual sub-block region in the first prediction block that includes at least one color component of the current block, the filter coefficients of the convolutional cross-component filter are determined. Thus, based on the filter coefficients and the reconstructed value of the first color component, the second predicted value of the second color component is determined. This optimizes the fitting relationship between the first and second color components, improves the accuracy of cross-component prediction, and thereby improves encoding and decoding performance.
[0177] The encoding process involves encoding the values of the first and second syntax elements into the bitstream.
[0178] Due to considerations of encoding / decoding costs and quality, convolutional cross-component prediction and sub-block transformation are not required for the current block in all scenarios. In other words, the process of determining the filter coefficients of the convolutional cross-component filter based on reference samples proposed in this application is not applicable in all scenarios. Therefore, the encoder needs to determine whether to perform convolutional cross-component prediction and sub-block transformation on the current block to encode the values of the corresponding syntax elements into the bitstream.
[0179] In one possible implementation, the encoder can determine whether to perform convolutional cross-component prediction and sub-block transformation on the current block based on the rate-distortion cost when using different encoding methods.
[0180] Optionally, the encoder first determines a first rate-distortion cost and a second rate-distortion cost. Then, based on a comparison of the first and second rate-distortion costs, if the first rate-distortion cost is less than the second rate-distortion cost, the encoder encodes the values of the first and second syntax elements into the bitstream. The value of the first syntax element indicates whether convolutional cross-component prediction is enabled for the current block, and the value of the second syntax element indicates whether sub-block transformation is enabled for the current block.
[0181] The first rate-distortion cost is the rate-distortion cost when convolutional cross-component prediction and sub-block transformation are enabled for the current block. When performing convolutional cross-component prediction and sub-block transformation on the current block, the encoder determines the first rate-distortion cost based on the distortion value of the reconstructed block (which can be mean square error, absolute error, etc.) and the coding bit rate required for the transmitted signal through the rate-distortion cost function.
[0182] The second rate-distortion cost is the rate-distortion cost when convolutional cross-component prediction and / or sub-block transformation are disabled in the current block. When performing convolutional cross-component prediction and disabling sub-block transformation in the current block, or when disabling convolutional cross-component prediction and performing sub-block transformation in the current block, or when disabling convolutional cross-component prediction and disabling sub-block transformation in the current block, the encoder determines the second rate-distortion cost based on the distortion value of the reconstructed block (which can be mean square error, absolute error, etc.) and the required coding bit rate for the transmitted signal, using the rate-distortion cost function.
[0183] Furthermore, if the first rate-distortion cost is less than the second rate-distortion cost, it indicates that performing convolutional cross-component prediction and sub-block transformation on the current block can significantly improve the quality of the reconstructed block. Therefore, the encoder determines that convolutional cross-component prediction and sub-block transformation of the current block are enabled, and encodes the value of the first syntax element (true or 1) and the value of the second syntax element (true or 1) into the bitstream.
[0184] Regarding the method of setting syntax elements, in one possible implementation, the encoder can set the syntax elements corresponding to the current block based on the rate-distortion cost comparison result corresponding to the current block, that is, different blocks in the same image correspond to their own syntax elements.
[0185] In another possible implementation, the encoder can accumulate rate-distortion costs corresponding to different blocks within the same slice to obtain a first rate-distortion cost accumulation value (obtained by accumulating the first rate-distortion costs of different blocks within the same slice) and a second rate-distortion cost accumulation value (obtained by accumulating the second rate-distortion costs of different blocks within the same slice). Based on the comparison result of the first rate-distortion cost accumulation value and the second rate-distortion cost accumulation value, the encoder sets the syntax element corresponding to the slice, that is, different blocks within the same slice in the same image correspond to the same syntax element.
[0186] In another possible implementation, the encoder can accumulate rate-distortion costs corresponding to different blocks in the same image to obtain a first rate-distortion cost accumulation value (obtained by accumulating the first rate-distortion costs of different blocks in the same image) and a second rate-distortion cost accumulation value (obtained by accumulating the second rate-distortion costs of different blocks in the same image). Based on the comparison result of the first rate-distortion cost accumulation value and the second rate-distortion cost accumulation value, the corresponding syntax element of the image is set, that is, different blocks in the same image correspond to the same syntax element.
[0187] In another possible implementation, the encoder can accumulate rate-distortion costs corresponding to different blocks in the same image group to obtain a first rate-distortion cost accumulation value (obtained by accumulating the first rate-distortion costs of different blocks in the same image group) and a second rate-distortion cost accumulation value (obtained by accumulating the second rate-distortion costs of different blocks in the same image group). Based on the comparison result of the first rate-distortion cost accumulation value and the second rate-distortion cost accumulation value, the encoder sets the syntax elements corresponding to the image group, that is, different blocks of different images in the same image group correspond to the same syntax elements.
[0188] The description of the reference sample is determined based on the value of the third syntax element.
[0189] In some embodiments, when residuals exist in the current block, sub-block transformations can be performed on the current block. This allows the encoder to transform only the regions with larger residuals in the current block, setting the residuals in other regions to zero. This reduces the number of transformation coefficients required for encoding and improves coding efficiency. In other words, when residuals exist in the current block and sub-block transformations are enabled, the encoder only needs to encode the residuals in a portion of the current block and perform transform quantization.
[0190] Optionally, considering that blocks in different images may have different residual distribution characteristics, or different blocks in the same image may have different residual distribution characteristics, multiple sub-block transformation modes can be set to more flexibly transform different blocks. This allows the encoder to select an appropriate sub-block transformation mode for the current block based on its residual distribution characteristics.
[0191] Optionally, when sub-block transformation is enabled for the current block, in order to facilitate the decoder in determining the applicable sub-block transformation mode for the current block, the encoder can also encode the syntax element corresponding to the current block into the bitstream, using this syntax element to indicate the sub-block transformation mode of the current block. Different sub-block transformation modes correspond to their respective syntax elements.
[0192] In some embodiments, when performing convolutional cross-component prediction and sub-block transformation on the current block, the encoder determines the sub-block transformation mode to be applied to the current block and determines the value of a third syntax element, which is used to indicate the sub-block transformation mode of the current block. Based on the value of the third syntax element, the encoder determines the reference sample in the first prediction block of the current block.
[0193] Optionally, the location of the residual sub-block region differs under different sub-block transformation modes. Based on this, the encoder can first determine the location of the residual sub-block region in the first prediction block based on the value of the third syntax element, and then determine the reference sample in the first prediction block based on the location of the residual sub-block region.
[0194] Optionally, based on the different partitioning methods corresponding to the residual sub-block regions, sub-block transformations can be divided into two categories. The first type of sub-block transformation corresponds to eight sub-block transformation modes, and under these modes, the height of the residual sub-block is the same as the height of the current block, or the width of the residual sub-block is the same as the width of the current block. The second type of sub-block transformation also corresponds to eight sub-block transformation modes, and under these modes, the height and width of the residual sub-block are the same.
[0195] For the first type of sub-block transformation, there can be two partition ratios, two partition directions, and two partition positions. By combining these pairs, eight sub-block transformation modes can be obtained. Among them, the partition ratio of the residual sub-block refers to the height partition ratio or the width partition ratio, which can be 1 / 2 or 1 / 4; the partition direction can be horizontal or vertical; and the partition position refers to the relative position of the residual sub-block region in the current block, which can be left (top) or right (bottom).
[0196] In one possible implementation, when the current sub-block transformation is enabled, the encoder can determine at least one of the partitioning ratio, partitioning direction, and partitioning position of the residual sub-block region based on the value of the third syntax element, thereby determining the position of the residual sub-block region based on at least one of the partitioning ratio, partitioning direction, and partitioning position.
[0197] For the second type of sub-block transformation, there can be two partition ratios, two horizontal positions, and two vertical positions. By combining these pairs, eight sub-block transformation patterns can be obtained. The partition ratio of the residual sub-block refers to the height and width partition ratios, which can be 1 / 2 or 1 / 4. The horizontal position refers to the relative horizontal position of the residual sub-block region within the current block, which can be left or right. The vertical position refers to the relative vertical position of the residual sub-block region within the current block, which can be up or down.
[0198] In another possible implementation, with the current sub-block transformation enabled, the encoder can determine at least one of the partition ratio, horizontal position, and vertical position of the residual sub-block region based on the value of the third syntax element, thereby determining the position of the residual sub-block region based on at least one of the partition ratio, horizontal position, and vertical position.
[0199] Optionally, the encoder can determine the predicted samples located outside the residual sub-block region in the first prediction block as reference samples based on the location of the residual sub-block region; or, determine a portion of the predicted samples located outside the residual sub-block region in the first prediction block as reference samples; or, determine a portion of the predicted samples located outside the residual sub-block region in the first prediction block, as well as a portion of the predicted samples located within the residual sub-block region in the first prediction block as reference samples; or, determine a portion of the predicted samples located outside the residual sub-block region in the first prediction block, as well as a portion of the predicted samples located within the residual sub-block region in the first prediction block as reference samples.
[0200] Explanation of determining all predicted samples as reference samples.
[0201] In some embodiments, to improve the efficiency of reference sample determination while better fitting the relationship between the first color component and the second color component, the encoder can also directly determine all predicted samples in the first prediction block of the current block as reference samples. That is, the reference samples include all predicted samples in the first prediction block located outside the residual sub-block region, and all predicted samples located within the residual sub-block region.
[0202] In one possible implementation, the encoder directly traverses each prediction sample in the first prediction block, thereby using each prediction sample as a reference sample.
[0203] During the encoding process, the fourth syntax element indicates the method for determining the reference sample.
[0204] To ensure consistency between the decoding and encoding ends in determining reference samples, considering both encoding and decoding costs and quality, a fourth syntax element can be set. The value of the fourth syntax element indicates whether the reference sample in the first prediction block of the current block is determined based on the value of the third syntax element, or whether all prediction samples in the first prediction block of the current block are determined as reference samples.
[0205] In some embodiments, the encoder determines a third rate-distortion cost and a fourth rate-distortion cost, and then encodes the value of the fourth syntax element into the bitstream based on the comparison between the third rate-distortion cost and the fourth rate-distortion cost.
[0206] The value of the fourth syntax element indicates whether to determine the reference sample in the first prediction block of the current block based on the value of the third syntax element, or to determine all prediction samples in the first prediction block of the current block as reference samples. Optionally, if the value of the fourth syntax element is true (or 1), it indicates that the reference sample in the first prediction block of the current block is determined based on the value of the third syntax element; if the value of the fourth syntax element is false (or 0), it indicates that all prediction samples in the first prediction block of the current block are determined as reference samples.
[0207] The third rate-distortion cost is the rate-distortion cost when the reference sample in the first prediction block of the current block is determined based on the value of the third syntax element, and the fourth rate-distortion cost is the rate-distortion cost when all prediction samples in the first prediction block of the current block are determined as reference samples.
[0208] Optionally, under the premise of performing convolutional cross-component prediction and sub-block transformation on the current block, when determining the reference sample in the first prediction block of the current block based on the value of the third syntax element, the encoder determines the third rate-distortion cost based on the distortion value of the reconstructed block (which can be mean square error, absolute error, etc.) and the coding bit rate required for the transmission signal through the rate-distortion cost function; when determining all the prediction samples in the first prediction block of the current block as reference samples, the encoder determines the fourth rate-distortion cost based on the distortion value of the reconstructed block (which can be mean square error, absolute error, etc.) and the coding bit rate required for the transmission signal through the rate-distortion cost function.
[0209] In one possible implementation, if the cost of the third rate distortion is less than the cost of the fourth rate distortion, it indicates that determining the reference samples in the first prediction block of the current block based on the value of the third syntax element can significantly improve encoding and decoding performance compared to determining all predicted samples in the first prediction block of the current block as reference samples. Therefore, the encoder sets the value of the fourth syntax element to true (or 1).
[0210] In another possible implementation, if the third rate distortion cost is not less than the fourth rate distortion cost, it indicates that determining the reference samples in the first prediction block of the current block based on the value of the third syntax element does not significantly improve encoding and decoding performance compared to determining all predicted samples in the first prediction block of the current block as reference samples. Therefore, the encoder sets the value of the fourth syntax element to false (or 0).
[0211] The derivation of filter coefficients and an explanation of convolutional cross-component prediction for the current block are presented.
[0212] In some embodiments, after determining the reference sample, the encoder can use the reference sample to derive the filter coefficients of the convolutional cross-component filter, thereby applying the convolutional cross-component filter to the convolutional cross-component prediction process for the current block.
[0213] Optionally, the encoder extracts reference samples from the first prediction block of the first color component and from the first prediction block of the second color component, thereby determining the filter coefficients of the convolutional cross-component filter based on the reference samples of the first color component and the reference samples of the second color component.
[0214] The method for extracting reference samples from the first prediction block of the first color component can be consistent with the method for extracting reference samples from the first prediction block of the second color component. The first color component is the luminance component, and the second color component is the chrominance component. The reference sample for the first color component is the luminance reference sample, and the reference sample for the second color component is the chrominance reference sample. Optionally, the correspondence between the luminance reference sample and the chrominance reference sample is determined based on the sampling format.
[0215] In one possible implementation, when applying the convolutional cross-component filter to output the second predicted value of the second color component, the reconstructed value of the first color component can be used as the input to the convolutional cross-component filter.
[0216] Optionally, the decoder first determines the reconstructed value of the first color component based on the predicted samples located in the residual sub-block region of the first prediction block of the first color component and the residual value of the first color component. Then, based on the filter coefficients and the reconstructed value of the first color component, the decoder performs filtering processing on the reconstructed value of the first color component through a convolutional cross-component filter to obtain the second prediction value of the second color component of the current block.
[0217] Furthermore, after obtaining the second predicted value of the second color component output by the convolutional cross-component filter, the decoder can obtain the third predicted value of the second color component through weighted fusion, and then use the third predicted value to determine the reconstructed value.
[0218] In some embodiments, the encoder performs weighted processing on the predicted samples located in the residual sub-block region of the first prediction block of the second color component and the second predicted value of the second color component to obtain a third predicted value of the second color component of the current block. Then, based on the third predicted value of the second color component of the current block and the residual value of the second color component, the reconstructed value of the second color component can be determined.
[0219] In the target prediction block of the second color component, the predicted value of the predicted sample located in the residual sub-block region is the third predicted value, and the third predicted value is equal to the first predicted value * weighted weight value + the second predicted value * weighted weight value; the predicted value of the predicted sample located outside the residual sub-block region is the first predicted value. Furthermore, the residual value corresponding to the predicted sample located outside the residual sub-block region is zero, so the reconstructed value after reconstruction is equal to the first predicted value; the residual value corresponding to the predicted sample located within the residual sub-block region is not zero, so the reconstructed value after reconstruction is equal to the third predicted value + the residual value.
[0220] In the above embodiments, the filter coefficients of the convolutional cross-component filter are derived using reference samples that include at least the predicted samples located outside the residual sub-block region in the first prediction block. By increasing the number of accurate predicted samples included in the reference samples, the relationship between the first color component and the second color component can be better fitted, thereby improving the accuracy of the filter coefficients and thus improving the encoding and decoding performance.
[0221] Please refer to Figure 12, which shows a structural block diagram of a prediction device provided in an exemplary embodiment of this application. The prediction device includes:
[0222] Decoding unit 1201 is used to determine the filter coefficients of the convolutional cross-component filter based on reference samples, wherein the reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block.
[0223] The decoding unit is further configured to determine a second predicted value of the second color component of the current block based on the filter coefficients and the reconstructed value of the first color component of the current block.
[0224] Optionally, the decoding unit 1201 is used for:
[0225] Parse the bitstream to determine the first and second syntax elements;
[0226] When the value of the first syntax element indicates that the current block convolution cross-component prediction is enabled, and the value of the second syntax element indicates that the current block sub-block transformation is enabled, the filter coefficients of the convolution cross-component filter are determined based on the reference sample.
[0227] Optionally, the decoding unit 1201 is used for:
[0228] Parse the bitstream to obtain the third syntax element, the value of which is used to indicate the sub-block transformation mode of the current block;
[0229] The reference sample in the first prediction block is determined based on the value of the third syntax element.
[0230] Optionally, the decoding unit 1201 is used for:
[0231] Based on the value of the third syntax element, the location of the residual sub-block region in the first prediction block is determined;
[0232] Based on the location of the residual sub-block region, the reference sample in the first prediction block is determined.
[0233] Optionally, when sub-block transformation of the current block is enabled, the decoding unit 1201 is configured to:
[0234] Based on the value of the third syntax element, determine at least one of the division ratio, division direction, and division position of the residual sub-block region;
[0235] The location of the residual sub-block region is determined based on at least one of the division ratio, the division direction, and the division position.
[0236] Optionally, when sub-block transformation of the current block is enabled, the decoding unit 1201 is configured to:
[0237] Based on the value of the third syntax element, determine at least one of the division ratio, horizontal position, and vertical position of the residual sub-block region;
[0238] The location of the residual sub-block region is determined based on at least one of the division ratio, the horizontal position, and the vertical position.
[0239] Optionally, the decoding unit 1201 is used for:
[0240] Based on the location of the residual sub-block region, the predicted samples in the first prediction block located outside the residual sub-block region are determined as the reference samples; or...
[0241] Based on the location of the residual sub-block region, the portion of the predicted samples in the first prediction block located outside the residual sub-block region is determined as the reference sample; or...
[0242] Based on the location of the residual sub-block region, the predicted samples located outside the residual sub-block region in the first prediction block, and a portion of the predicted samples located within the residual sub-block region, are determined as the reference samples; or...
[0243] Based on the location of the residual sub-block region, the portion of the predicted samples located outside the residual sub-block region in the first prediction block, and the predicted samples located within the residual sub-block region, are determined as the reference samples; or...
[0244] Based on the location of the residual sub-block region, the portion of the predicted samples located outside the residual sub-block region in the first prediction block, and the portion of the predicted samples located within the residual sub-block region, are determined as the reference samples.
[0245] Optionally, the decoding unit 1201 is used for:
[0246] All predicted samples in the first prediction block of the current block are determined as reference samples.
[0247] Optionally, the decoding unit 1201 is used for:
[0248] Parse the bitstream and determine the fourth syntax element. The value of the fourth syntax element is used to indicate the reference sample in the first prediction block based on the value of the third syntax element, or to determine all prediction samples in the first prediction block of the current block as reference samples.
[0249] Optionally, the decoding unit 1201 is used for:
[0250] The filter coefficients of the convolutional cross-component filter are determined based on reference samples in the first prediction block of the first color component and reference samples in the first prediction block of the second color component.
[0251] Optionally, the decoding unit 1201 is used for:
[0252] Based on the prediction samples located in the residual sub-block region of the first prediction block of the first color component and the residual value of the first color component, the reconstructed value of the first color component is determined.
[0253] Based on the filter coefficients and the reconstructed value of the first color component, the reconstructed value of the first color component is filtered by the convolutional cross-component filter to obtain the second predicted value of the second color component of the current block.
[0254] Optionally, the decoding unit 1201 is used for:
[0255] The prediction samples located in the residual sub-block region of the first prediction block of the second color component and the second prediction value of the second color component are weighted to obtain the third prediction value of the second color component of the current block;
[0256] The reconstructed value of the second color component is determined based on the third predicted value of the second color component of the current block and the residual value of the second color component.
[0257] Optionally, the first prediction block is obtained by predicting the current block using an inter-frame prediction mode or an intra-frame block copy mode.
[0258] Optionally, the first color component is a luminance component, and the second color component is a chromaticity component.
[0259] Please refer to Figure 13, which shows a structural block diagram of a prediction device provided in an exemplary embodiment of this application. The prediction device includes:
[0260] Encoding unit 1301 is used to determine the filter coefficients of the convolutional cross-component filter based on reference samples, wherein the reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block.
[0261] The encoding unit is further configured to determine a second predicted value of the second color component of the current block based on the filter coefficients and the reconstructed value of the first color component of the current block.
[0262] Optionally, the encoding unit 1301 is used for:
[0263] If the first rate-distortion cost is less than the second rate-distortion cost, the values of the first syntax element and the second syntax element are encoded into the bitstream. The first rate-distortion cost is the rate-distortion cost when convolutional cross-component prediction is enabled and sub-block transformation is enabled in the current block. The second rate-distortion cost is the rate-distortion cost when convolutional cross-component prediction and / or sub-block transformation is disabled in the current block. The value of the first syntax element is used to indicate that convolutional cross-component prediction is enabled in the current block, and the value of the second syntax element is used to indicate that sub-block transformation is enabled in the current block.
[0264] Optionally, the encoding unit 1301 is used for:
[0265] Determine a third syntax element, the value of which is used to indicate the sub-block transformation mode of the current block;
[0266] The reference sample in the first prediction block is determined based on the value of the third syntax element.
[0267] Optionally, the encoding unit 1301 is used for:
[0268] Based on the value of the third syntax element, the location of the residual sub-block region in the first prediction block is determined;
[0269] Based on the location of the residual sub-block region, the reference sample in the first prediction block is determined.
[0270] Optionally, when sub-block transformation of the current block is enabled, the encoding unit 1301 is configured to:
[0271] Based on the value of the third syntax element, determine at least one of the division ratio, division direction, and division position of the residual sub-block region;
[0272] The location of the residual sub-block region is determined based on at least one of the division ratio, the division direction, and the division position.
[0273] Optionally, when sub-block transformation of the current block is enabled, the encoding unit 1301 is configured to:
[0274] Based on the value of the third syntax element, determine at least one of the division ratio, horizontal position, and vertical position of the residual sub-block region;
[0275] The location of the residual sub-block region is determined based on at least one of the division ratio, the horizontal position, and the vertical position.
[0276] Optionally, the encoding unit 1301 is used for:
[0277] Based on the location of the residual sub-block region, the predicted samples in the first prediction block located outside the residual sub-block region are determined as the reference samples; or...
[0278] Based on the location of the residual sub-block region, the portion of the predicted samples in the first prediction block located outside the residual sub-block region is determined as the reference sample; or...
[0279] Based on the location of the residual sub-block region, the predicted samples located outside the residual sub-block region in the first prediction block, and a portion of the predicted samples located within the residual sub-block region, are determined as the reference samples; or...
[0280] Based on the location of the residual sub-block region, the portion of the predicted samples located outside the residual sub-block region in the first prediction block, and the predicted samples located within the residual sub-block region, are determined as the reference samples; or...
[0281] Based on the location of the residual sub-block region, the portion of the predicted samples located outside the residual sub-block region in the first prediction block, and the portion of the predicted samples located within the residual sub-block region, are determined as the reference samples.
[0282] Optionally, the encoding unit 1301 is used for:
[0283] All predicted samples in the first prediction block of the current block are determined as reference samples.
[0284] Optionally, the encoding unit 1301 is used for:
[0285] The third rate-distortion cost and the fourth rate-distortion cost are determined. The third rate-distortion cost is the rate-distortion cost when the reference sample in the first prediction block is determined based on the value of the third syntax element. The fourth rate-distortion cost is the rate-distortion cost when all prediction samples in the first prediction block of the current block are determined as reference samples.
[0286] Based on the comparison result of the third rate-distortion cost and the fourth rate-distortion cost, the value of the fourth syntax element is encoded into the bitstream. The value of the fourth syntax element is used to indicate the determination of the reference sample in the first prediction block based on the value of the third syntax element, or to determine all prediction samples in the first prediction block of the current block as reference samples.
[0287] Optionally, the encoding unit 1301 is used for:
[0288] The filter coefficients of the convolutional cross-component filter are determined based on reference samples in the first prediction block of the first color component and reference samples in the first prediction block of the second color component.
[0289] Optionally, the encoding unit 1301 is used for:
[0290] Based on the prediction samples located in the residual sub-block region of the first prediction block of the first color component and the residual value of the first color component, the reconstructed value of the first color component is determined.
[0291] Based on the filter coefficients and the reconstructed value of the first color component, the reconstructed value of the first color component is filtered by the convolutional cross-component filter to obtain the second predicted value of the second color component of the current block.
[0292] Optionally, the encoding unit 1301 is used for:
[0293] The prediction samples located in the residual sub-block region of the first prediction block of the second color component and the second prediction value of the second color component are weighted to obtain the third prediction value of the second color component of the current block;
[0294] The reconstructed value of the second color component is determined based on the third predicted value of the second color component of the current block and the residual value of the second color component.
[0295] Optionally, the first prediction block is obtained by predicting the current block using an inter-frame prediction mode or an intra-frame block copy mode.
[0296] Optionally, the first color component is a luminance component, and the second color component is a chromaticity component.
[0297] It should be noted that the prediction process of the above-mentioned decoding unit can refer to the above-mentioned prediction method embodiment, and the prediction process of the above-mentioned encoding unit can refer to the above-mentioned prediction method embodiment. This embodiment will not be described in detail here.
[0298] Please refer to Figure 14, which shows a structural block diagram of a decoder provided in an exemplary embodiment of this application. The decoder may include one or more components such as a processor 1401 and a memory 1402. The components are coupled together via a bus system. It is understood that the bus system is used to implement communication between these components. In addition to a data bus, the bus system also includes a power bus, a control bus, and a status signal bus.
[0299] Memory 1402 is used to store computer programs that can run on processor 1401; processor 1401 is used to execute, when running the computer program:
[0300] Based on reference samples, the filter coefficients of the convolutional cross-component filter are determined, wherein the reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block.
[0301] Based on the filter coefficients and the reconstructed value of the first color component of the current block, a second predicted value of the second color component of the current block is determined.
[0302] It is understood that the memory 1402 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0303] The processor 1401 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the aforementioned prediction method can be completed by the integrated logic circuitry in the hardware of the processor 1401 or by instructions in software form. The processor 1401 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1402. Processor 1401 reads information from memory 1402 and, in conjunction with its hardware, completes the steps of the above method. It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more ASICs, DSPs, digital signal processing devices (DSP Devices, DSPDs), programmable logic devices (PLDs), FPGAs, general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by the processor. The memory can be implemented in the processor or external to the processor. Optionally, as another embodiment, processor 1401 is also configured to execute the prediction method described in any of the foregoing embodiments when running the computer program.
[0304] Please refer to Figure 15, which shows a structural block diagram of an encoder provided in an exemplary embodiment of this application. The encoder may include one or more components such as a processor 1501 and a memory 1502. The various components are coupled together via a bus system. It is understood that the bus system is used to implement communication between these components. In addition to a data bus, the bus system also includes a power bus, a control bus, and a status signal bus.
[0305] Memory 1502 is used to store computer programs that can run on processor 1501; processor 1501 is used to execute, when running the computer program:
[0306] Based on reference samples, the filter coefficients of the convolutional cross-component filter are determined, wherein the reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block.
[0307] Based on the filter coefficients and the reconstructed value of the first color component of the current block, a second predicted value of the second color component of the current block is determined.
[0308] It is understood that the memory 1502 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0309] The processor 1501 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the aforementioned prediction method can be completed by the integrated logic circuitry in the hardware of the processor 1501 or by instructions in software form. The processor 1501 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1502. Processor 1501 reads information from memory 1502 and, in conjunction with its hardware, completes the steps of the above method. It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more ASICs, DSPs, digital signal processing devices (DSP Devices, DSPDs), programmable logic devices (PLDs), FPGAs, general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by the processor. The memory can be implemented in the processor or external to the processor. Optionally, as another embodiment, processor 1501 is also configured to execute the prediction method described in any of the foregoing embodiments when running the computer program.
[0310] This application also provides a non-volatile computer-readable storage medium for storing a bitstream, which is generated by using a prediction method of an encoder, or decoded by using a prediction method of a decoder, wherein the prediction method is the prediction method described in the above embodiments.
[0311] This application also provides a computer program product, which includes computer instructions stored in a computer-readable storage medium. A processor retrieves the computer instructions from the computer-readable storage medium and executes the computer instructions to implement the prediction method as described in the above embodiments.
[0312] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0313] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A prediction method applied to a decoder, characterized in that, The method includes: Based on reference samples, the filter coefficients of the convolutional cross-component filter are determined, wherein the reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block. Based on the filter coefficients and the reconstructed value of the first color component of the current block, a second predicted value of the second color component of the current block is determined.
2. The method of claim 1, wherein, The process of determining the filter coefficients of the convolutional cross-component filter based on reference samples includes: Parse the bitstream to determine the first and second syntax elements; When the value of the first syntax element indicates that the current block convolution cross-component prediction is enabled, and the value of the second syntax element indicates that the current block sub-block transformation is enabled, the filter coefficients of the convolution cross-component filter are determined based on the reference sample.
3. The method according to claim 1 or 2, characterized in that, The method includes: Parse the bitstream to obtain the third syntax element, the value of which is used to indicate the sub-block transformation mode of the current block; The reference sample in the first prediction block is determined based on the value of the third syntax element.
4. The method of claim 3, wherein, Determining the reference sample in the first prediction block based on the value of the third syntax element includes: Based on the value of the third syntax element, the location of the residual sub-block region in the first prediction block is determined; Based on the location of the residual sub-block region, the reference sample in the first prediction block is determined.
5. The method of claim 4, wherein, When sub-block transformation of the current block is enabled, determining the location of the residual sub-block region in the first prediction block based on the value of the third syntax element includes: Based on the value of the third syntax element, determine at least one of the division ratio, division direction, and division position of the residual sub-block region; The location of the residual sub-block region is determined based on at least one of the division ratio, the division direction, and the division position.
6. The method of claim 4, wherein, When sub-block transformation of the current block is enabled, determining the location of the residual sub-block region in the first prediction block based on the value of the third syntax element includes: Based on the value of the third syntax element, determine at least one of the division ratio, horizontal position, and vertical position of the residual sub-block region; The location of the residual sub-block region is determined based on at least one of the division ratio, the horizontal position, and the vertical position.
7. The method of claim 4, wherein, Determining the reference sample in the first prediction block based on the location of the residual sub-block region includes: Based on the location of the residual sub-block region, the predicted samples in the first prediction block located outside the residual sub-block region are determined as the reference samples; or... Based on the location of the residual sub-block region, the portion of the predicted samples in the first prediction block located outside the residual sub-block region is determined as the reference sample; or... Based on the location of the residual sub-block region, the predicted samples located outside the residual sub-block region in the first prediction block, and a portion of the predicted samples located within the residual sub-block region, are determined as the reference samples; or... Based on the location of the residual sub-block region, the portion of the predicted samples located outside the residual sub-block region in the first prediction block, and the predicted samples located within the residual sub-block region, are determined as the reference samples; or... Based on the location of the residual sub-block region, the portion of the predicted samples located outside the residual sub-block region in the first prediction block, and the portion of the predicted samples located within the residual sub-block region, are determined as the reference samples.
8. The method of claim 1 or 2, wherein, The method further includes: All predicted samples in the first prediction block of the current block are determined as reference samples.
9. The method according to claim 3 or 8, characterized in that, The method further includes: Parse the bitstream and determine the fourth syntax element. The value of the fourth syntax element is used to indicate the reference sample in the first prediction block based on the value of the third syntax element, or to determine all prediction samples in the first prediction block of the current block as reference samples.
10. The method according to any one of claims 1 to 9, characterized in that, The process of determining the filter coefficients of the convolutional cross-component filter based on reference samples includes: The filter coefficients of the convolutional cross-component filter are determined based on reference samples in the first prediction block of the first color component and reference samples in the first prediction block of the second color component.
11. The method according to any one of claims 1 to 10, characterized in that, Determining the second predicted value of the second color component of the current block based on the filter coefficients and the reconstructed value of the first color component of the current block includes: Based on the predicted samples located in the residual sub-block region of the first prediction block of the first color component and the residual value of the first color component, the reconstructed value of the first color component is determined. Based on the filter coefficients and the reconstructed value of the first color component, the reconstructed value of the first color component is filtered by the convolutional cross-component filter to obtain the second predicted value of the second color component of the current block.
12. The method of claim 11, wherein, The method further includes: The prediction samples located in the residual sub-block region of the first prediction block of the second color component and the second prediction value of the second color component are weighted to obtain the third prediction value of the second color component of the current block; The reconstructed value of the second color component is determined based on the third predicted value of the second color component of the current block and the residual value of the second color component.
13. The method according to any one of claims 1 to 12, characterized in that, The first prediction block is obtained by predicting the current block using either inter-frame prediction mode or intra-frame block copy mode.
14. The method according to any one of claims 1 to 13, characterized in that, The first color component is the luminance component, and the second color component is the chromaticity component.
15. A prediction method applied to an encoder, comprising: The method includes: Based on reference samples, the filter coefficients of the convolutional cross-component filter are determined, wherein the reference samples include at least the prediction samples located outside the residual sub-block region in the first prediction block of at least one color component of the current block. Based on the filter coefficients and the reconstructed value of the first color component of the current block, a second predicted value of the second color component of the current block is determined.
16. The method of claim 15, wherein, The method further includes: If the first rate-distortion cost is less than the second rate-distortion cost, the values of the first syntax element and the second syntax element are encoded into the bitstream. The first rate-distortion cost is the rate-distortion cost when convolutional cross-component prediction is enabled and sub-block transformation is enabled in the current block. The second rate-distortion cost is the rate-distortion cost when convolutional cross-component prediction and / or sub-block transformation is disabled in the current block. The value of the first syntax element is used to indicate that convolutional cross-component prediction is enabled in the current block, and the value of the second syntax element is used to indicate that sub-block transformation is enabled in the current block.
17. The method according to claim 15 or 16, characterized in that, The method further includes: Determine a third syntax element, the value of which is used to indicate the sub-block transformation mode of the current block; The reference sample in the first prediction block is determined based on the value of the third syntax element.
18. The method of claim 17, wherein, Determining the reference sample in the first prediction block based on the value of the third syntax element includes: Based on the value of the third syntax element, the location of the residual sub-block region in the first prediction block is determined; Based on the location of the residual sub-block region, the reference sample in the first prediction block is determined.
19. The method of claim 18, wherein, When sub-block transformation of the current block is enabled, determining the location of the residual sub-block region in the first prediction block based on the value of the third syntax element includes: Based on the value of the third syntax element, determine at least one of the division ratio, division direction, and division position of the residual sub-block region; The location of the residual sub-block region is determined based on at least one of the division ratio, the division direction, and the division position.
20. The method of claim 18, wherein, When sub-block transformation of the current block is enabled, determining the location of the residual sub-block region in the first prediction block based on the value of the third syntax element includes: Based on the value of the third syntax element, determine at least one of the division ratio, horizontal position, and vertical position of the residual sub-block region; The location of the residual sub-block region is determined based on at least one of the division ratio, the horizontal position, and the vertical position.
21. The method of claim 18, wherein, Determining the reference sample in the first prediction block based on the location of the residual sub-block region includes: Based on the location of the residual sub-block region, the predicted samples in the first prediction block located outside the residual sub-block region are determined as the reference samples; or... Based on the location of the residual sub-block region, the portion of the predicted samples in the first prediction block located outside the residual sub-block region is determined as the reference sample; or... Based on the location of the residual sub-block region, the predicted samples located outside the residual sub-block region in the first prediction block, and a portion of the predicted samples located within the residual sub-block region, are determined as the reference samples; or... Based on the location of the residual sub-block region, the portion of the predicted samples located outside the residual sub-block region in the first prediction block, and the predicted samples located within the residual sub-block region, are determined as the reference samples; or... Based on the location of the residual sub-block region, the portion of the predicted samples located outside the residual sub-block region in the first prediction block, and the portion of the predicted samples located within the residual sub-block region, are determined as the reference samples.
22. The method of claim 15 or 16, wherein, The method further includes: All predicted samples in the first prediction block of the current block are determined as reference samples.
23. The method of claim 17 or 22, wherein, The method further includes: The third rate-distortion cost and the fourth rate-distortion cost are determined. The third rate-distortion cost is the rate-distortion cost when the reference sample in the first prediction block is determined based on the value of the third syntax element. The fourth rate-distortion cost is the rate-distortion cost when all prediction samples in the first prediction block of the current block are determined as reference samples. Based on the comparison result of the third rate-distortion cost and the fourth rate-distortion cost, the value of the fourth syntax element is encoded into the bitstream. The value of the fourth syntax element is used to indicate the determination of the reference sample in the first prediction block based on the value of the third syntax element, or to determine all prediction samples in the first prediction block of the current block as reference samples.
24. The method of any one of claims 15 to 23, wherein, The process of determining the filter coefficients of the convolutional cross-component filter based on reference samples includes: The filter coefficients of the convolutional cross-component filter are determined based on reference samples in the first prediction block of the first color component and reference samples in the first prediction block of the second color component.
25. The method of any one of claims 15 to 24, wherein, Determining the second predicted value of the second color component of the current block based on the filter coefficients and the reconstructed value of the first color component of the current block includes: Based on the predicted samples located in the residual sub-block region of the first prediction block of the first color component and the residual value of the first color component, the reconstructed value of the first color component is determined. Based on the filter coefficients and the reconstructed value of the first color component, the reconstructed value of the first color component is filtered by the convolutional cross-component filter to obtain the second predicted value of the second color component of the current block.
26. The method of claim 25, wherein, The method further includes: The prediction samples located in the residual sub-block region of the first prediction block of the second color component and the second prediction value of the second color component are weighted to obtain the third prediction value of the second color component of the current block; The reconstructed value of the second color component is determined based on the third predicted value of the second color component of the current block and the residual value of the second color component.
27. The method of any one of claims 15 to 26, wherein, The first prediction block is obtained by predicting the current block using either inter-frame prediction mode or intra-frame block copy mode.
28. The method of any one of claims 15 to 27, wherein, The first color component is the luminance component, and the second color component is the chromaticity component.
29. A prediction device, characterized by The device includes: A decoding unit is used to determine the filter coefficients of a convolutional cross-component filter based on reference samples, said reference samples including at least one prediction sample in the first prediction block of at least one color component of the current block located outside the residual sub-block region; The decoding unit is further configured to determine a second predicted value of the second color component of the current block based on the filter coefficients and the reconstructed value of the first color component of the current block.
30. A prediction device, characterized by The device includes: The encoding unit is used to determine the filter coefficients of the convolutional cross-component filter based on reference samples, said reference samples including at least one prediction sample in the first prediction block of at least one color component of the current block located outside the residual sub-block region; The encoding unit is further configured to determine a second predicted value of the second color component of the current block based on the filter coefficients and the reconstructed value of the first color component of the current block.
31. A decoder, comprising: The decoder includes a memory and a processor, the memory for storing a computer program running on the processor; the processor, when running the computer program, is used to execute the prediction method as described in any one of claims 1 to 14.
32. An encoder comprising: The encoder includes a memory and a processor, the memory for storing a computer program running on the processor; the processor, when running the computer program, is used to execute the prediction method as described in any one of claims 15 to 28.
33. A non-transitory computer readable storage medium storing a bitstream, wherein, The bitstream is generated by using a prediction method of an encoder, or the bitstream is decoded by using a prediction method of a decoder, wherein the prediction method includes the prediction method as described in any one of claims 1 to 14, or the prediction method includes the prediction method as described in any one of claims 15 to 28.
34. A computer program product, characterised in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor retrieving the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to implement the prediction method as described in any one of claims 1 to 14, or the prediction method as described in any one of claims 15 to 28.
