Quantization method and apparatus for video compression

By acquiring the state data of the previous x coding units, the temporal dependency between the current coding unit and the previous coding unit is removed, enabling parallel processing of quantization tasks in video compression. This solves the problem of high hardware costs and achieves the effect of saving hardware costs.

CN116389764BActive Publication Date: 2025-12-09PEKING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310035243.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-10
Publication Date
2025-12-09
Estimated Expiration
2043-01-10

AI Technical Summary

Technical Problem

In existing video compression technologies, there is a time-series dependency between the current encoding unit and the previous encoding unit, which leads to high hardware costs.

Method used

By obtaining the state data of the xth coding unit before the current coding unit when the encoding ends, the quantization parameters of the current coding unit are determined based on this state data, the timing dependency is eliminated, and the quantization tasks of the current coding unit and the previous coding unit are processed in parallel in time.

Benefits of technology

In the same amount of time, fewer computing units are used to process the target image, saving hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389764B_ABST
    Figure CN116389764B_ABST
Patent Text Reader

Abstract

The application provides a quantization method and device for video compression, the method comprising: obtaining first state data at the end of encoding of the xth coding unit before the current coding unit, x being an integer greater than 1; determining second state data of the current coding unit based on the first state data; and quantizing a target image block based on the second state data of the current coding unit; wherein the first state data and the second state data are parameters updated in real time in a code rate control process along with the encoding process of each coding unit. Based on this, the time sequence dependence between the current coding unit and the previous coding unit corresponding to the current coding unit is removed, the processing of the target image is completed using fewer computing units in the same time, and thus the hardware cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of video processing, in particular to a quantization method and device for video compression. BACKGROUND

[0002] With the continuous popularity of image and video applications, video light compression technology is also constantly iterating and innovating. Common video light compression standards such as display stream compression (DSC) standard, VESA display stream compression-M (VDC-M) standard, Apple ProRes codec and JPEG-XS standard are widely used in display interface fields such as High Definition Multimedia Interface (HDMI) and (display port, DP) and image / video production fields. The main purpose of general video light compression standards is to achieve 4-16 times data compression under the conditions of meeting low latency, low complexity and subjective lossless. Taking the more common DSC encoding standard as an example, the light compression encoding framework mainly includes input and output, cache slicing, prediction, quantization, reconstruction, entropy encoding, rate control and code stream synthesis modules, and other standards optionally have transform and other special tool modules.

[0003] The determination of the quantization parameter in the prior art is to make a quantization decision for the current coding unit according to the context state data after the coding of the previous coding unit ends. The coding processes of the current coding unit and the previous coding unit have a strong dependency in time sequence, so the two coding units must process the corresponding image blocks in sequence, and therefore there is a problem of high hardware cost. SUMMARY

[0004] The present application provides a quantization method and device for video compression, which provides a quantization method for video compression, realizes the processing of a target image by using fewer computing units in the same time, and thus saves hardware cost.

[0005] The present application provides a quantization method for video compression, which comprises the following steps: acquiring first state data at the end of the coding of the xth coding unit before the current coding unit, x being an integer greater than 1; determining second state data of the current coding unit based on the first state data; and quantizing a target image block based on the second state data of the current coding unit; wherein the first state data and the second state data are parameters that are updated in real time in the rate control process along with the coding process of each coding unit.

[0006] In one of the embodiments, the determining the second state data of the current coding unit based on the first state data comprises: determining the first state data as the second state data of the current coding unit; or determining the second state data of the current coding unit based on the first state data and third state data; wherein the third state data is the state data at the end of encoding of the xth coding unit before the current coding unit.

[0007] In one of the embodiments, the first state data is the fullness of the buffer; correspondingly, the determining the second state data of the current coding unit based on the first state data comprises: determining the fullness of the buffer at the end of encoding of the xth coding unit before the current coding unit as the fullness of the buffer corresponding to the current coding unit; or obtaining the first fullness of the buffer at the end of encoding of the xth coding unit before the current coding unit, and obtaining the maximum encoding cost and the number of output bits at the end of encoding of the first coding unit to the xth coding unit before the current coding unit; determining the difference between the sum of the first fullness and the maximum encoding cost and the number of output bits as the second fullness of the buffer corresponding to the current coding unit.

[0008] In one of the embodiments, the first state data is the actual encoding bit number of the coding unit; correspondingly, the determining the second state data of the current coding unit based on the first state data comprises: determining the actual encoding bit number of the coding unit at the end of encoding of the xth coding unit before the current coding unit as the actual encoding bit number of the coding unit corresponding to the current coding unit.

[0009] In one of the embodiments, the first state data is the target encoding bit number of the coding unit; correspondingly, the determining the second state data of the current coding unit based on the first state data comprises: determining the target encoding bit number of the coding unit at the end of encoding of the xth coding unit before the current coding unit as the target encoding bit number of the coding unit corresponding to the current coding unit.

[0010] In one of the embodiments, the first state data is a target texture complexity level; accordingly, the determining the first state data as the second state data of the current coding unit comprises: determining the target texture complexity level at the end of the encoding of the xth coding unit before the current coding unit as the target texture complexity level corresponding to the current coding unit. In one of the embodiments, the first state data is a distribution of quantization reconstruction error; accordingly, the determining the first state data as the second state data of the current coding unit comprises: determining the distribution of quantization reconstruction error at the end of the encoding of the xth coding unit before the current coding unit as the distribution of quantization reconstruction error corresponding to the current coding unit.

[0011] The application further provides a quantization device for video compression, comprising: an acquisition module, configured to acquire first state data at the end of the encoding of an xth coding unit before a current coding unit, x being an integer greater than 1; a first determination module, configured to determine second state data of the current coding unit based on the first state data; and a second determination module, configured to quantize a target image block based on the second state data of the current coding unit; wherein the first state data and the second state data are parameters updated in real time in a rate control process along with the encoding process of each coding unit.

[0012] The application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the quantization method for video compression according to any one of the above embodiments when executing the program.

[0013] The application further provides a non-transitory computer readable storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the quantization method for video compression according to any one of the above embodiments.

[0014] The quantization method and device for video compression provided by the application eliminate the time sequence dependency between the current coding unit and the previous coding unit corresponding thereto based on the first state data at the end of the encoding of the xth (x being an integer greater than 1) coding unit before the current coding unit, so that the quantization tasks corresponding to the current coding unit and the previous coding unit corresponding thereto can be processed in parallel in time, thereby achieving the effect of saving hardware cost by using fewer computing units to complete the processing of the target image in the same time. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative effort.

[0016] Figure 1 is a schematic diagram of the framework of the prior art video compression method;

[0017] Figure 2 is one of the flowcharts of the quantization method for video compression provided by the present application;

[0018] Figure 3 is a schematic diagram of the relationship between the coding units provided by the present application;

[0019] Figure 4 is a schematic diagram of the structure of the quantization device for video compression provided by the present application;

[0020] Figure 5 is a schematic diagram of the structure of the electronic device provided by the present application. DETAILED DESCRIPTION

[0021] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.

[0022] In order to facilitate understanding, the technical terms involved in the present application will be explained first.

[0023] Rate control: Rate control technology is a very important technical module in actual video encoder. According to the different specific application scenarios in practice, such as real-time or offline encoding, traditional broadcast television service or streaming media transmission service on the Internet, etc., the output rate of the video encoder also has various different specific requirements and restrictions, such as average or maximum target rate, buffer size, initial delay, etc. Rate control is to control the quantization parameter (quantization parameter, QP) of each frame or each coding unit for various different application scenarios, so that the output of the coded video rate meets the specific restriction requirements, and the coding performance, including coding efficiency and subjective quality, is also optimized as much as possible.

[0024] Code rate: Code rate is the number of data bits transmitted per unit of time, and the unit is kilobits per second (kbps).

[0025] In order to facilitate understanding, first, the technical problem of the present application is described.

[0026] It can be understood that, generally, the context state data of the current coding unit can be predicted according to the context state data of the previous coding unit of the current coding unit, and then the quantization parameter of the current coding unit is determined according to the predicted context state data, and then the image to be processed of the current coding unit is quantized according to the determined quantization parameter, but in this case, since the current coding unit and the previous coding unit corresponding to the current coding unit have time sequence dependence, that is, the current coding unit must wait until the previous coding unit of the current coding unit is processed to determine the corresponding quantization parameter, and then the image to be coded is quantized, resulting in the problem that a large number of calculation units are required to complete the processing of the image within a certain time. Therefore, how to realize the processing of the image with fewer calculation units in the same time, or with fewer calculation units (i.e. lower hardware cost) to complete the encoding of the image under the same encoding efficiency is a very important technical problem.

[0027] Therefore, in order to solve the problem of high hardware cost caused by the fact that the previous and subsequent coding units must be processed in sequence to process the corresponding image, the present application provides a quantization method and device for video compression.

[0028] The present application will be described below Figures 1-5 The present application provides a quantization method and device for video compression.

[0029] In order to facilitate understanding, Figure 1 An application example of the present application is exemplarily given. Taking the DSC coding standard as an example, as shown in the figure, Figure 1 The light compression coding framework mainly includes input, cache slice, flatness measurement, prediction, quantization, reconstruction, entropy coding, code rate control, code stream synthesis, encoding cache and output modules. Among them, the code rate control module can output the quantization parameter to the flatness measurement module and the prediction, quantization and reconstruction modules, and the entropy coding module can feedback the number of coding bits to the code rate control module. The quantization method for video compression of the present application can be mainly applied to the code rate control module in the above light compression coding framework.

[0030] It can be understood that the present application can be applied not only to DSC, but also to VDC-M, Apple ProRes and JPEG-XS video compression methods.

[0031] Figure 2 One of flowcharts of the quantization method for video compression provided by the present application is shown in FIG. 1. It can be understood that the quantization method for video compression can be applied to the field of video compression, and can be executed by a rate control device, which comprises:

[0032] In step 210, first state data at the end of encoding of the xth encoding unit before the current encoding unit is obtained, where x is an integer greater than 1.

[0033] The first state data is a parameter updated in real time in the rate control process with the encoding process of each encoding unit.

[0034] It can be understood that if the current encoding unit is the Ith encoding unit, the xth encoding unit before the current encoding unit is the encoding unit counted from the Ith encoding unit to the front x encoding units. Specifically, the xth encoding unit before the current encoding unit can be referred to the related description of the xth encoding unit before the current encoding unit in the rate control device and the rate control method for video compression provided by the present application, which will not be repeated here for brevity. In addition, the determination of the value of x can be based on the specific circumstances of the target image block of the current encoding unit, such as in the case where the texture complexity of the target encoding block is close to the texture complexity of the image block of the xth encoding unit before the current encoding unit, the first state data at the end of encoding of the xth encoding unit before the current encoding unit is obtained, and the second state data of the current encoding unit is determined based on the first state data. Figure 3

[0035] It can also be understood that setting x as an integer greater than 1 can reduce the time sequence dependence of the current encoding unit and the previous encoding unit, and further can achieve the processing of the image using fewer computing units in the same time. In order to facilitate understanding, the following is an example. Exemplarily, the original processing needs the 2nd encoding unit to process the 3rd encoding unit before processing, and now x is set to 2, so the 3rd encoding unit does not need to wait for the 2nd encoding unit to finish processing, and the 3rd encoding unit can process the image block responsible for itself after the 1st encoding unit finishes processing. That is to say, the 2nd encoding unit and the 3rd encoding unit can be processed in parallel in time after the 1st encoding unit finishes processing, so that the processing of the image using fewer computing units in the same time can be achieved, thereby achieving the effect of saving hardware cost.

[0036] ​The time parallel processing, i.e. the pipeline, refers to dividing the to-be-processed task into multiple subtasks, the multiple subtasks can be processed in parallel, and when the parallel processing is performed, if the multiple subtasks can be completed by using the same time interval as when the parallel processing is not performed, the multiple subtasks can reuse a part of the calculation units, thereby saving the calculation resources and achieving the effect of reducing the hardware cost. That is, the same task is completed in the same time, which cannot be processed in parallel in the original time, and a part of the calculation units can be reused when the parallel processing in the time is implemented. In this way, a part of the calculation units can complete the work of two parts of the calculation units, thereby saving the calculation resources and achieving the effect of reducing the hardware cost.

[0037] In step 220, second state data of the current coding unit is determined based on the first state data.

[0038] The second state data is state data of the current coding unit corresponding to the first context state data.

[0039] As can be known from the foregoing description, because the current coding unit has a time sequence dependence on the previous coding unit, a large number of calculation units are required to complete the processing of the image in a certain time. Therefore, in order to solve the problem of time sequence dependence, the second state data of the current coding unit is determined according to the first state data at the end of the encoding of the xth coding unit before the previous coding unit.

[0040] In step 230, a target image block is quantized based on the second state data of the current coding unit.

[0041] The target image block is a part of a complete target image, and is an image block that needs to be quantized by the current coding unit. It can be understood that a complete image can be divided into multiple image blocks, and each image block is quantized and encoded by a corresponding coding unit.

[0042] It can be understood that the second state data is state data of the current coding unit corresponding to the first context state data, which can be understood as a parameter that is updated in real time during the rate control process with the encoding process of each coding unit. Therefore, the second state data can be used as a quantization parameter of the current coding unit, and the quantization of the image can be implemented according to the quantization parameter. Therefore, the target image block can be quantized according to the second state data.

[0043] It can also be understood that the process of quantizing the target image block according to the second state data can refer to the prior art, and the present application does not limit this.

[0044] The application provides a quantization method for video compression, which releases the time sequence dependency between a current coding unit and a previous coding unit corresponding to the current coding unit based on first state data at the end of coding of the xth coding unit before the current coding unit, so that the quantization tasks of the current coding unit and the previous coding unit corresponding to the current coding unit can be processed in parallel in time, thereby achieving the effect of saving hardware cost by using fewer calculation units to complete the processing of the target image in the same time.

[0045] In one of the embodiments, the determining of the second state data of the current coding unit based on the first state data comprises:

[0046] determining the first state data as the second state data of the current coding unit; or

[0047] determining the second state data of the current coding unit based on the first state data and third state data; wherein the third state data is the state data at the end of coding of the xth coding unit before the current coding unit.

[0048] In one of the embodiments, the first state data is the fullness of a buffer; correspondingly, the determining of the second state data of the current coding unit based on the first state data comprises:

[0049] determining the fullness of the buffer at the end of coding of the xth coding unit before the current coding unit as the fullness of the buffer corresponding to the current coding unit; or

[0050] obtaining the first fullness of the buffer at the end of coding of the xth coding unit before the current coding unit, and obtaining the maximum coding cost and the number of output bits at the end of coding of the first coding unit to the xth coding unit before the current coding unit; determining the difference between the sum of the first fullness and the maximum coding cost and the number of output bits as the second fullness of the buffer corresponding to the current coding unit.

[0051] In one of the embodiments, the maximum coding cost at the end of coding of the first coding unit to the xth coding unit before the current coding unit can be the maximum coding cost at the end of coding of the first coding unit to the xth coding unit before the current coding unit in an ideal case, or can be a preset value.

[0052] It can be understood that the encoding buffer outputs the code stream during the encoding of the xth encoding unit before the first encoding unit to the current encoding unit, and therefore, when the first filling degree of the buffer based on the end of the encoding of the xth encoding unit before the current encoding unit and the maximum encoding cost at the end of the encoding of the xth encoding unit before the first encoding unit to the current encoding unit are used to calculate the filling degree of the buffer corresponding to the current encoding unit, the number of corresponding output bits needs to be subtracted.

[0053] In one of the embodiments, the first state data is the actual encoding bit number of the encoding unit, and correspondingly, the determination of the first state data as the second state data of the current encoding unit includes:

[0054] The actual encoding bit number of the encoding unit at the end of the encoding of the xth encoding unit before the current encoding unit is determined as the actual encoding bit number of the encoding unit corresponding to the current encoding unit.

[0055] The actual encoding bit number is the actual bit number reached after the compression of the target image block.

[0056] In one of the embodiments, the first state data is the target encoding bit number of the encoding unit, and correspondingly, the determination of the first state data as the second state data of the current encoding unit includes:

[0057] The target encoding bit number of the encoding unit at the end of the encoding of the xth encoding unit before the current encoding unit is determined as the target encoding bit number of the encoding unit corresponding to the current encoding unit.

[0058] The target encoding bit number is the expected bit number reached after the compression of the target image block.

[0059] In one of the embodiments, the first state data is the target texture complexity level; correspondingly, the determination of the first state data as the second state data of the current encoding unit includes:

[0060] The target texture complexity level at the end of the encoding of the xth encoding unit before the current encoding unit is determined as the target texture complexity level corresponding to the current encoding unit.

[0061] In one of the embodiments, the first state data is the distribution of quantized reconstruction error; correspondingly, the determination of the first state data as the second state data of the current encoding unit includes:

[0062] The distribution of quantized reconstruction error at the end of the encoding of the xth encoding unit before the current encoding unit is determined as the distribution of quantized reconstruction error corresponding to the current encoding unit.

[0063] Figure 3 The relationship between the coding units provided by the present application is shown in the following table. Figure 3 As shown in the table, if the current coding unit is the Ith coding unit, then the xth coding unit before the current coding unit is the (I-x)th coding unit.

[0064] The quantization device for video compression provided by the present application is described below. The quantization device for video compression described below can be referred to the quantization method for video compression described above.

[0065] Figure 4 The quantization device for video compression provided by the present application is shown in the following table. Figure 4 As shown in the table, the quantization device for video compression provided by the present application comprises:

[0066] The acquisition module 410 is configured to acquire first state data at the end of encoding of the xth coding unit before the current coding unit, wherein x is an integer greater than 1.

[0067] The first determination module 420 is configured to determine second state data of the current coding unit based on the first state data.

[0068] The second determination module 430 is configured to quantize the target image block based on the second state data of the current coding unit.

[0069] The first state data and the second state data are parameters updated in real time in the rate control process along with the encoding process of each coding unit.

[0070] The quantization device for video compression provided by the present application removes the time sequence dependency between the current coding unit and the previous coding unit corresponding to the current coding unit based on the first state data at the end of encoding of the xth coding unit before the current coding unit, wherein x is an integer greater than 1, so that the quantization tasks of the current coding unit and the previous coding unit corresponding to the current coding unit can be processed in parallel in time, thereby achieving the effect of saving hardware cost by using fewer computing units to complete the processing of the target image in the same time.

[0071] In one embodiment, the first determination module 420 comprises:

[0072] The first determination unit is configured to determine the first state data as the second state data of the current coding unit; or

[0073] a second determining unit, configured to determine second state data of a current coding unit based on the first state data and third state data, wherein the third state data is state data at the end of encoding of an xth coding unit before the current coding unit.

[0074] In one of the embodiments, the first state data is a buffer fullness; accordingly, the first determining module 420 comprises:

[0075] a third determining unit, configured to determine the buffer fullness at the end of encoding of the xth coding unit before the current coding unit as the buffer fullness of the buffer corresponding to the current coding unit; or,

[0076] a processing unit, configured to obtain a first buffer fullness of the buffer at the end of encoding of the xth coding unit before the current coding unit, and obtain a maximum encoding cost and a number of output bits at the end of encoding of the first coding unit to the xth coding unit before the current coding unit; and determine a second buffer fullness of the buffer corresponding to the current coding unit as a difference between a sum of the first buffer fullness and the maximum encoding cost and the number of output bits.

[0077] In one of the embodiments, the first state data is a number of actual encoding bits of a coding unit; accordingly, the first determining unit comprises:

[0078] a fourth determining unit, configured to determine the number of actual encoding bits of the coding unit at the end of encoding of the xth coding unit before the current coding unit as the number of actual encoding bits of the coding unit corresponding to the current coding unit.

[0079] In one of the embodiments, the first state data is a target number of encoding bits of a coding unit; accordingly, the first determining unit comprises:

[0080] a fifth determining unit, configured to determine the target number of encoding bits of the coding unit at the end of encoding of the xth coding unit before the current coding unit as the target number of encoding bits of the coding unit corresponding to the current coding unit.

[0081] In one of the embodiments, the first state data is a target texture complexity level; accordingly, the first determining unit comprises:

[0082] a sixth determining unit, configured to determine the target texture complexity level at the end of encoding of the xth coding unit before the current coding unit as the target texture complexity level corresponding to the current coding unit.

[0083] In one of the embodiments, the first state data is a distribution of quantization reconstruction error; accordingly, the first determining unit comprises:

[0084] A seventh determining unit is configured to determine the distribution of quantization reconstruction errors at the end of encoding of the xth coding unit before the current coding unit as the distribution of quantization reconstruction errors corresponding to the current coding unit.

[0085] Figure 5 An example of a schematic diagram of a physical structure of an electronic device is shown in Figure 5 As shown in the figure, the electronic device can include a processor 510, a communications interface 520, a memory 530, and a communications bus 540, wherein the processor 510, the communications interface 520, and the memory 530 can communicate with each other through the communications bus 540. The processor 510 can invoke the logic instructions in the memory 530 to execute a quantization method for video compression, which includes: obtaining first state data at the end of encoding of the xth coding unit before the current coding unit, x being an integer greater than 1; determining second state data of the current coding unit based on the first state data; and quantizing a target image block based on the second state data of the current coding unit; wherein the first state data and the second state data are parameters that are updated in real time in a rate control process along with the encoding process of each coding unit.

[0086] In addition, the logic instructions in the memory 530 described above can be implemented in the form of a software functional unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, read-only memory), a random access memory (RAM, random access memory), a magnetic disk or an optical disk, and various program code storage media.

[0087] In another aspect, the present application also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions that, when executed by a computer, enable the computer to perform the quantization method for video compression provided by the present application, the method comprising: obtaining first state data at the end of encoding of an xth coding unit before a current coding unit, x being an integer greater than 1; determining second state data of the current coding unit based on the first state data; and quantizing a target image block based on the second state data of the current coding unit; wherein the first state data and the second state data are parameters that are updated in real time in a rate control process along with the encoding process of each coding unit.

[0088] In another aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement a quantization method for video compression provided by the present application, the method comprising: obtaining first state data at the end of encoding of an xth coding unit before a current coding unit, x being an integer greater than 1; determining second state data of the current coding unit based on the first state data; and quantizing a target image block based on the second state data of the current coding unit; wherein the first state data and the second state data are parameters that are updated in real time in a rate control process along with the encoding process of each coding unit.

[0089] The device embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separate, and the components illustrated as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0090] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus necessary universal hardware platforms, and of course can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in terms of the contribution to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0091] It can be understood that the above embodiments are only used to illustrate the technical solutions of the present application, but not limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features therein can be replaced by equivalent ones; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A quantization method for video compression, characterized in that, The method comprises the following steps: acquiring first state data at the end of encoding of the xth coding unit before the current coding unit, x being an integer greater than 1; the xth coding unit before the current coding unit being the coding unit x coding units forward from the current coding unit; determining second state data of the current coding unit based on the first state data; quantizing a target image block based on the second state data of the current coding unit; wherein the first state data and the second state data are parameters updated in real time in a code rate control process along with the encoding process of each coding unit.

2. The quantization method for video compression according to claim 1, wherein, The step of determining the second state data of the current coding unit based on the first state data comprises: determining the first state data as the second state data of the current coding unit; or determining the second state data of the current coding unit based on the first state data and third state data; wherein the third state data is state data at the end of encoding of the 1st coding unit to the xth coding unit before the current coding unit.

3. The quantization method for video compression according to claim 2, wherein, The first state data is the fullness of a buffer; correspondingly, the step of determining the second state data of the current coding unit based on the first state data comprises: determining the fullness of the buffer at the end of encoding of the xth coding unit before the current coding unit as the fullness of the buffer corresponding to the current coding unit; or acquiring the first fullness of the buffer at the end of encoding of the xth coding unit before the current coding unit, and acquiring the maximum encoding cost and the number of output bits at the end of encoding of the 1st coding unit to the xth coding unit before the current coding unit; determining the difference between the sum of the first fullness and the maximum encoding cost and the number of output bits as the second fullness of the buffer corresponding to the current coding unit.

4. The quantization method for video compression according to claim 2, wherein, The first state data is the actual encoding bit number of a coding unit; correspondingly, the step of determining the first state data as the second state data of the current coding unit comprises: determining the actual encoding bit number of the coding unit at the end of encoding of the xth coding unit before the current coding unit as the actual encoding bit number of the coding unit corresponding to the current coding unit.

5. The quantization method for video compression according to claim 2, wherein, The first state data is the target encoding bit number of a coding unit; correspondingly, the step of determining the first state data as the second state data of the current coding unit comprises: determining the target encoding bit number of the coding unit at the end of encoding of the xth coding unit before the current coding unit as the target encoding bit number of the coding unit corresponding to the current coding unit.

6. The quantization method for video compression according to claim 2, wherein, The first state data is a target texture complexity level; correspondingly, the step of determining the first state data as the second state data of the current coding unit comprises: determining the target texture complexity level at the end of encoding of the xth coding unit before the current coding unit as the target texture complexity level corresponding to the current coding unit.

7. The quantization method for video compression according to claim 2, wherein, The first state data is the distribution of quantization reconstruction error; correspondingly, the step of determining the first state data as the second state data of the current coding unit comprises: The distribution of quantization reconstruction errors at the end of encoding the xth coding unit before the current coding unit is determined as the distribution of quantization reconstruction errors corresponding to the current coding unit.

8. A quantization apparatus for video compression, characterized by, The method comprises the following steps: an acquisition module, configured to acquire first state data at the end of encoding the xth coding unit before the current coding unit, x being an integer greater than 1; the xth coding unit before the current coding unit being the coding unit counted x coding units forward from the current coding unit; a first determination module, configured to determine second state data of the current coding unit based on the first state data; a second determination module, configured to quantize a target image block based on the second state data of the current coding unit. The first state data and the second state data are parameters updated in real time in a code rate control process along with the encoding process of each coding unit.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps of the quantization method for video compression according to any one of claims 1 to 7. 10.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the quantization method for video compression according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Video encoder and video encoding method

    CN107241605A

  • Video coding rate control method and device, equipment and storage medium

    CN110324622A