Video image decoding method, video image encoding method, apparatus, and storage medium
By determining channel-level and block-level complexity levels and adjusting quantization parameters based on rate control, the method optimizes quantization in video encoding/decoding, enhancing image quality and efficiency.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2023-06-30
- Publication Date
- 2026-05-07
AI Technical Summary
The challenge in video encoding/decoding technology lies in selecting appropriate quantization parameters to balance image quality and efficiency, as inappropriate choices can lead to image distortion.
A method is provided to determine channel-level and block-level complexity levels from a code stream, using rate control parameters to optimize quantization parameters for improved image quality and visual experience, by calculating target bits and adjusting quantization parameters based on channel-level and block-level complexity.
This approach enhances the selection of quantization parameters, improving image quality and visual experience while ensuring coding/decoding efficiency.
Smart Images

Figure 0007855137000057 
Figure 0007855137000058 
Figure 0007855137000059
Abstract
Description
Cross - reference to related applications
[0001] The present invention claims priority based on a Chinese patent application with application number 202210887907.9, filed on July 26, 2022. Herein, all of its content is incorporated into the present invention by reference.
Technical Field
[0002] The present invention relates to the field of video encoding / decoding technology, and particularly to a video image decoding method, a video image encoding method, an apparatus, and a storage medium.
Background Art
[0003] In the field of video processing, video encoding / decoding technology plays an important role. Video encoding / decoding technology is a technology that reduces the amount of video data by encoding and decoding video. Among them, quantization is an important step in the process of video encoding and decoding. Mainly, by using quantization parameters instead of some original data in the code stream, the reduction of the redundancy of the original data in the code stream is realized. The quantization parameter for quantization is written into the code stream during the video encoding process. On the video decoding side, decoding is realized by analyzing the quantization parameter in the code stream. However, quantization is also accompanied by the risk of image distortion. Therefore, selecting an appropriate quantization parameter has the effect of improving the quality of the image. Therefore, how to select the quantization parameter is the key to video encoding / decoding technology.
Summary of the Invention
Problems to be Solved by the Invention
[0004] Embodiments of the present invention provide a video image decoding method, a video image encoding method, an apparatus, and a storage medium, which are useful for improving the quality of images by video encoding / decoding and improving the visual experience.
Means for Solving the Problems
[0005] To achieve the above-mentioned objectives, the embodiments of the present invention employ the following technical approach.
[0006] In a first aspect, embodiments of the present invention provide a video image decoding method and a video image encoding method, the method being applied to a video encoding device, a video decoding device, or a chip for a video encoding and decoding device. The method includes obtaining channel-level complexity levels from a code stream, determining a block-level complexity level of a current block according to at least two channel-level complexity levels, wherein the code stream is an encoded code stream of the current block, and the channel-level complexity levels are for indicating the degree of complexity of the channel-level texture of the current block, determining a target number of bits for the current block based on a rate control parameter, wherein the rate control parameter includes the block-level complexity level of the current block, determining a quantization parameter for the current block based on the target number of bits, and decoding the current block based on the quantization parameter.
[0007] The above quantization parameters play a crucial role in the video coding and decoding processes. The video coding / decoding method provided by the present invention allows the video coding / decoding device to obtain channel-level complexity levels from a code stream, determine the block-level complexity level of the current block according to at least two channel-level complexity levels, determine the target number of bits for the current block based on rate control parameters including the block-level complexity level, and further determine the quantization parameters for the current block based on the target number of bits. Following this process, the video coding / decoding method provided by the present invention can optimize the selection of quantization parameters, improve the image quality of the video coding / decoding, and enhance the visual experience.
[0008] In one possible implementation, the rate control parameters include the average number of bits for lossless coding at the same level, the average number of bits for lossless coding, and the code stream buffer fullness. Determining the target number of bits for the current block based on the rate control parameters includes determining the average number of bits for lossless coding at the same level and the average number of bits for lossless coding, determining the initial target number of bits based on the average number of bits for lossless coding at the same level and the average number of bits for lossless coding, and determining the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, and the initial target number of bits. Here, the average number of bits for same-level reversible coding is the average of the predicted number of bits required to reversibly encode the current block and a plurality of decoded image blocks, and the complexity level of the plurality of decoded image blocks is the same as the complexity level of the current block, the average number of bits for reversible coding is the average of the predicted number of bits required to reversibly encode the current block and all decoded image blocks, the code stream buffer fullness indicates the fullness of the buffer, and the buffer is for storing the code stream of the image to be processed.
[0009] In such possible implementations, a method for determining the target number of bits for the current block is provided. By introducing the same-level reversible coding average number of bits and the reversible coding average number of bits to determine the initial target number of bits, and then determining the target number of bits for the current block based on the initial target number of bits, the code stream buffer fullness, and the block-level complexity level, the determination of quantization parameters can be made more accurate, and furthermore, it is possible to improve image quality while guaranteeing coding / decoding efficiency.
[0010] In one possible implementation, determining the same-level reversible coding average bit count and the reversible coding average bit count includes determining the reversible coding bit count of the current block, where the reversible coding bit count is a predicted value of the number of bits required to reversibly encode the current block; updating the same-level reversible coding average bit count of the current block based on the current block's reversible coding bit count and a plurality of past same-level reversible coding average bit counts, where the past same-level reversible coding average bit counts are the same-level reversible coding average bit counts of decoded image blocks having the same complexity level as the block-level complexity level of the current block; and updating the current block's reversible coding average bit count based on the current block's reversible coding bit count and all past reversible coding average bit counts, where the past reversible coding average bit counts are the reversible coding average bit counts of decoded image blocks.
[0011] In such possible implementations, a method is provided to determine the average number of bits for lossless coding at the same level and the average number of bits for lossless coding based on the current number of bits for lossless coding of a block, the average number of bits for lossless coding at the same level in the past, and the average number of bits for lossless coding at the past, which helps to improve the feasibility of the proposed technology. By matching the average number of bits for lossless coding at the same level to the complexity level of a block, the selection of quantization parameters can be optimized, and an effect of further improving image quality can be obtained.
[0012] In one possible implementation, the current block is the first row block of the image to be processed, the rate control parameter includes a first row quality improvement parameter, and determining the target number of bits of the current block based on the rate control parameter further includes adjusting the target number of bits of the current block based on the first row quality improvement parameter so that the quantization parameter of the current block becomes smaller.
[0013] In such possible implementations, we provide an alternative method for determining the target number of bits for the current block, applicable to scenarios where the current block is the first row block. When the current block is the first row block, prediction becomes more difficult. Since the prediction error is transitive, this implementation mitigates the above effect and improves the image quality of video encoding / decoding by introducing a first-row quality improvement parameter to reduce the quantization parameter of the first row block.
[0014] In one possible implementation, the current block is the first row block of the image to be processed, the rate control parameter includes a first row quality improvement parameter, and determining the target number of bits of the current block based on the rate control parameter further includes adjusting the target number of bits of the current block based on the first row quality improvement parameter so that the quantization parameter of the current block becomes smaller. In such possible implementations, we provide an alternative method for determining the target number of bits for the current block, applicable to scenarios where the current block is the first column block. When the current block is the first column block, prediction becomes more difficult. Since the prediction error is transitive, this implementation mitigates the above effect and improves the image quality of video encoding / decoding by introducing a first column quality improvement parameter to reduce the quantization parameter of the first column block.
[0015] In one possible implementation, obtaining a channel-level complexity level from a code stream includes obtaining complexity information bits of the current block from the code stream, the complexity information bits being for indicating the channel-level complexity level of the current block, and determining the channel-level complexity level based on the complexity information bits.
[0016] In such possible implementations, the decoding side provides a method for obtaining the channel-level complexity level. The channel-level complexity level is obtained by analyzing information bits that indicate the channel-level complexity level of the current block in the encoded code stream. In one possible scenario, the complexity information bits may be 1 bit or 3 bits, and the most significant bit of the complexity information bits indicates whether the current channel-level complexity level is the same as the complexity level of the same channel in the image block immediately preceding the current block, and the change 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 in the current block, then the complexity level of the same channel in the previous image block indicates the complexity level of the U channel in the image block decoded before the current block. If the result of the determination by the most significant bit is the same, the complexity information bits are 1 bit; otherwise, the complexity information bits are 3 bits, and the lower 2 bits indicate the change between the channel-level complexity level of the current block and the complexity level of the same channel in the image block immediately preceding the current block. Based on the change value and the channel complexity level of the same channel in the previous image block, the currently required channel-level complexity level can be determined. Furthermore, the above scenario is merely an illustrative explanation, and the scope of protection for this possible implementation is not limited thereto. It is understood that the feasibility of the technical proposal can be improved by providing a specific method for obtaining the channel-level complexity level on the decoding side.
[0017] In a second aspect, embodiments of the present invention provide a video image encoding method, which is applied to a chip of a video encoding device. The method includes: obtaining channel-level texture information of a current block; determining a channel-level complexity level of the current block based on the channel-level texture information; determining a block-level complexity level of the current block according to at least two channel-level complexity levels, the channel-level complexity levels being for indicating the degree of complexity of the channel-level texture of the current block; determining a target number of bits of the current block based on a rate control parameter, the rate control parameter including the block-level complexity level of the current block; determining a quantization parameter of the current block based on the target number of bits; and encoding the current block based on the quantization parameter.
[0018] In such possible implementations, a method is provided for obtaining the channel-level complexity level of the current block. On the encoding side, the channel-level complexity level of the current block is determined based on the channel-level texture information of the current block. On the decoding side, the channel-level complexity level of the current block is obtained from the received encoded code stream. By providing a method for obtaining the channel-level complexity level of the current block during the encoding and decoding processes, the feasibility of the proposed technology can be improved, and it becomes easier to determine other rate control parameters and target bit counts based on the subsequently obtained channel-level complexity level, thereby optimizing the quantization parameters.
[0019] In one possible implementation, obtaining channel-level texture information of a current block and determining the channel-level complexity level of the current block based on the channel-level texture information includes: treating an image block with at least one channel in the current block as a processing unit, dividing the processing unit into at least two subunits, determining the texture information of each subunit, and determining the block-level complexity level of the current block based on the texture information of each subunit within the processing unit.
[0020] In such possible implementations, a method is provided for determining the channel-level complexity level of the current block, which is applied to the encoding side, thereby improving the feasibility of the proposed technology. Among these, treating at least one channel of the current block as a single processing unit, and further dividing each processing unit into at least two subunits, helps to improve the accuracy of the complexity information.
[0021] In one possible implementation, determining the texture information for each subunit involves obtaining the original pixel value of the subunit, the original or reconstructed pixel value of the adjacent column to the left of the subunit, and the reconstructed value of the adjacent row above the subunit, calculating the horizontal and vertical texture information for the corresponding subunit, and selecting the minimum value from the horizontal and vertical texture information as the texture information for the corresponding subunit.
[0022] In such possible implementations, we provide an implementation method for determining the texture information of subunits, thereby improving the feasibility of the proposed technology.
[0023] In one possible implementation, in the processing unit, determining the block-level complexity level of the current block based on the texture information of each sub-unit includes dividing the texture information of each sub-unit into the complexity levels of the corresponding sub-units based on a plurality of thresholds, where the plurality of thresholds are pre-set, and determining the block-level complexity level of the current block based on the complexity levels of each sub-unit.
[0024] In such a possible implementation, by setting a plurality of thresholds, it is provided to divide the texture information of each sub-unit into the complexity levels of the corresponding sub-units and determine the block-level complexity level of the current block based on the complexity levels of each sub-unit, which helps to improve the feasibility of the technical solution.
[0025] In one possible implementation, determining the block-level complexity level of the current block based on the complexity levels of each sub-unit includes mapping the complexity levels of each sub-unit to the corresponding channel-level complexity levels based on preset rules, and determining the block-level complexity level of the current block based on the channel-level complexity levels of each channel.
[0026] In such a possible implementation, a method is provided to map the complexity levels of each sub-unit to the corresponding channel-level complexity levels and further determine the block-level complexity level of the current block according to the channel-level complexity level of the current block, which helps to improve the feasibility of the technical solution.
[0027] In one possible implementation, mapping the complexity levels of each sub-unit to the corresponding channel-level complexity levels based on preset rules includes determining the channel-level complexity level based on a plurality of thresholds and the sum of the complexity levels of each sub-unit, where the plurality of thresholds are pre-set.
[0028] In such possible implementations, a method is provided to determine the channel-level complexity level based on multiple thresholds and the sum of the complexity levels of each subunit, which helps to improve the feasibility of the proposed technology.
[0029] In one possible implementation, mapping the complexity level of each subunit to the corresponding channel-level complexity level based on preset rules involves determining the level configuration of the subunit's complexity level and determining the corresponding channel-level complexity level based on that level configuration.
[0030] In such possible implementations, a method is provided to determine the corresponding channel-level complexity level based on the level configuration of the subunit complexity levels, which helps to improve the feasibility of the proposed technology.
[0031] In one possible implementation, determining the current block-level complexity level of a block based on the complexity level of each channel level is: Obtain the maximum, minimum, or weighted value of the complexity level for each channel level as the complexity level for the current block level, or This includes determining the block-level complexity level of the current block based on the sum of a plurality of thresholds and the complexity levels of each channel level, wherein the plurality of thresholds are predetermined.
[0032] In such possible implementations, we provide two methods for determining the complexity level of the current block based on the complexity level of each channel, which helps to improve the feasibility of the technical proposal.
[0033] In one possible implementation, the current block is a multi-channel image block, and each channel component of the multi-channel image block jointly or independently determines the same-level lossless encoding bit count and the target bit count.
[0034] In such possible implementations, it is provided that each channel component of a multi-channel image block jointly or independently determines the same-level lossless encoding bit count and the target bit count, which helps to improve the feasibility of the proposed technology.
[0035] In one possible implementation, the current block is a multi-channel image block, and each channel component of the multi-channel image block jointly or independently determines the complexity level of the channel class.
[0036] In such possible implementations, it is possible to provide a system in which each channel component of a multi-channel image block jointly or independently determines the complexity level of the channel class, which helps to improve the feasibility of the proposed technology.
[0037] The 3 In one embodiment, the present invention provides a video encoding / decoding device having the function of implementing a video image decoding method or a video image encoding method according to any one of the first embodiments. This function can be implemented by hardware, or by the hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the function.
[0038] The 4 In one embodiment, a video encoder is provided, which includes a processor and memory, the memory for storing computer execution instructions, and when the video encoder is activated, the processor executes the computer execution instructions stored in the memory to cause the video encoder to execute the video image decoding method or video image encoding method of any one of the first embodiments.
[0039] The 5In one embodiment, a video decoder is provided, which includes a processor and memory, the memory for storing computer execution instructions, and when the video decoder is activated, the processor executes the computer execution instructions stored in the memory to cause the video decoder to execute the video image decoding method or video image encoding method of any one of the first embodiments.
[0040] The 6 In one embodiment, a computer-readable storage medium is provided, and an instruction is stored in the computer-readable storage medium. When the instruction is executed on a computer, the computer is instructed to execute the video image decoding method or video image encoding method of any one of the first embodiments.
[0041] The 7 As an embodiment, a computer program product including instructions is provided, and when the computer program product is executed on a computer, the computer is made to execute the video image decoding method of any one of the first embodiments.
[0042] The 8 In one embodiment, an electronic device is provided, the electronic device including a video encoding / decoding device, and the processing circuit is configured to perform the video image decoding method or video image encoding method of any one of the first embodiments.
[0043] The 9 In one embodiment, a chip is provided, the chip includes a processor, the processor is coupled with memory, program instructions are stored in the memory, and when the program instructions stored in memory are executed by the processor, the video image decoding method or video image encoding method of any one of the first embodiments is executed.
[0044] The 10As an embodiment, a video encoding and decoding system is provided, the system comprising a video encoder and a video decoder, wherein the video encoder is configured to perform a video image decoding method or a video image encoding method according to any one of the first embodiments, and the video decoder is configured to perform a video image decoding method or a video image encoding method according to any one of the first embodiments.
[0045] The 3 Characteristics ~ No. 10 The technical effects of any one embodiment in the embodiments can refer to the technical effects of the corresponding embodiment in the first embodiment. A detailed explanation of this is omitted here. [Brief explanation of the drawing]
[0046] [Figure 1] Figure 1 is a system architecture diagram of an encoding and decoding system provided by an embodiment of the present invention. [Figure 2] Figure 2 is a schematic diagram of a video encoder provided in an embodiment of the present invention. [Figure 3] Figure 3 is a schematic diagram of a video decoder provided in an embodiment of the present invention. [Figure 4] Figure 4 is a schematic flowchart of video decoding provided in an embodiment of the present invention. [Figure 5] Figure 5 is a schematic diagram of a video decoder provided in an embodiment of the present invention. [Figure 6] Figure 6 is a flowchart of a video image decoding method and a video image encoding method provided in an embodiment of the present invention. [Figure 7] Figure 7 is a flowchart showing specific examples of video image decoding methods and video image encoding methods provided by embodiments of the present invention. [Figure 8] Figure 8 is a flowchart showing how to determine the block-level complexity level using the video image decoding method and video image encoding method provided in the embodiment of the present invention. [Figure 9]Figure 9 is a schematic diagram of the texture information of a subblock of a specific example of a video image decoding method and a video image encoding method provided by an embodiment of the present invention. [Figure 10] Figure 10 is a schematic diagram of the initial transmission delay mechanism in the video image decoding method and video image encoding method provided in the embodiment of the present invention. [Figure 11] Figure 11 is a schematic diagram of a video encoding / decoding device provided in an embodiment of the present invention. [Modes for carrying out the invention]
[0047] In the description of this invention, unless otherwise specified, " / " means "or," for example, A / B means A or B. In this specification, "and / or" merely describes the relationship between related objects, and indicates that there may be three types of relationships. For example, A and / or B may indicate that A exists alone, that A and B exist simultaneously, and that B exists alone. Also, "at least one" means one or more, and "multiple" means two or more. Words such as "first," "second," etc. do not limit the quantity or order of execution. Furthermore, words such as "first," "second," etc. do not necessarily limit that they are different. In this invention, terms such as "exemplary" or "for example" are used to mean an example, illustration, or explanation. In this invention, any embodiment or design described as "exemplary" or "for example" should not be construed as being preferable or advantageous to other embodiments or designs. More precisely, the use of terms such as "exemplary" or "for example" is intended to illustrate the relevant concepts in a specific form.
[0048] First, we will introduce the technical terms related to the embodiments of the present invention.
[0049] 1. Video encoding / decoding technology
[0050] Video encoding / decoding technology includes video encoding technology and video decoding technology, and may be collectively referred to as video encoding and decoding technology.
[0051] Among these, video sequences contain a range of redundant information, including spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. To remove as much redundant information as possible from video sequences and reduce the amount of data representing the video, video encoding techniques are provided to achieve the effects of reducing storage space and saving transmission bandwidth. Video encoding techniques are also called video compression techniques.
[0052] To retrieve data stored or transmitted based on the aforementioned video compression technology, it is necessary to implement this using corresponding video decoding technology.
[0053] Within the realm of international acceptance, video compression encoding standards are intended to standardize video encoding and decoding methods. Examples include 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).
[0054] Furthermore, the aforementioned compression coding method can be used in combination with coding algorithms based on a hybrid coding architecture.
[0055] The basic processing unit in the video encoding and decoding process is the image block, which is obtained by dividing one frame / image on the encoding side. Typically, each divided image block is processed one row at a time. Here, the image block currently being processed is called the current block, and the processed image block is called the encoded image block, decoded image block, or encoded / decoded image block. Taking HEVC as an example, HEVC defines a Coding Tree Unit (CTU), a Coding Unit (CU), a Prediction Unit (PU), and a Transform Unit (TU). CTU, CU, PU, and TU can all be image blocks obtained by dividing. Of these, PU and TU are both divided based on the CU.
[0056] 2. Video sampling
[0057] Since a pixel is the smallest complete sample of a video or image, data processing for an image block is performed on a pixel-by-pixel basis. Here, each pixel records color information. One sampling method is to represent color using RGB, which includes three image channels: R represents red, G represents green, and B represents blue. Another sampling method is to represent color using YUV, which also includes three image channels: Y represents luminance, U represents the first chromaticity Cb, and V represents the second chromaticity Cr. Because humans are more sensitive to luminance than to chromaticity, storing more luminance and less chromaticity can reduce storage space. Specifically, during video encoding and decoding, video sampling is typically performed using the YUV format, which includes formats such as the 420-sampling format and the 422-sampling format. This sampling format determines the number of chromaticity samples based on the number of luminance samples. For example, if one CU has 4x2 pixels, its format would be as follows:
[0058] TIFF0007855137000001.tif12170
[0059] TIFF0007855137000002.tif111156
[0060] TIFF0007855137000003.tif38163
[0061] TIFF0007855137000004.tif93155
[0062] TIFF0007855137000005.tif33163
[0063] The sampled luminance coding unit, first chromaticity coding unit, and second chromaticity coding unit described above are subsequently used as data units for each channel to be processed for the current block.
[0064] The encoding / decoding method provided by the present invention is applicable to a video encoding and decoding system. This video encoding and decoding system is also called a video encoding / decoding system. Figure 1 shows the configuration of the video encoding and decoding system.
[0065] As shown in Figure 1, the video coding and decoding system includes a source device 10 and a destination device 11. The source device 10 generates coded video data. The source device 10 may also be called a video coding device. The destination device 11 can decode the coded video data generated by the source device 10. The destination device 11 may also be called a video decoding device. The source device 10 and / or the destination device 11 may include at least one processor and memory coupled to the at least one processor. The memory includes, but is not limited to, read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), flash memory, or any other medium for storing desired program code in the form of computer-accessible instructions or data structures.
[0066] The source device 10 and destination device 11 may include a variety of devices. For example, electronic devices such as desktop computers, mobile calculators, notebook (e.g., laptop) computers, tablet computers, set-top boxes, portable phones such as so-called "smartphones," televisions, cameras, display devices, digital media players, video game consoles, in-car computers, or similar devices.
[0067] The destination device 11 receives encoded video data from the source device 10 via link 12. Link 12 may include one or more media and / or devices capable of transmitting the encoded video data from the source device 10 to the destination device 11. In one example, link 12 may include one or more communication media that enable the source device 10 to directly transmit the encoded video data 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 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 or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices that enable communication from the source device 10 to the destination device 11.
[0068] In other examples, encoded video data may be output from the output interface 103 to the storage device 13. Similarly, encoded video data may be accessed from the storage device 13 via the input interface 113. The storage device 13 may include various locally accessible data storage media. For example, it may include Blu-ray discs, Digital Video Discs (DVDs), Compact Disc Read-Only Memory (CD-ROMs), flash memory, or other suitable digital storage media for storing encoded video data.
[0069] In other examples, the storage device 13 may correspond to a file server or another intermediate storage device for storing encoded video data generated by the source device 10. In this example, the destination device 11 may retrieve the video data stored in the storage device 13 from the storage device 13 by streaming or downloading. The file server may be any type of server that stores encoded video data and can send encoded video data to the destination device 11. For example, the file server may include a World Wide Web server (e.g., for a website), a File Transfer Protocol (FTP) server, a Network Attached Storage (NAS) device, and a local disk drive.
[0070] The destination device 11 may access the encoded video data via a data connection of any standard (e.g., an internet connection). Examples of data connections include wireless communication channels, wired connections (e.g., cable modems), or a combination of both, suitable for accessing the encoded video data stored on the file server. The method by which the encoded video data is transmitted from the file server may be streaming, downloading, or a combination of both.
[0071] The encoding / decoding method according to the present invention is not limited to wireless application scenarios. Exemplarily, the encoding / decoding method according to the present invention applies to video encoding and decoding supporting a variety of multimedia applications, including, for example, wireless television broadcasting, wired television transmission, satellite television transmission, streaming video transmission (e.g., over 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 unidirectional or bidirectional video transmission to support applications such as video streaming, video playback, video broadcasting, and / or video phone calls.
[0072] The video encoding and decoding system shown in Figure 1 is merely an example of a video encoding and decoding system and does not limit the video encoding and decoding systems in the present invention. The encoding / decoding method provided by the present invention can also be applied to scenarios where there is no data communication between the encoding device and the decoding device. In other examples, the video data to be encoded or the encoded video data may be retrieved from local memory or streamed over a network. The video encoding device may encode the video data to be encoded and store the encoded video data in memory. The video decoding device may retrieve the encoded video data from memory and decode the encoded video data.
[0073] In Figure 1, the source device 10 includes a video source 101, a video encoder 102, and an output interface 103. In some examples, the output interface 103 may include a modulator / demodulator (modem) and / or transmitter. The video source 101 includes a video capture device (e.g., a video 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 these video data sources.
[0074] The video encoder 102 may encode video data from the video source 101. In some examples, the source device 10 may directly transmit the encoded video data to the destination device 11 via the output interface 103. In other examples, the encoded video data may be stored in the storage device 13 for later access by the destination device 11 for decoding and / or playback.
[0075] In the example shown in Figure 1, 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 may receive encoded video data via link 12 and / or from storage device 13. The display device 111 may be integrated with the destination device 11 or may be external to the destination device 11. Generally, the display device 111 displays the decoded video data. The display device 111 may include various types of displays, such as liquid crystal displays, plasma displays, organic light-emitting diode displays, or other types of displays.
[0076] Selectively, the video encoder 102 and video decoder 112 may be integrated with an audio encoder and decoder, respectively, and may include a suitable multiplexer / demultiplexer unit or other hardware and software to handle the encoding of both audio and video in a common data stream or separate data streams.
[0077] The video encoder 102 and 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. When the encoding / decoding method provided by the present invention is implemented by software, the present invention may be carried out by storing the instructions used in the software in a suitable non-volatile computer-readable storage medium and executing the instructions by at least one processor.
[0078] The video encoder 102 and video decoder 112 in this invention may operate according to a video compression standard (e.g., HEVC) or according to other industry standards. The present invention is not particularly limited.
[0079] Figure 2 is a schematic block diagram of a video encoder 102 in an embodiment of the present invention. In the video encoder 102, the prediction module 21, the transformation module 22, the quantization module 23, and the entropy coding module 24 may perform the processes of prediction, transformation, quantization, and entropy coding, respectively. The video encoder 102 further includes a preprocessing module 20 and an adder 202. Of these, the preprocessing module 20 may include a partitioning module and a code rate control module. For the reconstruction of video blocks, the video encoder 102 further includes an inverse quantization module 25, an inverse transformation module 26, an adder 201, and a reference image memory 27.
[0080] As shown in Figure 2, the video encoder 102 receives video data. The preprocessing module 20 obtains the input parameters of the video data. These input parameters include information such as the image resolution, image sampling format, pixel color depth (bits per pixel, bpp), and bit width in the video data. Here, bpp refers to the number of bits occupied by one pixel component in a unit pixel. Bit width refers to the number of bits occupied by a unit pixel. For example, if one pixel is represented using the values of three pixel components, RGB, and each pixel component occupies 8 bits, then the pixel color depth of that pixel is 8, and the bit width of that pixel is 3 × 8 = 24 bits.
[0081] The partitioning module in the preprocessing module 20 divides the image into original blocks. This partitioning may include dividing into slices, image blocks, or other relatively large units, and video block partitioning based on a four-tree structure of Largest Coding Unit (LCU) and CU (for example). Exemplaryly, the video encoder 102 is a component that encodes video blocks within the video slice to be encoded. Generally, a slice may be divided into multiple original blocks (and may be divided into sets of original blocks called image blocks). Typically, the partitioning module determines the sizes of the CU, PU, and TU. The partitioning module is also used to determine the size of the code rate control unit, which refers to the basic processing unit in the code rate control module. For example, in the code rate control module, the code rate control unit calculates complexity information for the current block and further calculates the quantization parameters of the current block based on the complexity information. Here, the partitioning policy of the partitioning module may be preset or may be continuously adjusted based on the image during the encoding process. If the partitioning policy is a preset policy, the same partitioning policy is also preset on the decoding side, thereby obtaining the same image processing unit. This image processing unit is one of the aforementioned image blocks and corresponds one-to-one with the encoding side. If the partitioning policy is continuously adjusted based on the image during the encoding process, the partitioning policy can be incorporated directly or indirectly into the code stream, and accordingly, the decoding side obtains the corresponding parameters from the code stream, resulting in the same partitioning policy and obtaining the same image processing unit.
[0082] The code 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 correlated calculations. Here, the code rate control module may, for example, acquire and calculate the quantization parameters by obtaining image information of the current block, such as the input information described above, or by acquiring and calculating the reconstructed values reconstructed by the adder 201, but the present invention is not limited thereto.
[0083] The prediction module 21 may provide the prediction block to the adder 202 to generate a residual block, and the prediction block to the adder 201 to obtain a reconstructed block through reconstruction. The reconstructed block is used later as a reference pixel for prediction. Here, the video encoder 102 generates a pixel difference value by subtracting the pixel values of the prediction block from the pixel values of the original block. The pixel difference value is a residual block, and the data in the residual block may include luminance difference and chromaticity difference. The adder 201 represents one or more components that perform this subtraction. The prediction module 21 may further send the relevant syntax elements to the entropy encoding module 24 to be merged into the code stream.
[0084] The conversion module 22 may convert the residual block by dividing it into one or more TUs. The conversion module 22 may convert the residual block from a pixel area to a conversion area (e.g., a frequency area). For example, the residual block may be converted using a discrete cosine transform (DCT) or a discrete sine transform (DST) to obtain conversion coefficients. 22 The acquired conversion coefficients may be transmitted to the quantization module 23.
[0085] The quantization module 23 may be quantized by a quantization unit, where the quantization unit may be the same as the CU, TU, and PU, and may be further divided in the partition module. The quantization module 23 quantizes the transformation coefficients to obtain quantized coefficients by further reducing the code rate. Here, the quantization process can reduce the bit depth associated with some or all of the coefficients. The degree of quantization can be changed by adjusting the quantization parameters. In some possible embodiments, the quantization module 23 may subsequently perform a scan of the matrix containing the quantized transformation coefficients. Alternatively, the entropy coding module 24 may perform the scan.
[0086] After quantization, the entropy coding module 24 may entropy code the quantization coefficients. For example, the entropy coding 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), stochastic interval partitioning entropy (PIPE) decoding, or other entropy coding methods or techniques. After entropy coding by the entropy coding module 24, the code stream is obtained and transmitted to the video decoder 112 or stored for subsequent transmission or retrieval by the video decoder 112.
[0087] The inverse quantization module 25 and the inverse transformation module 26 apply inverse quantization and inverse transformation, respectively. The adder 201 adds the inversely transformed residual block and the predicted residual block to generate a reconstructed block, which is later used as a reference pixel to predict the original block. The reconstructed block is stored in the reference image memory 27.
[0088] Figure 3 is a schematic diagram of a video decoder 112 in an embodiment of the present invention. As shown in Figure 3, the video decoder 112 includes an entropy decoding module 30, a prediction module 31, an inverse quantization module 32, an inverse transform module 33, an adder 301, and a reference image memory 34. Here, the entropy decoding module 30 includes an analysis module and a code rate control module. In some possible embodiments, the video decoder 112 may perform a decoding flow that is exemplary inverse to the coding flow described for the video encoder 102 shown in Figure 2.
[0089] During the decoding process, the video decoder 112 receives the encoded video code stream from the video encoder 102. The analysis module in the entropy decoding module 30 of the video decoder 112 generates quantization coefficients and syntax elements by entropy decoding the code stream. The entropy decoding module 30 transmits the syntax elements to the prediction module 31. The video decoder 112 may receive the syntax elements at the video slice level and / or video block level.
[0090] In the entropy decoding module 30, the code rate control module 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 performs correlation calculations. The code rate control module may also calculate the quantization parameters based on the reconstruction block reconstructed by the adder 301.
[0091] The inverse quantization module 32 performs inverse quantization (e.g., dequantization) on the quantization coefficients and generated quantization parameters provided from the code stream and decoded by the entropy decoding module 30. The inverse quantization process may include determining the degree of quantization using the quantization parameters calculated for each video block in the video slice by the video encoder 102, and similarly determining the degree of application of inverse quantization. The inverse transform module 33 applies an inverse transform (e.g., a transform method such as DCT or DST) to the inversely quantized transform coefficients and generates inversely transformed residual blocks in the image region for each inverse transform unit from the inversely quantized transform coefficients. Here, the size of the inverse transform unit and the size of the TU are the same. The inverse transform method and the transform method use the corresponding forward and inverse transforms in the same transform method. For example, the inverse transform of DCT or DST is an inverse DCT, inverse DST, or a conceptually similar inverse transform process.
[0092] After the prediction module 31 generates prediction blocks, the video decoder 112 adds the prediction blocks to the inversely transformed residual blocks from the inverse transformation module 33 to generate decoded video blocks. The adder 301 represents one or more components that perform this addition operation. If necessary, the decoded blocks may be filtered using a deblocking filter to remove block artifacts. The decoded image blocks in a given frame or image are stored in the reference image memory 34 as reference pixels for later prediction.
[0093] The present invention provides one possible implementation of video encoding / decoding. As shown in Figure 4, Figure 4 is a schematic diagram of the video encoding / decoding flow provided by the present invention. The implementation of video encoding / decoding includes processes 1 to 5. Processes 1 to 5 may be performed by one or more of the source device 10, video encoder 102, destination device 11, or video decoder 112 described above.
[0094] Process 1: Divide a single frame of image into one or more parallel coding units that do not overlap with each other. There are no dependencies between these one or more parallel coding units, and they can encode and decode completely in parallel / independently, as shown in parallel coding unit 1 and parallel coding unit 2 in Figure 4.
[0095] Process 2: Each parallel coding unit may be further divided into one or more independent coding units that do not overlap with each other. Each independent coding unit is independent of the others, but may share header information from some parallel coding units.
[0096] An independent coding unit may contain three components: luminance Y, first chromaticity Cb, and second chromaticity Cr, or three components of RGB, or it may contain only one of these components. If an independent coding unit contains three components, the sizes of these three components may be exactly the same or different. Specifically, this relates to the image input format. This independent coding unit may be understood as one or more processing units composed of N channels contained in each parallel coding unit. For example, the three components Y, Cb, and Cr are the three channels that constitute this parallel coding unit, each of which may be an independent coding unit. Alternatively, if Cb and Cr are collectively referred to as chromaticity channels, this parallel coding unit may include an independent coding unit consisting of luminance channels and an independent coding unit consisting of chromaticity channels.
[0097] Process 3: Each independent coding unit may be further divided into one or more non-overlapping coding units. Each coding unit within an independent coding unit may be dependent on one another. For example, multiple coding units may refer to each other to perform pre-coding and pre-decoding.
[0098] If the size of the coding unit and the independent coding unit are the same (i.e., the independent coding unit is divided into only one coding unit), then the size may be any of the sizes described in process 2.
[0099] The encoding unit may contain three components (or the three components of RGB): luminance Y, primary chromaticity Cb, and secondary chromaticity Cr, or it may contain only one of these components. If it contains three components, the sizes of these components may be exactly the same or different. Specifically, this relates to the image input format.
[0100] Process 3 is an optional step in the video coding and decoding method, and the video encoder / decoder may perform coding / decoding on the residual coefficients (or residual values) of the independent coding units obtained by Process 2.
[0101] Process 4: The encoded unit may be further divided into one or more non-overlapping prediction groups (Prediction Groups, PGs). A PG may be abbreviated as a Group. Each PG is encoded and decoded using a selected prediction mode to obtain the predicted values for the PG, which constitute the predicted values for the entire encoded unit. Based on the predicted values and the original values of the encoded unit, the residual values for the encoded unit are obtained.
[0102] Process 5: Based on the residual values of the encoded units, the encoded units are divided into groups 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, there may be two types: one in which the residual coefficients are transformed and one in which they are not.
[0103] Here, the selection modes for the encoding and decoding methods to the residual coefficients in process 5 include, but are not limited to, semi-fixed-length encoding, exponential Golomb encoding, Golomb-Rice encoding, truncated unary encoding, run-length encoding, and methods for directly encoding the original residual values.
[0104] For example, a video encoder may directly encode the coefficients within the RB.
[0105] Alternatively, for example, a video encoder may perform transformations on the residual block, such as DCT, DST, or Hadamard transform, and then encode the transformed coefficients.
[0106] As one possible example, if RB is small, the video encoder may directly uniformly quantize each coefficient in RB and then binary encode it. If RB is large, it may be further divided into multiple coefficient groups (CGs), each CG may be uniformly quantized and then binary encoded. In some embodiments of the present invention, the coefficient groups (CGs) and quantization groups (QGs) may be the same.
[0107] The following provides an illustrative explanation of the part of the semi-fixed-length coding scheme that encodes residual coefficients. First, the maximum absolute value of residuals within a single RB block is defined as the modified maximum (mm). Next, the number of bits required to encode the residual coefficients within this RB block (the number of bits required to encode residual coefficients within the same RB block must match) is determined. 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 needed to encode the residual coefficient of 1, which is represented as 01. If the CL of the current RB block is 7, this indicates encoding 8 bits for the residual coefficient and 1 bit for the sign bit. Determining the CL means finding the smallest M value that satisfies the condition that all residuals in the current subblock are within the range [-2^(M-1), 2^(M-1)]. If two boundary values, -2^(M-1) and 2^(M-1), exist simultaneously, then M should be increased by 1, meaning that M+1 bits are needed to encode all residuals in the current RB block. If only one of the two boundary values, -2^(M-1) and 2^(M-1), exists, one trailing bit needs to be encoded to determine whether that boundary value is -2^(M-1) or 2^(M-1). If neither -2^(M-1) nor 2^(M-1) exists in any of the residuals, this trailing bit does not need to be encoded.
[0108] In certain cases, the video encoder may directly encode the original image values instead of the residual values.
[0109] The video encoder 102 and video decoder 112 can be implemented in other forms. For example, they can be implemented using a general-purpose digital processor system, such as the encoding and decoding device 50 shown in Figure 5. The encoding and decoding device 50 may be a part of the video encoder 102 or a part of the video decoder 112.
[0110] The encoding and decoding device 50 may be applied to the encoding side or to the decoding side. The encoding and decoding device 50 includes a processor 501 and a memory 502. The processor 501 is connected to the memory 502 (for example, connected to each other via a bus 504). Optionally, the encoding and decoding device 50 further includes a communication interface 503, which is used to connect the processor 501 and the memory 502 and to send and receive data.
[0111] Memory 502 may be Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read-Only Memory (EPROM), or Compact Disc Read-Only Memory (CD-ROM). Memory 502 is for storing related program code and video data.
[0112] The processor 501 may be one or more central processing units (CPUs), such as CPU 0 and CPU 1 shown in Figure 5. If the processor 501 is a single CPU, this CPU may be a single-core CPU or a multi-core CPU.
[0113] The processor 501 reads the program code stored in the memory 502 and executes the operation of one of the embodiments and various executable embodiments of the design shown in Figure 6.
[0114] The encoding / decoding method provided by the present invention will be described in detail below, combining the video encoding and decoding system shown in Figure 1, the video encoder 102 shown in Figure 2, and the video decoder 112 shown in Figure 3.
[0115] Figure 6 is a flowchart of the video image decoding method and video image encoding method provided by the present invention. The method includes the following steps.
[0116] In S601, the complexity levels of at least two channels of the current block in the image to be processed are obtained, and the block-level complexity level of the current block is determined according to the complexity levels of at least two channels. These channel-level complexity levels indicate the degree of complexity of the channel-level texture of the current block.
[0117] The video image decoding method and video image encoding method provided by the present invention are applicable to video data encoding and decoding scenarios. Video data consists of multiple frame images, where one frame is a single still image, and a dynamic video is generated by synthesizing a temporally continuous sequence of frames. The image to be processed is the image in the video data that is to be encoded / decoded. When encoding / decoding video, the image to be processed is divided into multiple image blocks, and each image block is processed one by one, with each row being the basic processing unit. Here, the image block being processed is called the current block.
[0118] In this exemplary embodiment, the image to be processed may be a multichannel image. The complexity levels of at least two channel levels of the current block in the image to be processed are obtained, and the block level of the current block is determined according to the complexity levels of at least two channel levels. That is, the complexity levels of at least two channels of the current multichannel image block are obtained, and the block level of the current block is determined based on them. For example, the image to be processed may be an image in YUV format. In this case, the complexity levels of the Y channel and the U channel are obtained, and the block level of the current block is determined based on them. It can be understood that obtaining the complexity levels of YV, UV, or YUV can also determine the block level of the current block.
[0119] The multi-channel technology according to the present invention is not limited to the three YUV channels described above, but may have more channels. For example, if the image sensor is a four-channel sensor, the corresponding image to be processed will include four channels of image information, and if the image sensor is a five-channel sensor, the corresponding image to be processed will include five channels of image information.
[0120] The plurality of channels in the present invention may include at least one or more of the following: 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 plurality of channels may include Y channel, U channel, and V channel; or the plurality of channels may include R channel, G channel, and B channel; or the plurality of channels may include R channel, G channel, B channel, and alpha channel; or the plurality of channels may include R channel, G channel, B channel, and IR channel; or the plurality of channels may include R channel, G channel, B channel, and W channel; or the plurality of channels may include R channel, G channel, B channel, IR channel, and W channel; or the plurality of channels may include R channel, G channel, B channel, D channel, and W channel. In addition to the RGB color light-sensitive channels, there are also IR channels (infrared or near-infrared light-sensitive channels), D channels (dark channels mainly using infrared or near-infrared light), and W channels (all-color light-sensitive channels). Different sensors have different channels. For example, the sensor type may be an RGB sensor, RGBIR sensor, RGBW sensor, RGBIRW sensor, RGBD sensor, RGBDW sensor, etc.
[0121] Texture is a visual feature that reflects uniform phenomena in an image and is used to represent the attribute of the organized arrangement of surface structures that have gradual or periodic changes on the surface of an object. The channel-level complexity level indicates the degree of 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 channel-level texture information, the lower the channel-level complexity level.
[0122] Obtaining the complexity levels of at least two channels of the current block in the image to be processed, and determining the block-level complexity level of the current block according to the complexity levels of at least two channels, can be implemented in different ways on the encoding and decoding sides of video encoding / decoding. In one embodiment, On the encoding side, it is possible to obtain channel-level texture information of the current block and determine the block-level complexity level of the current block based on the channel-level texture information. Specifically, this process can be achieved by treating at least one channel image block of the current block as a processing unit, dividing each processing unit into at least two subunits, determining the texture information of each subunit, and then, in each processing unit, determining the block-level complexity level of the current block based on the texture information of each subunit.
[0123] Of these, at least one channel image block in the current block is treated as a processing unit, and each processing unit is divided into at least two subunits. Taking the image to be processed as a YUV image as an example, in one possible scenario, the process can be implemented by treating the Y channel of the current block as one processing unit and further dividing that processing unit into four subunits. In another possible scenario, the process can also be implemented by treating the two channels, the Y channel and the U channel, as one processing unit and further dividing that processing unit into two subunits. It should be understood that the above scenarios are merely illustrative descriptions and the scope of protection of the embodiments described herein is not limited thereto. For example, the U channel, V channel, YU channel, YV channel, UV channel, and YUV channel may be treated as one processing unit, and the number of subunits may be any integer of two or more.
[0124] In one possible implementation, determining the texture information of each subunit involves obtaining the original pixel value of the subunit, the original pixel value or reconstructed value of the adjacent column to the left of the subunit, and the reconstructed value of the adjacent row above the subunit, calculating the horizontal and vertical texture information of the subunit accordingly, and selecting the minimum value from the horizontal and vertical texture information as the texture information of the corresponding subunit.
[0125] Specifically, the texture information may be pixel point information. As an example, if the image to be processed is a YUV image and the Y, U, and V channels are each treated as one processing unit, the texture information of the subunits may be determined by dividing the processing unit into at least two subunits, calculating the horizontal complexity and vertical complexity of the subunit based on the original pixel value of the subunit, the original or reconstructed pixel value of the adjacent column to the left of the subunit, and the reconstructed value of the adjacent row above the subunit, and selecting the minimum value from the horizontal complexity and vertical complexity as the texture information of the corresponding subunit. The horizontal complexity and vertical complexity may be calculated based on the degree of difference between the horizontal and vertical pixel points of the subunit. The above scenario is merely an illustrative description, and it can be understood that the texture information can be obtained by other means. For example, it may be determined by image information other than pixel points, or a weighted value of the horizontal complexity and vertical complexity may be selected as the texture information of the corresponding subunit, or other methods that can achieve similar effects may be used. This embodiment is not particularly limited.
[0126] In one possible implementation, determining the block-level complexity level of the current block based on the texture information of each subunit in each processing unit is achieved by dividing the texture information of each subunit into the corresponding subunit complexity levels based on a plurality of thresholds, wherein the plurality of thresholds are predetermined, and determining the block-level complexity level of the current block based on the complexity level of each subunit.
[0127] Specifically, the process may set two thresholds, threshold 1 and threshold 2, and divide the complexity level of the subunit into three levels, 0 to 2, based on the set thresholds. If it is determined that the complexity of the texture information of the obtained subunit is less than or equal to threshold 1, the texture information of the subunit is divided into level 0. If it is determined that the complexity of the texture information of the obtained subunit is greater than threshold 1 and less than threshold 2, the texture information of the subunit is divided into level 1. If it is determined that the complexity of the texture information of the obtained subunit is greater than or equal to threshold 2, the texture information of the subunit is divided into level 2. The above scenario is merely illustrative, and it is understood that the scope of protection of the present invention is not limited thereto.
[0128] In one possible implementation, determining the block-level complexity level of the current block based on the complexity level of each subunit achieves mapping the complexity level of each subunit to the corresponding channel-level complexity level based on preset rules, and determining the block-level complexity level of the current block based on the complexity level of each channel-level.
[0129] Mapping the complexity level of each subunit to the corresponding channel-level complexity level based on the aforementioned preset rules is achieved as follows:
[0130] Implementation form 1: The channel-level complexity level is determined based on the sum of multiple thresholds and the complexity levels of each subunit, and the multiple thresholds are predetermined.
[0131] In one embodiment, the process is achieved by determining the complexity levels of multiple channel classes based on the multiple thresholds, adding the complexity levels of each subunit, and dividing the resulting sum into the complexity levels of the corresponding channel classes. Specifically, the thresholds may be three thresholds: 2, 4, and 7, and these three thresholds may divide the complexity levels of the channel classes into five levels: level 0 to level 4. The calculated complexity levels of the subunits are three levels: level 0 to level 2. The complexity levels of each subunit are added together. If the sum of the complexity levels of the subunits is less than 2, the complexity level of the corresponding channel class is 0. If the sum of the complexity levels of the subunits is 2 or more and less than 4, the corresponding channel class is 1. If the sum of the complexity levels of the subunits is 4, the complexity level of the corresponding channel class is 2. If the sum of the complexity levels of the subunits is greater than 4 and less than 7, the complexity level of the corresponding channel class is 3. If the sum of the complexity levels of the subunits is 7 or greater, the corresponding channel-level complexity level is 4. The above scenario is merely illustrative, and the scope of protection of the present invention is not limited thereto.
[0132] Implementation form 2: Determine the level configuration of the complexity levels of the subunits, and then determine the corresponding channel-level complexity levels based on that level configuration.
[0133] In one embodiment, in one specific scenario, the process achieves, for example, that the complexity levels of the subunits are multiple levels, and that the corresponding channel-level complexity level is determined based on the level to which each subunit belongs and the arrangement scheme. For example, when the processing unit is divided into four subunits, and the complexity levels of the four subunits are 1, 2, 2, and 2 respectively, and the preset rule includes a determination method such that there are three 2s in the complexity level of each subunit, then the channel-level complexity level is 2, and the corresponding channel-level complexity level is 2. The above scenario is merely illustrative, and other subunit division and determination methods are understood to be within the scope of the present invention.
[0134] In one possible implementation, there are several ways in which the complexity level of the current block is determined based on the complexity level of each channel, and the following are examples of such methods.
[0135] Implementation Method 1: Obtain the maximum, minimum, or weighted value of the complexity level for each channel level as the complexity level for the current block level. Implementation Method 2: The complexity level of the current block is determined based on the sum of multiple thresholds and the complexity levels of each channel level. The multiple thresholds are pre-set.
[0136] Furthermore, in the present invention, each channel component of the multi-channel image block, i.e., the current block, determines the complexity level of the channel class jointly or independently. For example, if the image to be processed is a YUV image, the U channel and the V channel may share a single complexity level of the channel class, or the complexity level of each channel class may be determined individually.
[0137] On the decoding side, the channel-level complexity level of the current block is obtained from the code stream. Here, the code stream is the encoded code stream of the current block. Specifically, the decoding side receives the encoded code stream of the current block transmitted from the encoding side, and the encoded code stream contains complexity information bits indicating the channel-level complexity level. Based on these information bits, the decoding side obtains the channel-level complexity level determined by the channel-level texture information on the encoding side, and determines the block-level complexity level based on the channel-level complexity level. Here, the implementation method for determining the block-level complexity level using at least two channel-level complexity levels is the same as on the encoding side, so it will not be explained here.
[0138] The implementation method for determining the channel-level complexity level using the complexity information bits is as follows: The complexity information bits of the current block are obtained from the encoded code stream, and the channel-level complexity level is determined based on the complexity information bits. Here, the complexity information bits may be 1 bit or 3 bits, and the most significant bit of the complexity information bits indicates whether the current channel-level complexity level is the same as the complexity level of the same channel in the image block immediately preceding the current block, and the change 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 in the current block, the complexity of the same channel in the previous image block indicates the complexity level of the U channel in the image block decoded before the current block. If the most significant bit determines that they are the same, the complexity information bit is 1 bit. If they are not the same, the complexity information bits are 3 bits, with the lower 2 bits indicating the change between the channel-level complexity of the current block and the complexity level of the same channel in the previous image block. Based on this change and the channel complexity level of the same channel in the previous image block, the required channel-level complexity level can be determined. The above scenario is merely illustrative, and the scope of protection of the present invention is not limited thereto. For example, the complexity information bits may indicate whether the complexity of the U channel of the current block and the Y channel of the current block are the same, and the change if they are different, but the present invention is not particularly limited thereto.
[0139] In S602, the target number of bits for the current block is determined according to a rate control parameter. This rate control parameter includes the block-level complexity level of the current block.
[0140] In one possible implementation, the rate control parameter includes the block-level complexity level of the current block calculated in step S601 and is used to determine the target number of bits for the current block. The target number of bits is the number of bits required to predict the encoding of the current block. The rate control parameter includes at least one of the following: image bit width bpc, target number of bits per pixel bpp, image format, average number of bits for lossless encoding at the same level, average number of bits for lossless encoding, code stream buffer fullness, first row quality improvement parameter, and first column quality improvement parameter. The target number of bits for the current block is determined by one or more of the above rate control parameters.
[0141] Here, the average number of bits for lossless encoding at the same level is the average of the predicted number of bits required to losslessly encode the current block and multiple coded image blocks, and the complexity levels of multiple decoded image blocks and the current block are the same. The average number of bits for lossless encoding is the average of the predicted number of bits required to losslessly encode the current block and all decoded image blocks. The code stream buffer fullness indicates the fullness of the buffer, and the buffer is for storing the code stream of the image to be processed. The first row quality improvement parameter is for reducing the quantization parameter of the first row block to mitigate the effects of the difficulty in predicting the first row block and the transitive nature of the prediction error when the current block is the first row block in the image to be processed.
[0142] In one possible implementation, the rate control parameters include the same-level reversible coding average number of bits, the reversible coding average number of bits, and the code stream buffer fullness. Determining the target number of bits for the current block according to the rate control parameters is achieved by determining the same-level reversible coding average number of bits and the reversible coding average number of bits, determining the initial target number of bits based on the same-level reversible coding average number of bits and the reversible coding average number of bits, and determining the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, and the initial target number of bits. Here, the calculation of the code stream buffer fullness is affected by an initial transmission delay mechanism, which refers to the effect of some invalid bits present in the buffer on the buffer fullness before the coded code stream of the current block is stored.
[0143] In one embodiment, determining the average number of bits for same-level reversible coding and the average number of bits is achieved by determining the number of bits for reversible coding of the current block, which is a predicted value of the number of bits required to reversibly code the current block; updating the average number of bits for same-level reversible coding of the current block based on the number of bits for reversible coding of the current block and a plurality of past average numbers of bits for same-level reversible coding; and updating the average number of bits for reversible coding of the current block based on the number of bits for reversible coding of the current block and all past average numbers of bits for reversible coding. Here, the average number of bits for past reversible coding is the average number of bits for same-level reversible coding of decoded image blocks having the same complexity level as the block complexity level of the current block, and the average number of bits for past reversible coding is the average number of bits for reversible coding of decoded image blocks.
[0144] In one possible implementation, if the current block is the first row block in the image to be processed, the rate control parameter further includes a first row quality improvement parameter, and determining the target number of bits for the current block according to the rate control parameter is achieved by determining an initial target number of bits based on the same-level reversible coding average number of bits and the reversible coding average number of bits, and by determining the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, the first row quality improvement parameter and the initial target number of bits. Here, the first row quality improvement parameter improves the image quality of the current block mainly by reducing the quantization parameter of the current block.
[0145] In one possible implementation, if the current block is the first column block in the image to be processed, the rate control parameter further includes a first column quality improvement parameter, and determining the target number of bits for the current block according to the rate control parameter is achieved by determining an initial target number of bits based on the same-level reversible coding average number of bits and the reversible coding average number of bits, and by determining the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, the first column quality improvement parameter and the initial target number of bits. Here, the first column quality improvement parameter improves the image quality of the current block mainly by reducing the quantization parameter of the current block.
[0146] Furthermore, in the process described above, the multi-channel image block, i.e., the channel components of the current block, jointly or independently determine the same-level lossless encoding bit count and the target bit count.
[0147] In S603, the quantization parameters of the current block are determined based on the target number of bits.
[0148] In one possible implementation, determining the quantization parameters of the current block based on the target number of bits involves calculating and obtaining a reference quantization parameter for the current block based on the average number of bits for same-level reversible coding, the target number of bits, and the sampling rate corresponding to the image format of the image to be processed. Furthermore, based on this reference quantization parameter, the component quantization parameters corresponding to each channel of the current block are calculated.
[0149] In S604, the current block is encoded / decoded based on the quantization parameters.
[0150] In this step, the video encoding / decoding device encodes / decodes the current block based on the quantization parameters of the current block. Selectively, during encoding, the video encoder incorporates the channel-level complexity level of the current block into the code stream, i.e., the complexity information bits. Alternatively, it incorporates the quantization parameters of the current block into the code stream. Correspondingly, the decoding side obtains the complexity information bits in the code stream, calculates the quantization parameters, and performs decoding. Alternatively, the decoding side obtains the quantization parameters in the code stream and performs decoding. Of course, the video encoder may also incorporate the two pieces of information described above into the code stream.
[0151] Next, as an application scenario where the image to be processed is a YUV image, the video image decoding method and video image encoding method will be described in detail by combining the flow shown in Figure 7 with a series of specific embodiments.
[0152] In step S701, the complexity level of the block class of the current block is determined. This step is used to determine the complexity level of the current block, and the process differs between the video encoding side and the video decoding side.
[0153] On the video encoding side, this process is primarily implemented through the flow shown in Figure 8.
[0154] In S801, the complexity of the texture information of the current block is determined. This step is achieved by taking at least one channel of the current block's image block as a processing unit, dividing each processing unit into at least two subunits, and determining the complexity of the texture information in each subunit.
[0155] Specifically, using the YUV444 format as an example, each 16x2 channel may be divided into four 4x2 subblocks, as shown in Figure 9. The texture information of the current block is the pixel information of the current block. To calculate the complexity of the current block, it is necessary to use the pixel points of the following three parts, as shown in Figure 9: (1) the original pixel values of the current block, (2) the original pixel values of the column to the left of the current block, i.e., the adjacent column to the left of subblock 1 (note that if the original pixel values cannot be obtained, reconstructed values may be used); and (3) the reconstructed values of the previous row adjacent to the current block, i.e., the gray grid area in Figure 9.
[0156] Next, using subblock 1 in Figure 9 as an example, we will explain the process for calculating the complexity of a subblock, that is, the process for determining the texture information of each subunit. Typically, this can be obtained by calculating the horizontal complexity and vertical complexity of each subblock. This is done as follows: The method for calculating horizontal complexity is the sum of the absolute values of the pixel values in the current column and the adjacent column to its left. The method for calculating vertical complexity is the sum of the absolute values of the pixel values in the current row and the adjacent row above it.
[0157] In one embodiment, if the current block is the left boundary of the current video slice, the calculation of the horizontal complexity uses the filler value of the left boundary, which is the pixel value of the current column. Correspondingly, if the current block is the top boundary of the current video slice, the calculation of the vertical complexity uses the filler value of the top boundary, which is the pixel value of the current row.
[0158] Specifically, the process described above is implemented as follows:
[0159] First, the horizontal complexity of subblock 1, sub_comp_hor, is calculated. Specifically, it is calculated using the set ori_pix[i][j], which consists of the pixel values that make up subblock 1, the pixel values or reconstructed values of the column to the left adjacent to subblock 1, and the pixel values of the row above the adjacent column. Here, i and j represent the matrices in which the pixel values are located, the pixel value of the first row and first column of subblock 1 is represented as ori_pix[0][0], and the other pixel values are estimated in this way. The horizontal complexity of subblock 1, sub_comp_hor, refers to the degree of difference between pixel points in the horizontal direction of subblock 1. Specifically, it is calculated as follows.
[0160]
number
[0161] The absolute value of the above formula is obtained as the horizontal complexity between the pixel value in the first row and first column of subblock 1 and the pixel value adjacent to its left.
[0162]
number
[0163] The absolute value of the above formula is obtained as the horizontal complexity between each pixel value in the first row of subblock 1.
[0164]
number
[0165] The absolute value of the above formula is obtained as the horizontal complexity between the pixel value in the second row and first column of subblock 1 and the pixel value adjacent to its left.
[0166]
number
[0167] The absolute value of the above formula is obtained as the horizontal complexity between each pixel value in the second row of subblock 1.
[0168] The vertical complexity sub_comp_ver of subblock 1 refers to the degree of difference between pixel points in the vertical direction within subblock 1. Similarly, the vertical complexity sub_comp_ver is calculated as follows:
[0169]
number
[0170] The absolute value of the above formula is obtained as the vertical complexity between the pixel values of the first row and the adjacent row above in subblock 1.
[0171]
number
[0172] The absolute value of the above formula is obtained as the vertical complexity between the pixel values of the second and first rows in subblock 1.
[0173] After obtaining multiple horizontal and vertical complexity values for subblock 1, the minimum of these values is defined as the texture information complexity `comp` for subblock 1. That is, the complexity of subblock 1 is:
number
[0174] The method for calculating the complexity of the texture information in subblocks 2, 3, and 4 is the same as that for subblock 1, and the method for dividing the textures of the U channel and V channel into subblocks and calculating the complexity of the texture information of the subblocks is the same as that for the Y channel, so the explanation is omitted here.
[0175] Furthermore, when it is necessary to merge multiple channels in order to jointly calculate complexity, for example, when it is necessary to merge the U channel and the V channel and jointly calculate complexity, this can be achieved using the following formula.
[0176]
number
[0177] In step S802, the current block's block-level complexity level is determined based on the complexity of the texture information of the subblocks for each channel.
[0178] In one embodiment, this step is achieved by the following three steps: In S8021, the complexity level of each channel's subblock is determined by the complexity of the texture information of the subblocks in each channel.
[0179] This process is achieved by setting multiple thresholds. In one specific example, it is achieved as follows:
[0180] Implementation method 1: Set two thresholds, threshold1 and threshold2.
[0181]
number
[0182] If bpc is less than 8, the default values for the two thresholds are 2 and 6, respectively.
[0183] Based on the two thresholds mentioned above, the complexity level (sub_comp) of the texture information of each subblock is divided into three complexity levels: level 0, level 1, and level 2. Specifically, it is divided as follows: 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.
[0184] Implementation form 2: Set four thresholds: threshold1, threshold2, threshold3, and threshold4. Thresholds are set as follows: threshold1 = 2 * (1 << (bpc - 8)), threshold2 = 4 * (1 << (bpc - 8)), threshold3 = 6 * (1 << (bpc - 8)), and threshold4 = 8 * (1 << (bpc - 8)). However, bpc >= 8.
[0185] Based on the four thresholds mentioned above, the complexity level (sub_comp_level) of the texture information of each subblock is divided into levels 0, 1, 2, 3, and 4. Specifically, it is divided as follows: 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.
[0186] In S8022, the complexity level of each channel's subblock is mapped to the channel-level complexity level.
[0187] Mapping the complexity levels of the subblocks of each channel to channel-level complexity levels is achieved by presetting multiple thresholds and using threshold mapping or a preset mapping policy. In one embodiment, there are three types of implementations.
[0188] Implementation Method 1: Multiple thresholds are set, the sum of the thresholds for each subblock within the corresponding channel, which is called sub_comp_level, is calculated, and the complexity of the texture information of each subblock is mapped to the channel-level complexity level of the corresponding channel according to the multiple thresholds. Using the channel subblock shown in Figure 9 above as an example, this process is specifically as follows. Three thresholds, 2, 4, and 7, are set, and the sum_sub_comp_level, the sum of the complexity levels of subblocks 1 to 4, is calculated. Based on these three thresholds, the texture information complexity sub_comp_level(0,1,2) of each of the four 3-level subblocks is mapped to a single 5-level channel-class complexity level comp_level(0,1,2,3,4).
[0189] The process of mapping the complexity of the texture information of each subblock according to the aforementioned threshold to the obtained channel-level complexity level comp_level(0,1,2,3,4) 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; and if 7 <= sum_sub_comp_level, then comp_level = 4.
[0190] Implementation form 2: Four thresholds, 5, 7, 10, and 12, are preset, and all sub_comp_levels are added together to obtain the comp_level according to the four thresholds. Here, the possible values for comp_level are (0, 1, 2, 3, 4). In this implementation form, unlike implementation form 1, the four 5-level sub_comp_levels may be mapped to one 5-level comp_level.
[0191] Implementation form 3: Obtain comp_level according to a preset logic rule. In one example, using the luminance channel of the current block as an example, the method for determining this logic rule is as follows:
[0192] Regarding the complexity level configuration consisting of the sub_comp_level of the four subblocks determined above, If the complexity level configuration includes two zeros, or one zero and three ones, If there are two consecutive zeros and the number of 2s is less than 2, then comp_level = 0; otherwise, comp_level = 1. If the complexity level configuration includes three 2s, or if there are two consecutive 2s, If there are three 2s, then comp_level = 4; otherwise, comp_level = 3. In other cases, comp_level = 2.
[0193] Using the 16x2 chromaticity channels of a block as an example, the method for determining the aforementioned logic rule is as follows:
[0194] If the complexity level's level configuration includes two zeros and the number of twos is less than two, If there are three zeros, or two consecutive zeros, and the number 2 is zero, then comp_level = 0; otherwise, comp_level = 1.
[0195] If the complexity level configuration includes two 2s, or if there is one 2 and three 1s, If there are three 2s or two consecutive 2s and the number of 0s is 0, then comp_level = 4; otherwise, comp_level = 3. In other cases, comp_level = 2.
[0196] In another possible implementation, using the current block's 8x2 or 8x1 chromaticity channels as an example, the method for determining the logic rule described above may be as follows:
number
[0197] In S8023, the complexity level of the current block is determined based on the complexity level of each channel level.
[0198] Taking the case where the image to be processed is a YUV image as an example, steps S8021 and S8022 may determine the channel-level complexity levels of the three channels Y, U, and V. In one embodiment, determining the block-level complexity level of the current block based on the complexity levels of each channel is achieved as follows.
[0199] Implementation Mode 1: The complexity level of the current block, blk_comp_level, is determined based on the sum of the complexity levels of each channel level.
[0200]
number
[0201] [Table 1]
[0202] In Table 1 above, `sample_rate` is the sampling rate of the image to be processed, and `format_bias` is the bias amount set when calculating the quantization parameters.
[0203] In steps S8021 to 8023, the channel-level complexity levels may be shared by multiple channels or may be independent. For example, in the case of an image in YUV or YCoCg format, luminance may use one complexity level, chromaticity may share one complexity level, or the three channels may determine their channel complexity levels individually.
[0204] Here, if the first chromaticity and the second chromaticity share the same complexity level, the method for calculating that complexity level is as follows.
[0205] Implementation 1: Obtain the minimum, maximum, or weighted value of the complexity level of two chromaticity channels.
[0206] Implementation form 2: The minimum, maximum, or weighted value of the complexity of the texture information of the two chromaticity channels is obtained as the texture complexity of the chromaticity, and the channel-level complexity level of the chromaticity is obtained according to the method of steps S8021 to 8023.
[0207] On the video decoding side, obtaining the complexity level of each channel from the code stream encoded by the encoding side is achieved by obtaining the complexity information bit of the current block from the encoded code stream and determining the complexity level of the channel based on the complexity information bit. Here, the complexity information bit may be 1 bit or 3 bits, and the most significant bit of the complexity information bit indicates whether the complexity level of the current channel is the same as the complexity level of the same channel in the image block immediately preceding the current block, and the change between the two.
[0208] Specifically, taking the case where the image to be processed is a YUV image as an example, the decoding side obtains the channel-level complexity level by, if the current channel-level complexity level is the complexity level of the U channel in the current block, then the complexity of the same channel in the previous image block indicates the complexity level of the U channel in the decoded image block prior to the current block. The most significant bit determines whether the complexity information bit is 1 bit if they are determined to be the same, and 3 bits if they are not the same, with the lower 2 bits indicating the change between the channel-level complexity of the current block and the complexity level of the same channel in the image block immediately preceding the current block. Based on this change and the channel complexity level of the same channel in the previous image block, the channel-level complexity level to be obtained can be determined. The above scenario is merely illustrative, and it is understood that the scope of protection of the present invention is not limited thereto. For example, the complexity information bits may indicate whether the complexity of the U channel in the current block and the Y channel in the current block are the same, and the change if they are different.
[0209] In step S702, the average number of bits for lossless coding at the same level and the average number of bits for lossless coding of the current block are determined.
[0210] When the first and second chromaticities of the YUV image share a single channel-level complexity level, determining the same-level reversible coding average bit count and the reversible coding average bit count of the current block can be achieved as follows.
[0211] In S7021, the number of lossless encoding bits, pred_lossless_bits, is determined.
[0212]
number
[0213] However, cu_bits currently indicates the actual number of encoded bits in the block, determined based on the number of encoded bits in the encoded / decoded image. width and height indicate the width and height of the encoded block, respectively. luma_qp indicates the quantization parameter for the luminance channel of the encoded / decoded image. chroam_qp indicates the quantization parameter for the chromaticity channel of the encoded / decoded image. a and b are weight values, their settings related to the prediction mode, with default values of 8 for both. In IBC mode, a, b >= 8. In point prediction mode, a, b >= 8. In palette mode, original value mode, and residual skip mode, the quantization parameters are disabled, so a, b == 0.
[0214] Also, if the buffer is full and residual skip mode is enabled,
number
[0215] In S7022, the average number of bits for lossless encoding at the same level, lossless_bits[blk_comp_level], is determined.
[0216] The average number of bits for lossless encoding at the same level, lossless_bits[blk_comp_level], corresponds to the block-level complexity level of the current block. If the block-level complexity level of the current block is the same as the block-level complexity level of the decoded image block, it is updated using the following formula.
[0217]
number
[0218] In one embodiment, one specific way of setting the update rate d is that for the first four image blocks of any complexity, the update rate d is set to 3 / 4, 5 / 8, 1 / 2, and 3 / 8, respectively, and in all other cases, it is set to 1 / 4.
[0219] In S7023, the average number of bits for lossless encoding, avg_lossless_bits, is determined.
[0220] Unlike the average number of bits for lossless encoding at the same level, the average number of bits for lossless encoding, avg_lossless_bits, is updated for each block. The specific update method is as follows:
[0221]
number
[0222] In step S703, the target number of bits for the current block is determined.
[0223] In one embodiment, determining the target number of bits for the current block is achieved by the following steps:
[0224] In S7031, the initial target number of bits is determined.
[0225] The initial target number of bits is the target number of bits calculated without considering buffer fullness, and is calculated by the following method.
[0226] (1) Calculate the quality ratio.
[0227]
number
[0228] [Table 2]
[0229] The method for calculating the aforementioned bpp is as follows:
[0230]
number
[0231] The initial transmission delay mechanism has the following characteristics: a) When transmission begins, the video slice is transmitted after delay_blks image blocks have been delayed, and these image blocks are not subjected to underflow processing. b) The buffer state of the video slice's tail buffer is fixed to delay_bits (zeros are used to fill in any missing bits). As shown in Figure 10, Figure 10 is a schematic diagram of the initial transmission delay mechanism. One or more image blocks in the video slice are located between the initial position and the second position, and the maximum value of the corresponding buffer increases based on the position between the initial position and the second position. Furthermore, for image blocks located between the threshold position and the 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. Between the second position and the threshold position, the buffer size corresponding to the image block does not change.
[0232] The aforementioned delay_bits are determined by the following calculation.
[0233]
number
[0234] Furthermore, if the image to be processed is a YUV444 or RGB image, the quality_ratio must be limited to a range of 0 to 0.6.
[0235] In one embodiment, after the quality ratio has been determined, the quality ratio can also be updated by calculating the average complexity level ave_comp_level of all previous image blocks. Specifically, this can be achieved as follows:
[0236]
number
[0237] (2) Determine the initial target number of bits. The aforementioned initial target number of bits, pre_target_bits, is determined by the following formula.
[0238]
number
[0239] In S7032, the initial target number of bits is limited according to the buffer state and the block-level complexity level of the current block, and the final target number of bits for the current block is determined. Specifically, this is implemented as follows.
[0240] (1) The buffer state can be expressed as buffer fullness. Buffer fullness is determined by the following formula.
[0241]
number
[0242] Also, in the process, when determining the available_buffer_size, as shown in FIG. 10, considering the influence of the initial transmission delay function, the available_buffer_size varies according to the position of the current block in the video slice.
[0243] For the first delay_blks blocks of the video slice, that is, from the initial position to the second position, the available_buffer_size linearly increases from delay_bits to max_buffer_size. The increasing step size start_step is start_step = (max_buffer_size ‐ delay_bits) / delay_blks; where max_buffer_size represents the maximum available buffer size and is a preset fixed value.
[0244] The available_buffer_size remains unchanged from the second position to the threshold position and is always equal to max_buffer_size.
[0245] From the threshold position to the final position, the available_buffer_size linearly decreases from max_buffer_size to delay_bits. The decreasing step size end_step 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.
[0246] Here, since the calculation of the delay_blks was described in detail in the part where the quality ratio is calculated, the description is omitted here.
[0247] (2) After determining the buffer fullness, upper and lower limits are determined to restrict the target number of bits. Specifically, this is done as follows. When calculating the lower limit min_bits,
number
[0248] When calculating the upper limit max_bits,
number
[0249] When considering the initial transmission delay mechanism, the process of determining the upper and lower limits described above must also take into account the effect of the initial transmission delay mechanism on buffer fullness.
[0250] (3) Based on the determined upper and lower limits, the initial target number of bits is limited, and the target number of bits for the current block is obtained. Specifically,
number
[0251] Furthermore, when the current block is the first row block of the image being processed, predicting the parameters of the first row block is 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 a first-row quality improvement parameter. This process is mainly achieved by reducing the quantization parameters of the first row block.
[0252] Specifically, the process for determining the target number of bits mentioned above is implemented as follows.
[0253] If the current block is the first-line block, increase bpp by 2.
[0254] For all first-line blocks in the image to be processed, the adjustment of the bpp parameter is realized by setting the increase amount of the bpp of the image block in the first line to bpp_delta_row, and gradually decreasing bpp_delta_row from 2.5 to 0.5 from the first block to the last block in the first line.
[0255] If the current block is the first-line block, in the process of determining the target bit number, improve the image quality of the current block by restricting the initial target bit number according to the buffer state and the block-level complexity level. After restricting the target bit number according to the buffer state and complexity, if the current block is the first-line block of the slice and target_bits < 7, where 7 is a preset empirical threshold, target_bits should increase and the increased target_bits must be within a predetermined range. Specifically,
Number
[0256] If the current block is the first-line block, further improve the quality of the current block by determining the upper limit according to the following formula.
[0257]
Number
[0258] If the current block is a first-row block, it is understood that improving the quality of the current block using the first-row quality improvement parameter will only be performed if certain conditions are met. For example, first-row quality improvement will only be performed if the complexity level of the current block is low.
[0259] Furthermore, if the current block is the first column block of the image being processed, the quality of the current block can be improved by introducing a first column quality improvement parameter. This process is mainly achieved by reducing the quantization parameter of the first column block.
[0260] If the current block is the first column block, increase bpp by 2.
[0261] For all first-row blocks in the image to be processed, the bpp parameter is adjusted by setting the increase in bpp for the first-row image block to bpp_delta_col, and gradually decreasing bpp_delta_col from 2.5 to 0.5 from the first block to the last block in the first row.
[0262] If the current block is the first column block, the image quality of the current block can be improved in the process of determining the target number of bits by limiting the initial target number of bits according to the buffer state and the complexity level of the block, in the following way: After limiting the target number of bits according to the buffer state 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, target_bits increases, and the increased target_bits must be within a predetermined range. Specifically,
number
[0263] If the current block is the first column block, the quality of the current block can be further improved by determining an upper limit using the following formula.
[0264]
number
[0265] If the current block is a first-column block, it is understood that improving the quality of the current block using the first-column quality improvement parameter will only be performed if certain conditions are met. For example, first-column quality improvement will only be performed if the complexity level of the current block is high.
[0266] In step S704, the quantization parameters of the current block are determined. In this step, determining the quantization parameters of the current block is achieved as follows:
[0267] (1) When calculating the reference quantization parameter ref_qp,
number
[0268] (2) Calculate the quantization parameters for each component. Taking the case where the image to be processed is a YUV image as an example, this process involves calculating the quantization parameters for each channel of the YUV. Specifically, this is done as follows.
[0269] When calculating the offset amount, bias = bias_init * format_bias; However, bias_init and format_bias are preset values, where bias_init refers to Table 3 below and format_bias refers to Table 1 above. When calculating the quantization parameters for the luminance channel, luma_qp= Clip3(0, luma_max_qp, ref_qp‐sample_rate * bias) When calculating the chromaticity channel quantization parameter, chroma_qp = Clip3(0, chroma_max_qp, ref_qp + bias) However, refer to Table 3 for bias_init and Table 2 for format_bias.
[0270] [Table 3]
[0271] In Table 3 above, comp_level[0] represents the luminance component, and comp_level[1] represents the chromaticity component.
[0272] Alternatively, for YUV420 format images, two YUV420 images may be combined into a single YUV444 image for processing. In this case, the complexity level of the luminance component is determined by the weighted value of the two images.
[0273]
number
[0274] The complexity level of the luminance component may be the maximum or minimum value of the two. The present invention is not particularly limited to this.
[0275] In step S705, video encoding / decoding is performed on the current block based on the quantization parameters.
[0276] In one embodiment, the video encoding / decoding device encodes / decodes the current block based on the quantization parameters of the current block. In the encoding process, it is understood that the video encoder incorporates the channel-level complexity level of the current block into the code stream, or incorporates the quantization parameters of the current block into the code stream. Accordingly, the decoding side obtains the channel-level complexity level in the code stream, calculates the quantization parameters, and performs decoding. Alternatively, the decoding side obtains the quantization parameters in the code stream and performs decoding. Of course, the video encoder may incorporate both types of information into the code stream.
[0277] Furthermore, in the process of determining the quantization parameters, each channel component of the current block may have parameters such as the average number of bits for lossless coding at the same level, the average number of bits for lossless coding, and the target number of bits determined individually. The process is implemented as follows.
[0278] Currently, determining the same-level reversible coding average number of bits and the reversible coding average number of bits for each channel component of a block is done as follows:
[0279] (1) Determine the number of lossless bits [i] for each channel component of the current block.
[0280]
number
[0281] (2) Determine the average number of bits for lossless_bits[i][comp_level[i]] of the same level lossless encoding for each channel component.
number
[0282] (3) Determine the average number of bits for lossless encoding, avg_lossless_bits.
number
[0283] Currently, determining the target number of bits for each channel component of a block is achieved by the following method.
[0284] (1) Determine the quality ratio.
[0285] Implementation method 1: Determine the quality ratio [i] of each channel component in the current block.
number
[0286] Implementation form 2: When calculating quality_ratio, the cu (Coding Unit) level is still used, and the calculation process is the same as in step S7031, but it is necessary to merge the ave_lossless_bits[i] into a cu-level variable.
[0287] (2) Determine the target number of bits, target_bits.
[0288] Implementation form 1:
number
[0289] Implementation form 2: This corresponds to implementation form 2 in step (1). In this case, the method for calculating the target number of bits, target_bits, is the same as in step S703, and the obtained target_bits is already a cu-level variable. Similarly, for the subsequent step (3), it is necessary to merge the cb-level lossless_bits[i] into the cu-level.
[0290] (3) Limit the target number of bits according to the buffer state and complexity. This step is the same as step S703 above, so the explanation is omitted here. Currently, determining the quantization parameters for each channel component of a block is achieved as follows.
[0291] Implementation method 1: Determine the quantization parameters for each channel component.
number
[0292] If step (3) is enabled, meaning the upper and lower bounds act as constraints and the value of target_bits changes to the upper or lower bound, target_bits is redistributed based on the proportion of target_bits[i] obtained in steps (1) and (2) to obtain a new target_bits[i]. If target_bits is not changed in step (3), the value of target_bits[i] remains unchanged.
[0293] Implementation form 2: If target_bits have not been separated before, target_bits are separated at this time according to the complexity level.
[0294] Implementation form 3: All variables prior to the step are at the cu level, and at this time the reference quantization parameter ref_qp is separated according to complexity, and the qp obtained from the separation is used as the final luminance and chromaticity qp.
[0295] TIFF0007855137000045.tif24148
[0296] TIFF0007855137000046.tif27162
[0297] Furthermore, it is necessary to merge a cb-level variable into a cu-level variable. If the cu variable that needs to be merged is temp[i], the merging process is specifically as follows:
number
[0298] In another specific embodiment of the present invention, the rate control parameter of the video image decoding method or the video image encoding method can also be a fixed-point number. Specifically, this is achieved by the following process.
[0299] S1: Initialization of encoding control
[0300] TIFF0007855137000048.tif123163
[0301] The above parameters are all intermediate parameters of the encoding control initialization process and are used to make the rate control parameters fixed-point numbers. Here, WarmUp[i](0<=i<=4) represents the update rate parameter for the first few blocks and is used to update the same level reversible encoding bit count, AdjComplexity. ComplexityShift represents the number of bits shifted by fixed-point arithmetic related to complexity. InfoRatioShift represents the number of bits shifted by fixed-point arithmetic related to the quality ratio. BppShift represents the number of bits shifted by fixed-point arithmetic related to bpp. FullnessShift represents the number of bits shifted by fixed-point arithmetic related to fullness. AvgComplexityShift represents the number of bits shifted by fixed-point arithmetic related to the reversible encoding average bit count. ChromaSampleRateShift represents the number of bits shifted by fixed-point arithmetic related to the sampling rate. K1Shift represents the number of bits shifted by fixed-point arithmetic related to k1 (see Table 4). K2Shift represents the number of bits shifted by fixed-point arithmetic related to k2. K3Shift represents the number of shift bits using fixed-point arithmetic related to k3. K4Shift represents the number of shift bits using fixed-point arithmetic related to k4. BiasShift represents the number of shift bits using fixed-point arithmetic related to Bias. K2, K3, and K4 are fixed empirical values used in the coding control algorithm. DelayBits represents the number of delay bits. TargetBpp represents the target bpp and is set externally. TransmissionDelayCu represents the number of cu for the initial transmission delay. EndDecreaseBits represents the number of bits that need to be reduced to the end of the slice due to the initial delay function. RcBufferSize represents the buffer size considered by the coding control. MuxWordSize represents the number of bits occupied by header information required for the substream parallel function. EndControlBlocks represents the number of blocks that need to be manipulated at the end of the slice due to the initial transmission delay.DecreaseStepLog2 represents the logarithm of the step size used to define the decrease in MaxBufferSize used by the code rate control module in each control block at the end of the slice, and its value is found in the code stream header. EndControlBegin represents the index of the block where control begins from the end of the slice. SliceWidthInCu represents how many cu widths are in the slice width. SliceHeightInCu represents how many cu heights are in the slice height. EndTargetFullness represents the target fullness at the end of the slice. RemainBlksLog2 represents the maximum binary number of bits in the total number of coded units in a single slice. MaxBufferSize represents the maximum buffer size.
[0302] According to BitDepth[0] (representing the bpc of the Y channel), ImageFormat retrieves initialization values for AdjComplexity (number of bits for lossless encoding at the same level), AvgComplexity (average number of bits for lossless encoding), ComplexityOffset (bias value for complexity calculation), MaxComp (maximum number of bits for lossless encoding), and K1 (empirical value) from Table 1.
[0303] [Table 4]
[0304] Table 4 above shows the correspondence between AdjComplexity, AvgComplexity, ComplexityOffset, MaxComp, and K1, and BitDepth[0] and ImageFormat.
[0305] According to the ImageFormat (image format), the initialization values for ChromaSampleRate (sampling rate), InvElem (multiplier required to remove division related to the sampling rate), InvElemShift (shift value required to remove division related to the sampling rate), and FormatBias (bias value for different image formats relative to qp) can be obtained from Table 5 below.
[0306] [Table 5]
[0307] Table 5 above shows the correspondence between ChromaSampleRate, InvElem, InvElemShift, FormatBias, and ImageFormat.
[0308] S2: Determine the quantization parameters. This step is implemented as follows.
[0309] S21: The quantization parameter MasterQp of the coding unit is calculated according to the luminance complexity level ComplexityLevel[0] and chromaticity complexity level ComplexityLevel[1] of the current coding unit.
[0310] S22: Calculate the quantization parameters Qp[0] and Qp[1] of the current coding unit's luminance coding block and chromaticity coding block according to MasterQp.
[0311] Here, calculating the quantization parameter MasterQp of the encoding unit according to the luminance complexity level ComplexityLevel[0] and chromaticity complexity level ComplexityLevel[1] of the current encoding unit is achieved as follows. TIFF0007855137000051.tif236131
[0312] However, bppAdj represents the adjustment value for bpp. BitsRecord represents the total number of bits currently encoded / decoded. CurrBlocks represents the number of blocks currently encoded / decoded. maxComp represents the conversion value required for MaxComp to make the encoding control a fixed-point number. complexityOffset represents the conversion value required for ComplexityOffset to make the encoding control a fixed-point number. RcBufferSizeMaxBit represents the buffer size of the code stream. The value of RcBufferSize is equal to the value of rc_buffer_size, and the value of RcBufferSizeMaxBit represents the maximum binary number of bits in RcBufferSize. shiftCur represents the current shift value. tmp represents the intermediate variables generated in the process of making the encoding control a fixed-point number. fullness represents the fullness. infoRatio represents the quality ratio. relativeComplexity represents the relative number of reversible encoded bits. minRate1, minRate2, and minRate13 represent the intermediate variables used to calculate minRate. minRate represents the lower limit of targetRate. targetRate represents the target number of bits. bppOffset1, bppOffset2, and bppOffset3 represent intermediate variables for calculating bppOffset. bppOffset represents the bias value of bpp. maxRate represents the upper limit of targetRate. InverseTable is a single preset table, defined as 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}.
[0313] The calculation of the quantization parameters Qp[0] and Qp[1] of the luminance coding block and chromaticity coding block of the current coding unit according to the aforementioned MasterQp can be achieved as follows.
[0314] Currently, the BiasInit is obtained from Table 6 below, according to the luminance complexity level [0] and chromaticity complexity level [1] of the encoding unit.
[0315] Table 6: Definition of BiasInit
[0316] [Table 6]
[0317] TIFF0007855137000053.tif48162
[0318] S3: Update rate control parameters
[0319] TIFF0007855137000054.tif70164
[0320] TIFF0007855137000055.tif49163
[0321] TIFF0007855137000056.tif39156
[0322] Furthermore, any methods not specifically described in the above technical proposals can be implemented on either the decoding or encoding side.
[0323] Furthermore, any part or all of the above embodiments can constitute a new embodiment, provided they do not contradict each other.
[0324] Embodiments of the present invention provide a video encoding / decoding device, which may be a video encoding / decoding instrument, a video encoder, or a video decoder. Specifically, the video encoding / decoding device is for performing steps performed by the video encoding / decoding instrument in the video image decoding method or video image encoding method described above. The video encoding / decoding device provided in embodiments of the present invention may include modules corresponding to the corresponding steps.
[0325] Embodiments of the present invention allow for the classification of a video encoding / decoding device into functional modules according to the examples of the methods described above. For example, each functional module may be separated according to its function, or two or more functions may be integrated into a single processing module. The integrated module may be implemented in hardware form or in the form of a software functional module. The module classification in embodiments of the present invention is schematic and merely a classification of logical functions, and other classification methods may be used in actual implementation.
[0326] When each function module is separated according to its respective function, Figure 11 shows one possible schematic configuration of the video encoding / decoding device according to the above embodiment. As shown in Figure 11, the video encoding / decoding device 1100 includes a complexity level determination module 1101, a rate control parameter determination module 1102, a quantization parameter determination module 1103, and an encoding / decoding module 1104.
[0327] The complexity level determination module 1101 obtains the complexity levels of at least two channel levels of the current block in the image to be processed, and determines the block level of the current block according to the complexity levels of at least two channel levels, with the channel level complexity levels indicating the degree of complexity of the channel level texture of the current block.
[0328] The rate control parameter determination module 1102 is for determining the target number of bits of the current block according to rate control parameters, the rate control parameters include the block-level complexity level of the current block.
[0329] The quantization parameter determination module 1103 is for determining the quantization parameters of the current block based on the target number of bits.
[0330] The encoding / decoding module 1104 is for encoding / decoding the current block based on the quantization parameters.
[0331] In one example, the rate control parameter includes the average number of bits for lossless coding at the same level, the average number of bits for lossless coding, and the code stream buffer fullness. The rate control parameter determination module is specifically used to determine the average number of bits for lossless coding at the same level and the average number of bits for lossless coding, to determine the initial target number of bits based on the average number of bits for lossless coding at the same level and the average number of bits for lossless coding, and to determine the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, and the initial target number of bits. Here, the average number of bits for lossless coding at the same level is the average of the predicted number of bits required to losslessly encode the current block and a plurality of decoded image blocks, and the complexity levels of the plurality of decoded image blocks are the same as the complexity level of the current block. The average number of bits for lossless coding is the average of the predicted number of bits required to losslessly encode the current block and all decoded image blocks. The code stream buffer fullness indicates the buffer fullness, and the buffer is for storing the code stream of the image to be processed.
[0332] In one example, the rate control parameter determination module is used to determine the average number of bits for lossless coding at the same level and the average number of bits for lossless coding; to determine the number of bits for lossless coding of the current block, wherein the number of bits for lossless coding is a predicted value of the number of bits required to losslessly code the current block; to update the average number of bits for lossless coding of the current block based on the number of bits for lossless coding of the current block and a plurality of past average number of bits for lossless coding at the same level, wherein the past average number of bits for lossless coding at the same level is the average number of bits for lossless coding of decoded image blocks having the same complexity level as the block complexity level of the current block; and to update the average number of bits for lossless coding of the current block based on the number of bits for lossless coding of the current block and all past average number of bits for lossless coding, wherein the past average number of bits for lossless coding is the average number of bits for lossless coding of decoded image blocks.
[0333] In one possible implementation, the current block is the first row block of the image to be processed, the rate control parameter includes a first row quality improvement parameter, and the rate control parameter determination module is specifically used to determine the target number of bits of the current block based on the rate control parameter, which further includes adjusting the target number of bits of the current block based on the first row quality improvement parameter so that the quantization parameter of the current block becomes smaller.
[0334] In one possible implementation, the current block is the first row block of the image to be processed, the rate control parameter includes a first row quality improvement parameter, and the rate control parameter determination module is specifically used to determine the target number of bits of the current block based on the rate control parameter, which further includes adjusting the target number of bits of the current block based on the first row quality improvement parameter so that the quantization parameter of the current block becomes smaller.
[0335] 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. On the encoding side, 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. Alternatively, on the decoding side, channel-level complexity levels are obtained from a code stream, and the code stream is the encoded code stream of the current block.
[0336] In one example, the complexity level determination module is specifically used to obtain a channel-level complexity level from a code stream. This includes obtaining complexity information bits for the current block from the code stream, the complexity information bits being used to indicate the channel-level complexity level of the current block, and determining the channel-level complexity level based on the complexity information bits.
[0337] In one example, the complexity level determination module is specifically used to acquire channel-level texture information of the current block and to determine the channel-level complexity level of the current block based on the channel-level texture information. This includes using an image block of at least one channel of the current block as a processing unit, dividing the processing unit into at least two subunits, determining the texture information of each subunit, and determining the block-level complexity level of the current block based on the texture information of each subunit within the processing unit.
[0338] In one example, the complexity level determination module is specifically used to determine the texture information of each subunit. This includes obtaining the original pixel value of the subunit, the original pixel value or reconstruction value of the adjacent column to the left of the subunit, and the reconstruction value of the adjacent row above the subunit, calculating the horizontal and vertical texture information of the subunit accordingly, and selecting the minimum value from the horizontal and vertical texture information as the texture information of the corresponding subunit.
[0339] In one example, the complexity level determination module is specifically used in a processing unit to determine the block-level complexity level of the current block based on the texture information of each subunit. This includes dividing the texture information of each subunit into corresponding subunit complexity levels based on a plurality of thresholds, wherein the plurality of thresholds are predetermined, and determining the block complexity level of the current block based on the complexity level of each subunit.
[0340] 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 level of each subunit. This includes mapping each subunit complexity level to the corresponding channel-level complexity level based on a preset rule, and determining the block-level complexity level of the current block based on the complexity level of each channel-level.
[0341] In one example, the complexity level determination module is specifically used to map the complexity level of each subunit to the corresponding channel-level complexity level based on preset rules. The channel-level complexity level is determined based on a plurality of thresholds and the sum of the complexity levels of each subunit, and the plurality of thresholds are predetermined.
[0342] In one example, the complexity level determination module is specifically used to map each subunit complexity level to the corresponding channel-level complexity level based on preset rules. The level configuration of the subunit complexity level is determined, and the corresponding channel-level complexity level is determined based on the level configuration.
[0343] In one example, the complexity level determination module is specifically used to determine the complexity level of the current block's block class based on the complexity level of each channel class. This includes obtaining the maximum, minimum, or weighted value of the complexity level of each channel class as the complexity level of the current block's block class, or determining the complexity level of the current block's block class based on a plurality of thresholds and the sum of the complexity levels of each channel class, wherein the plurality of thresholds are predetermined. All relevant details of each step in the embodiment of the above method can be used to describe the functions of the corresponding functional modules, and therefore, their explanation is omitted here.
[0344] Of course, the video encoding / decoding device provided in the embodiments of the present invention includes, but is not limited to, the modules described above. For example, the video encoding / decoding device may also include a storage module.
[0345] The memory module can be used to store program code and data for a video encoding / decoding device.
[0346] Embodiments of the present invention further provide an electronic device, which includes the video encoding / decoding device 1100, which performs a method performed by any one of the video decoders described above.
[0347] Embodiments of the present invention further provide a computer-readable storage medium. A computer program is stored in the computer-readable storage medium, and when the computer program is executed on a computer, it causes the computer to execute a method performed by one of the video decoders described above.
[0348] The interpretation and beneficial effects of the relevant content in any one of the above computer-readable storage media can also be found in the corresponding embodiments described above, so a detailed explanation is omitted here.
[0349] Embodiments of the present invention further provide a chip which integrates a control circuit and one or more ports for realizing the functions of the video encoding / decoding device 100. The functions that the chip selectively supports are omitted here, as they can be found in the above description. Those skilled in the art will understand that all or some of the steps for realizing the above embodiments can be completed by programming the relevant hardware. The program can be stored in a computer-readable storage medium, such as read-only memory or random-access memory. The processing unit or processor may 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 (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
[0350] Embodiments of the present invention further provide a computer program product that includes instructions. When executed by a computer, the instructions cause the computer to perform one of the methods described in the embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed by a computer, all or part of the flow or functionality of the embodiments of the present invention is generated. The computer may be a general-purpose computer, a dedicated 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. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired connection (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless connection (e.g., infrared, radio, microwave, etc.). The computer-readable storage medium may be any available medium accessible to the computer, or a data storage device such as a server or data center that is integrated with one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., SSDs).
[0351] The devices for storing the above-mentioned computer instructions or computer programs provided in the embodiments of the present invention include, but are not limited to, the memory, computer-readable storage medium, and communication chip, all of which are non-transitory.
[0352] The embodiments described above can be implemented in whole or in part by software, hardware, firmware, or a combination thereof. When implemented by a software program, it can be implemented in whole or in part by a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the flow or functionality of the embodiments of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable device. The computer instructions may be stored on a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, radio, microwave, etc.). The computer-readable storage medium may be any available medium accessible to the computer, or a data storage device such as a server or data center that is integrated on one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs).
[0353] While the present invention has been described herein with reference to each embodiment, those skilled in the art can understand and implement other variations of the disclosed embodiments by referring to the drawings, the disclosed content, and the appended claims when carrying out the processes of the present invention protected by the present invention. In the claims, the term “comprising” does not exclude other components or steps, and “one” or “one” does not exclude the case of multiple. A single processor or other unit can implement several of the functions enumerated in the claims. Although several measures are described in the dependent claims which are different from each other, it is not impossible that these measures can be combined to produce a good effect.
[0354] While the present invention has been described with reference to specific features and examples, it is clear that various modifications and combinations are possible without departing from the spirit and scope of the invention. Accordingly, this specification and drawings are merely illustrative descriptions of the invention as defined by the appended claims and are deemed to cover any and all modifications, changes, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various changes and modifications to the invention without departing from the spirit and scope of the invention. Thus, if these modifications and modifications of the invention fall within the scope of the claims of the invention and the equivalent art, the invention is intended to include these modifications and modifications.
Claims
1. A video image decoding method, Obtaining channel-level complexity levels from a code stream and determining the block-level complexity level of the current block according to at least two channel-level complexity levels, wherein the code stream is the encoded code stream of the current block, and the channel-level complexity levels are for indicating the degree of complexity of the channel-level texture of the current block. Determining the target number of bits for the current block based on rate control parameters, wherein the rate control parameters include the block-level complexity level of the current block. The quantization parameters of the current block are determined based on the target number of bits, This includes decoding the current block based on the quantization parameters, The rate control parameters include the average number of bits for lossless coding at the same level, the average number of bits for lossless coding, and the code stream buffer fullness. Determining the target number of bits for the current block based on the rate control parameters is: Determining the average number of bits for reversible coding at the same level and the average number of bits for reversible coding, The initial target number of bits is determined based on the aforementioned average number of bits for reversible coding at the same level and the aforementioned average number of bits for reversible coding. The process includes determining the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, and the initial target number of bits, The aforementioned average number of bits for reversible encoding at the same level is the average of the predicted number of bits required to reversibly encode the current block and the multiple decoded image blocks, and the complexity level of the multiple decoded image blocks is the same as the complexity level of the current block. The aforementioned average number of bits for reversible encoding is the average of the predicted number of bits required to reversibly encode the current block and all decoded image blocks, the code stream buffer fullness indicates the buffer fullness, and the buffer is for storing the code stream of the image to be processed. Video image decoding method.
2. Determining the above-mentioned average number of bits for reversible coding at the same level and the above-mentioned average number of bits for reversible coding is: The process involves determining the number of reversible encoded bits for the current block, wherein the number of reversible encoded bits is a predicted value of the number of bits required to reversibly encode the current block. The process involves updating the average number of bits for lossless coding of the current block based on the number of bits for lossless coding of the current block and a plurality of average numbers of bits for lossless coding of the same level in the past, wherein the average number of bits for lossless coding of the same level in the past is the average number of bits for lossless coding of decoded image blocks having the same complexity level as the block-level complexity level of the current block. The process includes updating the average number of reversible bits of the current block based on the average number of reversible bits of the current block and the average number of reversible bits of all past blocks, wherein the average number of reversible bits of past blocks is the average number of reversible bits of the decoded image block. The video image decoding method according to claim 1.
3. The current block is the first row block of the image to be processed, and the rate control parameter includes a parameter for improving the quality of the first row. When determining the target number of bits for the current block based on the rate control parameters, the video image decoding method further: This includes adjusting the target number of bits of the current block based on the leading row quality improvement parameter so that the quantization parameter of the current block becomes smaller. The video image decoding method according to claim 1.
4. The current block is the first column block of the image to be processed, and the rate control parameter includes a parameter for improving the quality of the first column. When determining the target number of bits for the current block based on the rate control parameters, the video image decoding method further: This includes adjusting the target number of bits of the current block based on the leading column quality improvement parameter so that the quantization parameter of the current block becomes smaller. The video image decoding method according to claim 1.
5. Obtaining channel-level complexity from a code stream is possible. The process involves obtaining complexity information bits for the current block from the code stream, wherein the complexity information bits are intended to indicate the channel-level complexity level of the current block. This includes determining the channel-level complexity level based on the complexity information bits, The video image decoding method according to claim 1.
6. The most significant bit in the complexity information bits indicates whether the current channel-level complexity level is the same as the complexity level of the same channel in the image block immediately preceding the current block, and the change between the two. If they are the same, there is one complexity information bit; otherwise, there are three complexity information bits. The video image decoding method according to claim 5.
7. A video image encoding method, The process involves obtaining channel-level texture information of the current block from a video image, determining the channel-level complexity level of the current block based on the channel-level texture information, and determining the block-level complexity level of the current block according to at least two channel-level complexity levels, wherein the channel-level complexity levels indicate the degree of complexity of the channel-level texture of the current block. Determining the target number of bits for the current block based on rate control parameters, wherein the rate control parameters include the block-level complexity level of the current block. The quantization parameters of the current block are determined based on the target number of bits, Encoding the current block based on the quantization parameters, Includes, The rate control parameters include the average number of bits for lossless coding at the same level, the average number of bits for lossless coding, and the code stream buffer fullness. Determining the target number of bits for the current block based on the rate control parameters is: Determining the average number of bits for reversible coding at the same level and the average number of bits for reversible coding, The initial target number of bits is determined based on the aforementioned average number of bits for reversible coding at the same level and the aforementioned average number of bits for reversible coding. The process includes determining the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, and the initial target number of bits, Here, the average number of bits for same-level reversible coding is the average of the predicted number of bits required to reversibly encode the current block and the plurality of encoded image blocks, and the complexity level of the plurality of encoded image blocks is the same as the complexity level of the current block. The aforementioned average number of bits for reversible encoding is the average of the predicted number of bits required to reversibly encode the current block and all encoded image blocks; the code stream buffer fullness indicates the buffer fullness; and the buffer is for storing the code stream of the image to be processed. Video image encoding method.
8. 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 is: The image block of at least one channel of the current block is used as a processing unit, the processing unit is divided into at least two subunits, and the texture information of each subunit is determined. The processing unit includes determining the block-level complexity level of the current block based on the texture information of each subunit, The video image encoding method according to claim 7.
9. Determining the texture information of each subunit is: The original pixel value of the subunit, the original pixel value or reconstructed value of the adjacent column to the left of the subunit, and the reconstructed value of the adjacent row above the subunit are obtained, and the corresponding horizontal texture information and vertical texture information of the subunit are calculated. This includes selecting the minimum value from the horizontal texture information and the vertical texture information as the texture information of the corresponding subunit, The video image encoding method according to claim 8.
10. In the processing unit, determining the block-level complexity level of the current block based on the texture information of each subunit is: In the processing unit, the texture information of each subunit is divided into the complexity level of the corresponding subunit based on a plurality of thresholds, wherein the plurality of thresholds are predetermined. This includes determining the block-level complexity level of the current block based on the complexity level of each of the subunits, The video image encoding method according to claim 8.
11. Determining the block-level complexity level of the current block based on the complexity level of each subunit is: Mapping the complexity level of each subunit to the corresponding channel-level complexity level based on preset rules, This includes determining the complexity level of the current block based on the complexity level of each channel, The video image encoding method according to claim 10.
12. Mapping the complexity level of each subunit to the corresponding channel-level complexity level based on the preset rules is: This includes determining a channel-level complexity level based on a plurality of thresholds and the sum of the complexity levels of each subunit, The aforementioned multiple thresholds are predetermined. The video image encoding method according to claim 11.
13. Mapping the complexity level of each subunit to the corresponding channel-level complexity level based on the preset rules is: This includes determining the level configuration of the complexity levels of the subunits and determining the corresponding channel-level complexity levels based on the level configuration. The video image encoding method according to claim 11.
14. Determining the above-mentioned average number of bits for reversible coding at the same level and the above-mentioned average number of bits for reversible coding is: The process involves determining the number of reversible encoded bits for the current block, wherein the number of reversible encoded bits is a predicted value of the number of bits required to reversibly encode the current block. The process involves updating the average number of bits for lossless coding of the current block based on the number of bits for lossless coding of the current block and a plurality of average numbers for lossless coding of the same level in the past, wherein the average number of bits for lossless coding of the same level in the past is the average number of bits for lossless coding of encoded image blocks having the same complexity level as the block-level complexity level of the current block. The process includes updating the average number of bits for lossless encoding of the current block based on the average number of bits for lossless encoding of all past blocks, wherein the average number of bits for lossless encoding of all past blocks is the average number of bits for lossless encoding of the encoded image block. The video image encoding method according to claim 7.
15. The current block is the first row block of the image to be processed, and the rate control parameter includes a parameter for improving the quality of the first row. When determining the target number of bits for the current block based on the rate control parameters, the video image encoding method further: This includes adjusting the target number of bits of the current block based on the leading row quality improvement parameter so that the quantization parameter of the current block becomes smaller. The video image encoding method according to claim 7.
16. The current block is the first column block of the image to be processed, and the rate control parameter includes a parameter for improving the quality of the first column. When determining the target number of bits for the current block based on the rate control parameters, the video image encoding method further: This includes adjusting the target number of bits of the current block based on the leading column quality improvement parameter so that the quantization parameter of the current block becomes smaller. The video image encoding method according to claim 7.
17. A video image decoding device, A complexity level determination module for obtaining channel-level complexity levels from a code stream and determining the block-level complexity level of the current block according to at least two channel-level complexity levels, wherein the code stream is the encoded code stream of the current block, and the channel-level complexity levels are for indicating the degree of complexity of the channel-level texture of the current block. A rate control parameter determination module for determining the target number of bits of the current block based on rate control parameters, wherein the rate control parameters include a block-level complexity level of the current block. A quantization parameter determination module for determining the quantization parameters of the current block based on the target number of bits, A decoding module for decoding the current block based on the quantization parameters, The rate control parameters include the average number of bits for lossless coding at the same level, the average number of bits for lossless coding, and the code stream buffer fullness. The rate control parameter determination module is further used to determine the same-level reversible coding average number of bits and the reversible coding average number of bits, to determine the initial target number of bits based on the same-level reversible coding average number of bits and the reversible coding average number of bits, and to determine the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, and the initial target number of bits. The aforementioned average number of bits for reversible encoding at the same level is the average of the predicted number of bits required to reversibly encode the current block and the multiple decoded image blocks, and the complexity level of the multiple decoded image blocks is the same as the complexity level of the current block. The aforementioned average number of bits for reversible encoding is the average of the predicted number of bits required to reversibly encode the current block and all encoded image blocks; the code stream buffer fullness indicates the buffer fullness; and the buffer is for storing the code stream of the image to be processed. Video image decoding device.
18. The complexity level determination module is further used to obtain complexity information bits of the current block from the code stream and to determine the channel-level complexity level based on the complexity information bits. The complexity information bits are for indicating the channel-level complexity level of the current block. The video image decoding device according to claim 17.
19. A video image encoding device, A complexity level determination module for obtaining channel-level texture information of the current block from a video image, determining the channel-level complexity level of the current block based on the channel-level texture information, and determining the block-level complexity level of the current block according to at least two channel-level complexity levels, wherein the channel-level complexity level indicates the degree of complexity of the channel-level texture of the current block. A rate control parameter determination module for determining the target number of bits of the current block based on rate control parameters, wherein the rate control parameters include the block-level complexity level of the current block, A quantization parameter determination module for determining the quantization parameters of the current block based on the target number of bits, An encoding module for encoding the current block based on the quantization parameters, Includes, The rate control parameters include the average number of bits for lossless coding at the same level, the average number of bits for lossless coding, and the code stream buffer fullness. The rate control parameter determination module is further used to determine the same-level reversible coding average number of bits and the reversible coding average number of bits, to determine the initial target number of bits based on the same-level reversible coding average number of bits and the reversible coding average number of bits, and to determine the target number of bits for the current block based on the code stream buffer fullness, the block-level complexity level of the current block, and the initial target number of bits. The aforementioned average number of bits for reversible encoding at the same level is the average of the predicted number of bits required to reversibly encode the current block and the multiple encoded image blocks, and the complexity level of the multiple encoded image blocks is the same as the complexity level of the current block. The aforementioned average number of bits for reversible encoding is the average of the predicted number of bits required to reversibly encode the current block and all encoded image blocks; the code stream buffer fullness indicates the buffer fullness; and the buffer is for storing the code stream of the image to be processed. Video image encoding device.
20. A decoder for performing the video image decoding method according to any one of claims 1 to 6.
21. An encoder for performing the video image encoding method according to any one of claims 7 to 16.
22. A video encoding and decoding system, The system comprises a video encoder and / or a video decoder, wherein the video encoder is for performing the video image encoding method according to any one of claims 7 to 16, and the video decoder is for performing the video image decoding method according to any one of claims 1 to 6. Video encoding and decoding systems.
23. A computer-readable storage medium, The computer-readable storage medium stores a program, When the program is executed on a computer, the computer will receive the video image decoding method according to any one of claims 1 to 6. Alternatively, the video image encoding method described in any one of claims 7 to 16 is performed. Computer-readable storage medium.
Citation Information
Patent Citations
Image coder, image coding method, image transmitter, image transmission method and recording medium
JP1998224786A
Moving image encoding device, moving image encoding method, and moving image encoding program
JP2011259408A
Image encoding device, image encoding method, and program
JP2015115735A