A bitrate control method, apparatus, device and storage medium

By dynamically adjusting the core coding parameters based on the information entropy and local activity of the coding unit in the JPEG-LS image compression standard, the problem of lack of bitrate control in JPEG-LS is solved, achieving efficient image coding compression, expanding the scope of application and improving coding efficiency.

CN116033167BActive Publication Date: 2026-03-13HENGXUAN TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-17
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In wearable devices based on system-on-a-chip (SoC), the JPEG-LS image compression standard lacks an effective bitrate control scheme, resulting in large fluctuations in encoder bitrate and affecting image compression encoding performance.

Method used

By dynamically adjusting the baseline values ​​of the core coding parameters based on the information entropy and local activity of the coding unit until a predetermined compression ratio threshold is reached, compression coding is achieved for each pixel to be encoded, and bitrate control is performed according to the current compression ratio.

Benefits of technology

It significantly reduces the amount of computation, improves coding efficiency, expands the applicability of the JPEG-LS image compression standard, and improves the image coding and compression effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116033167B_ABST
    Figure CN116033167B_ABST
Patent Text Reader

Abstract

This application provides a bitrate control method, apparatus, device, and storage medium, relating to the field of video coding technology. In this method, a baseline value for the core coding parameters of a coding unit is determined based on the information entropy of the coding unit. Compared to continuously trying to adjust the baseline value of the core coding parameters, this significantly reduces the number of retries, thereby greatly reducing the computational load. Based on the baseline value of the core coding parameters and the local activity level of each pixel to be encoded, each pixel to be encoded is compressed and encoded. The compression ratio of the coding unit is determined based on the encoding result. Then, based on the relationship between the current compression ratio and a predetermined compression ratio threshold, the baseline value of the core coding parameters is cyclically adjusted until the current compression ratio is less than the predetermined compression ratio threshold. The encoding result is then transmitted based on the bitrate corresponding to the current compression ratio, achieving bitrate control based on image content. This improves the image coding compression effect and expands the applicability of image compression standards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video coding technology, and in particular to a bitrate control method, apparatus, device, and storage medium. Background Technology

[0002] Wearable devices based on a System-on-Chip (SoC), such as watches, virtual reality (VR) devices, and augmented reality (AR) devices, need to display a large number of non-natural images. These images are very detailed and have high image quality requirements. Before displaying these images, the SoC needs to perform super-resolution processing on the image data. The super-resolution image data reaches 2K or 4K resolution, which places high demands on bandwidth. Therefore, lossless or visually lossless image data compression methods are needed to reduce bandwidth resource consumption.

[0003] Related technologies employ the JPEG-LS image compression standard to perform lossless or near-lossless compression of image data, thereby reducing bandwidth resource consumption. However, the JPEG-LS image compression standard lacks a bitrate control scheme, meaning that the encoder's bitrate fluctuates significantly and is uncontrollable, thus affecting the image compression coding effect. Summary of the Invention

[0004] This application provides a bitrate control method, apparatus, device, and storage medium to improve the effect of image compression coding.

[0005] On one hand, embodiments of this application provide a bitrate control method, including:

[0006] For each coding unit in the image to be encoded, a reference value for the coding core parameter of the coding unit is determined based on the information entropy of the coding unit. The coding unit includes multiple pixels to be encoded.

[0007] Based on the baseline values ​​of the core encoding parameters and the local activity level of each pixel to be encoded, each pixel to be encoded is compressed and encoded, and the compression ratio of the encoding unit is determined based on the encoding result.

[0008] If the current compression ratio is greater than the predetermined compression ratio threshold, then the baseline value of the encoding core parameter is adjusted, and the process returns to the step of performing compression encoding on each pixel to be encoded based on the baseline value of the encoding core parameter and the local activity level of each pixel to be encoded, and determining the current compression ratio of the encoding unit based on the encoding result, until the current compression ratio is less than or equal to the predetermined compression ratio threshold.

[0009] The encoded result is transmitted according to the target bit rate corresponding to the current compression ratio.

[0010] Optionally, before determining the baseline value of the coding core parameters of the coding unit based on the information entropy of the coding unit, the method further includes:

[0011] Based on the pixel values ​​of the plurality of pixels to be encoded and their respective occurrence probabilities in the encoding unit, the information entropy of the encoding unit is determined.

[0012] Optionally, determining the baseline values ​​of the coding core parameters of the coding unit based on the information entropy of the coding unit includes:

[0013] Using the information entropy of the encoding unit, a preset first reference lookup table is consulted to obtain the baseline values ​​of the encoding core parameters of the encoding unit. The first reference lookup table includes the baseline values ​​of the encoding core parameters corresponding to multiple information entropy ranges.

[0014] Optionally, before performing compressed encoding on each pixel based on the baseline value of the encoding core parameters and the local activity level of each pixel to be encoded, the following steps are included:

[0015] For each pixel to be encoded, obtain the pixel values ​​of multiple reference pixels located around the pixel to be encoded in the encoding unit;

[0016] Based on the pixel values ​​of the plurality of reference pixels, the context gradient of the pixel to be encoded is determined, and the context gradient is used to characterize the local activity level of the pixel to be encoded.

[0017] Optionally, the step of compressing and encoding each pixel to be encoded based on the baseline value of the encoding core parameters and the local activity level of each pixel to be encoded includes:

[0018] Based on the baseline values ​​of the encoding core parameters and the local activity level of each pixel to be encoded, the encoding core parameter values ​​of each pixel to be encoded are determined.

[0019] Each pixel to be encoded is compressed and encoded using the core encoding parameter values ​​of each pixel.

[0020] Optionally, determining the encoding core parameter value for each pixel to be encoded based on the baseline value of the encoding core parameters and the local activity level of each pixel to be encoded includes:

[0021] The local activity level of each pixel to be encoded is used to query a preset second reference lookup table to obtain the floating value of the encoding core parameter corresponding to each pixel to be encoded. The second reference lookup table includes multiple local activity level ranges and their corresponding floating values ​​of the encoding core parameter.

[0022] Based on the baseline value of the encoding core parameters and the floating value of the encoding core parameters for each pixel to be encoded, the value of the encoding core parameters for each pixel to be encoded is determined.

[0023] Optionally, determining the current compression ratio of the coding unit based on the coding result includes:

[0024] Based on the encoding results of the plurality of pixels to be encoded, the size of the encoded and compressed encoding unit is determined;

[0025] Based on the size of the encoded compressed unit and the size of the encoded unit before encoding compression, the compression ratio of the encoded unit in this iteration is determined.

[0026] On one hand, embodiments of this application provide a bitrate control device, including:

[0027] An estimation module is used to determine a baseline value for the coding core parameters of each coding unit in the image to be encoded, based on the information entropy of the coding unit, wherein the coding unit includes multiple pixels to be encoded;

[0028] The compression module is used to compress and encode each pixel to be encoded based on the baseline value of the encoding core parameters and the local activity level of each pixel to be encoded, and to determine the compression ratio of the encoding unit in this cycle based on the encoding result.

[0029] The judgment module is used to adjust the reference value of the encoding core parameters if the current compression ratio is greater than the predetermined compression ratio threshold, and return to the step of performing compression encoding on each pixel to be encoded based on the reference value of the encoding core parameters and the local activity level of each pixel to be encoded, and determining the current compression ratio of the encoding unit based on the encoding result, until the current compression ratio is less than or equal to the predetermined compression ratio threshold.

[0030] The transmission module is used to transmit the obtained encoding result according to the target bit rate corresponding to the current compression ratio.

[0031] Optionally, the estimation module is further configured to:

[0032] Before determining the baseline value of the encoding core parameters of the encoding unit based on the information entropy of the encoding unit, the information entropy of the encoding unit is determined based on the pixel values ​​of the plurality of pixels to be encoded and their respective occurrence probabilities in the encoding unit.

[0033] Optionally, the estimation module is specifically used for:

[0034] Using the information entropy of the encoding unit, a preset first reference lookup table is consulted to obtain the baseline values ​​of the encoding core parameters of the encoding unit. The first reference lookup table includes the baseline values ​​of the encoding core parameters corresponding to multiple information entropy ranges.

[0035] Optionally, the compression module is further configured to:

[0036] Based on the baseline values ​​of the core encoding parameters and the local activity level of each pixel to be encoded, before compressing and encoding each pixel to be encoded, the pixel values ​​of multiple reference pixels located around the pixel to be encoded in the encoding unit are obtained for each pixel to be encoded.

[0037] Based on the pixel values ​​of the plurality of reference pixels, the context gradient of the pixel to be encoded is determined, and the context gradient is used to characterize the local activity level of the pixel to be encoded.

[0038] Optionally, the compression module is specifically used for:

[0039] Based on the baseline values ​​of the encoding core parameters and the local activity level of each pixel to be encoded, the encoding core parameter values ​​of each pixel to be encoded are determined.

[0040] Each pixel to be encoded is compressed and encoded using the core encoding parameter values ​​of each pixel.

[0041] Optionally, the compression module is specifically used for:

[0042] The local activity level of each pixel to be encoded is used to query a preset second reference lookup table to obtain the floating value of the encoding core parameter corresponding to each pixel to be encoded. The second reference lookup table includes multiple local activity level ranges and their corresponding floating values ​​of the encoding core parameter.

[0043] Based on the baseline value of the encoding core parameters and the floating value of the encoding core parameters for each pixel to be encoded, the value of the encoding core parameters for each pixel to be encoded is determined.

[0044] Optionally, the compression module is specifically used for:

[0045] Based on the encoding results of the plurality of pixels to be encoded, the size of the encoded and compressed encoding unit is determined;

[0046] Based on the size of the encoded compressed unit and the size of the encoded unit before encoding compression, the compression ratio of the encoded unit in this iteration is determined.

[0047] On one hand, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described bitrate control method.

[0048] On one hand, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the above-described bitrate control method.

[0049] In this embodiment, the baseline value of the encoding core parameters of the encoding unit is determined based on the information entropy of the encoding unit. Compared with continuously trying to adjust the baseline value of the encoding core parameters, this greatly reduces the number of retries, thereby significantly reducing the computational load and improving encoding efficiency. Secondly, based on the baseline value of the encoding core parameters and the local activity level of each pixel to be encoded, each pixel to be encoded is compressed and encoded. The compression ratio of the encoding unit in this iteration is determined based on the encoding result. Then, based on the relationship between the current compression ratio and a predetermined compression ratio threshold, the baseline value of the encoding core parameters is cyclically adjusted until the current compression ratio is less than the predetermined compression ratio threshold. Finally, based on the bitrate corresponding to the current compression ratio, the encoding result is transmitted, achieving bitrate control based on image content, thereby improving the image encoding and compression effect. Furthermore, applying the above bitrate control method to the JPEG-LS image compression standard can effectively expand the applicability of the JPEG-LS image compression standard and facilitate algorithm hardware implementation. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 A schematic diagram of a system architecture provided in an embodiment of this application;

[0052] Figure 2 A flowchart illustrating a rate control method provided in an embodiment of this application;

[0053] Figure 3 A schematic diagram of a reference pixel provided for an embodiment of this application;

[0054] Figure 4 This is a schematic diagram of the structure of a bitrate control device provided in an embodiment of this application;

[0055] Figure 5This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0056] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0057] For ease of understanding, the terms used in the embodiments of this invention are explained below.

[0058] JPEG-LS: A lossless or near-lossless image compression standard (ISO-14495-1 / ITU-T.87), employing pixel-by-pixel compression, which is simple and effective. JPEG-LS mainly consists of three parts: 1. Predictor: JPEG-LS uses a nonlinear predictor with self-edge detection capabilities. 2. Context Modeling: JPEG-LS is based on a very simple context model determined by the quantization gradient. 3. Encoding: JPEG-LS uses a combination of Golomb-Rice and run-length encoding techniques or an arithmetic coding scheme.

[0059] Information entropy describes the uncertainty of possible events occurring from an information source. Typically, it's uncertain what symbol an information source will emit, and it can be measured by the probability of its occurrence. A higher probability means more chances of occurrence and less uncertainty; conversely, a lower probability means greater uncertainty.

[0060] refer to Figure 1 This is a system architecture diagram applicable to the embodiments of this application. The system architecture includes at least an encoding device 101 and a wearable device 102.

[0061] In practical applications, wearable device 102 includes, but is not limited to, smartwatches, VR devices, and AR devices. Encoding device 101 can be a terminal device, such as a smartphone, tablet, laptop, or desktop computer. Encoding device 101 can also be a server, which can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Encoding device 101 and wearable device 102 can be connected directly or indirectly through wired or wireless communication, which is not limited herein.

[0062] Encoding device 101 is used to compress and encode image data, and transmit the encoding result to wearable device 102. Wearable device 102 decodes the encoding result and displays the decoded image data. Encoding device 101 can use the JPEG-LS image compression standard to compress and encode image data, or it can use other image compression standards to compress and encode image data. This application does not make specific limitations in this regard.

[0063] based on Figure 1 The system architecture diagram shown in this application illustrates the flowchart of a bitrate control method. Figure 2 As shown, the process of this method is executed by a computer device, which can be... Figure 1 The encoding device 101 shown includes the following steps:

[0064] Step S201: For each coding unit in the image to be encoded, determine the baseline value of the coding core parameters of the coding unit based on the information entropy of the coding unit.

[0065] Specifically, the image to be encoded can be divided into multiple coding units, or the entire image can be treated as a single coding unit. A coding unit comprises multiple pixels to be encoded. Compression encoding is performed on each coding unit in the image to be encoded, and during compression encoding of each coding unit, each pixel within that coding unit is compressed and encoded sequentially.

[0066] In some embodiments, for each coding unit, the information entropy of the coding unit is determined based on the pixel values ​​of multiple pixels to be encoded in the coding unit and their respective occurrence probabilities in the coding unit, specifically satisfying the following formula (1):

[0067] H(x)=-∑P(x i )logP(x i (1)

[0068] Where H(x) represents the information entropy of the coding unit, x i P(x) represents the pixel value of pixel number i. i ) represents x i The probability of occurrence in the coding unit.

[0069] In practical applications, a linear fitting method can be used to fit the correspondence between information entropy and the baseline value Near0 of the encoding core parameter to obtain a first reference table. This first reference table includes baseline values ​​of the encoding core parameter corresponding to multiple information entropy ranges. The larger the baseline value of the encoding core parameter, the greater the corresponding compression ratio. For example, see Table 1, which provides a first reference table according to an embodiment of this application.

[0070] Table 1

[0071]

[0072] In the actual encoding process, the information entropy of the encoding unit is used to look up a preset first reference table to obtain the baseline value of the encoding core parameter of the encoding unit. For example, if the information entropy of the encoding unit is 8, then the first reference table shown in Table 1 is consulted to obtain the baseline value Near0 of the encoding core parameter of the encoding unit, which is 9.

[0073] In this embodiment, the baseline value of the coding core parameters of the coding unit is estimated based on the information entropy of the coding unit. Compared with continuously trying to adjust the baseline value of the coding core parameters, the number of retries is greatly reduced (statistically, the number of retries can be reduced by more than 60%), thereby significantly reducing the amount of computation and improving coding efficiency.

[0074] Step S202: Based on the baseline values ​​of the encoding core parameters and the local activity level of each pixel to be encoded, each pixel to be encoded is compressed and encoded, and the compression ratio of the encoding unit is determined based on the encoding result.

[0075] Specifically, because the human eye's sensitivity to high-frequency information decreases, quantization distortion can be appropriately increased for locally active or detail-rich pixels, i.e., a larger compression ratio can be used to improve compression efficiency. Conversely, for pixels in static or flat areas, quantization distortion should be reduced, i.e., a smaller compression ratio can be used to ensure image quality.

[0076] Therefore, in this embodiment, for each pixel to be encoded, the pixel values ​​of multiple reference pixels located around the pixel in the encoding unit are obtained. Then, based on the pixel values ​​of the multiple reference pixels, the context gradient of the pixel to be encoded is determined, wherein the context gradient is used to characterize the local activity level of the pixel to be encoded.

[0077] In practice, the number of reference pixels can be set according to the actual situation. For example, 3 reference pixels, 4 reference pixels, 5 reference pixels, etc. Each reference pixel is selected from all encoded pixels, and can be an encoded pixel that is directly adjacent to the current pixel to be encoded, or an encoded pixel that is not directly adjacent to the current pixel to be encoded. In some embodiments, the absolute value of the difference between the reference pixels is calculated, and then the multiple absolute values ​​are summed to determine the context gradient of the pixel to be encoded.

[0078] For example, such as Figure 3As shown, five reference pixels are selected from the area surrounding the pixel to be encoded, namely reference pixel a, reference pixel b, reference pixel c, reference pixel d, and reference pixel e. The absolute value of the difference between the pixel value of reference pixel d and the pixel value of reference pixel b is taken to obtain pixel gradient g1; the absolute value of the difference between the pixel value of reference pixel b and the pixel value of reference pixel c is taken to obtain pixel gradient g2; the absolute value of the difference between the pixel value of reference pixel c and the pixel value of reference pixel a is taken to obtain pixel gradient g3; and the absolute value of the difference between the pixel value of reference pixel b and the pixel value of reference pixel e is taken to obtain pixel gradient g4. These pixel gradients characterize the local gradient properties around the pixel to be encoded. Then, pixel gradients g1, g2, g3, and g4 are summed to obtain the context gradient of the pixel to be encoded, x.

[0079] Generally, a larger context gradient of a pixel indicates a higher local activity level, meaning a higher compression ratio can be applied to that pixel. Conversely, a smaller context gradient indicates a lower local activity level, meaning a lower compression ratio can be applied. Therefore, for each pixel to be encoded, the encoding core parameter value can be determined based on the baseline value of the encoding core parameters of the encoding unit and the local activity level of each pixel. Then, compression encoding is performed on each pixel using its encoding core parameter value, where a larger encoding core parameter value results in a higher compression ratio.

[0080] In some embodiments, for each pixel to be encoded, the reference value of the encoding core parameters of the encoding unit can be floated based on the local activity level of each pixel to obtain the encoding core parameter value of each pixel to be encoded. Then, the encoding core parameter value of the pixel to be encoded is used to perform compression encoding on the pixel to be encoded.

[0081] To quickly determine the corresponding core parameter fluctuation values ​​for each local activity level during compression encoding, this application embodiment experimentally fits the correspondence between local activity levels and core parameter fluctuation values ​​to obtain a second reference table. The second reference table includes the core parameter fluctuation values ​​corresponding to multiple local activity level ranges. For example, see Table 2, which provides a second reference table according to this application embodiment.

[0082] Table 2

[0083]

[0084] In the actual compression encoding process, the local activity level of each pixel to be encoded is used to look up the preset second reference table to obtain the floating value of the encoding core parameter corresponding to each pixel to be encoded. Then, based on the baseline value of the encoding core parameter of the encoding unit and the floating value of the encoding core parameter of each pixel to be encoded, the value of the encoding core parameter of each pixel to be encoded is determined.

[0085] Specifically, the base value of the coding core parameter of the coding unit is summed with the floating value of the coding core parameter of the pixel to be encoded to obtain the coding core parameter value of the pixel to be encoded. For example, if the base value Near0 of the coding core parameter of the coding unit is set to 9, the local activity level of a pixel to be encoded is 7, and the floating value of the coding core parameter is determined to be 2 by looking up Table 2, then the coding core parameter value of the pixel to be encoded is 11.

[0086] In this embodiment, the compression ratio of the encoding unit is adjusted at the pixel level, so that for pixels to be encoded in areas with rich texture, the compression ratio is greatly improved without causing visual loss, while improving the compression encoding efficiency; for pixels to be encoded in static or flat areas, the compression ratio is reduced to ensure image quality, thereby improving the compression encoding effect of the entire encoding unit.

[0087] In some embodiments, the size of the encoded and compressed coding unit is determined based on the encoding results of multiple pixels to be encoded. Then, the compression ratio of the coding unit in this iteration is determined based on the size of the encoded and compressed coding unit and the size of the coding unit before encoding and compression.

[0088] Specifically, the encoding results of multiple pixels to be encoded are merged to obtain the size of the encoded unit after encoding compression. Then, the ratio of the size of the encoded unit before encoding compression to the size after encoding compression is used as the compression ratio of the encoded unit in this iteration.

[0089] Step S203: Determine whether the current compression ratio is greater than the predetermined compression ratio threshold. If yes, proceed to step S204; otherwise, proceed to step S205.

[0090] Step S204: Adjust the baseline values ​​of the encoding core parameters and return to step S202.

[0091] Specifically, the predetermined compression ratio threshold is set by the user and can be adjusted for different coding units according to actual conditions. In practical applications, an image can be divided into multiple coding units, and the space of the entire image after compression is a fixed value. If the space of the entire image after compression is expected to be insufficient after compressing part of the image, the predetermined compression ratio threshold of the subsequent coding units can be increased; conversely, the predetermined compression ratio threshold of the subsequent coding units can be decreased to improve image quality.

[0092] When the current compression ratio is greater than the predetermined compression ratio threshold, it indicates that the baseline value of the coding core parameters determined based on the information entropy of the coding unit is too small, and the baseline value of the coding core parameters needs to be increased. In this application, the baseline value of the coding core parameters is increased according to a preset step size. The preset step size can be set according to the actual situation, such as 1 or 2. Then, step S202 is executed again based on the adjusted baseline value of the coding core parameters. If the current compression ratio obtained again is still greater than the predetermined compression ratio threshold, the baseline value of the coding core parameters is adjusted again, and step S202 is executed again based on the adjusted baseline value of the coding core parameters, and this process is repeated. If the current compression ratio obtained again is less than or equal to the predetermined compression ratio threshold, step S205 is executed.

[0093] Step S205: Transmit the obtained encoding result according to the target bit rate corresponding to the current compression ratio.

[0094] Specifically, bitrate refers to the number of bits of data transmitted per unit time during data transmission. After compressing and encoding the coding unit based on the current compression ratio, the encoded result obtained from the compression encoding is transmitted using the corresponding target bitrate.

[0095] In this embodiment, the baseline value of the encoding core parameters of the encoding unit is determined based on the information entropy of the encoding unit. Compared with continuously trying to adjust the baseline value of the encoding core parameters, this greatly reduces the number of retries, thereby significantly reducing the computational load and improving encoding efficiency. Secondly, based on the baseline value of the encoding core parameters and the local activity level of each pixel to be encoded, each pixel to be encoded is compressed and encoded. The compression ratio of the encoding unit in this iteration is determined based on the encoding result. Then, based on the relationship between the current compression ratio and a predetermined compression ratio threshold, the baseline value of the encoding core parameters is cyclically adjusted until the current compression ratio is less than the predetermined compression ratio threshold. Finally, based on the bitrate corresponding to the current compression ratio, the encoding result is transmitted, achieving bitrate control based on image content, thereby improving the image encoding and compression effect. Furthermore, applying the above bitrate control method to the JPEG-LS image compression standard can effectively expand the applicability of the JPEG-LS image compression standard and facilitate algorithm hardware implementation.

[0096] To verify the performance of the rate control method in this application, relevant personnel conducted tests on the rate control method and obtained the test data shown in Table 3 below:

[0097] Table 3

[0098] Image to be encoded Encoding unit size Maximum local error Overall compression ratio Image 001 50x 4 5-8 2.38 Image 002 50x 4 9-11 6 Image 003 32x 4 10-12 4.26 Image 004 32x 4 10-12 6.36 Image 005 50x 4 9-12 2 Image 006 32x 4 5-8 2

[0099] As can be seen from the test data shown in Table 3, when using the method in this application for bitrate control, the maximum local error is kept within a small range, and a good compression ratio can be obtained.

[0100] Based on the same technical concept, this application provides a schematic diagram of the structure of a bitrate control device, such as... Figure 4 As shown, the device 400 includes:

[0101] The estimation module 401 is used to determine the reference value of the coding core parameter of each coding unit in the image to be encoded based on the information entropy of the coding unit, wherein the coding unit includes multiple pixels to be encoded.

[0102] Compression module 402 is used to compress and encode each pixel to be encoded based on the reference value of the encoding core parameters and the local activity level of each pixel to be encoded, and to determine the compression ratio of the encoding unit in this cycle based on the encoding result.

[0103] The judgment module 403 is used to adjust the reference value of the encoding core parameter if the current compression ratio is greater than the predetermined compression ratio threshold, and return to the step of performing compression encoding on each pixel to be encoded based on the reference value of the encoding core parameter and the local activity level of each pixel to be encoded, and determining the current compression ratio of the encoding unit based on the encoding result, until the current compression ratio is less than or equal to the predetermined compression ratio threshold.

[0104] The transmission module 404 is used to transmit the obtained encoding result according to the target bit rate corresponding to the current compression ratio.

[0105] Optionally, the estimation module 401 is further configured to:

[0106] Before determining the baseline value of the encoding core parameters of the encoding unit based on the information entropy of the encoding unit, the information entropy of the encoding unit is determined based on the pixel values ​​of the plurality of pixels to be encoded and their respective occurrence probabilities in the encoding unit.

[0107] Optionally, the estimation module 401 is specifically used for:

[0108] Using the information entropy of the encoding unit, a preset first reference lookup table is consulted to obtain the baseline values ​​of the encoding core parameters of the encoding unit. The first reference lookup table includes the baseline values ​​of the encoding core parameters corresponding to multiple information entropy ranges.

[0109] Optionally, the compression module 402 is further configured to:

[0110] Based on the baseline values ​​of the core encoding parameters and the local activity level of each pixel to be encoded, before compressing and encoding each pixel to be encoded, the pixel values ​​of multiple reference pixels located around the pixel to be encoded in the encoding unit are obtained for each pixel to be encoded.

[0111] Based on the pixel values ​​of the plurality of reference pixels, the context gradient of the pixel to be encoded is determined, and the context gradient is used to characterize the local activity level of the pixel to be encoded.

[0112] Optionally, the compression module 402 is specifically used for:

[0113] Based on the baseline values ​​of the encoding core parameters and the local activity level of each pixel to be encoded, the encoding core parameters of each pixel to be encoded are determined.

[0114] Each pixel to be encoded is compressed using the core encoding parameters of that pixel.

[0115] Optionally, the compression module 402 is specifically used for:

[0116] The local activity level of each pixel to be encoded is used to query a preset second reference lookup table to obtain the floating value of the encoding core parameter corresponding to each pixel to be encoded. The second reference lookup table includes multiple local activity level ranges and their corresponding floating values ​​of the encoding core parameter.

[0117] Based on the baseline value of the encoding core parameters and the floating value of the encoding core parameters for each pixel to be encoded, the encoding core parameters for each pixel to be encoded are determined.

[0118] Optionally, the compression module 402 is specifically used for:

[0119] Based on the encoding results of the plurality of pixels to be encoded, the size of the encoded and compressed encoding unit is determined;

[0120] Based on the size of the encoded compressed unit and the size of the encoded unit before encoding compression, the compression ratio of the encoded unit in this iteration is determined.

[0121] In this embodiment, the baseline value of the encoding core parameters of the encoding unit is determined based on the information entropy of the encoding unit. Compared with continuously trying to adjust the baseline value of the encoding core parameters, this greatly reduces the number of retries, thereby significantly reducing the computational load and improving encoding efficiency. Secondly, based on the baseline value of the encoding core parameters and the local activity level of each pixel to be encoded, each pixel to be encoded is compressed and encoded. The compression ratio of the encoding unit in this iteration is determined based on the encoding result. Then, based on the relationship between the current compression ratio and a predetermined compression ratio threshold, the baseline value of the encoding core parameters is cyclically adjusted until the current compression ratio is less than the predetermined compression ratio threshold. Finally, based on the bitrate corresponding to the current compression ratio, the encoding result is transmitted, achieving bitrate control based on image content, thereby improving the image encoding and compression effect. Furthermore, applying the above bitrate control method to the JPEG-LS image compression standard can effectively expand the applicability of the JPEG-LS image compression standard and facilitate algorithm hardware implementation.

[0122] Based on the same technical concept, embodiments of this application provide a computer device, which can be... Figure 1 The encoding device shown, such as Figure 5 As shown, it includes at least one processor 501 and a memory 502 connected to at least one processor. In this embodiment, the specific connection medium between the processor 501 and the memory 502 is not limited. Figure 5 Taking the connection between processor 501 and memory 502 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.

[0123] In this embodiment of the application, the memory 502 stores instructions that can be executed by at least one processor 501. By executing the instructions stored in the memory 502, at least one processor 501 can perform the steps of the above-described rate control method.

[0124] The processor 501 is the control center of the computer device. It can connect to various parts of the computer device using various interfaces and lines, and achieves bit rate control by running or executing instructions stored in the memory 502 and calling data stored in the memory 502. Optionally, the processor 501 may include one or more processing units. The processor 501 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.

[0125] Processor 501 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0126] Memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 502 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 502 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer device, but is not limited thereto. In the embodiments of this application, memory 502 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0127] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the above-described bitrate control method.

[0128] Those skilled in the art will understand that embodiments of the present invention can be provided as methods or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer apparatus or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0130] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer device or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0131] These computer program instructions may also be loaded onto a computer device or other programmable data processing equipment to cause a series of operational steps to be performed on the computer device or other programmable equipment to produce a process implemented by the computer device, thereby providing instructions that execute on the computer device or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0132] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0133] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method of rate control, characterized by, The method comprises the following steps: For each coding unit in the image to be encoded, the information entropy of the coding unit is used to query a preset first reference table to obtain a reference value of a coding core parameter of the coding unit, wherein the first reference table comprises reference values of coding core parameters corresponding to a plurality of information entropy ranges respectively, and the coding unit comprises a plurality of pixels to be encoded; The local activity level of each pixel to be encoded is used to query a preset second reference table to obtain a floating value of the coding core parameter corresponding to each pixel to be encoded, wherein the second reference table comprises floating values of coding core parameters corresponding to a plurality of local activity level ranges respectively; The reference value of the coding core parameter and the floating value of the coding core parameter of each pixel to be encoded are summed to obtain a coding core parameter value of each pixel to be encoded; Each pixel to be encoded is compressed and encoded by using the coding core parameter value of each pixel to be encoded, and a current compression ratio of the coding unit is determined based on the encoding result; If the current compression ratio is greater than a predetermined compression ratio threshold, the reference value of the coding core parameter is adjusted, and the step of compressing and encoding each pixel to be encoded based on the reference value of the coding core parameter and the local activity level of each pixel to be encoded, and determining the current compression ratio of the coding unit based on the encoding result is performed until the current compression ratio is less than or equal to the predetermined compression ratio threshold; The obtained encoding result is transmitted at a target code rate corresponding to the current compression ratio.

2. The method of claim 1, wherein, Before the step of using the information entropy of the coding unit to query the preset first reference table to obtain the reference value of the coding core parameter of the coding unit, the method further comprises the following steps: The information entropy of the coding unit is determined based on the occurrence probability of the pixel values of the plurality of pixels to be encoded in the coding unit.

3. The method of claim 1, wherein, Before the step of using the local activity level of each pixel to be encoded to query the preset second reference table to obtain the floating value of the coding core parameter corresponding to each pixel to be encoded, the method comprises the following steps: For each pixel to be encoded, the pixel values of a plurality of reference pixels located around the pixel to be encoded in the coding unit are obtained; The context gradient of the pixel to be encoded is determined based on the pixel values of the plurality of reference pixels, and the context gradient is used to represent the local activity level of the pixel to be encoded.

4. The method according to any one of claims 1 to 3, characterized in that, The step of determining the current compression ratio of the coding unit based on the encoding result comprises the following steps: The size of the coding unit after encoding compression is determined based on the encoding results of the plurality of pixels to be encoded; The current compression ratio of the coding unit is determined based on the size of the coding unit after encoding compression and the size of the coding unit before encoding compression.

5. A rate control apparatus characterized by comprising: The method comprises the following steps: An estimation module is configured to, for each coding unit in the image to be encoded, use the information entropy of the coding unit to query a preset first reference table to obtain a reference value of a coding core parameter of the coding unit, wherein the first reference table comprises reference values of coding core parameters corresponding to a plurality of information entropy ranges respectively, and the coding unit comprises a plurality of pixels to be encoded; The compression module is configured to query a preset second reference table according to the local activity degree of each pixel to be encoded to obtain a floating value of the encoding core parameter corresponding to each pixel to be encoded, wherein the second reference table includes a plurality of floating values of the encoding core parameter corresponding to a respective local activity degree range; The base value of the encoding core parameter is summed with the floating value of the encoding core parameter of each pixel to be encoded to obtain a value of the encoding core parameter of each pixel to be encoded; Each pixel to be encoded is compressed and encoded according to the value of the encoding core parameter of each pixel to be encoded, and a current compression ratio of the encoding unit is determined based on an encoding result; The judging module is configured to adjust the base value of the encoding core parameter if the current compression ratio is greater than a predetermined compression ratio threshold, and return to perform the step of compressing and encoding each pixel to be encoded based on the base value of the encoding core parameter and the local activity degree of each pixel to be encoded, and determining the current compression ratio of the encoding unit based on an encoding result until the current compression ratio is less than or equal to the predetermined compression ratio threshold. The transmission module is configured to transmit the obtained encoding result according to a target code rate corresponding to the current compression ratio.

6. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the method of any one of claims 1-4 when executing the program.

7. A computer readable storage medium characterized by, The computer device stores a computer program executable by the computer device, and when the program runs on the computer device, the computer device executes the steps of the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Image compression method, system and device based on code rate control of sparse coding

    CN112203089A

  • Encoding method and device, storage medium and electronic equipment

    CN112738516A