Image decoding method, encoding method and device
By determining personalized quantization parameters for each pixel and inverse quantization pixel by pixel, the problem of decoding distortion caused by the same QP of all pixels in the image coding block is solved, and the authenticity and accuracy of image decoding are improved.
Patent Information
- Application Number
- CN202210062756.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-19
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-01-19
AI Technical Summary
In existing video coding and decoding technology, all pixels in the image coding block use the same quantization parameter (QP), resulting in large decoding distortion and affecting the authenticity and accuracy of image decoding.
At the decoding end, a personalized quantization parameter (QP) is determined for each pixel, and the predicted QP value is adjusted through pixel-by-pixel inverse quantization and adjusted based on the reconstructed information around the pixel to reduce decoding distortion.
While ensuring the compression rate, the decoding distortion of image frames is reduced and the authenticity and accuracy of image decoding are improved.
Smart Images

Figure CN116074530B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of video coding and decoding, and in particular to an image decoding method, encoding method and device. Background Art
[0002] 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.
[0003] 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.
[0004] 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
[0005] The embodiments of the present application provide 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.
[0006] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0007] 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 quantization parameter QP value of any pixel point or any multiple parallel dequantized pixel points in a current coding block; wherein there are at least two pixel points in the current coding block with different QP values; and dequantizing the pixel point according to the QP value of the pixel point.
[0008] Through the decoding method provided in the embodiments of the present application, the video decoder can determine the QP of each pixel granularity for the pixel points in the coding block, and then dequantize each pixel point according to the QP value of each pixel point, that is, dequantize each pixel point 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.
[0009] In a possible implementation, the image decoding method provided by the embodiment of the present application also includes: obtaining the QP value of the current coding block; and determining the predicted QP value of the pixel point, the predicted QP value of the pixel point being the QP value of the current coding block.
[0010] In a possible implementation, determining the QP value of the pixel point includes: when the pixel point is any target pixel point or any multiple parallel dequantized target pixel points in the current coding block, adjusting the predicted QP value of the pixel point, and using the adjusted QP value as the QP value of the pixel point; when the pixel point is a pixel point other than the target pixel point in the current coding block, determining the predicted QP value of the pixel point as the QP value of the pixel point.
[0011] In a possible implementation, adjusting the predicted QP value of the pixel point includes: acquiring information of reconstructed pixels around the pixel point; and adjusting the predicted QP value of the pixel point according to the information of reconstructed pixels around the pixel point.
[0012] In a possible implementation, adjusting the predicted QP value of the pixel includes: if the pixel satisfies a first preset condition, using the preset QP value as the QP value of the pixel; otherwise, using the predicted QP value of the pixel as the QP value of the pixel.
[0013] The first preset condition includes at least one of the following conditions:
[0014] The pixel point is a brightness pixel point;
[0015] The pixel point is a chromaticity pixel point;
[0016] The bit depth of the pixel is less than or equal to a bit depth threshold;
[0017] The predicted QP value of the pixel is less than or equal to an adjustable QP maximum value, and the adjustable QP maximum value is less than or equal to a QP maximum value;
[0018] The information of the reconstructed pixels around the pixel is less than or equal to a first preset threshold.
[0019] In a possible implementation manner, the dequantizing the pixel point according to the QP value of the pixel point includes: dequantizing the pixel point according to the adjusted QP value.
[0020] In a possible implementation manner, the target pixel point is any one or more pixel points in the current coding block.
[0021] In a possible implementation manner, the current coding block includes at least a first part of pixel points and / or a second part of pixel points, and the target pixel point is any one or more pixel points in the second part of pixel points.
[0022] In a possible implementation manner, the target pixel point is any one or more pixel points in the first position pixel points in the second part of pixel points.
[0023] In a possible implementation manner, the target pixel point is any one or more pixel points in the second position pixel points in the second part of pixel points.
[0024] In a possible implementation, the prediction mode of the current coding block is a point-by-point prediction mode, the current coding block includes at least a first part of pixels and / or a second part of pixels, the second part of pixels includes first position pixels and / or second position pixels, the first position pixels and the second position pixels are determined according to the point-by-point prediction mode of the current coding block.
[0025] In a possible implementation, adjusting the predicted QP value of the pixel point according to the information of the reconstructed pixels around the pixel point includes: if the pixel point satisfies the second preset condition and the third preset condition, adjusting the predicted QP value of the pixel point according to the first QP offset and the QP value corresponding to the distortion just perceptible to the human eye; wherein the second preset condition is that the predicted QP value of the pixel point is greater than the QP value corresponding to the distortion just perceptible to the human eye, and the predicted QP value of the pixel point is less than or equal to the adjustable QP maximum value, and the third preset condition is that the information of the reconstructed pixels around the pixel point is less than or equal to a first threshold; if the pixel point satisfies the second preset condition and the fourth preset condition, adjusting the predicted QP value of the pixel point according to the second QP offset and the QP maximum value; wherein the fourth preset condition is that the information of the reconstructed pixels around the pixel point is greater than the second threshold, and the first threshold is less than or equal to the second threshold; otherwise, taking the predicted QP value of the pixel point as the QP value of the pixel point.
[0026] In a possible implementation, when the pixel point satisfies the second preset condition and the third preset condition, the adjusted QP value satisfies: finalQP=max(initQP-offset1, jndQP), wherein finalQP represents the adjusted QP value, initQP represents the predicted QP value of the pixel point, offset1 represents the first QP offset, jndQP represents the QP value corresponding to the distortion that can be just perceived by the human eye, and max represents the maximum value.
[0027] In a possible implementation, when the pixel point satisfies the second preset condition and the fourth preset condition, the adjusted QP value satisfies: finalQP=min(initQP+offset2, maxQP), wherein finalQP represents the adjusted QP value, initQP represents the predicted QP value of the pixel point, offset2 represents the second QP offset, maxQP represents the maximum QP value, and min represents the minimum value.
[0028] In a possible implementation, the reconstructed pixel points around the pixel point include pixel points that meet the following conditions:
[0029] Pixel points in a square area with the pixel point as the center and a side length of a first preset value; or,
[0030] A pixel point in a rhombus area with the pixel point as the center and a diagonal length of a second preset value.
[0031] In a possible implementation, the information of the reconstructed pixel includes at least one of the following information: a pixel value, flatness information or texture information or complexity information, background brightness, contrast or motion degree of the reconstructed pixel.
[0032] In a possible implementation manner, the value of the information of the reconstructed pixel point includes at least one of the following: an original value, an absolute value, a mean value, or a difference value.
[0033] In a possible implementation, obtaining the information of the reconstructed pixels around the pixel includes: obtaining the information of the predicted pixel of the pixel; if the predicted pixel is a reconstructed pixel in the current coding block, using the information of the predicted pixel as the information of the reconstructed pixels around the pixel; otherwise, using the difference between the information of the predicted pixel and the information of the reconstructed pixels around the predicted pixel or the absolute value of the difference as the information of the reconstructed pixels around the pixel.
[0034] In one possible implementation, the prediction mode of the current coding block is a block prediction mode, and the image decoding method provided in an embodiment of the present application also includes: obtaining region division information of the current coding block, the region division information including the number of regions N and the position information of the region boundary, N being an integer greater than or equal to 2; and dividing the current coding block into N regions according to the region division information.
[0035] In a possible implementation, the QP value of a pixel point in at least one area among the N areas is determined based on information of reconstructed pixel points in at least one other area, and the other area is an area among the N areas except the at least one area.
[0036] In a possible implementation, the number of regions N is 2, the current coding block includes a first region and a second region, the pixels in the first region include at least one of the following pixel points: pixel points in a horizontal strip at any position of the current coding block, pixel points in a vertical strip at any position, or pixel points in a diagonal strip at any position, wherein the width of the strip does not exceed 2, and when the strip is located at the boundary of the current coding block, the width of the strip is equal to 1, and the pixel points in the second region are the pixel points in the current coding block except the first region.
[0037] In this way, determining the QP value of the pixel point includes: when the pixel point is any pixel point in the first area, adjusting the predicted QP value of the pixel point, and using the adjusted QP value as the QP value of the pixel point; when the pixel point is any pixel point in the second area, using the predicted QP value of the pixel point as the QP value of the pixel point.
[0038] In a possible implementation of the above situation, adjusting the predicted QP value of the pixel point includes: acquiring information of reconstructed pixels around the pixel point; and adjusting the predicted QP value of the pixel point according to the information of reconstructed pixels around the pixel point.
[0039] In a possible implementation manner, the acquiring the region division information of the current coding block includes: acquiring predefined region division information of the current coding block; or parsing a bitstream to acquire the region division information of the current coding block.
[0040] In one possible implementation, when the current coding block is transformed, the region division information of the current coding block is obtained, including: determining the region division information of the current coding block based on the pixel points of the upper adjacent row and / or the pixel points of the left adjacent column of the current coding block; the region division method of the current coding block includes at least one of the following: horizontal division, vertical division or diagonal division.
[0041] Thus, in a possible implementation method, for any pixel point in any one of the N areas or any multiple parallel dequantized pixel points, the QP value of the pixel point is determined, including: obtaining the QP offset of the pixel point; and adjusting the predicted QP value of the pixel point according to the QP offset, and using the adjusted QP value as the QP value of the pixel point.
[0042] In a possible implementation, obtaining the QP offset of the pixel point includes: parsing the bitstream to obtain the offset of the pixel point; or determining the QP offset of the pixel point based on derivation information, wherein the derivation information includes index information of the area where the pixel point is located and / or the distance from the pixel point to the area boundary line of the area where the pixel point is located; wherein the distance includes any one of the following: horizontal distance, vertical distance or Euclidean distance.
[0043] In a possible implementation, the QP offset of the pixel point is any one of the following: the third QP offset, the fourth QP offset, and the sum of the third QP offset and the fourth QP offset; the third QP offset is derived according to the index information of the area where the pixel point is located, the third QP offsets of the pixels in the same area are the same, and the third QP offsets of the pixels in different areas are different; the fourth QP offset is derived according to the distance from the pixel point to the area boundary of the area where the pixel point is located.
[0044] In a possible implementation, the dequantizing of the pixel point according to the QP value of the pixel point includes: determining the quantization step Qstep of the pixel point according to the QP value of the pixel point; for a selected quantizer combination, dequantizing the horizontal value of the pixel point using the Qstep of the pixel point; the quantizer combination includes one or more quantizers, the quantizer is a uniform quantizer or a non-uniform quantizer, and the horizontal value of the pixel point is obtained by parsing the bitstream.
[0045] In a 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 quantization parameter QP value of any pixel point or any multiple parallel quantized pixel points in any current encoding block; wherein there are at least two pixel points in the pixel points of the current encoding block with different QP values; and quantizing the pixel point according to the QP value of the pixel point.
[0046] Through the encoding method provided in the embodiments of the present application, the video encoder can determine the QP of each pixel granularity for the pixel points in the encoding block, and thus 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.
[0047] It can be understood that various possible implementations of the image encoding method may refer to the description of various possible implementations of the image decoding method.
[0048] In a third aspect, an embodiment of the present application provides an image decoding device, which is applied to a decoding end, and includes various modules for implementing the method described in the first aspect and one of its possible implementation methods, such as a quantization parameter QP determination unit and an inverse quantization unit.
[0049] 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 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.
[0050] In a fourth aspect, an embodiment of the present application provides an image encoding device, which is applied to an encoding end, and includes various modules for implementing the method described in the second aspect and one of its possible implementation methods, such as a quantization parameter QP determination unit and a quantization unit.
[0051] 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, which will not be repeated here. The 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.
[0052] 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 the computer instructions from the memory to implement the method described in any one of the first aspect to the second aspect and their possible implementation methods.
[0053] For example, the electronic device may be a video encoder, or an encoding end including a video encoder.
[0054] For another example, the electronic device may refer to a video decoder, or a decoding end including a video decoder.
[0055] 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 described in any one of the first aspect to the second aspect and their possible implementation methods is implemented.
[0056] 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 described in any one of the first aspect to the second aspect and their possible implementation methods.
[0057] In an eighth aspect, an embodiment of the present application provides a chip, comprising a memory and a processor, the memory being used to store computer instructions, and the processor being used to call and execute the computer instructions from the memory to implement the method described in any one of the first aspect to the second aspect and their possible implementation methods.
[0058] 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 described in the first aspect and any one of its possible implementations, and the encoding end is used to implement the method described in the second aspect and any one of its possible implementations.
[0059] 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
[0060] Figure 1 An exemplary block diagram of a video decoding system provided in an embodiment of the present application;
[0061] Figure 2 An exemplary block diagram of a video encoder provided in an embodiment of the present application;
[0062] Figure 3 An exemplary block diagram of a video decoder provided in an embodiment of the present application;
[0063] Figure 4 A schematic diagram of a video encoding / decoding process provided in an embodiment of the present application;
[0064] Figure 5 One of the flowcharts of an image decoding method provided in an embodiment of the present application;
[0065] Figure 6 A second flowchart of an image decoding method provided in an embodiment of the present application;
[0066] Figure 7 A third flowchart of an image decoding method provided in an embodiment of the present application;
[0067] Figure 8 A schematic diagram of pixel distribution provided in an embodiment of the present application;
[0068] Fig. 9 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;
[0069] Fig.10 A second schematic diagram of pixel division in a point-by-point prediction mode provided in an embodiment of the present application;
[0070] Fig.11 A third schematic diagram of pixel division in a point-by-point prediction mode provided in an embodiment of the present application;
[0071] Fig.12 A fourth flowchart of an image decoding method provided in an embodiment of the present application;
[0072] Fig.13 One of the schematic diagrams of region division of a coding block provided in an embodiment of the present application;
[0073] Fig.14 A second schematic diagram of region division of a coding block provided in an embodiment of the present application;
[0074] Fig.15 A third schematic diagram of region division of a coding block provided in an embodiment of the present application;
[0075] Fig.16 A schematic diagram of a flow chart of an image encoding method provided in an embodiment of the present application;
[0076] Fig.17 A schematic diagram of the division of residual groups provided in an embodiment of the present application;
[0077] Fig.18 A schematic diagram of TB / PB division provided in an embodiment of the present application;
[0078] Fig.19 A schematic diagram of the structure of a decoding device provided by the present application;
[0079] Fig. 20 A schematic diagram of the structure of an encoding device provided in this application;
[0080] Fig.21 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0081] 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.
[0082] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first preset value and a second preset value are used to distinguish different preset values rather than to describe a specific order of the preset values.
[0083] 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.
[0084] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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).
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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, any of which may be integrated as part of a combined encoder / decoder (encoder-decoder) in a corresponding device.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] 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.
[0115] 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.
[0116] 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.
[0117] 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).
[0118] 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.
[0119] 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 a plurality of image blocks (and may be divided into a set of image blocks called slices). The prediction processing unit 108 can select one of a plurality of possible decoding modes for the current image block, such as one of a plurality of intra-frame decoding modes or one of a plurality of 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.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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.
[0125] 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 (transform unit, 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 (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.
[0126] The transformer 101 may send the resulting transform coefficients to the quantizer 102. The quantizer 102 quantizes the transform coefficients to further reduce the bit rate. In some examples, the quantizer 102 may then perform a scan of the matrix including the quantized transform coefficients. Alternatively, the entropy encoder 103 may perform the scan.
[0127] 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.
[0128] 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 and can be used by the inter-frame predictor 110 as a reference block to perform inter-frame prediction on blocks in subsequent video frames or images.
[0129] 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.
[0130] 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.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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 of an 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 a current image block of the current video slice based on syntax elements received from the entropy decoder 203, and decode (e.g., perform inter-frame prediction) on the current image block 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.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] 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 decoder 100, decoding end 20 or video decoder 200.
[0141] 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.
[0142] 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.
[0143] 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).
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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), the size thereof can be any size described in process ②.
[0149] 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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 ②.
[0154] 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.
[0155] 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.
[0156] 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.
[0157] For example, a video encoder may directly encode coefficients within an RB.
[0158] 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.
[0159] 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.
[0160] 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 (modifiedmaximum, 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.
[0161] In addition, for some special cases, the video encoder can also directly encode the original value of the image instead of the residual value.
[0162] It should be noted that the coding block (codingblock, 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 dividing through the above process ③, or it can be a prediction group after the coding unit is further divided.
[0163] 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.
[0164] Figure 5 A schematic diagram of a flow chart of an image decoding method provided in the present application, which 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 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.
[0165] S501 : For any pixel point or any plurality of parallel dequantized pixel points in a current coding block, determine a QP value of the pixel point.
[0166] Among the pixels of the current coding block, at least two pixels have different QP values. The parallel dequantized pixels refer to some pixels that can be dequantized in parallel.
[0167] It can be understood that any pixel point or any multiple parallel dequantized pixel points in the current coding block are the pixel points currently processed by the video decoder. For the sake of convenience, in the following embodiments, any pixel point or any multiple parallel dequantized pixel points may also be referred to as the current pixel point.
[0168] 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).
[0169] It should be noted 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 point or any multiple parallel dequantized pixel points of the coding block, and assigns different QP values to at least two pixel points 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 difference between different pixels in the same coding block, and assigns a suitable QP value to each pixel point, 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).
[0170] S502: Dequantize the current pixel according to the QP value of the current pixel.
[0171] Dequantizing the current pixel point specifically involves dequantizing the horizontal value of the current pixel point, where the horizontal value of the current pixel point is obtained by a video decoder through parsing a bit stream.
[0172] 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.
[0173] In an embodiment of the present application, dequantizing the horizontal value of the current pixel point according to the QP value of the current pixel point specifically includes: determining the quantization step Qstep of the current pixel point according to the QP value of the current pixel point; and then, for the selected quantizer combination, using the Qstep of the current pixel point to dequantize the horizontal value of the current pixel point.
[0174] 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.
[0175] 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.
[0176] Method 1: Qstep=a×QP+b, where a and b are preset parameters, for example, a is 2 and b is 1.
[0177] Method 2: Qstep = 2 T , where T is an integer related to QP, for example, T = (QP-6) / 4.
[0178] 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.
[0179] Optionally, the conventional scalar quantization method in H.265 described below may be used to implement quantization and inverse quantization.
[0180] Quantification:
[0181] Dequantization: c′=l*Qstep
[0182] 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.
[0183] 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.
[0184] [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.
[0185] 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:
[0186] Method 1: f is set to 0.5 or other fixed value.
[0187] Method 2: f can be adaptively determined according to the QP value, prediction mode, and whether to perform a transformation.
[0188] In summary, through the decoding method provided in the embodiments of the present application, the video decoder can determine the QP of each pixel granularity for the pixel points in the coding block, and then dequantize each pixel point according to the QP value of each pixel point, that is, dequantize each pixel point 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.
[0189] Optionally, combined Figure 5 ,like Figure 6 As shown, before determining the QP value of the current pixel, the decoding method provided in the embodiment of the present application also includes S503-S504.
[0190] S503: Obtain the QP value of the current coding block.
[0191] 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.
[0192] 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.
[0193] The process of method 1 includes S1-S3.
[0194] S1. Obtain the predicted QP value of the current coding block.
[0195] 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.
[0196] 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)>>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.
[0197] S2. Parse the bitstream to obtain the QP offset of the current coding block.
[0198] 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.
[0199] 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.
[0200] 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.
[0201] The process of the second method includes S10-S30.
[0202] S10. Obtain a predicted QP value of a current coding block.
[0203] For the description of S10, please refer to the relevant description of S1, which will not be repeated here.
[0204] S20. Determine a QP offset value of the current coding block according to the derived information of the current coding block.
[0205] 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.
[0206] 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.
[0207] 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.
[0208] 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.
[0209] S504: Determine a predicted QP value of the current pixel, where the predicted QP value of the current pixel is the QP value of the current coding block.
[0210] 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.
[0211] Based on the above S503-S504, if Figure 7As shown, the above-mentioned determination of the QP value of the current pixel point (ie S501) specifically includes S5011-S5012.
[0212] S5011: When the current pixel is any target pixel or any multiple parallel dequantized target pixels in the current coding block, adjust the predicted QP value of the current pixel, and use the adjusted QP value as the QP value of the current pixel.
[0213] In the embodiment of the present application, the target pixel is one or more specified pixel in the current coding block, and these specified pixel can be understood as the pixel or candidate pixel whose QP value is to be adjusted, and the QP adjustment strategy is executed for the candidate pixel. The target pixel will be described in detail below.
[0214] S5012: When the current pixel is a pixel other than the target pixel in the current coding block, the predicted QP value of the current pixel is determined as the QP value of the current pixel.
[0215] 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.
[0216] like Figure 7 As shown, as an implementation method, S5011 in the above embodiment can be implemented through S601-S602.
[0217] S601: Obtain information of reconstructed pixels around the current pixel.
[0218] The reconstructed pixel points around the current pixel point can be understood as the reconstructed pixel points adjacent to the current pixel point. In an embodiment of the present application, the reconstructed pixel points around the current pixel point include pixel points that meet the following conditions: pixel points in a square area with the current pixel point as the center and a side length of a first preset value; or, pixel points in a diamond area with the current pixel point as the center and a diagonal length of a second preset value.
[0219] Optionally, the first preset value and the second preset value can be set according to actual needs, and the first preset value and the second preset value can be equal or different. For example, the first preset value and the second preset value can be one of 3 or 5.
[0220] For example, Figure 8 (a) in FIG. 1 shows an example of a square area division with the current pixel as the center. Two possible situations are given here: Situation 1: The reconstructed pixel refers to the pixel in the square area with the current pixel as the center and a side length of 3, such as Figure 8The surrounding pixel points 1 shown in (a); in case 2, the reconstructed pixel points refer to the pixel points in the square area with a side length of 5 and the current pixel point as the center, such as Figure 8 The surrounding pixel point 2 shown in (a).
[0221] Figure 8 (b) in FIG. 1 shows an example of a diamond region division with the current pixel as the center. Two possible situations are given here: Situation 1: The reconstructed pixel refers to the pixel in the diamond region with the current pixel as the center and the diagonal length of 3, such as Figure 8 The surrounding pixel points 1 shown in (b); in case 2, the reconstructed pixel points refer to the pixel points in the diamond area with the current pixel point as the center and the diagonal length of 5, such as Figure 8 The surrounding pixel point 2 shown in (b).
[0222] It should be noted that Figure 8 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.
[0223] Optionally, the information of the reconstructed pixels around the current pixel includes at least one of the following information: the 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) of the reconstructed pixel.
[0224] 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.
[0225] In one implementation, the method for obtaining information of reconstructed pixels around a current pixel may include steps 1 and 2:
[0226] Step 1: Get the predicted pixel information of the current pixel.
[0227] The predicted pixel point of the current pixel point is the reconstructed pixel point. Optionally, the reconstructed pixel point may be a reconstructed pixel point in the current coding block, or the reconstructed pixel point 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 a reference frame of the current image frame.
[0228] Step 2: If the predicted pixel is a reconstructed pixel in the current coding block, the information of the predicted pixel is used as the information of the reconstructed pixels around the pixel; otherwise, the difference between the information of the predicted pixel and the information of the reconstructed pixels around the predicted pixel or the absolute value of the difference is used as the information of the reconstructed pixels around the pixel.
[0229] S602: Adjust the predicted QP value of the current pixel according to information of reconstructed pixels around the current pixel.
[0230] The adjusted QP value is the final QP value of the pixel.
[0231] In the embodiment of the present application, a QP adjustment parameter table may be set for the current pixel of the current coding block. For example, the following Table 1 shows some parameters required for adjusting the QP value.
[0232] Table 1
[0233]
[0234] Specifically, S602 includes the following S6021-S6023.
[0235] S6021: If the current pixel satisfies the second preset condition and the third preset condition, adjust the predicted QP value of the current pixel according to the first QP offset and the QP value corresponding to the distortion just perceptible to the human eye.
[0236] Among them, the second preset condition is that the predicted QP value of the current pixel is greater than the QP value corresponding to the distortion that can be just perceived by the human eye, and the predicted QP value of the current pixel is less than or equal to the adjustable QP maximum value (i.e., maxAdjustQP in Table 1), and the adjustable QP maximum value is less than or equal to the QP maximum value. The third preset condition is that the information of the reconstructed pixels around the current pixel is less than or equal to the first threshold (i.e., thres1 in Table 1).
[0237] Optionally, referring to Table 1, when the current pixel satisfies the second preset condition and the third preset condition, the adjusted QP value of the current pixel satisfies:
[0238] finalQP=max(initQP–offset1, jndQP)
[0239] Among them, finalQP represents the adjusted QP value, initQP represents the predicted QP value of the current pixel, offset1 represents the first QP offset, jndQP represents the QP value corresponding to the just noticeable distortion (JND) of the human eye, and max represents the maximum value.
[0240] In one case, the QP value corresponding to the distortion that can be just perceived by the human eye is parsed from the bitstream. For example, the bitstream carries the QP value corresponding to the distortion that can be just perceived by the human eye, such as 20.
[0241] In another case, the QP value corresponding to the distortion that can be just perceived by the human eye is derived based on the flatness information or texture information, background brightness, and contrast information of the surrounding reconstructed coding blocks.
[0242] In another case, the QP value corresponding to the distortion that can be just perceived by the human eye may also be a preset value set by the video encoder or the video decoder, such as 15.
[0243] That is to say, the QP value corresponding to the distortion that can be just perceived by the human eye can not only be carried in the bitstream, but can also be derived by the video encoder or video decoder during the video encoding and decoding process, or can also be a preset value. The embodiment of the present application introduces the QP value corresponding to the distortion that can be just perceived by the human eye into the determination process of the QP value of the pixel point, so that each pixel point satisfies the judgment information corresponding to the distortion that can be just perceived by the human eye, which can reduce image distortion and thus improve the subjective quality of the image.
[0244] S6022: If the current pixel satisfies the second preset condition and the fourth preset condition, adjust the predicted QP value of the current pixel according to the second QP offset and the QP maximum value.
[0245] Among them, the fourth preset condition is that the information of the reconstructed pixel points around the current pixel point is greater than the second threshold (ie, thres2 in Table 1), and the first threshold is less than or equal to the second threshold.
[0246] It can be seen that the predicted QP value of the current pixel point needs to be adjusted in the above S6021 and S6022.
[0247] S6023: In cases other than S6021 and S6022, the predicted QP value of the current pixel is used as the QP value of the current pixel, that is, the predicted QP value of the current pixel does not need to be adjusted.
[0248] It is understandable that the above S6023 includes the following situations:
[0249] Case 1: The predicted QP value of the current pixel is less than or equal to the QP value corresponding to the distortion that can be just perceived by the human eye.
[0250] Scenario 2: The current pixel satisfies the second preset condition (i.e., the predicted QP value of the current pixel is greater than the QP value corresponding to the distortion that can be just perceived by the human eye, and the predicted QP value of the current pixel is less than or equal to the adjustable QP maximum value), and the information of the reconstructed pixels around the current pixel is greater than the first threshold and less than or equal to the second threshold.
[0251] Scenario 3: The predicted QP value of the current pixel is greater than the maximum adjustable QP value.
[0252] like Figure 7 As shown, as another implementation manner, S5011 in the above embodiment can be implemented through S603.
[0253] S603: If the current pixel satisfies a first preset condition, the preset QP value is used as the QP value of the current pixel; otherwise, the predicted QP value of the current pixel is used as the QP value of the current pixel.
[0254] The first preset condition includes at least one of the following conditions:
[0255] The current pixel is a brightness pixel;
[0256] The current pixel is a chroma pixel;
[0257] The bit depth of the current pixel is less than or equal to the bit depth threshold (i.e., bdThres in Table 1);
[0258] The predicted QP value of the current pixel is less than or equal to the maximum adjustable QP value (i.e., maxAdjustQP in Table 1);
[0259] The information of the reconstructed pixels around the current pixel is less than or equal to a first preset threshold (ie, thres1 in Table 1).
[0260] Exemplarily, the first preset condition may be that the current pixel is a brightness pixel, and the bit depth of the current pixel is less than or equal to the bit depth threshold; or, the first preset condition may be that the current pixel is a chrominance pixel, and the predicted QP value of the current pixel is less than or equal to the adjustable QP maximum value. Specifically, one or more of the above conditions may be selected and combined as the first preset condition according to actual needs.
[0261] In a possible implementation, the target pixel is any one or more pixels in the current coding block, that is, the QP value of each pixel in the current coding block needs to be adjusted. For each pixel, the QP value can be determined by the method described in S601-S602 or S603.
[0262] In another possible implementation, the target pixel is any one or more pixels in the second part of the pixels of the current coding block. In the embodiment of the present application, the current coding block includes at least a first part of pixels and / or a second part of pixels, wherein the first part of pixels are set to pixels whose QP values do not need to be adjusted, that is, the QP value of the first part of pixels is the predicted QP value of the first part of pixels, and the second part of pixels are set to pixels whose QP values are to be adjusted, that is, the QP value of each pixel in the second part of pixels is determined by the method described in S601-S602 or S603.
[0263] In another possible implementation, the current coding block includes at least a first part of pixel points and / or a second part of pixel points. Similarly, the first part of pixel points are set to pixel points whose QP value does not need to be adjusted, that is, the QP value of the first part of pixel points is the predicted QP value of the first part of pixel points, and the second part of pixel points are set to pixel points whose QP value is to be adjusted.
[0264] In one possible scenario, when the prediction mode of the current coding block is a point-by-point prediction mode, for the second portion of pixel points, the second portion of pixel points may include a first position pixel point and / or a second position pixel point, wherein the first position pixel point and the second position pixel point are determined according to the point-by-point prediction mode of the current coding block. Typically, the second position pixel point may include a pixel point corresponding to a starting point of the point-by-point prediction in the horizontal direction.
[0265] The above-mentioned target pixel point is any one or more pixel points in the first position pixel points. If the current pixel point is one or more pixel points in the first position pixel points, the QP value of the current pixel point can be determined by the method described in S601-S602 above; if the current pixel point is one or more pixel points in the second position pixel points, the QP value of the current pixel point can be determined by the method described in S603 above.
[0266] It should be understood that in the embodiment of the present application, which pixels in the second part of pixels of the current coding block are set as pixels at the first position and which pixels are set as pixels at the second position are related to the point-by-point prediction mode of the current coding block.
[0267] As an example, refer to Fig. 9 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. The point-by-point prediction mode of the coding block includes 4 modes, namely point-by-point prediction mode 1, point-by-point prediction mode 2, point-by-point prediction mode 3 and point-by-point prediction mode 4.
[0268] Among them, ≡ means 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;
[0269] ||| indicates that the predicted value of the current pixel is the average of the reconstructed values of the pixels above and below the pixel;
[0270] >Indicates that the predicted value of the current pixel is the reconstructed value of the pixel to its left;
[0271] ∨ indicates that the predicted value of the current pixel is the reconstructed value of the pixel above the pixel.
[0272] In the embodiment of the present application, for the convenience of description, the pixel points predicted based on the pixel points on the left and right sides thereof are referred to as the first type of pixel points, the pixel points predicted based on the pixel points on the upper and lower sides thereof are referred to as the second type of pixel points, the pixel points predicted based on the pixel points on the left side thereof are referred to as the third type of pixel points, and the pixel points predicted based on the pixel points on the upper side thereof are referred to as the fourth type of pixel points.
[0273] like Fig. 9 As shown in (a), the prediction mode of the current coding block is point-by-point prediction mode 1. It can be seen that the current coding block includes a first part of pixels and a second part of pixels, and all of the second part of pixels are defined as first position pixels, that is, the second part of pixels does not include the second position pixels. Among them, the first position pixels include the first type of pixels and the fourth type of pixels.
[0274] like Fig. 9 As shown in (b), the prediction mode of the current coding block is point-by-point prediction mode 2. It can be seen that the first part of the pixels and the second part of the pixels of the current coding block, some of the pixels in the second part of the pixels are defined as first-position pixels, and the other part is defined as second-position pixels, wherein the first-position pixels include second-category pixels and third-category pixels; the second-position pixels include third-category pixels and fourth-category pixels.
[0275] like Fig. 9 As shown in (c), the prediction mode of the current coding block is point-by-point prediction mode 3. It can be seen that all the pixels of the current coding block are the second part of pixels, some of the pixels of the second part of pixels are defined as first position pixels, and the other part is defined as second position pixels, wherein the first position pixels include third category pixels; the second position pixels include third category pixels and fourth category pixels.
[0276] like Fig. 9 As shown in (d), the prediction mode of the current coding block is point-by-point prediction mode 4. It can be seen that the current coding block includes a first part of pixels and a second part of pixels, and all of the second part of pixels are defined as first position pixels, that is, the second part of pixels does not include the second position pixels. Among them, the first position pixels include the fourth type of pixels.
[0277] As an example, refer to Fig.10 Taking the current coding block of 8×2 (width w is 8, 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 also includes 2 modes, namely point-by-point prediction mode 1 and point-by-point prediction mode 2.
[0278] like Fig.10 As shown in (a), the prediction mode of the current coding block is point-by-point prediction mode 1. It can be seen that the current coding block includes a first part of pixels and a second part of pixels, and all of the second part of pixels are defined as first position pixels, that is, the second part of pixels does not include the second position pixels. Among them, the first position pixels include the fourth type of pixels.
[0279] like Fig.10 As shown in (b), the prediction mode of the current coding block is point-by-point prediction mode 2. It can be seen that all the pixels of the current coding block are the second part of pixels, some of the pixels of the second part of pixels are defined as first position pixels, and the other part is defined as second position pixels, wherein the first position pixels include third category pixels; the second position pixels include third category pixels and fourth category pixels.
[0280] As an example, refer to Fig.11 Taking the current coding block of 8×1 (width w is 8, height h is 1) 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 also includes 2 modes, namely point-by-point prediction mode 1 and point-by-point prediction mode 2.
[0281] like Fig.11 As shown in (a), the prediction mode of the current coding block is the point-by-point prediction mode 1. It can be seen that all the pixels of the current coding block are the first part of pixels, and the first part of pixels are all fourth-category pixels.
[0282] like Fig.11 As shown in (b), the prediction mode of the current coding block is point-by-point prediction mode 2. It can be seen that all the pixels of the current coding block are the second part of pixels, some of the pixels in the second part of pixels are defined as first position pixels, and the other part is defined as second position pixels, wherein the first position pixels include third category pixels; the second position pixels include third category pixels and fourth category pixels.
[0283] Combination Figure 5 ,like Fig.12 As shown, in a possible scenario, when the prediction mode of the current coding block is a block prediction mode, before determining the QP value of the current pixel point, the decoding method provided by the embodiment of the present application also includes S505-S506.
[0284] S505: Obtain region division information of the current coding block, where the region division information includes the number N of regions and position information of region boundaries, where N is an integer greater than or equal to 2.
[0285] The area division information may also be referred to as a division template.
[0286] Optionally, the method for obtaining region division information of the current coding block includes: obtaining predefined region division information of the current coding block; or parsing a bit stream to obtain region division information of the current coding block; or deriving the region division information of the current coding block by a video decoder.
[0287] S506: Divide the current coding block into N regions according to the region division information.
[0288] Optionally, the block prediction mode may include a block-based inter prediction mode, a block-based intra prediction mode, or an intra block copy (IBC) prediction mode.
[0289] Optionally, a prediction block of the current coding block is predicted according to a block prediction mode, and then its residual block is obtained. From the perspective of whether to transform the residual block, the block prediction mode may include a block prediction mode without transformation and a block prediction mode with transformation, wherein the block prediction mode without transformation refers to not transforming the residual block determined according to the block prediction mode, and the block prediction mode with transformation refers to requiring transformation of the residual block determined according to the block prediction mode.
[0290] For the block prediction mode without transformation, the pixels in the current coding block can be reconstructed "point by point" or "region by region" in sequence, and the information of the previously reconstructed pixels can be used to adjust the QP value of the subsequently reconstructed pixels.
[0291] Point-by-point reconstruction of the pixels in the current coding block is similar to the above-mentioned point-by-point prediction mode. Therefore, the method for determining the QP value of the pixel points of the current coding block in the "point-by-point" reconstruction situation is similar to the method for determining the QP value in the above-mentioned point-by-point prediction mode, that is, the method described in S601-S602 or S603 above can be used to determine the QP value of the pixel points of the current coding block.
[0292] Reconstructing the pixels in the current coding block "region by region" allows the pixels in the same region to be reconstructed in parallel. The idea is to divide the current coding block into N regions (N≥2) and then reconstruct them region by region.
[0293] Specifically, for the "region-by-region" reconstruction method in the block prediction mode without transformation, the current coding block can be divided into N regions according to the number of regions N in the obtained divided region information and the position information of the region boundary. It should be noted that the QP value of the pixel points of at least one region in the N regions is determined based on the information of the reconstructed pixel points of at least one other region, and the other regions are regions other than at least one region in the N regions, that is, the N regions have a reconstruction order, that is, the reconstruction processes of some regions in the N regions have a dependent relationship, for example, one region needs to be reconstructed first, and then another region is reconstructed based on the reconstruction result of the region.
[0294] Optionally, the number of regions N and the position information of the region boundary lines may be derived according to information of the current coding block or information of reference pixels of the current coding block.
[0295] As an example, assuming that N=2 (i.e., the current coding block is divided into 2 regions), the current coding block includes a first region and a second region, and the pixels in the first region include at least one of the following pixels: pixels in a horizontal strip at any position of the current coding block, pixels in a vertical strip at any position, or pixels in an oblique strip at any position, wherein the width of the strip does not exceed 2, and when the strip is located at the boundary of the current coding block, the width of the strip is equal to 1, and the pixels in the second region are the pixels in the current coding block except the first region. The reconstruction order of the first region and the second region is to reconstruct the second region first, and then reconstruct the first region.
[0296] Exemplarily, one or more of the upper boundary pixel points, lower boundary pixel points, left boundary pixel points or right boundary pixel points of the current coding block, it can be understood that the upper boundary pixel points are the pixel points of the upper strip, the lower boundary pixel points are the pixel points of the lower strip, the left boundary pixel points are the pixel points of the left strip, and the right boundary pixel points are the pixel points of the right strip.
[0297] Fig.13 Schematic diagrams of several exemplary division results of the current coding block. Fig.13 In (a), the pixels in the first area include the upper boundary pixel points, the lower boundary pixel points, the left boundary pixel points and the right boundary pixel points of the current coding block. Fig.13 In (b), the pixels in the first area include the lower boundary pixels and the right boundary pixels of the current coding block. Fig.13 In (c), the pixels in the first area include the right boundary pixels of the current coding block. Fig.13 In (d), the pixels in the first area include the lower boundary pixels of the current coding block.
[0298] For the transformed block prediction mode, all pixels in the current coding block need to be reconstructed in parallel, so the current coding block can also be divided into N regions (N≥2), and then the pixels in the same region are reconstructed in parallel.
[0299] Specifically, for the transformed block prediction mode, the current coding block may be divided into N regions according to the number N of regions in the obtained divided region information and the position information of the region boundary.
[0300] Optionally, the number of regions N and the position information of the region boundary can be derived based on the information of the current coding block or the information of the reference pixels of the current coding block. Optionally, the region division information of the current coding block can be determined based on the pixel points of the upper adjacent row and / or the pixel points of the left adjacent column of the current coding block (i.e., the reference pixel points of the current coding block). Specifically, the object edge inside the current coding block is predicted based on the pixel points of the upper adjacent row and / or the pixel points of the left adjacent column of the current coding block, and then the current coding block is divided into several regions based on the object edge. For example, based on the pixel points of the upper adjacent row and / or the pixel points of the left adjacent column of the current coding block, a gradient algorithm is used to predict the pixel points where the pixel values of the rows and / or columns of the current coding block mutate, so that the mutated pixel points are used as the position of the region boundary, and the number of regions N can be determined accordingly.
[0301] The area division information of the current coding block determined by the above method can make the area division method of the current coding block include at least one of the following: horizontal division, vertical division or oblique division. For example, when there are one or more mutated pixels in the row pixel values of the current coding block and there are no mutated pixels in the column pixel values, the area division method of the current coding block is vertical division; when there are one or more mutated pixels in the column pixel values of the current coding block and there are no mutated pixels in the row pixel values, the area division method of the current coding block is horizontal division; when there are one or more mutated pixels in the row pixel values of the current coding block and there are one or more mutated pixels in the column pixel values, the area division method of the current coding block is oblique division.
[0302] refer to Fig.14 ,One way of dividing is to divide the current coding block into two areas, Fig.14 (a) in the figure shows that the vertical division is into two regions, and point A1 is the mutation pixel point of the row; Fig.14 (b) in the figure shows that the horizontal area is divided into two regions, and point B1 is the mutation pixel point of the column; Fig.14 (c) in the figure shows that the image is divided diagonally into two regions, where point C1 is the mutation pixel point of the row, and point D1 is the mutation pixel point of the column.
[0303] refer to Fig.15 ,One way of dividing is to divide the current coding block into three areas, Fig.15 (a) in the figure shows that the image is divided into three regions vertically, and points A2 and A3 are the sudden pixel points of the row; Fig.15 (b) in the figure shows that the horizontal three-division is divided into three regions, and points B2 and B3 are the mutation pixel points of the column; Fig.15 (c) to Fig.15 (e) in the figure shows that the image is divided into three regions diagonally, among which: Fig.15 In (c), points C2 and C3 are the mutation pixels of the row, and points D2 and D3 are the mutation pixels of the column; Fig.15 In (d), points C4 and C5 are the mutation pixel points of the row, and point D4 is the mutation pixel point of the column; Fig.15 In (e), point C6 is the mutation pixel point of the row, and points D5 and D6 are the mutation pixel points of the column.
[0304] It should be noted that Fig.14 and Fig.15 These are merely examples of some division results of the current coding block and should not be considered as limitations on the embodiments of the present application. The division method of the current coding block may also be a combination of multiple division methods.
[0305] Based on the above S505-S506, in one implementation, for the above block prediction mode without transformation, taking the current coding block being divided into 2 (ie, N=2) regions as an example, that is, the current coding block includes a first region and a second region (refer to Fig.10 ),like Fig.12 As shown, the above-mentioned determination of the QP value of the current pixel point (ie S501) specifically includes S5013-S5014.
[0306] S5013: When the current pixel is any pixel in the first area, adjust the predicted QP value of the current pixel, and use the adjusted QP value as the QP value of the current pixel.
[0307] Specifically, information of reconstructed pixels around the current pixel is obtained, and then the predicted QP value of the pixel is adjusted according to the information of reconstructed pixels around the current pixel. The specific process can refer to the relevant description of S601-S602 (wherein S602 includes S6021-S6023) in the above embodiment, which will not be repeated here.
[0308] S5014: When the current pixel is any pixel in the second region, the predicted QP value of the current pixel is used as the QP value of the current pixel. Since the pixel in the second region needs to be reconstructed first, there may be no reconstructed pixel around it at this time, so the QP value of the pixel in the second region is not adjusted, that is, the predicted QP value of the pixel in the second region is used as the QP value of the pixel.
[0309] In another implementation, for the above-mentioned transformed block prediction mode, for any pixel point in any one of the N regions or any number of parallel dequantized pixels, such as Fig.12 As shown, the above-mentioned determination of the QP value of the current pixel point (ie, S501) specifically includes S5015-S5016.
[0310] S5015. Obtain the QP offset of the current pixel.
[0311] Optionally, the method for obtaining the QP offset of the current pixel includes: parsing the bitstream to obtain the offset of the current pixel. It can be understood that in the process of encoding the image by the video encoder, after the video encoder predicts the QP offset of each pixel, the QP offset of each pixel can be encoded into the bitstream and transmitted to the video decoder.
[0312] Alternatively, optionally, the method for obtaining the QP offset of the current pixel point includes: determining the QP offset of the current pixel point based on derivation information, the derivation information including index information of the area where the current pixel point is located and / or the distance from the current pixel point to the area boundary line of the area where the current pixel point is located; wherein the distance includes any one of the following: horizontal distance, vertical distance or Euclidean distance.
[0313] Therefore, the derived QP offset includes at least one, for example, the QP offset of the current pixel is any one of the following: the third QP offset, the fourth QP offset, and the sum of the third QP offset and the fourth QP offset.
[0314] Among them, the third QP offset is derived according to the index information of the area where the current pixel point is located. The third QP offset can be regarded as a region-level QP offset. It should be understood that the third QP offsets of pixels in the same area are the same, and the third QP offsets of pixels in different areas are different.
[0315] The fourth QP offset is derived based on the distance from the current pixel to the region boundary of the region where the current pixel is located. The fourth QP offset can be regarded as a pixel-level QP offset. If the distances corresponding to the pixels are different, the QP offset of the current pixel may be different.
[0316] Optionally, one of the third QP offset, the fourth QP offset, and the sum of the third QP offset and the fourth QP offset may be selected as the QP offset of the pixel point according to the configuration of the video encoder side.
[0317] S5016: Adjust the predicted QP value of the current pixel according to the QP offset of the current pixel, and use the adjusted QP value as the QP value of the current pixel.
[0318] In summary, this is a description of the image decoding process. The video decoder can determine the QP of the pixel granularity for the pixels in the coding block, and then dequantize each pixel point by point according to the QP value of each pixel. In this way, the decoding distortion of the image frame can be reduced while ensuring a certain compression rate, which can improve the authenticity and accuracy of image decoding.
[0319] 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.
[0320] 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 encoding method implemented by the video encoder 100 is taken as an example for explanation. The image encoding method includes the following steps.
[0321] S1601. For any pixel point or any plurality of parallel quantized pixel points in any current coding block, determine a QP value of the pixel point.
[0322] Among the pixels of the current coding block, there are at least two pixels with different QP values.
[0323] S1602: quantize the pixel points according to the QP value of the pixel points.
[0324] Quantization is the reverse process of inverse quantization. For the quantization of QP values in the encoding method, please refer to the above Figure 5 to Figure 15 The corresponding process in the decoding method will not be described here.
[0325] In summary, through the encoding method provided in the embodiments of the present application, the video encoder can determine the QP of each pixel granularity for the pixel points in the encoding block, and thus 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.
[0326] It can be understood that for the block prediction mode, the current coding block is divided into N (N≥2) regions according to the method described in the embodiment, and the pixels in each region are quantized pixel by pixel or multiple pixels are quantized in parallel. After the horizontal value (i.e., the quantized residual coefficient or the quantized parameter coefficient) is obtained, the parameter coefficient is encoded.
[0327] In the case where the coding block is divided into N regions, since the QP values of different regions may be adjusted in different ways, the distribution of the quantized residual coefficients is also different. Therefore, a region-based residual grouping coding method can be designed.
[0328] Specifically, the residual coefficients of each region can be divided into several residual groups. It should be noted that each residual group cannot cross regions. Then, the code length parameter of the residual group is encoded. The encoding method can be a fixed-length code or a variable-length code. Then, the fixed-length code is used to encode each residual coefficient in the residual group. The code length of the fixed-length code is determined by the code length parameter of the residual group, and the code length parameters of different residual groups can be different.
[0329] Exemplary, reference Fig.17 , assuming that the current coding block is a 16×2 coding block, the current coding block is divided into two regions, region 1 and region 2. The residual coefficients corresponding to region 1 can be divided into n (n≥1) residual groups, and the residual coefficients corresponding to region 2 can be divided into m (m≥1) residual groups, and each residual group does not cross regions. It should be understood that the parameter coefficients correspond to the pixels one by one, and grouping the parameter coefficients corresponding to the region is to group the pixels included in the region. Figure 7 As shown, region 1 includes 15 pixels. Exemplarily, region 1 can be divided into one residual group, that is, the 15 pixels are divided into one residual group; region 1 can also be divided into 2 residual groups, for example, the first 8 pixels of region 1 are divided into one residual group 1, and the last 7 pixels of region 1 are divided into another residual group 2; region 1 can also be divided into 3 residual groups, for example, every 5 adjacent pixels are divided into one residual group, so as to obtain 3 residual groups, such as residual group 1, residual group 2 and residual group 3.
[0330] Optionally, the prediction mode used by the video encoder to predict the current coding block may include a point-by-point prediction mode and a block prediction mode. The block prediction mode may be an inter-frame prediction mode of a block, an intra-frame prediction mode of a block, or an intra-block copy prediction (IBC) prediction mode. An IBC prediction mode is briefly introduced below.
[0331] IBC technology searches for matching blocks of the current coding block in the reconstructed area of the current frame, with the aim of removing non-local redundancy in space. The prediction process in the IBC prediction mode can be divided into two processes: motion estimation and motion compensation. Motion estimation is the encoding end searching for matching blocks of the current coding block, estimating the relative displacement between the current coding block and its matching block, that is, the block vector (BV) or block vector difference (BVD) corresponding to the current coding block, and transmitting BV or BVP in the bitstream. Motion compensation is the generation of a prediction block based on the matching block, including operations such as weighting the matching block and predictive filtering.
[0332] Optionally, the method for the video encoder to obtain the prediction block of the current coding block may include:
[0333] Method 1: If the pixels in the prediction block are not available, it is allowed to fill with pixels on the upper or left side, or fill with default values.
[0334] Method 2: Based on the matching block obtained by BV or BVD, some processing is performed on the matching block (such as prediction filtering, illumination compensation, etc.) to generate the final prediction block.
[0335] Optionally, in the IBC prediction mode, the video encoder divides the current coding block into a number of transform blocks (TB) and a number of prediction blocks (PB), wherein a TB may include one or more PBs, for example, refer to Fig.18 , taking the current coding block of 16×2 as an example, the current coding block is divided into 2 TBs, namely TB1 and TB2, the sizes of TB1 and TB2 are both 8×2, each TB includes 4 PBs, and the size of each PB is 2×2; then each TB is reconstructed in turn. A pixel reconstruction method is: starting from the second TB of the current coding block, when performing motion compensation on the PB in each TB, the reconstructed pixel value in the reconstructed TB on the left side of the current TB can be referred to.
[0336] Optionally, the video encoder encodes BV or BVD using the following method 1 and / or method 2.
[0337] Method 1: For motion search performed only in the horizontal direction, only the block vector BV or block vector difference BVD in the horizontal direction is transmitted in the bitstream, and there is no need to transmit the BV or BVD in the vertical direction.
[0338] Method 2: The encoding method of BV or BVD can be a fixed-length code or a variable-length code.
[0339] And the code length of the fixed-length code or the binarization method of the variable-length code can be obtained based on one or more of the following information:
[0340] The location information, size information (including width or height or area), division mode information or TB / PB division method of the current coding block;
[0341] The location information or size information (including width, height or area) of the current TB;
[0342] The location information or size information (including width, height or area) of the current PB.
[0343] Optionally, the steps of obtaining the current coding block may be: first obtain the prediction BV (block vector prediction, BVP), and then obtain BVD, then BV=BVP+BVD.
[0344] The BVP may be obtained based on one or more of the following information:
[0345] BV or BVD, location information, size information (including width or height or area), partition mode information or TB / PB partitioning method of the coded block;
[0346] BV or BVD, position information or size information (including width or height or area) of surrounding prediction blocks.
[0347] 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.
[0348] Fig.191 is a schematic diagram of a decoding device provided in an embodiment of the present application. The decoding device 1900 includes a QP determination unit 1901 and an inverse quantization unit 1902. The decoding device 1900 can be used to implement the functions of the video decoder or the decoding end in the above decoding method embodiment, and thus can also achieve the beneficial effects of the above decoding method embodiment. In the embodiment of the present application, the decoding device 1900 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 .
[0349] QP determination unit 1901 and inverse quantization unit 1902 are used to implement Figure 5 to Figure 15 The decoding method provided by any embodiment of the present invention. For a detailed description of the above-mentioned QP determination unit 1901 and the inverse quantization unit 1902, 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.
[0350] Fig. 20 The present application provides a schematic diagram of the structure of a coding device, the coding device 2000 includes: a QP determination unit 2001 and a quantization unit 2002. The coding device 2000 can be used to implement the functions of the video encoder or the coding end in the above coding method embodiment, and thus can also achieve the beneficial effects of the above coding method embodiment. In the embodiment of the present application, the coding device 2000 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 .
[0351] The QP determination unit 2001 and the quantization unit 2002 are used to implement Figure 16 to Figure 18 For a more detailed description of the QP determination unit 2001 and the quantization unit 2002, please refer to Figures 4 to 18 The relevant description in the method embodiment shown is directly obtained and will not be repeated here.
[0352] The present application also provides an electronic device, such as Fig.21As shown, the present application provides a structural schematic diagram of an electronic device, the electronic device 2100 includes a processor 2101 and a communication interface 2102. The processor 2101 and the communication interface 2102 are coupled to each other. It is understandable that the communication interface 2101 can be a transceiver or an input-output interface. Optionally, the electronic device 2100 may also include a memory 2103 for storing instructions executed by the processor 2101 or storing input data required by the processor 2101 to run the instructions, or storing data generated after the processor 2101 runs the instructions.
[0353] When the electronic device 2100 is used to implement Figure 5 to Figure 15 When the method is shown, the processor 2101 and the interface circuit 2102 are used to perform the functions of the above-mentioned QP determination unit 1901 and the inverse quantization unit 1902.
[0354] When the electronic device 2100 is used to implement Figure 16 to Figure 18 When the method is shown, the processor 2101 and the interface circuit 2102 are used to perform the functions of the above-mentioned QP determination unit 2001 and the quantization unit 2002.
[0355] The specific connection medium between the communication interface 2102, the processor 2101 and the memory 2103 is not limited in the embodiment of the present application. Fig.21 The communication interface 2102, the processor 2101 and the memory 2103 are connected via a bus 2104. Fig.21 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.21 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.
[0356] The memory 2103 can be used to store software programs and modules, such as program instructions / modules corresponding to the decoding method or encoding method provided in the embodiment of the present application. The processor 2101 executes the software programs and modules stored in the memory 2103 to perform various functional applications and data processing. The communication interface 2102 can be used to communicate signaling or data with other devices. In the present application, the electronic device 2100 can have multiple communication interfaces 2102.
[0357] 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.
[0358] 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.
[0359] 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)).
[0360] 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.
[0361] 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.
[0362] 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.
[0363] 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.
[0364] 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.
[0365] 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, and the method includes: For any pixel point or any plurality of parallel dequantized pixel points in a current coding block, determine a quantization parameter QP value of the pixel point; wherein at least two pixel points in the current coding block have different QP values; Dequantizing the pixel according to the QP value of the pixel; Wherein, the method further comprises: Obtaining a QP value of the current coding block; Determine a predicted QP value of the pixel, where the predicted QP value of the pixel is the QP value of the current coding block; The determining the QP value of the pixel point includes: When the pixel point is any target pixel point or any plurality of parallel dequantized target pixel points in the current coding block, adjusting the predicted QP value of the pixel point, and using the adjusted QP value as the QP value of the pixel point; The adjusting the predicted QP value of the pixel point includes: Obtaining information of reconstructed pixels around the pixel; The predicted QP value of the pixel is adjusted according to information of reconstructed pixels around the pixel.
2. The method according to claim 1, characterized in that The adjusting the predicted QP value of the pixel point includes: If the pixel point meets the first preset condition, the preset QP value is used as the QP value of the pixel point; Otherwise, taking the predicted QP value of the pixel as the QP value of the pixel; The first preset condition includes at least one of the following conditions: The pixel point is a brightness pixel point; The pixel point is a chromaticity pixel point; The bit depth of the pixel is less than or equal to a bit depth threshold; The predicted QP value of the pixel is less than or equal to an adjustable QP maximum value, and the adjustable QP maximum value is less than or equal to a QP maximum value; The information of the reconstructed pixels around the pixel is less than or equal to a first preset threshold.
3. The method according to claim 1 or 2, characterized in that: The dequantizing the pixel point according to the QP value of the pixel point includes: Dequantize the pixel points according to the adjusted QP value.
4. The method according to claim 1 or 2, characterized in that: The target pixel point is any one or more pixel points in the current coding block.
5. The method according to claim 1 or 2, characterized in that: The current coding block includes at least a first part of pixel points and / or a second part of pixel points, and the target pixel point is any one or more pixel points in the second part of pixel points.
6. The method according to claim 1, characterized in that The current coding block includes at least a first part of pixel points and / or a second part of pixel points, and the target pixel point is any one or more pixel points in the first position of the second part of pixel points.
7. The method according to claim 2, characterized in that The current coding block includes at least a first part of pixel points and / or a second part of pixel points, and the target pixel point is any one or more pixel points in the second position pixel points in the second part of pixel points.
8. The method according to claim 6 or 7, characterized in that: The prediction mode of the current coding block is a point-by-point prediction mode, the second part of pixels includes first-position pixel points and / or second-position pixel points, and the first-position pixel points and the second-position pixel points are determined according to the point-by-point prediction mode of the current coding block.
9. The method according to claim 1, characterized in that: The adjusting the predicted QP value of the pixel point according to information of reconstructed pixels around the pixel point includes: If the pixel satisfies the second preset condition and the third preset condition, the predicted QP value of the pixel is adjusted according to the first QP offset and the QP value corresponding to the distortion just perceptible to the human eye; wherein the second preset condition is that the predicted QP value of the pixel is greater than the QP value corresponding to the distortion just perceptible to the human eye, and the predicted QP value of the pixel is less than or equal to the adjustable QP maximum value, and the third preset condition is that information of reconstructed pixels around the pixel is less than or equal to the first threshold; If the pixel point does not meet the second preset condition, or the pixel point meets the second preset condition but does not meet the third preset condition and does not meet the fourth preset condition, the predicted QP value of the pixel point is used as the QP value of the pixel point; wherein the fourth preset condition is that the information of the reconstructed pixels around the pixel point is greater than the second threshold, and the first threshold is less than or equal to the second threshold.
10. The method according to claim 9, characterized in that When the pixel point satisfies the second preset condition and the third preset condition, the adjusted QP value satisfies: finalQP = max(initQP - offset1, jndQP), wherein finalQP represents the adjusted QP value, initQP represents the predicted QP value of the pixel point, offset1 represents the first QP offset, jndQP represents the QP value corresponding to the distortion that can be just perceived by the human eye, and max represents the maximum value.
11. The method according to claim 1 or 2, characterized in that: The reconstructed pixel points around the pixel point include pixel points that meet the following conditions: Pixel points in a square area with the pixel point as the center and a side length of a first preset value; or, A pixel point in a rhombus area with the pixel point as the center and a diagonal length of a second preset value.
12. The method according to claim 1 or 2, characterized in that: The information of the reconstructed pixel includes at least one of the following information: pixel value, flatness information or texture information or complexity information, background brightness, contrast or motion degree of the reconstructed pixel.
13. The method according to claim 12, characterized in that The value of the information of the reconstructed pixel point includes at least one of the following: an original value, an absolute value, a mean value or a difference value.
14. The method according to claim 1 or 2, characterized in that: The obtaining information of reconstructed pixel points around the pixel point includes: Obtaining information of a predicted pixel point of the pixel point; If the predicted pixel point is not a reconstructed pixel point in the current coding block, the difference between the information of the predicted pixel point and the information of the reconstructed pixels around the predicted pixel point or the absolute value of the difference is used as the information of the reconstructed pixels around the pixel point.
15. The method according to claim 1, characterized in that The prediction mode of the current coding block is a block prediction mode, and the method further includes: Acquire region division information of the current coding block, where the region division information includes the number N of regions and position information of region boundaries, where N is an integer greater than or equal to 2; According to the region division information, the current coding block is divided into N regions.
16. The method according to claim 15, characterized in that The obtaining the region division information of the current coding block includes: Obtaining predefined region division information of the current coding block; or, Parse the bitstream to obtain the region division information of the current coding block.
17. An image encoding method, characterized in that: The method is performed by an encoding end, and the method includes: For any pixel point or any plurality of parallel quantized pixel points in any current coding block, determine a quantization parameter QP value of the pixel point; wherein at least two pixel points in the current coding block have different QP values; quantizing the pixel according to the QP value of the pixel; Wherein, the method further comprises: Obtaining a QP value of the current coding block; Determine a predicted QP value of the pixel, where the predicted QP value of the pixel is the QP value of the current coding block; The determining the QP value of the pixel point includes: When the pixel point is any target pixel point or any plurality of parallel quantized target pixel points in the current coding block, adjusting the predicted QP value of the pixel point, and using the adjusted QP value as the QP value of the pixel point; The adjusting the predicted QP value of the pixel point includes: Obtaining information of reconstructed pixels around the pixel; The predicted QP value of the pixel is adjusted according to information of reconstructed pixels around the pixel.
18. An image decoding device, characterized in that: The decoding device comprises: a quantization parameter QP determination unit and a dequantization unit; The QP determination unit is used to determine the quantization parameter QP value of any pixel point or any plurality of parallel dequantized pixel points in the current coding block; wherein at least two pixel points in the current coding block have different QP values; The dequantization unit is used to dequantize the pixel according to the QP value of the pixel; The QP determination unit is further configured to obtain the QP value of the current coding block; determine the predicted QP value of the pixel point, wherein the predicted QP value of the pixel point is the QP value of the current coding block; The QP determination unit determines the QP value of the pixel point, including: When the pixel point is any target pixel point or any plurality of parallel quantized target pixel points in the current coding block, adjusting the predicted QP value of the pixel point, and using the adjusted QP value as the QP value of the pixel point; The QP determination unit adjusts the predicted QP value of the pixel point, including: Obtaining information of reconstructed pixels around the pixel; The predicted QP value of the pixel is adjusted according to information of reconstructed pixels around the pixel.
19. An image encoding device, characterized in that: The encoding device comprises: a quantization parameter QP determination unit and a quantization unit; The QP determination unit is used to determine the quantization parameter QP value of any pixel point or any plurality of parallel quantized pixel points in any current coding block; wherein at least two pixel points among the pixel points of the current coding block have different QP values; The quantization unit is used to quantize the pixel according to the QP value of the pixel; The QP determination unit is further configured to obtain the QP value of the current coding block; determine the predicted QP value of the pixel point, wherein the predicted QP value of the pixel point is the QP value of the current coding block; The QP determination unit determines the QP value of the pixel point, including: When the pixel point is any target pixel point or any plurality of parallel quantized target pixel points in the current coding block, adjusting the predicted QP value of the pixel point, and using the adjusted QP value as the QP value of the pixel point; The QP determination unit adjusts the predicted QP value of the pixel point, including: Obtaining information of reconstructed pixels around the pixel; The predicted QP value of the pixel is adjusted according to information of reconstructed pixels around the pixel.
20. A video decoding system, characterized in that: It includes an encoding end and a decoding end, the encoding end is communicatively connected to the decoding end, the decoding end is used to implement the method according to any one of claims 1 to 16, and the encoding end is used to implement the method according to claim 17.
21. 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 17.
22. A computer-readable storage medium, characterized in that: The storage medium stores a computer program or instruction, and when the computer program or instruction is executed by an electronic device, the method according to any one of claims 1 to 17 is implemented.
Citation Information
Patent Citations
Method and apparatus for coding image data
CN110418133A
Training method and device of interpolation filter, video image encoding and decoding method, and codec
CN111010568A
