Encoding and decoding method, code stream, decoder, encoder, and storage medium

By adopting a cross-component prediction mode based on chroma intra-block replication technology in TSCPM, and using the reference motion vector of isometric luminance blocks to determine the cross-component prediction model, the problem that existing TSCPMs cannot flexibly cope with complex codec scenarios, and improve the codec efficiency of chroma blocks.

WO2025118292A1PCT designated stage expired Publication Date: 2025-06-12GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/137583
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-12

AI Technical Summary

Technical Problem

When deriving across component linear models, existing TSCPM only uses reconstructed pixels in adjacent rows and columns of the current chromaticity block as the source, resulting in the inability to flexibly deal with complex encoding and decoding scenarios, reducing the encoding and decoding efficiency of the chromaticity block.

Method used

By analyzing the code stream, the first syntax identification information is determined. If the current chromaticity block is instructed to adopt a cross-component prediction mode based on chroma intra-block copying technology, the reference motion vector is determined based on the iso-luminance block, and in an effective case, the cross-component prediction model is determined based on the reference luminance block and the chromaticity block corresponding to the reference motion vector, and the predicted chromaticity value of the predicted chromaticity block is determined.

Benefits of technology

The flexibility and diversity of determining cross-component prediction models is improved, so that the model can respond more flexibly to complex codec scenarios, thereby improving the codec efficiency of chroma blocks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023137583_12062025_PF_FP_ABST
    Figure CN2023137583_12062025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an encoding and decoding method, a code stream, a decoder, an encoder, and a storage medium. The method at a decoding end comprises: parsing a code stream, and determining first syntax identification information; when the first syntax identification information indicates that a current chroma block uses a cross-component prediction mode based on a chroma intra block copy technology, on the basis of a current co-located luma block corresponding to the current chroma block, determining a reference motion vector; when the reference motion vector is valid, on the basis of a reference luma block and a reference chroma block corresponding to the reference motion vector, determining a cross-component prediction model; on the basis of the cross-component prediction model, determining a predicted chroma value of a predicted chroma block; and on the basis of the predicted chroma value of the predicted chroma block, determining a reconstructed chroma value of the current chroma block. Thus, the present application improves the flexibility and diversity of determining the cross-component prediction model such that the cross-component prediction model can flexibly cope with more complex encoding and decoding scenarios, thereby improving the encoding and decoding efficiency of the current chroma block.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, code stream, decoder, encoder and storage medium Technical Field

[0001] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, a decoder, an encoder, and a storage medium. Background Art

[0002] Based on the reference software test platform of the latest video coding standard AVS3, a two-step cross-component prediction mode (TSCPM) is proposed. TSCPM is an inter-component prediction technology that removes redundancy between components by exploring the linear relationship between different components.

[0003] On the exploration software platform of the new generation video coding standard AVS4, a chroma block copy intra-frame prediction mode is proposed. Under this scheme, the chroma block can directly use the block vector or string vector of the luminance co-located block for motion compensation without the need for additional motion estimation. The final chroma prediction value is obtained by copying the chroma reconstruction value pointed to by the block motion vector.

[0004] Currently, when TSCPM deduces a cross-component linear model, it typically uses the reconstructed pixels in the adjacent row and column of the current chrominance block as the model derivation information source. This results in the current TSCPM being unable to flexibly cope with more complex encoding and decoding scenarios, thereby reducing the encoding and decoding efficiency of chrominance blocks.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a coding and decoding method, a code stream, a decoder, an encoder, and a storage medium, which can improve the coding and decoding efficiency of chroma blocks.

[0007] The technical solution of the embodiment of the present application can be implemented as follows:

[0008] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:

[0009] Parsing the code stream to determine first syntax identification information;

[0010] When the first syntax identification information indicates that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology, determining a reference motion vector according to a current co-located luminance block corresponding to the current chroma block;

[0011] When the reference motion vector is valid, determining a cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector;

[0012] Determining a predicted chroma value for a predicted chroma block based on the cross-component prediction model;

[0013] Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0014] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:

[0015] Determine a reference motion vector based on a current co-located luminance block corresponding to the current chrominance block;

[0016] When the reference motion vector is valid, determining the cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector;

[0017] Determining a predicted chroma value of a predicted chroma block based on the cross-component prediction model, and determining first syntax identification information according to the predicted chroma value; wherein the first syntax identification information is used to indicate whether the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technology;

[0018] Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0019] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:

[0020] The value of the first syntax identification information, the value of the second syntax identification information, the value of the third syntax identification information, and the quantized chroma residual value of the current chroma block; wherein the first syntax identification information is used to indicate whether the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology; the second syntax identification information is used to indicate whether the current chroma block adopts the chroma intra-frame block copy prediction mode; the third syntax identification information is used to indicate whether the current chroma block adopts the chroma intra-frame block copy prediction mode or the cross-component prediction mode based on the chroma intra-frame block copy technology.

[0021] In a fourth aspect, an embodiment of the present application provides a decoder, comprising a decoding part and a first determining part, wherein:

[0022] The decoding part is configured to parse the code stream and determine the first syntax identification information;

[0023] The first determining portion is configured to determine a reference motion vector according to a current co-located luma block corresponding to the current chroma block when the first syntax identification information indicates that the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technique;

[0024] When the reference motion vector is valid, determining a cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector;

[0025] Determining a predicted chroma value for a predicted chroma block based on the cross-component prediction model;

[0026] Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0027] In a fifth aspect, an embodiment of the present application provides an encoder, comprising a second determining part, wherein:

[0028] The second determining portion is configured to determine a reference motion vector based on a current co-located luminance block corresponding to the current chrominance block;

[0029] When the reference motion vector is valid, determining the cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector;

[0030] Determining a predicted chroma value of a predicted chroma block based on the cross-component prediction model, and determining first syntax identification information according to the predicted chroma value; wherein the first syntax identification information is used to indicate whether the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technology;

[0031] Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0032] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a first memory and a first processor, wherein:

[0033] The first memory is configured to store a computer program that can be executed on the first processor;

[0034] The first processor is configured to execute the method according to the first aspect when running the computer program.

[0035] In a seventh aspect, an embodiment of the present application provides an encoder, comprising a second memory and a second processor, wherein:

[0036] The second memory is configured to store a computer program that can be executed on the second processor;

[0037] The second processor is configured to execute the method according to the second aspect when running the computer program.

[0038] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the method described in the first aspect or the second aspect.

[0039] The embodiments of the present application provide a coding and decoding method, a code stream, a decoder, an encoder, and a storage medium. At the decoding end, the code stream is parsed to determine first syntax identification information; when the first syntax identification information indicates that the current chroma block adopts a cross-component prediction mode based on the chroma intra-frame block copy technology, a reference motion vector is determined based on the current co-located luminance block corresponding to the current chroma block; when the reference motion vector is valid, a cross-component prediction model is determined based on the reference luminance block and the reference chroma block corresponding to the reference motion vector; based on the cross-component prediction model, a predicted chroma value of the predicted chroma block is determined; and based on the predicted chroma value of the predicted chroma block, a reconstructed chroma value of the current chroma block is determined. At the encoding end, a reference motion vector is determined based on the current co-located luminance block corresponding to the current chrominance block; when the reference motion vector is valid, a cross-component prediction model is determined based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector; based on the cross-component prediction model, a predicted chrominance value of the predicted chrominance block is determined, and based on the predicted chrominance value, first syntax identification information is determined; wherein the first syntax identification information is used to indicate whether the current chrominance block adopts a cross-component prediction mode based on the chrominance intra-frame block copy technology; based on the predicted chrominance value of the predicted chrominance block, a reconstructed chrominance value of the current chrominance block is determined. Since the cross-component prediction model is determined by the reference luminance block and the reference chrominance block corresponding to the reference motion vector, compared to the cross-component prediction model derived from the reconstructed pixels of the adjacent row and column of the current chrominance block, the flexibility and diversity of determining the cross-component prediction model can be improved, so that the cross-component prediction model can flexibly cope with more complex encoding and decoding scenarios, thereby improving the encoding and decoding efficiency of the current chrominance block. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] FIG1a is a schematic diagram 1 of an optional method of adopting the YCbCr color space provided in an embodiment of the present application;

[0041] FIG1b is a second schematic diagram of an optional method of adopting the YCbCr color space provided in an embodiment of the present application;

[0042] FIG1c is a third schematic diagram of an optional method of adopting the YCbCr color space provided in an embodiment of the present application;

[0043] FIG1d is a fourth schematic diagram of an optional method of adopting the YCbCr color space provided in an embodiment of the present application;

[0044] FIG2 is a schematic block diagram of an optional encoder provided in an embodiment of the present application;

[0045] FIG3 is a block diagram of an optional decoder according to an embodiment of the present application;

[0046] FIG4 is a schematic diagram of a network architecture of an optional encoding and decoding system provided in an embodiment of the present application;

[0047] FIG5 is a schematic diagram of a flow chart of an optional two-step cross-component prediction mode provided in an embodiment of the present application;

[0048] FIG6a is a schematic diagram 1 of an optional method for selecting adjacent reference sample points provided in an embodiment of the present application;

[0049] FIG6 b is a second schematic diagram of an optional method for selecting adjacent reference sample points provided in an embodiment of the present application;

[0050] FIG6 c is a third schematic diagram of an optional method for selecting adjacent reference sample points provided in an embodiment of the present application;

[0051] FIG6 d is a fourth schematic diagram of an optional method for selecting adjacent reference sample points provided in an embodiment of the present application;

[0052] FIG6e is a fifth schematic diagram of an optional method for selecting adjacent reference sample points provided in an embodiment of the present application;

[0053] FIG7 is a schematic diagram of an optional template selection method for adjacent blocks provided in an embodiment of the present application;

[0054] FIG8 is a schematic diagram of an optional method for selecting luminance samples of a cross-component nonlinear prediction model provided in an embodiment of the present application;

[0055] FIG9 is a schematic diagram of a reference motion vector of an optional intra block copy prediction technique provided by an embodiment of the present application;

[0056] FIG10 is a schematic diagram of a luma co-located block in an optional chroma block copy intra prediction mode provided in an embodiment of the present application;

[0057] FIG11 is a schematic flow chart of an optional decoding method provided in an embodiment of the present application;

[0058] FIG12a is a schematic diagram of an optional reference luminance block provided in an embodiment of the present application;

[0059] FIG12 b is a schematic diagram of an optional reference chromaticity block provided in an embodiment of the present application;

[0060] FIG13a is a schematic diagram of an optional preset sample point selection method provided in an embodiment of the present application;

[0061] FIG13b is a second schematic diagram of an optional preset sample point selection method provided in an embodiment of the present application;

[0062] FIG13c is a third schematic diagram of an optional preset sample point selection method provided in an embodiment of the present application;

[0063] FIG13d is a fourth schematic diagram of an optional preset sample point selection method provided in an embodiment of the present application;

[0064] FIG13e is a fifth schematic diagram of an optional preset sample point selection method provided in an embodiment of the present application;

[0065] FIG14 is a schematic diagram of an optional multiple cross-component prediction sub-model provided in an embodiment of the present application;

[0066] FIG15 is a schematic diagram of an optional six-tap filter provided in an embodiment of the present application;

[0067] FIG16 is a schematic diagram of a flow chart of an optional encoding method provided in an embodiment of the present application;

[0068] FIG17 is a schematic diagram of the composition structure of an optional decoder provided in an embodiment of the present application;

[0069] FIG18 is a schematic diagram of a specific hardware structure of an optional decoder provided in an embodiment of the present application;

[0070] FIG19 is a schematic diagram of the composition structure of an optional encoder provided in an embodiment of the present application;

[0071] FIG20 is a schematic diagram of a specific hardware structure of an optional encoder provided in an embodiment of the present application;

[0072] FIG21 is a schematic diagram of the composition structure of an optional encoding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0073] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0074] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0075] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0076] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0077] Digital video compression technology primarily compresses large amounts of digital video data for easier transmission and storage. In other words, digital video compression reduces the amount of video data to save storage space and transmission bandwidth. Video data typically takes up a large amount of space, and compression technology can effectively reduce file size while maintaining imperceptible quality loss to the human eye. With the surge in internet video and the increasing demand for higher video clarity, while existing digital video compression standards can save significant video data, there is still a need for better digital video compression technologies to reduce the bandwidth and traffic pressure of digital video transmission.

[0078] Video compression typically relies on specific coding standards. Common video coding standards include H.264 / AVC, H.265 / HEVC, VP9, ​​and AV1. These standards define video compression algorithms and specifications to ensure compatibility across different devices. Video compression technologies are primarily categorized as intra-frame compression and inter-frame compression. Intra-frame compression relies on encoding individual video frames, while inter-frame compression exploits similarities between frames. Motion compensation is a key technique in inter-frame compression. By detecting motion between adjacent frames and predicting pixel positions based on this motion information, data size can be reduced while maintaining video quality. Quantization is the process of mapping pixel values ​​in an image or video to a smaller set, thereby reducing the range of data representation. Entropy coding further reduces data size by utilizing statistical information in the data to optimize the encoding process. Adjacent pixels in a video often exhibit spatial and temporal correlations. Compression algorithms exploit these correlations to reduce data redundancy through prediction and differential coding. Compression technologies typically allow users to choose different resolutions and bit rates while maintaining acceptable quality. This allows for better adaptation to diverse storage and transmission requirements. Certain applications, such as video conferencing and real-time surveillance, require high real-time video transmission. Consequently, some compression standards and technologies focus on providing low-latency solutions. Overall, digital video compression technology has been widely used in the multimedia field, impacting not only the efficiency of video storage and transmission but also the user experience of video applications.

[0079] Video compression includes multiple modules, including intra-frame prediction (spatial domain) and inter-frame prediction (temporal domain) to reduce or remove inherent redundancy in video, quantization and inverse quantization of residual information, and loop filtering and entropy coding to improve subjective and objective reconstruction quality. Most mainstream video compression standards describe block-based compression techniques. A video clip, a frame, or a series of pictures is divided into basic units called CTUs, which are further divided into blocks called CUs. Intra-frame blocks are predicted using neighboring pixels as reference, while inter-frame blocks refer to spatially adjacent blocks and reference information from other frames. In contrast to the prediction signal, the residual information is transformed, quantized, and entropy-coded into a bitstream on a block-by-block basis. These techniques are described in standards and implemented in various areas related to video compression. Internationally, the current mainstream standards include H.264 / Advanced Video Coding (AVC), H.265 / High Efficiency Video Coding (HEVC) standard, H.266 / Versatile Video Coding (VVC) and extensions of these standards. Video devices can achieve more efficient video encoding and decoding and transmission and storage by implementing these technologies.

[0080] In some embodiments, digital video is a video recorded in digital form, which is composed of a series of digital images, each image is composed of several rows and columns of pixels, and each pixel is represented by a digital value. In order to express the colors observed by the human eye, people have defined a series of different color models from a mathematical model, including RGB, YUV, etc. In order to project these color models into corresponding mathematical expressions, different color spaces are generated according to different processing methods and storage formats of different color data. Color space is a specific form of color organization, which defines a way to represent and organize color information. Different color spaces use different coordinate systems or parameters to describe colors, which makes it easy to represent, edit, analyze and process colors.

[0081] In some embodiments, the color space includes RGB format (Red Green Blue), YUV format (Luminance-Chrominance-Saturation), HSV format (Hue-Saturation-Value), Lab format and CMYK format (Cyan-Magenta-Yellow-Key). It should be noted that each of the above-mentioned color spaces has its own specific application fields and advantages, and the selection of an appropriate color space depends on specific needs and application scenarios. In practical applications, in the fields of image processing, computer vision and multimedia, it is often necessary to convert and process between different color spaces to meet the requirements of different devices and tasks.

[0082] In some embodiments, the RGB color space uses red, green, and blue components to represent color, with each component typically ranging from 0 to 255. The RGB color space is widely used in computer graphics and display technology, for displays, cameras, digital images, and more. While RGB is intuitive and easy to process and display, the RGB color space may differ slightly across different devices and standards.

[0083] In some embodiments, the YUV color space includes three components: luminance (Y) and chrominance (U, V), representing brightness and chrominance information, respectively. The YUV color space is primarily used in video encoding, such as H.264 and H.265. The separation of chrominance information makes it easier to remove color details that are not easily perceived by the human eye when compressing video. The YUV color space is suitable for video encoding, separating luminance and chrominance, improving compression efficiency.

[0084] In some embodiments, the HSV color space describes color using three parameters: hue, saturation, and value. The HSV color space is primarily used in image editing and graphic design because it better aligns with human color perception. The HSV color space is intuitive and easy to understand and adjust colors. Hue indicates the type of color, saturation indicates the purity of the color, and value indicates the brightness of the color.

[0085] In some embodiments, the Lab color space includes luminance (L) and two chromaticity components (a and b). The Lab color space is used to describe color differences as perceived by human vision and is device-independent. The Lab color space can more accurately describe color differences and is widely used in applications such as color matching and color correction.

[0086] In some embodiments, the CMYK color space uses four color components: cyan, magenta, yellow, and black, which respectively represent the ink content of the ink cartridge. The CMYK color space is mainly used in the printing field to define printing colors. The CMYK color space is suitable for the printing process. Various colors can be obtained by adjusting the content of different color components.

[0087] In some embodiments, the color object is an objective object. Different color spaces only measure the same object from different perspectives and do not change the nature of the color object. The color organization methods of color spaces are diverse and varied. According to incomplete statistics, there are 40 different models, the most common of which are RGB, CMY(K), HSI, YUV, YIQ, YCbCr, etc. Among them, the models based on the three primary colors are mainly RGB and CMY(K), and the models based on brightness and chromaticity are mainly HSI, YUV, YIQ, and YCbCr. The main uses of different color space models are also different. RGB is mainly used in display systems, CMY(K) is mainly used in printers, YUV is used for PAL color TVs, YIQ is used for NTSC color TVs, and YCbCr is used for digital color TVs. Currently, the YCbCr color space is the primary representation of digital video encoding sources. Y represents brightness, or grayscale values, Cb represents the difference between the blue signal and the brightness value, and Cr represents the difference between the red signal and the brightness value. This format separates brightness information from color information, exploiting the human eye's sensitivity to brightness and insensitivity to chrominance to compress some color information, thereby reducing bandwidth. YCbCr has many sampling formats, such as 4:4:4, 4:2:2, 4:1:1, and 4:2:0.

[0088] Figure 1a shows a sampling ratio of 4:4:4, Figure 1b shows a sampling ratio of 4:2:2, Figure 1c shows a sampling ratio of 4:1:1, and Figure 1d shows a sampling ratio of 4:2:0. A sampling ratio of 4:4:4 means that the luma (Y) component and the chroma (Cb and Cr) components are sampled per pixel both horizontally and vertically, meaning each pixel has independent chroma and luma information. This 4:4:4 sampling method preserves the highest possible color information and is suitable for scenes requiring high color accuracy, but it also requires more storage and transmission bandwidth. A sampling ratio of 4:2:2 means that the luma (Y) component is sampled at a rate of 4 pixels per row, while the chroma (Cb and Cr) components are sampled at a rate of 2 pixels per row. Specifically, with a sampling ratio of 4:4:4, the Y component is sampled only once for every 4 pixels in the horizontal direction, meaning that luma information is shared for every group of 4 pixels. The Cb and Cr components are sampled only once for every two pixels horizontally, meaning that chrominance information is shared for every two pixels. This reduces the sampling rate of the chrominance components compared to a 4:4:4 sampling scheme, thereby reducing data size and saving storage and transmission bandwidth. A 4:1:1 sampling scheme means that the luma (Y) component is sampled horizontally at every pixel, while the chrominance (Cb and Cr) components are sampled horizontally at every fourth pixel. This means that each pixel has independent luma information, while every four pixels share a set of chrominance information. A 4:1:1 sampling scheme also results in a lower sampling rate for the chrominance components than a 4:2:2 sampling scheme, reducing data size and saving storage and transmission bandwidth. A 4:2:0 sampling scheme means that the luma (Y) component is sampled horizontally and vertically at every pixel, while the chrominance (Cb and Cr) components are sampled every two pixels horizontally and every two rows vertically. This means that every pixel has independent luma information, while every four pixels share a set of chrominance information. The 4:2:0 sampling method has a lower sampling rate for the chrominance component than the 4:4:4 sampling method, which can significantly reduce the amount of data and is suitable for video compression and transmission.

[0089] To explore the next generation of digital video compression technology, a two-step cross-component prediction mode (TSCPM) was proposed based on the VVC Test Model (VTM), a reference software test platform for the latest video coding standard H.266 / VVC. TSCPM is an inter-component prediction technique that removes redundancy between components by exploring the linear relationships between them. The TSCPM workflow consists of the following two steps:

[0090] 1) Luma Prediction

[0091] First, the luma block corresponding to the chroma block to be encoded is used. Using the linear model parameters α and β and the reference samples of the luma block, a temporary luma prediction block of the same size is calculated. The goal of this step is to establish a linear relationship between the luma and chroma components. The linear model parameters α and β are calculated by analyzing the reference samples of the luma block and the corresponding chroma reference samples.

[0092] 2) Chroma Prediction

[0093] After the luma prediction is complete, the temporary luma prediction block is downsampled to obtain the corresponding chroma prediction value. The downsampling operation usually involves manipulating the luma block horizontally and vertically to match the resolution of the chroma components. The result of the downsampling is used to generate the prediction block of the chroma components, which will be used for intra prediction.

[0094] In general, TSCPM establishes a linear relationship between luma and chroma components, first predicting luma and then downsampling the chroma to achieve efficient prediction of the chroma components. This approach helps improve video coding efficiency, reduce data redundancy, and enhance compression performance. TSCPM is primarily used in modern video coding standards such as H.264 and H.265.

[0095] Currently, video compression technology is based on traditional block-based coding and decoding, which can include multiple modules, such as block partitioning, intra-frame prediction, inter-frame prediction, transformation, quantization, entropy coding, loop and post-processing filtering, etc. The embodiment of the present application mainly improves the prediction part to enhance the coding performance of TSCPM.

[0096] Here, the prediction part can include multiple technologies, including luma prediction mode and chroma prediction mode.

[0097] Referring to Figure 2, which shows a schematic block diagram of the composition of an encoder provided in an embodiment of the present application. As shown in Figure 2, the encoder 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109 and a decoded image cache unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding on the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is the process of generating a motion vector, which can estimate the motion of the video coding block. The motion compensation unit 104 then calculates the motion vector based on the motion vector determined by the motion estimation unit 105. After determining the intra-frame prediction mode, the intra-frame prediction unit 103 is further configured to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109. In addition, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block and reconstruct a residual block in the pixel domain. The reconstructed residual block is subjected to the filter control analysis unit 107 and the filtering unit 108 to remove the block effect artifacts. The reconstructed residual block is then added to a predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video coding block. The encoding unit 109 is configured to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode, and output the code stream of the video signal. The decoded image buffer unit 110 is configured to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .

[0098] Refer to Figure 3, which shows a schematic block diagram of the composition of a decoder provided by an embodiment of the present application. As shown in Figure 3, the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205 and a decoded image cache unit 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is encoded and processed in Figure 2, the code stream of the video signal is output; the code stream is input to the decoder 200, and first passes through the decoding unit 201 to obtain the decoded transform coefficient; the transform coefficient is processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data of the current video decoding block based on the determined intra-frame prediction mode and the data of the previously decoded block from the current frame or picture; the motion compensation unit 204 is to determine the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and use The prediction information is used to generate a predictive block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0099] Furthermore, the embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder, wherein FIG4 shows a schematic diagram of a network architecture of a coding and decoding system provided by the embodiment of the present application. As shown in FIG4 , the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic device can be various types of devices with video coding and decoding functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a server, etc., which is not specifically limited in the embodiment of the present application. Here, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.

[0100] It should be noted that the method of the embodiment of the present application is mainly applied to the prediction part shown in Figure 4 and the prediction part shown in Figure 3. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, and can even be applied to both the encoder and the decoder simultaneously, but the embodiment of the present application is not specifically limited to this. In addition, the prediction part here can include the intra-frame prediction part and the inter-frame prediction part.

[0101] It should also be noted that on the encoding side, the "current block" specifically refers to the coding block currently undergoing chroma prediction; on the decoding side, the "current block" specifically refers to the decoding block currently undergoing chroma prediction. Here, the current block can be a coding unit (CU), a coding tree unit (CTU), or even a prediction unit (PU) or a transform unit (TU), without specific limitations here.

[0102] To facilitate understanding of the technical solutions of the embodiments of the present application, the relevant technologies of the embodiments of the present application are described below. The following relevant technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all fall within the protection scope of the embodiments of the present application.

[0103] 1. Two-step cross-component prediction mode

[0104] Two-step cross-component prediction mode (TSCPM) is an inter-component prediction technology that removes inter-component redundancy by exploring the linear relationship between different components. TSCPM is performed in two steps, as shown in Figure 5. First, the luminance block corresponding to the current chrominance block to be encoded (i.e., the co-located luminance reconstruction block) is used to generate a temporary prediction block of the same size (i.e., the intermediate predicted chrominance block) (Temporary Chroma Prediction Block) through parameters α and β, and then down-sampled to obtain the predicted value of the chrominance component (i.e., the final predicted chrominance block) (Final Chroma Prediction Block). Among them, the co-located luminance reconstruction block can be expressed as R L (x,y), the intermediate predicted chroma block can be expressed as P' c (x,y)=α*R L (x,y)+β, the final predicted chrominance block can be expressed as P c (x,y).

[0105] 1) Linear Model

[0106] In some embodiments, the numerical values of the linear model parameters α and β are approximately calculated from the reconstructed luminance reference samples and the corresponding chrominance reference samples of the previous reference row and the left reference column of the current coding block. The specific derivation process is as follows:

[0107] First, according to the availability of the pixels in the adjacent blocks, it is divided into three cases to obtain four available pixel pairs. Alpha and beta are calculated through the four available pixel pairs. After obtaining alpha and beta, according to the linear relationship between luminance and chrominance, the chrominance prediction value is obtained through the luminance reconstructed pixels.

[0108] In some embodiments, when selecting four pairs of available pixels, the availability of the upper pixels and the left pixels needs to be considered, which is divided into the following three cases:

[0109] Case 1: If both the directly above pixel and the directly left pixel of the current block are "available", then two pixel pairs are selected from the above, and two pixel pairs are selected from the left.

[0110] Case 2: If only the above of the current block is available, then all four pixel pairs are selected from the directly above, and the selected positions are at widths of: 0 / 4, 1 / 4, 2 / 4, 3 / 4.

[0111] Case 3: If only the left pixel of the current block is available, then all four pixel pairs are selected from the directly left, and the selected positions are at heights of: 0 / 4, 1 / 4, 2 / 4, 3 / 4.

[0112] In some embodiments, assume that the size of the chrominance block to be encoded is WxH, its width is W, and its height is H. Define its upper reference row and left reference column as row[i] (0 <= i <= M - 1) and col[j] (0 <= j <= N - 1) respectively. Then, the selection methods of the adjacent reference sample points x[k] (0 <= k <= 4) are as follows:

[0113] Case 1: When both row[i] and col[j] are "available":

[0114] ● As shown in Figure 6a, when W = H: x[0] = row[0], x[1] = row[W - 1], x[3] = col[0], x[4] = col[H - 1];

[0115] ● As shown in Figure 6b, when W > H: x[0] = row[0], x[1] = row[W - W / H], x[3] = col[0], x[4] = col[H - 1];

[0116] ● As shown in Figure 6c, when W < H: x[0] = row[0], x[1] = row[W - 1], x[3] = col[0], x[4] = col[H - H / W].

[0117] Case 2: As shown in Figure 6d, when row[i] is "available" and col[j] is "unavailable": x[0] = row[0], x[1] = row[W / 4], x[3] = row[2×W / 4], x[4] = row[3×W / 4].

[0118] Case 3: As shown in Figure 6e, when row[i] is "unavailable" and col[j] is "available": x[0] = col[0], x[1] = col[H / 4], x[3] = col[2×H / 4], x[4] = col[3×H / 4].

[0119] In some embodiments, after obtaining four adjacent reference sample points, four quick comparisons are performed to obtain two points with larger luminance values ​​and two points with smaller luminance values. The mean points of these two groups are then used to derive linear model parameters. Assuming that the mean point value of the two points with larger luminance values ​​is xMax, and the mean point value of the two points with smaller luminance values ​​is xMin, similarly, the larger and smaller mean points of the corresponding chromaticity points can be obtained, represented by yMax and yMin, respectively. The value of α is then (yMax-yMin) / (xMax-xMin), and the value of M is yMin-α*xMin. In actual implementation, the division method for calculating the value of α can be replaced by a lookup table to reduce implementation complexity, while adding a shift precision value (shift) to ensure calculation accuracy.

[0120] In some embodiments, when both row[i] and col[j] are "unavailable", the default values ​​are used, where the default value of α is 0 and the default value of β is 1<<(BitDepth-1), where BitDepth represents the bit depth value of the sample.

[0121] In some embodiments, based on the linear model parameters α and β, and the brightness reconstruction pixel value of the corresponding position, an intermediate prediction pixel block of the same size as the corresponding brightness block can be calculated. The calculation process can be shown by formula (1): c ′(x,y)=α×R L (x,y)+β (1)

[0122] In formula (1), (x, y) represents the coordinate position of the pixel point of the chroma block to be encoded, R L (x, y) represents the brightness reconstructed pixel value at coordinate position (x, y) in the same luminance block corresponding to the chrominance block to be encoded, P c ′(x,y) represents the pixel value of the intermediate prediction block.

[0123] In some embodiments, the intermediate predicted pixel values ​​are downsampled, and a six-tap filter [1 2 1; 1 2 1] is used by default to perform downsampling to obtain the final predicted pixel value of the chroma block to be encoded. The calculation process can be shown by formula (2): c (x,y)=(2×P′ c (2x,2y)+2×P′ c (2x,2y+1)+P′ c (2x-1,2y)+P′ c (2x+1,2y)+ P′ c (2x-1,2y+1)+P′ c (2x+1,2y-1)+4)>>3 (2)

[0124] In formula (2), P c (x,y) is the predicted pixel value of the chroma block to be encoded.

[0125] 2) Nonlinear Model

[0126] In some embodiments, the nonlinear cross-component model building process may include the following steps:

[0127] Step 1: downsample the luminance of the current block (the same-position luminance block) and the adjacent template area to obtain downsampled luminance samples.

[0128] In some embodiments, the present application uses a 4:2:0 sampling format as an example for illustration, and downsampling in the following generally refers to dividing the width and height by 2 to obtain downsampled brightness samples.

[0129] Step 2: Based on the neighboring templates, a cross-component prediction model of luminance (Y) and chrominance (U / V) is constructed.

[0130] In some embodiments, the template selection method for neighboring blocks is shown in Figure 7. Using the current chroma block (shown as a white area in Figure 7) as a reference, the template is constructed by selecting the upper left (i.e., region A), upper (i.e., region B), upper right (i.e., region C), left (i.e., region D), and lower left (i.e., region E) of the current block. The width of region C is equal to the width of the current block (i.e., W), and the height of region E is equal to the height of the current block (i.e., H). The template width θ is fixed at 6 and will be adaptively adjusted based on the availability of neighboring samples. If the lower right corner of region C (region E) is not reconstructed or exceeds the image boundary, region C (region E) is unavailable.

[0131] In some embodiments, as shown in Figure 8, the model of the cross-component nonlinear prediction model selects the target chroma sample of the current chroma block (i.e., C), the associated position C in the downsampled luminance image, and the downsampled luminance samples around it. The surrounding downsampled luminance samples include: the sample above the associated position C (i.e., N), the sample below the associated position C (i.e., S), the sample to the left of the associated position C (i.e., W), and the sample to the right of the associated position C (i.e., E).

[0132] In some embodiments, to reduce the complexity of template calculation, only a subset of samples in the template region are selected for calculation of the cross-component nonlinear prediction model. Specifically, only samples in the template region whose horizontal and vertical coordinates satisfy the following constraints are selected: i.e., samples whose horizontal and vertical coordinates are not odd. The above process can be expressed as: (x%2==1 &&y%2==1).

[0133] In some embodiments, multiple equations are constructed to solve a linear system of equations to obtain model parameters of the cross-component nonlinear prediction model. The model is solved using an LDL solution method, and the entire process employs an integer calculation process.

[0134] Step 3: Based on the cross-component model, the downsampled luminance samples corresponding to the current block in step 1 are input to obtain the predicted value of chrominance (U / V).

[0135] 2. Intra Block Copy (IBC) prediction technology

[0136] In some embodiments, for screen content sequences such as text and graphics, there are many repetitive textures within the same frame, indicating strong spatial correlation. If the encoding of the current block can reference previously encoded blocks in the current frame, coding efficiency can be greatly improved, taking advantage of the strong spatial correlation of screen images. This technique, which references previously encoded blocks in the current frame and uses them for prediction, is known as IBC. IBC is similar to inter-frame image prediction, except that the prediction block in IBC is generated from reconstructed blocks in the current encoded image frame. As shown in Figure 9, in a coding tree unit (CTU), the white block in the lower right is the current coding unit (CU), and the previously encoded white block in the upper left is the prediction block (PB). The current CU and the prediction block are similar. If the encoder uses a search method to locate the position of the upper left white block, only the block vectors (BV) (i.e., reference motion vectors) of the two blocks need to be transmitted. The decoder can use this information to obtain a more accurate prediction value. Compared to conventional intra-frame prediction methods, IBC can better utilize redundant information within the frame, thereby improving coding performance.

[0137] In some embodiments, a reference (Candidate) matching the current block is found through a hash search or a full search within a maximum range of 64*64.

[0138] In some embodiments, the hash search range is limited to the current CTU and n CTUs to the left of the current CTU, where n varies according to the CTU size. If the CTU size is 128*128, then n is 1.

[0139] In some embodiments, the maximum allowed IBC size in the bitstream is 64*64, but the encoder currently only searches for blocks of 16*16 or less for acceleration.

[0140] In some embodiments, bv is transmitted with integer pixel precision, without bvp prediction.

[0141] In some embodiments, the IBC mode only supports PBs of 2N*2N, but the TB size can be N*N or 2N*2N.

[0142] In some embodiments, because AVS3 does not allow 2*N blocks for chroma, the division of some small blocks of Luma blocks and Chroma blocks is different. If such division inconsistency occurs, the Chroma blocks are consistently restricted to intra mode.

[0143] In some embodiments, if bv is an odd number, then for 420yuv, chroma pixels need to be interpolated, using 1:1 2tap interpolation.

[0144] 3. Chroma block copy intra prediction mode

[0145] In some embodiments, the chroma block copy intra prediction mode is a chroma intra prediction mode. AVS allows the use of a local dual tree block partitioning structure, which allows luminance blocks and chroma blocks to have different partitioning structures. Currently, the minimum length or width of luminance blocks and chroma blocks is at least 4 pixels. When the coding unit performs block partitioning, if the block size after partitioning is less than the minimum value, the partitioning will not be performed. Therefore, it may happen that the chroma block has stopped partitioning while the luminance block continues to be partitioned. Under this block partitioning structure, the luminance block and the chroma block will be encoded separately. In this case, the chroma block is restricted to using only the intra prediction mode. To solve the problem that the IBC technology cannot be used for specific chroma blocks, an IBC prediction scheme specifically for chroma is proposed. Under this scheme, the chroma block can directly use the block vector or string vector of the luminance co-located block for motion compensation, without the need for additional motion estimation. The final chroma prediction value is obtained by copying the chroma reconstruction value pointed to by the block motion vector.

[0146] In some embodiments, the process of chroma block copy intra prediction mode includes the following steps:

[0147] Step 1. As shown in Figure 10, if the luma sample at the position {C, TL, TR, BL, BR} on the luma co-located block corresponding to the CU of the chroma block is in block copy intra prediction mode or a normal string sub-mode of string copy intra prediction, then the current block can use the chroma block copy mode, where C represents the center position, TL represents the upper left position, TR represents the upper right position, BL represents the lower position, and BR represents the lower right position.

[0148] Step 2: If the luma sample has an available displacement vector, the chroma block uses the displacement vector for motion compensation.

[0149] Step 3: Otherwise, if there is at least one available displacement vector among the default displacement vectors {(-w, 0), (0, -h)}, use the first available displacement vector for motion compensation.

[0150] Step 4: Otherwise, if there is no available displacement vector, the prediction value of all samples of the current chroma block is set to 2BitDepth-1, where BitDepth is the coding sample accuracy.

[0151] Step 5: The chroma block encodes a flag cibc_flag in the code stream to indicate whether to use the chroma block copy intra prediction mode.

[0152] In existing technologies, TSCPM uses only the reconstructed pixels in one row and one column adjacent to the current block as the model derivation source when deriving a cross-component linear model. This makes it inflexible for various complex coding scenarios. Consequently, the current TSCPM cannot flexibly handle more complex coding and decoding scenarios, thereby reducing the coding and decoding efficiency of chroma blocks.

[0153] Based on this, an embodiment of the present application provides a coding and decoding method, a code stream, an encoder, a decoder and a storage medium. At the decoding end, the code stream is parsed to determine the first syntax identification information; when the first syntax identification information indicates that the current chroma block adopts a cross-component prediction mode based on the chroma intra-frame block copy technology, the reference motion vector is determined according to the current co-located luminance block corresponding to the current chroma block; when the reference motion vector is valid, the cross-component prediction model is determined based on the reference luminance block and the reference chroma block corresponding to the reference motion vector; based on the cross-component prediction model, the predicted chroma value of the predicted chroma block is determined; according to the predicted chroma value of the predicted chroma block, the reconstructed chroma value of the current chroma block is determined. At the encoding end, a reference motion vector is determined based on the current co-located luminance block corresponding to the current chrominance block; when the reference motion vector is valid, a cross-component prediction model is determined based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector; based on the cross-component prediction model, a predicted chrominance value of the predicted chrominance block is determined, and based on the predicted chrominance value, first syntax identification information is determined; wherein the first syntax identification information is used to indicate whether the current chrominance block adopts a cross-component prediction mode based on the chrominance intra-frame block copy technology; based on the predicted chrominance value of the predicted chrominance block, a reconstructed chrominance value of the current chrominance block is determined. Since the cross-component prediction model is determined by the reference luminance block and the reference chrominance block corresponding to the reference motion vector, compared to the cross-component prediction model derived from the reconstructed pixels of the adjacent row and column of the current chrominance block, the flexibility and diversity of determining the cross-component prediction model can be improved, so that the cross-component prediction model can flexibly cope with more complex encoding and decoding scenarios, thereby improving the encoding and decoding efficiency of the current chrominance block.

[0154] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0155] FIG11 is a flow chart of an optional decoding method provided in an embodiment of the present application. As shown in FIG11 , the method may include S301 to S305:

[0156] S301: parse a code stream to determine first syntax identification information.

[0157] It should be noted that the decoding method of the embodiment of the present application is applied to a decoder. Furthermore, the decoding method may specifically refer to a chroma prediction method. Specifically, within the chroma prediction mode, this mainly addresses a technical improvement to a chroma prediction mode, more specifically, a cross-component prediction mode based on chroma intra-block copying technology within the prediction mode, to avoid the problem in the related art of TSCPM that cannot flexibly cope with more complex encoding and decoding scenarios, thereby reducing the encoding and decoding efficiency of chroma blocks.

[0158] In an embodiment of the present application, the decoder determines first syntax identification information by parsing the bitstream, wherein the first syntax identification information is used to indicate whether the current chroma block adopts a cross-component prediction mode based on the chroma intra block copy technology.

[0159] In the embodiment of the present application, the implementation of parsing the code stream and determining the first syntax identification information in S301 may include the following two situations:

[0160] Case 1: In some embodiments of the present application, the implementation before S301 may include: parsing the code stream to determine the second syntax identification information;

[0161] When the second syntax identification information indicates that the current chroma block does not adopt the chroma intra block copy prediction mode, the step of parsing the code stream to obtain the first syntax identification information is performed.

[0162] In some embodiments of the present application, parsing the code stream and determining the implementation of the second syntax identification information may include:

[0163] If the value of the second syntax identification information is the first value, it is determined that the current chroma block adopts the chroma intra block copy prediction mode; or,

[0164] If the value of the second syntax identification information is the second value, it is determined that the current chroma block does not adopt the chroma intra block copy prediction mode.

[0165] Exemplarily, the second syntax identification information may be represented as cibc_flag.

[0166] It should be noted that in the embodiment of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Specifically, the second syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0167] Exemplarily, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to 0 and the second value can be set to 1; or, the first value can be set to true and the second value can be set to false; or, the first value can be set to false and the second value can be set to true; but this is not specifically limited here.

[0168] In an embodiment of the present application, taking the flag written into the bitstream as an example, assuming that the first value is set to 1 (true) and the second value is set to 0 (false), if the value of the second syntax identification information is 0 (false), then it can be determined that the current chroma block adopts the chroma intra-frame block copy prediction mode, that is, there is no need to execute the decoding method described in the embodiment of the present application; if the value of the second syntax identification information is 1 (true), then it can be determined that the current chroma block does not adopt the chroma intra-frame block copy prediction mode, that is, it may be necessary to execute the decoding method described in the embodiment of the present application.

[0169] It is understood that when the value of the second syntax identification information is the first value, it is determined that the current chroma block adopts the chroma intra block copy prediction mode, and redundant information is reduced through intra block copying, thereby achieving a compression effect. When the value of the second syntax identification information is the second value, it is determined that the current chroma block does not adopt the chroma intra block copy prediction mode, which can avoid or limit the use of chroma intra block copying, improve decoding stability, or avoid performance issues in certain situations.

[0170] In some embodiments of the present application, for situation 1, the implementation of parsing the code stream in S301 and determining the first syntax identification information may include:

[0171] If the value of the first syntax identification information is the third value, it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology; or

[0172] If the value of the first syntax identification information is the fourth value, it is determined that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra block copy technology.

[0173] Exemplarily, the first syntax identification information may be represented as tcibc_flag.

[0174] It should be noted that in the embodiment of the present application, the third value is different from the fourth value, and the third value and the fourth value can be in parameter form or in digital form. Specifically, the first syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0175] Exemplarily, for the third value and the fourth value, the third value can be set to 1 and the fourth value can be set to 0; or, the third value can be set to 0 and the fourth value can be set to 1; or, the third value can be set to true and the fourth value can be set to false; or, the third value can be set to false and the fourth value can be set to true; but this is not specifically limited here.

[0176] In an embodiment of the present application, taking the flag written into the bitstream as an example, assuming that the third value is set to 1 (true) and the fourth value is set to 0 (false), if the value of the second syntax identification information is 0 (false), then it can be determined that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra-frame block copy technology, that is, there is no need to execute the decoding method described in the embodiment of the present application; if the value of the first syntax identification information is 1 (true), then it can be determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology, that is, it is necessary to execute the decoding method described in the embodiment of the present application.

[0177] In the embodiment of the present application, the first syntax identification information acts as a switch, that is, when the first syntax identification information is a first value (such as 1 or true), it indicates that the decoding algorithm described in the embodiment of the present application is not started, that is, the decoding algorithm described in the embodiment of the present application is not executed; when the first syntax identification information is a second value (such as 0 or false), it indicates that the decoding algorithm described in the embodiment of the present application is started, that is, the decoding algorithm described in the embodiment of the present application is executed.

[0178] Case 2: The implementation before S301 may include: parsing the code stream to determine the third syntax identification information;

[0179] When the third syntax identification information indicates that the current chroma block adopts the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology, the step of parsing the code stream to obtain the first syntax identification information is performed.

[0180] In some embodiments of the present application, parsing the code stream and determining the third syntax identification information may include:

[0181] If the value of the third syntax identification information is the fifth value, it is determined that the current chroma block adopts the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology; or

[0182] If the value of the third syntax identification information is the sixth value, it is determined that the current chroma block does not adopt the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology.

[0183] Exemplarily, the third syntax identification information may be represented as cibc_flag.

[0184] It should be noted that in the embodiment of the present application, the fifth value is different from the sixth value, and the fifth and sixth values ​​can be in parameter form or in numerical form. Specifically, the second syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0185] Exemplarily, for the fifth value and the sixth value, the fifth value can be set to 1 and the sixth value can be set to 0; or, the fifth value can be set to 0 and the sixth value can be set to 1; or, the fifth value can be set to true and the sixth value can be set to false; or, the fifth value can be set to false and the sixth value can be set to true; but this is not specifically limited here.

[0186] In an embodiment of the present application, taking the flag written into the bitstream as an example, assuming that the fifth value is set to 1 (true) and the sixth value is set to 0 (false), if the value of the third syntax identification information is 0 (false), then it can be determined that the current chroma block does not adopt the chroma intra-frame block copy prediction mode or the cross-component prediction mode based on the chroma intra-frame block copy technology, that is, there is no need to execute the decoding method described in the embodiment of the present application; if the value of the second syntax identification information is 1 (true), then it can be determined that the current chroma block adopts the chroma intra-frame block copy prediction mode or the cross-component prediction mode based on the chroma intra-frame block copy technology, that is, it may be necessary to execute the decoding method described in the embodiment of the present application.

[0187] In some embodiments of the present application, for situation 2, the implementation of parsing the code stream in S301 and determining the first syntax identification information may include:

[0188] If the value of the first syntax identification information is the seventh value, it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology; or

[0189] If the value of the first syntax identification information is the eighth value, it is determined that the current chroma block adopts the chroma intra block copy prediction mode.

[0190] Exemplarily, the first syntax identification information may be represented as tcibc_flag.

[0191] It should be noted that in the embodiment of the present application, the seventh value is different from the eighth value, and the seventh and eighth values ​​can be in parameter form or in digital form. Specifically, the first syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0192] Exemplarily, for the seventh value and the eighth value, the seventh value can be set to 1 and the eighth value can be set to 0; or, the seventh value can be set to 0 and the eighth value can be set to 1; or, the seventh value can be set to true and the eighth value can be set to false; or, the seventh value can be set to false and the eighth value can be set to true; but this is not specifically limited here.

[0193] In an embodiment of the present application, taking the flag written into the bitstream as an example, assuming that the seventh value is set to 1 (true) and the eighth value is set to 0 (false), if the value of the second syntax identification information is 0 (false), then it can be determined that the current chroma block adopts the chroma intra-frame block copy prediction mode, that is, there is no need to execute the decoding method described in the embodiment of the present application; if the value of the first syntax identification information is 1 (true), then it can be determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology, that is, it is necessary to execute the decoding method described in the embodiment of the present application.

[0194] In an embodiment of the present application, the first syntax identification information acts as a switch, that is, when the first syntax identification information is a first value (such as 1 or true), it indicates that the decoding algorithm described in the embodiment of the present application is not started, that is, the decoding algorithm described in the embodiment of the present application is not executed; when the first syntax identification information is a second value (such as 0 or false), it indicates that the decoding algorithm described in the embodiment of the present application is started, that is, the decoding algorithm described in the embodiment of the present application is executed.

[0195] It should be noted that the first value, second value, third value, fourth value, fifth value, sixth value, seventh value, and eighth value mentioned above can be expressed in the same form (i.e., parameter form or numerical form). For example, the first value, third value, fifth value, and seventh value can be 1 or True, and the second value, fourth value, sixth value, and eighth value can be 0 or False.

[0196] S302: When the first syntax identification information indicates that the current chroma block adopts a cross-component prediction mode based on the chroma intra block copying technology, determine a reference motion vector according to the current co-located luminance block corresponding to the current chroma block.

[0197] In the embodiment of the present application, the current chroma block is also called the current block, the current block to be decoded, the current chroma block to be decoded, the block to be decoded, the chroma block to be decoded, etc. The embodiment of the present application does not impose any limitations on this.

[0198] In the embodiment of the present application, when the value of the first syntax identification information is 1 or True, it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology.

[0199] In the embodiment of the present application, the co-located luminance block refers to the luminance block corresponding to the current chrominance block. For example, in the YCbCr color space, for each chrominance block (Cb or Cr block), there is a luminance block in the same position or relative position, and this luminance block is called the co-located luminance block.

[0200] In an embodiment of the present application, there is a co-located relationship between the chrominance block and the luminance block. For example, in the YCbCr color space, the image is divided into a luminance component (Y) and two chrominance components (Cb, Cr). The luminance component (Y) contains the black and white information of the image, while the chrominance components (Cb, Cr) contain color information. The sampling rate of the chrominance component is usually lower than that of the luminance component, which means that for each luminance block, there may be multiple chrominance blocks. For each chrominance block, there is a co-located luminance block, which means that they have the same position or a certain relative position relationship in the image. Usually, the size of the luminance block is larger than the size of the chrominance block. For example, a luminance block may correspond to a 4x4 or 8x8 pixel block, while the chrominance block may correspond to a smaller 2x2 or 4x4 pixel block.

[0201] In this embodiment of the present application, the reference motion vector is used to predict the motion information of the current image block. Typically, the current co-located luminance block corresponding to the current chrominance block has the same motion vector. The obtained motion vector is applied to the current chrominance block to predict the position of the current chrominance block. This prediction process helps reduce residual errors caused by motion and improves decoding efficiency.

[0202] S303: When the reference motion vector is valid, determine a cross-component prediction model based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector.

[0203] In the embodiment of the present application, as shown in FIG12a , it shows the reference luminance block (Ref Luma) corresponding to the collocated luminance block (Col-Luma) corresponding to the current chroma block (Current Block) under the luminance channel (Luma Channel). As shown in FIG12b , it shows the reference chroma block (Ref Chroma) corresponding to the reference motion vector for the current chroma block under the chroma channel (Chroma Channel).

[0204] In the embodiment of the present application, whether the reference motion vector is valid can be determined from the following aspects:

[0205] 1) Range of reference motion vector:

[0206] In the embodiments of the present application, the reference motion vector is an integer value in pixels. For example, the H.264 standard specifies a motion vector range of a specific number of pixels, typically with upper and lower limits in both the horizontal and vertical directions. At the decoding end, it is necessary to check whether the decoded motion vector is within the specified range. If the motion vector value exceeds the specified range, it may indicate that the reference motion vector is invalid.

[0207] 2) Reference motion vector flag:

[0208] In the embodiment of the present application, a flag or special marker may be included in the bitstream to indicate whether the motion vector of the current block is valid. This flag is usually included in the block header information. At the decoding end, the decoder will check this flag. If the flag indicates that the motion vector is invalid, the decoder will not use the vector for motion compensation.

[0209] 3) Availability of the reference frame corresponding to the reference motion vector:

[0210] Motion vectors are typically relative to a reference frame. On the decoder side, it's necessary to ensure that the reference frame corresponding to the reference motion vector is available—either decoded or cached. If the reference frame is unavailable, the motion vector cannot be correctly applied to the current frame. If the reference frame is unavailable, the decoder may need to employ error handling strategies, such as skipping motion compensation for the current block or using other strategies for intra-frame prediction.

[0211] In some embodiments of the present application, invalid (unavailable) here may specifically refer to:

[0212] 1) Not reconstructed, that is, the reference luminance block and the reference chrominance block (also referred to as the template area of ​​the current chrominance block mentioned above) are not reconstructed, but usually, the area above and to the left of the current chrominance block (i.e., the template area), or the reference luminance block and the reference chrominance block have been reconstructed;

[0213] 2) Out of bounds, that is, the original image does not exist or the hardware device exceeds the range of pixels that can be obtained;

[0214] 3) The condition setting is not met. Generally, some specially designed modes only allow the current block to use pixels in the left template or only allow the current block to use pixels in the upper template.

[0215] It is understandable that the above-mentioned factors affecting whether the reference motion vector is valid are merely examples, and other factors may also be included in actual application scenarios, and the embodiments of the present application do not impose any limitation on this.

[0216] In some embodiments of the present application, when the reference motion vector satisfies at least one of the following conditions: the reference luminance block or the reference chrominance block corresponding to the reference motion vector has not been reconstructed, the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector does not match, and the reference motion vector is out of bounds, the reference motion vector is determined to be invalid; or,

[0217] The reference motion vector is determined to be valid when the reference motion vector satisfies the conditions that the reference luminance block or reference chrominance block corresponding to the reference motion vector has been reconstructed, the prediction mode of the reference luminance block or reference chrominance block corresponding to the reference motion vector matches, and the reference motion vector does not cross the boundary.

[0218] In an embodiment of the present application, determining whether a reference motion vector is valid may include the following steps:

[0219] Step 1: Check whether the reference luminance block or reference chrominance block corresponding to the reference motion vector is reconstructed.

[0220] In the embodiments of the present application, at the decoding end, the reference block may not be fully reconstructed because the corresponding block in the reference frame has not been fully decoded, or the decoder has not yet completed decoding the reference frame. In this case, the decoder may need to wait for the reference block to be fully reconstructed or employ some error handling mechanism. For example, it may choose to skip motion compensation for the current block and temporarily use other methods for padding or interpolation to prevent errors caused by incomplete decoding.

[0221] Step 2: Check whether the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector matches.

[0222] In embodiments of the present application, a reference block may use a prediction mode that does not match the current block. This may occur during intra-frame prediction, where the reference block may use a different prediction mode. In this case, the decoder may need to detect and correct the prediction mode mismatch, which may involve attempting to adjust the prediction mode of the reference block based on the prediction mode of the current block, or implementing other error recovery strategies.

[0223] Step 3: Check whether the reference motion vector is out of bounds.

[0224] In the embodiments of the present application, the value of the reference motion vector may exceed the specified range. This may be caused by a coding error, a transmission error, or other abnormal situation. At the decoding end, it is necessary to detect and handle the out-of-bounds situation. Possible handling methods include clipping the value of the motion vector to keep it within the valid range or using other error handling methods.

[0225] It's understandable that the above steps are designed to ensure the validity of the reference motion vectors and prevent erroneous or invalid reference motion vectors from affecting decoding quality. By detecting and handling these situations, the decoder ensures decoding accuracy and robustness, thereby improving the reliability of video decoding.

[0226] S304: Determine a predicted chroma value of the predicted chroma block based on the cross-component prediction model.

[0227] In the embodiment of the present application, the cross-component prediction model characterizes that the reconstructed luminance value of the current co-located luminance block corresponding to the current chrominance block has a relationship with the predicted chrominance value of the predicted chrominance block.

[0228] In some embodiments of the present application, the cross-component prediction model characterizes that the reconstructed luminance value of the current co-located luminance block corresponding to the current chrominance block has a linear or nonlinear relationship with the predicted chrominance value of the predicted chrominance block.

[0229] It should be noted that the linear cross-component prediction model can improve decoding efficiency and remove redundancy in the chroma components, allowing the model to better fit the relationship between luma and chroma in real-world scenarios. By using a linear cross-component prediction model, the decoder can more accurately estimate the values ​​of the chroma components, thereby achieving better compression during the decoding process, which is beneficial for improving video decoding performance and quality.

[0230] In the embodiments of the present application, although linear relationships can effectively capture the relationship between co-located luminance blocks and predicted chrominance blocks in many cases, some nonlinear relationships may sometimes exist. In order to more accurately model nonlinear relationships, more complex nonlinear models may also be used. In general, whether to use a linear or nonlinear relationship model depends on the actual coding standard, application scenario, and optimization requirements. Linear models are usually simpler, but in some cases may not be sufficient to accurately express complex relationships. Nonlinear models are more flexible, but usually require more computing resources.

[0231] In some embodiments of the present application, the decoding method further includes S306:

[0232] S306 : When the reference motion vector is invalid, determine the predicted chroma value of the predicted chroma block according to the sample accuracy of the current chroma block.

[0233] In the embodiments of the present application, the sample accuracy of the current chroma block refers to the representation accuracy of the chroma component (Chroma), which is usually expressed in bits (bit-depth). Higher sample accuracy is usually used to preserve details and color information in the image. For example, 8-bit sample accuracy means that each chroma component is represented by 8 binary bits (or bits). In this way, each chroma component can have 2^8=256 different discrete levels. These levels correspond to color changes, so higher sample accuracy means that more color details can be represented. Higher sample accuracy can provide more color levels, thereby improving color resolution. This is very important for preserving subtle color differences in the image. High sample accuracy helps to more accurately represent colors in the real world and improve color fidelity. Selecting an appropriate sample accuracy also involves a balance between coding efficiency. Higher sample accuracy may require more bits to represent each pixel, thereby increasing the amount of data after encoding.

[0234] In the embodiment of the present application, the sample accuracy of the current chroma block can be expressed as BitDepth.

[0235] In this embodiment of the present application, the sample accuracy of the current chroma block may include the following:

[0236] 1) 8-bit sample precision: Each component is represented using 8 bits. This is the most common sample precision, widely used in many real-time video transmission and storage applications, providing 256 different brightness or chrominance levels.

[0237] 2) 10-bit sample precision: Each component is represented using 10 bits. This provides higher precision than 8-bit sample precision and allows the representation of 1024 different brightness or chrominance levels. This is commonly used in some professional video and film production.

[0238] 3) 12-bit sample precision: Each component is represented by 12 bits, which can provide higher precision and allow the representation of 4096 different brightness or chrominance levels. This is usually used in professional fields and for special needs.

[0239] 4) 16-bit sample accuracy: Each component is represented by 16 bits, which can provide very high precision and allow the representation of 65536 different brightness or chrominance levels. This is usually used in special application areas such as medical imaging, which require extremely high image accuracy.

[0240] It should be noted that the sample accuracy listed above is only an example, and different sample accuracy levels are suitable for different application scenarios. Higher sample accuracy can generally provide richer color details and image quality, but also requires more storage space and transmission bandwidth. When selecting sample accuracy, it is necessary to balance image quality and data transmission efficiency based on the needs of the specific application. The embodiments of this application do not impose any restrictions on sample accuracy, and the specific selection can be made based on the actual scenario.

[0241] In some embodiments of the present application, the implementation of determining the predicted chroma value of the predicted chroma block according to the sample precision of the current chroma block in S306 may include S3061 to S3062:

[0242] S3061. Subtract the sample accuracy from the first preset value to obtain a fourth intermediate parameter.

[0243] S3062: Perform an exponential operation on the second preset value and the fourth intermediate parameter to obtain a predicted chromaticity value of each pixel in the predicted chromaticity block.

[0244] In the embodiment of the present application, the first preset value and the second preset value are pre-set values. For example, the first preset value is 1 and the second preset value is 2.

[0245] In the embodiment of the present application, the fourth intermediate parameter can be expressed as BitDepth-1.

[0246] In the embodiment of the present application, the predicted chroma value of each pixel in the predicted chroma block can be expressed as 2BitDepth-1.

[0247] As you can understand, the predicted chroma values ​​for each pixel in the predicted chroma block are generated through sample precision, preset values, and exponential operations. By adjusting the sample precision and different preset values, different predicted chroma values ​​can be explored, providing more flexible adjustment and optimization options in video encoding, helping to better adapt to different application scenarios and requirements in video decoding.

[0248] S305 : Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0249] In some embodiments of the present application, the implementation of determining the reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block in S305 may include S3051 to S3053:

[0250] S3051, parsing the code stream to obtain the chroma residual value of the current chroma block;

[0251] S3052, performing inverse transformation and inverse quantization on the chroma residual value to obtain an inverse quantized chroma residual value of the current chroma block;

[0252] S3053. Determine the reconstructed chroma value of the current chroma block according to the inverse quantized chroma residual value and the predicted chroma value.

[0253] In the embodiment of the present application, the chroma residual value represents the difference between the current chroma block and the predicted value. These residual values ​​are usually encoded and stored in the bitstream. Parsing the bitstream is to extract these residual values ​​from the bitstream.

[0254] In the embodiment of the present application, the chroma residual value may have been transformed and quantized. In order to obtain the actual residual value, an inverse transformation and inverse quantization process is required. The purpose of this step is to restore the encoded residual value to the original difference value.

[0255] In this embodiment of the present application, the reconstructed chroma value of the current chroma block is obtained by adding the inverse quantized residual value to the predicted chroma value. This is the last step of chroma block reconstruction, and the obtained reconstructed chroma value will be used to construct the final image frame.

[0256] It's understandable that, on the one hand, the inverse quantization and inverse transform processes help accurately restore the original chroma residual information at the decoder. This helps improve the video compression ratio, reducing file size while maintaining image quality. The inverse quantization and inverse transform processes help minimize distortion introduced by encoding. On the other hand, by correctly restoring the residual information at the decoder, the original image can be more accurately restored, improving image quality. On the other hand, the above process aims to minimize the computational complexity of the encoding and decoding process while maintaining image quality, which helps improve encoding and decoding efficiency.

[0257] In an embodiment of the present application, a decoding method is provided, comprising: parsing a bitstream at a decoding end to determine first syntax identification information; determining a reference motion vector based on a current co-located luma block corresponding to the current chroma block, if the first syntax identification information indicates that a current chroma block uses a cross-component prediction mode based on a chroma intra block copy technique; determining a cross-component prediction model based on a reference luma block and a reference chroma block corresponding to the reference motion vector, if the reference motion vector is valid; determining a predicted chroma value for the predicted chroma block based on the cross-component prediction model; and determining a reconstructed chroma value for the current chroma block based on the predicted chroma value of the predicted chroma block. Because the cross-component prediction model is determined using the reference luma block and the reference chroma block corresponding to the reference motion vector, compared to a cross-component prediction model derived from reconstructed pixels in adjacent rows and columns of the current chroma block, the cross-component prediction model can be more flexible and diverse in determining. This allows the cross-component prediction model to flexibly cope with more complex encoding and decoding scenarios, thereby improving the encoding and decoding efficiency of the current chroma block.

[0258] It can be understood that, on the one hand, the reference motion vector is determined based on the current co-located luminance block corresponding to the current chrominance block. This step helps to introduce the information of the luminance block into the decoding process of the chrominance block to improve the accurate processing of motion correlation. On the one hand, based on the cross-component prediction model, the predicted chrominance value of the predicted chrominance block is determined, which makes full use of the information of the luminance block, helps to improve the prediction accuracy of the chrominance block, and helps to more accurately restore the chrominance information in the original image at the decoding end, thereby improving the image quality. In general, the above process can improve the decoding accuracy of the chrominance block, enhance the image quality, and utilize cross-component correlation. By introducing the information of the luminance block, the decoding process more comprehensively utilizes the correlation between different components in the video image, thereby improving the decoding effect.

[0259] In some embodiments of the present application, the implementation of determining the reference motion vector according to the current co-located luminance block corresponding to the current chrominance block in S302 may include S401:

[0260] S401: Determine candidate reference samples that meet a preset prediction mode in a current co-located luminance block, and use motion vectors corresponding to the candidate reference samples as reference motion vectors.

[0261] In some embodiments of the present application, the preset prediction mode is: the candidate reference samples adopt the block copy intra prediction mode (Intra Block Copy, IBC) or the common string sub-mode of the string copy intra prediction.

[0262] In an embodiment of the present application, the decoder determines candidate reference samples that satisfy the block copy intra prediction mode or the common string sub-mode of string copy intra prediction in the current co-located luminance block, and uses the motion vector corresponding to the candidate reference sample as the reference motion vector.

[0263] In an embodiment of the present application, by parsing the corresponding syntax elements or identification information in the video code stream, the decoder determines whether the current block adopts the block copy intra-frame prediction mode or the ordinary string sub-mode of the string copy intra-frame prediction. If the current block adopts the block copy intra-frame prediction mode or the ordinary string sub-mode of the string copy intra-frame prediction, the decoder will obtain the corresponding prediction mode parameters, which may include the direction of block copy (horizontal or vertical) or the direction of the string sub-mode. According to the prediction mode parameters, the candidate reference samples that meet the block copy intra-frame prediction mode or the ordinary string sub-mode of the string copy intra-frame prediction are determined in the current co-located luminance block. For the determined candidate reference samples, their corresponding motion vectors are used as reference motion vectors.

[0264] It's understandable that the purpose of this process is to accurately describe the relationship between the current block and blocks in the reference frame during decoding, thereby improving prediction accuracy. By determining candidate reference samples and their corresponding motion vectors, the decoder can better restore the content of the current block, achieving better image quality.

[0265] In the embodiment of the present application, in the block-copy intra prediction mode (IBC), the prediction value of the current block is directly copied from the coded blocks in the adjacent area. This means that the content of the current block is similar to that of its adjacent coded blocks, so the prediction can be performed by directly copying the pixel values ​​of the adjacent blocks. This approach can effectively improve the accuracy of prediction in some cases.

[0266] In the embodiments of the present application, the common string submode of string-copy intra-frame prediction is an intra-frame prediction mode that involves copying the pixel values ​​in the current block with the pixel values ​​in adjacent blocks. In this mode, the generation of the predicted value involves copying the pixel values ​​of adjacent blocks, typically from left to right or from top to bottom, to form a "string." This method can be used for patterns with linear or regular patterns.

[0267] It's important to note that both the block copy intra prediction mode and the string copy intra prediction mode are designed for intra-frame prediction. By copying pixel values ​​from an already coded block, they provide a simple and effective prediction method based on adjacent blocks. The block copy intra prediction mode emphasizes copying the entire block, while the string copy intra prediction mode emphasizes the orderly concatenation of pixel values. The choice of mode typically depends on the decoding standard and the specific image content. These intra prediction modes help improve video decoding efficiency, reduce data size, and achieve better compression performance.

[0268] In some embodiments of the present application, the cross-component prediction model is a linear model; determining the implementation of the cross-component prediction model based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector in S303 may include S3031 to S3032:

[0269] S3031. Determine at least two reference luminance samples in a reference luminance block according to a preset sample selection method, and determine reference chrominance samples corresponding to the at least two reference luminance samples in a reference chrominance block according to a preset sample selection method.

[0270] In the embodiment of the present application, the preset sample point selection method is usually based on certain rules or algorithms, such as uniform distribution within the block, selection in a specific direction, etc.

[0271] In the embodiment of the present application, for each reference luma sample determined in the reference luma block, the corresponding reference chroma sample is found according to the chroma sampling structure (e.g., 4:2:0 or 4:4:4). If the sampling structure of the chroma block is 4:2:0, the corresponding reference chroma samples may be located at adjacent positions in the horizontal and vertical directions.

[0272] It can be understood that selecting at least two reference luminance samples and at least two reference luminance samples according to the preset sample selection method helps to establish the relationship between luminance and chrominance, and improves the accuracy of intra-frame prediction.

[0273] In some embodiments of the present application, the preset sample point selection method includes any one of the following: a center selection method, a vertical selection method, a horizontal selection method, a diagonal selection method, and a vertex selection method.

[0274] In an embodiment of the present application, as shown in FIG13a , in the center selection method, the center position of the reference chrominance block is first determined. The center position may be calculated by the midpoint of the width and height of the block. Then, the center position is selected as the reference chrominance sample. Furthermore, based on the reference chrominance sample in the reference chrominance block, the corresponding reference luminance sample is determined in the reference luminance block.

[0275] In an embodiment of the present application, as shown in FIG13b , in a vertical selection method, the reference chroma samples are determined by the vertical center line (e.g., the leftmost line) of the reference chroma block. The location of the vertical center line is typically determined by combining half the block's height with the block's left edge. Then, based on the reference chroma samples in the reference chroma block, the corresponding reference luma samples are determined in the reference luma block.

[0276] In an embodiment of the present application, as shown in FIG13c , in a horizontal selection method, the reference chroma sample is determined by the horizontal centerline of the reference chroma block. Typically, the location of the horizontal centerline is determined by combining half the width of the reference chroma block and the top edge of the block. Then, based on the reference chroma sample in the reference chroma block, the corresponding reference luminance sample is determined in the reference luminance block.

[0277] In an embodiment of the present application, as shown in FIG13d , in a diagonal selection method, the reference chroma samples are determined by the diagonal lines between the upper left and lower right corners of the reference chroma block. These are typically calculated from the midpoint of the diagonal lines of the width and height of the reference chroma samples. Then, based on the reference chroma samples in the reference chroma block, corresponding reference luminance samples are determined in the reference luminance block.

[0278] In an embodiment of the present application, as shown in FIG13e , in a vertex selection method, the positions of the four vertices of the reference chrominance block are determined. These vertices are typically the four corners of the reference chrominance block. Then, based on the reference chrominance samples in the reference chrominance block, corresponding reference luminance samples are determined in the reference luminance block.

[0279] It is understood that after determining these reference luma samples, the corresponding chroma samples can be determined through the corresponding chroma sampling structure, establishing a relationship between luma and chroma. This relationship helps improve the accuracy of intra-frame prediction, thereby better restoring the original video frame at the decoding end.

[0280] It is understandable that, on the one hand, different selection methods can better adapt to different image content and motion patterns. In some scenarios, a certain selection method may better capture important information in the image, thereby improving coding efficiency. On the other hand, different selection methods may help provide more accurate motion vector information. By selecting appropriate samples, motion can be estimated more precisely, thereby improving prediction accuracy. On the other hand, the clever selection of preset sample selection methods can improve the performance of intra-frame prediction. By selecting appropriate samples, the relationship between luminance and chrominance can be better modeled, thereby improving the quality of intra-frame prediction. On the other hand, certain selection methods may have lower complexity during decoding, allowing the decoder to perform prediction and motion estimation more efficiently, thereby reducing overall decoding complexity. In summary, by selecting the appropriate preset sample selection method, video decoders can better adapt to the needs of different scenarios, improve image quality, and reduce complexity while maintaining decoding efficiency.

[0281] In some embodiments of the present application, the preset sample point selection method is a center selection method; the width of the reference chroma block is W, and the height of the reference chroma block is H; the width of the reference luminance block is 2W, and the height of the reference luminance block is 2H.

[0282] In some embodiments of the present application, the at least two reference luma samples include: a first reference luma sample, a second reference luma sample, a third reference luma sample, and a fourth reference luma sample; the reference chroma samples corresponding to each of the at least two reference luma samples include: a first reference chroma sample, a second reference chroma sample, a third reference chroma sample, and a fourth reference chroma sample.

[0283] The position coordinates of the first reference chromaticity sample point in the reference chromaticity block are (1, 0); the first reference chromaticity sample point is the chromaticity sample point at the upper left corner of the reference chromaticity block;

[0284] The position coordinates of the second reference chromaticity sample in the reference chromaticity block are (W-2, 0);

[0285] The coordinates of the third reference chroma sample in the reference chroma block are (1, H-1);

[0286] The coordinates of the fourth reference chroma sample in the reference chroma block are (W-2, H-1);

[0287] The position coordinates of the first reference luminance sample point in the reference luminance block are (2, 0); the first reference luminance sample point is the luminance sample point at the upper left corner of the reference luminance block;

[0288] The position coordinates of the second reference luminance sample in the reference luminance block are (2×(W-2), 0);

[0289] The position coordinates of the third reference luminance sample in the reference luminance block are (2,2×(H-1));

[0290] The position coordinates of the fourth reference luminance sample in the reference luminance block are (2×(W−2), 2×(H−1)).

[0291] In some embodiments of the present application, the preset sample point selection method is a vertex selection method; the width of the reference chroma block is W, and the height of the reference chroma block is H; the width of the reference luminance block is 2W, and the height of the reference luminance block is 2H;

[0292] In some embodiments of the present application, the at least two reference luma samples include: a first reference luma sample, a second reference luma sample, a third reference luma sample, and a fourth reference luma sample; the reference chroma samples corresponding to each of the at least two reference luma samples include: a first reference chroma sample, a second reference chroma sample, a third reference chroma sample, and a fourth reference chroma sample.

[0293] The position coordinates of the first reference chromaticity sample point in the reference chromaticity block are (0, 0); the first reference chromaticity sample point is the chromaticity sample point at the upper left corner of the reference chromaticity block;

[0294] The position coordinates of the second reference chroma sample in the reference chroma block are (W-1, 0);

[0295] The position coordinates of the third reference chroma sample in the reference chroma block are (0, H-1);

[0296] The coordinates of the fourth reference chroma sample in the reference chroma block are (W-1, H-1);

[0297] The position coordinates of the first reference luminance sample point in the reference luminance block are (0, 0); the first reference luminance sample point is the luminance sample point at the upper left corner of the reference luminance block;

[0298] The position coordinates of the second reference luminance sample in the reference luminance block are (2×(W-1), 0);

[0299] The coordinates of the third reference luminance sample in the reference luminance block are (0, 2×(H-1));

[0300] The position coordinates of the fourth reference luminance sample in the reference luminance block are (2×(W−1), 2×(H−1)).

[0301] It should be noted that the centering selection method and vertex selection method listed above are only examples. In actual applications, other numbers of reference luminance samples and reference chrominance samples can also be selected. In addition, other methods are also provided for selecting the coordinate points of the reference luminance samples and reference chrominance samples. In other words, any of the reference luminance samples and reference chrominance samples can be selected. The specific selection method can be selected according to the actual application scenario, and the embodiments of the present application do not impose any restrictions on this.

[0302] In the embodiment of the present application, the first reference chroma sample corresponds to the first reference luminance sample, the second reference chroma sample corresponds to the second reference luminance sample, the third reference chroma sample corresponds to the third reference luminance sample, and the fourth reference chroma sample corresponds to the fourth reference luminance sample.

[0303] It is understood that the vertex selection method helps to establish a more accurate cross-component prediction model by using the relationship between luma samples and chroma samples. During the decoding process, referring to these samples can improve the prediction accuracy of chroma information, thereby improving video quality.

[0304] S3032. Determine a cross-component prediction model based on at least two reference luma samples and at least two reference chroma samples; wherein the at least two reference luma samples correspond to the at least two reference chroma samples.

[0305] In an embodiment of the present application, when the current chroma block corresponds to a cross-component prediction model, the cross-component prediction model is determined according to at least two reference luma samples and at least two reference chroma samples.

[0306] In some embodiments of the present application, the cross-component prediction model includes one or more cross-component prediction sub-models; determining the implementation of the cross-component prediction model according to at least two reference luma samples and at least two reference chroma samples in S3032 may include S30321 to S30322:

[0307] S30321. Group at least two reference luminance samples and at least two reference chrominance samples according to luminance values ​​of the at least two reference luminance samples to obtain at least one reference sample group; wherein each reference sample group includes at least two luminance samples and at least two chrominance samples; the at least two luminance samples correspond to the at least two chrominance samples; the at least two reference luminance samples include at least two luminance samples; the at least two reference chrominance samples include at least two chrominance samples; and at least one reference sample group corresponds to a different preset luminance range.

[0308] In the embodiments of the present application, different reference sample groups contain luma and chroma samples with different preset luminance ranges. This differentiation may help better adapt to brightness variations in different regions of the video. By specifying a different preset luminance range for each reference sample group, potential brightness differences in the video can be more flexibly handled, thereby improving decoding adaptability and performance.

[0309] Exemplarily, the at least one reference sample point group includes: a first sample point group, a second sample point group, a third sample point group, and a fourth sample point group. The first sample point group corresponds to a brightness range of 0 to 50, the second sample point group corresponds to a brightness range of 51 to 100, the third sample point group corresponds to a brightness range of 101 to 150, and the fourth sample point group corresponds to a brightness range of 151 to 255.

[0310] In an embodiment of the present application, as shown in FIG14 , a schematic diagram of multiple cross-component prediction sub-models is shown, where the horizontal axis is the reconstructed luminance value of the co-located luminance block, and the vertical axis is the predicted chrominance value of the predicted chrominance block corresponding to the current chrominance block. It can be seen that the cross-component prediction model includes two cross-component prediction sub-models, namely the first cross-component prediction sub-model and the second cross-component prediction sub-model. Among them, the scaling factor corresponding to the first cross-component prediction sub-model is 1 (α1=1), and the offset factor is 1 (β1=1), and the scaling factor corresponding to the second cross-component prediction sub-model is 1 / 2 (α2=1 / 2), and the offset factor is 1 (β2=1). Therefore, through multiple cross-component prediction sub-models, the reconstructed luminance values ​​for different co-located luminance blocks can be matched to different cross-component prediction sub-models, so that the adaptability and performance of decoding can be improved.

[0311] S30322. For each reference sample group in the at least one reference sample group, determine a cross-component prediction sub-model corresponding to each reference sample group according to at least two luma samples and at least two chroma samples in each reference sample group.

[0312] In some embodiments of the present application, S30322 determines, based on at least two luma samples and at least two chroma samples in each reference sample group, an implementation of a cross-component prediction sub-model corresponding to each reference sample group, which may include:

[0313] grouping the at least two luma samples and the at least two chroma samples in each reference sample group according to luma values ​​of the at least two luma samples to obtain a first sample group and a second sample group; wherein the first sample group and the second sample group each include at least one luma sample and at least one chroma sample; the at least one luma sample corresponds to the at least one chroma sample; and a reconstructed luma value of the at least one luma sample in the first sample group is greater than or equal to a reconstructed luma value of the at least one luma sample in the second sample group;

[0314] Determining a maximum reference luminance value and a first reference chrominance value, respectively, based on a reconstructed luminance value of at least one luminance sample and a reconstructed chrominance value of at least one chrominance sample in the first sample group;

[0315] Determine a minimum reference luminance value and a second reference chrominance value according to a reconstructed luminance value of at least one luminance sample and a reconstructed chrominance value of at least one chrominance sample in the second sample point group;

[0316] determining a scaling factor and an offset factor based on a maximum reference luminance value, a first reference chrominance value, a minimum reference luminance value, and a second reference chrominance value;

[0317] According to the scaling factor and the offset factor, the cross-component prediction sub-model corresponding to each reference sample group is determined.

[0318] In the embodiment of the present application, the maximum reference luminance value may be represented as xMax, the first reference chrominance value may be represented as yMax, the minimum reference luminance value may be represented as xMin, the second reference chrominance value may be represented as yMin, the scaling factor may be represented as a, and the offset factor may be represented as b.

[0319] It should be noted that the grouping and sorting of the at least two luma samples and the at least two chroma samples in each reference sample group is performed based on the luma values ​​of the at least two luma samples, while the chroma values ​​are manipulated based on the corresponding luma values. Therefore, the first reference chroma value corresponding to the maximum reference luma value is not necessarily the largest. Similarly, the second reference chroma value corresponding to the minimum reference luma value is not necessarily the smallest.

[0320] Exemplarily, when the reconstructed luminance value of the first reference luminance sample is greater than or equal to the reconstructed luminance value of the second reference luminance sample, the reconstructed luminance value of the second reference luminance sample is greater than or equal to the reconstructed luminance value of the third reference luminance sample, and the reconstructed luminance value of the third reference luminance sample is greater than or equal to the reconstructed luminance value of the fourth reference luminance sample, the first reference luminance sample, the second reference luminance sample, the first reference chroma sample corresponding to the first reference luminance sample, and the second reference chroma sample corresponding to the second reference luminance sample are divided into a first sample group, and the third reference luminance sample, the fourth reference luminance sample, the third reference chroma sample corresponding to the third reference luminance sample, and the fourth reference chroma sample corresponding to the fourth reference luminance sample are divided into a second sample group. Furthermore, the average of the reconstructed luminance values ​​of the first reference luminance sample and the second reference luminance sample is used as the maximum reference luminance value (xMax), the average of the reconstructed chroma values ​​of the first reference chroma sample and the second reference chroma sample is used as the first reference chroma value (yMax), the average of the reconstructed luminance values ​​of the third reference luminance sample and the fourth reference luminance sample is used as the minimum reference luminance value (xMin), and the average of the reconstructed chroma values ​​of the third reference chroma sample and the fourth reference chroma sample is used as the second reference chroma value (yMin).

[0321] In some embodiments of the present application, determining the scaling factor and the offset factor based on the maximum reference luminance value, the first reference chrominance value, the minimum reference luminance value, and the second reference chrominance value may include:

[0322] Subtracting the first reference chromaticity value (yMax) from the second reference chromaticity value (yMin) to obtain a first intermediate parameter;

[0323] Subtracting the maximum reference brightness value (xMax) from the minimum reference brightness value (xMin) to obtain a second intermediate parameter;

[0324] Dividing the first intermediate parameter by the second intermediate parameter to obtain a scaling factor (a);

[0325] Multiplying the scaling factor (a) and the minimum reference brightness value (xMin) to obtain a third intermediate parameter;

[0326] The second reference chromaticity value (yMin) is subtracted from the third intermediate parameter to obtain an offset factor (b).

[0327] In an embodiment of the present application, the first intermediate parameter can be expressed as yMax-yMin. The second intermediate parameter can be expressed as xMax-xMin. The scaling factor can be expressed as a=(yMax-yMin) / (xMax-xMin). The third intermediate parameter can be expressed as a×xMin. The offset factor can be expressed as yMin-a×xMin.

[0328] It can be understood that determining the scaling factor and offset factor can map the reference luminance and chrominance values ​​to a standard range, thereby achieving normalization and helping to more consistently process luminance and chrominance information in different scenarios. By determining the scaling factor and offset factor, the prediction model can be made more robust and adaptable to different luminance and chrominance conditions. By performing appropriate luminance and chrominance mapping, data redundancy can be reduced, decoding efficiency can be improved, and image information can be represented more compactly. In general, by determining the scaling factor and offset factor, the relationship between luminance and chrominance can be better handled, improving decoding performance and image quality.

[0329] In some embodiments of the present application, the cross-component prediction model is a nonlinear model; determining the implementation of the cross-component prediction model based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector in S304 may include:

[0330] Selecting all or part of the reference chroma samples in the reference chroma block;

[0331] A cross-component prediction model is determined based on all or part of the reference chroma samples, reference luma samples corresponding to all or part of the reference chroma samples in a reference luma block, and neighborhood reference luma samples of the reference luma samples.

[0332] In the embodiment of the present application, when the sizes of the reference luminance block and the reference chrominance block are inconsistent, the reference luminance block is downsampled to obtain downsampled luminance samples. The downsampling process can be expressed as: L′(x,y)=(L(x-1,y)+2L(x,y)+L(x+1,y)+L(x-1,y+1)+2L(x,y+1)+ L(x+1,y+1)) / 8 (3)

[0333] In formula (3), L(x, y) represents a pixel in the reference luminance block, and L′(x, y) represents the downsampled luminance sample corresponding to the pixel L(x, y).

[0334] In an embodiment of the present application, the sampled reference luminance block and the reference chrominance block are used as templates for parameter derivation.

[0335] In the embodiment of the present application, when the cross-component prediction model is a nonlinear model, the cross-component prediction model can be expressed by formula (4):

[0336] In formula (4), p0, p1, p2, p3, p4, p5, and B are model parameters of the cross-component prediction model, C is the reconstructed luminance value of the target luma sample corresponding to the target chroma sample of the current chroma block in the same luma block, N is the reconstructed luminance value of the luma sample located above the target luma sample, S is the reconstructed luminance value of the luma sample located below the target luma sample, W is the reconstructed luminance value of the luma sample located to the left of the target luma sample, and E is the reconstructed luminance value of the luma sample located to the right of the target luma sample. C′ is the predicted chroma value corresponding to the target chroma sample of the current chroma block.

[0337] In an embodiment of the present application, all or part of the reference chroma samples are selected in the reference chroma block, and based on all or part of the reference chroma samples, the reference luminance samples corresponding to all or part of the reference chroma samples in the reference luminance block, and the neighborhood reference luminance samples of the reference luminance samples, multiple equations are constructed to solve the linear equation system, and the LDL solution method is used to obtain the model parameters p0, p1, p2, p3, p4, p5, and B of the cross-component prediction model, thereby obtaining a nonlinear cross-component prediction model.

[0338] In this embodiment of the present application, samples whose horizontal and vertical coordinates satisfy preset constraints can be selected from the reference luminance block and the reference chrominance block, that is, samples whose horizontal and vertical coordinates are not odd numbers. This can be expressed as: (x%2==1 &&y%2==1).

[0339] It can be understood that by establishing a cross-component prediction model based on reference chrominance samples and corresponding reference luma samples, the adaptability of the prediction model can be enhanced, making it better suited to different types and scenes of video content. Considering the neighborhood reference luma samples of the reference luma samples can more comprehensively capture luma information, helping to improve the accuracy of the prediction model, which can be important for processing information such as local features and texture in the image. By more accurately modeling cross-component relationships, it is expected that the distortion introduced by the prediction will be reduced, thereby improving the overall video quality, including higher compression efficiency and better visual quality.

[0340] In some embodiments of the present application, the neighborhood reference luma samples include one or more of the following: a reference luma sample (N) located above the reference luma sample, a reference luma sample (S) located below the reference luma sample, a reference luma sample (W) located to the left of the reference luma sample, and a reference luma sample (E) located to the right of the reference luma sample.

[0341] In an embodiment of the present application, by considering the above-mentioned neighborhood reference luminance samples, the context and local features of the luminance information can be more comprehensively captured, which helps to improve the accuracy and adaptability of the cross-component prediction model. Such information consideration can generally better simulate the changes and textures of the luminance components in the image.

[0342] In some embodiments of the present application, the implementation of determining candidate reference samples that satisfy a preset prediction mode in the current co-located luminance block in S401 may include:

[0343] According to the preset M position information, the candidate reference sample points corresponding to the preset M position information are traversed in the current co-located luminance block to obtain the candidate reference sample points that meet the preset prediction mode; wherein M is a positive integer greater than or equal to 1, and i is a positive integer less than M.

[0344] In an embodiment of the present application, M pieces of position information are preset, each of which may include information such as coordinates or an index, and is used to specify a position in the current co-located luminance block. A traversal operation is performed for each piece of preset position information, and in each traversal, candidate reference samples corresponding to the position information are considered. For each piece of position information, corresponding candidate reference samples are found. These candidate reference samples may be determined in the current co-located luminance block based on the coordinates or index of the position information. For each candidate reference sample, it is checked whether it satisfies a preset prediction mode. Candidate reference samples that satisfy the preset prediction mode are collected for subsequent use.

[0345] In some embodiments of the present application, the M pieces of location information include one or more of the following:

[0346] The position of the middle of the current co-located luminance block;

[0347] The upper left position of the current co-located luminance block;

[0348] The upper right position of the current co-located luminance block;

[0349] The lower left position of the current co-located luminance block;

[0350] The lower right position of the current collocated luma block.

[0351] In the embodiment of the present application, the preset M position information can be expressed as {C, TL, TR, BL, BR}, where C represents the center position of the current co-located luminance block, TL represents the upper left position of the current co-located luminance block, TR represents the upper right position of the current co-located luminance block, BL represents the lower left position of the current co-located luminance block, and BR represents the lower right position of the current co-located luminance block.

[0352] In some embodiments of the present application, according to the preset M pieces of position information, candidate reference samples corresponding to the respective preset M pieces of position information are traversed in the current co-located luminance block to obtain candidate reference samples that meet the preset prediction mode, including:

[0353] For the i-th position information among the preset M position information, if the i-th candidate reference sample corresponding to the i-th position information in the current co-located luminance block does not satisfy the preset prediction mode, continue to traverse the i+1-th candidate reference sample corresponding to the i+1-th position information in the current co-located luminance block until the i+1-th candidate reference sample satisfies the preset prediction mode, and determine the i+1-th candidate reference sample as the candidate reference sample that satisfies the preset prediction mode; or,

[0354] In a case where the i-th candidate reference sample point satisfies the preset prediction mode, the i-th candidate reference sample point is determined as a candidate reference sample point that satisfies the preset prediction mode.

[0355] In an embodiment of the present application, for the i-th position information among the preset M position information, the i-th candidate reference sample corresponding thereto is considered. It is determined whether the i-th candidate reference sample in the current co-located luminance block satisfies the preset prediction mode. If the i-th candidate reference sample does not satisfy the preset prediction mode, then the i+1-th candidate reference sample corresponding to the i+1-th position information in the current co-located luminance block is continuously traversed. If the i-th candidate reference sample satisfies the preset prediction mode, then the i-th candidate reference sample is determined as a candidate reference sample that satisfies the preset prediction mode.

[0356] It can be understood that, on the one hand, by checking each position information one by one, it can be ensured that the selected candidate reference samples better match the preset conditions in the prediction mode, thereby improving the accuracy of the prediction. On the one hand, selecting candidate reference samples that meet the preset conditions helps to improve the prediction quality of the image block, thereby improving the visual quality of the overall image. On the one hand, through the preset position information and conditions, appropriate candidate reference samples can be selected according to different scenarios and requirements, making the prediction mode more flexible and adaptable. On the one hand, the effective selection of candidate reference samples can reduce redundant information, thereby improving the efficiency and performance of decoding in video compression. In general, the above steps help to improve the performance of the cross-component prediction model in video coding, making it better adapted to different prediction scenarios and requirements.

[0357] In some embodiments of the present application, the implementation of determining the predicted chroma value of the predicted chroma block based on the cross-component prediction model in S304 may include S3041 to S3042:

[0358] S3041. Determine, through a cross-component prediction model, candidate predicted chroma values ​​of a candidate chroma prediction block according to the reconstructed luminance values ​​of each pixel in the current co-located luminance block; wherein the candidate chroma prediction block is different in size from the current chroma block.

[0359] In an embodiment of the present application, the reconstructed luminance value of each pixel in the current co-located luminance block is input into the cross-component prediction model to obtain the candidate predicted chrominance value of the candidate chrominance prediction block.

[0360] In some embodiments of the present application, the cross-component prediction model includes at least one cross-component prediction sub-model; and the implementation of determining the candidate predicted chrominance value of the candidate chrominance prediction block according to the reconstructed luminance value of each pixel in the current co-located luminance block using the cross-component prediction model in S3041 may include:

[0361] For each pixel in the current co-located luminance block, the reconstructed luminance value of each pixel is input into the corresponding cross-component prediction sub-model to obtain a candidate predicted chrominance value corresponding to each pixel; wherein the preset luminance range corresponding to the reconstructed luminance value of each pixel matches the cross-component prediction sub-model;

[0362] Determine the candidate predicted chrominance value of the candidate chrominance prediction block according to the candidate predicted chrominance value corresponding to each pixel in the current co-located luminance block.

[0363] Exemplarily, at least one cross-component prediction sub-model includes: a first cross-component prediction sub-model, a second cross-component prediction sub-model, a third cross-component prediction sub-model, and a fourth cross-component prediction sub-model. The first cross-component prediction sub-model corresponds to a luminance range of 0 to 50, the second cross-component prediction sub-model corresponds to a luminance range of 51 to 100, the third cross-component prediction sub-model corresponds to a luminance range of 101 to 200, and the fourth cross-component prediction sub-model corresponds to a luminance range of 201 to 255. Then, if the pixel number of a luminance sample in the current co-located luminance block is 40, the luminance sample uses the first cross-component prediction sub-model to obtain the candidate predicted chrominance value of the chrominance sample corresponding to the luminance sample. If the pixel number of a luminance sample in the current co-located luminance block is 60, the luminance sample uses the second cross-component prediction sub-model to obtain the candidate predicted chrominance value of the chrominance sample corresponding to the luminance sample. If the pixel value of a luma sample in the current co-located luma block is 155, the third cross-component prediction sub-model is used for the luma sample to obtain the candidate predicted chroma value of the chroma sample corresponding to the luma sample. If the pixel value of a luma sample in the current co-located luma block is 220, the fourth cross-component prediction sub-model is used for the luma sample to obtain the candidate predicted chroma value of the chroma sample corresponding to the luma sample.

[0364] It can be understood that, on the one hand, the use of different cross-component prediction sub-models for each pixel can better adapt to the brightness and chrominance characteristics of different areas in the image. This adaptability helps to improve the performance of the decoder in various image scenarios. On the other hand, the use of the preset brightness range corresponding to each pixel and the cross-component prediction sub-model provides fine-grained control of different pixels, which enables the decoder to better cope with subtle differences that may exist in the image and improve the flexibility of decoding. In general, the above steps help to better capture the relationship between brightness and chrominance through a more refined cross-component prediction sub-model, thereby improving the quality of chrominance prediction and decoding efficiency.

[0365] S3042. Downsample the candidate predicted chroma values ​​of the candidate chroma prediction block to obtain predicted chroma values ​​of the predicted chroma block.

[0366] In the embodiment of the present application, the candidate predicted chroma values ​​of the candidate chroma prediction block are downsampled by a six-tap filter [1 2 1; 1 2 1]. This process can be expressed by formula (5): chroma (x,y)=(P t (2x-1,2y)+2×P t (2x,2y)+P t (2x+1,2y)+P t (2x-1,2y+1)+ 2×P t (2x,2y+1)+P t (2x+1,2y-1)+4)>>3 (5)

[0367] In formula (5), P chroma represents the predicted chroma value of the final predicted chroma block. Assuming the size of the predicted chroma block is W×H, the value range of x is [0, W-1], and the value range of y is [0, H-1]. Figure 15 shows the relationship between the shape of the six-tap filter and the corresponding positions of the chroma block prediction pixels and the intermediate prediction block pixels (the candidate predicted chroma values ​​of the candidate chroma prediction block).

[0368] It can be understood that, on the one hand, the cross-component prediction model allows for better capture of the complex relationship between luminance and chrominance. By using the reconstructed luminance value of the same-position luminance block, the predicted chrominance value can more accurately reflect the details and features in the image. On the other hand, since the size of the candidate chrominance prediction block is different from the current chrominance block, this method can adapt in size, making the prediction more adaptable to the details and structures of different areas in the image. In general, the above steps combine the advantages of information capture, size adaptability, and decoding efficiency, which helps to improve the quality of chrominance prediction and reduce the amount of data while maintaining efficient decoding.

[0369] In another embodiment of the present application, referring to FIG16 , a schematic flow chart of an encoding method provided by an embodiment of the present application is shown. As shown in FIG16 , the method may include S501 to S504:

[0370] S501. Determine a reference motion vector according to a current co-located luminance block corresponding to a current chrominance block.

[0371] In the embodiment of the present application, the co-located luminance block refers to the luminance block corresponding to the current chrominance block. For example, in the YCbCr color space, for each chrominance block (Cb or Cr block), there is a luminance block in the same position or relative position, and this luminance block is called the co-located luminance block.

[0372] In an embodiment of the present application, there is a co-located relationship between the chrominance block and the luminance block. For example, in the YCbCr color space, the image is divided into a luminance component (Y) and two chrominance components (Cb, Cr). The luminance component (Y) contains the black and white information of the image, while the chrominance components (Cb, Cr) contain color information. The sampling rate of the chrominance component is usually lower than that of the luminance component, which means that for each luminance block, there may be multiple chrominance blocks. For each chrominance block, there is a co-located luminance block, which means that they have the same position or a certain relative position relationship in the image. Usually, the size of the luminance block is larger than the size of the chrominance block. For example, a luminance block may correspond to a 4x4 or 8x8 pixel block, while the chrominance block may correspond to a smaller 2x2 or 4x4 pixel block.

[0373] In the embodiments of the present application, the reference motion vector is used to predict the motion information of the current image block. Typically, the current co-located luminance block corresponding to the current chrominance block has the same motion vector. The obtained motion vector is applied to the current chrominance block to predict the position of the current chrominance block. This prediction process helps reduce residual errors caused by motion and improves coding efficiency.

[0374] S502: When the reference motion vector is valid, determine a cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector.

[0375] In some embodiments of the present application, when the reference motion vector satisfies at least one of the following conditions: the reference luminance block or the reference chrominance block corresponding to the reference motion vector has not been reconstructed, the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector does not match, and the reference motion vector is out of bounds, the reference motion vector is determined to be invalid; or,

[0376] The reference motion vector is determined to be valid when the reference motion vector satisfies the conditions that the reference luminance block or reference chrominance block corresponding to the reference motion vector has been reconstructed, the prediction mode of the reference luminance block or reference chrominance block corresponding to the reference motion vector matches, and the reference motion vector does not cross the boundary.

[0377] In an embodiment of the present application, determining whether a reference motion vector is valid may include the following steps:

[0378] Step 1: Check whether the reference luminance block or reference chrominance block corresponding to the reference motion vector is reconstructed.

[0379] In the embodiments of the present application, at the encoder end, the reference block may not be fully reconstructed because the corresponding block in the reference frame has not been fully encoded, or the encoder has not yet completed encoding the reference frame. In this case, the encoder may need to wait for the reference block to be fully reconstructed or employ some error handling mechanism. For example, it may choose to skip motion compensation for the current block and temporarily use other methods for filling or interpolation to prevent errors caused by incomplete encoding.

[0380] Step 2: Check whether the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector matches.

[0381] In embodiments of the present application, a reference block may use a prediction mode that does not match the current block. This may occur during intra-frame prediction, where the reference block may use a different prediction mode. In this case, the encoder may need to detect and correct the prediction mode mismatch, which may involve attempting to adjust the prediction mode of the reference block based on the prediction mode of the current block, or implementing other error recovery strategies.

[0382] Step 3: Check whether the reference motion vector is out of bounds.

[0383] In the embodiments of the present application, the value of the reference motion vector may exceed the specified range. This may be caused by a coding error, a transmission error, or other abnormal situation. On the encoding side, it is necessary to detect and handle the out-of-bounds situation. Possible handling methods include clipping the value of the motion vector to keep it within the valid range or using other error handling methods.

[0384] It is understood that the above steps are designed to ensure the legitimacy of the reference motion vectors and prevent erroneous or invalid reference motion vectors from affecting encoding quality. By detecting and handling these situations, the encoder ensures encoding accuracy and robustness, thereby improving the reliability of video encoding.

[0385] S503. Determine a predicted chroma value of the predicted chroma block based on a cross-component prediction model, and determine first syntax identification information based on the predicted chroma value; wherein the first syntax identification information is used to indicate whether the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technology.

[0386] In the embodiment of the present application, the cross-component prediction model characterizes that the reconstructed luminance value of the current co-located luminance block corresponding to the current chrominance block has a relationship with the predicted chrominance value of the predicted chrominance block.

[0387] In some embodiments of the present application, the cross-component prediction model characterizes that the reconstructed luminance value of the current co-located luminance block corresponding to the current chrominance block has a linear or nonlinear relationship with the predicted chrominance value of the predicted chrominance block.

[0388] It should be noted that the linear cross-component prediction model can improve coding efficiency and remove redundancy in the chroma component, allowing the model to better fit the relationship between luma and chroma in real-world scenarios. By using a linear cross-component prediction model, the encoder can more accurately estimate the values ​​of the chroma components, thereby achieving better compression during the encoding process, which is beneficial for improving video coding performance and quality.

[0389] In some embodiments of the present application, the implementation of determining the first syntax identification information according to the predicted chrominance value in S503 may include:

[0390] Determine a chroma residual value of the current chroma block according to the original chroma value and the predicted chroma value of the current chroma block;

[0391] Performing rate-distortion cost calculation on the chroma residual value of the current chroma block to obtain a first rate-distortion cost value corresponding to the cross-component prediction mode based on the chroma intra block copy technology used by the current chroma block;

[0392] Determining a prediction mode for a current chroma block according to the first rate-distortion cost value;

[0393] The first syntax identification information is determined according to the prediction mode adopted by the current chroma block.

[0394] In this embodiment of the present application, the original chromaticity value at the corresponding position is subtracted from the predicted chromaticity value to obtain the chromaticity residual (i.e., the chromaticity residual value) of each pixel. This is to quantify the prediction error by comparing the difference between the actual observed chromaticity value and the value predicted by the model.

[0395] In an embodiment of the present application, the distortion between the original chrominance value and the reconstructed chrominance value of the current chrominance block is calculated. Various measurement methods can be used for distortion, the most common of which include mean squared error (MSE) or other structural similarity indexes (SSI). This step represents the image quality loss introduced during compression and decompression. Calculate the number of bits used to represent the chrominance residual value. This number of bits is usually measured by the length of the output data of the encoder, which represents the number of bits required for transmission or storage to represent the chrominance residual of the current chrominance block. Combine the distortion and compression rate to form a comprehensive evaluation index. A common calculation method is to linearly combine the distortion and compression rate, or to perform a more refined evaluation through some complex mathematical models.

[0396] In the embodiments of this application, some common rate-distortion optimization algorithms, such as variable bit rate (VBR) and constant bit rate (CBR), are generally used to minimize distortion while meeting a given bit rate or quality requirement. This helps achieve more efficient video compression and transmission.

[0397] In some embodiments of the present application, the first syntax identification information is coded, and the obtained coded bits are written into a bitstream.

[0398] In some embodiments of the present application, determining the prediction mode used by the current chroma block according to the first rate-distortion cost value may include:

[0399] When the first rate-distortion cost value is less than or equal to the second rate-distortion cost value corresponding to each of the one or more preset candidate prediction modes, determining that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology;

[0400] When the first rate-distortion cost value is greater than the second rate-distortion cost value corresponding to each of the one or more preset candidate prediction modes, it is determined that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra block copy technology.

[0401] It's understandable that, on the one hand, selecting an appropriate prediction mode can reduce image or video distortion and improve visual quality. On the other hand, selecting an appropriate prediction mode can reduce image or video distortion and improve visual quality. On the other hand, the dynamic decision-making mechanism allows the system to adjust the prediction mode based on actual conditions, thereby better adapting to different types of content and scenarios. On the other hand, by improving video encoding efficiency, a better user experience can be provided under limited bandwidth and storage conditions.

[0402] In some embodiments of the present application, the one or more candidate prediction modes include: a chroma intra block copy prediction mode; when the first rate-distortion cost value is greater than the second rate-distortion cost value corresponding to each of the one or more preset candidate prediction modes, determining that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra block copy technology includes:

[0403] When the first rate-distortion cost value is greater than the second rate-distortion cost value corresponding to the chroma intra block copy prediction mode, it is determined that the current chroma block adopts the chroma intra block copy prediction mode.

[0404] In some embodiments of the present application, the implementation of determining the first syntax identification information according to the prediction mode adopted by the current chroma block may include:

[0405] When it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology, determining that the value of the first syntax identification information is a third value; or

[0406] When it is determined that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra block copy technology, the value of the first syntax identification information is determined to be a fourth value.

[0407] Exemplarily, the first syntax identification information may be represented as tcibc_flag.

[0408] It should be noted that in the embodiment of the present application, the third value is different from the fourth value, and the third value and the fourth value can be in parameter form or in digital form. Specifically, the first syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0409] Exemplarily, for the third value and the fourth value, the third value can be set to 1 and the fourth value can be set to 0; or, the third value can be set to 0 and the fourth value can be set to 1; or, the third value can be set to true and the fourth value can be set to false; or, the third value can be set to false and the fourth value can be set to true; but this is not specifically limited here.

[0410] In an embodiment of the present application, taking the flag written into the bitstream as an example, assuming that the third value is set to 1 (true) and the fourth value is set to 0 (false), at this time if the value of the second syntax identification information is 0 (false), then it can be determined that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra-frame block copy technology; if the value of the first syntax identification information is 1 (true), then it can be determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology.

[0411] In some embodiments of the present application, the method further comprises:

[0412] determining second grammar identification information;

[0413] Encoding the second syntax identification information and writing the obtained coded bits into a bitstream;

[0414] Determining the second grammar identification information includes:

[0415] When it is determined that the current chroma block adopts the chroma intra block copy prediction mode, the value of the second syntax identification information is set to the first value; or,

[0416] When it is determined that the current chroma block does not adopt the chroma intra block copy prediction mode, the value of the second syntax identification information is set to the second value.

[0417] It should be noted that in the embodiment of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Specifically, the second syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0418] Exemplarily, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to 0 and the second value can be set to 1; or, the first value can be set to true and the second value can be set to false; or, the first value can be set to false and the second value can be set to true; but this is not specifically limited here.

[0419] In an embodiment of the present application, taking the flag written into the bitstream as an example, assuming that the first value is set to 1 (true) and the second value is set to 0 (false), if the value of the second syntax identification information is 0 (false), then it can be determined that the current chroma block adopts the chroma intra-frame block copy prediction mode; if the value of the second syntax identification information is 1 (true), then it can be determined that the current chroma block does not adopt the chroma intra-frame block copy prediction mode.

[0420] In the embodiment of the present application, in the AVS4 exploration phase reference software EVM-0.2, the prediction mode part of the current chroma block first encodes the CIBC related flag bit, then adds the related flag bit of the TSCPM_CIBC technology of this scheme, and then encodes the other chroma intra-frame prediction mode flag bits. The structure of the first syntax identification information is shown in Table 1:

[0421] Table 1

[0422] In Table 1, it can be seen that when it is determined that the current chroma block adopts the chroma intra block copy prediction mode, the binary string written to the code stream is 1; when it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology, the binary string written to the code stream is 01; when it is determined that the current chroma block adopts other chroma intra prediction modes, the binary string written to the code stream is 00*.

[0423] In an embodiment of the present application, with respect to the structure of the first syntax identification information shown in Table 1, the mode indicates whether to use the cross-component prediction mode based on the chroma intra block copy technology by encoding a flag bit tcibc_flag in the current chroma block related code stream.

[0424] Specifically, if the current chroma block does not use the CIBC mode, that is, if cibc_flag is 0, and the conditions for enabling the TSCPM_CIBC technology are met, a flag bit tcibc_flag needs to be encoded in the bitstream to indicate whether this mode is used. If tcibc_flag is 1, it indicates that the current chroma block uses the TSCPM_CIBC mode, and there is no need to continue encoding flag bits for other modes. If tcibc_flag is 0, it indicates that the current chroma block does not use the TSCPM_CIBC mode, and it is necessary to continue encoding other flag bits related to determining the prediction mode.

[0425] In some embodiments of the present application, the implementation of determining the first syntax identification information according to the prediction mode adopted by the current chroma block may include:

[0426] When it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology, the value of the first syntax identification information is set to the seventh value; or

[0427] When it is determined that the current chroma block adopts the chroma intra block copy prediction mode, the value of the first syntax identification information is set to the eighth value.

[0428] Exemplarily, the first syntax identification information may be represented as tcibc_flag.

[0429] It should be noted that in the embodiment of the present application, the seventh value is different from the eighth value, and the seventh and eighth values ​​can be in parameter form or in digital form. Specifically, the first syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0430] Exemplarily, for the seventh value and the eighth value, the seventh value can be set to 1 and the eighth value can be set to 0; or, the seventh value can be set to 0 and the eighth value can be set to 1; or, the seventh value can be set to true and the eighth value can be set to false; or, the seventh value can be set to false and the eighth value can be set to true; but this is not specifically limited here.

[0431] In an embodiment of the present application, taking the flag written into the bitstream as an example, assuming that the seventh value is set to 1 (true) and the eighth value is set to 0 (false), at this time if the value of the second syntax identification information is 0 (false), then it can be determined that the current chroma block adopts the chroma intra-frame block copy prediction mode; if the value of the first syntax identification information is 1 (true), then it can be determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology.

[0432] In some embodiments of the present application, the method further comprises:

[0433] determining third grammar identification information;

[0434] encoding the third syntax identification information, and writing the obtained coded bits into a bitstream;

[0435] Determining third grammar identification information includes:

[0436] When it is determined that the current chroma block adopts the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology, the value of the third syntax identification information is set to the fifth value; or,

[0437] When it is determined that the current chroma block does not adopt the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology, the value of the third syntax identification information is set to the sixth value.

[0438] Exemplarily, the third syntax identification information may be represented as cibc_flag.

[0439] It should be noted that in the embodiment of the present application, the fifth value is different from the sixth value, and the fifth and sixth values ​​can be in parameter form or in numerical form. Specifically, the second syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0440] Exemplarily, for the fifth value and the sixth value, the fifth value can be set to 1 and the sixth value can be set to 0; or, the fifth value can be set to 0 and the sixth value can be set to 1; or, the fifth value can be set to true and the sixth value can be set to false; or, the fifth value can be set to false and the sixth value can be set to true; but this is not specifically limited here.

[0441] In an embodiment of the present application, taking the flag written into the bitstream as an example, assuming that the fifth value is set to 1 (true) and the sixth value is set to 0 (false), at this time, if the value of the third syntax identification information is 0 (false), then it can be determined that the current chroma block does not adopt the chroma intra-frame block copy prediction mode or the cross-component prediction mode based on the chroma intra-frame block copy technology; if the value of the second syntax identification information is 1 (true), then it can be determined that the current chroma block adopts the chroma intra-frame block copy prediction mode or the cross-component prediction mode based on the chroma intra-frame block copy technology.

[0442] It should be noted that the first value, second value, third value, fourth value, fifth value, sixth value, seventh value, and eighth value mentioned above can be expressed in the same form (i.e., parameter form or numerical form). For example, the first value, third value, fifth value, and seventh value can be 1 or True, and the second value, fourth value, sixth value, and eighth value can be 0 or False.

[0443] In the embodiment of the present application, in the AVS4 exploration phase reference software EVM-0.2, for the prediction mode part of the current chroma block, the structure of the first syntax identification information is shown in Table 2:

[0444] Table 2

[0445] As can be seen in Table 2, when it is determined that the current chroma block adopts the chroma intra block copy prediction mode, the binary string written to the code stream is 10; when it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology, the binary string written to the code stream is 11; when it is determined that the current chroma block adopts other chroma intra prediction modes, the binary string written to the code stream is 0*.

[0446] In an embodiment of the present application, with respect to the structure of the first syntax identification information shown in Table 2, the mode indicates whether to use the cross-component prediction mode based on the chroma intra-frame block copying technology by encoding a flag bit tcibc_flag in the current chroma block related code stream. If the value of the flag bit cibc_flag of the current chroma block is 0, the encoding of the CIBC mode and the TSCPM_CIBC mode is skipped. Other related flag bits for determining the prediction mode are continued to be encoded. If the value of the flag bit cibc_flag of the current chroma block is 1, the value of tcibc_flag is continued to be encoded to indicate whether to use the CIBC or TSCPM_CIBC mode. If the value of tcibc_flag is 0, the prediction mode of the current block is CIBC; if the value of tcibc_flag is 1, the prediction mode of the current block is TSCPM_CIBC.

[0447] In some embodiments of the present application, the encoding method further includes S506:

[0448] S506 : When the reference motion vector is invalid, determine the predicted chroma value of the predicted chroma block according to the sample accuracy of the current chroma block.

[0449] In the embodiments of the present application, the sample accuracy of the current chroma block refers to the representation accuracy of the chroma component (Chroma), which is usually expressed in bits (bit-depth). Higher sample accuracy is usually used to preserve details and color information in the image. For example, 8-bit sample accuracy means that each chroma component is represented by 8 binary bits (or bits). In this way, each chroma component can have 2^8=256 different discrete levels. These levels correspond to color changes, so higher sample accuracy means that more color details can be represented. Higher sample accuracy can provide more color levels, thereby improving color resolution. This is very important for preserving subtle color differences in the image. High sample accuracy helps to more accurately represent colors in the real world and improve color fidelity. Selecting an appropriate sample accuracy also involves a balance between coding efficiency. Higher sample accuracy may require more bits to represent each pixel, thereby increasing the amount of data after encoding.

[0450] In some embodiments of the present application, the implementation of determining the predicted chroma value of the predicted chroma block according to the sample precision of the current chroma block in S506 may include S5061 to S5062:

[0451] S5061. Subtract the sample accuracy from the first preset value to obtain a fourth intermediate parameter.

[0452] S5062: Perform an exponential operation on the second preset value and the fourth intermediate parameter to obtain a predicted chromaticity value of each pixel in the predicted chromaticity block.

[0453] In the embodiment of the present application, the first preset value and the second preset value are pre-set values. For example, the first preset value is 1 and the second preset value is 2.

[0454] In the embodiment of the present application, the fourth intermediate parameter can be expressed as BitDepth-1.

[0455] In the embodiment of the present application, the predicted chroma value of each pixel in the predicted chroma block can be expressed as 2BitDepth-1.

[0456] As you can understand, the predicted chroma values ​​for each pixel in the predicted chroma block are generated through sample precision, preset values, and exponential operations. By adjusting the sample precision and different preset values, different predicted chroma values ​​can be explored, providing more flexible adjustment and optimization options in video encoding, helping to better adapt to different application scenarios and needs in video encoding.

[0457] S504: Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0458] In some embodiments of the present application, when it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology, the chroma residual value is transformed and quantized to obtain a quantized chroma residual value of the current chroma block;

[0459] The quantized chroma residual value of the current chroma block is encoded, and the obtained encoding bits are written into the bitstream.

[0460] In an embodiment of the present application, the chrominance residual value represents the difference between the original chrominance value and the predicted chrominance value of the current chrominance block, and these residual values ​​need to be processed during encoding, including transformation and quantization. The chrominance residual value may change its representation through some transformations (such as discrete cosine transform, DCT). This transformation helps to represent the data as frequency domain coefficients, usually by removing redundant information to improve the compression performance of the data. The transformed frequency domain coefficients need to be quantized to reduce the amount of data. Quantization is achieved by mapping the coefficients to a discrete value domain, which introduces information loss. During the quantization process, different step sizes (quantization step sizes) can be used to control the compression level. Larger quantization step sizes will result in more information loss, but will also produce a higher compression ratio.

[0461] As can be understood, the quantized chroma residual values ​​obtained through the above steps can be more efficiently encoded and transmitted due to their smaller data size. Accordingly, at the decoder, the received quantized chroma residual values ​​are inversely quantized and inversely transformed to restore them to the final reconstructed chroma values. This process is a key step in compression coding, used to minimize data size while maintaining image quality.

[0462] In an embodiment of the present application, a coding method is provided, the method comprising: determining, at an encoding end, a reference motion vector based on a current co-located luminance block corresponding to a current chrominance block; determining, when the reference motion vector is valid, a cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector; determining a predicted chrominance value of the predicted chrominance block based on the cross-component prediction model, and determining first syntax identification information based on the predicted chrominance value; wherein the first syntax identification information is used to indicate whether the current chrominance block adopts a cross-component prediction mode based on a chrominance intra block copy technique; and determining a reconstructed chrominance value of the current chrominance block based on the predicted chrominance value of the predicted chrominance block. Because the cross-component prediction model is determined by the reference luminance block and the reference chrominance block corresponding to the reference motion vector, compared to a cross-component prediction model derived from reconstructed pixels in adjacent rows and columns of the current chrominance block, the flexibility and diversity of determining the cross-component prediction model can be improved, thereby enabling the cross-component prediction model to flexibly cope with more complex coding scenarios, thereby improving the coding efficiency of the current chrominance block.

[0463] It can be understood that, on the one hand, the reference motion vector is determined based on the current co-located luminance block corresponding to the current chrominance block. This step helps to introduce the information of the luminance block into the encoding process of the chrominance block to improve the accurate processing of motion correlation. On the one hand, based on the cross-component prediction model, the predicted chrominance value of the predicted chrominance block is determined, which makes full use of the information of the luminance block, helps to improve the prediction accuracy of the chrominance block, and helps to more accurately restore the chrominance information in the original image at the encoding end, thereby improving the image quality. In general, the above process can improve the encoding accuracy of the chrominance block, enhance the image quality, and utilize cross-component correlation. By introducing the information of the luminance block, the encoding process more comprehensively utilizes the correlation between different components in the video image, thereby improving the encoding effect.

[0464] In some embodiments of the present application, the implementation of determining the reference motion vector according to the current co-located luminance block corresponding to the current chrominance block in S502 may include S601:

[0465] S601: Determine candidate reference samples that meet a preset prediction mode in a current co-located luminance block, and use motion vectors corresponding to the candidate reference samples as reference motion vectors.

[0466] In some embodiments of the present application, the preset prediction mode is: the candidate reference samples adopt the block copy intra prediction mode (Intra Block Copy, IBC) or the common string sub-mode of the string copy intra prediction.

[0467] In an embodiment of the present application, the encoder determines candidate reference samples that satisfy the block copy intra prediction mode or the common string sub-mode of string copy intra prediction in the current co-located luminance block, and uses the motion vector corresponding to the candidate reference sample as the reference motion vector.

[0468] It's understandable that the purpose of the above process is to accurately describe the relationship between the current block and blocks in the reference frame during encoding, thereby improving prediction accuracy. By determining candidate reference samples and their corresponding motion vectors, the encoder can better restore the content of the current block, achieving better image quality.

[0469] It's important to note that both the block copy intra prediction mode and the string copy intra prediction mode are designed for intra-frame prediction. By copying pixel values ​​from an already coded block, they provide a simple and effective prediction method based on adjacent blocks. The block copy intra prediction mode emphasizes copying the entire block, while the string copy intra prediction mode emphasizes the orderly concatenation of pixel values. The choice of mode typically depends on the coding standard and the specific image content. These intra prediction modes help improve video coding efficiency, reduce data size, and achieve better compression performance.

[0470] In some embodiments of the present application, the cross-component prediction model is a linear model; determining the implementation of the cross-component prediction model based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector in S503 may include S5031 to S5032:

[0471] S5031. Determine at least two reference luminance samples in a reference luminance block according to a preset sample selection method, and determine reference chrominance samples corresponding to the at least two reference luminance samples in a reference chrominance block according to a preset sample selection method.

[0472] In the embodiment of the present application, the preset sample point selection method is usually based on certain rules or algorithms, such as uniform distribution within the block, selection in a specific direction, etc.

[0473] In the embodiment of the present application, for each reference luma sample determined in the reference luma block, the corresponding reference chroma sample is found according to the chroma sampling structure (e.g., 4:2:0 or 4:4:4). If the sampling structure of the chroma block is 4:2:0, the corresponding reference chroma samples may be located at adjacent positions in the horizontal and vertical directions.

[0474] It can be understood that selecting at least two reference luminance samples and at least two reference luminance samples according to the preset sample selection method helps to establish the relationship between luminance and chrominance, and improves the accuracy of intra-frame prediction.

[0475] In some embodiments of the present application, the preset sample point selection method includes any one of the following: a center selection method, a vertical selection method, a horizontal selection method, a diagonal selection method, and a vertex selection method.

[0476] It is understandable that, on the one hand, different selection methods can better adapt to different image content and motion patterns. In some scenarios, a certain selection method may better capture important information in the image, thereby improving coding efficiency. On the other hand, different selection methods may help provide more accurate motion vector information. By selecting appropriate samples, motion can be estimated more precisely, thereby improving prediction accuracy. On the other hand, the clever selection of preset sample selection methods can improve the performance of intra-frame prediction. By selecting appropriate samples, the relationship between luminance and chrominance can be better modeled, thereby improving the quality of intra-frame prediction. On the other hand, certain selection methods may have lower encoding complexity, allowing the encoder to perform prediction and motion estimation more efficiently, thereby reducing overall encoding complexity. In summary, by selecting the appropriate preset sample selection method, video encoders can better adapt to the needs of different scenarios, improve image quality, and reduce complexity while maintaining coding efficiency.

[0477] In some embodiments of the present application, the preset sampling point selection method is a center selection method; the width of the reference chroma block is W, and the height of the reference chroma block is H; the width of the reference luminance block is 2W, and the height of the reference luminance block is 2H;

[0478] The at least two reference luma samples include: a first reference luma sample, a second reference luma sample, a third reference luma sample, and a fourth reference luma sample; the reference chroma samples corresponding to the at least two reference luma samples include: a first reference chroma sample, a second reference chroma sample, a third reference chroma sample, and a fourth reference chroma sample; wherein,

[0479] The position coordinates of the first reference chromaticity sample point in the reference chromaticity block are (1, 0); the first reference chromaticity sample point is the chromaticity sample point at the upper left corner of the reference chromaticity block;

[0480] The position coordinates of the second reference chroma sample in the reference chroma block are (W-2, 0);

[0481] The coordinates of the third reference chroma sample in the reference chroma block are (1, H-1);

[0482] The coordinates of the fourth reference chroma sample in the reference chroma block are (W-2, H-1);

[0483] The position coordinates of the first reference luminance sample point in the reference luminance block are (2, 0); the first reference luminance sample point is the luminance sample point at the upper left corner of the reference luminance block;

[0484] The position coordinates of the second reference luminance sample in the reference luminance block are (2×(W-2), 0);

[0485] The position coordinates of the third reference luminance sample in the reference luminance block are (2,2×(H-1));

[0486] The position coordinates of the fourth reference luminance sample in the reference luminance block are (2×(W−2), 2×(H−1)).

[0487] In some embodiments of the present application, the preset sample point selection method is a vertex selection method; the width of the reference chroma block is W, and the height of the reference chroma block is H; the width of the reference luminance block is 2W, and the height of the reference luminance block is 2H;

[0488] In some embodiments of the present application, the at least two reference luma samples include: a first reference luma sample, a second reference luma sample, a third reference luma sample, and a fourth reference luma sample; the reference chroma samples corresponding to each of the at least two reference luma samples include: a first reference chroma sample, a second reference chroma sample, a third reference chroma sample, and a fourth reference chroma sample.

[0489] The position coordinates of the first reference chromaticity sample point in the reference chromaticity block are (0, 0); the first reference chromaticity sample point is the chromaticity sample point at the upper left corner of the reference chromaticity block;

[0490] The position coordinates of the second reference chroma sample in the reference chroma block are (W-1, 0);

[0491] The position coordinates of the third reference chroma sample in the reference chroma block are (0, H-1);

[0492] The coordinates of the fourth reference chroma sample in the reference chroma block are (W-1, H-1);

[0493] The position coordinates of the first reference luminance sample point in the reference luminance block are (0, 0); the first reference luminance sample point is the luminance sample point at the upper left corner of the reference luminance block;

[0494] The position coordinates of the second reference luminance sample in the reference luminance block are (2×(W-1), 0);

[0495] The coordinates of the third reference luminance sample in the reference luminance block are (0, 2×(H-1));

[0496] The position coordinates of the fourth reference luminance sample in the reference luminance block are (2×(W−1), 2×(H−1)).

[0497] It should be noted that the centering selection method and vertex selection method listed above are only examples. In actual applications, other numbers of reference luminance samples and reference chrominance samples can also be selected. In addition, other methods are also provided for selecting the coordinate points of the reference luminance samples and reference chrominance samples. In other words, any of the reference luminance samples and reference chrominance samples can be selected. The specific selection method can be selected according to the actual application scenario, and the embodiments of the present application do not impose any restrictions on this.

[0498] In the embodiment of the present application, the first reference chroma sample corresponds to the first reference luminance sample, the second reference chroma sample corresponds to the second reference luminance sample, the third reference chroma sample corresponds to the third reference luminance sample, and the fourth reference chroma sample corresponds to the fourth reference luminance sample.

[0499] It is understood that the vertex selection method helps to establish a more accurate cross-component prediction model by using the relationship between luma samples and chroma samples. During the encoding process, referring to these samples can improve the prediction accuracy of chroma information, thereby improving video quality.

[0500] S5032. Determine a cross-component prediction model based on at least two reference luma samples and at least two reference chroma samples; wherein the at least two reference luma samples correspond to the at least two reference chroma samples.

[0501] In some embodiments of the present application, the cross-component prediction model includes one or more cross-component prediction sub-models; determining the implementation of the cross-component prediction model according to at least two reference luma samples and at least two reference chroma samples in S5032 may include S50321 to S50322:

[0502] S50321. Group at least two reference luminance samples and at least two reference chrominance samples according to luminance values ​​of the at least two reference luminance samples to obtain at least one reference sample group; wherein each reference sample group includes at least two luminance samples and at least two chrominance samples; the at least two luminance samples correspond to the at least two chrominance samples; the at least two reference luminance samples include at least two luminance samples; the at least two reference chrominance samples include at least two chrominance samples; and at least one reference sample group corresponds to a different preset luminance range.

[0503] In the embodiments of the present application, different reference sample groups contain luma and chroma samples with different preset luminance ranges. This differentiation may help better adapt to brightness variations in different regions of the video. By specifying a different preset luminance range for each reference sample group, possible brightness differences in the video can be more flexibly handled, thereby improving encoding adaptability and performance.

[0504] Exemplarily, the at least one reference sample point group includes: a first sample point group, a second sample point group, a third sample point group, and a fourth sample point group. The first sample point group corresponds to a brightness range of 0 to 50, the second sample point group corresponds to a brightness range of 51 to 100, the third sample point group corresponds to a brightness range of 101 to 150, and the fourth sample point group corresponds to a brightness range of 151 to 255.

[0505] S50322. For each reference sample group in the at least one reference sample group, determine a cross-component prediction sub-model corresponding to each reference sample group according to at least two luma samples and at least two chroma samples in each reference sample group.

[0506] In some embodiments of the present application, S50322 determines, based on at least two luma samples and at least two chroma samples in each reference sample group, an implementation of a cross-component prediction sub-model corresponding to each reference sample group, which may include:

[0507] grouping the at least two luma samples and the at least two chroma samples in each reference sample group according to luma values ​​of the at least two luma samples to obtain a first sample group and a second sample group; wherein the first sample group and the second sample group each include at least one luma sample and at least one chroma sample; the at least one luma sample corresponds to the at least one chroma sample; and a reconstructed luma value of the at least one luma sample in the first sample group is greater than or equal to a reconstructed luma value of the at least one luma sample in the second sample group;

[0508] Determining a maximum reference luminance value and a first reference chrominance value, respectively, based on a reconstructed luminance value of at least one luminance sample and a reconstructed chrominance value of at least one chrominance sample in the first sample group;

[0509] Determine a minimum reference luminance value and a second reference chrominance value according to a reconstructed luminance value of at least one luminance sample and a reconstructed chrominance value of at least one chrominance sample in the second sample point group;

[0510] determining a scaling factor and an offset factor based on a maximum reference luminance value, a first reference chrominance value, a minimum reference luminance value, and a second reference chrominance value;

[0511] According to the scaling factor and the offset factor, the cross-component prediction sub-model corresponding to each reference sample group is determined.

[0512] In the embodiment of the present application, the maximum reference luminance value may be represented as xMax, the first reference chrominance value may be represented as yMax, the minimum reference luminance value may be represented as xMin, the second reference chrominance value may be represented as yMin, the scaling factor may be represented as a, and the offset factor may be represented as b.

[0513] In some embodiments of the present application, determining the scaling factor and the offset factor based on the maximum reference luminance value, the first reference chrominance value, the minimum reference luminance value, and the second reference chrominance value may include:

[0514] Subtracting the first reference chromaticity value (yMax) from the second reference chromaticity value (yMin) to obtain a first intermediate parameter;

[0515] Subtracting the maximum reference brightness value (xMax) from the minimum reference brightness value (xMin) to obtain a second intermediate parameter;

[0516] Dividing the first intermediate parameter by the second intermediate parameter to obtain a scaling factor (a);

[0517] Multiplying the scaling factor (a) and the minimum reference brightness value (xMin) to obtain a third intermediate parameter;

[0518] The second reference chromaticity value (yMin) is subtracted from the third intermediate parameter to obtain an offset factor (b).

[0519] In an embodiment of the present application, the first intermediate parameter can be expressed as yMax-yMin. The second intermediate parameter can be expressed as xMax-xMin. The scaling factor can be expressed as a=(yMax-yMin) / (xMax-xMin). The third intermediate parameter can be expressed as a×xMin. The offset factor can be expressed as yMin-a×xMin.

[0520] It can be understood that determining the scaling factor and offset factor can map the reference luminance and chrominance values ​​to a standard range, thereby achieving normalization and helping to more consistently process luminance and chrominance information in different scenarios. By determining the scaling factor and offset factor, the prediction model can be made more robust and adaptable to different luminance and chrominance conditions. By performing appropriate luminance and chrominance mapping, data redundancy can be reduced, encoding efficiency can be improved, and image information can be represented more compactly. In general, by determining the scaling factor and offset factor, the relationship between luminance and chrominance can be better handled, improving encoding performance and image quality.

[0521] In some embodiments of the present application, the cross-component prediction model is a nonlinear model; determining the implementation of the cross-component prediction model based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector in S304 may include:

[0522] Selecting all or part of the reference chroma samples in the reference chroma block;

[0523] A cross-component prediction model is determined based on all or part of the reference chroma samples, reference luma samples corresponding to all or part of the reference chroma samples in a reference luma block, and neighborhood reference luma samples of the reference luma samples.

[0524] In an embodiment of the present application, when the cross-component prediction model is a nonlinear model, the cross-component prediction model can be expressed by formula (3).

[0525] It can be understood that by establishing a cross-component prediction model based on reference chrominance samples and corresponding reference luma samples, the adaptability of the prediction model can be enhanced, making it better suited to different types and scenes of video content. Considering the neighborhood reference luma samples of the reference luma samples can more comprehensively capture luma information, helping to improve the accuracy of the prediction model, which can be important for processing information such as local features and texture in the image. By more accurately modeling cross-component relationships, it is expected that the distortion introduced by the prediction will be reduced, thereby improving the overall video quality, including higher compression efficiency and better visual quality.

[0526] In some embodiments of the present application, the neighborhood reference luma samples include one or more of the following: a reference luma sample (N) located above the reference luma sample, a reference luma sample (S) located below the reference luma sample, a reference luma sample (W) located to the left of the reference luma sample, and a reference luma sample (E) located to the right of the reference luma sample.

[0527] In an embodiment of the present application, by considering the above-mentioned neighborhood reference luminance samples, the context and local features of the luminance information can be more comprehensively captured, which helps to improve the accuracy and adaptability of the cross-component prediction model. Such information consideration can generally better simulate the changes and textures of the luminance components in the image.

[0528] In some embodiments of the present application, the implementation of determining candidate reference samples that satisfy a preset prediction mode in the current co-located luminance block in S601 may include:

[0529] According to the preset M position information, the candidate reference sample points corresponding to the preset M position information are traversed in the current co-located luminance block to obtain the candidate reference sample points that meet the preset prediction mode; wherein M is a positive integer greater than or equal to 1, and i is a positive integer less than M.

[0530] In some embodiments of the present application, the M pieces of location information include one or more of the following:

[0531] The position of the middle of the current co-located luminance block;

[0532] The upper left position of the current co-located luminance block;

[0533] The upper right position of the current co-located luminance block;

[0534] The lower left position of the current co-located luminance block;

[0535] The lower right position of the current collocated luma block.

[0536] In the embodiment of the present application, the preset M position information can be expressed as {C, TL, TR, BL, BR}, where C represents the center position of the current co-located luminance block, TL represents the upper left position of the current co-located luminance block, TR represents the upper right position of the current co-located luminance block, BL represents the lower left position of the current co-located luminance block, and BR represents the lower right position of the current co-located luminance block.

[0537] In some embodiments of the present application, according to the preset M pieces of position information, candidate reference samples corresponding to the respective preset M pieces of position information are traversed in the current co-located luminance block to obtain candidate reference samples that meet the preset prediction mode, including:

[0538] For the i-th position information among the preset M position information, if the i-th candidate reference sample corresponding to the i-th position information in the current co-located luminance block does not satisfy the preset prediction mode, continue to traverse the i+1-th candidate reference sample corresponding to the i+1-th position information in the current co-located luminance block until the i+1-th candidate reference sample satisfies the preset prediction mode, and determine the i+1-th candidate reference sample as the candidate reference sample that satisfies the preset prediction mode; or,

[0539] In a case where the i-th candidate reference sample point satisfies the preset prediction mode, the i-th candidate reference sample point is determined as a candidate reference sample point that satisfies the preset prediction mode.

[0540] In an embodiment of the present application, for the i-th position information among the preset M position information, the i-th candidate reference sample corresponding thereto is considered. It is determined whether the i-th candidate reference sample in the current co-located luminance block satisfies the preset prediction mode. If the i-th candidate reference sample does not satisfy the preset prediction mode, then the i+1-th candidate reference sample corresponding to the i+1-th position information in the current co-located luminance block is continuously traversed. If the i-th candidate reference sample satisfies the preset prediction mode, then the i-th candidate reference sample is determined as a candidate reference sample that satisfies the preset prediction mode.

[0541] It can be understood that, on the one hand, by checking each position information one by one, it can be ensured that the selected candidate reference samples better match the preset conditions in the prediction mode, thereby improving the accuracy of the prediction. On the one hand, selecting candidate reference samples that meet the preset conditions helps to improve the prediction quality of the image block, thereby improving the visual quality of the overall image. On the one hand, through the preset position information and conditions, appropriate candidate reference samples can be selected according to different scenarios and requirements, making the prediction mode more flexible and adaptable. On the one hand, the effective selection of candidate reference samples can reduce redundant information, thereby improving the efficiency and performance of encoding in video compression. In general, the above steps help to improve the performance of the cross-component prediction model in video coding, making it better adapted to different prediction scenarios and requirements.

[0542] In some embodiments of the present application, the implementation of determining the predicted chroma value of the predicted chroma block based on the cross-component prediction model in S503 may include S5031 to S5032:

[0543] S5031. Determine, through a cross-component prediction model, candidate predicted chroma values ​​of a candidate chroma prediction block according to the reconstructed luminance values ​​of each pixel in the current co-located luminance block; wherein the candidate chroma prediction block is different in size from the current chroma block.

[0544] In an embodiment of the present application, the reconstructed luminance value of each pixel in the current co-located luminance block is input into the cross-component prediction model to obtain the candidate predicted chrominance value of the candidate chrominance prediction block.

[0545] In some embodiments of the present application, the cross-component prediction model includes at least one cross-component prediction sub-model; and the implementation of determining the candidate predicted chrominance value of the candidate chrominance prediction block according to the reconstructed luminance value of each pixel in the current co-located luminance block using the cross-component prediction model in S3041 may include:

[0546] For each pixel in the current co-located luminance block, the reconstructed luminance value of each pixel is input into the corresponding cross-component prediction sub-model to obtain a candidate predicted chrominance value corresponding to each pixel; wherein the preset luminance range corresponding to the reconstructed luminance value of each pixel matches the cross-component prediction sub-model;

[0547] Determine the candidate predicted chrominance value of the candidate chrominance prediction block according to the candidate predicted chrominance value corresponding to each pixel in the current co-located luminance block.

[0548] It can be understood that, on the one hand, the use of different cross-component prediction sub-models for each pixel can better adapt to the brightness and chrominance characteristics of different areas in the image. This adaptability helps to improve the performance of the encoder in various image scenarios. On the other hand, the use of the preset brightness range corresponding to each pixel and the cross-component prediction sub-model provides fine-grained control of different pixels, which enables the encoder to better cope with subtle differences that may exist in the image and improve the flexibility of encoding. In general, the above steps help to better capture the relationship between brightness and chrominance through a more refined cross-component prediction sub-model, thereby improving the quality of chrominance prediction and coding efficiency.

[0549] S5032. Downsample the candidate predicted chroma values ​​of the candidate chroma prediction block to obtain predicted chroma values ​​of the predicted chroma block.

[0550] In the embodiment of the present application, the candidate predicted chroma values ​​of the candidate chroma prediction block are downsampled by a six-tap filter [1 2 1; 1 2 1]. This process can be expressed by formula (4).

[0551] It can be understood that, on the one hand, the cross-component prediction model allows for better capture of the complex relationship between luminance and chrominance. By using the reconstructed luminance value of the same-position luminance block, the predicted chrominance value can more accurately reflect the details and features in the image. On the other hand, since the size of the candidate chrominance prediction block is different from the current chrominance block, this method can adapt in size, making the prediction more adaptable to the details and structures of different areas in the image. In general, the above steps combine the advantages of information capture, size adaptability and coding efficiency, which helps to improve the quality of chrominance prediction and reduce the amount of data while maintaining efficient coding.

[0552] In another embodiment of the present application, a coding and decoding method is provided. The core idea of ​​the method is to combine TSCPM and CIBC technology, which is hereinafter represented by TSCPM_CIBC. The main process includes four parts:

[0553] 1) Obtain the luminance reference block (i.e., reference luminance block) and chrominance reference block (i.e., reference chrominance block) corresponding to the block motion vector (i.e., reference motion vector);

[0554] 2) Derivation of a cross-component model (i.e., a cross-component prediction model) based on the obtained luminance reference block and chrominance reference block;

[0555] 3) Calculate the pixel value of the intermediate prediction block (i.e., the candidate predicted chroma value of the candidate prediction block) based on the derived cross-component model and the reconstructed pixel value of the co-located luminance block (i.e., the current co-located luminance block) corresponding to the current chroma block to be encoded (i.e., the current chroma block);

[0556] 4) Downsample the intermediate prediction block to obtain the final chrominance prediction block (i.e., the predicted chrominance value of the predicted chrominance block).

[0557] In an embodiment of the present application, the encoding and decoding method may include the following steps:

[0558] Step 1. First, the activation condition of this mode is similar to the CIBC technology, that is, if the luminance sample located at the position {C, TL, TR, BL, BR} on the luminance co-located block of the current chrominance block to be encoded is a block copy intra-frame prediction mode or a normal string sub-mode of string copy intra-frame prediction, then the current block can use the cross-component prediction mode based on the chrominance intra-frame block copy technology.

[0559] In this embodiment, if the conditions for using the TSCPM_CIBC technique are met, the system first traverses the five preset positions {C, TL, TR, BL, BR} in the co-located luma block corresponding to the current chroma block to be encoded in a fixed order. The BV at the luma sample that first meets the conditions is obtained as the reference BV for the current block. The corresponding luma and chroma reference blocks are obtained from this BV. If the BV is invalid, meaning that no valid reconstructed pixel values ​​can be obtained from it, the predicted values ​​for all samples in the current chroma block are set to 2BitDepth-1.

[0560] Step 2: Select sample points from the obtained luminance reference block and chrominance reference block for deriving a cross-component model, where the sample points can be all or part of the sample points of the reference block, and the derived cross-component model can be a linear model or a nonlinear model.

[0561] In an embodiment of the present application, referring to the implementation scheme of the original AVS3 technology TSCPM, the selection of sample points is changed from obtaining 4 pixel points from the reconstructed pixels in an adjacent row and column of the current block to selecting 4 pixel points from the reference block pointed to by BV. The current pixel point selection scheme is specifically: pixel points in the four area positions of the upper left, upper right, lower left, and lower right of the current block.

[0562] In the embodiment of the present application, assume that the chrominance block to be encoded is of size W×H, with a width of W and a height of H, x represents the horizontal coordinate, y represents the vertical coordinate, and the coordinate of the upper left corner of the current block is (0,0). Then the positions of the four chrominance reconstruction pixels are (1,0), (w-2,0), (1,h-1), and (w-2,h-1). The size of the corresponding luminance block to be encoded is 2W×2H, and the positions of the corresponding four luminance reconstruction pixels are (2,0), (2×(w-2),0), (2,2×(h-1)), and (2×(w-2),2×(h-1)). The luminance reconstruction pixels and chrominance reconstruction pixels at the four corresponding positions are bound to each other one by one, and the four selected luminance reconstruction pixels are sorted and grouped, with the two points with larger pixel values ​​forming a group and the two points with smaller pixel values ​​forming a group. The average value of the group with larger luminance reconstruction pixel values ​​is recorded as xMax, and the average value of the group with smaller pixel values ​​is recorded as xMin. Similarly, the values ​​corresponding to the chromaticity reconstructed pixel values ​​are calculated and recorded as yMax and yMin, respectively. The cross-component model in this solution is a linear model, with the scaling factor recorded as a and the offset factor recorded as b. Thus, a = (yMax - yMin) / (xMax - xMin) and b = yMin - a × xMin.

[0563] Step 3: Based on the derived linear model parameters a and b, and the reconstructed pixel values ​​in the same luminance block corresponding to the current chrominance block to be encoded, an intermediate prediction block can be generated. The block size is the same as the same luminance block size, that is, 2W×2H. The pixel value of the intermediate prediction block is given by the formula P t (x,y)=a×R Luma (x, y) + b is calculated, where (x, y) represents the horizontal and vertical coordinates of the corresponding pixel point, and both are integers. The value range of x is [0, 2W-1], and the value range of y is [0, 2H-1]. Luma Represents the reconstructed pixel value of the same luminance block, P t Indicates the calculated intermediate prediction value of the intermediate prediction block.

[0564] Step 4: Downsample the intermediate prediction block to obtain the final chrominance prediction block. In this scheme, a six-tap filter [1 2 1; 1 2 1] is used for downsampling, and the final chrominance prediction block is used as the prediction output under the TSCPM_CIBC mode.

[0565] In an embodiment of the present application, an implementation of a decoding end is provided, including:

[0566] The decoder obtains the bitstream information and parses it. When parsing the intra prediction mode of the current chroma block to be encoded, it analyzes the value of tcibc_flag. If the value of tcibc_flag is 0, it uses another prediction mode and sets the prediction mode to that mode. If tcibc_flag is 1, it sets the prediction mode of the current chroma block to TSCPM_CIBC. It then continues parsing other related bitstream information.

[0567] During the prediction decoding process of the current coded chroma block, if the prediction mode is TSCPM_CIBC, the following prediction process is performed: according to the five preset positions {C, TL, TR, BL, BR} in the co-located luminance block corresponding to the current chroma block to be encoded, they are traversed in a fixed order, and the BV at the luminance sample that first meets the conditions is obtained as the reference BV of the current block. If the BV is invalid, the prediction values ​​of all samples of the current chroma block are set to 2BitDepth-1. If the BV is valid, the corresponding reference blocks of luminance and chroma are obtained respectively through the BV.

[0568] Let the size of the current chrominance block be W x H. From the chrominance reference block, obtain the chrominance reconstructed pixel values ​​for the four pixels at positions (1, 0), (w-2, 0), (1, h-1), and (w-2, h-1). From the luma reference block, obtain the luma reconstructed pixel values ​​for the four pixels at positions (2, 0), (2×(w-2), 0), (2, 2×(h-1)), and (2×(w-2), 2×(h-1)). Bind the luma and chrominance reconstructed pixels at the four corresponding positions one by one. Sort and group the four selected luma reconstructed pixels, with the two with larger values ​​forming one group and the two with smaller values ​​forming another. The average value of the group with larger luma reconstructed pixel values ​​is denoted as xMax, and the average value of the group with smaller values ​​is denoted as xMin. Similarly, calculate the corresponding values ​​for the chrominance reconstructed pixel values ​​and denote them as yMax and yMin, respectively. The cross-component model in this scheme is a linear model, with a scaling factor denoted as a and a shift factor denoted as b. Then we can get a=(yMax-yMin) / (xMax-xMin), b=yMin-a×xMin. According to the derived linear model parameters a and b, from the formula P t (x,y)=a×R Luma The intermediate prediction block is calculated by (x, y) + b, and then downsampled using a six-tap filter [1 2 1; 1 2 1] to obtain the final chrominance prediction block. The inverse transform and inverse quantization operations are then performed.

[0569] In an embodiment of the present application, an implementation of an encoding end is provided, including:

[0570] First, we traverse the five preset positions {C, TL, TR, BL, BR} in the co-located luma block corresponding to the current chroma block to be encoded in a fixed order. The BV at the luma sample that first meets the requirements is obtained as the reference BV for the current block. If the BV is invalid (i.e., no valid reconstructed pixel values ​​can be obtained from it), the prediction values ​​for all samples in the current chroma block are set to 2BitDepth-1. If the BV is valid, the corresponding luma and chroma reference blocks are obtained from it. Let the size of the current chroma block be WxH. The reconstructed chroma pixel values ​​for the four pixels at positions (1,0), (w-2,0), (1,h-1), and (w-2,h-1) are obtained from the chroma reference block. The reconstructed luma pixel values ​​for the four pixels at positions (2,0), (2×(w-2),0), (2,2×(h-1)), and (2×(w-2),2×(h-1)) are obtained from the luma reference block. The brightness reconstruction pixels and chromaticity reconstruction pixels at four corresponding positions are bound to each other one by one, and the four selected brightness reconstruction pixels are sorted and grouped, with the two points with larger pixel values ​​forming a group and the two points with smaller pixel values ​​forming a group. The average value of the group with larger brightness reconstruction pixel values ​​is recorded as xMax, and the average value of the group with smaller pixel values ​​is recorded as xMin. Similarly, the values ​​corresponding to the chromaticity reconstruction pixel values ​​are calculated and recorded as yMax and yMin respectively. The cross-component model of this scheme is a linear model, the scaling factor is recorded as a, and the offset factor is recorded as b. Then we can get a=(yMax-yMin) / (xMax-xMin), b=yMin-a×xMin. Based on the derived linear model parameters a and b, by formula P t (x,y)=a×R Luma (x,y)+b is calculated to obtain the intermediate prediction block, and finally a six-tap filter [1 2 1; 1 2 1] is used to downsample the intermediate prediction block to obtain the final chrominance prediction block.

[0571] The current chroma prediction block is compared with the original chroma block to calculate the pixel distortion value (SAD). The bit cost of the coded bitstream is estimated. Based on this information, the RDCost of the mode is calculated and compared with the rate-distortion cost of other prediction modes. If the rate-distortion cost of the TSCPM_CIBC mode is the lowest, the value of tcibc_flag is set to 1; otherwise, the value of tcibc_flag is set to 0. Finally, during the bitstream encoding stage, the value of the flag bit tcibc_flag is written to the bitstream.

[0572] The performance test results of the encoding and decoding method provided in the embodiment of the present application on the AVS4 exploration phase reference software EVM-0.2 under the general test conditions for screen content encoding are shown in Table 3 below:

[0573] Table 3

[0574] It can be seen that the encoding and decoding method provided in the embodiment of the present application can effectively utilize the information of the chroma intra-frame block copy technology to obtain relatively matching luminance reference blocks and chroma reference blocks, and combine the spirit of the two-step cross-component prediction technology to derive a set of cross-component model parameters based on the obtained reference blocks, and apply them to the current block to be encoded to improve the accuracy of the prediction, thereby effectively improving the encoding performance without introducing additional complexity.

[0575] In an embodiment of the present application, a new cross-component prediction mode is proposed. This mode obtains a set of corresponding luminance reference blocks and chrominance reference blocks through the method of chrominance intra-frame block copying technology, and selects sample points from them to derive a set of cross-component models. Then, according to the methods of the two cross-component prediction modes, the cross-component model is applied to the co-located luminance block corresponding to the current chrominance block to be encoded to obtain an intermediate prediction block, and finally the final prediction block is generated by downsampling.

[0576] In the embodiment of the present application, the derivation process of the cross-component model is mainly carried out with reference to the original technology TSCPM of the AVS3 standard. Since the sources of the reference sample points are different, the methods for selecting the reference sample points are different. The sample point selection scheme in this scheme can be improved, including selecting 4 pixel points at different positions, or increasing the number of selected sample points, and changing the calculation scheme of the linear model.

[0577] In the embodiments of the present application, in TSCPM, only one linear model is used between the luma and chroma of the same coding block. If this is expanded to a multi-model cross-component linear model, multiple models can be provided for the same coding block. Adjacent luma and chroma pixels are divided into different categories based on a classification threshold, and the pixels in each category are used to calculate different model parameters.

[0578] In one embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, a code stream is provided, wherein the code stream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:

[0579] The value of the first syntax identification information, the value of the second syntax identification information, the value of the third syntax identification information, and the quantized chroma residual value of the current chroma block; wherein the first syntax identification information is used to indicate whether the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology; the second syntax identification information is used to indicate whether the current chroma block adopts the chroma intra-frame block copy prediction mode; the third syntax identification information is used to indicate whether the current chroma block adopts the chroma intra-frame block copy prediction mode or the cross-component prediction mode based on the chroma intra-frame block copy technology.

[0580] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, see FIG17 , which shows a schematic diagram of the structure of a decoder provided in an embodiment of the present application. As shown in FIG17 , the decoder 1000 includes a decoding part 1001 and a first determining part 1002, wherein:

[0581] The decoding part 1001 is configured to parse the code stream and determine the first syntax identification information;

[0582] The first determining portion 1002 is configured to determine a reference motion vector according to a current co-located luma block corresponding to the current chroma block, when the first syntax identification information indicates that the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technique;

[0583] When the reference motion vector is valid, determining a cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector;

[0584] Determining a predicted chroma value for a predicted chroma block based on the cross-component prediction model;

[0585] Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0586] In some embodiments, the cross-component prediction model characterizes that a reconstructed luminance value of a current co-located luminance block corresponding to the current chrominance block has a linear or nonlinear relationship with a predicted chrominance value of the predicted chrominance block.

[0587] In some embodiments, the first determining portion 1002 is further configured to determine candidate reference samples that satisfy a preset prediction mode in the current co-located luminance block, and use the motion vector corresponding to the candidate reference sample as a reference motion vector.

[0588] In some embodiments, the first determination part 1002 is further configured to determine at least two reference luma samples in the reference luma block according to a preset sample selection method, and determine reference chroma samples corresponding to each of the at least two reference luma samples in the reference chroma block according to the preset sample selection method; determine the cross-component prediction model based on the at least two reference luma samples and the at least two reference chroma samples; wherein the at least two reference luma samples correspond to the at least two reference chroma samples.

[0589] In some embodiments, the cross-component prediction model includes one or more cross-component prediction sub-models; the first determination part 1002 is further configured to group the at least two reference luma samples and the at least two reference chroma samples according to the luma values ​​of the at least two reference luma samples to obtain at least one reference sample group; wherein each reference sample group includes at least two luma samples and at least two chroma samples; the at least two luma samples correspond to the at least two chroma samples; the at least two reference luma samples include the at least two luma samples; the at least two reference chroma samples include the at least two chroma samples; the at least one reference sample group corresponds to a different preset luma range; for each reference sample group in the at least one reference sample group, the cross-component prediction sub-model corresponding to each reference sample group is determined based on the at least two luma samples and the at least two chroma samples in each reference sample group.

[0590] In some embodiments, the first determining portion 1002 is further configured to group the at least two luma samples and the at least two chroma samples in each reference sample group according to the luma values ​​of the at least two luma samples to obtain a first sample group and a second sample group; wherein the first sample group and the second sample group each include at least one luma sample and at least one chroma sample; the at least one luma sample corresponds to the at least one chroma sample; the reconstructed luma value of the at least one luma sample in the first sample group is greater than or equal to the reconstructed luma value of the at least one luma sample in the second sample group; and according to the The maximum reference luminance value and the first reference chrominance value are determined respectively based on the reconstructed luminance value of at least one luminance sample and the reconstructed chrominance value of at least one chrominance sample in the first sample group; the minimum reference luminance value and the second reference chrominance value are determined respectively based on the reconstructed luminance value of at least one luminance sample and the reconstructed chrominance value of at least one chrominance sample in the second sample group; a scaling factor and an offset factor are determined based on the maximum reference luminance value, the first reference chrominance value, the minimum reference luminance value and the second reference chrominance value; and the cross-component prediction sub-model corresponding to each reference sample group is determined based on the scaling factor and the offset factor.

[0591] In some embodiments, the first determining part 1002 is further configured to perform a subtraction operation on the first reference chromaticity value and the second reference chromaticity value to obtain a first intermediate parameter; perform a subtraction operation on the maximum reference luminance value and the minimum reference luminance value to obtain a second intermediate parameter; perform a division operation on the first intermediate parameter and the second intermediate parameter to obtain the scaling factor; perform a multiplication operation on the scaling factor and the minimum reference luminance value to obtain a third intermediate parameter; and perform a subtraction operation on the second reference chromaticity value and the third intermediate parameter to obtain the offset factor.

[0592] In some embodiments, the cross-component prediction model is a nonlinear model; the first determination part 1002 is further configured to select all or part of the reference chroma samples in the reference chroma block; and determine the cross-component prediction model based on the all or part of the reference chroma samples, the reference luminance samples in the reference luminance block corresponding to the all or part of the reference chroma samples, and the neighborhood reference luminance samples of the reference luminance samples.

[0593] In some embodiments, the neighborhood reference luma samples include one or more of the following: a reference luma sample above the reference luma sample, a reference luma sample below the reference luma sample, a reference luma sample to the left of the reference luma sample, and a reference luma sample to the right of the reference luma sample.

[0594] In some embodiments, the first determination part 1002 is further configured to traverse the candidate reference sample points corresponding to each of the preset M position information in the current co-located luminance block according to the preset M position information, to obtain the candidate reference sample points that meet the preset prediction mode; wherein M is a positive integer greater than or equal to 1, and i is a positive integer less than M.

[0595] In some embodiments, the first determining part 1002 is further configured to, for the i-th position information among the preset M position information, continue to traverse the i+1-th candidate reference sample corresponding to the i+1-th position information in the current co-located luminance block when the i-th candidate reference sample corresponding to the i-th position information in the current co-located luminance block does not satisfy the preset prediction mode, until the i+1-th candidate reference sample satisfies the preset prediction mode, and determine the i+1-th candidate reference sample as the candidate reference sample that satisfies the preset prediction mode; or, when the i-th candidate reference sample satisfies the preset prediction mode, determine the i-th candidate reference sample as the candidate reference sample that satisfies the preset prediction mode.

[0596] In some embodiments, the M position information includes one or more of the following: the middle position of the current co-located luminance block; the upper left position of the current co-located luminance block; the upper right position of the current co-located luminance block; the lower left position of the current co-located luminance block; and the lower right position of the current co-located luminance block.

[0597] In some embodiments, the preset prediction mode is: the candidate reference samples adopt a block copy intra prediction mode or a common string sub-mode of a string copy intra prediction mode.

[0598] In some embodiments, the preset sample point selection method includes any one of the following: a center selection method, a vertical selection method, a horizontal selection method, a diagonal selection method, and a vertex selection method.

[0599] In some embodiments, the preset sample selection method is a center selection method; the width of the reference chroma block is W, and the height of the reference chroma block is H; the width of the reference luminance block is 2W, and the height of the reference luminance block is 2H; the at least two reference luminance samples include: a first reference luminance sample, a second reference luminance sample, a third reference luminance sample, and a fourth reference luminance sample; the reference chroma samples corresponding to each of the at least two reference luminance samples include: a first reference chroma sample, a second reference chroma sample, a third reference chroma sample, and a fourth reference chroma sample; wherein the position coordinates of the first reference chroma sample in the reference chroma block are (1,0); the first reference chroma sample is the chroma sample in the upper left corner of the reference chroma block; the second reference chroma sample is the chroma sample in the upper left corner of the reference chroma block The position coordinates of the chrominance sample in the reference chrominance block are (W-2, 0); the position coordinates of the third reference chrominance sample in the reference chrominance block are (1, H-1); the position coordinates of the fourth reference chrominance sample in the reference chrominance block are (W-2, H-1); the position coordinates of the first reference luminance sample in the reference luminance block are (2, 0); the first reference luminance sample is the luminance sample in the upper left corner of the reference luminance block; the position coordinates of the second reference luminance sample in the reference luminance block are (2×(W-2), 0); the position coordinates of the third reference luminance sample in the reference luminance block are (2, 2×(H-1)); and the position coordinates of the fourth reference luminance sample in the reference luminance block are (2×(W-2), 2×(H-1)).

[0600] In some embodiments, the first determining part 1002 is further configured to determine the predicted chroma value of the predicted chroma block according to the sample accuracy of the current chroma block when the reference motion vector is invalid.

[0601] In some embodiments, the first determination part 1002 is further configured to perform a subtraction operation on the sample accuracy and a first preset value to obtain a fourth intermediate parameter; and perform an exponential operation on the second preset value and the fourth intermediate parameter to obtain a predicted chromaticity value of each pixel point in the predicted chromaticity block.

[0602] In some embodiments, the first determination part 1002 is further configured to determine that the reference motion vector is invalid when the reference motion vector satisfies at least one of the following conditions: the reference luminance block or the reference chrominance block corresponding to the reference motion vector has not been reconstructed, the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector does not match, and the reference motion vector is out of bounds; or, determine that the reference motion vector is valid when the reference motion vector satisfies the following conditions: the reference luminance block or the reference chrominance block corresponding to the reference motion vector has been reconstructed, the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector matches, and the reference motion vector is not out of bounds.

[0603] In some embodiments, the first determination part 1002 is further configured to determine the candidate predicted chroma value of the candidate chroma prediction block according to the reconstructed luminance value of each pixel in the current co-located luminance block through the cross-component prediction model; wherein the candidate chroma prediction block is different in size from the current chroma block; and downsample the candidate predicted chroma value of the candidate chroma prediction block to obtain the predicted chroma value of the predicted chroma block.

[0604] In some embodiments, the cross-component prediction model includes at least one cross-component prediction sub-model; the first determination part 1002 is also configured to input the reconstructed luminance value of each pixel point in the current co-located luminance block into the corresponding cross-component prediction sub-model to obtain the candidate predicted chromaticity value corresponding to each pixel point; wherein the preset luminance range corresponding to the reconstructed luminance value of each pixel point matches the cross-component prediction sub-model; and determine the candidate predicted chromaticity value of the candidate chromaticity prediction block based on the candidate predicted chromaticity value corresponding to each pixel point in the current co-located luminance block.

[0605] In some embodiments, the decoding part 1001 is further configured to parse the code stream and determine the second syntax identification information; when the second syntax identification information indicates that the current chroma block does not adopt the chroma frame intra block copy prediction mode, perform the step of parsing the code stream to obtain the first syntax identification information.

[0606] In some embodiments, the decoding part 1001 is further configured to determine that the current chroma block adopts the chroma intra-frame block copy prediction mode if the value of the second syntax identification information is a first value; or, if the value of the second syntax identification information is a second value, determine that the current chroma block does not adopt the chroma intra-frame block copy prediction mode.

[0607] In some embodiments, the decoding part 1001 is further configured to determine that the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology if the value of the first syntax identification information is the third value; or, if the value of the first syntax identification information is the fourth value, determine that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra-frame block copy technology.

[0608] In some embodiments, the decoding part 1001 is further configured to parse the code stream to determine third syntax identification information; when the third syntax identification information indicates that the current chroma block adopts the chroma intra-frame block copy prediction mode or the cross-component prediction mode based on the chroma intra-frame block copy technology, perform the step of parsing the code stream to obtain the first syntax identification information.

[0609] In some embodiments, the decoding part 1001 is further configured to determine that the current chroma block adopts the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology if the value of the third syntax identification information is the fifth value; or, if the value of the third syntax identification information is the sixth value, determine that the current chroma block does not adopt the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology.

[0610] In some embodiments, the decoding part 1001 is further configured to determine that the current chroma block adopts a cross-component prediction mode based on the chroma intra-frame block copy technology if the value of the first syntax identification information is the seventh value; or, if the value of the first syntax identification information is the eighth value, determine that the current chroma block adopts the chroma intra-frame block copy prediction mode.

[0611] In some embodiments, the decoding part 1001 is further configured to parse the code stream to obtain the chroma residual value of the current chroma block.

[0612] In some embodiments, the first determination part 1002 is further configured to perform inverse transformation and inverse quantization on the chroma residual value to obtain the inverse quantized chroma residual value of the current chroma block; and determine the reconstructed chroma value of the current chroma block based on the inverse quantized chroma residual value and the predicted chroma value.

[0613] It is understandable that in the embodiments of the present application, a "part" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.

[0614] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0615] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the decoder 1000. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.

[0616] Based on the composition of the above-mentioned decoder 1000 and the computer-readable storage medium, refer to Figure 18, which shows a specific hardware structure diagram of the decoder 1000 provided in an embodiment of the present application. As shown in Figure 18, the decoder 1000 may include: a first communication interface 1101, a first memory 1102 and a first processor 1103; each component is coupled together through a first bus system 1104. It can be understood that the first bus system 1104 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 1104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 1104 in Figure 18. Among them,

[0617] The first communication interface 1101 is used to receive and send signals when sending and receiving information with other external network elements;

[0618] A first memory 1102 is used to store computer programs that can be run on the first processor 1103;

[0619] The first processor 1103 is configured to, when running the computer program, execute:

[0620] Parsing the code stream to determine first syntax identification information;

[0621] When the first syntax identification information indicates that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology, determining a reference motion vector according to a current co-located luminance block corresponding to the current chroma block;

[0622] When the reference motion vector is valid, determining a cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector;

[0623] Determining a predicted chroma value for a predicted chroma block based on the cross-component prediction model;

[0624] Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0625] It is understood that the first memory 1102 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 1102 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0626] The first processor 1103 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 1103. The above-mentioned first processor 1103 can 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. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented as a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 1102 , and the first processor 1103 reads the information in the first memory 1102 and completes the steps of the above method in combination with its hardware.

[0627] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0628] Optionally, as another embodiment, the first processor 1103 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0629] This embodiment provides a decoder, in which, since the cross-component prediction model is determined by the reference luminance block and the reference chrominance block corresponding to the reference motion vector, compared with the cross-component prediction model derived based on the reconstructed pixels in an adjacent row and column of the current chrominance block, the flexibility and diversity of determining the cross-component prediction model can be improved, so that the cross-component prediction model can flexibly cope with more complex decoding scenarios, thereby improving the decoding efficiency of the current chrominance block.

[0630] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see Figure 19, which shows a schematic diagram of the composition structure of an encoder provided by an embodiment of the present application. As shown in Figure 19, the encoder 2000 may include a second determining part 2001 and an encoding part 2002; wherein,

[0631] The second determining part 2001 is configured to determine a reference motion vector according to a current co-located luminance block corresponding to the current chrominance block;

[0632] When the reference motion vector is valid, determining the cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector;

[0633] Determining a predicted chroma value of a predicted chroma block based on the cross-component prediction model, and determining first syntax identification information according to the predicted chroma value; wherein the first syntax identification information is used to indicate whether the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technology;

[0634] Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0635] In some embodiments, the cross-component prediction model characterizes that a reconstructed luminance value of a current co-located luminance block corresponding to the current chrominance block has a linear or nonlinear relationship with a predicted chrominance value of the predicted chrominance block.

[0636] In some embodiments, the second determining part 2001 is further configured to determine candidate reference samples that meet a preset prediction mode in the current co-located luminance block, and use the motion vector corresponding to the candidate reference sample as a reference motion vector.

[0637] In some embodiments, the second determination part 2001 is further configured to determine at least two reference luma samples in the reference luma block according to a preset sample selection method, and determine reference chroma samples corresponding to the at least two reference luma samples in the reference chroma block according to the preset sample selection method; determine the cross-component prediction model based on the at least two reference luma samples and the at least two reference chroma samples; wherein the at least two reference luma samples correspond to the at least two reference chroma samples.

[0638] In some embodiments, the cross-component prediction model includes one or more cross-component prediction sub-models; the second determination part 2001 is further configured to group the at least two reference luma samples and the at least two reference chroma samples according to the luma values ​​of the at least two reference luma samples to obtain at least one reference sample group; wherein each reference sample group includes at least two luma samples and at least two chroma samples; the at least two luma samples correspond to the at least two chroma samples; the at least two reference luma samples include the at least two luma samples; the at least two reference chroma samples include the at least two chroma samples; the at least one reference sample group corresponds to a different preset luma range; for each reference sample group in the at least one reference sample group, the cross-component prediction sub-model corresponding to each reference sample group is determined based on the at least two luma samples and the at least two chroma samples in the each reference sample group.

[0639] In some embodiments, the second determining portion 2001 is further configured to group the at least two luma samples and the at least two chroma samples in each reference sample group according to the luma values ​​of the at least two luma samples to obtain a first sample group and a second sample group; wherein the first sample group and the second sample group each include at least one luma sample and at least one chroma sample; the at least one luma sample corresponds to the at least one chroma sample; the reconstructed luma value of the at least one luma sample in the first sample group is greater than or equal to the reconstructed luma value of the at least one luma sample in the second sample group; and according to the The maximum reference luminance value and the first reference chrominance value are determined respectively based on the reconstructed luminance value of at least one luminance sample and the reconstructed chrominance value of at least one chrominance sample in the first sample group; the minimum reference luminance value and the second reference chrominance value are determined respectively based on the reconstructed luminance value of at least one luminance sample and the reconstructed chrominance value of at least one chrominance sample in the second sample group; a scaling factor and an offset factor are determined based on the maximum reference luminance value, the first reference chrominance value, the minimum reference luminance value and the second reference chrominance value; and the cross-component prediction sub-model corresponding to each reference sample group is determined based on the scaling factor and the offset factor.

[0640] In some embodiments, the second determining part 2001 is further configured to perform a subtraction operation on the first reference chromaticity value and the second reference chromaticity value to obtain a first intermediate parameter; perform a subtraction operation on the maximum reference luminance value and the minimum reference luminance value to obtain a second intermediate parameter; perform a division operation on the first intermediate parameter and the second intermediate parameter to obtain the scaling factor; perform a multiplication operation on the scaling factor and the minimum reference luminance value to obtain a third intermediate parameter; and perform a subtraction operation on the second reference chromaticity value and the third intermediate parameter to obtain the offset factor.

[0641] In some embodiments, the cross-component prediction model is a nonlinear model; the second determination part 2001 is further configured to select all or part of the reference chroma samples in the reference chroma block; and determine the cross-component prediction model based on the all or part of the reference chroma samples, the reference luminance samples in the reference luminance block corresponding to the all or part of the reference chroma samples, and the neighborhood reference luminance samples of the reference luminance samples.

[0642] In some embodiments, the neighborhood reference luma samples include one or more of the following: a reference luma sample above the reference luma sample, a reference luma sample below the reference luma sample, a reference luma sample to the left of the reference luma sample, and a reference luma sample to the right of the reference luma sample.

[0643] In some embodiments, the second determination part 2001 is further configured to traverse the candidate reference sample points corresponding to each of the preset M position information in the current co-located luminance block according to the preset M position information, to obtain the candidate reference sample points that meet the preset prediction mode; wherein M is a positive integer greater than or equal to 1, and i is a positive integer less than M.

[0644] In some embodiments, the second determining part 2001 is further configured to, for the i-th position information among the preset M position information, continue to traverse the i+1-th candidate reference sample corresponding to the i+1-th position information in the current co-located luminance block when the i-th candidate reference sample corresponding to the i-th position information in the current co-located luminance block does not satisfy the preset prediction mode, until the i+1-th candidate reference sample satisfies the preset prediction mode, and determine the i+1-th candidate reference sample as the candidate reference sample that satisfies the preset prediction mode; or, when the i-th candidate reference sample satisfies the preset prediction mode, determine the i-th candidate reference sample as the candidate reference sample that satisfies the preset prediction mode.

[0645] In some embodiments, the M position information includes one or more of the following: the middle position of the current co-located luminance block; the upper left position of the current co-located luminance block; the upper right position of the current co-located luminance block; the lower left position of the current co-located luminance block; and the lower right position of the current co-located luminance block.

[0646] In some embodiments, the preset prediction mode is: the candidate reference samples adopt a block copy intra prediction mode or a common string sub-mode of a string copy intra prediction mode.

[0647] In some embodiments, the preset sample point selection method includes any one of the following: a center selection method, a vertical selection method, a horizontal selection method, a diagonal selection method, and a vertex selection method.

[0648] In some embodiments, the preset sample selection method is a center selection method; the width of the reference chroma block is W, and the height of the reference chroma block is H; the width of the reference luminance block is 2W, and the height of the reference luminance block is 2H; the at least two reference luminance samples include: a first reference luminance sample, a second reference luminance sample, a third reference luminance sample, and a fourth reference luminance sample; the reference chroma samples corresponding to each of the at least two reference luminance samples include: a first reference chroma sample, a second reference chroma sample, a third reference chroma sample, and a fourth reference chroma sample; wherein the position coordinates of the first reference chroma sample in the reference chroma block are (1,0); the first reference chroma sample is the chroma sample in the upper left corner of the reference chroma block; the second reference chroma sample is the chroma sample in the upper left corner of the reference chroma block The position coordinates of the chrominance sample in the reference chrominance block are (W-2, 0); the position coordinates of the third reference chrominance sample in the reference chrominance block are (1, H-1); the position coordinates of the fourth reference chrominance sample in the reference chrominance block are (W-2, H-1); the position coordinates of the first reference luminance sample in the reference luminance block are (2, 0); the first reference luminance sample is the luminance sample in the upper left corner of the reference luminance block; the position coordinates of the second reference luminance sample in the reference luminance block are (2×(W-2), 0); the position coordinates of the third reference luminance sample in the reference luminance block are (2, 2×(H-1)); and the position coordinates of the fourth reference luminance sample in the reference luminance block are (2×(W-2), 2×(H-1)).

[0649] In some embodiments, the second determining part 2001 is further configured to determine the predicted chroma value of the predicted chroma block according to the sample accuracy of the current chroma block when the reference motion vector is invalid.

[0650] In some embodiments, the second determination part 2001 is further configured to perform a subtraction operation on the sample accuracy and a first preset value to obtain a fourth intermediate parameter; and perform an exponential operation on the second preset value and the fourth intermediate parameter to obtain a predicted chromaticity value of each pixel point in the predicted chromaticity block.

[0651] In some embodiments, the second determination part 2001 is further configured to determine that the reference motion vector is invalid when the reference motion vector satisfies at least one of the following conditions: the reference luminance block or the reference chrominance block corresponding to the reference motion vector has not been reconstructed, the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector does not match, and the reference motion vector is out of bounds; or, determine that the reference motion vector is valid when the reference motion vector satisfies the following conditions: the reference luminance block or the reference chrominance block corresponding to the reference motion vector has been reconstructed, the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector matches, and the reference motion vector is not out of bounds.

[0652] In some embodiments, the second determination part 2001 is further configured to determine the candidate predicted chroma value of the candidate chroma prediction block according to the reconstructed luminance value of each pixel in the current co-located luminance block through the cross-component prediction model; wherein the candidate chroma prediction block is different in size from the current chroma block; and downsample the candidate predicted chroma value of the candidate chroma prediction block to obtain the predicted chroma value of the predicted chroma block.

[0653] In some embodiments, the cross-component prediction model includes at least one cross-component prediction sub-model; the second determination part 2001 is also configured to input the reconstructed luminance value of each pixel point in the current co-located luminance block into the corresponding cross-component prediction sub-model to obtain the candidate predicted chromaticity value corresponding to each pixel point; wherein the preset luminance range corresponding to the reconstructed luminance value of each pixel point matches the cross-component prediction sub-model; and determine the candidate predicted chromaticity value of the candidate chromaticity prediction block based on the candidate predicted chromaticity value corresponding to each pixel point in the current co-located luminance block.

[0654] In some embodiments, the second determination part 2001 is further configured to determine the chroma residual value of the current chroma block based on the original chroma value and the predicted chroma value of the current chroma block; perform rate-distortion cost calculation on the chroma residual value of the current chroma block to obtain a first rate-distortion cost value corresponding to the cross-component prediction mode based on the chroma intra-frame block copy technology adopted by the current chroma block; determine the prediction mode adopted by the current chroma block based on the first rate-distortion cost value; and determine the first syntax identification information based on the prediction mode adopted by the current chroma block.

[0655] In some embodiments, the encoding part 2002 is configured to encode the first syntax identification information and write the obtained encoded bits into a bitstream.

[0656] In some embodiments, the second determination part 2001 is further configured to determine that the current chroma block adopts the cross-component prediction mode based on the chroma intra block copy technology when the first rate-distortion cost value is less than or equal to the second rate-distortion cost value corresponding to each of the one or more preset candidate prediction modes; or to determine that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra block copy technology when the first rate-distortion cost value is greater than the second rate-distortion cost value corresponding to each of the one or more preset candidate prediction modes.

[0657] In some embodiments, the one or more candidate prediction modes include: a chroma intra block copy prediction mode; the second determination part 2001 is further configured to determine that the current chroma block adopts the chroma intra block copy prediction mode when the first rate-distortion cost value is greater than the second rate-distortion cost value corresponding to the chroma intra block copy prediction mode.

[0658] In some embodiments, the second determination part 2001 is further configured to determine that the value of the first syntax identification information is a third value when it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology; or to determine that the value of the first syntax identification information is a fourth value when it is determined that the current chroma block does not adopt the cross-component prediction mode based on the chroma intra-frame block copy technology.

[0659] In some embodiments, the second determining portion 2001 is further configured to determine second grammar identification information.

[0660] In some embodiments, the second determination part 2001 is further configured to set the value of the second syntax identification information to the first value when it is determined that the current chroma block adopts the chroma intra-frame block copy prediction mode; or to set the value of the second syntax identification information to the second value when it is determined that the current chroma block does not adopt the chroma intra-frame block copy prediction mode.

[0661] In some embodiments, the encoding part 2002 is further configured to encode the second syntax identification information and write the obtained encoded bits into a bitstream.

[0662] In some embodiments, the second determination part 2001 is further configured to set the value of the first syntax identification information to the seventh value when it is determined that the current chroma block adopts the cross-component prediction mode based on the chroma intra-frame block copy technology; or, when it is determined that the current chroma block adopts the chroma intra-frame block copy prediction mode, set the value of the first syntax identification information to the eighth value.

[0663] In some embodiments, the second determining portion 2001 is further configured to determine third grammar identification information.

[0664] In some embodiments, the second determination part 2001 is further configured to set the value of the third syntax identification information to the fifth value when it is determined that the current chroma block adopts the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology; or, when it is determined that the current chroma block does not adopt the chroma intra block copy prediction mode or the cross-component prediction mode based on the chroma intra block copy technology, set the value of the third syntax identification information to the sixth value.

[0665] In some embodiments, the encoding part 2002 is further configured to encode the third syntax identification information and write the obtained encoded bits into the bitstream.

[0666] In some embodiments, the second determination part 2001 is further configured to, when it is determined that the current chroma block adopts a cross-component prediction mode based on the chroma intra-frame block copying technology, perform transformation processing and quantization processing on the chroma residual value to obtain the quantized chroma residual value of the current chroma block.

[0667] In some embodiments, the encoding part 2002 is further configured to encode the quantized chroma residual value of the current chroma block and write the obtained encoded bits into the bitstream.

[0668] It is understood that in this embodiment, a "portion" may be a circuit portion, a processor portion, a program portion, or software portion, and may also be a module or non-modular. Furthermore, the various components in this embodiment may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional modules.

[0669] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium, which is applied to the encoder 2000 and stores a computer program. When the computer program is executed by the second processor, it implements any of the methods in the aforementioned embodiments.

[0670] Based on the composition of the above-mentioned encoder 2000 and the computer-readable storage medium, refer to Figure 20, which shows a specific hardware structure diagram of the encoder 2000 provided in an embodiment of the present application. As shown in Figure 20, the encoder 2000 may include: a second communication interface 2101, a second memory 2102 and a second processor 2103; each component is coupled together through a second bus system 2104. It can be understood that the second bus system 2104 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 2104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 2104 in Figure 20. Among them,

[0671] The second communication interface 2101 is used to receive and send signals during the process of sending and receiving information between other external network elements;

[0672] The second memory 2102 is used to store computer programs that can be run on the second processor 2103;

[0673] The second processor 2103 is configured to, when running the computer program, execute:

[0674] Determine a reference motion vector based on a current co-located luminance block corresponding to the current chrominance block;

[0675] When the reference motion vector is valid, determining the cross-component prediction model based on a reference luminance block and a reference chrominance block corresponding to the reference motion vector;

[0676] Determining a predicted chroma value of a predicted chroma block based on the cross-component prediction model, and determining first syntax identification information according to the predicted chroma value; wherein the first syntax identification information is used to indicate whether the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technology;

[0677] Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

[0678] Optionally, as another embodiment, the second processor 2103 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0679] It can be understood that the hardware functions of the second memory 2102 are similar to those of the first memory 1102, and the hardware functions of the second processor 2103 are similar to those of the first processor 1103; they will not be described in detail here.

[0680] This embodiment provides an encoder, in which, since the cross-component prediction model is determined by the reference luminance block and the reference chrominance block corresponding to the reference motion vector, compared with the cross-component prediction model derived based on the reconstructed pixels of an adjacent row and column of the current chrominance block, the flexibility and diversity of determining the cross-component prediction model can be improved, so that the cross-component prediction model can flexibly cope with more complex coding scenarios, thereby improving the coding efficiency of the current chrominance block.

[0681] In yet another embodiment of the present application, referring to FIG21 , a schematic diagram of the structure of a coding and decoding system provided by an embodiment of the present application is shown. As shown in FIG21 , the coding and decoding system 3000 may include a decoder 3001 and an encoder 3002 .

[0682] In the embodiment of the present application, the decoder 3001 may be the decoder described in any one of the aforementioned embodiments, and the encoder 3002 may be the encoder described in any one of the aforementioned embodiments.

[0683] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0684] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0685] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0686] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0687] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0688] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the embodiments of the present application. Industrial Applicability

[0689] In an embodiment of the present application, at the decoding end, the code stream is parsed to determine the first syntax identification information; when the first syntax identification information indicates that the current chroma block adopts a cross-component prediction mode based on the chroma intra-frame block copy technology, the reference motion vector is determined based on the current co-located luminance block corresponding to the current chroma block; when the reference motion vector is valid, the cross-component prediction model is determined based on the reference luminance block and the reference chroma block corresponding to the reference motion vector; based on the cross-component prediction model, the predicted chroma value of the predicted chroma block is determined; and based on the predicted chroma value of the predicted chroma block, the reconstructed chroma value of the current chroma block is determined. At the encoding end, a reference motion vector is determined based on the current co-located luminance block corresponding to the current chrominance block; when the reference motion vector is valid, a cross-component prediction model is determined based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector; based on the cross-component prediction model, a predicted chrominance value of the predicted chrominance block is determined, and based on the predicted chrominance value, first syntax identification information is determined; wherein the first syntax identification information is used to indicate whether the current chrominance block adopts a cross-component prediction mode based on the chrominance intra-frame block copy technology; based on the predicted chrominance value of the predicted chrominance block, a reconstructed chrominance value of the current chrominance block is determined. Since the cross-component prediction model is determined by the reference luminance block and the reference chrominance block corresponding to the reference motion vector, compared to the cross-component prediction model derived from the reconstructed pixels of the adjacent row and column of the current chrominance block, the flexibility and diversity of determining the cross-component prediction model can be improved, so that the cross-component prediction model can flexibly cope with more complex encoding and decoding scenarios, thereby improving the encoding and decoding efficiency of the current chrominance block.

Claims

1. A decoding method, applied to a decoder, the method comprises: analyzing a bitstream to determine first syntax identification information; when the first syntax identification information indicates that the current chrominance block adopts a cross-component prediction mode based on chrominance intra block copy technology, determining a reference motion vector according to a current co-located luma block corresponding to the current chrominance block; when the reference motion vector is valid, determining a cross-component prediction model based on a reference luma block and a reference chrominance block corresponding to the reference motion vector; determining a predicted chrominance value of a predicted chrominance block based on the cross-component prediction model; determining a reconstructed chrominance value of the current chrominance block according to the predicted chrominance value of the predicted chrominance block.

2. The method according to claim 1, wherein, the cross-component prediction model represents that there is a linear or non-linear relationship between a reconstructed luma value of a current co-located luma block corresponding to the current chrominance block and a predicted chrominance value of the predicted chrominance block.

3. The method according to claim 1 or 2, wherein, the determining a reference motion vector according to a current co-located luma block corresponding to the current chrominance block comprises: determining candidate reference samples that meet a preset prediction mode in the current co-located luma block, and using a motion vector corresponding to the candidate reference samples as the reference motion vector.

4. The method according to any one of claims 1 to 3, wherein, the cross-component prediction model is a linear model; the determining a cross-component prediction model based on a reference luma block and a reference chrominance block corresponding to the reference motion vector comprises: determining at least two reference luma samples in the reference luma block according to a preset sample selection method, and determining reference chrominance samples corresponding to the at least two reference luma samples respectively in the reference chrominance block according to the preset sample selection method; determining the cross-component prediction model according to the at least two reference luma samples and at least two reference chrominance samples; wherein the at least two reference luma samples correspond to the at least two reference chrominance samples.

5. The method according to claim 4, wherein, the cross-component prediction model includes one or more cross-component prediction sub-models; the determining a cross-component prediction model according to the at least two reference luma samples and at least two reference chrominance samples comprises: grouping the at least two reference luma samples and the at least two reference chrominance samples according to the luma values of the at least two reference luma samples to obtain at least one reference sample group; wherein each reference sample group includes at least two luma samples and at least two chrominance samples; the at least two luma samples correspond to the at least two chrominance samples; the at least two reference luma samples include the at least two luma samples; the at least two reference chrominance samples include the at least two chrominance samples; the at least one reference sample group corresponds to different preset luma ranges; For each reference sample point group in the at least one reference sample point group, determine the cross-component prediction sub-model corresponding to each reference sample point group according to at least two luminance sample points and the at least two chrominance sample points in each reference sample point group.

6. The method according to claim 5, wherein, the determining the cross-component prediction sub-model corresponding to each reference sample point group according to at least two luminance sample points and the at least two chrominance sample points in each reference sample point group includes: Group the at least two luminance sample points and the at least two chrominance sample points in each reference sample point group according to the luminance values of the at least two luminance sample points, to obtain a first sample point group and a second sample point group; wherein, each of the first sample point group and the second sample point group includes at least one luminance sample point and at least one chrominance sample point; the at least one luminance sample point corresponds to the at least one chrominance sample point; the reconstructed luminance value of at least one luminance sample point in the first sample point group is greater than or equal to the reconstructed luminance value of at least one luminance sample point in the second sample point group; Determine a maximum reference luminance value and a first reference chrominance value respectively according to the reconstructed luminance value of at least one luminance sample point and the reconstructed chrominance value of at least one chrominance sample point in the first sample point group; Determine a minimum reference luminance value and a second reference chrominance value respectively according to the reconstructed luminance value of at least one luminance sample point and the reconstructed chrominance value of at least one chrominance sample point in the second sample point group; Based on the maximum reference luminance value, the first reference chrominance value, the minimum reference luminance value and the second reference chrominance value, determine a scaling factor and an offset factor; According to the scaling factor and the offset factor, determine the cross-component prediction sub-model corresponding to each reference sample point group.

7. The method according to claim 6, wherein, the determining the scaling factor and the offset factor based on the maximum reference luminance value, the first reference chrominance value, the minimum reference luminance value and the second reference chrominance value includes: Perform a subtraction operation on the first reference chrominance value and the second reference chrominance value to obtain a first intermediate parameter; Perform a subtraction operation on the maximum reference luminance value and the minimum reference luminance value to obtain a second intermediate parameter; Perform a division operation on the first intermediate parameter and the second intermediate parameter to obtain the scaling factor; Perform a multiplication operation on the scaling factor and the minimum reference luminance value to obtain a third intermediate parameter; Perform a subtraction operation on the second reference chrominance value and the third intermediate parameter to obtain the offset factor.

8. The method according to any one of claims 1 to 3, wherein, the cross-component prediction model is a non-linear model; the determining the cross-component prediction model based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector includes: Select all or part of the reference chrominance sample points in the reference chrominance block; Determine the cross-component prediction model according to the all or part of the reference chrominance sample points, the reference luminance sample points corresponding to the all or part of the reference chrominance sample points in the reference luminance block, and the neighboring reference luminance sample points of the reference luminance sample points.

9. The method according to claim 8, wherein, the neighboring reference luminance samples include one or more of the following: a reference luminance sample above the reference luminance sample, a reference luminance sample below the reference luminance sample, a reference luminance sample to the left of the reference luminance sample, and a reference luminance sample to the right of the reference luminance sample.

10. The method according to any one of claims 3 to 9, wherein, determining candidate reference samples that meet a preset prediction mode in the current co-located luminance block includes: traversing candidate reference samples corresponding to each of the preset M position information in the current co-located luminance block according to the preset M position information to obtain candidate reference samples that meet the preset prediction mode; where M is a positive integer greater than or equal to 1, and i is a positive integer less than M.

11. The method according to claim 10, wherein, traversing candidate reference samples corresponding to each of the preset M position information in the current co-located luminance block according to the preset M position information to obtain candidate reference samples that meet the preset prediction mode includes: for the i-th position information among the preset M position information, when the i-th candidate reference sample corresponding to the i-th position information in the current co-located luminance block does not meet the preset prediction mode, continue to traverse the (i + 1)-th candidate reference sample corresponding to the (i + 1)-th position information in the current co-located luminance block until the (i + 1)-th candidate reference sample meets the preset prediction mode, and determine the (i + 1)-th candidate reference sample as the candidate reference sample that meets the preset prediction mode; or, when the i-th candidate reference sample meets the preset prediction mode, determine the i-th candidate reference sample as the candidate reference sample that meets the preset prediction mode.

12. The method according to claim 10 or 11, wherein, the M position information includes one or more of the following: the middle position of the current co-located luminance block; the upper left position of the current co-located luminance block; the upper right position of the current co-located luminance block; the lower left position of the current co-located luminance block; the lower right position of the current co-located luminance block.

13. The method according to any one of claims 3 to 12, wherein, the preset prediction mode is: the candidate reference sample adopts a block copy intra prediction mode or an ordinary string sub-mode of string copy intra prediction.

14. The method according to any one of claims 4 to 12, wherein, the preset sample selection method includes any one of the following: a centered selection method, a vertical selection method, a horizontal selection method, a diagonal selection method, and a vertex selection method.

15. The method according to any one of claims 4 to 12, wherein, the preset sample selection method is a centered selection method; the width of the reference chrominance block is W, and the height of the reference chrominance block is H; the width of the reference luminance block is 2W, and the height of the reference luminance block is 2H; At least two reference luminance samples include: a first reference luminance sample, a second reference luminance sample, a third reference luminance sample, and a fourth reference luminance sample; reference chrominance samples corresponding to the at least two reference luminance samples respectively include: a first reference chrominance sample, a second reference chrominance sample, a third reference chrominance sample, and a fourth reference chrominance sample; wherein, The position coordinates of the first reference chrominance sample in the reference chrominance block are (1, 0); the first reference chrominance sample is the chrominance sample at the upper left corner of the reference chrominance block; The position coordinates of the second reference chrominance sample in the reference chrominance block are (W - 2, 0); The position coordinates of the third reference chrominance sample in the reference chrominance block are (1, H - 1); The position coordinates of the fourth reference chrominance sample in the reference chrominance block are (W - 2, H - 1); The position coordinates of the first reference luminance sample in the reference luminance block are (2, 0); the first reference luminance sample is the luminance sample at the upper left corner of the reference luminance block; The position coordinates of the second reference luminance sample in the reference luminance block are (2×(W - 2), 0); The position coordinates of the third reference luminance sample in the reference luminance block are (2, 2×(H - 1)); The position coordinates of the fourth reference luminance sample in the reference luminance block are (2×(W - 2), 2×(H - 1)).

16. The method according to any one of claims 1 to 15, wherein, The method further includes: When the reference motion vector is invalid, determining the predicted chrominance value of the predicted chrominance block according to the sample precision of the current chrominance block.

17. The method according to claim 16, wherein, The determining the predicted chrominance value of the predicted chrominance block according to the sample precision of the current chrominance block includes: Performing a subtraction operation on the sample precision and a first preset value to obtain a fourth intermediate parameter; Performing an exponential operation on a second preset value and the fourth intermediate parameter to obtain the predicted chrominance value of each pixel point in the predicted chrominance block.

18. The method according to claim 16 or 17, wherein, The method further includes: When the reference motion vector satisfies at least one of the following conditions: the reference luminance block or reference chrominance block corresponding to the reference motion vector has not been reconstructed, the prediction mode of the reference luminance block or reference chrominance block corresponding to the reference motion vector does not match, and the reference motion vector is out of bounds, determining that the reference motion vector is invalid; or, When the reference motion vector satisfies the following conditions: the reference luminance block or reference chrominance block corresponding to the reference motion vector has been reconstructed, the prediction mode of the reference luminance block or reference chrominance block corresponding to the reference motion vector matches, and the reference motion vector is not out of bounds, determining that the reference motion vector is valid.

19. The method according to any one of claims 1 to 18, wherein, The determining the predicted chrominance value of the predicted chrominance block based on the cross-component prediction model includes: Using the cross-component prediction model, determine candidate predicted chrominance values for a candidate chrominance prediction block according to the reconstructed luminance values of each pixel point in the current co-located luminance block; wherein, the size of the candidate chrominance prediction block is different from that of the current chrominance block; Downsample the candidate predicted chrominance values of the candidate chrominance prediction block to obtain the predicted chrominance values of the predicted chrominance block.

20. The method according to claim 19, wherein, the cross-component prediction model includes at least one cross-component prediction sub-model; the step of using the cross-component prediction model to determine candidate predicted chrominance values for a candidate chrominance prediction block according to the reconstructed luminance values of each pixel point in the current co-located luminance block includes: For the reconstructed luminance value of each pixel point in the current co-located luminance block, input the reconstructed luminance value of each pixel point into the corresponding cross-component prediction sub-model to obtain the candidate predicted chrominance value corresponding to each pixel point; wherein, the preset luminance range corresponding to the reconstructed luminance value of each pixel point matches the cross-component prediction sub-model; Determine the candidate predicted chrominance values of the candidate chrominance prediction block according to the candidate predicted chrominance values corresponding to each pixel point in the current co-located luminance block.

21. The method according to claim 1, wherein, the method further includes: Parse the bitstream to determine second syntax identification information; When the second syntax identification information indicates that the current chrominance block does not adopt the chrominance intra block copy prediction mode, perform the step of parsing the bitstream to obtain the first syntax identification information.

22. The method according to claim 21, wherein, the step of parsing the bitstream to determine second syntax identification information includes: If the value of the second syntax identification information is a first value, determine that the current chrominance block adopts the chrominance intra block copy prediction mode; or, If the value of the second syntax identification information is a second value, determine that the current chrominance block does not adopt the chrominance intra block copy prediction mode.

23. The method according to any one of claims 1, 21 or 22, wherein, the step of parsing the bitstream to determine first syntax identification information includes: If the value of the first syntax identification information is a third value, determine that the current chrominance block adopts the cross-component prediction mode based on the chrominance intra block copy technology; or, If the value of the first syntax identification information is a fourth value, determine that the current chrominance block does not adopt the cross-component prediction mode based on the chrominance intra block copy technology.

24. The method according to claim 1, wherein, the method further includes: Parse the bitstream to determine third syntax identification information; When the third syntax identification information indicates that the current chrominance block adopts the chrominance intra block copy prediction mode or the cross-component prediction mode based on the chrominance intra block copy technology, perform the step of parsing the bitstream to obtain the first syntax identification information.

25. The method according to claim 24, wherein, the step of parsing the bitstream to determine third syntax identification information includes: If the value of the third syntax flag information is the fifth value, determine that the current chrominance block adopts a chrominance intra block copy prediction mode or a cross-component prediction mode based on the chrominance intra block copy technology; or, If the value of the third syntax flag information is the sixth value, determine that the current chrominance block does not adopt a chrominance intra block copy prediction mode or a cross-component prediction mode based on the chrominance intra block copy technology.

26. The method according to any one of claims 1, 24 or 25, wherein, the parsing the bitstream to determine the first syntax flag information includes: If the value of the first syntax flag information is the seventh value, determine that the current chrominance block adopts a cross-component prediction mode based on the chrominance intra block copy technology or, If the value of the first syntax flag information is the eighth value, determine that the current chrominance block adopts a chrominance intra block copy prediction mode.

27. The method according to any one of claims 1 to 26, wherein, the determining the reconstructed chrominance value of the current chrominance block according to the predicted chrominance value of the predicted chrominance block includes: parsing the bitstream to obtain the chrominance residual value of the current chrominance block; performing inverse transform processing and inverse quantization processing on the chrominance residual value to obtain the inverse quantized chrominance residual value of the current chrominance block; determining the reconstructed chrominance value of the current chrominance block according to the inverse quantized chrominance residual value and the predicted chrominance value.

28. An encoding method, applied to an encoder, the method comprises: determining a reference motion vector according to a current co-located luma block corresponding to a current chrominance block; when the reference motion vector is valid, determining a cross-component prediction model based on a reference luma block and a reference chrominance block corresponding to the reference motion vector; determining a predicted chrominance value of a predicted chrominance block based on the cross-component prediction model, and determining first syntax flag information according to the predicted chrominance value; wherein, the first syntax flag information is used to indicate whether the current chrominance block adopts a cross-component prediction mode based on the chrominance intra block copy technology; determining the reconstructed chrominance value of the current chrominance block according to the predicted chrominance value of the predicted chrominance block.

29. The method according to claim 28, wherein, the cross-component prediction model represents that there is a linear or non-linear relationship between the reconstructed luma value of the current co-located luma block corresponding to the current chrominance block and the predicted chrominance value of the predicted chrominance block.

30. The method according to claim 28 or 29, wherein, the determining a reference motion vector according to a current co-located luma block corresponding to a current chrominance block includes: determining candidate reference samples satisfying a preset prediction mode in the current co-located luma block, and using the motion vector corresponding to the candidate reference samples as the reference motion vector.

31. The method according to any one of claims 28 to 30, wherein, the cross-component prediction model is a linear model; the determining a cross-component prediction model based on a reference luma block and a reference chrominance block corresponding to the reference motion vector includes: Determine at least two reference luminance samples in the reference luminance block according to a preset sample selection method, and determine reference chrominance samples corresponding to the at least two reference luminance samples respectively in the reference chrominance block according to the preset sample selection method; Determine the cross-component prediction model according to the at least two reference luminance samples and the at least two reference chrominance samples; wherein, the at least two reference luminance samples correspond to the at least two reference chrominance samples.

32. The method according to claim 31, wherein, the cross-component prediction model includes one or more cross-component prediction sub-models; The determining the cross-component prediction model according to the at least two reference luminance samples and the at least two reference chrominance samples includes: Group the at least two reference luminance samples and the at least two reference chrominance samples according to the luminance values of the at least two reference luminance samples to obtain at least one reference sample group; wherein, each reference sample group includes at least two luminance samples and at least two chrominance samples; the at least two luminance samples correspond to the at least two chrominance samples; the at least two reference luminance samples include the at least two luminance samples; the at least two reference chrominance samples include the at least two chrominance samples; the at least one reference sample group corresponds to different preset luminance ranges; For each reference sample group in the at least one reference sample group, determine the cross-component prediction sub-model corresponding to each reference sample group according to the at least two luminance samples and the at least two chrominance samples in each reference sample group.

33. The method according to claim 32, wherein, The determining the cross-component prediction sub-model corresponding to each reference sample group according to the at least two luminance samples and the at least two chrominance samples in each reference sample group includes: Group the at least two luminance samples and the at least two chrominance samples in each reference sample group according to the luminance values of the at least two luminance samples to obtain a first sample group and a second sample group; wherein, each of the first sample group and the second sample group includes at least one luminance sample and at least one chrominance sample; the at least one luminance sample corresponds to the at least one chrominance sample; the reconstructed luminance value of the at least one luminance sample in the first sample group is greater than or equal to the reconstructed luminance value of the at least one luminance sample in the second sample group; Determine a maximum reference luminance value and a first reference chrominance value respectively according to the reconstructed luminance value and the reconstructed chrominance value of the at least one luminance sample in the first sample group; Determine a minimum reference luminance value and a second reference chrominance value respectively according to the reconstructed luminance value and the reconstructed chrominance value of the at least one luminance sample in the second sample group; Determine a scaling factor and an offset factor based on the maximum reference luminance value, the first reference chrominance value, the minimum reference luminance value and the second reference chrominance value; Determine the cross-component prediction sub-model corresponding to each reference sample point group according to the scaling factor and the offset factor.

34. The method according to claim 33, wherein, the determining of the scaling factor and the offset factor based on the maximum reference luminance value, the first reference chrominance value, the minimum reference luminance value, and the second reference chrominance value includes: Performing a subtraction operation on the first reference chrominance value and the second reference chrominance value to obtain a first intermediate parameter; Performing a subtraction operation on the maximum reference luminance value and the minimum reference luminance value to obtain a second intermediate parameter; Performing a division operation on the first intermediate parameter and the second intermediate parameter to obtain the scaling factor; Performing a multiplication operation on the scaling factor and the minimum reference luminance value to obtain a third intermediate parameter; Performing a subtraction operation on the second reference chrominance value and the third intermediate parameter to obtain the offset factor.

35. The method according to any one of claims 28 to 30, wherein, the cross-component prediction model is a non-linear model; the determining of the cross-component prediction model based on the reference luminance block and the reference chrominance block corresponding to the reference motion vector includes: Selecting all or part of the reference chrominance sample points in the reference chrominance block; Determining the cross-component prediction model according to all or part of the reference chrominance sample points, the reference luminance sample points corresponding to the all or part of the reference chrominance sample points in the reference luminance block, and the neighboring reference luminance sample points of the reference luminance sample points.

36. The method according to claim 35, wherein, the neighboring reference luminance sample points include one or more of the following: the reference luminance sample point above the reference luminance sample point, the reference luminance sample point below the reference luminance sample point, the reference luminance sample point to the left of the reference luminance sample point, and the reference luminance sample point to the right of the reference luminance sample point.

37. The method according to any one of claims 30 to 36, characterized in that the determining of the candidate reference sample points satisfying a preset prediction mode in the current co-located luminance block includes: Traversing the candidate reference sample points corresponding to the preset M position information in the current co-located luminance block according to the preset M position information to obtain the candidate reference sample points satisfying the preset prediction mode; where M is a positive integer greater than or equal to 1, and i is a positive integer less than M.

38. The method according to claim 37, characterized in that the traversing of the candidate reference sample points corresponding to the preset M position information in the current co-located luminance block according to the preset M position information to obtain the candidate reference sample points satisfying the preset prediction mode includes: For the i-th position information among the preset M position information, when the i-th candidate reference sample corresponding to the i-th position information in the current co-located luminance block does not meet the preset prediction mode, continue to traverse the (i + 1)-th candidate reference sample corresponding to the (i + 1)-th position information in the current co-located luminance block until the (i + 1)-th candidate reference sample meets the preset prediction mode, and determine the (i + 1)-th candidate reference sample as the candidate reference sample that meets the preset prediction mode; or, When the i-th candidate reference sample meets the preset prediction mode, determine the i-th candidate reference sample as the candidate reference sample that meets the preset prediction mode.

39. The method according to claim 37 or 38, wherein, the M position information includes one or more of the following: the position in the middle of the current co-located luminance block; the position in the upper left of the current co-located luminance block; the position in the upper right of the current co-located luminance block; the position in the lower left of the current co-located luminance block; the position in the lower right of the current co-located luminance block.

40. The method according to any one of claims 30 to 39, wherein, the preset prediction mode is: the candidate reference sample adopts the block copy intra prediction mode or the ordinary string mode of the string copy intra prediction.

41. The method according to any one of claims 31 to 39, wherein, the preset sample selection method includes any one of the following: the center selection method, the vertical selection method, the horizontal selection method, the diagonal selection method, and the vertex selection method.

42. The method according to any one of claims 31 to 39, wherein, the preset sample selection method is the center selection method; the width of the reference chrominance block is W, and the height of the reference chrominance block is H; the width of the reference luminance block is 2W, and the height of the reference luminance block is 2H; at least two reference luminance samples include: the first reference luminance sample, the second reference luminance sample, the third reference luminance sample, and the fourth reference luminance sample; the reference chrominance samples corresponding to the at least two reference luminance samples respectively include: the first reference chrominance sample, the second reference chrominance sample, the third reference chrominance sample, and the fourth reference chrominance sample; wherein, the position coordinate of the first reference chrominance sample in the reference chrominance block is (1, 0); the first reference chrominance sample is the chrominance sample at the upper left corner of the reference chrominance block; the position coordinate of the second reference chrominance sample in the reference chrominance block is (W - 2, 0); the position coordinate of the third reference chrominance sample in the reference chrominance block is (1, H - 1); the position coordinate of the fourth reference chrominance sample in the reference chrominance block is (W - 2, H - 1); the position coordinate of the first reference luminance sample in the reference luminance block is (2, 0); the first reference luminance sample is the luminance sample at the upper left corner of the reference luminance block; the position coordinate of the second reference luminance sample in the reference luminance block is (2×(W - 2), 0); The position coordinates of the third reference luminance sample in the reference luminance block are (2, 2×(H - 1)); The position coordinates of the fourth reference luminance sample in the reference luminance block are (2×(W - 2), 2×(H - 1)).

43. The method according to any one of claims 28 to 39, wherein, the method further comprises: when the reference motion vector is invalid, determining the predicted chrominance value of the predicted chrominance block according to the sample precision of the current chrominance block.

44. The method according to claim 43, wherein, the determining the predicted chrominance value of the predicted chrominance block according to the sample precision of the current chrominance block includes: performing a subtraction operation on the sample precision and a first preset value to obtain a fourth intermediate parameter; performing an exponential operation on a second preset value and the fourth intermediate parameter to obtain the predicted chrominance values of the respective pixel points in the predicted chrominance block.

45. The method according to claim 43 or 44, wherein, the method further comprises: when the reference motion vector satisfies at least one of the conditions that the reference luminance block or the reference chrominance block corresponding to the reference motion vector is not reconstructed, the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector does not match, and the reference motion vector is out of bounds, determining that the reference motion vector is invalid; or, when the reference motion vector satisfies the conditions that the reference luminance block or the reference chrominance block corresponding to the reference motion vector is reconstructed, the prediction mode of the reference luminance block or the reference chrominance block corresponding to the reference motion vector matches, and the reference motion vector is not out of bounds, determining that the reference motion vector is valid.

46. The method according to any one of claims 28 to 45, wherein, the determining the predicted chrominance value of the predicted chrominance block based on the cross-component prediction model includes: determining the candidate predicted chrominance values of the candidate chrominance prediction block through the cross-component prediction model according to the reconstructed luminance values of the respective pixel points in the current co-located luminance block; wherein, the size of the candidate chrominance prediction block is different from that of the current chrominance block; downsampling the candidate predicted chrominance values of the candidate chrominance prediction block to obtain the predicted chrominance value of the predicted chrominance block.

47. The method according to claim 46, wherein, the cross-component prediction model includes at least one cross-component prediction sub-model; the determining the candidate predicted chrominance values of the candidate chrominance prediction block through the cross-component prediction model according to the reconstructed luminance values of the respective pixel points in the current co-located luminance block includes: for the reconstructed luminance value of each pixel point in the current co-located luminance block, inputting the reconstructed luminance value of each pixel point into the corresponding cross-component prediction sub-model to obtain the candidate predicted chrominance value corresponding to each pixel point; wherein, the preset luminance range corresponding to the reconstructed luminance value of each pixel point matches the cross-component prediction sub-model; determining the candidate predicted chrominance values of the candidate chrominance prediction block according to the candidate predicted chrominance values corresponding to the respective pixel points in the current co-located luminance block.

48. The method according to any one of claims 28 to 47, wherein, determining the first syntax identification information according to the predicted chrominance value includes: determining a chrominance residual value of the current chrominance block according to the original chrominance value and the predicted chrominance value of the current chrominance block; calculating a rate-distortion cost for the chrominance residual value of the current chrominance block to obtain a first rate-distortion cost value corresponding to an inter-component prediction mode using a chrominance intra-block copy technique for the current chrominance block; determining a prediction mode adopted by the current chrominance block according to the first rate-distortion cost value; determining the first syntax identification information according to the prediction mode adopted by the current chrominance block.

49. The method according to claim 48, wherein, the method further includes: performing encoding processing on the first syntax identification information and writing the obtained encoded bits into a bitstream.

50. The method according to claim 48, wherein, determining the prediction mode adopted by the current chrominance block according to the first rate-distortion cost value includes: when the first rate-distortion cost value is less than or equal to second rate-distortion cost values respectively corresponding to one or more preset candidate prediction modes, determining that the current chrominance block adopts an inter-component prediction mode using a chrominance intra-block copy technique; when the first rate-distortion cost value is greater than the second rate-distortion cost values respectively corresponding to the one or more preset candidate prediction modes, determining that the current chrominance block does not adopt an inter-component prediction mode using a chrominance intra-block copy technique.

51. The method according to claim 50, wherein, the one or more candidate prediction modes include: a chrominance intra-block copy prediction mode; and when the first rate-distortion cost value is greater than the second rate-distortion cost values respectively corresponding to the one or more preset candidate prediction modes, determining that the current chrominance block does not adopt an inter-component prediction mode using a chrominance intra-block copy technique includes: when the first rate-distortion cost value is greater than the second rate-distortion cost value corresponding to the chrominance intra-block copy prediction mode, determining that the current chrominance block adopts the chrominance intra-block copy prediction mode.

52. The method according to any one of claims 48 to 51, wherein, determining the first syntax identification information according to the prediction mode adopted by the current chrominance block includes: when it is determined that the current chrominance block adopts an inter-component prediction mode using a chrominance intra-block copy technique, determining that the value of the first syntax identification information is a third value; or when it is determined that the current chrominance block does not adopt an inter-component prediction mode using a chrominance intra-block copy technique, determining that the value of the first syntax identification information is a fourth value.

53. The method according to claim 52, wherein, the method further includes: determining second syntax identification information; performing encoding processing on the second syntax identification information and writing the obtained encoded bits into a bitstream; determining the second syntax identification information includes: When it is determined that the current chrominance block adopts the chrominance intra block copy prediction mode, the value of the second syntax identification information is set to a first value; or, When it is determined that the current chrominance block does not adopt the chrominance intra block copy prediction mode, the value of the second syntax identification information is set to a second value.

54. The method according to any one of claims 48 to 51, wherein, determining the first syntax identification information according to the prediction mode adopted by the current chrominance block includes: When it is determined that the current chrominance block adopts the cross-component prediction mode based on the chrominance intra block copy technology, the value of the first syntax identification information is set to a seventh value; or, When it is determined that the current chrominance block adopts the chrominance intra block copy prediction mode, the value of the first syntax identification information is set to an eighth value.

55. The method according to claim 54, wherein, the method further includes: determining a third syntax identification information; performing encoding processing on the third syntax identification information, and writing the obtained encoded bits into a bitstream; determining the third syntax identification information includes: When it is determined that the current chrominance block adopts the chrominance intra block copy prediction mode or the cross-component prediction mode based on the chrominance intra block copy technology, the value of the third syntax identification information is set to a fifth value; or, When it is determined that the current chrominance block does not adopt the chrominance intra block copy prediction mode or the cross-component prediction mode based on the chrominance intra block copy technology, the value of the third syntax identification information is set to a sixth value.

56. The method according to any one of claims 28 to 55, wherein, the method further includes: When it is determined that the current chrominance block adopts the cross-component prediction mode based on the chrominance intra block copy technology, performing transform processing and quantization processing on the chrominance residual value to obtain the quantized chrominance residual value of the current chrominance block; performing encoding processing on the quantized chrominance residual value of the current chrominance block, and writing the obtained encoded bits into a bitstream.

57. A bitstream, which is generated by performing bit encoding on information to be encoded; wherein, the information to be encoded includes at least one of the following: the value of the first syntax identification information, the value of the second syntax identification information, the value of the third syntax identification information, the quantized chrominance residual value of the current chrominance block; wherein, the first syntax identification information is used to indicate whether the current chrominance block adopts the cross-component prediction mode based on the chrominance intra block copy technology; the second syntax identification information is used to indicate whether the current chrominance block adopts the chrominance intra block copy prediction mode; the third syntax identification information is used to indicate whether the current chrominance block adopts the chrominance intra block copy prediction mode or the cross-component prediction mode based on the chrominance intra block copy technology.

58. A decoder, which includes a decoding part and a first determination part, wherein: the decoding part is configured to parse the bitstream and determine the first syntax identification information; The first determination part is configured to determine a reference motion vector according to a current co-located luma block corresponding to the current chroma block when the first syntax identification information indicates that the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technique; When the reference motion vector is valid, determine a cross-component prediction model based on a reference luma block and a reference chroma block corresponding to the reference motion vector; Determine a predicted chroma value of a predicted chroma block based on the cross-component prediction model; Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

59. An encoder, the encoder includes a second determination part, wherein: The second determination part is configured to determine a reference motion vector according to a current co-located luma block corresponding to the current chroma block; When the reference motion vector is valid, determine a cross-component prediction model based on a reference luma block and a reference chroma block corresponding to the reference motion vector; Determine a predicted chroma value of a predicted chroma block based on the cross-component prediction model, and determine first syntax identification information according to the predicted chroma value; wherein, the first syntax identification information is used to indicate whether the current chroma block adopts a cross-component prediction mode based on a chroma intra block copy technique; Determine a reconstructed chroma value of the current chroma block according to the predicted chroma value of the predicted chroma block.

60. A decoder, the decoder includes a first memory and a first processor, wherein: The first memory is configured to store a computer program that can run on the first processor; The first processor is configured to execute the method according to any one of claims 1 to 27 when running the computer program.

61. An encoder, the encoder includes a second memory and a second processor, wherein: The second memory is configured to store a computer program that can run on the second processor; The second processor is configured to execute the method according to any one of claims 28 to 56 when running the computer program.

62. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the method according to any one of claims 1 to 27, or implements the method according to any one of claims 28 to 56.

Citation Information

Patent Citations

  • Chroma intra-frame prediction method and device

    CN110324627A

  • Image component prediction method, encoder, decoder and storage medium

    CN113676732A

  • Constraint of syntax elements for adaptive parameter sets

    CN115398912A

  • Communication Establishment Method And Terminal

    US20190342933A1

  • Methods and apparatuses for cross-component prediction

    US20220239897A1