WO2023124602A1 - 数据变换与恢复方法、装置、系统、电子设备及存储介质 - Google Patents

数据变换与恢复方法、装置、系统、电子设备及存储介质 Download PDF

Info

Publication number
WO2023124602A1
WO2023124602A1 PCT/CN2022/132143 CN2022132143W WO2023124602A1 WO 2023124602 A1 WO2023124602 A1 WO 2023124602A1 CN 2022132143 W CN2022132143 W CN 2022132143W WO 2023124602 A1 WO2023124602 A1 WO 2023124602A1
Authority
WO
WIPO (PCT)
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.)
Ceased
Application number
PCT/CN2022/132143
Other languages
English (en)
French (fr)
Inventor
王立传
张园
杨明川
韩韬
茅心悦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Publication of WO2023124602A1 publication Critical patent/WO2023124602A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]

Definitions

  • the present disclosure relates to the technical field of data processing, and in particular to a data conversion and recovery method, device, system, electronic equipment, and storage medium.
  • DCT transform Discrete Cosine Transform, discrete cosine transform
  • integer transform is widely used in related technologies to achieve a higher compression ratio, for example, JPEG (Joint Photographic Experts Group, Joint Photographic Experts Group)
  • JPEG Joint Photographic Experts Group
  • H.264 standard the next-generation digital video compression format following MPEG4 by the International Organization for Standardization and the International Telecommunication Union
  • VCM Video Coding For Machines, The feature coding in the machine vision coding
  • DCT transformation Video Coding For Machines, The feature coding in the machine vision coding
  • the traditional integer transformation is derived from the DCT transformation, and the equivalent matrix of the DCT transformation is slightly modified, and the floating-point operation error term is incorporated into the quantization. Therefore, the performance loss of the integer transformation scheme comes only from quantization; while the performance loss of the DCT transformation scheme comes from the error term of the quantization and the floating-point operation of the DCT transformation itself.
  • the traditional integer transformation scheme is not an all-integer transformation scheme, but only incorporates the floating-point error term into the quantization. Although the floating-point calculation error is reduced to a certain extent, this error is unavoidable. Therefore, neither the DCT transformation scheme nor the traditional integer transformation scheme can completely eliminate the floating point operation error.
  • the present disclosure provides a data conversion and recovery method, device, system, electronic equipment and storage medium, which overcomes the technical problem in the related art that traditional integer conversion-based compression schemes cannot completely eliminate floating-point calculation errors at least to a certain extent.
  • a data transformation method includes: obtaining a pre-configured integer matrix, wherein the integer matrix is invertible and the inverse matrix is a rational number matrix; Integer transform.
  • integer transformation is performed on the data to be transformed by the following formula:
  • Y represents the data after integer transformation
  • X represents the data before integer transformation
  • I represents a pre-configured reversible integer matrix whose inverse matrix is a rational number matrix
  • IT represents the transposition matrix of I.
  • the data after the integer transformation is inversely transformed by the following formula to recover the data before the integer transformation:
  • Y represents the data after integer transformation
  • X represents the restored data, that is, the data before integer transformation
  • F represents the inverse matrix of I, which is a rational number matrix
  • FT represents the transpose matrix of F.
  • the data after the integer transformation is inversely transformed by the following formula to recover the data before the integer transformation:
  • F represents the inverse matrix of I, which is a matrix of rational numbers
  • N represents an integer matrix with the same dimension as F, and each element is n
  • n is a positive integer
  • the data to be transformed is plastic data
  • the forward transformation and inverse transformation of the plastic data are both integer transformations of full integer operations
  • the method further includes: using an integer matrix to perform Integer transformation of full integer operation: using the integer matrix after shaping the inverse matrix of the integer matrix, performing inverse transformation of full integer operation on the data after integer transformation to recover the shaped data.
  • the data to be transformed is floating-point data
  • the method further includes: quantizing the floating-point data to be transformed to obtain quantized integer data; Integer transformation of the operation: using the integer matrix after shaping the inverse matrix of the integer matrix, inversely transforming the data after the integer transformation to recover the data before the integer transformation.
  • the data to be transformed is floating-point data
  • the method further includes: using an integer matrix to transform the floating-point data to be transformed to obtain transformed floating-point data; using the inverse of the integer matrix The integer matrix after the matrix is reshaped, inversely transforms the transformed floating-point data, and restores the floating-point data before the transformation.
  • the data to be transformed is floating-point data
  • the method further includes: using an integer matrix to transform the floating-point data to be transformed to obtain transformed floating-point data; Quantization processing: performing inverse quantization processing on the quantized data; using the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix, inverse transforming the dequantized floating-point data to restore the transformed previous floating-point data.
  • the data to be transformed includes at least any one of the following: image data, video data, residual data, and feature data.
  • a data recovery method including: acquiring the data to be recovered, wherein the data to be recovered is the data after integer transformation of the original data by using an integer matrix, and the integer matrix
  • the reversible and inverse matrix is a matrix of rational numbers; using the inverse matrix of the integer matrix, the inverse transformation is performed on the data to be restored, so as to restore the data before the integer transformation.
  • a data restoration method including: acquiring data to be restored, wherein the data to be restored is the data after integer transformation of the original data by using an integer matrix, and the integer matrix
  • the inverse matrix is reversible and is a matrix of rational numbers; the data to be restored is inversely transformed by using the integer matrix after shaping the inverse matrix, so as to restore the data before the integer transformation.
  • a data conversion device including: a configuration module, configured to obtain a pre-configured integer matrix, wherein the integer matrix is invertible and the inverse matrix is a rational number matrix; the conversion module uses The integer transformation is performed on the data to be transformed by using the integer matrix.
  • a data restoration device including: a data acquisition module, configured to acquire data to be restored, wherein the data to be restored is the integer transformation of the original data by using an integer matrix data, the integer matrix is reversible and the inverse matrix is a rational number matrix; the inverse transformation module is used to use the inverse matrix of the integer matrix to inverse transform the data to be restored, so as to restore the data before the integer transformation.
  • a data restoration device including: a data acquisition module, configured to acquire data to be restored, wherein the data to be restored is the integer transformation of the original data by using an integer matrix Data, the integer matrix is reversible and the inverse matrix is a rational number matrix; the inverse transformation module is used to use the integer matrix after shaping the inverse matrix to perform inverse transformation on the data to be restored, so as to restore the integer transformation before data.
  • an image compression system including: a first encoding module and a first decoding module; wherein, the first encoding module is used to obtain a pre-configured integer matrix, using the The integer matrix performs integer transformation on the image data, wherein the integer matrix is reversible and the inverse matrix is a rational number matrix; the first decoding module is used to use the inverse matrix of the integer matrix or after shaping the inverse matrix Integer matrix of integer transformation, the inverse transformation is performed on the data after the integer transformation, and the image data before the integer transformation is recovered.
  • the first encoding module is also used to: encode the data after integer transformation, and transmit the encoded data to the first decoding module; the first decoding module is also used to encode data from The data of the first coding module is decoded, and the inverse matrix of the integer matrix or the integer matrix obtained by shaping the inverse matrix is used to inversely transform the decoded data to restore the data before the integer transformation.
  • the first encoding module adopts an encoding manner that performs ZigZag scanning or an encoding manner that does not perform ZigZag scanning.
  • a feature compression system including: a second encoding module and a second decoding module; wherein, the second encoding module is used to obtain a pre-configured integer matrix, using the The integer matrix performs integer transformation on the feature data, wherein the integer matrix is reversible and the inverse matrix is a rational number matrix; the second decoding module is used to use the inverse matrix of the integer matrix or after shaping the inverse matrix Integer matrix of integer transformation, inverse transformation is performed on the data after integer transformation, and the data before integer transformation is recovered.
  • the second encoding module is also used to: encode the data after integer transformation, and transmit the encoded data to the second decoding module; the second decoding module is also used to encode the data from The data of the second coding module is decoded, and the inverse matrix of the integer matrix or the integer matrix obtained by shaping the inverse matrix is used to inversely transform the decoded data to restore the data before the integer transformation.
  • the second encoding module adopts an encoding manner that performs ZigZag scanning or an encoding manner that does not perform ZigZag scanning.
  • the second coding module is further used to perform quantization processing on the feature data, and uses the integer matrix to perform integer transformation of all integer operations on the quantized feature data; the second decoding module is also used to Using the integer matrix after shaping the inverse matrix, perform inverse transformation of all integer operations on the data after integer transformation, and perform inverse quantization processing on the inverse transformed data to obtain original feature data.
  • the second encoding module is further configured to perform integer transformation on the feature data, and quantize the integer-transformed feature data; the second decoding module is also used to invert the quantized feature data
  • the quantization process uses the integer matrix after shaping the inverse matrix to perform inverse transformation on the data after the inverse quantization process to obtain the original feature data.
  • a residual compression system including: a third encoding module and a third decoding module; wherein, the third encoding module is used to obtain a pre-configured integer matrix by using The integer matrix performs integer transformation on the residual data, wherein the integer matrix is reversible and the inverse matrix is a rational number matrix; the third decoding module is used to use the inverse matrix of the integer matrix or perform an integer transformation on the inverse matrix Integer matrix after shaping, perform inverse transformation on the data after integer transformation, and restore the data before integer transformation.
  • the third encoding module is also used to: encode the data after integer transformation, and transmit the encoded data to the third decoding module; the third decoding module is also used to encode data from The data of the third coding module is decoded, and the inverse matrix of the integer matrix or the integer matrix obtained by shaping the inverse matrix is used to inversely transform the decoded data to restore the data before the integer transformation.
  • the third encoding module adopts an encoding manner that performs ZigZag scanning or an encoding manner that does not perform ZigZag scanning.
  • an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable Instructions to execute the data transformation method described in any of the above, or the data recovery method described in any of the above.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the data transformation method described in any one of the above, or any of the above-mentioned A data recovery method as described.
  • Fig. 1 shows the flow chart of realizing data compression based on traditional integer transformation in the related art
  • Fig. 2 shows the schematic diagram of the data transformation result adopting traditional DCT/integer transformation in the related art
  • FIG. 3 shows a flow chart of implementing data compression based on a new integer transformation in an embodiment of the present disclosure
  • Fig. 4 shows a schematic diagram of the principle of quantization realized by combining the basic quantization step size and the step size multiplier in the embodiment of the present disclosure
  • FIG. 5 shows a schematic diagram of data transformation results using new integer transformations in an embodiment of the present disclosure
  • FIG. 6 shows a flow chart of a data conversion method in an embodiment of the present disclosure
  • FIG. 7 shows a flowchart of a data recovery method in an embodiment of the present disclosure
  • FIG. 8 shows a flowchart of another data recovery method in an embodiment of the present disclosure
  • FIG. 9 shows a schematic diagram of a data conversion device in an embodiment of the present disclosure.
  • FIG. 10 shows a schematic diagram of a data recovery device in an embodiment of the present disclosure
  • Fig. 11 shows a schematic diagram of an image compression system in an embodiment of the present disclosure
  • Fig. 12 shows a schematic diagram of a feature compression system in an embodiment of the present disclosure
  • Fig. 13 shows a schematic diagram of a residual compression system in an embodiment of the present disclosure
  • Fig. 14 shows a structural block diagram of an electronic device in an embodiment of the present disclosure.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • Example embodiments may, however, 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 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.
  • Compression Reducing the size of data by some technical means.
  • Decompression restore the reduced data size to its original size by some technical means.
  • Decoding A specific means of decompression.
  • DCT The English full name is Discrete Cosine Transform, translated as "Discrete Cosine Transform", which is used for lossy data compression of images or videos.
  • ZigZag scanning that is, zigzag scanning, scanning according to a certain path (zigzag), and transforming the quantized coefficients from two-dimensional to one-dimensional.
  • the lower right corner of the matrix has basically become a zero value, and the non-zero values are basically concentrated in the upper left corner of the matrix.
  • the two-dimensional matrix can be transformed into a one-dimensional
  • the first part of the string is mainly non-zero values, and the latter part is mainly zero values.
  • the two-dimensional DCT transformation is equivalent to the first DCT transformation, and then the column DCT transformation.
  • the following matrix can be used to represent the positive and negative transformation of DCT:
  • FIG. 1 shows a flow chart of data compression based on traditional integer transformation in the related art.
  • traditional integer transformation is used to compress data
  • Hadamard transformation/quantization and ZigZag scanning are required for transformation coefficients.
  • ZigZag scanning is an essential module of the system, and ZigZag scanning itself brings a lot of calculations.
  • Coefficient encoding/decoding of traditional DCT transform/integer transform relies on ZigZag scanning (ie, zigzag scanning) to gather 0 coefficients together, and ZigZag itself requires a lot of calculation.
  • the embodiments of the present disclosure provide a data transformation method and a data recovery method based on a new integer transformation.
  • the new integer transformation is explained first:
  • the new integer transformation provided in the embodiments of the present disclosure only constrains I to be an integer matrix, the integer matrix is invertible and the inverse matrix is a rational number matrix:
  • Y represents the data after integer transformation
  • X represents the data before integer transformation
  • I represents a pre-configured reversible integer matrix whose inverse matrix is a rational number matrix
  • IT represents the transposition matrix of I
  • F T represents the transpose matrix of F.
  • the inverse matrix can be reshaped and calculated:
  • N represents an integer matrix with the same dimension as F, and each element is n; n is a positive integer; Represents the Kronecker product of F and N, which is an integer matrix; express The transpose matrix.
  • the new integer transformation provided in the embodiments of the present disclosure utilizes an integer matrix that has nothing to do with DCT, therefore, for integer data, integer transformation and inverse transformation of all integer operations can be performed without any information loss; for floating-point numbers According to the data, after the floating-point data is quantized, the integer transformation of the whole integer operation can be realized for the quantized shaping matrix, not only without any floating-point expression error and quantization error, but also can generate more zeros than the traditional integer transformation/DCT transformation The coefficient effectively improves the data compression ratio and data compression efficiency.
  • Fig. 3 shows a flow chart of realizing data compression based on the new integer transformation in the embodiment of the present disclosure.
  • the quantization module is an optional module when the data compression is realized by using the new integer transformation provided in the embodiment of the present disclosure.
  • the embodiment of the present disclosure can realize quantization from integer type (floating point type) data to integer data in the following two ways:
  • Mode a fixed quantization table
  • Mode b Quantization combined with basic quantization step size and step size multiplier.
  • Fig. 4 shows a schematic diagram of the principle of quantization realized by combining a basic quantization step size and a step size multiplier in an embodiment of the present disclosure.
  • the basic quantization is divided into (2 ⁇ INT_MAX+1) steps: the basic quantization step size is abs_max/INT_MAX;
  • a 4x4 fixed quantization table is shown in Table 1
  • a 4x4 step size multiplication table is shown in Table 2.
  • Fig. 5 shows a schematic diagram of the data transformation result using the new integer transformation in the embodiment of the disclosure.
  • the new integer transformation provided in the embodiment of the disclosure has the following advantages:
  • More 0 coefficients and configurable distribution of different coefficients make ZigZag scan encoding an optional item rather than a mandatory item.
  • the embodiments of the present disclosure provide two encoding modes: 1 an encoding mode without performing ZigZag scanning; 2 an encoding mode in which ZigZag scanning is performed.
  • the embodiments of the present disclosure disclose a data transformation method and a data recovery method, which use a pre-configured integer matrix to perform integer transformation on the data to be transformed, and perform integer transformation on the data after the integer transformation
  • the inverse transformation can realize the whole integer transformation scheme, not only without any floating-point expression error and quantization error, but also can generate more zero coefficients than the traditional integer transformation/DCT transformation, effectively improving the data compression ratio and data compression efficiency.
  • the data conversion method and the data restoration method provided in the embodiments of the present disclosure may be executed by any electronic device with computing and processing capabilities.
  • the data conversion method in the embodiment of the present disclosure may be executed by the encoding end device
  • the data recovery method in the embodiment of the present disclosure may be executed by the decoding end device.
  • the electronic device that executes the data conversion method and the data recovery method in the embodiments of the present disclosure may be a terminal device or a server.
  • the terminal devices may include but not limited to smartphones, tablet computers, laptop computers, desktop computers, wearable devices, augmented reality devices, virtual reality devices, etc.
  • the server may provide various services, such as A background management server that provides support for devices operated by terminal equipment.
  • the background management server can analyze and process the received data such as requests, and feed back the processing results to the terminal device.
  • the clients of the application programs installed in the terminal device are the same, or the clients of the same type of application programs based on different operating systems. Based on different terminal platforms, the specific form of the client of the application program may also be different, for example, the client of the application program may be a mobile phone client, a PC client, and the like.
  • the server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network Cloud servers for basic cloud computing services such as cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and big data and artificial intelligence platforms.
  • the terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
  • the terminal and the server may be connected directly or indirectly through wired or wireless communication, which is not limited in the present disclosure.
  • Fig. 6 shows a flow chart of a data transformation method in an embodiment of the present disclosure.
  • the data transformation method provided in an embodiment of the present disclosure includes the following steps:
  • the integer matrix configured in the above S602 is a reversible matrix whose elements are integers, and its inverse matrix is a matrix of rational numbers; the original data can be transformed into integers by using the integer matrix, and the inverse matrix of the integer matrix or The integer matrix after the inverse matrix is reshaped, and the inverse integer transformation (inverse transformation) is performed on the data after the integer transformation, so that the original data can be completely restored.
  • the integer transformation performed on the original data is the integer transformation of the full integer operation
  • the inverse integer transformation performed on the integer transformed data is also the inverse integer transformation of the full integer operation.
  • the integer matrix is directly used to perform integer transformation and inverse integer transformation on the original data; if the original data is floating-point data, the integer transformation of the full integer operation is realized on the quantized integer matrix .
  • data to be transformed may include but not limited to any one of the following: image data, video data, residual data, and feature data.
  • an integer matrix irrelevant to the DCT transformation is used to perform integer transformation on the data to be transformed, so that the form of the integer transformation is not unique, and more integer transformation schemes can be provided.
  • both the forward transformation and the inverse transformation of the shaping data are integer transformations of full integer operations
  • the data transformation method provided in the embodiments of the present disclosure further includes the following steps: Using the integer matrix to carry out the integer transformation of the integer operation on the integer data to be transformed; using the integer matrix after shaping the inverse matrix of the integer matrix, performing the inverse transformation of the integer operation on the data after the integer transformation, and recovering the integer data.
  • the data transformation method when the data to be transformed is floating-point data, further includes the following steps: quantizing the floating-point data to be transformed to obtain quantized integer data; Integer transformation in which the matrix performs full integer operations on the quantized shaping data; use the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix to inverse transform the data after the integer transformation, and restore the data before the integer transformation ( That is, the integer data obtained by quantizing the original floating-point data).
  • the data transformation method when the data to be transformed is floating-point data, further includes the following steps: using an integer matrix to transform the floating-point data to be transformed to obtain the transformed floating-point data ;Use the integer matrix after shaping the inverse matrix of the integer matrix to perform inverse transformation on the transformed floating-point data, and restore the floating-point data before transformation.
  • the integer transformation and inverse transformation are directly performed on the floating point data, and the floating point data before the integer transformation can be approximately restored.
  • the data transformation method when the data to be transformed is floating-point data, further includes the following steps: using an integer matrix to transform the floating-point data to be transformed to obtain the transformed floating-point data ; Quantize the transformed floating-point data; perform inverse quantization on the quantized data; use the inverse matrix of the integer matrix or the integer matrix after reshaping the inverse matrix to inverse the dequantized floating-point data Transform to restore the floating-point data before transformation.
  • quantization and inverse quantization are performed on the transformed data, and the floating-point data before the integer transformation can be approximated by inverse transformation.
  • the configured integer matrix is used at the encoding end to perform integer transformation on the data before encoding; to perform integer transformation on the data after integer transformation Compression coding, so that the decoding end can completely restore the original data through inverse integer transformation after decoding the data, not only without any floating-point expression error and quantization error, but also can generate more zero coefficients than traditional integer transformation/DCT transformation, effectively
  • the data compression ratio and data compression efficiency are improved.
  • the data to be compressed can be converted into an integer by the above formula (8); after the compressed data is decoded, the data after the integer conversion can be restored by the above formula (9) or (10) .
  • the new integer transformation provided in the embodiment of the present disclosure can be used to realize the full integer transformation (that is, the integer transformation of the full integer operation) ;
  • the data to be compressed is floating-point data
  • a new integer transformation is performed on the quantized integer data.
  • the specific quantization process has been introduced in the above content, and will not be repeated here.
  • the embodiments of the present disclosure can use the data recovery method shown in FIG. 7 to recover the data before integer transformation; in other embodiments, the embodiments of the present disclosure can use the data recovery method shown in FIG. 8 , to restore the data before the integer transformation.
  • the data recovery method provided in the embodiment of the present disclosure includes the following steps:
  • the data to be restored is the data obtained by performing integer transformation on the original data by using an integer matrix, the integer matrix is reversible and the inverse matrix is a rational number matrix;
  • the data recovery method provided in the embodiment of the present disclosure includes the following steps:
  • the data to be restored is the data obtained by performing integer transformation on the original data by using an integer matrix, the integer matrix is reversible and the inverse matrix is a rational number matrix;
  • the decoding end receives the compressed data from the encoding end, it decodes the compressed data, and uses the inverse matrix of the integer matrix to perform the inverse matrix
  • the integer matrix after shaping performs an inverse integer transformation on the decoded data to completely restore the data before the integer transformation, which can realize the full integer transformation scheme, not only without any floating-point expression error and quantization error, but also can generate more than traditional integer Transform/DCT transforms more 0 coefficients, effectively improving the data compression ratio and data compression efficiency.
  • embodiments of the present disclosure also provide a data conversion device, such as the following embodiments. Since the problem-solving principle of this device embodiment is similar to that of the above-mentioned method embodiment, the implementation of this device embodiment can refer to the implementation of the above-mentioned method embodiment, and repeated descriptions will not be repeated.
  • FIG. 9 shows a schematic diagram of a data conversion device in an embodiment of the present disclosure. As shown in FIG. 9 , the device includes: a configuration module 91 and a conversion module 92.
  • the configuration module 91 is used to obtain a pre-configured integer matrix, wherein the integer matrix is invertible and the inverse matrix is a rational number matrix; the transformation module 92 is used to perform integer transformation on the data to be transformed by using the integer matrix.
  • the data transformation device pre-configures an integer matrix that is reversible and the inverse matrix is a rational number matrix through the configuration module 91; through the transformation module 92, the integer transformation is performed on the data to be transformed using the configured integer matrix,
  • the whole integer transformation scheme can be realized, not only without any floating-point expression error and quantization error, but also can generate more zero coefficients than the traditional integer transformation/DCT transformation, effectively improving the data compression ratio and Data compression efficiency.
  • embodiments of the present disclosure also provide a data recovery device, such as the following embodiments. Since the problem-solving principle of this device embodiment is similar to that of the above-mentioned method embodiment, the implementation of this device embodiment can refer to the implementation of the above-mentioned method embodiment, and repeated descriptions will not be repeated.
  • FIG. 10 shows a schematic diagram of a data recovery device in an embodiment of the present disclosure.
  • the device includes: a data acquisition module 101 and an inverse transformation module 102 .
  • the data obtaining module 101 is used to obtain the data to be restored, wherein, the data to be restored is the data after integer transformation is carried out to the original data by using an integer matrix, the integer matrix is reversible and the inverse matrix is a matrix of rational numbers; the inverse transformation module 102 uses It uses the inverse matrix of the integer matrix to perform inverse transformation on the data to be restored, so as to restore the data before the integer transformation.
  • the above-mentioned inverse transformation module 102 can also use the integer matrix after shaping the inverse matrix to perform inverse transformation on the data to be restored, so as to restore the integer transformation previous data.
  • the data recovery device obtains the data to be recovered through the data acquisition module 101, and uses the inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix through the inverse transformation module 102,
  • the original data can be completely recovered by performing an inverse integer transformation on the data to be recovered.
  • an image compression system is also provided in the embodiments of the present disclosure, such as the following embodiments. Since the problem-solving principle of the system embodiment is similar to that of the above-mentioned method embodiment, the implementation of the system embodiment can refer to the implementation of the above-mentioned method embodiment, and repeated descriptions will not be repeated.
  • FIG. 11 shows a schematic diagram of an image compression system in an embodiment of the present disclosure.
  • the image compression system 11 includes: a first encoding module 111 and a first decoding module 112 .
  • the first encoding module 111 is used to obtain a pre-configured integer matrix, and uses the integer matrix to perform integer transformation on the image data, wherein the integer matrix is reversible and the inverse matrix is a rational number matrix; the first decoding module 112 is used to use the integer matrix The inverse matrix of the matrix or the integer matrix after shaping the inverse matrix performs inverse transformation on the data after the integer transformation, and restores the image data before the integer transformation.
  • first encoding module 111 and first decoding module 112 may be deployed on the same device, or may be deployed on different devices, which is not specifically limited in this disclosure.
  • the first encoding module 111 is also used to: encode the data after integer transformation, and transmit the encoded data to the first decoding module 112; the first decoding module 112 is also used to encode The data of module 111 is decoded, and the inverse matrix of the integer matrix or the integer matrix obtained by shaping the inverse matrix is used to inversely transform the decoded data to recover the data before the integer transformation.
  • the first encoding module 111 adopts an encoding manner that performs ZigZag scanning or an encoding manner that does not perform ZigZag scanning.
  • embodiments of the present disclosure also provide a feature compression system, such as the following embodiments. Since the problem-solving principle of the system embodiment is similar to that of the above-mentioned method embodiment, the implementation of the system embodiment can refer to the implementation of the above-mentioned method embodiment, and repeated descriptions will not be repeated.
  • FIG. 12 shows a schematic diagram of a feature compression system in an embodiment of the present disclosure.
  • the image compression system 12 includes: a second encoding module 121 and a second decoding module 122 .
  • the second encoding module 121 is used to obtain a pre-configured integer matrix, and uses the integer matrix to perform integer transformation on the characteristic data, wherein the integer matrix is reversible and the inverse matrix is a rational number matrix; the second decoding module 122 is used to use the integer matrix The inverse matrix of the matrix or the integer matrix after reshaping the inverse matrix performs inverse transformation on the data after the integer transformation, and restores the data before the integer transformation.
  • the above feature data may be, but not limited to, feature data obtained by extracting features from an image using a convolutional neural network (CNN) model.
  • CNN convolutional neural network
  • the second encoding module 121 and the second decoding module 122 may be deployed on the same device, or may be deployed on different devices, which is not specifically limited in the present disclosure.
  • the second encoding module 121 is also used to: encode the data after integer transformation, and transmit the encoded data to the second decoding module 122; the second decoding module 122 is also used to encode data from the second encoding
  • the data of the module 121 is decoded, and the inverse matrix of the integer matrix or the integer matrix obtained by reshaping the inverse matrix is used to inversely transform the decoded data to recover the data before the integer transformation.
  • the second encoding module 121 adopts an encoding manner that performs ZigZag scanning or an encoding manner that does not perform ZigZag scanning.
  • the second encoding module 121 is also used to perform quantization processing on the feature data, and uses an integer matrix to perform integer transformation of all integer operations on the quantized feature data; the second decoding module 122 is also used to use the inverse matrix The integer matrix after shaping is performed, the inverse transformation of the whole integer operation is performed on the data after the integer transformation, and the inverse quantization process is performed on the inversely transformed data to obtain the original feature data.
  • the second encoding module 121 is also used to perform integer transformation on the feature data, and quantize the integer-transformed feature data; the second decoding module 122 is also used to perform inverse quantization on the quantized feature data , using the inverse matrix of the integer matrix or the integer matrix after reshaping the inverse matrix, inversely transforming the data after inverse quantization processing to obtain the original feature data.
  • embodiments of the present disclosure also provide a residual compression system, such as the following embodiments. Since the problem-solving principle of the system embodiment is similar to that of the above-mentioned method embodiment, the implementation of the system embodiment can refer to the implementation of the above-mentioned method embodiment, and repeated descriptions will not be repeated.
  • FIG. 13 shows a schematic diagram of a residual compression system in an embodiment of the present disclosure.
  • the residual compression system 13 includes: a third encoding module 131 and a third decoding module 132 .
  • the third coding module 131 is used to obtain a pre-configured integer matrix, and uses the integer matrix to perform integer transformation on the residual data, wherein the integer matrix is reversible and the inverse matrix is a rational number matrix; the third decoding module 132 is used to use The inverse matrix of the integer matrix or the integer matrix after shaping the inverse matrix performs inverse transformation on the data after the integer transformation, and restores the data before the integer transformation.
  • the third encoding module 131 and the third decoding module 132 may be deployed on the same device, or may be deployed on different devices, which is not specifically limited in this disclosure.
  • the third encoding module 131 is also used to: encode the data after integer transformation, and transmit the encoded data to the third decoding module 132; the third decoding module 132 is also used to encode data from the third encoding
  • the data of the module 131 is decoded, and the inverse matrix of the integer matrix or the integer matrix obtained by shaping the inverse matrix is used to inversely transform the decoded data to restore the data before the integer transformation.
  • the third encoding module 131 adopts an encoding manner that performs ZigZag scanning or an encoding manner that does not perform ZigZag scanning.
  • Step 1 Block the image 4x4 XF M_16
  • Step 3 Direct entropy encoding of the resulting coefficients YF 32_1 .
  • Step 1 Perform entropy decoding on the data to obtain YF 32_2 ;
  • Step 2 carry out inverse integer transformation to YF 32_2 by following formula, obtain original image 4x4 block XF M_16 ;
  • F represents the inverse matrix of I, which is a matrix of rational numbers
  • N represents an integer matrix with the same dimension as F, and each element is n
  • n is a positive integer.
  • Step 1 The image gets the feature F 32_1 through the CNN feature extraction network
  • Step 2 Preliminary preprocessing of features, forcing features to take 0.0 as the middle point, and the left and right positive and negative distributions
  • Feature maximum value f_max max(F 32_1 );
  • Feature 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 6 The feature is shaped into (-1,16) dimension to get XI M_16
  • Step 10 Set q_table as shown in Table 3;
  • Step 2 Perform an inverse integer transformation on the data:
  • F is the inverse matrix of I, which is a floating-point rational number
  • n is a positive integer
  • N is a matrix whose dimension is the same as F, and each element of which is an integer n;
  • Step 3 Feature XI M_16 is shaped back to the original size to get I 32_2 ;
  • Step 1 the image obtains the feature F 32_1 through the CNN feature extraction network
  • Step 5 feature shaping into (-1,16) dimension to get XI M_16 ;
  • Step 7 Directly entropy encode the coefficients.
  • Step 1 Perform an inverse integer transformation on the data YI 32_2 :
  • F is the inverse matrix of I, which is a floating-point rational number
  • n is a positive integer
  • N is a matrix whose dimension is the same as F, and each element of which is an integer n;
  • Step 2 Feature XI M_16 is shaped back to the original size to get I 32_2 ;
  • Step 1 the image obtains the feature F 32_1 through the CNN feature extraction network
  • Step 6 feature shaping into (-1,64) dimension to get XI M_64 ;
  • Step 8 Set the fixed quantization table q_table, as shown in Table 4;
  • Step 9 Second Quantization of Feature Data Further narrow the scope of the data.
  • Step 2 Perform an inverse integer transformation on the data:
  • F is the inverse matrix of I, which is a floating-point rational number
  • n is a positive integer
  • N is a matrix whose dimension is the same as F, and each element of which is an integer n;
  • Step 3 Feature XI M_64 is reshaped to the original size to get I 32_2 ;
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • Step 1 the image obtains the feature F 32_1 through the CNN feature extraction network
  • Step 2 feature shaping into (-1,16) dimension obtains XI M_16 ;
  • Step 5 Quantify the feature data
  • Step 6 Entropy coding the quantized feature data I 32_1 .
  • Step 1 Dequantize the data I 32_2 to obtain integer transformation coefficients, which are floating-point values:
  • YI 32_2 I 32_1 ⁇ b2;
  • XI M_16 FYI 32_2 F T ;
  • F is the inverse matrix of I, which is a floating-point rational number
  • Step 2 Feature XI M_16 is shaped back to the original size to get I 32_2 ;
  • Embodiment 6 is a diagrammatic representation of Embodiment 6
  • Step 1 Estimate the image to obtain the residual I 32_1 ;
  • Step 2 Quantize the residual and complete the 8x8 block to get XI M_64 ;
  • Step 3 Perform an 8x8 integer transformation on each 64 small block to get:
  • YI 32_1 IXI M_64 I Y ;
  • Step 4 zigzag encoding + other entropy encoding
  • Step 1 Other entropy decoding + zigzag decoding of encoded data
  • Step 2 Do an inverse integer transformation:
  • F is the inverse matrix of I, which is a floating-point rational number
  • n is a positive integer
  • N is a matrix whose dimension is the same as F, and each element of which is an integer n;
  • the residual is dequantized to obtain the residual I 32_2 .
  • FIG. 14 An electronic device 1400 according to this embodiment of the present disclosure is described below with reference to FIG. 14 .
  • the electronic device 1400 shown in FIG. 14 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
  • electronic device 1400 takes the form of a general-purpose computing device.
  • Components of the electronic device 1400 may include but not limited to: at least one processing unit 1410, at least one storage unit 1420, and a bus 1430 connecting different system components (including the storage unit 1420 and the processing unit 1410).
  • the storage unit stores program codes, and the program codes can be executed by the processing unit 1410, so that the processing unit 1410 executes various exemplary methods according to the present disclosure described in the “Exemplary Methods” section of this specification. Implementation steps.
  • the processing unit 1410 can perform the following steps in the above method embodiment: obtain a pre-configured integer matrix; use the integer matrix to perform integer transformation on the data to be compressed; The data to be compressed is encoded to obtain compressed data.
  • the processing unit 1410 may perform the following steps in the above method embodiment: obtain compressed data, wherein the compressed data is an integer transformation of the original data using a pre-configured integer matrix, and The data obtained by encoding the data after integer transformation; decoding the compressed data, and using the inverse matrix of the integer matrix to perform inverse integer transformation on the decoded data to restore the original data.
  • the storage unit 1420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 14201 and/or a cache storage unit 14202 , and may further include a read-only storage unit (ROM) 14203 .
  • RAM random access storage unit
  • ROM read-only storage unit
  • Storage unit 1420 may also include programs/utilities 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, Implementations of networked environments may be included in each or some combination of these examples.
  • Bus 1430 may represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local area using any of a variety of bus structures. bus.
  • the electronic device 1400 can also communicate with one or more external devices 1440 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable the user to interact with the electronic device 1400, and/or communicate with Any device (eg, router, modem, etc.) that enables the electronic device 1400 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interface 1450 .
  • the electronic device 1400 can also 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 the network adapter 1460 . As shown, network adapter 1460 communicates with other modules of electronic device 1400 via bus 1430 .
  • other hardware and/or software modules may be used in conjunction with electronic device 1400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
  • the example implementations described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of software products, and the software products can be stored in a non-volatile storage medium (which can be CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to make a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
  • a computing device which may be a personal computer, a server, a terminal device, or a network device, etc.
  • a computer-readable storage medium is also provided, and the computer-readable storage medium may be a readable signal medium or a readable storage medium.
  • a program product capable of realizing the above-mentioned methods of the present disclosure is stored thereon.
  • various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code, and when the program product is run on a terminal device, the program code is used to make the The terminal device executes the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section above in this specification.
  • Computer-readable storage media in this disclosure may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory Erasable programmable read-only memory
  • CD-ROM portable compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.
  • a computer-readable storage medium may include a data signal carrying readable program code in baseband or as part of a carrier wave traveling as a data signal. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • program code contained on a computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, cable, optical cable, RF, etc., or any suitable combination of the above.
  • the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, and the programming language includes an object-oriented programming language—such as Java, C++, etc., or Includes conventional procedural programming languages - such as the "C" 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 and partly on a remote computing device, or entirely on the remote computing device or server to execute.
  • 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 (for example, using an Internet service provider). business to connect via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider
  • steps of the methods of the present disclosure are depicted in the drawings in a particular order, there is no requirement or implication that the steps must be performed in that particular order, or that all illustrated steps must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution, etc.
  • the example embodiments described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of software products, and the software products can be stored in a non-volatile storage medium (which can be CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to make a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
  • a non-volatile storage medium which can be CD-ROM, U disk, mobile hard disk, etc.
  • a computing device which may be a personal computer, a server, a mobile terminal, or a network device, etc.

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

本公开提供了一种数据变换与恢复方法、装置、系统、电子设备及存储介质,涉及数据处理技术领域。该方法包括:获取预先配置的一个整数矩阵;利用整数矩阵对待压缩数据进行整数变换;对整数变换后的待压缩数据进行编码,得到压缩后的数据。

Description

数据变换与恢复方法、装置、系统、电子设备及存储介质
相关申请的交叉引用
本申请是以中国申请号为202111626735.1,申请日为2021年12月28日的申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。
技术领域
本公开涉及数据处理技术领域,尤其涉及一种数据变换与恢复方法、装置、系统、电子设备及存储介质。
背景技术
在数字多媒体时代,大量的图像或视频数据,需要耗费大量的存储空间。对于图像或视频数据的压缩处理,相关技术中广泛利用DCT变换(Discrete Cosine Transform,离散余弦变换)或整数变换来取得更高的压缩比,例如,JPEG(Joint Photographic Experts Group,联合图像专家组)标准中采用了DCT变换;H.264标准(国际标准化组织和国际电信联盟继MPEG4之后的新一代数字视频压缩格式)中采用了整数变换来对残差信号进行压缩;VCM(Video Coding For Machines,机器视觉编码)标准中的特征编码采用了DCT变换。
传统的整数变换来源于DCT变换,对DCT变换的等效矩阵进行了细微修改,将浮点运算误差项合并到量化里面去。因而,整数变换方案性能损失仅来源于量化;而DCT变换方案的性能损失来源于量化和DCT变换本身浮点运算的误差项。但仔细分析可以看出,传统的整数变换方案,不是全整数变换方案,只是将浮点误差项合并到量化里面,虽然在一定程度上减少了浮点运算误差,但这个误差是无法避免的,因而,无论是DCT变换方案,还是传统整数变换方案,都没有完全消除浮点运算误差。
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本公开提供一种数据变换与恢复方法、装置、系统、电子设备及存储介质,至少在一定程度上克服相关技术中基于传统整数变换的压缩方案无法完全消除浮点运算误差的技术问题。
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。
根据本公开的一个方面,提供了一种数据变换方法,该方法包括:获取预先配置的一个整数矩阵,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;利用所述整数矩阵对待变换数据进行整数变换。
在一些实施例中,通过如下公式对待变换数据进行整数变换:
Y=IXI T
其中,Y表示整数变换后的数据;X表示整数变换前的数据;I表示预先配置的一个可逆且逆矩阵为有理数矩阵的整数矩阵;I T表示I的转置矩阵。
在一些实施例中,通过如下公式对整数变换后的数据进行逆变换,以恢复出整数变换前的数据:
X=FYF T
其中,Y表示整数变换后的数据;X表示恢复后的数据,也即整数变换前的数据;F表示I的逆矩阵,是一个有理数矩阵;F T表示F的转置矩阵。
在一些实施例中,通过如下公式对整数变换后的数据进行逆变换,以恢复出整数变换前的数据:
Figure PCTCN2022132143-appb-000001
其中,F表示I的逆矩阵,是一个有理数矩阵;N表示与F维度相同的一个整数矩阵,每个元素为n;n为正整数;
Figure PCTCN2022132143-appb-000002
表示F和N的克罗内克积,是一个整数矩阵;
Figure PCTCN2022132143-appb-000003
表示
Figure PCTCN2022132143-appb-000004
的转置矩阵。
在一些实施例中,所述待变换数据为整形数据,对所述整形数据的正变换和逆变换均为全整数运算的整数变换,所述方法还包括:利用整数矩阵对待变换的整形数据进行全整 数运算的整数变换;利用对所述整数矩阵的逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行全整数运算的逆变换,恢复出所述整形数据。
在一些实施例中,所述待变换数据为浮点数据,所述方法还包括:对待变换的浮点数据进行量化,得到量化后的整形数据;利用整数矩阵对量化后的整形数据进行全整数运算的整数变换;利用对所述整数矩阵的逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,所述待变换数据为浮点数据,所述方法还包括:利用整数矩阵对待变换的浮点数据进行变换,得到变换后的浮点数据;利用对所述整数矩阵的逆矩阵进行整形后的整数矩阵,对变换后的浮点数据进行逆变换,恢复出变换前的浮点数据。
在一些实施例中,所述待变换数据为浮点数据,所述方法还包括:利用整数矩阵对待变换的浮点数据进行变换,得到变换后的浮点数据;对变换后的浮点数据进行量化处理;对量化处理后的数据进行反量化处理;利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对反量化后的浮点数据进行逆变换,恢复出变换前的浮点数据。
在一些实施例中,所述待变换数据至少包括如下任意之一:图像数据、视频数据、残差数据、特征数据。
根据本公开的另一个方面,还提供了一种数据恢复方法,包括:获取待恢复数据,其中,所述待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,所述整数矩阵可逆且逆矩阵为有理数矩阵;利用所述整数矩阵的逆矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
根据本公开的另一个方面,还提供了一种数据恢复方法,包括:获取待恢复数据,其中,所述待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,所述整数矩阵可逆且逆矩阵为有理数矩阵;利用对所述逆矩阵进行整形后的整数矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
根据本公开的另一个方面,还提供了一种数据变换装置,包括:配置模块,用于获取预先配置的一个整数矩阵,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;变换模块,用于利用所述整数矩阵对待变换数据进行整数变换。
根据本公开的另一个方面,还提供了一种数据恢复装置,包括:数据获取模块,用于获取待恢复数据,其中,所述待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,所述整数矩阵可逆且逆矩阵为有理数矩阵;逆变换模块,用于利用所述整数矩阵的逆矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
根据本公开的另一个方面,还提供了一种数据恢复装置,包括:数据获取模块,用于获取待恢复数据,其中,所述待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,所述整数矩阵可逆且逆矩阵为有理数矩阵;逆变换模块,用于利用对所述逆矩阵进行整形后的整数矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
根据本公开的另一个方面,还提供了一种图像压缩系统,包括:第一编码模块和第一解码模块;其中,所述第一编码模块,用于获取预先配置的一个整数矩阵,利用所述整数矩阵对图像数据进行整数变换,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;所述第一解码模块,用于利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的图像数据。
在一些实施例中,所述第一编码模块还用于:对整数变换后的数据进行编码,将编码后的数据传输至所述第一解码模块;所述第一解码模块还用于对来自第一编码模块的数据进行解码,利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对解码后的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,所述第一编码模块采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
根据本公开的另一个方面,还提供了一种特征压缩系统,包括:第二编码模块和第二解码模块;其中,所述第二编码模块,用于获取预先配置的一个整数矩阵,利用所述整数矩阵对特征数据进行整数变换,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;所述第二解码模块,用于利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,所述第二编码模块还用于:对整数变换后的数据进行编码,将编码后的数据传输至所述第二解码模块;所述第二解码模块还用于对来自第二编码模块的数据进行解码,利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对解码后 的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,所述第二编码模块采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
在一些实施例中,所述第二编码模块还用于对特征数据进行量化处理,利用所述整数矩阵对量化后的特征数据进行全整数运算的整数变换;所述第二解码模块还用于利用对所述逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行全整数运算的逆变换,并对逆变换后的数据进行反量化处理,得到原始特征数据。
在一些实施例中,所述第二编码模块还用于对特征数据进行整数变换,对整数变换后的特征数据进行量化处理;所述第二解码模块还用于对量化后的特征数据进行反量化处理,利用对所述逆矩阵进行整形后的整数矩阵,对反量化处理后的数据进行逆变换,得到原始特征数据。
根据本公开的另一个方面,还提供了一种残差压缩系统,包括:第三编码模块和第三解码模块;其中,所述第三编码模块,用于获取预先配置的一个整数矩阵,利用所述整数矩阵对残差数据进行整数变换,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;所述第三解码模块,用于利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,所述第三编码模块还用于:对整数变换后的数据进行编码,将编码后的数据传输至所述第三解码模块;所述第三解码模块还用于对来自第三编码模块的数据进行解码,利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对解码后的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,所述第三编码模块采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
根据本公开的另一个方面,还提供了一种电子设备,包括:处理器;以及存储器,用于存储所述处理器的可执行指令;其中,所述处理器配置为经由执行所述可执行指令来执行上述任意一项所述的数据变换方法,或上述任意一项所述的数据恢复方法。
根据本公开的另一个方面,还提供了一种计算机可读存储介质,其上存储有计算机程 序,所述计算机程序被处理器执行时实现上述任意一项所述的数据变换方法,或上述任意一项所述的数据恢复方法。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出相关技术中基于传统整数变换实现数据压缩的流程图;
图2示出相关技术中采用传统DCT/整数变换的数据变换结果示意图;
图3示出本公开实施例中基于新整数变换实现数据压缩的流程图;
图4示出本公开实施例中基础量化步长和步长倍率结合实现量化的原理示意图;
图5示出本公开实施例中采用新整数变换的数据变换结果示意图;
图6示出本公开实施例中一种数据变换方法流程图;
图7示出本公开实施例中一种数据恢复方法流程图;
图8示出本公开实施例中又一种数据恢复方法流程图;
图9示出本公开实施例中一种数据变换装置示意图;
图10示出本公开实施例中一种数据恢复装置示意图;
图11示出本公开实施例中一种图像压缩系统示意图;
图12示出本公开实施例中一种特征压缩系统示意图;
图13示出本公开实施例中一种残差压缩系统示意图;
图14示出本公开实施例中一种电子设备的结构框图。
具体实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
为便于理解,在介绍本公开实施例之前,首先对本公开实施例中涉及到的几个名词进行解释如下:
压缩:以某种技术手段,减少数据尺寸。
解压:将减少数据尺寸后的数据通过某种技术手段恢复成原始尺寸。
编码:压缩的一种具体技术手段。
解码:解压的一种具体手段。
DCT:英文全称为Discrete Cosine Transform,译为“离散余弦变换”,用于对图像或视频进行有损数据压缩。
ZigZag扫描:即Z字形扫描,按照一定的路径(Z字形)扫描,将量化后的系数从二维变换到一维。经过DCT变换和量化处理后,矩阵的右下角部分基本上都已变为零值,非零值基本集中在矩阵的左上角部分,经过ZigZag扫描后,可将二维的矩阵变换为一个一维的串,该串靠前的部分主要为非零值,靠后的部分则主要是零值。
下面结合附图及实施例对本公开具体实施方式进行详细说明。
首先,对传统DCT变换进行分析:二维DCT变换等效于先行DCT变换,再列DCT 变换,可以用下面的矩阵表示DCT正反变换:
Y=AXA T        (1)
X=BYB T       (2)
其中,B=A -1,A表示如下:
Figure PCTCN2022132143-appb-000005
传统的整数变换来源于DCT变换:
Figure PCTCN2022132143-appb-000006
则DCT变换公式为:
Figure PCTCN2022132143-appb-000007
取d=c/b(约等于0.414),为了完成整数变换,必须取d=0.5,且修正
Figure PCTCN2022132143-appb-000008
此时得到了整数变换公式:
Figure PCTCN2022132143-appb-000009
此时得到修正后的整数变换矩阵:
Figure PCTCN2022132143-appb-000010
Figure PCTCN2022132143-appb-000011
图1示出相关技术中基于传统整数变换实现数据压缩的流程图,如图1所示,若使用传统的整数变换对数据进行压缩,需要对变换系数进行哈达玛变换/量化以及ZigZag扫描。其中,ZigZag扫描是系统必备模块,而ZigZag扫描本身带来了大量的计算。
分析可知,传统DCT变换和整数变换存在如下缺点:
1)传统整数变换来源于DCT变换,是DCT变换的系数稍作修改的结果,导致整数变换的方案具有唯一性。
2)传统DCT变换和整数变换没有达到0系数比例最优;图2所示为通过传统DCT变换和整数变换对4×4数据块进行变换后的结果,可以看出,传统DCT变换和整数变换后的结果中,虽然非0系数比较多,但并没有达到最优。传统整数变换相对于DCT变换,并没有增加0系数的比例。
3)传统DCT变换/整数变换都是非完全整数变换,误差项E仍然包含了无理浮点数,只不过通过和量化一起合并的手段适当减少了误差,但误差仍然不可避免;
4)传统DCT变换/整数变换的系数编码/解码依赖ZigZag扫描(即Z字形扫描)将0系数集中在一起,而ZigZag本身的计算量不小。
为了解决相关技术中基于传统整数变换的压缩方案无法完全消除浮点运算误差的技术问题,本公开实施例中提供了一种基于新整数变换的数据变换方法和数据恢复方法,在介绍该数据变换方法和数据恢复方法之前,先对新整数变换进行说明:
本公开实施例中提供的新整数变换,仅仅约束I为一个整数矩阵,该整数矩阵可逆且逆矩阵为有理数矩阵:
Y=IXI T             (8)
X=FYF T          (9)
其中,Y表示整数变换后的数据;X表示整数变换前的数据;I表示预先配置的一个可逆且逆矩阵为有理数矩阵的整数矩阵;I T表示I的转置矩阵;F=I -1,表示I的逆矩阵,是一个有理数矩阵;F T表示F的转置矩阵。进一步地,为了实现全整数的逆变换,可对逆矩阵进行整形计算:
Figure PCTCN2022132143-appb-000012
其中,N表示与F维度相同的一个整数矩阵,每个元素为n;n为正整数;
Figure PCTCN2022132143-appb-000013
表示F和N的克罗内克积,是一个整数矩阵;
Figure PCTCN2022132143-appb-000014
表示
Figure PCTCN2022132143-appb-000015
的转置矩阵。
由于本公开实施例中提供的新整数变换,利用的是一个与DCT无关的整数矩阵,因而,对于整形数据,可进行全整数运算的整数变换和逆变换,而无任何信息损失;对于浮点数据,可对浮点数据进行量化后,对量化后的整形矩阵实现全整数运算的整数变换,不仅无任何浮点表达误差及量化误差,而且可产生比传统整数变换/DCT变换更多的0系数,有效提高了数据压缩比和数据压缩效率。
图3示出本公开实施例中基于新整数变换实现数据压缩的流程图,如图3所示,利用本公开实施例中提供的新整数变换实现数据压缩时,量化模块为可选模块。本公开实施例可通过如下两种方式实现整数型(浮点型)数据到整形数据的量化:
方式a:固定量化表;
方式b:基础量化步长和步长倍率结合的量化。图4示出本公开实施例中基础量化步长和步长倍率结合实现量化的原理示意图。
1)整数变换系数求取绝对值最大值abs_max=max(abs(c))
2)基础量化分为(2×INT_MAX+1)个步骤:基础量化步长为abs_max/INT_MAX;
3)对应的步长倍率表设置步长倍率q_table;
4)基础量化步长乘以步长倍率表的步长倍率得到每个位置的具体量化步长s=q_table×abs_max/INT_MAX;
5)系数进行对应的量化Y_quant=round(Y/s);round函数可返回一个数值,该数值是按照指定的小数位数进行四舍五入运算的结果。
6)反量化操作为Y=Y_quant×s;
例如,一个4x4的固定量化表如表1所示,一个4x4的步长倍率表如表2所示。
表1
1 1 1 4
1 1 4 4
1 4 4 8
4 4 8 8
表2
1 1 1 1
1 1 1 1
1 1 1 2
1 1 2 2
下面一个实际的例子,来说明本公开实施例中新整数变换的优点:假设预先配置的整数矩阵如下:
Figure PCTCN2022132143-appb-000016
则有:
Figure PCTCN2022132143-appb-000017
则设计:
Figure PCTCN2022132143-appb-000018
Figure PCTCN2022132143-appb-000019
图5示出本公开实施例中采用新整数变换的数据变换结果示意图,如图5所示,本公开实施例中提供的新整数变换,具有如下优点:
1)全整数运行的整数变换系统,可完全消灭误差,提高系统原始性能指标;
2)产生比传统DCT/整数量化更多的0系数,提高整体压缩系统的压缩比;
3)可配置/非唯一的整数量化系统,运用于多个可能场景;
4)更多的0系数,可配置的不同系数分布,使得ZigZag扫描编码成为可选项,而不是必选项。本公开实施例中提供了两种编码方式:①不执行ZigZag扫描的编码方式;②执行ZigZag扫描的编码方式。
基于本公开实施例中提供的新整数变换,本公开实施例中公开了一种数据变换方法和数据恢复方法,利用一个预先配置的整数矩阵对待变换数据进行整数变换,并在整数变换后的数据进行逆变换,能够实现全整数变换方案,不仅无任何浮点表达误差及量化误差,而且可产生比传统整数变换/DCT变换更多的0系数,有效提高了数据压缩比和数据压缩效率。
本公开实施例中提供的数据变换方法和数据恢复方法可以由任意具备计算处理能力的电子设备执行。在数据压缩系统中,本公开实施例中的数据变换方法可由编码端设备执行,本公开实施例中的数据恢复方法可由解码端设备执行。
需要说明的是,执行本公开实施例中数据变换方法和数据恢复方法的电子设备可以是终端设备,也可以是服务器。其中,终端设备可以包括但不限于智能手机、平板电脑、膝上型便携计算机、台式计算机、可穿戴设备、增强现实设备、虚拟现实设备等;服务器可以是提供各种服务的服务器,例如对用户利用终端设备所进行操作的装置提供支持的后台管理服务器。后台管理服务器可以对接收到的请求等数据进行分析等处理,并将处理结果反馈给终端设备。
在一些实施例中,终端设备中安装的应用程序的客户端是相同的,或基于不同操作系 统的同一类型应用程序的客户端。基于终端平台的不同,该应用程序的客户端的具体形态也可以不同,比如,该应用程序客户端可以是手机客户端、PC客户端等。
在一些实施例中,服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此。终端以及服务器可以通过有线或无线通信方式进行直接或间接地连接,本公开在此不做限制。
图6示出本公开实施例中一种数据变换方法流程图,如图6所示,本公开实施例中提供的数据变换方法包括如下步骤:
S602,获取预先配置的一个整数矩阵,其中,整数矩阵可逆且逆矩阵为有理数矩阵。
需要说明的是,上述S602中配置的整数矩阵是一个可逆的元素为整数的矩阵,其逆矩阵为一个有理数矩阵;利用该整数矩阵可对原始数据进行整数变换,利用该整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行反整数变换(逆变换),能够完全恢复出原始数据。原则上,只要原始数据为整形数据,则对原始数据进行的整数变换为全整数运算的整数变换,对整数变换后的数据进行的反整数变换也是全整数运算的反整数变换。在具体实施时,若原始数据为整形数据,则直接利用整数矩阵对原始数据进行整数变换和反整数变换;若原始数据为浮点数据,则对量化后的整形矩阵实现全整数运算的整数变换。
S604,利用整数矩阵对待变换数据进行整数变换。
需要说明的是,上述待变换数据可以包括但不限于如下任意之一:图像数据、视频数据、残差数据、特征数据。本公开实施例中,利用一个与DCT变换无关的整数矩阵对待变换数据进行整数变换,使得整数变换的形式不唯一,可以提供更多的整数变换方案。
因而,在一些实施例中,当待变换数据为整形数据时,对整形数据的正变换和逆变换均为全整数运算的整数变换,本公开实施例中提供的数据变换方法还包括如下步骤:利用 整数矩阵对待变换的整形数据进行全整数运算的整数变换;利用对整数矩阵的逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行全整数运算的逆变换,恢复出整形数据。
在另一些实施例中,当待变换数据为浮点数据时,本公开实施例中提供的数据变换方法还包括如下步骤:对待变换的浮点数据进行量化,得到量化后的整形数据;利用整数矩阵对量化后的整形数据进行全整数运算的整数变换;利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据(也即对原始浮点数据进行量化得到的整形数据)。
在一些实施例中,当待变换数据为浮点数据时,本公开实施例中提供的数据变换方法还包括如下步骤:利用整数矩阵对待变换的浮点数据进行变换,得到变换后的浮点数据;利用对整数矩阵的逆矩阵进行整形后的整数矩阵,对变换后的浮点数据进行逆变换,恢复出变换前的浮点数据。该实施例中,对浮点数据直接进行整数变换和逆变换,可近似恢复出整数变换前的浮点数据。
在一些实施例中,当待变换数据为浮点数据时,本公开实施例中提供的数据变换方法还包括如下步骤:利用整数矩阵对待变换的浮点数据进行变换,得到变换后的浮点数据;对变换后的浮点数据进行量化处理;对量化处理后的数据进行反量化处理;利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对反量化后的浮点数据进行逆变换,恢复出变换前的浮点数据。该实施例中,对浮点数据直接进行整数变换后,对变换后的数据进行量化和反量化,经逆变换,可近似恢复出整数变换前的浮点数据。需要说明的是,本公开对浮点数据经整数变换后执行的量化和反量化的具体方法不作限定,本领域技术人员可根据实际情况执行相应的量化和反量化,以确保能够恢复出整数变换前的数据。
在一些实施例中,当本公开实施例中提供的新整数变换方案应用于数据压缩系统中时,在编码端利用配置的整数矩阵对编码前的数据进行整数变换;对整数变换后的数据进行压缩编码,以便解码端对数据解码后对通过反整数变换,完全恢复出原始数据,不仅无任何浮点表达误差及量化误差,而且可产生比传统整数变换/DCT变换更多的0系数,有效提高了数据压缩比和数据压缩效率。在具体实施时,在对数据压缩前,可通过上述公式(8)对待压缩数据进行整数变换;在对压缩数据解码后,通过上述公式(9)或(10)对整数变换后的数据进行恢复。
由于待压缩数据可能是整形数据,也可能是浮点数据,当待压缩数据时整形数据时,利用本公开实施例中提供的新整数变换能够实现全整数变换(即全整数运算的整数变换);当待压缩数据为浮点数据时,可对浮点数据进行量化后,对量化后的整形数据进行新整数变换,具体量化处理过程已在上述内容中介绍,此处不再赘述。
在一些实施例中,本公开实施例可利用图7所示的数据恢复方法,恢复出整数变换前的数据;在另外一些实施例中,本公开实施例可利用图8所示的数据恢复方法,恢复出整数变换前的数据.
如图7所示,本公开实施例中提供的数据恢复方法包括如下步骤:
S702,获取待恢复数据,其中,待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,整数矩阵可逆且逆矩阵为有理数矩阵;
S704,利用整数矩阵的逆矩阵,对待恢复数据进行逆变换,以恢复出整数变换前的数据。
如图8所示,本公开实施例中提供的数据恢复方法包括如下步骤:
S802,获取待恢复数据,其中,待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,整数矩阵可逆且逆矩阵为有理数矩阵;
S804,利用对逆矩阵进行整形后的整数矩阵,对待恢复数据进行逆变换,以恢复出整数变换前的数据。
当本公开的实施例提供的数据恢复方法可以应用于数据压缩系统中的解码端,由解码端接收到来自编码端的压缩数据后,对压缩数据进行解码,利用整数矩阵的逆矩阵对逆矩阵进行整形后的整数矩阵,对解码后的数据进行反整数变换,以完全恢复出整数变换前的数据,能够实现全整数变换方案,不仅无任何浮点表达误差及量化误差,而且可产生比传统整数变换/DCT变换更多的0系数,有效提高了数据压缩比和数据压缩效率。
基于同一发明构思,本公开实施例中还提供了一种数据变换装置,如下面的实施例。由于该装置实施例解决问题的原理与上述方法实施例相似,因此该装置实施例的实施可以参见上述方法实施例的实施,重复之处不再赘述。
图9示出本公开实施例中一种数据变换装置示意图,如图9所示,该装置包括:配置 模块91和变换模块92。
其中,配置模块91,用于获取预先配置的一个整数矩阵,其中,整数矩阵可逆且逆矩阵为有理数矩阵;变换模块92,用于利用整数矩阵对待变换数据进行整数变换。
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述方法实施例所公开的内容。需要说明的是,上述模块作为装置的一部分可以在诸如一组计算机可执行指令的计算机系统中执行。
由上可知,本公开的实施例所提供的数据变换装置,通过配置模块91预先配置一个可逆且逆矩阵为有理数矩阵的整数矩阵;通过变换模块92利用配置的整数矩阵对待变换数据进行整数变换,当待变换数据为整形数据时,能够实现全整数变换方案,不仅无任何浮点表达误差及量化误差,而且可产生比传统整数变换/DCT变换更多的0系数,有效提高了数据压缩比和数据压缩效率。
基于同一发明构思,本公开实施例中还提供了一种数据恢复装置,如下面的实施例。由于该装置实施例解决问题的原理与上述方法实施例相似,因此该装置实施例的实施可以参见上述方法实施例的实施,重复之处不再赘述。
图10示出本公开实施例中一种数据恢复装置示意图,如图10所示,该装置包括:数据获取模块101和逆变换模块102。
其中,数据获取模块101,用于获取待恢复数据,其中,待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,整数矩阵可逆且逆矩阵为有理数矩阵;逆变换模块102,用于利用整数矩阵的逆矩阵,对待恢复数据进行逆变换,以恢复出整数变换前的数据。
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述方法实施例所公开的内容。需要说明的是,上述模块作为装置的一部分可以在诸如一组计算机可执行指令的计算机系统中执行。
为了实现全整数运算的逆变换,在一些实施例中,上述逆变换模块102还可利用对所述逆矩阵进行整形后的整数矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
由上可知,本公开的实施例所提供的数据恢复装置,通过数据获取模块101获取待恢复数据,通过逆变换模块102利用整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对待恢复数据进行反整数变换,能够完全恢复出原始数据。
基于同一发明构思,本公开实施例中还提供了一种图像压缩系统,如下面的实施例。由于该系统实施例解决问题的原理与上述方法实施例相似,因此该系统实施例的实施可以参见上述方法实施例的实施,重复之处不再赘述。
图11示出本公开实施例中一种图像压缩系统示意图,如图11所示,该图像压缩系统11包括:第一编码模块111和第一解码模块112。
其中,第一编码模块111,用于获取预先配置的一个整数矩阵,利用整数矩阵对图像数据进行整数变换,其中,整数矩阵可逆且逆矩阵为有理数矩阵;第一解码模块112,用于利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的图像数据。
需要说明的是,根据具体应用场景的不同,上述第一编码模块111和第一解码模块112可以部署于同一设备,也可以部署于不同的设备,本公开对此不做具体限定。
在一些实施例中,第一编码模块111还用于:对整数变换后的数据进行编码,将编码后的数据传输至第一解码模块112;第一解码模块112还用于对来自第一编码模块111的数据进行解码,利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对解码后的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,第一编码模块111采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
基于同一发明构思,本公开实施例中还提供了一种特征压缩系统,如下面的实施例。由于该系统实施例解决问题的原理与上述方法实施例相似,因此该系统实施例的实施可以参见上述方法实施例的实施,重复之处不再赘述。
图12示出本公开实施例中一种特征压缩系统示意图,如图12所示,该图像压缩系统12包括:第二编码模块121和第二解码模块122。
其中,第二编码模块121,用于获取预先配置的一个整数矩阵,利用整数矩阵对特征 数据进行整数变换,其中,整数矩阵可逆且逆矩阵为有理数矩阵;第二解码模块122,用于利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据。
需要说明的是,上述特征数据可以是但不限于利用卷积神经网络CNN模型对图像进行特征提取得到的特征数据。根据具体应用场景的不同,上述第二编码模块121和第二解码模块122可以部署于同一设备,也可以部署于不同的设备,本公开对此不做具体限定。
在一些实施例中,第二编码模块121还用于:对整数变换后的数据进行编码,将编码后的数据传输至第二解码模块122;第二解码模块122还用于对来自第二编码模块121的数据进行解码,利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对解码后的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,第二编码模块121采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
在一些实施例中,第二编码模块121还用于对特征数据进行量化处理,利用整数矩阵对量化后的特征数据进行全整数运算的整数变换;第二解码模块122还用于利用对逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行全整数运算的逆变换,并对逆变换后的数据进行反量化处理,得到原始特征数据。
在一些实施例中,第二编码模块121还用于对特征数据进行整数变换,对整数变换后的特征数据进行量化处理;第二解码模块122还用于对量化后的特征数据进行反量化处理,利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对反量化处理后的数据进行逆变换,得到原始特征数据。
基于同一发明构思,本公开实施例中还提供了一种残差压缩系统,如下面的实施例。由于该系统实施例解决问题的原理与上述方法实施例相似,因此该系统实施例的实施可以参见上述方法实施例的实施,重复之处不再赘述。
图13示出本公开实施例中一种残差压缩系统示意图,如图13所示,该残差压缩系统13包括:包括:第三编码模块131和第三解码模块132。
其中,第三编码模块131,用于获取预先配置的一个整数矩阵,利用整数矩阵对残差 数据进行整数变换,其中,整数矩阵可逆且逆矩阵为有理数矩阵;第三解码模块132,用于利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据。
需要说明的是,根据具体应用场景的不同,上述第三编码模块131和第三解码模块132可以部署于同一设备,也可以部署于不同的设备,本公开对此不做具体限定。
在一些实施例中,第三编码模块131还用于:对整数变换后的数据进行编码,将编码后的数据传输至第三解码模块132;第三解码模块132还用于对来自第三编码模块131的数据进行解码,利用整数矩阵的逆矩阵或对逆矩阵进行整形后的整数矩阵,对解码后的数据进行逆变换,恢复出整数变换前的数据。
在一些实施例中,第三编码模块131采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
本公开实施例中提供的新整数变换方案,能够应用于很多场景,下面列举几个具体的例子:
实施例1:
编码端:
第1步:对图像4x4分块XF M_16
第2步:对每一个16的小块进行4x4整数变换,得到YF 32_1=IXF M_16I T
其中,
Figure PCTCN2022132143-appb-000020
第3步:对所得系数YF 32_1直接熵编码。
解码端:
第1步:对数据进行熵解码得到YF 32_2
第2步:通过如下公式对YF 32_2进行反整数变换,得到原始图像4x4块XF M_16
Figure PCTCN2022132143-appb-000021
Figure PCTCN2022132143-appb-000022
Figure PCTCN2022132143-appb-000023
Figure PCTCN2022132143-appb-000024
其中,F表示I的逆矩阵,是一个有理数矩阵;N表示与F维度相同的一个整数矩阵,每个元素为n;n为正整数。
实施例2:
编码端:
第1步:图像通过CNN特征提取网络得到特征F 32_1
第2步:特征初步预处理,强制特征以0.0为中间点,左右正负分布
特征最大值f_max=max(F 32_1);
特征最大值f_min=min(F 32_1);
特征偏移量f_offset=(f_max+f_min)/2;
F 32_1=F 32_1-f_offset;
第3步:求F 32_1的最大绝对值abs_max=max(abs(f_max),abs(f_min))
第4步:设置INT_MAX为227,则量化步骤数量为2×227+1,量化步长为b=abs_max/227;
第5步:对特征数据进行量化I 32_1=round(F 32_1/b);
第6步:特征整形成(-1,16)维度得到XI M_16
第7步:对每一个16的小块进行4x4的整数变换,得到YI 32_1=IXI M_16I T
第8步:求YI 32_1的最大绝对值abs_max_2=max(abs(YI 32_1));
第9步:设置INT_MAX_2为4,则量化steps为1+2×128,基础量化步长为b_2=abs_max_2/4;
第10步:设置q_table为如表3所示;
表3
1 1 1 1
1 1 1 2
1 1 2 2
1 2 2 2
第11步:对4x4的每个位置系数,量化步长为s_2=q_table×b_2;
第12步:对特征数据进行第二次量化YI 32_1=round(YI 32_1/s_2),进一步缩小数据范围;
解码端:
第1步:对二次量化数据进行反量化YI 32_2=YI 32_2×s_2;
第2步:对数据进行反整数变换:
Figure PCTCN2022132143-appb-000025
其中,F为I的逆矩阵,其为浮点有理数,n是一个正整数,N是一个矩阵,其维度和F相同,其每个元素均为整数n;
第3步:特征XI M_16整形回原尺寸得到I 32_2
第4步:反量化变换:F 32_2=I 32_2×b;
第5步:F 32_2=F 32_2+f_offset。
实施例3:
编码端:
第1步:图像通过CNN特征提取网络得到特征F 32_1
第2步:求取特征的最大值和最小值,其中,最大值f_max=max(F 32_1);最小值f_min=min(F 32_1);
第3步:设置INT_MAX为27,则量化步骤数为27,量化步长为b=(f_max-f_min)/27;
第4步:对特征数据进行量化I 32_1=round((F 32_1-f_min)/b);
第5步:特征整形成(-1,16)维度得到XI M_16
第6步:对每一个16的小块进行4x4的整数变换,得到YI 32_1=IXI M_16I T
第7步:对系数直接进行熵编码。
解码端:
第1步:对数据YI 32_2进行反整数变换:
Figure PCTCN2022132143-appb-000026
其中,F为I的逆矩阵,其为浮点有理数,n是一个正整数,N是一个矩阵,其维度和F相同,其每个元素均为整数n;
第2步:特征XI M_16整形回原尺寸得到I 32_2
第3步:反量化变换F 32_2=fmin+I 32_2×b;
实施例4:
编码端:
第1步:图像通过CNN特征提取网络得到特征F 32_1
第2步:特征初步预处理,强制特征以0.0为起点,仅正向分布f_min=min(F 32_1);F 32_1=F 32_1-f_min;
第3步:求F 32_1的最大值abs_max=max(F 32_1);
第4步:设置INT_MAX为28,则量化steps为28,量化步长为b=abs_max/28;
第5步:对特征数据进行量化I 32_1=round(F 32_1/b);
第6步:特征整形成(-1,64)维度得到XI M_64
第7步:对每一个64的小块进行8x8的整数变换,得到YI 32_1=IXI M_64I T
第8步:设置固定量化表q_table,如表4所示;
表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
第9步:对特征数据进行第二次量化
Figure PCTCN2022132143-appb-000027
进一步缩小数据范围。
解码端:
第1步:对二次量化数据进行反量化YI 32_2=YI 32_2×q_table;
第2步:对数据进行反整数变换:
Figure PCTCN2022132143-appb-000028
其中,F为I的逆矩阵,其为浮点有理数,n是一个正整数,N是一个矩阵,其维度和F相同,其每个元素均为整数n;
第3步:特征XI M_64整形回原尺寸得到I 32_2
第4步:反量化变换F 32_2=I 32_2×b;
第5步:F 32_2=F 32_2+f_min。
实施例5:
编码端:
第1步:图像通过CNN特征提取网络得到特征F 32_1
第2步:特征整形成(-1,16)维度得到XI M_16
第3步:对每一个16的小块进行4x4的整数变换,得到YI 32_1=IXI M_16I T,本例得到的系数也为浮点值;
第4步:设置INT_MAX为2 5,则量化steps为1+2×2 5,基础量化步长为b=abs_max/2 5;q_table设置为表5所示,b2=b×q_table;
表5
1 1 1 1
1 1 1 2
1 1 2 2
1 2 2 2
第5步:对特征数据进行量化
Figure PCTCN2022132143-appb-000029
第6步:对量化后的特征数据I 32_1熵编码。
解码端:
第1步:对数据I 32_2进行反量化,得到整数变换系数,为浮点值:
YI 32_2=I 32_1×b2;
XI M_16=FYI 32_2F T
其中,F为I的逆矩阵,其为浮点有理数;
第2步:特征XI M_16整形回原尺寸得到I 32_2
第3步:反量化变换F 32_2=fmin+I 32_2×b;
实施例6:
编码端:
第1步:对图像进行估计,得到残差I 32_1
第2步:对残差进行量化并完成8x8分块,得到XI M_64
第3步:对每一个64的小块进行8x8的整数变换,得到:
YI 32_1=IXI M_64I Y
第4步:zigzag编码+其他熵编码;
解码端:
第1步:对编码数据其他熵解码+zigzag解码;
第2步:进行反整数变换:
Figure PCTCN2022132143-appb-000030
其中,F为I的逆矩阵,其为浮点有理数,n是一个正整数,N是一个矩阵,其维度和F相同,其每个元素均为整数n;
第3步对残差反量化得到残差I 32_2
所属技术领域的技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。
下面参照图14来描述根据本公开的这种实施方式的电子设备1400。图14显示的电子设备1400仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图14所示,电子设备1400以通用计算设备的形式表现。电子设备1400的组件可以包括但不限于:上述至少一个处理单元1410、上述至少一个存储单元1420、连接不同系统组件(包括存储单元1420和处理单元1410)的总线1430。
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元1410执行,使得所述处理单元1410执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤。
当所述电子设备1400为编码端设备时,所述处理单元1410可以执行上述方法实施例的如下步骤:获取预先配置的一个整数矩阵;利用整数矩阵对待压缩数据进行整数变换;对整数变换后的待压缩数据进行编码,得到压缩后的数据。
当所述电子设备1400为解码端设备时,所述处理单元1410可以执行上述方法实施例的如下步骤:获取压缩数据,其中,压缩数据为利用预先配置的整数矩阵对原始数据进行整数变换,并对整数变换后的数据进行编码得到的数据;对压缩数据进行解码,利用整数矩阵的逆矩阵对解码后的数据进行反整数变换,恢复出原始数据。
存储单元1420可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)14201和/或高速缓存存储单元14202,还可以进一步包括只读存储单元(ROM)14203。
存储单元1420还可以包括具有一组(至少一个)程序模块14205的程序/实用工具14204,这样的程序模块14205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线1430可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。
电子设备1400也可以与一个或多个外部设备1440(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备1400交互的设备通信,和/或与 使得该电子设备1400能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1450进行。并且,电子设备1400还可以通过网络适配器1460与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器1460通过总线1430与电子设备1400的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备1400使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本公开实施方式的方法。
在本公开的示例性实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质可以是可读信号介质或者可读存储介质。其上存储有能够实现本公开上述方法的程序产品。在一些可能的实施方式中,本公开的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤。
本公开中的计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
在本公开中,计算机可读存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件 使用或者与其结合使用的程序。
可选地,计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。
在具体实施时,可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
此外,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
通过以上实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、移动终端、或者网络设备等)执行根据本公开实施方式的方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者 适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由所附的权利要求指出。

Claims (28)

  1. 一种数据变换方法,包括:
    获取预先配置的一个整数矩阵,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    利用所述整数矩阵对待变换数据进行整数变换。
  2. 根据权利要求1所述的数据变换方法,其中,通过如下公式对待变换数据进行整数变换:
    Y=IXI T
    其中,Y表示整数变换后的数据;X表示整数变换前的数据,也即整数变换前的数据;I表示预先配置的一个可逆且逆矩阵为有理数矩阵的整数矩阵;I T表示I的转置矩阵。
  3. 根据权利要求2所述的数据变换方法,其中,通过如下公式对整数变换后的数据进行逆变换,以恢复出整数变换前的数据:
    X=FYF T
    其中,F表示I的逆矩阵,是一个有理数矩阵;F T表示F的转置矩阵。
  4. 根据权利要求2所述的数据变换方法,其中,通过如下公式对整数变换后的数据进行逆变换,以恢复出整数变换前的数据:
    Figure PCTCN2022132143-appb-100001
    其中,F表示I的逆矩阵,是一个有理数矩阵;N表示与F维度相同的一个整数矩阵,每个元素为n;n为正整数;
    Figure PCTCN2022132143-appb-100002
    表示F和N的克罗内克积,是一个整数矩阵;
    Figure PCTCN2022132143-appb-100003
    表示
    Figure PCTCN2022132143-appb-100004
    的转置矩阵。
  5. 根据权利要求1所述的数据变换方法,其中,所述待变换数据为整形数据,对所述整形数据的正变换和逆变换均为全整数运算的整数变换,所述数据变换方法还包括:
    利用整数矩阵对待变换的整形数据进行全整数运算的整数变换;
    利用对所述整数矩阵的逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行全整 数运算的逆变换,恢复出所述整形数据。
  6. 根据权利要求1所述的数据变换方法,其中,所述待变换数据为浮点数据,所述数据变换方法还包括:
    对待变换的浮点数据进行量化,得到量化后的整形数据;
    利用整数矩阵对量化后的整形数据进行全整数运算的整数变换;
    利用对所述整数矩阵的逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据。
  7. 根据权利要求1所述的数据变换方法,其中,所述待变换数据为浮点数据,所述数据变换方法还包括:
    利用整数矩阵对待变换的浮点数据进行变换,得到变换后的浮点数据;
    利用所述整数矩阵的逆矩阵或对所述整数矩阵的逆矩阵进行整形后的整数矩阵,对变换后的浮点数据进行逆变换,恢复出变换前的浮点数据。
  8. 根据权利要求1所述的数据变换方法,其中,所述待变换数据为浮点数据,所述数据变换方法还包括:
    利用整数矩阵对待变换的浮点数据进行变换,得到变换后的浮点数据;
    对整数变换后的浮点数据进行量化处理;
    对量化处理后的数据进行反量化处理;
    利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对反量化后的浮点数据进行逆变换,恢复出整数变换前的浮点数据。
  9. 根据权利要求1至8中任意一项所述的数据变换方法,其中,所述待变换数据至少包括如下任意之一:图像数据、视频数据、残差数据、特征数据。
  10. 一种数据恢复方法,包括:
    获取待恢复数据,其中,所述待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    利用所述整数矩阵的逆矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
  11. 一种数据恢复方法,包括:
    获取待恢复数据,其中,所述待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    利用对所述逆矩阵进行整形后的整数矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
  12. 一种数据变换装置,包括:
    配置模块,用于获取预先配置的一个整数矩阵,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    变换模块,用于利用所述整数矩阵对待变换数据进行整数变换。
  13. 一种数据恢复装置,包括:
    数据获取模块,用于获取待恢复数据,其中,所述待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    逆变换模块,用于利用所述整数矩阵的逆矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
  14. 一种数据恢复装置,包括:
    数据获取模块,用于获取待恢复数据,其中,所述待恢复数据为利用一个整数矩阵对原始数据进行整数变换后的数据,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    逆变换模块,用于利用对所述逆矩阵进行整形后的整数矩阵,对所述待恢复数据进行逆变换,以恢复出整数变换前的数据。
  15. 一种图像压缩系统,包括:第一编码模块和第一解码模块;
    所述第一编码模块,用于获取预先配置的一个整数矩阵,利用所述整数矩阵对图像数据进行整数变换,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    所述第一解码模块,用于利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的图像数据。
  16. 根据权利要求15所述的图像压缩系统,其中:
    所述第一编码模块还用于,对整数变换后的数据进行编码,将编码后的数据传输至所述第一解码模块;
    所述第一解码模块还用于,对来自第一编码模块的数据进行解码,利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对解码后的数据进行逆变换,恢复出整数变换前的数据。
  17. 根据权利要求16所述的图像压缩系统,其中,所述第一编码模块采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
  18. 一种特征压缩系统,包括:第二编码模块和第二解码模块;
    所述第二编码模块,用于获取预先配置的一个整数矩阵,利用所述整数矩阵对特征数据进行整数变换,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    所述第二解码模块,用于利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据。
  19. 根据权利要求18所述的特征压缩系统,其中:
    所述第二编码模块还用于,对整数变换后的数据进行编码,将编码后的数据传输至所述第二解码模块;
    所述第二解码模块还用于,对来自第二编码模块的数据进行解码,利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对解码后的数据进行逆变换,恢复出整数变换前的数据。
  20. 根据权利要求19所述的特征压缩系统,其中,所述第二编码模块采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
  21. 根据权利要求18所述的特征压缩系统,其中:
    所述第二编码模块还用于,对特征数据进行量化处理,利用所述整数矩阵对量化后的 特征数据进行全整数运算的整数变换;
    所述第二解码模块还用于,利用对所述逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行全整数运算的逆变换,并对逆变换后的数据进行反量化处理,得到原始特征数据。
  22. 根据权利要求18所述的特征压缩系统,其中:
    所述第二编码模块还用于,对特征数据进行整数变换,对整数变换后的特征数据进行量化处理;
    所述第二解码模块还用于,对量化后的特征数据进行反量化处理,利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对反量化处理后的数据进行逆变换,得到原始特征数据。
  23. 一种残差压缩系统,包括:第三编码模块和第三解码模块;
    所述第三编码模块,用于获取预先配置的一个整数矩阵,利用所述整数矩阵对残差数据进行整数变换,其中,所述整数矩阵可逆且逆矩阵为有理数矩阵;
    所述第三解码模块,用于利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对整数变换后的数据进行逆变换,恢复出整数变换前的数据。
  24. 根据权利要求23所述的残差压缩系统,其中:
    所述第三编码模块还用于,对整数变换后的数据进行编码,将编码后的数据传输至所述第三解码模块;
    所述第三解码模块还用于,对来自第三编码模块的数据进行解码,利用所述整数矩阵的逆矩阵或对所述逆矩阵进行整形后的整数矩阵,对解码后的数据进行逆变换,恢复出整数变换前的数据。
  25. 根据权利要求23所述的残差压缩系统,其中,所述第三编码模块采用执行ZigZag扫描的编码方式或不执行ZigZag扫描的编码方式。
  26. 一种电子设备,包括:
    处理器;以及
    存储器,用于存储所述处理器的可执行指令;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1~9中任意一项所述的数据变换方法,或权利要求10或11所述的数据恢复方法。
  27. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1~9中任意一项所述的数据变换方法,或权利要求10或11所述的数据恢复方法。
  28. 一种计算机程序,包括:
    指令,所述指令当由处理器执行时使所述处理器执行如权利要求1~9中任意一项所述的数据变换方法,或权利要求10或11所述的数据恢复方法。
PCT/CN2022/132143 2021-12-28 2022-11-16 数据变换与恢复方法、装置、系统、电子设备及存储介质 Ceased WO2023124602A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111626735.1A CN116366867B (zh) 2021-12-28 2021-12-28 数据变换与恢复方法、装置、系统、电子设备及存储介质
CN202111626735.1 2021-12-28

Publications (1)

Publication Number Publication Date
WO2023124602A1 true WO2023124602A1 (zh) 2023-07-06

Family

ID=86914982

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/132143 Ceased WO2023124602A1 (zh) 2021-12-28 2022-11-16 数据变换与恢复方法、装置、系统、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN116366867B (zh)
WO (1) WO2023124602A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101261619A (zh) * 2001-08-30 2008-09-10 诺基亚有限公司 变换及后续量化的实现
CN102036063A (zh) * 2009-09-29 2011-04-27 北京中星微电子有限公司 一种用于编码解码的图像变换方法及装置
WO2011133008A2 (ko) * 2010-04-23 2011-10-27 삼성전자 주식회사 영상의 변환 방법 및 장치, 역변환 방법 및 장치
CN103125116A (zh) * 2010-09-28 2013-05-29 三星电子株式会社 视频编码方法和装置以及解码方法和装置
CN113439441A (zh) * 2019-02-15 2021-09-24 北京字节跳动网络技术有限公司 基于块分割的变换参数推导

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1210960C (zh) * 2003-07-03 2005-07-13 浙江大学 运用于图像编码和视频编码的8×8整数变换方法和装置
CN102413331A (zh) * 2011-12-01 2012-04-11 上海大学 图像或视频的编码方法
US8719321B2 (en) * 2011-12-11 2014-05-06 Hong Kong Applied Science and Technology Research Institute Company Limited Adaptive block-size transform using LLMICT

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101261619A (zh) * 2001-08-30 2008-09-10 诺基亚有限公司 变换及后续量化的实现
CN102036063A (zh) * 2009-09-29 2011-04-27 北京中星微电子有限公司 一种用于编码解码的图像变换方法及装置
WO2011133008A2 (ko) * 2010-04-23 2011-10-27 삼성전자 주식회사 영상의 변환 방법 및 장치, 역변환 방법 및 장치
CN103125116A (zh) * 2010-09-28 2013-05-29 三星电子株式会社 视频编码方法和装置以及解码方法和装置
CN113439441A (zh) * 2019-02-15 2021-09-24 北京字节跳动网络技术有限公司 基于块分割的变换参数推导

Also Published As

Publication number Publication date
CN116366867A (zh) 2023-06-30
CN116366867B (zh) 2024-11-19

Similar Documents

Publication Publication Date Title
US10909728B1 (en) Learned lossy image compression codec
WO2023159820A1 (zh) 图像压缩方法、图像解压缩方法及装置
WO2021031877A1 (zh) 图像编解码的方法、装置和芯片
CN113592966B (zh) 图像处理方法及装置、电子设备和存储介质
CN115866253B (zh) 一种基于自调制的通道间变换方法、装置、终端及介质
WO2023045420A1 (zh) 图像处理方法及装置、电子设备和存储介质
JP2025506961A (ja) 視覚データ処理のための方法、装置、及び媒体
CN116389752A (zh) 视频编码方法及装置、视频解码方法及装置、电子设备
US12149265B2 (en) Efficient update of cumulative distribution functions for image compression
CN114286113B (zh) 基于多头异构卷积自编码器的图像压缩恢复方法及系统
CN105163130B (zh) 一种基于离散Tchebichef正交多项式的图像无损压缩方法
CN109474826B (zh) 图片压缩方法、装置、电子设备及存储介质
WO2023124602A1 (zh) 数据变换与恢复方法、装置、系统、电子设备及存储介质
CN113949867B (zh) 一种图像处理的方法及装置
CN114827289A (zh) 一种通信压缩方法、系统、电子装置和存储介质
CN116566397A (zh) 编码、解码方法、编码器、解码器、电子设备及存储介质
CN115623207B (zh) 一种基于多进多出技术的数据传输方法及相关设备
Al-hamid et al. Optimized Image Compression Techniques for the Embedded Processors
CN115499664A (zh) 视频编码方法、视频解码方法以及编码端或/和解码端
CN116233471A (zh) 基于渲染和传统编码相结合的图像或视频压缩方法及装置
CN109756735A (zh) 用于视频播放的方法及装置
CN116366070B (zh) 小波系数编码方法、装置、系统、设备及介质
CN116418997A (zh) 特征数据压缩方法、装置、系统、电子设备及存储介质
US10628165B2 (en) Gain control for multiple description coding
CN115174908B (zh) 视频编码的变换量化方法、装置、设备以及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22913861

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22913861

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 15/10/2024)

122 Ep: pct application non-entry in european phase

Ref document number: 22913861

Country of ref document: EP

Kind code of ref document: A1