Video decoding method, device and storage medium
By using the bit rate control parameters to calculate the quantization parameters in video decoding, the problem of quantization parameters occupying resources is solved, and the video streaming efficiency and image quality are improved.
Patent Information
- Application Number
- CN202310485423.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2042-01-21
AI Technical Summary
In the existing video decoding technology, quantization parameters occupy more resources in the code stream, affecting the transmission efficiency and resulting in low image transmission efficiency.
By obtaining the code rate control parameters in the image to be decoded, and calculating and determining the quantization parameters can be achieved to achieve video decoding, saving code stream resources, and improving transmission efficiency. Specific methods include obtaining the resource abundance, complexity, predicting bit count, average quantization parameters and quantization parameter change values of the image block, and using these parameters to calculate and update the quantization parameters to ensure the correlation and decoding quality between the image blocks.
It effectively saves code stream resources, improves the transmission efficiency of video code streams, improves image decoding quality, and improves the performance of video transmission.
Smart Images

Figure CN117221564B_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202210074669.X, and the original application date is January 21, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of video decoding technology, and in particular to a video decoding method, device and storage medium. Background Art
[0003] Video coding and decoding technology plays an important role in the field of video transmission and storage. Among them, quantization is a key step in determining image quality during the video coding and decoding process. Quantization mainly reduces data redundancy through quantization parameters, but it may also bring the risk of image distortion. Currently, the quantization parameters used for quantization are written into the bitstream during the video encoding stage, and the video decoding end implements decoding by parsing the quantization parameters in the bitstream. However, the quantization parameters occupy more resources in the bitstream, affecting the transmission efficiency. Summary of the invention
[0004] The embodiments of the present application provide a video decoding method, device and storage medium, which are helpful to save resources in a bit stream and improve the transmission efficiency of the bit stream.
[0005] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0006] In a first aspect, an embodiment of the present application provides a video decoding method, which is applied to a video decoding device or a chip of a video decoding device, and the method includes: obtaining one or more rate control parameters of a current block in an image to be decoded; determining a quantization parameter of the current block based on the one or more rate control parameters; and decoding the current block based on the quantization parameter of the current block.
[0007] Since the quantization parameter occupies more resources in the bitstream and affects the transmission efficiency, the video decoding method proposed in this application is adopted, the decoding end obtains the bitrate control parameter, and the quantization parameter is calculated by the bitrate control parameter to realize decoding, thereby saving resources in the bitstream and improving the efficiency of bitstream transmission.
[0008] In a possible implementation, obtaining one or more rate control parameters of a current block in an image to be decoded includes: obtaining information of the image to be decoded, the information of the image to be decoded including basic information of the image to be decoded and information of an image block in the image to be decoded; and determining one or more rate control parameters of the current block based on part or all of the information of the image to be decoded.
[0009] This possible implementation provides a specific implementation of obtaining the rate control parameter, by obtaining the basic information of the image to be decoded and the information of the image block in the image to be decoded, and calculating the rate control parameter used to generate the quantization parameter. The calculation of the quantization parameter is completed through partial features of the image.
[0010] In a possible implementation, the rate control parameters include resource adequacy of the current block, complexity of the current block, predicted number of bits of the current block, average quantization parameter of the current block and change value of the quantization parameter of the current block; wherein the average quantization parameter is used to characterize the average degree of quantization parameters of decoded image blocks in the image to be decoded, resource adequacy refers to the sufficiency of resources used to store the current block in the resources used to store the image to be decoded, complexity refers to the complexity of the decoded image blocks in the image to be decoded, predicted number of bits refers to the estimated resources occupied by the current block after decoding, and change value of the quantization parameter refers to the change value of the quantization parameter between decoded image blocks in the image to be decoded.
[0011] This possible implementation method provides a variety of rate control parameters, and the various rate control parameters can generate quantization parameters in different ways, thereby improving the feasibility of the solution.
[0012] In a possible implementation, determining the quantization parameter of the current block according to one or more rate control parameters includes: acquiring the rate control parameter of a decoded image block; and determining the quantization parameter of the current block according to the rate control parameter of the decoded image block.
[0013] This possible implementation method provides a specific implementation method for generating a quantization parameter according to a rate control parameter, and determines the quantization parameter of a current block by using the rate control parameter of a decoded image block, which helps to establish correlation between image blocks.
[0014] In a possible implementation, determining a quantization parameter of a current block according to one or more rate control parameters includes: acquiring a quantization parameter of a decoded image block; and determining a quantization parameter of the current block according to the quantization parameter of the decoded image block.
[0015] This possible implementation method provides a specific implementation method for generating a quantization parameter according to a bit rate control parameter, and determines the quantization parameter of a current block by using the quantization parameter of a decoded image block, which helps to establish correlation between image blocks.
[0016] In a possible implementation, after obtaining information of the image to be decoded, the method further includes: calculating the total number of bits of the current block based on the current block information, the total number of bits of the current block being the number of bits occupied after the current block is decoded; determining the number of available bits based on the total number of bits, the number of available bits being the image data for storing the decoded current block, and the number of available bits being used to determine one or more rate control parameters of the current block.
[0017] This possible implementation method provides a specific implementation method for determining the bit rate control parameters according to the information of the image to be decoded. By calculating the number of available bits of the image block, it helps to improve the accuracy of the bit rate control parameters and improve the feasibility of the solution.
[0018] In a possible implementation manner, determining the number of available bits according to the total number of bits includes: removing other bits used for storing non-image data from the total number of bits.
[0019] This possible implementation method provides a specific implementation method for determining the number of available bits, wherein the number of available bits for storing image data is determined by removing some of the other bits for storing non-image data, which helps to improve the accuracy of the bit rate control parameters and improve the feasibility of the solution.
[0020] In a possible implementation manner, the method further includes: initializing an intermediate parameter, where the intermediate parameter is used to determine a quantization parameter of the current block in combination with one or more rate control parameters.
[0021] This possible implementation provides an initialization process for determining an intermediate parameter of a quantization parameter, which helps to generate the quantization parameter.
[0022] In a possible implementation manner, after determining the quantization parameter of the current block according to one or more rate control parameters, the method further includes: modifying the quantization parameter based on the one or more rate control parameters.
[0023] In this possible implementation, a method for correcting the quantization parameter after determining the quantization parameter is provided, which helps to improve the quality of the decoded image.
[0024] In a possible implementation manner, after determining the quantization parameter according to one or more rate control parameters, the method further includes: updating the one or more rate control parameters.
[0025] In this possible implementation, a method for updating the bit rate control parameters is provided, which adaptively adjusts the image blocks in the image to be decoded, and helps to improve the flexibility of the solution application.
[0026] In a second aspect, an embodiment of the present application provides a video decoding device, which has the function of implementing any one of the video decoding methods in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0027] In a third aspect, a video decoding device is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the video decoding device is running, the processor executes the computer execution instructions stored in the memory to enable the video decoding device to perform a video decoding method as described in any one of the first aspects above.
[0028] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer can execute any one of the video decoding methods in the first aspect.
[0029] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any one of the video decoding methods in the first aspect.
[0030] According to a sixth aspect, an electronic device is provided, the electronic device comprising a video decoding device, wherein a processing circuit is configured to execute a video decoding method as described in any one of the first aspects above.
[0031] In a seventh aspect, a chip is provided, comprising a processor, wherein the processor is coupled to a memory, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the video decoding method of any one of the above-mentioned first aspects is implemented.
[0032] The technical effects brought about by any implementation method in the second to seventh aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A system architecture diagram of a coding and decoding system provided in an embodiment of the present application;
[0034] Figure 2 A schematic diagram of the structure of a video encoder provided in an embodiment of the present application;
[0035] Figure 3 A schematic diagram of the structure of a video decoder provided in an embodiment of the present application;
[0036] Figure 4 A schematic diagram of a video decoding process provided by an embodiment of the present application;
[0037] Figure 5 A schematic diagram of the structure of a video decoder provided in an embodiment of the present application;
[0038] Figure 6 A flowchart of a video decoding method provided in an embodiment of the present application;
[0039] Figure 7A schematic diagram of image block position information provided by an embodiment of the present application;
[0040] Figure 8 Schematic diagram of the sigmoid function provided in the embodiment of the present application;
[0041] Fig. 9 A flowchart for determining parameter initialization provided in an embodiment of the present application;
[0042] Fig.10 A schematic diagram of the structure of an encoding device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0044] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0045] First, the technical terms involved in the embodiments of the present application are introduced:
[0046] 1. Video Coding Technology
[0047] Video sequences contain a series of redundant information, including spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. In order to remove redundant information in video sequences as much as possible and reduce the amount of data representing the video, video coding technology is proposed to achieve the effect of reducing storage space and saving transmission bandwidth. Video coding technology is also called video compression technology.
[0048] In the international scope, video compression coding standards, for example: Advanced Video Coding (AVC) in Part 10 of the MPEG-2 and MPEG-4 standards developed by the Motion Picture Experts Group (MPEG), H.263, H.264 and H.265 (also known as High Efficiency Video Coding standard, HEVC) developed by the International Telecommunication Union Telecommunication Standardization Sector (ITU-T).
[0049] It should be noted that in a coding algorithm based on a hybrid coding architecture, the above compression coding methods can be used in a mixed manner.
[0050] The basic processing unit in the video compression encoding process is the image block, which is obtained by dividing a frame / image at the encoding end. Taking HEVC as an example, HEVC defines Coding Tree Unit (CTU), Coding Unit (CU), Prediction Unit (PU) and Transform Unit (TU). CTU, CU, PU and TU can all be used as image blocks obtained after division. Among them, PU and TU are divided based on CU.
[0051] 2. Video sampling
[0052] A pixel is the smallest complete sample of a video or image, so the data processing of an image block is done in units of pixels. Each pixel records color information. One method is to represent color through RGB, including three image channels, R represents red, G represents green, and B represents blue; the other method is to represent color through YUV, including three image channels, Y represents luminance, U represents the first chrominance Cb, and V represents the second chrominance Cr. Since people are more sensitive to brightness than to chrominance, storage space can be reduced by storing more brightness and less chrominance. Specifically, in video encoding and decoding, the YUV format is usually used for video sampling, including 420 sampling format, 444 sampling format, etc. This sampling format determines the number of samples of two chrominances based on the number of samples of brightness. For example, assuming that a CU has 4×2 pixels, the format is as follows:
[0053] [Y0,U0,V0][Y1,U1,V1][Y2,U2,V2][Y3,U3,V3];
[0054] [Y4, U4, V4] [Y5, U5, V5] [Y6, U6, V6] [Y7, U7, V7];
[0055] The 420 sampling format indicates that YUV is sampled in a 4:2:0 format, that is, the brightness and the first chroma or the second chroma are selected in a 4:2 ratio, where the first chroma and the second chroma are selected in alternate lines. The above CU sampling selects the brightness Y0-Y3 of the first row, and the first chroma U0 and U2, and selects the brightness Y4-Y7 of the second row, and the second chroma V4 and V6. The CU is sampled and composed of a brightness coding unit and a chroma coding unit, where the brightness coding unit is:
[0056] [Y0][Y1][Y2][Y3];
[0057] [Y4][Y5][Y6][Y7];
[0058] The chroma coding unit is:
[0059] [U0][U2];
[0060] [V4][V6];
[0061] Similarly, the 444 sampling format indicates that YUV is sampled in a 4:4:4 format, that is, the brightness, the first chroma, and the second chroma are selected in a 4:4:4 ratio. Then the sampled brightness coding unit of the above CU is:
[0062] [Y0][Y1][Y2][Y3];
[0063] [Y4][Y5][Y6][Y7];
[0064] The chroma coding unit is:
[0065] [U0,V0][U1,V1][U2,V2][U3,V3];
[0066] [U4,V4][U5,V5][U6,V6][U7,V7];
[0067] The luminance coding unit and the chrominance coding unit obtained by sampling are used as data units for subsequent encoding processing.
[0068] The decoding method provided in this application is applicable to a video encoding and decoding system. Figure 1 The structure of the video coding system is shown.
[0069] like Figure 1As shown, the video encoding and decoding system includes a source device 10 and a destination device 11. The source device 10 generates encoded video data, and the source device 10 can also be called a video encoding device or a video encoding device. The destination device 11 can decode the encoded video data generated by the source device 10, and the destination device 11 can also be called a video decoding device or a video decoding device. The source device 10 and / or the destination device 11 may include at least one processor and a memory coupled to the at least one processor. The memory may include but is not limited to a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures that can be accessed by a computer, and the present application does not make specific limitations on this.
[0070] The source device 10 and the destination device 11 may include a variety of devices, including electronic devices such as desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, or the like.
[0071] The destination device 11 may receive the encoded video data from the source device 10 via the link 12. The link 12 may include one or more media and / or devices capable of moving the encoded video data from the source device 10 to the destination device 11. In one example, the link 12 may include one or more communication media that enable the source device 10 to transmit the encoded video data directly to the destination device 11 in real time. In this example, the source device 10 may modulate the encoded video data according to a communication standard (e.g., a wireless communication protocol) and may transmit the modulated video data to the destination device 11. The one or more communication media may include wireless and / or wired communication media, such as a radio frequency (RF) spectrum, one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices that enable communication from the source device 10 to the destination device 11.
[0072] In another example, the encoded video data may be output from the output interface 103 to the storage device 13. Similarly, the encoded video data may be accessed from the storage device 13 through the input interface 113. The storage device 13 may include a variety of locally accessible data storage media, such as a Blu-ray disc, a high-density digital video disc (DVD), a compact disc read-only memory (CD-ROM), a flash memory, or other suitable digital storage media for storing encoded video data.
[0073] In another example, the storage device 13 may correspond to a file server or another intermediate storage device storing the encoded video data generated by the source device 10. In this example, the destination device 11 may obtain the video data stored therein from the storage device 13 via streaming or downloading. The file server may be any type of server capable of storing the encoded video data and transmitting the encoded video data to the destination device 11. For example, the file server may include a World Wide Web (Web) server (e.g., for a website), a File Transfer Protocol (FTP) server, a Network Attached Storage (NAS) device, and a local disk drive.
[0074] The destination device 11 can access the encoded video data through any standard data connection (e.g., an Internet connection). Example types of data connections include wireless channels suitable for accessing the encoded video data stored on a file server, wired connections (e.g., cable modems, etc.), or a combination of both. The encoded video data can be transmitted from the file server in the form of streaming, downloading, or a combination of both.
[0075] The decoding method of the present application is not limited to wireless application scenarios. For example, the decoding method of the present application can be applied to video encoding and decoding supporting the following multimedia applications: over-the-air television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (e.g., via the Internet), encoding of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or other applications. In some examples, the video encoding and decoding system can be configured to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and / or video telephony.
[0076] It should be noted that Figure 1The video coding and decoding system shown is only an example of a video coding and decoding system, and is not a limitation of the video coding and decoding system in the present application. The coding and decoding method provided in the present application can also be applied to a scenario where there is no data communication between the coding device and the decoding device. In other examples, the video data to be encoded or the encoded video data can be retrieved from a local memory, or can be streamed over a network, etc. The video coding device can encode the video data to be encoded and store the encoded video data in a memory, and the video decoding device can also obtain the encoded video data from the memory and decode the encoded video data.
[0077] exist Figure 1 , source device 10 includes a video source 101, a video encoder 102, and an output interface 103. In some examples, output interface 103 may include a modulator / demodulator (modem) and / or a transmitter. Video source 101 may include a video capture device (e.g., a camera), a video archive containing previously captured video data, a video input interface for receiving video data from a video content provider, and / or a computer graphics system for generating video data, or a combination of such sources of video data.
[0078] Video encoder 102 may encode video data from video source 101. In some examples, source device 10 transmits the encoded video data directly to destination device 11 via output interface 103. In other examples, the encoded video data may also be stored on storage device 13 for later access by destination device 11 for decoding and / or playback.
[0079] exist Figure 1 In an example of the present invention, the destination device 11 includes a display device 111, a video decoder 112, and an input interface 113. In some examples, the input interface 113 includes a receiver and / or a modem. The input interface 113 can receive the encoded video data via the link 12 and / or from the storage device 13. The display device 111 can be integrated with the destination device 11 or can be external to the destination device 11. In general, the display device 111 displays the decoded video data. The display device 111 can include a variety of display devices, such as a liquid crystal display, a plasma display, an organic light emitting diode display, or other types of display devices.
[0080] Alternatively, the video encoder 102 and the video decoder 112 may each be integrated with an audio encoder and decoder, and may include appropriate multiplexer-demultiplexer units or other hardware and software to handle the encoding of both audio and video in a common data stream or in separate data streams.
[0081] The video encoder 102 and the video decoder 112 may include at least one microprocessor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), discrete logic, hardware, or any combination thereof. If the decoding method provided in the present application is implemented in software, instructions for the software may be stored in a suitable non-volatile computer-readable storage medium, and at least one processor may be used to execute the instructions to implement the present application.
[0082] The video encoder 102 and the video decoder 112 in the present application may operate according to a video compression standard (eg, HEVC), or may operate according to other industry standards, which is not specifically limited in the present application.
[0083] Figure 2 1 is a schematic block diagram of a video encoder 102 in an embodiment of the present application. The video encoder 102 can perform prediction, transformation, quantization and entropy coding processes in the prediction module 21, the transformation module 22, the quantization module 23 and the entropy coding module 24 respectively. The video encoder 102 also includes a pre-processing module 20 and a summer 202, wherein the pre-processing module 20 includes a segmentation module and a bit rate control module. For video block reconstruction, the video encoder 102 also includes an inverse quantization module 25, an inverse transformation module 26, a summer 201 and a reference image memory 27.
[0084] like Figure 2 As shown in , the video encoder 102 receives video data, and the segmentation module in the pre-processing module 20 segments the data into primitive blocks. This segmentation may also include segmentation into slices, image blocks, or other larger units, and (for example) video block segmentation according to a quadtree structure of the largest coding unit (LCU) and CU. Exemplarily, the video encoder 102 encodes components of the video blocks within the video slice to be encoded. In general, the slice can be divided into multiple primitive blocks (and may be divided into a set of primitive blocks called image blocks). The sizes of CU, PU, and TU are usually determined in the segmentation module.
[0085] The bit rate control module in the preprocessing module 20 obtains the sizes of CU, PU and TU, and the input parameters of the video data, wherein the input parameters include the resolution, format, bit width and input bpp of the image in the video data;
[0086] The rate control module generates a rate control parameter according to the input parameter and the image block size, and the rate control parameter is used to generate a quantization parameter so that the quantization module 23 and the inverse quantization module 25 can perform related calculations. The rate control module can also update the rate control parameter according to the reconstructed block obtained by the summer 201 after reconstruction.
[0087] The prediction module 21 may provide the prediction block to the summer 202 to generate a residual block, and provide the prediction block to the summer 201 for reconstruction to obtain a reconstructed block, which is used as a reference pixel for subsequent prediction. The video encoder 102 forms a pixel difference by subtracting the pixel value of the prediction block from the pixel value of the original block. The pixel difference is the residual block, and the data in the residual block may include brightness difference and chrominance difference. The summer 201 represents one or more components that perform this subtraction operation. The prediction module 21 may also send related syntax elements to the entropy coding module 24 for merging into the bitstream.
[0088] The transform module 22 may divide the residual block into one or more TUs for transformation. The transform module 22 may convert the residual block from the pixel domain to the transform domain (e.g., the frequency domain). For example, the residual block may be transformed using a discrete cosine transform (DCT) or a discrete sine transform (DST) to obtain a transform coefficient. The transform module 32 may send the obtained transform coefficient to the quantization module 23.
[0089] Quantization module 23 quantizes the transform coefficients to further reduce the code rate to obtain quantized coefficients. The quantization process can reduce the bit depth associated with some or all of the coefficients. The degree of quantization can be modified by adjusting the quantization parameter. In some possible embodiments, quantization module 23 can then perform a scan of the matrix containing the quantized transform coefficients. Alternatively, entropy coding module 24 can perform the scan.
[0090] After quantization, entropy encoding module 24 may entropy encode the quantized coefficients. For example, entropy encoding module 24 may perform context-adaptive variable-length coding (CAVLC), context-based adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic decoding (SBAC), probability interval partitioning entropy (PIPE) decoding, or another entropy encoding method or technique. After entropy encoding by entropy encoding module 24, the encoded bitstream may be transmitted to video decoder 112 or archived for later transmission or retrieval by video decoder 112.
[0091] The inverse quantization module 25 and the inverse transform module 26 apply inverse quantization and inverse transform respectively, and the summer 201 adds the inverse transformed residual block to the predicted residual block to generate a reconstructed block, which is used as a reference pixel for subsequent prediction of the original block. The reconstructed block is stored in the reference image memory 27.
[0092] Figure 3 1 is a schematic diagram of the structure of the video decoder 112 in the embodiment of the present application. Figure 3 As shown, the video decoder 112 includes an entropy decoding module 30, a prediction module 31, an inverse quantization module 32, an inverse transformation module 33, a summer 301 and a reference image memory 34. The entropy decoding module 30 includes a parsing module and a bit rate control module. In some feasible embodiments, the video decoder 112 may perform Figure 2 The decoding process of the video encoder 102 is an exemplary reciprocal of the encoding process described.
[0093] During the decoding process, the video decoder 112 receives a bitstream of the encoded video from the video encoder 102. The parsing module in the entropy decoding module 30 of the video decoder 112 entropy decodes the bitstream to generate quantized coefficients and syntax elements. The entropy decoding module 30 transfers the syntax elements to the prediction module 31. The video decoder 112 may receive the syntax elements at the video slice level and / or the video block level.
[0094] The rate control module in the entropy decoding module 30 generates a rate control parameter based on the information of the image to be decoded obtained by the parsing module, and the rate control parameter is used to generate a quantization parameter so that the inverse quantization module 32 can perform relevant calculations. The rate control module can also update the rate control parameter based on the reconstructed block obtained by the summer 301 through reconstruction.
[0095] The inverse quantization module 32 inversely quantizes (e.g., dequantizes) the quantization coefficients and the generated quantization parameters provided in the bitstream and decoded by the entropy decoding module 30. The inverse quantization process may include determining the degree of quantization using the quantization parameters calculated by the video encoder 102 for each video block in the video slice, and similarly determining the degree of inverse quantization to be applied. The inverse transform module 33 applies an inverse transform (e.g., a transform method such as DCT, DST, etc.) to the inversely quantized transform coefficients, and generates an inversely transformed residual block in the pixel domain from the inversely quantized transform coefficients according to an inverse transform unit. The size of the inverse transform unit is the same as the size of the TU, and the inverse transform method and the transform method use the corresponding forward transform and inverse transform in the same transform method, for example, the inverse transform of DCT, DST is an inverse DCT, an inverse DST, or a conceptually similar inverse transform process.
[0096] After the prediction module 31 generates the prediction block, the video decoder 112 forms a decoded video block by summing the inverse transformed residual block from the inverse transform module 33 with the prediction block. The summer 301 represents one or more components that perform this summing operation. If necessary, a deblocking filter may also be applied to filter the decoded block to remove blocking artifacts. The decoded visual blocks in a given frame or image are stored in the reference image memory 34 as reference pixels for subsequent prediction.
[0097] This application provides a possible video encoding / decoding implementation, such as Figure 4 As shown, Figure 4 A schematic diagram of a video encoding / decoding process provided in the present application, wherein the video encoding / decoding implementation method includes process ① to process ⑤, and process ① to process ⑤ can be executed by any one or more of the above-mentioned source device 10, video encoder 102, destination device 11 or video decoder 112.
[0098] Process ①: Divide a frame of image into one or more non-overlapping parallel coding units. The one or more parallel coding units have no dependencies and can be completely parallel / independently encoded and decoded, such as Figure 4 A parallel encoding unit 1 and a parallel encoding unit 2 are shown.
[0099] Process ②: Each parallel coding unit can be further divided into one or more non-overlapping independent coding units. The independent coding units may not depend on each other, but may share some parallel coding unit header information.
[0100] The independent coding unit may include three components, namely, luminance Y, first chrominance Cb, and second chrominance Cr, or three components, namely, RGB, or may include only one of the components. If the independent coding unit includes three components, the sizes of the three components may be exactly the same or different, depending on the input format of the image.
[0101] Process ③: Each independent coding unit can be further divided into one or more non-overlapping coding units. The coding units within the independent coding unit can be interdependent, such as multiple coding units can perform mutual reference pre-coding and decoding.
[0102] If the coding unit and the independent coding unit have the same size (ie, the independent coding unit is divided into only one coding unit), their sizes can be all sizes described in process ②.
[0103] The coding unit may include three components (or three components of RGB) including brightness Y, first chrominance Cb, and second chrominance Cr, or only one of them. If it includes three components, the sizes of the components may be completely the same or different, which is related to the image input format.
[0104] It is worth noting that process ③ is an optional step in the video coding and decoding method, and the video codec can encode / decode the residual coefficients (or residual values) of the independent coding units obtained in process ②.
[0105] Process ④: For the coding unit, it can be further divided into one or more non-overlapping prediction groups (Prediction Group, PG), PG can also be referred to as Group, each PG is encoded and decoded according to the selected prediction mode to obtain the prediction value of PG, which constitutes the prediction value of the entire coding unit, and the residual value of the coding unit is obtained based on the prediction value and the original value of the coding unit.
[0106] Process ⑤: Based on the residual values of the coding units, the coding units are grouped to obtain one or more non-overlapping residual blocks (RBs). The residual coefficients of each RB are encoded and decoded according to the selected mode to form a residual coefficient stream. Specifically, it can be divided into two categories: transforming the residual coefficients and not transforming them.
[0107] Among them, the selected mode of the residual coefficient encoding and decoding method in process ⑤ may include, but is not limited to any of the following: semi-fixed length coding method, exponential Golomb coding method, Golomb-Rice coding method, truncated unary code coding method, run-length coding method, direct encoding of the original residual value, etc.
[0108] For example, a video encoder may directly encode coefficients within an RB.
[0109] For another example, the video encoder may also transform the residual block, such as DCT, DST, Hadamard transform, etc., and then encode the transformed coefficients.
[0110] As a possible example, when RB is small, the video encoder can directly perform uniform quantization on each coefficient in RB, and then perform binary encoding. If RB is large, it can be further divided into multiple coefficient groups (coefficient groups, CG), and then each CG is uniformly quantized and then binary encoded. In some embodiments of the present application, the coefficient group (CG) and the quantization group (QG) can be the same.
[0111] The following is an exemplary explanation of the residual coefficient encoding part in a semi-fixed length coding method. First, the maximum value of the absolute value of the residual in an RB block is defined as the modified maximum value (modified maximum, mm). Secondly, the number of coding bits for the residual coefficient in the RB block is determined (the number of coding bits for the residual coefficient in the same RB block is consistent). For example, if the critical limit (CL) of the current RB block is 2 and the current residual coefficient is 1, then 2 bits are required to encode the residual coefficient 1, which is expressed as 01. If the CL of the current RB block is 7, it means encoding an 8-bit residual coefficient and a 1-bit sign bit. The determination of CL is to find the minimum M value that satisfies that all residuals of the current sub-block are within the range of [-2^(M-1), 2^(M-1)]. If both -2^(M-1) and 2^(M-1) exist, M should be increased by 1, that is, M+1 bits are required to encode all residuals of the current RB block; if only one of the two boundary values of -2^(M-1) and 2^(M-1) exists, a Trailing bit needs to be encoded to determine whether the boundary value is -2^(M-1) or 2^(M-1); if all residuals do not exist in either -2^(M-1) or 2^(M-1), there is no need to encode the Trailing bit.
[0112] In addition, for some special cases, the video encoder can also directly encode the original value of the image instead of the residual value.
[0113] The video encoder 102 and the video decoder 112 may also be implemented in another implementation form, for example, by using a general digital processor system, such as Figure 5 The coding and decoding device 50 shown in the figure may be a part of the video encoder 102 or a part of the video decoder 112 .
[0114] The coding and decoding device 50 can be applied to the coding side or the decoding side. The coding and decoding device 50 includes a processor 501 and a memory 502. The processor 501 is connected to the memory 502 (such as being connected to each other through a bus 504). Optionally, the coding and decoding device 50 may also include a communication interface 503, which connects the processor 501 and the memory 502 for receiving / sending data.
[0115] The memory 502 may be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a compact disc read-only memory (CD-ROM). The memory 502 is used to store relevant program codes and video data.
[0116] The processor 501 may be one or more central processing units (CPUs), such as Figure 5 In the example shown in FIG. 5 , CPU 0 and CPU 1 are shown in FIG. 5 . In the case where processor 501 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
[0117] The processor 501 is used to read the program code stored in the memory 502 and execute Figure 6 The operations of any corresponding implementation scheme and its various feasible implementation modes.
[0118] Below, combined with the above Figure 1 The video coding system shown, Figure 2 The video encoder 102 is shown as well as Figure 3 The video decoder 112 shown describes the decoding method provided by the present application in detail.
[0119] like Figure 6 FIG. 1 is a flowchart of a video decoding method provided by the present application. The method includes:
[0120] S601: A video decoder obtains one or more rate control parameters of a current block in a to-be-decoded image.
[0121] The image to be decoded is composed of multiple image blocks, and the current block is any one of the multiple image blocks.
[0122] Among them, the rate control parameter is used to generate the quantization parameter, which is used in the dequantization process during the decoding process, as mentioned above Figure 3Description of the inverse quantization module 32 in . The code rate control parameters include the resource abundance of the current block, the complexity of the current block, the predicted number of bits of the current block, the average quantization parameter of the current block and the change value of the quantization parameter. Resource abundance refers to the sufficiency of the resources used to store the current block in the resources used to store the image to be decoded. The complexity of the current block refers to the complexity of the decoded image blocks in the image to be decoded. The predicted number of bits of the current block refers to the estimated resources occupied after the current block is decoded. The average quantization parameter of the current block is used to characterize the average degree of the quantization parameters of the decoded image blocks in the image to be decoded. The change value of the quantization parameter refers to the change value of the quantization parameter between the decoded image blocks in the image to be decoded.
[0123] Optionally, before step S601, the method further includes, the video decoder obtaining information of the image to be decoded, the information of the image to be decoded including basic information of the image to be decoded and information of image blocks in the image to be decoded. The basic information includes one or more of the following information:
[0124] The resolution of the image to be decoded is used to indicate the number of pixels contained in the image to be decoded, usually composed of horizontal pixels and vertical pixels. For example, 640×480 means that the horizontal pixels are 640 units and the vertical pixels are 480 units. The resolution of the image is 307200 pixels, which can also be expressed as 300,000 pixels.
[0125] The format of the image to be decoded refers to the sampling format of the image to be decoded, and reference may be made to the above description on video sampling.
[0126] The bit width of the image to be decoded refers to the depth of each pixel used to store the image to be decoded. For example, each pixel of a color image is represented by three components: R, G, and B. If each component is 8 bits, then a pixel is represented by 24 bits, which means that the depth of the pixel is 24.
[0127] The information of the image block in the image to be decoded includes one or more of the following information:
[0128] The input pixel depth (bits per pixel, bpp) of the image to be decoded refers to the depth of each pixel of the image to be decoded. For example, if the image is expected to be transmitted in the bitstream with each pixel occupying 18 bits, if the image is represented by three components of RGB, each component occupies 6 bits, which saves 2 bits compared to the bit width used to store the image.
[0129] It should be noted that bpp is usually less than or equal to the bit width. The bpp is usually determined in the encoding stage and written into the bit stream for the decoding end to obtain.
[0130] The size information (block_size) of the image blocks in the image to be decoded, where the sizes of the image blocks can be the same or different. Accordingly, the size information of all image blocks in the image to be decoded can also be inferred based on this information, or directly obtained from the bitstream, and this application does not limit this. For the size information of the image blocks, please refer to the above Figure 2 Description, for example, one or more sizes of CU, PU and TU, which may specifically be other sizes such as 8×8, 16×8, etc.
[0131] The position information of the current block refers to the position information of the current block in the image to be encoded. Figure 7 As shown, the size of the image to be encoded is 8×4, and it can be divided into 8 small blocks according to the image block size of 2×2. Assuming that the shaded part in the figure is the current block, the position of the current block in the image to be encoded can be expressed in the form of coordinates as (1, 1).
[0132] The reconstructed image block, also called the reconstructed block, refers to an image block formed by reconstructing multiple pixels based on the residual block after the inverse transformation and the predicted residual block, such as Figure 3 The reconstructed block shown in .
[0133] According to the above basic information and the information of each image block, at least the resources of the image to be decoded and the resources occupied by each image block in the image to be decoded can be obtained. The resources can be represented by part or all of the following information:
[0134] The number of remaining bits (ramin_bits) of the current block refers to the bit resources that are not occupied by the decoded image blocks in the resources storing the image to be decoded.
[0135] The number of remaining blocks of the current block (remain_blocks) refers to the number of undecoded image blocks in the image to be decoded.
[0136] The actual number of bits refers to the bit resources occupied by each decoded image block in the resources storing the image to be decoded.
[0137] It should be noted that the method for obtaining the above-mentioned information of the image to be decoded is well known to those skilled in the art. For example, a video decoder can obtain the basic information of the image to be decoded by obtaining the header information of the bitstream. The basic information refers to the format, resolution, size and other information of the image file. The bitstream also includes information of the image blocks in the image to be decoded, such as the size of the image blocks and bpp information.
[0138] The video decoder determines the rate control parameters according to part or all of the information of the image to be decoded, specifically, including the following five situations.
[0139] Case 1: The video decoder determines the resource sufficiency of the current block according to the information of the image to be decoded.
[0140] 1) The video decoder determines the resource sufficiency according to the remaining bits (ramin_bits), the remaining number of blocks (remain_blocks), the size information of the current block (block_size), and the input pixel depth bpp.
[0141] If (ramin_bits / remain_blocks) > block_size × bpp × M, it means the resources are sufficient;
[0142] If (ramin_bits / remain_blocks) < block_size × bpp × N, it means the resources are insufficient;
[0143] Where M > N > 0.
[0144] 2) The video decoder determines the resource sufficiency according to the remaining bits, the remaining number of blocks, and the position information of the current block.
[0145] Specifically, the video decoder determines the position of the current block in the image to be decoded. Further, it determines the position of the current block in the parallel unit in the image to be decoded. The parallel unit can be a slice and / or a group processing unit. Specifically, if the current block is in the first 1 / n position of the parallel unit, the first weight coefficient w1 is set to 1 + a; if the current block is in the middle 1 / n position of the parallel unit, w1 is set to 1; if the current block is in the last 1 / n position of the parallel unit, w1 is set to 1 - a, where 0 < a < 1.
[0146] Optionally, a increases as the distance between the first 1 / n and the last 1 / n relative to the middle 1 / n increases. By changing the value of a, the corresponding first weight coefficient is adjusted.
[0147] sufficiency = w1 × (remain_bits / remain_blocks);
[0148] It can be understood that different parallel units have different first weight coefficients. When considering the position of the current block in the slice and the position of the group processing unit in the image to be decoded at the same time, the video decoder can use the product of the respective weight coefficients as the first weight coefficient.
[0149] Case 2: The video decoder determines the complexity of the current block according to the reconstructed image block in the information of the decoded image blocks.
[0150] 1) The transformation coefficient weighting method.
[0151] Specifically, the video decoder performs weighting according to the transform coefficients of the first n reconstructed blocks of the current block, 1≤n≤the number of decoded image blocks. The number of decoded image blocks can be obtained by parsing the bitstream, or calculated according to the number of remaining blocks and the number of image blocks of the image to be decoded. The transform method can be DCT transform, Hadamard transform or DST transform.
[0152] complexity = ∑WC;
[0153] Wherein, C represents the transform coefficient, and W represents the weight coefficient of the transform coefficient. Exemplarily, in the DCT transform, it includes a DC coefficient and an AC coefficient, the DC coefficient represents the transform coefficient of the first image block in the decoded image block, and the AC coefficient represents the transform coefficient of other image blocks in the decoded image block. Exemplarily, when n is the number of decoded image blocks, the weight coefficient of the DC coefficient is set to 0, and the weight coefficients of other AC coefficients are set to 1. The above selection method helps to simplify the calculation process.
[0154] It should be noted that the present application does not impose any restrictions on the selection method of n. For example, n is a preset fixed value, or n can refer to the above-mentioned resource abundance. When resources are sufficient, n takes a smaller value, and when resources are insufficient, n takes a larger value.
[0155] 2) The video decoder uses the variance of the pixel values of the first n reconstructed blocks of the current block as the complexity, where 1≤n≤the number of decoded image blocks.
[0156] 3) Gradient weighted method
[0157] Specifically, the video decoder performs weighting according to the gradients of the first n reconstructed blocks of the current block, where 1≤n≤the number of decoded image blocks.
[0158] Horizontal gradient x = reconstruction of column t - reconstruction of column t-1;
[0159] Vertical gradient y = reconstruction of row s - reconstruction of row s-1;
[0160] Horizontal complexity (complexity1) = sum of horizontal gradients (gradx) / grad_block_size
[0161] Vertical complexity (complexity2) = sum of vertical gradients (grady) / grad_block_size
[0162] Where 0≤x≤total number of columns of the reconstructed block, 0≤y≤total number of rows of the reconstructed block, and grad_block_size is the number of pixels in the gradient reconstructed block. For example, if the current reconstructed block is 4×2, the grad_block_size in the horizontal complexity is 3×2=6, and the grad_block_size in the vertical complexity is 1×4=4.
[0163] 4) Sharpening weighted method
[0164] Specifically, the video decoder performs sharpening based on the first n reconstructed blocks of the current block and weights the sharpening results. Where 1≤n≤the number of decoded image blocks. Common sharpening algorithms include Robert, Prewitt, Sobel, Laplacian, and Kirsch.
[0165] complexity1 = A1 × P;
[0166] complexity2 = A2 × P;
[0167] complexity=|complexity1|+|complexity2|;
[0168] Wherein, P represents the pixel value of the reconstructed block, and A1 and A2 represent the horizontal operator and the vertical operator of any of the above-mentioned sharpening algorithms, respectively.
[0169] Case 3: The video decoder determines the number of predicted bits (pred_bits) of the current block according to the information of the image to be decoded.
[0170] 1) The video decoder obtains the predicted number of bits according to the number of remaining bits and the number of remaining blocks.
[0171] pred_bits=remain_bits / remain_blocks.
[0172] 2) The video decoder weights the actual number of bits (real_bits) to obtain the predicted number of bits.
[0173] Specifically, the video decoder performs weighting according to the actual bit numbers of the first n decoded image blocks, where 1≤n≤the number of decoded image blocks.
[0174] pred_bits=B1×real_bits1+B2×real_bits2+……+Bn×real_bitsn.
[0175] Among them, B1>B2>…>Bn>0, and B1+B2+…+Bn=1.
[0176] Optionally, based on the above determination of at least one rate control parameter from the information of the image to be encoded, other rate control parameters can also be derived from the at least one rate control parameter. Specifically, there are the following three cases:
[0177] Case 1: The video decoder determines the resource abundance based on the predicted number of bits and complexity
[0178] 1) The video decoder determines the resource abundance based on the information of the current block (remaining bits, remaining number of blocks) and the predicted number of bits.
[0179] Specifically, if (remain_bits / remain_blocks) > 1 + a × pred_bits, it indicates that the resources are sufficient;
[0180] if (remain_bits / remain_blocks) ≤ 1 - a × pred_bits, it indicates that the resources are insufficient. Where 0 < a < 1.
[0181] 2) The video decoder determines the resource abundance based on the complexity of the current block and the predicted number of bits, and the maximum value (max_complexity) of the complexity of the previous n decoded image blocks, in combination with the size information of the current block and the input pixel depth. Where 1 ≤ n ≤ the number of decoded image blocks.
[0182] Specifically,
[0183] if complexity / max_complexity × C × block_size × bpp < pred_bits; it indicates that the resources are sufficient;
[0184] if complexity / max_complexity × C × block_size × bpp > pred_bits; it indicates that the resources are insufficient.
[0185] Where C > 1.
[0186] Case 2: The video decoder determines the complexity based on the predicted number of bits and the resource abundance
[0187] 1) Complexity weighting method
[0188] The video decoder weights according to the complexity of the previous n decoded image blocks, 1 ≤ n ≤ the number of decoded image blocks;
[0189] complexity = D1 × complexity1 + D2 × complexity2 + …… + Dn × complexityn
[0190] where D1 > D2 > …… > Dn > 0, and D1 + D2 + …… + Dn = 1.
[0191] 2) The video decoder determines the complexity of the current block according to the complexity (pre_complexity) of the previous n decoded image blocks and the position information of the current block. Where 1 ≤ n ≤ the number of decoded image blocks.
[0192] Specifically, the video decoder determines the position of the current block in the image to be decoded. Further, it determines the position of the current block in the parallel unit in the image to be decoded. The parallel unit can be a slice and / or a group processing unit. If the current block is in the first 1 / n position of the parallel unit, the second weight coefficient w2 is set to 1 + a; if the current block is in the middle 1 / n position of the parallel unit, w2 is set to 1; if the current block is in the last 1 / n position of the parallel unit, w2 is set to 1 - a, where 0 < a < 1.
[0193] Optionally, a increases as the distance between the first 1 / n and the last 1 / n relative to the middle 1 / n increases. By changing the value of a, the corresponding second weight coefficient is adjusted.
[0194] complexity = w2 × pre_complexity;
[0195] It can be understood that different parallel units have different second weight coefficients. When considering the position of the current block in the slice and the position of the group processing unit in the image to be decoded at the same time, the video decoder can use the product of the respective weight coefficients as the second weight coefficient.
[0196] 3) The video decoder determines the complexity of the current block according to the predicted number of bits (pre_pred_bits) of the previous n decoded image blocks, the resource sufficiency (pre_sufficiency) of the previous n decoded image blocks, as well as the predicted number of bits and resource sufficiency of the current block;
[0197] If pred_bits > pre_pred_bits and sufficiency > pre_sufficiency, it is considered that the complexity is small;
[0198] If pred_bits < pre_pred_bits and sufficiency < pre_sufficiency, it is considered that the complexity is large.
[0199] Case 3: The video decoder determines the predicted number of bits according to the resource sufficiency and complexity
[0200] 1) The video decoder obtains the number of predicted bits of the current block by weighting the number of predicted bits of the first n decoded image blocks, where 1≤n≤the number of decoded image blocks.
[0201] pred_bits=E1×pred_bits1+E2×pred_bits2+……+En×pred_bitsn;
[0202] Among them, E1>E2>…>En>0, and E1+E2+…+En=1.
[0203] 2) The video decoder obtains the predicted bit number of the current block by weighting the predicted bit number and the actual bit number of the first n decoded image blocks, where 1≤n≤the number of decoded image blocks.
[0204] pred_bits=F1×pred_bits1+…+Fn×pred_bitsn+G1×real_bits1+…+Gn×real_bitsn, where F1, …, Fn, G1, …, Gn are all greater than 0, and F1+…+Fn+G1+…+Gn=1.
[0205] 3) The video decoder obtains the predicted bit number of the current block based on the overall complexity (pre_complexity) of the first n decoded image blocks, the predicted bit number (pred_bits), and the complexity (complexity) of the current block, 1≤n≤the number of decoded image blocks. Among them, pre_complexity is a variable value to satisfy the calculation of the following formula;
[0206] pred_bits=clip(complexity / pre_complexity,1-a,1+a)×pred_bits;
[0207] Among them, clip(complexity / pre_complexity, 1-a, 1+a) means adjusting pre_complexity so that the value of complexity / pre_complexity is within the range of (1-a, 1+a), 0 <a<1。
[0208] It should be noted that pre_complexity can be the average complexity of the first n decoded image blocks; or, any complexity of the first n decoded image blocks; or, the maximum complexity of the first n decoded image blocks, or other coefficients representing the overall complexity.
[0209] 4) The video decoder obtains the predicted bit number of the current block by weighting the overall complexity, the actual bit number of the previous n decoded image blocks, and the complexity of the current block, where 1 ≤ n ≤ the number of decoded image blocks. Among them, pre_complexity is a variable value to satisfy the following calculation formula;
[0210] pred_bits = clip(complexity / pre_complexity, 1 - a, 1 + a) × real_bits;
[0211] The value range of the correlation coefficient is the same as that in 3) above, which will not be elaborated here.
[0212] 5) The video decoder obtains the empirical value according to the position information, and the complexity of the current block, and the predicted bit number of the previous n decoded image blocks are weighted to obtain the predicted bit number of the current block, where 1 ≤ n ≤ the number of decoded image blocks.
[0213] Specifically, the video decoder determines the position of the current block in the image to be decoded. Further, it determines the position of the current block in the parallel unit of the image to be decoded, and the parallel unit can be a slice and / or a group processing unit. Specifically, if the current block is in the first 1 / n position of the parallel unit and the complexity is less than the first preset complexity, the third weight coefficient w3 is set to 1 + a; if the current block is in the middle 1 / n position of the parallel unit, w3 is set to 1; if the current block is in the last 1 / n position of the parallel unit and the complexity is greater than the second preset complexity, w3 is set to 1 - a, where 0 < a < 1, and the first preset complexity is less than the second preset complexity. Exemplarily, a is 0.2, the first preset complexity is 2000, and the second preset complexity is 10000.
[0214] Optionally, a increases as the distance between the first 1 / n and the last 1 / n relative to the middle 1 / n increases. By changing the value of a, the corresponding third weight coefficient is adjusted.
[0215] It can be understood that the third weight coefficient is different for different parallel units. When considering the position of the current block in the slice and the position of the group processing unit in the image to be decoded at the same time, the video decoder can use the product of the respective weight coefficients as the third weight coefficient.
[0216] Through the above three cases, using the correlation between the rate control parameters helps to improve the feasibility of the solution.
[0217] Case 4: The video decoder determines the average quantization parameter (average_quantization) according to the information of the image to be decoded.
[0218] Optionally, the video decoder obtains the quantization parameters of the first n decoded image blocks using any one of the above three cases, where 1 ≤ n ≤ the number of decoded image blocks. The description of obtaining the quantization parameters of the first n decoded image blocks can refer to step S602 below.
[0219] 1) Global average
[0220] average_quantization = sum of quantization parameters of the first n blocks (total_sum) / n (total_blocks)
[0221] 2) Moving average
[0222] Specifically, the video decoder calculates the average quantization parameter according to different weights corresponding to the position information.
[0223] average_quantization t = average_quantization t-1 × H1 + H2 × pre_quantization
[0224] where t represents the current block, t - 1 represents the previous decoded image block of the current block, average_quantization t-1 represents the average quantization parameter of the previous decoded image block, and pre_quantization represents the quantization parameter of the previous decoded image block.
[0225] where H1 + H2 = 1, and both H1 and H2 are greater than 0.
[0226] 3) The video decoder determines the average quantization parameter according to the complexity of the first n decoded image blocks and the complexity of the current block.
[0227] Specifically, the video decoder divides the complexity of the first n decoded image blocks into k levels, determines the position of the complexity of the current block among the k levels, and calculates the average value of the quantization parameters of this level as the quantization parameter of the current block. Exemplarily, level 1 is complexity > 10000, level 2 is 1000 < complexity < 10000, level 3 is complexity < 1000. If the complexity of the current block is within the range of level 3, then calculate the average value of the quantization parameters of level 3 as the average quantization parameter of this current block.
[0228] 4) The video decoder determines the average quantization parameter according to the resource availability of the first n decoded image blocks and the resource availability of the current block.
[0229] 5) The video decoder determines an average quantization parameter according to the predicted bit numbers of the first n decoded image blocks and the predicted bit number of the current block.
[0230] Among them, 4) and 5) are similar to the above 3), which divides the levels and calculates the average values of the quantization parameters of the corresponding levels, which will not be repeated here.
[0231] 6) The video decoder performs clustering using the predicted number of bits of the current block and the actual number of bits of the previous block.
[0232] It should be noted that the above methods 3)-6) mainly use clustering based on certain information of the current block and certain information of the previous N blocks, and average the quantization parameters of the blocks in the similar class, wherein different coefficients can also be used for different blocks in the level to perform weighted averaging to obtain the average quantization parameter. In addition, the information used for clustering can be a combination of multiple information, such as complexity, resource abundance, and at least two of the predicted number of bits.
[0233] Case 5: The video decoder determines a change value (Δquantization) of a quantization parameter according to information of the image to be decoded.
[0234] 1) The video decoder obtains the change value of the quantization parameter according to the accumulation of the difference between the predicted bit number and the actual bit number of the first n decoded image blocks and the size information mapping of the current block.
[0235] The sum of the differences between the predicted number of bits and the actual number of bits of the first n decoded image blocks is represented by pred_real_sum, that is, 1≤n≤the number of decoded image blocks.
[0236] Δquantization=clip(pred_real_sum / block_size,J1,J2);
[0237] Among them, |J1| and |J2| are both smaller than a maximum quantization parameter, and the maximum quantization parameter is a preset value, indicating the maximum quantization parameter that can be used for the image block to be decoded.
[0238] Optionally, pred_real_sum may be replaced by target_real_sum, where target_real_sum represents the accumulation of differences between the target number of bits and the actual number of bits of the first n decoded image blocks.
[0239] The target number of bits (target_bits) refers to the product of the target pixel depth (target bpp) and the size information of the current block.
[0240] It can be understood that the target pixel depth is in units of block processing units, and is used to represent the pixel depth of the current block being transmitted, that is, a parameter further defined based on the input bpp of the image to be decoded.
[0241] Wherein, target_bits=target bpp×block_size;
[0242] 1≤n≤the number of decoded image blocks
[0243] Δquantization=clip(target_real_sum / block_size,J1,J2)
[0244] Optionally, pred_real_sum may be replaced by target_pred_sum, where target_pred_sum represents the accumulation of differences between the target number of bits and the predicted number of bits of the first n decoded image blocks.
[0245] 1≤n≤the number of decoded image blocks
[0246] Δquantization=clip(target_pred_sum / block_size,J1,J2)
[0247] Exemplarily, the maximum quantization parameter is represented by max_quantization, J1 is -max_quantization / 3, and J2 is max_quantization / 3; or, J1 is -4, and J2 is 4.
[0248] 2) The video decoder maps the change value of the quantization parameter based on the accumulation of the difference between the target number of bits and the predicted number of bits of the first n decoded image blocks.
[0249] Δquantization=sigmoid(target_pred_sum / block_size)×(J3)
[0250] like Figure 8 As shown, the function y=sigmoid(x) is an s-shaped function, and the value range of y is [0, 1]. When x tends to positive infinity, y=1, and when x tends to negative infinity, y=0.
[0251] It should be noted that target_pred_sum can also be replaced by pred_real_sum or target_real_sum.
[0252] 3) The video decoder determines the change value of the quantization parameter based on the complexity of the current block, the complexity of the previous decoded image block, and the maximum quantization parameter.
[0253] If complexity > pre_complexity, then Δquantization = clip(Δpre_quantization + 1, 0, max_Δquantization);
[0254] If complexity < pre_complexity, then Δquantization = clip(Δpre_quantization - 1, 0, max_Δquantization).
[0255] Among them, Δpre_quantization represents the change value of the quantization parameter of the previous decoded image block, and max_Δquantization represents the maximum change value of the quantization parameter of the image block in the image to be decoded, and this maximum value can be a preset fixed value.
[0256] 5) The video decoder sets the change value of the quantization parameter to a fixed value.
[0257] Exemplarily, the fixed value is Δquantization = 1.
[0258] 6) The video decoder adjusts the change value of the quantization parameter according to the information of the image to be decoded and other rate control parameters of the current block.
[0259] If the image bit width is greater than 8bit, then Δquantization = 2;
[0260] Or, if the current channel is a chrominance component, then Δquantization = 2;
[0261] Or, if the position of the current block is in the first 1 / n position of the parallel unit, then Δquantization = 1; if the position of the current block is in the last 1 / n position of the parallel unit, then Δquantization = 2; if the position of the current block is at the boundary of the parallel unit, then Δquantization = 1.
[0262] It should be noted that the video decoder can also adjust the fixed value according to other input parameters.
[0263] Optionally, the video decoder sets the change value of the quantization parameter to a fixed value according to the resource abundance in other rate control parameters of the current block.
[0264] Exemplarily, if the resources of the current block are sufficient, Δquantization=1; if the resources of the current block are insufficient, Δquantization=4.
[0265] Optionally, before the above step S601, the method further includes: the video decoder initializing a rate control parameter, such as Fig. 9 As shown, the following steps are included:
[0266] S901. The video decoder calculates the total number of bits of the current block according to information of the image to be decoded.
[0267] The total number of bits refers to the number of bits occupied by the current block, and is calculated based on the sampling format, resolution, and bpp in the basic information of the image to be decoded.
[0268] Optionally, the total number of bits can be calculated according to the sampling format of the image. For example, if the image is in YUV format, the total number of bits of the Y channel, the total number of bits of the U channel, and the total number of bits of the V channel can be calculated separately. Multiple channels can also be combined into different sets to calculate the total number of bits.
[0269] Specifically, the N-channel image is divided into M sets (M≤N). Exemplarily, the Y channel is the first set, and the U channel and the V channel are the second set.
[0270] In the first possible implementation, the parameters of each set are independent of each other. The parameters include all variable parameters in the decoding process such as initialization parameters, rate control parameters, and quantization parameters. The parameters may also include some parameters of all the above variable parameters, that is, some or all parameters of each set are independent of each other.
[0271] In a second possible implementation, the parameters of each set are shared. Similarly, the parameter may include some or all of the above-mentioned variable parameters, and each set shares some or all of the parameters. Exemplarily, the common parameters of the first set and the second set include initialized parameters, updated parameter thresholds and quantization parameters, and the independent parameters include intermediate variables and rate control parameters. Among them, the intermediate variable refers to the intermediate parameter generated in the calculation of the quantization parameter, for example, the number of decoded image blocks based on the current block.
[0272] Optionally, the above parameters are updated according to M sets. Specifically, the parameters are updated after each set is decoded; or the parameters are updated after all sets are decoded.
[0273] S902: The video decoder determines the number of available bits according to the total number of bits.
[0274] The available bits are used to store the image data before decoding the current block.
[0275] Optionally, the video decoder removes other bits used to store non-image data from the total number of bits, which may include the following types of data, such as reserved bits used to store header information of an image, and inter-block offset bits used to determine the position of data in a bitstream.
[0276] Optionally, after the above step S902, step S904 may be further included, the video decoder is combined according to the channel division, and the total number of available bits of each set is calculated; the total resources are allocated to the total number of bits of each set according to the ratio of M sets.
[0277] The ratio of the M sets can be determined by referring to the number of image blocks in each set. The video decoder allocates the total number of available bits of the current block according to the ratio of the sets.
[0278] Optionally, step S904 may also be applied before step S902, where the video decoder calculates the available bit numbers of the M sets respectively.
[0279] Among them, other non-image bits in step S902 are removed respectively after the sets are divided.
[0280] It can be understood that dividing the sets first and then removing the other bits used to store non-image data in each set can help improve the flexibility of the available bits in each set and improve the performance of the video decoder; first removing the other bits used to store non-image data from the total number of bits to obtain the total number of available bits, and then dividing the available bits of each set can help ensure the consistency of the available bits in each set.
[0281] Optionally, after the above step S901, the video decoder further calculates a target BPP (target_bpp) according to bpp;
[0282] For example, target_bpp=bpp-0.1;
[0283] Optionally, the target_bpp may be common to the M sets, or may be an independent target_bpp for each set.
[0284] If each set has an independent target_bpp, the target_bpp obtained by weighting all the sets must meet the bpp restriction, for example, bpp=target_bpp+0.1 (empirical value).
[0285] It should be noted that the target bpp is used to determine the target number of bits and other parameters related to the target number of bits.
[0286] S903: The video decoder initializes intermediate parameters.
[0287] The intermediate parameter is used to determine the quantization parameter of the current block in combination with one or more rate control parameters.
[0288] Exemplary parameters include:
[0289] 1.target_bits=total_bits / total_blocks
[0290] 2.target_real_sum=target_bits×total_blocks–total_bits
[0291] 3.pred_real_sum=0
[0292] Optionally, some intermediate variables in calculating the bit rate control parameters may also be predefined in this step, such as a maximum quantization parameter, a maximum value of allowed complexity, and the like.
[0293] S602: The video decoder determines a quantization parameter of a current block according to one or more rate control parameters.
[0294] Specifically, it includes the following 7 solutions.
[0295] Solution 1: Use the average quantization parameter as the quantization parameter.
[0296] Solution 2: The quantization parameter is obtained by weighting the average quantization parameter and the quantization parameter change value.
[0297] quantization=clip(average_quantization+Δquantization,0,max_quantization)
[0298] Solution 3: Determine the quantization parameter according to the complexity of the current block, the complexity of the previous decoded image block, and the quantization parameter of the previous decoded image block.
[0299] quantization=clip(complexity / pre_complexity,1-a,1+a)×pre_quantization
[0300] Among them, 0 <a<1。
[0301] Solution 4: Determine the quantization parameter of the current block according to the position information and complexity of the current block and the quantization parameter of the previous decoded image block.
[0302] If the current block is in the first 1 / n position of the parallel unit, the fourth weight coefficient w4 is 1-a; if it is in the last 1 / 2 position of the parallel unit, w4 is 1+a, 0 <a<1;
[0303] quantization=w4×pre_quantization;
[0304] Optionally, if the complexity of the current block is greater than K1 (or the resource margin is less than L1), then quantization = w4 × pre_quantization × 1 + b; if the complexity is less than K2 (or the resource margin is greater than L2), then quantization = w4 × pre_quantization × 1 - b, 0 <b<1,0<K1<K2,0<L1<L2;
[0305] Solution 5: Determine the quantization parameter of the current block according to the information of the previous decoded image block.
[0306] 1) If the target_real_sum of the previous decoded image block is > 0,
[0307] Then quantization=clip(pre_quantization+M,0,max_quantization);
[0308] If the target_real_sum of the previous decoded image block is < 0,
[0309] Then quantization=clip(pre_quantization-M, 0, max_quantization), where M>1.
[0310] 2) Or according to pred_real_sum, if pred_real_sum is greater than a preset threshold, the quantization parameter is increased, otherwise, the quantization parameter is decreased.
[0311] Solution 6: Determine the quantization parameter of the current block according to the position information of the current block.
[0312] Exemplarily, if the current block is the first block in the parallel unit, quantization=0;
[0313] Solution 7: Determine the quantization parameter of the current block according to multiple complexities of the current block.
[0314] If {complexity1 < N1 || complexity2 < N2}, where at least one of complexity1 < N1 and complexity2 < N2 satisfies the condition to hold; then quantization = 0. N1 and N2 can be calibrated by bit width, and both N1 and N2 are greater than 0.
[0315] It should be noted that, in combination with the encoding process described above for Figure 2 The specific implementation manner in which the video encoder generates quantization parameters based on the rate control parameters is a reciprocal encoding process to the above-described embodiment on the decoding side, and will not be described repeatedly.
[0316] S603. The video decoder decodes the current block based on the quantization parameter of the current block.
[0317] Optionally, after determining the quantization parameter above, the video decoder corrects the quantization parameter.
[0318] The first possible implementation manner is to adjust according to the resource abundance of the current block; if it exceeds the range of the resource abundance, corresponding adjustments are made.
[0319] Exemplarily, if the resources are sufficient, then quantization = clip(quantization - x, 0, max_quantization);
[0320] If the resources are insufficient, then quantization = clip(quantization + x, 0, max_quantization); x > 0.
[0321] The second possible implementation manner is to adjust based on the above-mentioned number of bits.
[0322] 1) Adjust according to the total number of target bits and the actual number of bits before;
[0323] If target_real_sum ≥ P1 × target_bits and quntization ≤ pre_quantization;
[0324] Then quantization = clip(quantization + Q1, 0, max_quantization);
[0325] If target_real_sum < P2 × target_bits and quantization > pre_quantization
[0326] quantization = clip(quantization + Q2, 0, max_quantization).
[0327] Among them, the absolute values of P1, P2, Q1, and Q2 are all greater than 1.
[0328] 2) Adjust according to the predicted number of bits and the actual number of bits;
[0329] If pred_real_sum < P3, then quantization = clip(quantization + Q3, 0, max_quantization);
[0330] If pred_real_sum > P4, then quantization = clip(quantization + Q4, 0, max_quantization);
[0331] Among them, the absolute values of P3, P4, Q3, and Q4 are all greater than 1.
[0332] The third possible implementation method is based on the actual number of bits of the previous n blocks and the rate control buffer (buffer_size) of the current block;
[0333] target_real_sum is actually the same as buffer_size;
[0334] Exemplarily, if it is an 8-bit image and buffer_size ≥ ((max_buffer_size * 63) >> 6);
[0335] Then quantization = max_quantization;
[0336] If it is a 10-bit image and ((max_buffer_size * 15) >> 4) ≤ buffer_size;
[0337] Then quantization = max_quantization;
[0338] If it is an image with other bit depths and ((max_buffer_size * 7) >> 3) ≤ buffer_size;
[0339] Then quantization = max_quantization;
[0340] If buffer_size>0, then quantization=max(buffer_size×max_quantization / max_buffer_size,quantization);
[0341] If buffer_size<0, then quantization=0, buffer_size=0.
[0342] A fourth possible implementation manner is to adjust the quantization parameter according to the position of the current block.
[0343] Exemplarily, if it is at the boundary of the parallel unit, quantization=quantization / 2;
[0344] And the difference between the parallel cells on the left and right of the parallel cell boundary cannot be greater than 3;
[0345] The difference in quantization parameters between the middle, upper, lower, left and right blocks of the same parallel unit cannot be greater than max_quantization / 4.
[0346] A fifth possible implementation manner is to make adjustments based on the smoothness of the rate control.
[0347] Constant Bit Rate (CBR): This rate control method has a buffer_size, and each block will update the buffer_size according to the actual number of bits and the target number of bits. The buffer_size must not exceed the first preset threshold and cannot be less than 0. Among them, buffer_size is target_real_sum, or the input bpp is used as the target bpp to calculate target_real_sum. Exemplarily, a two-level buffer is used, and the two-level buffer is parallel and independent to perform CBR.
[0348] a) Correction of the primary buffer and video decoder limit quantization parameters;
[0349] If max_buffer_size×R1≥buffer_size;
[0350] Then quantization=max_quantization;
[0351] If max_buffer_size×R1 <buffer_size<max_buffer_size×R2;
[0352] Then quantization = max(buffer_size × max_quantization / max_buffer_size, quantization);
[0353] If max_buffer_size × R2 ≤ buffer_size;
[0354] Then quantization = 0;
[0355] If buffer_size < 0, it means that the current block at the encoding end includes multiple invalid data during the encoding process;
[0356] Correspondingly, the decoding end fills -buffer_size bits, which is the number of bits of multiple invalid data, and sets buffer_size = 0, so that the decoded image block is the same as the encoded image block.
[0357] It should be noted that the above first-level buffer can also be applied to the correction after the video encoder calculates the quantization parameter.
[0358] Optionally, b) the second-level buffer, and the correction of the quantization parameter is applied to the encoding process.
[0359] If the real_bits of the currently selected optimal mode will make buffer_size < max_buffer_size × U1, at this time, select a mode with the smallest distortion;
[0360] If the real_bits of the currently selected optimal mode will make buffer_size < max_buffer_size × U2, at this time, select a lossless mode or a mode with the smallest distortion;
[0361] If the real_bits of the currently selected optimal mode will make buffer_size > max_buffer_size × U3, at this time, select a mode that does not exceed max_buffer_size x U3 and has a smaller distortion;
[0362] If the real_bits of the currently selected optimal mode will make buffer_size > max_buffer_size × U4, at this time, select a new mode with the smallest cost.
[0363] It should be noted that U1 - U4 can be calculated according to the cost of the mode with the smallest cost in max_buffer_size, or different fixed values can be preset.
[0364] The sixth possible implementation method. To ensure that buffer_size < 0 or buffer_size ≥ max_buffer_size does not occur, it is required that buffer_size be within the ideal range, that is, max_buffer_size × V1 < buffer_size < max_buffer_size × V2, where 0 ≤ V1 ≤ V2 ≤ 1.
[0365] To implement buffer_size within the above ideal range, the encoding end or the decoding end can reserve resources during parameter initialization. The reserved resources are max_buffer_size × V3, where V3 ≥ 1. Among them, when determining the available number of bits during parameter initialization, the reserved resources belong to the reserved number of bits and need to be deducted to meet the subsequent resource replenishment.
[0366] It can be understood that, in the case of ensuring that buffer_size does not overflow, the reserved resources can also be used for encoding and decoding the last few image blocks, or for the boundary of the parallel unit, and the reserved resources are released to places where the resources are relatively scarce.
[0367] It should be noted that for the schemes not specifically described in the above scheme for correcting quantization parameters, they can all be performed after generating quantization parameters at the decoding end or the encoding end.
[0368] Optionally, the above steps S601 - S603 are implemented according to different parallel units.
[0369] Embodiment 1. Block, row, group, slice-level parallelism
[0370] Specifically, the encoding end records the offset information of the data of the current block. The offset information refers to the position of the current block in the parallel unit, which is represented by the sum of the actual number of bits from the first block of the parallel unit to the previous image block of the current block.
[0371] At the encoding end, the video encoder writes the offset information into the code stream for the decoding end to parse the code stream and obtain the offset information, so as to locate the position of the current block in the parallel unit.
[0372] Optionally, the position written into the code stream by the encoding end is the beginning of the entire parallel unit code stream.
[0373] At the decoding end, the video decoder obtains the offset information in the code stream, locates the position of the current block according to the offset information, and performs decoding.
[0374] It should be noted that during the execution of the above scheme, the offset information can be removed as other bits for storing non-image data during the parameter initialization phase, or included in the actual number of bits as consumption of parallel units during the encoding and decoding process, or not included in the actual number of bits during the encoding and decoding process. Different inclusion methods affect the calculation of some parameters in the above scheme, and a comprehensive consideration is made for selection.
[0375] Embodiment 2: Row-level parallelism
[0376] Specifically, the encoding end fills in the bit stream according to the rules.
[0377] In the first possible implementation, each row is divided into several units, and each unit is aligned according to a given parameter (such as 128 bits); (If the number of bits in the unit is not a multiple of 128 bits, the unit is padded to a multiple of 128 bits). The given parameter can be an empirical parameter, or obtained from one or more information of the width, height, and bpp of the row.
[0378] The second possible implementation method is the maximum number of bits between slice rows: the number of bits consumed by the longest row among all rows in the same position of all slices. Align according to the maximum number of bits between slice rows; (if the number of bits consumed by the row is not a multiple of the maximum number of bits between slice rows, the number of bits consumed is padded to a multiple of the maximum number of bits between slice rows).
[0379] The third possible implementation is to fill -buffer_size bits after the slice is encoded (CBR ensures that buffer_size ≤ 0)
[0380] For the above three possible implementations, the decoding end includes three possible implementations:
[0381] The first possible implementation method is to determine whether the currently consumed bits meet the alignment of the given parameter bits when reading to the end of the unit. If so, there is no need to read the padding bits. Otherwise, read the number of bits filled to meet the multiple of the given bits.
[0382] The second possible implementation method is to determine whether the currently consumed bits meet the alignment of the maximum number of bits between slice rows when decoding to the end of the row. If so, there is no need to read the padding bits. Otherwise, read the number of bits filled by the multiple of the maximum number of bits between slice rows.
[0383] A third possible implementation is to read -buffer_size padding bits.
[0384] Exemplary, a code stream arrangement method, taking two slices as an example, wherein the slices are only divided vertically:
[0385] The first cell of slice1 (fill), the first cell of slice2 (fill), the second cell of slice1, the second cell of slice2 (fill), ... the last cell of the first row of slice1, the last cell of the first row of slice2 (fill).
[0386] It should be noted that the maximum number of bits between the first lines of a slice is the number of bits consumed by encoding one line of slice1.
[0387] It should be noted that the number of bits consumed by the padding is included in the actual number of bits consumed by the corresponding block, or the number of bits consumed by the padding is not included in the actual number of bits consumed by the corresponding block.
[0388] Embodiment 3: Slice-level parallelism
[0389] The encoding end calculates the number of unit bits and writes it into the bit stream;
[0390] Optionally, when the unit is determined, the number of bits of each unit can be calculated based on the width and height of the slice and one or more of bpp (or target_bpp). For example, the width of the slice × height × bpp = 10000 bits, where 10000 bits is the number of bits of the unit in the slice.
[0391] Optionally, the number of bits of the unit may also be a preset fixed value.
[0392] Among them, the code stream arrangement is a code stream arrangement method, taking two slices as an example, in which the slice is only divided vertically:
[0393] The first cell of slice1, the first cell of slice2, the second cell of slice1, the second cell of slice2... the last cell of slice1, the last cell of slice2.
[0394] It should be noted that the number of bits of each unit is a constant size determined by any one of the two optional methods mentioned above.
[0395] The decoding end parses the bitstream in the order of the first unit of the first slice, the first unit of the second slice, the second unit of the first slice, and the second unit of the second slice.
[0396] It should be noted that the above parallel schemes that are not specifically described can be performed on the decoding side or the encoding side.
[0397] It should be noted that, in the absence of conflict, part or all of the contents of any multiple embodiments above may constitute a new embodiment.
[0398] The embodiment of the present application provides a decoding device, which may be a video decoder. Specifically, the decoding device is used to execute the steps executed by the video decoder in the above decoding method. The decoding device provided in the embodiment of the present application may include modules corresponding to the corresponding steps.
[0399] The embodiment of the present application can divide the functional modules of the decoding device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. The division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0400] In the case of dividing each functional module into corresponding functional modules, Fig.10 A possible structural diagram of the decoding device involved in the above embodiment is shown. Fig.10 As shown, the decoding device 100 includes an acquisition module 1001 , a determination module 1002 and a decoding module 1003 .
[0401] The acquisition module 1001 is used to acquire one or more rate control parameters of the current block in the image to be decoded, such as the above step S601.
[0402] The determination module 1002 is used to determine the quantization parameter of the current block according to one or more rate control parameters; for example, the above step S602.
[0403] The decoding module 1003 is used to decode the current block based on the quantization parameter of the current block, such as the above step S603.
[0404] In one example, the acquisition module 1001 is specifically used to obtain information of the image to be decoded, the information of the image to be decoded including basic information of the image to be decoded and information of image blocks in the image to be decoded; and determine one or more bit rate control parameters of the current block based on part or all of the information of the image to be decoded.
[0405] In one example, the bit rate control parameters include resource adequacy of the current block, complexity of the current block, predicted number of bits of the current block, average quantization parameter of the current block and change value of the quantization parameter of the current block; wherein, the average quantization parameter is used to characterize the average degree of quantization parameters of decoded image blocks in the image to be decoded, resource adequacy refers to the sufficiency of resources used to store the current block in the resources used to store the image to be decoded, complexity refers to the complexity of the decoded image blocks in the image to be decoded, predicted number of bits refers to the estimated resources occupied after decoding the current block, and change value of the quantization parameter refers to the change value of the quantization parameter between decoded image blocks in the image to be decoded.
[0406] In an example, the determination module 1002 is specifically configured to obtain a rate control parameter of a decoded image block; and determine a quantization parameter of a current block according to the rate control parameter of the decoded image block.
[0407] In an example, the determination module 1002 is specifically configured to obtain a quantization parameter of a decoded image block; and determine a quantization parameter of a current block according to the quantization parameter of the decoded image block.
[0408] In one example, the determination module 1002 is also used to calculate the total number of bits of the current block based on the current block information, where the total number of bits of the current block is the number of bits occupied by the current block after decoding; determine the number of available bits based on the total number of bits, where the available number of bits is for storing image data after decoding the current block, and the available number of bits is used to determine one or more bit rate control parameters of the current block.
[0409] In an example, the determination module 1002 is specifically configured to remove other bits used to store non-image data from the total number of bits.
[0410] In an example, the determination module 1002 is further used to initialize an intermediate parameter, where the intermediate parameter is used to determine a quantization parameter of the current block in combination with one or more bit rate control parameters.
[0411] In an example, the determination module 1002 is further configured to modify the quantization parameter based on one or more rate control parameters.
[0412] In one example, the determination module 1002 is further configured to update one or more rate control parameters.
[0413] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0414] Of course, the decoding device provided in the embodiment of the present application includes but is not limited to the above modules. For example, the decoding device may also include a storage module 1004 .
[0415] The storage module 1004 may be used to store program codes and data of the decoding device.
[0416] An embodiment of the present application further provides an electronic device, which includes the above-mentioned decoding device 100, and the decoding device 100 executes the method executed by any one of the video decoders provided above.
[0417] An embodiment of the present application also provides a communication system, which includes the above-mentioned decoding device 100 and encoding device, wherein the decoding device 100 executes the method executed by any one of the video decoders provided above, and the encoding device executes the method executed by any one of the video encoders provided above.
[0418] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer executes the method executed by any one of the video decoders provided above.
[0419] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.
[0420] The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for implementing the functions of the above-mentioned decoding device 100. Optionally, the functions supported by the chip can be referred to above and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gatearray, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
[0421] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0422] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.
[0423] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0424] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0425] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A video decoding method, characterized in that: include: Acquire information of an image to be decoded, wherein the information of the image to be decoded includes basic information of the image to be decoded and information of image blocks in the image to be decoded, wherein the information of the image blocks in the image to be decoded includes an actual number of bits, and the actual number of bits is used to indicate the actual number of bits occupied by each decoded image block; Determine one or more rate control parameters of the current block according to part or all of the information of the image to be decoded; obtain one or more rate control parameters of the current block in the image to be decoded; the rate control parameters of the current block include the predicted number of bits of the current block, the predicted number of bits refers to the estimated resources occupied by the current block after encoding, and the predicted number of bits of the current block is derived according to the weighted value of the actual number of bits of the first n decoded image blocks; Determining a quantization parameter of the current block according to the one or more rate control parameters; The current block is decoded based on a quantization parameter of the current block.
2. The method according to claim 1, characterized in that The determining the quantization parameter of the current block according to the one or more rate control parameters includes: Obtaining rate control parameters of decoded image blocks; The quantization parameter of the current block is determined according to the rate control parameter of the decoded image block.
3. The method according to claim 1, characterized in that After determining the quantization parameter of the current block according to the one or more rate control parameters, the method further includes: The quantization parameter is modified based on the one or more rate control parameters.
4. The method according to claim 1, characterized in that: After determining the quantization parameter according to the one or more rate control parameters, the method further includes: The one or more rate control parameters are updated.
5. A video decoding device, characterized in that: include: an acquisition module, configured to acquire information of an image to be decoded, wherein the information of the image to be decoded includes basic information of the image to be decoded and information of image blocks in the image to be decoded, wherein the information of image blocks in the image to be decoded includes an actual number of bits, and the actual number of bits is used to indicate the actual number of bits occupied by each decoded image block; A determination module, configured to determine one or more rate control parameters of a current block according to part or all of the information of the image to be decoded; The acquisition module is further used to acquire one or more rate control parameters of the current block in the image to be decoded; the rate control parameters of the current block include the predicted number of bits of the current block, the predicted number of bits refers to the estimated resources occupied by the current block after encoding, and the predicted number of bits of the current block is derived according to the weighted value of the actual number of bits of the first n decoded image blocks; The determination module is further configured to determine a quantization parameter of the current block according to the one or more rate control parameters; A processing module is used to decode the current block based on the quantization parameter of the current block.
6. A video decoder, characterized in that: including a processor and a memory; The memory stores instructions executable by the processor; When the processor is configured to execute the instructions, the video decoder implements the video decoding method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed on the computer, the computer is caused to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Rate control method and encoding device
CN109076212A
Apparatus and method for inverse quantization
CN112690000A