Method for determining image block prediction samples and encoding and decoding device

By determining the pixel value and color sampling mode of pixel points in the image block, a consistent predictive sample is built, solving the problem of large memory usage on the decoding side, and simplifying the hardware implementation.

CN114979629BActive Publication Date: 2024-12-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110209576.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-24
Publication Date
2024-12-10
Estimated Expiration
2041-02-24

AI Technical Summary

Technical Problem

In the prior art, when derive image block prediction samples, the decoding end occupies a large amount of memory, which leads to difficulty in implementing hardware.

Method used

By obtaining the type of the current string where the current pixel point in the current image block is located, determining the reference pixel value, and combining the color sampling mode of the image block, a prediction sample of the pixel point is obtained, thereby forming a consistent image block prediction sample and reducing memory usage.

Benefits of technology

It reduces the memory usage of image block prediction sample export and simplifies the hardware implementation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979629B_ABST
    Figure CN114979629B_ABST
Patent Text Reader

Abstract

The present application provides a method for determining predicted samples of an image block and a coding and decoding device, the method comprising: obtaining the type of a current string in which a current pixel point in a current image block is located; determining a reference pixel value of the current pixel point according to the type of the current string; determining a color sampling mode of the current image block; obtaining predicted samples of the current pixel point according to the color sampling mode of the current image block and the reference pixel value of the current pixel point; obtaining predicted samples of the current image block according to the predicted samples of the current pixel point, thereby reducing the amount of memory occupied in the process of determining the predicted samples of the current image block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a method for determining image block prediction samples and a coding and decoding device. Background Art

[0002] Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smart phones, computers, e-readers or video players, etc. With the development of video technology, the amount of data included in video data is large. In order to facilitate the transmission of video data, video devices implement video compression technology to make video data more efficiently transmitted or stored.

[0003] At present, spatial prediction or temporal prediction is used to reduce or eliminate redundant information in video data to achieve video data compression. Motion compensation is a commonly used prediction method for video coding. Based on the redundant characteristics of video content in the time domain or spatial domain, the prediction value of the current coding block is derived from the encoded area. Prediction methods based on motion compensation include: inter-frame prediction, intra-frame block copy, intra-frame string copy, etc. The intra-frame string copy prediction method is to divide a coding block into a series of pixel strings according to a certain scanning order. The encoder encodes the type, length and prediction value information of each string of the current coding block in the bitstream. Correspondingly, the decoder derives the prediction sample of the current image block based on the type, length and prediction value information of each string carried in the bitstream, and determines the reconstruction value of the current image block based on the prediction sample of the current image block.

[0004] However, currently the decoding end occupies a large amount of memory when exporting prediction samples. Summary of the invention

[0005] The present application provides a method for determining image block prediction samples and a coding and decoding device, which reduces the memory size required for deriving prediction samples at the decoding end and is conducive to hardware implementation.

[0006] In a first aspect, a method for determining a prediction sample of an image block is provided, comprising:

[0007] Obtaining a type of a current string where a current pixel point in a current image block is located, wherein the current image block includes the current string, and the current string includes at least one pixel point;

[0008] Determining a reference pixel value of the current pixel point according to the type of the current string;

[0009] Determining a color sampling mode of the current image block;

[0010] Obtaining a prediction sample of the current pixel according to a color sampling mode of the current image block and a reference pixel value of the current pixel;

[0011] According to the predicted samples of the current pixel point, the predicted samples of the current image block are obtained.

[0012] In a second aspect, a device for determining a prediction sample of an image block is provided, comprising:

[0013] An acquisition unit, configured to obtain a type of a current string where a current pixel point in a current image block is located, wherein the current image block includes the current string, and the current string includes at least one pixel point;

[0014] A reference pixel value determining unit, used to determine a reference pixel value of the current pixel point according to the type of the current string;

[0015] A mode determination unit, configured to determine a color sampling mode of the current image block;

[0016] A prediction sample determination unit, configured to obtain a prediction sample of the current pixel point according to a color sampling mode of the current image block and a reference pixel value of the current pixel point;

[0017] The prediction sample determination unit is used to obtain the prediction sample of the current image block according to the prediction sample of the current pixel point.

[0018] In a third aspect, a coding device is provided, comprising a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its implementations.

[0019] In a fourth aspect, a decoding device is provided, comprising a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its implementations.

[0020] In a fifth aspect, a chip is provided for implementing the method in the first aspect or its various implementations. Specifically, the chip includes: a processor for calling and running a computer program from a memory so that a device equipped with the chip executes the method in the first aspect or its various implementations.

[0021] In a sixth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method in the above-mentioned first aspect or its various implementations.

[0022] In a seventh aspect, a computer program product is provided, comprising computer program instructions, which enable a computer to execute the method in the above-mentioned first aspect or its various implementations.

[0023] In an eighth aspect, a computer program is provided, which, when executed on a computer, enables the computer to execute the method in the first aspect or its various implementations.

[0024] Through the technical solution provided by the present application, the type of the current string where the current pixel point in the current image block is located is obtained; according to the type of the current string, the reference pixel value of the current pixel point is determined; the color sampling mode of the current image block is determined; according to the color sampling mode of the current image block and the reference pixel value of the current pixel point, the predicted sample of the current pixel point is obtained; according to the predicted sample of the current pixel point, the predicted sample of the current image block is obtained. That is, the decoding end or the encoding end considers the color sampling mode of the current image block in the process of determining the reference pixel value of the pixel point in the current image block, so that the color sampling mode of the predicted sample of the current image block formed according to the predicted sample of the current pixel point is consistent with the color sampling mode of the current image block. For example, if the color sampling mode of the current image block is YUV4:2:0, the color sampling mode of the predicted sample of the current image block is also YUV4:2:0, thereby reducing the memory usage in the process of determining the predicted sample of the current image block. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0026] Figure 1 A schematic block diagram of a video encoding and decoding system involved in an embodiment of the present application;

[0027] Figure 2 is a schematic block diagram of a video encoder provided in an embodiment of the present application;

[0028] Figure 3 is a schematic block diagram of a decoding framework provided in an embodiment of the present application;

[0029] Figure 4 A schematic diagram of an intra-frame block copy involved in an embodiment of the present application;

[0030] Figure 5 It is a schematic diagram of an intra-frame string replication involved in an embodiment of the present application;

[0031] Figure 6 A flowchart of a method for determining image block prediction samples provided in an embodiment of the present application;

[0032] Fig. 7A A schematic diagram of a color sampling mode involved in an embodiment of the present application;

[0033] Figure 7B This is a schematic diagram of another color sampling mode involved in an embodiment of the present application;

[0034] Figure 7C This is a schematic diagram of another color sampling mode involved in an embodiment of the present application;

[0035] Figure 8 A schematic flow chart of another method for determining image block prediction samples provided in an embodiment of the present application;

[0036] Fig. 9A A schematic diagram of a current image block involved in an embodiment of the present application;

[0037] Fig. 9B for Fig. 9A A schematic diagram of a chrominance prediction sample of the current image block shown;

[0038] Fig. 9C for Fig. 9A A schematic diagram of another chrominance prediction sample of the current image block shown;

[0039] Fig.10 A schematic flow chart of another method for determining image block prediction samples provided in an embodiment of the present application;

[0040] Fig.11 is a schematic block diagram of a device for determining image block prediction samples provided by an embodiment of the present application;

[0041] Fig.12 It is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0044] The present application can be applied to the field of image coding and decoding, the field of video coding and decoding, the field of hardware video coding and decoding, the field of dedicated circuit video coding and decoding, the field of real-time video coding and decoding, etc. For example, the scheme of the present application can be combined with an audio and video coding standard (AVS), such as the H.264 / audio video coding (AVC) standard, the H.265 / high efficiency video coding (HEVC) standard, and the H.266 / versatile video coding (VVC) standard. Alternatively, the scheme of the present application can be combined with other proprietary or industry standards and operate, and the standards include ITU-TH.261, ISO / IECMPEG-1Visual, ITU-TH.262 or ISO / IECMPEG-2Visual, ITU-TH.263, ISO / IECMPEG-4Visual, ITU-TH.264 (also known as ISO / IECMPEG-4AVC), including scalable video coding (SVC) and multi-view video coding (MVC) extensions. It should be understood that the technology of the present application is not limited to any specific coding standard or technology.

[0045] To facilitate understanding, first combine Figure 1 The video encoding and decoding system involved in the embodiments of the present application is introduced.

[0046] Figure 1 1 is a schematic block diagram of a video encoding and decoding system 100 involved in an embodiment of the present application. It should be noted that: Figure 1 This is just an example. The video encoding and decoding system of the embodiment of the present application includes but is not limited to Figure 1 As shown. Figure 1As shown, the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is used to encode (which can be understood as compressing) video data to generate a code stream, and transmit the code stream to the decoding device. The decoding device decodes the code stream generated by the encoding device to obtain decoded video data.

[0047] The encoding device 110 of the embodiment of the present application can be understood as a device with a video encoding function, and the decoding device 120 can be understood as a device with a video decoding function, that is, the embodiment of the present application includes a wider range of devices for the encoding device 110 and the decoding device 120, such as smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, vehicle-mounted computers, etc.

[0048] In some embodiments, the encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via the channel 130. The channel 130 may include one or more media and / or devices capable of transmitting the encoded video data from the encoding device 110 to the decoding device 120.

[0049] In one example, the channel 130 includes one or more communication media that enable the encoding device 110 to transmit the encoded video data directly to the decoding device 120 in real time. In this example, the encoding device 110 can modulate the encoded video data according to the communication standard and transmit the modulated video data to the decoding device 120. The communication medium includes a wireless communication medium, such as a radio frequency spectrum, and optionally, the communication medium may also include a wired communication medium, such as one or more physical transmission lines.

[0050] In another example, the channel 130 includes a storage medium, which can store the video data encoded by the encoding device 110. The storage medium includes a variety of locally accessible data storage media, such as optical disks, DVDs, flash memories, etc. In this example, the decoding device 120 can obtain the encoded video data from the storage medium.

[0051] In another example, the channel 130 may include a storage server that can store the video data encoded by the encoding device 110. In this example, the decoding device 120 can download the stored encoded video data from the storage server. Alternatively, the storage server can store the encoded video data and transmit the encoded video data to the decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.

[0052] In some embodiments, the encoding device 110 includes a video encoder 112 and an output interface 113. The output interface 113 may include a modulator / demodulator (modem) and / or a transmitter.

[0053] In some embodiments, the encoding device 110 may further include a video source 111 in addition to the video encoder 112 and the input interface 113 .

[0054] The video source 111 may include at least one of a video acquisition device (eg, a video camera), a video archive, a video input interface, and a computer graphics system, wherein the video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate video data.

[0055] The video encoder 112 encodes the video data from the video source 111 to generate a code stream. The video data may include one or more pictures or a sequence of pictures. The code stream contains the coding information of the picture or the sequence of pictures in the form of a bit stream. The coding information may include the coded picture data and associated data. The associated data may include a sequence parameter set (SPS for short), a picture parameter set (PPS for short) and other syntax structures. The SPS may contain parameters applied to one or more sequences. The PPS may contain parameters applied to one or more pictures. The syntax structure refers to a set of zero or more syntax elements arranged in a specified order in the code stream.

[0056] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data may also be stored in a storage medium or a storage server for subsequent reading by the decoding device 120.

[0057] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122 .

[0058] In some embodiments, the decoding device 120 may include a display device 123 in addition to the input interface 121 and the video decoder 122 .

[0059] The input interface 121 includes a receiver and / or a modem. The input interface 121 can receive the encoded video data through the channel 130 .

[0060] The video decoder 122 is used to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to the display device 123 .

[0061] The display device 123 displays the decoded video data. The display device 123 may be integrated with the decoding device 120 or external to the decoding device 120. The display device 123 may include a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.

[0062] also, Figure 1 This is only an example, and the technical solution of the embodiment of the present application is not limited to Figure 1 For example, the technology of the present application can also be applied to single-sided video encoding or single-sided video decoding.

[0063] The following is an introduction to the video encoding framework involved in the embodiments of the present application.

[0064] Figure 2 2 is a schematic block diagram of a video encoder 200 provided in an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression on an image, or can be used to perform lossless compression on an image. The lossless compression can be visually lossless compression or mathematically lossless compression.

[0065] The video encoder 200 may be applied to image data in luminance and chrominance (YCbCr, YUV) format.

[0066] For example, the video encoder 200 reads video data, and for each frame of the video data, divides the frame into a number of coding tree units (CTUs). In some examples, CTB may be referred to as a "tree block", "largest coding unit" (LCU) or "coding tree block" (CTB). Each CTU may be associated with a pixel block of equal size within the image. Each pixel may correspond to a luminance (luminance or luma) sample and two chrominance (chrominance or chroma) samples. Therefore, each CTU may be associated with a luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU may be further divided into a number of coding units (CUs) for encoding, and a CU may be a rectangular block or a square block. CU can be further divided into prediction unit (PU) and transform unit (TU), so that coding, prediction and transform are separated and more flexible in processing. In one example, CTU is divided into CU in quadtree mode, and CU is divided into TU and PU in quadtree mode.

[0067] The video encoder and video decoder may support various PU sizes. Assuming that the size of a particular CU is 2N×2N, the video encoder and video decoder may support PU sizes of 2N×2N or N×N for intra-frame prediction, and support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N or similar sizes for inter-frame prediction. The video encoder and video decoder may also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.

[0068] In some embodiments, Figure 2 As shown, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may include more, fewer, or different functional components.

[0069] Optionally, in the present application, the current block may be referred to as a current coding unit (CU) or a current prediction unit (PU), etc. A prediction block may also be referred to as a prediction image block or an image prediction block, and a reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.

[0070] In some embodiments, the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Since there is a strong correlation between adjacent pixels in a frame of a video, the intra-frame prediction method is used in the video coding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent frames in a video, the inter-frame prediction method is used in the video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving the coding efficiency.

[0071] The inter-frame prediction unit 211 can be used for inter-frame prediction. Inter-frame prediction can refer to the image information of different frames. Inter-frame prediction uses motion information to find reference blocks from reference frames, and generates prediction blocks based on reference blocks to eliminate temporal redundancy. The frames used for inter-frame prediction can be P frames and / or B frames. P frames refer to forward prediction frames, and B frames refer to bidirectional prediction frames. Motion information includes a reference frame list where the reference frame is located, a reference frame index, and a motion vector. The motion vector can be an integer pixel or a sub-pixel. If the motion vector is a sub-pixel, it is necessary to use interpolation filtering in the reference frame to make the required sub-pixel block. Here, the integer pixel or sub-pixel block in the reference frame found according to the motion vector is called a reference block. Some technologies will directly use the reference block as a prediction block, and some technologies will generate a prediction block based on the reference block. Reprocessing the prediction block based on the reference block can also be understood as using the reference block as a prediction block and then processing the prediction block to generate a new prediction block.

[0072] The most commonly used inter-frame prediction methods currently include: geometric partitioning mode (GPM) in the VVC video codec standard and angular weighted prediction (AWP) in the AVS3 video codec standard. These two intra-frame prediction modes have something in common in principle.

[0073] The intra-frame prediction unit 212 only refers to the information of the same frame image to predict the pixel information in the current code image block to eliminate spatial redundancy. The frame used for intra-frame prediction can be an I frame.

[0074] The intra-frame prediction modes used by HEVC are Planar, DC, and 33 angle modes, for a total of 35 prediction modes. The intra-frame modes used by VVC are Planar, DC, and 65 angle modes, for a total of 67 prediction modes. The intra-frame modes used by AVS3 are DC, Plane, Bilinear, and 63 angle modes, for a total of 66 prediction modes.

[0075] In some embodiments, the intra prediction unit 212 may be implemented using intra block copy technology and intra string copy technology.

[0076] The residual unit 220 may generate a residual block of the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, the residual unit 220 may generate a residual block of the CU so that each sample in the residual block has a value equal to the difference between the following two: a sample in the pixel blocks of the CU and a corresponding sample in the prediction blocks of the PUs of the CU.

[0077] The transform / quantization unit 230 may quantize the transform coefficients. The transform / quantization unit 230 may quantize the transform coefficients associated with the TUs of the CU based on a quantization parameter (QP) value associated with the CU. The video encoder 200 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.

[0078] The inverse transform / quantization unit 240 may apply inverse quantization and inverse transform to the quantized transform coefficients, respectively, to reconstruct a residual block from the quantized transform coefficients.

[0079] The reconstruction unit 250 may add the samples of the reconstructed residual block to the corresponding samples of one or more prediction blocks generated by the prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of the CU in this manner, the video encoder 200 may reconstruct the pixel blocks of the CU.

[0080] Loop filtering unit 260 may perform a deblocking filtering operation to reduce blocking effects of pixel blocks associated with a CU.

[0081] In some embodiments, the loop filter unit 260 includes a deblocking filter unit and a sample adaptive offset / adaptive loop filter (SAO / ALF) unit, wherein the deblocking filter unit is used to remove the block effect, and the SAO / ALF unit is used to remove the ringing effect.

[0082] The decoded image buffer 270 may store the reconstructed pixel blocks. The inter prediction unit 211 may use the reference image containing the reconstructed pixel blocks to perform inter prediction on PUs of other images. In addition, the intra prediction unit 212 may use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra prediction on other PUs in the same image as the CU.

[0083] The entropy encoding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy-encoded data.

[0084] Figure 3 It is a schematic block diagram of a decoding framework 300 provided in an embodiment of the present application.

[0085] like Figure 3As shown, the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transformation unit 330, a reconstruction unit 340, a loop filter unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components.

[0086] The video decoder 300 may receive a bitstream. The entropy decoding unit 310 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse the syntax elements in the bitstream that have been entropy encoded. The prediction unit 320, the inverse quantization / transformation unit 330, the reconstruction unit 340, and the loop filter unit 350 may decode the video data according to the syntax elements extracted from the bitstream, that is, generate decoded video data.

[0087] In some embodiments, the prediction unit 320 includes an intra-prediction unit 321 and an inter-prediction unit 322 .

[0088] The intra prediction unit 321 may perform intra prediction to generate a prediction block of a PU. The intra prediction unit 321 may use an intra prediction mode to generate a prediction block of a PU based on a pixel block of a spatially neighboring PU. The intra prediction unit 321 may also determine an intra prediction mode of a PU according to one or more syntax elements parsed from a code stream.

[0089] The inter prediction unit 322 may construct a first reference image list (list 0) and a second reference image list (list 1) according to the syntax elements parsed from the code stream. In addition, if the PU is encoded using inter prediction, the entropy decoding unit 310 may parse the motion information of the PU. The inter prediction unit 322 may determine one or more reference blocks of the PU according to the motion information of the PU. The inter prediction unit 322 may generate a prediction block of the PU according to the one or more reference blocks of the PU.

[0090] The inverse quantization / transform unit 330 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.

[0091] After inverse quantizing the transform coefficients, the inverse quantization / transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients in order to generate a residual block associated with the TU.

[0092] The reconstruction unit 340 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the reconstruction unit 340 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.

[0093] The loop filtering unit 350 may perform a deblocking filtering operation to reduce blocking effects of pixel blocks associated with a CU.

[0094] The video decoder 300 may store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.

[0095] The basic process of video encoding and decoding is as follows: at the encoding end, a frame of image is divided into blocks, and for the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block. The residual unit 220 can calculate the residual block based on the original block of the prediction block and the current block, that is, the difference between the original block of the prediction block and the current block, and the residual block can also be called residual information. The residual block can remove information that is not sensitive to the human eye through the transformation and quantization process of the transformation / quantization unit 230 to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transformation / quantization unit 230 can be called a time domain residual block, and the time domain residual block after transformation and quantization by the transformation / quantization unit 230 can be called a frequency residual block or a frequency domain residual block. The entropy coding unit 280 receives the quantized change coefficient output by the change quantization unit 230, and can entropy encode the quantized change coefficient and output a bit stream. For example, the entropy coding unit 280 can eliminate character redundancy according to the target context model and the probability information of the binary bit stream.

[0096] At the decoding end, the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block. The prediction unit 320 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block based on the prediction information. The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or on the block to obtain a decoded image. The encoding end also requires similar operations as the decoding end to obtain a decoded image. The decoded image can also be called a reconstructed image, and the reconstructed image can be used as a reference frame for inter-frame prediction for subsequent frames.

[0097] It should be noted that the block division information determined by the encoder, as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder by analyzing the existing information, thereby ensuring that the decoded image obtained by the encoder is the same as the decoded image obtained by the decoder.

[0098] The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.

[0099] The intra-frame block copy technology and the intra-frame string copy technology are introduced below.

[0100] Intra Block Copy (IBC) is an intra-frame coding tool adopted in the HEVC Screen Content Coding (SCC) extension, which significantly improves the coding efficiency of screen content. In AVS3 and VVC, IBC technology is also adopted to improve the performance of screen content coding. IBC uses the spatial correlation of screen content video and uses the coded image pixels on the current image to predict the pixels of the current block to be coded, which can effectively save the bits required for coding pixels. Figure 4 As shown in Figure 1, the displacement between the current coding block and its reference block in IBC is called a block vector (BV for short). VVC uses a mode similar to the AMVP mode in inter-frame prediction to predict BV and allows BVD to be encoded using 1 or 4 pixel resolution.

[0101] Intra String Copy (ISC) is also called intra prediction. It divides a coding block into a series of pixel strings or unmatched pixels according to a certain scanning order (raster scanning, round-trip scanning, Zig-Zag scanning, etc.). Similar to IBC, the current string searches for a reference string of the same shape in the encoded area of ​​the current frame image. Based on this, the prediction information of the current string is derived. By encoding the original signal and prediction information of the current string, the residual signal of the current string is obtained and the residual signal is encoded. For example: Figure 5 is a schematic diagram of an intra-frame string replication involved in an embodiment of the present application, such as Figure 5 As shown, the 28 white pixels are string 1, the 35 light gray pixels are string 2, and the 1 black pixel represents an unmatched pixel (an unmatched pixel is also called an isolated point, and the pixel value of the unmatched pixel is directly encoded instead of being derived from the predicted value of the reference string). Among them, the reference string of string 1 is on its left, and the displacement of string 1 to its corresponding reference string is represented by string vector 1. The reference string of string 2 is above it, and the displacement of string 2 to its corresponding reference string is represented by string vector 2.

[0102] The intra-frame string copy technology needs to encode the string vector (SV) corresponding to each string in the current coding block, the string length, and the flag of whether there is a matching string. Among them, the string vector (SV) represents the displacement of the string to be encoded to its reference string. The string length represents the number of pixels contained in the string.

[0103] The equivalent string and unit vector string mode is a sub-mode of intra-frame string replication and was adopted into the AVS3 standard in October 2020. Similar to intra-frame string replication, this mode divides a coding / decoding block into a series of pixel strings or unmatched pixels in a certain scanning order. The type of pixel string can be an equivalent string or a unit base vector string. The characteristic of an equivalent string is that all pixels in the pixel string have the same prediction value. The unit vector string (also called unit base vector string, unit offset string, copy above string, etc.) is characterized by its displacement vector (0, -1), and its implementation is relatively simple. Each pixel of the string uses the pixel above as the prediction value of the current pixel point. The equivalent string mode requires encoding the type, length and prediction value information of each string of the current coding block in the bitstream. Accordingly, the decoding end derives the prediction sample from the information decoded from the bitstream.

[0104] There are several ways to encode the prediction value: 1) directly encode the prediction value; 2) construct a reference pixel candidate list L1, and encode the index of the prediction value in L1; 3) construct a reference pixel prediction list L0, derive the reference pixel candidate list L1 from the list according to the reuse flag reuse_flag, encode reuse_flag and the index of the encoded prediction value in L1. In the current implementation of the equivalent string, the above method 3) is used to encode the prediction value. It should be noted that the above method does not record the prediction value in the list, but records the position of the reference pixel in the image.

[0105] At present, the medium value string and unit basis vector string modes in AVS3 are implemented for video images in YUV420 format. The current prediction sample matrix is ​​recorded as pred_y, pred_cb, pred_cr. This method uses a memory with a height of LCU height, a width of image width, and a channel number of 3 to derive the prediction sample, recorded as LcuRowBuf[ch][x][y]. Then, the value of a pixel sample can be confirmed according to the channel, horizontal coordinate, and vertical coordinate of the color component.

[0106] The current process of exporting prediction samples in AVS3 is as follows:

[0107] Step 1: For a CU with equal value string and unit base vector string mode, the CU is divided into a series of equal value strings, unit base vector strings or unmatched pixels. The prediction samples of each part are derived in turn according to the following method. The coordinates of the current pixel point are (x, y):

[0108] Case 1: If the type of the current string where the current pixel is located is an equal value string, execute the following steps 11 to 13:

[0109] Step 11, decoding the bitstream to obtain a reference pixel value of the current pixel, for example, directly decoding from the bitstream or confirming by a point vector, and parsing comp_flag from the bitstream, where comp_flag is used to indicate whether a chrominance component value of the current pixel exists;

[0110] Step 12, assign the Y component LcuRowBuf[0][x][y] of the current position (x, y);

[0111] Step 13, if the chrominance component value of the current position (x, y) exists, assign the Cb component LcuRowBuf[1][x][y] and the Cr component LcuRowBuf[2][x][y] of the current position (x, y);

[0112] Case 2: If the type of the string where the current pixel point is located is an unmatched pixel, the following steps 21 and 22 are executed:

[0113] Step 21, if the coordinates of the current pixel point are an integer multiple of 2 (i.e., x%2==0&&y%2==0), decode the pixel values ​​of the Y, Cb and Cr components from the bitstream to obtain LcuRowBuf[0][x][y], LcuRowBuf[1][x][y], LcuRowBuf[2][x][y];

[0114] Step 22, if the coordinates of the current pixel point are not an integer multiple of 2, decode the pixel value of the Y component from the bitstream, LcuRowBuf[0][x][y], and set the values ​​of the Cb and Cr components LcuRowBuf[1][x][y], LcuRowBuf[2][x][y] to 0.

[0115] Case 3: If the type of the string where the current pixel point is located is a unit base vector string, the pixel value of the adjacent pixel point above the current pixel point is used as the reference pixel value of the current pixel point, that is, LcuRowBuf[0][x][y]=LcuRowBuf[0][x][y-1], LcuRowBuf[1][x][y]=LcuRowBuf[1][x][y-1], LcuRowBuf[2][x][y]=LcuRowBuf[2][x][y-1];

[0116] Step 2: After the prediction samples of the entire CU are derived, the prediction samples of the chroma components are downsampled, and the chroma sample matrix of size wXh is downsampled to a chroma sample matrix of size w / 2Xh / 2. Specifically, the non-zero pixels in each 2X2 sub-block in the prediction samples of the entire CU are averaged to obtain the downsampled chroma sample values.

[0117] Step 3: derive the values ​​of pred_y, pred_u, and pred_v according to the position of each pixel in the CU. For the luma sample, pred_y is the pixel value in LcuRowBuf[0], pred_cb is the downsampled chroma sample value in LcuRowBuf[1], and pred_cr is the downsampled chroma sample value in LcuRowBuf[2].

[0118] From the above, it can be seen that in the current AVS3, for video images in YUV4:2:0 format or YUV4:2:2, the prediction sample export needs to use the YUV4:4:4 size internal, which occupies a large memory space and is not conducive to the implementation of the decoding hardware device.

[0119] In order to solve the above technical problems, the present application downsamples the reference pixel value of the current pixel point according to the color sampling mode of the current image block to obtain the predicted sample of the current pixel point, and then the size of the predicted sample of the current image block is consistent with the size of the current image block, thereby reducing the memory size required for exporting the predicted sample, which is conducive to hardware implementation.

[0120] The technical solution provided in the embodiments of the present application is described in detail below in conjunction with specific embodiments.

[0121] It should be noted that the method of the present application is applicable to the encoding end and the decoding end, and the process of determining the image block prediction sample at the encoding end and the decoding end is basically similar. Here, the method for determining the image block prediction sample provided by the present application is described by taking the decoding end as an example, and the encoding end can refer to the decoding end.

[0122] Figure 6 A flowchart of a method for determining an image block prediction sample provided in an embodiment of the present application. The method in the embodiment of the present application is applied to Figure 1 or Figure 3 The decoding end shown in Figure 6 As shown, including:

[0123] S610: Obtain the type of a current string where a current pixel point in a current image block is located, the current image block includes a current string, and the current string includes at least one pixel point.

[0124] The execution subject of the embodiments of the present application includes but is not limited to the following devices: a decoder, an encoder, or a device for determining image block prediction samples, such as a desktop computer, a mobile computing device, a notebook (e.g., a laptop) computer, a tablet computer, a set-top box, a handheld device such as a smart phone, a television, a camera, a display device, a digital media player, a video game console, a car computer, or the like.

[0125] At the encoding end, the current image block is divided into a series of pixel strings in a certain scanning order, each pixel string includes at least one pixel point, and the type of the pixel string can be an equal value string, a unit vector string or an unmatched pixel.

[0126] The encoding end encodes the length, type and prediction value information of the pixel string in the bitstream. In this way, when decoding the current image block, the decoding end can decode the type of the current string where the current pixel point in the current image block is located from the bitstream, and the current string includes at least one pixel point.

[0127] Optionally, the type of the current string includes any one of the following: an equal value string, an unmatched pixel, and a unit base vector string.

[0128] S620: Determine a reference pixel value of a current pixel point according to the type of the current string.

[0129] In some embodiments, if the type of the current string is an equal value string, the decoded code stream obtains the index of the reference pixel value corresponding to the current string, queries the reference pixel value corresponding to the index in a preset reference pixel prediction list, and determines the reference pixel value corresponding to the index as the reference pixel value of the current pixel point.

[0130] Exemplarily, the preset reference pixel prediction list is shown in Table 1:

[0131] Table 1

[0132] index Reference pixel value 1 A1 2 A2 3 A3 …… ……

[0133] Since all pixels in an equal value string have the same reference pixel value, if the type of the current string is an equal value string, the encoder encodes the index of the reference pixel value corresponding to the current string in the bitstream, for example, the reference pixel value corresponding to all pixels in the current string is A2, and the index of the reference pixel value A2 is 2, and the encoder encodes the index 2 in the bitstream. The decoder decodes the bitstream to obtain the index of the reference pixel value corresponding to the current string, for example, 2, and then searches the reference pixel value A2 corresponding to the index 2 from Table 1 above, and determines the reference pixel value A2 as the reference pixel value corresponding to the current string.

[0134] Since the reference pixel values ​​corresponding to all the pixels in the current string are the same, namely A2, it can be determined that the reference pixel value of the current pixel is also A2.

[0135] In some embodiments, if the type of the current string is unmatched pixels, the decoded code stream obtains a predicted value of the current pixel, and determines the predicted value of the current pixel as a reference pixel value of the current pixel.

[0136] Specifically, if the type of the current string is unmatched pixel, it means that the current string includes a pixel point, such as Figure 5 The unmatched pixel shown in the black area is the current pixel. When encoding, the encoder encodes the predicted value of the unmatched pixel in the bitstream. In this way, if the current pixel is an unmatched pixel, the decoder can directly decode the bitstream to obtain the predicted value of the current pixel, and then determine the predicted value of the current pixel as the reference pixel value of the current pixel.

[0137] In some embodiments, if the type of the current string is a unit base vector string, the value of the decoded pixel point adjacent to the current pixel point is determined as the reference pixel value of the current pixel point.

[0138] Specifically, since each pixel in the unit base vector string uses the value of the adjacent pixel above as its own reference pixel value, if the type of the current string is a unit base vector string, the decoder determines the value of the adjacent decoded pixel above the current pixel as the reference pixel value of the current pixel.

[0139] S630: Determine the color sampling mode of the current image block.

[0140] During encoding, the encoding end divides the current image to be encoded into multiple image blocks, and encodes each image block. Correspondingly, the decoding end also decodes each image block in the current image. Therefore, the color sampling mode of the current image block described in the embodiment of the present application is the color sampling mode of the image where the current image block is located.

[0141] In some embodiments, the color format of the video image of the embodiment of the present application is YUV. YUV is mainly used to optimize the transmission of color video signals. Compared with RGB video signal transmission, its biggest advantage is that it only takes up very little bandwidth (RGB requires three independent video signals to be transmitted simultaneously). Among them, "Y" represents brightness (Luminance or Luma), that is, the grayscale value; while "U" and "V" represent chrominance (Chrominance or Chroma), which is used to describe the color and saturation of the image and is used to specify the color of the pixel. "Brightness" is established through the RGB input signal by superimposing specific parts of the RGB signal together. "Chroma" defines two aspects of color-hue and saturation, represented by Cr and Cb respectively. Among them, Cr reflects the difference between the red part of the RGB input signal and the brightness value of the RGB signal. And Cb reflects the difference between the blue part of the RGB input signal and the brightness value of the RGB signal. The importance of using the YUV color space is that its brightness signal Y and chrominance signals U and V are separated. If there is only a Y signal component but no U and V components, then the image represented in this way is a black and white grayscale image. Color television uses YUV space in order to use the brightness signal Y to solve the compatibility problem between color television and black and white television, so that black and white television can also receive color television signals.

[0142] The storage format of the YUV code stream is actually closely related to its color sampling mode. There are three mainstream color sampling modes: YUV4:4:4, YUV4:2:2 and YUV4:2:0. The numbers in the ratio N1:N2:N3 are the relative sampling rates in the horizontal direction. N1 represents the number of Y samples in odd and even rows, N2 represents the number of U and V samples in odd rows, and N3 represents the number of U and V samples in even rows.

[0143] Among them, Fig. 7A As shown, YUV4:4:4 means that the chroma channels are not downsampled, that is, each Y sample corresponds to a set of UV samples.

[0144] like Figure 7B As shown, YUV4:2:2 means 2:1 horizontal downsampling, no vertical downsampling. That is, for each scan line, every two U or V samples correspond to four Y samples. That is, every two Y samples share a set of UV components.

[0145] like Figure 7C As shown, YUV4:2:0 means 2:1 horizontal downsampling and 2:1 vertical downsampling, that is, every four Y samples share a set of UV samples.

[0146] It should be noted that the color sampling modes involved in the embodiments of the present application include but are not limited to Fig. 7A , Figure 7B and Figure 7C Optionally, a color sampling mode for downsampling the brightness component is also included, such as YUV3:2:0, YUV3:2:2, etc.

[0147] In some embodiments, the color sampling mode of the current image block is a default mode. For example, the encoding end and the decoding end set the color sampling mode of the current image block to YUV4:2:0 by default.

[0148] In some embodiments, the encoder carries the color sampling mode information of the current image block in the bitstream, so that the decoder can obtain the color sampling mode of the current image block by decoding the bitstream.

[0149] S640: Obtain a prediction sample of the current pixel according to the color sampling mode of the current image block and the reference pixel value of the current pixel.

[0150] Specifically, the decoding end obtains the color sampling mode of the current image block and the reference pixel value of the current pixel according to the above steps, and then obtains the predicted sample of the current pixel according to the color sampling mode of the current image block and the reference pixel value of the current pixel. That is, the decoding end of the present application takes into account the color sampling mode of the current image block when determining the predicted sample of the current pixel, so that the color sampling mode of the predicted sample of the current pixel is consistent with the color sampling mode of the current image block, thereby reducing the occupied memory.

[0151] S650: Obtain prediction samples of the current image block according to the prediction samples of the current pixel.

[0152] Specifically, the current pixel is a pixel in the current image block, and other pixels in the current image block refer to the process of determining the prediction sample of the current pixel to determine the prediction sample of each pixel in the current image block. The prediction sample of each pixel in the current image block constitutes the prediction sample of the current image block.

[0153] In an embodiment of the present application, the decoding end obtains the predicted sample of the current pixel point according to the color sampling mode of the current image block and the reference pixel value of the current pixel point. That is, the decoding end considers the color sampling mode of the current image block in the process of determining the reference pixel value of the pixel point in the current image block, so that the color sampling mode of the predicted sample of the current image block composed of the predicted samples of each pixel point is consistent with the color sampling mode of the current image block. For example, if the color sampling mode of the current image block is YUV4:2:0, the color sampling mode of the predicted sample of the current image block is also YUV4:2:0. If the color sampling mode of the current image block is YUV4:2:2, the color sampling mode of the predicted sample of the current image block is also YUV4:2:2. Compared with the prior art that uses a memory of YUV4:4:4 size to derive the predicted sample and then perform downsampling, the present application reduces the amount of memory occupied in the process of determining the predicted sample of the current image block.

[0154] In addition, the present application directly obtains the prediction samples of the current image block based on the prediction samples of each pixel in the current image block without downsampling, thereby reducing the complexity of calculations and improving the speed of determining the prediction samples of the current image block.

[0155] The above S640 is described in detail below in conjunction with specific embodiments.

[0156] In some embodiments, if the prediction sample of the current pixel includes a brightness prediction sample, then S640 includes the following step S640-A:

[0157] S640-A: If the color sampling mode of the current image block is YUV4:2:2 or YUV4:2:0, the brightness value of the reference pixel of the current pixel is determined as the brightness prediction sample of the current pixel.

[0158] For example, assuming that the position coordinates of the current pixel are (x, y), the position coordinates of the current pixel can be understood as the position coordinates of the current pixel in the image to be decoded, or as the position coordinates of the current pixel in the current image block. Assume that the brightness value of the reference pixel of the current pixel is recorded as pixel_luma. If the color sampling mode of the current image block is YUV4:2:2 or YUV4:2:0, the brightness value of the reference pixel of the current pixel is determined as the brightness prediction sample of the current pixel, for example, the value of pic_luma(x,y) is set to pixel_luma.

[0159] Taking each pixel in the current image block as the current pixel, the brightness prediction sample of each pixel in the current image block can be determined according to the above steps, and the brightness prediction sample of each pixel in the current image block constitutes the prediction sample under the brightness component in the prediction sample of the current image block. The size of the prediction sample under the brightness component is the same as the size of the current image block. For example, if the size of the current image block is 16X16, the size of the brightness prediction sample of the current image block is also 16X16. 16X16 means 16 rows of pixels and 16 columns of pixels.

[0160] In some embodiments, if the prediction sample of the current pixel includes a chrominance prediction sample, the above S640 includes the following steps: Figure 8 Steps shown.

[0161] Figure 8 A flowchart of another method for determining image block prediction samples provided in an embodiment of the present application is shown as follows: Figure 8 As shown, the above S640 includes:

[0162] S810: Obtain the position information of the current pixel.

[0163] In some embodiments, the position information of the current pixel may be the position coordinates of the current pixel in the image to be decoded.

[0164] In some embodiments, the position information of the current pixel point may be the position coordinates of the current pixel point in the current image block.

[0165] In some embodiments, the position information of the current pixel includes a first horizontal coordinate and a first vertical coordinate. For example, the position information of the current pixel is (x, y), where x is the first horizontal coordinate and y is the first vertical coordinate.

[0166] S820: Determine, according to the color sampling mode of the current image block, a first ratio of the luminance samples to the chrominance samples in the horizontal direction and a second ratio of the luminance samples to the chrominance samples in the vertical direction.

[0167] For example, if the color sampling mode of the current image block is YUV4:4:4, Fig. 7A As shown, for every 4 luminance samples in the horizontal direction, there are 4 chrominance samples, that is, the first ratio is 1. For every 4 luminance samples in the vertical direction, there are 4 chrominance samples, that is, the second ratio is also 1.

[0168] For example, if the color sampling mode of the current image block is YUV4:2:2, Fig. 7A As shown, for every 4 luminance samples in the horizontal direction, there are 2 chrominance samples, that is, the first ratio is 2. For every 4 luminance samples in the vertical direction, there are 4 chrominance samples, that is, the second ratio is 1.

[0169] For example, if the color sampling mode of the current image block is YUV4:2:0, Figure 7C As shown, for every 4 luminance samples in the horizontal direction, there are 2 chrominance samples, that is, the first ratio is 2. For every 4 luminance samples in the vertical direction, there are 2 chrominance samples, that is, the second ratio is also 2.

[0170] S830: Determine a chrominance prediction sample of the current pixel according to the position information of the current pixel, the first ratio, the second ratio, and the chrominance value of the reference pixel of the current pixel.

[0171] Specifically, the decoding end determines the first position of the chroma prediction sample of the current pixel according to the position information of the current pixel, the first ratio, and the second ratio, and uses the chroma prediction sample at the first position as the chroma prediction sample of the current pixel.

[0172] In some embodiments, the above S830 includes the following steps:

[0173] S830-A1: If the first horizontal coordinate is an integer multiple of the first ratio, and the first vertical coordinate is an integer multiple of the second ratio, determining the first position according to the first horizontal coordinate and the first ratio, and the first vertical coordinate and the second ratio;

[0174] S830-A2: Using the chrominance value of the reference pixel of the current pixel as the chrominance prediction sample at the first position;

[0175] S830-A3: Use the chrominance prediction sample at the first position as the chrominance prediction sample of the current pixel.

[0176] For example, the position information of the current pixel is (x, y), where x is the first horizontal coordinate of the current pixel and y is the first vertical coordinate of the current pixel. The decoding end determines whether the first horizontal coordinate of the current pixel is an integer multiple of the first ratio, and whether the first vertical coordinate is an integer multiple of the second ratio. Exemplarily, assuming that the first ratio is represented by scale_x and the second ratio is represented by scale_y, it is determined whether the current pixel satisfies the following formula (1):

[0177] x%scale_x==0 and y%scale_y==0 (1)

[0178] Among them, % is the remainder operation, and == is equal to.

[0179] If the color sampling mode of the current image block is YUV4:2:2, the above scale_x is 2 and scale_y is 1.

[0180] If the color sampling mode of the current image block is YUV4:2:0, the above scale_x is 2 and scale_y is 2.

[0181] For example, if the color sampling mode of the current image block is YUV4:2:0, Figure 7C As shown, for every 4 luminance samples in the horizontal direction, there are 2 chrominance samples, that is, the first ratio is 2. For every 4 luminance samples in the vertical direction, there are 2 chrominance samples, that is, the second ratio is also 2.

[0182] If it is determined that the position information of the current pixel satisfies the above formula (1), that is, the first horizontal coordinate of the current pixel is an integer multiple of the first ratio, and the first vertical coordinate is an integer multiple of the second ratio, then the first position is determined based on the first horizontal coordinate and the first ratio, and the first vertical coordinate and the second ratio, and the chromaticity value of the reference pixel of the current pixel is used as the chromaticity prediction sample at the first position, and the chromaticity prediction sample at the first position is used as the chromaticity prediction sample of the current pixel.

[0183] In some embodiments, the first position is determined in the above S830-A1 according to the first horizontal coordinate and the first ratio, and the first vertical coordinate and the second ratio, including but not limited to the following methods:

[0184] Method 1: Divide the first horizontal coordinate by the first ratio to obtain a first value, and determine the integer part of the first value as the horizontal coordinate of the first position. Similarly, divide the first vertical coordinate by the second ratio to obtain a second value, and determine the integer part of the second value as the vertical coordinate of the first position.

[0185] Method 2: determining the integer divisible value of the first horizontal coordinate and the first ratio as the horizontal coordinate of the first position; and determining the integer divisible value of the first vertical coordinate and the second ratio as the vertical coordinate of the first position.

[0186] In an example of the second method, pixel_chroma represents the chromaticity value of the reference pixel value of the current pixel, pic_chroma represents the chromaticity value of the current pixel, and the value of pic_chroma(x / scale_x, y / scale_y) is set to pixel_chroma.

[0187] The following describes a process for determining a chrominance prediction sample of a current image block when the color sampling mode of the current image block is YUV4:2:2 or YUV4:2:0.

[0188] For example, suppose the current image block is Fig. 9A As shown, its size is 4X4, and the coordinates of each pixel in the current image block are as follows Fig. 9A shown.

[0189] Example 1: If the color sampling mode of the current image block is YUV4:2:0, the first ratio is 2, the second ratio is 2, and the chrominance prediction sample of the current image block is determined according to the following formula (2) and formula (3):

[0190] x%2==0 and y%2==0 (2)

[0191] pic_chroma(x / 2,y / 2)=pixel_chroma (3)

[0192] Among them, / is the integer division symbol, pixel_chroma represents the chromaticity value of the reference pixel value of the current pixel, and pic_chroma represents the chromaticity value of the current pixel.

[0193] It should be noted that only when the position information of the current pixel satisfies the above formula (2), the following formula (3) is executed to obtain the chrominance prediction sample of the current pixel.

[0194] Specifically, if the coordinates of the current pixel point are (0,0), the above formula (2) is satisfied, and the value of pic_chroma(0,0) is set to pixel_chroma according to formula (3). If the coordinates of the current pixel point are (0,2), the above formula (2) is satisfied, and the value of pic_chroma(0,1) is set to pixel_chroma according to formula (3). If the coordinates of the current pixel point are (2,0), the above formula (2) is satisfied, and the value of pic_chroma(1,0) is set to pixel_chroma according to formula (3). If the coordinates of the current pixel point are (2,2), the above formula (2) is satisfied, and the value of pic_chroma(1,1) is set to pixel_chroma according to formula (3). If the coordinates of the current pixel point are (0,1), (0,1), (0,3), (1,0), (1,1), (1,2), (1,3), (2,1), (2,3), (3,0), (3,1), (3,2), (3,3), and the above formula (2) is not satisfied, then formula (3) is not executed.

[0195] Based on this, the chrominance prediction samples of the current image block are determined as follows: Fig. 9B As shown, the size is 2X2.

[0196] Example 2: If the color sampling mode of the current image block is YUV4:2:2, the first ratio is 2, the second ratio is 1, and the chrominance prediction sample of the current image block is determined according to the following formula (4) and formula (5):

[0197] x%2==0 and y%1==0 (4)

[0198] pic_chroma(x / 2,y / 1)=pixel_chroma (5)

[0199] Among them, / is the integer division symbol, pixel_chroma represents the chromaticity value of the reference pixel value of the current pixel, and pic_chroma represents the chromaticity value of the current pixel.

[0200] It should be noted that only when the position information of the current pixel satisfies the above formula (4), the following formula (5) is executed to obtain the chrominance prediction sample of the current pixel.

[0201] Specifically, if the coordinates of the current pixel point are (0,0), the above formula (4) is satisfied, and the value of pic_chroma(0,0) is set to pixel_chroma according to formula (5). If the coordinates of the current pixel point are (0,1), the above formula (4) is satisfied, and the value of pic_chroma(0,1) is set to pixel_chroma according to formula (5). If the coordinates of the current pixel point are (0,2), the above formula (4) is satisfied, and the value of pic_chroma(0,2) is set to pixel_chroma according to formula (5). If the coordinates of the current pixel point are (0,3), the above formula (4) is satisfied, and the value of pic_chroma(0,3) is set to pixel_chroma according to formula (5). If the coordinates of the current pixel point are (2,0), the above formula (4) is satisfied, and the value of pic_chroma(1,0) is set to pixel_chroma according to formula (5). If the coordinates of the current pixel point are (2,1), the above formula (4) is satisfied, then the value of pic_chroma(1,1) is set to pixel_chroma according to formula (5). If the coordinates of the current pixel point are (2,2), the above formula (4) is satisfied, then the value of pic_chroma(1,2) is set to pixel_chroma according to formula (5). If the coordinates of the current pixel point are (2,3), the above formula (4) is satisfied, then the value of pic_chroma(1,3) is set to pixel_chroma according to formula (5). If the coordinates of the current pixel point are (1,0), (1,1), (1,2), (1,3), (3,0), (3,1), (3,2), (3,3), the above formula (4) is not satisfied, then formula (5) is not executed.

[0202] Based on this, the chrominance prediction samples of the current image block are determined as follows: Fig. 9C As shown, the size is 2X4.

[0203] In some embodiments, if the prediction sample of the current pixel includes a chrominance prediction sample, and the color sampling mode of the current image block is YUV4:2:2, then the above S640 includes the following: Fig.10 Steps shown.

[0204] Fig.10 A flowchart of another method for determining image block prediction samples provided in an embodiment of the present application is shown as follows: Fig.10 As shown, the above S640 includes:

[0205] S101, obtaining the position information of the current pixel.

[0206] The implementation of the above S101 is the same as that of the above S801. Please refer to the description of the above S801 and will not be repeated here.

[0207] S102: Determine a third ratio of luminance samples to chrominance samples in the horizontal direction in the YUV4:2:0 color sampling mode.

[0208] For example, if the color sampling mode of the current image block is YUV4:2:2, Fig. 7A As shown, for every 4 luminance samples in the horizontal direction, there are 2 chrominance samples, that is, the third ratio is 2.

[0209] S103 . Determine a chroma prediction sample of the current pixel according to the position information of the current pixel, the third ratio, and the chroma value of the reference pixel value of the current pixel.

[0210] Specifically, the decoding end determines the second position of the chroma prediction sample of the current pixel according to the position information of the current pixel and the third ratio, and uses the chroma prediction sample at the second position as the chroma prediction sample of the current pixel.

[0211] In some embodiments, the position information includes a first horizontal coordinate and a first vertical coordinate, and the above S130 includes the following steps S103-A1 to S103-A3:

[0212] S103-A1, if the first horizontal coordinate is an integer multiple of the third ratio, determining the second position according to the first horizontal coordinate, the third ratio, and the first vertical coordinate;

[0213] S103-A2, using the chrominance value of the reference pixel of the current pixel as the chrominance prediction sample at the second position;

[0214] S103-A3: Use the chrominance prediction sample at the second position as the chrominance prediction sample of the current pixel.

[0215] For example, the position information of the current pixel is (x, y), where x is the first horizontal coordinate of the current pixel, and y is the first vertical coordinate of the current pixel. The decoding end determines whether the first horizontal coordinate of the current pixel is an integer multiple of the first ratio, and whether the first vertical coordinate is an integer multiple of the second ratio. Exemplarily, assuming that the third ratio is represented by scale_x, it is determined whether the current pixel satisfies the following formula (6):

[0216] x%scale_x==0 (6)

[0217] Among them, % is the remainder operation, and == is equal to.

[0218] If the color sampling mode of the current image block is YUV4:2:2, the above scale_x is 2.

[0219] If it is determined that the position information of the current pixel satisfies the above formula (6), that is, the first horizontal coordinate of the current pixel is an integer multiple of the third ratio, the second position is determined based on the first horizontal coordinate and the third ratio, and the chromaticity value of the reference pixel of the current pixel is used as the chromaticity prediction sample at the second position, and the chromaticity prediction sample at the second position is used as the chromaticity prediction sample of the current pixel.

[0220] In some embodiments, determining the second position according to the first horizontal coordinate and the third ratio in the above S130-A1 includes but is not limited to the following methods:

[0221] Method 1: Divide the first horizontal coordinate by the third ratio to obtain a third value, and determine the integer part of the third value as the horizontal coordinate of the second position; determine the first vertical coordinate as the vertical coordinate of the second position.

[0222] In a second method, a value that is an integer division of the first horizontal coordinate and the third ratio is determined as the horizontal coordinate of the second position; and the first vertical coordinate is determined as the vertical coordinate of the second position.

[0223] In an example of the second method, pixel_chroma represents the chromaticity value of the reference pixel of the current pixel, pic_chroma represents the chromaticity value of the current pixel, and the value of pic_chroma(x / scale_x, y) is set to pixel_chroma.

[0224] The following describes a process for determining the chrominance prediction samples of the current image block when the color sampling mode of the current image block is YUV4:2:2.

[0225] For example, suppose the current image block is Fig. 9A As shown, its size is 4X4, and the coordinates of each pixel in the current image block are as follows Fig. 9A shown.

[0226] If the color sampling mode of the current image block is YUV4:2:2, the third ratio is 2, and the chrominance prediction sample of the current image block is determined according to the following formula (7) and formula (8):

[0227] x%2==0 (7)

[0228] pic_chroma(x / 2,y)=pixel_chroma (8)

[0229] Among them, / is the integer division symbol, pixel_chroma represents the chromaticity value of the reference pixel value of the current pixel, and pic_chroma represents the chromaticity value of the current pixel.

[0230] It should be noted that only when the position information of the current pixel satisfies the above formula (7), the following formula (8) is executed to obtain the chrominance prediction sample of the current pixel.

[0231] Specifically, if the coordinates of the current pixel point are (0,0), the above formula (7) is satisfied, and the value of pic_chroma(0,0) is set to pixel_chroma according to formula (8). If the coordinates of the current pixel point are (0,1), the above formula (7) is satisfied, and the value of pic_chroma(0,1) is set to pixel_chroma according to formula (8). If the coordinates of the current pixel point are (0,2), the above formula (7) is satisfied, and the value of pic_chroma(0,2) is set to pixel_chroma according to formula (8). If the coordinates of the current pixel point are (0,3), the above formula (7) is satisfied, and the value of pic_chroma(0,3) is set to pixel_chroma according to formula (8). If the coordinates of the current pixel point are (2,0), the above formula (7) is satisfied, and the value of pic_chroma(1,0) is set to pixel_chroma according to formula (8). If the coordinates of the current pixel point are (2,1), the above formula (7) is satisfied, then the value of pic_chroma(1,1) is set to pixel_chroma according to formula (8). If the coordinates of the current pixel point are (2,2), the above formula (7) is satisfied, then the value of pic_chroma(1,2) is set to pixel_chroma according to formula (8). If the coordinates of the current pixel point are (2,3), the above formula (7) is satisfied, then the value of pic_chroma(1,3) is set to pixel_chroma according to formula (8). If the coordinates of the current pixel point are (1,0), (1,1), (1,2), (1,3), (3,0), (3,1), (3,2), (3,3), the above formula (7) is not satisfied, then formula (8) is not executed.

[0232] Based on this, the chrominance prediction samples of the current image block are determined as follows: Fig. 9C As shown, the size is 4X2.

[0233] In an embodiment of the present application, if the prediction samples of the current pixel point include chroma prediction samples, and the color sampling mode of the current image block is YUV4:2:2, the position information of the current pixel point is obtained; the third ratio of the brightness sample to the chroma sample in the horizontal direction in the YUV4:2:2 color sampling mode is determined; based on the position information of the current pixel point, the third ratio, and the chroma value of the reference pixel of the current pixel point, the chroma prediction sample of the current pixel point is quickly determined, and the process is simple.

[0234] It should be understood that Figure 6 , Figures 8 to 10 This is only an example of the present application and should not be construed as limiting the present application.

[0235] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, as long as they do not violate the ideas of the present application, they should also be regarded as the contents disclosed in the present application.

[0236] It should also be understood that in the various method embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, in the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. Specifically, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.

[0237] Combination of the above Figures 6 to 10 , describes in detail the method embodiment of the present application, and the following is combined with Figure 11 to Figure 12 , describe in detail the device embodiments of the present application.

[0238] Fig.11 1 is a schematic block diagram of an apparatus for determining image block prediction samples provided in an embodiment of the present application, and the apparatus may belong to a decoding end, such as a decoding device. Optionally, the apparatus may also belong to an encoding end, such as an encoding device.

[0239] like Fig.11 As shown, the image block prediction sample determination device 10 may include:

[0240] A decoding unit 11 is used to decode a bit stream to obtain a type of a current string where a current pixel point in a current image block is located, wherein the current image block includes the current string, and the current string includes at least one pixel point;

[0241] A reference pixel value determining unit 12, configured to determine a reference pixel value of the current pixel point according to the type of the current string;

[0242] A mode determination unit 13, configured to determine a color sampling mode of the current image block;

[0243] A prediction sample determination unit 14, configured to obtain a prediction sample of the current pixel point according to a color sampling mode of the current image block and a reference pixel value of the current pixel point;

[0244] The determination unit 15 is configured to obtain the prediction sample of the current image block according to the prediction sample of the current pixel point.

[0245] In some embodiments, the type of the current string includes any one of the following: an equal value string, an unmatched pixel, and a unit base vector string.

[0246] In some embodiments, the reference pixel value determination unit 12 is specifically configured to, if the type of the current string is an equal value string, obtain an index of a reference pixel value corresponding to the current string by decoding a bitstream, query a reference pixel value corresponding to the index in a preset reference pixel prediction list, and determine the reference pixel value corresponding to the index as the reference pixel value of the current pixel point;

[0247] If the type of the current string is an unmatched pixel, decoding the code stream to obtain a predicted value of the current pixel, and determining the predicted value of the current pixel as a reference pixel value of the current pixel;

[0248] If the type of the current string is a unit base vector string, the value of the decoded pixel point adjacent to the current pixel point is determined as the reference pixel value of the current pixel point.

[0249] In some embodiments, if the prediction sample of the current pixel point includes a brightness prediction sample, the prediction sample determination unit 14 is specifically used to determine the brightness value of the reference pixel of the current pixel point as the brightness prediction sample of the current pixel point if the color sampling mode of the current image block is YUV4:2:2 or YUV4:2:0.

[0250] In some embodiments, if the predicted samples of the current pixel point include chroma prediction samples, the predicted sample determination unit 14 is specifically used to obtain the position information of the current pixel point; determine a first ratio of the luminance sample to the chroma sample in the horizontal direction and a second ratio of the luminance sample to the chroma sample in the vertical direction according to the color sampling mode of the current image block; determine the chroma prediction sample of the current pixel point according to the position information of the current pixel point, the first ratio, the second ratio, and the chroma value of the reference pixel of the current pixel point.

[0251] In some embodiments, the position information includes a first horizontal coordinate and a first vertical coordinate, and the prediction sample determination unit 14 is specifically used to determine the first position according to the first horizontal coordinate and the first ratio, and the first vertical coordinate and the second ratio if the first horizontal coordinate is an integer multiple of the first ratio, and the first vertical coordinate is an integer multiple of the second ratio; use the chromaticity value of the reference pixel of the current pixel as the chromaticity prediction sample at the first position; and use the chromaticity prediction sample at the first position as the chromaticity prediction sample of the current pixel.

[0252] In some embodiments, the prediction sample determination unit 14 is specifically configured to determine the integer divisible value of the first horizontal coordinate and the first ratio as the horizontal coordinate of the first position; and determine the integer divisible value of the first vertical coordinate and the second ratio as the vertical coordinate of the first position.

[0253] In some embodiments, if the color sampling mode of the current image block is YUV4:2:0, the first ratio and the second ratio are both 2; if the color sampling mode of the current image block is YUV4:2:2, the first ratio is 2 and the second ratio is 1.

[0254] In some embodiments, if the prediction samples of the current pixel include chrominance prediction samples, and the color sampling mode of the current image block is YUV4:2:2, the prediction sample determination unit 14 is specifically used to obtain the position information of the current pixel; determine the third ratio of the luminance sample to the chrominance sample in the horizontal direction in the YUV4:2:2 color sampling mode; and determine the chrominance prediction sample of the current pixel according to the position information of the current pixel, the third ratio, and the chrominance value of the reference pixel of the current pixel.

[0255] In some embodiments, the position information includes a first horizontal coordinate and a first vertical coordinate, and the prediction sample determination unit 14 is specifically used to determine the second position according to the first horizontal coordinate and the third ratio, and the first vertical coordinate if the first horizontal coordinate is an integer multiple of the third ratio; use the chromaticity value of the reference pixel of the current pixel as the chromaticity prediction sample at the second position; and use the chromaticity prediction sample at the second position as the chromaticity prediction sample of the current pixel.

[0256] In some embodiments, the prediction sample determination unit 14 is specifically configured to determine the integer divisor of the first horizontal coordinate and the third ratio as the horizontal coordinate of the second position; and determine the first vertical coordinate as the vertical coordinate of the second position.

[0257] Optionally, the third ratio is 2.

[0258] In some embodiments, the mode determination unit 13 is specifically configured to decode the code stream to obtain the color sampling mode of the current image block.

[0259] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, Fig.11 The device shown can execute the method embodiment corresponding to the above decoding end, and the above-mentioned and other operations and / or functions of each module in the device are respectively for implementing the corresponding processes of the method embodiment corresponding to the above decoding end, which will not be repeated here for the sake of brevity.

[0260] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0261] Fig.12 It is a schematic block diagram of an electronic device 30 provided in an embodiment of the present application. The electronic device 30 may be a decoding device or an encoding device.

[0262] like Fig.12 As shown, the electronic device 30 may be the video decoder described in the embodiment of the present application, and the electronic device 30 may include:

[0263] The memory 33 and the processor 32, the memory 33 is used to store the computer program 34 and transmit the program code 34 to the processor 32. In other words, the processor 32 can call and run the computer program 34 from the memory 33 to implement the method in the embodiment of the present application.

[0264] For example, the processor 32 may be configured to execute the steps in the above method 200 according to the instructions in the computer program 34 .

[0265] In some embodiments of the present application, the processor 32 may include but is not limited to:

[0266] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0267] In some embodiments of the present application, the memory 33 includes but is not limited to:

[0268] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example 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 (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0269] In some embodiments of the present application, the computer program 34 may be divided into one or more units, which are stored in the memory 33 and executed by the processor 32 to complete the method provided by the present application. The one or more units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30.

[0270] like Fig.12 As shown, the electronic device 30 may further include:

[0271] The transceiver 33 may be connected to the processor 32 or the memory 33 .

[0272] The processor 32 may control the transceiver 33 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include an antenna, and the number of antennas may be one or more.

[0273] It should be understood that the various components in the electronic device 30 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0274] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0275] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0276] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0277] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the unit is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0278] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0279] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for determining image block prediction samples, characterized in that: include: Obtaining a type of a current string where a current pixel point in a current image block is located, wherein the current image block includes the current string, and the current string includes at least one pixel point; Determining a reference pixel value of the current pixel point according to the type of the current string; Determining a color sampling mode of the current image block; If the prediction sample of the current pixel includes a chrominance prediction sample, obtaining position information of the current pixel; Determine, according to the color sampling mode of the current image block, a ratio of a luminance component to a chrominance component in at least one direction, and if the position information of the current pixel and the ratio satisfy a preset relationship, obtain a prediction sample of the current pixel according to the chrominance value in the reference pixel value of the current pixel; According to the predicted samples of the current pixel point, the predicted samples of the current image block are obtained.

2. The method according to claim 1, characterized in that The type of the current string includes any one of the following: an equal value string, an unmatched pixel, and a unit base vector string.

3. The method according to claim 2, characterized in that The determining, according to the type of the current string, a reference pixel value of the current pixel point includes: If the type of the current string is an equal-value string, obtaining an index of a reference pixel value corresponding to the current string, searching a preset reference pixel prediction list for a reference pixel value corresponding to the index, and determining the reference pixel value corresponding to the index as a reference pixel value of the current pixel point; If the type of the current string is an unmatched pixel, obtaining a predicted value of the current pixel, and determining the predicted value of the current pixel as a reference pixel value of the current pixel; If the type of the current string is a unit base vector string, the value of the decoded pixel point adjacent to the current pixel point is determined as the reference pixel value of the current pixel point.

4. The method according to any one of claims 1 to 3, characterized in that: If the prediction sample of the current pixel includes a brightness prediction sample, obtaining the prediction sample of the current pixel according to the color sampling mode of the current image block and the reference pixel value of the current pixel includes: If the color sampling mode of the current image block is YUV4:2:2 or YUV4:2:0, the brightness value in the reference pixel value of the current pixel is determined as the brightness prediction sample of the current pixel.

5. The method according to any one of claims 1 to 3, characterized in that: The step of determining a ratio of a brightness component to a chrominance component in at least one direction according to the color sampling mode of the current image block, and obtaining a prediction sample of the current pixel according to a chrominance value in a reference pixel value of the current pixel if the position information of the current pixel and the ratio satisfy a preset relationship, comprises: Determine, according to the color sampling mode of the current image block, a first ratio of the luminance samples to the chrominance samples in the horizontal direction and a second ratio of the luminance samples to the chrominance samples in the vertical direction; If the position information of the current pixel point and the first ratio and the second ratio satisfy a preset relationship, the chrominance prediction sample of the current pixel point is determined based on the position information of the current pixel point, the first ratio, the second ratio, and the chrominance value in the reference pixel value of the current pixel point.

6. The method according to claim 5, characterized in that The position information includes a first horizontal coordinate and a first vertical coordinate, the preset relationship is that the first horizontal coordinate is an integer multiple of the first ratio, and the first vertical coordinate is an integer multiple of the second ratio, and if the position information of the current pixel point satisfies the preset relationship with the first ratio and the second ratio, determining the chrominance prediction sample of the current pixel point according to the position information of the current pixel point, the first ratio, the second ratio, and the chrominance value in the reference pixel value of the current pixel point, including: If the first horizontal coordinate is an integer multiple of the first ratio, and the first vertical coordinate is an integer multiple of the second ratio, determining a first position according to the first horizontal coordinate and the first ratio, and the first vertical coordinate and the second ratio; Using the chrominance value in the reference pixel value of the current pixel as the chrominance prediction sample at the first position; The chrominance prediction sample at the first position is used as the chrominance prediction sample of the current pixel.

7. The method according to claim 6, characterized in that Determining the first position according to the first horizontal coordinate and the first ratio, and the first vertical coordinate and the second ratio, includes: Determine the integer division value of the first horizontal coordinate and the first ratio as the horizontal coordinate of the first position; The integer division value of the first vertical coordinate and the second ratio is determined as the vertical coordinate of the first position.

8. The method according to claim 5, characterized in that The determining, according to the color sampling mode of the current image block, a first ratio of pixels corresponding to the brightness component and the chrominance component in the horizontal direction, and a second ratio of pixels corresponding to the brightness component and the chrominance component in the vertical direction, comprises: If the color sampling mode of the current image block is YUV4:2:0, the first ratio and the second ratio are both 2; If the color sampling mode of the current image block is YUV4:2:2, the first ratio is 2 and the second ratio is 1.

9. The method according to claim 2 or 3, characterized in that: If the color sampling mode of the current image block is YUV4:2:2, determining the ratio of the brightness component to the chrominance component in at least one direction according to the color sampling mode of the current image block, and if the position information of the current pixel and the ratio satisfy a preset relationship, obtaining a predicted sample of the current pixel according to the chrominance value in the reference pixel value of the current pixel, including: Obtaining the position information of the current pixel; Determine a third ratio of luma samples to chroma samples in the horizontal direction in the YUV4:2:2 color sampling mode; If the position information of the current pixel and the third ratio satisfy a preset relationship, the chrominance prediction sample of the current pixel is determined according to the position information of the current pixel, the third ratio, and the chrominance value in the reference pixel value of the current pixel.

10. The method according to claim 9, characterized in that The position information includes a first horizontal coordinate and a first vertical coordinate, the preset relationship is that the first horizontal coordinate is an integer multiple of the third ratio, and if the position information of the current pixel and the third ratio satisfy the preset relationship, determining the chrominance prediction sample of the current pixel according to the position information of the current pixel, the third ratio, and the chrominance value in the reference pixel value of the current pixel, including: If the first horizontal coordinate is an integer multiple of the third ratio, determining a second position according to the first horizontal coordinate, the third ratio, and the first vertical coordinate; Using the chrominance value in the reference pixel value of the current pixel as the chrominance prediction sample at the second position; The chrominance prediction sample at the second position is used as the chrominance prediction sample of the current pixel.

11. The method according to claim 10, characterized in that The determining the second position according to the first horizontal coordinate, the third ratio, and the first vertical coordinate includes: Determine the integer division value of the first horizontal coordinate and the third ratio as the horizontal coordinate of the second position; The first vertical coordinate is determined as the vertical coordinate of the second position.

12. The method according to claim 9, characterized in that The third ratio is 2.

13. A device for determining image block prediction samples, characterized in that: include: An acquisition unit, configured to obtain a type of a current string where a current pixel point in a current image block is located, wherein the current image block includes the current string, and the current string includes at least one pixel point; A reference pixel value determining unit, used to determine a reference pixel value of the current pixel point according to the type of the current string; A mode determination unit, configured to determine a color sampling mode of the current image block; A prediction sample determining unit, configured to obtain position information of the current pixel if the prediction sample of the current pixel includes a chrominance prediction sample; Determine, according to the color sampling mode of the current image block, a ratio of a luminance component to a chrominance component in at least one direction, and if the position information of the current pixel and the ratio satisfy a preset relationship, obtain a prediction sample of the current pixel according to the chrominance value in the reference pixel value of the current pixel; The prediction sample determination unit is used to obtain the prediction sample of the current image block according to the prediction sample of the current pixel point.

14. A decoding device, characterized in that: including a processor and a memory; The memory is used to store computer programs; The processor is used to call and run the computer program stored in the memory to implement the method according to any one of claims 1 to 12.

15. A coding device, characterized in that: including a processor and a memory; The memory is used to store computer programs; The processor is used to call and run the computer program stored in the memory to implement the method according to any one of claims 1 to 12.