Movatterモバイル変換


[0]ホーム

URL:


CN101192304B - Image compression and decompression device and method for embedded system - Google Patents

Image compression and decompression device and method for embedded system
Download PDF

Info

Publication number
CN101192304B
CN101192304BCN2006101629181ACN200610162918ACN101192304BCN 101192304 BCN101192304 BCN 101192304BCN 2006101629181 ACN2006101629181 ACN 2006101629181ACN 200610162918 ACN200610162918 ACN 200610162918ACN 101192304 BCN101192304 BCN 101192304B
Authority
CN
China
Prior art keywords
data
bit
image
output
embedded system
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.)
Expired - Fee Related
Application number
CN2006101629181A
Other languages
Chinese (zh)
Other versions
CN101192304A (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.)
Generalplus Technology Inc
Original Assignee
Generalplus Technology Inc
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 Generalplus Technology IncfiledCriticalGeneralplus Technology Inc
Priority to CN2006101629181ApriorityCriticalpatent/CN101192304B/en
Publication of CN101192304ApublicationCriticalpatent/CN101192304A/en
Application grantedgrantedCritical
Publication of CN101192304BpublicationCriticalpatent/CN101192304B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Landscapes

Abstract

Translated fromChinese

本发明是有关用于嵌入式系统的图像压缩及解压缩的装置与方法。数据提供器用于提供多组N位图像数据。锁存器用于锁存数据提供器输出的N位图像数据。比较器对比数据提供器及锁存器的数据,从而产生指示信号。数据封装器在指示信号为第一状态时,将第一位串接至输出比特流,当指示信号为第二状态时,将第二位及数据提供器输出的N位图像数据串接至该输出比特流。

Figure 200610162918

The present invention relates to an apparatus and method for image compression and decompression for an embedded system. A data provider is used to provide multiple groups of N-bit image data. A latch is used to latch the N-bit image data output by the data provider. A comparator compares the data of the data provider and the latch to generate an indication signal. When the indication signal is in a first state, the data encapsulator connects the first bit in series to an output bit stream, and when the indication signal is in a second state, connects the second bit and the N-bit image data output by the data provider in series to the output bit stream.

Figure 200610162918

Description

Translated fromChinese
用于嵌入式系统的图像压缩及解压缩装置与方法 Image compression and decompression device and method for embedded system

技术领域technical field

本发明涉及图像压缩及解压缩的技术领域,尤其指一种用于嵌入式系统的图像压缩及解压缩的装置与方法。 The invention relates to the technical field of image compression and decompression, in particular to an image compression and decompression device and method for an embedded system. the

背景技术Background technique

现有的无损图像压缩技术可分成:Run Length编码、霍夫曼编码(Huffman Coding)、Lempel-Ziv-Weich编码、算数编码(ArithmeticCoding)、差分编码(Differential Coding)及无损JPEG编码(Lossless JPEG)等。其中,Run Length编码将一连串相同的数据改成以两个字节(Byte)来表示,前一个字节(Byte)代表该串数据的长度(亦即重复次数),后面一个字节(Byte)则用于记录数据。例如数据为”555555AA”,经由RunLength编码后变为”652A”,其中,表示有6个”5”、2个”A”。这样就节省了4个字节的空间了。然而,Run Length编码需要统计输入数据的重复率,当数据的重复率低时,压缩比亦降低。 Existing lossless image compression techniques can be divided into: Run Length Coding, Huffman Coding (Huffman Coding), Lempel-Ziv-Weich Coding, Arithmetic Coding (Arithmetic Coding), Differential Coding (Differential Coding) and Lossless JPEG Coding (Lossless JPEG) wait. Among them, Run Length encoding changes a series of identical data into two bytes (Byte), the previous byte (Byte) represents the length of the string of data (that is, the number of repetitions), and the latter byte (Byte) are used to record data. For example, if the data is "555555AA", it will become "652A" after being encoded by RunLength, which means that there are 6 "5" and 2 "A". This saves 4 bytes of space. However, Run Length encoding needs to count the repetition rate of the input data. When the repetition rate of the data is low, the compression ratio will also decrease. the

霍夫曼编码系将输入数据依照出现机率使用二叉树方式(BinaryTree)编码,出现机率大的符号使用长度较短的码来表示,出现机率小的符号使用长度较长的码表示,因而其平均使用的数据量较小。然而其与Run Length编码一样,要统计输入数据出现的机率。 The Huffman coding system encodes the input data according to the probability of occurrence using a binary tree (BinaryTree). Symbols with a high probability of occurrence are represented by a code with a shorter length, and symbols with a low probability of occurrence are represented by a code with a longer length. The amount of data is small. However, it is the same as Run Length encoding, and it needs to count the probability of input data occurrence. the

Lempel-Ziv-Weich编码使用已出现的字符串当作索引查表对比的依据,并且建立索引的方式以作为数据压缩流。然而,Lempel-Ziv-Weich编码方法需要使用大的存储器空间,以暂存所建立的表格。 Lempel-Ziv-Weich encoding uses the existing strings as the basis for index look-up table comparison, and the indexing method is used as a data compression stream. However, the Lempel-Ziv-Weich encoding method needs to use a large memory space to temporarily store the created table. the

算数编码(Arithmetic Coding)最大的特点在于它不是以一个符号代表一个位,而是以一个实数来表示压缩字符串。这种方法需将原始字符串先读一遍,统计每一相异字符出现机率,将0至1实数区间依此机率分割成原始编码区间表,接着将原始字符串一个一个的字符读入,每一字元读入,即将其所占区间,用原始编码区间表再分割,如此到最后一个字元读完后,就会产生一个最后区间,再从此区间挑一实数 代表原始字符串的压缩文件。算数编码所得到的编码只需要一个存浮点数的空间即可存入,无需像霍夫曼编码一样需要大量空间来储存。然而,其缺点为要统计输入数据出现的机率及算法非常复杂。 The biggest feature of arithmetic coding (Arithmetic Coding) is that it does not use a symbol to represent a bit, but a real number to represent a compressed string. This method needs to read the original string first, count the occurrence probability of each different character, divide the real number range from 0 to 1 into the original code interval table according to the probability, and then read the original string character by character, each One character is read in, that is, the interval it occupies is divided by the original encoding interval table, so that after the last character is read, a final interval will be generated, and then a real number is selected from this interval to represent the compressed file of the original string . The code obtained by arithmetic coding only needs a space for storing floating-point numbers to be stored, and does not need a large amount of space for storage like Huffman coding. However, its disadvantage is that it is very complicated to count the probability of occurrence of the input data and the algorithm. the

而差分编码则使用预估值与实际值之间的差值作为压缩的依据,而其单独运用时压缩率低。无损JPEG编码则使用离散余弦转换与预估误差值作为压缩的依据。 Differential encoding uses the difference between the estimated value and the actual value as the basis for compression, and the compression rate is low when it is used alone. Lossless JPEG encoding uses discrete cosine transform and estimated error value as the basis for compression. the

然而在嵌入式系统中,仅有有限的计算能力及有限的存储器容量,上述的图像压缩技术均难以在嵌入式系统执行。由此可知,图像压缩及解压缩功能在嵌入式系统上仍有改善的空间。 However, in an embedded system, there are only limited computing power and limited memory capacity, and the above-mentioned image compression techniques are difficult to implement in the embedded system. It can be seen that there is still room for improvement in the image compression and decompression functions on the embedded system. the

发明内容Contents of the invention

本发明的目的在于提供一种用于嵌入式系统的图像压缩及解压缩装置与方法,从而能在嵌入式系统中执行图像压缩及解压缩功能。 The object of the present invention is to provide an image compression and decompression device and method for an embedded system, so that image compression and decompression functions can be performed in the embedded system. the

本发明的另一目的在于提供一种用于嵌入式系统的图像压缩及解压缩装置与方法,从而能在嵌入式系统中执行图像压缩及解压缩时减少存储器使用量。 Another object of the present invention is to provide an image compression and decompression device and method for an embedded system, so as to reduce memory usage when performing image compression and decompression in the embedded system. the

本发明的再一目的在于提供一种用于嵌入式系统的图像压缩及解压缩装置与方法,从而能于嵌入式系统中执行图像压缩及解压缩时,减少嵌入式处理器计算能力需求。 Yet another object of the present invention is to provide an image compression and decompression device and method for an embedded system, thereby reducing the computing power requirement of the embedded processor when performing image compression and decompression in the embedded system. the

依据本发明的一个方面,本发明提出一种用于嵌入式系统的图像压缩装置,包括数据提供器、锁存器、比较器及数据封装器。该数据提供器用于提供多组N位图像数据;该锁存器连接至该数据提供器,以锁存该数据提供器输出的N位图像数据;该比较器连接至该数据提供器及该锁存器,以对比该数据提供器及该锁存器的数据,从而产生指示信号,该指示信号具有第一状态及第二状态,其中,第一状态代表该数据提供器输出的数据与该锁存器的数据相同,第二状态代表该数据提供器输出的数据与该锁存器的数据不相同;该数据封装器连接至该比较器及该数据提供器,当该指示信号为第一状态时,将第一位串接(concatenate)至输出比特流(output bit stream),当该指示信号为第二状态时,将第二位及数据提供器输出的N位图像数据串接至该输出比特流。 According to one aspect of the present invention, the present invention provides an image compression device for an embedded system, including a data provider, a latch, a comparator and a data encapsulator. The data provider is used to provide multiple sets of N-bit image data; the latch is connected to the data provider to latch the N-bit image data output by the data provider; the comparator is connected to the data provider and the lock register to compare the data of the data provider and the latch to generate an indication signal, the indication signal has a first state and a second state, wherein the first state represents the data output by the data provider and the latch The data of the register is the same, and the second state represents that the data output by the data provider is different from the data of the latch; the data encapsulator is connected to the comparator and the data provider, when the indication signal is in the first state When the first bit is concatenated (concatenate) to the output bit stream (output bit stream), when the indication signal is in the second state, the second bit and the N-bit image data output by the data provider are concatenated to the output bitstream. the

依据本发明的另一方面,本发明提出一种嵌入式系统中的图像解压缩装置,包括数据提供器、数据产生装置及缓冲器。该数据提供器用于连续输出输出比特流;该数据产生装置连接至该数据提供器,以根据该数据提供器所输出的输出比特流而产生数据;该缓冲器用于暂存该数据产生装置所产生的数据;其中,该数据产生装置判定该输出比特流中的位为第一位时,该数据产生装置获取该输出比特流的后续N位,并暂存至该缓冲器中且将的输出,该数据产生装置判定该输出比特流中的位为第二位时,则将该缓冲器中暂存的数据输出。 According to another aspect of the present invention, the present invention provides an image decompression device in an embedded system, including a data provider, a data generating device and a buffer. The data provider is used to continuously output the output bit stream; the data generating device is connected to the data provider to generate data according to the output bit stream output by the data provider; the buffer is used to temporarily store the data generated by the data generating device The data; wherein, when the data generation device determines that the bit in the output bit stream is the first bit, the data generation device obtains the subsequent N bits of the output bit stream, and temporarily stores them in the buffer and outputs the output, When the data generating device judges that the bit in the output bit stream is the second bit, it outputs the data temporarily stored in the buffer. the

依据本发明的再一方面,本发明提出一种嵌入式系统中的图像压缩方法,其对图像文件进行压缩,该方法包括下列步骤:(A)初始化参考值;(B)读取该图像文件的一组N位图像数据;(C)比较该N位图像数据及该参考值;(D)当步骤(C)判定该N位图像数据等于该参考值时,将第一位输出并串接至输出比特流;(E)当步骤(C)判定该N位图像数据不等于该参考值时,将第二位及该N位图像数据输出并串接至该输出比特流;(F)判断是否读取至该图像文件尾端,若否,重复执行步骤(B)。 According to another aspect of the present invention, the present invention proposes an image compression method in an embedded system, which compresses an image file, and the method includes the following steps: (A) initializing a reference value; (B) reading the image file A group of N-bit image data; (C) compare the N-bit image data and the reference value; (D) when step (C) judges that the N-bit image data is equal to the reference value, the first bit is output and concatenated to the output bit stream; (E) when step (C) judges that the N-bit image data is not equal to the reference value, the second bit and the N-bit image data are output and connected in series to the output bit stream; (F) judging Whether to read to the end of the image file, if not, repeat step (B). the

依据本发明的又一方面,本发明提出一种嵌入式系统中的图像解压缩方法,其对压缩图像数据流进行解压缩,该方法包括下列步骤:(A)初始化参考值;(B)读取该压缩图像数据流的位;(C)判断该位是否为第一位;(D)当步骤(C)判定该位为第一位时,输出该参考值;(E)当步骤(C)判定该位不为第一位时,输出该压缩图像数据流的接续N位;(F)判断是否读取至该压缩图像数据流尾端,若否,重复执行步骤(B)。 According to yet another aspect of the present invention, the present invention proposes a kind of image decompression method in the embedded system, and it decompresses the compressed image data flow, and the method comprises the following steps: (A) initializing reference value; (B) reading Get the bit of this compressed image data stream; (C) judge whether this bit is the first bit; (D) when step (C) judges that this bit is the first bit, output this reference value; (E) when step (C) ) When judging that this bit is not the first bit, output the continuation N bits of the compressed image data stream; (F) judge whether to read to the end of the compressed image data stream, if not, repeat step (B). the

附图说明Description of drawings

图1是本发明用于嵌入式系统的图像压缩装置的方块图。 FIG. 1 is a block diagram of an image compression device used in an embedded system according to the present invention. the

图2是本发明用于嵌入式系统的图像压缩装置的运行示意图。 Fig. 2 is a schematic diagram of the operation of the image compression device used in the embedded system according to the present invention. the

图3是本发明用于嵌入式系统的图像压缩方法的流程图。 Fig. 3 is a flow chart of the image compression method used in the embedded system according to the present invention. the

图4是本发明用于嵌入式系统的图像解压缩装置的方块图。 Fig. 4 is a block diagram of an image decompression device used in an embedded system according to the present invention. the

图5是本发明用于嵌入式系统的图像解压缩方法的流程图。 Fig. 5 is a flow chart of the image decompression method used in an embedded system according to the present invention. the

主要元件符号说明 Description of main component symbols

数据提供器        110   锁存器          120 data provider 110latch 120

比较器            130   数据封装器      140 Comparator 130 Data Wrapper 140

数据提供器        310   数据产生装置    320 data provider 310data generating device 320

缓冲器            330 Buffer 330

具体实施方式Detailed ways

图1是本发明用于嵌入式系统的图像压缩装置的方块图,包括数据提供器110、锁存器120、比较器130及数据封装器140。 FIG. 1 is a block diagram of an image compression device for an embedded system of the present invention, including adata provider 110 , alatch 120 , acomparator 130 and adata encapsulator 140 . the

该数据提供器110用于提供多组N位图像数据。该数据提供器110为存储器。该存储器较佳为非易失性存储器,例如只读存储器(ROM)或闪速存储器(Flash)。于其他实施例中,该存储器可为静态随机存取存储器(SRAM),以暂存该多组N位图像数据。其中,该N值优选为4或8。 Thedata provider 110 is used for providing multiple sets of N-bit image data. Thedata provider 110 is a memory. The memory is preferably a non-volatile memory, such as read only memory (ROM) or flash memory (Flash). In other embodiments, the memory may be a static random access memory (SRAM) to temporarily store the sets of N-bit image data. Among them, the N value is preferably 4 or 8. the

该锁存器120连接至该数据提供器110,以锁存该数据提供器110输出的N位图像数据。 Thelatch 120 is connected to thedata provider 110 to latch the N-bit image data output by thedata provider 110 . the

该比较器130连接至该数据提供器110及该锁存器120,以对比该数据提供器110及该锁存器120的数据,从而产生指示信号EQ。该指示信号EQ具有第一状态及第二状态,其中,该第一状态代表该数据提供器110输出的数据与该锁存器120的数据相同。该第二状态代表该数据提供器110输出的数据与该锁存器120的数据不相同。 Thecomparator 130 is connected to thedata provider 110 and thelatch 120 to compare the data of thedata provider 110 and thelatch 120 to generate an indication signal EQ. The indication signal EQ has a first state and a second state, wherein the first state represents that the data output by thedata provider 110 is the same as the data of thelatch 120 . The second state represents that the data output by thedata provider 110 is different from the data of thelatch 120 . the

该数据封装器140连接至该比较器130及该数据提供器110,当该指示信号EQ为第一状态时,将第一位串接至输出比特流,当该指示信号为第二状态时,将第二位及数据提供器输出的N位图像数据串接至该输出比特流。其中,该第一位为位“0”,该第二位为位“1”。 The data encapsulator 140 is connected to thecomparator 130 and thedata provider 110, and when the indication signal EQ is in the first state, the first bit is serially connected to the output bit stream; when the indication signal is in the second state, The N-bit image data output by the second bit and data provider are concatenated to the output bit stream. Wherein, the first bit is bit "0", and the second bit is bit "1". the

该锁存器120具有LE(Latch Enale)脚位,其连接至该比较器130,以接收该指示信号EQ。当该指示信号EQ为第二状态时,该锁存器120锁存该数据提供器110输出的N位图像数据。当该指示信号EQ为第一状态时,该锁存器120维持先前的输出数据。 Thelatch 120 has an LE (Latch Enale) pin connected to thecomparator 130 to receive the indication signal EQ. When the indication signal EQ is in the second state, thelatch 120 latches the N-bit image data output by thedata provider 110 . When the indication signal EQ is in the first state, thelatch 120 maintains the previous output data. the

图2是本发明用于嵌入式系统的图像压缩装置的运行示意图。在本实施例中,N值为4以说明压缩及解压缩过程。该数据提供器110 依序输出“5H”、“5H”、“5H”、“AH”、“AH”及“AH”数据。一开始,该锁存器120的输出被初始化为“0H”。由于该数据提供器110的输出数据(“5H”)不等于该锁存器120的输出数据(“0H”),所以该比较器的指示信号EQ为第二状态。该数据封装器140将第二位(位“1”)及数据提供器输出的N位图像数据串接至该输出比特流。图2的“&”代表VHDL语言中的串接运算符(Concatenate Operator)。因为该指示信号EQ为第二状态,所以该锁存器120锁存该数据提供器110输出的4位图像数据(“5H”)。 Fig. 2 is a schematic diagram of the operation of the image compression device used in the embedded system according to the present invention. In this embodiment, the value of N is 4 to illustrate the compression and decompression process. Thedata provider 110 sequentially outputs "5H", "5H", "5H", "AH", "AH" and "AH" data. Initially, the output of thelatch 120 is initialized to "0H". Since the output data (“5H”) of thedata provider 110 is not equal to the output data (“0H”) of thelatch 120 , the indication signal EQ of the comparator is in the second state. The data encapsulator 140 concatenates the second bit (bit "1") and the N-bit image data output by the data provider into the output bit stream. The "&" in Figure 2 represents the concatenation operator (Concatenate Operator) in the VHDL language. Because the indication signal EQ is in the second state, thelatch 120 latches the 4-bit image data (“5H”) output by thedata provider 110 . the

由于该数据提供器110的第二个输出数据(“5H”)等于该锁存器120的输出数据(“5H”),所以该比较器的指示信号EQ为第一状态。该数据封装器140将第一位(“0”)串接至该输出比特流。因为该指示信号EQ为第一状态,所以该锁存器120维持此前的输出数据。 Since the second output data (“5H”) of thedata provider 110 is equal to the output data (“5H”) of thelatch 120 , the indication signal EQ of the comparator is in the first state. The data encapsulator 140 concatenates the first bit ("0") to the output bit stream. Because the indication signal EQ is in the first state, thelatch 120 maintains the previous output data. the

该数据提供器110的第三个输出数据(“5H”)等于该锁存器120的输出数据(“5H”),所以该比较器的指示信号EQ为第一状态。该数据封装器140将“0”串接至该输出比特流。因为该指示信号EQ为第一状态,所以该锁存器120维持此先前的输出数据。 The third output data (“5H”) of thedata provider 110 is equal to the output data (“5H”) of thelatch 120 , so the indication signal EQ of the comparator is in the first state. The data encapsulator 140 concatenates "0"s to the output bit stream. Because the indication signal EQ is in the first state, thelatch 120 maintains the previous output data. the

该数据提供器110的第四个输出数据(“AH”)不等于该锁存器120的输出数据(“5H”),所以该比较器的指示信号EQ为第二状态。该数据封装器140将第二位(位“1”)及数据提供器输出的N位图像数据串接至该输出比特流。因为该指示信号EQ为第二状态,所以该锁存器120锁存该数据提供器110输出的4位图像数据(“AH”)。 The fourth output data (“AH”) of thedata provider 110 is not equal to the output data (“5H”) of thelatch 120 , so the indication signal EQ of the comparator is in the second state. The data encapsulator 140 concatenates the second bit (bit "1") and the N-bit image data output by the data provider into the output bit stream. Because the indication signal EQ is in the second state, thelatch 120 latches the 4-bit image data (“AH”) output from thedata provider 110 . the

其他数据的压缩过程与上述相同,在此不以赘述。由图2可知,原先24位的图像数据经压缩后变为14位。由于图像数据相似性极高,因此本发明可以达到图像数据压缩的目的。 The compression process of other data is the same as above, and will not be repeated here. It can be seen from Figure 2 that the original 24-bit image data becomes 14-bit after being compressed. Because the similarity of image data is extremely high, the present invention can achieve the purpose of image data compression. the

图3进一步说明本发明用于嵌入式系统的图像压缩方法的流程。其用于对图像文件进行压缩,该图像压缩方法是无损压缩(Loseless)方法。该图像文件具有多组N位图像数据。参考图1所示的方块图,该方法首先在步骤(A)中初始化参考值,将参考值Vref初始化为“0H”。在步骤(B)中读取该图像文件的一组N位图像数据。在步骤(C)中比较该N位图像数据及该参考值。 FIG. 3 further illustrates the flow of the image compression method for embedded systems of the present invention. It is used to compress image files, and the image compression method is a lossless compression (Loseless) method. The image file has multiple sets of N-bit image data. Referring to the block diagram shown in FIG. 1, the method first initializes a reference value in step (A), and initializes the reference value Vref to "0H". A set of N-bit image data of the image file is read in step (B). The N-bit image data and the reference value are compared in step (C). the

当步骤(C)判定该N位图像数据等于该参考值时,在步骤(D)中输出第一位(“0”)串接至输出比特流。当步骤(C)判定该N位图像数据不等于该参考值时,在步骤(E)中,将第二位(“1”)及该N位图像数据输出并串接至该输出比特流。在步骤(E1)中设定该参考值Vref为该N位图像数据。 When the step (C) determines that the N-bit image data is equal to the reference value, the first bit ("0") is output in step (D) and concatenated to the output bit stream. When step (C) determines that the N-bit image data is not equal to the reference value, in step (E), the second bit (“1”) and the N-bit image data are output and concatenated into the output bit stream. In step (E1), the reference value Vref is set as the N-bit image data. the

在步骤(F)中判断是否读取到该图像文件尾端,若否,重复执行步骤(B)。若是,则结束图像压缩流程。 In step (F), it is judged whether the end of the image file has been read, and if not, step (B) is repeatedly executed. If yes, end the image compression process. the

图4是本发明用于嵌入式系统的图像解压缩装置的方块图,其包括数据提供器310、数据产生装置320及缓冲器330。 FIG. 4 is a block diagram of an image decompression device for an embedded system according to the present invention, which includes adata provider 310 , adata generating device 320 and abuffer 330 . the

该数据提供器310用于连续输出输出比特流。该数据提供器310可以是具有序列输出的存储器或先进先出缓冲器。该数据产生装置320连接至该数据提供器310,以根据该数据提供器所输出的输出比特流而产生数据。该缓冲器330用于暂存该数据产生装置320所产生的数据。 Thedata provider 310 is used to continuously output the output bit stream. Thedata provider 310 may be a memory with serial output or a first-in first-out buffer. Thedata generating device 320 is connected to thedata provider 310 to generate data according to the output bit stream output by the data provider. Thebuffer 330 is used for temporarily storing the data generated by thedata generating device 320 . the

当该数据产生装置320判定该输出比特流中的一位为第二位(“1”)时,该数据产生装置320撷取该输出比特流的后续N位,并暂存至该缓冲器330中且将的输出,该数据产生装置320判定该输出比特流中的一位为第一位(“0”)时,则将该缓冲器中暂存的数据输出的。其中,该N值优选为4或8。 When thedata generating device 320 determines that one bit in the output bit stream is the second bit ("1"), thedata generating device 320 extracts the subsequent N bits of the output bit stream and temporarily stores them in thebuffer 330 When thedata generation device 320 determines that one bit in the output bit stream is the first bit ("0"), it outputs the data temporarily stored in the buffer. Among them, the N value is preferably 4 or 8. the

图5进一步说明本发明用于嵌入式系统的图像解压缩方法的流程图。其是在嵌入式系统中对图像文件进行解压缩,该图像文件具有多组N位图像数据。配合图4所示的方块图,该方法首先在步骤(A)中初始化参考值,是将参考值Vref初始化为“0H”。在步骤(B)中读取该压缩图像数据流的一位。在步骤(C)中判断该位是否为第一位(“0”)。 Fig. 5 further illustrates the flow chart of the image decompression method used in the embedded system of the present invention. It is to decompress the image file in the embedded system, and the image file has multiple sets of N-bit image data. In accordance with the block diagram shown in FIG. 4 , the method first initializes the reference value in step (A), which is to initialize the reference value Vref to "0H". One bit of the compressed image data stream is read in step (B). In step (C) it is judged whether the bit is the first bit ("0"). the

当步骤(C)判定该位为第一位时,在步骤(D)中输出该参考值。当步骤(C)判定该位不为第一位时,在步骤(E)中输出该压缩图像数据流的接续N位。在步骤(E1)中设定该参考值为所读取的该压缩图像数据流的N位。 When step (C) determines that the bit is the first bit, the reference value is output in step (D). When step (C) determines that the bit is not the first bit, output the next N bits of the compressed image data stream in step (E). In step (E1), the reference value is set to N bits of the read compressed image data stream. the

在步骤(F)中判断是否读取至该压缩图像数据流尾端,若否,重复执行步骤(B)。若是,则结束图像解压缩流程。 In step (F), it is judged whether the end of the compressed image data stream has been read, and if not, step (B) is repeatedly executed. If yes, end the image decompression process. the

由上述说明可知,本发明使用一位以记录数据提供器110的输出数据与锁存器120的输出数据是否相同,若相同,则将第一位(“0”)串接至输出比特流,若不相同,则将第二位(“1”)及该N位图像数据输出并串接至该输出比特流。而现有的Run Length编码系将一连串相同的数据改成以两个字节来表示,前一个字节代表该串数据的长度(亦即重复次数),后面一个字节则用于记录数据。而差分编码则使用预估值与实际值之间的差值作为压缩的依据。本发明的技术与现有的RunLength编码及差分编码均不相同,且其算法较为简单,特别适合在嵌入式系统中。 It can be seen from the above description that the present invention uses one bit to record whether the output data of thedata provider 110 and the output data of thelatch 120 are the same, and if they are the same, the first bit ("0") is serially connected to the output bit stream, If not, the second bit (“1”) and the N-bit image data are output and concatenated to the output bit stream. The existing Run Length coding system changes a series of identical data into two bytes to represent, the previous byte represents the length of the string of data (that is, the number of repetitions), and the latter byte is used to record the data. Differential encoding uses the difference between the estimated value and the actual value as the basis for compression. The technology of the present invention is different from the existing RunLength coding and differential coding, and its algorithm is relatively simple, which is especially suitable for embedded systems. the

由以上的说明可知,本发明是嵌入式系统内的图像压缩解压缩装置及方法利用图像邻近点具有高度相似性的特点而对图像文件进行压缩及解压缩,以降低图像的数据量,从而减少在嵌入式系统中存储器的使用量。同时,本发明的压缩及解压缩技术由于其算法简单,可轻易以硬件电路来实现,或是在嵌入式系统中执行图像压缩或解压缩时,可减少嵌入式处理器计算能力需求。 As can be seen from the above description, the present invention uses the image compression and decompression device and method in the embedded system to compress and decompress image files by using the characteristics of high similarity between adjacent points of the image, so as to reduce the amount of image data, thereby reducing Memory usage in embedded systems. At the same time, the compression and decompression technology of the present invention can be easily realized by hardware circuit due to its simple algorithm, or when performing image compression or decompression in an embedded system, it can reduce the computing power requirement of the embedded processor. the

上述实施例仅为了方便说明而举例而已,本发明所主张的权利范围应以权利要求所述为准,而非仅限于上述实施例。 The above-mentioned embodiments are only examples for convenience of description, and the scope of rights claimed by the present invention should be determined by the claims, rather than limited to the above-mentioned embodiments. the

Claims (11)

CN2006101629181A2006-11-292006-11-29 Image compression and decompression device and method for embedded systemExpired - Fee RelatedCN101192304B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN2006101629181ACN101192304B (en)2006-11-292006-11-29 Image compression and decompression device and method for embedded system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN2006101629181ACN101192304B (en)2006-11-292006-11-29 Image compression and decompression device and method for embedded system

Publications (2)

Publication NumberPublication Date
CN101192304A CN101192304A (en)2008-06-04
CN101192304Btrue CN101192304B (en)2011-05-25

Family

ID=39487278

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN2006101629181AExpired - Fee RelatedCN101192304B (en)2006-11-292006-11-29 Image compression and decompression device and method for embedded system

Country Status (1)

CountryLink
CN (1)CN101192304B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113971702A (en)*2021-10-292022-01-25深圳市道通科技股份有限公司 A kind of picture compression method, decompression method and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1250565A (en)*1997-01-172000-04-12艾利森电话股份有限公司Encoder and decoder
CN1554190A (en)*2001-07-112004-12-08D・基尔班克 Systems and methods for compressing data

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1250565A (en)*1997-01-172000-04-12艾利森电话股份有限公司Encoder and decoder
CN1554190A (en)*2001-07-112004-12-08D・基尔班克 Systems and methods for compressing data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JP昭57-19857A 1982.02.02
JP昭58-16344A 1983.01.31

Also Published As

Publication numberPublication date
CN101192304A (en)2008-06-04

Similar Documents

PublicationPublication DateTitle
US8933825B2 (en)Data compression systems and methods
US7492290B1 (en)Alternative encoding for LZSS output
US9077368B2 (en)Efficient techniques for aligned fixed-length compression
US8988257B2 (en)Data compression utilizing variable and limited length codes
WO2019153700A1 (en)Encoding and decoding method, apparatus and encoding and decoding device
US9479194B2 (en)Data compression apparatus and data decompression apparatus
US5874908A (en)Method and apparatus for encoding Lempel-Ziv 1 variants
JP2018520576A (en) Method, apparatus and system for data compression and decompression of semantic values
US20200294629A1 (en)Gene sequencing data compression method and decompression method, system and computer-readable medium
CN104811209B (en)A kind of the compressed file data embedding method and device of anti-most long matching detection
CN114520659A (en)Method for lossless compression and decoding of data by combining rANS and LZ4 encoding
Kim et al.Hardware-accelerated fast lossless compression based on LZ4 algorithm
CN101192304B (en) Image compression and decompression device and method for embedded system
CN112449191B (en) Method for compressing multiple images, method and device for decompressing images
Mamun et al.Hardware Approach of Lempel-Ziv-Welch Algorithm for Binary Data Compression
Ambadekar et al.Advanced data compression using J-bit Algorithm
Shravana et al.Review on lossless data compression using x-matchpro algorithm
CN111342844B (en)LZW coding and improved run-length coding-based radar data lossless compression and decompression method
Huang et al.Hardware design for accelerating PNG decode
JP3143029B2 (en) Data compression method and device, and data decompression method and device
Rani et al.An Enhanced Text Compression System Based on ASCII Values and Huffman Coding
SMADI et al.A MODIFIED LEMPEL-ZIV WELCH SOURCE CODING ALGORITHM FOR EFFICIENT DATA COMPRESSION.
TW200824465A (en)Device and method of image compression and decompression for embedded system
Raza et al.Implementation of LZW Algorithm for Binary Lossless Data Compression
JPH08116271A (en)Data compression method, its device, data expansion method and its device

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20110525

Termination date:20161129


[8]ページ先頭

©2009-2025 Movatter.jp