Method and device for image re-compression

WO2024237804A1PCT designated stage expired Publication Date: 2024-11-21HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
PCT/RU2023/000147
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2024-11-21

Smart Images

  • Figure RU2023000147_21112024_PF_FP_ABST
    Figure RU2023000147_21112024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of this application provide a method for image re-compression and a related device. The method includes: obtaining, according to a first image, quantized discrete cosine transform (DCT) coefficients; obtaining, according to context information of each of the quantized DCT coefficients, probability distribution parameters corresponding to each of the quantized DCT coefficients; determining, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients, probability of each of the quantized DCT coefficients; and coding, according to the probability of each of the quantized DCT coefficients, the first image. The proposed technique makes it possible to save the disk space.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD AND DEVICE FOR IMAGE RE-COMPRESSIONTECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of image compression, and more particularly, to a method for image re-compression and a related device.BACKGROUND

[0002] In recent years with emerging multiple various data storage and cloud services the problem of data compression became vital again. One of the key and most expensive factors for organizing cloud services is disk space.

[0003] The most part of the data currently located in the cloud is media data. This data is normally compressed in a more or less efficient way but still it is very desirable to improve its compression further to save the disk space for the cloud. Thus the problem of re-compression for this data emerges.

[0004] Therefore, how to recompress a compressed image is a challenge.SUMMARY

[0005] Embodiments of the present application provide a method for image re-compression and a related device. The technical solution may save the disk space.

[0006] According to a first aspect, an embodiment of this application provides a method for image re-compression, where the method includes: obtaining, according to a first image, quantized discrete cosine transform (DCT) coefficients; obtaining, according to context information of each of the quantized DCT coefficients, probability distribution parameters corresponding to each of the quantized DCT coefficients; idetermining, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients, probability of each of the quantized DCT coefficients; and coding, according to the probability of each of the quantized DCT coefficients, the first image.

[0007] According to the method above, the probability distribution parameter can accurately predict the probability of each quantized DCT coefficient, so that the encoding length of each quantized DCT coefficient can be adjusted according to the probability of each quantized DCT coefficient, so as to obtain a higher compression ratio and further save storage space.

[0008] In a possible design, the first image is a JPEG image.

[0009] In a possible design, the obtaining, according to a first image, quantized discrete cosine transform (DCT) coefficients, includes: obtaining, by decoding the JPEG image, each of the quantized DCT coefficients.

[0010] In a possible design the probability distribution is a Laplace distribution.

[0011] In a possible design, the probability distribution parameters include the standard deviation of the probability distribution.

[0012] In a possible design, the Laplace distribution parameters include a standard deviation of the Laplace distribution.

[0013] In a possible design, the obtaining, according to context information of each of the quantized DCT coefficients, probability distribution parameters corresponding to each of the quantized DCT coefficients, include: obtaining, according to the context information in three directions of each of the quantized DCT coefficients, three standard deviations of the probability distributions corresponding to each of the quantized DCT coefficients; and obtaining, according to the three standard deviations of the probability distributions, a target standard deviation of the probability distributions corresponding to each of the quantized DCT coefficients.

[0014] In a possible design, the determining, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients, probability of each of the quantized DCT coefficients, includes: determining, according to the probability distributionparameters corresponding to each of the quantized DCT coefficients and a value of each of the quantized DCT coefficients, the probability of each of the quantized DCT coefficients.

[0015] In a possible design, the coding, according to the probability of each of the quantized DCT coefficients, the first image, includes: coding the quantized DCT coefficients using an entropy coder according to the probability of each of the quantized DCT coefficients.

[0016] In a possible design, the entropy coder is a multi-symbol arithmetic coder (MSAC) or a run-length Rice-Golomb coder (RLRG).

[0017] In a possible design, when using RLRG encoder, DCT coefficients in a bucket can be sorted according to Laplace distribution parameter computed for the previous bucket.

[0018] In a possible design, unification of all positions in an 8x8 block of an image in a data structure called bucket, so that there are 64 buckets for 8x8 blocks.

[0019] In a possible design, the coding, according to the probability of each of the quantized DCT coefficients, the first image, includes: if the number of zeros in a bucket to which quantized DCT coefficients are assigned is located is less than a threshold value, the coding of the quantized DCT coefficients in this bucket through the MSAC.

[0020] In a possible design, the coding, according to the probability of each of the quantized DCT coefficients, of the first image, includes: if the number of zeros in a bucket to which quantized DCT coefficients are assigned is located is greater than a threshold value, the coding of the quantized DCT coefficients in this bucket through the RLRG.

[0021] According to a second aspect, an embodiment of this application provides an electronic device, and the electronic device has function of implementing the method in the first aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or the software includes one or more modules corresponding to the function.

[0022] According to a third aspect, an embodiment of this application provides a computer readable storage medium including instructions. When the instructions are run on a computer, the computer is enabled to perform the method in the first aspect or any possible design of the first aspect.

[0023] According to a fourth aspect, an electronic device is provided, including a processor, a memory, and a communications interface. The processor is connected to the memory and thecommunications interface. The memory is configured to store instructions, the processor is configured to execute the instructions, and the communications interface is configured to communicate with another network element under control of the processor. When the processor executes the instructions stored in the memory, the processor is enabled to perform the method in the first aspect or any possible design of the first aspect.

[0024] According to a fifth aspect, a chip system is provided, where the chip system includes a memory and a processor, where the memory is configured to store a computer program, and the processor is configured to invoke the computer program from the memory and run the computer program, so that a server on which the chip is disposed performs the method in the first aspect or any possible design of the first aspect.

[0025] According to a sixth aspect, a computer program product is provided, where when the computer program product is run on a server, the server is enabled to perform the method in the first aspect or any possible design of the first aspect.DESCRIPTION OF DRAWINGS

[0026] One or more embodiments are exemplarily described by corresponding accompanying drawings, and these exemplary illustrations and accompanying drawings constitute no limitation on the embodiments. Elements with the same reference numerals in the accompanying drawings are illustrated as similar elements, and the drawings are not limited to scale, in which:

[0027] FIG. 1 is a schematic diagram of the method for image re-compression.

[0028] FIG. 2 shows context information collection for quantized DCT coefficients located in a specific bucket.

[0029] FIG. 3 shows a schematic diagram of coding different buckets based on different coders.

[0030] FIG. 4 shows results of application of a suggested method for re-compressing a set of test JPEG images.

[0031] FIG. 5 is a schematic block diagram of an electronic device according to an embodiment of this application.

[0032] FIG. 6 is a schematic block diagram of an electronic device according to an embodiment of this application.DESCRIPTION OF EMBODIMENTS

[0033] The following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are merely some but not all of the embodiments of the present invention. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0034] In the specification, claims, and accompanying drawings of the present invention, the term “include” and any other variants of the term mean to cover the non-exclusive inclusion. For example, a process, a method, a system, a product, or a device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes an unlisted step or unit, or optionally further includes another inherent step or unit of the process, the method, the product, or the device.

[0035] This application will present various aspects, embodiments or features in the context of a system including a plurality of devices, components, modules, and the like. It is to be understood and appreciated that the various systems may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in connection with the figures. In addition, combinations of these schemes can also be used.

[0036] In addition, in the embodiments of the present application, words such as “exemplary” and “for example” are used to represent examples or illustrations. Any embodiment or design described in this application as “exemplary” should not be construed as preferred or advantageous embodiment over other embodiments or designs. Rather, the use of the word example is intended to present a concept in a concrete way.

[0037] In this application, “relevant” and “corresponding” can sometimes be used interchangeably, it should be noted that, when the difference is not emphasized, the meaningsto be expressed are the same.

[0038] The service scenarios described in the embodiments of the present application are for the purpose of illustrating the technical solutions of the embodiments of the present application more clearly, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. In spite of the evolution of the architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to solving similar technical problems.

[0039] In recent years, with emerging multiple various data storage and cloud services, the problem of data compression became vital again. One of the key and most expensive factors for organizing cloud services is disk space.

[0040] The most part of the data currently located in the cloud is media data. This data is normally already compressed in a more or less efficient way but still it is very desirable to improve its compression further to save the disk space for the cloud. Thus the problem of refer this data compression emerges.

[0041] To solve the problem above, embodiments of the present application provide a method and device for image re-compression, which are helpful to further save the disk space.

[0042] FIG. 1 is a schematic diagram of a method for image re-compression. The method may be performed by a device for image re-compression, or by a module or a unit in the device for image re-compression. The method specifically includes the following steps.

[0043] Step 110: Extract quantized discrete cosine transform (DCT) coefficients of a first image.

[0044] The embodiment of this application does not specifically limit the first image, as long as the quantized DCT coefficient can be obtained from the first image. The following is an example of the possible implementation of the first image.

[0045] In one possible implementation, the first image is an original image without any compression operation. In the embodiment of the application, the quantized DCT coefficient can be obtained from the original image.

[0046] In one possible implementation, the first image is a joint photographic experts group (JPEG) image. In the embodiment of the application, the JPEG image can be decompressed to obtain quantized DCT coefficients corresponding to the JPEG image.

[0047] It should be understood that the JPEG image is a compressed image obtained by data compression of an image using JPEG technology. For convenience of description, the JPEG image is described in detail below.

[0048] For example, in the process of JPEG compression, the image will be divided into multiple blocks, the size of each block is 8x8 pixels, and each block is processed separately in the whole process of data compression. Each 8x8 block is represented as an 8x8 matrix in data. Two-dimensional DCT transformation is performed on the 8x8 matrix to obtain a matrix including 8x8 DCT coefficients. Then the DCT coefficient matrix is quantized, and the matrix including 8x8 quantized DCT coefficients is obtained. Finally, the quantized DCT coefficient matrix is transformed into a one-dimensional array, and the one-dimensional array is coded to obtain the above JPEG image.

[0049] In the embodiment of the present application, the JPEG image can be decompressed to obtain a matrix of quantized DCT coefficients corresponding to each block above, where each quantized DCT coefficient matrix includes 8x8 quantized DCT coefficients.

[0050] In the embodiment of the present application, a bucket is represented as a set of quantized DCT coefficients at a fixed position in each block. That is, an image divided into blocks of the size 8x8 pixels can include 64 buckets, and each bucket includes a set of quantized DCT coefficients at the same position in each 8x8 block. FIG. 2 shows a part of an image consisting of 20 blocks of the size 8x8 pixels, each block including 8x8 quantized DCT coefficients. Thus this part of an image includes 64 buckets, and each bucket includes a set of 20 quantized DCT coefficients at the same position in 20 blocks.

[0051] Optionally, in some embodiments, correlation between buckets can also be evaluated by using some correlation metrics. If some buckets have strong correlation, these buckets can be combined. After bucket merging, context information can also be shared between / among merged buckets.

[0052] In one possible implementation, we can use a Pearson correlation coefficient to evaluate the correlation between buckets.

[0053] Step 120: According to context information of each of the quantized DCT coefficients, determine probability distribution parameters corresponding to each of the quantized DCT coefficients.

[0054] The probability distribution parameters corresponding to each of the quantized DCT coefficients can be determined according to the context information of each of the quantized DCT coefficients, so that probability of each of the quantized DCT coefficients can be estimated according to the probability distribution parameters corresponding to each of the quantized DCT coefficients.

[0055] The probability distribution described above can be realized in a variety of ways and is not specified in this application embodiment. In one possible implementation, the probability distribution is generalized Gaussian. In another possible implementation, the probability distribution is Laplace distribution.

[0056] For the convenience of description, the quantized DCT coefficient in the Q-th bucket of the current block (i) shown in FIG. 2 is taken as an example to introduce the context information of the quantized DCT coefficient, for example, the dotted line represents the quantized DCT coefficient corresponding to position 1. Therein the Q is an integer greater than 0.

[0057] As shown in FIG. 2, a quantized DCT coefficient in the current block (for example, the quantized DCT coefficient corresponding to a position labeled 1 represented by a dotted line) can include context information in three directions, namely, a vertical (V) direction, a horizontal (H) direction and a diagonal (D) direction.

[0058] As an example, the context information in the vertical direction may include a set of quantized DCT coefficients of corresponding buckets in a plurality of blocks in the vertical direction, the length of which is confined by the size of an image. For example, as shown in FIG. 2, the set of quantized DCT coefficients includes quantized DCT coefficients corresponding to a position labeled 2 represented by a dotted line, quantized DCT coefficients corresponding to a position labeled 3 represented by a dotted line, and quantized DCT coefficients corresponding to a position labeled 4 represented by a dotted line.

[0059] As another example, the context information in the horizontal direction may include the set of quantized DCT coefficients of the corresponding bucket in a plurality of blocks in the horizontal direction, the length of the set of quantized DCT coefficients is confined by the size of an image. For example, as shown in FIG. 2, the set includes quantized DCT coefficients for a position labeled 5 represented by a dotted line, quantized DCT coefficients for a positionlabeled 6 represented by a dotted line, and quantized DCT coefficients for a position labeled 7 represented by a dotted line.

[0060] As another example, the context information in the diagonal direction may include the set of quantized DCT coefficients of the corresponding bucket in a plurality of blocks in the diagonal direction, the length of which is confined by the size of an image. For example, as shown in FIG. 2, the set includes quantized DCT coefficients for a position labeled 8 represented by a dotted line, quantized DCT coefficients for a position labeled 9 represented by a dotted line, and quantized DCT coefficients for a position labeled 10 represented by a dotted line.

[0061] Taking the probability distribution as Laplace distribution as a concrete example, the following describes in detail how to determine the Laplace distribution parameters corresponding to each of the quantized DCT coefficients according to the context information of each of the quantized DCT coefficients.

[0062] As an example, the Laplace distribution has two parameters to be predicted: a mean p and a standard deviation o. In one possible implementation, an embodiment of the present application can take p=0 and determine the o of the Laplace distribution corresponding to each quantized DCT coefficient based on the context information of each quantized DCT coefficient.

[0063] In the embodiment of the present application, the standard deviation of the Laplace distribution of a specific quantized DCT coefficient can be calculated by the following formula o.

[0064] a0= (1 - a a-i_ + alDCT L- (formula 1)

[0065] In this formula 1, the k is the index of buckets, i.e., k=l,2 '64; ;is a standard deviation for the bucket k, and i is the block indexis the absolute value of the DCT coefficient for the bucket k, and the block i — 1; and a is an empirical parameter.

[0066] We can predict a by the formula 1 in one direction, for example, horizontal (H), or vertical (V), or diagonal (D) direction. Or we can predict a by the formula 1 using a linear combination of two or three directions: horizontal (H), vertical (V), and diagonal (D) directions, in the embodiment of this application, it is not limited to predict cr by which of H, V and D.

[0067] Now to take into account 2D dependences, we predict a by the formula 1 in threedirections: horizontal, vertical, and diagonal directions. This yields three predicted cr:represents a standard deviation of the prediction in the horizontal direction calculated according to the formula 1 ,represents a standard deviation of the prediction in the vertical direction calculated according to the formula 1, andrepresents a standard deviation of the prediction in the diagonal direction calculated according to the formula 1. The resulting standard deviation is computed as:

[0068] cr0= Aa f + Ba^ + Cofd(formula 2)

[0069] Coefficients A, B, and C can be chosen in various ways.

[0070] Step 130: According to the Laplace distribution parameters corresponding to each of the quantized DCT coefficients, probability of each of the quantized DCT coefficients is determined respectively.

[0071] In the embodiment of the present application, after estimating the Laplace distribution parameters corresponding to each of the quantized DCT coefficients, the probability of each of the quantized DCT coefficients can be determined according to the Laplace distribution corresponding to each of the quantized DCT coefficients.

[0072] As an example, if the parameter of the Laplace distribution is the standard deviation o of the Laplace distribution, after estimating the standard deviation o of the Laplace distribution corresponding to the quantized DCT coefficients, a probability of the quantized DCT coefficients can be estimated either from an explicit formula or from a pre-computed table.

[0073] For example, the following explicit formulas are used for probabilities estimation.

[0074] (formula 3)

[0075] Now if X is a discrete alphabet ... -3, -2, -1, 0, 1, 2, 3, ..., then the probability of each of the quantized DCT coefficients would be approximated by means of formula 4:

[0076] P(Xitct) = F(Xt+ 0.5, a) - F(Xf- 0.5, a) (formula 4)

[0077] In the actual computation= DCTi}that is, the value of the i-th quantized DCT coefficient. The a is computed by the formula 1.

[0078] Step 140: Code each of the quantized DCT coefficients according to the probability of each of the quantized DCT coefficients.

[0079] After determining the probability of each of the quantized DCT coefficients, theembodiment of the application can code the quantized DCT coefficient through an entropy coder. Specifically, the entropy coder can code each quantized DCT coefficient either explicitly using the probability of each quantized DCT coefficient or not using the probability explicitly.

[0080] It should be understood that the embodiment of the application does not specifically define the above entropy coder, as long as it is an entropy coder that requires probability estimation.

[0081] In one example, the entropy coder utilizing the explicit probability computation is a multi-symbol arithmetic coder (MSAC). In another example, the entropy coder not using an explicit probability estimation is a run-length Rice-Golomb coder (RLRG).

[0082] It should be understood that different buckets can use the same entropy coder, or different entropy coders can also be used, which is not specifically defined in the embodiments of the present application.

[0083] Optionally, in some embodiments, a combination of MSAC and RLRG may be used for encoding. Specifically, all buckets can be divided into two groups. One group can code the quantized DCT coefficients using an MSAC and the other group can code the quantized DCT coefficients using an RLRG.

[0084] An embodiment of the present application does not specify the classification criteria for dividing all buckets into two groups. For example, as shown in FIG. 3, the classification criterion is the number of zeros in each bucket. If the number of zeros in the bucket is less than a threshold value, the DCT coefficients quantified in the bucket using the MSAC can be coded. If the number of zeros in the bucket is greater than a threshold value, the DCT coefficients quantified in the bucket using the RLRG can be coded.

[0085] The size of the above threshold value can be determined empirically according to experience.

[0086] For example, the results of application of the suggested method for re-compressing a set of test images is shown in FIG. 4.

[0087] It can be seen from the data in FIG. 4 that storage space can be saved by recompressing an image with the method provided in the embodiment of the application.

[0088] FIG. 5 is a schematic block diagram of an electronic device 500 according to an embodiment of this application. As shown in FIG. 5, the electronic device 500 includes: aprocessing unit 501 and a coding unit 502.

[0089] The processing unit 501 is configured to obtain, according to a first image, quantized discrete cosine transform (DCT) coefficients.

[0090] The processing unit 501 is further configured to obtain, according to context information of each of the quantized DCT coefficients, probability distribution parameters corresponding to each of the quantized DCT coefficients.

[0091] The processing unit 501 is further configured to determine, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients, probability of each of the quantized DCT coefficients.

[0092] The coding unit 502 is configured to code, according to the probability of each of the quantized DCT coefficients, the first image.

[0093] In some embodiments, the first image is a JPEG image.

[0094] In some embodiments, the processing unit 501 is specifically configured to obtain, by decoding the JPEG image, each of the quantized DCT coefficients.

[0095] In some embodiments, the probability distribution is a Laplace distribution.

[0096] In some embodiments, the probability distribution parameters include a standard deviation of the probability distribution.

[0097] In some embodiments, the Laplace distribution parameters include a standard deviation of the Laplace distribution.

[0098] In some embodiments, the processing unit 501 is specifically configured to obtain, according to the context information in three directions of each of the quantized DCT coefficients, three standard deviations of the probability distributions corresponding to each of the quantized DCT coefficients; and obtain, according to the three standard deviations of the probability distribution, a target standard deviation of the probability distributions corresponding to each of the quantized DCT coefficients.

[0099] In some embodiments, the processing unit 501 is specifically configured to determine, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients and a value of each of the quantized DCT coefficients, the probability of each of the quantized DCT coefficients.

[0100] In some embodiments, the coding unit 502 is specifically configured to code thequantized DCT coefficients using an entropy coder according to the probability of each of the quantized DCT coefficients.

[0101] In some embodiments, the entropy coder is a multi-symbol arithmetic coder (MSAC) or a run-length Rice-Golomb coder (RLRG).

[0102] In some embodiments, unification of all positions in an 8x8 block of an image in a data structure called bucket, so that there are 64 buckets for 8x8 blocks.

[0103] In some embodiments, if the number of zeros in a bucket to which quantized DCT coefficients are assigned is located is less than a threshold value, the coding unit 502 is specifically configured to code all quantized DCT coefficients in this bucket through the MSAC.

[0104] In some embodiments, if the number of zeros in a bucket where a first quantized DCT coefficient is located is greater than a threshold value, the coding unit 502 is specifically configured to code all quantized DCT coefficients in this bucket through the RLRG.

[0105] It should be understood that the electronic device 500 in this embodiment of this application may correspond to the electronic device in the above-mentioned embodiments, and the foregoing and other management operations and / or functions of the units in the electronic device are separately used to implement corresponding steps of the foregoing methods. For brevity, details are not described herein again.

[0106] As shown in FIG.6, an electronic device 600 may include a transceiver 601 , a processor 602, and a memory 603. The memory 603 may be configured to store code, instructions, and the like executed by the processor 602.

[0107] It should be understood that the processor 602 may be an integrated circuit chip and has a signal processing capability. In an implementation process, steps of the foregoing method embodiments may be completed by using a hardware integrated logic circuit in the processor, or by using instructions in a form of software. The processor may be a general purpose processor, a central processing unit (CPU), a graphics processing unit (GPU), a neural processing unit (NPU), a system on chip (SoC) or another programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The processor may implement or perform the methods, the steps, and the logical block diagrams that are disclosed in the embodiments of the present invention. The general purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The steps of the methodsdisclosed with reference to the embodiments of the present invention may be directly performed and completed by a hardware decoding processor, or may be performed and completed by using a combination of hardware in the decoding processor and a software module. The software module may be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory, and the processor reads information in the memory and completes the steps of the foregoing methods in combination with hardware in the processor.

[0108] It may be understood that the memory 603 in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), or a flash memory. The volatile memory may be a random access memory (Random Access Memory, RAM) and is used as an external cache. By way of example rather than limitation, many forms of RAMs may be used, and are, for example, a static random access memory (Static RAM, SRAM), a dynamic random access memory (Dynamic RAM, DRAM), a synchronous dynamic random access memory (Synchronous DRAM, SDRAM), a double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), an enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), a synchronous link dynamic random access memory (Synchronous link DRAM, SLDRAM), and a direct rambus random access memory (Direct Rambus RAM, DR RAM).

[0109] It should be noted that the memory in the systems and the methods described in this specification includes but is not limited to these memories and a memory of any other appropriate type.

[0110] An embodiment of this application further provides a system chip, where the system chip includes an input / output interface, at least one processor, at least one memory, and a bus. The at least one memory is configured to store instructions, and the at least one processor is configured to invoke the instructions of the at least one memory to perform operations in themethods in the foregoing embodiments.

[0111] An embodiment of this application further provides a computer storage medium, where the computer storage medium may store a program instruction for performing any of the foregoing methods.

[0112] Optionally, the storage medium may be specifically the memory 603.

[0113] A person of ordinary skill in the art may be aware that, in combination with the examples described in the embodiments disclosed in this specification, units and algorithm steps can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed by hardware or software depends on particular applications and design constraints of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of this application.

[0114] It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiment. Details are not described herein again.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, the unit division is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.

[0116] The units described as separate parts may be or may not be physically separate, and parts displayed as units may be or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of the embodiments.

[0117] In addition, functional units in the embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit.

[0118] When the functions are implemented in a form of a software functional unit and sold or used as an independent product, the functions may be stored in a computer readable storage medium. Based on such an understanding, the technical solutions in this application essentially, or the part contributing to the prior art, or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the methods described in the embodiments of this application. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk, or an optical disc.

[0119] The foregoing descriptions are merely specific implementations of this application, but are not intended to limit the protection scope of this application. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in this application shall fall within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims

CLAIMSWhat is claimed is:

1. A method for image re-compression, comprising: obtaining, according to a first image, quantized discrete cosine transform (DCT) coefficients; obtaining, according to context information of each of the quantized DCT coefficients, probability distribution parameters corresponding to each of the quantized DCT coefficients; determining, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients, probability of each of the quantized DCT coefficients; and coding, according to the probability of each of the quantized DCT coefficients, the first image.

2. The method according to claim 1, wherein the probability distribution parameters comprises Laplace distribution parameters.

3. The method according to claim 1 or 2, wherein the first image is a JPEG image.

4. The method according to claim 3, wherein the obtaining, according to a first image, quantized discrete cosine transform (DCT) coefficients, comprises: obtaining, by decoding the JPEG image, each of the quantized DCT coefficients.

5. The method according to any one of claims 1-4, wherein the probability distribution parameters comprise a standard deviation of the probability distribution.

6. The method according to claim 5, wherein the obtaining, according to context information of each of the quantized DCT coefficients, probability distribution parameters corresponding to each of the quantized DCT coefficients, comprises: obtaining, according to the context information in three directions of each of the quantized DCT coefficients, three standard deviations of the probability distributions corresponding to each of the quantized DCT coefficients; and obtaining, according to the three standard deviations of the probability distribution, a target standard deviation of the probability distributions corresponding to each of the quantized DCT coefficients.

7. The method according to any one of claims 1-6, wherein the determining, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients, probability of each of the quantized DCT coefficients, comprises: determining, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients and a value of each of the quantized DCT coefficients, the probability of each of the quantized DCT coefficients.

8. The method according to any one of claims 1-7, wherein the coding, according to the probability of each of the quantized DCT coefficients, the first image, comprises: coding the quantized DCT coefficients using an entropy coder according to the probability of each of the quantized DCT coefficients.

9. The method according to claim 8, wherein the entropy coder is a multi-symbol arithmetic coder (MS AC) or a run-length Rice-Golomb coder (RLRG).

10. The method according to claim 9, wherein the coding, according to the probability of each of the quantized DCT coefficients, the first image, comprises: if the number of zeros in a bucket where a first quantized DCT coefficient is located is less than a threshold value, the coding of the quantized DCT coefficients in the bucket through the MSAC.

11. The method according to claim 9, wherein the coding, according to the probability of each of the quantized DCT coefficients, the first image, comprises: if the number of zeros in a bucket where a first quantized DCT coefficient is located is greater than a threshold value, the coding of the quantized DCT coefficients in the bucket through the RLRG.

12. An electronic device, comprising: a processing unit, configured to obtain, according to a first image, quantized discrete cosine transform (DCT) coefficients; the processing unit, further configured to obtain, according to context information of each of the quantized DCT coefficients, probability distribution parameters corresponding to each of the quantized DCT coefficients; the processing unit, further configured to determine, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients, probability ofeach of the quantized DCT coefficients; and a coding unit, configured to code, according to the probability of each of the quantized DCT coefficients, the first image.

13. The electronic device according to claim 12, wherein the probability distribution parameters comprises Laplace distribution parameters <>14. The electronic device according to claim 12 or 13, wherein the first image is a JPEG image.

15. The electronic device according to claim 14, wherein the processing unit is further configured to obtain, by decoding the JPEG image, each of the quantized DCT coefficients.

16. The electronic device according to any one of claims 12-15, wherein the probability distribution parameters comprise a standard deviation of the probability distribution.

17. The electronic device according to claim 16, wherein the processing unit is further configured to obtain, according to the context information in three directions of each of the quantized DCT coefficients, three standard deviations of the probability distributions corresponding to each of the quantized DCT coefficients; and obtain, according to the three standard deviations of the probability distributions, a target standard deviation of the probability distributions corresponding to each of the quantized DCT coefficients.

18. The electronic device according to any one of claims 12-17, wherein the processing unit is further configured to determine, according to the probability distribution parameters corresponding to each of the quantized DCT coefficients and a value of each of the quantized DCT coefficients, the probability of each of the quantized DCT coefficients.

19. The electronic device according to any one of claims 12-18, wherein the coding unit is further configured to code the quantized DCT coefficients using an entropy coder according to the probability of each of the quantized DCT coefficients.

20. The electronic device according to claim 19, wherein the entropy coder is a multisymbol arithmetic coder (MS AC) or a run-length Rice-Golomb coder (RLRG).

21. The electronic device according to claim 20, wherein if the number of zeros in a bucket where a first quantized DCT coefficient is located is less than a threshold value, the coding unit is further configured to code the quantized DCT coefficients in the bucket through the MS AC.

22. The electronic device according to claim 20, wherein if the number of zeros in a bucketwhere a first quantized DCT coefficient is located is greater than a threshold value, the coding unit is further configured to code the quantized DCT coefficients in the bucket through the RLRG.

23. A computer readable storage medium storing instructions that, when run on a server, enable the server to perform the method according to any one of claims 1 to 11.

24. A device, comprising a memory and a processor, wherein the memory is configured to store a computer program, and the processor is configured to invoke the computer program from the memory and run the computer program, so that a server on which a chip is disposed performs the method according to any one of claims 1 to 11.

25. A computer program product, wherein when the computer program product is run on a server, the server is enabled to perform the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN114363615A

  • Picture processing method and apparatus

    US20230039840A1