Image decoding method, encoding method and device

By adjusting the quantization parameter QP value according to the prediction method of each pixel, and performing inverse quantization and quantization pixel by pixel, the problem of large quantization distortion is solved, and the realism and accuracy of image decoding are improved.

CN116071440BActive Publication Date: 2024-09-24HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210976078.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-07-26
Filing Date
2022-08-15
Publication Date
2024-09-24
Estimated Expiration
2042-08-15

AI Technical Summary

Technical Problem

In existing video encoding and decoding technologies, quantization distortion is relatively large, resulting in significant distortion during the image decoding process and affecting the realism and accuracy of image decoding.

Method used

By determining the prediction residual and gradient of each pixel based on the prediction method, adjusting the quantization parameter QP value, and performing dequantization and quantization pixel by pixel, quantization distortion is reduced.

Benefits of technology

While maintaining a certain compression rate, the decoding distortion of image frames is reduced, thereby improving the realism and accuracy of image decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116071440B_ABST
    Figure CN116071440B_ABST
Patent Text Reader

Abstract

The present application discloses an image decoding method, an encoding method and a device, and relates to the technical field of video encoding and decoding. The image decoding method includes: determining a prediction residual value of the first pixel point according to a prediction method of the first pixel point; the prediction residual value is used to reflect the gradient of the first pixel point; the prediction method is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point; the first pixel point is any pixel point in the current coding block; determining a target quantization parameter QP value of the first pixel point according to the prediction residual value of the first pixel point; and dequantizing the first pixel point according to the target QP value of the first pixel point, so that the decoding distortion of the image frame can be reduced while ensuring a certain compression rate, and the authenticity and accuracy of the image decoding can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on July 26, 2022, with application number 2022108862947 and application name “An image decoding method, encoding method and device”, the entire contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the technical field of computer video processing, and in particular to an image decoding method, encoding method and device. Background Art

[0003] In the field of video coding and decoding, video compression (ie, video coding and decoding) technology can be used to compress the data volume of the video, thereby achieving efficient transmission or storage of the video.

[0004] Encoding and decoding a video means encoding and decoding each frame of the video. Taking a frame of image as an example, at the encoding end, the image encoder encodes the image, obtains the code stream corresponding to the image and transmits the code stream to the decoding end; at the decoding end, the image decoder parses the code stream to obtain the image. At present, the image is divided into one or more coding units (CU), and the image encoder predicts each CU, determines the residual value between the predicted value of the CU and the true value of the CU, transforms, quantizes, and encodes the residual value in turn, thereby obtaining the code stream. Correspondingly, the image decoder predicts each CU, dequantizes and inversely transforms the decoding result of the code stream corresponding to the CU in turn to obtain the residual value corresponding to the CU, calculates the sum of the predicted value and the residual value of the CU, and thereby obtains the reconstructed value of the CU.

[0005] In the image encoding and decoding process, quantization can achieve a many-to-one mapping of signal values, thereby effectively reducing the signal value space and obtaining a better compression effect. It can be understood that the encoder and decoder perform quantization and dequantization processes according to the quantization parameter (QP). At present, a QP is set for a CU, the encoder obtains the QP of each CU, and quantizes the residual value or transform coefficient of the CU according to the QP; correspondingly, the decoder obtains the QP of the CU, and dequantizes the quantization coefficients parsed from the bitstream according to the QP. However, all pixels in a CU are quantized with the same QP, that is, all pixels in the CU are quantized to the same degree, which will result in a large quantization distortion (quantization distortion can be understood as image distortion caused by quantization) in the image encoding and decoding process. Summary of the invention

[0006] The present application provides an image decoding method, an encoding method and an apparatus, which can reduce the decoding distortion of image frames while ensuring a certain compression rate, and can improve the authenticity and accuracy of image decoding.

[0007] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0008] In a first aspect, an embodiment of the present application provides an image decoding method, which is executed by a decoding end, and the method includes: determining a prediction residual value of the first pixel point according to a prediction method of the first pixel point; the prediction residual value is used to reflect the gradient of the first pixel point; the prediction method is used to indicate the position of a reconstructed pixel point referenced when predicting the pixel point; the first pixel point is any pixel point in the current coding block; determining a target quantization parameter QP value of the first pixel point according to the prediction residual value of the first pixel point; and dequantizing the first pixel point according to the target QP value of the first pixel point.

[0009] Through the image decoding method provided in the embodiments of the present application, the video decoder can determine the prediction residual value (reflecting the gradient of the first pixel) of each pixel point according to the prediction mode of each pixel point in the coding block (the prediction mode is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point), and then determine the QP of each pixel point granularity for the pixel point in the coding block, so as to dequantize each pixel point according to the QP value of each pixel point, that is, dequantize each pixel point pixel by pixel. In this way, the decoding distortion of the image frame can be reduced while ensuring a certain compression rate, and the authenticity and accuracy of the image decoding can be improved.

[0010] The gradient of a pixel is used to represent the difference between the pixel and its surrounding pixels, and can reflect the complexity of the pixel (eg, texture characteristics, etc.).

[0011] In one possible implementation, the predicted residual value of the first pixel point includes: a target value or an average value of the target values; wherein the target value is the gradient of the reconstructed pixels around the first pixel point; or, the target value is the absolute value of the gradient of the reconstructed pixels around the first pixel point; or, the target value is the residual value of the dequantized residual values ​​of the reconstructed pixels around the first pixel point; or, the target value is the absolute value of the residual values ​​of the dequantized residual values ​​of the reconstructed pixels around the first pixel point.

[0012] In one possible implementation, the above prediction method includes: predicting based on the reconstructed pixels on the left and right sides of the pixel point; and / or predicting based on the reconstructed pixels on the upper and lower sides of the pixel point; and / or predicting based on the reconstructed pixels on the left side of the pixel point; and / or predicting based on the reconstructed pixels on the upper side of the pixel point.

[0013] In another possible implementation, the prediction method of the first pixel point is to predict based on the reconstructed pixel points on the left and right sides of the pixel point; the prediction residual value of the first pixel point is determined based on the prediction method of the first pixel point, including: calculating the difference between the pixel values ​​of the second pixel point and the third pixel point as the first difference; or, using the residual value after inverse quantization of the second pixel point as the first difference; the second pixel point is the first reconstructed pixel point on the left side of the first pixel point, and the third pixel point is the first reconstructed pixel point on the upper side of the second pixel point; calculating the difference between the pixel values ​​of the fourth pixel point and the fifth pixel point as the second difference; or, using the residual value of the fourth pixel point after inverse quantization as the second difference; the fourth pixel point is the first reconstructed pixel point on the right side of the first pixel point, and the fifth pixel point is the first reconstructed pixel point on the upper side of the fourth pixel point; using the average of the absolute value of the first difference and the absolute value of the second difference as the prediction residual value of the first pixel point.

[0014] In another possible implementation, the prediction method of the first pixel point is to predict based on the reconstructed pixel points on the upper and lower sides of the pixel point; the prediction residual value of the first pixel point is determined based on the prediction method of the first pixel point, including: calculating the difference between the pixel values ​​of the sixth pixel point and the seventh pixel point as the third difference; the sixth pixel point is the first reconstructed pixel point on the upper side of the first pixel point, and the seventh pixel point is the first reconstructed pixel point on the left side of the sixth pixel point; calculating the difference between the pixel values ​​of the eighth pixel point and the ninth pixel point as the fourth difference; or, using the residual value after inverse quantization of the eighth pixel point as the fourth difference; the eighth pixel point is the first reconstructed pixel point on the lower side of the first pixel point, and the ninth pixel point is the first reconstructed pixel point on the left side of the eighth pixel point; and using the average of the absolute value of the third difference and the absolute value of the fourth difference as the prediction residual value of the first pixel point.

[0015] In another possible implementation, the prediction method for the first pixel is to predict based on the reconstructed pixel on the left side of the pixel; the prediction residual value of the first pixel is determined based on the prediction method for the first pixel, including: taking the absolute value of the difference between the pixel values ​​of the tenth pixel and the eleventh pixel as the prediction residual value of the first pixel; the tenth pixel is the first reconstructed pixel on the left side of the first pixel, and the eleventh pixel is the first reconstructed pixel on the left side of the tenth pixel; or, taking the absolute value of the difference between the pixel values ​​of the tenth pixel and the twelfth pixel as the prediction residual value of the first pixel; the twelfth pixel is the first reconstructed pixel above the tenth pixel; or, taking the absolute value of the residual value after inverse quantization of the tenth pixel as the prediction residual value of the first pixel.

[0016] In another possible implementation, the prediction method for the first pixel point is to predict based on the reconstructed pixel point on the upper side of the pixel point; the prediction residual value of the first pixel point is determined based on the prediction method for the first pixel point, including: taking the absolute value of the difference between the pixel values ​​of the thirteenth pixel point and the fourteenth pixel point as the prediction residual value of the first pixel point; the thirteenth pixel point is the first reconstructed pixel point on the upper side of the first pixel point, and the fourteenth pixel point is the first reconstructed pixel point on the upper side of the thirteenth pixel point; or, taking the absolute value of the residual value after inverse quantization of the thirteenth pixel point as the prediction residual value of the first pixel point.

[0017] In another possible implementation, the method further includes: determining a predicted QP value of a first pixel; the predicted QP value of the first pixel is the QP value of a current coding block; the above-mentioned determination of a target quantization parameter QP value of the first pixel based on the predicted residual value of the first pixel includes: if the first pixel is a target pixel in the current coding block, adjusting the predicted QP value of the first pixel according to the predicted residual value to obtain a target QP value of the first pixel; the target pixel is a pixel with a preset adjusted QP value; or, if the first pixel is a pixel other than the target pixel in the current coding block, using the predicted QP value of the first pixel as the target QP value.

[0018] In another possible implementation, the above-mentioned adjusting the predicted QP value of the first pixel point according to the predicted residual value to obtain the target QP value of the first pixel point includes: if the predicted QP value of the first pixel point is greater than or equal to the first threshold and less than or equal to the second threshold, and the predicted residual value of the first pixel point is less than or equal to the third threshold, adjusting the predicted QP value of the first pixel point to obtain the target QP value; the target QP value is less than the predicted QP value; otherwise, using the predicted QP value of the first pixel point as the target QP value of the first pixel point.

[0019] In another possible implementation, the first threshold is a QP value corresponding to the distortion that can be just perceived by the human eye, and the second threshold is an adjustable maximum QP value.

[0020] In another possible implementation, the above-mentioned adjustment of the predicted QP value of the first pixel point to obtain the target QP value of the first pixel point includes: taking the larger value of the QP value obtained by subtracting the preset offset from the predicted QP value and the QP value corresponding to the distortion just perceptible to the human eye as the target QP value.

[0021] In another possible implementation, the QP value corresponding to the distortion just perceptible to the human eye is determined according to the bit depth of the first pixel in the target channel, or the channel index of the first pixel.

[0022] In another possible implementation, the adjustable QP maximum value is determined according to one or more of the bit depth of the first pixel in the target channel, the channel index of the first pixel, and the fullness of the code stream buffer.

[0023] In another possible implementation, the third threshold is determined according to one or more of the bit depth of the first pixel in the target channel, the channel index of the first pixel, and the texture complexity of the current block.

[0024] In another possible implementation, the preset offset is determined based on one or more of the bit depth of the first pixel in the target channel, the channel index of the first pixel, the fullness of the bitstream buffer, and the texture complexity of the current coding block.

[0025] In another possible implementation, the above-mentioned current coding block includes at least a first part of pixel points and / or a second part of pixel points; wherein the first part of pixel points are set to pixel points whose QP values ​​do not need to be adjusted; the second part of pixel points are set to pixel points whose QP values ​​are to be adjusted; the first part of pixel points and the second part of pixel points are determined according to a point-by-point prediction mode of the current coding block; and the target pixel point is any one or more pixel points in the second part of pixel points.

[0026] In another possible implementation, the point-by-point prediction mode of the current coding block includes: mode one and mode two; mode one is a vertical prediction mode for processing vertical type textures; mode two is a horizontal prediction mode for processing horizontal type textures; when the point-by-point prediction mode of the current coding block is mode one, the second part of the pixel points includes at least one of the following: first-category pixel points, fourth-category pixel points that are not in the first row; the first-category pixel points are pixel points predicted based on the reconstructed pixel points on the left and right sides of the pixel points; the fourth-category pixel points are pixel points predicted based on the reconstructed pixel points on the upper side of the pixel points; when the point-by-point prediction mode of the current coding block is mode two, the second part of the pixel points includes at least one of the following: second-category pixel points that are not in the first column, third-category pixel points that are not in the first column, and fourth-category pixel points that are not in the first row; the second-category pixel points are pixel points predicted based on the reconstructed pixel points on the upper and lower sides of the pixel points; the third-category pixel points are pixel points predicted based on the reconstructed pixel points on the left side of the pixel points.

[0027] In the second aspect, an embodiment of the present application provides an image encoding method, which is executed by an encoding end, and the method includes: determining a prediction residual value of the first pixel point according to a prediction method of the first pixel point; the prediction residual value is used to reflect the gradient of the first pixel point; the prediction method is used to indicate the position of a reconstructed pixel point that is referenced when predicting the pixel point; the first pixel point is any pixel point in the current coding block; determining a target quantization parameter QP value of the first pixel point according to the prediction residual value of the first pixel point; and quantizing the first pixel point according to the target QP value of the first pixel point.

[0028] Through the image encoding method provided in the embodiments of the present application, the video encoder can determine the prediction residual value (reflecting the gradient of the first pixel) of each pixel point according to the prediction mode of each pixel point in the coding block (the prediction mode is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point), and then determine the QP of each pixel point granularity for the pixel point in the coding block, so as to quantize each pixel point according to the QP value of each pixel point, that is, quantize pixel by pixel. In this way, the decoding distortion of the image frame can be reduced while ensuring a certain compression rate, and the authenticity and accuracy of the image decoding can be improved.

[0029] It can be understood that each step in the image encoding method is the reverse operation of the aforementioned image decoding method. Therefore, various possible implementations of the image encoding method can be reversed by referring to the descriptions of various possible implementations of the image decoding method, which will not be repeated here.

[0030] In a third aspect, an embodiment of the present application provides an image decoding device, which is deployed in a decoding end, and includes various modules for implementing the method of the first aspect and one of its possible implementation methods, such as a determination unit and an inverse quantization unit.

[0031] The technical solution and beneficial effects of the third aspect can be found in the description of the first aspect and any one of its possible implementations, and will not be repeated here. The image decoding device has the function of implementing the behavior in the method example of any one of the first aspect and its possible implementations. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0032] In a fourth aspect, an embodiment of the present application provides an image encoding device, which is deployed in an encoding end, and includes various modules for implementing the method of the second aspect and one of its possible implementation methods, such as a determination unit and a quantization unit.

[0033] The technical solution and beneficial effects of the fourth aspect can be found in the description of the second aspect and any one of its possible implementations, and will not be repeated here. The image encoding device has the function of implementing the behavior in the method example of any one of the second aspect and its possible implementations. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0034] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory is used to store computer instructions, and the processor is used to call and execute computer instructions from the memory to implement the method of any one of the first aspect to the second aspect and their possible implementation methods.

[0035] For example, the electronic device may be a video encoder, or an encoding end including a video encoder.

[0036] For another example, the electronic device may refer to a video decoder, or a decoding end including a video decoder.

[0037] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are executed by a computing device or a storage system where the computing device is located, the method of any one of the first aspect to the second aspect and their possible implementation methods is implemented.

[0038] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the computer program product runs on a computing device or a processor, the computing device or the processor executes the instructions to implement the method of any one of the first aspect to the second aspect and their possible implementation methods.

[0039] In an eighth aspect, an embodiment of the present application provides a chip, comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory to implement the method of any one of the first aspect to the second aspect and their possible implementation methods.

[0040] In a ninth aspect, an embodiment of the present application provides a video decoding system, which includes an encoding end and a decoding end, the decoding end is used to implement the method of the first aspect and any one of its possible implementations, and the encoding end is used to implement the method of the second aspect and any one of its possible implementations.

[0041] Based on the implementation methods provided in the above aspects, the embodiments of the present application can be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1An exemplary block diagram of a video decoding system provided in an embodiment of the present application;

[0043] Figure 2 An exemplary block diagram of a video encoder provided in an embodiment of the present application;

[0044] Figure 3 An exemplary block diagram of a video decoder provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of a video encoding / decoding process provided in an embodiment of the present application;

[0046] Figure 5 One of the flowcharts of an image decoding method provided in an embodiment of the present application;

[0047] Figure 6 A second flowchart of an image decoding method provided in an embodiment of the present application;

[0048] Figure 7 A schematic diagram of pixel distribution provided in an embodiment of the present application;

[0049] Figure 8 This is one of the schematic diagrams of pixel division in a point-by-point prediction mode provided in an embodiment of the present application;

[0050] Fig. 9 A second schematic diagram of pixel division in a point-by-point prediction mode provided in an embodiment of the present application;

[0051] Fig.10 A third schematic diagram of pixel division in a point-by-point prediction mode provided in an embodiment of the present application;

[0052] Fig.11 A fourth schematic diagram of pixel division in a point-by-point prediction mode provided in an embodiment of the present application;

[0053] Fig.12 A fifth schematic diagram of pixel division in a point-by-point prediction mode provided in an embodiment of the present application;

[0054] Fig.13 A third flowchart of an image decoding method provided in an embodiment of the present application;

[0055] Fig.14 A fourth flowchart of an image decoding method provided in an embodiment of the present application;

[0056] Fig.15 A sixth schematic diagram of pixel division in a point-by-point prediction mode provided in an embodiment of the present application;

[0057] Fig.16A schematic diagram of a flow chart of an image encoding method provided in an embodiment of the present application;

[0058] Fig.17 A schematic diagram of the structure of an image decoding device provided by the present application;

[0059] Fig.18 A schematic diagram of the structure of an image encoding device provided by the present application;

[0060] Fig.19 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0061] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0062] The terms "first" and "second" and the like in the specification and drawings of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.

[0063] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0064] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0065] In the description of the present application, unless otherwise specified, “plurality” means two or more.

[0066] The image decoding method and encoding method provided in the embodiments of the present application can also be used for video decoding and video encoding. It should be understood that a video includes a series of images (pictures), and decoding and encoding a video is essentially decoding and encoding all the images included in the video.

[0067] It can be understood that the quantization involved in the image coding process refers to the process of mapping the continuous value (or a large number of discrete values) of the signal to a finite number of discrete values. Quantization can achieve a many-to-one mapping of signal values. In video coding, after the residual signal is transformed, the transform coefficients often have a large dynamic range. Therefore, quantizing the transform coefficients can effectively reduce the signal value space and obtain better compression effects. However, due to the many-to-one mapping mechanism, the quantization process will inevitably introduce distortion, which is the root cause of distortion in video coding.

[0068] Inverse quantization is the reverse process of quantization. Inverse quantization refers to mapping the quantized coefficients into a reconstructed signal in the input signal space. The reconstructed signal is an approximation of the input signal.

[0069] Quantization includes scalar quantization (SQ) and vector quantization. Among them, scalar quantization is the most basic quantization method. The input of scalar quantization is a one-dimensional scalar signal. The scalar quantization process includes: firstly dividing the input signal space into a series of non-intersecting intervals, and selecting a representative signal for each interval; then for each input signal, scalar quantizing the input signal into a representative signal of the interval where the input signal is located. Among them, the interval length is called the quantization step (quantization step, denoted as Qstep), the interval index is the horizontal value (Level), that is, the quantized value, and the parameter representing the quantization step is the quantization parameter (QP).

[0070] The simplest scalar quantization method is uniform scalar quantization, which divides the input signal space into equally spaced intervals, and the representative signal of each interval is the midpoint of the interval.

[0071] The optimal scalar quantizer is the Lloyd-Max quantizer. The Lloyd-Max quantizer takes into account the distribution of the input signal. The interval division is non-uniform. The representative signal of each interval is the probability centroid of the interval, and the boundary point between two adjacent intervals is the midpoint of the representative signals of the two intervals.

[0072] The following describes the system architecture used in the embodiments of the present application. Figure 1An exemplary block diagram of a video decoding system provided for the present application. As used herein, the term "video decoder" generally refers to both a video encoder and a video decoder. In the present application, the term "video decoding" or "decoding" may generally refer to video encoding or video decoding. The video encoder 100 and the video decoder 200 of the video decoding system 1 are used to predict the motion information of the current decoded image block or its sub-block, such as a motion vector, according to various method examples described in any of the multiple new inter-frame prediction modes proposed in the present application, so that the predicted motion vector is as close as possible to the motion vector obtained using the motion estimation method, so that there is no need to transmit the motion vector difference during encoding, thereby further improving the encoding and decoding performance.

[0073] like Figure 1 As shown in , the video decoding system 1 includes an encoding end 10 and a decoding end 20. The encoding end 10 generates encoded video data. Therefore, the encoding end 10 can be referred to as a video encoding device. The decoding end 20 can decode the encoded video data generated by the encoding end 10. Therefore, the decoding end 20 can be referred to as a video decoding device. Various implementations of the encoding end 10, the decoding end 20, or both may include one or more processors and a memory coupled to the one or more processors. The memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other media that can be used to store desired program code in the form of instructions or data structures that can be accessed by a computer, as described herein.

[0074] The encoding end 10 and the decoding end 20 may include various devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, car computers, or the like.

[0075] The decoding end 20 may receive the encoded video data from the encoding end 10 via the link 30. The link 30 may include one or more media or devices capable of moving the encoded video data from the encoding end 10 to the decoding end 20. In one example, the link 30 may include one or more communication media that enable the encoding end 10 to transmit the encoded video data directly to the decoding end 20 in real time. In this example, the encoding end 10 may modulate the encoded video data according to a communication standard (e.g., a wireless communication protocol), and may transmit the modulated video data to the decoding end 20. The one or more communication media may include wireless and / or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from the encoding end 10 to the decoding end 20.

[0076] In another example, the encoded data may be output from output interface 140 to storage device 40. Similarly, the encoded data may be accessed from storage device 40 via input interface 240. Storage device 40 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, a Blu-ray disc, a digital versatile disc (DVD), a compact disc read-only memory (CD-ROM), flash memory, volatile or non-volatile memory, or any other suitable digital storage media for storing encoded video data.

[0077] In another example, the storage device 40 may correspond to a file server or another intermediate storage device that can hold the encoded video generated by the encoding end 10. The decoding end 20 can access the stored video data from the storage device 40 via streaming or downloading. The file server can be any type of server capable of storing the encoded video data and transmitting the encoded video data to the decoding end 20. Example file servers include a network server (e.g., for a website), a file transfer protocol (FTP) server, a network attached storage (NAS) device, or a local disk drive. The decoding end 20 can access the encoded video data through any standard data connection (including an Internet connection). This may include a wireless channel (e.g., a wireless fidelity (Wi-Fi) connection), a wired connection (e.g., a digital subscriber line (DSL), a cable modem, etc.), or a combination of the two suitable for accessing the encoded video data stored on the file server. The transmission of the encoded video data from the storage device 40 can be streaming, downloading, or a combination of the two.

[0078] The image decoding method provided by the present application can be applied to video encoding and decoding to support a variety of multimedia applications, such as over-the-air television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (e.g., via the Internet), encoding of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or other applications. In some examples, the video decoding system 1 can be used to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting and / or video telephony.

[0079] Figure 1 The video decoding system 1 described in is only an example, and the technology of the present application can be applied to video decoding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between the encoding device and the decoding device. In other examples, data is retrieved from local storage, streamed over a network, etc. A video encoding device may encode data and store the data to a memory, and / or a video decoding device may retrieve data from a memory and decode the data. In many examples, encoding and decoding are performed by devices that do not communicate with each other but only encode data to a memory and / or retrieve data from a memory and decode data.

[0080] exist Figure 1In an example of , the encoding end 10 includes a video source 120, a video encoder 100, and an output interface 140. In some examples, the output interface 140 may include a modulator / demodulator (modem) and / or a transmitter. The video source 120 may include a video capture device (e.g., a camera), a video archive containing previously captured video data, a video feed interface for receiving video data from a video content provider, and / or a computer graphics system for generating video data, or a combination of such sources of video data.

[0081] The video encoder 100 may encode video data from a video source 120. In some examples, the encoding end 10 transmits the encoded video data directly to the decoding end 20 via an output interface 140. In other examples, the encoded video data may also be stored on a storage device 40 for later access by the decoding end 20 for decoding and / or playback.

[0082] exist Figure 1 In the example of , the decoding end 20 includes an input interface 240, a video decoder 200, and a display device 220. In some examples, the input interface 240 includes a receiver and / or a modem. The input interface 240 can receive the encoded video data via the link 30 and / or from the storage device 40. The display device 220 can be integrated with the decoding end 20 or can be external to the decoding end 20. In general, the display device 220 displays the decoded video data. The display device 220 may include a variety of display devices, for example, a liquid crystal display (LCD), a plasma display, an organic light-emitting diode (OLED) display, or other types of display devices.

[0083] although Figure 1 100 and 200 may each be integrated with an audio encoder and decoder, and may include appropriate multiplexer-demultiplexer units or other hardware and software to handle the encoding of both audio and video in a common data stream or in separate data streams. In some examples, the demultiplexer (MUX-DEMUX) unit may conform to the ITU H.223 multiplexer protocol, or other protocols such as the user datagram protocol (UDP), if applicable.

[0084] The video encoder 100 and the video decoder 200 may each be implemented as any of a variety of circuits such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. If the present application is implemented in part in software, the device may store instructions for the software in a suitable non-volatile computer-readable storage medium, and may use one or more processors to execute the instructions in hardware to implement the technology of the present application. Any of the foregoing (including hardware, software, a combination of hardware and software, etc.) may be considered as one or more processors. Each of the video encoder 100 and the video decoder 200 may be included in one or more encoders or decoders, and any of the encoders or decoders may be integrated as part of a combined encoder / decoder (encoder-decoder) in a corresponding device.

[0085] The application may generally refer to the video encoder 100 as "signaling" or "transmitting" certain information to another device, such as the video decoder 200. The term "signaling" or "transmitting" may generally refer to the transmission of syntax elements and / or other data used to decode the compressed video data. This transmission may occur in real time or near real time. Alternatively, this communication may occur over a period of time, such as when the syntax elements are stored in the encoded bitstream to a computer-readable storage medium at the time of encoding, and the decoding device may then retrieve the syntax elements at any time after the syntax elements are stored to such medium.

[0086] JCT-VC developed the H.265 (HEVC) standard. HEVC standardization is based on an evolutionary model of a video decoding device called the HEVC test model (HEVCmodel, HM). The latest standard document of H.265 can be obtained from http: / / www.itu.int / rec / T-REC-H.265, and the latest version of the standard document is H.265 (12 / 16), which is incorporated herein by reference in its entirety. HM assumes that the video decoding device has several additional capabilities relative to the existing algorithm of ITU-TH.264 / AVC. For example, H.264 provides 9 intra-frame prediction coding modes, while HM can provide up to 35 intra-frame prediction coding modes.

[0087] JVET is committed to the development of the H.266 standard. The process of H.266 standardization is based on an evolutionary model of a video decoding device called the H.266 test model. The algorithm description of H.266 is available from http: / / phenix.int-evry.fr / jvet, where the latest algorithm description is contained in JVET-F1001-v2, which is incorporated herein by reference in its entirety. At the same time, the reference software of the JEM test model can be obtained from https: / / jvet.hhi.fraunhofer.de / svn / svn_HMJEMSoftware / , which is also incorporated herein by reference in its entirety.

[0088] In general, the working model of HM describes that a video frame or image can be divided into a sequence of tree blocks or largest coding units (LCUs) that include both luma and chroma samples, and LCUs are also called coding tree units (CTUs). Tree blocks have a similar purpose to macroblocks of the H.264 standard. A slice includes several consecutive tree blocks in decoding order. A video frame or image can be partitioned into one or more slices. Each tree block can be split into coding units (CUs) according to a quadtree. For example, a tree block that is the root node of a quadtree can be split into four child nodes, and each child node can be a parent node and split into another four child nodes. The final unsplittable child nodes that are leaf nodes of the quadtree include decoding nodes, such as decoded video blocks. Syntax data associated with the decoded bitstream can define the maximum number of times a tree block can be split, and can also define the minimum size of a decoding node.

[0089] The size of a CU corresponds to the size of a decoding node and must be square in shape. The size of a CU can range from 8x8 pixels up to a maximum of 64x64 pixels or larger treeblock size.

[0090] A video sequence typically includes a series of video frames or images. A group of pictures (GOP) exemplarily includes a series of one or more video images. A GOP may include syntax data in the header information of the GOP, in the header information of one or more of the images, or elsewhere, and the syntax data describes the number of images included in the GOP. Each slice of the image may include slice syntax data describing the encoding mode of the corresponding image. The video encoder 100 typically operates on video blocks within individual video slices to encode video data. A video block may correspond to a decoding node within a CU. A video block may have a fixed or variable size and may differ in size according to a specified decoding standard.

[0091] In this application, "N×N" and "N times N" may be used interchangeably to refer to the pixel size of a video block in terms of vertical and horizontal dimensions, e.g., 16×16 pixels or 16 times 16 pixels. In general, a 16×16 block will have 16 pixels in the vertical direction (y=16) and 16 pixels in the horizontal direction (x=16). Similarly, an N×N block generally has N pixels in the vertical direction and N pixels in the horizontal direction, where N represents a non-negative integer value. The pixels in a block may be arranged in rows and columns. Furthermore, a block need not necessarily have the same number of pixels in the horizontal direction as in the vertical direction. For example, a block may include N×M pixels, where M is not necessarily equal to N.

[0092] After intra / inter predictive decoding using a CU, the video encoder 100 may calculate residual data for the CU. The CU may include pixel data in a spatial domain (also referred to as a pixel domain), and the CU may include coefficients in a transform domain after a transform (e.g., a discrete cosine transform (DCT), an integer transform, a discrete wavelet transform, or a conceptually similar transform) is applied to the residual video data. The residual data may correspond to a pixel difference between a pixel of an unencoded image and a prediction value corresponding to the CU. The video encoder 100 may form a CU including the residual data and generate transform coefficients for the CU.

[0093] After any transform to produce transform coefficients, the video encoder 100 may perform quantization of the transform coefficients. Quantization illustratively refers to the process of quantizing the coefficients to possibly reduce the amount of data used to represent the coefficients, thereby providing further compression. The quantization process may reduce the bit depth associated with some or all of the coefficients. For example, an n-bit value may be truncated to an m-bit value during quantization, where n is greater than m.

[0094] In some possible embodiments, the video encoder 100 may scan the quantized transform coefficients using a predefined scanning order to generate a serialized vector that can be entropy encoded. In other possible embodiments, the video encoder 100 may perform adaptive scanning. After scanning the quantized transform coefficients to form a one-dimensional vector, the video encoder 100 may entropy decode the one-dimensional vector according to context-based adaptive variable-length code (CAVLC), context-based adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) decoding or other entropy decoding methods. The video encoder 100 may also entropy encode syntax elements associated with the encoded video data for use by the video decoder 200 to decode the video data.

[0095] To perform CABAC, the video encoder 100 may assign context within a context model to a symbol to be transmitted. The context may be related to whether the adjacent values ​​of the symbol are non-zero. To perform CAVLC, the video encoder 100 may select a variable length code for the symbol to be transmitted. The codewords in variable-length decoding (VLC) may be constructed so that relatively shorter codes correspond to symbols with greater probability, while longer codes correspond to symbols with less probability. In this way, the use of VLC can achieve the purpose of saving code rate relative to using equal length codewords for each symbol to be transmitted. The probability in CABAC can be determined based on the context assigned to the symbol.

[0096] In an embodiment of the present application, the video encoder may perform inter-frame prediction to reduce temporal redundancy between images. The present application may refer to the CU that the video decoder is currently decoding as the current CU. The present application may refer to the image that the video decoder is currently decoding as the current image.

[0097] Figure 21 is an exemplary block diagram of a video encoder provided by the present application. The video encoder 100 is used to output video to a post-processing entity 41. The post-processing entity 41 represents an example of a video entity that can process the encoded video data from the video encoder 100, such as a media aware network element (MANE) or a splicing / editing device. In some cases, the post-processing entity 41 may be an example of a network entity. In some video encoding systems, the post-processing entity 41 and the video encoder 100 may be parts of separate devices, while in other cases, the functionality described with respect to the post-processing entity 41 may be performed by the same device including the video encoder 100. In one example, the post-processing entity 41 is Figure 1 An example of a storage device 40.

[0098] exist Figure 2 In the example of , the video encoder 100 includes a prediction processing unit 108, a filter unit 106, a decoded picture buffer (DPB) 107, a summer 112, a transformer 101, a quantizer 102, and an entropy encoder 103. The prediction processing unit 108 includes an inter-frame predictor 110 and an intra-frame predictor 109. For image block reconstruction, the video encoder 100 also includes an inverse quantizer 104, an inverse transformer 105, and a summer 111. The filter unit 106 is intended to represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter. Although in Figure 2 The filter unit 106 is shown as an in-loop filter in FIG. 1 , but in other implementations, the filter unit 106 may be implemented as a post-loop filter. In one example, the video encoder 100 may further include a video data memory and a segmentation unit (not shown in the figure).

[0099] The video data memory may store video data to be encoded by the components of the video encoder 100. The video data stored in the video data memory may be obtained from the video source 120. The DPB 107 may be a reference image memory that stores reference video data for encoding the video data in the intra-frame and inter-frame decoding modes by the video encoder 100. The video data memory and the DPB 107 may be formed by any of a variety of memory devices, such as a dynamic random access memory (DRAM) including a synchronous dynamic random access memory (SDRAM), a magnetic random access memory (MRAM), a resistive random access memory (RRAM), or other types of memory devices. The video data memory and the DPB 107 may be provided by the same memory device or a separate memory device. In various examples, the video data memory may be on-chip with other components of the video encoder 100, or off-chip relative to those components.

[0100] like Figure 2 As shown, the video encoder 100 receives video data and stores the video data in a video data memory. The segmentation unit segments the video data into a number of image blocks, and these image blocks can be further segmented into smaller blocks, such as image block segmentation based on a quadtree structure or a binary tree structure. This segmentation can also include segmentation into slices, tiles or other larger units. The video encoder 100 generally describes components for encoding image blocks within a video slice to be encoded. The slice can be divided into multiple image blocks (and may be divided into sets of image blocks called slices). The prediction processing unit 108 can select one of multiple possible decoding modes for the current image block, such as one of multiple intra-frame decoding modes or one of multiple inter-frame decoding modes. The prediction processing unit 108 can provide the resulting intra-frame and inter-frame decoded blocks to the summer 112 to generate residual blocks, and to the summer 111 to reconstruct the encoded blocks used as reference images.

[0101] The intra-frame predictor 109 within the prediction processing unit 108 may perform intra-frame predictive encoding of the current image block relative to one or more neighboring blocks in the same frame or slice as the current block to be encoded to remove spatial redundancy. The inter-frame predictor 110 within the prediction processing unit 108 may perform inter-frame predictive encoding of the current image block relative to one or more prediction blocks in one or more reference images to remove temporal redundancy.

[0102] Specifically, the inter-frame predictor 110 can be used to determine the inter-frame prediction mode for encoding the current image block. For example, the inter-frame predictor 110 can use rate-distortion analysis to calculate the rate-distortion values ​​of various inter-frame prediction modes in the candidate inter-frame prediction mode set, and select the inter-frame prediction mode with the best rate-distortion characteristics. The rate-distortion analysis generally determines the amount of distortion (or error) between the encoded block and the original unencoded block encoded to generate the encoded block, as well as the bit rate (that is, the number of bits) used to generate the encoded block. For example, the inter-frame predictor 110 can determine that the inter-frame prediction mode with the lowest rate-distortion cost for encoding the current image block in the candidate inter-frame prediction mode set is the inter-frame prediction mode used for inter-frame prediction of the current image block.

[0103] The inter-frame predictor 110 is used to predict the motion information (e.g., motion vector) of one or more sub-blocks in the current image block based on the determined inter-frame prediction mode, and obtain or generate the prediction block of the current image block using the motion information (e.g., motion vector) of one or more sub-blocks in the current image block. The inter-frame predictor 110 can locate the prediction block pointed to by the motion vector in one of the reference image lists. The inter-frame predictor 110 can also generate syntax elements associated with the image block and the video slice for use by the video decoder 200 when decoding the image block of the video slice. Alternatively, in one example, the inter-frame predictor 110 performs a motion compensation process using the motion information of each sub-block to generate a prediction block for each sub-block, thereby obtaining a prediction block for the current image block; it should be understood that the inter-frame predictor 110 here performs motion estimation and motion compensation processes.

[0104] Specifically, after selecting the inter prediction mode for the current image block, the inter predictor 110 may provide information indicating the selected inter prediction mode of the current image block to the entropy encoder 103 so that the entropy encoder 103 encodes the information indicating the selected inter prediction mode.

[0105] The intra-frame predictor 109 may perform intra-frame prediction on the current image block. Specifically, the intra-frame predictor 109 may determine an intra-frame prediction mode used to encode the current block. For example, the intra-frame predictor 109 may use rate-distortion analysis to calculate rate-distortion values ​​for various intra-frame prediction modes to be tested, and select an intra-frame prediction mode with the best rate-distortion characteristics from the modes to be tested. In any case, after selecting an intra-frame prediction mode for the image block, the intra-frame predictor 109 may provide information indicating the selected intra-frame prediction mode of the current image block to the entropy encoder 103 so that the entropy encoder 103 encodes the information indicating the selected intra-frame prediction mode.

[0106] After the prediction processing unit 108 generates a prediction block for the current image block via inter-frame prediction and intra-frame prediction, the video encoder 100 forms a residual image block by subtracting the prediction block from the current image block to be encoded. The summer 112 represents one or more components that perform this subtraction operation. The residual video data in the residual block may be contained in one or more (transformunit, TU) and applied to the transformer 101. The transformer 101 transforms the residual video data into residual transform coefficients using a transform such as a discrete cosine transform (discrete cosine transform, DCT) or a conceptually similar transform. The transformer 101 can convert the residual video data from a pixel value domain to a transform domain, such as a frequency domain.

[0107] Transformer 101 may send the resulting transform coefficients to quantizer 102. Quantizer 102 quantizes the transform coefficients to further reduce the bit rate. In some examples, quantizer 102 may then perform a scan of the matrix including the quantized transform coefficients. Alternatively, entropy encoder 103 may perform the scan.

[0108] After quantization, the entropy encoder 103 performs entropy encoding on the quantized transform coefficients. For example, the entropy encoder 103 may perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy coding method or technique. After entropy encoding by the entropy encoder 103, the encoded bitstream may be transmitted to the video decoder 200, or archived for later transmission or retrieval by the video decoder 200. The entropy encoder 103 may also perform entropy encoding on syntax elements of the current image block to be encoded.

[0109] The inverse quantizer 104 and the inverse transformer 105 apply inverse quantization and inverse transformation, respectively, to reconstruct the residual block in the pixel domain, for example, for later use as a reference block of a reference image. The summer 111 adds the reconstructed residual block to the prediction block generated by the inter-frame predictor 110 or the intra-frame predictor 109 to generate a reconstructed image block. The filter unit 106 can be applied to the reconstructed image block to reduce distortion, such as block artifacts. The reconstructed image block is then stored as a reference block in the decoded image buffer 107, which can be used by the inter-frame predictor 110 as a reference block to perform inter-frame prediction on a block in a subsequent video frame or image.

[0110] It should be understood that other structural changes of the video encoder 100 can be used to encode the video stream. For example, for some image blocks or image frames, the video encoder 100 can directly quantize the residual signal without being processed by the transformer 101, and accordingly, it does not need to be processed by the inverse transformer 105; or, for some image blocks or image frames, the video encoder 100 does not generate residual data, and accordingly, it does not need to be processed by the transformer 101, the quantizer 102, the inverse quantizer 104 and the inverse transformer 105; or, the video encoder 100 can directly store the reconstructed image block as a reference block without being processed by the filter unit 106; or, the quantizer 102 and the inverse quantizer 104 in the video encoder 100 can be combined together.

[0111] Figure 3 An exemplary block diagram of a video decoder 200 provided in the present application. Figure 3 In an example of FIG. 1 , the video decoder 200 includes an entropy decoder 203, a prediction processing unit 208, an inverse quantizer 204, an inverse transformer 205, a summer 211, a filter unit 206, and a DPB 207. The prediction processing unit 208 may include an inter-frame predictor 210 and an intra-frame predictor 209. In some examples, the video decoder 200 may perform substantially the same Figure 2 The encoding process described in video encoder 100 is the inverse of the decoding process.

[0112] During the decoding process, the video decoder 200 receives an encoded video code stream representing image blocks and associated syntax elements of an encoded video slice from the video encoder 100. The video decoder 200 can receive video data from the network entity 42, and optionally, can also store the video data in a video data memory (not shown in the figure). The video data memory can store video data to be decoded by the components of the video decoder 200, such as an encoded video code stream. The video data stored in the video data memory can be obtained, for example, from the storage device 40, from a local video source such as a camera, via a wired or wireless network communication of the video data, or by accessing a physical data storage medium. The video data memory can be used as a decoded picture buffer (CPB) for storing encoded video data from an encoded video code stream. Therefore, although in Figure 3The video data memory is not shown in the figure, but the video data memory and DPB 207 can be the same memory or separately arranged. The video data memory and DPB 207 can be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM) including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. In various examples, the video data memory can be integrated on the chip with other components of the video decoder 200, or can be arranged off the chip relative to those components.

[0113] The network entity 42 may be a server, a MANE, a video editor / splicer, or other device for implementing one or more of the techniques described above. The network entity 42 may or may not include a video encoder, such as the video encoder 100. Before the network entity 42 sends the encoded video code stream to the video decoder 200, the network entity 42 may implement some of the techniques described in this application. In some video decoding systems, the network entity 42 and the video decoder 200 may be parts of separate devices, while in other cases, the functionality described with respect to the network entity 42 may be performed by the same device including the video decoder 200. In some cases, the network entity 42 may be Figure 1 An example of a storage device 40.

[0114] The entropy decoder 203 of the video decoder 200 entropy decodes the code stream to generate quantized coefficients and some syntax elements. The entropy decoder 203 forwards the syntax elements to the prediction processing unit 208. The video decoder 200 may receive syntax elements at the video slice level and / or the image block level.

[0115] When the video slice is decoded as an intra-frame decoded (I) slice, the intra-frame predictor 209 of the prediction processing unit 208 may generate a prediction block for the image block of the current video slice based on the signaled intra-frame prediction mode and data from a previously decoded block of the current frame or picture. When the video slice is decoded as an inter-frame decoded (i.e., B or P) slice, the inter-frame predictor 210 of the prediction processing unit 208 may determine an inter-frame prediction mode for decoding the current image block of the current video slice based on the syntax elements received from the entropy decoder 203, and decode the current image block (e.g., perform inter-frame prediction) based on the determined inter-frame prediction mode. Specifically, the inter-frame predictor 210 may determine whether to use a new inter-frame prediction mode to predict the current image block of the current video strip. If the syntax element indicates that the new inter-frame prediction mode is used to predict the current image block, the motion information of the current image block or the sub-block of the current image block of the current video strip is predicted based on the new inter-frame prediction mode (for example, a new inter-frame prediction mode specified by the syntax element or a default new inter-frame prediction mode), so as to obtain or generate a prediction block of the current image block or the sub-block of the current image block by using the predicted motion information of the current image block or the sub-block of the current image block through a motion compensation process. The motion information here may include reference image information and motion vectors, wherein the reference image information may include but is not limited to unidirectional / bidirectional prediction information, a reference image list number and a reference image index corresponding to the reference image list. For inter-frame prediction, a prediction block may be generated from one of the reference images in one of the reference image lists. The video decoder 200 may construct reference image lists, i.e., list 0 and list 1, based on the reference images stored in the DPB 207. The reference frame index of the current image may be included in one or more of the reference frame list 0 and the list 1. In some examples, the video encoder 100 may signal a specific syntax element indicating whether a new inter-frame prediction mode is used to decode a specific block, or may signal a specific syntax element indicating whether a new inter-frame prediction mode is used and indicating which new inter-frame prediction mode is used to decode a specific block. It should be understood that the inter-frame predictor 210 here performs a motion compensation process.

[0116] The inverse quantizer 204 inversely quantizes, i.e., dequantizes, the quantized transform coefficients provided in the bitstream and decoded by the entropy decoder 203. The inverse quantization process may include using the quantization parameters calculated by the video encoder 100 for each image block in the video slice to determine the degree of quantization to be applied and likewise the degree of inverse quantization to be applied. The inverse transformer 205 applies an inverse transform to the transform coefficients, such as an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process, to generate a residual block in the pixel domain.

[0117] After the inter-frame predictor 210 generates a prediction block for the current image block or a sub-block of the current image block, the video decoder 200 obtains a reconstructed block, i.e., a decoded image block, by summing the residual block from the inverse transformer 205 with the corresponding prediction block generated by the inter-frame predictor 210. The summer 211 represents a component that performs this summing operation. If necessary, a loop filter (in the decoding loop or after the decoding loop) may also be used to smooth pixel transitions or otherwise improve video quality. The filter unit 206 may represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter. Although in Figure 3 206 is shown as an in-loop filter, but in other implementations, the filter unit 206 may be implemented as a post-loop filter. In one example, the filter unit 206 is adapted to reconstruct the block to reduce block distortion, and the result is output as a decoded video stream. Furthermore, the decoded image blocks in a given frame or image may also be stored in a decoded image buffer 207, and the DPB 207 stores reference images for subsequent motion compensation. The DPB 207 may be part of a memory that may also store the decoded video for later display on a display device (e.g., Figure 1 The memory may be presented on a display device 220) or may be separate from such memory.

[0118] It should be understood that other structural changes of the video decoder 200 can be used to decode the encoded video code stream. For example, the video decoder 200 can generate an output video stream without being processed by the filter unit 206; or, for some image blocks or image frames, the entropy decoder 203 of the video decoder 200 does not decode the quantized coefficients, and accordingly does not need to be processed by the inverse quantizer 204 and the inverse transformer 205.

[0119] The techniques of the present application may be performed by any of the video encoders or video decoders described in the present application, such as Figures 1 to 3 The video encoder 100 and the video decoder 200 shown and described. That is, in one possible implementation, Figure 2 The described video encoder 100 may perform the specific techniques described below when performing inter-frame prediction during encoding of a block of video data. Figure 3 The described video decoder 200 may perform the specific techniques described below when performing inter-prediction during decoding of a block of video data. Thus, references to a general "video encoder" or "video decoder" may include the video encoder 100, the video decoder 200, or another video encoding or decoding unit.

[0120] Figure 1 to Figure 3These are merely examples provided for the embodiments of the present application. In some examples, the video encoder 100, the video decoder 200, and the video decoding system may include more or fewer components or units, and the present application is not limited thereto.

[0121] Below Figure 1 to Figure 3 Based on the video decoding system shown, the embodiment of the present application provides a possible video encoding / decoding implementation method, such as Figure 4 As shown, Figure 4 A flowchart of a video encoding / decoding process provided in the present application, wherein the video encoding / decoding implementation method includes process ① to process ⑤, and process ① to process ⑤ can be executed by any one or more of the above-mentioned encoding end 10, video encoder 100, decoding end 20 or video decoder 200.

[0122] Process ①: Divide a frame of image into one or more non-overlapping parallel coding units. The one or more parallel coding units have no dependencies and can be completely parallel / independently encoded and decoded, such as Figure 4 A parallel encoding unit 1 and a parallel encoding unit 2 are shown.

[0123] Process ②: Each parallel coding unit can be further divided into one or more non-overlapping independent coding units. The independent coding units may not depend on each other, but may share some parallel coding unit header information.

[0124] For example, the width of an independent coding unit is w_lcu and the height is h_lcu. If a parallel coding unit is divided into an independent coding unit, the size of the independent coding unit is exactly the same as the parallel coding unit; otherwise, the width of the independent coding unit should be greater than the height (unless it is an edge area).

[0125] Typically, the independent coding unit may be a fixed w_lcu×h_lcu, where w_lcu and h_lcu are both 2 to the power of N (N≥0), such as the size of the independent coding unit is 128×4, 64×4, 32×4, 16×4, 8×4, 32×2, 16×2 or 8×2.

[0126] As a possible example, the independent coding unit may be fixed to 128×4. If the size of the parallel coding unit is 256×8, the parallel coding unit may be equally divided into 4 independent coding units; if the size of the parallel coding unit is 288×10, the parallel coding unit is divided into: the first / second row is 2 128×4 + 1 32×4 independent coding units; the third row is 2 128×2 + 1 32×2 independent coding units.

[0127] It is worth noting that the independent coding unit can include three components of brightness Y, chrominance Cb, and chrominance Cr, or three components of red (red, R), green (green, G), and blue (blue, B), or only one of them. If the independent coding unit contains three components, the sizes of the three components can be exactly the same or different, which is related to the input format of the image.

[0128] Process ③: Each independent coding unit can be further divided into one or more non-overlapping coding units. The coding units within the independent coding unit can be interdependent, such as multiple coding units can perform mutual reference pre-coding and decoding.

[0129] If the coding unit and the independent coding unit have the same size (ie, the independent coding unit is divided into only one coding unit), then its size can be all the sizes of process ②.

[0130] If the independent coding unit is divided into multiple non-overlapping coding units, feasible division examples include: horizontal equal division (the height of the coding unit is the same as that of the independent coding unit, but the width is different, which can be 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.), vertical equal division (the width of the coding unit is the same as that of the independent coding unit, but the height is different, which can be 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.), horizontal and vertical equal division (quadtree division), etc., preferably horizontal equal division.

[0131] The width of the coding unit is w_cu and the height is h_cu, so its width should be greater than its height (unless it is an edge area). Usually, the coding unit can be a fixed w_cu x h_cu, where w_cu and h_cu are both 2N powers (N is greater than or equal to 0), such as 16x4, 8x4, 16x2, 8x2, 8x1, 4x1, etc.

[0132] As a possible example, the coding unit may be a fixed 16x4. If the size of the independent coding unit is 64x4, the independent coding unit may be equally divided into 4 coding units; if the size of the independent coding unit is 72x4, the coding unit may be divided into: 4 16x4 + 1 8x4.

[0133] It is worth noting that the coding unit can include three components of brightness Y, chrominance Cb, and chrominance Cr (or three components of red R, green G, and blue B), or only one of them. If it includes three components, the sizes of the components can be exactly the same or different, which is related to the image input format.

[0134] It is worth noting that process ③ is an optional step in the video coding and decoding method, and the video codec can encode / decode the residual coefficients (or residual values) of the independent coding units obtained in process ②.

[0135] Process ④: For the coding unit, it can be further divided into one or more non-overlapping prediction groups (Prediction Group, PG), PG can also be referred to as Group, each PG is encoded and decoded according to the selected prediction mode to obtain the prediction value of PG, which constitutes the prediction value of the entire coding unit, and the residual value of the coding unit is obtained based on the prediction value and the original value of the coding unit.

[0136] Process ⑤: Based on the residual values ​​of the coding units, the coding units are grouped to obtain one or more non-overlapping residual blocks (RBs). The residual coefficients of each RB are encoded and decoded according to the selected mode to form a residual coefficient stream. Specifically, it can be divided into two categories: transforming the residual coefficients and not transforming them.

[0137] Among them, the selected mode of the residual coefficient encoding and decoding method in process ⑤ may include, but is not limited to any of the following: semi-fixed length coding method, exponential Golomb coding method, Golomb-Rice coding method, truncated unary code coding method, run-length coding method, direct encoding of the original residual value, etc.

[0138] For example, a video encoder may directly encode coefficients within an RB.

[0139] For another example, the video encoder may also transform the residual block, such as DCT, DST, Hadamard transform, etc., and then encode the transformed coefficients.

[0140] As a possible example, when RB is small, the video encoder can directly perform uniform quantization on each coefficient in RB, and then perform binary encoding. If RB is large, it can be further divided into multiple coefficient groups (coefficient groups, CG), and then each CG is uniformly quantized and then binary encoded. In some embodiments of the present application, the coefficient group (CG) and the quantization group (QG) can be the same.

[0141] The following is an exemplary explanation of the residual coefficient encoding part in a semi-fixed length coding method. First, the maximum value of the absolute value of the residual in an RB block is defined as the modified maximum value (modified maximum, mm). Secondly, the number of coding bits for the residual coefficient in the RB block is determined (the number of coding bits for the residual coefficient in the same RB block is consistent). For example, if the critical limit (CL) of the current RB block is 2 and the current residual coefficient is 1, then 2 bits are required to encode the residual coefficient 1, which is expressed as 01. If the CL of the current RB block is 7, it means encoding an 8-bit residual coefficient and a 1-bit sign bit. The determination of CL is to find the minimum M value that satisfies that all residuals of the current sub-block are within the range of [-2^(M-1), 2^(M-1)]. If both -2^(M-1) and 2^(M-1) exist, M should be increased by 1, that is, M+1 bits are required to encode all residuals of the current RB block; if only one of the two boundary values ​​​​of -2^(M-1) and 2^(M-1) exists, a Trailing bit needs to be encoded to determine whether the boundary value is -2^(M-1) or 2^(M-1); if all residuals do not exist in either -2^(M-1) or 2^(M-1), there is no need to encode the Trailing bit.

[0142] In addition, for some special cases, the video encoder can also directly encode the original value of the image instead of the residual value.

[0143] It should be noted that the coding block (CB) in the embodiment of the present application corresponds to an image block in the image. The coding block can be a coding unit obtained by division through the above process ③, or it can be a prediction group after the coding unit is further divided.

[0144] Combined with the above Figure 1 The video decoding system shown, Figure 2 The video encoder shown and Figure 3 The framework diagram of the video decoder is shown, and the image decoding method and encoding method involved in the embodiments of the present application are described in detail below.

[0145] Figure 5 A schematic diagram of a flow chart of an image decoding method provided in the present application, the image decoding method can be applied to Figure 1 In the video decoding system shown in FIG. 1 , the image decoding method can be executed by the decoding end 20. Specifically, the image decoding method can be executed by the video decoder 200 included in the decoding end 20. Figure 5 As shown, the image decoding method provided in the embodiment of the present application includes the following steps.

[0146] S501: Determine a prediction residual value of a first pixel point according to a prediction method of the first pixel point.

[0147] The first pixel is the pixel currently processed by the video decoder, the first pixel is any pixel in the current coding block, and the current coding block is the decoding block currently processed by the video decoder. It should be understood that for each pixel in the current coding block, the scheme provided by the present application can be used for decoding or encoding. The embodiment of the present application only describes the encoding and decoding process of the first pixel as an example, and is not specifically limited.

[0148] It is understandable that decoding the video stream to be decoded can obtain one or more image frames contained in the video stream. An image frame includes one or more image blocks. In an embodiment of the present application, the current coding block corresponds to an image block of the image to be processed (the image to be processed is any one of the one or more image frames), and the coding block can be a coding unit (coding unit, CU).

[0149] In some embodiments, the predicted residual value is used to reflect the gradient of the first pixel. The gradient of a pixel is used to represent the difference between the pixel and its surrounding pixels, and can reflect the complexity of the pixel (such as texture characteristics, etc.). Exemplarily, if the gradient value of a pixel is larger, it means that the difference between the pixel and its surrounding pixels is larger (reflected in the image, indicating that the current coding block has more texture information), indicating that the complexity of the pixel is higher; if the gradient value of a pixel is smaller, it means that the difference between the pixel and its surrounding pixels is smaller (reflected in the image, indicating that the current coding block is smoother), indicating that the complexity of the pixel is lower.

[0150] In some embodiments, the predicted residual value of the first pixel is determined by the gradient of the reconstructed pixels around the first pixel; or, the predicted residual value of the first pixel is determined by the residual value of the reconstructed pixels around the first pixel after dequantization. It is understandable that since the first pixel has not been reconstructed, the gradient of the first pixel cannot be directly calculated based on the pixel value of the first pixel. Since the gradient information of adjacent pixels is relatively close, the gradient of the reconstructed pixels around the first pixel can be used; or, the residual value of the reconstructed pixels around the first pixel after dequantization (the residual value of the pixel after dequantization can reflect the gradient of the pixel) is used to predict the gradient of the first pixel, that is, to determine the predicted residual value of the first pixel.

[0151] Exemplarily, the predicted residual value of the first pixel point includes: a target value or an average value of the target values; wherein the target value is the gradient of the reconstructed pixels around the first pixel point; or, the target value is the absolute value of the gradient of the reconstructed pixels around the first pixel point; or, the target value is the residual value of the dequantized residual values ​​of the reconstructed pixels around the first pixel point; or, the target value is the absolute value of the residual values ​​of the dequantized residual values ​​of the reconstructed pixels around the first pixel point.

[0152] Optional, such as Figure 6 As shown, the above step S501 can be specifically implemented as the following steps S5011-S5012.

[0153] S5011. Obtain reference pixel information of the first pixel.

[0154] The reference pixel refers to the surrounding reconstructed pixel points that are referenced when performing point-by-point prediction on the first pixel.

[0155] As a possible implementation manner, the above step S5011 can be implemented as the following steps:

[0156] Step 1: Obtain information about reconstructed pixels around the first pixel.

[0157] Among them, the reconstructed pixel points around the first pixel point can be understood as the reconstructed pixel points adjacent to the first pixel point. In an embodiment of the present application, the reconstructed pixel points around the first pixel point include pixel points that meet the following conditions: pixel points in a square area with the first pixel point as the center and a side length of a first preset value; or, pixel points in a diamond area with the first pixel point as the center and a diagonal length of a second preset value; or, pixel points in an "L"-shaped area with the first pixel point as the vertex, a horizontal length of a third preset value, and a vertical length of a fourth preset value.

[0158] Optionally, the first preset value, the second preset value, the third preset value and the fourth preset value can be set according to actual needs, and the first preset value, the second preset value, the third preset value and the fourth preset value can be equal or different. For example, the first preset value, the second preset value, the third preset value and the fourth preset value can be one of 3 or 5.

[0159] For example, Figure 7 (a) in FIG. 1 shows an example of a square region division with the first pixel as the center. Two possible situations are given here: Situation 1: The reconstructed pixel point refers to the pixel point in the square region with the first pixel as the center and a side length of 3, such as Figure 7 The surrounding pixel point 1 shown in (a); in case 2, the reconstructed pixel point refers to the pixel point in a square area with a side length of 5 and the first pixel point as the center, such as Figure 7 The surrounding pixel point 2 shown in (a).

[0160] Figure 7 (b) in FIG. 1 shows an example of a diamond region division with the first pixel as the center. Two possible situations are given here: Situation 1: The reconstructed pixel point refers to the pixel point in the diamond region with the first pixel as the center and the diagonal length of 3, such as Figure 7 The surrounding pixel point 1 shown in (b); in case 2, the reconstructed pixel point refers to the pixel point in the diamond area with the first pixel point as the center and the diagonal length of 5, such as Figure 7 The surrounding pixel point 2 shown in (b).

[0161] Figure 7 (c) in FIG. 1 shows a semi-enclosed area division with a horizontal length of a third preset value and a vertical length of a fourth preset value as an example. Two possible situations are given here: Situation 1, the reconstructed pixel point refers to a pixel point in a semi-enclosed area with a horizontal length of 3 on the upper side of the first pixel point and a vertical length of 3 on the left side, such as Figure 7 The surrounding pixel point 1 shown in (c); Case 2, the reconstructed pixel point is a pixel point in a semi-enclosed area with a horizontal length of 5 and a vertical length of 2 on the upper side of the first pixel point, and a vertical length of 5 and a horizontal length of 2 on the left side, as shown in Figure 7 The surrounding pixel point 2 shown in (c).

[0162] It should be noted that Figure 7 This is only an example of the reconstructed pixel points around the current pixel point for illustrating the embodiment of the present application, and should not be understood as limiting the present application. In other possible examples, the reconstructed pixel points around the current pixel point may also refer to one or two pixel points adjacent to the current pixel point above and below, or adjacent to the current pixel point on the left and right.

[0163] Optionally, the information of the reconstructed pixel points around the first pixel point includes at least one of the following information: the pixel value of the reconstructed pixel point, the reconstructed residual value of the reconstructed pixel point (the reconstructed residual value includes: the residual value after inverse quantization, or the difference between the reconstructed value and the predicted value), the gradient value of the reconstructed pixel point (including: horizontal gradient, vertical gradient or average gradient), flatness information or texture information or complexity information, background brightness, contrast or degree of motion (the degree of motion can be represented by a motion vector).

[0164] Further, optionally, the value of the above-mentioned reconstructed pixel information includes at least one of the following: an original value, an absolute value, a mean value or a difference value.

[0165] Step 2: Determine the reference pixel information of the first pixel according to the prediction method of the first pixel and the information of the reconstructed pixels around the first pixel.

[0166] In some embodiments, the prediction method is used to indicate the position of the reconstructed pixel point that is referenced when predicting the pixel point.

[0167] Optionally, the prediction method includes: predicting based on the reconstructed pixels on the left and right sides of the pixel point; and / or, predicting based on the reconstructed pixels on the upper and lower sides of the pixel point; and / or, predicting based on the reconstructed pixels on the left side of the pixel point; and / or, predicting based on the reconstructed pixels on the upper side of the pixel point.

[0168] As an example, Figure 8 As shown, taking the current coding block of 16×2 (width w is 16, height h is 2) as an example, the prediction mode of the coding block is the point-by-point prediction mode, and the point-by-point prediction mode of the coding block includes two modes, namely mode 1 and mode 2. Figure 8 As shown in (a) in FIG. 1 , mode 1 is a vertical prediction mode, which is used to process vertical textures; Figure 8 As shown in (b), mode 2 is a horizontal prediction mode, which is used to process horizontal textures.

[0169] Among them, RL indicates that the predicted value of the current pixel is the average of the reconstructed values ​​of the pixels on the left and right sides of the pixel;

[0170] TB means that the predicted value of the current pixel is the average of the reconstructed values ​​of the pixels above and below the pixel;

[0171] L indicates that the predicted value of the current pixel is the reconstructed value of the pixel to the left of the pixel;

[0172] T indicates that the predicted value of the current pixel is the reconstructed value of the pixel above the pixel.

[0173] In some embodiments, for ease of description, the pixel points predicted based on the reconstructed pixel points on its left and right sides are called first-category pixel points, the pixel points predicted based on the reconstructed pixel points on its upper and lower sides are called second-category pixel points, the pixel points predicted based on the reconstructed pixel points on its left side are called third-category pixel points, and the pixel points predicted based on the reconstructed pixel points on its upper side are called fourth-category pixel points.

[0174] In some embodiments, first, based on the prediction method of the first pixel, a reference pixel of the first pixel is selected from the reconstructed pixels around the first pixel; and then, based on the information of the reconstructed pixels around the first pixel, the information of the reference pixel of the first pixel is determined.

[0175] Optionally, according to the prediction mode of the first pixel, a reference pixel of the first pixel is selected from reconstructed pixels around the first pixel, including the following cases:

[0176] Case 1: When the prediction method for the first pixel point is to predict based on the reconstructed pixels on the left and right sides of the pixel point, the reference pixels of the first pixel point are the reconstructed pixels on the left and right sides of the first pixel point.

[0177] Case 2: When the prediction method for the first pixel point is to predict based on the reconstructed pixels on the upper and lower sides of the pixel point, the reference pixels of the first pixel point are the reconstructed pixels on the upper side of the first pixel point and the reconstructed pixels on the lower side of the first pixel point.

[0178] Case 3: when the prediction method of the first pixel is to predict based on the reconstructed pixel on the left side of the pixel, the reference pixel of the first pixel is the reconstructed pixel on the left side of the first pixel.

[0179] Case 4: when the prediction method of the first pixel is to predict based on the reconstructed pixel above the pixel, the reference pixel of the first pixel is the reconstructed pixel above the first pixel.

[0180] Optionally, determining the reference pixel information of the first pixel according to the information of the reconstructed pixels around the first pixel includes the following two cases:

[0181] Case 1: if the reference pixel is a reconstructed pixel in the current coding block, the information of the reference pixel is used as the information of the reconstructed pixel around the first pixel.

[0182] Case 2: If the reference pixel is a reconstructed pixel outside the current coding block, the difference between the information of the reference pixel and the information of the reconstructed pixels around the reference pixel or the absolute value of the difference is used as the information of the reconstructed pixels around the first pixel.

[0183] It can be understood that the reference pixel point of the first pixel point is a reconstructed pixel point, and the reconstructed pixel point may be a reconstructed pixel point in the current coding block, or may not be a reconstructed pixel point in the current coding block, that is, a reconstructed pixel point outside the current coding block. For example, when the prediction mode is an intra-frame prediction mode, the reconstructed pixel point is the pixel point around the coding block in the current image frame. When the prediction mode is an inter-frame prediction mode, the reconstructed pixel point may be a reconstructed block on the reference frame of the current image frame.

[0184] As another possible implementation, the above step S5011 can be implemented as the following steps:

[0185] Step a1: determine a reference pixel of the first pixel according to a prediction method of the first pixel.

[0186] As an example, when the prediction method for the first pixel is to predict based on the reconstructed pixels on the left and right sides of the pixel, the reconstructed pixels on the left side of the first pixel and the reconstructed pixels on the right side of the first pixel are used as reference pixels for the first pixel; when the prediction method for the first pixel is to predict based on the reconstructed pixels on the upper and lower sides of the pixel, the reconstructed pixels on the upper side of the first pixel and the reconstructed pixels on the lower side of the first pixel are used as reference pixels for the first pixel; when the prediction method for the first pixel is to predict based on the reconstructed pixels on the left side of the pixel, the reconstructed pixels on the left side of the first pixel are used as reference pixels for the first pixel; when the prediction method for the first pixel is to predict based on the reconstructed pixels on the upper side of the pixel, the reconstructed pixels on the upper side of the first pixel are used as reference pixels for the first pixel.

[0187] Step a2: Obtain reference pixel information of the first pixel.

[0188] As an example, the information of the reference pixel point of the first pixel point includes one or more of the following: pixel value, flatness information or texture information or complexity information, background brightness, contrast or degree of motion (the degree of motion can be represented by a motion vector), etc.

[0189] Further, optionally, the value of the above-mentioned reference pixel information includes at least one of the following: an original value, an absolute value, a mean value or a difference value.

[0190] S5012: Determine a prediction residual value of the first pixel according to information of the reference pixel of the first pixel.

[0191] In some embodiments, when the prediction method of the first pixel is to predict based on the reconstructed pixels on the left and right sides of the pixel, the reference pixels of the first pixel are the reconstructed pixels on the left and right sides of the first pixel, and the prediction residual value of the first pixel is determined in the following two ways:

[0192] Method 1: Determine the prediction residual value of the first pixel point according to the difference between the reconstructed value and the predicted value of the reference pixel point of the first pixel point. Then the above step S5012 can be implemented as the following steps:

[0193] Step b1-1, calculating the difference between the pixel values ​​of the second pixel point and the third pixel point as the first difference value.

[0194] The second pixel is the first reconstructed pixel on the left side of the first pixel, and the third pixel is the first reconstructed pixel on the upper side of the second pixel.

[0195] Exemplarily, assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), the coordinates of the second pixel in the target channel are (pic_x-1, pic_y), and the coordinates of the third pixel in the target channel are (pic_x-1, pic_y-1), then the first difference may satisfy: I[pic_y][pic_x–1]–I[pic_y–1][pic_x–1]. Wherein, I[pic_y][pic_x–1] represents the pixel value of the pixel (pic_x–1, pic_y) in the target channel; I[pic_y–1][pic_x–1] represents the pixel value of the pixel (pic_x–1, pic_y-1) in the target channel.

[0196] It should be noted that, for a single pixel, I represents the pixel value of the pixel (for a reconstructed pixel, I represents the pixel value of the pixel after reconstruction); for the current coding block, I represents the pixel value matrix of the reconstructed pixels included in the current coding block.

[0197] In some embodiments, the target channel indicates the channel where the current coding block is located; the channel where the current coding block is located may be any one of the luminance channel and the chrominance channel. It is understandable that an image usually corresponds to one luminance channel and two chrominance channels, and the target image may be any one of the three channels.

[0198] In other embodiments, when the channel where the current coding block is located is a chroma channel, the target channel may also be represented as a luma channel. For example, assuming that the channel where the first pixel (the pixel in the current coding block) is located is a chroma channel, when obtaining the bit depth of the first pixel in the chroma channel, the bit depth of the first pixel in the luma channel may be obtained to replace the bit depth of the first pixel in the chroma channel.

[0199] Step b1-2: Calculate the difference between the pixel values ​​of the fourth pixel point and the fifth pixel point as the second difference value.

[0200] The fourth pixel is the first reconstructed pixel on the right side of the first pixel, and the fifth pixel is the first reconstructed pixel on the upper side of the fourth pixel.

[0201] Exemplarily, assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), the coordinates of the fourth pixel in the target channel are (pic_x+1, pic_y), and the coordinates of the fifth pixel in the target channel are (pic_x+1, pic_y-1), then the first difference may satisfy: I[pic_y][pic_x+1]–I[pic_y–1][pic_x+1]. Wherein, I represents the pixel value of the pixel (for a reconstructed pixel, I represents the pixel value of the pixel after reconstruction), I[pic_y][pic_x+1] represents the pixel value of the pixel (pic_x+1, pic_y) in the target channel; I[pic_y–1][pic_x+1] represents the pixel value of the pixel (pic_x+1, pic_y-1) in the target channel.

[0202] Step b1-3: taking the average of the absolute value of the first difference and the absolute value of the second difference as the prediction residual value of the first pixel.

[0203] It can be understood that the above-mentioned first difference represents the vertical gradient of the second pixel point, the above-mentioned second difference represents the vertical gradient of the fourth pixel point, and the second pixel point and the fourth pixel point are the reconstructed pixels closest to the left and right sides of the first pixel point respectively. Therefore, based on the average value of the gradient of the second pixel point and the gradient of the fourth pixel point, the predicted residual value of the first pixel point (i.e., the gradient of the first pixel point) can be determined.

[0204] For example, the position information of the first pixel point, the second pixel point, the third pixel point, the fourth pixel point and the fifth pixel point may be as follows: Fig. 9 As shown. Among them, the prediction residual value of the first pixel can satisfy the following formula (1):

[0205] PredResiTmp=(Abs(I[pic_y][pic_x-1]–I[pic_y-1][pic_x-1])+Abs(I[pic_y][pic_x+1]–I[pic_y-1][pic_x+1])+1)>>1 Formula (1)

[0206] Among them, PredResiTmp represents the predicted residual value of the pixel point; Abs represents the function of finding the absolute value; >> represents right shift in binary; >>1 represents right shift of 1 bit in binary and division by 2 in decimal.

[0207] Method 2: Determine the predicted residual value of the first pixel point according to the residual value of the reference pixel point after inverse quantization of the first pixel point. Then the above step S5012 can be implemented as the following steps:

[0208] Step b2-1, calculate the residual value of the second pixel after inverse quantization as the first difference value.

[0209] The second pixel is the first reconstructed pixel on the left side of the first pixel.

[0210] For example, assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), and the coordinates of the second pixel in the target channel are (pic_x-1, pic_y), the inverse quantized residual value of the second pixel can be expressed as PointCoeffData[pic_y][pic_x–1].

[0211] It should be noted that, for a single pixel, PointCoeffData represents the residual value of the pixel after inverse quantization; for the current coding block, PointCoeffData represents the residual value matrix of the reconstructed pixel points included in the current coding block after inverse quantization.

[0212] Step b2-2, calculate the residual value of the fourth pixel after inverse quantization as the second difference value.

[0213] The fourth pixel is the first reconstructed pixel on the right side of the first pixel.

[0214] For example, assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), and the coordinates of the fourth pixel in the target channel are (pic_x+1, pic_y), the inverse quantized residual value of the fourth pixel can be expressed as PointCoeffData[pic_y][pic_x+1].

[0215] Step b2-3: take the average of the absolute value of the first difference and the absolute value of the second difference as the prediction residual value of the first pixel.

[0216] It can be understood that the above-mentioned first difference represents the residual value of the second pixel after inverse quantization, which can reflect the gradient of the second pixel; the above-mentioned second difference represents the residual value of the fourth pixel after inverse quantization, which can reflect the gradient of the fourth pixel, and the second pixel and the fourth pixel are the reconstructed pixels closest to the left and right sides of the first pixel respectively. Therefore, according to the average of the absolute values ​​of the gradient of the second pixel and the gradient of the fourth pixel, the predicted residual value of the first pixel (that is, the absolute value of the gradient of the first pixel) can be determined.

[0217] For example, the position information of the first pixel, the second pixel, and the fourth pixel may be as follows: Fig. 9 As shown. Among them, the prediction residual value of the first pixel point can also satisfy the following formula (2):

[0218] PredResiTmp=(Abs(PointCoeffData[pic_y][pic_x-1])+Abs(PointCoeffData[pic_y][pic_x+1])+1)>>1 Formula (2)

[0219] In some embodiments, when the prediction method of the first pixel is to predict based on the reconstructed pixels on both sides of the pixel, the reference pixels of the first pixel are the reconstructed pixels on the upper side of the first pixel and the reconstructed pixels on the lower side of the first pixel, then the prediction residual value of the first pixel is determined in the following two ways:

[0220] Method 1: Determine the prediction residual value of the first pixel point according to the difference between the reconstructed value and the predicted value of the reference pixel point of the first pixel point. Then the above step S5012 can be implemented as the following steps:

[0221] Step c1-1, calculating the difference between the pixel values ​​of the sixth pixel point and the seventh pixel point as the third difference value.

[0222] The sixth pixel is the first reconstructed pixel above the first pixel, and the seventh pixel is the first reconstructed pixel on the left side of the sixth pixel.

[0223] Exemplarily, assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), the coordinates of the sixth pixel in the target channel are (pic_x, pic_y-1), and the coordinates of the seventh pixel in the target channel are (pic_x-1, pic_y-1), then the third difference may satisfy: I[pic_y-1][pic_x]–I[pic_y-1][pic_x-1]. Wherein, I[pic_y-1][pic_x] represents the pixel value of the pixel (pic_x, pic_y-1) in the target channel; I[pic_y-1][pic_x-1] represents the pixel value of the pixel (pic_x-1, pic_y-1) in the target channel.

[0224] Step c1-2: Calculate the difference between the pixel values ​​of the eighth pixel point and the ninth pixel point as the fourth difference value.

[0225] The eighth pixel is the first reconstructed pixel below the first pixel, and the ninth pixel is the first reconstructed pixel on the left side of the eighth pixel.

[0226] Exemplarily, assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), the coordinates of the eighth pixel in the target channel are (pic_x, pic_y+1), and the coordinates of the ninth pixel in the target channel are (pic_x-1, pic_y+1), then the fourth difference may satisfy: I[pic_y+1][pic_x]–I[pic_y+1][pic_x-1]. Wherein, I represents the pixel value of the pixel (for a reconstructed pixel, I represents the pixel value of the pixel after reconstruction), I[pic_y+1][pic_x] represents the pixel value of the pixel (pic_x, pic_y+1) in the target channel; I[pic_y+1][pic_x-1] represents the pixel value of the pixel (pic_x-1, pic_y+1) in the target channel.

[0227] Step c1-3: taking the average of the absolute value of the third difference and the absolute value of the fourth difference as the prediction residual value of the first pixel.

[0228] It can be understood that the above-mentioned third difference represents the horizontal gradient of the sixth pixel point, the above-mentioned fourth difference represents the horizontal gradient of the eighth pixel point, and the sixth pixel point and the eighth pixel point are the reconstructed pixels closest to the upper and lower sides of the first pixel point respectively. Therefore, based on the average value of the gradient of the sixth pixel point and the gradient of the eighth pixel point, the predicted residual value of the first pixel point (i.e., the gradient of the first pixel point) can be determined.

[0229] For example, the position information of the first pixel point, the sixth pixel point, the seventh pixel point, the eighth pixel point and the ninth pixel point may be as follows: Fig.10 As shown. Among them, the prediction residual value of the first pixel point can satisfy the following formula (3):

[0230] PredResiTmp=(Abs(I[pic_y-1][pic_x]–I[pic_y-1][pic_x-1])+Abs(I[pic_y+1][pic_x]–I[pic_y+1][pic_x-1])+1)>>1 Formula (3)

[0231] Method 2: Determine the predicted residual value of the first pixel based on the difference between the reconstructed value and the predicted value of the reference pixel of the first pixel and the residual value of the reference pixel of the first pixel after inverse quantization. Then the above step S5012 can be implemented as the following steps:

[0232] Step c2-1, calculating the difference between the pixel values ​​of the sixth pixel point and the seventh pixel point as the third difference value.

[0233] The sixth pixel is the first reconstructed pixel above the first pixel, and the seventh pixel is the first reconstructed pixel on the left side of the sixth pixel.

[0234] Step c2-2: Calculate the residual value of the eighth pixel after inverse quantization as the fourth difference value.

[0235] The eighth pixel is the first reconstructed pixel below the first pixel.

[0236] For example, assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), then the coordinates of the eighth pixel in the target channel are (pic_x, pic_y+1), then the inverse quantized residual value of the eighth pixel can be expressed as PointCoeffData[pic_y+1][pic_x].

[0237] Step c2-3: taking the average of the absolute value of the third difference and the absolute value of the fourth difference as the prediction residual value of the first pixel.

[0238] It is understandable that, since the sixth pixel is a pixel outside the current coding block, the residual value of the sixth pixel after inverse quantization cannot be calculated. Therefore, the gradient of the sixth pixel is represented by calculating the difference between the reconstructed value and the predicted value of the sixth pixel (that is, the third difference); the fourth difference represents the residual value of the eighth pixel after inverse quantization, which can reflect the gradient of the eighth pixel. Since the sixth pixel and the eighth pixel are the reconstructed pixels closest to the upper and lower sides of the first pixel, respectively, the predicted residual value of the first pixel (that is, the absolute value of the gradient of the first pixel) can be determined based on the average of the absolute values ​​of the gradient of the sixth pixel and the gradient of the eighth pixel.

[0239] For example, the position information of the first pixel point, the sixth pixel point and the eighth pixel point may be as follows: Fig.10 As shown. Among them, the prediction residual value of the first pixel point can satisfy the following formula (4):

[0240] PredResiTmp=(Abs(I[pic_y-1][pic_x]–I[pic_y-1][pic_x-1])+Abs(PointCoeffData[pic_y+1][pic_x])+1)>>1 Formula (4)

[0241] In some embodiments, when the prediction method of the first pixel is to predict based on the reconstructed pixel on the left side of the pixel, and the reference pixel of the first pixel is the reconstructed pixel on the left side of the first pixel, there are two ways to determine the prediction residual value of the first pixel:

[0242] Method 1: determining a prediction residual value of the first pixel point according to a difference between a reconstructed value of a reference pixel point of the first pixel point and a prediction value thereof.

[0243] When the prediction residual value of the first pixel is calculated using method 1, the above step S5012 may have the following two situations:

[0244] Case 1: when the horizontal position of the first pixel in the target channel is not 5, 9 or 13, the absolute value of the difference between the pixel values ​​of the tenth pixel and the eleventh pixel is used as the prediction residual value of the first pixel.

[0245] The tenth pixel is the first reconstructed pixel on the left side of the first pixel, and the eleventh pixel is the first reconstructed pixel on the left side of the tenth pixel.

[0246] It can be understood that the difference between the pixel values ​​of the tenth pixel and the eleventh pixel represents the horizontal gradient of the tenth pixel, and the tenth pixel is the nearest reconstructed pixel to the left of the first pixel. Therefore, based on the horizontal gradient of the tenth pixel, the predicted residual value of the first pixel (i.e., the gradient of the first pixel) can be determined.

[0247] For example, the position information of the first pixel point, the tenth pixel point, and the eleventh pixel point may be as follows: Fig.11 As shown in (a) in . Assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), the coordinates of the tenth pixel in the target channel are (pic_x-1, pic_y), and the coordinates of the eleventh pixel in the target channel are (pic_x-2, pic_y), then the prediction residual value of the first pixel can satisfy the following formula (5):

[0248] PredResiTmp=Abs(I[pic_y][pic_x-1]–I[pic_y][pic_x-2]) Formula (5)

[0249] Among them, I[pic_y][pic_x-1] represents the pixel value of the pixel point (pic_x-1, pic_y) in the target channel; I[pic_y][pic_x-2] represents the pixel value of the pixel point (pic_x-2, pic_y) in the target channel.

[0250] Case 2: when the horizontal position of the first pixel in the target channel is 5, 9 or 13, the absolute value of the difference between the pixel values ​​of the tenth pixel and the twelfth pixel is used as the prediction residual value of the first pixel.

[0251] The tenth pixel is the first reconstructed pixel on the left side of the first pixel, and the twelfth pixel is the first reconstructed pixel above the tenth pixel.

[0252] It can be understood that the difference between the pixel values ​​of the tenth pixel and the twelfth pixel represents the vertical gradient of the tenth pixel, and the tenth pixel is the nearest reconstructed pixel to the left of the first pixel. Therefore, based on the vertical gradient of the tenth pixel, the predicted residual value of the first pixel (i.e., the gradient of the first pixel) can be determined.

[0253] It should be noted that if Figure 8 As shown, when the point-by-point prediction mode of the current coding block is mode two, the prediction modes of the 5th pixel point, the 9th pixel point, and the 13th pixel point in the horizontal direction of the current coding block are all "T", that is, prediction is performed based on the reconstructed pixel point above the pixel point. Therefore, the 5th pixel point, the 9th pixel point, and the 13th pixel point in the horizontal direction of the current coding block cannot obtain the information of the horizontally adjacent pixel points of the pixel point, and the horizontal gradient cannot be calculated, and only the vertical gradient can be calculated.

[0254] Therefore, when the horizontal position of the first pixel in the target channel is 5, 9 or 13, the vertical gradient of the first reconstructed pixel (i.e., the tenth pixel) on the left side of the first pixel needs to be used as the predicted residual value of the first pixel.

[0255] For example, the position information of the first pixel point, the tenth pixel point, and the twelfth pixel point may be as follows: Fig.11 As shown in (b) in FIG. 1 , assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), the coordinates of the tenth pixel in the target channel are (pic_x-1, pic_y), and the coordinates of the twelfth pixel in the target channel are (pic_x-1, pic_y-1). The predicted residual value of the first pixel can satisfy the following formula (6):

[0256] PredResiTmp=Abs(I[pic_y][pic_x-1]–I[pic_y-1][pic_x-1]) Formula (6)

[0257] Among them, I represents the pixel value of the pixel (for the reconstructed pixel, I represents the pixel value of the pixel after reconstruction), I[pic_y][pic_x-1] represents the pixel value of the pixel (pic_x-1, pic_y) in the target channel; I[pic_y-1][pic_x-1] represents the pixel value of the pixel (pic_x-1, pic_y-1) in the target channel.

[0258] Method 2: determining a predicted residual value of the first pixel point according to a residual value of a reference pixel point of the first pixel point after inverse quantization.

[0259] Specifically, the above step S5012 can be implemented as: taking the absolute value of the residual value after dequantization of the tenth pixel as the prediction residual value of the first pixel, wherein the tenth pixel is the first reconstructed pixel on the left side of the first pixel.

[0260] It can be understood that the residual value after inverse quantization of the tenth pixel can reflect the gradient of the tenth pixel, and the tenth pixel is the reconstructed pixel closest to the left side of the first pixel. Therefore, based on the absolute value of the gradient of the tenth pixel, the predicted residual value of the first pixel (that is, the absolute value of the gradient of the first pixel) can be determined.

[0261] For example, the position information of the first pixel and the tenth pixel may be as follows: Fig.11 As shown in (b) in FIG. 1 , assuming that the coordinates of the first pixel in the target channel are (pic_x, pic_y), then the coordinates of the tenth pixel in the target channel are (pic_x-1, pic_y), and the prediction residual value of the first pixel can satisfy the following formula (7):

[0262] PredResiTmp=Abs(PointCoeffData[pic_y][pic_x–1]) Formula (7)

[0263] Among them, PointCoeffData[pic_y][pic_x–1] represents the residual value after inverse quantization of the pixel point (pic_x-1, pic_y).

[0264] In some embodiments, when the prediction method of the first pixel is to predict based on the reconstructed pixel above the pixel, the reference pixel of the first pixel is the reconstructed pixel above the first pixel, and the prediction residual value of the first pixel is determined in the following two ways:

[0265] Method 1: determining a prediction residual value of the first pixel point according to a difference between a reconstructed value of a reference pixel point of the first pixel point and a prediction value thereof.

[0266] Specifically, the above step S5012 can be implemented as: taking the absolute value of the difference between the pixel values ​​of the thirteenth pixel point and the fourteenth pixel point as the prediction residual value of the first pixel point.

[0267] The thirteenth pixel point is the first reconstructed pixel point above the first pixel point, and the fourteenth pixel point is the first reconstructed pixel point above the thirteenth pixel point.

[0268] It can be understood that the absolute value of the difference between the pixel values ​​of the thirteenth pixel and the fourteenth pixel represents the vertical gradient of the thirteenth pixel, and the thirteenth pixel is the reconstructed pixel closest to the upper side of the first pixel. Therefore, based on the vertical gradient of the thirteenth pixel, the predicted residual value of the first pixel (i.e., the gradient of the first pixel) can be determined.

[0269] For example, the position information of the first pixel point, the thirteenth pixel point, and the fourteenth pixel point may be as follows: Fig.12 Assume that the coordinates of the first pixel in the target channel are (pic_x, pic_y), then the coordinates of the thirteenth pixel in the target channel are (pic_x, pic_y-1), and the coordinates of the fourteenth pixel in the target channel are (pic_x, pic_y-2), then the prediction residual value of the first pixel can satisfy the following formula (8):

[0270] PredResiTmp=Abs(I[pic_y–1][pic_x]–I[pic_y–2][pic_x]) Formula (8)

[0271] Among them, I[pic_y-1][pic_x] represents the pixel value of the pixel point (pic_x, pic_y-1) in the target channel; I[pic_y-2][pic_x] represents the pixel value of the pixel point (pic_x, pic_y-2) in the target channel.

[0272] Method 2: determining a predicted residual value of the first pixel point according to a residual value of a reference pixel point of the first pixel point after inverse quantization.

[0273] Specifically, the above step S5012 can be implemented as: taking the absolute value of the residual value after dequantization of the thirteenth pixel as the prediction residual value of the first pixel, wherein the thirteenth pixel is the first reconstructed pixel above the first pixel.

[0274] It can be understood that the residual value after inverse quantization of the thirteenth pixel can reflect the gradient of the thirteenth pixel, and the thirteenth pixel is the reconstructed pixel closest to the upper side of the first pixel. Therefore, based on the absolute value of the gradient of the thirteenth pixel, the predicted residual value of the first pixel (that is, the absolute value of the gradient of the first pixel) can be determined.

[0275] For example, the position information of the first pixel and the thirteenth pixel may be as follows: Fig.12 Assume that the coordinates of the first pixel in the target channel are (pic_x, pic_y), then the coordinates of the thirteenth pixel in the target channel are (pic_x, pic_y-1), and the prediction residual value of the first pixel can satisfy the following formula (9):

[0276] PredResiTmp=Abs(PointCoeffData[pic_y–1][pic_x]) Formula (9)

[0277] Among them, PointCoeffData[pic_y–1][pic_x] represents the residual value after inverse quantization of the pixel point (pic_x, pic_y-1).

[0278] S502: Determine a target QP value of the first pixel according to the prediction residual value of the first pixel.

[0279] In some embodiments, in combination Figure 5 ,like Fig.13 As shown, before determining the target QP value of the first pixel point according to the prediction residual value of the first pixel point, the above method also includes the following steps S504-S505.

[0280] S504: Obtain the QP value of the current coding block.

[0281] In one implementation, the QP value of the current coding block can be parsed from the bitstream. In near-lossless compression technology, the probability of a small QP is higher than that of a large QP. Therefore, the video encoder can directly encode the QP value of a coding block using truncated unary code, truncated Rice code or exponential Golomb code, so that the video decoder can parse the bitstream to obtain the QP value of the coding block.

[0282] In another implementation, the QP value of the current coding block may be obtained by using the predicted QP value and the QP offset of the current coding block. Exemplarily, the QP value of the current coding block may be obtained by the following method 1 or method 2.

[0283] The process of method 1 includes S1-S3.

[0284] S1. Obtain the predicted QP value of the current coding block.

[0285] Optionally, the predicted QP value of the current coding block may be calculated according to the QP values ​​of surrounding blocks of the current coding block.

[0286] Exemplarily, the predicted QP value of the current coding block can be determined according to the QP value of the reconstructed block on the left side of the current coding block and the QP value of the reconstructed block on the upper side, such as: predQP = (QP A +QP B +)>>1, where predQP represents the predicted QP value of the current coding block, QP A Indicates the reconstructed block to the left of the current encoding, QP B Indicates the reconstructed block above the current coding block. >>1 indicates a right shift by one bit, i.e., division by 2.

[0287] S2. Parse the bitstream to obtain the QP offset of the current coding block.

[0288] It can be understood that during the video encoding process, the video encoder determines the predicted QP of the current coding block, determines the difference between the actual QP value of the current coding block and the predicted QP value, obtains the QP offset of the current coding block (which can be recorded as deltaQP), and then encodes the QP offset using a variable length code, and transmits the QP offset to the video decoder through the bitstream, so that after the video decoder obtains the bitstream, it can parse the bitstream to obtain the QP offset of the current coding block.

[0289] S3. The sum of the predicted QP value of the current coding block and the QP offset is used as the QP value of the current coding block.

[0290] That is, QP=predQP+deltaQP, where QP represents the QP value of the current encoding, predQP represents the predicted QP value of the current encoding block, and deltaQP represents the QP offset of the current encoding block.

[0291] The process of the second method includes S10-S30.

[0292] S10. Obtain a predicted QP value of a current coding block.

[0293] For the description of S10, please refer to the relevant description of S1, which will not be repeated here.

[0294] S20. Determine a QP offset value of the current coding block according to the derived information of the current coding block.

[0295] The derived information includes at least one of the following information: flatness information of the current coding block, remaining space of the code stream buffer, or distortion constraint information.

[0296] It should be understood that, during the video encoding process, the video encoder uses a code control algorithm to derive the QP offset of the current coding block according to the derivation information of the current coding block, but the video encoder does not transmit the QP offset in the bitstream. Thus, during the video decoding process, the video decoder uses the same method as the video encoder to derive the QP offset of the current coding block. The process of deriving the QP offset of the current coding block according to at least one of the flatness information of the current coding block, the remaining space of the bitstream buffer, or the distortion constraint information in the above S20 is a prior art. For specific details, reference may be made to the relevant content of the existing derivation of the QP offset, which will not be described in detail in the embodiments of the present application.

[0297] S30: Taking the sum of the predicted QP value and the QP offset of the current coding block as the QP value of the current coding block.

[0298] In the embodiment of the present application, the predicted QP value of the current coding block can also be obtained based on other more information, for example, the QP offset of the current coding block can be derived based on the QP of the previous coded block of the current coding block, the number of coded bits of the previous coded block (prevBlockRate), the target bit rate (targetRate), the flatness information of the current coding block, and the fullness (rcFullness) of the current code stream buffer.

[0299] S505 : Determine a predicted QP value of a first pixel according to the QP value of the current coding block.

[0300] The predicted QP value of the first pixel is the QP value of the current coding block.

[0301] In an embodiment of the present application, the obtained QP value of the current coding block is used as the initial QP value (i.e., the predicted QP value) of each pixel point of the current coding block, and on this basis, the predicted QP value is adjusted or not adjusted to obtain the QP value of each pixel point.

[0302] Based on the above S503-S504, if Fig.14 As shown, the above-mentioned determining the target QP value of the first pixel point according to the prediction residual value of the first pixel point (ie S502) specifically includes S5021-S5022.

[0303] S5021: If the first pixel is a target pixel in the current coding block, adjust the predicted QP value of the first pixel according to the prediction residual value to obtain a target QP value of the first pixel.

[0304] Among them, the target QP value is less than the predicted QP value.

[0305] The target pixel is a pixel whose QP value is preset. In the embodiment of the present application, the target pixel is one or more specified pixels in the current coding block, which can be understood as pixels or candidate pixels whose QP values ​​are to be adjusted. For the candidate pixels, the QP adjustment strategy is executed.

[0306] As an example, the current coding block includes at least a first part of pixel points and / or a second part of pixel points; wherein the first part of pixel points are set to pixel points whose QP values ​​do not need to be adjusted; the second part of pixel points are set to pixel points whose QP values ​​are to be adjusted; and the target pixel point is any one or more pixel points in the second part of pixel points.

[0307] The first part of pixel points and the second part of pixel points are determined according to the point-by-point prediction mode of the current coding block. Fig.15As shown, the point-by-point prediction modes of the current coding block include: mode 1 and mode 2; specifically, when the size of the current coding block is 16×2, the point-by-point prediction modes of the current coding block are respectively Fig.15 (a) and Fig.15 As shown in (b) in FIG. 1 ; when the size of the current coding block is 8×2, the point-by-point prediction modes of the current coding block are Fig.15 (c) and Fig.15 As shown in (d) in FIG; when the size of the current coding block is 8×1, the point-by-point prediction modes of the current coding block are Fig.15 (e) and Fig.15 As shown in (f); then when the point-by-point prediction modes of the current coding block are mode 1 and mode 2 respectively, the second part of the pixel points in the current coding block can be as shown in the following Table 1:

[0308] Table 1

[0309] Point-by-point prediction model The second part of the pixel Mode 1 T in non-first row, all RL Mode 2 T for non-first row, TB for non-first column, L for non-first column

[0310] from Fig.15 It can be seen that when the point-by-point prediction mode of the current coding block is mode one, the second part of pixel points includes at least one of the following: a first-category pixel point (RL), a fourth-category pixel point (T) that is not in the first row; the first-category pixel point is a pixel point predicted based on the reconstructed pixel points on the left and right sides of the pixel point; the fourth-category pixel point is a pixel point predicted based on the reconstructed pixel point on the upper side of the pixel point.

[0311] When the point-by-point prediction mode of the current coding block is mode two, the second part of pixel points includes at least one of the following: second-category pixel points (TB) not in the first column, third-category pixel points (L) not in the first column, and fourth-category pixel points (T) not in the first row; the second-category pixel points are pixel points predicted based on the reconstructed pixel points on the upper and lower sides of the pixel points; the third-category pixel points are pixel points predicted based on the reconstructed pixel points on the left side of the pixel points.

[0312] In this way, after determining that the first pixel is the target pixel in the current coding block, the predicted QP value of the first pixel can be adjusted according to the prediction residual value of the first pixel to obtain the target QP value of the first pixel.

[0313] In an embodiment of the present application, a QP adjustment parameter table may be set for the first pixel of the current coding block. For example, the following Table 2 shows some parameters required for adjusting the QP value.

[0314] Table 2

[0315]

[0316]

[0317] Among them, info can be the reconstructed residual value of the reconstructed pixels around the current pixel; for example, the reconstructed residual value of the reconstructed pixel includes: the residual value after inverse quantization of the reconstructed pixel; or the difference between the reconstructed value of the reconstructed pixel and the predicted value.

[0318] Specifically, the above step S5021 can be implemented as the following steps:

[0319] Step d1, determining a first threshold, a second threshold and a third threshold.

[0320] Among them, the first threshold is the QP value corresponding to the distortion that can be just perceived by the human eye (i.e., jndQp in Table 2), the second threshold is the adjustable QP maximum value (i.e., adjustMaxQp in Table 2), and the third threshold is the threshold of the reconstructed pixel information (i.e., resiThres in Table 2).

[0321] Optionally, the QP value (first threshold) corresponding to the distortion that can be just perceived by the human eye is determined according to the bit depth of the first pixel in the target channel or the channel index of the first pixel. When the target channel is a chroma channel, the QP value (first threshold) corresponding to the distortion that can be just perceived by the human eye can also be determined according to the bit depth of the first pixel in the brightness channel. Exemplarily, the QP value corresponding to the distortion that can be just perceived by the human eye is positively correlated with the bit depth of the first pixel in the target channel.

[0322] Optionally, the adjustable QP maximum value (second threshold) is determined according to one or more of the bit depth of the first pixel in the target channel, the channel index of the first pixel, and the fullness of the code stream buffer. When the target channel is a chroma channel, the adjustable QP maximum value (second threshold) can also be determined according to the bit depth of the first pixel in the brightness channel. Exemplarily, the adjustable QP maximum value is positively correlated with the bit depth of the first pixel in the brightness channel and negatively correlated with the fullness of the code stream buffer.

[0323] Optionally, the threshold value (third threshold value) of the reconstructed pixel information is determined according to one or more of the bit depth of the first pixel in the target channel, the channel index of the first pixel, and the texture complexity of the current block. When the target channel is a chroma channel, the threshold value (third threshold value) of the reconstructed pixel information can also be determined according to the bit depth of the first pixel in the brightness channel. Exemplarily, the threshold value of the reconstructed pixel information is positively correlated with the bit depth of the first pixel in the brightness channel.

[0324] As a possible implementation method, the bit depth of the first pixel in the target channel is first adjusted to determine the bit depth index of the first pixel in the target channel; then, according to the bit depth index of the first pixel in the target channel, the QP value corresponding to the distortion just perceptible to the human eye, the adjustable maximum QP value, and the threshold of the reconstructed pixel information are respectively determined.

[0325] Exemplarily, the bit depth index of the first pixel in the target channel satisfies the following formula (10):

[0326] bdIdx=Clip3(BitDepth[component]–8, 0, 8) Formula (10)

[0327] Among them, bdIdx represents the bit depth index of the first pixel in the target channel, BitDepth[component] represents the bit depth of the first pixel in the target channel, and Clip is the clipping function.

[0328] It can be understood that the index value of the bit depth of the first pixel point in the target channel is adjusted from 8 to 16 to 0 to 8 through the above formula (10), which is convenient for processing.

[0329] Taking the example that the QP value (first threshold) corresponding to the distortion that can be just perceived by the human eye is determined by the bit depth of the first pixel point in the target channel, the QP value (first threshold) corresponding to the distortion that can be just perceived by the human eye can satisfy the following formula (11):

[0330] jndQp=(bdIdx<<2)+16 Formula (11)

[0331] Among them, << means left shift in binary; <<2 means left shift 2 bits in binary and multiplication by 4 in decimal.

[0332] Taking the adjustable QP maximum value (second threshold) determined by the bit depth of the first pixel in the target channel as an example, the adjustable QP maximum value (second threshold) can satisfy the following formula (12):

[0333] adjustMaxQp=((bdIdx>>1)<<3)+32 Formula (12)

[0334] Among them, >> means right shift in binary; >>1 means right shift 1 bit in binary and division by 2 in decimal; <<3 means left shift 3 bits in binary and multiplication by 8 in decimal.

[0335] Taking the threshold value (third threshold value) of the reconstructed pixel information as determined by the bit depth of the first pixel point in the target channel as an example, the threshold value (third threshold value) of the reconstructed pixel information can satisfy the following formula (13):

[0336] resiThres=10<<(bdIdx>>1) Formula (13)

[0337] Furthermore, whether to adjust the predicted QP value of the first pixel point can be determined according to the first threshold, the second threshold and the third threshold, as shown in the following step d2.

[0338] Step d2: If the predicted QP value of the first pixel is greater than or equal to the first threshold and less than or equal to the second threshold, and the predicted residual value of the first pixel is less than or equal to the third threshold, adjust the predicted QP value of the first pixel to obtain the target QP value; otherwise, use the predicted QP value of the first pixel as the target QP value of the first pixel.

[0339] In some embodiments, if the predicted QP value of the first pixel point and the predicted residual value of the first pixel point meet the above conditions, the above adjustment of the predicted QP value of the first pixel point to obtain the target QP value of the first pixel point can be implemented as follows: the larger value of the QP value obtained by subtracting the preset offset from the predicted QP value and the QP value corresponding to the distortion just perceptible to the human eye is used as the target QP value.

[0340] The preset offset may be determined based on one or more of the bit depth of the first pixel in the target channel, the channel index of the first pixel, the fullness of the code stream buffer, and the texture complexity of the current coding block. When the target channel is a chroma channel, the preset offset may also be determined based on the bit depth of the first pixel in the luminance channel.

[0341] Exemplarily, the target QP value of the first pixel satisfies the following formula (14):

[0342] PixelQp=Max(QP[component]-offset,jndQp) Formula (14)

[0343] Among them, PixelQp represents the target QP value of the first pixel (i.e., finalQp in Table 2), QP[component] represents the QP value of the current coding block where the first pixel is located, QP[component] can be used as the predicted QP value of the first pixel (i.e., orgQp in Table 2), offset represents the preset offset (i.e., QP offset value), jndQp represents the QP value corresponding to the distortion that can be just perceived by the human eye, and Max represents the maximum value.

[0344] It can be understood that since the predicted residual value reflects the gradient of the first pixel, it can also reflect the complexity of the first pixel (such as texture characteristics, etc.). Therefore, when the predicted residual value of the first pixel is less than or equal to the threshold of the reconstructed pixel information, it means that the first pixel is a simple pixel; when the predicted QP value of the first pixel is greater than or equal to the QP value corresponding to the distortion that can be just perceived by the human eye (the QP value reflects the detailed information of the spatial compression of the pixel, and the larger the QP value, the stronger the distortion of the pixel), it means that the distortion of the first pixel is large; for simple pixels, the distortion can be reduced by reducing the QP value. Therefore, the embodiment of the present application determines the target QP value based on the QP value obtained by subtracting the preset offset from the predicted QP value.

[0345] At the same time, in order to avoid adjusting the predicted QP value too much, the embodiment of the present application uses the QP value obtained by subtracting the preset offset from the predicted QP value and the larger value of the QP value corresponding to the distortion just perceptible to the human eye as the target QP value. In this way, the predicted QP value is adjusted to reduce the distortion of the first pixel point, and the situation where the adjustment amplitude is too large can be avoided, thereby reducing the decoding distortion of the image frame and improving the quality of the decoded image.

[0346] S5022: If the first pixel is a pixel other than the target pixel in the current coding block, use the predicted QP value of the first pixel as the target QP value.

[0347] In the embodiment of the present application, pixel points other than the target pixel point in the current coding block are not adjusted, and there is no need to execute the QP adjustment strategy. For these pixel points, their QP value is the QP value of the current coding block.

[0348] It can be understood that in the prior art, the same QP value is used for all pixels in a coding block (such as the current coding block mentioned above), that is, in the process of dequantizing the current coding block, the QP value is the QP value of the coding block granularity, which will cause large image distortion; while in the embodiment of the present application, for a coding block (such as the current coding block mentioned above), the video decoder determines the QP value for any pixel of the coding block, that is, in the process of dequantizing the current coding block, the QP value is the QP value of the pixel granularity, which fully considers the differences between different pixels in the same coding block, and assigns a suitable QP value to each pixel, thereby reducing the decoding distortion of the image frame, that is, the dequantization effect of the current coding block can be improved (the dequantization effect can be measured by the quality of the decoded image).

[0349] S503 : Dequantize the first pixel according to the target QP value of the first pixel.

[0350] Dequantizing the first pixel point specifically involves dequantizing the horizontal value of the first pixel point, where the horizontal value of the first pixel point is obtained by a video decoder through parsing a bit stream.

[0351] It can be understood that during the encoding process, the video encoder predicts the current coding block to obtain the residual value of the current coding block (the residual value is the difference between the true value of the current coding block and the predicted value of the current coding block). The residual value can be called the residual coefficient of the current coding block, and then the residual coefficient of the current coding block is transformed and then quantized to obtain the quantization coefficient of the current coding block; or the video encoder does not transform the residual coefficient of the current coding block, but directly quantizes the residual coefficient to obtain the quantization coefficient of the current coding block. The quantization coefficient can be called a horizontal value or a quantized residual coefficient. In the embodiments of the present application, for the convenience of description, the quantized values ​​are collectively referred to as horizontal values.

[0352] In an embodiment of the present application, dequantizing the horizontal value of the first pixel point according to the target QP value of the first pixel point specifically includes: determining the quantization step Qstep of the first pixel point according to the target QP value of the first pixel point; and then, for the selected quantizer combination, using the Qstep of the first pixel point to dequantize the horizontal value of the first pixel point.

[0353] Optionally, the quantizer is a uniform quantizer or a non-uniform quantizer, and the quantizer combination is determined by flag information carried by the bitstream.

[0354] It should be understood that the video decoder can determine Qstep according to the QP value by at least one of formula derivation or table lookup. Three possible implementation methods are provided below:

[0355] Method 1: Qstep=a×QP+b, where a and b are preset parameters, for example, a is 2 and b is 1.

[0356] Method 2: Qstep = 2 T , where T is an integer related to QP, for example, T = (QP-6) / 4.

[0357] Method 3: Qstep = 2 (QP+offset) / octave , where octave is the level of QP, that is, the value of Qstep doubles for every octave increase in the value of QP. Octave is usually selected as 6 or 8, and offset is an integer offset value.

[0358] Optionally, the conventional scalar quantization method in H.265 described below may be used to implement quantization and inverse quantization.

[0359] Quantification:

[0360] Dequantization: c′=l*Qstep

[0361] Among them, l is the horizontal value obtained after quantization, c is the residual coefficient to be quantized (the residual coefficient can be the residual coefficient of the transform domain, that is, the transformed residual coefficient; or the residual coefficient can be the residual coefficient of the pixel domain, that is, the residual value), Qstep is the quantization step size, f is the parameter for controlling rounding, f∈[0,1), sign represents the sign function, floor represents the floor function; c' is the value after inverse quantization.

[0362] It can be understood that the larger the QP value and the larger the Qstep value, the coarser the quantization, the greater the image distortion caused by quantization, and the smaller the bit rate of coefficient encoding.

[0363] [0,1-f) represents the quantization dead zone. The parameter f is related to the length of the quantization dead zone. The smaller f is, the longer the quantization dead zone is, and the closer the horizontal value after quantization is to zero. When f=0.5, the above quantization and dequantization formulas are equivalent to rounding, and the quantization distortion is minimal. When f<0.5, the smaller f is, the greater the quantization distortion is, and the smaller the code rate of the coefficient encoding is. In H.265, for I frames, f=1 / 3 is selected, and for B / P frames, f=1 / 6 is selected.

[0364] Exemplarily, the quantization or inverse quantization formula of the uniform quantizer can refer to the above quantization and inverse quantization formulas, and the parameter f can be taken as follows:

[0365] Method 1: f is set to 0.5 or other fixed value.

[0366] Method 2: f can be adaptively determined according to the QP value, prediction mode, and whether to perform a transformation.

[0367] In summary, this is a description of the image decoding process. Through the image decoding method provided in the embodiments of the present application, the video decoder can determine the prediction residual value (reflecting the gradient of the first pixel) of each pixel point according to the prediction mode of each pixel point in the coding block (the prediction mode is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point), and then determine the QP of each pixel point granularity for the pixel point in the coding block, so as to dequantize each pixel point according to the target QP value of each pixel point, that is, dequantize each pixel point pixel by pixel point. In this way, the decoding distortion of the image frame can be reduced while ensuring a certain compression rate, and the authenticity and accuracy of the image decoding can be improved.

[0368] Correspondingly, in the image encoding method, the video encoder first obtains the QP, Qstep and residual coefficient of the pixel point; adaptively selects a quantizer to quantize the residual coefficient; and finally adjusts the quantization coefficient to obtain the final horizontal value, thereby realizing the encoding of the image frame.

[0369] exist Figure 2 Based on the video encoder 100 shown, the present application also provides an image encoding method, such as Fig.16 As shown, Fig.16 FIG. 1 is a flow chart of an image encoding method provided in the present application. The image encoding method may be executed by the video encoder 100 or by an encoding end (such as a video encoder 100) that supports the functions of the video encoder 100. Figure 1 The encoding end 10) shown in the figure is executed. Here, the video encoder 100 is used as an example to implement the image encoding method. The image encoding method includes the following steps.

[0370] S601: Determine a prediction residual value of a first pixel point according to a prediction method of the first pixel point.

[0371] The prediction residual value is used to reflect the gradient of the first pixel; the prediction method is used to indicate the position of the reconstructed pixel referenced when predicting the pixel; and the first pixel is any pixel in the current coding block.

[0372] It should be noted that the process of determining the prediction residual value of the first pixel point in S601 can refer to the specific implementation process of the aforementioned step S501, which will not be repeated here.

[0373] S602: Determine a target QP value of the first pixel according to the prediction residual value of the first pixel.

[0374] It should be noted that the process of determining the target QP value of the first pixel in S602 may refer to the specific implementation process of the aforementioned step S502, which will not be described in detail here.

[0375] S603 , quantize the first pixel according to the target QP value of the first pixel.

[0376] It should be noted that Fig.16 The quantification of the indication is Figure 5 The inverse process of inverse quantization is shown in FIG. 1 . For the quantization of the target QP value in the image coding method, please refer to the above Figure 5 to Figure 15 The corresponding process in the image decoding method will not be described here.

[0377] In summary, through the image encoding method provided in the embodiments of the present application, the video encoder can determine the prediction residual value (reflecting the gradient of the first pixel) of each pixel point according to the prediction mode of each pixel point in the coding block (the prediction mode is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point), and then determine the QP of each pixel point granularity for the pixel point in the coding block, so as to quantize each pixel point according to the QP value of each pixel point, that is, quantize pixel by pixel. In this way, the decoding distortion of the image frame can be reduced while ensuring a certain compression rate, and the authenticity and accuracy of the image decoding can be improved.

[0378] It is understandable that, in order to implement the functions in the above embodiments, the video encoder / video decoder includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.

[0379] Fig.17 The structure diagram of an image decoding device provided in an embodiment of the present application is shown in FIG. 700. The image decoding device 700 includes a determination unit 701 and an inverse quantization unit 702. The image decoding device 700 can be used to implement the functions of the video decoder or the decoding end in the above-mentioned image decoding method embodiment, and thus can also achieve the beneficial effects of the above-mentioned image decoding method embodiment. In the embodiment of the present application, the image decoding device 700 can be as follows: Figure 1 The decoding end 20 or video decoder 200 shown may also be as shown in Figure 3 The video decoder 200 shown may also be a module (such as a chip) applied to the decoding end 20 or the video decoder 200 .

[0380] The determination unit 701 and the inverse quantization unit 702 are used to implement Figure 5 to Figure 15 The image decoding method provided by any embodiment of the present invention. For a detailed description of the above-mentioned determination unit 701 and the inverse quantization unit 702, please directly refer to Figure 5 to Figure 15 The relevant description in the method embodiment shown is directly obtained and will not be repeated here.

[0381] Fig.18The present application provides a schematic diagram of the structure of an image encoding device, the image encoding device 800 includes: a determination unit 801 and a quantization unit 802. The image encoding device 800 can be used to implement the functions of the video encoder or the encoding end in the above-mentioned image encoding method embodiment, and thus can also achieve the beneficial effects of the above-mentioned image encoding method embodiment. In the embodiment of the present application, the image encoding device 800 can be as follows Figure 1 The encoding end 10 or video encoder 100 shown may also be as shown in Figure 2 The video encoder 100 shown may also be a module (such as a chip) applied to the encoding end 10 or the video encoder 100 .

[0382] The determination unit 801 and the quantization unit 802 are used to implement Fig.16 For a more detailed description of the above-mentioned determination unit 801 and quantization unit 802, please refer directly to Figures 5 to 16 The relevant description in the method embodiment shown is directly obtained and will not be repeated here.

[0383] The present application also provides an electronic device, such as Fig.19 As shown, the present application provides a structural schematic diagram of an electronic device, the electronic device 900 includes a processor 901 and a communication interface 902. The processor 901 and the communication interface 902 are coupled to each other. It can be understood that the communication interface 902 can be a transceiver or an input-output interface. Optionally, the electronic device 900 may also include a memory 903 for storing instructions executed by the processor 901 or storing input data required by the processor 901 to run the instructions, or storing data generated after the processor 901 runs the instructions.

[0384] When the electronic device 900 is used to implement Figure 5 to Figure 15 In the method shown, the processor 901 and the communication interface 902 are used to execute the functions of the above-mentioned determination unit 701 and the inverse quantization unit 702.

[0385] When the electronic device 900 is used to implement Fig.16 In the method shown, the processor 901 and the communication interface 902 are used to execute the functions of the above-mentioned determination unit 801 and the quantization unit 802.

[0386] The specific connection medium between the communication interface 902, the processor 901 and the memory 903 is not limited in the embodiment of the present application. Fig.19 In the embodiment, the communication interface 902, the processor 901 and the memory 903 are connected via a bus 904. Fig.19 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.19 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0387] The memory 903 may be used to store software programs and modules, such as program instructions / modules corresponding to the image decoding method or image encoding method provided in the embodiment of the present application. The processor 901 executes the software programs and modules stored in the memory 903 to perform various functional applications and data processing. The communication interface 902 may be used to communicate signaling or data with other devices. In the present application, the electronic device 900 may have multiple communication interfaces 902.

[0388] It is understandable that the processor in the embodiments of the present application may be a central processing unit (CPU), a neural processing unit (NPU) or a graphic processing unit (GPU), or may be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.

[0389] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a network device or a terminal device. Of course, the processor and the storage medium can also be present in a network device or a terminal device as discrete components.

[0390] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, 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 instruction is loaded and executed on a computer, the process or function in accordance with 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 device. The computer instruction 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 instruction 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)) mode 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, data center, etc. that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a magnetic disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state drive (SSD)).

[0391] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0392] 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 modules or units 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0393] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0394] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0395] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, or all or part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk, and other media that can store program codes.

[0396] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application 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. An image decoding method, characterized in that: The method is performed by a decoding end; the method comprises: Determine a prediction residual value of the pixel point according to a prediction method of the pixel point; the prediction residual value is used to reflect the gradient of the pixel point; the prediction method is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point; the pixel point is any pixel point in the current coding block; Determine a target quantization parameter QP value of the first pixel point according to a prediction residual value of the first pixel point; wherein the first pixel point is a target pixel point in the current coding block, and the target pixel point is a pixel point of a preset adjusted QP value; Dequantize the first pixel according to the target QP value of the first pixel.

2. The method according to claim 1, characterized in that The prediction methods include: Make predictions based on the reconstructed pixels on the left and right sides of the pixel; and / or, making predictions based on reconstructed pixels above and below the pixel; and / or, making a prediction based on a reconstructed pixel to the left of the pixel; And / or, prediction is performed based on a reconstructed pixel above the pixel.

3. The method according to claim 2, characterized in that The pixel point prediction method is to predict based on the reconstructed pixel points on the left and right sides of the pixel point; The step of determining the prediction residual value of the pixel point according to the prediction mode of the pixel point comprises: Calculate the difference between the pixel values ​​of the second pixel and the third pixel as the first difference; or use the residual value after dequantization of the second pixel as the first difference; the second pixel is the first reconstructed pixel on the left side of the pixel, and the third pixel is the first reconstructed pixel above the second pixel; Calculate the difference between the pixel values ​​of the fourth pixel and the fifth pixel as the second difference; or use the residual value after inverse quantization of the fourth pixel as the second difference; the fourth pixel is the first reconstructed pixel on the right side of the pixel, and the fifth pixel is the first reconstructed pixel above the fourth pixel; An average value of the absolute value of the first difference and the absolute value of the second difference is used as the prediction residual value of the pixel point.

4. The method according to claim 2, characterized in that: The pixel point is predicted based on the reconstructed pixel point on the left side of the pixel point; The step of determining the prediction residual value of the pixel point according to the prediction mode of the pixel point comprises: The absolute value of the difference between the pixel values ​​of the tenth pixel and the eleventh pixel is used as the prediction residual value of the pixel; the tenth pixel is the first reconstructed pixel on the left side of the pixel, and the eleventh pixel is the first reconstructed pixel on the left side of the tenth pixel; Alternatively, the absolute value of the difference between the pixel values ​​of the tenth pixel point and the twelfth pixel point is used as the prediction residual value of the pixel point; the twelfth pixel point is the first reconstructed pixel point on the upper side of the tenth pixel point; Alternatively, the absolute value of the residual value after dequantization of the tenth pixel point is used as the predicted residual value of the pixel point.

5. The method according to claim 2, characterized in that: The prediction method of the pixel point is to predict according to the reconstructed pixel point on the upper side of the pixel point; and determining the prediction residual value of the pixel point according to the prediction method of the pixel point includes: The absolute value of the difference between the pixel values ​​of the thirteenth pixel and the fourteenth pixel is used as the prediction residual value of the pixel; the thirteenth pixel is the first reconstructed pixel above the pixel, and the fourteenth pixel is the first reconstructed pixel above the thirteenth pixel; Alternatively, the absolute value of the residual value after dequantization of the thirteenth pixel point is used as the predicted residual value of the pixel point.

6. An image encoding method, characterized in that: The method is performed by an encoding end, and the method includes: Determine a prediction residual value of the pixel point according to a prediction method of the pixel point; the prediction residual value is used to reflect the gradient of the pixel point; the prediction method is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point; the pixel point is any pixel point in the current coding block; Determine a target quantization parameter QP value of the first pixel point according to a prediction residual value of the first pixel point; wherein the first pixel point is a target pixel point in the current coding block, and the target pixel point is a pixel point of a preset adjusted QP value; The first pixel is quantized according to a target QP value of the first pixel.

7. An image decoding device, characterized in that: The decoding device comprises: a determination unit and a dequantization unit; The determining unit is used to determine the prediction residual value of the pixel point according to the prediction mode of the pixel point; the prediction residual value is used to reflect the gradient of the pixel point; the prediction mode is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point; the pixel point is any pixel point in the current coding block; The determining unit is further configured to determine a target quantization parameter QP value of the first pixel point according to a prediction residual value of the first pixel point; wherein the first pixel point is a target pixel point in the current coding block, and the target pixel point is a pixel point of a preset adjusted QP value; The dequantization unit is used to dequantize the first pixel according to the target QP value of the first pixel.

8. An image encoding device, characterized in that The image encoding device comprises: a determination unit and a quantization unit; The determining unit is used to determine the prediction residual value of the pixel point according to the prediction mode of the pixel point; the prediction residual value is used to reflect the gradient of the pixel point; the prediction mode is used to indicate the position of the reconstructed pixel point referenced when predicting the pixel point; the pixel point is any pixel point in the current coding block; The determining unit is further configured to determine a target quantization parameter QP value of the first pixel point according to a prediction residual value of the first pixel point; wherein the first pixel point is a target pixel point in the current coding block, and the target pixel point is a pixel point of a preset adjusted QP value; The quantization unit is used to quantize the first pixel according to the target QP value of the first pixel.

9. A video decoding system, characterized in that: It comprises an encoding end and a decoding end, the encoding end is communicatively connected with the decoding end, the decoding end is used to implement the method according to any one of claims 1 to 5, and the encoding end is used to implement the method according to claim 6.

10. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory to implement the method according to any one of claims 1 to 6.

11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program or instruction. When the computer program or instruction is executed by an electronic device, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • An image compression method and device

    CN101087415A

  • Prediction method, coding method, decoding method and device thereof of pixels in frame

    CN105282558A

  • QP adaptive in-loop filtering method and system, electronic equipment and storage medium

    CN114513662A

  • Method of Redundant Picture Coding Using Polyphase Downsampling and the Codes Using the Method

    US20080199094A1