Image coding parameter determination method and device, electronic equipment, chip and storage medium

By determining the image encoding parameters, the problem of difficult balance of compression rate and subjective quality in image compression is solved, and the system resource saving and work efficiency improvement are achieved.

CN119815043APending Publication Date: 2025-04-11BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311308318.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art is difficult to achieve efficient compression rate and subjective quality balance in image compression, resulting in waste of system power consumption, bandwidth and storage resources.

Method used

By determining the most suitable image encoding parameter, namely the quantization parameter (QP), the image is compressed according to QP. The method includes acquiring candidate QPs according to the bit width of the image to be processed, acquiring the first code stream and the second code stream based on these QPs, and finally determining the target QPs to achieve image compression.

Benefits of technology

It realizes the system power consumption, bandwidth and storage while ensuring the subjective quality and compression rate balance of image compression processing, and improving system work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119815043A_ABST
    Figure CN119815043A_ABST
Patent Text Reader

Abstract

The invention provides an image coding parameter determination method and device, electronic equipment, a chip and a storage medium, and the method comprises the steps: obtaining a plurality of candidate quantization parameters QP according to the bit width of a to-be-processed image; obtaining a plurality of first code streams based on a plurality of first QPs in the plurality of candidate QPs; determining a plurality of second QPs based on the plurality of first code streams, and obtaining a plurality of second code streams; and determining a target QP based on the plurality of second code streams, the target QP being used for performing image compression processing on the to-be-processed image. According to the scheme provided by the invention, the system power consumption, bandwidth and storage can be saved and the system working efficiency can be improved while the subjective quality and compression rate balance of image compression processing can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image compression, and in particular to a method, device, electronic device, chip and storage medium for determining image coding parameters. Background Art

[0002] In image compression technology, frame buffer compression technology is mainly used inside the chip for cache compression processing in image processing. The main purpose of frame buffer compression is to reduce hardware and bandwidth resources, but at the same time, it requires that the image cannot be significantly damaged. Therefore, the compression rate will be limited and the compression effect is poor. In order to achieve higher compression quality and compression rate, a bitrate control algorithm can be used. This algorithm can reasonably allocate the compression rate of different texture areas to achieve a balance between subjective quality and compression rate. Summary of the invention

[0003] The present disclosure provides a method, device, electronic device, chip and storage medium for determining image coding parameters, which can realize the selection of the most appropriate image coding parameter, namely, quantization parameter (QP), and perform image compression processing according to QP, while achieving a balance between subjective quality and compression rate, saving system power consumption, bandwidth and storage, and improving system working efficiency.

[0004] A first aspect embodiment of the present disclosure proposes a method for determining image coding parameters, the method comprising: obtaining multiple candidate quantization parameters QP according to the bit width of the image to be processed; obtaining multiple first code streams based on multiple first QPs among the multiple candidate QPs; determining multiple second QPs based on the multiple first code streams, and obtaining multiple second code streams; determining a target QP based on the multiple second code streams, the target QP being used for image compression processing of the image to be processed.

[0005] In some embodiments of the present disclosure, obtaining multiple first code streams based on multiple first QPs among multiple candidate QPs includes: determining multiple first QPs from multiple candidate QPs at preset intervals; and pre-encoding a first area in a to-be-processed image based on the multiple first QPs to obtain multiple first code streams corresponding to each of the multiple first QPs.

[0006] In some embodiments of the present disclosure, determining multiple second QPs based on multiple first codestreams, and obtaining multiple second codestreams includes: determining an intermediate codestream based on the multiple first codestreams, where the intermediate codestream is a codestream that meets a preset codestream condition among the multiple first codestreams; determining multiple second QPs based on the intermediate codestream; and pre-encoding a first area of ​​the image to be processed based on the multiple second QPs to obtain multiple second codestreams corresponding to each of the multiple second QPs.

[0007] In some embodiments of the present disclosure, determining a plurality of second QPs based on the intermediate code stream includes: determining an intermediate QP corresponding to the intermediate code stream from a plurality of first QPs; and determining a plurality of second QPs within a preset range from the intermediate QP.

[0008] In some embodiments of the present disclosure, determining a target QP based on multiple second codestreams includes: determining a target codestream based on the multiple second codestreams, where the target codestream is a codestream that meets a preset codestream condition among the multiple second codestreams; and determining a target QP corresponding to the target codestream from the multiple second QPs.

[0009] In some embodiments of the present disclosure, the preset bitstream condition includes at least one of the following: the length of the current bitstream is less than or equal to the preset bitstream length; the QP corresponding to the current bitstream is the smallest; the QP corresponding to the current bitstream is in a preset range; the difference between the QP corresponding to the current bitstream and the QP corresponding to the reference bitstream is less than or equal to a preset value, and the reference bitstream is obtained by pre-encoding the second area of ​​the image to be processed.

[0010] A second aspect of the present disclosure provides a device for determining image coding parameters, the device comprising: a first acquisition module, used to acquire multiple candidate quantization parameters QP according to the bit width of the image to be processed; a second acquisition module, used to acquire multiple first code streams based on multiple first QPs among the multiple candidate QPs; a first determination module, used to determine multiple second QPs based on the multiple first code streams, and acquire multiple second code streams; a second determination module, used to determine a target QP based on the multiple second code streams, and the target QP is used to perform image compression processing on the image to be processed.

[0011] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect embodiment of the present disclosure, or execute the method described in the second aspect embodiment of the present disclosure.

[0012] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure, or to execute the method described in the second aspect embodiment of the present disclosure.

[0013] The fifth aspect embodiment of the present disclosure proposes a chip, which includes one or more interfaces and one or more processors; the interface is used to receive signals from a memory of an electronic device and send signals to the processor, the signals include computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the method described in the first aspect embodiment of the present disclosure, or executes the method described in the second aspect embodiment of the present disclosure.

[0014] In summary, the method, device, electronic device, chip and storage medium for determining image coding parameters proposed in the present disclosure obtain multiple candidate quantization parameters QP according to the bit width of the image to be processed; obtain multiple first code streams based on multiple first QPs among the multiple candidate QPs; determine multiple second QPs based on the multiple first code streams and obtain multiple second code streams; determine the target QP based on the multiple second code streams, and use the target QP to compress the image to be processed, so as to achieve the balance between subjective quality and compression rate in the image compression processing, save system power consumption, bandwidth and storage, and improve system work efficiency.

[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0017] Figure 1 A flowchart of a method for determining image coding parameters provided by an embodiment of the present disclosure;

[0018] Figure 2 A flowchart of a method for determining image coding parameters provided by an embodiment of the present disclosure;

[0019] Figure 3 A flowchart of a method for determining image coding parameters provided by an embodiment of the present disclosure;

[0020] Figure 4 A flowchart of a method for determining image coding parameters provided by an embodiment of the present disclosure;

[0021] Figure 5 An example diagram of determining an image coding parameter provided by an embodiment of the present disclosure;

[0022] Figure 6 A schematic diagram of the structure of a device for determining image coding parameters provided by an embodiment of the present disclosure;

[0023] Figure 7A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;

[0024] Figure 8 A schematic diagram of the chip structure provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0026] Among various technologies for compressing data, the development of image compression processing technology has received more attention. The main reason is that there is a large amount of data redundancy and subjective visual redundancy in digital image and video data, which will occupy a large amount of storage and bandwidth, increase system power consumption, and waste resources on the one hand. On the other hand, the transmission rate of large data packets will also be reduced, which does not meet the efficient requirements for data transmission. Therefore, image compression processing is very necessary. Among them, frame buffer compression is mainly used for cache compression for image processing inside the chip. In order to facilitate image reconstruction, frame buffer compression needs to reduce hardware storage and bandwidth resources while ensuring that there is no obvious damage to the image after compression. Under such requirements, the compression rate is limited and the compression effect is poor. In order to achieve a better compression effect, a code stream control algorithm can be used. By performing different compression on different texture areas, a balance between subjective quality and compression rate can be achieved.

[0027] When compressing different texture areas, different QPs need to be determined for different texture areas. When selecting QP for a specific area, usually the number of encodings required is the number of groups of QPs. The problem caused by this is that the system processing efficiency is reduced. The overall parallel processing can improve the efficiency to a certain extent, but the system power consumption is large, which will greatly occupy the system bandwidth and storage resources. The usual solution to this type of problem is to set an interval and select QP within the interval, which can reduce the number of traversals. However, the set interval is an estimated value, and in extreme cases, the key QP value may be missed. For example, when encountering a scene with simpler textures, a lower QP value needs to be taken. There is a possibility that it cannot be obtained within the set interval, which will result in poor compressed image quality.

[0028] In summary, in order to solve the technical problems in the related art, the embodiments of the present disclosure provide a method for determining image coding parameters, by obtaining multiple first code streams based on multiple first QPs; determining multiple second QPs based on the multiple first code streams and obtaining multiple second code streams; and determining the target QP based on the multiple second code streams, thereby achieving QP hierarchical processing, reducing the number of traversals, and saving power consumption, bandwidth, and storage of the system.

[0029] Figure 1 The following is a flow chart of a method for determining image coding parameters provided by an embodiment of the present disclosure. Figure 1 As shown, the method can be executed by an electronic device, optionally, the method can be executed by a network device, optionally, the method can be executed by a server. The method can include the following steps.

[0030] Step 101: Obtain multiple candidate quantization parameters QP according to the bit width of the image to be processed.

[0031] In some embodiments, the image to be processed may be an image to be compressed.

[0032] In some embodiments, the QP value range may be selected according to the bit width of the image to be processed. For example, if the bit width of a certain image data is 10 bits, the QP value range is QP0-QP9.

[0033] In some embodiments, the multiple candidate quantization parameters QP may be all or part of the QP values ​​within the QP value range in the above embodiments.

[0034] Step 102: Acquire multiple first code streams based on multiple first QPs among multiple candidate QPs.

[0035] In some embodiments, the plurality of first QPs may be obtained by sampling the plurality of candidate QPs at a certain interval, and the interval value may be manually specified.

[0036] In some embodiments, multiple first QPs may be pre-encoded separately to obtain multiple first code streams.

[0037] In some embodiments, the precoding process may include residual quantization, encoding and other processing procedures.

[0038] In some embodiments, the encoding in the precoding process can be performed using two encoding modes. The first is constant bit rate (CBR). In the CBR mode, the encoded data can be directly obtained through the address offset to achieve random access to the data. The second mode is variable bit rate (VBR). In the VBR mode, additional storage of address location information is required to achieve random access.

[0039] In the above embodiment, when encoding, both encoding modes are used for encoding. When outputting bitstreams, the bitstreams obtained by the two modes can be compared, and the bitstream information with a smaller code length can be selected and input into the bitstream control module.

[0040] In the above embodiment, two encoding modes are used to solve the problem that the length of the code after encoding is longer than that before encoding, which may occur in variable-length encoding.

[0041] Step 103: determine multiple second QPs based on the multiple first bitstreams, and obtain multiple second bitstreams.

[0042] In some embodiments, the bitstream control module may perform interval decision on multiple first bitstream information and select a QP value interval that meets the requirements.

[0043] In some embodiments, the bitstream control module can perform QP selection control based on the bitstream information obtained by pre-coding. The main purpose of the bitstream control module is to judge the bitstream based on preset bitstream conditions to select a QP that meets the conditions for image compression.

[0044] In some embodiments, the preset bitstream condition includes at least one of the following: the length of the current bitstream is less than or equal to the preset bitstream length; the QP corresponding to the current bitstream is the smallest; the QP corresponding to the current bitstream is in a preset range; the difference between the QP corresponding to the current bitstream and the QP corresponding to the reference bitstream is less than or equal to a preset value, and the reference bitstream is obtained by pre-encoding the second area of ​​the image to be processed.

[0045] In some embodiments, the second QP may be determined according to a plurality of first code streams, and the main steps include: determining an intermediate code stream according to the plurality of first code streams, where the intermediate code stream is a code stream that meets a preset code stream condition among the plurality of first code streams; obtaining a first QP corresponding to the intermediate code stream according to the intermediate code stream, and determining the first QP as the intermediate QP; and determining a plurality of second QPs according to the intermediate QPs.

[0046] In some embodiments, multiple second QPs may be pre-encoded respectively to obtain multiple second code streams.

[0047] Step 104: determine a target QP based on the multiple second code streams, where the target QP is used to perform image compression processing on the image to be processed.

[0048] In some embodiments, the bitstream control module may perform QP decision on multiple second bitstreams to determine second bitstream information that meets the conditions.

[0049] In some embodiments, the corresponding second QP may be acquired according to the determined second code stream information.

[0050] In some embodiments, the determined second QP may be used as a target QP, and the image may be compressed using the target QP.

[0051] In summary, in the above embodiments of the present application, multiple second QPs are determined based on multiple first QPs and code streams of multiple second QPs are obtained, and a target QP is determined according to the code streams of the multiple second QPs. The image is compressed according to the target QP. This hierarchical processing method can save system power consumption, bandwidth and storage, and improve system working efficiency.

[0052] Figure 2 The following is a flow chart of a method for determining image coding parameters provided by an embodiment of the present disclosure. Figure 2 As shown, based on Figure 1 In the embodiment shown, this embodiment specifically describes the above step 102. The method may include the following steps.

[0053] Step 201, determining a plurality of first QPs from a plurality of candidate QPs according to a preset interval;

[0054] In some embodiments, the multiple candidate QPs may be all QPs within a QP value range, where the QP value range is determined by the bit width of the image to be processed.

[0055] In some embodiments, the interval may be preset and may be specified in advance according to a specific QP value range and actual needs.

[0056] In some embodiments, multiple first QPs can be obtained by sampling multiple candidate QPs at preset intervals. For example, when the QP value range is QP0 to QP9, QP0, QP3, QP6, and QP9 can be selected as the first QP, and the preset interval is 2; or QP0, QP4, and QP8 can be selected as the first QP, and the preset interval is 3.

[0057] Step 202: pre-encode a first region in the image to be processed based on a plurality of first QPs to obtain a plurality of first code streams corresponding to the plurality of first QPs respectively.

[0058] In some embodiments, the first area may be a part of the image to be processed, for example, a pixel area of ​​3*3 in size on the image to be processed.

[0059] In some embodiments, compression processing of the image in the first region can achieve division of the image by region and compression processing of the image in units of region, and can achieve random access decoding by block, which can be used for data caching of image algorithms that require random access.

[0060] In some embodiments, the pre-coding process may include performing pre-processing such as residual quantization and encoding on the first region. Through the pre-coding process, multiple first code streams corresponding to multiple first QPs may be obtained.

[0061] In some embodiments, the first code stream may be used to determine a preset code stream condition, and may reflect the effect of the first QP on image compression processing.

[0062] In summary, the above embodiments of the present application determine multiple first QPs according to multiple candidate QPs, and pre-encode the first region based on the multiple first QPs to obtain multiple first code streams, thereby realizing the first-level QP decision in the QP classification, narrowing the value range of the QP, and not traversing the QP outside the range, thereby reducing the number of traversals and saving the power consumption, bandwidth and storage of the system; secondly, the present application can realize random access decoding by block by compressing the image of the first region.

[0063] Figure 3 The following is a flow chart of a method for determining image coding parameters provided by an embodiment of the present disclosure. Figure 3 As shown, based on Figure 1 In the embodiment shown, this embodiment specifically describes the above step 103. The method may include the following steps.

[0064] Step 301: determine an intermediate code stream based on multiple first code streams, where the intermediate code stream is a code stream that meets a preset code stream condition among the multiple first code streams.

[0065] In some embodiments, the bitstream control module may determine the intermediate bitstream based on a plurality of first bitstreams.

[0066] In some embodiments, the preset bitstream condition may include any one of the following 1) to 4):

[0067] 1) The length of the current bitstream is less than or equal to the preset bitstream length.

[0068] In some embodiments, the current code stream may be an intermediate code stream.

[0069] In some embodiments, in order to ensure the compression rate, the code stream control module may preset an ideal code stream length. When the length of the intermediate code stream is less than or equal to the preset length, the compression rate meets the requirement.

[0070] 2) The QP corresponding to the current bitstream is the smallest.

[0071] In some embodiments, the QP value can be used to indicate the degree of image compression. The higher the QP value, the higher the degree of compression, the more information is lost, and the worse the image quality; the lower the QP value, the less information is lost, and the better the image quality.

[0072] In some embodiments, multiple first QPs corresponding to multiple first code streams may be obtained, and a code stream corresponding to a minimum value of the multiple first QPs may be selected as an intermediate code stream.

[0073] 3) The QP corresponding to the current bitstream is within the preset range.

[0074] In some embodiments, the preset interval may be a QP value range obtained according to the bit width of the data to be processed.

[0075] 4) A difference between a QP corresponding to the current bitstream and a QP corresponding to a reference bitstream is less than or equal to a preset value, and the reference bitstream is obtained by pre-encoding the second region of the image to be processed.

[0076] In some embodiments, the second region may be a region on the same image, which is adjacent to or close to the first region and has a determined QP value.

[0077] In some embodiments, when the QP values ​​of two adjacent or neighboring areas differ too much, the image will be discontinuous. In order to ensure the smooth transition of the image, the QP values ​​of the adjacent areas should not differ too much. A value can be preset to judge the difference between the QP values ​​of the intermediate code stream and the reference code stream. When the difference is less than or equal to the preset value, the preset code stream condition is met.

[0078] For example, if the preset value is set to 1, the difference in QP values ​​between two adjacent or similar areas should be within the range of ±1. If it exceeds this range, the image will appear uneven, so the QP value does not meet the preset bitstream condition.

[0079] Step 302: Determine a plurality of second QPs based on the intermediate code stream.

[0080] Determine an intermediate QP corresponding to the intermediate code stream from a plurality of first QPs;

[0081] In some embodiments, an intermediate code stream that meets a preset code stream condition may be selected according to multiple first code streams corresponding to multiple first QPs, and the QP corresponding to the intermediate code stream may be determined as the intermediate QP.

[0082] A plurality of second QPs within a preset range from the middle QP are determined.

[0083] In some embodiments, after the middle QP is determined, a QP that is smaller than the middle QP and has not been traversed may be selected as the second QP within a sampling interval.

[0084] For example, when the QP value range is QP0 to QP9, QP0, QP3, QP6, and QP9 can be taken as the first QP according to a certain interval sampling. When the intermediate QP is determined to be QP0 according to the preset bitstream condition, since QP0 is already the minimum QP, QP0 can be directly determined as the target QP; when the intermediate QP is determined to be QP6 according to the preset bitstream condition, QP4 and QP5 can be used as the second QP; when judging according to the preset bitstream condition, QP9 still does not meet the condition, and QP9 can be determined as the target QP.

[0085] Step 303: pre-encode the first region of the image to be processed based on the multiple second QPs to obtain multiple second code streams corresponding to the multiple second QPs respectively.

[0086] In some embodiments, the precoding process based on the second QP is consistent with the above step 202 and will not be described again here.

[0087] In summary, the above embodiments of the present application narrow the selection range of QP by determining the second QP based on the intermediate code stream, only partially traverse and do not miss the most suitable QP, thereby saving power consumption, bandwidth and storage of the system.

[0088] Figure 4 The following is a flow chart of a method for determining image coding parameters provided by an embodiment of the present disclosure. Figure 4 As shown, based on Figure 1 In the embodiment shown, this embodiment specifically describes the above step 104. The method may include the following steps.

[0089] Step 401, determining a target bitstream based on multiple second bitstreams, where the target bitstream is a bitstream that meets a preset bitstream condition among the multiple second bitstreams;

[0090] The preset bitstream condition may include any one of the following 1) to 4):

[0091] 1) The length of the current bitstream is less than or equal to the preset bitstream length.

[0092] In some embodiments, the current code stream may be a target code stream.

[0093] In some embodiments, in order to ensure the compression rate, the code stream length may be preset, and when the target code stream length is less than or equal to the preset length, the compression rate meets the requirement.

[0094] 2) The QP corresponding to the current bitstream is the smallest.

[0095] In some embodiments, the QP value can be used to indicate the degree of image compression. The higher the QP value, the higher the degree of compression, the more information is lost, and the worse the image quality; the lower the QP value, the less information is lost, and the better the image quality.

[0096] In some embodiments, multiple second QPs corresponding to multiple second bitstreams may be obtained, and a bitstream corresponding to a minimum value of the multiple second QPs may be selected as a target bitstream.

[0097] 3) The QP corresponding to the current bitstream is within the preset range.

[0098] In some embodiments, the preset interval may be a QP value range obtained according to the bit width of the data to be processed.

[0099] 4) A difference between a QP corresponding to the current bitstream and a QP corresponding to a reference bitstream is less than or equal to a preset value, and the reference bitstream is obtained by pre-encoding the second region of the image to be processed.

[0100] In some embodiments, the second region may be a region on the same image, which is adjacent to or close to the first region and has a determined QP value. Optionally, the size of the second region is the same as that of the first region.

[0101] In some embodiments, when the QP values ​​of two adjacent or neighboring areas differ too much, the image will be discontinuous. In order to ensure the smooth transition of the image, the QP values ​​of the adjacent areas should not differ too much. A value can be preset to judge the difference between the QP values ​​of the target bitstream and the reference bitstream. When the difference is less than or equal to the preset value, the preset bitstream condition is met.

[0102] Step 402: determine a target QP corresponding to a target bitstream from a plurality of second QPs.

[0103] In some embodiments, a corresponding QP may be determined as a target QP according to a target bitstream, and the image may be compressed according to the target QP.

[0104] In summary, the above embodiments of the present application determine the target bitstream and the corresponding target QP based on the second bitstream, implement a two-level hierarchical decision, determine the target QP while reducing the number of traversals, and save system power consumption, bandwidth and storage.

[0105] For the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the described order of actions, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.

[0106] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0107] The technical solution of the present disclosure is further described in detail below in conjunction with specific application examples.

[0108] Figure 5 An example diagram of determining an image coding parameter provided by an embodiment of the present disclosure is shown in FIG. The diagram is an example of a method for determining an image coding parameter using 5 groups of QPs covering all 10 groups of QPs from QP0 to QP9.

[0109] The example system mainly includes a precoding module, an interval decision module, a QP decision module, and a bit rate control module.

[0110] The pre-coding module can perform pre-coding processing on the QP to obtain a code stream corresponding to the QP. In the following example, the value range of the QP can be determined first according to the bit width of the image to be processed. For example, the value range of the QP in this example is QP0 to QP9, and the QP within the value range can be sampled at a certain interval. Optionally, this example selects QP0, QP3, and QP6 as the first QP to perform a first-level hierarchical decision. After QP0, QP3, and QP6 are input into the pre-coding module, the corresponding code stream information is obtained, which are pre-coding QP0, pre-coding QP3, and pre-coding QP6, respectively. The code stream information can be input into the interval decision module for decision-making.

[0111] When the interval decision module makes interval decisions on the bitstream information, it needs to make judgments based on the preset bitstream conditions. The bitstream control module will set an ideal bitstream length. The pre-encoded bitstream length needs to be less than or equal to the set value in order to meet the compression rate requirements. The interval decision module can obtain the corresponding QP value based on the bitstream information and select the smallest QP value as the intermediate QP. The smaller the QP value, the better the image compression quality.

[0112] After the interval decision module determines the intermediate QP, the second QP can be determined according to the intermediate QP. For example, when the intermediate QP is QP0, there is no value smaller than QP0 in the value range of QP, which means that within the value range, QP0 has the best compression effect on the image, so QP0 is determined as the target QP. For another example, when the intermediate QP is QP3, there may be QP1 or QP2 that also meets the preset bitstream condition, then QP1 and QP2 are determined as the second QP, and the minimum value that can meet the preset bitstream condition is used as the target QP. For another example, when QP6 does not meet the preset bitstream condition, there may be QP7 or QP8 that can meet the preset bitstream condition, then QP7 and QP8 are used as the second QP. Similarly, the minimum value that meets the preset bitstream condition is selected as the target QP. When both QP7 and QP8 cannot meet the preset bitstream condition, QP9 can be selected as the target QP.

[0113] In summary, this example uses a hierarchical approach to make decisions on QPs. It only needs to traverse 5 groups of QPs to achieve the selection of QPs that would take 10 times to determine using the full traversal method. The method in this example reduces the number of traversals by half, saving system power consumption, bandwidth, and storage, and improving hardware pipeline efficiency.

[0114] Figure 6 FIG. 6 is a block diagram of an apparatus 600 for determining image coding parameters provided by an embodiment of the present disclosure. Figure 6 As shown, the device 600 includes:

[0115] The first acquisition module 610 is used to acquire multiple candidate quantization parameters QP according to the bit width of the image to be processed; the second acquisition module 620 is used to acquire multiple first code streams based on multiple first QPs among the multiple candidate QPs; the first determination module 630 is used to determine multiple second QPs based on the multiple first code streams and acquire multiple second code streams; the second determination module 640 is used to determine the target QP based on the multiple second code streams, and the target QP is used to perform image compression processing on the image to be processed.

[0116] In summary, the first acquisition module 610 acquires multiple candidate QPs, the second acquisition module 620 acquires multiple first code streams according to the multiple first QPs in the candidate QPs, the first determination module 630 determines multiple second QPs according to the multiple first code streams acquired by the second acquisition module, and acquires multiple second code streams, and the second determination module determines the target QP according to the multiple second code streams of the first determination module, thereby realizing hierarchical processing of the candidate QPs, reducing the number of traversals while obtaining the most appropriate QP value, and saving system power consumption, bandwidth, and storage.

[0117] In some embodiments, the second acquisition module 620 is further used to execute: determining multiple first QPs from multiple candidate QPs at preset intervals; and pre-encoding the first area in the image to be processed based on the multiple first QPs to obtain multiple first code streams corresponding to each of the multiple first QPs.

[0118] In some embodiments, the first determination module 630 is further used to perform: determining an intermediate code stream based on multiple first code streams, where the intermediate code stream is a code stream that meets a preset code stream condition among the multiple first code streams; determining multiple second QPs based on the intermediate code stream; and pre-encoding the first area of ​​the image to be processed based on the multiple second QPs to obtain multiple second code streams corresponding to each of the multiple second QPs.

[0119] In some embodiments, the first determination module 630 is further configured to: determine an intermediate QP corresponding to the intermediate code stream from the plurality of first QPs; and determine a plurality of second QPs that are within a preset range with the intermediate QP.

[0120] In some embodiments, the second determination module 640 is further configured to: determine a target bitstream based on multiple second bitstreams, where the target bitstream is a bitstream that meets a preset bitstream condition among the multiple second bitstreams; and determine a target QP corresponding to the target bitstream from the multiple second QPs.

[0121] In some embodiments, the preset bitstream condition includes at least one of the following:

[0122] The length of the current code stream is less than or equal to the preset code stream length;

[0123] The QP corresponding to the current bitstream is the smallest;

[0124] The QP corresponding to the current bitstream is within the preset range;

[0125] A difference between a QP corresponding to the current bitstream and a QP corresponding to a reference bitstream is less than or equal to a preset value, and the reference bitstream is obtained by pre-encoding the second region of the image to be processed.

[0126] In summary, the device 600 determines multiple second QPs based on multiple first QPs, determines the target QP based on the multiple second QPs, and performs hierarchical processing on the QP. On the premise of obtaining the most appropriate QP value, the number of traversals is reduced, and system power consumption, bandwidth and storage are saved.

[0127] Figure 7 A block diagram of an electronic device 700 for implementing the above-mentioned method for determining image coding parameters provided in an embodiment of the present disclosure.

[0128] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present disclosure, the embodiment of the present disclosure also provides an electronic device, such as Figure 7 As shown, the electronic device 700 includes:

[0129] Communication interface 701, capable of exchanging information with other devices;

[0130] The processor 702 is connected to the communication interface 701 to implement information interaction with other devices, and is used to execute the method provided by one or more of the above technical solutions when running the computer program;

[0131] A memory 703 on which the computer program is stored.

[0132] Specifically, the processor 702 can be used to obtain multiple candidate quantization parameters QP according to the bit width of the image to be processed; obtain multiple first code streams based on multiple first QPs among the multiple candidate QPs; determine multiple second QPs based on the multiple first code streams and obtain multiple second code streams; determine a target QP based on the multiple second code streams, and the target QP is used to perform image compression processing on the image to be processed.

[0133] It should be noted that the specific processing process of the processor 702 can be understood by referring to the above method.

[0134] Of course, in actual application, the various components in the electronic device 700 are coupled together through the bus system 704. It can be understood that the bus system 704 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 704 .

[0135] The memory 703 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 700. Examples of such data include: any computer program used to operate on the electronic device 700.

[0136] The method disclosed in the above embodiment of the present application can be applied to the processor 702, or implemented by the processor 702. The processor 702 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 702. The above-mentioned first processor 702 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 702 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 703, and the processor 702 reads the information in the memory 703 and completes the steps of the above method in combination with its hardware.

[0137] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0138] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by a processor 720 of an electronic device 700 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0139] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method for determining image coding parameters described in the above embodiments of the present disclosure.

[0140] The embodiment of the present disclosure also provides a chip, such as Figure 8 As shown, the chip includes a processor 810 and an interface 820. The number of the processor 810 may be one or more, the number of the interface 820 may be multiple, the interface circuit is used to receive a signal from the memory of the electronic device and send a signal to the processor, the signal includes a computer instruction stored in the memory, when the processor executes the computer instruction, the electronic device executes the method for determining the image coding parameter described in the above embodiment of the present disclosure.

[0141] It should be noted that, for the convenience of description, only the parts related to the relevant invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other.

[0142] It should be understood that the "system", "device", "unit" and / or "module" used in this application is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the word can be replaced by other expressions.

[0143] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "a kind" and / or "the" do not refer to the singular, but also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of clearly identified steps and elements, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements. The elements defined by the sentence "includes a..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.

[0144] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, 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, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0145] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0146] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, the various steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.

[0147] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0148] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0149] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0150] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0151] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0152] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent commodity, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0153] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for determining image coding parameters, characterized in that: include: According to the bit width of the image to be processed, multiple candidate quantization parameters QP are obtained; Based on a plurality of first QPs among the plurality of candidate QPs, obtaining a plurality of first code streams; Based on the multiple first code streams, determine multiple second QPs, and obtain multiple second code streams; A target QP is determined based on the multiple second code streams, where the target QP is used to perform image compression processing on the image to be processed.

2. The method according to claim 1, characterized in that: The acquiring a plurality of first code streams based on a plurality of first QPs among the plurality of candidate QPs comprises: Determine the plurality of first QPs from the plurality of candidate QPs at a preset interval; Based on the multiple first QPs, pre-encode the first region in the to-be-processed image to obtain the multiple first code streams corresponding to each of the multiple first QPs.

3. The method according to claim 2, characterized in that The determining a plurality of second QPs based on the plurality of first bitstreams and obtaining the plurality of second bitstreams comprises: Determine an intermediate code stream based on the multiple first code streams, where the intermediate code stream is a code stream that meets a preset code stream condition among the multiple first code streams; Determining the plurality of second QPs based on the intermediate code stream; Based on the multiple second QPs, the first region of the to-be-processed image is pre-encoded to obtain the multiple second code streams corresponding to each of the multiple second QPs.

4. The method according to claim 3, characterized in that The determining, based on the intermediate code stream, the plurality of second QPs comprises: Determine an intermediate QP corresponding to the intermediate code stream from the multiple first QPs; A plurality of second QPs within a preset range from the middle QP are determined.

5. The method according to claim 1, characterized in that The determining the target QP based on the multiple second code streams includes: Determine a target bitstream based on the multiple second bitstreams, the target bitstream being a bitstream that meets a preset bitstream condition among the multiple second bitstreams; A target QP corresponding to the target code stream is determined from the multiple second QPs.

6. The method according to any one of claims 3 to 5, characterized in that The preset bitstream condition includes at least one of the following: The length of the current code stream is less than or equal to the preset code stream length; The QP corresponding to the current bitstream is the smallest; The QP corresponding to the current bitstream is within the preset range; A difference between a QP corresponding to the current bitstream and a QP corresponding to a reference bitstream is less than or equal to a preset value, and the reference bitstream is obtained by pre-encoding the second region of the image to be processed.

7. A device for determining image coding parameters, characterized in that: The device comprises: A first acquisition module, used for acquiring a plurality of candidate quantization parameters QP according to the bit width of the image to be processed; A second acquisition module, configured to acquire a plurality of first code streams based on a plurality of first QPs among the plurality of candidate QPs; A first determining module, configured to determine a plurality of second QPs based on the plurality of first bitstreams, and obtain a plurality of second bitstreams; The second determination module is used to determine a target QP based on the multiple second code streams, where the target QP is used to perform image compression processing on the image to be processed.

8. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.

10. A chip, characterized in that: It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal includes a computer instruction stored in the memory, and when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1 to 6.