TW424208B - Real-time compression/decompression method for scanned image - Google Patents

Real-time compression/decompression method for scanned image Download PDF

Info

Publication number
TW424208B
TW424208B TW88104515A TW88104515A TW424208B TW 424208 B TW424208 B TW 424208B TW 88104515 A TW88104515 A TW 88104515A TW 88104515 A TW88104515 A TW 88104515A TW 424208 B TW424208 B TW 424208B
Authority
TW
Taiwan
Prior art keywords
byte
code
bits
bit
read
Prior art date
Application number
TW88104515A
Other languages
Chinese (zh)
Inventor
Huang-Tsuen Chen
Original Assignee
Mustek Systems 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 Mustek Systems Inc filed Critical Mustek Systems Inc
Priority to TW88104515A priority Critical patent/TW424208B/en
Application granted granted Critical
Publication of TW424208B publication Critical patent/TW424208B/en

Links

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

During the encoding of the compression method of the present invention, the format of each byte is set to have an identification code (2 bits) and a counting code (6 bits) and, by a bit plane, the read data are divided into a high bit plane and a low bit plane for separation process. When reading the output data of the A/D converter, each byte can read no more than 63 (2<6>-1) bits. The identification code of each byte represents the code properties of the bit, such as high/low bit and non-encoded bit. The counting code represents the accumulative number of consecutive bits having the same code properties. After encoding, bytes will be outputted to a random access memory for the host access. During decompression, the host will access the data stored in the random access memory and a buffer that can store at least 63 bytes is provided to register the decompressed data. Therefore, it only needs to check the identification code of a byte during decompression before knowing whether the code represents a high/low bit or a non-encoded bit. Then, according to the figure indicated by the counting code, the data can be written sequentially into the corresponding position in the buffer to complete the whole decompression procedure. After decompression, all of the image data stored in the buffer can be outputted for further processing.

Description

A7 B7 經濟部中央標準局員工消費合作社印製 424208 五、發明説明() 5—1發明領域及背景 A_發明領域 本發明係為一種掃描影像壓縮/解壓縮方法,尤指一種 利用位元(b i t)為讀取單元的掃描影像壓縮/解壓縮方法, 以提高重複數碼的可能性’並適用於未來1 2、1 4或更高位 元解析的類比/數位轉換裝置。 B .發明背景 影像壓縮/解壓縮之技術的主要目的不外於加速影像傳 遞的速度。應用於掃描器(scanner)的壓縮/解壓縮技術, 便是應用在掃描器與電腦主機之間的傳遞,以增快影像傳 送至主機的速度。當掃描的影像經過類比/數位轉換裝置轉 換成數位資料後’便可開始進行影像的壓縮。壓縮後的影 像資料傳送到一隨機存取記憶體,以供主機存取。主機.便 開始執行解壓縮,待整個影像完成解壓縮後便可輸出至螢 幕,供使用者作進一步的處理。 習知之掃描影像的處理在讀取類比/數位轉換裝置所輸 出之影像資料時’皆以8位元(bit)為單位來處理,亦即每 次只讀取8個位元,再針對所讀取之位元組的特性來壓縮/ 解壓縮。此讀取方法比較不具彈性,且當類比,數位轉換裝 置的解析已從原先之8位元提昇至12、14或更高位元時, 此讀取方式將無法適用。而且,每次皆以8位元為處理單 位’由於失真處理的關係’容易產生如碼賽克的現象B甚 本紙張尺度適用中國國家標準(CNS) A_4規格(210&gt;&lt;297公釐) (請先鬩讀背面之注-意事項再填寫本頁)A7 B7 Printed by the Consumer Cooperatives of the Central Standards Bureau of the Ministry of Economic Affairs 424208 V. Description of the Invention (5-1) Fields and Background of the Invention A_ Field of the Invention The present invention is a method for compressing / decompressing scanned images, especially a method using bit ( bit) is a scanning image compression / decompression method of the reading unit to increase the possibility of repetitive digitals' and is applicable to analog / digital conversion devices for future 1, 2, 14 or higher bit resolution. B. BACKGROUND OF THE INVENTION The main purpose of image compression / decompression technology is to accelerate the speed of image transmission. The compression / decompression technology applied to the scanner is applied between the scanner and the host computer to increase the speed of the image transmission to the host computer. When the scanned image is converted into digital data by an analog / digital conversion device, image compression can begin. The compressed image data is sent to a random access memory for host access. The host starts to perform decompression. After the entire image is decompressed, it can be output to the screen for further processing by the user. The conventional scanning image processing is performed in 8-bit units when reading the image data output by the analog / digital conversion device, that is, only 8 bits are read at a time, and then for the read Take the characteristics of the bytes to compress / decompress. This reading method is relatively inflexible, and when the parsing of the digital conversion device has been upgraded from the original 8-bit to 12, 14 or higher, this reading method will not be applicable. Moreover, every time the 8-bit processing unit is used “because of the distortion processing”, it is easy to produce phenomena such as code sec. B The paper size is applicable to China National Standard (CNS) A_4 specifications (210 &gt; &lt; 297 mm) (Please read the note-attention on the back before filling out this page)

經濟部令央標準局員工消費合作社印製 五、發明説明()Printed by the Staff Consumer Cooperative of the Central Bureau of Standards of the Ministry of Economic Affairs

且’ 8位元的資料量小,其位元的重複性也相對較小,壓 縮的效率也較差D 5 — 2發明目的及概述 本發明之主要目的在提出一種不會產生碼賽克現象的影 像壓縮/解壓縮方法’並可使壓縮時尋得重複數碼之可能性 提高’進而達到快速壓縮/解壓縮的目的。 本發明之另一目的在提出一種不受限於類比/數也轉換 裝置之解析效率的影像壓縮/解壓縮方法,以使掃描影像之 壓縮/解壓縮的方法可適用於未來12、14或更高位元解析 的類比/數位轉換裝置。 依據上述之目的,本發明之壓縮方法在編碼時,先設定 每一位元組(byte)的格式為具有識別碼(2 biu),及 計數碼(6 bits)兩部份。並將讀取的資料以位元平面, 區分高位元平面及低位元平面分別來處理。在讀取類比/數 位轉換裝置所輸出之資料時’每—位元组最多可讀取63 (2«-1)個位元。每一位元组的識别碼代表該位元的編碼 性質’如高/低位元或未編碼的資料。而計數碼部份則累計 連續之同一性質之編碼的位元數。編碼完成後便將位元組 輸出至一隨機存取記憶體供主機存取。 在解壓縮時’主機便存取隨機存取記憶體中的資料。同 時’並有-可至少容納63位元組的緩衝器,以供暫存解壓 本紙張尺度適用中國國家標準(CNS ) A4規格(210X29955~y (請先閱讀背面之注意事.項#'填寫本頁)Moreover, the amount of data of 8 bits is small, the bit repeatability is relatively small, and the efficiency of compression is also poor. D 5-2 Purpose of the invention and summary The main purpose of the invention is to propose a method that does not produce the code sike phenomenon. The image compression / decompression method 'can increase the possibility of finding duplicate digitals when compressing', thereby achieving the purpose of rapid compression / decompression. Another object of the present invention is to propose an image compression / decompression method that is not limited to the analysis efficiency of the analog / digital conversion device, so that the method for compressing / decompressing scanned images can be applied to the future 12, 14, or more. High-bit resolution analog / digital conversion device. According to the above purpose, in the compression method of the present invention, when encoding, first set the format of each byte to have an identification code (2 biu) and a counting code (6 bits). The read data is processed with a bit plane, distinguishing between a high bit plane and a low bit plane. When reading the data output by the analog / digital conversion device, a maximum of 63 (2 «-1) bits can be read per byte. The identification code of each byte represents the encoding properties of the bit, such as high / low bits or uncoded data. The count code part accumulates the number of consecutive encoded bits of the same nature. After the encoding is completed, the bytes are output to a random access memory for the host to access. When decompressed, the host accesses the data in random access memory. At the same time, there is a buffer that can hold at least 63 bytes for temporary storage and decompression. This paper size applies the Chinese National Standard (CNS) A4 specification (210X29955 ~ y (please read the note on the back first. Item # ') (This page)

經濟部中央梯準局員工消費合作社印製 Ο 8 Α7 · Β7 五、發明説明() -- 縮後之資料。解壓縮時,只要査詢位元组的識別碼,便可 知道其編碼代表的是高/低位元或未編碼的資料。然後再依 照其計數碼的數目,依序填入缓衝器中相對應的位置中, 如此便可完成解壓縮的程序。完成後,便可輸出整個緩衝 器的影像資料,以供使用者作更進一步的處理。 5 _ 3圖式之簡單說明 圖1A顯示本發明之編碼的位元組格式。 圖1 B顯示本發明之編碼的位元組的識別碼種類。 圖2A顯示位元平面的處理方式示意圖a 圖2B顯示位元平面的處理方式的另一示意圖。 圖3顯示本發明之壓縮的流程圖。 圖4顯示本發明之解壓縮的流程圖。 5 — 4本發明之詳細說明 為根本打破習用之影像資料的讀取方式,本發明先定義 編碼之位元組(byte)的格式,如圖1A所示。在一位元 組中,前兩個位元代表識別碼1 1,後6個位元則代表計數 碼1 2。識別碼1 1有兩個位元,因此可有4種組合,如圖1 B 所示。其中,「00」表示該位元組中所編碟的皆為高位元 的資料,即” 1 ”。「0 1」表示該位元組中所編碼的為低位 元的資料,即” 0 ”。「1 0」表示該位元組中的資料皆是尚 未編碼的資料,即原始資料例如,當影像資料的重複性 很低時,便不須經過編碼,可直接輸出。「1 1」則代表備 用’尚未定義。當然’這四種可能的組合及定義可因人而 本紙張尺度適用中國國家標準(CNS ) A4規格(210X297^ ) {諳先閲讀背面之注意事項再填寫本頁)Printed by the Consumer Cooperatives of the Central Government Bureau of the Ministry of Economic Affairs 〇 8 Α7 · Β7 V. Description of the invention ()-the shortened information. When decompressing, as long as the byte identification code is queried, it can be known that its encoding represents high / low bits or unencoded data. Then according to the number of counting codes, fill in the corresponding positions in the buffer in order, so that the decompression process can be completed. After completion, the image data of the entire buffer can be output for further processing by the user. 5_3 Brief Description of the Schematic Figure 1A shows the encoded byte format of the present invention. FIG. 1B shows the types of identification codes of the encoded bytes of the present invention. FIG. 2A shows a schematic diagram of a processing method of a bit plane. FIG. 2B shows another schematic diagram of a processing method of a bit plane. FIG. 3 shows a compression flow chart of the present invention. FIG. 4 shows a decompression flowchart of the present invention. 5-4 Detailed description of the present invention In order to completely break the conventional way of reading image data, the present invention first defines the format of encoded bytes, as shown in FIG. 1A. In a byte, the first two bits represent the identification code 1 1 and the last six bits represent the count code 1 2. The identification code 1 1 has two bits, so there are 4 combinations, as shown in Figure 1B. Among them, "00" indicates that the data in the byte is all high-bit data, that is, "1". "0 1" indicates the low-bit data encoded in the byte, that is, "0". "1 0" indicates that the data in the byte are all uncoded data, that is, the original data. For example, when the repetitiveness of the image data is very low, it can be directly output without coding. "1 1" means standby 'has not been defined. Of course, these four possible combinations and definitions can vary from person to person. This paper size applies the Chinese National Standard (CNS) A4 specification (210X297 ^) {谙 Read the precautions on the back before filling this page)

A7 B7 經濟部中央梯準局負工消費合作社印f. 〇 8 i、發明説明() 異,只要能分別代表高位元,低位元,及未編碼等三種類 別即可。 每筆編碼的位元組有8位元,去除前兩位元的識別碼 後,所剩的6個位元,可用來記錄編碼時連續的同一性質 編碼的數目。因此,6個位元最多可記錄63 (之、】)個編 碼的位元。例如,”0011111 V,便表示有連續63個高位元 (&quot;1”)的影像資料。而,”〇1001111,,便表示有連續3〇 個低位元(” ”)的影像資料。 另外,本發明採用「位元平面切片」的觀念來處理每一 筆讀取的影像資料。依據「位元平面切片」的技術,若一 個影像中的每個像素是以8位元表示,便可將影像當作由 八個1位元的平面所構成,如圖2A所示。其範圍由最不重 要的位元平面0至最重要的位元平面7 ^依據8位元的二進 位組’平面0包含組成影像像素二進位的所有最低位元, 平面7則包含所有組成影像像素二進位的所有最高位元。 如圖2B所示,讀入的每一位元组的各個位元將由高而低分 別處理。也就是,處理位元的順序是 [A7][B7][C7J... [A6][B6][C6]... [A5][B5][C5]... [A4] [B4HC4]... [A3][B3][C3]... [A2][B2][C2]...[A1 ][B1] [C1 ]…【AO]【BO][CO]…。 依此原理,一張影像若以其中之一種位元平面影像來呈 現,則8個位元平面將顯示出完全不同的影像。高位元平 本紙張尺度適用中國國家標準(CNS ) A4規格(210X297杳釐) (請先閲讀背面之注意事l-fi--·填寫本買)A7 B7 Printed by the Central Laboratories of the Ministry of Economic Affairs, Consumer Cooperatives f. 〇 8 i. Description of the invention () Different, as long as they can represent the three types of high bit, low bit, and uncoded. Each encoded byte has 8 bits. After removing the first two bits of the identification code, the remaining 6 bits can be used to record the number of consecutive encodings of the same nature. Therefore, up to 63 (of,]) coded bits can be recorded with 6 bits. For example, "0011111 V" means that there are 63 consecutive high-order (&quot; 1 ") image data. However, "〇1001111," means that there are 30 consecutive low-order image data (""). In addition, the present invention uses the concept of "bit plane slice" to process each read image data. According to the "bit plane slice" technology, if each pixel in an image is represented by 8 bits, the image can be regarded as consisting of eight 1-bit planes, as shown in Figure 2A. Its range is from the least significant bit plane 0 to the most significant bit plane 7 ^ According to the 8-bit binary group 'plane 0 contains all the lowest bits that make up the image pixel binary, plane 7 contains all the constituent images All highest bits of a pixel binary. As shown in FIG. 2B, each bit of each byte read will be processed from high to low. That is, the order of processing bits is [A7] [B7] [C7J ... [A6] [B6] [C6] ... [A5] [B5] [C5] ... [A4] [B4HC4] ... [A3] [B3] [C3] ... [A2] [B2] [C2] ... [A1] [B1] [C1]… [AO] [BO] [CO]…. According to this principle, if an image is presented as one of the bit plane images, the 8 bit planes will display completely different images. High bit level This paper size is applicable to Chinese National Standard (CNS) A4 specification (210X297mm) (Please read the notice on the back first l-fi-- · fill in this purchase)

A7 B7 4〜〇8 五、發明説明() (請先閣讀背面.y注意事1#填寫本頁) 面的可壓縮性較高,而低位元平面的資料重覆性較小,因 此壓縮較困難。對於最後三個低位元的位元平面資料,可 以不必編碼而直接傳遞。或是在傳遞高位元平面的資料 後’再以亂數方式補充低位元平面的資料,以降低解壓後 資料的失真率。此為熟習該項技術者所常用的技術,其目 的在只針對壓縮效率大的影像進行壓縮。 依據上述之編碼格式及位元平面的處理方法,本發明之 方法每次讀取的資料最多為63個位元組,因為有6個位元 最多可記錄63筆資料,而每筆資料當作8個位元平面來處 理,所以每次處理的區塊便有6 3位元組。 本發明之壓縮方法的詳細步驟如圖3所示: 301 :讀取類比/數位轉換裝置所輪出之資料; 3 0 2 由於影像的處理是依序—條一條地處理,因此將每 一條掃描的影像,以6 3個位元组為一區塊,分成數 個處理區塊; 經濟部中央標準局員工消費合作社印裂 303 :依序處理所讀取之區塊的資料,其處理程序如下. 3031 :依序讀取類比/數位轉換裝置所輸出的6個位元. 3032 :判斷此6個位元的屬性?當此6個位元皆為,,時 執行步驟3033 ;當此6個位元皆為時,執^步 驟3034;其它情況時,執行步驟3035; &quot; 3 0 3 3 :設定該位元組的識別碼為” 〇 〇 ”,並將該計數 # .為二進位的”11”’並執行步驟~ 本紙張尺度適用中國國家標準(CNS ) Α4規格(210Χ2Ε&gt;7?公楚) 424P〇b 經濟部中央標準局員工消費合作社印製 A7 B7 五、發明説明() 3 0 34 設疋該位疋組的識別碼為,,〇彳,,,並將該計數碼設 為一進位的11 ”,並執行步驟3036。 3035 ‘設定該位凡组的識別碼為,,彳〇,,,並執行步驟 3038 ; 3 0 3 6,判定下一位元是否為同值,或該計數碼的六個位元 皆為” 1 ” ?如果是,便執行步驟3 0 3 7 ;否則,便執 行步驟3038。 3037 :將該計數碼累進彳,並重覆執行步驟3(]36。 3 0 3 8 .輸出該位元組至—記憶裝置。 3039 :判斷是否已完成該區塊的處理?若是,則執行步驟 3 04 ;否則,執行步驟3〇31 ; 304 :判斷是否已完成所有區塊的處理?若是,則執行步 輝3 0 5 ;否則執行步驟3 〇 3。 305 :結束。 在步驟3 0 3 1,為增加資料的可壓縮性,可先將二進位 碼轉換成葛雷碼(gray code)。葛雷碼是對相鄰的位元 進行XOR的運算。由於葛雷碼有個獨特的性質,即經過葛 雷碼轉換後,相連的代碼字之間僅有一個位元不同。因 此,利用此特性,即使灰階有很小變化,也可在所有的位 元平面顯示出來,不會使畫面為一大片全黑或全白。 壓縮後的資料暫存在一隨機存取記憶體中,以供解壓縮 裝置來處理。解壓縮的方法乃相對於壓縮方法進行,其方 法如下,而且解壓縮須要至少6 3位元組的緩衝器儲存解壓 本紙張尺度適用中國國家標準(CMS ) A4規格(210X297你緩) (請先聞讀背面之注意事項再缜寫本頁) 訂A7 B7 4 ~ 〇8 V. Description of the invention () (please read the back. Y Caution 1 # fill in this page) The compressibility of the surface is high, but the data repetition of the low-bit plane is less, so the compression More difficult. The bit-plane data of the last three low-order bits can be directly transmitted without coding. Or, after the data of the high-bit plane is transmitted, the data of the low-bit plane is supplemented in a random manner to reduce the distortion rate of the decompressed data. This is a technique commonly used by those skilled in the art, and its purpose is to compress only images with high compression efficiency. According to the encoding format and bit plane processing method described above, the method of the present invention can read a maximum of 63 bytes of data each time, because there are 6 bits that can record a maximum of 63 pieces of data, and each piece of data is treated as 8-bit planes are used for processing, so each processing block has 63 bytes. The detailed steps of the compression method of the present invention are shown in FIG. 3: 301: Read the data rotated by the analog / digital conversion device; 3 0 2 Since the image processing is processed in order-one by one, each scan is scanned The image is divided into several processing blocks with 63 bytes as a block. The employee consumer cooperative of the Central Bureau of Standards of the Ministry of Economic Affairs prints 303. The data of the read blocks are processed in sequence. The processing procedure is as follows: 3031: Read the 6 bits output by the analog / digital conversion device in sequence. 3032: Determine the attributes of the 6 bits? When the 6 bits are all, go to step 3033; when the 6 bits are all, go to step 3034; in other cases, go to step 3035; &quot; 3 0 3 3: set the byte The identification code is "〇〇", and the count # is a binary "11" 'and the steps are performed ~ This paper size applies the Chinese National Standard (CNS) Α4 specification (210 × 2Ε &gt; 7? Chu) 424P〇b Printed by the Consumers' Cooperative of the Central Standards Bureau of the Ministry of Economic Affairs A7 B7 V. Description of the invention () 3 0 34 Set the identification code of this bit group to be, 〇 ,, and set the count code to a round 11 ” And execute step 3036. 3035 'Set the identification code of this bit group to ,, 彳 〇 ,, and perform step 3038; 3 0 3 6, determine whether the next bit is the same value, or six of the count code All bits are "1"? If yes, go to step 3 0 3 7; otherwise, go to step 3038. 3037: Accumulate the count code and repeat step 3 () 36. 3 0 3 8. Output the byte to the -memory device. 3039: Determine whether the processing of the block has been completed? If yes, execute step 3 04; Otherwise, execute step 3031; 304: Determine whether the processing of all blocks has been completed? If yes, execute step Hui 3 0 5; otherwise, execute step 3 03. 305: end. At step 3 0 3 1 In order to increase the compressibility of the data, you can first convert the binary code into a gray code. The gray code is an XOR operation on adjacent bits. Because of the unique nature of the gray code, That is, after Gray code conversion, there is only one bit difference between the connected code words. Therefore, using this feature, even if the gray level changes slightly, it can be displayed on all bit planes without making the screen It is a large piece of black or white. The compressed data is temporarily stored in a random access memory for processing by the decompression device. The decompression method is relative to the compression method. The method is as follows, and the decompression requires At least 63 bytes of buffer storage and decompression. The paper size is applicable to the Chinese National Standard (CMS) A4 specification (210X297). (Please read the precautions on the back before writing this page.) Order

^ 2 4 2 ο 五、發明説明( 縮後的資料。缓衝器的記憶體排列等同於壓縮前之影像資 料的排列。本發明之解壓縮的詳細步驟如下: {諳先聞讀背面之注意事項再填寫本頁) 401 ··依序讀取編碼的資料,每次讀取—位元組。 402 :由該位元組的識別竭,判斷該位元组的屬性。 403 :當該位元組的識別瑪為“〇〇”時,依據該位元組之 什數益所記錄之數,依序填入.等量的” 1 ”於緩衝器中 相對應的位置;即按照 [A7][B7][C7I...[A6][B6][C6]... [A0][B0][C0] …等順序’由高位元至低位元開始填入等量的,,。 404 :當該位元組的識別碼為“〇1,,時,依據該位元組之 計數器所記錄之數,依序填入等量的,,彳,,於緩衝器中 相 對應 的位置;即按 照 [A7][B7][C7]... [A6][B6][C6]... [A0][B0][C0] …等順序’由高位元至低位元開始填入等量 的,,0,,。 經濟部中央標準局員工消費合作社印製 4 0 5 :當該位元組的識別碼為“ 1 〇”時’則依序將該位元 組之計數碼的資料,存入緩衝器中相對應的位置。 由於此位元組尚未編碼,因此只要將計數碼的資料 填入相對的位置即可。例如,如果該位元組 為” 1 0 1 0 1 0 1 〇 ”,且代表第5位元的資料,則分別依 序將 ”101010” 填入[A5][B5][C5][D5]【E5] [F5]^ 2 4 2 ο 5. Description of the invention (condensed data. The memory arrangement of the buffer is equivalent to the arrangement of the image data before compression. The detailed steps of decompression of the present invention are as follows: {谙 Note on the back of the reading Please fill in this page for more information) 401 ·· Sequentially read the coded data, each time read-byte. 402: Determine the attributes of the byte from the identification of the byte. 403: When the identification mark of the byte is "〇〇", fill it in order according to the number recorded in the byte of the byte. The same amount of "1" in the corresponding position in the buffer ; That is, in the order of [A7] [B7] [C7I ... [A6] [B6] [C6] ... [A0] [B0] [C0]… etc. of,,. 404: When the identifier of the byte is "〇1,", fill in the corresponding positions in the buffer in the same amount according to the number recorded by the counter of the byte. ; That is, in the order of [A7] [B7] [C7] ... [A6] [B6] [C6] ... [A0] [B0] [C0]… and so on, 'fill in from high to low, etc. Quantitative ,, 0 ,,. Printed by the Consumer Cooperatives of the Central Standards Bureau of the Ministry of Economic Affairs 4 5 5: When the identification code of the byte is "1 0", then the data of the counting code of the byte is sequentially , Stored in the corresponding position in the buffer. Since this byte has not been encoded, as long as the data of the counting code is filled in the relative position. For example, if the byte is "1 0 1 0 1 0 1 〇 ", and the data representing the 5th bit, then fill in" 101010 "in order [A5] [B5] [C5] [D5] [E5] [F5]

中D 4 0 6 :判斷缓衝器是否已填滿?如果是,執行步騍4 〇 7 ; 否則,執行步驟401。 本紙張尺度適用中國國家標準(CNS) A4規格(2I0X297//;遵) A7 B7 經濟部中央橾準局員工消費合作社印製Middle D 4 0 6: Determine whether the buffer is full? If yes, go to step 407; otherwise, go to step 401. This paper size applies to China National Standard (CNS) A4 specifications (2I0X297 //; compliance) A7 B7 Printed by the Consumer Cooperatives of the Central Procurement Bureau of the Ministry of Economic Affairs

42420 B 五、發明説明() 407:輸出缓衝器中的資料。 408 ·判斷是否已完成所有資料的解壓縮?若是,執行步 驟409 ;否則,執行步驟4〇1。 409 :結束。 如此當每一區塊的影像資料還原後,便將緩衝器中的資 料輪入電腦主機,直至完成所有區埤的轉換。其中,若原 先的二進位碼已轉換為葛雷碼,在執行步驟4〇7時,由於 所解壓縮的是葛雷碼,必須先將葛.雷碼轉換為二進位碼, 才能將緩衝器中的資料輸入電腦。壓縮及解壓縮的步驟可 同時進行,只是必須以6 3個位元組為單位。當壓縮程式將 影像編碼為6 3個位元組,然後傳送至記憶裝置後,解壓縮 程式便可開始進行。由於壓縮時是以63個位元組為單位, 因此’解壓縮程式必須等到6 3個位元組都編碼完成後才可 進行。 本發明之方法可以軟體實施,也可將程式製作成特殊應 用晶片(A S丨C),來執行影像的壓縮及解壓縮。综上所 述’本發明之壓縮/解壓縮方法在讀取類比/數位轉換裝置 所輸出之資料時乃以位元(b i t )為單位,而非以位元组 (byte)為單位來處理,因此不但具有數碼變動小的優點, 而丑容易尋得同值性數碼,所以影像的壓縮效率較高。 ’另外,本發明之壓縮/解壓縮方法在影像漏失(丨〇ss)方 面’因可針對一或二個位元採取個別的處理,例如將2 5 5 本紙張尺度適用中國國家襟準(CNS ) A4規格(210X297i&amp;釐) (請先聞讀背面文注意事_項再填寫本頁}42420 B V. Description of the invention () 407: Data in output buffer. 408 · Determined whether all data have been decompressed? If yes, go to step 409; otherwise, go to step 401. 409: End. In this way, after the image data of each block is restored, the data in the buffer is rotated into the computer host until the conversion of all the regions is completed. Among them, if the original binary code has been converted into a Gray code, when performing step 407, because the decompressed is a Gray code, the Gray code must be converted into a binary code before the buffer can be converted. Enter the data in the computer. The compression and decompression steps can be performed simultaneously, but only in units of 63 bytes. When the compression program encodes the image into 63 bytes and then sends it to the memory device, the decompression program can begin. Since the compression is based on 63 bytes, the decompression program must wait until all 63 bytes have been encoded. The method of the present invention can be implemented by software, and the program can be made into a special application chip (A S 丨 C) to perform image compression and decompression. To sum up, the method of compression / decompression of the present invention reads the data output by the analog / digital conversion device in units of bits rather than bytes. Therefore, not only has the advantage of small digital fluctuations, but it is easy to find isomorphic digital, so the compression efficiency of the image is high. 'In addition, the compression / decompression method of the present invention in terms of image leakage (丨 〇ss)' can be treated individually for one or two bits, such as applying the 2 5 5 paper size to the Chinese National Standard (CNS) ) A4 specification (210X297i &amp; PCT) (Please read the notes on the back _ items before filling this page}

4242 Α7 Β7 五、發明説明() 階降低為128階或64階’使影像純化等,使用者並不容易 察覺且其改變較為柔和,不會產生習知類似馬賽克的現 象。甚且’本發明之I缩方法,可以選擇低位元(|〇w bit) 的傳送,W-條線(〇ne |jne)抽樣傳送,或以責任猶環週 期(duty cycle)的觀念重建,因此可視影像的傳輸量而 定’非常具有彈性β 以上所述僅為本發明之較佳實施例而已,且已達廣泛之 實用功效,凡依本發明申請專利範圍所作之均等變化與佟 飾,皆仍屬本發明專利涵蓋之範圍内。 經濟部中央橾準扃負工消費合作社印裝 I張 ,紙 本 準 標 家 國 國 中 |用 娘 格 釐 9 (請先閲讀背面.y注意事%#*填寫本頁)4242 Α7 Β7 V. Explanation of the invention () step is reduced to 128 steps or 64 steps' to purify the image, etc. It is not easy for the user to perceive and the change is softer, and it will not produce the phenomenon like a mosaic. Even the 'reduction method of the present invention can choose the transmission of low bit (| 〇w bit), W-line (〇ne | jne) sampling transmission, or reconstruction based on the concept of duty cycle. Therefore, depending on the transmission volume of the image, 'very flexible β' The above is only a preferred embodiment of the present invention, and has achieved a wide range of practical effects. All changes and decorations that are equal according to the scope of the patent application of the present invention, All are still within the scope of the invention patent. Printed by the Central Government of the Ministry of Economic Affairs of the Consumers ’Cooperative Co-operative Society, printed on paper in the standard country of the country | use the Angstrom 9 (please read the back first. 注意 事事% # * Fill this page)

Claims (1)

4242 0 A AS B8 Cg DS 六、申請專利範圍 一種掃描影像即時壓縮方法,包含步驟: 設定一位元组,該位元組包含識別碼,及計數碼; 讀取類比/數位轉換裝置所輸出之資料; 區分該輸出之資料為複數個處理區塊; 依序處理所讀取之區塊的資料,包含步驟: (a) 依序讀取類比/數位轉換裝置所輸出之6個位元; (b) 判定該六個位元的屬性’並依據該六個位元的屬 性,設定該位元組的識別碼; (c) 當該位元組的識別碼表示高位元或低位元時,設定 該位元組的計數碼為二進位碼的”彳彳,,,並執行步 驟(e); (d) 當該位元組的識別碼不為高位元或低位元時直接 依序輸入六個位元於該位元組之計數碼; (e) 該位元組之計數碼累計連續且同值的位元數,直至 該計數碼的六個位元皆為,,1 ”,或當下一位元不為 同值; 經濟部中央標準局負工消費合作社印製 (f) ^該汁數瑪的六個位元皆為,’1’’,咬當下 為同值時,輸出該位元組; (£1)重複該步驟直备., / 直至儿成所有影像資料 碼。 位元不 的編 2·如申請專利範圍第1項所述〜々忐,更包含一解遲 法,包含步驟: 肝您縮方 本紙張尺度it财國國家榇準(CNS -- ----------σ------ΐτ-------?----- (請先閱讀背面之注意事項再填寫本頁) - • m ί I 1 I I I 424208 A8 B8 C8 DS 申請專利範圍 依序讀取上述之編碼的位元纽瞀 姐貫#,每次讀取一位元 , 依據所讀取之位元組的識別碼 列%爿斷該位元組的屬性; 當該讀取之位元組的識別碼表 ▲ 衣不网位凡時,依據該位元 组之計數碼所記錄之數’依序填耸 再八等夏的1於緩衝器中相 對應的位置; 當該讀取之位元組的識別碼表示低位元時,依據該位元 組之計數碼所記錄之數,依序填人等量的„『於緩衝器中相 對應的位置; 當該讀取之位元纽的識別碼不為低位元或高位元時,依 序將該位元組之計數碼的資料,存入緩衝器中相對應的位 置;及 料 當該緩衝器已填滿時,輸出該緩衝器中的資 3_如申請專利範圍第]項所述之方法,其中上述之步驟(a) 更包含步驟: (h)在讀取上述之類比/數位轉換裝置所輸出之6個位 元時,轉換上述之6個位元為葛雷.瑪。 經濟部中央標準局員工消費合作社印製 4.如申請專利範圍第2項所述之方法,更包含步驟·· 在輸出上述之緩衝器中的資料時,轉換上述之葛雷碼為 二進位碼。 5_如申請專利範圍第彳項所述之方法,其中上述之識別碼 為二個位元,及上述之計數碼為六個位元。 私紙張尺度通用中國國家標準{ CNS ) A4規格(釐) 4242 Ο 8 Α8 Β8 C8 D8 申請專利範圍 6·如申請專利範園第2項所述之方法,其中上述之缓衝器 係至少可容納6 3個位元組。 7· —種掃描影像即時壓縮/解壓縮方法,包含步驟: (a) 設定一位元組,該位元組包含識別碼,及計數碼; (b) 讀取類比/數位轉換裝置所輸出之資料; (c) 區分該輸出之資料為複數個處理區塊; (d) 依序讀.取類比/數位轉換裝置所輸出之6個位元; (e) 判定該六個位元的屬性,並依據該六個位元的屬 性’設定該位元組的識別碼; (f) 當,位元組的識別碼表示高位元或低位元時,設定 該也兀組的計數碼為二進位碼的”彳彳”,並累計連續 且同值的位元數於該位元組的計數碼,直至該計數 碼的六個位元皆為,’1”,或當下一位元不為同值; (g) 當該位元組的識別碼不為高位元或低位元時直接 依序輸入六個原始資料的位元於該位元組之計數 碼; 經濟部中央標準局員工消費合作社印製 (h )當該位儿組之計數碼的六個位元皆為,,1,,,或當下 一位元不為同值時,輪出該位元組; (i) 重複步驟(d)至(h)直$ + # I 成所有影像資料的編碼; (j) 依序讀取該編碼的位元纽資料,每次讀取一位元 組; ㈨依據所讀取之位元組的識別褐’判斷該位元 性; 關緖準(CNS) AS 424208 S _______ D8 六、申請專利範園 (丨)當該讀取之位元组的識別碼表示高位元時,依據該 位元組之計數碼所纪錄之數,依序填入等量的”,, 於緩衝器中相對應的位置: (m)當該讀取之位元组的識別碼表示低位元時,依據該 位元組之計數碼所記錄之數,依序填入等量的” 〇,, 於緩衝器中相對應的位置; (η)當該讀取之位元組的識別碼不為低位元或高位元 時’依序將該位元組之計數碼的資料,存入緩衝器 中相對的位置;及 (〇)當該缓衝器已填滿時’輸出該緩衝器中的資料。 8. 如申請專利範圍第7項所述之方法,其中上述之步驟(b) 更包含步驟: (P)在讀取上述之類比/數位轉換裴置所輸出之6個位元 時’轉換上述之6個位元為葛雷碼。 9. 如申請專利範圍第7項所述之方法,其中上述之步驟(〇) 更包含步驟: 經濟部中央標隼局貝工消費合作社印製 (q)在輸出上述之缓衝器中的資料時,轉換上述之葛雷 碼為二進位瑪。 10. 如申請專利範虎第7項所述之方法,其中上述之識別 碼為二個位元,及上述之計數碼為六個位元。 本紙張尺度適用中國國家操準(CNS ) A4規格(210&gt;&lt;2行公釐) 424208 c 々、申請專利範圍 1 1 .如申請專利範圍第7項所述之方法,其中上述之緩衝 器係至少可容納6 3個位元組。 12.如申請專利範圍第7項所述之方法,其中上述之步驟 (b)至(i)與上述之步驟(j)至(〇 &gt;係可同時執行。 (請先閱讀背面之注意事項再填寫本頁) 訂., 經濟部中央標準局員工消費合作社印裝 本紙張尺度適用中國國家標準(CNS ) A4規格(210X25^公釐)4242 0 A AS B8 Cg DS VI. Patent application scope A method for real-time compression of scanned images, including steps: Set a byte, the byte contains an identification code, and a counting code; read the output from the analog / digital conversion device Data; distinguishing the output data into a plurality of processing blocks; sequentially processing the data of the read blocks, including steps: (a) sequentially reading the 6 bits output by the analog / digital conversion device; b) determine the attributes of the six bits, and set the identification code of the byte according to the attributes of the six bits; (c) when the identification code of the byte indicates the high or low bit, set The counting code of the byte is "彳 彳" of the binary code, and step (e) is performed; (d) when the identification code of the byte is not the high or low byte, enter six directly in sequence The count code of the bit in the byte; (e) The count code of the byte accumulates the number of consecutive and equal bits until the six bits of the count code are all, 1 ", or when the next Bits are not the same value; printed by the Consumers' Cooperatives of the Central Bureau of Standards of the Ministry of Economic Affairs (f) ^ Juice number Ma are all six bits, '1', the lower bite to the same value, the output bytes; (£ 1) Preparation of repeated step linear, / child until all the image data into codes. Bitwise Editing 2 · As described in item 1 of the scope of patent application ~ 々 忐, it also includes a solution method, including the steps: You must shrink the paper, the paper size, and the country's national standard (CNS---- ------- σ ------ ΐτ -------? ----- (Please read the notes on the back before filling out this page)-• m ί I 1 III 424208 A8 B8 C8 DS The scope of the patent application sequentially reads the above-coded bits Newton sister #, and reads one bit at a time, and judges the byte based on the read byte sequence of the read byte. Attribute; When the identification code table of the read byte ▲ is not suitable for the Internet, fill in the order of eight in the buffer according to the number recorded in the count code of the byte. Corresponding position; when the read byte identification code indicates the low-order bit, according to the number recorded in the byte count code, fill in the same amount of 『『 corresponding position in the buffer in order. ; When the read bit identifier is not a low bit or a high bit, sequentially store the data of the byte count code in the corresponding position in the buffer; and It is expected that when the buffer is full, the information in the buffer is output. 3_ The method described in item [Scope of patent application], wherein the above step (a) further includes steps: (h) after reading the above When the 6 bits output by the analog / digital conversion device, the above 6 bits are converted to Gray. Ma. Printed by the Consumer Cooperatives of the Central Standards Bureau of the Ministry of Economic Affairs 4. The method described in item 2 of the scope of patent application , And further includes the step of converting the above Gray code to a binary code when outputting the data in the above buffer. 5_ The method described in item 彳 of the scope of patent application, wherein the above identification code is two Bits, and the above-mentioned counting code are six bits. The standard of private paper is common Chinese national standard {CNS) A4 specification (centimeter) 4242 〇 8 Α8 Β8 C8 D8 Scope of patent application The method described above, wherein the above buffer can hold at least 63 bytes. 7 · —a method for real-time compression / decompression of scanned images, including the steps: (a) setting a byte, the byte Including identification code and counting code; (b) read Data output by the analog / digital conversion device; (c) Differentiating the output data into a plurality of processing blocks; (d) Read in sequence. Take the 6 bits output by the analog / digital conversion device; (e) Judgment The six-bit attribute, and set the byte identification code according to the six-bit attribute; (f) when the byte identification code indicates the high bit or low bit, set this The counting code of the group is the "彳 彳" of the binary code, and the number of consecutive and equal-valued bits is accumulated in the counting code of the byte group, until the six bits of the counting code are all "1", or When the next bit is not the same value; (g) When the identification code of the byte is not the high bit or the low bit, directly enter the six original data bits into the byte count number of the byte directly; Ministry of Economic Affairs Printed by the Consumer Standards Cooperative of the Central Bureau of Standards (h) When the six digits of the counting code of the bit group are all 1 ,, 1, or when the next bit is not the same value, the bit group is rotated out; (i) Repeat steps (d) to (h) until $ + # I becomes the encoding of all image data; (j) Read the bits of the encoding in sequence Data, one byte is read at a time; 判断 judging the bitness based on the identification of the read bytes; Guan Xuzhun (CNS) AS 424208 S _______ D8 VI. Patent Application Park (丨) When the read byte identification code indicates the high-order byte, fill in the same amount in sequence according to the number recorded by the byte count code, and the corresponding position in the buffer: (m ) When the read byte identification code indicates the low-order bit, fill in the same amount of "0" in sequence, corresponding to the corresponding position in the buffer according to the number recorded by the byte count code; (η) when the read byte identification code is not a low bit or a high bit, 'sequence data of the byte count code is stored in a relative position in the buffer; and (〇) when When the buffer is full, the data in the buffer is output. 8. The method as described in item 7 of the scope of patent application, wherein the above step (b) further comprises the steps: (P) when reading the 6 bits output by the above analog / digital conversion Pei Zhi Six of them are Gray codes. 9. The method as described in item 7 of the scope of patent application, wherein the above step (0) further includes the steps: (b) printed by the Central Bureau of Standards of the Ministry of Economic Affairs, Shellfish Consumer Cooperatives to output the data in the above buffer At this time, the above Gray code is converted into a binary ma. 10. The method according to item 7 of the patent application Fanhu, wherein the above identification code is two bits, and the above count code is six bits. This paper size is applicable to China National Standards (CNS) A4 specification (210 &gt; &lt; 2 line mm) 424208 c 々Applicable patent scope 1 1. The method described in item 7 of the patent scope, in which the above buffer Department can accommodate at least 6 3 bytes. 12. The method as described in item 7 of the scope of patent application, wherein steps (b) to (i) and steps (j) to (0) above can be performed simultaneously. (Please read the precautions on the back first (Fill in this page again) Order. The paper size of the printed papers of the Consumer Cooperatives of the Central Bureau of Standards of the Ministry of Economic Affairs applies to the Chinese National Standard (CNS) A4 (210X25 ^ mm)
TW88104515A 1999-03-22 1999-03-22 Real-time compression/decompression method for scanned image TW424208B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW88104515A TW424208B (en) 1999-03-22 1999-03-22 Real-time compression/decompression method for scanned image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW88104515A TW424208B (en) 1999-03-22 1999-03-22 Real-time compression/decompression method for scanned image

Publications (1)

Publication Number Publication Date
TW424208B true TW424208B (en) 2001-03-01

Family

ID=21640046

Family Applications (1)

Application Number Title Priority Date Filing Date
TW88104515A TW424208B (en) 1999-03-22 1999-03-22 Real-time compression/decompression method for scanned image

Country Status (1)

Country Link
TW (1) TW424208B (en)

Similar Documents

Publication Publication Date Title
US5867112A (en) Software method of compressing text and graphic images for storage on computer memory
US7239717B2 (en) Lossless embedding of data in digital objects
JP2968582B2 (en) Method and apparatus for processing digital data
TW453049B (en) Real time algorithms and architectures for coding images compressed by DWT-based techniques
TW200305830A (en) System and method for progressively transforming and coding digital data
TWI273779B (en) Method and apparatus for optimized lossless compression using a plurality of coders
JP2002300408A (en) Unit and method for filing image, and unit and method for recovering the image
CN100539700C (en) Method for encoding images and device
TW535412B (en) Progressive JPEG decoding device and method thereof
TW424208B (en) Real-time compression/decompression method for scanned image
JPH0351966A (en) Coding apparatus of image data
JPH11168632A (en) Binary expression processing method for dither image, method for uncompressing dither image expressed in compression binary representation and compression and uncompression system for dither image
JPH0215782A (en) Picture encoding system
CN1107381C (en) Real-time compression/decompression method for scanned image
Gupta et al. Lossless compression based Kmp technique
JP3859325B2 (en) Image iterative transform decoding apparatus and method, and recording medium
CN1154363C (en) Method for encoding image information and method for decoding
WO2006115384A1 (en) Apparatus and method of conversing data
JP2627927B2 (en) Image data compression rate conversion method
JP3797965B2 (en) Image encoding apparatus, image decoding apparatus and methods thereof
TWI249139B (en) Block decoding-method capable of rotating direction decoding-output and system
JP3796235B2 (en) Image compression and decompression method
JPS6348068A (en) Transmitting device for variable density picture
JP2001197496A5 (en)
TW560177B (en) Image processing method for facilitating data transmission

Legal Events

Date Code Title Description
GD4A Issue of patent certificate for granted invention patent
MM4A Annulment or lapse of patent due to non-payment of fees