Video image decoding method, device and storage medium
By obtaining the channel-level complexity level and code control parameters of the video image and optimizing the selection of quantization parameters, the problem of difficulty in balancing image quality and decoding efficiency in the selection of quantization parameters in the existing technology is solved, and a more efficient video image decoding effect is achieved.
Patent Information
- Application Number
- CN202310452692.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-07-26
AI Technical Summary
In existing video image decoding technology, the selection of quantization parameters is difficult to balance image quality and decoding efficiency, leading to the risk of image distortion, and it is difficult to adapt to the complexity changes of different image blocks.
By obtaining at least two channel-level complexity levels of the image to be processed, the block-level complexity level is determined, and the target number of bits is calculated based on the code control parameters, thereby optimizing the selection of quantization parameters and improving the image decoding quality.
It improves the image quality of video image decoding, reduces the risk of image distortion, adapts to the complexity changes of different image blocks, and improves the visual experience.
Smart Images

Figure CN116366847B_ABST
Abstract
Description
[0001] This invention patent application is a divisional application of the Chinese invention patent application with application date of July 26, 2022, application number 202210887907.9, and name “A video decoding method, device and storage medium”. Technical Field
[0002] The present application relates to the technical field of video image decoding, and in particular to a video image decoding method, device and storage medium. Background Art
[0003] Video image decoding technology plays an important role in the field of video processing. Video image decoding technology is a technology that reduces the amount of video data by encoding and decoding the video. Among them, quantization is an important step in the above-mentioned video encoding and decoding process. It mainly replaces part of the original data in the bitstream with quantization parameters to reduce the redundancy of the original data in the bitstream. The quantization parameters used for quantization are written into the bitstream during the video encoding stage. The video decoding end implements decoding by parsing the quantization parameters in the bitstream. However, quantization also brings the risk of image distortion. Selecting appropriate quantization parameters can improve image quality. Therefore, how to select quantization parameters has become the key to video image decoding technology. Summary of the invention
[0004] The embodiments of the present application provide a video image decoding method, device and storage medium, which are helpful to improve the image quality of video image decoding and improve the visual experience.
[0005] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0006] In a first aspect, an embodiment of the present application provides a video image decoding method, which is applied to a video encoding device or a video decoding device or a chip of a video codec device, and the method includes: obtaining at least two channel-level complexity levels of a current block in an image to be processed, and determining a block-level complexity level of the current block based on the at least two channel-level complexity levels, wherein the channel-level complexity level is used to characterize the complexity of the channel-level texture of the current block; determining coding parameters of the current block, and determining a target number of bits of the current block based on the coding parameters; determining a quantization parameter of the current block based on the target number of bits; and decoding the current block based on the quantization parameter.
[0007] The above-mentioned quantization parameters play an important role in the video encoding and decoding process. Using the video image decoding method proposed in this application, the video image decoding device obtains at least two channel-level complexity levels of the current block in the image to be processed, and determines the block-level complexity level of the current block accordingly, determines the target number of bits of the current block according to the code control parameters including the block-level complexity level, and further determines the quantization parameter of the current block based on the target number of bits. Based on the above process, the video image decoding method provided by this application can optimize the selection of quantization parameters, improve the image quality of video image decoding, and improve the visual experience.
[0008] In a possible implementation, the above-mentioned code control parameters include the average number of lossless coding bits at the same level, the average number of lossless coding bits, and the fullness of the code stream buffer;
[0009] Determining the target number of bits of the current block according to the code control parameters includes: determining the average number of lossless coding bits and the average number of lossless coding bits at the same level; determining the initial target number of bits based on the average number of lossless coding bits and the average number of lossless coding bits at the same level; determining the target number of bits of the current block based on the fullness of the code stream buffer, the block-level complexity level of the current block and the initial target number of bits; wherein the above-mentioned average number of lossless coding bits at the same level is the average value of the predicted values of the number of bits required for lossless coding of the current block and multiple decoded image blocks, and the above-mentioned multiple decoded image blocks have the same complexity level as the current block; the average number of lossless coding bits is the average value of the predicted values of the number of bits required for lossless coding of the current block and all decoded image blocks; the fullness of the code stream buffer is used to characterize the fullness of the buffer, and the above-mentioned buffer is used to store the code stream of the image to be processed.
[0010] In this possible implementation, a method for determining the target number of bits of the current block is provided. By introducing the average number of lossless coding bits of the same level and the average number of lossless coding bits to determine the initial target number of bits, and determining the target number of bits of the current block based on the initial target number of bits, the fullness of the code stream buffer and the block-level complexity level, the quantization parameter can be determined more accurately, thereby achieving the effect of improving image quality while ensuring decoding efficiency.
[0011] In a possible implementation, determining the average number of lossless coding bits at the same level and the average number of lossless coding bits includes: determining the number of lossless coding bits of a current block, the number of lossless coding bits being a predicted value of the number of bits required for lossless coding of the current block; updating the average number of lossless coding bits at the same level of the current block based on the number of lossless coding bits of the current block and multiple historical average numbers of lossless coding bits at the same level; the historical average number of lossless coding bits at the same level being the average number of lossless bits at the same level of decoded image blocks having the same complexity level as the current block; updating the average number of lossless coding bits of the current block based on the number of lossless coding bits of the current block and all historical average numbers of lossless coding bits; the historical average number of lossless coding bits being the average number of lossless bits of decoded image blocks.
[0012] In this possible implementation, a method is provided for determining the average number of lossless coding bits at the same level and the average number of lossless coding bits through the number of lossless coding bits of the current block, the historical average number of lossless coding bits at the same level and the historical average number of lossless coding bits, which helps to improve the feasibility of the scheme. By matching the average number of lossless coding bits at the same level with the block-level complexity level, the selection of quantization parameters can be optimized, thereby achieving the effect of improving image quality.
[0013] In a possible implementation, the current block is the first row block of the image to be processed, and the coding parameters include first row quality improvement parameters; determining the target number of bits of the current block according to the coding parameters also includes: adjusting the target number of bits of the current block according to the first row quality improvement parameters to reduce the quantization parameter of the current block.
[0014] In this possible implementation, another method for determining the target number of bits of the current block is provided, which is applicable to the scenario where the current block is the first row block. When the current block is the first row block, the prediction is more difficult because the prediction error is transitive. This implementation reduces the above influence by introducing the first row quality improvement parameter to reduce the quantization parameter of the first row block, so as to achieve the effect of improving the image quality of video image decoding.
[0015] In a possible implementation, the current block is the first column block of the image to be processed, and the coding parameters include the first column quality improvement parameters; determining the target number of bits of the current block according to the coding parameters also includes: adjusting the target number of bits of the current block according to the first row quality improvement parameters to reduce the quantization parameter of the current block.
[0016] In this possible implementation, another method for determining the target number of bits of the current block is provided, which is applicable to the scenario where the current block is the first column block. When the current block is the first column block, the prediction difficulty is greater because the prediction error is transitive. This implementation reduces the above influence by introducing the first column quality improvement parameter to reduce the quantization parameter of the first column block, so as to achieve the effect of improving the image quality of video image decoding.
[0017] In a possible implementation, at least two channel-level complexity levels of a current block in an image to be processed are obtained, including: obtaining channel-level texture information of the current block, and determining the channel-level complexity level of the current block based on the channel-level texture information; or obtaining the channel-level complexity level from a bitstream, where the bitstream is an encoded bitstream of the current block.
[0018] In this possible implementation, a method for obtaining the channel-level complexity level of the current block is provided. At the encoding end, the channel-level complexity level of the current block is determined based on the channel-level texture information of the current block, and at the decoding end, the channel-level complexity level of the current block is obtained from the received encoded bitstream. By providing a method for obtaining the channel-level complexity level of the current block in encoding and decoding, the feasibility of the scheme is improved, and it is convenient to subsequently determine other code control parameters and target bit numbers based on the obtained channel-level complexity level, thereby optimizing the quantization parameter.
[0019] In a possible implementation, obtaining the channel-level complexity level from the bitstream includes: obtaining complexity information bits of the current block from the bitstream, where the complexity information bits are used to represent the channel-level complexity level of the current block; and determining the channel-level complexity level according to the complexity information bits.
[0020] In this possible implementation, a method for a decoder to obtain the above-mentioned channel-level complexity level is provided. The above-mentioned channel-level complexity level is obtained by parsing the information bit used to represent the channel-level complexity level of the current block in the encoded bitstream. In a possible scenario, the complexity information bit can be 1 bit or 3 bits, and the first bit of the complexity information bit is used to indicate whether the current channel-level complexity level is the same as the complexity level of the same channel of the previous image block of the current block and the change value between the two. Taking a YUV image as an example, if the current channel-level complexity level is the complexity level of the U channel of the current block, the same channel complexity of the previous image block represents the complexity level of the U channel of the image block decoded before the current block. If the first bit is the same, the complexity information bit is 1 bit; if different, the complexity information bit is 3 bits, and the last two bits represent the change value of the channel-level complexity of the current block and the complexity level of the same channel of the previous image block of the current block. Based on the change value and the channel complexity level of the same channel of the previous image block, the current channel-level complexity level required can be determined. It is understandable that the above scenario is only an exemplary description, and the protection scope of this possible implementation method is not limited thereto. In addition, the feasibility of the solution is improved by proposing a specific method for the decoding end to obtain the channel-level complexity level.
[0021] In a possible implementation, channel-level texture information of the current block is obtained, and the channel-level complexity level of the current block is determined based on the channel-level texture information, including: taking at least one channel image block in the current block as a processing unit, dividing the processing unit into at least two sub-units, and determining the texture information of each sub-unit; in the processing unit, determining the block-level complexity level of the current block based on the texture information of each sub-unit.
[0022] In this possible implementation, a method for determining the channel-level complexity level of the current block applicable to the encoding end is provided, which improves the feasibility of the scheme. Among them, at least one channel image block of the current block is used as a processing unit, and each processing unit is further divided into at least two sub-units, which helps to improve the accuracy of the complexity information.
[0023] In one possible implementation, the texture information of each sub-unit is determined, including: obtaining the original pixel value of the sub-unit, the original pixel value or reconstructed value of the adjacent column on the left side of the sub-unit, and the reconstructed value of the adjacent row above the sub-unit, and correspondingly calculating the horizontal texture information and vertical texture information of the sub-unit; selecting the minimum value in the horizontal texture information and the vertical texture information as the texture information of the corresponding sub-unit.
[0024] In this possible implementation, a method for determining texture information of a sub-unit is provided, which improves the feasibility of the solution.
[0025] In one possible implementation, in a processing unit, the block complexity level of the current block is determined based on the texture information of each sub-unit, including: in the processing unit, the texture information of each sub-unit is divided into corresponding sub-unit complexity levels based on multiple thresholds, and the above multiple thresholds are pre-set; and the block complexity level of the current block is determined based on the complexity level of each sub-unit.
[0026] In this possible implementation, it is proposed to divide the texture information of each sub-unit into corresponding sub-unit complexity levels by setting multiple thresholds, and determine the block complexity level of the current block based on the complexity level of each sub-unit, which helps to improve the feasibility of the solution.
[0027] In one possible implementation, the block complexity level of the current block is determined based on the complexity levels of each sub-unit, including: mapping each sub-unit complexity level to a corresponding channel-level complexity level according to a preset rule; and determining the block-level complexity level of the current block based on each channel-level complexity level.
[0028] In this possible implementation, a method is proposed to map the complexity level of each sub-unit to the corresponding channel-level complexity level, and further determine the block-level complexity level of the current block by the channel-level complexity level of the current block, which helps to improve the feasibility of the solution.
[0029] In a possible implementation, each sub-unit complexity level is mapped to a corresponding channel-level complexity level according to a preset rule, including: determining the channel-level complexity level based on multiple thresholds and the sum of the sub-unit complexity levels, and the multiple thresholds are pre-set.
[0030] In this possible implementation, a method for determining the channel-level complexity level based on multiple thresholds and the sum of the complexity levels of each sub-unit is provided, which helps to improve the feasibility of the solution.
[0031] In a possible implementation, each sub-unit complexity level is mapped to a corresponding channel-level complexity level according to a preset rule, including: determining a level composition of the sub-unit complexity level, and determining a corresponding channel-level complexity level according to the level composition.
[0032] In this possible implementation, a method for determining the corresponding channel-level complexity level based on the level composition of the sub-unit complexity level is provided, which helps to improve the feasibility of the solution.
[0033] In one possible implementation, the block-level complexity level of the current block is determined based on each channel-level complexity level, including: taking the maximum value, minimum value or weighted value of each channel-level complexity level as the block-level complexity level of the current block; or determining the block-level complexity level of the current block based on multiple thresholds and the sum of each channel-level complexity level, and the above multiple thresholds are pre-set.
[0034] In this possible implementation, two methods for determining the block-level complexity level of the current block based on each channel-level complexity level are provided, which helps to improve the feasibility of the solution.
[0035] In a possible implementation, the current block is a multi-channel image block; the channel components of the multi-channel image block jointly or independently determine the same-level lossless coding bit number and the target bit number.
[0036] In this possible implementation, it is proposed that each channel component of the multi-channel image block jointly or independently determines the above-mentioned same-level lossless coding bit number and the target bit number, which helps to improve the feasibility of the solution.
[0037] In a possible implementation, the current block is a multi-channel image block; each channel component of the multi-channel image block jointly or independently determines the channel-level complexity level.
[0038] In this possible implementation, it is proposed that each channel component of a multi-channel image block jointly or independently determines the above-mentioned channel-level complexity level, which helps to improve the feasibility of the solution.
[0039] In a second aspect, an embodiment of the present application provides a video image decoding device, which has the function of implementing any of the video image decoding methods in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0040] In a third aspect, a video encoder is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the video encoder is running, the processor executes the computer execution instructions stored in the memory to enable the video encoder to perform a video image decoding method as described in any one of the first aspects above.
[0041] In a fourth aspect, a video decoder is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the video decoder is running, the processor executes the computer execution instructions stored in the memory to enable the video decoder to perform a video image decoding method as described in any one of the first aspects above.
[0042] In a fifth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer can execute any one of the video image decoding methods in the first aspect.
[0043] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any one of the video interpretation methods in the first aspect.
[0044] According to a seventh aspect, an electronic device is provided, the electronic device comprising a video image decoding device, wherein a processing circuit is configured to execute a video image decoding method as described in any one of the first aspects above.
[0045] In an eighth aspect, a chip is provided, the chip including a processor, the processor and a memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the video image decoding method of any one of the above-mentioned first aspects is implemented.
[0046] In a ninth aspect, a video encoding and decoding system is provided, the system comprising a video encoder and a video decoder, the video encoder being configured to execute a video image decoding method as described in any one of the first aspects above, and the video decoder being configured to execute a video image decoding method as described in any one of the first aspects above.
[0047] The technical effects brought about by any implementation method in the second to ninth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A system architecture diagram of a coding and decoding system provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of the structure of a video encoder provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the structure of a video decoder provided in an embodiment of the present application;
[0051] Figure 4 A schematic diagram of a video decoding process provided by an embodiment of the present application;
[0052] Figure 5 A schematic diagram of the structure of a video decoder provided in an embodiment of the present application;
[0053] Figure 6 A flowchart of a video image decoding method provided in an embodiment of the present application;
[0054] Figure 7 A flowchart of a specific embodiment of a video image decoding method provided in an embodiment of the present application;
[0055] Figure 8 A flowchart of determining a block level complexity level in a video image decoding method provided in an embodiment of the present application;
[0056] Fig. 9 A schematic diagram of sub-block texture information of a specific embodiment of a video image decoding method provided in an embodiment of the present application;
[0057] Fig.10 A schematic diagram of an initial delayed transmission mechanism in a video image decoding method provided in an embodiment of the present application;
[0058] Fig.11 A schematic diagram of a video image decoding device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] 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.
[0060] 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.
[0061] First, the technical terms involved in the embodiments of the present application are introduced:
[0062] 1. Video image decoding technology
[0063] Video image decoding technology includes video encoding technology and video decoding technology, which can also be collectively referred to as video coding and decoding technology.
[0064] Among them, video sequences contain a series of redundant information, such as spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. In order to remove the redundant information in the video sequence as much as possible and reduce the amount of data representing the video, video coding technology is proposed to achieve the effect of reducing storage space and saving transmission bandwidth. Video coding technology is also called video compression technology.
[0065] In order to obtain the data stored or transmitted based on the above video compression technology, video decoding technology is required to implement it accordingly.
[0066] Within the international scope, video compression coding standards are used to standardize video coding and decoding methods, such as: Advanced Video Coding (AVC) in Part 10 of the MPEG-2 and MPEG-4 standards developed by the Motion Picture Experts Group (MPEG), and H.263, H.264 and H.265 (also known as High Efficiency Video Coding standard, HEVC) developed by the International Telecommunication Union-Telecommunication Standardization Sector (ITU-T).
[0067] It should be noted that in a coding algorithm based on a hybrid coding architecture, the above compression coding methods can be used in a mixed manner.
[0068] The basic processing unit in the video encoding and decoding process is the image block, which is obtained by dividing a frame / image at the encoding end. The divided image blocks are usually processed line by line. Among them, the image block being processed is called the current block, and the processed image block is called the encoded image block, or the decoded image block, or the decoded image block. Taking HEVC as an example, HEVC defines the Coding Tree Unit (CTU), Coding Unit (CU), Prediction Unit (PU) and Transform Unit (TU). CTU, CU, PU and TU can all be used as image blocks obtained after division. Among them, PU and TU are divided based on CU.
[0069] 2. Video sampling
[0070] A pixel is the smallest complete sample of a video or image, so the data processing of an image block is done in units of pixels. Each pixel records color information. One sampling method is to represent the color through RGB, which includes three image channels, R represents red, G represents green, and B represents blue. Another sampling method is to represent the color through YUV, which includes three image channels, Y represents luminance, U represents the first chrominance Cb, and V represents the second chrominance Cr. Since people are more sensitive to brightness than to chrominance, storage space can be reduced by storing more brightness and less chrominance. Specifically, in video encoding and decoding, the YUV format is usually used for video sampling, including 420 sampling format, 422 sampling format, etc. This sampling format determines the number of samples of two chrominances based on the number of samples of brightness. For example, assuming that a CU has 4×2 pixels, the format is as follows:
[0071] [Y0,U0,V0][Y1,U1,V1][Y2,U2,V2][Y3,U3,V3];
[0072] [Y4, U4, V4] [Y5, U5, V5] [Y6, U6, V6] [Y7, U7, V7];
[0073] The 420 sampling format indicates that YUV is sampled in a 4:2:0 format, that is, the brightness and the first chroma or the second chroma are selected in a 4:2 ratio, where the first chroma and the second chroma are selected in alternate lines. The above CU sampling selects the brightness Y0-Y3 of the first row, and the first chroma U0 and U2, and selects the brightness Y4-Y7 of the second row, and the second chroma V4 and V6. The CU is sampled and composed of a brightness coding unit and a chroma coding unit, where the brightness coding unit is:
[0074] [Y0][Y1][Y2][Y3];
[0075] [Y4][Y5][Y6][Y7];
[0076] The first chroma coding unit is:
[0077] [U0][U2];
[0078] The second chroma coding unit is:
[0079] [V4][V6];
[0080] It can be seen that the image block size after sampling in the above sampling format has changed. The luminance coding unit block size remains unchanged, still 4×2, while the first chroma coding unit block size becomes 2×1, and the second chroma coding unit block size also becomes 2×1. Therefore, if the CU size is assumed to be X×Y, the chroma coding unit block size after sampling based on the 420 sampling format is
[0081] Similarly, the 422 sampling format indicates that YUV is sampled in a 4:2:2 format, that is, the brightness, the first chroma, and the second chroma are selected in a ratio of 4:2:2. Then the sampled brightness coding unit of the above CU is:
[0082] [Y0][Y1][Y2][Y3];
[0083] [Y4][Y5][Y6][Y7];
[0084] The first chroma coding unit is:
[0085] [U0][U2];
[0086] [U4][U6];
[0087] The second chroma coding unit is:
[0088] [V1][V3];
[0089] [V5][V7];
[0090] Among them, the luma coding unit block size remains unchanged, still 4×2, while the first chroma coding unit block size becomes 2×2, and the second chroma coding unit block size also becomes 2×2. Therefore, if the CU size is assumed to be X×Y, the chroma coding unit block size after sampling based on the 422 sampling format is
[0091] The luminance coding unit, the first chrominance coding unit and the second chrominance coding unit obtained through sampling are used as data units of each channel to be subsequently processed for the current block.
[0092] The decoding method provided in the present application is applicable to a video coding and decoding system, which can also be called a video image decoding system. Figure 1 The structure of the video coding system is shown.
[0093] like Figure 1 As shown, the video encoding and decoding system includes a source device 10 and a destination device 11. The source device 10 generates encoded video data, and the source device 10 can also be called a video encoding device or a video encoding device. The destination device 11 can decode the encoded video data generated by the source device 10, and the destination device 11 can also be called a video decoding device or a video decoding device. The source device 10 and / or the destination device 11 may include at least one processor and a memory coupled to the at least one processor. The memory may include but is not limited to a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures that can be accessed by a computer, and the present application does not make specific limitations on this.
[0094] The source device 10 and the destination device 11 may include a variety of devices, including electronic devices such as 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, in-vehicle computers, or the like.
[0095] The destination device 11 may receive the encoded video data from the source device 10 via the link 12. The link 12 may include one or more media and / or devices capable of moving the encoded video data from the source device 10 to the destination device 11. In one example, the link 12 may include one or more communication media that enable the source device 10 to transmit the encoded video data directly to the destination device 11 in real time. In this example, the source device 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 destination device 11. The one or more communication media may include wireless and / or wired communication media, such as a radio frequency (RF) spectrum, 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 enable communication from the source device 10 to the destination device 11.
[0096] In another example, the encoded video data may be output from the output interface 103 to the storage device 13. Similarly, the encoded video data may be accessed from the storage device 13 through the input interface 113. The storage device 13 may include a variety of locally accessible data storage media, such as a Blu-ray disc, a high-density digital video disc (DVD), a compact disc read-only memory (CD-ROM), a flash memory, or other suitable digital storage media for storing encoded video data.
[0097] In another example, the storage device 13 may correspond to a file server or another intermediate storage device storing the encoded video data generated by the source device 10. In this example, the destination device 11 may obtain the video data stored therein from the storage device 13 via streaming or downloading. The file server may be any type of server capable of storing the encoded video data and transmitting the encoded video data to the destination device 11. For example, the file server may include a World Wide Web (Web) server (e.g., for a website), a File Transfer Protocol (FTP) server, a Network Attached Storage (NAS) device, and a local disk drive.
[0098] The destination device 11 can access the encoded video data through any standard data connection (e.g., an Internet connection). Example types of data connections include wireless channels suitable for accessing the encoded video data stored on a file server, wired connections (e.g., cable modems, etc.), or a combination of both. The encoded video data can be transmitted from the file server in the form of streaming, downloading, or a combination of both.
[0099] The decoding method of the present application is not limited to wireless application scenarios. For example, the decoding method of the present application can be applied to video encoding and decoding supporting the following multimedia applications: over-the-air television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (e.g., via the Internet), encoding of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or other applications. In some examples, the video encoding and decoding system can be configured to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and / or video telephony.
[0100] It should be noted that Figure 1 The video coding and decoding system shown is only an example of a video coding and decoding system, and is not a limitation of the video coding and decoding system in the present application. The decoding method provided in the present application can also be applied to a scenario where there is no data communication between the coding device and the decoding device. In other examples, the video data to be encoded or the encoded video data can be retrieved from a local memory, or can be streamed on a network, etc. The video coding device can encode the video data to be encoded and store the encoded video data in a memory, and the video decoding device can also obtain the encoded video data from the memory and decode the encoded video data.
[0101] exist Figure 1 , source device 10 includes a video source 101, a video encoder 102, and an output interface 103. In some examples, output interface 103 may include a modulator / demodulator (modem) and / or a transmitter. Video source 101 may include a video capture device (e.g., a camera), a video archive containing previously captured video data, a video input 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.
[0102] Video encoder 102 may encode video data from video source 101. In some examples, source device 10 transmits the encoded video data directly to destination device 11 via output interface 103. In other examples, the encoded video data may also be stored on storage device 13 for later access by destination device 11 for decoding and / or playback.
[0103] exist Figure 1 In an example of the present invention, the destination device 11 includes a display device 111, a video decoder 112, and an input interface 113. In some examples, the input interface 113 includes a receiver and / or a modem. The input interface 113 can receive the encoded video data via the link 12 and / or from the storage device 13. The display device 111 can be integrated with the destination device 11 or can be external to the destination device 11. In general, the display device 111 displays the decoded video data. The display device 111 can include a variety of display devices, such as a liquid crystal display, a plasma display, an organic light emitting diode display, or other types of display devices.
[0104] Alternatively, the video encoder 102 and the video decoder 112 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.
[0105] The video encoder 102 and the video decoder 112 may include at least one microprocessor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), discrete logic, hardware, or any combination thereof. If the decoding method provided in the present application is implemented in software, the instructions for the software may be stored in a suitable non-volatile computer-readable storage medium, and at least one processor may be used to execute the instructions to implement the present application.
[0106] The video encoder 102 and the video decoder 112 in the present application may operate according to a video compression standard (eg, HEVC), or may operate according to other industry standards, which is not specifically limited in the present application.
[0107] Figure 2 1 is a schematic block diagram of a video encoder 102 in an embodiment of the present application. The video encoder 102 can perform prediction, transformation, quantization and entropy coding processes in the prediction module 21, the transformation module 22, the quantization module 23 and the entropy coding module 24 respectively. The video encoder 102 also includes a pre-processing module 20 and a summer 202, wherein the pre-processing module 20 includes a segmentation module and a bit rate control module. For video block reconstruction, the video encoder 102 also includes an inverse quantization module 25, an inverse transformation module 26, a summer 201 and a reference image memory 27.
[0108] like Figure 2As shown in , the video encoder 102 receives video data, and the preprocessing module 20 receives input parameters of the video data. The input parameters include information such as the resolution of the image in the video data, the sampling format of the image, the pixel depth (bits per pixel, bpp), and the bit width. Bpp refers to the number of bits occupied by a pixel component in a unit pixel. The bit width refers to the number of bits occupied by a unit pixel. For example, if a pixel is represented by the values of the three pixel components RGB, and each pixel component occupies 8 bits (bits), the pixel depth of the pixel is 8, and the bit width of the pixel is 3×8=24 bits.
[0109] The segmentation module in the preprocessing module 20 divides the image into original blocks. This segmentation may also include segmentation into slices, image blocks or other larger units, and (for example) segmentation of video blocks according to the quadtree structure of the largest coding unit (LCU) and CU. Exemplarily, the video encoder 102 encodes the components of the video block in the video slice to be encoded. Generally, the slice can be divided into multiple original blocks (and may be divided into a set of original blocks called image blocks). The sizes of CU, PU and TU are usually determined in the segmentation module. In addition, the segmentation module is also used to determine the size of the rate control unit. The rate control unit refers to the basic processing unit in the rate control module. For example, the rate control module calculates complexity information for the current block based on the rate control unit, and then calculates the quantization parameter of the current block based on the complexity information. Among them, the segmentation strategy of the segmentation module can be preset, or it can be continuously adjusted based on the image during the encoding process. When the segmentation strategy is a preset strategy, the same segmentation strategy is also preset in the decoding end accordingly, so as to obtain the same image processing unit. The image processing unit is any of the above-mentioned image blocks and corresponds one-to-one with the encoding side. When the segmentation strategy is continuously adjusted based on the image during the encoding process, the segmentation strategy can be directly or indirectly encoded into the bitstream, and accordingly, the decoding end obtains the corresponding parameters from the bitstream, obtains the same segmentation strategy, and obtains the same image processing unit.
[0110] The rate control module in the preprocessing module 20 is used to generate quantization parameters so that the quantization module 23 and the inverse quantization module 25 perform related calculations. In the process of calculating the quantization parameters, the rate control module can obtain the image information of the current block for calculation, such as the above-mentioned input information; it can also obtain the reconstruction value obtained by the summer 201 after reconstruction for calculation, and this application does not limit this.
[0111] The prediction module 21 may provide the prediction block to the summer 202 to generate a residual block, and provide the prediction block to the summer 201 for reconstruction to obtain a reconstructed block, which is used as a reference pixel for subsequent prediction. The video encoder 102 forms a pixel difference by subtracting the pixel value of the prediction block from the pixel value of the original block. The pixel difference is the residual block, and the data in the residual block may include brightness difference and chrominance difference. The summer 201 represents one or more components that perform this subtraction operation. The prediction module 21 may also send related syntax elements to the entropy coding module 24 for merging into the bitstream.
[0112] The transform module 22 may divide the residual block into one or more TUs for transformation. The transform module 22 may convert the residual block from the pixel domain to the transform domain (e.g., the frequency domain). For example, the residual block may be transformed using a discrete cosine transform (DCT) or a discrete sine transform (DST) to obtain a transform coefficient. The transform module 32 may send the obtained transform coefficient to the quantization module 23.
[0113] The quantization module 23 may perform quantization based on the quantization unit. The quantization unit may be the same as the CU, TU, and PU described above, or may be further divided in the segmentation module. The quantization module 23 quantizes the transform coefficients to further reduce the bit rate to obtain quantized coefficients. The quantization process may reduce the bit depth associated with some or all of the coefficients. The degree of quantization may be modified by adjusting the quantization parameter. In some feasible embodiments, the quantization module 23 may then perform a scan of the matrix containing the quantized transform coefficients. Alternatively, the entropy coding module 24 may perform the scan.
[0114] After quantization, entropy encoding module 24 may entropy encode the quantized coefficients. For example, entropy encoding module 24 may perform context-adaptive variable-length coding (CAVLC), context-based adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic decoding (SBAC), probability interval partitioning entropy (PIPE) decoding, or another entropy encoding method or technique. After entropy encoding by entropy encoding module 24, a bitstream is obtained, which can be transmitted to video decoder 112 or archived for later transmission or retrieval by video decoder 112.
[0115] The inverse quantization module 25 and the inverse transform module 26 apply inverse quantization and inverse transform respectively, and the summer 201 adds the inverse transformed residual block to the predicted residual block to generate a reconstructed block, which is used as a reference pixel for subsequent prediction of the original block. The reconstructed block is stored in the reference image memory 27.
[0116] Figure 3 1 is a schematic diagram of the structure of the video decoder 112 in the embodiment of the present application. Figure 3 As shown, the video decoder 112 includes an entropy decoding module 30, a prediction module 31, an inverse quantization module 32, an inverse transformation module 33, a summer 301 and a reference image memory 34. The entropy decoding module 30 includes a parsing module and a bit rate control module. In some feasible embodiments, the video decoder 112 may perform Figure 2 The decoding process of the video encoder 102 is an exemplary reciprocal of the encoding process described.
[0117] During the decoding process, the video decoder 112 receives a bitstream of the encoded video from the video encoder 102. The parsing module in the entropy decoding module 30 of the video decoder 112 entropy decodes the bitstream to generate quantized coefficients and syntax elements. The entropy decoding module 30 transfers the syntax elements to the prediction module 31. The video decoder 112 may receive the syntax elements at the video slice level and / or the video block level.
[0118] The rate control module in the entropy decoding module 30 generates quantization parameters based on the information of the image to be decoded obtained by the analysis module so that the inverse quantization module 32 can perform relevant calculations. The rate control module can also calculate the quantization parameters based on the reconstructed block obtained by the summer 301 through reconstruction.
[0119] The inverse quantization module 32 inversely quantizes (e.g., dequantizes) the quantization coefficients and the generated quantization parameters provided in the bitstream and decoded by the entropy decoding module 30. The inverse quantization process may include determining the degree of quantization using the quantization parameters calculated by the video encoder 102 for each video block in the video slice, and similarly determining the degree of inverse quantization to be applied. The inverse transform module 33 applies an inverse transform (e.g., a transform method such as DCT, DST, etc.) to the inversely quantized transform coefficients, and generates an inversely transformed residual block in the pixel domain from the inversely quantized transform coefficients according to an inverse transform unit. The size of the inverse transform unit is the same as the size of the TU, and the inverse transform method and the transform method use the corresponding forward transform and inverse transform in the same transform method, for example, the inverse transform of DCT, DST is an inverse DCT, an inverse DST, or a conceptually similar inverse transform process.
[0120] After the prediction module 31 generates the prediction block, the video decoder 112 forms a decoded video block by summing the inverse transformed residual block from the inverse transform module 33 with the prediction block. The summer 301 represents one or more components that perform this summing operation. If necessary, a deblocking filter may also be applied to filter the decoded block to remove blocking artifacts. The decoded image blocks in a given frame or image are stored in the reference image memory 34 as reference pixels for subsequent prediction.
[0121] This application provides a possible video encoding / decoding implementation, such as Figure 4 As shown, Figure 4 A schematic diagram of a video encoding / decoding process provided in the present application, wherein the video encoding / decoding implementation method includes process ① to process ⑤, and process ① to process ⑤ can be executed by any one or more of the above-mentioned source device 10, video encoder 102, destination device 11 or video decoder 112.
[0122] Process ①: Divide a frame of image into one or more non-overlapping parallel coding units. The one or more parallel coding units have no dependencies and can be completely parallel / independently encoded and decoded, such as Figure 4 A parallel encoding unit 1 and a parallel encoding unit 2 are shown.
[0123] Process ②: Each parallel coding unit can be further divided into one or more non-overlapping independent coding units. The independent coding units may not depend on each other, but may share some parallel coding unit header information.
[0124] The independent coding unit may include three components, namely, brightness Y, first chromaticity Cb, and second chromaticity Cr, or three components, namely, RGB, or may include only one of the components. If the independent coding unit includes three components, the sizes of the three components may be exactly the same or different, which is related to the input format of the image. The independent coding unit may also be understood as one or more processing units formed by the N channels contained in each parallel coding unit. For example, the three components Y, Cb, and Cr mentioned above are the three channels constituting the parallel coding unit, each of which may be an independent coding unit, or Cb and Cr may be collectively referred to as chromaticity channels. Then, the parallel coding unit includes an independent coding unit consisting of a brightness channel and an independent coding unit consisting of a chromaticity channel.
[0125] Process ③: Each independent coding unit can be further divided into one or more non-overlapping coding units. The coding units within the independent coding unit can be interdependent, such as multiple coding units can perform mutual reference pre-coding and decoding.
[0126] If the coding unit and the independent coding unit have the same size (ie, the independent coding unit is divided into only one coding unit), the size thereof can be any size described in process ②.
[0127] The coding unit may include three components (or three components of RGB) including brightness Y, first chrominance Cb, and second chrominance Cr, or only one of them. If it includes three components, the sizes of the components may be completely the same or different, which is related to the image input format.
[0128] It is worth noting that process ③ is an optional step in the video coding and decoding method, and the video codec can encode / decode the residual coefficients (or residual values) of the independent coding units obtained in process ②.
[0129] Process ④: For the coding unit, it can be further divided into one or more non-overlapping prediction groups (Prediction Group, PG), PG can also be referred to as Group, each PG is encoded and decoded according to the selected prediction mode to obtain the prediction value of PG, which constitutes the prediction value of the entire coding unit, and the residual value of the coding unit is obtained based on the prediction value and the original value of the coding unit.
[0130] Process ⑤: Based on the residual values of the coding units, the coding units are grouped to obtain one or more non-overlapping residual blocks (RBs). The residual coefficients of each RB are encoded and decoded according to the selected mode to form a residual coefficient stream. Specifically, it can be divided into two categories: transforming the residual coefficients and not transforming them.
[0131] Among them, the selected mode of the residual coefficient encoding and decoding method in process ⑤ may include, but is not limited to any of the following: semi-fixed length coding method, exponential Golomb coding method, Golomb-Rice coding method, truncated unary code coding method, run-length coding method, direct encoding of the original residual value, etc.
[0132] For example, a video encoder may directly encode coefficients within an RB.
[0133] For another example, the video encoder may also transform the residual block, such as DCT, DST, Hadamard transform, etc., and then encode the transformed coefficients.
[0134] As a possible example, when RB is small, the video encoder can directly perform uniform quantization on each coefficient in RB, and then perform binary encoding. If RB is large, it can be further divided into multiple coefficient groups (coefficient groups, CG), and then each CG is uniformly quantized and then binary encoded. In some embodiments of the present application, the coefficient group (CG) and the quantization group (QG) can be the same.
[0135] The following is an exemplary explanation of the residual coefficient encoding part in a semi-fixed length coding method. First, the maximum value of the absolute value of the residual in an RB block is defined as the modified maximum value (modified maximum, mm). Secondly, the number of coding bits for the residual coefficient in the RB block is determined (the number of coding bits for the residual coefficient in the same RB block is consistent). For example, if the critical limit (CL) of the current RB block is 2 and the current residual coefficient is 1, then 2 bits are required to encode the residual coefficient 1, which is expressed as 01. If the CL of the current RB block is 7, it means encoding an 8-bit residual coefficient and a 1-bit sign bit. The determination of CL is to find the minimum M value that satisfies that all residuals of the current sub-block are within the range of [-2^(M-1), 2^(M-1)]. If both -2^(M-1) and 2^(M-1) exist, M should be increased by 1, that is, M+1 bits are required to encode all residuals of the current RB block; if only one of the two boundary values of -2^(M-1) and 2^(M-1) exists, a Trailing bit needs to be encoded to determine whether the boundary value is -2^(M-1) or 2^(M-1); if all residuals do not exist in either -2^(M-1) or 2^(M-1), there is no need to encode the Trailing bit.
[0136] In addition, for some special cases, the video encoder can also directly encode the original value of the image instead of the residual value.
[0137] The video encoder 102 and the video decoder 112 may also be implemented in another implementation form, for example, by using a general digital processor system, such as Figure 5 The coding and decoding device 50 shown in the figure may be a part of the video encoder 102 or a part of the video decoder 112 .
[0138] The coding and decoding device 50 can be applied to the coding side or the decoding side. The coding and decoding device 50 includes a processor 501 and a memory 502. The processor 501 is connected to the memory 502 (such as being connected to each other through a bus 504). Optionally, the coding and decoding device 50 may also include a communication interface 503, which connects the processor 501 and the memory 502 for receiving / sending data.
[0139] The memory 502 may be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a compact disc read-only memory (CD-ROM). The memory 502 is used to store relevant program codes and video data.
[0140] The processor 501 may be one or more central processing units (CPUs), such as Figure 5 In the example shown in FIG. 5 , CPU 0 and CPU 1 are shown in FIG. 5 . In the case where processor 501 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
[0141] The processor 501 is used to read the program code stored in the memory 502 and execute Figure 6 The operations of any corresponding implementation scheme and its various feasible implementation modes.
[0142] Below, combined with the above Figure 1 The video coding system shown, Figure 2 The video encoder 102 is shown as well as Figure 3 The video decoder 112 shown describes the decoding method provided by the present application in detail.
[0143] like Figure 6 FIG. 1 is a flowchart of a video image decoding method provided by the present application. The method comprises:
[0144] S601. Obtain at least two channel-level complexity levels of a current block in an image to be processed, and determine a block-level complexity level of the current block according to the at least two channel-level complexity levels; the channel-level complexity level is used to characterize the complexity of the channel-level texture of the current block.
[0145] The video image decoding method provided in the present application is applied to the encoding and decoding scenario of video data. The video data is composed of frames of images, and a frame is a static image. A temporally continuous frame sequence is synthesized together to form a dynamic video. The above-mentioned image to be processed is the image to be decoded in the video data. When decoding the video image, the image to be processed is divided into multiple image blocks, and the image blocks are used as the basic processing units and processed line by line. Among them, the image block being processed is called the current block.
[0146] In this example implementation, the above-mentioned image to be processed may be a multi-channel image, and the above-mentioned acquisition of at least two channel-level complexity levels of the current block in the image to be processed and determination of the block-level complexity level of the current block based on the at least two channel-level complexity levels means acquiring the complexity levels of at least two channels of the current multi-channel image block, and determining the block-level complexity level of the current block accordingly. For example, the image to be processed may be an image in YUV format, and the complexity levels of the Y channel and the U channel may be acquired, and the block-level complexity level of the current block may be determined accordingly. It is understandable that acquiring the complexity level of YV or UV or YUV may also determine the block-level complexity level of the current block.
[0147] The multi-channels of the present application are not limited to the aforementioned YUV three channels, and there may be more channels. For example, when the image sensor is a four-channel sensor, the corresponding image to be processed includes image information of four channels. For example, when the image sensor is a five-channel sensor, the corresponding image to be processed includes image information of five channels.
[0148] The multiple channels in the present application may include at least one or more of the following channels: Y channel, U channel, V channel, Co channel, Cg channel, R channel, G channel, B channel, alpha channel, IR channel, D channel, and W channel. For example, the multiple channels include Y channel, U channel, and V channel, or the multiple channels include R channel, G channel, and B channel, or the multiple channels include R channel, G channel, B channel, and alpha channel, or the multiple channels may include R channel, G channel, B channel, and IR channel, or the multiple channels include R channel, G channel, B channel, and W channel, or the multiple channels include R channel, G channel, B channel, IR channel, and W channel, or the multiple channels include R channel, G channel, B channel, and D channel, or the multiple channels may include R channel, G channel, B channel, D channel, and W channel. Among them, in addition to the RGB color photosensitivity channel, there may also be an IR channel (infrared or near-infrared photosensitivity channel), a D channel (dark light channel, mainly through infrared light or near-infrared light), and a W channel (full-color photosensitivity channel). There are different channels for different sensors. For example, the sensor type can be an RGB sensor, an RGBIR sensor, an RGBW sensor, an RGBIRW sensor, an RGBD sensor, an RGBDW sensor, and the like.
[0149] Texture is a visual feature that reflects homogeneous phenomena in an image. It is used to represent the slowly changing or periodically changing surface structure organization and arrangement properties of an object's surface. The above channel-level complexity level is used to characterize the complexity of the channel-level texture of the current block. The more complex the channel-level texture information of the current block, the higher the channel-level complexity level. Similarly, the simpler the above channel-level texture information, the lower the channel-level complexity level.
[0150] The above-mentioned obtaining at least two channel-level complexity levels of the current block in the image to be processed and determining the block-level complexity level of the current block according to the at least two channel-level complexity levels may be implemented in different ways at the encoding end and the decoding end of the video image decoding. Optionally:
[0151] At the encoding end, the following can be achieved: obtaining the channel-level texture information of the current block, and determining the block-level complexity level of the current block based on the channel-level texture information. Specifically, the process can be implemented as follows: taking at least one channel image block in the current block as a processing unit, and dividing each processing unit into at least two sub-units, determining the texture information of each sub-unit; in each processing unit, determining the block-level complexity level of the current block based on the texture information of each sub-unit.
[0152] Among them, at least one channel image block in the current block is used as a processing unit, and each processing unit is divided into at least two sub-units. Taking the image to be processed as a YUV image as an example, in one possible scenario, the process can be implemented as follows: the Y channel of the current block is used as a processing unit, and the processing unit is further divided into four sub-units. In another possible scenario, the process can also be implemented as follows: the two channels, the Y channel and the U channel, are used as a processing unit, and the processing unit is further divided into two sub-units. It can be understood that the above scenario is only an exemplary description, and the protection scope of this example implementation is not limited to this. For example, the U channel, V channel, YU channel, YV channel, UV channel, and YUV channel can also be used as a processing unit, and the number of the above sub-units can also be any integer greater than or equal to two.
[0153] In one possible implementation, the above-mentioned determination of the texture information of each sub-unit can be implemented as follows: obtain the original pixel value of the sub-unit, the original pixel value or reconstructed value of the adjacent column on the left of the sub-unit, and the reconstructed value of the adjacent row above the sub-unit, and calculate the horizontal texture information and vertical texture information of the sub-unit accordingly; select the minimum value in the horizontal texture information and the vertical texture information as the texture information of the corresponding sub-unit.
[0154] Specifically, the texture information may be pixel information. For example, if the image to be processed is a YUV image, and the Y, U, and V channels are respectively used as a processing unit, after the processing unit is divided into at least two sub-units, the sub-unit texture information may be determined by calculating the horizontal complexity and vertical complexity of the sub-unit based on the original pixel value of the sub-unit, the original pixel value or reconstructed value of the adjacent column on the left side of the sub-unit, and the reconstructed value of the adjacent row above the sub-unit, and selecting the minimum value in the horizontal complexity and vertical complexity as the texture information of the corresponding sub-unit. The horizontal complexity and vertical complexity may be calculated based on the degree of difference of the pixels of the sub-unit in the horizontal and vertical directions. It is understandable that the above scenario is only an exemplary description, and the texture information may also be obtained by other means, for example, it may be determined by image information other than pixels, or the weighted value of the horizontal complexity and vertical complexity may be selected as the texture information of the corresponding sub-unit, or other means that may achieve the same effect, and this example implementation does not specifically limit this.
[0155] In a possible implementation, in each processing unit, determining the block complexity level of the current block based on the texture information of each sub-unit can be achieved in the following manner: in the processing unit, the texture information of each sub-unit is divided into corresponding sub-unit complexity levels based on multiple thresholds, and the multiple thresholds are pre-set; and the block complexity level of the current block is determined based on the complexity level of each sub-unit.
[0156] Specifically, the above process can be: setting two thresholds, threshold 1 and threshold 2, and dividing the sub-unit complexity level into three levels from 0 to 2 based on the set thresholds. If it is determined that the complexity of the obtained texture information of the sub-unit is less than or equal to threshold 1, the texture information of the sub-unit is divided into level 0; if it is determined that the complexity of the obtained texture information of the sub-unit is greater than threshold 1 and less than threshold 2, the texture information of the sub-unit is divided into level 1; if it is determined that the complexity of the obtained texture information of the sub-unit is greater than or equal to threshold 2, the texture information of the sub-unit is divided into level 2. It can be understood that the above scenario is only an exemplary scenario, and the protection scope of the present application is not limited thereto.
[0157] In a possible implementation, the above-mentioned determination of the block-level complexity level of the current block based on the complexity level of each sub-unit can be implemented as follows: mapping each sub-unit complexity level to the corresponding channel-level complexity level according to preset rules; and determining the block-level complexity level of the current block based on each channel-level complexity level.
[0158] The above mapping of each sub-unit complexity level to the corresponding channel level complexity level according to the preset rules can be achieved in the following way:
[0159] Implementation method 1: determining the channel level complexity level based on multiple thresholds and the sum of the complexity levels of each sub-unit, wherein the multiple thresholds are pre-set.
[0160] Optionally, the above process can be implemented as follows: determine multiple channel-level complexity levels based on the above multiple thresholds, sum the above sub-unit complexity levels, and divide the obtained sum into corresponding channel-level complexity levels. Specifically, the above thresholds can be three thresholds of 2, 4, and 7. These three thresholds can divide the channel-level complexity level into five levels from level 0 to level 4. The sub-unit complexity levels calculated above are three levels from 0 to 2. By summing the complexity levels of each sub-unit, if the sum of the sub-unit complexity levels is less than 2, the corresponding channel-level complexity level is 0; if the sum of the sub-unit complexity levels is greater than or equal to 2 and less than 4, the corresponding channel level is 1; if the sum of the sub-unit complexity levels is equal to 4, the corresponding channel-level complexity level is 2; if the sum of the sub-unit complexity levels is greater than 4 and less than 7, the corresponding channel-level complexity level is 3; if the sum of the sub-unit complexity levels is greater than or equal to 7, the corresponding channel-level complexity level is 4. It can be understood that the above scenario is only an exemplary scenario, and the protection scope of the present application is not limited to this.
[0161] Implementation method 2: Determine the level composition of the sub-unit complexity level, and determine the corresponding channel-level complexity level based on the level composition.
[0162] Optionally, in a specific scenario, the above process can be implemented as follows: for example, the above sub-unit complexity level is multiple levels, and the corresponding channel-level complexity level is determined according to the level and arrangement of each sub-unit. For example, when the above processing unit is divided into 4 sub-units, and the complexity levels of the 4 sub-units are 1, 2, 2, and 2 respectively, if the preset rules include a decision-making method: each sub-unit complexity level has 3 2s, then the channel-level complexity level is 2, then the corresponding channel-level complexity level is 2. It can be understood that the above scenario is only an exemplary description, and other sub-unit division methods and decision-making methods also fall within the protection scope of this application.
[0163] In a possible implementation, there are multiple ways to determine the block-level complexity level of the current block based on each channel-level complexity level, illustratively:
[0164] Implementation method 1: Take the maximum value, minimum value or weighted value of each channel-level complexity level as the block-level complexity level of the current block.
[0165] Implementation method 2: determining the block-level complexity level of the current block based on a plurality of thresholds and the sum of each channel-level complexity level, wherein the plurality of thresholds are pre-set.
[0166] In addition, in the present application, the above-mentioned multi-channel image block, that is, each channel component of the current block, can determine the channel-level complexity level jointly or independently. For example, when the image to be processed is a YUV image, the U channel and the V channel can share a channel-level complexity level, or can determine their own channel-level complexity levels separately.
[0167] At the decoding end, it can be implemented as follows: obtaining the channel-level complexity level of the current block from the bitstream, wherein the above-mentioned bitstream is the encoded bitstream of the current block. Specifically, the decoding end can receive the encoded bitstream of the current block transmitted from the encoding end, wherein the encoded bitstream contains complexity information bits for indicating the channel-level complexity level, and based on the information bits, the channel-level complexity level determined by the encoding end based on the channel-level texture information can be obtained, and the block-level complexity level is determined based on the channel-level complexity level. Among them, the implementation of determining the block-level complexity level by at least two channel-level complexity levels is the same as that of the encoding end, and will not be repeated here.
[0168] The above-mentioned implementation of determining the channel-level complexity level through the complexity information bit can be as follows: obtain the complexity information bit of the above-mentioned current block from the above-mentioned encoded code stream; determine the channel-level complexity level according to the complexity information bit. Among them, the above-mentioned complexity information bit can be 1 bit or 3 bits, and the first bit of the complexity information bit is used to indicate whether the current channel-level complexity level is the same as the complexity level of the same channel of the previous image block of the current block and the change value between the two. Taking the YUV image as an example, if the current channel-level complexity level is the complexity level of the U channel of the current block, the same channel complexity of the previous image block represents the complexity level of the U channel of the image block decoded before the current block. If it is judged to be the same according to the first bit, the complexity information bit is 1 bit; if it is different, the complexity information bit is 3 bits, and the last two bits represent the change value of the channel-level complexity of the current block and the complexity level of the same channel of the previous image block of the current block. Based on the change value and the channel complexity level of the same channel of the previous image block, the current channel-level complexity level required can be determined. It is understandable that the above scenario is only an exemplary description, and the protection scope of this application is not limited to this. For example, the above complexity information bit can also indicate whether the complexity of the U channel of the current block is the same as that of the Y channel of the current block, and the change value when they are different, and this application does not make special limitations on this.
[0169] S602: Determine a target number of bits of a current block according to a coding control parameter, where the coding control parameter includes a block-level complexity level of the current block.
[0170] In a possible implementation, the code control parameters include the block level complexity level of the current block calculated in step S601, which is used to determine the target number of bits of the current block, and the target number of bits is the number of bits required to predict the encoding of the current block. The above code control parameters may also include at least one of the following parameters: image bit width bpc, target number of bits per pixel bpp, image format, average number of lossless coding bits at the same level, average number of lossless coding bits, bitstream buffer fullness, first row quality improvement parameter, first column quality improvement parameter, and the target number of bits of the current block can be determined by one or more of the above code control parameters.
[0171] Among them, the above-mentioned average lossless coding bit number of the same level is the average value of the predicted value of the number of bits required for lossless coding of the current block and multiple decoded image blocks, and the complexity level of the multiple decoded image blocks is the same as that of the current block; the above-mentioned average lossless coding bit number is the average value of the predicted value of the number of bits required for lossless coding of the current block and all decoded image blocks; the above-mentioned code stream buffer fullness is used to characterize the fullness of the buffer, and the above-mentioned buffer is used to store the code stream of the image to be processed; the above-mentioned first-row quality improvement parameter is used to lower the quantization parameter of the first-row block when the current block is the first-row block in the image to be processed, so as to reduce the impact caused by the greater difficulty in predicting the first-row block and the transitivity of the prediction error.
[0172] In a possible implementation, the above-mentioned code control parameters may include the average number of lossless coding bits at the same level, the average number of lossless coding bits, and the fullness of the code stream buffer. Determining the target number of bits of the current block according to the code control parameters may be implemented as follows: determining the above-mentioned average number of lossless coding bits and the average number of lossless coding bits at the same level; determining the initial target number of bits based on the average number of lossless coding bits and the average number of lossless coding bits at the same level; determining the target number of bits of the current block based on the fullness of the code stream buffer, the block-level complexity level of the current block, and the initial target number of bits. The calculation of the fullness of the code stream buffer may be affected by the initial transmission delay mechanism, which refers to the influence of some invalid bits existing in the buffer before the encoding code stream of the current block is stored on the fullness of the buffer.
[0173] Optionally, the above determination of the average number of lossless coding bits and the average number of coding bits at the same level can be implemented as follows: determining the number of lossless coding bits of the current block, which is a predicted value of the number of bits required for lossless coding of the current block; updating the average number of lossless coding bits of the current block at the same level based on the number of lossless coding bits of the current block and multiple historical average numbers of lossless coding bits at the same level; updating the average number of lossless coding bits of the current block based on the number of lossless coding bits of the current block and all historical average numbers of lossless coding bits. Among them, the above historical average number of lossless coding bits at the same level is the average number of lossless bits at the same level of the decoded image blocks with the same complexity level as the current block, and the above historical average number of lossless coding bits is the average number of lossless bits of the decoded image blocks.
[0174] In a possible implementation, when the current block is the first row block in the image to be processed, the above-mentioned code control parameters also include the first row quality improvement parameters, and the above-mentioned determination of the target number of bits of the current block based on the code control parameters can be implemented as follows: determining the initial target number of bits based on the average number of lossless coding bits of the same level and the average number of lossless coding bits; determining the target number of bits of the current block based on the fullness of the code stream buffer, the block level complexity level of the current block, the first row quality improvement parameters and the initial target number of bits. Among them, the above-mentioned first row quality improvement parameters mainly improve the image quality of the current block by reducing the quantization parameter of the current block.
[0175] In a possible implementation, when the current block is the first column block in the image to be processed, the above-mentioned coding parameters also include the first column quality improvement parameters, and the above-mentioned determination of the target number of bits of the current block based on the coding parameters can be implemented as follows: determining the initial target number of bits based on the average number of lossless coding bits of the same level and the average number of lossless coding bits; determining the target number of bits of the current block based on the fullness of the code stream buffer, the block-level complexity level of the current block, the first column quality improvement parameters and the initial target number of bits. Among them, the above-mentioned first column quality improvement parameters mainly improve the image quality of the current block by reducing the quantization parameter of the current block.
[0176] In addition, in the above process, the above multi-channel image block, that is, the channel components of the current block, can jointly or independently determine the above same-level lossless coding bit number and the target bit number.
[0177] S603: Determine a quantization parameter of the current block based on the target number of bits.
[0178] In a possible implementation, the above-mentioned determination of the quantization parameter of the current block based on the target bit number can be implemented as follows: a reference quantization parameter of the current block is calculated based on the above-mentioned average lossless coding bit number of the same level, the target bit number, and the sampling rate corresponding to the image format of the above-mentioned image to be processed, and further, the quantization parameters of each component corresponding to each channel of the current block can be calculated based on the reference quantization parameter.
[0179] S604: Decode the current block based on the quantization parameter.
[0180] In this step, the video image decoder decodes the current block based on the quantization parameter of the current block. Optionally, during encoding, the video encoder encodes the channel-level complexity level of the current block into the bitstream, that is, the above-mentioned complexity information bit. Or the quantization parameter of the current block is encoded into the bitstream. Accordingly, the decoding end obtains the complexity information bit in the bitstream to calculate the quantization parameter for decoding, or the decoding end obtains the quantization parameter in the bitstream for decoding. Of course, the video encoder can also encode both of the above information into the bitstream.
[0181] Next, the above-mentioned image to be processed is a YUV image as an application scenario, combined with the following Figure 7 The process shown in the figure describes the above-mentioned video image decoding method in detail through a series of specific embodiments:
[0182] Step S701: Determine the block complexity level of the current block.
[0183] This step is used to determine the complexity level of the current block, and the implementation process is different between the video encoding end and the video decoding end.
[0184] On the video encoding side, the process mainly consists of Figure 8 The process shown is implemented as follows:
[0185] S801: Determine the complexity of texture information of the current block.
[0186] This step can be implemented by taking at least one channel image block in the current block as a processing unit, dividing each processing unit into at least two sub-units, and determining the complexity of texture information of each sub-unit.
[0187] Specifically, taking the YUV444 format as an example, each 16x2 channel can be divided into four 4x2 sub-blocks, such as Fig. 9 shown.
[0188] The texture information of the current block is the pixel information of the current block. The calculation of the complexity of the current block requires the use of the following three parts of pixel points, such as Fig. 9 As shown in the figure: (1) the original pixel value of the current block; (2) the original pixel value of the column to the left of the current block, that is, the column adjacent to the left of sub-block 1. It should be noted that when the original pixel value is not available, the reconstructed value can also be used; (3) the reconstructed value of the previous row adjacent to the current block, that is, Fig. 9 The gray square area in the .
[0189] Next, Fig. 9 Taking sub-block 1 in the figure as an example, the calculation process of the sub-block complexity is explained, that is, the process of determining the texture information of each sub-unit mentioned above, which can usually be obtained by calculating the horizontal complexity and vertical complexity of each sub-block, which can be implemented as follows: the horizontal complexity is calculated as: the sum of the absolute values of the pixel value of the current column and the pixel value of the adjacent column to its left; the vertical complexity is calculated as: the sum of the absolute values of the pixel value of the current row and the pixel value of the adjacent row above it.
[0190] Optionally, when the current block is the left boundary of the current video slice, the above horizontal complexity calculation uses the filling value of the left boundary, which is the pixel value of the current column; correspondingly, when the current block is the upper boundary of the current video slice, the above vertical complexity calculation uses the filling value of the upper boundary, which is the pixel value of the current row.
[0191] Specifically, the above process can be implemented as follows:
[0192] First, calculate the horizontal complexity sub_comp_hor of sub-block 1. Specifically, it can be calculated by the set ori_pix[i][j] consisting of the pixel values of sub-block 1, the pixel values or reconstructed values of the adjacent left column of sub-block 1, and the adjacent upper row. Among them, i, j represent the rows and columns where the pixel values are located. The pixel value of the first row and the first column of sub-block 1 is represented as ori_pix[0][0], and the representation of other pixel values is similar. The horizontal complexity sub_comp_hor of sub-block 1 refers to the degree of difference between pixels in sub-block 1 in the horizontal direction. The specific calculation is as follows:
[0193] sub_comp_hor 1+=ori_pix[0][-1]-ori_pix[0][0]
[0194] The absolute value of the above expression is taken as the horizontal complexity between the pixel value of the first row and the first column of sub-block 1 and the pixel value adjacent to its left.
[0195] sub_comp_hor 2+=ori_pix[0][i]-ori_pix[0][i+1]
[0196] The absolute value of the above expression is taken as the horizontal complexity between the pixel values in the first row of sub-block 1.
[0197] sub_comp_hor 3+=ori_pix[1][-1]-ori_pix[1][0]
[0198] The absolute value of the above expression is taken as the horizontal complexity between the pixel value of the second row and the first column of sub-block 1 and the pixel value adjacent to its left.
[0199] sub_comp_hor4+=ori_pix[1][i]-ori_pix[1][i+1]
[0200] The absolute value of the above expression is taken as the horizontal complexity between the pixel values in the second row of sub-block 1.
[0201] The vertical complexity sub_comp_ver of sub-block 1 refers to the difference between pixels of sub-block 1 in the vertical direction. Similarly, the vertical complexity sub_comp_ver can be specifically calculated as follows:
[0202] sub_comp_ver 1+=rec_pix[-1][i]-ori_pix[0][i]
[0203] The absolute value of the above expression is taken as the vertical complexity between the pixel values of the first row of sub-block 1 and the adjacent row above.
[0204] sub_comp_hor 2+=ori_pix[0][i]-ori_pix[1][i]
[0205] The absolute value of the above expression is taken as the vertical complexity between the pixel values of the second row and the first row of sub-block 1.
[0206] After obtaining multiple horizontal complexities and multiple vertical complexities of sub-block 1, the minimum value is taken as the complexity comp of the texture information of sub-block 1, that is, the complexity of sub-block 1 is:
[0207] sub_comp=min(sub_comp_hor,sub_comp_ver)
[0208] The calculation method of the complexity of the texture information of the above sub-blocks 2, 3, and 4 is the same as that of sub-block 1, and the method of dividing the textures of channels U and V into sub-blocks and calculating the complexity of the sub-block texture information is the same as that of channel Y, so they will not be repeated here.
[0209] In addition, if multiple channels need to be combined to calculate the complexity together, for example, when the U channel and the V channel need to be combined to calculate the complexity, it can be achieved through the following formula:
[0210] sub_comp = sub_comp1 * a + sub_comp2 * b, where 0 <= a, b <= 1 and a + b = 1
[0211] Step S802: Determine the block-level complexity level of the current block based on the complexity of the texture information of each channel sub-block.
[0212] Optionally, this step can be implemented in three steps as follows:
[0213] S8021: Determine the complexity level of each channel sub-block through the complexity of the texture information of each channel sub-block.
[0214] This process can be achieved by setting multiple thresholds. Optionally, the specific implementation can be as follows:
[0215] Implementation method 1: Set two thresholds, thres1 and thres2:
[0216] thres1 = 2 * (1 << (bpc - 8)); thres2 = 6 * (1 << (bpc - 8)), where bpc >= 8 and bpc is the image bit width.
[0217] When bpc is less than 8, the above two thresholds default to 2 and 6.
[0218] Divide the complexity sub_comp of the texture information of each sub-block into three complexity levels, level 0, level 1, and level 2, through the above two thresholds. The specific division is as follows:
[0219] If sub_comp <= thres1, then sub_comp_level = 0; if thres1 < sub_comp < thres2, then sub_comp_level = 1; if sub_comp >= thres2, then sub_comp_level = 2.
[0220] Implementation method 2: Set four thresholds, thres1, thres2, thres3, and thres4: thres1 = 2 * (1 << (bpc - 8)), thres2 = 4 * (1 << (bpc - 8)), thres3 = 6 * (1 << (bpc - 8)), thres4 = 8 * (1 << (bpc - 8)). And bpc >= 8 among them.
[0221] Through the above four thresholds, the texture information complexity sub_comp_level of each sub-block is divided into levels 0, 1, 2, 3, and 4, and the specific division is as follows:
[0222] If sub_comp <= thres1, then sub_comp_level = 0; if thres1 < sub_comp < thres2, then sub_comp_level = 1; if thres2 < sub_comp < thres3, then sub_comp_level = 2; if thres3 < sub_comp < thres4, then sub_comp_level = 3; if sub_comp >= thres4, then sub_comp_level = 4.
[0223] S8022: Map the complexity level of each channel sub-block to the channel-level complexity level.
[0224] The above mapping of the complexity level of each channel sub-block to the channel-level complexity level can be achieved by presetting multiple thresholds and mapping based on the thresholds or based on a preset mapping strategy. Optionally, there are the following three implementation methods:
[0225] Implementation method 1: Set multiple thresholds, calculate the sum of the thresholds sub_comp_level of each sub-block within the corresponding channel, and map the texture information complexity of each sub-block to the channel-level complexity level of the corresponding channel according to the above multiple thresholds. Taking the channel sub-block shown above Fig. 9 as an example, this process can be specifically as follows:
[0226] Set three thresholds 2, 4, and 7, calculate the sum of the complexity levels sum_sub_comp_level of sub-blocks 1 to sub-block 4, and map the texture information complexity sub_comp_level (0, 1, 2) of each of the 4 three-level sub-blocks to 1 five-level channel-level complexity level comp_level (0, 1, 2, 3, 4) according to the above three thresholds.
[0227] The process of mapping the texture information complexity of each sub - block to obtain the channel - level complexity level comp_level(0, 1, 2, 3, 4) according to the threshold is as follows: If sum_sub_comp_level < 2, then comp_level = 0; if 2 <= sum_sub_comp_level < 4, then comp_level = 1; if sum_sub_comp_level == 4, then comp_level = 2; if 4 < sum_sub_comp_level < 7, then comp_level = 3; if 7 <= sum_sub_comp_level, then comp_level = 4.
[0228] Implementation method 2: Preset 4 thresholds 5, 7, 10, 12, sum all sub_comp_level, and then obtain comp_level according to the above 4 thresholds, where the possible values of comp_level are (0, 1, 2, 3, 4). In this implementation method, different from implementation method 1, it is possible to map 4 level - 5 sub_comp_levels to 1 level - 5 comp_level.
[0229] Implementation method 3: Obtain comp_level according to the preset logical rules. Optionally, taking the luminance channel of the current block as an example, the decision - making method of this logical rule can be as follows:
[0230] Regarding the level composition of the complexity level composed of sub_comp_level of the 4 determined sub - blocks above:
[0231] When the level composition of the complexity level includes 2 zeros, or 1 zero and 3 ones:
[0232] If there are 2 consecutive zeros and the number of 2s is less than 2, comp_level = 0; otherwise comp_level = 1.
[0233] When the level composition of the complexity level includes 3 twos, or there are 2 consecutive twos:
[0234] If there are 3 twos, comp_level = 4; otherwise comp_level = 3.
[0235] In other cases, comp_level = 2.
[0236] Taking the 16x2 chrominance channel of the current block as an example, the decision - making method of the above logical rule can be:
[0237] When the level composition of the complexity level includes 2 zeros and the number of 2s is less than 2:
[0238] If there are 3 zeros, or 2 consecutive 0s and 0 2s, comp_level = 0; otherwise comp_level = 1.
[0239] When the complexity level consists of 2 2s, or 1 2 and 3 1s:
[0240] If there are 3 2s, or 2 consecutive 2s and 0 0s, comp_level = 4; otherwise comp_level = 3.
[0241] In other cases, comp_level=2.
[0242] In addition, in another possible implementation, taking the 8x2 or 8x1 chrominance channel of the current block as an example, the decision-making method of the above logical rule can also be: comp_level=sub_comp_level1+sub_comp_level2, where sub_comp_level1 and sub_comp_level2 are the complexity levels of the two sub-blocks of the chrominance channel respectively.
[0243] S8023: Determine the block-level complexity level of the current block based on each channel-level complexity level.
[0244] Taking the above-mentioned image to be processed as a YUV image as an example, after the above-mentioned steps S8021 and S8022, the channel-level complexity levels of the three channels Y, U, and V can be determined. Optionally, the above-mentioned determination of the block-level complexity level of the current block based on each channel-level complexity level can be implemented as follows:
[0245] Implementation method 1: Determine the block-level complexity level blk_comp_level of the current block based on the sum of the above channel-level complexity levels:
[0246] chroma_comp_level=(u_comp_level+v_comp_level) / 2
[0247] blk_comp_level = (luma_comp_level + chroma_comp_level * sample_rate) / (1 + sample_rate) where sample_rate is the sampling rate of the image to be processed, which is determined by the image format of the image to be processed. A setting method of sample_rate can be referred to in Table 1 below:
[0248] Table 1:
[0249] Image Format YUV400 YUV420 YUV422 RGB444 YUV444 sample_rate 0 0.5 1 2 2 format_bias 0 8 / 9 2 / 3 1 4 / 9
[0250] In Table 1 above, sample_rate is the sampling rate of the image to be processed, and format_bias is the bias set when calculating the quantization parameter.
[0251] In the above steps S8021 to 8023, the channel-level complexity level can be shared by multiple channels or can be independent. For example, if it is a YUV or YCoCg format image, the brightness uses one complexity, the chrominance uses one complexity, or the three channels determine the channel complexity level independently.
[0252] When the first chromaticity and the second chromaticity share a complexity level, the complexity level is calculated as follows:
[0253] Implementation method 1: Take the minimum, maximum or weighted value of the complexity levels of the two chrominance channels.
[0254] Implementation method 2: Take the minimum, maximum or weighted value of the texture information complexity of the two chromaticity channels as the texture complexity of the chromaticity, and then obtain the channel-level complexity level of the chromaticity according to the method of the above steps S8021 to 8023.
[0255] At the video decoding end, the above-mentioned channel-level complexity levels are obtained from the bitstream encoded by the encoding end, which can be implemented as follows: obtaining the complexity information bit of the above-mentioned current block from the above-mentioned encoded bitstream; determining the channel-level complexity level according to the complexity information bit. Among them, the above-mentioned complexity information bit can be 1 bit or 3 bits, and the first bit of the complexity information bit is used to indicate whether the current channel-level complexity level is the same as the same channel complexity level of the previous image block of the current block and the change value between the two.
[0256] Specifically, taking the image to be processed as a YUV image as an example, the decoding end obtains the channel-level complexity level and can be implemented as follows: if the current channel-level complexity level is the complexity level of the U channel of the current block, then the complexity of the same channel of the previous image block represents the complexity level of the U channel of the image block decoded before the current block. If the first bit is the same, the complexity information bit is 1 bit; if different, the complexity information bit is 3 bits, and the last two bits represent the change value of the channel-level complexity of the current block and the complexity level of the same channel of the previous image block of the current block. Based on the change value and the channel complexity level of the same channel of the previous image block, the current channel-level complexity level required can be determined. It can be understood that the above scenario is only an exemplary description, and the protection scope of the present application is not limited to this. For example, the above complexity information bit can also indicate whether the complexity of the U channel of the current block is the same as that of the Y channel of the current block, and the change value when they are different.
[0257] Step S702: Determine the average number of lossless coded bits and the average number of lossless coded bits of the same level of the current block.
[0258] When the first chroma and the second chroma of the YUV image share a channel-level complexity level, the above-mentioned determination of the average lossless coding bits and the average lossless coding bits of the same level of the current block may be implemented as follows:
[0259] S7021. Determine the number of lossless coding bits pred_lossless_bits.
[0260] pred_lossless_bits=(cu_bits / (width x height)+luma_qp / a+sample_rate*chroma_qp / b) / (1+sample_rate)
[0261] Among them, cu_bits represents the actual number of coding bits of the current block, which can be determined based on the number of coding bits of the decoded image; width and height represent the width and height of the coding block respectively, luma_qp represents the quantization parameter of the luminance channel of the decoded image, and chroam_qp represents the quantization parameter of the chrominance channel of the decoded image; a and b are weight values, and their settings are related to the prediction mode. The default values are both 8: for IBC mode, a, b>=8; for point prediction mode, a, b>=8; for palette mode, original value mode and residual skip mode, the quantization parameters are invalid, so a, b==0.
[0262] In addition, when the buffer is full and in residual skip mode:
[0263] pred_lossless_bits=bpc+c
[0264] The parameter c is related to the image format and is 0.67 only in RGB mode and 0 in other formats.
[0265] S7022. Determine the average number of lossless coding bits lossless_bits[blk_comp_level] at the same level.
[0266] The average number of lossless coding bits lossless_bits[blk_comp_level] at the same level corresponds to the block complexity level of the current block. When the block complexity level of the current block is the same as the block complexity level of the decoded image block, it is updated by the following formula:
[0267] lossless_bits[blk_comp_level]=lossless_bits[blk_comp_level]*(1–d)+pred_lossless_bits*d
[0268] Wherein, d is the update rate, and 0<=d<=1.
[0269] Optionally, a specific setting manner of the update rate d may be: for the first four image blocks of any complexity, the update rate d is respectively set to 3 / 4, 5 / 8, 1 / 2, 3 / 8, and the rest are set to 1 / 4.
[0270] S7023. Determine the average number of lossless coding bits avg_lossless_bits.
[0271] Different from the average lossless coding bits of the same level, the average lossless coding bits avg_lossless_bits will be updated in each block. The specific update method can be:
[0272] avg_lossless_bits=avg_lossless_bits*(1-e)+pred_lossless_bits*e
[0273] Wherein, e is the update rate, 0<=e<=1. Optionally, one setting of e may be e=0.01.
[0274] Step S703: Determine the target number of bits of the current block.
[0275] Optionally, the above determination of the target number of bits of the current block may be implemented by the following steps:
[0276] S7031. Determine an initial target number of bits.
[0277] The initial target number of bits is the target number of bits calculated without considering the buffer fullness, and can be calculated as follows:
[0278] (1) Calculate the quality ratio quality_ratio:
[0279] quality_ratio=bpp / (ave_lossless_bits–comp_offset)*(1+sample_rate)
[0280] Among them, comp_offset is a preset value, and one setting method is shown in Table 2 below:
[0281] Table 2:
[0282]
[0283]
[0284] The above bpp is calculated as:
[0285] bpp=target_bpp / 16+(end_target_fullness–(cur_total_bits–((target_bpp<<1)×(cur_blocks–1)))) / max(16,slice_width_in_cu×slice_height_in_cu–cur_blocks) / 32
[0286] Wherein, end_target_fullness is a preset value. Optionally, a specific setting value of end_target_fullness may be (delay_bits-1533)*3 / 4.
[0287] Among them, delay_bits is a preset value, which is related to the initial transmission delay mechanism, and delay_bits is the number of delay bits.
[0288] The characteristics of the initial transmission delay mechanism are as follows: a) When a video slice starts to be transmitted, it is delayed by delay_blks image blocks before transmission, and these image blocks are not underflowed. b) The buffer state of the buffer at the end of the video slice is always delay_bits delay bits (if insufficient, fill with zeros). Fig.10 As shown, Fig.10 Schematic diagram of the initial transmission delay mechanism, one or more image blocks in a video slice are between an initial position and a second position, and the maximum value of the corresponding buffer increases based on the position between the initial position and the second position, and the image blocks at a position between a threshold position and a final position of the slice, the maximum value of the corresponding buffer decreases based on the position between the threshold position and the final position, and the buffer size corresponding to the image block remains unchanged between the second position and the threshold position.
[0289] The delay_bits can be determined by the following calculation: delay_bits=delay_blks*bpp*blk_size, wherein blk_size represents a block size and delay_blks is a preset value.
[0290] In addition, if the image to be processed is a YUV444 or RGB image, the value range of the quality_ratio needs to be limited to between 0 and 0.6.
[0291] Optionally, after the quality ratio is determined, the quality ratio may be updated by calculating the average complexity level ave_comp_level of all previous image blocks, which may be specifically implemented as follows:
[0292] avg_comp_level=avg_comp_level*(1-k)+blk_comp_level*k
[0293] If avg_comp_level>blk_comp_level, quality_ratio-=0.05;
[0294] If avg_comp_level <blk_comp_level,quality_ratio+=0.05。
[0295] (2) Determine the initial target number of bits.
[0296] The above initial target number of bits pre_target_bits can be determined by the following formula:
[0297] pre_target_bits=quality_ratio*(lossless_bits[blk_comp_level]-comp_offset)*(1+sample_rate); wherein comp_offset is a preset value, and a setting method can refer to Table 2 above, and sample_rate can refer to Table 1 above.
[0298] S7032: limiting the initial target number of bits according to the buffer state and the block-level complexity level of the current block, and determining the final target number of bits of the current block, which can be specifically implemented as follows:
[0299] (1) The above buffer state can be represented by the buffer fullness, which can be determined based on the following formula:
[0300] fullness=(cur_total_bits–((target_bpp<<1)×(cur_blocks–1)) / available_buffer_size
[0301] Among them, cur_total_bits represents the number of bits currently consumed, target_bpp represents the target number of bits per pixel (bpp), cur_blocks represents the number of blocks of the image currently processed, and available_buffer_size represents the size of the available buffer.
[0302] In addition, in the above process, when determining available_buffer_size, if the influence of the initial transmission delay function is taken into account, the available_buffer_size is different depending on the position of the current block in the video slice, such as Fig.10 As shown:
[0303] From the delay_blks blocks at the beginning of the video slice, that is, from the initial position to the second position, the available_buffer_size can be linearly increased from delay_bits to max_buffer_size. The increase step start_step is: start_step = (max_buffer_size - delay_bits) / delay_blks; where max_buffer_size represents the maximum available buffer size, which is a preset fixed value.
[0304] From the second position to the threshold position available_buffer_size remains unchanged and is always equal to max_buffer_size.
[0305] From the threshold position to the final position, available_buffer_size decreases linearly from max_buffer_size to delay_bits. The step length end_step of the decrease is: end_step = -(max_buffer_size - delay_bits) / (end_blks - thres_blks); where end_blks represents the number of blocks at the final position, and thres_blks represents the number of blocks at the threshold position.
[0306] The calculation of the delay_blks has been described in detail in the calculation of the quality ratio, so it will not be repeated here.
[0307] (2) After determining the buffer fullness, further determine the upper and lower bounds for limiting the target number of bits, which can be specifically implemented as follows:
[0308] Calculate the lower bound min_bits:
[0309] min_bits=max((1.5–10*fullness)*bpp,0.9*bpp / max_lossless_bits*min(lossless_bits[blk_comp_level],max_lossless_bits))
[0310] min_rate=max(min_rate,bpp-(1+sample_rate)*k-2*(fullness-0.85)))
[0311] Wherein, k=Clip3(0,2.5,max_lossless_bits–lossless_bits[blk_comp_level]); max_lossless_bits is a preset value. For a specific setting method, please see Table 2.
[0312] Calculate the upper bound max_bits:
[0313] bpp_offset=min(max_bpp_offset–k,14.29*(0.85-fullness))
[0314] bpp_offset=min(bpp_offset,-8.46*fullness+8.76-(1+sample_rate)*k)
[0315] max_bits=max(bpp+bpp_offset,min_rate)
[0316] Where max_bpp_offset = 12–bpp < 4? 4: 12–bpp
[0317] If the initial transmission delay mechanism is taken into account, the above process of determining the upper and lower bounds also needs to consider the impact of the initial transmission delay mechanism on the buffer fullness.
[0318] (3) Based on the determined upper and lower bounds, the initial target number of bits is limited to obtain the target number of bits of the current block, which can be specifically implemented as: target_bits = Clip3 (min_bits, max_bits, target_bits).
[0319] In addition, if the current block is the first row block of the image to be processed, the parameter prediction of the first row block is more difficult and the prediction error is transitive. Therefore, when the current block is the first row block, the quality of the current block can be improved by introducing the first row quality improvement parameter, which is mainly achieved by reducing the quantization parameter of the first row block.
[0320] Specifically, in the above process of determining the target number of bits, the following can be achieved:
[0321] If the current block is the first row block, increase the bpp by 2.
[0322] For all first row blocks in the image to be processed, the adjustment of the bpp parameter can be achieved as follows: let the amount of bpp increase of the image blocks in the first row be bpp_delta_row, and from the first block to the last block in the first row, bpp_delta_row gradually decreases from 2.5 to 0.5.
[0323] When the current block is the first row block, in the process of limiting the initial target bit number according to the buffer status and the block-level complexity level to determine the target bit number, the image quality of the current block can be improved in the following way: after limiting the target bit number according to the buffer status and complexity, if the current block is the first row block of the slice and target_bits<7, where 7 is a preset empirical threshold, then increase target_bits, and the increased target_bits must be within a given range. The specific implementation can be: target_bits+=Clip3(0,2,7-target_bits).
[0324] When the current block is the first row block, the quality of the current block can also be improved by determining the upper bound using the following formula: max_bits=max(bpp+bpp_offset,min_rate), bpp_offset=max(bpp_offset,-1), where 1 is a preset empirical parameter.
[0325] It is understandable that when the current block is the first row block, improving the quality of the current block by using the first row quality improvement parameter can also be performed only when certain conditions are met. For example, the first row quality improvement is performed only when the complexity level of the current block is low.
[0326] In addition, when the current block is the first column block of the image to be processed, the quality of the current block can also be improved by introducing the first column quality improvement parameter. This process is mainly achieved by reducing the quantization parameter of the first column block.
[0327] If the current block is the first column block, increase the bpp by 2.
[0328] For all the first column blocks in the image to be processed, the adjustment of the bpp parameter can be achieved as follows: let the amount of bpp increase of the image block in the first column be bpp_delta_col, and from the first block to the last block in the first row, bpp_delta_col gradually decreases from 2.5 to 0.5.
[0329] When the current block is the first column block, in the process of limiting the initial target bit number according to the buffer status and the block-level complexity level to determine the target bit number, the image quality of the current block can be improved in the following way: after limiting the target bit number according to the buffer status and complexity, if the current block is the first column block of the slice and target_bits<7, where 7 is a preset empirical threshold, then increase target_bits, and the increased target_bits must be within a given range. The specific implementation can be: target_bits+=Clip3(0,2,7-target_bits).
[0330] When the current block is the first column block, the quality of the current block can also be improved by determining the upper bound using the following formula: max_bits=max(bpp+bpp_offset,min_rate), bpp_offset=max(bpp_offset,-1), where 1 is a preset empirical parameter.
[0331] It is understandable that when the current block is the first column block, improving the quality of the current block by using the first column quality improvement parameter can also be performed only when certain conditions are met. For example, the first row quality improvement is performed only when the complexity level of the current block is high.
[0332] Step S704: Determine the quantization parameter of the current block.
[0333] In this step, the above-mentioned determination of the quantization parameter of the current block is implemented as follows:
[0334] (1) Calculate the reference quantization parameter ref_qp:
[0335] ref_qp=(lossless_bits[blk_comp_level]–target_bits / (1+sample_rate))*p
[0336] The default value of p is 8.
[0337] (2) Calculate the quantization parameters of each component. Taking the image to be processed as a YUV image as an example, the process is to calculate the quantization parameters of each YUV channel, which can be specifically implemented as follows:
[0338] Calculate the offset: bias = bias_init * format_bias; where bias_init and format_bias are preset values, where bias_init is shown in Table 3 below, and format_bias is shown in Table 1 above.
[0339] Calculate the luminance channel quantization parameter: luma_qp = Clip3 (0, luma_max_qp, ref_qp – sample_rate * bias)
[0340] Calculate the chroma channel quantization parameter: chroma_qp = Clip3 (0, chroma_max_qp, ref_qp + bias)
[0341] For bias_init, please see Table 3, and for format_bias, please see Table 2.
[0342] Table 3:
[0343]
[0344] In the above Table 3, comp_level[0] represents the luminance component, and comp_level[1] represents the chrominance component.
[0345] In addition, for YUV420 format images, two YUV420 images can be combined into one YUV444 image for processing.
[0346] At this time, the complexity level of the brightness component can be determined by the weighted value of the two:
[0347] comp_level[0]=m*y1_comp_level+(1-m)*y2_comp_level, where 0<=m<=1.
[0348] It is understandable that the above brightness component complexity level may also take the maximum or minimum value of the two, and this application does not make any special limitation on this.
[0349] Step S705: Decode the video image of the current block based on the quantization parameter.
[0350] Optionally, the video image decoder decodes the current block based on the quantization parameter of the current block. It is understandable that, when encoding, the video encoder may encode the channel level complexity level of the current block into the bitstream, or encode the quantization parameter of the current block into the bitstream. Accordingly, the decoding end obtains the channel level complexity level in the bitstream to calculate the quantization parameter for decoding, or the decoding end obtains the quantization parameter in the bitstream for decoding. Of course, the video encoder can also encode both of the above two types of information into the bitstream.
[0351] In addition, in the process of determining the quantization parameter, each channel component of the current block can also independently determine the above parameters such as the average number of lossless coding bits at the same level, the average number of lossless coding bits and the target number of bits, and the above process can be implemented as follows:
[0352] Determine the average number of lossless coded bits and the average number of lossless coded bits of the same level for each channel component of the current block, specifically:
[0353] (1) Determine the number of lossless coding bits pred_lossless_bits[i] of each channel component of the current block:
[0354] pred_lossless_bits[i]=(cu_bits[i] / (width[i]x height[i])+qp[i] / a[i]
[0355] When the buffer is full and in residual skip mode, pred_lossless_bits[i] = bpc[i] + c[i];
[0356] Among them, i is the number of channels of the current block, indicating the actual number of coding bits of the current channel; width and height respectively represent the width and height of the current channel coding unit, and qp represents the quantization parameter of the current channel.
[0357] (2) Determine the average number of lossless coding bits of the same level for each channel component: lossless_bits[i][comp_level[i]]:
[0358] lossless_bits[i][comp_level[i]]=lossless_bits[i][comp_level[i]]*(1–d[i])+pred_lossless_bits[i]*d[i]
[0359] Wherein, lossless_bits[i][comp_level[i]] is the average number of lossless coded bits of the same complexity level as the current channel of the coded channel, and d[i] is the update rate.
[0360] (3) Determine the average number of lossless coding bits avg_lossless_bits:
[0361] avg_lossless_bits[i]=avg_lossless_bits[i]*(1–e[i])+pred_lossless_bits[i]*e[i]
[0362] Determine the target number of bits for each channel component of the current block, which can be achieved by:
[0363] (1) Determine the quality ratio quality_ratio:
[0364] Implementation 1: Determine the quality ratio quality_ratio[i] of each channel component of the current block:
[0365] quality_ratio[i]=bpp[i] / (ave_lossless_bits[i]–comp_offset[i])
[0366] Implementation method 2: The calculation of quality_ratio still adopts the cu (Coding Unit) level, and the calculation process is the same as the above step S7031, but the above ave_lossless_bits[i] needs to be merged into a cu level variable.
[0367] (2) Determine the target number of bits target_bits:
[0368] Implementation method 1: target_bits[i]=quality_ratio[i]*(lossless_bits[i][comp_level[i]]-comp_offset[i])
[0369] For the subsequent step (3), target_bits and lossless_bits need to be synthesized from the cb level (channel level) to the cu level.
[0370] Implementation 2 corresponds to implementation 2 in step (1). At this time, the calculation method of the target bit number target_bits is the same as in step S703, and the obtained target_bits is already a cu-level variable. For the subsequent step (3), it is also necessary to merge the cb-level lossless_bits[i] into the cu-level.
[0371] (3) Limiting the target number of bits according to the buffer status and complexity is the same as step S703 above and will not be described again here.
[0372] Determine the quantization parameters of each channel component of the current block, which can be achieved as follows:
[0373] Implementation method 1: Determine the quantization parameters of each channel component:
[0374] qp[i]=(lossless_bits[i][comp_level[i]]–target_bits[i])*p[i]
[0375] If step (3) takes effect, that is, the upper and lower limits have a limiting effect, and the value of target_bits is modified to the upper or lower limit, then according to the ratio of target_bits[i] obtained in steps (1) to (2), target_bits is reallocated to obtain a new target_bits[i]; if target_bits is not modified by step (3), the value of target_bits[i] will not change.
[0376] Implementation method 2: If target_bits have not been separated before, target_bits are separated according to the complexity level.
[0377] Implementation method 3: All variables before this step are at the CU level. At this time, the reference quantization parameter ref_qp is separated according to the complexity, and the separated qp is used as the final brightness and chrominance qp.
[0378] In the above process, assuming that the cu variable to be split is temp, the implementation of splitting the cu-level variable into the cb-level variable can be:
[0379] temp[i]=temp*k[i], where 0<=k[i]<=1 and ∑k[i]=1.
[0380] The value of k is related to the complexity. One implementation of k is k[i]=comp_level[i] / ∑comp_level[i]. Another implementation is to preset a table, where the table index value is the complexity level.
[0381] In addition, the cb-level variables need to be combined into cu-level variables. Assume that the cu variable to be combined is temp[i]. The specific combining process is:
[0382] temp=(temp[0]+temp[1]*sample_rate) / (1+sample_rate)
[0383] In another specific embodiment of the present application, the code control parameters of the above-mentioned video image decoding method may also be fixed-pointed, which may be achieved through the following process:
[0384] S1: Code control initialization
[0385] Initialize the code control parameters before decoding each video slice: WarmUp, EndControlLine, EndControlBlocks, EndControlBegin, EndTargetFullness and MaxBufferSize. The specific initialization can be as follows:
[0386]
[0387]
[0388] The above parameters are all intermediate parameters of the code control initialization process, which are used to realize the fixed-point of code control parameters. Among them, WarmUp[i] (0<=i<=4) represents the starting number of block update rate parameters, which are used to update the AdjComplexity of lossless coding bits of the same level; ComplexityShift represents the number of shifts for the fixed-point operation of complexity-related operations; InfoRatioShift represents the number of shifts for the fixed-point operation of quality ratio-related operations; BppShift represents the number of shifts for the fixed-point operation of bpp-related operations; FullnessShift represents the number of shifts for the fixed-point operation of fullness-related operations; AvgComplexityShift represents the number of shifts for the fixed-point operation of average lossless coding bits The number of bits; ChromaSampleRateShift indicates the number of shifts performed by fixed-point sampling rate operations; K1Shift indicates the number of shifts performed by fixed-point k1 (see Table 4) operations; K2Shift indicates the number of shifts performed by fixed-point k2 operations; K3Shift indicates the number of shifts performed by fixed-point k3 operations; K4Shift indicates the number of shifts performed by fixed-point k4 operations; BiasShift indicates the number of shifts performed by fixed-point Bias operations; K2, K3, K4 are fixed empirical values used in the code control algorithm; DelayBits indicates the number of delay bits; TargetBpp Indicates the target bpp, which is configured externally; TransmissionDelayCu indicates the number of CUs of the initial transmission delay; EndDecreaseBits indicates the number of bits that need to be reduced at the end of the slice due to the initial delay function; RcBufferSize indicates the buffer size considered by the code control; MuxWordSize indicates the percentage of header information required for the sub-stream parallel function; EndControlBlocks indicates the number of blocks that need to operate on the maximum value of the buffer due to the initial transmission delay slice end; DecreaseStepLog2 indicates the logarithmic value of the step size of each control block that the MaxBufferSize used by the rate control module decreases at the end of the slice, and its value is in the code stream header; EndControlBegin indicates the index of the block where control starts at the end of the slice; SliceWidthInCu indicates how many CUs are in the width of the slice; SliceHeightInCu indicates how many CUs are in the height of the slice; EndTargetFullness indicates the target fullness at the end of the slice; RemainBlksLog2 indicates the highest binary digit of the total number of coding units in a stripe; MaxBufferSize indicates the maximum value of the buffer.
[0389] According to BitDepth[0] (indicating the bpc of the Y channel), ImageFormat looks up Table 1 to obtain the initialization values of AdjComplexity (the number of lossless coding bits at the same level), AvgComplexity (the average number of lossless coding bits), ComplexityOffset (the bias value for complexity calculation), MaxComp (the maximum number of lossless coding bits), and K1 (the empirical value).
[0390] Table 4:
[0391]
[0392] Table 4 above shows the correspondence between AdjComplexity, AvgComplexity, ComplexityOffset, MaxComp, K1, BitDepth[0], and ImageFormat.
[0393] According to ImageFormat (image format), the initialization values of ChromaSampleRate (sampling rate), InvElem (removing the multiplier required for division related to the sampling rate), InvElemShift (removing the shift value required for division related to the sampling rate) and FormatBias (bias value for qp for different image formats) can be obtained from Table 5 below.
[0394] Table 5:
[0395] ImageFormat YUV400 YUV420 YUV422 RGB444 YUV444 ChromaSampleRate 0 1 2 4 4 InvElem 1 85 1 85 85 InvElemShift 0 7 1 8 8 FormatBias 0 114 85 128 57
[0396] Table 5 above shows the correspondence between ChromaSampleRate, InvElem, InvElemShift, FormatBias and ImageFormat.
[0397] S2: Determine the quantization parameter. This step can be implemented as follows:
[0398] S21: Calculate the quantization parameter MasterQp of the coding unit according to the brightness complexity level ComplexityLevel[0] and the chrominance complexity level ComplexityLevel[1] of the current coding unit.
[0399] S22: Calculate quantization parameters Qp[0] and Qp[1] of the luma coding block and chroma coding block of the current coding unit according to MasterQp.
[0400] The calculation of the quantization parameter MasterQp of the coding unit according to the brightness complexity level ComplexityLevel[0] and the chrominance complexity level ComplexityLevel[1] of the current coding unit can be implemented as follows:
[0401]
[0402]
[0403]
[0404] Among them, bppAdj represents the adjustment value of bpp; BitsRecord represents the total number of bits currently decoded; CurrBlocks represents the number of blocks currently decoded; maxComp represents the value that needs to be transformed for MaxComp to perform fixed-point coding; complexityOffset represents the value that needs to be transformed for ComplexityOffset to perform fixed-point coding; RcBufferSizeMaxBit represents the code stream buffer size. The value of RcBufferSize is equal to the value of rc_buffer_size, and the value of RcBufferSizeMaxBit represents the highest binary digit of RcBufferSize; shiftCur represents the current shift value; tmp represents the intermediate variable generated during the process of fixed-point coding; fullness represents the fullness; infoRatio represents the quality ratio; relativeComplexity represents the number of relatively lossless coded bits; minRate1, minRate2 and minRate13 represent the intermediate variables for calculating minRate; minRate represents the lower limit of targetRate; target tRate represents the target number of bits; bppOffset1, bppOffset2 and bppOffset3 are intermediate variables for calculating bppOffset; bppOffset represents the offset value of bpp; maxRate represents the upper limit of targetRate; InverseTable is a preset table whose definition is: InverseTable = {1024,512,341,256,205,171,146,128,114,102,93,85,79,73,68,64,60,57,54,51,49,47,45,43,41,39,38,37,35,34,33,32}
[0405] The calculation of the quantization parameters Qp[0] and Qp[1] of the luminance coding block and the chrominance coding block of the current coding unit according to MasterQp can be implemented as follows:
[0406] Obtain BiasInit from Table 6 below according to the brightness complexity level ComplexityLevel[0] and the chrominance complexity level ComplexityLevel[1] of the previous coding unit;
[0407] Table 6: Definition of BiasInit
[0408]
[0409] The calculation of the brightness quantization parameter Qp[0] and the chrominance quantization parameters Qp[1] and Qp[2] can be specifically implemented as follows:
[0410]
[0411] S3: Code control parameter update
[0412] Input the actual number of bits CuBits of the current coding unit, the luminance quantization parameter Qp[0], the chrominance quantization parameter Qp[1] and the complexity CuComplexityLevel of the current coding unit, and calculate the actual lossless coding bit number compCur of the current block according to the actual coding overhead and quantization parameters, which can be implemented as follows:
[0413]
[0414] Update the code control parameters AvgComplexity and AdjComplexity according to the actual lossless coding bit number compCur of the current block, which can be achieved as follows:
[0415]
[0416] Update the code control parameter MaxBufferSize, which can be achieved as follows:
[0417]
[0418]
[0419] It should be noted that any solution not specifically described in the above solution can be performed on the decoding side or the encoding side.
[0420] It should be noted that, in the absence of conflict, part or all of the contents of any multiple embodiments above may constitute a new embodiment.
[0421] The embodiment of the present application provides a video image decoding device, which can be a video image decoder, a video encoder, or a video decoder. Specifically, the video image decoding device is used to execute the steps performed by the video image decoder in the above video image decoding method. The video image decoding device provided in the embodiment of the present application may include modules corresponding to the corresponding steps.
[0422] The embodiment of the present application can divide the functional modules of the video image decoding device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. The division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0423] In the case of dividing each functional module into corresponding functional modules, Fig.11 A possible structural diagram of the video image decoding device involved in the above embodiment is shown. Fig.11 As shown, the video image decoding device 1100 includes a complexity level determination module 1101 , a coding parameter determination module 1102 , a quantization parameter determination module 1103 and a decoding module 1104 .
[0424] The complexity level determination module 1101 is used to obtain at least two channel-level complexity levels of the current block in the image to be processed, and determine the block-level complexity level of the current block based on the at least two channel-level complexity levels; the above-mentioned channel-level complexity level is used to characterize the complexity of the channel-level texture of the current block.
[0425] The coding control parameter determination module 1102 is used to determine the target number of bits of the current block according to the coding control parameters, where the coding control parameters include the block level complexity level of the current block.
[0426] The quantization parameter determination module 1103 is used to determine the quantization parameter of the current block based on the target number of bits.
[0427] The decoding module 1104 is configured to decode the current block based on the quantization parameter.
[0428] In one example, the above-mentioned code control parameters include the average number of lossless coding bits at the same level, the average number of lossless coding bits and the fullness of the code stream buffer; the above-mentioned code control parameter determination module is specifically used to: determine the average number of lossless coding bits at the same level and the average number of lossless coding bits; determine the initial target number of bits based on the average number of lossless coding bits at the same level and the average number of lossless coding bits; determine the target number of bits of the current block based on the fullness of the code stream buffer, the block-level complexity level of the current block and the initial target number of bits; wherein the above-mentioned average number of lossless coding bits at the same level is the average value of the predicted value of the number of bits required for lossless coding of the current block and multiple decoded image blocks, and the above-mentioned multiple decoded image blocks have the same complexity level as the current block; the average number of lossless coding bits is the average value of the predicted value of the number of bits required for lossless coding of the current block and all decoded image blocks; the fullness of the code stream buffer is used to characterize the fullness of the buffer, and the above-mentioned buffer is used to store the code stream of the image to be processed.
[0429] In one example, the above-mentioned code control parameter determination module is specifically used to determine the average number of lossless coding bits at the same level and the average number of lossless coding bits: determine the number of lossless coding bits of the current block, the number of lossless coding bits is the predicted value of the number of bits required for lossless coding of the current block; update the average number of lossless coding bits of the current block at the same level based on the number of lossless coding bits of the current block and multiple historical average number of lossless coding bits at the same level; the historical average number of lossless coding bits at the same level is the average number of lossless bits of the same level of decoded image blocks with the same complexity level as the current block; update the average number of lossless coding bits of the current block based on the number of lossless coding bits of the current block and all historical average number of lossless coding bits; the historical average number of lossless coding bits is the average number of lossless bits of the decoded image blocks.
[0430] In a possible implementation, the current block is the first row block of the image to be processed, and the coding control parameters include first row quality improvement parameters; the coding control parameter determination module is specifically used to determine the target number of bits of the current block according to the coding control parameters, and also includes: adjusting the target number of bits of the current block according to the first row quality improvement parameters to reduce the quantization parameter of the current block.
[0431] In a possible implementation, the current block is the first column block of the image to be processed, and the coding control parameters include the first column quality improvement parameters; the coding control parameter determination module is specifically used to determine the target number of bits of the current block according to the coding control parameters, and also includes: adjusting the target number of bits of the current block according to the first row quality improvement parameters to reduce the quantization parameter of the current block.
[0432] In one example, the complexity level determination module is specifically used to: obtain at least two channel-level complexity levels of the current block in the image to be processed, obtain the channel-level texture information of the current block at the encoding end, and determine the channel-level complexity level of the current block based on the channel-level texture information; or at the decoding end, obtain the channel-level complexity level from the bitstream, and the bitstream is the encoded bitstream of the current block.
[0433] In one example, the complexity level determination module is specifically used to obtain the channel-level complexity level from the bitstream: obtain the complexity information bit of the current block from the bitstream, the complexity information bit is used to represent the channel-level complexity level of the current block; determine the channel-level complexity level based on the complexity information bit.
[0434] In one example, the complexity level determination module is specifically used to obtain channel-level texture information of the current block, and determine the channel-level complexity level of the current block based on the channel-level texture information: taking at least one channel image block in the current block as a processing unit, dividing the processing unit into at least two sub-units, and determining the texture information of each sub-unit; in the processing unit, determining the block-level complexity level of the current block based on the texture information of each sub-unit.
[0435] In one example, the complexity level determination module is specifically used to determine the texture information of each sub-unit: obtaining the original pixel value of the sub-unit, the original pixel value or reconstructed value of the adjacent column on the left side of the sub-unit, and the reconstructed value of the adjacent row above the sub-unit, and correspondingly calculating the horizontal texture information and vertical texture information of the sub-unit; selecting the minimum value in the horizontal texture information and the vertical texture information as the texture information of the corresponding sub-unit.
[0436] In one example, the complexity level determination module is specifically used to determine the block complexity level of the current block in a processing unit based on the texture information of each sub-unit: in the processing unit, the texture information of each sub-unit is divided into corresponding sub-unit complexity levels based on multiple thresholds, and the multiple thresholds are pre-set; the block complexity level of the current block is determined based on the complexity level of each sub-unit.
[0437] In one example, the complexity level determination module is specifically used to determine the block complexity level of the current block based on the complexity levels of each sub-unit: mapping each sub-unit complexity level to a corresponding channel-level complexity level according to preset rules; and determining the block-level complexity level of the current block based on each channel-level complexity level.
[0438] In one example, the complexity level determination module is specifically used to map each sub-unit complexity level to a corresponding channel-level complexity level according to preset rules: the channel-level complexity level is determined based on multiple thresholds and the sum of the sub-unit complexity levels, and the multiple thresholds are pre-set.
[0439] In one example, the complexity level determination module is specifically used to map each sub-unit complexity level to a corresponding channel-level complexity level according to preset rules: determine the level composition of the sub-unit complexity level, and determine the corresponding channel-level complexity level according to the level composition.
[0440] In one example, the complexity level determination module is specifically used to determine the block-level complexity level of the current block based on each channel-level complexity level: taking the maximum value, minimum value or weighted value of each channel-level complexity level as the block-level complexity level of the current block; or determining the block-level complexity level of the current block based on multiple thresholds and the sum of each channel-level complexity level, and the multiple thresholds are pre-set.
[0441] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0442] Of course, the video image decoding device provided in the embodiment of the present application includes but is not limited to the above modules. For example, the video image decoding device may also include a storage module.
[0443] The storage module can be used to store program codes and data of the video image decoding device.
[0444] An embodiment of the present application further provides an electronic device, which includes the above-mentioned video image decoding device 1100, and the video image decoding device 1100 executes the method executed by any one of the video image decoders provided above.
[0445] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer executes the method executed by any one of the video decoders provided above.
[0446] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.
[0447] The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for implementing the functions of the above-mentioned video image decoding device 100. Optionally, the functions supported by the chip can be referred to above and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gatearray, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
[0448] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions 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 instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. 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 a data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0449] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.
[0450] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0451] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0452] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A video image decoding method, characterized in that: include: Acquire complexity information bits of a current block from a bitstream, where the complexity information bits are used to indicate a channel-level complexity level of the current block; Determining a channel-level complexity level according to the complexity information bit, the bitstream is a coded bitstream of the current block, and determining a block-level complexity level of the current block according to at least two channel-level complexity levels; the channel-level complexity level is used to characterize the complexity of the channel-level texture of the current block; Determining a target number of bits of the current block according to a coding control parameter, wherein the coding control parameter includes the block level complexity level of the current block; Determining a quantization parameter of the current block based on the target number of bits; decoding the current block based on the quantization parameter; The code control parameters include the average number of lossless coding bits at the same level, the average number of lossless coding bits, and the fullness of the code stream buffer; The determining the target number of bits of the current block according to the code control parameter includes: Determining the average number of lossless coded bits at the same level and the average number of lossless coded bits; Determine an initial target number of bits based on the average number of lossless coded bits at the same level and the average number of lossless coded bits; Determine a target number of bits for the current block based on the fullness of the code stream buffer, the block level complexity level of the current block, and the initial target number of bits; The average number of lossless coding bits at the same level is an average of predicted values of the number of bits required for lossless coding of the current block and multiple decoded image blocks, and the complexity level of the multiple decoded image blocks is the same as that of the current block.
2. The video image decoding method according to claim 1, characterized in that: The first bit of the complexity information bit is used to indicate whether the current channel-level complexity level is the same as the same channel-level complexity level of the previous image block of the current block and the change value between the two; if they are the same, the complexity information bit is 1 bit; if they are different, the complexity information bit is 3 bits.
3. The video image decoding method according to claim 1, characterized in that: The average lossless coding bit number is the average value of the predicted bit number required for lossless coding of the current block and all decoded image blocks; the fullness of the code stream buffer is used to represent the fullness of the buffer, and the buffer is used to store the code stream of the image to be processed.
4. The video image decoding method according to claim 3, characterized in that: The determining the average number of lossless coding bits at the same level and the average number of lossless coding bits includes: Determine the number of lossless coding bits of the current block, where the number of lossless coding bits is a predicted value of the number of bits required for lossless coding of the current block; updating the average number of lossless coded bits of the current block at the same level according to the number of lossless coded bits of the current block and a plurality of historical average number of lossless coded bits of the same level; the historical average number of lossless coded bits of the same level is the average number of lossless bits of the same level of decoded image blocks with the same complexity level as the current block; The average number of lossless coding bits of the current block is updated according to the number of lossless coding bits of the current block and all historical average number of lossless coding bits; the historical average number of lossless coding bits is the average number of lossless bits of decoded image blocks.
5. The video image decoding method according to claim 1, characterized in that: The current block is the first row block of the image to be processed, and the coding control parameters include first row quality improvement parameters; When determining the target number of bits of the current block according to the coding control parameter, the method further includes: The target number of bits of the current block is adjusted according to the first-line quality improvement parameter to reduce a quantization parameter of the current block.
6. The video image decoding method according to claim 1, characterized in that: The current block is the first column block of the image to be processed, and the coding control parameters include the first column quality improvement parameters; When determining the target number of bits of the current block according to the coding control parameter, the method further includes: The target number of bits of the current block is adjusted according to the first column quality improvement parameter to reduce the quantization parameter of the current block.
7. A video image decoding device, characterized in that: The device comprises: A complexity level determination module, configured to obtain a complexity information bit of a current block from a bitstream, wherein the complexity information bit is used to indicate a channel-level complexity level of the current block; determine a channel-level complexity level according to the complexity information bit, wherein the bitstream is an encoded bitstream of the current block, and determine a block-level complexity level of the current block according to at least two channel-level complexity levels; the channel-level complexity level is used to characterize a complexity level of a channel-level texture of the current block; A coding control parameter determination module, used to determine a target number of bits of a current block according to a coding control parameter, wherein the coding control parameter includes a block level complexity level of the current block; A quantization parameter determination module, used to determine a quantization parameter of a current block based on a target number of bits; A decoding module, used for decoding a current block based on a quantization parameter; The code control parameters include the average number of lossless coding bits at the same level, the average number of lossless coding bits, and the fullness of the code stream buffer; The code control parameter determination module is further used to determine the average number of lossless coding bits at the same level and the average number of lossless coding bits; determine the initial target number of bits based on the average number of lossless coding bits at the same level and the average number of lossless coding bits; determine the target number of bits of the current block based on the fullness of the code stream buffer, the block level complexity level of the current block and the initial target number of bits; The average number of lossless coding bits at the same level is an average of predicted values of the number of bits required for lossless coding of the current block and multiple decoded image blocks, and the complexity level of the multiple decoded image blocks is the same as that of the current block.
8. A decoder, characterized in that: The decoder is configured to perform the method according to any one of claims 1 to 6.
9. A video decoding system, characterized in that: The method comprises a decoder for executing the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed on the computer, the computer is caused to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Reversible information hiding method and system based on pixel value sorting prediction and diamond prediction
CN113099067A
Image coding method and device, equipment and storage medium
CN113784126A
