[go: up one dir, main page]

CN107592541B - An image decompression method and system - Google Patents

An image decompression method and system Download PDF

Info

Publication number
CN107592541B
CN107592541B CN201710826772.4A CN201710826772A CN107592541B CN 107592541 B CN107592541 B CN 107592541B CN 201710826772 A CN201710826772 A CN 201710826772A CN 107592541 B CN107592541 B CN 107592541B
Authority
CN
China
Prior art keywords
data
image
line
frame
decompression
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.)
Active
Application number
CN201710826772.4A
Other languages
Chinese (zh)
Other versions
CN107592541A (en
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.)
Institute of Semiconductors of CAS
Original Assignee
Institute of Semiconductors of CAS
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 Institute of Semiconductors of CAS filed Critical Institute of Semiconductors of CAS
Priority to CN201710826772.4A priority Critical patent/CN107592541B/en
Publication of CN107592541A publication Critical patent/CN107592541A/en
Application granted granted Critical
Publication of CN107592541B publication Critical patent/CN107592541B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明公开了一种针对特定图像压缩数据流的快速图像解压方法,详细说明了该方法所对应的压缩算法、解压缩实现流程,图像重建过程,内部结构及各模块间的互联关系,本发明还提出一种图像解压系统,可用于实现图像解压方法。本发明提供的图像解压缩方法和系统具有算法实现简单、意义明确,且可按照“图像行”展开进行多级流水操作,从而实现数据解压缩和图像无损重建。

Figure 201710826772

The invention discloses a fast image decompression method for a specific image compression data stream, and describes in detail the compression algorithm corresponding to the method, the decompression realization process, the image reconstruction process, the internal structure and the interconnection between the modules. An image decompression system is also proposed, which can be used to realize the image decompression method. The image decompression method and system provided by the present invention have simple algorithm implementation and clear meaning, and can perform multi-stage pipeline operations according to "image line" expansion, thereby realizing data decompression and image lossless reconstruction.

Figure 201710826772

Description

Image decompression method and system
Technical Field
The present invention relates to the field of image information processing technology, and in particular, to a decompression method and system for a specific image compressed data stream.
Background
Image sensors are widely used in scientific research, industrial production, medical health, national defense and military fields. With the continuous improvement of the image resolution and the image frame rate, human beings can observe more subtle object characteristics or more transient physical phenomena, so that the observation means of the human beings are greatly enriched, and the cognitive level of the human beings is improved.
But with the rapid improvement of image performance, the huge challenge of the image data quantity and the data transmission bandwidth which are multiplied is brought. Massive image data and ultrahigh data transmission bandwidth bring a series of technical problems for subsequent image transmission, storage and processing. In order to solve the problems, an image lossless compression method for processing high data bandwidth in real time is developed, and the difficulty of transmission and storage is greatly reduced. At the same time, a corresponding decompression method is also proposed for lossless reconstruction of images for subsequent research and practical use.
Disclosure of Invention
Technical problem to be solved
The invention aims to provide an image decompression method and system aiming at a high-speed real-time image lossless compression algorithm and realizing the inverse process of the image compression algorithm, namely, restoring original image data before compression and reconstructing an image in a lossless manner for subsequent use.
(II) technical scheme
An image decompression method comprising: s1: reading first frame original image data in an image compressed data stream, and taking the first frame original image data as basic image data; s2: reading and judging whether each image line compressed data in each line of the ith frame is within a preset threshold range, if the image line compressed data is within the threshold range, adding the image line compressed data and basic image data with the same coordinate, if the image line compressed data exceeds the threshold range, reading image line non-compressed data corresponding to the data with the exceeding range, adding the image line non-compressed data and the basic image data with the same coordinate, calculating to obtain a complete data image of the ith frame, and taking the complete data image as new basic image data; s3: judging whether the ith frame is the last frame or not, if so, finishing image decompression, otherwise, setting i to i +1, and returning to the step S2; wherein i is a positive integer and its initial value is 2.
Preferably, step S2 includes: s21: reading image data of a j-th line from the basic image data; s22: reading the kth image line compressed data of the jth line in the ith frame; s23: judging whether the image line compressed data is within a preset threshold range, if so, adding the image line compressed data and basic image data with the same coordinate, and if not, storing the coordinate corresponding to the image line uncompressed data; s24: judging whether the value of k is the number of pixels contained in the jth line, if not, setting k to be k +1, returning to S22 to process the next image line compressed data of the jth line, and if so, entering the step S25; s25: reading the non-compressed data of the image lines corresponding to the storage coordinates one by one, adding the non-compressed data of the image lines with the same coordinates with the basic image data of the same coordinates to obtain the image data of the jth line of the ith frame, and updating the jth line of the basic image data by using the image data; s26: judging whether the value of j is the number of lines included in the ith frame image, if not, setting j to i +1, returning to S21 to process image line compressed data of another line, if so, obtaining a complete data image of the ith frame, and taking the complete data image as new basic image data; wherein k and j are both positive integers, and the initial value is 1.
Preferably, between S1 and S2, S1A is further included: scanning the preset alignment code in the image compressed data stream, continuing the search when the preset alignment code is not found, and entering step S2 when the preset alignment code is found.
An image decompression system comprises a line decompression processing module for executing the image decompression method;
preferably, the system also comprises a data packet frame header detection module and an image frame data caching module; the data packet frame header detection module is configured to scan a preset alignment code in the image compressed data stream to trigger the line decompression processing module to execute step S2; the image frame data caching module is used for caching basic image data, and the basic image data is original image data or image data of the ith frame.
Preferably, the device comprises a line decompression processing module, wherein the line decompression processing module comprises a data stream reading controller, a comparator, an adder, an OV address register, an image line data cache and a decompression state control machine; the data flow reading controller is used for reading first frame original image data, image line compressed data and image line non-compressed data in the image compressed data flow, transmitting original image frame data to an image line data cache, sending the image line compressed data to the comparator and the adder, and sending the image line non-compressed data to the adder; the image line data cache is used for receiving original image data, writing the original image data into the image frame data cache module, and reading image data of the jth line in the basic image data from the image frame data cache module; the comparator is connected with the data stream reading controller, the adder and the OV address register and is used for judging whether the compressed data of each image line is within a preset threshold range or not, if so, a trigger signal is sent to the adder, and if not, the coordinate corresponding to the data exceeding the threshold range is stored in the OV address register; the decompression state controller is used for scanning the address in the OV address register, controlling the data flow reading controller to read the corresponding image line non-compressed data and sending a trigger signal to the adder. The adder is used for adding the image line compressed data and the basic image data with the same coordinate, and adding the image line non-compressed data and the basic image data with the same coordinate; the image line data cache is also connected with an adder and used for transmitting the basic image data with the same coordinate in the jth line of image data to the adder for calculation, acquiring the updated jth line of image data from the adder, and transmitting the updated jth line of image data back to the image frame data cache module to update the jth line of the basic image data.
Preferably, the line decompression processing module further comprises a data stream write-in controller, and the data stream write-in controller is located between the image line data buffer and the image frame data buffer module, and is used for transmitting the image data between the image line data buffer and the image frame data buffer module.
Preferably, the line decompression processing module further comprises a data counter and a line counter; the data counter is connected with the data stream reading controller and is used for recording the number of the image data read by the data stream reading controller so as to judge whether the value of k is the number of pixels contained in the j-th line; and the line counter is connected with the data stream writing controller and is used for recording the line number of the data transmitted by the data stream writing controller so as to judge whether the value of j is the line number contained in the ith frame image.
Preferably, the decompression state controller is further configured to collect signals input from the packet header detection module, the data counter, the OV address register, the line counter, and an external user, generate an image decompression flow control signal according to logic, sequentially start/stop the data flow reading controller, the comparator, the adder, and the data flow writing controller according to a predetermined flow, and generate a synchronous effective signal of a decompressed data flow.
Preferably, the system also comprises an input data caching module and an output data caching module; the input data caching module is used for caching image data in the image compression data stream and transmitting the data to the line decompression processing module; the output data caching module is connected with the line decompression processing module and used for caching and outputting the first frame of original image data and each subsequent frame of image data.
(III) advantageous effects
According to the technical scheme, the invention has the following beneficial effects:
(1) the method has simple hierarchy, clear meaning and easy realization, and can quickly realize the image lossless recovery and reconstruction aiming at the specific compressed data stream;
(2) the invention processes according to 'image line' in actual processing, which is beneficial to copying a plurality of similar realization structures and expanding to carry out multi-stage pipeline operation, thereby improving decompression speed.
Drawings
Fig. 1 is a schematic diagram of an input image compression data flow.
Fig. 2 is a schematic structural diagram of an image decompression system according to an embodiment of the present invention.
FIG. 3 is a state machine transition diagram of an image decompression process according to an embodiment of the present invention.
FIG. 4 is a flowchart of an image decompression method according to an embodiment of the present invention.
Detailed Description
In order that the objects, technical solutions and advantages of the present invention will become more apparent, the present invention will be further described in detail with reference to the accompanying drawings in conjunction with the following specific embodiments.
The image decompression method provided by the present invention divides the processed image compression data flow into 4 data segments from the data structure, as shown in fig. 1, which is a schematic diagram of the image compression data flow, and includes:
(1) an original image frame data segment;
(2) aligning the encoded data segments;
(3) compressing the data segment by the image line;
(4) the image lines are not compressed segments of data.
Wherein the data segment (1) is present only once throughout the compressed data stream; the data segment (2) appears only once in the compressed data of one frame image; the data segments (3), (4) are alternately and cyclically present. And the data segments (3), (4) are generated by the equations (EQ1, EQ2, EQ3), wherein the data segment (3) is actually the result of the B (p, l, f) calculation, and the data segment (4) is actually the result of the O (p, l, f) calculation:
δ(p,l,f)=gray(p,l,f)-gray(p,l,f-1) (EQ1)
Figure BDA0001406840970000051
Figure BDA0001406840970000052
(the above formula should satisfy 1. ltoreq. p. ltoreq.M,Ldarkl is more than 1 and less than or equal to N, f is more than or equal to 1, and TH is 2K-1(0<K<R))
Wherein gray (p, L, f) is the gray function of the input pixel, p is the pixel number, L is the image line number, f is the image frame number, M is the image width, N is the image height, R is the quantization bit width of the pixel, L is the quantization bit width of the pixeldarkIs the dark pixel row height. Delta (p, l, f) represents residual error, B (p, l, f) and O (p, l, f) represent residual error coding index and overflow respectively, TH is preset threshold, and binK is(δ(p,l,f))And bin K(TH)And binK(-(TH+1))K bit signed natural binary codes which are residual errors respectively; a K bit signed natural binary code of TH; a K bit signed natural binary code of- (TH + 1); binR(δ(p,l,f))The R bits that are residuals are signed natural binary codes.
An embodiment of the present invention provides an image decompression method, including the following steps:
s1: reading original image data of a first frame in an image compressed data stream, and taking the original image data as basic image data;
s2: reading and judging whether each image line compressed data in each line of the ith frame is within a preset threshold range, if the image line compressed data is within the threshold range, adding the image line compressed data and basic image data with the same coordinate, if the image line compressed data exceeds the threshold range, reading image line non-compressed data corresponding to the data with the exceeding range, adding the image line non-compressed data and the basic image data with the same coordinate, calculating to obtain a complete data image of the ith frame, and taking the complete data image as new basic image data;
s3: judging whether the ith frame is the last frame or not, if so, finishing image decompression, otherwise, setting i to i +1, and returning to the step S2; where the initial value of i is 2.
Wherein, the step S2 further includes:
s21: reading image data of a j-th line from the basic image data;
s22: reading the kth image line compressed data of the jth line in the ith frame;
s23: judging whether the image line compressed data is within a preset threshold range, if so, adding the image line compressed data and basic image data with the same coordinate (namely, jth line kth basic image data), and if not, storing the coordinate corresponding to the image line uncompressed data;
s24: judging whether the value of k is the number of pixels contained in the jth line, if not, setting k to be k +1, returning to S22 to process the next image line compressed data of the jth line, and if so, entering the step S25;
s25: reading the non-compressed data of the image lines corresponding to the storage coordinates one by one, adding the non-compressed data of the image lines with the same coordinates with the basic image data of the same coordinates to obtain the image data of the jth line of the ith frame, and updating the jth line of the basic image data by using the image data;
s26: judging whether the value of j is the number of lines included in the ith frame image, if not, setting j to j +1, returning to S21 to process image line compressed data of another line, if so, obtaining a complete data image of the ith frame, and taking the complete data image as new basic image data; wherein k and j are both positive integers, and the initial value is 1.
In some embodiments of the invention, between S1 and S2, S1A is further included: scanning the preset alignment code in the image compressed data stream, continuing the search when the preset alignment code is not found, and entering step S2 when the preset alignment code is found.
Another embodiment of the present invention provides an image decompression system, the block diagram of the system of the present invention is shown in fig. 2, and for the above data structure, the present invention works in order according to the state machine transition diagram shown in fig. 3. The image decompression system includes: SOF detection module (data packet frame head detection module), input data buffer module, line decompression processing module, image frame data buffer module, output data buffer module, and each module is interconnected in order. Wherein, the line decompression processing module is used for executing steps S1 to S3.
The SOF detection module (SOF is an abbreviation of Start of Frame and indicates a header of a packet) is used to scan the preset alignment code in the image compressed data stream, so as to quickly locate the Start position of a new Frame of image in the continuous image compressed data stream, and trigger the line decompression processing module to execute step S2.
The input data caching module is used for caching image data in the image compression data flow and transmitting the data to the line decompression processing module.
The image frame data caching module is used for caching basic image data, and the basic image data is original image data or image data of an ith frame. The image frame data buffer module receives the image data output by the buffer line decompression processing module on one hand, and outputs the image data to the line decompression processing module on the other hand. The storage capacity should be sufficient to store at least 1 frame of image data completely.
The output data caching module is connected with the line decompression processing module and is used for caching and outputting the first frame of original image data and each subsequent frame of image data output by the line decompression processing module, namely the image decompression data stream.
The line decompression processing module comprises a data flow reading controller, a decompression control state machine, a data counter, a comparator, an OV address register, an image line data cache, an adder, a line counter and a data flow writing controller, and all units are mutually and sequentially interconnected.
The decompression control state machine is connected with other units in the line decompression processing module, collects signals (such as threshold information) from the SOF detection module, the data counter, the OV address register, the line counter and external user input signals, generates an image decompression flow control signal according to logic, sequentially starts/stops a data flow reading controller, a comparator, an adder and a data flow writing controller according to a preset flow, and generates synchronous effective signals of the decompressed data flow.
The data flow reading controller is connected with the decompression state controller, the image line data cache, the data counter, the comparator and the adder, and is controlled by the output pulse of the decompression state controller to sequentially read the original image frame data of the first frame, the image line compressed data of the ith frame and the image line non-compressed data, transmit the original image frame data to the image line data cache, transmit the image line compressed data to the comparator and the adder and transmit the image line non-compressed data to the adder.
The data counter is connected with the decompression state controller and is used for recording the number of data read by the data stream reading controller so as to judge whether the value of k is the number of pixels contained in the jth line, namely whether the compressed data of the kth image line is the last data of the jth line; the data counter is a loop counter, and the maximum range of the count is up to the number of pixels (or the number of pixel points) contained in a single line of the decompressed image. When the data counter counts the number of pixels needed by one line of the image, a pulse signal is generated and sent to the decompression state controller, so that the decompression state controller controls each unit to carry out the next operation. The data counter is then cleared to begin recounting.
The image line data buffer is connected with the decompression state controller, the data stream reading controller and the data stream writing controller and is used for buffering a certain line of image data from the data stream reading controller or the data stream writing controller. And receiving original image data from the data stream reading controller, writing the original image data into the image frame data caching module, and reading image data of the jth line in the basic image data from the image frame data caching module. The image line data cache is also connected with an adder and used for transmitting the basic image data with the same coordinate in the jth line of image data to the adder for calculation, acquiring the updated jth line of image data from the adder, and transmitting the updated jth line of image data back to the image frame data cache module to update the jth line of the basic image data.
The data flow write-in controller is connected with the decompression state controller, the image line data cache, the line counter, and an image frame data cache module and an output data cache module outside the line decompression processing module. The data flow write-in controller is controlled by the output pulse of the decompression state controller, the image data flow is moved in order in the image line data cache, the image frame data cache module and the output data cache module, and 1 time pulse is output after 1 line operation is finished, so that a line counter is started to add 1.
The comparator is connected with the decompression state controller, the data flow reading controller, the adder and the OV address register and is used for judging whether the compressed data of each image line is within a preset threshold range, receiving threshold information sent by the decompression state controller, comparing the compressed data of the image lines read by the data flow reading controller with the threshold, and if the compressed data of the image lines is within the threshold range, sending a trigger signal to the adder by the comparator, triggering the adder to read the data, calculating and outputting the data; if the data is out of the threshold range, the comparator stores the coordinate corresponding to the data exceeding the threshold range in the OV address register.
The adder is connected with the decompression state controller, the data flow reading controller, the image line data cache and the comparator, reads data of corresponding coordinates from the image line data cache under the control of the decompression state controller, and sums the data with image line compressed data or image line uncompressed data of the same coordinates sent by the data flow reading controller.
An OV address register (OV is an abbreviation of Overflow and indicates Overflow or over-threshold), which is connected with the decompression state controller and the comparator and is used for receiving and storing the position information of the pixel points outside the threshold range transmitted by the comparator. The decompression state controller scans the address in the OV address register, controls the data flow reading controller to read the corresponding image line non-compressed data, and sends a trigger signal to the adder.
The line counter is connected with the decompression state controller and the data stream write-in controller and is used for recording the line number of data processed by the data stream write-in controller so as to judge whether the value of j is the line number contained in the ith frame image, namely whether the jth line is the last line of the ith frame image, the line counter is a cycle counter, the maximum counting range is up to the height of the decompressed image frame (or the maximum image line number), a pulse signal is generated after the counting is completed, and the pulse signal is sent to the decompression state controller so as to control each unit to carry out the next operation. The line counter is then cleared and recounted.
Another embodiment of the present invention provides an image decompression method, which is used in an image decompression system, wherein the image decompression implementation steps perform ordered and conditional transitions in 5 states, as shown in fig. 3, which is a flowchart of the image decompression method according to the embodiment of the present invention, and fig. 4 is a state machine transition diagram of the image decompression process according to the embodiment of the present invention, which includes the following steps:
step S1: reading first frame original image data in the image compressed data stream, and taking the first frame original image data as basic image data.
In this embodiment, the image decompression system is the image decompression system described above. The line decompression processing module reads original image frame data in the compressed data stream, writes the complete original image frame data into the image frame data caching module, and takes the first frame of original image data stored by the image frame data caching module as basic image data.
In which the image decompression process is in state 1, which is performed for (1) a segment of data, comprising the following sub-steps:
substep S11: the decompression state controller starts the data flow reading controller and the data counter and writes the read data into the image line data cache in sequence. When the data counter counts the number of pixels needed by one line of the image, the decompression state machine stops the data stream reading controller and starts the data stream writing controller;
substep S12: the data flow write-in controller simultaneously loads the data in the image line data cache into the image frame cache module and the output data cache module, when the write-in controller finishes the operation, a pulse is generated, a line counter is started to add 1, and the line data processing of 1 is marked to be finished.
Substep S13: the substeps S11 and S12 are repeated until the line counter is full of all the lines of one frame image.
When the state operation is completed, the image frame data caching module stores the complete 1 frame of original image, and the output end also outputs the complete one frame of image data. Thereafter, the decompression state controller proceeds to the next state.
Step S1A: scanning the preset alignment code in the image compressed data stream, continuing the search when the preset alignment code is not found, and entering step S2 when the preset alignment code is found.
In the step, the image decompression process is in a state 2, the state 2 uses an SOF retrieval module to scan an input data stream aiming at a data segment (2), and the search is continued when a preset alignment code is not found; if the preset alignment code is found, generating a trigger pulse, starting a decompression state controller, and starting to enter an image line decompression mode; (where the alignment code is a predetermined or predetermined value, e.g., one row of pixels all has 0xFFFF, the next row of pixels all has 0x0000, and so on, for example, data with a large abrupt change in gray level between two consecutive rows.)
Step S2: reading and judging whether each image line compressed data in each line of the ith frame is within a preset threshold range, if the image line compressed data is within the threshold range, adding the image line compressed data and basic image data with the same coordinate, if the image line compressed data exceeds the threshold range, reading image line non-compressed data corresponding to the over-range data, adding the image line non-compressed data and the basic image data with the same coordinate, calculating to obtain a complete data image of the ith frame, and taking the complete data image as new basic image data.
Wherein i is a positive integer and its initial value is 2. Step S2 includes the following substeps:
substep S21: the image data of the j-th line is read from the base image data.
Wherein j is a positive integer and its initial value is 1. The decompression state controller starts a data flow write-in controller, and reads out a row (jth row) of basic image data from the image frame data cache module to the image row data cache;
substep S22: and reading the kth image line compressed data of the jth line in the ith frame.
Wherein k is a positive integer and its initial value is 1.
In the step, the image decompression process is in a state 3, the decompression state controller starts the data flow reading controller, the counter and the comparator in the state 3 for the data segment (3), the data flow reading controller sequentially reads the image line compressed data in the compressed data flow, and transmits the currently read data (such as the k image line compressed data of the j line) to the comparator and the adder.
Substep S23: and judging whether the image line compressed data is within a preset threshold range, if so, adding the image line compressed data and basic image data with the same coordinate, and if not, storing the coordinate corresponding to the image line uncompressed data.
And comparing and judging the currently read data with a preset threshold value in a comparator, if the currently read data is within the threshold value table range, triggering an adder by the comparator, taking out the data with the same coordinate address as the currently read image line compressed data from the image line data cache by the adder, summing the data with the currently read image line compressed data, writing the calculation result into the image line data cache, and updating the image line data of the image line data cache. If outside the threshold table range, the comparator triggers an OV address register into which the coordinate address of the currently read pixel data is written.
This step implements an inverse process of one of δ (p, l, f) -gray (p, l, f-1) (i.e., a case where the difference between the pixel value of the current line and the pixel value corresponding to the same-position line in the adjacent previous frame image is within a set threshold range), that is, the gray (p, l, f) is obtained by solving the read data B (p, l, f) and the gray (p, l, f-1) in the image line data cache. If the pixel address is outside the threshold value table range, an OV address register is triggered, the current pixel address is written into the register, and the next operation is waited.
Substep S24: it is determined whether the value of k is equal to the number of pixels included in the jth line, and if not, k is set to k +1, the process returns to S22 to process the compressed data of the next image line in the jth line, and if so, the process proceeds to step S25.
In the above process, the data counter records the number of image line compressed data read by the data stream reading controller, that is, it is determined whether the value of k reaches the number of pixels included in the jth line, and when the data counter is full of the number of pixels required by an image line, the kth image line compressed data is the last image line compressed data of the jth line, and the next state is entered.
Substep S25: reading the non-compressed data of the image lines corresponding to the storage coordinates one by one, adding the non-compressed data of the image lines with the same coordinates with the basic image data of the same coordinates to obtain the image data of the jth line of the ith frame, and updating the jth line of the basic image data by using the image data.
In the step, the image decompression process is in a state 4, the decompression state controller scans the address data recorded in the OV address register one by one in the state 4 aiming at the (4) data segment, the decompression state controller triggers the adder to take out the data with the same coordinate address from the image line data cache, the data obtained by the data stream reading controller at the moment is calculated by the adder together with the data read out from the image line data cache at the same address, and the calculation result is written back to the corresponding coordinate address of the image line data cache. And starting a data stream write-in controller, and moving the data in the image line data cache into the image frame data cache module and the output data cache module. At this time, the refreshing of the new image line in the image frame data buffer module and the outputting of the new image line are actually completed. When the data stream is completely written into the controller, a pulse is generated, a line counter is started to add 1, and the completion of data processing of one line is marked.
This step realizes the inverse process of the other case of δ (p, l, f) -gray (p, l, f-1) (i.e., the case where the difference between the pixel value of the current line and the pixel value corresponding to the same position line in the adjacent previous frame image is outside the set threshold range), that is, the gray (p, l, f) is obtained from the read data O (p, l, f) and the gray (p, l, f-1) in the image line data buffer. When OV address register is scanned, decompression state machine
Substep S26: judging whether the value of j is the number of lines included in the ith frame image, if not, setting j to j +1, returning to S21 to process image line compressed data of another line, if so, obtaining a complete data image of the ith frame, and taking the complete data image as new basic image data;
in the above process, the line counter records the number of lines of the image data refreshed in the image frame data buffer module, that is, it is determined whether the value of j is the number of lines included in the ith frame image, and the jth line is the last line of the frame image, if the refreshing of all lines is not completed, j is set to j +1, the process returns to S21 to process the image line compressed data of another line, the data stream write-in controller reads the next line image data from the image frame data buffer module and buffers it into the image line data buffer, the decompression state controller controls the data stream read controller, the comparator, the adder, the OV address register, the data counter and the line counter to process the next line image data, and moves the processed next line image into the image frame data buffer module and the output data buffer module to complete the refreshing and outputting of the next line image until the scan line counter of the decompression state machine reaches the image height (or the number of lines), at this time, the image frame buffer module stores the complete ith frame image data, and the output end also outputs the complete ith frame image data as new basic image data.
Step S3: it is determined whether or not the i-th frame is the last frame, and if so, the image decompression is completed, otherwise, i is set to i +1, and the process returns to S2.
If the i-th frame is determined to be the last frame (this determination process may be completed by the decompression state controller or the data stream reading controller), decompression of all image frames is completed, and if not, i is set to i +1, and the process returns to step S1A to retrieve the next image frame again. In which the image decompression is in state 5, and steps S1A to S3 are repeated until the process completes the decompression of all F frame images.
It should also be noted that directional terms, such as "upper", "lower", "front", "rear", "left", "right", etc., used in the embodiments are only directions referring to the drawings, and are not intended to limit the scope of the present invention. Throughout the drawings, like elements are represented by like or similar reference numerals. Conventional structures or constructions will be omitted when they may obscure the understanding of the present invention.
And the shapes and sizes of the respective components in the drawings do not reflect actual sizes and proportions, but merely illustrate contents of the embodiments of the present invention. Furthermore, in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim.
Unless otherwise indicated, the numerical parameters set forth in the specification and attached claims are approximations that can vary depending upon the desired properties sought to be obtained by the present invention. In particular, all numbers expressing quantities of ingredients, reaction conditions, and so forth used in the specification and claims are to be understood as being modified in all instances by the term "about". Generally, the expression is meant to encompass variations of ± 10% in some embodiments, 5% in some embodiments, 1% in some embodiments, 0.5% in some embodiments by the specified amount.
Furthermore, the word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.
In addition, unless steps are specifically described or must occur in sequence, the order of the steps is not limited to that listed above and may be changed or rearranged as desired by the desired design. The embodiments described above may be mixed and matched with each other or with other embodiments based on design and reliability considerations, i.e., technical features in different embodiments may be freely combined to form further embodiments.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the method of the invention should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing inventive embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention and are not intended to limit the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (1)

1. An image decompression method, decompression being performed by an image decompression system, the image decompression system comprising: the device comprises a line decompression processing module, a data packet frame head detection module and an image frame data cache module; the line decompression processing module comprises a data stream reading controller, a comparator, an adder, an OV address register, an image line data cache and a decompression state control machine; the image decompression method comprises the following steps:
s1: reading, by a data stream read controller, original image data of a first frame in an image compressed data stream, the image compressed data stream comprising: an original image frame data segment; aligning the encoded data segments; compressing the data segment by the image line; and an image line non-compressed data segment; and using the original image data as basic image data;
s2: reading and judging whether each image line compressed data in each line of the ith frame is within a preset threshold range, if the image line compressed data is within the threshold range, adding the image line compressed data and basic image data with the same coordinate, if the image line compressed data exceeds the threshold range, reading image line non-compressed data corresponding to the data with the exceeding range, adding the image line non-compressed data and the basic image data with the same coordinate, calculating to obtain a complete data image of the ith frame, and taking the complete data image as new basic image data;
s3: judging whether the ith frame is the last frame or not, if so, finishing image decompression, otherwise, setting i to i +1, and returning to the step S2;
wherein the initial value of i is 2;
wherein, the step S2 further includes:
s21: reading image data of a j-th line from the basic image data;
s22: reading the kth image line compressed data of the jth line in the ith frame;
s23: judging whether the image line compressed data is within a preset threshold range, if so, adding the image line compressed data and basic image data with the same coordinate, and if not, storing the coordinate corresponding to the image line uncompressed data;
s24: judging whether the value of k is the number of pixels contained in the jth line, if not, setting k to be k +1, returning to S22 to process the next image line compressed data of the jth line, and if so, entering the step S25;
s25: reading the non-compressed data of the image lines corresponding to the storage coordinates one by one, adding the non-compressed data of the image lines with the same coordinates with the basic image data of the same coordinates to obtain the image data of the jth line of the ith frame, and updating the jth line of the basic image data by using the image data;
s26: judging whether the value of j is the number of lines included in the ith frame image, if not, setting j to j +1, returning to S21 to process image line compressed data of another line, if so, obtaining a complete data image of the ith frame, and taking the complete data image as new basic image data;
wherein k and j are positive integers, and the initial values are both 1;
wherein, between S1 and S2, S1A is also included: scanning a preset alignment code in the image compressed data stream through a data packet frame header detection module, continuing searching when the preset alignment code is not found, and entering step S2 when the preset alignment code is found;
the method comprises the steps that original image frame data are transmitted to an image line data cache through a data stream reading controller, image line compressed data are sent to a comparator and an adder, and image line non-compressed data are sent to the adder;
receiving original image data through an image line data cache, writing the original image data into an image frame data cache module, and reading image data of a jth line in basic image data from the image frame data cache module;
the comparator is connected with the data stream reading controller, the adder and the OV address register to judge whether the compressed data of each image line is in a preset threshold range, if so, a trigger signal is sent to the adder, and if not, the coordinates corresponding to the data exceeding the threshold range are stored in the OV address register;
scanning the address in the OV address register by a decompression state controller, controlling a data stream reading controller to read corresponding image line non-compressed data, and sending a trigger signal to an adder;
adding, by an adder, the image line compressed data and base image data of the same coordinates, and adding the image line non-compressed data and the base image data of the same coordinates;
the image line data cache is also connected with an adder so as to transmit basic image data with the same coordinate in the jth line of image data to the adder for calculation, obtain updated image data of the jth line from the adder, transmit the updated image data of the jth line back to the image frame data cache module, and update the jth line of the basic image data;
the line decompression processing module also comprises a data stream write-in controller, the data stream write-in controller is positioned between the image line data cache and the image frame data cache module and is used for transmitting the image data between the image line data cache and the image frame data cache module;
the line decompression processing module also comprises a data counter and a line counter;
the data counter is connected with the data stream reading controller, and the number of the image data read by the data stream reading controller is recorded, so that whether the value of k is the number of pixels contained in the j-th line is judged;
the row counter is connected with the data stream writing controller, and the row number of data transmitted by the data stream writing controller is recorded, so that whether the value of j is the row number contained in the ith frame image or not is judged;
the control device collects the signals from the data packet frame head detection module, the data counter, the OV address register, the line counter and the input of the external user, generates the control signal of the image decompression flow according to the logic, starts/stops the data flow reading controller, the comparator, the adder and the data flow writing controller in sequence according to the preset flow, and generates the synchronous effective signal of the decompression data flow.
CN201710826772.4A 2017-09-13 2017-09-13 An image decompression method and system Active CN107592541B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710826772.4A CN107592541B (en) 2017-09-13 2017-09-13 An image decompression method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710826772.4A CN107592541B (en) 2017-09-13 2017-09-13 An image decompression method and system

Publications (2)

Publication Number Publication Date
CN107592541A CN107592541A (en) 2018-01-16
CN107592541B true CN107592541B (en) 2022-03-04

Family

ID=61051617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710826772.4A Active CN107592541B (en) 2017-09-13 2017-09-13 An image decompression method and system

Country Status (1)

Country Link
CN (1) CN107592541B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112839230B (en) * 2021-01-20 2023-04-28 上海思朗科技有限公司 Image data compression device and image data decompression device
CN114615209B (en) * 2022-03-11 2024-03-08 山东云海国创云计算装备产业创新中心有限公司 Dynamic adaptive image compression method, device, equipment and readable medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9071825B2 (en) * 2012-04-24 2015-06-30 Tektronix, Inc. Tiling or blockiness detection based on spectral power signature
CN106550237B (en) * 2015-09-16 2020-05-19 中国科学院深圳先进技术研究院 A surveillance video compression method
CN106791844B (en) * 2016-12-19 2019-09-03 中国科学院半导体研究所 An image lossless compression device and method

Also Published As

Publication number Publication date
CN107592541A (en) 2018-01-16

Similar Documents

Publication Publication Date Title
US7689047B2 (en) Reduced buffer size for JPEG encoding
EP3991817A1 (en) Data processing method and apparatus, computer device, and readable storage medium
CN101815168A (en) Imaging apparatus, and variable speed imaging method
CN107592541B (en) An image decompression method and system
CN100422986C (en) Apparatus for performing discrete cosine transform/inverse discrete cosine transform and method thereof
CN109743562B (en) Matching cost calculation circuit structure based on Census algorithm and working method thereof
CN103647937A (en) An image tracking system and an image data processing method thereof
US7589761B2 (en) Device and method for transmitting image data
EP2787738B1 (en) Tile-based compression for graphic applications
JP2009295159A (en) Memory access method
JPS5816665B2 (en) Fuakushimirishingounofugoukahoushiki
CN107659815B (en) Image decompression method and device for executing the same
US20210082082A1 (en) Data processing method and processing circuit
CN110392262B (en) Method and device for compressing virtual desktop image
CN104731519A (en) Cache memory management device and dynamic image system and method using the cache memory management device
CN112019856A (en) Video reversing method and system for smart phone
CN103238324A (en) Image processing device and image processing method
JPH04368086A (en) Method and system of compressing frame row image and method and system of restructuring frame
JPS5888971A (en) Encoding system for picture signal
KR100353894B1 (en) Memory architecture for buffering jpeg input data and addressing method thereof
CN106791843A (en) A kind of Lossless Image Compression Algorithm system and method
CN107680030B (en) An image processor and processing method
WO2020232683A1 (en) Pipeline hardware compression-based system and method
US5210713A (en) Data storage method and first-in first-out memory device
US7460718B2 (en) Conversion device for performing a raster scan conversion between a JPEG decoder and an image memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant