Image encoding and decoding method and device
In video encoding technology, the decoding end determines the target correspondence relationship based on the quantization parameters to minimize the change rate of quantization step size, and solves the problem of code flow fluctuations caused by the difference in quantization step size, improving the compression performance and image quality balance of video encoding.
Patent Information
- Application Number
- CN202210520733.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-13
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-05-13
AI Technical Summary
In the existing video encoding technology, the quantization step sizes corresponding to the quantization parameters vary greatly, resulting in obvious fluctuations in the code stream, affecting the compression performance, and making it difficult to balance image quality and compression rate.
By obtaining the quantization parameter QP value of the block to be decoded on the decoding end, the target correspondence relationship is determined to minimize the rate of change of the quantization step size, select a suitable correspondence relationship for inverse quantization, and control the range of the quantization step size to adjust the image quality and compression rate balance.
Effectively control code rate fluctuations, improve the compression performance of the encoder, and ensure the balance between image quality and compression rate.
Smart Images

Figure CN116156168B_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 coding and decoding method and device. Background Art
[0002] Video coding technology is also called video compression technology. Video compression technology is used to reduce the data bandwidth of video signals. Among them, video is a continuous sequence of images, which is composed of continuous image frames. One frame is an image. Due to the visual persistence effect of the human eye, when the frame sequence is played at a certain rate, what the human eye can see is a continuous video. 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 reconstruct the image.
[0003] 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 achieving better compression efficiency. The encoder and decoder determine the quantization step (Qstep) based on the quantization parameter (QP) to perform the quantization and dequantization process. Quantization is a step in lossy image compression, and the quantization step can be used to control the balance between image quality and compression rate. A larger quantization step can ensure a high compression rate but reduce image quality, while a smaller quantization step will result in a low compression rate but maintain better image quality.
[0004] At present, in the quantization process, the quantization step sizes corresponding to quantization parameters of similar sizes are quite different. This will cause the code rate of the code stream output by the encoder to fluctuate significantly, and the balance between image quality and compression rate is poor, affecting the compression performance of the encoder. Summary of the invention
[0005] The embodiments of the present application provide an image encoding and decoding method and device, which can be used to improve the compression performance of the encoder.
[0006] In order to achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[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: obtaining a quantization parameter QP value of a block to be decoded; determining a target corresponding relationship in multiple corresponding relationships based on the obtained QP value; the corresponding relationship is used to indicate the corresponding relationship between different QP values and quantization step sizes, and the corresponding relationships indicated by each two corresponding relationships in the multiple corresponding relationships are different, wherein, in the multiple corresponding relationships, the target corresponding relationship has a minimum rate of change of the quantization step size within a preset interval including the QP value; determining the target quantization step size based on the obtained QP value and the target corresponding relationship; dequantizing the block to be decoded based on the target quantization step size; and reconstructing the dequantized block to be decoded to obtain a reconstructed image block.
[0008] The image decoding method provided by the embodiment of the present application has at least the following beneficial effects: the method presets a variety of corresponding relationships between different quantization parameters and quantization step sizes. In the dequantization process, based on each corresponding relationship, including the change rate of the quantization step size within the preset interval of the QP value, a suitable corresponding relationship can be first selected, and the quantization step size can be determined according to the obtained quantization parameter of the block to be decoded, and then the dequantization operation is performed. Since a larger quantization step size can ensure a high compression rate but will reduce the image quality, a lower quantization step size will result in a low compression rate but will maintain a good image quality. By selecting a suitable corresponding relationship, the range of the quantization step size can be adjusted, and the size of the change rate of the quantization step size corresponding to the quantization parameter of similar size can also be controlled. In this way, the method can control the balance between image quality and compression rate by selecting a suitable corresponding relationship, and can also control the rate fluctuation of the video code stream by controlling the change speed between the quantization step sizes, thereby improving the compression performance of the encoder.
[0009] In a possible implementation, the above-mentioned determining a target corresponding relationship among multiple corresponding relationships includes: obtaining a first parameter of the block to be decoded, the first parameter may include any one of the above-mentioned QP value, the predicted quantization step size, or the index value of the predicted quantization step size, wherein the index value of the predicted quantization step size is used to indicate a value interval of the predicted quantization step size. Then, according to the first parameter, the target corresponding relationship is determined among the multiple corresponding relationships.
[0010] In another possible implementation, if the first parameter includes the QP value, the above-mentioned determining the target corresponding relationship among multiple corresponding relationships according to the first parameter specifically includes: if the QP value is within a first QP interval, determining a first corresponding relationship among the multiple corresponding relationships as the target corresponding relationship, wherein a change rate of a quantization step determined based on the first corresponding relationship and the QP value in the first QP interval among the multiple corresponding relationships is the smallest; the first QP interval is one of the multiple QP intervals, and the multiple QP intervals are multiple QP value intervals obtained by dividing the possible value range of QP.
[0011] It can be understood that if the distribution of quantization step length is relatively concentrated, the difference in quantization step lengths corresponding to QPs of similar sizes is relatively small, which will cause the code stream output by the encoder to have a relatively small bit rate fluctuation. On the contrary, if the distribution of quantization step length is relatively sparse, the difference in quantization step lengths corresponding to QPs of similar sizes is relatively large, which will cause the code stream output by the encoder to have a relatively large bit rate fluctuation, affecting the compression performance of the encoder. Moreover, when the quantization step length is relatively large, if the quantization step length increases a lot, the quantization becomes coarser, and the quantization distortion also suddenly increases, affecting the quality of the decoded image. If the rate of change of the quantization step length with the QP is the smallest, it means that the distribution of the quantization step length is the most concentrated, and the difference in quantization step lengths corresponding to QPs of similar sizes is the smallest, which will cause the code stream output by the encoder to have a relatively small bit rate fluctuation.
[0012] In another possible implementation, if the first parameter includes a predicted quantization step or an index value of a predicted quantization step, then the above-mentioned determining a target corresponding relationship among multiple corresponding relationships based on the first parameter includes: if the predicted quantization step value is within a first quantization step interval, or the index value of the predicted quantization step indicates the first quantization step interval, then determining a second corresponding relationship among the multiple corresponding relationships as the target corresponding relationship, wherein, among the multiple corresponding relationships, the rate of change of the quantization step within the first quantization step interval in the second corresponding relationship is the smallest; wherein the first quantization step interval is one of the multiple quantization step intervals, and the multiple quantization step intervals are divided based on the possible value range of the quantization step to obtain multiple quantization step value intervals.
[0013] In another possible implementation, the obtaining of the first parameter of the block to be decoded includes: obtaining first historical parameters of one or more reconstructed image blocks around the block to be decoded, the first historical parameters including one or more of a historical quantization step size, QP value, bit depth, mode information, target pixel depth (bits per pixel, BPP), and texture complexity of one or more reconstructed image blocks around the block to be decoded; and determining the first parameter according to the first historical parameters.
[0014] It can be understood that in this implementation, the first parameter of the block to be decoded may be determined based on relevant information of one or more reconstructed image blocks around the block to be decoded.
[0015] In another possible implementation, if the first parameter includes a predicted quantization step size, then determining the first parameter based on the first historical parameter includes: determining the mean, median or mode of the historical quantization step sizes of the one or more reconstructed image blocks as the predicted quantization step size.
[0016] In another possible implementation, if the first parameter includes an index value of a predicted quantization step, then the above-mentioned determining the first parameter based on the first historical parameter includes: determining an index value of a quantization step value interval in which a historical quantization step of one or more reconstructed image blocks is located, the quantization step interval being one of a plurality of quantization step intervals, and the plurality of quantization step intervals are divided based on a range of possible values of the quantization step to obtain a plurality of quantization step value intervals; determining an index value of the predicted quantization step based on the obtained one or more index values.
[0017] In another possible implementation, the above-mentioned determining the target corresponding relationship among multiple corresponding relationships includes: parsing the code stream of the block to be decoded to obtain an identifier of the target corresponding relationship; and determining the target corresponding relationship among multiple corresponding relationships based on the identifier of the target corresponding relationship, and the target corresponding relationship is used to determine the target quantization step size of the block to be decoded during inverse quantization.
[0018] In another possible implementation, if the block to be decoded is the first image block in the decoding order of the current image frame, a target correspondence relationship is determined among multiple correspondence relationships, including: parsing the code stream of the current image frame to obtain an identifier of the target correspondence relationship; and determining the target correspondence relationship among the multiple correspondence relationships according to the identifier of the target correspondence relationship, wherein the target correspondence relationship is used to determine a target quantization step size during inverse quantization of all image blocks to be decoded in the current image frame.
[0019] In another possible implementation, if the block to be decoded is the first image block in the decoding order of the current image frame, a target corresponding relationship is determined among multiple corresponding relationships, including: obtaining a second historical parameter of the decoded image frame, the second historical parameter including one or more of the bit depth, target pixel depth, and texture complexity of the decoded image frame; determining the target corresponding relationship among multiple corresponding relationships based on the second historical parameter; or obtaining an image parameter of the current image frame, the image parameter including one or more of the bit depth, target pixel depth, and texture complexity of the current image frame; and determining the target corresponding relationship among multiple corresponding relationships based on the image parameter.
[0020] It can be understood that in this implementation, the decoding end can directly obtain the identifier of the target correspondence relationship by parsing the bit stream, and the determination process is simple and direct, which can save computing costs.
[0021] In yet another possible implementation, the block to be decoded is not the first image block in the decoding order of the current image frame, and the above-mentioned determination of the target corresponding relationship includes: determining the corresponding relationship adopted by the reconstructed image blocks in the current image frame as the target corresponding relationship.
[0022] In yet another possible implementation, the multiple corresponding relationships include multiple quantization curves, where the quantization curve is a quantization step-QP variation curve.
[0023] It can be understood that the corresponding relationship between multiple quantization step sizes and multiple QP values can be represented by a quantization step size-QP change curve.
[0024] In yet another possible implementation, the quantization curve includes a segmented curve and a smooth curve.
[0025] In another possible implementation, the quantization step size in the smooth curve changes uniformly with the QP value, or the rate of change of the quantization step size with the QP when the quantization step size in the smooth curve is less than a first threshold is less than or greater than the rate of change of the quantization step size with the QP when the quantization step size is greater than a second threshold; wherein the second threshold is greater than or equal to the first threshold.
[0026] In another possible implementation, the quantization step size satisfies the following relationship:
[0027] Q step =p×2 n
[0028] Among them, Q step is the above quantization step size, p is a positive odd number, and n is an integer.
[0029] It can be understood that in this implementation, the number and size of the possible values of the quantization step can be controlled by a preset formula. Furthermore, according to the above formula, the required hardware cost can be reduced by reducing the number of values of p.
[0030] In a second aspect, an embodiment of the present application provides an image decoding method, which is applied to a decoding end, and the method includes: obtaining a quantization parameter QP value of a block to be decoded; determining a target quantization step size according to the QP value, wherein the target quantization step size satisfies a preset set, and the preset set includes at least one preset quantization step size value; dequantizing the block to be decoded according to the target quantization step size; and reconstructing the dequantized block to be decoded to obtain a reconstructed image block.
[0031] In a possible implementation, the at least one preset quantization step size may take a value that satisfies the following relationship:
[0032] Q step =p×2 n
[0033] Among them, Q step is the target quantization step size, p is a positive odd number, and n is an integer.
[0034] In a third manner, an embodiment of the present application provides an image encoding method, which is applied to an encoding end, and the method includes: obtaining a quantization parameter QP value of a block to be encoded; determining a target corresponding relationship among multiple corresponding relationships; the corresponding relationship is used to indicate the corresponding relationship between different QP values and quantization step sizes, and the corresponding relationships indicated by each two corresponding relationships in the multiple corresponding relationships are different, wherein, among the multiple corresponding relationships, the target corresponding relationship has the smallest rate of change of the quantization step size within a preset interval including the QP value; determining the target quantization step size according to the QP value and the target corresponding relationship; quantizing the block to be encoded according to the target quantization step size; encoding the quantized block to be encoded to obtain a code stream of the block to be encoded.
[0035] In a possible implementation, the above-mentioned determining the target corresponding relationship among multiple corresponding relationships includes: obtaining a first parameter of the block to be encoded, the first parameter including any one of a QP value, a predicted quantization step, or an index value of the predicted quantization step, the index value of the predicted quantization step being used to indicate a value range of the predicted quantization step; and determining the target corresponding relationship among multiple corresponding relationships according to the first parameter.
[0036] In another possible implementation, if the first parameter includes a QP value, the above-mentioned determining a target corresponding relationship among multiple corresponding relationships based on the first parameter specifically includes: if the QP value is within a first QP interval, determining a first corresponding relationship among the multiple corresponding relationships as the target corresponding relationship, wherein a rate of change of a quantization step determined based on the first corresponding relationship among the multiple corresponding relationships and the QP value in the first QP interval is the smallest; wherein the first QP interval is one of the multiple QP intervals, and the multiple QP intervals are multiple QP value intervals obtained by dividing the possible value range of QP.
[0037] In another possible implementation, if the first parameter includes a predicted quantization step or an index value of a predicted quantization step, then the above-mentioned determination of a target corresponding relationship among multiple corresponding relationships based on the first parameter specifically includes: if the predicted quantization step value is within a first quantization step interval, or the index value of the predicted quantization step indicates the first quantization step interval, then determining a second corresponding relationship among the multiple corresponding relationships as the target corresponding relationship, wherein, among the multiple corresponding relationships, the rate of change of the quantization step within the first quantization step interval in the second corresponding relationship is the smallest; wherein the first quantization step interval is one of the multiple quantization step intervals, and the multiple quantization step intervals are divided based on the possible value range of the quantization step to obtain multiple quantization step value intervals.
[0038] In another possible implementation, the above-mentioned obtaining the first parameter of the block to be encoded specifically includes: obtaining first historical parameters of one or more encoded image blocks around the block to be encoded, the first historical parameters including one or more of the historical quantization step size, QP value, bit depth, mode information, target pixel depth and texture complexity of one or more encoded image blocks around the block to be decoded; determining the first parameter according to the first historical parameters.
[0039] In another possible implementation, if the first parameter includes a predicted quantization step size, then determining the first parameter based on the first historical parameter specifically includes: determining the mean, median or mode of the historical quantization step sizes of one or more encoded image blocks as the predicted quantization step size.
[0040] In another possible implementation, if the first parameter includes an index value of a predicted quantization step, then the above-mentioned determining the first parameter based on the first historical parameter specifically includes: determining the index value of a quantization step value interval in which a historical quantization step of one or more encoded image blocks is located, the quantization step interval being one of a plurality of quantization step intervals, and the plurality of quantization step intervals being a plurality of quantization step value intervals obtained by dividing the quantization step value range based on the quantization step value range; determining the index value of the predicted quantization step based on the obtained one or more index values.
[0041] In another possible implementation, the method further includes: obtaining an identifier of the target correspondence relationship; encoding the identifier of the target correspondence relationship, wherein the code stream of the block to be encoded includes the identifier of the target correspondence relationship, and the target correspondence relationship is used to determine a target quantization step size when quantizing the block to be encoded.
[0042] In another possible implementation, if the block to be encoded is the first image block in the encoding order of the current image frame, the method further includes: obtaining an identifier of the target correspondence relationship; encoding the identifier of the target correspondence relationship, the code stream of the current image frame includes the identifier of the target correspondence relationship, and the target correspondence relationship is used to determine the target quantization step size of all image blocks to be encoded in the current image frame during quantization.
[0043] In another possible implementation, if the block to be encoded is the first image block in the encoding order of the current image frame, then the above-mentioned determination of the target corresponding relationship among multiple corresponding relationships specifically includes: obtaining a second historical parameter of the encoded image frame, the second historical parameter including one or more of the bit depth, target pixel depth and texture complexity of the encoded image frame; determining the target corresponding relationship among multiple corresponding relationships based on the second historical parameter; or, obtaining an image parameter of the current image frame, the image parameter including one or more of the bit depth, target pixel depth and texture complexity of the current image frame; and determining the target corresponding relationship among multiple corresponding relationships based on the image parameter.
[0044] In another possible implementation, if the block to be encoded is not the first image block in the encoding order of the current image frame, then the above-mentioned determining the target corresponding relationship specifically includes: determining the corresponding relationship adopted by the encoded image blocks in the current image frame as the target corresponding relationship.
[0045] In yet another possible implementation, the plurality of corresponding relationships include a plurality of quantization curves, where the quantization curve is a quantization step-QP variation curve, and the quantization curve includes a segmented curve or a smooth curve.
[0046] In another possible implementation, the quantization step size in the continuous curve changes uniformly with the QP value, or the rate of change of the quantization step size with the QP when the quantization step size in the continuous curve is less than a first threshold is less than or greater than the rate of change of the quantization step size with the QP when the quantization step size is greater than a second threshold; wherein the second threshold is greater than or equal to the first threshold.
[0047] In another possible implementation, the quantization step size satisfies the following relationship:
[0048] Q step =p×2 n
[0049] Among them, Q step is the quantization step size, p is a positive odd number, and n is an integer.
[0050] The image decoding method provided by the third aspect and any possible implementation thereof corresponds to the image encoding method provided by the first aspect and any possible implementation thereof. Therefore, the beneficial effects of the technical solution provided by the third aspect and any possible implementation thereof can be referred to the description of the beneficial effects of the corresponding method in the first aspect and will not be repeated here.
[0051] In a fourth aspect, an embodiment of the present application also provides an image encoding method, which is applied to a decoding end, and the method includes: obtaining a quantization parameter QP value of a block to be encoded; determining a target quantization step size according to the QP value, wherein the target quantization step size belongs to a preset set, and the preset set includes at least one preset quantization step size value; determining the target quantization step size according to a correspondence between the QP value and the target; quantizing the block to be encoded according to the target quantization step size; encoding the quantized block to be encoded to obtain a code stream of the block to be encoded.
[0052] In a possible implementation, the at least one preset quantization step size may take a value that satisfies the following relationship:
[0053] Q step =p×2 n
[0054] Among them, Qstep is the target quantization step size, p is a positive odd number, and n is an integer.
[0055] The image decoding method provided by the fourth aspect and any possible implementation thereof corresponds to the image encoding method provided by the second aspect and any possible implementation thereof. Therefore, the beneficial effects of the technical solution provided by the fourth aspect and any possible implementation thereof can be referred to the description of the beneficial effects of the corresponding method in the second aspect and will not be repeated here.
[0056] In a fifth aspect, the present application provides an image decoding device. The decoding device may be a video decoder or a device including a video decoder. The decoding device includes various modules for implementing the method provided in any possible implementation of the first aspect or the second aspect. The decoding device has the function of implementing the behavior in the above-mentioned related method instance. The function may be implemented by hardware, or by hardware executing corresponding software implementation. The hardware or software includes one or more modules corresponding to the above-mentioned functions. The beneficial effects thereof can be found in the description of the corresponding method, which will not be repeated here.
[0057] In a sixth aspect, the present application provides an image encoding device. The encoding device may be a video encoder or a device including a video encoder. The encoding device includes various modules for implementing the method in any possible implementation of the third aspect or the fourth aspect. The encoding device has the function of implementing the behavior in the above-mentioned related method instance. The function may be implemented by hardware, or by hardware executing corresponding software implementation. The hardware or software includes one or more modules corresponding to the above-mentioned functions. The beneficial effects thereof can be found in the description of the corresponding method, which will not be repeated here.
[0058] In a seventh aspect, 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 a method of any one of the implementation modes of the first to fourth aspects.
[0059] For example, the electronic device may refer to a video encoder, or a device including a video encoder.
[0060] For another example, the electronic device may refer to a video decoder, or a device including a video decoder.
[0061] In an eighth aspect, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a computing device or a storage system where the computing device is located, a method of implementing any one of the first to fourth aspects is implemented.
[0062] In a ninth aspect, 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 a method according to any one of the implementation methods of the first to fourth aspects.
[0063] In a tenth aspect, the present application provides a chip comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory to implement a method of any one of the implementation modes in the first to fourth aspects.
[0064] In the eleventh aspect, an embodiment of the present application provides a coding and decoding system, which video decoding system includes an encoding end and a decoding end, the decoding end is used to implement the method described in the first aspect or the second aspect and any one of their possible implementations, and the encoding end is used to implement the method described in the third aspect or the fourth aspect and any one of their possible implementations.
[0065] Based on the implementations provided in the above aspects, the present application can be further combined to provide more implementations. In other words, any possible implementation of any of the above aspects can be applied to other aspects without conflict, thereby obtaining a new embodiment. For example, any image decoding method provided in the first and second aspects can be combined in pairs or in three aspects without conflict, thereby obtaining a new image decoding method. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 A schematic diagram of the architecture of a coding and decoding system 1 used in an embodiment of the present application;
[0067] Figure 2 is a schematic block diagram of an example of an encoder 100 for implementing the method according to an embodiment of the present application;
[0068] Figure 3 A schematic diagram of a corresponding relationship between an image, a parallel coding unit, an independent coding unit, and a coding unit provided in an embodiment of the present application;
[0069] Figure 4 is a schematic block diagram of an example of a decoder 200 for implementing the method according to an embodiment of the present application;
[0070] Figure 5 A flowchart of an image decoding method provided in an embodiment of the present application;
[0071] Figure 6 A schematic diagram of the relationship between the current QG and blocks A and B provided in an embodiment of the present application;
[0072] Figure 7The quantization curve provided in the embodiment of the present application is shown as follows: Figure 1 ;
[0073] Figure 8 The quantization curve provided in the embodiment of the present application is shown as follows: Figure 2 ;
[0074] Fig. 9 A schematic diagram of a flow chart of another image decoding method provided in an embodiment of the present application;
[0075] Fig.10 A schematic diagram of a flow chart of another image decoding method provided in an embodiment of the present application;
[0076] Fig.11 A schematic diagram of a flow chart of another image decoding method provided in an embodiment of the present application;
[0077] Fig.12 A schematic diagram of a flow chart of an image encoding method provided in an embodiment of the present application;
[0078] Fig.13 A flowchart of another image encoding method provided in an embodiment of the present application
[0079] Fig.14 A schematic diagram of the structure of a decoding device 1400 provided in an embodiment of the present application;
[0080] Fig.15 A schematic diagram of the structure of another decoding device 1500 provided in an embodiment of the present application;
[0081] Fig.16 A schematic diagram of the structure of an encoding device 1600 provided in an embodiment of the present application;
[0082] Fig.17 A schematic diagram of the structure of another encoding device 1700 provided in an embodiment of the present application;
[0083] Fig.18 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0084] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0085] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "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. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0086] It should be noted that, in this 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 this 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.
[0087] The following describes the system architecture used in the embodiments of the present application.
[0088] See also Figure 1 , Figure 1 FIG. 1 shows a schematic diagram of the architecture of the encoding and decoding system 1 used in the embodiment of the present application. Figure 1 As shown, the coding and decoding system 1 may include an encoding end 10 and a decoding end 20. The encoding end 10 generates encoded video data. Therefore, the encoding end 10 may be referred to as a video encoding device. The decoding end 20 may decode the encoded video data generated by the encoding end 10. Therefore, the decoding end 20 may be referred to as a video decoding device.
[0089] The specific forms of the encoding end 10 and the decoding end 20 can be 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.
[0090] Optional, Figure 1 The encoding end 10 and the decoding end 20 in the embodiment may be two separate devices. Alternatively, the encoding end 10 and the decoding end 20 may be the same device, that is, the encoding end 10 or the corresponding functions and the decoding end 20 or the corresponding functions may be integrated on the same device.
[0091] The encoding end 10 and the decoding end 20 may communicate with each other. For example, 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.
[0092] Optionally, the encoder 10 can output the encoded data from the output interface 140 to a built-in or external storage device. The storage device may include any of a variety of distributed or locally accessed data storage media, such as a hard disk drive, a Blu-ray disc, a digital video disc (DVD), a compact disc read-only memory (CD-ROM), a flash memory, a volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data.
[0093] like Figure 1 As shown, the encoding end 10 includes a video source 120, an 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. The encoder 100 may encode the video data from the video source 120. In some examples, the encoding end 10 transmits the encoded video data directly to the decoding end 20 via the output interface 140. In other examples, the encoded video data may also be stored on a storage device for later access by the decoding end 20 for decoding and / or playback.
[0094] like Figure 1As shown, the decoding end 20 includes an input interface 240, a 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 a storage device. The display device 220 can be integrated with the decoding end 20 or can be outside 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.
[0095] although Figure 1 Not shown, but in some aspects, encoder 100 and decoder 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.
[0096] It should be understood that Figure 1 The illustrated codec system 1 is only an example, and the techniques of the present application may be applicable to video coding arrangements (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 a local memory, streamed over a network, and the like. 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.
[0097] Below is a description of the drawings. Figure 1 The specific structures of the encoder 100 and decoder 200 are briefly introduced.
[0098] See also Figure 2 , Figure 2 1 is a schematic block diagram of an example of an encoder 100 for implementing the method of the embodiment of the present application. Figure 2As shown, the encoder 100 includes a prediction processing unit 101, a residual calculation unit 102, a residual transformation unit 103, a quantization unit 104, a coding unit 105, an inverse quantization unit (also referred to as an inverse quantization unit) 106, a residual inverse transformation unit 107, a reconstruction unit (or referred to as a reconstruction unit) 108, and a filter unit 109. Optionally, the encoder 100 may further include a buffer and a decoded image buffer. The buffer is used to cache the reconstructed block (or reconstructed block) output by the reconstruction unit 108, and the decoded image buffer is used to cache the filtered image block output by the filter unit 109.
[0099] In one example, the input of the encoder 100 is an image block of an image to be encoded (ie, a block to be encoded or a coding unit).
[0100] In another example, the input of the encoder 100 is an image to be encoded, and the encoder 100 may further include a segmentation unit ( Figure 2 The encoder 100 is used to encode the multiple image blocks of the image to be encoded block by block, thereby completing the encoding of the image to be encoded. For example, the encoder 100 performs an encoding process on each image block, thereby completing the encoding of the image to be encoded.
[0101] Exemplarily, a method for dividing a to-be-encoded image into a plurality of image blocks may include:
[0102] Step 11: Divide a frame of image into one or more non-overlapping parallel coding units. The parallel coding units have no dependency relationship and can be encoded and decoded in parallel / independently.
[0103] Step 12: For each parallel coding unit, the encoding end may divide it into one or more independent coding units that do not overlap each other. The independent coding units may not depend on each other, but may share some information of the parallel coding unit.
[0104] Step 13: For each independent coding unit, the encoding end may further divide it into one or more non-overlapping coding units. If the independent coding unit is divided into multiple non-overlapping coding units, the division method may be a horizontal equal division method, a vertical equal division method, or a horizontal and vertical equal division method. Of course, the specific implementation is not limited to this. The coding units in the independent coding unit may be interdependent, that is, they may refer to each other during the process of executing the prediction step.
[0105] The width of the coding unit is w_cu, and the height is h_cu. Optionally, the width is greater than the height (unless it is an edge area). Usually, the coding unit can be a fixed w_cu×h_cu, where w_cu and h_cu are both 2N powers (N is greater than or equal to 0), such as 16×4, 8×4, 16×2, 8×2, 4×2, 8×1, 4×1, etc.
[0106] The coding unit may 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 may be exactly the same or different, which is related to the image input format.
[0107] like Figure 3 , which is a schematic diagram of the correspondence between an image, a parallel coding unit, an independent coding unit, and a coding unit. Figure 3 In the description, an example is taken in which an image is divided into parallel coding unit 1 and parallel coding unit 2 according to 3:1, and an independent coding unit includes 4 coding units.
[0108] Optionally, the segmentation unit divides the image to be encoded into a plurality of image blocks, which may be further segmented into smaller blocks, such as image block segmentation based on a quadtree structure or a binary tree structure. In addition, the segmentation may also include segmentation into slices, tiles or other larger units. The slice may be divided into a plurality of image blocks (or may be divided into a set of image blocks called tiles).
[0109] The prediction processing unit 101 is used to receive or obtain the real value of the block to be encoded and the reconstructed image data, and predict the block to be encoded based on the relevant data in the reconstructed image data to obtain a predicted block of the block to be encoded.
[0110] Optionally, the prediction processing unit 101 may include an inter-frame predictor and an intra-frame predictor. The inter-frame predictor may be used to determine the inter-frame prediction mode used to encode the block to be encoded, and based on the determined inter-frame prediction mode, predict the motion information of one or more sub-blocks in the current image block, such as a motion vector (MV), and use the motion information of one or more sub-blocks in the current image block (such as a motion vector) to obtain or generate a prediction block of the current image block. The intra-frame predictor may determine the intra-frame prediction mode used to encode the block to be encoded.
[0111] Among them, intra-frame prediction refers to using the correlation of the video spatial domain to predict using the coded block (codingblock, CB) of the current block to achieve the purpose of removing video spatial redundancy. Exemplarily, intra-frame prediction specifies multiple prediction modes, each of which corresponds to a texture direction (except DC mode). For example, if the image texture is arranged horizontally, the horizontal prediction mode can better predict the image information.
[0112] Inter-frame prediction refers to the use of adjacent coded image pixels to predict the pixels of the current image based on the correlation of the video time domain. Since the video sequence contains strong temporal correlation, it can effectively remove the temporal redundancy of the video. The inter-frame prediction part of the video coding standard uses block-based motion compensation technology. The main principle is to find a best matching block in the previously coded image for each pixel block of the current image. This process is called motion estimation (ME).
[0113] In addition, in the inter-frame prediction mode, a motion vector can be used to represent the relative displacement between the current coding block and the best matching block in its reference image. Each divided block has a corresponding motion vector transmitted to the decoding end. If the motion vector of each block is independently encoded and transmitted, especially when it is divided into small-sized blocks, it will consume a considerable number of bits. In order to reduce the number of bits used to encode the motion vector, the spatial correlation between adjacent image blocks is used to predict the motion vector of the current block to be encoded based on the motion vector of the adjacent encoded block, and then the prediction difference is encoded. In this way, the number of bits representing the motion vector can be effectively reduced. In the process of encoding the motion vector of the current block, the motion vector of the adjacent encoded block is first used to predict the motion vector of the current block, and then the difference (motion vector difference, MVD) between the predicted value of the motion vector (motion vector prediction, MVP) and the true estimate of the motion vector is encoded, thereby effectively reducing the number of encoding bits of the MV.
[0114] The residual calculation unit 102 is used to calculate the residual value between the real value of the block to be encoded and the predicted block of the block to be encoded to obtain the residual block. For example, by subtracting the pixel value of the predicted block from the real pixel value of the block to be encoded pixel by pixel.
[0115] In one example, the residual transform unit 103 is used to determine the residual coefficient based on the residual block. Optionally, in this process, it can include: transforming the residual block, such as discrete cosine transform (DCT) or discrete sine transform (DST), to obtain transform coefficients in the transform domain, and the transform coefficients can also be called transform residual coefficients or residual coefficients, and the residual coefficients can represent the residual block in the transform domain. Of course, the encoder 100 may not include the step of residual transform in the process of encoding the block to be encoded.
[0116] The quantization unit 104 is used to quantize the transform coefficients or residual values by applying scalar quantization or vector quantization to obtain quantized residual coefficients (or quantized residual values). The quantization process can reduce the bit depth associated with some or all of the residual coefficients. For example, a p-bit transform coefficient can be rounded down to a q-bit transform coefficient during quantization, where p is greater than q. The degree of quantization can be modified by adjusting a quantization parameter (QP). For example, for scalar quantization, different scales can be applied to achieve finer or coarser quantization. A smaller quantization step size corresponds to finer quantization, while a larger quantization step size corresponds to coarser quantization. The appropriate quantization step size can be indicated by the QP.
[0117] Among them, in the image encoding process, in order to achieve image compression, the residual block of the block to be encoded is usually quantized, or the residual coefficient block obtained after a certain processing of the residual block is quantized, so that the quantized residual block or residual coefficient block can be encoded with fewer bits. It can be understood that the residual block is a residual value block obtained based on the original pixel block and the prediction block of the block to be encoded, and the residual coefficient block is a coefficient block obtained after a certain processing and transformation of the residual block.
[0118] As an example, taking the encoder 100 quantizing the residual block as an example, the encoder 100 can divide each residual value in the residual block of the to-be-encoded block by a quantization coefficient to reduce the residual value in the residual block. In this way, compared with the residual value that has not been quantized, the residual value that has been reduced after quantization can be encoded with fewer bits, thus achieving compression encoding of the image.
[0119] The encoding unit 105 is used to encode the above-mentioned quantized residual coefficients (or quantized residual values), and output the encoded image data (i.e., the encoding result of the current block to be encoded) in the form of an encoded bit stream (or code stream), and then the encoded bit stream can be transmitted to the decoder, or stored and subsequently transmitted to the decoder or used for retrieval. The encoding unit 105 can also be used to encode the syntax elements of the block to be encoded, such as encoding the prediction mode adopted by the block to be encoded into the code stream, etc.
[0120] In one example, the coding unit 105 encodes the residual coefficient, and a feasible method is: semi-fixed length coding. First, the maximum value of the absolute value of the residual in a residual block (RB) is defined as modifiedmaximum(mm). Determine the number of coding bits for the residual coefficient in the RB (the number of coding bits for the residual coefficient in the same RB is consistent). For example, if the CL of the current RB 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 previous RB 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; 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.
[0121] Of course, other residual coefficient encoding methods may also be used, such as an exponential Golomb encoding method, a Golomb-Rice encoding method, a truncated unary code encoding method, a run-length encoding method, directly encoding the original residual value, and the like.
[0122] In addition, for some special cases, the original value can be directly encoded instead of the residual value.
[0123] The inverse quantization unit 106 is used to inverse quantize the above-mentioned quantized residual coefficient (or quantized residual value) to obtain an inverse quantized residual coefficient (inverse quantized residual value). The inverse quantization is the reverse application of the above-mentioned quantization unit 104, for example, based on or using the same quantization step size as the quantization unit 104, applying an inverse quantization scheme of the quantization scheme applied by the quantization unit 104.
[0124] The residual inverse transform unit 107 is used to inverse transform (or inverse transform) the above-mentioned inverse quantized residual coefficients to obtain a reconstructed residual block. Optionally, the inverse transform may include an inverse discrete cosine transform (discrete cosine transform, DCT) or an inverse discrete sine transform (discrete sine transform, DST). In this way, the inverse transform value obtained after the inverse transform (or inverse transform) of the above-mentioned inverse quantized residual coefficients is the residual value reconstructed in the pixel domain (or sample domain). That is, after the inverse quantized residual coefficient block is inversely transformed by the residual inverse transform unit 107, the block obtained is the reconstructed residual block. Of course, when the above-mentioned residual change unit 103 is not included in the encoder 100, the encoder 100 may also not include the inverse transform step.
[0125] The reconstruction unit 108 is used to add the reconstructed residual block to the prediction block to obtain a reconstructed block in the sample domain. The reconstruction unit 108 can be a summer. For example, the reconstruction unit 108 adds the residual value in the reconstructed residual block to the prediction value of the corresponding pixel in the prediction block to obtain the reconstructed value of the corresponding pixel. The reconstructed block output by the reconstruction unit 108 can be subsequently used to predict other image blocks to be encoded.
[0126] The filter unit 109 (or simply “filter”) is used to filter the reconstructed block to obtain a filtered block, so as to smoothly perform pixel conversion or improve image quality.
[0127] In one example, an encoding process implemented by the encoder 100 may include the following steps:
[0128] Step 21: The prediction processing unit 101 determines a prediction mode, and predicts the block to be encoded based on the determined prediction mode and the reconstructed block of the encoded image block to obtain a prediction block of the block to be encoded.
[0129] The reconstructed block of the encoded image block is obtained after the inverse quantization unit 106, the residual inverse transformation unit 107 and the reconstruction unit 108 sequentially process the quantized residual coefficient block of the encoded image block.
[0130] Step 22: The residual calculation unit 102 obtains a residual block of the block to be encoded based on the original pixel values of the prediction block and the block to be encoded;
[0131] Step 23: The residual transform unit 103 transforms the residual block to obtain a residual coefficient block.
[0132] Step 24: The quantization unit 104 quantizes the residual coefficient block to obtain a quantized residual coefficient block.
[0133] Step 25: The encoding unit 105 encodes the quantized residual coefficient block and encodes related syntax elements (such as prediction mode, encoding mode) to obtain a code stream of the block to be encoded.
[0134] See also Figure 4 , Figure 4 A schematic block diagram of an example of a decoder 200 for implementing the method of an embodiment of the present application is shown. The decoder 200 is used to receive image data (i.e., an encoded bit stream, e.g., an encoded bit stream including an image block and associated syntax elements) encoded by the encoder 200 to obtain a decoded image block.
[0135] like Figure 4 As shown, the decoder 200 includes a code stream parsing unit 201, a dequantization unit 202, a residual inverse transform unit 203, a prediction processing unit 204, a reconstruction unit 205, and a filter unit 206. In some examples, the decoder 200 may perform substantially the same Figure 2 The decoding process is the inverse of the encoding process described by the encoder 100. Optionally, the decoder 200 may further include a buffer and a filtered image buffer, wherein the buffer is used to cache the reconstructed image blocks output by the reconstruction unit 205, and the filtered image buffer is used to cache the filtered image blocks output by the filter unit 206.
[0136] The code stream parsing unit 201 is used to decode the encoded bit stream to obtain quantized residual coefficients (or quantized residual values) and / or decoding parameters (for example, the decoding parameters may include any one or all of the inter-frame first parameters, intra-frame first parameters, filter parameters and / or other syntax elements performed by the encoding side). The code stream parsing unit 201 is also used to forward the above decoding parameters to the prediction processing unit 204, so that the prediction processing unit 204 performs a prediction process according to the decoding parameters.
[0137] The function of the inverse quantization unit 202 may be the same as that of the inverse quantization unit 106 of the encoder 100 , and is used to inverse quantize (ie, inverse quantize) the quantized residual coefficients decoded and output by the bitstream parsing unit 201 .
[0138] Among them, inverse quantization is the reverse process of quantization, and inverse quantization refers to mapping the quantized coefficients into a reconstructed signal in the input signal space, and the reconstructed signal is an approximation of the input signal. In order to reconstruct the image block from the compressed and encoded bitstream, the inverse quantization unit 202 of the decoder 200 can inverse quantize the residual block or residual coefficient block parsed from the bitstream, so as to reconstruct the unquantized residual block or residual coefficient block corresponding to the image block, and then, the decoder 200 reconstructs the image block according to the reconstructed residual block or residual coefficient block, so as to obtain the reconstructed block of the image.
[0139] As an example, taking the residual block after the decoder 200 parses the to-be-decoded block from the bitstream and quantizes it as an example, the decoder 200 can dequantize the residual block through the dequantization unit 202. Specifically, the encoding end can multiply each residual value in the parsed residual block by a quantization coefficient to reconstruct the residual value in the unquantized residual block corresponding to the to-be-decoded block, thereby obtaining a reconstructed residual block. Among them, the quantization coefficient is the quantization coefficient when the encoding device quantizes the residual block of the to-be-decoded block when encoding the to-be-decoded block. In this way, the decoder 200 can realize the reconstruction of the to-be-decoded block based on the residual block reconstructed after dequantization, and obtain the reconstructed block of the to-be-decoded block.
[0140] The function of the residual inverse transform unit 203 may be the same as that of the residual inverse transform unit 107 of the encoder 100, and is used to perform an inverse transform (e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) on the above-mentioned dequantized residual coefficients to obtain a reconstructed residual value. The block obtained by the inverse transform is the residual block of the reconstructed block to be decoded in the pixel domain.
[0141] The function of the reconstruction unit 205 (eg, a summer) may be the same as that of the reconstruction unit 108 of the encoder 100 .
[0142] The prediction processing unit 204 is used to receive or obtain the encoded image data (for example, the encoded bit stream of the current image block) and the reconstructed image data. The prediction processing unit 204 can also receive or obtain relevant parameters of the prediction mode and / or information about the selected prediction mode (that is, the above-mentioned decoding parameters) from, for example, the bit stream parsing unit 202, and predict the current image block based on the relevant data and decoding parameters in the reconstructed image data to obtain a prediction block of the current image block.
[0143] The reconstruction unit 205 is used to add the reconstructed residual block to the prediction block to obtain a reconstructed block of the image to be decoded in the sample domain, for example, adding the residual value in the reconstructed residual block to the prediction value in the prediction block.
[0144] The filter unit 206 is configured to filter the reconstructed block to obtain a filtered block, where the filtered block is a decoded image block.
[0145] Specifically, in the embodiment of the present application, the decoder 200 is used to implement the decoding method described in the embodiments below.
[0146] It should be understood that in the encoder 100 and decoder 200 of the embodiment of the present application, the processing result of a certain link can also be output to the next link after further processing. For example, after the interpolation filtering, motion vector derivation or filtering links, the processing results of the corresponding links are further subjected to operations such as Clip or shift.
[0147] In an example, a decoding process implemented by the decoder 200 may include the following steps:
[0148] Step 31: The code stream parsing unit 201 parses the prediction mode and the residual coding mode;
[0149] Step 32: The code stream parsing unit 201 parses quantization related values (such as near values, or QP values, etc.) based on the prediction mode and the residual coding mode;
[0150] Step 33: The inverse quantization unit 202 analyzes the residual coefficients based on the prediction mode and the quantization correlation value;
[0151] Step 34: The prediction processing unit 204 obtains the prediction value of each pixel of the current image block based on the prediction mode;
[0152] Step 35: The residual value decoding unit 203 inversely transforms the residual coefficients to reconstruct the residual values of each pixel of the current image block;
[0153] Step 36: The reconstruction unit 205 obtains the reconstructed value of each pixel in the current coding unit based on the predicted value and residual value of each pixel.
[0154] Figure 1 to Figure 4 These are merely examples provided for the embodiments of the present application. In some examples, the encoder 100, the decoder 200, and the encoding and decoding system 1 may include more or fewer components or units, and the present application does not limit this.
[0155] The following image encoding and decoding method provided in the embodiment of the present application is described in conjunction with the accompanying drawings.
[0156] Figure 5 The following is a flow chart of an image decoding method provided by the present application. Optionally, the image decoding method can be applied to Figure 1 In the coding and decoding system 1 shown, the image decoding method can be executed by the decoding end 20. Specifically, the decoding method can be executed by the 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:
[0157] S101. The decoding end obtains a QP value of a block to be decoded.
[0158] Optionally, the decoding end may obtain the QP value corresponding to the block to be decoded based on the bitstream of the video to be decoded. The block to be decoded may be referred to as a decoding unit. Generally, when decoding an image frame in the video to be decoded, decoding is performed in units of decoding units.
[0159] It can be understood that the video stream to be decoded can be a code stream received by the decoding end from the encoding end, or a code stream obtained from other devices, such as a code stream obtained from a storage device, and the embodiment of the present application is not limited to this.
[0160] In a possible implementation, the decoding end can parse the bitstream of the block to be decoded to obtain the QP value of the block to be decoded based on the bitstream of the video to be decoded by using a decoding method corresponding to the encoding end.
[0161] Optionally, the encoder may directly encode the QP value of an image block using a truncated unary code, a truncated Rice code, or an exponential Golomb code. Correspondingly, the decoder at the decoding end may parse the QP value of the image block (block to be decoded) from the bitstream using a decoding method corresponding to the encoding method used by the encoding end.
[0162] In another possible implementation, the decoder can also parse the code stream of the block to be decoded to obtain the QP offset of the block to be decoded based on the code stream of the video to be decoded, through a decoding method corresponding to the encoder. In this case, the QP value is encoded using a predictive encoding method, that is, the encoder encodes the difference between the actual QP and the predicted QP, that is, the QP offset. Thus, the decoder can determine the predicted QP value, and determine the QP value based on the predicted QP value and the actual QP and predicted QP offset obtained by parsing the code stream.
[0163] Optionally, when the decoding end parses the code stream of the block to be decoded to obtain the QP offset of the block to be decoded, the specific process of the decoding end obtaining the QP value of the block to be decoded can be implemented as the following steps S1 to S3:
[0164] S1. The decoding end obtains the predicted QP value of the block to be decoded.
[0165] Optionally, the decoding end may obtain a predicted QP value of a current quantization group (QG).
[0166] There is no fixed size relationship between the decoding unit and the QG. In the same frame image, the QG can be of a fixed size, and the decoding unit can be adaptively divided according to the image content. Therefore, a QG can be larger than the image block corresponding to a decoding unit, that is, the decoding unit is an image block in the QG. Alternatively, a QG can be smaller than the image block corresponding to a decoding unit, that is, a decoding unit can include multiple QGs.
[0167] When the segmentation unit at the encoding end divides a frame of image into multiple slices, tiles or other larger units, a slice or tile may include multiple QGs, or a slice or tile may include image blocks corresponding to multiple decoding units, and the decoding unit may be any one of the image blocks corresponding to the multiple decoding units.
[0168] Optionally, since the QPs of all image blocks containing non-zero coefficients in the same QG are the same, the QPs of image blocks in different QGs are different. Therefore, when the decoding unit is an image block in the current QG, the predicted QP value of the current QG obtained by the decoding end is the predicted QP value of the decoding unit. The predicted QP value of the current QG can be calculated based on the QP values of the QGs where the reconstructed image blocks around the current QG are located.
[0169] For example, Figure 6 As shown, block A is the reconstructed image block on the left side of the current QG, and block B is the reconstructed image block on the upper side of the current QG.
[0170] In one example, the predicted QP value of the current QG may satisfy the following formula (1):
[0171] predQP=(QP A +QP B +1)>>1 Formula (1)
[0172] Among them, QP A It is the quantization parameter of the image block containing block A or one or more pixels in block A, QP B It is the quantization parameter of the image block containing block B or one or more pixels in block B. >>1 means shifting right by one bit, that is, division by 2.
[0173] In another example, for the first QG of the current Slice or Tile, the above block A and block B do not exist, and the actual QP of the current Slice or Tile can be used as the predicted QP of the current QG.
[0174] It should be noted that, during the decoding process, for each Slice or Tile, the decoder can obtain preset parameters of the Slice or Tile by parsing the bitstream of the Slice or Tile, and the preset parameters include the actual QP of each Slice or Tile.
[0175] In another example, for the QG (not the first one) located at the upper boundary of the current Slice or Tile, block B does not exist, but block A does. Then the above QP B May be replaced by the quantization parameter of the last decoding unit in the previous QG in decoding order.
[0176] In another example, for a QG (not the first one) located at the left edge of the current Slice or Tile, block A does not exist, but block B does. Then the above QP A May be replaced by the quantization parameter of the last decoding unit in the previous QG in decoding order.
[0177] It should be noted that if the current QG contains multiple decoding units, all decoding units in the QG share the predQP of the current QG. If a decoding unit contains multiple QGs, the predQP of the first QG in the CU is used as the predQP of the current CU.
[0178] S2. The decoding end parses the video code stream to be processed to obtain the QP offset of the block to be decoded.
[0179] It can be understood that in the video encoding process, the encoder determines the predicted QP of the currently encoded image block, and then determines the difference between the actual QP value of the image block and the predicted QP value, that is, when the QP of the image block is relative to the predicted QP, the QP offset (deltaQP) is then encoded using a variable-length or fixed-length code, and the QP offset is transmitted to the decoder through the bitstream, so that after the decoder obtains the video bitstream to be processed, it can parse the obtained bitstream to obtain the QP offset of the image block (that is, the block to be decoded).
[0180] S3. The decoding end determines the QP value of the block to be decoded according to the predicted QP value of the block to be decoded and the QP offset.
[0181] That is, QP=predQP+deltaQP, where QP represents the QP value of the current encoding, predQP represents the predicted QP value of the current block to be decoded, and deltaQP represents the QP offset of the current block to be decoded.
[0182] In some embodiments, the decoding end may also determine the QP offset value of the block to be decoded based on the derived information of the block to be decoded. Further, the decoding end determines the QP value of the block to be decoded based on the predicted QP value and the QP offset of the block to be decoded. The derived information may include at least one of the flatness information of the block to be decoded, the remaining space of the code stream buffer, or the distortion constraint information.
[0183] It should be understood that during the video encoding process, the encoder uses a code control algorithm to derive the QP offset of the image block to be encoded based on the derivation information of the image block to be encoded, and the encoder may not transmit the QP offset in the bitstream. In this way, during the video decoding process, the decoder uses the same method as the encoder to derive the QP offset of the block to be decoded.
[0184] S102: The decoding end determines a target corresponding relationship among multiple corresponding relationships.
[0185] The above correspondence is used to indicate the correspondence between different QP values and Qstep, and each two correspondences in the multiple correspondences indicate different correspondences. In addition, among the multiple correspondences, the target correspondence has the smallest change rate of the quantization step within a preset interval including the QP value.
[0186] Optionally, the above-mentioned multiple corresponding relationships may be specifically possible representation forms such as multiple quantization curves, quantization formulas, and corresponding relationship tables indicating the corresponding relationship between QP and Qstep.
[0187] It should be noted that, during the decoding process, the above-mentioned multiple corresponding relationships can be implemented as multiple quantization curves, multiple quantization formulas, multiple corresponding relationship tables, or a combination of quantization curves, quantization formulas and corresponding relationship tables.
[0188] In some embodiments, the decoding end may parse out or pre-store multiple correspondences between QP and Qstep in the bitstream, and then determine the above target correspondence from the multiple correspondences.
[0189] The above correspondence is described in detail below:
[0190] For example, the above correspondence may be a quantization formula determined according to a traditional scalar quantization method in the H.265 coding standard. Exemplarily, the relationship between Qstep and QP may be approximated by the following formula (2), that is, the above quantization formula is specifically:
[0191] Q step =2 (QP-4) / 6 Formula (2)
[0192] Alternatively, the quantization formula may also be a quantization formula determined by a uniform scalar quantization method of a VDCM (VESA Display Compression-M Standard) coding standard, such as the following formula (3) or formula (4):
[0193] Q step =2 QP / 8 Formula (3)
[0194] Q step =2 stepSize Formula (4)
[0195] Wherein, stepSize is 0 or a positive integer. In actual implementation, stepSize can be determined according to a specific QP value.
[0196] For another example, the above correspondence relationship may be a correspondence relationship table as shown in Table 1. Exemplarily, when QP is 1, its corresponding Qstep is 0.6875.
[0197] Table 1
[0198]
[0199]
[0200] For another example, the above correspondence relationship may be a quantization curve, that is, a Qstep-QP variation curve.
[0201] For ease of description, the following description takes the Qstep-QP variation curve in the coordinate system where the horizontal axis (x-axis) is QP and the vertical axis (y-axis) is Qstep as an example of the quantization curve described in this application.
[0202] Optionally, the quantization curve includes a segmented curve and a smooth curve.
[0203] Among them, a smooth continuous curve refers to a curve that has a tangent at every point on the continuous curve, and the tangent rotates continuously with the movement of the tangent point.
[0204] In one example, Qstep in the above smooth curve varies uniformly with QP. Figure 7 As shown in (a) of FIG. 1 , the quantization curve may be a linear function curve. In the curve, Qstep changes evenly with QP, and the values of Qstep are evenly distributed.
[0205] In another example, the smooth curve is a non-uniformly changing curve.
[0206] Optionally, the rate of change of Qstep with QP when Qstep is less than the first threshold in the above smooth curve is less than the rate of change of Qstep with QP when Qstep is greater than the second threshold. Alternatively, the rate of change of Qstep with QP when Qstep is less than the first threshold in the above smooth curve is greater than the rate of change of Qstep with QP when Qstep is greater than the second threshold. The second threshold is greater than or equal to the first threshold.
[0207] Optionally, the rate of change of Qstep with QP when Qstep is less than or equal to the first threshold in the above smooth curve is less than the rate of change of Qstep with QP when Qstep is greater than or equal to the second threshold. Alternatively, the rate of change of Qstep with QP when Qstep is less than or equal to the first threshold in the above smooth curve is greater than the rate of change of Qstep with QP when Qstep is greater than or equal to the second threshold. The second threshold is greater than or equal to the first threshold.
[0208] Optionally, the rate of change of Qstep with QP when Qstep is less than the first threshold in the above smooth curve is less than the rate of change of Qstep with QP when Qstep is greater than or equal to the second threshold. Alternatively, the rate of change of Qstep with QP when Qstep is less than the first threshold in the above smooth curve is greater than the rate of change of Qstep with QP when Qstep is greater than or equal to the second threshold. The second threshold is greater than or equal to the first threshold.
[0209] Optionally, when Qstep in the smooth curve is less than or equal to the first threshold, the rate of change of Qstep with QP is less than the rate of change of Qstep with QP when Qstep is greater than the second threshold. Alternatively, when Qstep in the smooth curve is less than or equal to the first threshold, the rate of change of Qstep with QP is greater than the rate of change of Qstep with QP when Qstep is greater than the second threshold. The second threshold is greater than or equal to the first threshold.
[0210] As an example, the curve is divided into three segments: large Qstep segment, medium Qstep segment, and small Qstep segment according to two Qstep thresholds. There are many ways to determine which segment the Qstep threshold as an endpoint belongs to, as follows: Figure 7 (b)~ Figure 7 (e) is only an example of segmentation. Other methods of dividing the curve into three segments according to two Qstep thresholds are also applicable to the present application.
[0211] For example, Figure 7 As shown in (b) in the figure, the quantization curve can be an exponential function curve. Assume that the first threshold is a and the second threshold is b. In the quantization curve, the rate of change of Qstep gradually increases with the increase of QP. Moreover, in the curve, a section of the curve corresponding to Qstep less than the first threshold a (that is, the small Qstep section of the curve) is relatively gentle, and in this section of the curve, Qstep changes slowly with QP. Compared with a section of the curve corresponding to Qstep greater than the second threshold b in the curve (that is, the large Qstep section of the curve), in the small Qstep section of the curve, the rate of change of Qstep with QP is smaller. In other words, compared with the large Qstep section of the curve, in the small Qstep section of the curve, the range of possible values of Qstep under the same △QP is smaller, that is, the values of Qstep in the small Qstep section of the curve are more concentrated, that is, the distribution of Qstep is denser. Correspondingly, the opposite is true in the large Qstep section of the curve.
[0212] Among them, △QP can be the difference between the QP values of two points in the curve. It can be understood that the small Qstep segment in the quantization curve refers to a segment of the curve when the possible value of Qstep is less than the first threshold. The large Qstep segment in the quantization curve refers to a segment of the curve when the possible value of Qstep is greater than the second threshold. In addition, when the second threshold is greater than the first threshold, the medium Qstep segment is a segment of the curve when the possible value of Qstep in the quantization curve is greater than or equal to the first threshold, and less than or equal to the second threshold.
[0213] Or, if Figure 7 As shown in (c) in the figure, the quantization curve can be a logarithmic function curve. In the quantization curve, the rate of change of Qstep gradually decreases as QP increases. In the curve, a section of the curve corresponding to Qstep less than the first threshold a (that is, the small Qstep section of the curve) is steeper, and in this section of the curve, Qstep changes more rapidly with QP. Compared with a section of the curve corresponding to Qstep greater than the second threshold b in the curve (that is, the large Qstep section of the curve), in the small Qstep section of the curve, the rate of change of Qstep with QP is larger. In other words, compared with the large Qstep section of the curve, in the small Qstep section of the curve, under the same △QP, the range of possible values of Qstep is larger, and the values of Qstep in the small Qstep section of the curve are more dispersed (that is, the distribution of Qstep is sparser). Correspondingly, the opposite is true in the large Qstep section of the curve.
[0214] Or, if Figure 7 As shown in (d) in FIG. 1 , the quantization curve can be a cubic function curve. In the middle Qstep segment of the curve, the curve is relatively gentle, and Qstep changes slowly with QP. Compared with the large Qstep segment and the small Qstep segment of the curve, the value of Qstep is relatively concentrated in the middle Qstep segment of the curve. Correspondingly, the large Qstep segment and the small Qstep segment of the curve are opposite.
[0215] Or, if Figure 7 As shown in (e) in FIG. 1 , the quantization curve can be a Sigmoid function curve. In the large Qstep segment and the small Qstep segment of the curve, the two curves are relatively gentle, and Qstep changes slowly with QP, compared with the middle Qstep segment of the curve, that is, the Qstep values in the small Qstep segment and the large Qstep segment of the curve are more concentrated. Correspondingly, the middle Qstep segment of the curve is the opposite.
[0216] It should be noted that if the distribution of quantization step lengths in the quantization curve is relatively concentrated, the difference in quantization step lengths corresponding to quantization parameters of similar sizes will be small. This will result in a smaller bitrate fluctuation in the code stream output by the encoder, and a better balance between image quality and compression rate. On the contrary, if the distribution of quantization step lengths in the quantization curve is relatively sparse, the difference in quantization step lengths corresponding to quantization parameters of similar sizes will be large. This will result in a larger bitrate fluctuation in the code stream output by the encoder, affecting the compression performance of the encoder. However, Figure 7 For example, a quantization curve may be concentrated in the small Qstep segment and sparse in the large Qstep segment. If the Qstep used in the inverse quantization process needs to be determined based on the large Qstep segment of the quantization curve based on the determined QP value, it may affect the balance between image quality and compression rate. Moreover, in the large Qstep segment, if the quantization step size increases a lot, the quantization becomes coarser and the quantization distortion suddenly increases, affecting the quality of the decoded image. Therefore, based on the distribution of each Qstep value segment (such as large Qstep segment, small Qstep segment, etc.), a combination of selections can be made. Figure 7 The multiple quantization curves in the smooth curve are used as the above multiple corresponding relationships, so that each value segment of Qstep has a quantization curve with a relatively concentrated Qstep distribution. Therefore, in the decoding process, based on any value segment of Qstep, a quantization curve with a more appropriate Qstep change rate for the value segment is selected from multiple quantization curves to determine Qstep.
[0217] For example, based on Figure 7 The distribution of Qstep in the small Qstep segment shown in (b) is relatively dense, as shown in Figure 7 The distribution of Qstep in the large Qstep segment shown in (c) is denser and Figure 7 The distribution of Qstep in the middle Qstep segment shown in (d) is relatively dense, and the above multiple corresponding relationships can be Figure 7 (b) Figure 7 (c) and Figure 7 The quantization curve shown in (d) in the figure, in this way, during the decoding process, based on any value segment in the small Qstep segment, the medium Qstep segment or the large Qstep segment, a quantization curve with a more appropriate Qstep change rate for the value segment can be selected from the three preset quantization curves to determine the Qstep.
[0218] For example, based on Figure 7 In the case where the Qstep distribution of the middle Qstep segment shown in (d) is relatively dense, a quantization curve with a relatively dense Qstep distribution of other Qstep segments can be selected and combined with it, for example, Figure 7(d) and Figure 7 The quantization curve shown in (e) can also be Figure 7 (a) and Figure 7 The quantization curves shown in (d) are no longer listed one by one. In this way, during the decoding process, based on any value segment in the small Qstep segment, the medium Qstep segment or the large Qstep segment, a quantization curve with a more suitable Qstep change rate for the value segment can be selected from the preset multiple quantization curves to determine the Qstep.
[0219] In another example, the quantization curve is a segmented curve.
[0220] For example, Figure 8 As shown in (a) of FIG. 1 , the quantization curve may be a piecewise constant function curve, in which the value of Qstep may be c, d, e, or f. The values of Qstep corresponding to multiple QP values are the same. For another example, the quantization curve may be Figure 8 As shown in (b) in FIG. 8 , the quantization curve may also be a piecewise linear function curve.
[0221] It should be noted that the above multiple corresponding relationships can also be implemented as Figure 7 The smooth curve and Figure 8 Any one or a combination of the piecewise curves shown.
[0222] It should be understood that Figure 7 and Figure 8 The quantization curve shown in is only an example, and the quantization curve at the decoding end may also include other possible curves.
[0223] In some embodiments, the value of Qstep in the above correspondence relationship satisfies the following formula (5):
[0224] Q step =p×2 n Formula (5)
[0225] Among them, Q step is the above Qstep, p is a positive odd number, and n is an integer.
[0226] Optionally, the value of Qstep in the above target correspondence relationship can be limited according to formula (5). For example, Figure 8 c, d, e, and f in the quantization curve shown in (a) satisfy the above formula (5).
[0227] Optionally, the target Qstep value can be adjusted by setting specific values of p and n. For example, n can be set to 0 and p to be set to 5. Figure 8 The c in the quantization curve shown in (a) can be 5.
[0228] Optionally, the number of possible values of the target Qstep can be adjusted by setting the specific number of p and n.
[0229] It should be noted that during the quantization process, the encoder can first divide the input signal space into a series of non-intersecting intervals, and select a representative signal for each interval; then for each input signal, the input signal scalar is quantized into a representative signal of the interval where the input signal is located. The interval length is called Qstep, and the encoder can divide the input signal space based on Qstep. In the specific division calculation process of the encoder, it can be achieved through shift and multiplication circuits. Specifically, it can be achieved through multiplication. Then shift right by n bits to achieve this. Therefore, the number of multiplication circuits required to achieve the quantization process is The number of values that can be taken is also the number of values that can be taken by p. Similarly, inverse quantization is the inverse process of quantization, and the number of multiplication circuits required by the decoding end to implement the inverse quantization process is also the number of values that can be taken by p. Among them, a multiplication circuit is an electronic device that performs the multiplication of two unrelated analog signals, and it can multiply two binary numbers. In the process of quantization and inverse quantization, the more multiplication circuits are used, the higher the hardware requirements for implementing quantization and inverse quantization. Therefore, based on the above formula (5), the required hardware cost can be reduced by setting a smaller number of values of p.
[0230] In some embodiments, the decoding end may determine the target corresponding relationship among multiple corresponding relationships in the following possible ways.
[0231] Mode 1: The decoding end parses the code stream of the to-be-decoded block to obtain an identifier of the target corresponding relationship, and determines the target corresponding relationship from the multiple corresponding relationships according to the identifier of the target corresponding relationship.
[0232] The target correspondence relationship identifier is used to indicate the target correspondence relationship. Optionally, each correspondence relationship may be preset with a corresponding identifier, which may be a serial number, a character, etc., which may be used to indicate a correspondence relationship. For example, the target correspondence relationship identifier may be 1, correspondence relationship 1, ①, etc.
[0233] It should be noted that when the encoding end encodes the image block corresponding to the to-be-decoded block, the corresponding relationship adopted by the image block, that is, the identifier of the target corresponding relationship, can be encoded, so that the code stream of the to-be-encoded block includes the identifier of the target corresponding relationship. Correspondingly, the decoding end parses the code stream of the to-be-decoded block to obtain the identifier of the target corresponding relationship.
[0234] Mode 2: The decoding end obtains a first parameter of the block to be decoded, and determines a target corresponding relationship from the multiple corresponding relationships according to the first parameter.
[0235] The first parameter includes any one of a QP value, a predicted Qstep, or an index value of the predicted Qstep. The index value of the predicted Qstep is used to indicate a value interval of the predicted Qstep.
[0236] The detailed description of method 2 can be found below. Fig. 9 The detailed description of the illustrated embodiment will not be repeated here.
[0237] In method 3, the decoding end may also obtain the second historical parameter of the decoded image frame or the image parameter of the current image frame, and determine the target corresponding relationship among multiple corresponding relationships according to the second historical parameter of the decoded image frame or the image parameter of the current image frame.
[0238] The detailed description of the above method 3 can be found in the following Fig.10 The detailed description of the illustrated embodiment will not be repeated here.
[0239] Optionally, the timing at which the decoding end determines the target corresponding relationship among multiple corresponding relationships may be different, and there are several possible implementation methods:
[0240] In a possible implementation, when decoding each block to be decoded in an image frame, the decoding end redetermines the target corresponding relationship among multiple corresponding relationships. Exemplarily, when decoding each block to be decoded in an image frame, the decoding end may adopt the above-mentioned method 1 and method 2 to redetermine the target corresponding relationship among multiple corresponding relationships.
[0241] In another possible implementation, when the decoding end starts decoding any image frame, the target corresponding relationship is re-determined in multiple corresponding relationships, that is, all image blocks of the same image frame adopt the same corresponding relationship. In this way, the decoding end can save computing resources. Exemplarily, if the block to be decoded is the first image block in the decoding order of the current image frame, the decoding end can adopt the above-mentioned method 1, method 2 and method 3 to determine the above-mentioned target corresponding relationship in multiple corresponding relationships. And the target corresponding relationship is used as the target corresponding relationship when decoding the image blocks other than the above-mentioned block to be decoded in the current image frame. Alternatively, if the block to be decoded is not the first image block in the decoding order of the current image frame, the decoding end can determine the corresponding relationship adopted by the reconstructed image block in the current image frame as the target corresponding relationship. In another possible implementation, the corresponding relationship combination can be switched at the block level. For different blocks to be decoded, multiple corresponding relationships are switchable, and the selected target corresponding relationships can also be different. For example, different corresponding relationship combinations can be configured for the first block to be decoded and the second block to be decoded, and the target corresponding relationship of the first block to be decoded can be different from the target corresponding relationship of the second block to be decoded.
[0242] The block level here can be any one of the largest coding unit (LCU), largest coding block (LCB), coding tree unit (CTU), coding tree block (CTB), coding unit (CU), transform unit (TU), transform block (TB) or QG.
[0243] When the decoding end decodes different LCUs, LCBs, CTUs, CTBs, CUs, CBs, TUs, TBs or QGs, it redetermines the target correspondence relationship among multiple correspondence relationships, that is, all image blocks of the same LCU, LCB, CTU, CTB, CU, CB, TU, TB or QG adopt the same correspondence relationship.
[0244] Similarly, if the block to be decoded is the first image block in the decoding order of the current LCU, LCB, CTU, CTB, CU, CB, TU, TB or QG, the decoding end may adopt the above-mentioned method 1 or method 2 to determine the above-mentioned target corresponding relationship among multiple corresponding relationships. Alternatively, if the block to be decoded is not the first image block, the decoding end may determine the corresponding relationship adopted by the reconstructed image block in the current LCU, LCB, CTU, CTB, CU, CB, TU, TB or QG as the target corresponding relationship.
[0245] In another possible implementation, the correspondence combination may be switched at the frame level. Different correspondence combinations may be configured for the first image and the second image, and the target correspondence of the to-be-decoded block in the first image may be different from the target correspondence of the to-be-decoded block in the second image.
[0246] The above-mentioned target correspondence relationship may be determined by the decoding end through indication information carried by the bitstream, or may be derived by the decoding end through derivation.
[0247] S103: The decoding end determines a target Qstep according to a corresponding relationship between the QP value of the block to be decoded and the target.
[0248] The decoding end may search the target Qstep of the block to be decoded in the target corresponding relationship according to the determined target corresponding relationship and based on the QP value of the block to be decoded.
[0249] Exemplarily, the corresponding relationship in the above decoding end includes Figure 7 (a) Figure 7 (b) and Figure 7 In the case of the quantization curve shown in (c) in FIG. 1 , if the target corresponding relationship determined by the decoding end in step S102 is Figure 7 The quantization curve shown in (a) in FIG. 1 is shown in FIG. 2 . The decoding end can be based on the QP value of the block to be decoded, as shown in FIG. 2 . Figure 7 The target Qstep corresponding to the QP value is determined from the quantization curve shown in (a) in FIG. 100 . Alternatively, if the target corresponding relationship determined by the decoding end in step S102 is Figure 7 The quantization curve shown in (b) in FIG. 1 is shown in FIG. 2 . The decoding end can be based on the QP value of the block to be decoded, in the following example: Figure 7 The target Qstep corresponding to the QP value is determined from the quantization curve shown in (b) in FIG. Alternatively, if the target corresponding relationship determined by the decoding end in step S102 is Figure 7 The quantization curve shown in (c) in FIG. 1 is shown in FIG. 2 . The decoding end can be based on the QP value of the block to be decoded, in the following example: Figure 7 The target Qstep corresponding to the QP value is determined from the quantization curve shown in (c) in FIG.
[0250] S104: The decoding end performs inverse quantization on the block to be decoded according to the target Qstep.
[0251] Inverse quantization refers to mapping the quantized coefficients into a reconstructed signal in the input signal space, where the reconstructed signal is an approximation of the input signal.
[0252] Optionally, the decoding end can parse the video bitstream of the video to be processed to obtain the horizontal value of each pixel of the block to be decoded. Then, according to the horizontal value and the obtained target Qstep, inverse quantization is performed to obtain the residual coefficient of the block to be decoded. Among them, if the same QP value is used for all pixels in the block to be decoded, the quantization step size Qstep of each pixel in the block to be decoded is the same.
[0253] Optionally, the decoding end dequantizes the horizontal value corresponding to each pixel point in the block to be decoded according to the Qstep of decoding the block to be decoded based on the quantizer combination selected in the quantization process.
[0254] 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.
[0255] Exemplarily, the quantizer may adopt a uniform quantizer in the H.265 coding standard.
[0256] Specifically, the traditional scalar quantization method in the H.265 coding standard shown in the following formula (6) can be used to implement quantization and inverse quantization.
[0257]
[0258] 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.
[0259] 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.
[0260] [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 the H.265 encoding standard, for I frames, f=1 / 3 is selected, and for B / P frames, f=1 / 6 is selected.
[0261] Exemplarily, the quantization or dequantization formula of the uniform quantizer can refer to the above quantization and dequantization formulas, and the parameter f has the following method:
[0262] Method 1: f is set to 0.5 or other fixed value.
[0263] Method 2: f can be adaptively determined according to the QP value, prediction mode, and whether to perform a transformation.
[0264] It should be noted that, based on the above formula (6), it can be concluded that the smaller the value of f is, the lower the compression bit rate will be and the greater the distortion will be. Different blocks to be decoded can adopt different f values, or different image frames can adopt different f values.
[0265] S105 . The decoding end reconstructs the inverse-quantized block to be decoded to obtain a reconstructed image block.
[0266] The decoding end may reconstruct the block to be decoded based on the residual coefficient of the block to be decoded obtained after inverse quantization to obtain a reconstructed image block.
[0267] Optionally, the decoding end may also perform an inverse transform (or inverse transform) process. Specifically, the decoding end may inversely transform the residual coefficients obtained after the above inverse quantization to obtain inverse transform values, that is, residual values reconstructed in the pixel domain (or sample domain). That is, after the inverse transform of the inverse quantized residual coefficient block, the block obtained is the reconstructed residual block.
[0268] Optionally, in addition to the inverse quantization process, the decoding end also needs to receive or obtain relevant parameters of the prediction mode of the block to be decoded and / or information about the selected prediction mode, predict the block to be decoded, and obtain a prediction block of the block to be decoded.
[0269] Furthermore, the residual value in the reconstructed residual block is added to the predicted value of the corresponding pixel in the prediction block to obtain the reconstructed value of the corresponding pixel, that is, to obtain the reconstructed image block.
[0270] The image decoding method provided by the embodiment of the present application has at least the following beneficial effects: the method presets a variety of corresponding relationships between different quantization parameters and quantization step sizes. In the dequantization process, based on each corresponding relationship, including the change rate of the quantization step size within the preset interval of the QP value, a suitable corresponding relationship can be first selected, and the quantization step size can be determined according to the obtained quantization parameter of the block to be decoded, and then the dequantization operation is performed. Since a larger quantization step size can ensure a high compression rate but will reduce the image quality, a lower quantization step size will result in a low compression rate but will maintain a good image quality. By selecting a suitable corresponding relationship, the range of the quantization step size can be adjusted, and the size of the change rate of the quantization step size corresponding to the quantization parameter of similar size can also be controlled. In this way, the method can control the balance between image quality and compression rate by selecting a suitable corresponding relationship, and can also control the rate fluctuation of the video code stream by controlling the change speed between the quantization step sizes, thereby improving the compression performance of the encoder.
[0271] In some embodiments, based on Figure 5 In the decoding method shown in FIG. 1 , if the decoding end adopts method 2 to determine the target corresponding relationship among multiple corresponding relationships, such as Fig. 9 As shown, the above step S102 can be specifically implemented as the following steps:
[0272] S102 A1. The decoding end obtains a first parameter of a block to be decoded.
[0273] The first parameter includes any one of a QP value, a predicted Qstep, or an index value of the predicted Qstep. It should be understood that the decoding end has determined the QP value of the to-be-decoded block in step S101.
[0274] In some embodiments, the decoding end obtains the first historical parameters of one or more reconstructed image blocks around the block to be decoded, and determines the first parameter based on the first historical parameters. The first historical parameters include one or more of the historical Qstep, QP value, bit depth, mode information, target pixel depth (bits per pixel, BPP) and texture complexity of one or more reconstructed image blocks around the block to be decoded. The number of one or more reconstructed image blocks is not fixed. The decoding end can select X image blocks that have been reconstructed around the block to be decoded, and obtain the first historical parameters of the X reconstructed image blocks, where X is a positive integer. Exemplarily, X can take 10, 5 or other reasonable values.
[0275] In one possible case, if the first parameter is a predicted Qstep, optionally, the decoding end may determine a mean, a median, or a mode of the historical Qstep of one or more reconstructed blocks as the predicted Qstep of the block to be decoded.
[0276] In another possible situation, the decoding end may determine the target compression rate of the reconstructed image block according to information such as the target pixel depth and bit depth of the reconstructed image block, and further determine the predicted Qstep of the block to be decoded according to the target compression rate.
[0277] Exemplarily, the predicted Qstep and the target compression rate satisfy the following formula (7):
[0278] Prediction Q step =2 比特深度*(1-目标压缩率) Formula (7)
[0279] In addition, the index value of the predicted Qstep is used to indicate the value interval of the predicted Qstep, wherein the value interval of Qstep can be an interval determined according to the possible value range of Qstep.
[0280] Optionally, the decoding end may pre-set multiple value intervals of Qstep according to the possible value range of Qstep. Exemplarily, the decoding end divides the possible value range of Qstep equally into multiple intervals. For example, the decoding end may divide the possible value range of Qstep equally into 3 intervals, such as the intervals [0, MaxQstep / 3], [MaxQstep / 3, 2MaxQstep / 3] or [2MaxQstep / 3, MaxQstep], etc., where MaxQstep is the maximum quantization step size. In this case, the predicted value interval of Qstep may be any one of the above three value intervals. Alternatively, the decoding end divides the possible value range of Qstep unequally into multiple intervals. For example, the decoding end may divide the possible value range of Qstep unequally into 2 intervals, such as the intervals [0, m] and [m, MaxQstep], where 0<m<MaxQstep.
[0281] The value range of Qstep can be further divided into more or fewer value intervals, and the present application does not limit the specific number of Qstep value intervals. It should be noted that the division method of the Qstep value interval at the decoding end is the same as the division method of the Qstep value interval at the encoding end.
[0282] Optionally, the index value of the predicted Qstep may be an identifier for indicating the value interval of the predicted Qstep, and the identifier may be, for example, a character and / or a numerical value. For example, the index value of the interval [0, MaxQstep / 3] may be 0, the index value of the interval [MaxQstep / 3, 2MaxQstep / 3] may be 1, and the index value of the interval [2MaxQstep / 3, MaxQstep] may be 2. For another example, the index value of the interval [0, MaxQstep / 3] may be an identifier such as interval 1, QJ1, etc.
[0283] Optionally, the index value of the predicted Qstep may also be the value interval of Qstep itself. For example, the index value of the predicted Qstep may be [0, MaxQstep / 3], [MaxQstep / 3, 2MaxQstep / 3], [2MaxQstep / 3, MaxQstep], etc.
[0284] In some embodiments, the decoding end parses the code stream of the block to be decoded to obtain the index value of the predicted Qstep.
[0285] In some embodiments, the decoding end may determine the index value of the Qstep value interval where the historical Qstep of the one or more reconstructed image blocks is located, and determine the index value of the predicted Qstep based on the obtained one or more index values.
[0286] Optionally, the decoding end may determine the index value that appears most frequently among one or more index values as the index value for predicting Qstep.
[0287] Optionally, in the case where the above index value is a numerical value indicating the value interval of the predicted Qstep, the decoding end may determine the mean, median, mode, maximum value, minimum value or other possible numerical value of one or more index values as the index value of the predicted Qstep based on the obtained one or more index values. Exemplarily, if the value interval of Qstep includes [0, MaxQstep / 3], [MaxQstep / 3, 2MaxQstep / 3], [2MaxQstep / 3, MaxQstep], the index value of the interval [0, MaxQstep / 3] may be 0, the index value of the interval [MaxQstep / 3, 2MaxQstep / 3] may be 1, and the index value of the interval [2MaxQstep / 3, MaxQstep] may be 2. If the number X of reconstructed blocks is 5, and among the historical Qsteps of the 5 reconstructed image blocks obtained by the decoder, 2 historical Qsteps are in the interval [0, MaxQstep / 3], and 3 are in the interval [MaxQstep / 3, 2MaxQstep / 3], then the 5 index values determined by the decoder are 0, 0, 1, 1, and 1. Furthermore, the decoder determines that the average of the 5 index values is 0.6, and the approximate value of 0.6 is 1, so the decoder can determine that the index value of the block to be decoded is 1.
[0288] S102A2: The decoding end determines a target corresponding relationship from multiple corresponding relationships according to the first parameter.
[0289] In some embodiments, when the first parameter is the QP value of the block to be decoded, the decoding end may determine the QP value interval of the QP value of the block to be decoded, and determine the target correspondence relationship among multiple correspondence relationships based on the value interval.
[0290] Optionally, the decoding end may pre-set multiple QP value intervals according to the possible value range of QP. Exemplarily, the decoding end divides the possible value range of QP equally into multiple intervals, which may be 2, 3 or 4, or more. For example, the decoding end may set the intervals [0, MaxQP / 3], [MaxQP / 3, 2MaxQP / 3] or [2MaxQP / 3, MaxQP], etc., where MaxQP is the maximum quantization parameter. It should be understood that the decoding end may also divide the possible value range of QP into multiple intervals unequally, which may be 2, 3 or 4, or more.
[0291] The QP value range can be further divided into more or fewer value intervals, and the present application does not limit the specific number of QP value intervals. It should be noted that the QP value intervals at the decoding end are divided in the same way as the QP value intervals at the encoding end.
[0292] Optionally, if the QP value is within the first QP interval, the decoding end determines a first corresponding relationship among multiple corresponding relationships as a target corresponding relationship, wherein a change rate of Qstep determined based on the first corresponding relationship and the QP value in the first QP interval is the smallest among the multiple corresponding relationships.
[0293] The first QP interval is any one of the multiple QP intervals set above, and the multiple QP intervals are multiple QP value intervals obtained by dividing the possible value range of QP.
[0294] Exemplarily, the above multiple corresponding relationships include Figure 7 (b) Figure 7 (c) and Figure 7 In the case of the quantization parameter shown in (d), the decoding end divides the possible value range of QP into the intervals [0, MaxQP / 3], [MaxQP / 3, 2MaxQP / 3] and [2MaxQP / 3, MaxQP].
[0295] If the QP value of the block to be decoded is in the interval [0, MaxQP / 3], that is, the first QP interval is the interval [0, MaxQP / 3]. Figure 7 (b) Figure 7 (c) and Figure 7 The quantization curve shown in (d) in the figure is [0, MaxQP / 3]. Figure 7 The quantization curve shown in (b) is the most gentle, that is, the rate of change of Qstep with QP is the smallest, so the decoder can Figure 7 The quantization curve shown in (b) (ie, the first correspondence) is determined as the target correspondence.
[0296] Correspondingly, if the QP value of the to-be-decoded block is in the interval [MaxQP / 3, 2MaxQP / 3], that is, the first QP interval is the interval [MaxQP / 3, 2MaxQP / 3]. Figure 7 The quantization curve shown in (d) is the most gentle, that is, the rate of change of Qstep with QP is the smallest, so the decoder can Figure 7 The quantization curve shown in (d) (ie, the first correspondence) is determined as the target correspondence.
[0297] Alternatively, when the first QP interval is the interval [2MaxQP / 3, MaxQP], Figure 7 The quantization curve shown in (c) is the most gentle, that is, the rate of change of Qstep with QP is the smallest, and the decoder can Figure 7 The quantization curve shown in (c) (ie, the first correspondence) is determined as the target correspondence.
[0298] In some embodiments, when the first parameter is a predicted Qstep value or an index value of a predicted Qstep, the decoding end can determine the predicted Qstep value or the index value of the predicted Qstep of the block to be decoded, determine the predicted Qstep value range, and determine the target correspondence relationship among multiple correspondence relationships based on the value range.
[0299] Optionally, if the predicted Qstep value is within the first Qstep interval, or the predicted Qstep index value indicates the first Qstep interval, the decoding end may determine the second corresponding relationship among the multiple corresponding relationships as the target corresponding relationship, wherein the change rate of Qstep within the first Qstep interval in the second corresponding relationship is the smallest among the multiple corresponding relationships.
[0300] The first Qstep interval is any one of the multiple Qstep intervals mentioned above, and the multiple Qstep intervals are divided into multiple Qstep value intervals based on the possible value range of Qstep.
[0301] It should be noted that if the rate of change of Qstep with QP is the smallest, it means that the distribution of quantization step is the most concentrated, and the difference of quantization step corresponding to quantization parameters of similar size is the smallest, so that the code rate fluctuation of the code stream output by the encoder is the smallest. Therefore, according to the rate of change of Qstep with QP, a suitable corresponding relationship can be selected from multiple corresponding relationships as the target corresponding curve.
[0302] In one example, when the decoding end divides the possible value range of Qstep into intervals [0, a], [a, b], and [b, MaxQstep], the above multiple corresponding relationships include Figure 7 (b) Figure 7 (c) and Figure 7 For example, if the predicted Qstep value is within [0, a], or the predicted Qstep index value indicates [0, a], that is, the small Qstep segment described in step S102. Thus, the first Qstep interval is the small Qstep segment, where, in the small Qstep segment, Figure 7 The quantization curve shown in (b) is the most gentle, that is, the rate of change of Qstep with QP is the smallest. Then the decoder can Figure 7The quantization curve shown in (b) in (i.e., the first correspondence) is determined as the target correspondence. Correspondingly, if the predicted Qstep value is within [a, b], or the predicted Qstep index value indicates [a, b], the first Qstep interval is the above-mentioned middle Qstep segment. Among them, in the middle Qstep segment, Figure 7 The quantization curve shown in (d) is the most gentle, that is, the rate of change of Qstep with QP is the smallest. Therefore, the decoder can Figure 7 The quantization curve shown in (d) (ie, the first correspondence) is determined as the target correspondence.
[0303] If the predicted Qstep value is within [b, MaxQstep], or the predicted Qstep index indicates [b, MaxQstep], the first Qstep interval is the large Qstep segment. Figure 7 The quantization curve shown in (c) is the most gentle, that is, the rate of change of Qstep with QP is the smallest. Therefore, the decoder can Figure 7 The quantization curve shown in (c) (ie, the first correspondence) is determined as the target correspondence.
[0304] In another example, when the decoding end divides the possible value range of Qstep into intervals [0, a], [a, b] and [b, MaxQstep], the above multiple corresponding relationships include Figure 7 (d) and Figure 7 For example, if the predicted Qstep value is within [0, a], or the predicted Qstep index value indicates [0, a], that is, the small Qstep segment described in step S102. Thus, the first Qstep interval is the small Qstep segment, where, in the small Qstep segment, Figure 7 The quantization curve shown in (e) is the most gentle, that is, the rate of change of Qstep with QP is the smallest. Then the decoder can Figure 7 The quantization curve shown in (e) (ie, the first correspondence) is determined as the target correspondence.
[0305] Correspondingly, if the predicted Qstep value is within [a, b], or the predicted Qstep index value indicates [a, b], the first Qstep interval is the above-mentioned middle Qstep segment. Figure 7 The quantization curve shown in (d) is the most gentle, that is, the rate of change of Qstep with QP is the smallest. Therefore, the decoder can Figure 7 The quantization curve shown in (d) (ie, the first correspondence) is determined as the target correspondence.
[0306] If the predicted Qstep value is within [b, MaxQstep], or the predicted Qstep index indicates [b, MaxQstep], the first Qstep interval is the large Qstep segment. Figure 7 The quantization curve shown in (e) is the most gentle, that is, the rate of change of Qstep with QP is the smallest. Therefore, the decoder can Figure 7 The quantization curve shown in (e) (ie, the first correspondence) is determined as the target correspondence.
[0307] In some embodiments, based on Figure 5 In the decoding method shown in FIG. 1 , if the decoding end adopts method 3 to determine the target corresponding relationship among multiple corresponding relationships, such as Fig.10 As shown, the above step S102 can be specifically implemented as the following steps:
[0308] S102B1. The decoding end obtains a second historical parameter of a decoded image frame or an image parameter of a current image frame.
[0309] The second historical parameter may include one or more of the bit depth, target pixel depth and texture complexity of the decoded image frame.
[0310] The image parameters include one or more of the bit depth, target pixel depth, and texture complexity of the current image frame.
[0311] It should be noted that, during the decoding process, for each image frame, the decoding end can obtain the frame header of the image frame by parsing the code stream of the image frame. The frame header is data of a certain length at the front end of each image frame, and the data can be used to indicate the image parameters of the current image frame. Exemplarily, the image parameters include one or more of the bit depth, target pixel depth, and texture complexity of the current image frame.
[0312] S102B2: The decoding end determines the target corresponding relationship from a plurality of corresponding relationships according to the second historical parameter of the decoded image frame or the image parameter of the current image frame.
[0313] Optionally, the decoding end may determine the target compression rate of the reconstructed image block based on information such as the bit depth and target pixel depth of the decoded image frame, or information such as the bit depth and target pixel depth of the current image frame, and then determine the predicted Qstep of the block to be decoded based on the target compression rate.
[0314] The specific process of determining the predicted Qstep of the to-be-decoded block according to the target compression rate may refer to the relevant description in the above step S102A1, which will not be described in detail here.
[0315] Therefore, the decoding end can determine the target corresponding relationship among multiple corresponding relationships according to the predicted Qstep of the block to be decoded. Please refer to the above step S102A2 and will not be repeated here.
[0316] In some embodiments, the decoding end may further divide the values of texture complexity or other possible parameters into multiple intervals, wherein the number of intervals is the same as the number of intervals divided into Qstep, and the multiple intervals of texture complexity have a one-to-one correspondence with the multiple intervals of Qstep.
[0317] Optionally, preset range 1, preset range 2 and preset range 3 of texture complexity are set, wherein preset range 1 corresponds to [0, MaxQstep / 3], preset range 2 corresponds to [MaxQstep / 3, 2MaxQstep / 3], and preset range 3 corresponds to [2MaxQstep / 3, MaxQstep].
[0318] Therefore, the decoding end can determine the texture complexity of the decoded image frame, or the preset range of the texture complexity of the current image frame, and determine the value interval of Qstep corresponding to the preset range.
[0319] Therefore, the decoding end determines the target corresponding relationship among multiple corresponding relationships according to the value interval of Qstep. The specific process can refer to the above step S102A2 and will not be repeated here.
[0320] Based on the above embodiments, all image blocks of the same image frame may adopt the same corresponding relationship, so that the decoding end can save computing resources.
[0321] The present application also provides an image decoding method, such as Fig.11 As shown, the method is applied to a decoding end, and the method includes:
[0322] S201. The decoding end obtains a quantization parameter QP value of a block to be decoded.
[0323] The detailed description of step S201 can refer to the description of step S101 above, which will not be repeated here.
[0324] S202: The decoding end determines a target Qstep according to the QP value, where the target Qstep belongs to a preset set, and the preset set includes at least one preset quantization step value.
[0325] In some embodiments, at least one preset quantization step size may take a value that satisfies the above formula (5).
[0326] The decoding end may determine the target Qstep according to the QP value and the preset corresponding relationship, wherein the preset corresponding relationship may be any corresponding relationship in the above step S102, which will not be described in detail here.
[0327] Optionally, there may be multiple preset corresponding relationships, so that the decoding end may also select a target corresponding relationship from the multiple preset corresponding relationships.
[0328] S203 , the decoding end dequantizes the to-be-decoded block according to the target Qstep, and reconstructs the dequantized to-be-decoded block to obtain a reconstructed image block.
[0329] The detailed description of step S203 can refer to the description of steps S103 to S104 above, which will not be repeated here.
[0330] based on Fig.11 The image decoding method shown can control the number and size of the possible values of the quantization step length by a preset formula. Furthermore, according to the above formula (5), the required hardware cost can be reduced by reducing the number of values of p.
[0331] In some embodiments, the present application also provides an image encoding method, such as Fig.12 As shown, Fig.12 The flowchart of an image encoding method provided by the present application is shown in FIG. 1 . The image encoding method can be executed by the encoder 100 or by an encoding end (such as a coding end) supporting the function of the encoder 100. Figure 1 The encoding end 10) shown in the figure is executed, and the encoding method implemented by the encoder 100 is taken as an example for description. The image encoding method includes the following steps:
[0332] S301: The encoder obtains a quantization parameter QP value of a block to be encoded.
[0333] The encoding end may obtain one or more frames of images contained in the video to be encoded, where one frame of image includes one or more image blocks.
[0334] The block to be encoded corresponds to an image block of a to-be-processed image (the to-be-processed image is any one of one or more frames of images), and the block to be encoded may be referred to as a coding unit (CU).
[0335] The encoding end may determine the QP based on a preset strategy, and the embodiment of the present application does not limit the specific process by which the encoding end determines the QP value of the block to be encoded.
[0336] S302: The encoding end determines a target corresponding relationship among multiple corresponding relationships.
[0337] Optionally, a plurality of corresponding relationships are preset in the encoding end, and a target corresponding relationship is determined among the plurality of corresponding relationships, wherein among the plurality of corresponding relationships, the target corresponding relationship has the smallest rate of change of the quantization step length within a preset interval including the QP value.
[0338] The process of the encoding end determining the target corresponding relationship may refer to S102 and will not be described in detail here.
[0339] Optionally, after determining the target correspondence, the encoding end may obtain an identifier of the target correspondence, so that when encoding an image block corresponding to the block to be encoded, the correspondence adopted for the image block, ie, the identifier of the target correspondence, may be encoded.
[0340] S303: The encoder determines a target Qstep according to a corresponding relationship between the QP value and the target.
[0341] The detailed description of step S303 may refer to the description of step S103 above, which will not be repeated here.
[0342] S304: The encoder quantizes the block to be encoded according to the target Qstep.
[0343] It can be understood that during the encoding process, the encoder predicts the current block to be encoded, thereby obtaining the residual value of the current block to be encoded (the residual value is the difference between the true value of the current block to be encoded and the predicted value of the current block to be encoded), and then transforms the residual value of the current block to be encoded to obtain the residual coefficient, and then quantizes the residual coefficient to obtain the quantized coefficient corresponding to the current block to be encoded.
[0344] Alternatively, the encoder does not transform the residual value of the current block to be encoded, but directly quantizes the residual value to obtain a quantized coefficient of the current block to be encoded, and the quantized coefficient can also be called a horizontal value or a quantized residual coefficient.
[0345] Optionally, the encoding end may use a uniform quantizer in the above-mentioned H.265 encoding standard or other possible quantizers to perform the quantization process.
[0346] S305: The encoding end encodes the quantized block to be encoded to obtain a code stream of the block to be encoded.
[0347] The decoding end may encode the quantized residual coefficients to obtain an encoded bit stream (ie, the encoding result of the current block to be encoded).
[0348] Optionally, the decoding end may adopt a semi-fixed length coding method, an exponential Golomb coding method, a Golomb-Rice coding method, a truncated unary code coding method, a run-length coding method, directly encode the original residual value, and the like.
[0349] In some embodiments, after determining the quantization parameter QP value of the block to be encoded, the encoding end may directly encode the QP value of the block to be encoded using a truncated unary code, a truncated Rice code, or an exponential Golomb code, so that the decoder can directly obtain the QP value of the block to be encoded by parsing the bitstream.
[0350] In some embodiments, after determining the quantization parameter QP value of the block to be encoded, the encoder may encode the QP value in a predictive encoding manner. Specifically, the encoder may encode the difference between the actual QP and the predicted QP. Thus, the decoder may determine the predicted QP value, and determine the QP value based on the predicted QP value and the difference between the actual QP and the predicted QP obtained by parsing the bitstream.
[0351] In some embodiments, the encoding end may also encode the identifier of the target correspondence relationship, so that the decoding end can determine the target correspondence relationship based on the identifier of the target correspondence relationship, and determine the target correspondence relationship from multiple correspondence relationships. The target correspondence relationship is used to determine the target quantization step size of the block to be encoded during quantization.
[0352] In some embodiments, if the block to be encoded is the first image block in the encoding order of the current image frame, the encoding end may also encode the identifier of the target correspondence relationship, so that the decoding end may determine the identifier based on the target correspondence relationship and determine the target correspondence relationship among multiple correspondence relationships. The target correspondence relationship is used to determine the target quantization step size of all image blocks to be encoded in the current image frame during quantization.
[0353] Based on the above-mentioned image coding method, multiple corresponding relationships between different quantization parameters and quantization step sizes can be preset. In the quantization process, a suitable corresponding relationship can be selected first, and the quantization step size can be determined according to the obtained quantization parameter of the block to be decoded, and then the inverse quantization operation is performed. Since quantization is a lossy compression process of an image, a larger quantization step size can ensure a high compression rate but will reduce the image quality, and a lower quantization step size will result in a low compression rate but will maintain a good image quality. By selecting a suitable corresponding relationship, the range of possible values of the quantization step size can be adjusted, and the change speed of the quantization step size corresponding to the quantization parameters of similar size can also be controlled. In this way, the method can control the balance between image quality and compression rate by selecting a suitable corresponding relationship, and can also control the rate fluctuation of the video code stream by controlling the change speed between the quantization step sizes, thereby improving the compression performance of the encoder.
[0354] In some embodiments, the present application also provides an image encoding method, such as Fig.13 As shown, the method is applied to the encoding end, and the method includes the following steps:
[0355] S401: The encoding end obtains a QP value of a block to be encoded.
[0356] The detailed description of step S401 can refer to the description of step S301 above, which will not be repeated here.
[0357] S402: The encoder determines a target Qstep according to the QP value, where the target Qstep belongs to a preset set, and the preset set includes at least one preset Qstep possible value.
[0358] In some embodiments, at least one preset Qstep value may be the above formula (5).
[0359] Furthermore, the specific process of the encoder determining the target Qstep according to the QP value can refer to the description of step S302 above, which will not be repeated here.
[0360] S403: The encoder determines a target Qstep according to the corresponding relationship between the QP value and the target.
[0361] The detailed description of step S403 can refer to the description of step S303 above, which will not be repeated here.
[0362] S404: The encoder quantizes the block to be encoded according to the target Qstep.
[0363] The detailed description of step S404 can refer to the description of step S304 above, which will not be repeated here.
[0364] S405: The encoding end encodes the quantized block to be encoded to obtain a code stream of the block to be encoded.
[0365] The detailed description of step S405 can refer to the description of step S305 above, which will not be repeated here.
[0366] based on Fig.13 The image coding method shown can control the number and size of possible values of Qstep by a preset formula. Furthermore, according to the above formula (5), the required hardware cost can be reduced by reducing the number of possible values of p.
[0367] It is understandable that, in order to implement the functions in the above-mentioned embodiments, the encoding end / decoding end includes hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art 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.
[0368] The following describes a decoding device and an encoding device provided in embodiments of the present application.
[0369] In one example, any decoding device provided in the embodiments of the present application may be Figure 1 In another example, any of the following encoding devices may be Figure 1 The encoding end 20 or the encoder 200 in the embodiment is described uniformly here and will not be described in detail below.
[0370] Fig.14 The present application provides a structural schematic diagram of a decoding device 1400, and any of the above decoding method embodiments can be executed by the decoding device 1400. The decoding device 1400 includes an acquisition unit 1401, a determination unit 1402, a dequantization unit 1403, and a reconstruction unit 1404. Among them, the acquisition unit 1401 is used to obtain the quantization parameter QP value of the block to be decoded. The determination unit 1402 is used to determine the target correspondence relationship among multiple correspondences, wherein the correspondence relationship is used to indicate the correspondence relationship between different QP values and Qstep, and the correspondences indicated by each two correspondences in the multiple correspondences are different. The determination unit 1402 is also used to determine the target Qstep according to the QP value and the target correspondence relationship. The dequantization unit 1403 is used to dequantize the block to be decoded according to the target Qstep. The reconstruction unit 1404 is used to reconstruct the dequantized block to be decoded to obtain a reconstructed image block.
[0371] The acquisition unit 1401, the determination unit 1402, the dequantization unit 1403 and the reconstruction unit 1404 of the device 1400 are used to implement Figures 5 to 10 The decoding method provided by any embodiment of the present invention. The detailed description of the acquisition unit 1401, the determination unit 1402, the inverse quantization unit 1403 and the reconstruction unit 1404 can be directly referred to. Figures 5 to 10 The relevant description follows directly from the method embodiment shown.
[0372] Fig.15 The present application provides a structural schematic diagram of a decoding device 1500, and any of the above decoding method embodiments can be executed by the decoding device 1500. The decoding device 1500 includes an acquisition unit 1501, a determination unit 1502, a dequantization unit 1503, and a reconstruction unit 1504. Among them, the acquisition unit 1501 is used to obtain the quantization parameter QP value of the block to be decoded. The determination unit 1502 is used to determine the target quantization step Qstep according to the QP value, and the target Qstep belongs to a preset set, and the preset set includes at least one preset quantization step value. The dequantization unit 1503 is used to dequantize the block to be decoded according to the target Qstep. The reconstruction unit 1504 is used to reconstruct the dequantized block to be decoded to obtain a reconstructed image block.
[0373] For a more detailed description of the acquisition unit 1501, determination unit 1502, inverse quantization unit 1503 and reconstruction unit 1504, as well as a more detailed description of each technical feature therein and a description of the beneficial effects, etc., please refer to the corresponding method embodiment section above and will not be repeated here.
[0374] Fig.16 The present application provides a structural schematic diagram of a coding device 1600, and any of the above coding method embodiments can be executed by the coding device 1600. The coding device 1600 includes an acquisition unit 1601, a determination unit 1602, a quantization unit 1603, and a coding unit 1604. Among them, the acquisition unit 1601 is used to obtain the quantization parameter QP value of the block to be encoded. The determination unit 1602 is used to determine a target corresponding relationship among multiple corresponding relationships, wherein the corresponding relationship is used to indicate the corresponding relationship between different QP values and quantization step lengths Qstep, and the corresponding relationships indicated by each two corresponding relationships in the multiple corresponding relationships are different. The determination unit 1602 is also used to determine the target Qstep according to the QP value and the target corresponding relationship. The quantization unit 1603 is used to quantize the block to be encoded according to the target Qstep. The coding unit 1604 is used to encode the quantized block to be encoded to obtain a code stream of the block to be encoded.
[0375] For a more detailed description of the acquisition unit 1601, determination unit 1602, quantization unit 1603 and encoding unit 1604, as well as a more detailed description of each technical feature therein and a description of the beneficial effects, etc., please refer to the corresponding method embodiment section above and will not be repeated here.
[0376] Fig.17 The present application provides a structural schematic diagram of a coding device 1700, and any of the above coding method embodiments can be executed by the coding device 1700. The coding device 1700 includes an acquisition unit 1701, a determination unit 1702, a quantization unit 1703, and a coding unit 1704. Among them, the acquisition unit 1701 is used to obtain the quantization parameter QP value of the block to be encoded. The determination unit 1702 is used to determine the target quantization step Qstep according to the QP value, and the target Qstep belongs to a preset set, and the preset set includes at least one preset quantization step value. The determination unit 1702 is also used to determine the target Qstep according to the corresponding relationship between the QP value and the target. The quantization unit 1703 is used to quantize the block to be encoded according to the target Qstep. The coding unit 1704 is used to encode the quantized block to be encoded to obtain the code stream of the block to be encoded.
[0377] For a more detailed description of the acquisition unit 1701, determination unit 1702, quantization unit 1703 and encoding unit 1704, as well as a more detailed description of each technical feature therein and a description of the beneficial effects, etc., please refer to the corresponding method embodiment section above and will not be repeated here.
[0378] The present application also provides an electronic device for executing any of the above-mentioned image encoding / decoding methods. Fig.18 As shown, Fig.18 This is a schematic diagram of the structure of an electronic device provided by the present application, where the electronic device 1800 includes a processor 1801 and a communication interface 1802. The processor 1801 and the communication interface 1802 are coupled to each other. It can be understood that the communication interface 1802 can be a transceiver or an input-output interface.
[0379] In one example, the electronic device 1800 may further include a memory 1803 for storing instructions executed by the processor 1801 or storing input data required for the processor 1801 to run instructions or storing data generated after the processor 1801 runs instructions.
[0380] The specific connection medium between the communication interface 1802, the processor 1801 and the memory 1803 is not limited in the embodiment of the present application. Fig.18 The communication interface 1802, the processor 1801 and the memory 1803 are connected via a bus 1804. Fig.18 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.18 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.
[0381] The memory 1803 may be used to store software programs and modules, such as program instructions / modules corresponding to the image decoding method or image encoding method provided in the embodiment of the present application. The processor 1801 executes the software programs and modules stored in the memory 1803 to perform various functional applications and data processing to implement any of the image decoding methods or image encoding methods provided above. The communication interface 1802 may be used to communicate signaling or data with other devices. In the present application, the electronic device 1800 may have multiple communication interfaces 1802.
[0382] 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.
[0383] 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.
[0384] An embodiment of the present application also provides a coding and decoding system, including a coding end and a decoding end, wherein the coding end can be used to execute any one of the image coding methods provided above, and the decoding end is used to execute the corresponding image decoding method.
[0385] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, 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 programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may 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 program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).
[0386] In the various embodiments of the present application, unless otherwise specified or provided for in any logical conflict, the terms and / or descriptions between the different embodiments are consistent and may be referenced to each other, and the technical features in the different embodiments may be combined to form new embodiments according to their inherent logical relationships.
[0387] It is understood that the various numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.
Claims
1. An image decoding method, characterized in that: The method is applied to a decoding end, and the method comprises: Obtain the quantization parameter QP value of the block to be decoded; Determine a target corresponding relationship among a plurality of corresponding relationships; the corresponding relationship is used to indicate a corresponding relationship between different QP values and quantization step sizes, and the corresponding relationships indicated by each two corresponding relationships among the plurality of corresponding relationships are different, wherein, among the plurality of corresponding relationships, the target corresponding relationship has a minimum rate of change of the quantization step size within a preset interval including the QP value; the plurality of corresponding relationships include a plurality of quantization curves, the quantization curves are quantization step size-QP change curves, and the quantization curves include segmented curves or smooth curves; Determining a target quantization step size according to the corresponding relationship between the QP value and the target; De-quantizing the block to be decoded according to the target quantization step size; The inversely quantized block to be decoded is reconstructed to obtain a reconstructed image block.
2. The method according to claim 1, characterized in that The determining of a target corresponding relationship among a plurality of corresponding relationships includes: Acquire a first parameter of the block to be decoded, where the first parameter includes any one of the QP value, the predicted quantization step size, or an index value of the predicted quantization step size, where the index value of the predicted quantization step size is used to indicate a value interval of the predicted quantization step size; The target corresponding relationship is determined from among the multiple corresponding relationships according to the first parameter.
3. The method according to claim 2, characterized in that If the first parameter includes the QP value, determining the target corresponding relationship from the multiple corresponding relationships according to the first parameter includes: If the QP value is within a first QP interval, determining a first corresponding relationship among the multiple corresponding relationships as the target corresponding relationship, wherein a change rate of a quantization step size determined based on the first corresponding relationship among the multiple corresponding relationships and the QP value in the first QP interval is minimum; The first QP interval is one of a plurality of QP intervals, and the plurality of QP intervals are divided based on a possible value range of QP to obtain a plurality of QP value intervals.
4. The method according to claim 2, characterized in that: If the first parameter includes the predicted quantization step size or an index value of the predicted quantization step size, determining the target corresponding relationship from the multiple corresponding relationships according to the first parameter includes: If the predicted quantization step value is within the first quantization step interval, or the index value of the predicted quantization step indicates the first quantization step interval, determining a second corresponding relationship among the multiple corresponding relationships as the target corresponding relationship, wherein, among the multiple corresponding relationships, a change rate of the quantization step within the first quantization step interval in the second corresponding relationship is the smallest; The first quantization step interval is one of a plurality of quantization step intervals, and the plurality of quantization step intervals are obtained by dividing a plurality of quantization step value intervals based on a possible value range of the quantization step.
5. The method according to any one of claims 2 to 4, characterized in that: The obtaining the first parameter of the block to be decoded includes: Acquire first historical parameters of one or more reconstructed image blocks around the block to be decoded, where the first historical parameters include one or more of historical quantization step sizes, QP values, bit depths, mode information, target pixel depths, and texture complexity of one or more reconstructed image blocks around the block to be decoded; The first parameter is determined according to the first historical parameter.
6. The method according to claim 5, characterized in that If the first parameter includes the predicted quantization step size, determining the first parameter according to the first historical parameter includes: The mean, median or mode of the historical quantization step lengths of the one or more reconstructed image blocks is determined as the predicted quantization step length.
7. The method according to claim 5, characterized in that The first parameter includes an index value of the predicted quantization step length, and determining the first parameter according to the first historical parameter includes: Determine an index value of a quantization step value interval in which the historical quantization step of the one or more reconstructed image blocks is located, where the quantization step interval is one of a plurality of quantization step intervals, and the plurality of quantization step intervals are obtained by dividing the plurality of quantization step value intervals based on a range of possible values of the quantization step; According to the determined one or more index values, an index value of the predicted quantization step size is determined.
8. The method according to claim 1, characterized in that The determining of a target corresponding relationship among a plurality of corresponding relationships includes: Parsing the code stream of the block to be decoded to obtain an identifier of the target corresponding relationship; According to the identifier of the target corresponding relationship, the target corresponding relationship is determined among the multiple corresponding relationships, and the target corresponding relationship is used to determine the target quantization step size of the to-be-decoded block during inverse quantization.
9. The method according to claim 1, characterized in that: The block to be decoded is the first image block in the decoding order of the current image frame, and determining the target corresponding relationship among the multiple corresponding relationships includes: Parsing the code stream of the current image frame to obtain an identifier of the target corresponding relationship; According to the identifier of the target corresponding relationship, the target corresponding relationship is determined among the multiple corresponding relationships, and the target corresponding relationship is used to determine the target quantization step size of all the image blocks to be decoded in the current image frame during inverse quantization.
10. The method according to claim 1, characterized in that The block to be decoded is the first image block in the decoding order of the current image frame, and determining the target corresponding relationship among the multiple corresponding relationships includes: Acquire a second historical parameter of the decoded image frame, where the second historical parameter includes one or more of a bit depth, a target pixel depth, and a texture complexity of the decoded image frame; determining the target corresponding relationship from the multiple corresponding relationships according to the second historical parameter; or, Acquire image parameters of the current image frame, where the image parameters include one or more of a bit depth, a target pixel depth, and a texture complexity of the current image frame; The target corresponding relationship is determined among the multiple corresponding relationships according to the image parameters.
11. The method according to claim 1, characterized in that: The block to be decoded is not the first image block in the decoding order of the current image frame, and the determining the target corresponding relationship includes: The corresponding relationship adopted by the reconstructed image blocks in the current image frame is determined as the target corresponding relationship.
12. The method according to claim 1, characterized in that The quantization step size in the smooth curve changes uniformly with the QP value, or the rate of change of the quantization step size with the QP when the quantization step size in the smooth curve is less than a first threshold is less than or greater than the rate of change of the quantization step size with the QP when the quantization step size is greater than a second threshold; wherein the second threshold is greater than or equal to the first threshold.
13. The method according to any one of claims 1-4, 6-11, and 12, characterized in that: The quantization step size satisfies the following relationship: Q step =p×2 n Among them, Q step is the quantization step size, p is a positive odd number, and n is an integer.
14. An image decoding method, characterized in that: The method is applied to a decoding end, and the method comprises: Obtain the quantization parameter QP value of the block to be decoded; Determining a target quantization step size according to the QP value, wherein the target quantization step size belongs to a preset set, and the preset set includes at least one preset quantization step size possible value; De-quantizing the block to be decoded according to the target quantization step size; Reconstructing the inversely quantized block to be decoded to obtain a reconstructed image block; The at least one preset quantization step size may take a value that satisfies the following relationship: Q step =p×2 n Among them, Q step is the target quantization step size, p is a positive odd number, and n is an integer.
15. An image encoding method, characterized in that: The method is applied to the encoding end, and the method includes: Obtain the quantization parameter QP value of the block to be encoded; Determine a target corresponding relationship among a plurality of corresponding relationships; the corresponding relationship is used to indicate a corresponding relationship between different QP values and quantization step sizes, and the corresponding relationships indicated by each two corresponding relationships among the plurality of corresponding relationships are different, wherein, among the plurality of corresponding relationships, the target corresponding relationship has a minimum rate of change of the quantization step size within a preset interval including the QP value; the plurality of corresponding relationships include a plurality of quantization curves, the quantization curves are quantization step size-QP change curves, and the quantization curves include segmented curves or smooth curves; Determining a target quantization step size according to the corresponding relationship between the QP value and the target; quantizing the block to be encoded according to the target quantization step size; The quantized block to be encoded is encoded to obtain a code stream of the block to be encoded.
16. The method according to claim 15, characterized in that The determining of a target corresponding relationship among a plurality of corresponding relationships includes: Acquire a first parameter of the block to be encoded, where the first parameter includes any one of the QP value, the predicted quantization step size, or an index value of the predicted quantization step size, where the index value of the predicted quantization step size is used to indicate a value interval of the predicted quantization step size; The target corresponding relationship is determined from among the multiple corresponding relationships according to the first parameter.
17. The method according to claim 16, characterized in that If the first parameter includes the QP value, determining the target corresponding relationship from the multiple corresponding relationships according to the first parameter includes: If the QP value is within a first QP interval, determining a first corresponding relationship among the multiple corresponding relationships as the target corresponding relationship, wherein a change rate of a quantization step size determined based on the first corresponding relationship among the multiple corresponding relationships and the QP value in the first QP interval is minimum; The first QP interval is one of a plurality of QP intervals, and the plurality of QP intervals are divided based on a possible value range of QP to obtain a plurality of QP value intervals.
18. The method according to claim 16, characterized in that If the first parameter includes the predicted quantization step size or an index value of the predicted quantization step size, determining the target corresponding relationship from the multiple corresponding relationships according to the first parameter includes: If the predicted quantization step value is within the first quantization step interval, or the index value of the predicted quantization step indicates the first quantization step interval, the second corresponding relationship among the multiple corresponding relationships is determined as the target corresponding relationship, wherein, among the multiple corresponding relationships, the rate of change of the quantization step within the first quantization step interval in the second corresponding relationship is the smallest; wherein the first quantization step interval is one of the multiple quantization step intervals, and the multiple quantization step intervals are divided based on the possible value range of the quantization step to obtain multiple quantization step value intervals.
19. The method according to any one of claims 16 to 18, characterized in that: The obtaining the first parameter of the block to be encoded includes: Acquire first historical parameters of one or more encoded image blocks around the block to be encoded, where the first historical parameters include one or more of historical quantization step sizes, QP values, bit depths, mode information, target pixel depths, and texture complexity of one or more encoded image blocks around the block to be encoded; The first parameter is determined according to the first historical parameter.
20. The method according to claim 19, characterized in that If the first parameter includes the predicted quantization step size, determining the first parameter according to the first historical parameter includes: The mean, median or mode of the historical quantization step sizes of the one or more encoded image blocks is determined as the predicted quantization step size.
21. The method according to claim 19, characterized in that The first parameter includes an index value of the predicted quantization step length, and determining the first parameter according to the first historical parameter includes: Determine an index value of a quantization step value interval in which the historical quantization step of the one or more encoded image blocks is located, wherein the quantization step interval is one of a plurality of quantization step intervals, and the plurality of quantization step intervals are obtained by dividing the plurality of quantization step value intervals based on a range of possible values of the quantization step; According to the obtained one or more index values, an index value of the predicted quantization step length is determined.
22. The method according to claim 15, characterized in that The method further comprises: Obtaining an identifier of the target corresponding relationship; The identifier of the target correspondence relationship is encoded, and the code stream of the block to be encoded includes the identifier of the target correspondence relationship, and the target correspondence relationship is used to determine the target quantization step size of the block to be encoded during quantization.
23. The method according to claim 15, characterized in that If the block to be encoded is the first image block in the encoding order of the current image frame, the method further includes: Obtaining an identifier of the target corresponding relationship; The identifier of the target correspondence is encoded, and the code stream of the current image frame includes the identifier of the target correspondence. The target correspondence is used to determine the target quantization step size of all image blocks to be encoded in the current image frame during quantization.
24. The method according to claim 15, characterized in that The block to be encoded is the first image block in the encoding order of the current image frame, and determining the target corresponding relationship among the multiple corresponding relationships includes: Acquire a second historical parameter of the encoded image frame, where the second historical parameter includes one or more of a bit depth, a target pixel depth, and a texture complexity of the encoded image frame; determining the target corresponding relationship from the multiple corresponding relationships according to the second historical parameter; or, Acquire image parameters of the current image frame, where the image parameters include one or more of a bit depth, a target pixel depth, and a texture complexity of the current image frame; The target corresponding relationship is determined among the multiple corresponding relationships according to the image parameters.
25. The method according to claim 15, characterized in that The block to be encoded is not the first image block in the encoding order of the current image frame, and the determining of the target corresponding relationship includes: The corresponding relationship adopted by the encoded image blocks in the current image frame is determined as the target corresponding relationship.
26. The method according to claim 15, characterized in that The quantization step size in the smooth curve changes uniformly with the QP value, or the rate of change of the quantization step size with the QP when the quantization step size in the smooth curve is less than a first threshold is less than or greater than the rate of change of the quantization step size with the QP when the quantization step size is greater than a second threshold; wherein the second threshold is greater than or equal to the first threshold.
27. The method according to any one of claims 15-18, 20-25, 26, characterized in that: The quantization step size satisfies the following relationship: Q step =p×2 n Among them, Q step is the quantization step size, p is a positive odd number, and n is an integer.
28. An image encoding method, characterized in that: The method is applied to a decoding end, and the method comprises: Obtain the quantization parameter QP value of the block to be encoded; Determining a target quantization step size according to the QP value, wherein the target quantization step size belongs to a preset set, and the preset set includes at least one preset quantization step size possible value; Determine a target quantization step size according to the corresponding relationship between the QP value and the target; quantizing the block to be encoded according to the target quantization step size; Encode the quantized block to be encoded to obtain a code stream of the block to be encoded The at least one preset quantization step size may take a value that satisfies the following relationship: Q step =p×2 n Among them, Q step is the target quantization step size, p is a positive odd number, and n is an integer.
29. An image decoding device, characterized in that: include: An acquisition unit, used to acquire a quantization parameter QP value of a block to be decoded; A determination unit, used for determining a target corresponding relationship among a plurality of corresponding relationships; The correspondence relationship is used to indicate the correspondence relationship between different QP values and quantization step sizes, and the correspondence relationship indicated by each two correspondence relationships in the multiple correspondence relationships is different, wherein, in the multiple correspondence relationships, the change rate of the quantization step size of the target correspondence relationship within the preset interval including the QP value is the smallest; the multiple correspondence relationships include multiple quantization curves, the quantization curve is a quantization step size-QP change curve, and the quantization curve includes a segmented curve or a smooth curve; The determination unit is further used to determine a target quantization step size according to the corresponding relationship between the QP value and the target; a dequantization unit, configured to dequantize the block to be decoded according to the target quantization step size; The reconstruction unit is used to reconstruct the inversely quantized block to be decoded to obtain a reconstructed image block.
30. An image decoding device, characterized in that: The device comprises: An acquisition unit, used to acquire a quantization parameter QP value of a block to be decoded; A determination unit, configured to determine a target quantization step size according to the QP value, wherein the target quantization step size belongs to a preset set, and the preset set includes at least one preset quantization step size possible value; a dequantization unit, configured to dequantize the block to be decoded according to the target quantization step size; A reconstruction unit, used for reconstructing the inversely quantized block to be decoded to obtain a reconstructed image block; The at least one preset quantization step size may take a value that satisfies the following relationship: Q step =p×2 n Among them, Q step is the target quantization step size, p is a positive odd number, and n is an integer.
31. An image encoding device, characterized in that: The device comprises: An acquisition unit, used to acquire a quantization parameter QP value of a block to be encoded; a determination unit, configured to determine a target corresponding relationship among a plurality of corresponding relationships; the corresponding relationship is used to indicate a corresponding relationship between different QP values and quantization step sizes, and the corresponding relationships indicated by every two corresponding relationships among the plurality of corresponding relationships are different, wherein, among the plurality of corresponding relationships, the target corresponding relationship has a minimum rate of change of the quantization step size within a preset interval including the QP value; the plurality of corresponding relationships include a plurality of quantization curves, the quantization curves are quantization step size-QP change curves, and the quantization curves include segmented curves or smooth curves; The determination unit is further used to determine a target quantization step size according to the corresponding relationship between the QP value and the target; A quantization unit, configured to quantize the block to be encoded according to the target quantization step size; The encoding unit is used to encode the quantized block to be encoded to obtain a code stream of the block to be encoded.
32. An image encoding device, characterized in that: The device comprises: An acquisition unit, used to acquire a quantization parameter QP value of a block to be encoded; A determination unit, configured to determine a target quantization step size according to the QP value, wherein the target quantization step size belongs to a preset set, and the preset set includes at least one preset quantization step size possible value; The determination unit is further used to determine a target quantization step size according to the corresponding relationship between the QP value and the target; A quantization unit, configured to quantize the block to be encoded according to the target quantization step size; An encoding unit, configured to encode the quantized block to be encoded to obtain a code stream of the block to be encoded; The at least one preset quantization step size may take a value that satisfies the following relationship: Q step =p×2 n Among them, Q step is the target quantization step size, p is a positive odd number, and n is an integer.
33. An electronic device, characterized in that: It 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 described in any one of claims 1-28.
34. 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 described in any one of claims 1 to 28 is implemented.
Citation Information
Patent Citations
Self-adaptive quantification method and device based on size of transform block
CN105898299A
Variations of rho-domain rate control
CN107431814A