Computer data compression and reconstruction method based on matrix decomposition
By combining a matrix factorization-based method with integer-constrained image processing steps, the problems of computational difficulty and reduced reconstruction quality in lossy image compression are solved, achieving stable and efficient image reconstruction at ultra-low bitrates.
Patent Information
- Application Number
- CN202511629474.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-02-13
AI Technical Summary
In existing technologies for lossy image compression, discrete direct embedding transformation and decomposition lead to increased computational difficulty and decreased reconstruction quality, failing to effectively reduce errors.
A matrix factorization-based method is adopted, which involves color transformation and chroma downsampling, block division and matrix assembly, low-rank approximation of discrete sensing, factor packing and lossless compression, lossless decoding and factor recovery, reconstruction and inverse transformation. Integer constraints are introduced during the optimization process to avoid discrete steps and directly perform lossless compression.
It achieves stable and efficient image reconstruction in ultra-low bitrate scenarios, reduces reconstruction errors, and is suitable for data compression and reconstruction in ultra-low bitrate scenarios.
Smart Images

Figure CN121531132A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer data processing, in particular to a computer data compression and reconstruction method based on matrix decomposition. BACKGROUND
[0002] Lossy compression is widely used in streaming media scenarios, which can adjust between volume and quality, represent data as low rank or sparse structure at compression end, only keep the most important singular values, eigenvectors or sparse coefficients, greatly reduce storage and transmission volume, at reconstruction end, multiply these few reserved parameters with basis to restore approximate original data, and can combine priori (such as non-negativity, sparsity, low rank constraint) and regularization to suppress noise and complete missing.
[0003] Matrix decomposition is to decompose a complex matrix into several simpler matrices for calculation, understanding structure, data compression or subsequent analysis. Traditional image lossy compression such as discrete cosine transform (DCT) and singular value decomposition (SVD) first transform and decompose the original image into a better coordinate system, and then discretize all values to grid points, the discretization error cannot be perceived and weighed in transformation and decomposition, resulting in significant degradation of picture reconstruction quality.
[0004] If the discretization is directly embedded in the transformation and decomposition in the prior art, the problem will change from smooth and derivable continuous optimization to non-convex combination optimization with integer bounded constraints, the closed-form solution and conventional gradient method fail, and the calculation difficulty and convergence analysis increase sharply. Therefore, it is necessary to design a computer data compression and reconstruction method based on matrix decomposition to reduce error. SUMMARY
[0005] The present application aims to provide a computer data compression and reconstruction method based on matrix decomposition to solve the problems in the background art.
[0006] In order to solve the above technical problems, the present application provides the following technical scheme: a computer data compression and reconstruction method based on matrix decomposition, comprising S1, color transformation and chroma downsampling: converting the image from RGB to YCbCr to reduce the correlation between channels, downsampling the chroma channel by a set ratio, preferentially preserving the brightness details, and synchronously generating a parameter table to record the image size, downsampling ratio and integer boundary information; S2, block division and matrix assembly: dividing each channel into small blocks of fixed size and flattening them into vectors, stacking them by block as row to form a channel-level observation matrix, while preserving the block index, setting the rank or quality factor as the code rate control quantity, and writing it into the parameter table; S3. Low-rank approximation of discrete sensing: Solve the low-rank representation of X as approximately equal to the transpose of U and V in the bounded integer field. The elements of U and V are constrained by integer boundaries. The column vector is updated alternately by block coordinate descent. First, the continuous optimum is found, and then the elements are rounded down and truncated to the interval, thereby monotonically reducing the reconstruction error. The truncated singular value decomposition projection is used as the initialization to improve the convergence speed and stability. S4. Factor Packaging and Lossless Compression: Pack integer factors and parameter tables into structured data or factor graph representation, perform lossless entropy encoding on the integer stream to reduce the bit rate, record fragment boundaries and verification information to ensure that the bit stream can be correctly parsed; S5. Lossless Decoding and Factor Recovery: Lossless decoding of the bitstream, recovery of U and V and parameter tables, verification of consistency and reconstruction of channel-level matrix and block index, and preparation of integer-to-pixel scaling factors for reconstruction. S6. Reconstruction and Inverse Transformation: Calculate the approximate matrix of each channel by multiplying U by the transpose of V, and backfill the row blocks to the corresponding image positions. Upsample the chroma channel and combine it with the luminance channel. Perform inverse color space transformation to obtain the reconstructed image and output it.
[0007] According to the above technical solution, S1 specifically refers to: S1-1, Input is an 8-bit color image tensor The channel order is RGB. Subsequent steps rely only on pixel intensity and size information. Resolution and bit depth metadata are recorded in the parameter table and carried with the bitstream for decoding consistency verification. This stage only reads and does not modify pixel bits, and does not involve any discretization or rounding operations, linearly transforming RGB to luminance. Blueness component Redness component Three components, ,in Given a 3×3 real matrix, where b is the bias vector, after transformation... , , ,in , These are the height and width of the original image, respectively; S1-2, to , Spatial downsampling using average pooling is performed with a 2x2 kernel size and a 2x2 stride. The formula is , Similarly, after downsampling Size retention , , The size becomes The three component values are still... It allows real numbers and outputs three components. The parameter table should be used to register the color space type, whether to enable chroma downsampling, pooling kernel and stride, original size and downsampled size.
[0008] According to the above technical solution, S2 specifically refers to: S2-1. Based on the three-way matrix of S1, determine the block size. If a dimension is not a multiple of 8, mirror padding is performed first to reach the nearest multiple of 8. This ensures that each subsequent channel can be completely divided into non-overlapping 8×8 blocks, avoiding cross-block alignment errors. The following steps are performed on the three matrices: the entire image is divided into non-overlapping 8×8 blocks. If mirror padding was performed in the previous step, this step divides the image into blocks based on the padded dimensions. Each 8×8 block is flattened into row vectors of length 64 in a predetermined order. The flattening order must be consistent at the decoding end. All row vectors are stacked row by row to obtain the three-way observation matrix. , , The number of rows is equal to the number of blocks (i.e., pixels) in the corresponding channel divided by 64, and the number of columns is always 64. S2-2. Generate and save parameters: block size, whether to use mirror fill and its boundary width, flattening order, and original dimensions. Based on the downsampling size, a block index mapping table is established to record the channel and top-left corner coordinates of the block corresponding to each row of block vectors in the original image. Check if the number of rows in the three matrices are equal to... and Check if the number of columns is always 64; if it does not match the record, stop encoding and report an error, outputting... The three observation matrices and their associated parameters include block size, flattening order, filling information, and size-index mapping.
[0009] According to the above technical solution, S3 specifically refers to: S3-1. Approximate each observation matrix produced by S2 with a low-rank approximation, and then abstract it uniformly to a given... , in order Integer bounded factor representation The original matrix is approximated by multiplying two smaller factor matrices, where the lower-rank factor matrix is... Low-rank factor matrix Then the discrete optimization formula is: , , ,in Given an integer interval, we first use the low-rank decomposition of the continuous field to obtain an ideal initial solution of real numbers. Then, we round each element of the initial solution to the preset integer boundary to obtain an integer and bounded initial value. This transforms the discrete value into a feasible region constraint that the factor elements must fall within the specified integer interval. In the optimization, we weigh the discrete error against the approximation error. S3-2. Update only one column vector at a time, keeping the rest fixed. First, update all columns... Update it again, then change all columns. Update once, repeating the process until convergence or the iteration limit is reached. Each update is equivalent to solving a rank-one approximation subproblem, and the result is projected back to the integer interval after the update. The closed-form column update formula is: , The projection is performed by rounding each element and truncating the interval to achieve bounded integer projection. Two types of stopping conditions are used: first, the relative decrease of the objective function is lower than the threshold; second, the maximum number of iterations is reached. In implementation, a small amount of intermediate quantity is cached to avoid explicit recalculation of large residual matrices, thereby further speeding up the process while maintaining monotonicity. The overall iteration cost is comparable to matrix multiplication. Each channel will obtain a pair of bounded integer factor matrices and metadata such as rank, boundary, and number of iterations. The decoding end only needs to perform lossless decoding and restore the image by matrix multiplication, and then use the subsequent reverse process to restore the image.
[0010] According to the above technical solution, S4 specifically refers to: S4-1. After the discrete perceptual decomposition in S3, the integer bounded factor matrix is directly obtained, and each channel has a pair of basis matrices. With sparse matrices Without needing to perform independent discretization, it enters the lossless compression process, compressing each channel... and The data is written into the bitstream in the form of an integer array in a predetermined order. Then, a general lossless compression library is called to compress and encapsulate the data, recording the channel order, matrix shape, rank, integer boundaries and data block offsets to ensure that the decoding end restores each factor block in a one-to-one correspondence. S4-2. Save the color space type and chroma downsampling strategy, block size and boundary mirroring method, flattening order, rank, integer boundary, shape and channel identifier of the three pairs of factors, as well as the length and verification of each data segment along with the bitstream. During encapsulation, the three pairs of factors are written in segments and compressed separately to support random positioning and parallel decoding. The decoding end recovers in reverse order starting from the outermost layer - first decompressing without loss to obtain the factors.
[0011] According to the above technical solution, S5 specifically refers to: S5-1. Read the parameter table and decompress the corresponding brightness values segment by segment. Blueness component Redness component Basis matrix and sparse matrix of three channels , , Perform a consistency check on the solved factors: the data type is integer, and the values are all within... The internal dimensions are consistent with the parameter table. Using the channel as the unit, the block-level approximate matrix of the channel is synthesized by using the solved bounded integer factors and the corresponding template information. The synthesis here strictly corresponds to the low-rank representation at the encoding end, but no new discretization is introduced. S5-2. Reshape the block-level approximation matrix of each channel into fixed-size blocks in a predetermined order, and backfill them to the corresponding planar positions according to the block index. If the encoding end performed mirror filling for alignment, crop it according to the original resolution after backfilling to restore the true boundary. Perform the upsampling strategy corresponding to the encoding end on the two chroma planes to make their spatial size consistent with the luminance plane. Use nearest neighbor interpolation to ensure strict symmetry with the average pooling of the encoding end. Combine the luminance and the two chroma planes into the target color space according to the reverse process of the encoding end, and then convert it back to the standard three-channel color image. This inverse transformation is the opposite of the linear transformation of the encoding end. Crop the result in intervals and round it to eight bits to ensure compatibility with common image containers.
[0012] According to the above technical solution, S6 specifically refers to: S6-1, Using the integer factors of the lossless recovery from S5 as input, calculate channel by channel. , , The three products are the block-level approximation matrix of luminance and downsampled chrominance. The number of rows equals the number of luminance blocks. The number of rows is 64, and the same applies to the chroma channels. Multiplication is performed only after ensuring the inner product dimension matches, restoring the discrete integer factors to a continuous patch matrix. This is the only source of loss in the entire decoding chain. , , Each row is reshaped into 8x8 blocks in a predetermined order; this step is the strict inverse of the S2 flattening and stacking process. Based on the block index mapping table, the blocks are backfilled into the luminance and chrominance planes according to their top-left corner coordinates. If the encoding end has performed mirror padding on the boundaries, they are trimmed to their original size here. After backfilling, the Y and downsampling dimensions are obtained. , A two-dimensional image plane; S6-2, Upsample the two chroma pixels from the row-by-column bisector size back to the original row-by-column size; use nearest neighbor interpolation, that is, copy each chroma pixel into a 2x2 block, which is structurally dual to the average pooling at the encoding end, and then apply the upsampled chroma pixels. , satisfy , , Upsampling only copies pixels, does not introduce new floating-point operation errors, and maintains pixel alignment with the brightness plane. Performing the inverse linear transformation, which is the opposite of S1, yields RGB. This generates the final RGB eight-bit image.
[0013] According to the above technical solution, this method employs a data compression and reconstruction system, which includes: Input Parameter Module: Receives images and configurations, generates parameter tables for color mode, downsampling, rank, and integer boundaries, and supports basic consistency checks; Color Variable Downsampling Module: Converts RGB to Y, Cb, Cr, and performs double downsampling on the chromaticity components to reduce entropy, maintaining pixel values as real numbers; Block Flattening Module: Flattens the block vectors in parallel to a length of 64 rows using an 8x8 non-overlapping block method, recording the block index; Matrix Assembly Module: Stacks the block vectors into a channel matrix, outputting the number of rows, columns, and block position mappings; Integer Low-Rank Solving Module: Solves for X in the bounded integer domain, alternately updates and projects it onto the integer interval, outputting U, V, and error; Factor Encapsulation and Compression Module: Encapsulates U, V, and the parameter table into a structured bitstream and performs lossless entropy encoding, generating verification information; Storage and Transmission Interface Module: Writes the bitstream to non-volatile memory or transmits it via bus, supporting DMA transfer and bandwidth arbitration; Lossless Decoding and Recovery Module: Losslessly decompresses the bitstream and recovers U, V, and the parameter table, performing consistency and verification checks; Channel Reconstruction and Backfilling Module: Calculates UV The row vectors are restored to 8×8 blocks according to the index and backfilled into the channel plane, with the filling boundaries trimmed as needed; the chroma upsampling inverse color module performs nearest-neighbor double upsampling on the chroma components and inversely transforms Y, Cb, and Cr to RGB, keeping the numerical range valid; the output display file module rounds the RGB values and truncates them to 8 bits, outputting them to the display or writing them to an image file; the bitrate quality scheduling module sets the rank, iteration rounds, and integer boundaries according to the target bpp or quality factor, and uniformly distributes them to the encoding and decoding link.
[0014] Compared with existing technologies, the beneficial effects achieved by this invention are as follows: This invention proposes a matrix factorization based on discrete perception, which directly incorporates the discrete constraint that the factors are integers and fall within a bounded interval into the low-rank approximation optimization problem. The optimization process learns to approximate the image block matrix using integer blocks, and incorporates the discrete processes of rounding and truncation into the optimization model itself. The optimization process automatically balances accuracy and storability, eliminating the need for a separate discrete step. During encoding, it can be directly treated as an integer array for lossless compression. This results in both low compression and stable reconstruction of the main information, making it particularly suitable for ultra-low bitrate scenarios. Attached Figure Description
[0015] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the overall modular structure of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Please see Figure 1 The present invention provides a technical solution: a computer data compression and reconstruction method based on matrix factorization, including S1, color transformation and chromaticity downsampling: converting the image from RGB to YCbCr to reduce the correlation between channels, downsampling the chromaticity channel according to a set ratio, prioritizing the preservation of brightness details, and simultaneously generating a parameter table to record the image size, downsampling ratio and integer boundary information; S2, Blocking and Matrix Assembly: Divide each channel into small blocks of fixed size and flatten them into vectors. Stack the blocks as rows to form a channel-level observation matrix. At the same time, retain the block index, set the rank or quality factor as the bitrate control quantity, and write it into the parameter table. S3. Low-rank approximation of discrete sensing: Solve the low-rank representation of X as approximately equal to the transpose of U and V in the bounded integer field. The elements of U and V are constrained by integer boundaries. The column vector is updated alternately by block coordinate descent. First, the continuous optimum is found, and then the elements are rounded down and truncated to the interval, thereby monotonically reducing the reconstruction error. The truncated singular value decomposition projection is used as the initialization to improve the convergence speed and stability. S4. Factor Packaging and Lossless Compression: Pack integer factors and parameter tables into structured data or factor graph representation, perform lossless entropy encoding on the integer stream to reduce the bit rate, record fragment boundaries and verification information to ensure that the bit stream can be correctly parsed; S5. Lossless Decoding and Factor Recovery: Lossless decoding of the bitstream, recovery of U and V and parameter tables, verification of consistency and reconstruction of channel-level matrix and block index, and preparation of integer-to-pixel scaling factors for reconstruction. S6. Reconstruction and Inverse Transformation: Calculate the approximate matrix of each channel by multiplying U by V transpose, and backfill the row blocks to the corresponding image positions. Upsample the chroma channel and combine it with the luminance channel. Perform inverse color space transformation to obtain the reconstructed image and output it. S1 specifically refers to: S1-1, Input is an 8-bit color image tensor The channel order is RGB. Subsequent steps rely only on pixel intensity and size information. Resolution and bit depth metadata are recorded in the parameter table and carried with the bitstream for decoding consistency verification. This stage only reads and does not modify pixel bits, and does not involve any discretization or rounding operations, linearly transforming RGB to luminance. Blueness component Redness component Three components, ,in Given a 3×3 real matrix, where b is the bias vector, after transformation... , , ,in , These represent the height and width of the original image, respectively; channel decorrelation is used to reduce entropy for the subsequent low-rank representation, avoiding the introduction of bias by premature discretization in the pixel domain.
[0018] This step linearly transforms the input eight-bit color image from RGB to luminance Y and two chrominance channels Cb and Cr in channel order, and writes metadata such as the transformation matrix A, bias b, original height H and width W into the parameter table. Note that this step only performs linear transformation and does not discretize, and the values can be real numbers. Any subsequent truncation and rounding are completed in the factor domain to ensure that pixel domain statistics are not distorted prematurely.
[0019] S1-2, to , Spatial downsampling using average pooling is performed with a 2x2 kernel size and a 2x2 stride. The formula is , Similarly, after downsampling Size retention , , The size becomes The three component values are still... It allows real numbers and outputs three components. The color space type, whether to enable chroma downsampling, pooling kernel and stride, original size and downsampled size are registered in the parameter table. It sacrifices chroma details slightly to achieve significant entropy reduction, ensuring that the decoder can completely reproduce the data according to the parameter table.
[0020] This step performs spatial downsampling of Cb and Cr using average pooling with a 2x2 kernel and a 2x2 stride to obtain a chromaticity plane of size H multiplied by W. At the same time, the parameter table records whether downsampling and kernel stride configuration are enabled. Downsampling only applies to chromaticity, making full use of the prior perception that the human eye is more sensitive to brightness, reducing entropy from the source and providing cleaner input for subsequent block division and low-rank approximation.
[0021] S2 specifically refers to: S2-1. Based on the three-way matrix of S1, determine the block size. If a dimension is not a multiple of 8, mirror padding is performed first to reach the nearest multiple of 8. This ensures that each subsequent channel can be completely divided into non-overlapping 8×8 blocks, avoiding cross-block alignment errors. The following steps are performed on the three matrices: the entire image is divided into non-overlapping 8×8 blocks. If mirror padding was performed in the previous step, this step divides the image into blocks based on the padded dimensions. Each 8×8 block is flattened into row vectors of length 64 in a predetermined order. The flattening order must be consistent at the decoding end. All row vectors are stacked row by row to obtain the three-way observation matrix. , , The number of rows is equal to the number of blocks (i.e., pixels) in the corresponding channel divided by 64, and the number of columns is always 64; this ensures block alignment and shape consistency, so that subsequent matrix decomposition is performed on a unified dimension.
[0022] This step divides Y and the downsampled Cb and Cr into non-overlapping 8x8 blocks. If the size is not an integer multiple of 8, first perform boundary mirroring to make it divisible. Then, flatten each block into a row vector of length 64 in a predetermined order and stack them vertically to form the observation matrix XY, XCB, XCR. Note that the uniform flattening order and block alignment are the key to subsequent reversible backfilling and need to be fixed in the parameter table.
[0023] S2-2. Generate and save parameters: block size, whether to use mirror fill and its boundary width, flattening order, and original dimensions. Based on the downsampling size, a block index mapping table is established to record the channel and top-left corner coordinates of the block corresponding to each row of block vectors in the original image. Check if the number of rows in the three matrices are equal to... and Check if the number of columns is always 64; if it does not match the record, stop encoding and report an error, outputting... Three observation matrices and corresponding parameters for block size, flattening order, filling information, and size-index mapping; providing location information and rules for reversible rearrangement to ensure unambiguous backfilling during reconstruction.
[0024] This step generates and saves parameters such as block size, whether to use mirror padding and width, flattening order, original and downsampled dimensions, etc. At the same time, a block index mapping table is established to record the coordinates of the top left corner of each row of block vectors in the original image. Before proceeding to the next step, a size consistency check is performed to ensure that the number of rows and columns of the three matrices are completely consistent with the records. Otherwise, encoding is stopped and an error is reported to ensure that the decoding end can reversibly rearrange without ambiguity.
[0025] S3 specifically refers to: S3-1. Approximate each observation matrix produced by S2 with a low-rank approximation, and then abstract it uniformly to a given... , in order Integer bounded factor representation The original matrix is approximated by multiplying two smaller factor matrices, where the lower-rank factor matrix is... Low-rank factor matrix Then the discrete optimization formula is: , , ,in Given an integer interval, we first use low-rank decomposition of the continuous field to obtain an ideal initial real solution. Then, we round each element of the initial solution to the preset integer boundary to obtain an integer and bounded initial value. We transform the discrete value into a feasible region constraint that the factor elements must fall within the specified integer interval. In the optimization, we weigh the discrete error against the approximation error. We incorporate the discrete value into the feasible region and use integer factors to directly carry the compression and error trade-off.
[0026] This step solves for the integer bounded low-rank representation of the observation matrix Xc for each channel, given the rank Rc and integer boundaries α and β. Xc is approximately equal to the transpose of Uc multiplied by Vc, where Uc belongs to the integer interval matrix Mc multiplied by Rc and Vc belongs to the integer interval matrix 64 multiplied by Rc. The key point of this step is to incorporate the quantization as a factor element into the feasible region of the interval [α, β] into the optimization, and it is suggested to obtain integer initial values by truncating the symmetric initial values of singular value decomposition through round and clamp projection to speed up convergence.
[0027] S3-2. Update only one column vector at a time, keeping the rest fixed. First, update all columns... Update it again, then change all columns. Update once, repeating the process until convergence or the iteration limit is reached. Each update is equivalent to solving a rank-one approximation subproblem, and the result is projected back to the integer interval after the update. The closed-form column update formula is: , The projection is performed by rounding and truncating each element, achieving bounded integer projection. Two stopping conditions are used: first, the relative decrease of the objective function is lower than a threshold; second, the maximum number of iterations is reached. In implementation, a small amount of intermediate data is cached to avoid explicit recalculation of large residual matrices, thereby further speeding up the process while maintaining monotonicity. The overall iteration cost is comparable to matrix multiplication. Each channel will receive a pair of bounded integer factor matrices and metadata such as rank, boundary, and iteration number. The decoding end only needs to perform lossless decoding and restore the image by matrix multiplication, and then use the subsequent reverse process to restore the image. The continuous optimal value is first found, and then round + clamp projection is performed. The objective function is monotonically non-increasing and converges.
[0028] This step uses block coordinate descent to alternately update U and V column by column: each time, with another factor fixed, the continuous optimal closed-form solution is obtained for a single column, and then rounding and interval truncation projection are performed element by element to ensure that the target value is monotonically non-increasing and stops when the maximum number of iterations or the relative descent threshold is met; the key point is to clarify the stopping criteria and the handling details of abnormal denominators, and record the final U, V, Rc, α, β and the number of iterations for comparison at the decoding end.
[0029] S4 specifically refers to: S4-1. After the discrete perceptual decomposition in S3, the integer bounded factor matrix is directly obtained, and each channel has a pair of basis matrices. With sparse matrices Without needing to perform independent discretization, it enters the lossless compression process, compressing each channel... and The data is written into the bitstream in a predetermined order as an integer array, and then a general lossless compression library is called to compress and encapsulate it. The channel order, matrix shape, rank, integer boundary and data block offset are recorded to ensure that the decoding end restores each factor block in a one-to-one correspondence; to avoid secondary discretization, and to ensure that the decoding end restores each factor block in a one-to-one correspondence.
[0030] This step directly writes the pair of bounded integer factors U and V obtained from each channel into the bitstream as an integer array and encapsulates them using general lossless compression. At the same time, it records the channel order, matrix shape, rank, integer boundaries, and offsets of each data segment. No independent quantization step is performed, thereby avoiding secondary quantization errors and creating conditions for the decoding end to achieve one-to-one factor recovery.
[0031] S4-2. The color space type, chroma downsampling strategy, block size and boundary mirroring method, flattening order, rank, integer boundary, shape and channel identifier of the three pairs of factors, as well as the length and verification of each data segment are saved with the bitstream. During encapsulation, the three pairs of factors are written in segments and compressed separately to support random positioning and parallel decoding. The decoding end recovers in reverse order from the outermost layer - first decompressing without loss to obtain the factors; metadata out-of-band and segmented encapsulation facilitate random positioning and improve the system decoding throughput.
[0032] This step saves the color space type, chroma downsampling strategy, block size and mirror fill method, flattening order, rank and integer boundaries of each channel, shape and channel identifier of the three pairs of factors, as well as the length and checksum of each data segment along with the bitstream. The three pairs of factors are written in segments and compressed separately to support random positioning and parallel decoding. The integrity of the metadata directly determines the reproducibility and throughput of the decoding.
[0033] S5 specifically refers to: S5-1. Read the parameter table and decompress the corresponding brightness values segment by segment. Blueness component Redness component Basis matrix and sparse matrix of three channels , , Perform a consistency check on the solved factors: the data type is integer, and the values are all within... The internal dimensions are consistent with the parameter table. Using channels as units, the block-level approximate matrix of the channel is synthesized using the solved bounded integer factors and the corresponding template information. The synthesis here strictly corresponds to the low-rank representation at the encoding end, but no new discretization is introduced. Only product reconstruction is performed without introducing new discretization errors, ensuring end-to-end consistency.
[0034] In this step, the decoding end decompresses three pairs of factors segment by segment according to the parameter table without loss and performs consistency verification to confirm that the data type is integer, the value falls within [α, β], and the size is consistent with the record. Then, the block-level approximate matrix of the channel is synthesized by multiplying U by the transpose of V in units of the channel. This step only performs product reconstruction and does not introduce new quantization to ensure end-to-end consistency.
[0035] S5-2. Reshape the block-level approximation matrix of each channel into fixed-size blocks in a predetermined order, and backfill them to the corresponding planar positions according to the block index. If the encoding end performed mirror filling for alignment, crop it according to the original resolution after backfilling to restore the true boundary. Perform the upsampling strategy corresponding to the encoding end on the two chroma planes to make their spatial size consistent with the luminance plane. Use nearest neighbor interpolation to ensure strict symmetry with the average pooling of the encoding end. Combine the luminance and the two chroma planes into the target color space according to the reverse process of the encoding end, and then convert it back to the standard three-channel color image. This inverse transformation is the inverse process of the linear transformation of the encoding end. Crop the result in intervals and round it to eight bits to ensure compatibility with common image containers. Inversely, dualize with the encoding end to ensure the reproducibility of spatial alignment and color restoration.
[0036] This step reshapes the block-level approximation matrix of each channel into eight-by-eight blocks in a pre-defined order and backfills them into the corresponding plane based on the block index. If mirror filling has been performed on the encoding side, the boundaries are clipped at the original resolution after backfilling. Then, the two chromaticity channels are upsampled twice using the nearest neighbor method to make them consistent with the size of the luminance space. Finally, the target color space is synthesized according to the reverse process of the encoding side and prepared to return to the standard three-channel color image. The upsampling method must be dual with the average pooling structure on the encoding side to ensure that the space and color path are strictly consistent.
[0037] S6 specifically refers to: S6-1, Using the integer factors of the lossless recovery from S5 as input, calculate channel by channel. , , The three products are the block-level approximation matrix of luminance and downsampled chrominance. The number of rows equals the number of luminance blocks. The number of rows is 64, and the same applies to the chroma channels. Multiplication is performed only after ensuring the inner product dimension matches, restoring the discrete integer factors to a continuous patch matrix. This is the only source of loss in the entire decoding chain. , , Each row is reshaped into 8x8 blocks in a predetermined order; this step is the strict inverse of the S2 flattening and stacking process. Based on the block index mapping table, the blocks are backfilled into the luminance and chrominance planes according to their top-left corner coordinates. If the encoding end has performed mirror padding on the boundaries, they are trimmed to their original size here. After backfilling, the Y and downsampling dimensions are obtained. , The two-dimensional image plane; restoring integer factors to continuous domain patches is the only source of loss in the decoding link.
[0038] This step takes the integer factors recovered by S5 as input, calculates the transpose of U by V for each channel to obtain the block-level approximate matrix of luminance and downsampled chrominance, and then reshapes each row into eight-by-eight blocks in a predetermined order and backfills them into the plane according to the index. If there is mirror padding at the encoding end, it is clipped to the original size after backfilling. This step restores the integer factors to the continuous field patch matrix, and it is necessary to ensure the inner product dimension matching and index consistency.
[0039] S6-2, Upsample the two chroma pixels from the row-by-column bisector size back to the original row-by-column size; use nearest neighbor interpolation, that is, copy each chroma pixel into a 2x2 block, which is structurally dual to the average pooling at the encoding end, and then apply the upsampled chroma pixels. , satisfy , , Upsampling only copies pixels, does not introduce new floating-point operation errors, and maintains pixel alignment with the brightness plane. Performing the inverse linear transformation, which is the opposite of S1, yields RGB. The final RGB eight-bit image is generated; the upsampling and average pooling structures are dual, the inverse color change resets the visual field and is compatible with common containers.
[0040] This step upsamples the two chromaticity channels from a size of row-by-row multiplication to the same resolution as the luminance, uses nearest-neighbor copying to avoid new floating-point errors, and then performs the inverse color transformation opposite to S1 to obtain a three-channel eight-bit image and performs range cropping and rounding on the values; the upsampling and inverse color transformation operators and parameters must be strictly aligned with the records at the encoding end, and the output is compatible with common containers.
[0041] This method employs a data compression and reconstruction system, which includes: Input Parameter Module: Receives images and configurations, generates parameter tables for color mode, downsampling, rank, and integer boundaries, and supports basic consistency checks; Color Variable Downsampling Module: Converts RGB to Y, Cb, Cr, and performs double downsampling on the chromaticity components to reduce entropy, maintaining pixel values as real numbers; Block Flattening Module: Flattens the block vectors in parallel to a length of 64 rows using an 8x8 non-overlapping block method, recording the block index; Matrix Assembly Module: Stacks the block vectors into a channel matrix, outputting the number of rows, columns, and block position mappings; Integer Low-Rank Solving Module: Solves for X in the bounded integer domain, alternately updates and projects it onto the integer interval, outputting U, V, and error; Factor Encapsulation and Compression Module: Encapsulates U, V, and the parameter table into a structured bitstream and performs lossless entropy encoding, generating verification information; Storage and Transmission Interface Module: Writes the bitstream to non-volatile memory or transmits it via bus, supporting DMA transfer and bandwidth arbitration; Lossless Decoding and Recovery Module: Losslessly decompresses the bitstream and recovers U, V, and the parameter table, performing consistency and verification checks; Channel Reconstruction and Backfilling Module: Calculates UV The row vectors are restored to 8×8 blocks according to the index and backfilled into the channel plane, with the filling boundaries trimmed as needed; the chroma upsampling inverse color module performs nearest-neighbor double upsampling on the chroma components and inversely transforms Y, Cb, and Cr to RGB, keeping the numerical range valid; the output display file module rounds the RGB values and truncates them to 8 bits, outputting them to the display or writing them to an image file; the bitrate quality scheduling module sets the rank, iteration rounds, and integer boundaries according to the target bpp or quality factor, and uniformly distributes them to the encoding and decoding link.
[0042] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0043] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A computer data compression and reconstruction method based on matrix factorization, characterized in that: include: S1. Color Transformation and Chromaticity Downsampling: Convert the image from RGB to YCbCr to reduce the correlation between channels, downsample the chroma channel according to a set ratio, prioritize the preservation of luminance details, and simultaneously generate a parameter table to record the image size, downsampling ratio, and integer boundary information. S2, Blocking and Matrix Assembly: Divide each channel into small blocks of fixed size and flatten them into vectors. Stack the blocks as rows to form a channel-level observation matrix. At the same time, retain the block index, set the rank or quality factor as the bitrate control quantity, and write it into the parameter table. S3. Low-rank approximation of discrete sensing: Solve the low-rank representation of X as approximately equal to the transpose of U and V in the bounded integer field. The elements of U and V are constrained by integer boundaries. The column vector is updated alternately by block coordinate descent. First, the continuous optimum is found, and then the elements are rounded down and truncated to the interval, thereby monotonically reducing the reconstruction error. The truncated singular value decomposition projection is used as the initialization to improve the convergence speed and stability. S4. Factor Packaging and Lossless Compression: Pack integer factors and parameter tables into structured data or factor graph representation, perform lossless entropy encoding on the integer stream to reduce the bit rate, record fragment boundaries and verification information to ensure that the bit stream can be correctly parsed; S5. Lossless Decoding and Factor Recovery: Lossless decoding of the bitstream, recovery of U and V and parameter tables, verification of consistency and reconstruction of channel-level matrix and block index, and preparation of integer-to-pixel scaling factors for reconstruction. S6. Reconstruction and Inverse Transformation: Calculate the approximate matrix of each channel by multiplying U by the transpose of V, and backfill the row blocks to the corresponding image positions. Upsample the chroma channel and combine it with the luminance channel. Perform inverse color space transformation to obtain the reconstructed image and output it.
2. The computer data compression and reconstruction method based on matrix factorization according to claim 1, characterized in that: Specifically, S1 is: S1-1, Input is an 8-bit color image tensor The channel order is RGB. Subsequent steps rely only on pixel intensity and size information. Resolution and bit depth metadata are recorded in the parameter table and carried with the bitstream for decoding consistency verification. This stage only reads and does not modify pixel bits, and does not involve any discretization or rounding operations, linearly transforming RGB to luminance. Blueness component Redness component Three components, ,in Given a 3×3 real matrix, where b is the bias vector, after transformation... , , ,in , These are the height and width of the original image, respectively; S1-2, to , Spatial downsampling using average pooling is performed with a 2x2 kernel size and a 2x2 stride. The formula is , Similarly, after downsampling Size retention , , The size becomes The three component values are still... It allows real numbers and outputs three components. The parameter table should be used to register the color space type, whether to enable chroma downsampling, pooling kernel and stride, original size and downsampled size.
3. The computer data compression and reconstruction method based on matrix factorization according to claim 2, characterized in that: Specifically, S2 is: S2-1. Based on the three-way matrix of S1, determine the block size. If a dimension is not a multiple of 8, mirror padding is performed first to reach the nearest multiple of 8. This ensures that each subsequent channel can be completely divided into 8×8 non-overlapping blocks, avoiding cross-block alignment errors. The following steps are performed on the three matrices: the entire image is divided into non-overlapping 8×8 blocks. If mirror padding was performed in the previous step, this step divides the image into blocks at the padded size. Each 8×8 block is flattened into a row vector of length 64 in a predetermined order. The flattening order must be consistent at the decoding end. All row vectors are stacked row by row to obtain the three-way observation matrix. , , The number of rows is equal to the number of blocks (i.e., pixels) in the corresponding channel divided by 64, and the number of columns is always 64. S2-2. Generate and save parameters: block size, whether to use mirror fill and its boundary width, flattening order, and original dimensions. Based on the downsampling size, a block index mapping table is established to record the channel and top-left corner coordinates of the block corresponding to each row of block vectors in the original image. Check if the number of rows in the three matrices are equal to... and Check if the number of columns is always 64; if it does not match the record, stop encoding and report an error, outputting... The three observation matrices and their associated parameters include block size, flattening order, filling information, and size-index mapping.
4. The computer data compression and reconstruction method based on matrix factorization according to claim 3, characterized in that: Specifically, S3 is: S3-1. Approximate each observation matrix produced by S2 with a low-rank approximation, and then abstract it uniformly to a given... , in order Integer bounded factor representation The original matrix is approximated by multiplying two smaller factor matrices, where the lower-rank factor matrix is... Low-rank factor matrix Then the discrete optimization formula is: , , ,in Given an integer interval, we first use the low-rank decomposition of the continuous field to obtain an ideal initial solution of real numbers. Then, we round each element of the initial solution to the preset integer boundary to obtain an integer and bounded initial value. This transforms the discrete value into a feasible region constraint that the factor elements must fall within the specified integer interval. In the optimization, we weigh the discrete error against the approximation error. S3-2. Update only one column vector at a time, keeping the rest fixed. First, update all columns... Update it again, then change all columns. Update once, repeating the process until convergence or the iteration limit is reached. Each update is equivalent to solving a rank-one approximation subproblem, and the result is projected back to the integer interval after the update. The closed-form column update formula is: , The projection is performed by rounding each element and truncating the interval to achieve bounded integer projection. Two types of stopping conditions are used: first, the relative decrease of the objective function is lower than the threshold; second, the maximum number of iterations is reached. In implementation, a small amount of intermediate quantity is cached to avoid explicit recalculation of large residual matrices. The overall iteration cost is comparable to matrix multiplication. Each channel will obtain a pair of integer bounded factor matrices and metadata such as rank, boundary, and number of iterations. The decoding end only needs to perform lossless decoding and restore the image by matrix multiplication. Then, the image can be restored by the subsequent reverse process.
5. The computer data compression and reconstruction method based on matrix factorization according to claim 4, characterized in that: Specifically, S4 is: S4-1. After the discrete perceptual decomposition in S3, the integer bounded factor matrix is directly obtained, and each channel has a pair of basis matrices. With sparse matrices Without needing to perform independent discretization, it enters the lossless compression process, compressing each channel... and The data is written into the bitstream in the form of an integer array in a predetermined order. Then, a general lossless compression library is called to compress and encapsulate the data, recording the channel order, matrix shape, rank, integer boundaries and data block offsets to ensure that the decoding end restores each factor block in a one-to-one correspondence. S4-2. Save the color space type and chroma downsampling strategy, block size and boundary mirroring method, flattening order, rank, integer boundary, shape and channel identifier of the three pairs of factors, as well as the length and verification of each data segment along with the bitstream. During encapsulation, the three pairs of factors are written in segments and compressed separately to support random positioning and parallel decoding. The decoding end recovers in reverse order starting from the outermost layer - first decompressing without loss to obtain the factors.
6. The computer data compression and reconstruction method based on matrix factorization according to claim 5, characterized in that: Specifically, S5 is: S5-1. Read the parameter table and decompress the corresponding brightness values segment by segment. Blueness component Redness component Basis matrix and sparse matrix of three channels , , Perform a consistency check on the solved factors: the data type is integer, and the values are all within... The internal dimensions are consistent with the parameter table. Using the channel as the unit, the block-level approximate matrix of the channel is synthesized by using the solved bounded integer factors and the corresponding template information. The synthesis here strictly corresponds to the low-rank representation at the encoding end, but no new discretization is introduced. S5-2. Reshape the block-level approximation matrix of each channel into fixed-size blocks in a predetermined order, and backfill them to the corresponding planar positions according to the block index. If the encoding end performed mirror filling for alignment, crop it according to the original resolution after backfilling to restore the true boundary. Perform the upsampling strategy corresponding to the encoding end on the two chroma planes to make their spatial size consistent with the luminance plane. Use nearest neighbor interpolation to ensure strict symmetry with the average pooling of the encoding end. Combine the luminance and the two chroma planes into the target color space according to the reverse process of the encoding end, and then convert it back to a standard three-channel color image. Crop the result in intervals and round it to eight bits to ensure compatibility with common image containers.
7. The computer data compression and reconstruction method based on matrix factorization according to claim 6, characterized in that: Specifically, S6 is: S6-1, Using the integer factors of the lossless recovery from S5 as input, calculate channel by channel. , , The three products are the block-level approximation matrix of luminance and downsampled chrominance. The number of rows equals the number of luminance blocks. The number of rows is 64, and the same applies to the chroma channels. Multiplication is performed only after ensuring the inner product dimension matches, restoring the discrete integer factors to a continuous patch matrix. This is the only source of loss in the entire decoding chain. , , Each row is reshaped into 8x8 blocks in a predetermined order; based on the block index mapping table, the blocks are backfilled into the luminance and chrominance planes according to their top-left corner coordinates. If the encoding end has performed mirror padding on the boundaries, they are trimmed to their original size here. After backfilling, the Y and downsampling dimensions are obtained. , A two-dimensional image plane; S6-2, Upsample the two chroma pixels from the row-by-column bisector size back to the original row-by-column size; use nearest neighbor interpolation, that is, copy each chroma pixel into a 2x2 block, which is structurally dual to the average pooling at the encoding end, and then apply the upsampled chroma pixels. , satisfy , , Upsampling only copies pixels, does not introduce new floating-point operation errors, and maintains pixel alignment with the brightness plane. Performing the inverse linear transformation, which is the opposite of S1, yields RGB. This generates the final RGB eight-bit image.
8. The computer data compression and reconstruction method based on matrix factorization according to claim 7, characterized in that: This method employs a data compression and reconstruction system, which includes: Input Parameter Module: Receives images and configurations, generates parameter tables for color mode, downsampling, rank, and integer boundaries, and supports basic consistency checks; Color Variable Downsampling Module: Converts RGB to Y, Cb, Cr, and performs double downsampling on the chromaticity components to reduce entropy, maintaining pixel values as real numbers; Block Flattening Module: Flattens the block vectors in parallel to a length of 64 rows using an 8x8 non-overlapping block method, recording the block index; Matrix Assembly Module: Stacks the block vectors into a channel matrix, outputting the number of rows, columns, and block position mappings; Integer Low-Rank Solving Module: Solves for X in the bounded integer domain, alternately updates and projects it onto the integer interval, outputting U, V, and error; Factor Encapsulation and Compression Module: Encapsulates U, V, and the parameter table into a structured bitstream and performs lossless entropy encoding, generating verification information; Storage and Transmission Interface Module: Writes the bitstream to non-volatile memory or transmits it via bus, supporting DMA transfer and bandwidth arbitration; Lossless Decoding and Recovery Module: Losslessly decompresses the bitstream and recovers U, V, and the parameter table, performing consistency and verification checks; Channel Reconstruction and Backfilling Module: Calculates UV The row vectors are restored to 8×8 blocks according to the index and backfilled into the channel plane, with the filling boundaries trimmed as needed; the chroma upsampling inverse color module performs nearest-neighbor double upsampling on the chroma components and inversely transforms Y, Cb, and Cr to RGB, keeping the numerical range valid; the output display file module rounds the RGB values and truncates them to 8 bits, outputting them to the display or writing them to an image file; the bitrate quality scheduling module sets the rank, iteration rounds, and integer boundaries according to the target bpp or quality factor, and uniformly distributes them to the encoding and decoding link.