CN116366867A - Data transformation and recovery method, device and system, electronic equipment and storage medium - Google Patents
Data transformation and recovery method, device and system, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116366867A CN116366867A CN202111626735.1A CN202111626735A CN116366867A CN 116366867 A CN116366867 A CN 116366867A CN 202111626735 A CN202111626735 A CN 202111626735A CN 116366867 A CN116366867 A CN 116366867A
- Authority
- CN
- China
- Prior art keywords
- data
- integer
- matrix
- transformation
- inverse
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 67
- 238000011084 recovery Methods 0.000 title claims abstract description 35
- 238000013501 data transformation Methods 0.000 title abstract description 9
- 239000011159 matrix material Substances 0.000 claims abstract description 392
- 230000009466 transformation Effects 0.000 claims abstract description 225
- 238000007667 floating Methods 0.000 claims abstract description 75
- 238000013139 quantization Methods 0.000 claims abstract description 66
- 238000006243 chemical reaction Methods 0.000 claims abstract description 22
- 238000012545 processing Methods 0.000 claims abstract description 22
- 238000007493 shaping process Methods 0.000 claims description 70
- 238000007906 compression Methods 0.000 claims description 35
- 230000006835 compression Effects 0.000 claims description 35
- 230000002441 reversible effect Effects 0.000 claims description 34
- 238000011550 data transformation method Methods 0.000 claims description 23
- 230000001131 transforming effect Effects 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 3
- 238000013144 data compression Methods 0.000 abstract description 24
- 238000010586 diagram Methods 0.000 description 17
- 238000013527 convolutional neural network Methods 0.000 description 6
- 238000000605 extraction Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 230000006837 decompression Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/625—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
The disclosure provides a data transformation and recovery method, a device, a system, electronic equipment and a storage medium, and relates to the technical field of data processing. The method comprises the following steps: obtaining a preconfigured integer matrix; performing integer transformation on data to be compressed by utilizing an integer matrix; and encoding the data to be compressed after integer conversion to obtain compressed data. The full integer transformation scheme can be realized, not only has no floating point expression error or quantization error, but also can generate more 0 coefficients than the traditional integer transformation/DCT transformation, and effectively improves the data compression ratio and the data compression efficiency.
Description
Technical Field
The disclosure relates to the technical field of data processing, and in particular relates to a data transformation and recovery method, a device, a system, electronic equipment and a storage medium.
Background
In the digital multimedia age, a large amount of image or video data requires a large amount of memory space. For compression processing of image or video data, DCT transformation (Discrete Cosine Transform, discrete cosine transformation) or integer transformation is widely used in the related art to obtain a higher compression ratio, for example, DCT transformation is adopted in the JPEG (Joint Photographic Experts Group ) standard; integer transform is adopted in the h.264 standard (new generation digital video compression format followed by MPEG4 by the international organization for standardization and the international telecommunication union) to compress the residual signal; the feature encoding in the VCM (Video Coding For Machines, machine vision encoding) standard employs DCT transformation.
The traditional integer transform is derived from the DCT transform, and the equivalent matrix of the DCT transform is slightly modified to incorporate floating point operation error terms into quantization. Thus, the integer transform scheme performance penalty is derived only from quantization; while the performance penalty of the DCT transform scheme derives from the error terms of the quantization and the floating point operations of the DCT transform itself. However, as can be seen by careful analysis, the conventional integer transform scheme, not the full integer transform scheme, incorporates floating point error terms into quantization, and although the floating point operation error is somewhat reduced, this error is unavoidable, and thus neither the DCT transform scheme nor the conventional integer transform scheme completely eliminates the floating point operation error.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a data transformation and recovery method, apparatus, system, electronic device, and storage medium, which at least overcome to some extent the technical problem that the compression scheme based on the conventional integer transformation in the related art cannot completely eliminate floating point operation errors.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to one aspect of the present disclosure, there is provided a data transformation method, the method comprising: obtaining a preconfigured integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational matrix; and carrying out integer transformation on the data to be transformed by utilizing the integer matrix.
In some embodiments, the data to be transformed is integer transformed by the following formula:
Y=IXI T ;
wherein Y represents the integer transformed data; x represents data before integer conversion; i represents a reversible and inverse matrix which is preconfigured integer matrix of rational number matrix; i T Representing the transposed matrix of I.
In some embodiments, the integer transformed data is inverse transformed to recover the data prior to the integer transformation by:
X=FYF T ;
wherein Y represents the integer transformed data; x represents the recovered data, i.e., the data before integer transformation; f represents the inverse matrix of I, which is a rational matrix; f (F) T Representing the transposed matrix of F.
In some embodiments, the integer transformed data is inverse transformed to recover the data prior to the integer transformation by:
Wherein F represents the inverse matrix of I and is a rational matrix; n represents an integer matrix of the same dimension as F, each element being N; n is a positive integer;the kronecker product, representing F and N, is an integer matrix; />Representation ofIs a transposed matrix of (a).
In some embodiments, the data to be transformed is shaped data, the forward transform and the inverse transform of the shaped data are both integer transforms of a full integer operation, the method further comprising: integer transformation of full integer operation is carried out on the shaping data to be transformed by utilizing the integer matrix; and carrying out inverse transformation of full integer operation on the data after integer transformation by utilizing the integer matrix after shaping the inverse matrix of the integer matrix, and recovering the shaped data.
In some embodiments, the data to be transformed is floating point data, the method further comprising: quantizing floating point data to be transformed to obtain quantized shaping data; performing integer transformation of full integer operation on the quantized shaping data by utilizing an integer matrix; and carrying out inverse transformation on the data after integer transformation by utilizing the integer matrix after shaping the inverse matrix of the integer matrix, and recovering the data before integer transformation.
In some embodiments, the data to be transformed is floating point data, the method further comprising: transforming floating point data to be transformed by utilizing an integer matrix to obtain transformed floating point data; and (3) carrying out inverse transformation on the transformed floating point data by using the integer matrix after shaping the inverse matrix of the integer matrix, and recovering the floating point data before transformation.
In some embodiments, the data to be transformed is floating point data, the method further comprising: transforming floating point data to be transformed by utilizing an integer matrix to obtain transformed floating point data; carrying out quantization processing on the converted floating point data; performing inverse quantization on the quantized data; and carrying out inverse transformation on the inverse quantized floating point data by utilizing the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recovering the floating point data before transformation.
In some embodiments, the data to be transformed includes at least any one of: image data, video data, residual data, feature data.
According to another aspect of the present disclosure, there is also provided a data recovery method, including: obtaining data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by using an integer matrix, and the integer matrix is reversible and the inverse matrix is a rational number matrix; and carrying out inverse transformation on the data to be recovered by utilizing the inverse matrix of the integer matrix so as to recover the data before the integer transformation.
According to another aspect of the present disclosure, there is also provided a data recovery method, including: obtaining data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by using an integer matrix, and the integer matrix is reversible and the inverse matrix is a rational number matrix; and carrying out inverse transformation on the data to be recovered by utilizing the integer matrix after shaping the inverse matrix so as to recover the data before the integer transformation.
According to another aspect of the present disclosure, there is also provided a data conversion apparatus including: the configuration module is used for obtaining a preconfigured integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational number matrix; and the transformation module is used for carrying out integer transformation on the data to be transformed by utilizing the integer matrix.
According to another aspect of the present disclosure, there is also provided a data recovery apparatus including: the data acquisition module is used for acquiring data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by utilizing an integer matrix, and the integer matrix is reversible and the inverse matrix is a rational matrix; and the inverse transformation module is used for carrying out inverse transformation on the data to be recovered by utilizing the inverse matrix of the integer matrix so as to recover the data before the integer transformation.
According to another aspect of the present disclosure, there is also provided a data recovery apparatus including: the data acquisition module is used for acquiring data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by utilizing an integer matrix, and the integer matrix is reversible and the inverse matrix is a rational matrix; and the inverse transformation module is used for carrying out inverse transformation on the data to be recovered by utilizing the integer matrix after shaping the inverse matrix so as to recover the data before the integer transformation.
According to another aspect of the present disclosure, there is also provided an image compression system including: a first encoding module and a first decoding module; the first coding module is used for obtaining a preconfigured integer matrix and carrying out integer transformation on the image data by utilizing the integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational matrix; the first decoding module is configured to reverse transform the integer transformed data by using an inverse matrix of the integer matrix or an integer matrix obtained by shaping the inverse matrix, and recover image data before the integer transformation.
In some embodiments, the first encoding module is further to: encoding the integer transformed data, and transmitting the encoded data to the first decoding module; the first decoding module is further configured to decode the data from the first encoding module, and inverse transform the decoded data by using the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, to recover the data before the integer transformation.
In some embodiments, the first encoding module employs an encoding scheme that performs a ZigZag scan or an encoding scheme that does not perform a ZigZag scan.
According to another aspect of the present disclosure, there is also provided a feature compression system, comprising: a second encoding module and a second decoding module; the second coding module is configured to obtain a preconfigured integer matrix, and perform integer transformation on the feature data by using the integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational matrix; and the second decoding module is used for carrying out inverse transformation on the data after integer transformation by utilizing the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recovering the data before integer transformation.
In some embodiments, the second encoding module is further to: encoding the integer transformed data and transmitting the encoded data to the second decoding module; the second decoding module is further configured to decode the data from the second encoding module, and inverse transform the decoded data by using the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, to recover the data before the integer transformation.
In some embodiments, the second encoding module employs an encoding scheme that performs a ZigZag scan or an encoding scheme that does not perform a ZigZag scan.
In some embodiments, the second encoding module is further configured to quantize the feature data, and perform integer transform of full integer operation on the quantized feature data using the integer matrix; the second decoding module is further configured to perform inverse transformation of full integer operation on the data after integer transformation by using the integer matrix after shaping the inverse matrix, and perform inverse quantization processing on the data after inverse transformation, so as to obtain original feature data.
In some embodiments, the second encoding module is further configured to perform integer transform on the feature data, and perform quantization on the feature data after the integer transform; the second decoding module is further configured to perform inverse quantization processing on the quantized feature data, and perform inverse transformation on the inverse quantized data by using the integer matrix after shaping the inverse matrix, so as to obtain original feature data.
According to another aspect of the present disclosure, there is also provided a residual compression system including: a third encoding module and a third decoding module; the third coding module is configured to obtain a preconfigured integer matrix, and perform integer transformation on residual data by using the integer matrix, where the integer matrix is reversible and the inverse matrix is a rational matrix; and the third decoding module is used for carrying out inverse transformation on the data after integer transformation by utilizing the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recovering the data before integer transformation.
In some embodiments, the third encoding module is further to: encoding the integer transformed data, and transmitting the encoded data to the third decoding module; the third decoding module is further configured to decode the data from the third encoding module, and inverse transform the decoded data by using the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, to recover the data before the integer transformation.
In some embodiments, the third encoding module employs an encoding scheme that performs a ZigZag scan or an encoding scheme that does not perform a ZigZag scan.
According to another aspect of the present disclosure, there is also provided an electronic apparatus including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the data transformation method of any one of the above, or the data recovery method of any one of the above, via execution of the executable instructions.
According to another aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the data transformation method of any one of the above, or the data recovery method of any one of the above.
The data transformation and recovery method, device, system, electronic equipment and storage medium provided by the embodiment of the disclosure utilize a pre-configured reversible and inverse matrix as an integer matrix of a rational matrix to carry out integer transformation on data to be transformed, and when the data to be transformed is a shaping matrix, the integer transformation of full integer operation can be realized; when floating point data of the data to be converted is quantized, integer conversion of full integer operation can be realized on the quantized shaping matrix, not only is no floating point expression error or quantization error generated, but also more 0 coefficients can be generated compared with the traditional integer conversion/DCT conversion, and the data compression ratio and the data compression efficiency are effectively improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 illustrates a flow chart for implementing data compression based on conventional integer transforms in the related art;
FIG. 2 is a diagram showing the result of data transformation using conventional DCT/integer transformation in the related art;
FIG. 3 illustrates a flow chart for implementing data compression based on a new integer transform in an embodiment of the disclosure;
FIG. 4 is a schematic diagram showing a basic quantization step size and step size multiplying power combined quantization in an embodiment of the present disclosure;
FIG. 5 illustrates a data transformation result diagram employing a new integer transformation in an embodiment of the present disclosure;
FIG. 6 illustrates a flow chart of a data transformation method in an embodiment of the present disclosure;
FIG. 7 illustrates a flow chart of a data recovery method in an embodiment of the present disclosure;
FIG. 8 illustrates a flow chart of yet another data recovery method in an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of a data conversion device in an embodiment of the disclosure;
FIG. 10 is a schematic diagram of a data recovery device according to an embodiment of the disclosure;
FIG. 11 illustrates a schematic diagram of an image compression system in an embodiment of the present disclosure;
FIG. 12 illustrates a schematic diagram of a feature compression system in an embodiment of the present disclosure;
FIG. 13 illustrates a residual compression system schematic diagram in an embodiment of the present disclosure;
fig. 14 shows a block diagram of an electronic device in an embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
For ease of understanding, before describing embodiments of the present disclosure, several terms referred to in the embodiments of the present disclosure are first explained as follows:
Compression: the data size is reduced by some technical means.
Decompression: and restoring the data with the reduced data size to the original size through a certain technical means.
Encoding: a specific technical means of compression.
Decoding: a specific means of decompression.
DCT (discrete cosine transform): english, which is known as Discrete Cosine Transform, translates to "discrete cosine transform" for lossy data compression of images or video.
ZigZag scan: i.e. zig-zag scanning, converts the quantized coefficients from two dimensions to one dimension according to a certain path (zig-zag) scanning. After DCT transformation and quantization, the lower right corner of the matrix is basically changed to zero value, the non-zero value is basically concentrated in the upper left corner of the matrix, and after ZigZag scanning, the two-dimensional matrix can be transformed into a one-dimensional string, the front part of the string is mainly non-zero value, and the rear part is mainly zero value.
The following detailed description of the present disclosure refers to the accompanying drawings and examples.
First, the conventional DCT transform is analyzed: the two-dimensional DCT transform is equivalent to the prior DCT transform, and the following DCT transforms can be used to represent the inverse DCT transform by the following matrix:
Y=AXA T (1)
X=BYB T (2)
wherein b=a -1 A is as follows:
conventional integer transforms are derived from DCT transforms:
The DCT transform formula is:
taking d=c/b (approximately equal to 0.414), in order to complete the integer transform, d=0.5 must be taken and correctedAt this point, an integer transform formula is obtained:
at this time, a modified integer transform matrix is obtained:
fig. 1 is a flowchart illustrating a related art implementation of data compression based on a conventional integer transform, and if data is compressed using the conventional integer transform, hadamard transform/quantization and zig-zag scan are required for transform coefficients, as shown in fig. 1. Among them, the zigZag scan is a necessary module of the system, and the zigZag scan itself brings about a large amount of computation.
Analysis shows that conventional DCT transforms and integer transforms suffer from the following drawbacks:
1) The conventional integer transform is derived from the DCT transform, and is the result of a slight modification of the coefficients of the DCT transform, resulting in a scheme of integer transform that is unique.
2) The traditional DCT transformation and the integer transformation do not reach the 0 coefficient proportion optimum; fig. 2 shows the result of transforming a 4×4 data block by conventional DCT and integer transform, and it can be seen that the result of conventional DCT and integer transform is not optimal although there are many non-0 coefficients. The conventional integer transform does not increase the scale of 0 coefficients relative to the DCT transform.
3) The conventional DCT/integer transform is not a complete integer transform, the error term E still contains an irrational floating point number, but the error is properly reduced by combining with quantization, but the error is still unavoidable;
4) The coefficient encoding/decoding of the conventional DCT transform/integer transform relies on the ZigZag scan (i.e., zig-zag scan) to group the 0 coefficients together, while the ZigZag itself is computationally inexpensive.
In order to solve the technical problem that a compression scheme based on conventional integer transformation cannot completely eliminate floating point operation errors in the related art, the embodiments of the present disclosure provide a data transformation method and a data recovery method based on new integer transformation, and before introducing the data transformation method and the data recovery method, the new integer transformation is described:
the new integer transform provided in the embodiments of the present disclosure only constrains I to be an integer matrix that is reversible and the inverse matrix is a rational matrix of numbers:
Y=IXI T (8)
X=FYF T (9)
wherein Y represents the integer transformed data; x represents data before integer conversion; i represents a reversible and inverse matrix which is preconfigured integer matrix of rational number matrix; i T Representing the transpose matrix of I; f=i -1 The inverse matrix representing I is a rational matrix; f (F) T Representing the transposed matrix of F. Further, to implement the inverse transform of the whole integer, the inverse matrix may be shaped:
wherein N represents an integer matrix of the same dimension as F, each element being N; n is a positive integer;the kronecker product, representing F and N, is an integer matrix; />Representation->Is a transposed matrix of (a).
Because the new integer transformation provided in the embodiments of the present disclosure utilizes an integer matrix that is independent of the DCT, integer transformation and inverse transformation of full integer operations can be performed for the shaped data without any information loss; for floating point data, after the floating point data is quantized, the quantized shaping matrix is subjected to integer transformation of full integer operation, so that not only is no floating point expression error or quantization error generated, but also more 0 coefficients can be generated compared with the traditional integer transformation/DCT transformation, and the data compression ratio and the data compression efficiency are effectively improved.
Fig. 3 shows a flowchart of implementing data compression based on a new integer transform in an embodiment of the disclosure, and as shown in fig. 3, the quantization module is an optional module when implementing data compression using the new integer transform provided in the embodiment of the disclosure. Embodiments of the present disclosure may implement quantization of integer (floating point) data to shaped data in two ways:
Mode a: fixing a quantization table;
mode b: and (3) quantization of the combination of the basic quantization step length and the step length multiplying power. Fig. 4 is a schematic diagram illustrating a combination of a basic quantization step size and a step size magnification to implement quantization in an embodiment of the present disclosure.
1) Obtaining the absolute value maximum abs_max=max (abs (c))
2) The basic quantization is divided into (2×INT_MAX+1) steps: the basic quantization step length is abs_max/INT_MAX;
3) Setting a step multiplying power q_table in a corresponding step multiplying power table;
4) Multiplying the basic quantization step by the step multiplying power of the step multiplying power table to obtain a specific quantization step s=q_table×abs_max/int_max of each position;
5) The coefficients undergo corresponding quantization y_quant=round (Y/s); the round function may return a value that is the result of a rounding operation to the specified decimal place.
6) The dequantization operation is y=y_quant×s;
for example, a fixed quantization table of 4x4 is shown in table 1, and a step size ratio table of 4x4 is shown in table 2.
TABLE 1
1 | 1 | 1 | 4 |
1 | 1 | 4 | 4 |
1 | 4 | 4 | 8 |
4 | 4 | 8 | 8 |
TABLE 2
1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 |
1 | 1 | 1 | 2 |
1 | 1 | 2 | 2 |
The following is a practical example to illustrate the advantages of the new integer transform in the embodiments of the present disclosure:
the preconfigured integer matrix is assumed as follows:
then there are:
the design is as follows:
FIG. 5 is a schematic diagram of the data transformation results using a new integer transformation in an embodiment of the present disclosure, as shown in FIG. 5, which has the following advantages:
1) The integer conversion system of whole integer operation can completely eliminate errors and improve the original performance index of the system;
2) Generating more 0 coefficients than the traditional DCT/integer quantization, and improving the compression ratio of the whole compression system;
3) A configurable/non-unique integer quantization system, for use in a plurality of possible scenarios;
4) Further 0 coefficients, configurable different coefficient distributions, make the ZigZag scan encoding a selectable option instead of a mandatory option. Two coding modes are provided in the embodiments of the present disclosure: (1) the encoding mode of the ZigZag scanning is not executed; (2) the encoding scheme of the ZigZag scan is performed.
Based on the new integer transformation provided in the embodiments of the present disclosure, the embodiments of the present disclosure disclose a data transformation method and a data recovery method, which utilize a preconfigured integer matrix to perform integer transformation on data to be transformed, and perform inverse transformation on the data after the integer transformation, so that a full integer transformation scheme can be implemented, not only has no floating point expression error and quantization error, but also can generate more 0 coefficients than the traditional integer transformation/DCT transformation, and effectively improve the data compression ratio and the data compression efficiency.
The data transformation method and the data recovery method provided in the embodiments of the present disclosure may be performed by any electronic device having computing processing capabilities. In the data compression system, the data transformation method in the embodiment of the present disclosure may be performed by the encoding end device, and the data recovery method in the embodiment of the present disclosure may be performed by the decoding end device.
It should be noted that, the electronic device performing the data transformation method and the data recovery method in the embodiments of the present disclosure may be a terminal device or a server. The terminal device may include, but is not limited to, a smart phone, a tablet computer, a laptop portable computer, a desktop computer, a wearable device, an augmented reality device, a virtual reality device, etc.; the server may be a server providing various services, such as a background management server providing support for devices operated by the user with the terminal device. The background management server can analyze and process the received data such as the request and the like, and feed back the processing result to the terminal equipment.
Alternatively, the clients of the applications installed in the terminal device are the same or clients of the same type of application based on different operating systems. The specific form of the application client may also be different based on the different terminal platforms, for example, the application client may be a mobile phone client, a PC client, etc.
Optionally, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the disclosure is not limited herein.
Fig. 6 shows a flowchart of a data transformation method in an embodiment of the disclosure, and as shown in fig. 6, the data transformation method provided in the embodiment of the disclosure includes the following steps:
s602, obtaining a preconfigured integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational matrix.
Note that, the integer matrix configured in S602 is a matrix in which reversible elements are integers, and the inverse matrix is a rational matrix; the original data can be subjected to integer transformation by using the integer matrix, and the original data can be completely recovered by performing inverse integer transformation (inverse transformation) on the data after the integer transformation by using the inverse matrix of the integer matrix or the integer matrix after the inverse matrix is shaped. In principle, if the original data is shaped data, the integer transform to be performed on the original data is an integer transform of a full integer operation, and the inverse integer transform to be performed on the data after the integer transform is also an inverse integer transform of the full integer operation. In the implementation, if the original data is the shaping data, the integer matrix is directly utilized to carry out integer transformation and inverse integer transformation on the original data; and if the original data are floating point data, realizing integer transformation of full integer operation on the quantized shaping matrix.
S604, carrying out integer transformation on the data to be transformed by using an integer matrix.
It should be noted that, the data to be transformed may include, but is not limited to, any of the following: image data, video data, residual data, feature data. In the embodiment of the disclosure, the data to be transformed is subjected to integer transformation by using an integer matrix which is irrelevant to DCT transformation, so that the form of the integer transformation is not unique, and more integer transformation schemes can be provided.
Thus, in some embodiments, when the data to be transformed is shaped data, both the forward transform and the inverse transform of the shaped data are integer transforms of full integer operations, the data transformation method provided in embodiments of the present disclosure further comprises the steps of: integer transformation of full integer operation is carried out on the shaping data to be transformed by utilizing the integer matrix; and (3) performing inverse transformation of full integer operation on the data after integer transformation by using the integer matrix after shaping the inverse matrix of the integer matrix, and recovering shaped data.
In other embodiments, when the data to be converted is floating point data, the data conversion method provided in the embodiments of the present disclosure further includes the following steps: quantizing floating point data to be transformed to obtain quantized shaping data; performing integer transformation of full integer operation on the quantized shaping data by utilizing an integer matrix; and (3) carrying out inverse transformation on the data after integer transformation by utilizing an inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recovering the data before integer transformation (namely, the shaping data obtained by quantizing the original floating point data).
In some embodiments, when the data to be converted is floating point data, the data conversion method provided in the embodiments of the present disclosure further includes the following steps: transforming floating point data to be transformed by utilizing an integer matrix to obtain transformed floating point data; and (3) performing inverse transformation on the transformed floating point data by using the integer matrix after shaping the inverse matrix of the integer matrix, and recovering the floating point data before transformation. In this embodiment, the floating point data before the integer conversion can be approximately restored by directly performing the integer conversion and the inverse conversion on the floating point data.
In some embodiments, when the data to be converted is floating point data, the data conversion method provided in the embodiments of the present disclosure further includes the following steps: transforming floating point data to be transformed by utilizing an integer matrix to obtain transformed floating point data; carrying out quantization processing on the converted floating point data; performing inverse quantization on the quantized data; and (3) carrying out inverse transformation on the inverse quantized floating point data by using an inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recovering the floating point data before transformation. In this embodiment, after the floating point data is directly subjected to integer transformation, the transformed data is quantized and dequantized, and the floating point data before the integer transformation can be approximately recovered by inverse transformation. It should be noted that, the specific method of quantization and dequantization performed on floating point data after integer transformation is not limited in this disclosure, and those skilled in the art may perform corresponding quantization and dequantization according to actual situations, so as to ensure that data before integer transformation can be recovered.
In some embodiments, when the new integer transform scheme provided in the embodiments of the present disclosure is applied in a data compression system, the data before encoding is subjected to integer transform by using a configured integer matrix at the encoding end; the data after integer transformation is compressed and encoded, so that the decoding end can completely recover the original data through inverse integer transformation after decoding the data, not only has no floating point expression error or quantization error, but also can generate more 0 coefficients than the traditional integer transformation/DCT transformation, and effectively improves the data compression ratio and the data compression efficiency. In specific implementation, before data compression, integer transformation can be performed on the data to be compressed through the formula (8); after decoding the compressed data, the integer-transformed data is restored by the above formula (9) or (10).
Since the data to be compressed may be shaped data or floating point data, when the data to be compressed is shaped data, full integer transformation (i.e., integer transformation of full integer operation) can be realized by using the new integer transformation provided in the embodiments of the present disclosure; when the data to be compressed is floating point data, the floating point data can be quantized, and then new integer transformation is performed on the quantized shaping data, and the specific quantization process is described in the above description and will not be repeated here.
In some embodiments, embodiments of the present disclosure may utilize the data recovery method shown in fig. 7 to recover the data prior to integer transformation; in other embodiments, embodiments of the present disclosure may recover data prior to integer transforms using the data recovery method shown in FIG. 8.
As shown in fig. 7, the data recovery method provided in the embodiment of the present disclosure includes the following steps:
s702, obtaining data to be recovered, wherein the data to be recovered is data obtained by performing integer transformation on original data by using an integer matrix, the integer matrix is reversible, and the inverse matrix is a rational number matrix;
s704, inverse transformation is performed on the data to be recovered by using the inverse matrix of the integer matrix, so as to recover the data before the integer transformation.
As shown in fig. 8, the data recovery method provided in the embodiment of the present disclosure includes the following steps:
s802, obtaining data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by using an integer matrix, the integer matrix is reversible, and the inverse matrix is a rational number matrix;
s804, carrying out inverse transformation on the data to be recovered by using the integer matrix after shaping the inverse matrix so as to recover the data before the integer transformation.
When the data recovery method provided by the embodiment of the disclosure can be applied to a decoding end in a data compression system, the decoding end receives compressed data from an encoding end, then decodes the compressed data, performs inverse integer transformation on the decoded data by using an integer matrix after shaping an inverse matrix of the integer matrix, so as to completely recover data before the integer transformation, and can realize a full integer transformation scheme, thereby not only having no floating point expression error and quantization error, but also generating more 0 coefficients than the traditional integer transformation/DCT transformation, and effectively improving the data compression ratio and the data compression efficiency.
Based on the same inventive concept, the embodiments of the present disclosure also provide a data conversion device, such as the following embodiments. Since the principle of solving the problem of the embodiment of the device is similar to that of the embodiment of the method, the implementation of the embodiment of the device can be referred to the implementation of the embodiment of the method, and the repetition is omitted.
Fig. 9 shows a schematic diagram of a data conversion device according to an embodiment of the disclosure, as shown in fig. 9, the device includes: a configuration module 91 and a transformation module 92.
The configuration module 91 is configured to obtain an integer matrix configured in advance, where the integer matrix is reversible and the inverse matrix is a rational matrix; a transformation module 92, configured to perform integer transformation on the data to be transformed by using the integer matrix.
It should be noted that the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to what is disclosed in the above method embodiments. It should be noted that the modules described above may be implemented as part of an apparatus in a computer system, such as a set of computer-executable instructions.
As can be seen from the above, the data conversion device provided by the embodiments of the present disclosure configures in advance an integer matrix of which the inverse matrix is a rational matrix through the configuration module 91; the transformation module 92 performs integer transformation on the data to be transformed by using the configured integer matrix, when the data to be transformed is plastic data, a full integer transformation scheme can be realized, not only has no floating point expression error or quantization error, but also can generate more 0 coefficients than the traditional integer transformation/DCT transformation, and the data compression ratio and the data compression efficiency are effectively improved.
Based on the same inventive concept, the embodiments of the present disclosure also provide a data recovery device, such as the following embodiments. Since the principle of solving the problem of the embodiment of the device is similar to that of the embodiment of the method, the implementation of the embodiment of the device can be referred to the implementation of the embodiment of the method, and the repetition is omitted.
Fig. 10 is a schematic diagram of a data recovery device according to an embodiment of the disclosure, as shown in fig. 10, where the device includes: a data acquisition module 101 and an inverse transformation module 102.
The data acquisition module 101 is configured to acquire data to be recovered, where the data to be recovered is data obtained by performing integer transformation on original data by using an integer matrix, the integer matrix is reversible, and the inverse matrix is a rational matrix; and the inverse transformation module 102 is used for carrying out inverse transformation on the data to be restored by utilizing an inverse matrix of the integer matrix so as to restore the data before the integer transformation.
It should be noted that the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to what is disclosed in the above method embodiments. It should be noted that the modules described above may be implemented as part of an apparatus in a computer system, such as a set of computer-executable instructions.
In order to implement the inverse transformation of the whole integer operation, in some embodiments, the inverse transformation module 102 may further perform inverse transformation on the data to be recovered by using the integer matrix after shaping the inverse matrix, so as to recover the data before the integer transformation.
As can be seen from the above, in the data recovery device provided by the embodiments of the present disclosure, the data to be recovered is obtained by the data obtaining module 101, and the inverse transformation module 102 performs inverse integer transformation on the data to be recovered by using the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, so that the original data can be completely recovered.
Based on the same inventive concept, an image compression system is also provided in the embodiments of the present disclosure, as follows. Since the principle of solving the problem of the system embodiment is similar to that of the method embodiment, the implementation of the system embodiment can be referred to the implementation of the method embodiment, and the repetition is omitted.
Fig. 11 shows a schematic diagram of an image compression system according to an embodiment of the present disclosure, and as shown in fig. 11, the image compression system 11 includes: a first encoding module 111 and a first decoding module 112.
The first encoding module 111 is configured to obtain a preconfigured integer matrix, and perform integer transformation on the image data by using the integer matrix, where the integer matrix is reversible and the inverse matrix is a rational matrix; the first decoding module 112 is configured to inverse transform the integer transformed data by using an inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recover the image data before the integer transformation.
It should be noted that, according to different application scenarios, the first encoding module 111 and the first decoding module 112 may be disposed in the same device or may be disposed in different devices, which is not specifically limited in this disclosure.
In some embodiments, the first encoding module 111 is further configured to: encoding the integer transformed data, and transmitting the encoded data to the first decoding module 112; the first decoding module 112 is further configured to decode the data from the first encoding module 111, and inverse transform the decoded data by using an inverse matrix of the integer matrix or an integer matrix obtained by shaping the inverse matrix, to recover the data before the integer transformation.
In some embodiments, the first encoding module 111 employs an encoding scheme that performs a ZigZag scan or an encoding scheme that does not perform a ZigZag scan.
Based on the same inventive concept, a feature compression system is also provided in the embodiments of the present disclosure, as follows. Since the principle of solving the problem of the system embodiment is similar to that of the method embodiment, the implementation of the system embodiment can be referred to the implementation of the method embodiment, and the repetition is omitted.
Fig. 12 shows a schematic diagram of a feature compression system in an embodiment of the disclosure, as shown in fig. 12, the image compression system 12 includes: a second encoding module 121 and a second decoding module 122.
The second encoding module 121 is configured to obtain a preconfigured integer matrix, and perform integer transformation on the feature data by using the integer matrix, where the integer matrix is reversible and the inverse matrix is a rational matrix; the second decoding module 122 is configured to inverse transform the integer transformed data by using an inverse matrix of the integer matrix or the integer matrix obtained by shaping the inverse matrix, and recover the data before the integer transformation.
It should be noted that the feature data may be, but is not limited to, feature data obtained by extracting features from an image by using a convolutional neural network CNN model. The second encoding module 121 and the second decoding module 122 may be disposed in the same device or may be disposed in different devices according to different application scenarios, which is not specifically limited in this disclosure.
In some embodiments, the second encoding module 121 is further configured to: encoding the integer transformed data, and transmitting the encoded data to the second decoding module 122; the second decoding module 122 is further configured to decode the data from the second encoding module 121, and inverse transform the decoded data by using an inverse matrix of the integer matrix or an integer matrix obtained by shaping the inverse matrix, to recover the data before the integer transformation.
In some embodiments, the second encoding module 121 employs an encoding manner that performs a ZigZag scan or an encoding manner that does not perform a ZigZag scan.
In some embodiments, the second encoding module 121 is further configured to perform quantization processing on the feature data, and perform integer transformation of full integer operation on the quantized feature data by using an integer matrix; the second decoding module 122 is further configured to perform inverse transformation of the integer-transformed data by using the integer matrix after shaping the inverse matrix, and perform inverse quantization processing on the inverse-transformed data to obtain the original feature data.
In some embodiments, the second encoding module 121 is further configured to perform integer transform on the feature data, and perform quantization on the feature data after the integer transform; the second decoding module 122 is further configured to perform inverse quantization processing on the quantized feature data, and perform inverse transformation on the inverse quantized data by using an inverse matrix of the integer matrix or an integer matrix obtained by shaping the inverse matrix, to obtain original feature data.
Based on the same inventive concept, a residual compression system is also provided in the embodiments of the present disclosure, as follows. Since the principle of solving the problem of the system embodiment is similar to that of the method embodiment, the implementation of the system embodiment can be referred to the implementation of the method embodiment, and the repetition is omitted.
Fig. 13 shows a schematic diagram of a residual compression system in an embodiment of the disclosure, as shown in fig. 13, the residual compression system 13 includes: comprising the following steps: a third encoding module 131 and a third decoding module 132.
The third encoding module 131 is configured to obtain a preconfigured integer matrix, and perform integer transformation on the residual data by using the integer matrix, where the integer matrix is reversible and the inverse matrix is a rational matrix; the third decoding module 132 is configured to inverse transform the integer transformed data by using an inverse matrix of the integer matrix or the integer matrix obtained by shaping the inverse matrix, and recover the data before the integer transformation.
It should be noted that, according to different application scenarios, the third encoding module 131 and the third decoding module 132 may be disposed in the same device or may be disposed in different devices, which is not specifically limited in this disclosure.
In some embodiments, the third encoding module 131 is further configured to: encoding the integer transformed data, and transmitting the encoded data to the third decoding module 132; the third decoding module 132 is further configured to decode the data from the third encoding module 131, and inverse transform the decoded data by using an inverse matrix of the integer matrix or an integer matrix obtained by shaping the inverse matrix, to recover the data before the integer transformation.
In some embodiments, the third encoding module 131 employs an encoding scheme that performs a ZigZag scan or an encoding scheme that does not perform a ZigZag scan.
The new integer transform scheme provided in the embodiments of the present disclosure can be applied to many scenarios, and the following are specific examples:
example 1:
encoding end:
step 1: XF for partitioning image 4x4 M_16
Step 2: 4x4 integer transform is performed on each 16 small block to obtain YF 32_1 =IXF M_16 I T ;
Wherein,,
step 3: for the obtained coefficient YF 32_1 Direct entropy coding.
Decoding end:
step 1: entropy decoding the data to obtain YF 32_2 ;
Step 2: YF is calculated by the following formula 32_2 Performing inverse integer transformation to obtain 4x4 block XF of the original image M_16 ;
Wherein F represents the inverse matrix of I and is a rational matrix; n represents an integer matrix of the same dimension as F, each element being N; n is a positive integer.
Example 2:
encoding end:
step 1: the image obtains a feature F through a CNN feature extraction network 32_1
Step 2: preliminary pretreatment of features, forcing the features to take 0.0 as a middle point and distribute left and right positively and negatively
Characteristic maximum value f_max=max (F 32_1 );
Characteristic maximum value f_min=min (F 32_1 );
Feature offset f_offset= (f_max+f_min)/2;
F 32_1 =F 32_1 -f_offset;
step 3: find F 32_1 Maximum absolute value abs_max=max (abs (f_max), abs (f_min))
Step 4: setting int_max to 227, the number of quantization steps is 2×227+1, and the quantization step size is b=abs_max/227;
step 5: quantizing feature data I 32_1 =round(F 32_1 /b);
Step 6: feature shaping to (-1, 16) dimension to obtain XI M_16
Step 7: 4x4 integer transform is performed on each 16 small block to obtain YI 32_1 =IXI M_16 I T ;
Step 8: find YI 32_1 Maximum absolute value abs_max_2=max (abs (YI 32_1 ));
Step 9: setting int_max_2 to 4, then the quantization steps is 1+2×128, and the basic quantization step is b_2=abs_max_2/4;
step 10: setting q_table as shown in table 3;
TABLE 3 Table 3
1 | 1 | 1 | 1 |
1 | 1 | 1 | 2 |
1 | 1 | 2 | 2 |
1 | 2 | 2 | 2 |
Step 11: for each position coefficient of 4x4, the quantization step size is s_2=q_table×b_2;
step 12: second-time YI quantization of feature data 32_1 =round(YI 32_1 S_2), further narrowing the data range;
decoding end:
step 1: dequantizing YI of secondary quantized data 32_2 =YI 32_2 ×s_2;
Step 2: performing inverse integer transformation on the data:
wherein F is an inverse matrix of I, which is a floating point rational number, N is a positive integer, N is a matrix, the dimension of the matrix is the same as F, and each element of the matrix is an integer N;
step 3: feature XI M_16 Shaping to original size to obtain I 32_2 ;
Step 4: inverse quantization transformation: f (F) 32_2 =I 32_2 ×b;
Step 5: f (F) 32_2 =F 32_2 +f_offset。
Example 3:
encoding end:
step 1: the image obtains a feature F through a CNN feature extraction network 32_1 ;
Step 2: the maximum and minimum values of the feature are determined, wherein the maximum value f_max=max (F 32_1 ) The method comprises the steps of carrying out a first treatment on the surface of the Minimum value f_min=min (F 32_1 );
Step 3: setting INT_MAX to 27, and setting the quantization step number to 27 and the quantization step size to b= (f_max-f_min)/27;
step 4: quantizing feature data I 32_1 =round((F 32_1 -f_min)/b);
Step 5: feature shaping to (-1, 16) dimension to obtain XI M_16 ;
Step 6: 4x4 integer transform is performed on each 16 small block to obtain YI 32_1 =IXI M_16 I T ;
Step 7: the coefficients are directly entropy encoded.
Decoding end:
step 1: for data YI 32_2 Performing inverse integer transformation:
wherein F is an inverse matrix of I, which is a floating point rational number, N is a positive integer, N is a matrix, the dimension of the matrix is the same as F, and each element of the matrix is an integer N;
step 2: feature XI M_16 Shaping to original size to obtain I 32_2 ;
Step 3: inverse quantization transform F 32_2 =fmin+I 32_2 ×b;
Example 4:
encoding end:
step 1: the image obtains a feature F through a CNN feature extraction network 32_1 ;
Step 2: feature preliminary preprocessing, forcing features to start with 0.0, forward distribution f_min=min only (F 32_1 );F 32_1 =F 32_1 -f_min;
Step 3: find F 32_1 Maximum value abs_max=max (F 32_1 );
Step 4: setting int_max to 28, then quantizing steps to 28, quantizing step size to b=abs_max/28;
step 5: quantizing feature data I 32_1 =round(F 32_1 /b);
Step 6: feature shaping to (-1, 64) dimension to obtain XI M_64 ;
Step 7: 8x8 integer transform is performed on each 64 small block to obtain YI 32_1 =IXI M_64 I T ;
Step 8: setting a fixed quantization table q_table as shown in table 4;
TABLE 4 Table 4
7 | 7 | 10 | 19 | 40 | 40 | 40 | 40 |
7 | 8 | 10 | 26 | 40 | 40 | 40 | 40 |
10 | 10 | 22 | 40 | 40 | 40 | 40 | 40 |
19 | 26 | 40 | 40 | 40 | 40 | 40 | 40 |
40 | 40 | 40 | 40 | 40 | 40 | 40 | 40 |
40 | 40 | 40 | 40 | 40 | 40 | 40 | 40 |
40 | 40 | 40 | 40 | 40 | 40 | 40 | 40 |
40 | 40 | 40 | 40 | 40 | 40 | 40 | 40 |
Step 9: second-time YI quantization of feature data 32_1 =round(YI 321 And/q_table), and further reducing the data range.
Decoding end:
step 1: dequantizing YI of secondary quantized data 32_2 =YI 32_2 ×q_table;
Step 2: performing inverse integer transformation on the data:
wherein F is an inverse matrix of I, which is a floating point rational number, N is a positive integer, N is a matrix, the dimension of the matrix is the same as F, and each element of the matrix is an integer N;
step 3: feature XI M_64 Shaping to original size to obtain I 32_2 ;
Step 4: inverse quantization transform F 32_2 =I 32_2 ×b;
Step 5: f (F) 32_2 =F 32_2 +f_min。
Example 5:
encoding end:
step 1: the image obtains a feature F through a CNN feature extraction network 32_1 ;
Step 2, feature shaping to (-1, 16) dimension to obtain XI M_16 ;
Step 3: 4x4 integer transform is performed on each 16 small block to obtain YI 32_1 =IXI M_16 I T The coefficients obtained in this example are also floating point values;
step 4: setting INT_MAX to 2 5 Then the quantization steps is 1+2×2 5 The basic quantization step size is b=abs_max/2 5 The method comprises the steps of carrying out a first treatment on the surface of the q_table is set as shown in table 5, b2=b×q_table;
TABLE 5
1 | 1 | 1 | 1 |
1 | 1 | 1 | 2 |
1 | 1 | 2 | 2 |
1 | 2 | 2 | 2 |
Step 5: quantizing feature data I 32_1 =round(YI 321 /b2);
Step 6: for quantized feature data I 32_1 Entropy coding.
Decoding end:
step 1: for data I 32_2 Inverse quantization is performed to obtain integer transform coefficients, which are floating point values:
YI 32_2 =I 32_1 ×b2;
XI M_16 =FYI 32_2 F T ;
wherein F is the inverse matrix of I, which is a floating point rational number;
step 2: feature XI M_16 Shaping to original size to obtain I 32_2 ;
Step 3: inverse quantization transform F 32_2 =fmin+I 32_2 ×b;
Example 6:
encoding end:
step 1: estimating the image to obtain residual error I 32_1 ;
Step 2: quantizing the residual and completing 8x8 blocking to obtain XI M_64 ;
Step 3: performing 8x8 integer transform on each 64 tile, resulting in:
YI 32_1 =IXI M_64 I T ;
step 4: zig-zag encoding+other entropy encoding;
decoding end:
step 1: other entropy decoding and zigzag decoding are carried out on the encoded data;
step 2: performing inverse integer transformation:
wherein F is an inverse matrix of I, which is a floating point rational number, N is a positive integer, N is a matrix, the dimension of the matrix is the same as F, and each element of the matrix is an integer N;
step 3, dequantizing the residual error to obtain a residual error I 32_2 。
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 1400 according to such an embodiment of the present disclosure is described below with reference to fig. 14. The electronic device 1400 shown in fig. 14 is merely an example and should not be construed as limiting the functionality and scope of use of the disclosed embodiments.
As shown in fig. 14, the electronic device 1400 is embodied in the form of a general purpose computing device. Components of electronic device 1400 may include, but are not limited to: the at least one processing unit 1410, the at least one memory unit 1420, and a bus 1430 connecting the different system components (including the memory unit 1420 and the processing unit 1410).
Wherein the storage unit stores program code that is executable by the processing unit 1410 such that the processing unit 1410 performs steps according to various exemplary embodiments of the present disclosure described in the above section of the present description of exemplary methods.
When the electronic device 1400 is an encoding end device, the processing unit 1410 may perform the following steps of the method embodiment: obtaining a preconfigured integer matrix; performing integer transformation on data to be compressed by utilizing an integer matrix; and encoding the data to be compressed after integer conversion to obtain compressed data.
When the electronic device 1400 is a decoding end device, the processing unit 1410 may perform the following steps of the method embodiment: obtaining compressed data, wherein the compressed data is obtained by performing integer transformation on original data by utilizing a preconfigured integer matrix and encoding the data after the integer transformation; decoding the compressed data, and performing inverse integer transformation on the decoded data by using an inverse matrix of the integer matrix to recover the original data.
The memory unit 1420 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 14201 and/or cache memory 14202, and may further include Read Only Memory (ROM) 14203.
The memory unit 1420 may also include a program/utility 14204 having a set (at least one) of program modules 14205, such program modules 14205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The electronic device 1400 may also communicate with one or more external devices 1440 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 1400, and/or any device (e.g., router, modem, etc.) that enables the electronic device 1400 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1450. Also, electronic device 1400 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 1460. As shown, the network adapter 1460 communicates with other modules of the electronic device 1400 via the bus 1430. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 1400, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium, which may be a readable signal medium or a readable storage medium, is also provided. On which a program product is stored which enables the implementation of the method described above of the present disclosure. In some possible implementations, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the "exemplary methods" section of this specification, when the program product is run on the terminal device.
More specific examples of the computer readable storage medium in the present disclosure may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In this disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Alternatively, the program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In particular implementations, the program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the description of the above embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
Claims (27)
1. A method of transforming data, comprising:
obtaining a preconfigured integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational matrix;
and carrying out integer transformation on the data to be transformed by utilizing the integer matrix.
2. The data transformation method according to claim 1, wherein the data to be transformed is subjected to integer transformation by the following formula:
Y=IXI T ;
wherein Y represents the integer transformed data; x represents data before integer conversion, that is, data before integer conversion; i represents a reversible and inverse matrix which is preconfigured integer matrix of rational number matrix; i T Representing the transposed matrix of I.
3. The data transformation method according to claim 2, wherein the data after the integer transformation is inverse transformed by the following formula to recover the data before the integer transformation:
X=FYF T ;
wherein F represents the inverse matrix of I and is a rational matrix; f (F) T Representing the transposed matrix of F.
4. The data transformation method according to claim 2, wherein the data after the integer transformation is inverse transformed by the following formula to recover the data before the integer transformation:
5. The data transformation method according to claim 1, wherein the data to be transformed is shaping data, and the positive transformation and the inverse transformation of the shaping data are both integer transforms of a full integer operation, the method further comprising:
integer transformation of full integer operation is carried out on the shaping data to be transformed by utilizing the integer matrix;
and carrying out inverse transformation of full integer operation on the data after integer transformation by utilizing the integer matrix after shaping the inverse matrix of the integer matrix, and recovering the shaped data.
6. The data transformation method according to claim 1, wherein the data to be transformed is floating point data, the method further comprising:
quantizing floating point data to be transformed to obtain quantized shaping data;
performing integer transformation of full integer operation on the quantized shaping data by utilizing an integer matrix;
and carrying out inverse transformation on the data after integer transformation by utilizing the integer matrix after shaping the inverse matrix of the integer matrix, and recovering the data before integer transformation.
7. The data transformation method according to claim 1, wherein the data to be transformed is floating point data, the method further comprising:
transforming floating point data to be transformed by utilizing an integer matrix to obtain transformed floating point data;
and carrying out inverse transformation on the transformed floating point data by utilizing the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix of the integer matrix, and recovering the floating point data before transformation.
8. The data transformation method according to claim 1, wherein the data to be transformed is floating point data, the method further comprising:
transforming floating point data to be transformed by utilizing an integer matrix to obtain transformed floating point data;
Carrying out quantization treatment on floating point data after integer transformation;
performing inverse quantization on the quantized data;
and carrying out inverse transformation on the inverse quantized floating point data by utilizing the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recovering the floating point data before the integer transformation.
9. The data transformation method according to any one of claims 1 to 8, wherein the data to be transformed includes at least any one of: image data, video data, residual data, feature data.
10. A method of data recovery, comprising:
obtaining data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by using an integer matrix, and the integer matrix is reversible and the inverse matrix is a rational number matrix;
and carrying out inverse transformation on the data to be recovered by utilizing the inverse matrix of the integer matrix so as to recover the data before the integer transformation.
11. A method of data recovery, comprising:
obtaining data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by using an integer matrix, and the integer matrix is reversible and the inverse matrix is a rational number matrix;
And carrying out inverse transformation on the data to be recovered by utilizing the integer matrix after shaping the inverse matrix so as to recover the data before the integer transformation.
12. A data conversion apparatus, comprising:
the configuration module is used for obtaining a preconfigured integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational number matrix;
and the transformation module is used for carrying out integer transformation on the data to be transformed by utilizing the integer matrix.
13. A data recovery apparatus, comprising:
the data acquisition module is used for acquiring data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by utilizing an integer matrix, and the integer matrix is reversible and the inverse matrix is a rational matrix;
and the inverse transformation module is used for carrying out inverse transformation on the data to be recovered by utilizing the inverse matrix of the integer matrix so as to recover the data before the integer transformation.
14. A data recovery apparatus, comprising:
the data acquisition module is used for acquiring data to be recovered, wherein the data to be recovered is data obtained by carrying out integer transformation on original data by utilizing an integer matrix, and the integer matrix is reversible and the inverse matrix is a rational matrix;
And the inverse transformation module is used for carrying out inverse transformation on the data to be recovered by utilizing the integer matrix after shaping the inverse matrix so as to recover the data before the integer transformation.
15. An image compression system, comprising: a first encoding module and a first decoding module;
the first coding module is used for obtaining a preconfigured integer matrix and carrying out integer transformation on the image data by utilizing the integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational matrix;
the first decoding module is configured to reverse transform the integer transformed data by using an inverse matrix of the integer matrix or an integer matrix obtained by shaping the inverse matrix, and recover image data before the integer transformation.
16. The image compression system of claim 15, wherein the first encoding module is further configured to: encoding the integer transformed data, and transmitting the encoded data to the first decoding module; the first decoding module is further configured to decode the data from the first encoding module, and inverse transform the decoded data by using the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, to recover the data before the integer transformation.
17. The image compression system of claim 16, wherein the first encoding module employs an encoding scheme that performs a ZigZag scan or an encoding scheme that does not perform a ZigZag scan.
18. A feature compression system, comprising: a second encoding module and a second decoding module;
the second coding module is configured to obtain a preconfigured integer matrix, and perform integer transformation on the feature data by using the integer matrix, wherein the integer matrix is reversible and the inverse matrix is a rational matrix;
and the second decoding module is used for carrying out inverse transformation on the data after integer transformation by utilizing the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recovering the data before integer transformation.
19. The feature compression system of claim 18, wherein the second encoding module is further configured to: encoding the integer transformed data and transmitting the encoded data to the second decoding module; the second decoding module is further configured to decode the data from the second encoding module, and inverse transform the decoded data by using the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, to recover the data before the integer transformation.
20. The feature compression system of claim 19, wherein the second encoding module employs an encoding scheme that performs a ZigZag scan or an encoding scheme that does not perform a ZigZag scan.
21. The feature compression system of claim 18, wherein the second encoding module is further configured to quantize the feature data, and perform an integer transform of a full integer operation on the quantized feature data using the integer matrix; the second decoding module is further configured to perform inverse transformation of full integer operation on the data after integer transformation by using the integer matrix after shaping the inverse matrix, and perform inverse quantization processing on the data after inverse transformation, so as to obtain original feature data.
22. The feature compression system of claim 18, wherein the second encoding module is further configured to perform an integer transform on the feature data, and to quantize the integer transformed feature data; the second decoding module is further configured to perform inverse quantization processing on the quantized feature data, and perform inverse transformation on the inverse quantized data by using an inverse matrix of the integer matrix or an integer matrix obtained by shaping the inverse matrix, to obtain original feature data.
23. A residual compression system, comprising: a third encoding module and a third decoding module;
the third coding module is configured to obtain a preconfigured integer matrix, and perform integer transformation on residual data by using the integer matrix, where the integer matrix is reversible and the inverse matrix is a rational matrix;
and the third decoding module is used for carrying out inverse transformation on the data after integer transformation by utilizing the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, and recovering the data before integer transformation.
24. The residual compression system of claim 23, wherein the third encoding module is further configured to: encoding the integer transformed data, and transmitting the encoded data to the third decoding module; the third decoding module is further configured to decode the data from the third encoding module, and inverse transform the decoded data by using the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, to recover the data before the integer transformation.
25. The residual compression system of claim 23, wherein the third encoding module employs an encoding scheme that performs a zig-zag scan or an encoding scheme that does not perform a zig-zag scan.
26. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data transformation method of any one of claims 1 to 9, or the data recovery method of claim 10 or 11, via execution of the executable instructions.
27. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed by a processor, implements the data transformation method of any one of claims 1 to 9, or the data recovery method of claim 10 or 11.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111626735.1A CN116366867A (en) | 2021-12-28 | 2021-12-28 | Data transformation and recovery method, device and system, electronic equipment and storage medium |
PCT/CN2022/132143 WO2023124602A1 (en) | 2021-12-28 | 2022-11-16 | Data transform and recovery method, apparatus and system, electronic device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111626735.1A CN116366867A (en) | 2021-12-28 | 2021-12-28 | Data transformation and recovery method, device and system, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116366867A true CN116366867A (en) | 2023-06-30 |
Family
ID=86914982
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111626735.1A Pending CN116366867A (en) | 2021-12-28 | 2021-12-28 | Data transformation and recovery method, device and system, electronic equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116366867A (en) |
WO (1) | WO2023124602A1 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1461150A (en) * | 2003-07-03 | 2003-12-10 | 浙江大学 | 8*8 integer conversion method used in image coding and video coding and its device |
CN102036063A (en) * | 2009-09-29 | 2011-04-27 | 北京中星微电子有限公司 | Image transformation method and device for coding and decoding |
CN102413331A (en) * | 2011-12-01 | 2012-04-11 | 上海大学 | Coding method for images or videos |
CN102572426A (en) * | 2011-12-11 | 2012-07-11 | 香港应用科技研究院有限公司 | Method and apparatus for data processing |
CN103125116A (en) * | 2010-09-28 | 2013-05-29 | 三星电子株式会社 | Video encoding method and device and decoding method and device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7082450B2 (en) * | 2001-08-30 | 2006-07-25 | Nokia Corporation | Implementation of a transform and of a subsequent quantization |
WO2011133008A2 (en) * | 2010-04-23 | 2011-10-27 | 삼성전자 주식회사 | Method and apparatus for transforming images, and method and apparatus for inversely transforming images |
CN113439441A (en) * | 2019-02-15 | 2021-09-24 | 北京字节跳动网络技术有限公司 | Transform parameter derivation based on block partitioning |
-
2021
- 2021-12-28 CN CN202111626735.1A patent/CN116366867A/en active Pending
-
2022
- 2022-11-16 WO PCT/CN2022/132143 patent/WO2023124602A1/en unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1461150A (en) * | 2003-07-03 | 2003-12-10 | 浙江大学 | 8*8 integer conversion method used in image coding and video coding and its device |
CN102036063A (en) * | 2009-09-29 | 2011-04-27 | 北京中星微电子有限公司 | Image transformation method and device for coding and decoding |
CN103125116A (en) * | 2010-09-28 | 2013-05-29 | 三星电子株式会社 | Video encoding method and device and decoding method and device |
CN102413331A (en) * | 2011-12-01 | 2012-04-11 | 上海大学 | Coding method for images or videos |
CN102572426A (en) * | 2011-12-11 | 2012-07-11 | 香港应用科技研究院有限公司 | Method and apparatus for data processing |
US20130151575A1 (en) * | 2011-12-11 | 2013-06-13 | Hong Kong Applied Science and Technology Research Institute Company Limited | Adaptive block-size transform using llmict |
Also Published As
Publication number | Publication date |
---|---|
WO2023124602A1 (en) | 2023-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2013059021A (en) | Method for distributed information source encoding of wavelet coefficient in zero tree | |
WO2021031877A1 (en) | Methods and apparatus for image coding and decoding, and chip | |
US10248666B2 (en) | Creation of hierarchical dictionary | |
CN103026636B (en) | Orthogonal multiple description coded | |
CN105163130B (en) | A kind of Lossless Image Compression Algorithm method based on discrete Tchebichef orthogonal polynomial | |
US7894550B2 (en) | Method, apparatus, and system for source coding with iterative side information generation and decoding process | |
CN115866253B (en) | Inter-channel conversion method, device, terminal and medium based on self-modulation | |
WO2023159820A1 (en) | Image compression method, image decompression method, and apparatuses | |
CN116366867A (en) | Data transformation and recovery method, device and system, electronic equipment and storage medium | |
Al-hamid et al. | Optimized Image Compression Techniques for the Embedded Processors | |
US20230085142A1 (en) | Efficient update of cumulative distribution functions for image compression | |
CN113949867B (en) | Image processing method and device | |
KR100561392B1 (en) | Method and apparatus for fast inverse discrete cosine transform | |
CN114189684A (en) | JND algorithm-based video coding method, device, medium and computing device | |
Hadi | Medical Image Compression using DCT and DWT Techniques | |
CN116366070A (en) | Wavelet coefficient coding method, device, system, equipment and medium | |
CN116916033B (en) | Combined space-time video compression method based on random self-adaptive Fourier decomposition | |
CN116418997A (en) | Characteristic data compression method, device and system, electronic equipment and storage medium | |
US11645079B2 (en) | Gain control for multiple description coding | |
Zhou et al. | Enhanced image compression method exploiting NTT for internet of thing | |
Bao et al. | Image Compression Based on Hybrid Domain Attention and Postprocessing Enhancement | |
Zha | Progressive lossless image compression using image decomposition and context quantization | |
Yin et al. | Learned distributed image compression with decoder side information | |
Wang et al. | Pyramid transform coding using vector quantization | |
CN115623207A (en) | Data transmission method based on MIMO technology and related equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |