Video Encoding / Decoding Method, Apparatus, and Storage Medium

By calculating angular gradients to determine quantization parameters based on image block complexity, the method addresses image distortion and inefficiencies in video encoding/decoding, enhancing efficiency and quality.

JP2025520149AActive Publication Date: 2025-07-01HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2024570913
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-05-31
Filing Date
2023-05-24
Publication Date
2025-07-01
Estimated Expiration
2043-05-24

AI Technical Summary

Technical Problem

Existing video encoding/decoding technologies face challenges in determining accurate quantization parameters, leading to potential image distortion and inefficiencies in encoding/decoding processes.

Method used

A method that calculates angular gradients of image blocks to determine complexity information, which is used to accurately set quantization parameters, improving encoding/decoding efficiency by optimizing resource usage in the code stream.

Benefits of technology

This approach enhances video encoding/decoding efficiency by reducing resource consumption and improving image quality through more precise quantization parameter determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025520149000001_ABST
    Figure 2025520149000001_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a video encoding / decoding method, apparatus, and storage medium, relate to the technical field of video encoding / decoding, and are useful for improving encoding / decoding efficiency. The method includes obtaining complexity information of a current block in a processing target image, where the complexity information of the current block is obtained by calculating at least one angular gradient of the current block based on at least pixel values of the current block, determining a quantization parameter of the current block based on the complexity information of the current block, and decoding the current block based on the quantization parameter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] (Cross-reference to Related Applications) This invention claims priority based on a Chinese patent application with an application number of 202210612716.1 and an invention title of "Video Encoding / Decoding Method, Apparatus, and Storage Medium", which was filed with the China National Intellectual Property Administration on May 31, 2022. Here, all of its content is incorporated into this invention by reference.

[0002] This invention relates to the field of video encoding / decoding technology, and particularly to video encoding / decoding methods, apparatuses, and storage media.

Background Art

[0003] Video encoding / decoding technology plays an important role in the field of video processing. Among them, video encoding / decoding technology includes video encoding and decoding. In the process of video encoding and decoding, the process of performing quantization or inverse quantization on the images in the video is the key to determining the image quality. Quantization mainly realizes reducing the redundancy of the original data in the code stream by replacing some of the original data in the code stream with quantization parameters. However, there is a risk of image distortion in the quantization process. Therefore, when considering the image quality, in order to improve the video encoding / decoding efficiency, determining more accurate quantization parameters for the images in the video is a problem that needs to be solved urgently at present.

Summary of the Invention

[0004] Embodiments of this invention provide a video encoding / decoding method, apparatus, and storage medium, which are helpful for improving video encoding / decoding efficiency.

[0005] To achieve the above object, embodiments of this invention adopt the following technical solutions.

[0006] In a first aspect, an embodiment of the present invention provides a video encoding / decoding method. The method is applicable to a video encoding device, a video decoding device, or a chip for video encoding and decoding. The method includes obtaining complexity information of a current block in a processing target image, where the complexity information of the current block is obtained by calculating at least one angular gradient of the current block based on at least the pixel values of the current block, determining a quantization parameter of the current block based on the complexity information of the current block, and encoding / decoding the current block based on the quantization parameter.

[0007] The quantization parameter plays an important role in the video encoding and decoding process. When using the video encoding / decoding method according to the present invention, the video encoding / decoding device obtains the complexity information of the current block in the processing target image, the complexity information is calculated based on the information of the current block, determines the quantization parameter of the current block based on the complexity information, and encodes / decodes. Considering the angular gradient information of the current block helps to determine a more accurate quantization parameter for the current block, thereby improving the video encoding / decoding efficiency in consideration of the image quality. Also, when performing video decoding by the above method, on the decoding side, since the complexity information of the current block is obtained from the code stream to determine the quantization parameter, it helps to reduce the resources occupied by the quantization parameter in the code stream, thereby transmitting more valid data in the code stream and improving the transmission efficiency.

[0008] In a possible embodiment, obtaining the complexity information of the current block in the processing target image includes calculating at least one angular gradient of the current block based on the pixel values of the current block and the reconstructed values of the encoded / decoded pixel values of the current block, and obtaining the complexity information of the current block based on at least one angular gradient of the current block.

[0009] In this possible embodiment, by calculating the complexity of the current block based on the pixel value and the reconstruction value of the current block, it helps to determine a more accurate quantization parameter for the current block, and considering the image quality, it improves the encoding / decoding efficiency of the video.

[0010] In a possible embodiment, obtaining the complexity information of the current block in the image to be processed includes calculating at least one angular gradient of the current block based on the pixel value of the current block and the pixel values adjacent to the current block in the image to be processed, and obtaining the complexity information of the current block based on at least one angular gradient of the current block.

[0011] In this possible embodiment, by calculating the complexity of the current block based on the pixel value of the current block and the pixel values adjacent to the current block, it helps to determine a more accurate quantization parameter for the current block, and considering the image quality, it improves the encoding / decoding efficiency of the video.

[0012] In a possible embodiment, obtaining the complexity information of the current block in the image to be processed includes obtaining the prediction angle used in the angular prediction mode of the current block, calculating the angular gradient based on the prediction angle to obtain the corresponding complexity information, and using the corresponding complexity information as the complexity information of the current block.

[0013] In this possible embodiment, by determining the corresponding complexity according to the angular prediction mode of the current block, it helps to determine a more accurate quantization parameter for the current block. On the decoding side, it helps to save resources in the code stream and improves the encoding / decoding efficiency of the video.

[0014] In a possible embodiment, when the current block is an N-channel image block, obtaining the complexity information of the current block in the image to be processed involves obtaining the complexity information of each channel image block based on the pixel values of each channel image block in the N-channel image block, where N is an integer greater than 0, and determining the complexity information of the current block based on the complexity information of each channel image block.

[0015] In this possible embodiment, a form of determining the complexity of the current block based on the complexities of a plurality of channel image blocks is provided, which improves the feasibility of implementing the technical solution. Also, by dividing the image into multiple channels and calculating each respectively, it helps to improve the accuracy of the complexity information obtained by the determination.

[0016] In a possible embodiment, obtaining the complexity information of each channel image block based on the pixel values of each channel image block in the N-channel image block involves dividing each channel image block into at least two sub-blocks, determining the complexity information of at least two sub-blocks of each channel image block, and determining the complexity information of the corresponding channel image block in each channel image block based on the complexity information of at least two sub-blocks of each channel image block.

[0017] In this possible embodiment, a form of determining the complexity of the current block based on the complexities of a plurality of channel image blocks is provided. By further dividing the plurality of channel image blocks and determining the complexity, it helps to improve the accuracy of the complexity information obtained by the determination.

[0018] In a possible embodiment, determining the complexity information of a corresponding channel image block based on the complexity information of at least two sub-blocks of each channel image block includes determining the minimum value of the complexity information of at least two sub-blocks of each channel image block as the complexity information of the corresponding channel image block.

[0019] In this possible embodiment, a form of determining the complexity of a plurality of channel image blocks based on the complexity of the plurality of divided channel image blocks is provided, improving the feasibility of implementing the technical solution.

[0020] In a possible embodiment, determining the complexity information of the current block based on the complexity information of each channel image block includes determining the minimum value of the complexity information of each channel image block as the complexity information of the current block.

[0021] In this possible embodiment, a form of determining the complexity of a plurality of channel image blocks based on the complexity information of the plurality of channel image blocks is provided, improving the feasibility of implementing the technical solution.

[0022] In a possible embodiment, determining the complexity information of the current block based on the complexity information of each channel image block includes determining the complexity level of each channel image block based on the complexity information of each channel image block, and determining the complexity information of the current block based on the complexity level of each channel image block.

[0023] In this possible embodiment, a form of determining the complexity of a plurality of channel image blocks based on the complexity of the plurality of divided channel image blocks is provided, improving the feasibility of implementing the technical solution.

[0024] In a possible embodiment, determining the quantization parameter of the current block based on the complexity information of the current block includes determining the reference quantization parameter of the current block based on the complexity information of the current block, and determining the quantization parameter of the current block based on the reference quantization parameter of the current block.

[0025] In this possible embodiment, a method for determining the quantization parameter based on the reference quantization parameter is provided, and the accuracy of the quantization parameter obtained by the determination is improved.

[0026] In a possible embodiment, when the video encoding / decoding method is a video encoding method, determining the reference quantization parameter of the current block based on the complexity information of the current block is to obtain the buffer region state of the image to be processed, where the buffer region state is used to represent the number of bits occupied by the encoded image block in the image to be processed within the buffer region, and among them, the buffer region is used to control the uniform output of the code stream of the image to be processed, and determining the reference quantization parameter of the current block based on the correspondence between the buffer region state and the complexity information of the current block. Of course, when the above video encoding / decoding method is a video decoding method, in the decoding process, the situation of buffering the code stream in the buffer region in the above encoding process can be simulated, and the reference quantization parameter can be determined according to the result of the simulation.

[0027] In this possible embodiment, a form for determining the reference quantization parameter of the current block based on the buffer region state and the complexity information of the current block is provided, improving the feasibility of implementing the technical solution.

[0028] In one possible embodiment, determining the reference quantization parameter of the current block based on the complexity information of the current block includes determining the complexity level of the current block, determining the corresponding target bits based on the complexity level of the current block, where the target bits refer to the number of bits occupied by the current block in the code stream, and obtaining the reference quantization parameter of the current block based on the target bits.

[0029] In this possible embodiment, a form of determining the reference quantization parameter of the current block based on the target bits is provided, improving the feasibility of the technical solution.

[0030] In one possible embodiment, determining the quantization parameter of the current block based on the reference quantization parameter of the current block includes determining a weight coefficient based on the complexity information of the current block, where the weight coefficient is for adjusting the quantization parameter of the current block based on the degree of complexity of the current block, and determining the quantization parameter of the current block based on the weight coefficient and the reference quantization parameter of the current block.

[0031] In this possible embodiment, a form of determining the quantization parameter of the current block based on the reference quantization parameter is provided, improving the feasibility of the technical solution.

[0032] In one possible embodiment, the complexity information of the current block is obtained based on the calculation by the coding rate control unit of the current block, and the coding rate control unit is the basic processing unit for calculating the complexity information of the current block. The quantization parameter of the current block is the quantization parameter of the coding rate control unit of the current block. Encoding / decoding the current block based on the quantization parameter of the current block includes determining the quantization parameter of the encoding / decoding unit of the current block based on the quantization parameter of the coding rate control unit, and encoding / decoding the current block based on the quantization parameter of the encoding / decoding unit.

[0033] In this possible embodiment, a form for determining the quantization parameter of the current block is provided. Among them, when the size of the coding rate control unit is smaller than the size of the quantization unit, a plurality of quantization parameters obtained by corresponding calculations are used for quantization by one quantization unit. For this problem, the above method provides a corresponding technical solution and improves the feasibility of the technical solution.

[0034] In a second aspect, an embodiment of the present invention provides a video encoding / decoding device. The device has a function of implementing the video encoding / decoding method according to any one of the above first aspects. This function may be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions.

[0035] In a third aspect, an embodiment of the present invention provides a video encoder, and the video encoder is for executing the video encoding / decoding method according to any one of the above first aspects.

[0036] In a fourth aspect, an embodiment of the present invention provides another video encoder, which includes a processor and a memory. The memory is for storing computer execution instructions. When the video encoder operates, the processor executes the computer execution instructions stored in the memory so that the video encoder executes the video encoding / decoding method according to any one of the above first aspects.

[0037] In a fifth aspect, an embodiment of the present invention provides a video decoder, and the video decoder is for executing the video encoding / decoding method according to any one of the above first aspects.

[0038] In a sixth aspect, an embodiment of the present invention provides another video decoder, the video decoder including a processor and a memory, the memory being for storing computer-executable instructions, and when the video decoder operates, the processor executes the computer-executable instructions stored in the memory so that the video decoder executes the video encoding / decoding method according to any one of the first aspects above.

[0039] In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, a program being stored in the computer-readable storage medium, and when the program is executed on a computer, the computer is caused to execute the video encoding / decoding method according to any one of the first aspects above.

[0040] In an eighth aspect, an embodiment of the present invention provides a computer program product including instructions, and when the instructions are executed on a computer, the computer is caused to execute the video encoding / decoding method according to any one of the first aspects above.

[0041] In a ninth aspect, an embodiment of the present invention provides an electronic device, the electronic device including a video encoding / decoding device, and a processing circuit is configured to execute the video encoding / decoding method according to any one of the first aspects above.

[0042] In a tenth aspect, an embodiment of the present invention provides a chip, the chip including a processor, the processor being coupled to a memory, program instructions being stored in the memory, and when the program instructions stored in the memory are executed by the processor, the video encoding / decoding method according to any one of the first aspects above is realized.

[0043] In the eleventh aspect, a video encoding and decoding system including a video encoder and a video decoder is provided. The video encoder is configured to execute the video encoding / decoding method according to any one of the first aspects described above, and the video decoder is configured to execute the video encoding / decoding method according to any one of the first aspects described above.

[0044] For the technical effects achieved by the implementation manners of any one of the second aspect to the eleventh aspect, reference can be made to the technical effects achieved by the corresponding implementation manners in the first aspect or the embodiments for implementing the following invention. Therefore, the description is omitted here.

Brief Description of the Drawings

[0045] The drawings described here are for providing a further understanding of the present invention and constitute a part of the present invention. The schematic embodiments and their descriptions of the present invention are for interpreting the present invention and do not constitute an excessive limitation of the present invention.

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12a

Figure 12b

Figure 12c

Figure 13a

Figure 13b

Figure 14a

Figure 14b

Figure 15

Figure 16a

Figure 16b

Figure 17

Figure 18

Embodiments for Carrying Out the Invention

[0046] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in more detail below with reference to the accompanying drawings and by way of examples. It is obvious that the described embodiments are merely some, rather than all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention shall fall within the scope of protection of the present invention.

[0047] In the description of the present invention, unless otherwise specified, " / " means "or". For example, A / B means A or B. The "and / or" in this specification is only used to explain the correlation relationship of related objects and represents that three relationships may exist. For example, A and / or B may mean that A exists alone, A and B exist simultaneously, and B exists alone. Also, "at least one" means one or more, and "a plurality" means two or more. Terms such as "first" and "second" do not limit the quantity or execution order. And terms such as "first" and "second" do not necessarily limit that they are different.

[0048] Note that in this specification, terms such as "exemplary" or "for example" are used to represent by way of example, illustration, or explanation. Any embodiment or design described as "exemplary" or "for example" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. To be precise, using terms such as "exemplary" or "for example" is intended to specifically illustrate related concepts.

[0049] First, technical terms related to the embodiments of the present invention will be introduced.

[0050] 1. Video encoding / decoding technology

[0051] Video encoding / decoding technology includes video encoding technology and video decoding technology, and may also be collectively referred to as video encoding and decoding technology.

[0052] Among them, a video sequence has a series of redundant information such as spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. In order to remove as much redundant information as possible in the video sequence and reduce the amount of data representing the video, video encoding technology has been proposed to achieve the effects of reducing memory space and saving transmission bandwidth. Video encoding technology is also called video compression technology.

[0053] In order to obtain the data stored or transmitted based on the above video compression technology, it is necessary to be realized by the corresponding video decoding technology.

[0054] Internationally, the video compression encoding standard is for standardizing video encoding and decoding methods. For example, Advanced Video Coding (AVC) in Part 10 of the MPEG-2 and MPEG-4 standards formulated by the Motion Picture Experts Group (MPEG), H.263, H.264 and H.265 (also called High Efficiency Video Coding standard, HEVC) formulated by the International Telecommunication Union-Telecommunication Standardization Sector (ITU-T).

[0055] In addition, in the encoding algorithm based on the hybrid encoding architecture, the above compression encoding methods may be combined and used.

[0056] The basic processing unit in the video encoding and decoding process is an image block, which is obtained by dividing an image of one frame per sheet on the encoding side. Usually, each image block obtained after division is processed one by one row by row. Among them, the image block being processed is called the current block, and the processed image block is called the encoded image block, the decoded image block, or the encoded / decoded image block. Taking HEVC as an example, in HEVC, a Coding Tree Unit (CTU), a Coding Unit (CU), a Prediction Unit (PU), and a Transform Unit (TU) are defined. The CTU, CU, PU, and TU can all be image blocks after division. Among them, both the PU and TU are divided based on the CU.

[0057] 2. Video Sampling

[0058] Since a pixel is the smallest complete sample of a video or an image, data processing for an image block is performed in pixel units. Among them, each pixel records color information. One sampling method is to represent colors in RGB, which includes three image channels, where R represents red, G represents green, and B represents blue. Another sampling method is to represent colors in YUV, which also includes three image channels, where Y represents luminance, U represents the first chrominance Cb, and V represents the second chrominance Cr. Since humans are more sensitive to luminance than chrominance, memory space reduction is achieved by storing more data indicating luminance and less data indicating chrominance. Specifically, in video encoding and decoding, video sampling is usually performed in a YUV format including a 420 sampling format, a 422 sampling format, etc. This sampling format determines the number of samples of the two chrominances based on the number of luminance samples. For example, assuming that one CU is 4×2 pixels, the format is as follows. TIFF2025520149000002.tif The sampling format of 14116420 indicates that sampling is performed in the YUV4:2:0 format. That is, the luminance and the first chrominance or the second chrominance are selected at a ratio of 4:2, and among them, the first chrominance and the second chrominance are selected every other row. In this case, the above CU sampling selects the luminance Y0 - Y3 and the first chrominance U0, U2 in the first row, and the luminance Y4 - Y7 and the second chrominance V4, V6 in the second row. After the CU is sampled, it is composed of a luminance encoding unit and a chrominance encoding unit. Among them, the luminance encoding unit is TIFF2025520149000003.tif is 1438, The first chrominance encoding unit is TIFF2025520149000004.tif is 822, The second chrominance encoding unit is TIFF2025520149000005.tif is 822.

[0059] As can be seen from this, the size of the image block sampled in the above sampling format has changed. Among them, the block size of the luminance encoding unit remains unchanged and is still 4×2, but the block size of the first chrominance encoding unit becomes 2×1, and the block size of the second chrominance encoding unit also becomes 2×1. Therefore, if the size of the CU is X×Y, the block size of the chrominance encoding unit sampled based on the 420 sampling format becomes X / 2×Y / 2.

[0060] Similarly, the 422 sampling format indicates that sampling is performed in the YUV4:2:2 format. That is, the luminance, the first chrominance, and the second chrominance are selected at a ratio of 4:2:2. In this case, the above CU-sampled luminance encoding unit is TIFF2025520149000006.tif is 1440, The first chrominance encoding unit is TIFF2025520149000007.tif is 1421, The second chrominance encoding unit is TIFF2025520149000008.tif1523.

[0061] Among them, the block size of the luminance encoding unit remains unchanged and is still 4×2, but the block size of the first chrominance encoding unit becomes 2×2, and the block size of the second chrominance encoding unit also becomes 2×2. Therefore, if the size of the CU is X×Y, the block size of the chrominance encoding unit sampled based on the 422 sampling format becomes X / 2×Y.

[0062] The above-sampled luminance encoding unit, the first chrominance encoding unit, and the second chrominance encoding unit are used as data units for each channel for subsequent processing of the current block.

[0063] The encoding / decoding method according to the present invention is applied to a video encoding and decoding system. The video encoding and decoding system is also called a video encoding / decoding system. The structure of the video encoding and decoding system is shown in FIG. 1.

[0064] As shown in FIG. 1, a video encoding and decoding system includes a source device 10 and a destination device 11. The source device 10 generates encoded video data. The source device 10 is also referred to as a video encoding device or a video encoding apparatus. The destination device 11 decodes the encoded video data generated by the source device 10. The destination device 11 is also referred to as a video decoding device or a video decoding apparatus. The source device 10 and / or the destination device 11 includes at least one processor and a memory coupled to the at least one processor. The memory includes, but is not limited to, a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, or any other medium for storing desired program code in the form of instructions or data structures accessible by a computer. In the present invention, it is not particularly limited thereto.

[0065] The source device 10 and the destination device 11 may include various devices. For example, it includes electronic devices such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet personal computer, a set-top box, a handset of a telephone such as a so-called "smartphone", a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer or a similar device.

[0066] The destination device 11 receives the encoded video data from the source device 10 via the link 12. The link 12 may include one or more media and / or devices capable of transmitting the encoded video data from the source device 10 to the destination device 11. In one example, the link 12 may include one or more communication media that enable the source device 10 to directly transmit the encoded video data to the destination device 11 in real time. In this example, the source device 10 modulates the encoded video data according to a communication standard (e.g., a wireless communication protocol) and transmits the modulated video data to the destination device 11. The one or more communication media described above may include wireless and / or wired communication media such as, for example, the radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media described above can form part of a packet-based network. The packet-based network may be, for example, a local area network, a wide area network, or a global network (e.g., the Internet), etc. The one or more communication media described above include routers, switches, base stations, or other devices that enable communication from the source device 10 to the destination device 11.

[0067] In another example, the encoded video data is output from the output interface 103 to the storage device 13. Similarly, the encoded video data is accessed from the storage device 13 via the input interface 113. The storage device 13 may include various locally accessible data storage media. Examples include Blu-ray discs, digital video discs (DVDs), compact disc read-only memories (CD-ROMs), flash memories, or other suitable digital storage media for storing the encoded video data.

[0068] In another example, the storage device 13 may correspond to a file server or another intermediate storage device for storing the encoded video data generated by the source device 10. In this example, the destination device 11 acquires the video data stored in the storage device 13 from the storage device 13 by streaming or downloading. The file server can be any type of server that can store the encoded video data and transmit the encoded video data to the destination device 11. For example, the file server may include a World Wide Web (Web) server (e.g., for a website), a File Transfer Protocol (FTP) server, a Network Attached Storage (NAS) device, and a local disk drive.

[0069] The destination device 11 accesses the encoded video data via any standard data connection (e.g., an Internet connection). Examples of the type of data connection include a wireless channel, a wired connection (e.g., a cable modem, etc.) suitable for accessing the encoded video data stored in the file server, or a combination of both. The method of transmitting the encoded video data from the file server may be streaming, downloading, or a combination of both.

[0070] The encoding / decoding method of the present invention is not limited to the scenario of wireless applications. Exemplarily, the encoding / decoding method of the present invention is applied to the encoding and decoding of videos that support the following various multimedia applications. For example, wireless television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (e.g., via the Internet), encoding of video data stored in a data storage medium, decoding of video data stored in a data storage medium, or other applications. In some examples, the video encoding and decoding system is configured to support unidirectional or bidirectional video transmission in order to support applications such as, for example, video streaming, video playback, video broadcasting, and / or video telephony.

[0071] Note that FIG. 1 is a system architecture diagram of a video encoding and decoding system according to an embodiment of the present invention. It is merely an example of the video encoding and decoding system shown in FIG. 1 and does not limit the video encoding and decoding system in the present invention. The encoding / decoding method according to the present invention can also be applied to a scenario where there is no data 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 obtain the encoded video data from memory and decode the encoded video data.

[0072] In FIG. 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 a transmitter. The video source 101 may include 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.

[0073] The video encoder 102 encodes the video data from the video source 101. In some examples, the source device 10 directly transmits the encoded video data to the destination device 11 by the output interface 103. In some other examples, the encoded video data may be stored in the storage device 13 so that it can be accessed later by the destination device 11 for decoding and / or playback.

[0074] In the example of FIG. 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 receives the encoded video data via the link 12 and / or from the storage device 13. The display device 111 may be integrated with the destination device 11 or installed outside the destination device 11. Generally, the display device 111 displays the decoded video data. The display device 111 may include various display devices. For example, a liquid crystal display, a plasma display, an organic light emitting diode display, or other types of display devices may be mentioned.

[0075] Optionally, the video encoder 102 and the video decoder 112 are each integrated with an audio encoder and an audio decoder, and include an appropriate multiplexer / demultiplexer unit or other hardware and software to process the encoding of both audio and video in a common data stream or individual data streams.

[0076] The video encoder 102 and the video decoder 112 may include at least one microprocessor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA), discrete logic, hardware, or any combination thereof. When the encoding / decoding method according to the present invention is implemented by software, the present invention is implemented by storing instructions used in the software in an appropriate non-volatile computer-readable storage medium and executing the instructions using at least one processor.

[0077] The video encoder 102 and the video decoder 112 in the present invention may operate according to a video compression standard (e.g., HEVC) or other industry standards. The present invention is not particularly limited.

[0078] Figure 2 is a schematic configuration diagram of the video encoder 102 according to an embodiment of the present invention. In the video encoder 102, the prediction module 21, the conversion module 22, the quantization module 23, and the entropy encoding module 24 perform the processes of prediction, conversion, quantization, and entropy encoding, respectively. The video encoder 102 further includes a preprocessing module 20 and an adder 202. Among them, the preprocessing module 20 includes a splitting module and a coding rate control module. For the reconstruction of the video block, the video encoder 102 further includes an inverse quantization module 25, an inverse conversion module 26, an adder 201, and a reference image memory 27.

[0079] As shown in FIG. 2, the video encoder 102 receives video data. The preprocessing module 20 is for obtaining the input parameters of the video data. Among them, the input parameters include information such as the resolution of the image in the video data, the sampling format of the image, the pixel depth (bits per pixel, bpp), and the bit width. Among them, bpp refers to the number of bits occupied by one pixel component in a unit pixel. The bit width refers to the number of bits occupied by a unit pixel. For example, when one pixel is represented by the values of three pixel components of RGB and each pixel component occupies 8 bits (bits), the pixel depth of the pixel is 8, and the bit width of the pixel is 3×8 = 24 bits.

[0080] The splitting module in the preprocessing module 20 splits the image into original blocks. This splitting may include splitting into slices, image blocks, or other relatively large units, and (for example) splitting of video blocks based on the quadtree structure of the largest coding unit (LCU) and coding units (CUs). Exemplarily, the video encoder 102 is an assembly for encoding video blocks located in a video slice to be encoded. Generally, a slice can be split into a plurality of original blocks (and may be split into a set of original blocks called image blocks). Usually, the sizes of CUs, PUs, and TUs are determined in the splitting module. The splitting module is also used to determine the size of the coding rate control unit. The coding rate control unit refers to the basic processing unit in the coding rate control module. The coding rate control unit is for calculating the quantization parameter of the current block. For example, the coding rate control module calculates the complexity information for the current block by the coding rate control unit, and further calculates the quantization parameter of the current block based on the complexity information. Among them, the splitting strategy of the splitting module may be preset or continuously adjusted based on the image in the encoding process. When the splitting strategy is a preset strategy, the same splitting strategy is preset correspondingly on the decoding side, so that the same image processing unit can be obtained. The image processing unit is any one of the above image blocks and corresponds one-to-one with the encoding side. When the splitting strategy is continuously adjusted based on the image in the encoding process, the splitting strategy is incorporated into the code stream directly or indirectly. Correspondingly, on the decoding side, the corresponding parameters are obtained from the code stream, the same splitting strategy is obtained, and the same image processing unit is obtained.

[0081] The coding rate control module in the preprocessing module 20 is used to generate quantization parameters so that the quantization module 23 and the inverse quantization module 25 perform related calculations. Among them, in the process of calculating the quantization parameters, the coding rate control module may obtain and calculate the image information of the current block, such as the above input information, or obtain and calculate the reconstructed value reconstructed by the adder 201, but the present invention is not limited thereto.

[0082] The prediction module 21 provides a prediction block to the adder 202 to generate a residual block, and provides the prediction block to the adder 201 to obtain a reconstructed block by reconstruction. The reconstructed block is used as a reference pixel for subsequent prediction. Among them, the video encoder 102 generates a pixel difference by subtracting the pixel value of the prediction block from the pixel value of the original block. The pixel difference is a residual block, and the data in the residual block may include a luminance difference and a chrominance difference. The adder 201 represents one or more assemblies that perform this subtraction. The prediction module 21 may send related syntax elements to the entropy coding module 24 for merging into the code stream.

[0083] The conversion module 22 divides the residual block into one or more TUs for conversion. The conversion module 22 converts the residual block from the pixel domain to the conversion domain (for example, the frequency domain). For example, the discrete cosine transform (DCT) or the discrete sine transform (DST) is used to convert the residual block to obtain conversion coefficients. The conversion module 22 sends the obtained conversion coefficients to the quantization module 23.

[0084] The quantization module 23 performs quantization by a quantization unit. Among them, the quantization unit may be the same as the above-mentioned CU, TU, and PU, or may be further divided in the division module. The quantization module 23 quantizes the transform coefficients so as to further reduce the coded bits and obtain quantization coefficients. Among them, the quantization process can reduce the bit depth associated with some or all of the coefficients. By adjusting the quantization parameters, the degree of quantization can be changed. In some possible embodiments, the quantization module 23 may then perform a scan of the matrix including the quantized transform coefficients. Alternatively, the entropy coding module 24 may perform the scan.

[0085] After quantization, the entropy coding module 24 entropy-codes 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), Probability Interval Partitioning Entropy (PIPE) decoding, or another entropy coding method or technique. After performing entropy coding by the entropy coding module 24, a code stream is obtained, and the code stream is transmitted to the video decoder 112, or archived for subsequent transmission or search by the video decoder 112.

[0086] The inverse quantization module 25 and the inverse transform module 26 apply inverse quantization and inverse transform respectively. The adder 201 adds the inverse-transformed residual block and the predicted residual block to generate a reconstructed block, and the reconstructed block is later used as a reference pixel for predicting the original block. The reconstructed block is stored in the reference image memory 27.

[0087] FIG. 3 is a schematic configuration diagram of a video decoder 112 according to an embodiment of the present invention. As shown in FIG. 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. Among them, the entropy decoding module 30 includes an analysis module and a coding rate control module. In some possible embodiments, the video decoder 112 executes a decoding flow that is exemplarily inverse to the encoding flow described for the video encoder 102 in FIG. 2.

[0088] In the decoding process, the video decoder 112 receives the coded stream of the encoded video from the video encoder 102. The analysis module in the entropy decoding module 30 of the video decoder 112 performs entropy decoding on the coded stream to generate quantization coefficients and syntax elements. The entropy decoding module 30 transmits the syntax elements to the prediction module 31. The video decoder 112 receives the syntax elements at the video slice level and / or the video block level.

[0089] The coding rate control module in the entropy decoding module 30 generates a quantization parameter based on the information of the image to be decoded obtained by the analysis module so that the inverse quantization module 32 performs a correlation calculation. The coding rate control module may calculate the quantization parameter based on the reconstructed block reconstructed by the adder 301.

[0090] The inverse quantization module 32 performs inverse quantization (e.g., dequantization) on the quantization coefficients provided from the code stream and decoded by the entropy decoding module 30 and the generated quantization parameters. The inverse quantization process may include a process of determining the degree of quantization using the quantization parameters calculated by the video encoder 102 for each video block in the video slice. Similarly, the inverse quantization process may include a process of determining the degree of application of inverse quantization. The inverse transformation module 33 applies an inverse transformation (e.g., a transformation method such as DCT, DST, etc.) to the transformed coefficients after inverse quantization, and inverse-transforms the transformed coefficients after inverse quantization to obtain an inverse transformation unit, i.e., a residual block. Among them, the size of the inverse transformation unit may be the same as the size of the TU. The inverse transformation method and the transformation method adopt the corresponding forward transformation and inverse transformation in the same transformation method. For example, the inverse transformation of DCT and DST is an inverse DCT, an inverse DST, or a conceptually similar inverse transformation process.

[0091] After the prediction module 31 generates a prediction block, the video decoder 112 forms a decoded image block by adding the residual block after inverse transformation from the inverse transformation module 33 and the prediction block. The adder 301 represents one or more assemblies that perform this addition operation. Optionally, in order to remove block artifacts, the image of the decoded block may be filtered using a deblocking filter. The decoded image blocks in the specified frame or image are stored in the reference image memory 34 as reference pixels for future prediction.

[0092] The present invention provides a possible video encoding / decoding implementation method as shown in FIG. 4. FIG. 4 is a flowchart of the video encoding and decoding method according to the present invention. The video encoding / decoding implementation method includes processes 1 to 5. Processes 1 to 5 may be executed by any one or more of the above source device 10, video encoder 102, destination device 11, or video decoder 112.

[0093] The following uses the video encoding process as an example to explain the above Process 1 to Process 5.

[0094] Process 1: Divide the image of one frame into one or more parallel encoding units that do not overlap with each other. There is no dependency between the one or more parallel encoding units, and encoding and decoding are performed completely in parallel / independently, such as the parallel encoding unit 1 and the parallel encoding unit 2 shown in FIG. 4.

[0095] Process 2: Each parallel encoding unit may be further divided into one or more independent encoding units that do not overlap with each other. Although the independent encoding units do not depend on each other, they may share the header information of some parallel encoding units.

[0096] The independent encoding unit may include three components, namely, luminance Y, first chrominance Cb, and second chrominance Cr, or three components of RGB, or may include only one of these components. When the independent encoding unit includes three components, the sizes of these three components may be exactly the same or different, specifically related to the input format of the image. The independent encoding unit can also be understood as one or more processing units composed of N channels included in each parallel encoding unit. For example, the above three components of Y, Cb, and Cr are three channels that make up the parallel encoding unit, and each may be an independent encoding unit. Alternatively, when Cb and Cr are collectively referred to as chrominance channels, the parallel encoding unit includes an independent encoding unit composed of a luminance channel and an independent encoding unit composed of chrominance channels.

[0097] Process 3: Each independent encoding unit may be further divided into one or more encoding units that do not overlap with each other. Each encoding unit in the independent encoding unit may depend on each other. For example, multiple encoding units may perform preliminary encoding and preliminary decoding by referring to each other.

[0098] When the sizes of the symbolization unit and the independent symbolization unit are the same (i.e., the independent symbolization unit is divided into only one symbolization unit), the size may be any of the sizes described in Process 2.

[0099] The symbolization unit may include three components of luminance Y, first chrominance Cb, and second chrominance Cr (or three components of RGB), or may include only one of these components. When including three components, the sizes of these components may be exactly the same or different, specifically related to the input format of the image.

[0100] It should be noted that Process 3 is an optional step in the video encoding and decoding method, and the video encoder / decoder may perform encoding / decoding on the residual coefficients (or residual values) of the independent symbolization unit obtained in Process 2.

[0101] Process 4: The symbolization unit may be further divided into one or more non-overlapping prediction groups (PG). PG may be abbreviated as Group. Each PG performs encoding and decoding according to the selected prediction mode, a predicted value of the PG is obtained, the predicted value of the entire symbolization unit is constituted, and a residual value of the symbolization unit is obtained based on the predicted value and the original value of the symbolization unit. For example, in FIG. 4, one symbolization unit in the independent symbolization unit is divided into PG-1, PG-2, and PG-3.

[0102] Process 5: Based on the residual value of the symbolization unit, the symbolization units are grouped to obtain one or more non-overlapping residual blocks (RB). The residual coefficients of each RB perform encoding and decoding according to the selected mode to form a residual coefficient stream. Specifically, it is divided into two types: when performing conversion on the residual coefficients and when not performing conversion. As shown in FIG. 4, one symbolization unit is grouped to obtain RB-1 and RB-2.

[0103] Among them, the selection mode of the encoding and decoding methods for the residual coefficients in Process 5 may include, but is not limited to, the semi-fixed length encoding method, the exponential Golomb encoding method, the Golomb-Rice encoding method, the truncated unary encoding method, the run-length encoding method, the direct encoding method of the original residual value, etc. For example, when selecting the exponential Golomb encoding method to encode the residual coefficients of each RB, when decoding the residual coefficients of each RB, it is necessary to select the decoding method corresponding to the exponential Golomb encoding method for decoding.

[0104] For example, a video encoder directly encodes the coefficients in the RB.

[0105] Also, for example, a video encoder may perform a transformation such as DCT, DST, Hadamard transform, etc. on the residual block, and further encode the transformed coefficients.

[0106] As a possible example, when the RB is small, the video encoder may directly uniformly quantize each coefficient in the RB and further perform binary encoding. When the RB is large, it may be further divided into a plurality of coefficient groups (CG), each CG is uniformly quantized, and further binary encoding may be performed. In some embodiments of the present invention, the sizes of the coefficient group (CG) and the quantization group (QG) may be the same.

[0107] The following describes, by way of example, the part of encoding the residual coefficients by the semi-fixed length coding method. First, define the maximum value of the absolute value of the residuals in one RB as the modified maximum (mm). Next, determine the number of coding bits of the residual coefficients in the RB by the above mm (the number of coding bits of the residual coefficients in the same RB is the same). For example, when the code length (CL) of the current RB is 2 and the current residual coefficient is 1, 2 bits are required to code the residual coefficient 1, which is represented as 01. In a special case, when the CL of the current RB is 7, it represents coding an 8-bit residual coefficient and a 1-bit sign bit. Among them, the method of determining CL is to find the minimum M value that satisfies the condition that all the residuals of the current RB are in the range of [-2^(M-1), 2^(M-1)], and set the found M as the CL of the current RB. If both of the two boundary values of -2^(M-1) and 2^(M-1) exist in the current RB at the same time, M should be increased by only 1, that is, M+1 bits are required to code all the residuals of the current RB. If only one of the two boundary values of -2^(M-1) and 2^(M-1) exists in the current RB, it is necessary to code the trailing bit to determine whether the boundary value is -2^(M-1) or 2^(M-1). If neither -2^(M-1) nor 2^(M-1) exists in all the residuals in the current RB, there is no need to code the trailing bit.

[0108] Note that in special situations, the video encoder may directly encode the original value of the image instead of the residual value.

[0109] The above video encoder 102 and video decoder 112 may also be implemented by other implementation methods. For example, they may be implemented using a general-purpose digital processor system. FIG. 5 provides a schematic configuration diagram of a video encoding and decoding apparatus. Like the encoding and decoding apparatus 50 shown in FIG. 5, the encoding and decoding apparatus 50 may be a part of the above video encoder 102 or a part of the above video decoder 112.

[0110] The encoding and decoding apparatus 50 may be applied to the encoding side or the decoding side. The encoding and decoding apparatus 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 apparatus 50 may further include a communication interface 503. The communication interface 503 is connected to the processor 501 and the memory 502 and is used to transmit and receive data.

[0111] The memory 502 may be a random access memory (RAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EPROM), or a compact disc read-only memory (CD-ROM). The memory 502 is for storing relevant program codes 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 FIG. 5, for example. When the processor 501 is a single CPU, the CPU may be a single-core CPU or a multi-core CPU.

[0113] When the processor 501 reads the program code stored in the memory 502, it is for executing the operations of any embodiment corresponding to FIG. 6 and its various executable embodiments.

[0114] The encoding / decoding method according to the present invention may be applied to the video encoder 102 or the video decoder 112. For example, in some cases, the video encoder 102 may not perform encoding using the encoding / decoding method of the present invention and may not transmit quantization parameter information to the video decoder 112. In this case, the video decoder 112 may perform decoding using the encoding / decoding method according to the present invention. In other cases, the video encoder 102 may perform encoding using the encoding / decoding method of the present invention and transmit quantization parameter information to the video decoder 112. In this case, the video decoder 112 may obtain quantization parameter information from the code stream and perform decoding.

[0115] Hereinafter, the encoding / decoding method according to the present invention will be described in detail by combining the video encoding and decoding system shown in FIG. 1, the video encoder 102 shown in FIG. 2, and the video decoder 112 shown in FIG. 3 above.

[0116] As shown in FIG. 6, FIG. 6 is a flowchart of the video encoding / decoding method according to the present invention. This method includes S601.

[0117] In S601, the video encoding / decoding device obtains complexity information of the current block in the image to be processed. The complexity information of the current block represents the degree of difference in pixel values of the current block, and the complexity information of the current block is obtained by calculating at least one angular gradient of the current block based on at least the pixel values of the current block.

[0118] The information of an image block is usually understood to be represented by the pixel points included in the image block. When the difference in pixel values of each pixel point in an image block is small, that is, when the complexity is low, it indicates that the color change of the image block is small, and the image block is considered to be relatively simple. Similarly, when the difference in pixel values of each pixel point in an image block is large, that is, when the complexity is high, it indicates that the color change of the image block is large, and the image block is considered to be relatively complex.

[0119] Specifically, the complexity information (block_complexity) of the current block is obtained by calculating at least one angular gradient of the current block based on at least the pixel values of the current block. Among them, the angular gradient of the current block refers to calculating the difference in pixel values of the current block based on the gradient direction of a certain angle. The angular gradient includes a horizontal gradient, a vertical gradient, and other angular gradients.

[0120] The horizontal gradient of the current block refers to a set of differences between the pixel values of the t-th column and the pixel values of the (t - 1)-th column in the current block calculated based on the leftward or rightward gradient direction in the horizontal direction. Among them, t is an integer greater than 1. The formula is as follows.

[0121] Horizontal gradient H = pixel value of the t-th column - pixel value of the (t - 1)-th column

[0122] FIG. 7 provides a schematic diagram of a method for calculating an angular gradient. As shown in FIG. 7(a), taking a 4×2 image block as an example, according to the above formula, the 4×2 image block is calculated in the direction shown in the figure, and a 3×2 difference is obtained. In this case, the horizontal gradient of the image block is the above set of 3×2 differences.

[0123] The horizontal complexity (horizontal complexity) is calculated based on the above horizontal gradient by the following formula. Hereinafter, the horizontal complexity is represented by complexity_hor. complexity_hor = sum of elements in the horizontal gradient (gradH) / number of elements (grad_block_size)

[0124] When combined with the above example, if a 3×2 difference is obtained, for the current block, complexity_hor = sum of 6 differences / 6. Among them, the elements in the above horizontal gradient may be each horizontal gradient calculated for the image block in the horizontal direction.

[0125] Similarly, the vertical gradient of the current block refers to the set of differences between the pixel values of the s-th row and the (s - 1)-th row in the current block calculated based on the upward or downward gradient direction in the vertical direction. Among them, s is an integer greater than 1. The formula is as follows.

[0126] Vertical gradient V = pixel value of the s-th row - pixel value of the (s - 1)-th row

[0127] As shown in Fig. 7(b), taking a 4×2 image block as an example and calculating the above formula for the image block according to the direction shown in the figure, a 4×1 difference is obtained. In this case, the horizontal gradient of the image block is the set of the above 4×1 differences.

[0128] The vertical complexity is calculated based on the above vertical gradient by the following formula. Hereinafter, complexity_ver represents the vertical complexity. complexity_ver = sum of elements in the vertical gradient (gradV) / number of elements (grad_block_size)

[0129] When combined with the above example, complexity_ver = sum of 4 differences / 4. Among them, the elements in the above vertical gradient may be each vertical gradient calculated for the image block in the vertical direction.

[0130] Similarly, other angular gradients in the current block may include a 45° gradient, a 135° gradient, a 225° gradient, or a 315° gradient. Referring to the schematic diagram of another method for calculating the angular gradient provided in FIG. 8, the directions of the other angular gradients are respectively shown in FIGS. 8(a) to 8(d).

[0131] Calculating the complexity information of the current block based on the pixel values of the current block by the above method is advantageous for more accurately determining encoding / decoding parameters such as quantization parameters for the current block, thereby improving the quality of the video encoding / decoding image and improving the encoding / decoding efficiency of the image.

[0132] Hereinafter, an implementation manner for determining the complexity information of the current block by the following first possible implementation manner to the fourth possible implementation manner will be described.

[0133] In the above solution, the number of elements included in the gradient of the current block is smaller than the number of pixels of the current block. Considering a method for more accurately calculating the complexity of the current block, the video encoding / decoding device may determine the complexity information of the current block by referring to the reconstructed value of the encoded / decoded pixel value of the current block.

[0134] In a first possible implementation manner, the video encoding / decoding device calculates at least one angular gradient of a current block based on pixel values of the current block and reconstructed values of encoded / decoded pixel values of the current block, and obtains complexity information of the current block based on at least one angular gradient of the current block. Referring to the schematic diagram of another method for calculating the angular gradient provided in FIG. 9, as shown in FIGS. 9(a) to 9(f), among them, the blank part represents the original pixel, that is, the pixel value of the current block, and the hatched part represents the reconstructed pixel, that is, the reconstructed value of the encoded / decoded pixel value of the current block. FIG. 9(a) is a schematic diagram of a form in which the gradient of the current block is calculated for each row based on the pixels in the current block and the reconstructed values of the edge pixel values in the gradient direction of the pixels. In this way, by the above method, for each original pixel, the reconstructed value of the corresponding edge pixel value or another original pixel value in the current block is searched along the gradient direction of the current block so as to calculate the elements in the gradient direction included in the current block. For example, the shadow pixels in the first row are marked as pixel 1-1, pixel 1-2... pixel 1-16 in order from left to right, the pixels in the second row are marked as pixel 2-1, pixel 2-2... pixel 2-17 in order from left to right, and the pixels in the third row are marked as pixel 3-1, pixel 3-2... pixel 3-16 in order from left to right. The calculated gradients of the current block may include the gradient obtained by subtracting pixel 1-1 from pixel 2-1, the gradient obtained by subtracting pixel 1-2 from pixel 2-2... the gradient obtained by subtracting pixel 1-16 from pixel 2-16, the gradient obtained by subtracting pixel 2-2 from pixel 3-1, the gradient obtained by subtracting pixel 2-3 from pixel 3-2... the gradient obtained by subtracting pixel 2-17 from pixel 3-16. In this way, 32 gradient values can be obtained for 2×16 original pixels. Similarly, for the method of calculating the angular gradient in the gradient direction shown in FIGS. 9(b) to 9(f), reference may be made to the method of calculating the gradient shown in FIG. 9(a) above. The difference is that the positions and angular directions of the pixels used are different, but the detailed description is omitted here.

[0135] For the implementation manner of obtaining the complexity information of the current block based on at least one angular gradient of the current block, reference may be made to the following embodiments, but the detailed description is omitted here.

[0136] In this way, for one original pixel, one element is obtained by calculation in the same gradient direction, and the number of elements included in each gradient of the current block is equal to the number of pixels of the current block. The above element represents the change along the gradient direction of the pixels in the current block corresponding to the element. And the elements correspond one-to-one with the pixels in the current block. Therefore, since each element uniformly represents the change along the gradient direction of the pixels in the current block, each element obtained based on the above is helpful for obtaining more accurate complexity information of the current block.

[0137] In the second possible implementation manner, the video encoding / decoding device calculates the complexity information of the current block based on the pixel values of the current block and the pixel values adjacent to the current block in the image to be processed. The differences from the above first possible implementation manner are as follows. In the first possible implementation manner, the reconstructed value of the encoded / decoded pixel value of the current block, that is, the reconstructed value is used, and the reconstructed value is the reconstructed value of the pixels in the current block. On the other hand, in the second possible implementation manner, the pixel values adjacent to the current block in the image to be processed, that is, the values related to the pixels in the blocks adjacent to the current block are used, and the value may be a reconstructed value or an original value.

[0138] It can be understood that it is similar to the method of calculating the complexity information based on the reconstructed value of the encoded / decoded pixel value of the current block. As shown in FIG. 9, the blank part in FIG. 9 may be regarded as the pixels of a 16×2 current block. The difference is that the hatched part in FIG. 9 may be regarded as the pixels adjacent to the current block and represents the pixel values of the current block and the adjacent pixels.

[0139] For example, when calculating the horizontal gradient according to e) of FIG. 9, at this time, the current block includes 16×2 pixels. The horizontal gradient calculated by using the value obtained by subtracting the pixel value of the first column of pixels in the current block from the reconstructed value of the pixels in the column immediately before the current block, the value obtained by subtracting the pixel value of the second column of pixels in the current block from the reconstructed value of the pixels in the first column of the current block, ……, and the value obtained by subtracting the pixel value of the 16th column of pixels in the current block from the reconstructed value of the pixels in the 15th column of the current block includes a difference of 16×2, and becomes the sum of the differences of complexity_hor = 32 of the current block / 32. Regarding the specific calculation method, detailed description is omitted here.

[0140] It should be noted that the above selective method is only an example. In fact, a plurality of reconstructed pixels and adjacent pixels may be selected. For example, the reconstructed pixel is the average value of the reconstructed values n rows before, n columns before, or n before the current block, and the adjacent pixel is the average value of the pixel values n rows before, n columns before, or n before the current block, but the present invention is not limited thereto.

[0141] Optionally, the complexity information of the current block is obtained based on at least one angular gradient of the current block. Specifically, the video encoding / decoding device uses the minimum value in the complexity information obtained based on at least one angular gradient as the complexity information of the current block. That is, when the complexity information of the current block calculated based on a certain angular gradient is the minimum, the minimum complexity information is used as the complexity information of the current block.

[0142] In a third possible implementation manner, in the process of video encoding / decoding, since sampling is performed on the image to be processed in multiple channels, the current block is composed of image blocks of multiple channels. If the current block is an image block of N channels, where N is an integer greater than 0, the video encoding / decoding device determines the complexity information of each channel's image block based on the pixel values of the image blocks of each channel in the above-mentioned N-channel image block, and determines the complexity information of the current block based on the complexity information of each channel's image block. For example, the minimum value in the complexity information of the N-channel image block is determined as the complexity information of the current block. In this way, the complexity information calculated for the image block of a single-channel image becomes more accurate, which helps to improve the accuracy of determining the complexity information of the current block and the accuracy of video encoding / decoding.

[0143] In a possible implementation manner, for each channel image block, at least one angular gradient can be calculated, one complexity information of the channel image block can be obtained based on each angular gradient, and based on the obtained complexity information, the complexity information of the channel image block is determined. For example, the minimum value of the obtained complexity information is determined as the complexity information of the channel image block.

[0144] In another possible implementation manner, the video encoding / decoding device divides each channel image block in the multiple channel image blocks that make up the current block, and determines the complexity information of each channel image block based on the sub-blocks after dividing each channel image block. Specifically, the video encoding / decoding device divides each channel image block into at least two sub-blocks, obtains the complexity information of at least two sub-blocks of each channel image block, and determines the complexity information of the corresponding channel image block in each channel image block based on the complexity information of at least two sub-blocks of each channel image block.

[0145] Exemplarily, FIG. 10 provides a schematic diagram of a method for dividing an image block and calculating an angular gradient. As shown in FIG. 10, a certain 4×2 channel image block in the current block is divided vertically, and complexity information of the channel image block is obtained by calculating an angular gradient for the divided 8×2 sub-image blocks.

[0146] Among them, the implementation method for determining the complexity information of at least two sub-blocks of each channel image block may refer to the implementation method provided in FIG. 7 above, but detailed description is omitted here.

[0147] Optionally, the video encoding / decoding device determines the minimum value of the complexity information of at least two sub-blocks of each channel image block as the complexity information of the corresponding channel image block.

[0148] Note that the division rules for the above sub-blocks of each channel image block may be the same or different. Among them, depending on the sampling format of the image, the sizes of each channel image block may be different. For example, when sampling is performed according to the 420 sampling format in the YUV format as described above, the block sizes after sampling the luminance, the first chrominance, and the second chrominance are different. Therefore, a relatively large channel image block may be divided to determine the complexity information of the channel image block. Since the complexity information calculated for the sub-blocks with a small size in the channel image block is more accurate, the complexity information of the channel image block obtained based on the complexity information of the sub-blocks is more accurate, which helps to improve the accuracy of determining the complexity information of the current block and the accuracy of video encoding / decoding.

[0149] The multi-channel of the present invention is not limited to the above-mentioned three RGB channels, and may have more channels. For example, if the image sensor is a 4-channel sensor, the corresponding image to be processed includes 4-channel image information. For example, if the image sensor is a 5-channel sensor, the corresponding image to be processed includes 5-channel image information.

[0150] The multi-channel in the present invention includes, for example, at least one or more of a Y channel, a U channel, a V channel, a Co channel, a Cg channel, an R channel, a G channel, a B channel, an alpha channel, an IR channel, a D channel, and a W channel. For example, the multi-channel may include a Y channel, a U channel, and a V channel. Alternatively, the multi-channel may include an R channel, a G channel, and a B channel. Alternatively, the multi-channel may include an R channel, a G channel, a B channel, and an alpha channel. Alternatively, the multi-channel may include an R channel, a G channel, a B channel, and an IR channel. Alternatively, the multi-channel may include an R channel, a G channel, a B channel, and a W channel. Alternatively, the multi-channel may include an R channel, a G channel, a B channel, an IR channel, and a W channel. Alternatively, the multi-channel may include an R channel, a G channel, a B channel, and a D channel. Alternatively, the multi-channel may include an R channel, a G channel, a B channel, a D channel, and a W channel. Among them, other than the RGB color light-sensitive channels, it may have an IR channel (infrared or near-infrared light-sensitive channel), a D channel (mainly a dark channel by infrared or near-infrared), and a W channel (full-color light-sensitive channel). Different sensors may have different channels. For example, the sensor type may be an RGB sensor, an RGBIR sensor, an RGBW sensor, an RGBIRW sensor, an RGBD sensor, an RGBDW sensor, etc.

[0151] In the fourth possible implementation manner, the video encoding / decoding device obtains the prediction angle used for the current block's angular prediction mode, calculates an angular gradient based on the prediction angle to obtain corresponding complexity information, and uses the corresponding complexity information as the complexity information of the current block.

[0152] Among them, the angular prediction mode is a general prediction mode for determining the residual between the pixel value and the reconstructed value of the current block based on a specified angle. The prediction angle, also called the prediction direction, is similar to the angles related to the other angular gradients described above, such as 45°, 135°, etc.

[0153] The implementation manner of calculating the angular gradient based on the prediction angle and obtaining the corresponding complexity information may refer to the above implementation manner, but detailed description is omitted here.

[0154] By the above method, a correlation is established between the prediction mode of the current block and the calculation of the complexity information, making the calculation of the complexity information of the current block more purposeful, improving the accuracy of the complexity information, and improving the accuracy of video encoding / decoding.

[0155] Optionally, the prediction mode may include a plurality of prediction modes such as an average (DC) prediction mode, a planar prediction mode, etc. The video encoding / decoding device may set a plurality of complexity information for the current block in order to determine the complexity information of the current block according to the prediction mode. In some cases, the plurality of complexity information may be calculated based on the plurality of angular gradients. In other cases, a plurality of complexity information may be preset in the video encoding / decoding device. Among them, there is a correspondence between the preset plurality of complexity information and the prediction mode. For example, the plurality of complexity information has first complexity information and second complexity information. The first complexity information corresponds to an angular prediction mode (which may include one or more angular prediction modes), and the second complexity information corresponds to the DC prediction mode and the planar prediction mode. When making a prediction for the current block, there is a possibility of obtaining a plurality of prediction results based on the plurality of prediction modes, and the optimal prediction mode is determined based on the rate-distortion (Rate-Distortion Optimized, RDO) cost and used as the prediction mode of the current block. The complexity information of the current block is obtained according to the correspondence between the prediction mode determined based on the RDO cost and the preset complexity information. Combining the above examples, when it is determined that the prediction mode of the current block is the DC prediction mode based on the RDO cost, according to the above correspondence, the complexity information of the current block should be the second complexity information.

[0156] Optionally, as described in the above third possible implementation manner, the prediction mode may be divided into multiple categories, and each category may correspond to one piece of complexity information. The multiple categories may include an intra mode category, a dot prediction mode category, a Screen Content Coding (SCC) mode category, an original value mode category, and a fallback mode category. For example, the angle prediction mode belongs to the intra mode category. Note that the category to which the above prediction mode belongs may be further divided according to whether conversion is performed. For example, the intra mode category may be divided into an intra mode + conversion category and an intra mode + non - conversion category. The correspondence between the complexity information and the category is similar to the case where the above first complexity information corresponds to one or more prediction modes. After determining the category to which the prediction mode of the current block belongs, the quantization parameter is calculated using the corresponding complexity information.

[0157] Optionally, as can be seen from the above third possible implementation manner, the determination of the complexity information of the current block by video encoding / decoding based on at least one angle gradient of the N - channel image block of the current block is realized by the following steps S11 - S12.

[0158] In S11, the video encoding / decoding device obtains the complexity information of each channel image block based on the pixel values of each channel image block in the N - channel image block, where N is an integer greater than 0.

[0159] In S12, the video encoding / decoding device obtains the complexity information of the current block based on the complexity information of each channel image block.

[0160] As can be seen from the above description, for the current block, at least one angular gradient can be obtained, and based on the angular gradient thus obtained, the complexity information of the current block can be obtained. For the channel image block, at least one angular gradient can be obtained, and based on the angular gradient thus obtained, the complexity information of the channel image block can be obtained. For the sub-blocks of the channel image block, at least one angular gradient can also be obtained, and based on the angular gradient thus obtained, the complexity information of the sub-blocks can be obtained. In addition to the implementation methods for obtaining the complexity information described above, there are also other implementation methods. Hereinafter, taking the acquisition of the complexity information of the current block as an example, the following implementation methods 1-4 will be described.

[0161] In Implementation Method 1, the minimum value of each complexity information calculated based on the angular gradient is used as the complexity information of the current block. The formula is as follows. TIFF2025520149000009.tif11149

[0162] Among them, complexity_45 is the complexity information calculated based on the 45° angular gradient, complexity_225 is the complexity information calculated based on the 225° angular gradient, complexity_135 is the complexity information calculated based on the 135° angular gradient, and complexity_315 is the complexity information calculated based on the 315° angular gradient.

[0163] In Implementation Method 2, based on the weighted values of each complexity information calculated based on the angular gradient, the complexity information of the current block is obtained. The formula is as follows. TIFF2025520149000010.tif11149

[0164] Among them, w v represents the weighted value corresponding to the vertical gradient, w h represents the weighted value corresponding to the horizontal gradient, w 225 represents the weighted value corresponding to the 225° gradient, w 315represents the weighting value corresponding to a 315° gradient, where 0 ≤ w v , w h , w 225 , w 315 ≤ 1 and w v + w h + w 225 + w 315 = 1.

[0165] In implementation method 3, the complexity level of the original image block of each channel is calculated, and the block_complexity of the current block is determined based on the complexity_level of each channel image block. It includes the following steps S21 - S23.

[0166] In step S21, the video encoding / decoding device determines the complexity_level of each channel image block based on the complexity information of each channel image block.

[0167] In case 1, considering the subjective model classification of the human eye, A - 1 absolute thresholds are set, and the image blocks are divided into A levels from simple to complex.

[0168] For example, for an 8-bit image block with a sampling format of YUV444, the complexity_level of each channel image block is divided based on the following method, including that complexity ≦ 4 belongs to level 1, 4 < complexity < 16 belongs to level 2, and complexity ≧ 16 belongs to level 3. Also, for example, for a 10-bit image block with a sampling format of YUV444, the complexity_level of each channel image block is divided based on the following method, including that complexity ≦ 8 belongs to level 1, 8 < complexity < 64 belongs to level 2, and complexity ≧ 64 belongs to level 3. Also, for example, for a 12-bit image block with a sampling format of YUV444, the complexity_level of each channel image block is divided based on the following method, including that complexity ≦ 16 belongs to level 1, 16 < complexity < 256 belongs to level 2, and complexity ≧ 256 belongs to level 3.

[0169] In case 2, considering the subjective model classification of the human eye, B - 1 absolute thresholds are set, and C dynamic thresholds updated in the image block are installed, and the image block is divided into B + C levels in total.

[0170] FIG. 11 is a schematic diagram of the relationship between the dynamic threshold and the absolute threshold according to an embodiment of the present invention. As shown in FIG. 11, assuming that the absolute threshold 1 is 4 and the absolute threshold 2 is 16, then 0 < dynamic threshold (thread) 1 < 4, and 4 < thread2 < 16. Assume that complexity ≦ thread1 belongs to level 1, thread1 < complexity ≦ 4 belongs to level 2, 4 < complexity ≦ thread2 belongs to level 3, thread2 < complexity ≦ 16 belongs to level 4, and complexity > 16 belongs to level 5. Among them, when the above dynamic threshold is updated for the image block, if the complexity information of the current block is less weighted than the complexity information of some previous image blocks, the dynamic threshold becomes smaller. If the complexity information of the current block has the same weight as the complexity information of some previous image blocks, the dynamic threshold does not change. If the complexity information of the current block is more weighted than the complexity information of some previous image blocks, the dynamic threshold becomes larger.

[0171] In step S22, the video encoding / decoding device determines the complexity level (block_complexity_level) of the current block based on the complexity_level of each channel image block.

[0172] Regarding the complexity level of each channel image block, a large weight is given to the channel to which the human eye is sensitive, and conversely, a small weight is given. The complexity levels of each channel image block are weighted to obtain the complexity level of the current block.

[0173] Taking the number of channels of the image block as 3 as an example, the complexity level of the current block is determined by the following formula. TIFF2025520149000011.tif7149

[0174] Among them, w1, w2, or w3 may be 0. w1, w2, and w3 respectively represent the weights of the complexity levels of the three-channel image block, and complexity_level1, complexity_level2, and complexity_level3 respectively represent the complexity levels of the three-channel image block. For example, for an image block with a sampling format of YUV444, a large weight can be assigned to the Y-channel coefficient, and w1 = 2, w2 = w3 = 1 can be set.

[0175] In step S23, the video encoding / decoding device represents the complexity information of the current block based on block_complexity_level.

[0176] Steps S21 - S23 flexibly adjust the weights of the complexity levels of the image blocks of different channels to flexibly adjust the complexity information of the current block.

[0177] Regarding implementation method 3, the video encoding / decoding device may directly determine the complexity information (block_complexity) of the current block based on the complexity of each channel image block without executing step S21 above. That is, it is the following implementation method 4.

[0178] In implementation method 4, the video encoding / decoding device directly weights the complexity of each channel image block to obtain the complexity information of the current block. The formula is as follows. TIFF2025520149000012.tif8145

[0179] Among them, w4, w5, or w6 may be 0. w4, w5, and w6 respectively represent the weights of the complexity information of the three-channel image block, and complexity1, complexity2, and complexity3 respectively represent the complexity information of the three-channel image. The weights represented by w4, w5, and w6 may be related to the subjective model of the human eye. For example, a large weight is assigned to the channel to which the human eye is sensitive.

[0180] Further, based on the obtained block_complexity, the block_complexity may be leveled by the above step S22 to obtain block_complexity_level.

[0181] Note that when an N-channel image block is divided into at least two sub-blocks, the video encoding / decoding device may determine the complexity information of the N-channel image block by the above method to determine the complexity information of the current block.

[0182] Specifically, taking the example of dividing one channel image block into two sub-blocks, when the complexity information of the two sub-blocks is sub_complexity1 and sub_complexity2 respectively, based on the complexity information of the two sub-blocks, when determining the complexity information (complexity1) of the channel image block, the following implementation methods 5 - 7 are included.

[0183] In implementation method 5, the minimum value of the complexity information of each sub-block is used as the complexity information of the channel image block. TIFF2025520149000013.tif9108

[0184] In implementation method 6, the complexity information of each sub-block is weighted to obtain the complexity information of the channel image block.

[0185] TIFF2025520149000014.tif8112 Among them, w7 and w8 respectively represent the weights of the complexity information of the two sub-blocks, and 0 ≤ w7 ≤ 1, 0 ≤ w8 ≤ 1.

[0186] In implementation method 7, based on the complexity level of each sub-block, the complexity information of the channel image block is determined.

[0187] In the following (1) and (2), taking as an example that the complexity levels of two sub - blocks are sub_complexity_level1 and sub_complexity_level2 respectively, the complexity information of the channel image block is complexity1, and the complexity level of the channel image block is complexity_level1, this implementation method will be described. Among them, the method for determining the complexity level of each sub - block is to determine the complexity level of each sub - block based on the complexity information of each sub - block. Specifically, reference may be made to the description of step S21 above, but the difference is that the names of each sub - block and each channel image block are different, and detailed description is omitted here.

[0188] (1) Based on the complexity levels of each sub - block, the complexity level of the channel image block may be determined.

[0189] Optionally, the complexity levels of each sub - block (for example, sub_complexity_level1 and sub_complexity_level2) may be weighted to obtain the complexity level of the channel image block (for example, complexity_level1). The formula is as follows.

[0190] TIFF2025520149000015.tif8148 Among them, w9 and w10 respectively represent the weights of the complexity levels of the two sub - blocks, and 0 ≤ w9 ≤ 1, 0 ≤ w10 ≤ 1.

[0191] Optionally, the minimum value of the complexity levels of each sub - block (for example, sub_complexity_level1 and sub_complexity_level2) is taken as the complexity level of the channel image block (for example, complexity_level1). The formula is as follows. TIFF2025520149000016.tif8133

[0192] (2) Represent the complexity information of the channel image block based on the determined block complexity level of the channel image block.

[0193] Specifically, this step is similar to S23, and detailed description is omitted here.

[0194] The following describes other implementation manners of step S601.

[0195] In some cases, the video encoder 102 may obtain the complexity information and send the complexity information to the video decoder 112. In this case, if the encoding / decoding device is the video decoder 112, the selective implementation manner of the above step S601 includes analyzing the code stream and obtaining the complexity information of the current block in the image to be processed from the code stream.

[0196] In S602, the video encoding / decoding device determines the quantization parameter of the current block based on the complexity information of the current block.

[0197] Optionally, the video encoding / decoding device determining the quantization parameter of the current block based on the complexity information includes the following steps S31 - S32.

[0198] In S31, the video encoding / decoding device determines the reference quantization parameter (ref_qp) of the current block based on the complexity information of the current block.

[0199] In S32, based on the reference quantization parameter of the current block, the quantization parameter of the current block is determined.

[0200] Among them, the reference quantization parameter is for instructing the generation of the quantization parameter.

[0201] Optionally, the video encoding / decoding device acquires the buffer area state of the image to be processed and the correspondence between the buffer area state and the complexity information of the current block, and determines the reference quantization parameter of the current block based on the correspondence between the buffer area state and the complexity information.

[0202] In the video encoding process, since the encoding rates of different image blocks are different, the output bitstream fluctuates, which affects the transmission stability. In response to this, the video encoder also includes a buffer module. The buffer area in the buffer module is for controlling the output of the bitstream at a uniform speed. The output of the bitstream at a uniform speed means that the bits occupied by the bitstream are output at a uniform speed. It can be understood that the buffer area causes the bitstream flowing in at a non-uniform speed after encoding to flow out in the form of a uniform speed so as to achieve a stable output. Also, the buffer area does not allow overruns. Among them, an overrun includes an overflow and an underflow. When it exceeds the maximum value (max_buffer) of the buffer area state, it is an overflow, and when it is below the minimum value (0) of the buffer area state, it is an underflow.

[0203] The above buffer area state is for representing the number of bits occupied by the encoded image blocks in the image to be processed in the buffer area. It can be understood that the buffer area state is updated by the image blocks. For example, if an image block flows into the buffer area at a speed of 100 bit / second after being encoded and flows out of the preset buffer area at a uniform speed of 50 bit / second, the number of bits of the image block in the buffer area in one second is 100 - 50 = 50 bit.

[0204] The above buffer area state may also be referred to as the physical buffer state (physical_buffer).

[0205] Specifically, the video encoding / decoding device may directly read the state information of the corresponding buffer area to obtain the buffer area state of the image to be processed. The video encoding / decoding device obtains the correspondence between the buffer area state of the image to be processed and the complexity information of the current block by the following steps S41 - S42.

[0206] In S41, the video encoding / decoding device determines the fullness based on the buffer area state.

[0207] Fullness refers to the linear mapping for each category of the buffer area state and means the degree of fullness of the buffer area. Refer to the following formula. TIFF2025520149000017.tif972

[0208] Among them, a and b are the parameters of the linear mapping for each category of fullness by physical_buffer. a represents the scaling for physical_buffer, and b represents the degree of offset for physical_buffer. The parameters may be adjusted based on the buffer area state, image information, and complexity information. The following will be described by cases.

[0209] In Case 1, the parameters a and b are determined based on the image information.

[0210] For example, in some blocks starting from slice, a = 0.8 and b = (-bpp) / (2×block_size). Among them, block_size represents the size of the block.

[0211] In some blocks starting from slice, the buffer area state is small. It can be understood that the above a and b further reduce the fullness, obtain a smaller ref_qp, and improve the accuracy of encoding / decoding.

[0212] Alternatively, in the blocks at the slice boundary (e.g., the first row and the first column), a = 0 and b = -bpp x block_size.

[0213] It can be understood that there are no reference pixels in the boundary blocks and the quality of the prediction result is low. By determining a relatively small ref_qp, a reduction in fullness is achieved.

[0214] In Case 2, parameters a and b are determined based on the image information and the buffer area state.

[0215] Based on the relationship between bpp and the buffer area state, parameters a and b are adjusted.

[0216] For example, when bpp = 8 and (physical_buffer) / (max_buffer)>0.85, a = 1 and b = 0. Also, for example, when bpp = 6 and (physical_buffer) / (max_buffer)>0.85, a = 1.1 and b = block_size.

[0217] As can be seen, when the buffer area state is relatively full at a low bpp, by further increasing the fullness with the above a and b so as to obtain a relatively large ref_qp, it is possible to prevent the buffer area state from exceeding the maximum number of bits of the buffer area.

[0218] In Case 3, parameters a and b are determined based on the image information and the complexity information.

[0219] For example, for an image block with high complexity information, a = 1 and b = bpp×block_size. For an image block with general complexity information, a = 1 and b = 0. For an image block with low complexity information, a = 1 and b = -bpp×block_size.

[0220] Optionally, the degree of high or low complexity information may correspond to the above complexity information levels.

[0221] In case 4, parameters a and b are determined according to the buffer area state.

[0222] For example, if physical_buffer < (max_buffer) / 2, then a = 0.9 and b = 0. If (max_buffer) / 2 ≤ physical_buffer < (3×max_buffer) / 4, then a = 1.0 and b = 0. If physical_buffer ≥ (3×max_buffer) / 4, then a = 1.2 and b = 0.

[0223] As can be seen therefrom, when the buffer area state is relatively empty, by reducing fullness with the above a and b, the effect of lowering ref_qp can be realized. Similarly, when the buffer area state is relatively full, by increasing fullness with the above a and b, the effect of raising ref_qp can be realized.

[0224] It should be noted that the above four cases are only examples for determining the relevant parameters of parameters a and b, and the magnitudes of the parameter values may be other values, but are not limited thereto.

[0225] In S42, the video encoding / decoding device calculates ref_qp based on the fullness.

[0226] Hereinafter, the implementation method for determining ref_qp will be described.

[0227] In a possible implementation method, ref_qp is calculated with reference to the following formula. TIFF2025520149000018.tif952

[0228] Among them, c and d are parameters, and may be adjusted based on the buffer area state, image information, and complexity information. Optionally, parameter c may be determined based on max_qp. Among them, max_qp is the maximum quantization parameter.

[0229] Among them, c and d are parameters of the linear mapping for each section of ref_qp according to fullness. c represents the scaling for fullness, and d represents the degree of offset for fullness. These parameters may be adjusted based on image information, complexity information, and fullness. Hereinafter, it will be described by cases.

[0230] In Case 1, parameters c and d are determined based on image information.

[0231] For example, fixed parameters such as c = 1 and d = 1 may be used according to image information. Different c and d may exist for different bit widths.

[0232] Alternatively, in the blocks at the slice boundary (for example, the first row and the first column), special processing is performed, and ref_qp becomes smaller than the original value, that is, relatively small c and d are used.

[0233] In Case 2, parameters c and d are determined based on fullness and image information.

[0234] For example, parameters c and d are determined with respect to the bit width in the image information and the target pixel depth (target_bpp).

[0235] For example, when target_bpp is 8 bits and fullness < 0.1, for an 8-bit image, c = 0 and d = 2. For a 10-bit image, c = 0 and d = 4. For a 12-bit image, c = 0 and d = 6. When target_bpp is 8 bits and fullness > 0.8, for an 8-bit image, c = 1 and d = 2. For a 10-bit image, c = 1 and d = 4. For a 12-bit image, c = 1 and d = 6. Among them, c and d are updated in the image block.

[0236] Among them, target_bpp refers to the parameter specified on the encoding side and represents the number of bits required per pixel point after compression. For example, for a 10-bit original image with a sampling format of YUV444, the bpp of the original image is 30 bits. If target_bpp is 5 bits, it means that it is compressed 6 times.

[0237] In other possible implementation manners, ref_qp may be determined based on the bit width and pixel depth in the image information. Specifically, a range for ref_qp may be determined based on the image information. Among them, when the image information changes, the corresponding range of ref_qp is different. Specifically, the range is an interval composed of a minimum reference quantization parameter (min_ref_qp) and a maximum reference quantization parameter (max_ref_qp). For example, for an image with a bpp of 8 bits and a sampling format of YUV444, if fullness < 0.25, then min_ref_qp = 0, max_ref_qp = 8, and ref_qp is selected from (0, 8). If fullness > 0.85, then min_ref_qp = 4, max_ref_qp = 56, and ref_qp is selected from (4, 56). Otherwise, min_ref_qp = 0, max_ref_qp = 32, and ref_qp is selected from (0, 32).

[0238] In Case 3, parameters c and d are determined based on the buffer area state.

[0239] Specifically, parameters c and d are determined based on the relationship between physical_buffer and max_buffer.

[0240] When physical_buffer < (max_buffer) / 4, c = 0.5 and d = 0. When (max_buffer) / 4 ≤ physical_buffer < (max_buffer) / 2, c = 1.0 and d = 0. When physical_buffer ≥ (max_buffer) / 2, c = 1.3 and d = 0.

[0241] In Case 4, parameters c and d are determined based on complexity information and fullness.

[0242] For blocks with high complexity information, the mapping results for different fullness levels are different. For example, when fullness = 0.5, the reference QP of a complex block becomes 32 through mapping, and the reference QP of a simple block becomes 16 through mapping.

[0243] Or, for example, for simple blocks, when fullness < 0.2, c > 0 and d = 0, that is, the reference QP increases as fullness increases. When 0.2 ≤ fullness ≤ 0.8, c = 0 and d > 0, and the value of d is updated with the image block. As fullness increases, the reference QP is maintained constant within a part of fullness. When fullness > 0.8, c > 0, that is, the reference QP increases as fullness increases. Similar operations are also performed for normal blocks and complex blocks. Among them, simple blocks are understood as blocks where the complexity information is below a first preset value, complex blocks are understood as blocks where the complexity information is above a second preset value, and normal blocks are understood as blocks where the complexity information is between the first preset value and the second preset value.

[0244] In Case 5, parameter c is determined based on complexity information.

[0245] As can be seen from the formula for calculating the above ref_qp, when the parameter c is set large, the change in ref_qp accompanying the change in fullness becomes large, and the change in qp determined based on the change in ref_qp accompanying the change in fullness also becomes large. It can be understood that the parameter c can be regarded as the "slope" in the mapping relationship between qp and fullness. Therefore, by adjusting the magnitude of the parameter c, the sensitivity of qp accompanying the change in fullness is adjusted. When encoding a block with relatively low complexity, since the computational resources such as the number of bits in the buffer area consumed by encoding are relatively small, it is also possible to appropriately reduce the sensitivity of qp accompanying the change in fullness. That is, in order to prevent qp from being adjusted to be too small due to the change in fullness, the magnitude of the parameter c is appropriately reduced, that is, to ensure that the encoding quality of blocks with relatively low complexity is not too low. On the contrary, when encoding a block with relatively high complexity, since the computational resources such as the number of bits in the buffer area consumed by encoding are relatively large, the sensitivity of qp accompanying the change in fullness is appropriately increased. That is, the magnitude of the parameter c is appropriately increased to further improve the control ability with respect to the encoding rate. In summary, for blocks with relatively high complexity, a relatively high parameter c may be determined, but for blocks with relatively low complexity, a relatively low parameter c may be determined.

[0246] For example, for a block with relatively high complexity, c = 1.1. For a block with relatively low complexity, c = 0.9.

[0247] In Case 6, the parameters e and f are determined based on the complexity information, the maximum complexity (max_complexity), and the maximum quantization parameter (max_qp), where e and f are parameters related to fullness, buffer state, and image information. TIFF2025520149000019.tif9127

[0248] Determining the reference quantization parameter based on the above-mentioned complexity information and the fullness or buffer area state may refer to the function image of the reference quantization parameter, complexity, and buffer area state provided in FIG. 12a. Among them, as the buffer area state increases, the reference quantization parameter increases, and the complexity information can have different effects on the increase of the reference quantization parameter with respect to the buffer area state. For example, in an image block with relatively high complexity, the reference quantization parameter increases as the buffer area state increases. In an image block with relatively low complexity, the increase in the reference quantization parameter of an image block with relatively high complexity may be smaller than the increase in the buffer area state. Of course, the effects of complexity and buffer area state on the reference quantization parameter are always in a positive correlation.

[0249] Specifically, as shown in the function image of the reference quantization parameter and the buffer area state provided in FIG. 12b, assuming that in the interval of (0, max_buffer×0.15) and (max_buffer×0.85, the maximum number of bits in the buffer area), the influence of the buffer area state on the reference quantization parameter is dominant, that is, when the buffer area state is relatively empty or relatively full, the influence of complexity is relatively small. In the interval of [max_buffer×0.15, max_buffer×0.85], the influence of complexity is large. Considering the influence of complexity information on the reference quantization parameter, five possibilities as shown in the figure may occur. When the influence of complexity is relatively small, at this time, within this interval, the reference quantization parameter may not change, corresponding to L3. When the influence of complexity is general, at this time, within this interval, the reference quantization parameter may increase slowly, corresponding to L2 or L4. When the influence of complexity is relatively large, at this time, within this interval, the reference quantization parameter may change suddenly, corresponding to L1 or L5. Among them, the starting point due to the change in complexity is determined based on the complexity information itself.

[0250] For the influence of the complexity information considered for each section in FIG. 12b, reference may be made to the function image of the reference quantization parameter and the complexity provided by FIG. 12c.

[0251] As can be seen therefrom, based on the physical buffer area state of the image to be processed, the input and output of the buffer area code stream of the image to be processed can be dynamically controlled, and the output of the code stream can be further stabilized.

[0252] Optionally, the video encoding / decoding device determines the complexity level of the current block, determines a target bit (target_cost) based on the complexity level of the current block, and obtains the reference quantization parameter of the current block based on the target bit. The target bit refers to the number of predicted bits for encoding / decoding the current block. The actual number of bits for encoding / decoding the current block may be greater than, less than, or equal to the target bit. Among them, determining the complexity level of the current block may refer to the part of the embodiment regarding the complexity level above, but the description is omitted here. Among them, the above target bit refers to the number of bits occupied by the current block in the code stream.

[0253] Specifically, the video encoding / decoding device determines the target bit based on the complexity level of the current block, which is realized by the following several cases.

[0254] In Case 1, target_cost is determined based on the image information and the complexity.

[0255] Specifically, each piece of complexity information stores one reference bit number (ref_cost), which is updated together with the image block, and ref_cost = 0.75 × ref_cost t-1It is +0.25×real_cost, where real_cost represents the predicted lossless consumption bit number of the current block related to the quantization parameter (qp) and the actual number of encoded bits. ref_cost is the number of reference bits for determining target_cost. ref_cost t-1 is the number of reference bits corresponding to the previous image block. ref_cost is for representing the number of reference bits corresponding to the current image block. Perform a piecewise linear transformation using ref_cost at the complexity level of the current block to obtain the target bits. Refer to the following formula. TIFF2025520149000020.tif863

[0256] Among them, g and h are the parameters of the piecewise linear mapping of target_cost based on ref_cost. g represents the scaling for target_cost, and h represents the degree of offset for ref_cost. The parameters g and h are related to the image information. For example, for an image with bpp of 8 bits and a sampling format of YUV444, when ref_cost > 1.1×average bit number (ave_cost), g = 1.8 and h = -9. When ref_cost < 0.9×ave_cost, g = 1.2 and h = -6. Among them, g and h are for modifying ref_cost based on ave_cost to obtain target_cost.

[0257] In case 2, determine target_cost based on the complexity information.

[0258] Specifically, there are I complexity information and J types of modes, which are divided into I×J categories, and each category corresponds to one target_cost. For example, the complexity information indicates whether the current block is simple or complex, and the modes include Intra block copy (IBC) mode and non-IBC mode. There are a total of four categories including simple IBC, simple non-IBC, complex IBC, and complex non-IBC, and each category corresponds to one target_cost. By estimating the number of reference bits for each category (ref_cost = real_bit + qp / 8), the predicted number of bits for each category is updated ((pred_cost t ) = 0.75×pred_cost t-1 + 0.25×ref_cost), and the coefficient is calculated (scale = bpp / (avg_complexity - offset)). Among them, avg_complexity represents the sliding average complexity of all blocks up to the position of the current block, and offset is related to the image format and bpp. Finally, target_cost = scale×(pred_cost - offset) is obtained. Among them, pred_cost t-1 is the predicted number of bits corresponding to the previous image block.

[0259] In Case 3, target_cost is determined based on the image information. The image information includes bit width, image sampling format, or other information.

[0260] Specifically, there are K bit widths and L image sampling formats, which are divided into a total of K×L categories, and each category corresponds to one target_cost. For example, there are two bit widths (8bit and 12bit), and two image sampling formats (YUV and RGB), and there are a total of four types of target_cost including 8bitYUV, 8bitRGB, 12bitYUV, and 12bitRGB.

[0261] In Case 4, obtain the fullness and, in combination with the complexity information, buffer area state, or image information of the current block, determine the target_cost based on the fullness.

[0262] Among them, the process of obtaining the fullness is the same as that in step S41.

[0263] In Case 4.1, determine the target_cost based on the fullness and the buffer area state.

[0264] Specifically, target_cost = m × ref_cost + n × physical_buffer + o, where m, n, and o are parameters.

[0265] When fullness > 0.85, at this point, the setting of target_cost is dominated by fullness, that is, the value of n is greater than m. When fullness < 0.25, at this point, m is greater than n.

[0266] In Case 4.2, determine the target_cost based on the fullness, image information, and complexity information.

[0267] Among them, different fullness values correspond to different minimum target bits (min_target_cost) and maximum target bits (max_target_cost), which limit the target_cost.

[0268] For example, for an 8-bit image with a sampling format of YUV444, min_target_cost = bpp × fullness × p1 + q1 and max_target_cost = bpp × fullness × p2 + q2. Among them, when fullness < 0.25, p1 and q1 make min_target_cost smaller, and when fullness > 0.75, p1 and q1 make min_target_cost larger. Among them, when fullness < 0.25, p2 and q2 make max_target_cost smaller, and when fullness > 0.75, p2 and q2 make max_target_cost larger.

[0269] In Case 4.3, target_cost is determined based on fullness and complexity information.

[0270] For a simple block with relatively low complexity, when fullness < 0.1, m > 0 and n = 0, that is, ref_qp increases as fullness increases. When 0.1 ≤ fullness ≤ 0.9, m = 0 and n > 0, and the value of n is updated with the image block. As fullness increases, ref_qp is maintained constant within a part of fullness. When fullness > 0.9, m > 0, that is, ref_qp increases as fullness increases. Similar operations are also performed for normal blocks and complex blocks. For a certain part of simple blocks and normal blocks, when the actual encoded bits are larger than the target bits, the value of n increases, and conversely decreases, that is, by adjusting n, the actual bit consumption is made below target_cost. For complex blocks, by adjusting n, the actual bit consumption is made above target_cost (if simple blocks and normal blocks do not save bits, there are no extra bits available for complex blocks, and it is strictly made below target_cost).

[0271] Optionally, the video encoding / decoding device determines the reference quantization parameter of the current block based on the target bits. Refer to the following formula. TIFF2025520149000021.tif1070

[0272] Among them, u and v are parameters. u and v are the parameters of the linear mapping for each section of ref_qp by target_cost. u represents the scaling for target_cost, and v represents the degree of offset for target_cost. For example, u = 8 / 3 and v = ref_cost × 8.

[0273] As can be seen, the reference quantization parameter obtained based on the target bits corresponding to the complexity level can be flexibly adjusted based on the magnitude of the target bits. In this way, the quantization parameter can be adjusted more flexibly.

[0274] The implementation method of step S32 will be described below.

[0275] Optionally, the video encoding / decoding device determines the quantization parameter of the current block based on the reference quantization parameter of the current block. Specifically, the formula qp = ref_qp × x + y may be referred to. Among them, x and y are the parameters of the linear mapping for each section of qp by ref_qp. x represents the scaling for ref_qp, and y represents the degree of offset for ref_qp.

[0276] Specifically, the video encoding / decoding device determines the quantization parameter based on the current reference quantization parameter, which is realized by the following several cases.

[0277] In case 1, the parameters x and y are determined based on the image information.

[0278] If x is 1 and y is 0, the reference quantization parameter is the quantization parameter.

[0279] Alternatively, for an image with a sampling format of YUV444, for each channel, x = 1 / 3 and y = 0. Or, for the Y channel, x = 1 / 2 and y = 0, and for the chrominance channels, x = 1 and y = 0.

[0280] Or, when ref_qp is within (0, 16), for the Y channel, x = 1 / 4 and y = 0, and for the chrominance channels, x = 1 / 2 and y = 0. When ref_qp is within (17, 32), for the Y channel, x = 1 / 2 and y = 2, and for the chrominance channels, x = 1 / 2 and y = 4. When ref_qp is within (33, 63), for the Y channel, x = 1 and y = 0, and for the chrominance channels, x = 1 and y = 0.

[0281] In Case 2, parameters x and y are determined based on complexity information.

[0282] Specifically, the video encoding / decoding device determines a weight coefficient based on the complexity information of the current block, and the weight coefficient is for adjusting the quantization parameter of the current block based on the degree of complexity of the current block. Based on the weight coefficient and the reference quantization parameter of the current block, the quantization parameter of the current block is determined.

[0283] For example, the above weight coefficient may be regarded as the following x, and the weight coefficient may be determined based on the following formula. TIFF2025520149000022.tif6149

[0284] Among them, w represents the weight, including w11, w12, and w13, and 0 ≤ w11, w12, w13 ≤ 1. block_complexity1, block_complexity2, and block_complexity3 respectively represent the complexity information of the three channels of the current block.

[0285] By this possible implementation method, by using the weight coefficient determined by the complexity information of the current block to adjust the quantization parameter of the current block, the quantization parameter of the current block can be adaptively adjusted based on the complexity information of the current block, improving the accuracy of determining the quantization parameter of the current block and improving the accuracy of video encoding / decoding.

[0286] In Case 3, a weight coefficient is determined based on the complexity information of M encoded / decoded image blocks and the complexity information of the current block. The quantization parameter of the current block is determined based on the weight coefficient and the reference quantization parameter of the current block.

[0287] For example, the above weight coefficient may be regarded as the following x, and the weight coefficient may be determined based on the following formula.

[0288] Among them, window_complexity represents the complexity information of the image blocks included in the sliding window. As the image blocks in the sliding window change, the window_complexity is updated accordingly. Specifically, it is calculated based on the following formula. TIFF2025520149000023.tif8149TIFF2025520149000024.tif11149

[0289] Among them, w10, w11, and w12 represent weights, and 0 ≤ w10, w11, w12 ≤ 1. window_complexity z represents the complexity information of the M encoded / decoded image blocks starting from the z block. Similarly, window_complexit y z-1 represents the complexity information of the M encoded / decoded image blocks starting from the z - 1 block. window_complexity1 z 、window_complexity2 z and window_complexity3 zThey respectively represent the complexity information of three different image blocks included in the sliding window. y = 0.

[0290] Based on the weight coefficient and the reference quantization parameter of the current block, the implementation method for determining the quantization parameter of the current block may refer to the formula qp = ref_qp × x + y, but detailed explanations are omitted here.

[0291] In S603, the video encoding / decoding device encodes / decodes the current block based on the quantization parameter.

[0292] Optionally, the complexity information of the current block is obtained by being calculated by the encoding rate control unit of the current block, and the quantization parameter of the current block is the quantization parameter of the encoding rate control unit of the current block. For the video encoding / decoding device to perform encoding / decoding on the current block based on the quantization parameter of the current block includes determining the quantization parameter of the encoding / decoding unit of the current block based on the quantization parameter of the encoding rate control unit, and performing encoding / decoding on the current block based on the quantization parameter of the encoding unit. Among them, when encoding the current block, the above encoding / decoding unit is the encoding unit, and when decoding the current block, the above encoding / decoding unit is the decoding unit.

[0293] It can be understood that the coding rate control module calculates by the coding rate control unit when determining the quantization parameter. If the size of the coding rate control unit is larger than the size of the basic coding unit (quantization unit), it means that multiple basic coding units use the same quantization parameter. If the size of the coding rate control unit is equal to the size of the quantization unit, a one-to-one corresponding quantization parameter can be obtained. If the size of the coding rate control unit is smaller than the size of the quantization unit, it means that one quantization unit corresponds to multiple quantization parameters. At this time, in order for the quantization unit to determine the final quantization parameter based on the multiple quantization parameters, some strategy needs to be used.

[0294] In the first possible implementation manner, the video encoding / decoding device divides the quantization unit based on the coding rate control unit, that is, makes multiple quantization parameters correspond to multiple quantization units one-to-one.

[0295] In the second possible implementation manner, multiple quantization parameters are weighted or the minimum value is selected to obtain one quantization parameter and make it correspond to the one quantization unit.

[0296] In the third possible implementation manner, multiple quantization parameters are integrated based on the complexity information and the buffer area state. Exemplarily, quantization parameters with similar complexity information are integrated into one, and the similar complexity information may be multiple complexity information that satisfies a specific difference range.

[0297] According to the above possible implementation manners, the quantization parameter of the coding unit of the current block is determined based on the quantization parameter of the coding rate control unit. In this way, the quantization parameter of the coding block can be matched with the coding rate control strategy, and the encoding / decoding result takes into account the quality of the image while considering the requirements of the coding rate control, improving the encoding / decoding efficiency.

[0298] The above integration method may be to obtain one quantization parameter by weighting similar quantization parameters, or to select the minimum value among similar quantization parameters as the integrated quantization parameter.

[0299] For one or more integrated quantization parameters, a plurality of quantization units corresponding to the quantization parameters may be further obtained by the above first possible implementation method, or one quantization parameter corresponding to one quantization unit may be further obtained by the above second possible implementation method, but it is not limited thereto.

[0300] It can be understood that in step S603, the video encoding / decoding device encodes or decodes the current block based on the quantization parameter.

[0301] Optionally, during encoding, the video encoder encodes the complexity information of the current block into the code stream, or encodes the quantization parameter of the current block into the code stream. Correspondingly, on the decoding side, the complexity information in the code stream is obtained, the quantization parameter is calculated for decoding, or on the decoding side, the quantization parameter in the code stream is obtained for decoding. Of course, the video encoder may also encode both of the above information into the code stream.

[0302] In addition, when the video encoder encodes the complexity information of the current block into the code stream, the video decoder correspondingly obtains the complexity information and calculates the quantization parameter. However, the video decoder does not necessarily need to update other parameters using the complexity information. Exemplarily, the method of determining the above target_cost is related to performing updates based on the complexity information of the current block. However, when specifically implemented, the result of updating based on complexity may be different from the result of updating based on historical information (for example, the number of bits occupied by the encoded / decoded image block and the quantization parameter of the encoded / decoded image block). At this time, the original parameter update method is maintained without using the method of updating the parameter using the complexity information.

[0303] Calculating the complexity information of the current block by the above method helps to more accurately determine the encoding / decoding parameters for the current block, such as the quantization parameter, thereby improving the encoding / decoding efficiency of the image.

[0304] Optionally, the code stream obtained by the above encoding / decoding method may perform the following code stream grouping method before being encoded into the code stream.

[0305] Among them, as can be seen from the description of the above slices, the image may be divided into a plurality of slices based on the width (image_width) and height (image_height) of the image. image_width is used to specify the width of the luminance component of the image, that is, the number of samples in the horizontal direction, which is a 16-bit unsigned integer. The unit of image_width should be the number of samples per line of the image. The sample at the upper left corner of the displayable area should be aligned with the sample at the upper left corner of the decoded image. The value of ImageWidth is equal to the value of image_width. The value of ImageWidth should not be 0 and should be an integer multiple of 16. image_height is used to specify the height of the luminance component of the image, that is, the number of scanning lines in the vertical direction, which is a 16-bit unsigned integer. The unit of image_height should be the number of lines of image samples. The value of ImageHeight is equal to the value of image_height. The value of ImageHeight should not be 0 and should be an integer multiple of 2.

[0306] Since a slice is a fixed rectangular area in the image, it is also called a rectangular slice, includes parts of several coding units in the image, and slices do not overlap each other. The splitting method is not limited, but it may be further split into CUs based on slices. Among them, when splitting slices based on the image, in order to split into an integer number of slices, it may be necessary to adjust the current width or height of the image. As shown in the schematic diagram of the image boundary provided by FIG. 13a, real_width is the actual width of the image, and real_height is the actual height of the image, that is, it indicates the boundary of the image displayable area. In order to split the slice, by adaptively increasing the width and height of the image, image_width and image_height in the figure are obtained.

[0307] A slice has a width (slice_width) and a height (slice_height). For example, as shown in the schematic diagram of the slice provided in FIG. 13b, SliceNum X represents the number of slices in the horizontal direction of one image, and SliceNum Y represents the number of slices in the vertical direction of one image.

[0308] In the method of code stream grouping, the length of the code stream of each slice is fixed, among which the length of the R - 1 previous chunks is fixed, but the length of the last chunk is not fixed. FIGS. 14a and 14b are flowcharts showing the code stream grouping method on the encoding side and the decoding side respectively.

[0309] FIG. 14a is a flowchart of the code stream grouping method on the encoding side according to an embodiment of the present invention, and includes steps S1401a - S1406a.

[0310] In S1401a, the image is divided into sliceNumX * sliceNumY rectangular slices in the horizontal and vertical directions.

[0311] By dividing the image in the horizontal and vertical directions, sliceNumX rectangular slices are obtained in the horizontal direction and sliceNumY rectangular slices are obtained in the vertical direction. The above - mentioned image refers to the image to be processed. After dividing the image to be processed in the horizontal and vertical directions in this way, horizontal slices and vertical slices can be obtained, and thereby the above - mentioned sliceNumX and sliceNumY, that is, the first number of slices and the second number of slices, can be obtained.

[0312] In S1402a, the total resources are calculated and the number of chunks chunkNum of each slice is determined.

[0313] total_resoure refers to the resources occupied by the slice calculated based on the number of bits required for each pixel point.

[0314] total_resourec = ((slice_width × slice_height × target_pixel_depth (target_bpp) + 7) >> 3) << 3.

[0315] Determine the number of chunks (chunkNum) based on the total resource total_resource.

[0316] TIFF2025520149000025.tif973

[0317] Among them, n = total_resoure % size == 0? 0 : 1, where size is an integer multiple of 8. For example, size = target_bpp × 32 × block_num.

[0318] Among them, block_num is a preset configuration parameter, and block_num is an integer multiple of 4.

[0319] In S1403a, encode the sliceNumX slices in each slice row in sequence to generate sliceNumX bitstream buffer areas.

[0320] Among them, the bitstream buffer area may be represented by slicebuffer[sliceNumX], and the bitstream buffer area may be padded with zeros and byte-aligned.

[0321] In this step, encoding each slice is understood as encoding each image block in the slice according to the solution according to the above embodiment and obtaining the encoded data of each image block in the slice.

[0322] In S1404a, further divide each bitstream buffer area into N bit chunks, where the length of the N - 1 previous chunks is the first value, and the length of the last chunk is the second value.

[0323] In this step, the above bit chunk may be referred to as a code stream chunk. The above N represents the number of chunks, that is, the above chunkNum.

[0324] Specifically, each bit stream buffer area is further divided into chunkNum chunk chunks. The calculation method of chunksize is as follows. The length of the chunk before the (chunkNum - 1)-th chunk is chunksize = size1, and the length of the last chunk is size2, where size1 = size and size2 = total_resouce - (chunkNum - 1)×size. Among them, the first numerical value may be size1, and the second numerical value may be size2.

[0325] In S1405a, each bit chunk of sliceNumX slices is interleaved and encoded in sequence to form a final bit stream.

[0326] For sliceNum slices in one slice row, encoding is performed chunkNum times in sequence, and each time the chunk chunks of each slice are interleaved to form a final code stream.

[0327] In S1406a, it is determined whether the encoding of the slice is completed. If not, return to S1403a to encode the next slice row.

[0328] FIG. 14b is a flowchart of a code stream grouping method on the decoding side according to an embodiment of the present invention. As shown in FIG. 14b, it includes steps S1401b - S1406b.

[0329] In S1401b, the image is divided into sliceNumX*sliceNumY rectangular slices in the horizontal and vertical directions.

[0330] Since this step is the same as step S1401a described above, the first slice number of the horizontal slices and the second slice number of the vertical slices in the image can be obtained. Similarly, in this step, the above-mentioned image is the image to be processed.

[0331] Until decoding is completed on the decoding side, the decoding side cannot obtain the image to be processed itself. Therefore, in this step, based on the video header information or image header information in the received code stream, the actual image width and actual image height of the image to be processed are obtained, and further, based on the actual image width and actual image height, the above-mentioned sliceNumX (the first slice number) and sliceNumY (the second slice number) are calculated.

[0332] Of course, the above-mentioned sliceNumX and sliceNumY may be directly obtained from the video header information or image header information in the code stream.

[0333] In S1402b, the total resources are calculated, and the number of chunks chunkNum for each slice is determined.

[0334] This step is the same as step S1402a described above.

[0335] In S1403b, the code stream is received, and the code stream chunks of sliceNumX slices in each slice row are sequentially analyzed, and the code stream of each chunk is deinterleaved into the bitstream buffer area of each slice. Among them, the length of the N - 1 previous chunks is the first numerical value, and the length of the last chunk is the second numerical value.

[0336] On the decoding side, the code stream may be received continuously. Of course, all the code streams to be decoded may also be directly obtained.

[0337] The number of code stream chunks in each slice is the above-mentioned chunkNum.

[0338] During deinterleaving, in units of slices, code stream chunks of each slice are deinterleaved, and the result of deinterleaving is stored in the bitstream buffer area under the said conditions.

[0339] Optionally, receive the code stream, analyze it in sequence for chunkNum times, and deinterleave the slicenumX code stream chunks analyzed each time into the code stream buffer area of each slice. The calculation method of chunksize is as follows. The length of the chunk that is chunkNum - 1 before is chunksize = size1, and the length of the last chunk is size2, where size1 = size and size2 = total_resouce - (chunkNum - 1)×size.

[0340] In S1404b, each slice is decoded by the bitstream buffer area of each slice.

[0341] In S1405b, the reconstructed image of each rectangular slice is obtained.

[0342] In S1406b, it is judged whether the analysis of the code stream of the slice is completed. If not, return to S1403b and analyze the next slice row in sequence.

[0343] As shown in the schematic diagram of chunk interleaving by the code stream grouping method provided by FIG. 15, when sliceNumX is 2, a schematic diagram of chunk interleaving by the above code stream grouping method is shown.

[0344] Among them, chunk R in FIG. 15 represents the R-th chunk. The length of the R-th chunk is not fixed, but the lengths of the other R - 1 chunks are fixed. In the same figure, size 1 represents the lengths of the other R - 1 chunks, and size 2 represents the length of the R-th chunk.

[0345] The code streams represented by (c) in FIG. 15 are grouped according to size 1 and size 2 respectively. If size 1 is smaller than size 2, a schematic diagram of the interleaving of the grouped chunks is shown in (a) of FIG. 15. If size 1 is larger than size 2, a schematic diagram of the interleaving of the grouped chunks is shown in (b) of FIG. 15.

[0346] In other code stream grouping methods, the length of the code stream of each slice is fixed. Among them, the length of the r-th chunk is not fixed, but the lengths of the other r - 1 chunks are fixed. FIGS. 16a and 16b are flowcharts showing the code stream grouping method on the encoding side and the decoding side respectively.

[0347] FIG. 16a is a flowchart of the code stream grouping method on the encoding side. As shown in FIG. 16a, it includes steps S1601a - S1606a.

[0348] In S1601a, the image is divided into sliceNumX * sliceNumY rectangular slices in the horizontal and vertical directions.

[0349] This step is the same as step S1401a above.

[0350] In S1602a, the total resources are calculated and the number of chunks chunkNum for each slice is determined.

[0351] This step is the same as step S1402a above.

[0352] In S1603a, the sliceNumX slices in each slice row are encoded in sequence to generate slicenumX bit stream buffer areas.

[0353] In S1604a, the bitstream buffer area of each slice is further divided into N bit chunks, the length of the Kth chunk is a first numerical value, and the lengths of the other N - 1 chunks are a second numerical value.

[0354] In this step, the above bit chunks may be called code stream chunks. The above N represents the number of chunks, that is, the above chunkNum.

[0355] For example, each bitstream buffer area may be divided into chunkNum chunk chunks, and the length chunksize of each chunk is not fixed. The first numerical value may be size1, and the second numerical value may be size2. Among them, the calculation method of chunksize is as follows. The length of the kth chunk is size1, and the lengths of the other chunkNum - 1 chunks are chunksize = size2, where size2 = size and size1 = total_resouce - (chunkNum - 1)×size, and the value range of k is 1~chunkNum.

[0356] In S1605a, interleaving and encoding are performed in sequence on each bit chunk of sliceNumX slices to form a final bitstream.

[0357] For sliceNum slices in one slice row, encoding is performed chunkNum times in sequence, and in each time, the chunk chunks of each slice are interleaved to form a final code stream.

[0358] In S1606a, it is determined whether the encoding of the slice is completed. If not, return to S1603a to encode the next slice row.

[0359] Figure 16b is a flowchart of the code stream grouping method on the decoding side. As shown in Figure 16b, it includes steps S1601b - S1606b.

[0360] In S1601b, the image is divided into sliceNumX * sliceNumY rectangular slices in the horizontal and vertical directions.

[0361] This step is the same as the above step S1401b.

[0362] In S1602b, the total resources are calculated and the number of chunks chunkNum for each slice is determined.

[0363] This step is the same as the above step S1402b.

[0364] In S1603b, a code stream is received, the code stream chunks of the sliceNumX slices in each slice row are sequentially analyzed, the code stream of each chunk is deinterleaved into the bitstream buffer area of each slice, among which, the length of the Kth chunk is the first numerical value, and the lengths of the other N - 1 chunks are the second numerical value.

[0365] A code stream is received, and for the sliceNumX slices in each slice row, it is analyzed chunkNum times in sequence, and the slicenumX code stream chunks analyzed each time are deinterleaved into the code stream buffer area of each slice. The calculation method of chunksize is as follows. The length of the kth chunk is size1, and the lengths of the other chunkNum - 1 chunks are chunksize = size2. Among them, size2 = size, size1 = total_resouce - (chunkNum - 1)×size, and the value range of k is 1~chunkNum.

[0366] In S1604b, each slice is decoded by the bitstream buffer area of each slice.

[0367] In S1605b, the reconstructed image of each rectangular slice is obtained.

[0368] In S1606b, it is determined whether the analysis of the code stream of the slice is completed. If not, it returns to S1603b and sequentially analyzes the next slice line.

[0369] As shown in the schematic diagram of the chunk interleaving by the code stream grouping method provided by FIG. 17, when sliceNumX is 2, it shows the schematic diagram of the chunk interleaving of the other code stream grouping methods described above.

[0370] Among them, chunk r in FIG. 17 represents the r-th chunk, and chunk R represents the R-th chunk. The length of the r-th chunk is not fixed, but the lengths of the other R - 1 chunks are fixed. In the same figure, size 1 represents the lengths of the other R - 1 chunks, and size 2 represents the length of the r-th chunk.

[0371] The code streams represented by FIG. 17(c) are grouped according to size 1 and size 2 respectively. When size 1 is smaller than size 2, the schematic diagram of the interleaving of the grouped chunks is shown in FIG. 17(a). When size 1 is larger than size 2, the schematic diagram of the interleaving of the grouped chunks is shown in FIG. 17(b).

[0372] In addition, the forms not specifically described in the above solution can be executed on the decoding side or the encoding side.

[0373] In addition, when there is no conflict, some or all of the above-mentioned multiple implementation methods can form a new implementation method.

[0374] Embodiments of the present invention provide a video encoding / decoding device, which may be a video encoding / decoding device, or a video encoder, or a video decoder. Specifically, the video encoding / decoding device is for executing the steps executed by the video encoding / decoding device in the above video encoding / decoding method. The video encoding / decoding device according to the embodiments of the present invention may include a module corresponding to the corresponding step.

[0375] Embodiments of the present invention may divide the video encoding / decoding device into functional modules according to the above methods and examples. For example, it may be divided into functional modules corresponding to each function, or two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules. In the embodiments of the present invention, the division of modules is schematic and is merely a logical function division, and there may be other division methods in actual implementation.

[0376] When dividing into functional modules corresponding to each function, FIG. 18 is a schematic configuration diagram of a video encoding / decoding device according to an embodiment of the present invention. As shown in FIG. 18, the video encoding / decoding device 180 includes an acquisition module 1801, a determination module 1802, and an encoding / decoding module 1803.

[0377] The acquisition module 1801 is for acquiring the complexity information of the current block in the image to be processed. The complexity information of the current block is obtained by calculating at least one angular gradient of the current block based on at least the pixel values of the current block, for example, corresponding to the above step S601.

[0378] The determination module 1802 is for determining the quantization parameter of the current block based on the complexity information of the current block, for example, corresponding to the above step S602.

[0379] The symbolization / decryption module 1803 is for symbolizing / decrypting the current block based on quantization parameters, and corresponds to, for example, step S603 described above.

[0380] In an example, the acquisition module 1801 specifically calculates at least one angular gradient of the current block based on the pixel value of the current block and the reconstructed value of the symbolized / decrypted pixel value of the current block, and is used to obtain the complexity information of the current block based on at least one angular gradient of the current block.

[0381] In an example, the acquisition module 1801 specifically calculates at least one angular gradient of the current block based on the pixel value of the current block and the pixel values of the blocks adjacent to the current block in the image to be processed, and is used to obtain the complexity information of the current block based on at least one angular gradient of the current block.

[0382] In an example, the acquisition module 1801 specifically obtains the prediction angle used in the angle prediction mode of the current block, calculates the angular gradient based on the prediction angle, obtains the corresponding complexity information, and is used to set the corresponding complexity information as the complexity information of the current block.

[0383] In an example, the current block is an N-channel image block, and the acquisition module 1801 specifically obtains the complexity information of each channel image block based on the pixel values of each channel image block in the N-channel image block, where N is an integer greater than zero, and is used to determine the complexity information of the current block based on the complexity information of each channel image block.

[0384] In one example, the acquisition module 1801 specifically divides each channel image block into at least two sub-blocks, determines the complexity information of at least two sub-blocks of each channel image block, and is used to determine the complexity information of the corresponding channel image block in each channel image block based on the complexity information of at least two sub-blocks of each channel image block.

[0385] In one example, the acquisition module 1801 is specifically used to determine the minimum value in the complexity information of at least two sub-blocks of each channel image block as the complexity information of the corresponding channel image block.

[0386] In one example, the acquisition module 1801 is specifically used to determine the minimum value in the complexity information of each channel image block as the complexity information of the current block.

[0387] In one example, the acquisition module 1801 specifically determines the complexity level of each channel image block based on the complexity information of each channel image block, and is used to determine the complexity information of the current block based on the complexity level of each channel image block.

[0388] In one example, the determination module 1802 specifically determines the reference quantization parameter of the current block based on the complexity information of the current block, and is used to determine the quantization parameter of the current block based on the reference quantization parameter of the current block.

[0389] In an example, when the video encoding / decoding method is a video encoding method, the determination module 1802 specifically obtains the buffer area state of the image to be processed. The buffer area state is for representing the number of occupied bits of the encoded image block in the image to be processed in the buffer area. Among them, the buffer area is for controlling the output of the code stream of the image to be processed at a uniform speed. Based on the correspondence between the buffer area state and the complexity information of the current block, it is used to determine the reference quantization parameter of the current block.

[0390] In an example, the determination module 1802 is specifically used to determine the complexity level of the current block. Based on the complexity level of the current block, the corresponding target bits are determined. The target bits are the number of bits that the current block occupies in the code stream. Based on the target bits, the reference quantization parameter of the current block is obtained.

[0391] In an example, the determination module 1802 specifically determines a weight coefficient based on the complexity information of the current block. The weight coefficient is for adjusting the quantization parameter of the current block based on the degree of complexity of the current block. Based on the weight coefficient and the reference quantization parameter of the current block, it is used to determine the quantization parameter of the current block.

[0392] In an example, the complexity information of the current block is obtained by being calculated by the encoding rate control unit of the current block. The encoding rate control unit is the basic processing unit for calculating the complexity information of the current block. If the quantization parameter of the current block is the quantization parameter of the encoding rate control unit of the current block, the encoding / decoding module 1803 specifically determines the quantization parameter of the encoding / decoding unit of the current block based on the quantization parameter of the encoding rate control unit, and is used to encode / decrypt the current block based on the quantization parameter of the encoding / decoding unit.

[0393] Among them, all relevant contents of each step regarding the embodiments of the above method can all be incorporated by reference to the descriptions of the functions of the corresponding functional blocks, and the descriptions are omitted here.

[0394] Of course, the video encoding / decoding device according to the embodiments of the present invention includes the above modules, but is not limited thereto. For example, the video encoding / decoding device may further include a storage module 1804.

[0395] The storage module 1804 is for storing the program code and data of the video encoding / decoding device.

[0396] Embodiments of the present invention also provide a video decoder including a processor and a memory.

[0397] Instructions executable by the processor are stored in the memory.

[0398] When the processor executes the instructions, it is configured to cause the video decoder to implement the video image decoding method in the above embodiments.

[0399] Embodiments of the present invention also provide a video encoder including a processor and a memory.

[0400] Instructions executable by the processor are stored in the memory.

[0401] When the processor executes the instructions, it is configured to cause the video encoder to implement the video image encoding method in the above embodiments.

[0402] Embodiments of the present invention also provide a video encoding and decoding system including a video encoder and a video decoder. The video encoder is for executing any of the video encoding / decoding methods according to the above embodiments, and the video decoder is for executing any of the video encoding / decoding methods according to the above embodiments.

[0403] Embodiments of the present invention also provide an electronic device, which includes the above video encoding / decoding device 180, and the video encoding / decoding device 180 executes a method executed by any of the video encoding / decoding apparatuses provided in the above description.

[0404] Embodiments of the present invention provide a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute a method executed by any of the video decoders provided in the above description.

[0405] For any of the computer-readable storage media provided above, for the description of related content and the description of beneficial effects, reference may be made to the above corresponding implementation manners, so the description is omitted here.

[0406] Embodiments of the present invention also provide a chip. In the chip, a control circuit and one or more ports for realizing the functions of the above video encoding / decoding device 100 are integrated. Optionally, the functions that can be supported by the chip may refer to the above description, which is omitted here. Those skilled in the art should understand that all or part of the steps for realizing the above implementation method may also be instructed to related hardware by a program. The above program may be stored in a computer-readable storage medium. The above storage medium may be a read-only memory, a random access memory, etc. The above processing unit or processor may be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a digital signal processor (DSP), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.

[0407] Embodiments of the present invention provide a computer program product including instructions, which, when executed on a computer, cause the computer to execute any of the methods in the above embodiments. The computer program product includes one or more computer instructions. Loading and executing the instructions of the computer program causes all or part of them to implement the flow or functions of the embodiments of the present invention. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium accessible by the computer, or may be a data storage device such as a server or data center in which one or more available media are integrated. The available medium may be a magnetic medium (such as a floppy disk, hard disk, tape), an optical medium (such as a DVD), or a semiconductor medium (such as an SSD), etc.

[0408] It should be noted that the devices for storing the above computer instructions or computer programs according to the embodiments of the present invention are, for example, the above-mentioned memory, computer-readable storage medium, communication chip, etc., which have non-transitory property and are not limited thereto.

[0409] In the above embodiments, all or part of them can be realized by software, hardware, firmware, or any combination thereof. When realized using a software program, all or part of it is realized in the form of a computer program product. The computer program product includes one or more computer instructions. When the instructions of the computer program are loaded and executed on a computer, all or part of them realize the flow or function of the embodiments of the present invention. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or may be transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium accessible by a computer, or may be a data storage device such as a server or data center in which one or more available media are integrated. The available medium may be a magnetic medium (such as a floppy disk, hard disk, tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state drive (SSD), etc.).

[0410] Here, the present invention has been described with reference to each embodiment. However, in the process of implementing the claimed scope of the claims, those skilled in the art can understand and implement other changes to the disclosed embodiments by referring to the drawings, the disclosure content, and the scope of the claims. In the claims, the term "comprising" does not exclude other components or steps, and "a" or "one" does not exclude multiple cases. A single processor or other unit can implement several functions listed in the scope of the claims. Although several measures are described in different dependent claims, this does not mean that these measures cannot produce good effects when combined.

[0411] The present invention has been described with reference to specific features and their embodiments. However, it is obvious that various modifications and combinations are possible without departing from the spirit and scope of the present invention. Accordingly, the present specification and the drawings are merely exemplary descriptions of the present invention defined by the scope of the claims, and are considered to include any and all modifications, changes, combinations, or equivalents within the scope of the present invention. Obviously, those skilled in the art can make various changes and deformations to the present invention without departing from the spirit and scope of the present invention. In this way, these changes and deformations of the present invention are included in the present invention if they are within the scope of the claims of the present invention and the scope of equivalent technologies. The above description is a preferred embodiment of the present invention and does not limit the present invention. Modifications, equivalent substitutions, improvements, etc. made within the scope of the spirit and principle of the present invention should be included within the protection scope of the present invention.

Claims

1. A video image decoding method applied to the decoding side, comprising: obtaining complexity information of a current block in a processing target image; determining a quantization parameter of the current block based on the complexity information of the current block; decoding the current block based on the quantization parameter, wherein the video image decoding method is characterized by the above.

2. The current block is an N-channel image block, and obtaining the complexity information of the current block in the processing target image includes: obtaining pixel values of the current block in the processing target image, where the pixel values of the current block include pixel values of each channel image block in the N-channel image block, the N-channel image block includes at least a luminance channel image block and a chrominance channel image block, and N is an integer greater than 0; obtaining complexity information of each channel image block based on the pixel values of each channel image block in the N-channel image block, where N is an integer greater than 0; obtaining the complexity information of the current block based on the complexity information of each channel image block, wherein the video image decoding method is characterized by the above and is as claimed in claim 1.

3. Determining the quantization parameter of the current block based on the complexity information of the current block includes: determining a reference quantization parameter of the current block based on the complexity information of the current block; determining the quantization parameter of the current block based on the reference quantization parameter of the current block, wherein the video image decoding method is characterized by the above and is as claimed in claim 1.

4. Decoding the current block based on the quantization parameter includes: inversely quantizing the current block based on the quantization parameter of the current block and obtaining transform coefficients after inverse quantization of the current block; inversely transforming the transform coefficients after inverse quantization of the current block and obtaining a residual block after inverse transformation; obtaining the current block after decoding based on the residual block after inverse transformation, wherein the video image decoding method is characterized by the above and is as claimed in any one of claims 1 to 3.

5. After the step of decoding the current block based on the quantization parameter, further, To obtain the number n of code stream chunks divided for each slice in the image to be processed, where n is a positive integer, To de-interleave the code stream chunks corresponding to each slice in each slice row of the code stream and obtain n code stream chunks corresponding to each slice, where the n code stream chunks include at least two sizes and at least one size is an integer multiple of 8, The video image decoding method according to any one of claims 1 to 3, characterized by the above.

6. Obtaining the n code stream chunks divided for each slice in the image to be processed Obtaining the slice width and slice height of each slice in the image to be processed Determining the target transmission bit number based on the slice width, slice height, and target occupied bits per pixel, and determining the number of the code stream chunks based on the target transmission bit number and the chunk size value, The video image decoding method according to claim 5, characterized by the above.

7. The chunk size value is derived based on the number of encoding units in the code stream chunk, the encoding unit size, and the target pixel depth, and the chunk size value is an integer multiple of 8. The video image decoding method according to claim 6, characterized by the above.

8. De-interleaving the code stream chunks corresponding to each slice in each slice row of the code stream and obtaining n code stream chunks corresponding to each slice Based on the horizontal direction of each slice row in the code stream, sequentially de-interleaving the code stream chunks corresponding to X slices in the same slice row and obtaining n code stream chunks corresponding to each slice in the X slices, where X is a positive integer. The video image decoding method according to claim 6 or 7, characterized by the above.

9. When the length of the actual encoded bit number is fixed, for the code stream chunks of the number of the code stream chunks, the lengths of the code stream chunks other than the k-th code stream chunk are all of the first size, the length of the k-th code stream chunk is of the second size, the first size is an integer multiple of 8, the second size is determined based on the target transmission bit number, the first size, and the n code stream chunks, and k is a positive integer greater than 0 and less than or equal to n. The video image decoding method according to claim 6 or 7, characterized in that.

10. The k-th code stream chunk is the last code stream chunk among all the code stream chunks. The video image decoding method according to claim 9, characterized in that.

11. A video image encoding method applied to the encoding side, acquiring complexity information of a current block in a processing target image, wherein the complexity information of the current block is obtained by calculating at least one angular gradient of the current block based on at least pixel values of the current block, determining a quantization parameter of the current block based on the complexity information of the current block, encoding the current block based on the quantization parameter, and including. A video image encoding method, characterized in that.

12. Acquiring the complexity information of the current block in the processing target image is calculating at least one angular gradient of the current block based on the pixel value of the current block and the reconstructed value of the pixel value after encoding of the current block, and acquiring the complexity information of the current block based on at least one angular gradient of the current block, and including. The video image encoding method according to claim 11, characterized in that.

13. Acquiring the complexity information of the current block in the processing target image is calculating at least one angular gradient of the current block based on the pixel value of the current block and the pixel values adjacent to the current block in the processing target image, and acquiring the complexity information of the current block based on at least one angular gradient of the current block, and including. The video image encoding method according to claim 11, characterized in that...

14. Obtaining the complexity information of the current block in the image to be processed includes: Obtaining the prediction angle used in the angle prediction mode of the current block; Calculating an angle gradient based on the prediction angle and obtaining corresponding complexity information; Using the corresponding complexity information as the complexity information of the current block. The video image encoding method according to claim 11, characterized in that...

15. The prediction mode of the current block includes a first prediction mode and a second prediction mode, and corresponding complexity information is preset for each of the first prediction mode and the second prediction mode. Obtaining the complexity information of the current block in the image to be processed includes: Obtaining prediction results by the first prediction mode and the second prediction mode; Determining an optimal prediction mode from the prediction results based on the rate-distortion cost; Using the complexity information of the optimal prediction mode as the complexity information of the current block. The video image encoding method according to claim 11, characterized in that...

16. Obtaining the complexity information of the current block in the image to be processed includes: Obtaining the complexity information of the current block based on a weighted value of the complexity information calculated by the at least one angle gradient. The video image encoding method according to claim 11, characterized in that...

17. When the current block is an N-channel image block, obtaining the complexity information of the current block in the image to be processed includes: Obtaining the complexity information of each channel image block based on the pixel values of each channel image block in the N-channel image block; Obtaining the complexity information of the current block based on the complexity information of each channel image block, where N is an integer greater than 0. The video image encoding method according to any one of claims 11 to 16, characterized in that...

18. Based on the pixel values of each channel image block in the N-channel image block, obtaining the complexity information of each channel image block includes: Dividing each channel image block into at least two sub-blocks. ​ determining complexity information of at least two sub-blocks of each of the channel image blocks; determining complexity information of a corresponding channel image block based on the complexity information of at least two sub-blocks of each of the channel image blocks, The video image encoding method according to claim 17, characterized in that.

19. Determining the complexity information of the corresponding channel image block based on the complexity information of at least two sub-blocks of each of the channel image blocks includes: obtaining complexity information of a corresponding channel image block based on weighted values of the complexity information of the at least two sub-blocks. The video image encoding method according to claim 18, characterized in that.

20. Determining the complexity information of the current block based on the complexity information of each of the channel image blocks includes: determining a complexity level of each of the channel image blocks based on the complexity information of each of the channel image blocks; determining the complexity information of the current block based on the complexity level of each of the channel image blocks. The video image encoding method according to any one of claims 11 to 16, characterized in that.

21. Determining the quantization parameter of the current block based on the complexity information of the current block includes: determining a reference quantization parameter of the current block based on the complexity information of the current block; determining the quantization parameter of the current block based on the reference quantization parameter of the current block. The video image encoding method according to any one of claims 11 to 16, characterized in that.

22. After the step of encoding the current block based on the quantization parameter, further: obtaining a number n of code stream chunks divided for each slice in the image to be processed, where the n code stream chunks include at least two sizes, at least one size is an integer multiple of 8, and n is a positive integer; interleaving code stream chunks corresponding to each slice in each slice row of the image to be encoded to obtain a code stream. The video image encoding method according to any one of claims 11 to 16, characterized in that.

23. Obtaining n code stream chunks divided for each slice in the image to be processed includes: obtaining the slice width and slice height of each slice in the image to be processed; determining a target transmission bit number based on the slice width, the slice height, and the target occupancy bits per pixel, and determining the number of the code stream chunks based on the target transmission bit number and a chunk size value; The video image encoding method according to claim 22, characterized in that.

24. The chunk size value is derived based on the number of encoding units in the code stream chunk, the encoding unit size, and the target pixel depth, and the chunk size value is an integer multiple of 8. The video image encoding method according to claim 23, characterized in that.

25. Interleaving the code stream chunks corresponding to each slice in each slice row of the image to be encoded to obtain a code stream includes: based on the horizontal direction of each slice row, sequentially interleaving the code stream chunks corresponding to X slices in the same slice row to obtain a code stream, where X is a positive integer. The video image encoding method according to claim 22 or 23, characterized in that.

26. When the length of the actual encoded bit number is fixed, for the code stream chunks of the number of the code stream chunks, the lengths of other code stream chunks except the k-th code stream chunk are all of a first size, the length of the k-th code stream chunk is of a second size, the first size is an integer multiple of 8, the second size is determined based on the target transmission bit number, the first size, and the n code stream chunks, and k is a positive integer greater than 0 and less than or equal to n. The video image encoding method according to claim 22 or 23, characterized in that.

27. The k-th code stream chunk is the last code stream chunk among all the code stream chunks. The video image encoding method according to claim 26, characterized in that.

28. A video decoding apparatus, comprising: an acquisition module for acquiring complexity information of a current block in an image to be processed; A determination module for determining a quantization parameter of the current block based on the complexity information of the current block; A decoding module for decoding the current block based on the quantization parameter, and comprising: A video decoding apparatus characterized by the above.

29. A video encoding apparatus, comprising: An acquisition module for acquiring complexity information of a current block in an image to be processed, wherein the complexity information of the current block is acquired by calculating at least one angular gradient of the current block based on at least pixel values of the current block; A determination module for determining a quantization parameter of the current block based on the complexity information of the current block; An encoding module for encoding the current block based on the quantization parameter, and comprising: A video encoding apparatus characterized by the above.

30. A video decoder, comprising a processor and a memory, Instructions executable by the processor are stored in the memory, When the processor executes the instructions, the video decoder is configured to implement the video image decoding method according to any one of Claims 1 to 10. A video decoder characterized by the above.

31. A video encoder, comprising a processor and a memory, Instructions executable by the processor are stored in the memory, When the processor executes the instructions, the video encoder is configured to implement the video image encoding method according to any one of Claims 11 to 27. A video encoder characterized by the above.

32. A video encoding and decoding system, comprising: A video encoder and a video decoder, The video encoder is for executing the video image encoding method according to any one of Claims 11 to 27, and the video decoder is for executing the video image decoding method according to any one of Claims 1 to 10. A video encoding and decoding system characterized by the above.

33. A computer-readable storage medium, A program is stored in the computer-readable storage medium, When the program is executed on a computer, the computer is caused to execute the method according to any one of Claims 1 to 27. A computer-readable storage medium characterized by the above.

34. A computer program product including instructions that, when executed on a computer, cause the computer to execute the steps of the method according to any one of claims 1 to 27. A computer program product including instructions, characterized by the above.

Citation Information

Patent Citations

  • Quantizing method and circuit

    JP1996056360A

  • Moving image encoder, moving image encoding method and moving image encoding program

    JP2013106316A

  • Content adaptive quantization for video coding

    US20190089957A1

  • Image processing device and method

    WO2013031574A1

  • An image coding apparatus and method thereof based on a quantization parameter derivation

    WO2019194422A1