WO2014027429A1 - データ圧縮方法及びその装置並びにそのプログラム - Google Patents

データ圧縮方法及びその装置並びにそのプログラム Download PDF

Info

Publication number
WO2014027429A1
WO2014027429A1 PCT/JP2013/001926 JP2013001926W WO2014027429A1 WO 2014027429 A1 WO2014027429 A1 WO 2014027429A1 JP 2013001926 W JP2013001926 W JP 2013001926W WO 2014027429 A1 WO2014027429 A1 WO 2014027429A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
same
predetermined number
processing target
encoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/JP2013/001926
Other languages
English (en)
French (fr)
Inventor
智靖 奥島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dainippon Screen Manufacturing Co Ltd
Original Assignee
Dainippon Screen Manufacturing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dainippon Screen Manufacturing Co Ltd filed Critical Dainippon Screen Manufacturing Co Ltd
Publication of WO2014027429A1 publication Critical patent/WO2014027429A1/ja
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/46Conversion to or from run-length codes, i.e. by representing the number of consecutive digits, or groups of digits, of the same kind by a code word and a digit indicative of that kind
    • H03M7/48Conversion to or from run-length codes, i.e. by representing the number of consecutive digits, or groups of digits, of the same kind by a code word and a digit indicative of that kind alternating with other codes during the code conversion process, e.g. run-length coding being performed only as long as sufficientlylong runs of digits of the same kind are present

Definitions

  • the present invention relates to a data compression method and apparatus for compressing processing target data such as image data, and a program thereof, and more particularly, to a technique for continuously compressing continuous data.
  • Pack Bits also called continuous length compression or run-length compression
  • This Pack Bits performs lossless compression of data by recording the continuous / discontinuous length of the same data.
  • the conventional example having such a configuration has the following problems. That is, the conventional method can obtain a compression effect only when a lot of identical data continues. For example, image data is often not identical in proportion to many identical data and is often in the form of approximate data in terms of noise. Therefore, there is a problem that the image data cannot be efficiently compressed.
  • the present invention has been made in view of such circumstances, and provides a data compression method, an apparatus thereof, and a program for the same, which can improve compression efficiency even if the continuity of the same data is low. For the purpose.
  • the present invention has the following configuration. That is, the invention according to claim 1 is a data compression method for compressing processing target data, wherein a continuity determination step for determining whether or not the same data is continuous for a predetermined number of the processing target data; As a result of the determination by the continuity determination step, when the same data for the processing target data is a predetermined number or more, the plurality of the same data is continuously length-compressed as a sequence of all the same data.
  • each data of the processing target data Dividing each of the data to be processed divided by the dividing step,
  • the higher-order bit continuity determination step for determining whether the data of the higher-order bits have the same value and are continuous for a predetermined number or more, and the determination by the higher-order bit continuity determination step,
  • a second code for consecutively compressing the upper bits of each data as a series of semi-identical data and listing the lower bits of each data
  • a second encoding step for performing the conversion When the first encoding step for performing the first encoding and the determination by the continuity determination step indicate that the same data for the processing target data is not a predetermined number or more, each data of the processing target data Dividing each of the data to be processed divided by the dividing step,
  • the higher-order bit continuity determination step for determining whether the data of the higher-order bits have the same value and are continuous for a predetermined number or more, and the determination by the higher-order bit continuity determination step, When the data is the same and is a predetermined number or
  • the first encoding step when the same data for the processing target data is continuous by a predetermined number or more by the determination in the continuity determination step.
  • First encoding is performed to continuously compress a plurality of identical data as a series of all identical data.
  • the dividing step when the same data as the processing target data is not a predetermined number or more, each data of the processing target data is divided into upper bits and lower bits.
  • the upper bit continuity determination step it is determined whether or not the upper bit data is the same value among the data to be processed divided in the division step and is a predetermined number or more, and is continuous.
  • the second encoding step as the continuation of semi-identical data, the higher-order bits of each data are subjected to continuous length compression, and the second encoding is performed in which the lower-order bits of each data are arranged.
  • the first encoding is performed as all the same data and compression is performed, so that the compression efficiency can be improved. If the same data does not continue for a predetermined number or more, the data is divided. If the upper bits are the same and continue for a predetermined number or more, compression is performed by the second encoding as a continuation of semi-identical data. Therefore, the compression efficiency can be improved even for data with low continuity of the same data.
  • each data less than a predetermined number is set as non-identical data
  • the first data Preferably, the encoding step is not performed (Claim 2), and when the upper bit data is the same and not more than a predetermined number according to the determination in the upper bit continuity determination step, each less than the predetermined number It is preferable that the data is non-identical data and the second encoding step is not performed. When the compression effect cannot be expected, it is preferable that the first encoding step and the second encoding step are not performed.
  • the predetermined number in the continuity determining step is preferably “3” (Claim 4), and the predetermined number in the upper bit continuity determining step is preferably “5” (Claim). Item 5).
  • a compression effect can be expected if the number of consecutive identical data is “3” or more, and a compression effect can be expected if the number of consecutive identical data is “5” or more.
  • the invention according to claim 6 is a data compression apparatus for compressing processing target data, wherein continuity determination means for determining whether or not the same data is continuous for a predetermined number of the processing target data; As a result of the determination by the continuity determination means, when the same data for the processing target data is a predetermined number or more, the plurality of the same data is continuously length-compressed as a continuation of all the same data If the same data for the processing target data is not a predetermined number or more consecutive as determined by the first encoding means for performing the first encoding and the continuity determination means, each data of the processing target data Data dividing means for dividing the data into upper bits and lower bits, and among the data of the processing object data divided by the data dividing means, the upper bits By the determination by the upper bit continuity determining means for determining whether or not the data is the same value and not less than a predetermined number, the upper bit data among the data is the same by the determination by the upper bit continuity determining means If it is a predetermined number or more of continuous data, the upper
  • the first encoding means determines that the data to be processed has a predetermined number or more of continuous data as determined by the continuity determination means.
  • First encoding is performed to continuously compress a plurality of identical data as a series of identical data.
  • the dividing means divides each data of the processing target data into upper bits and lower bits when the same data is not continuous more than a predetermined number with respect to the processing target data.
  • the upper bit continuity determining means determines whether or not the upper bit data is the same value among the data to be processed divided by the dividing means and is a predetermined number or more, and is continuous.
  • the second encoding means performs second encoding in which the upper bits of each data are continuously length-compressed as a series of semi-identical data, and the lower bits of each data are enumerated.
  • the first encoding is performed by the first encoding means as all the same data and compression is performed, so that the compression efficiency can be improved.
  • the data is divided.
  • the second encoding means sets the second code as a continuation of semi-identical data. Compression will be achieved. Therefore, the compression efficiency can be improved even for data with low continuity of the same data.
  • the invention according to claim 9 is a data compression program for compressing the processing target data by a computer, and when the CPU of the computer executes in a memory, the same number of the processing target data is equal to or more than a predetermined number. If the same data for the processing target data is continuous for a predetermined number or more by the determination by the continuity determination function for determining whether or not the data is continuous, it is assumed that all the same data is continuous.
  • the predetermined number of the same data as the processing target data is determined by the first encoding function for performing the first encoding for continuous length compression of the plurality of the same data and the determination by the continuity determination function.
  • the first encoding step if the same data is continuous for a predetermined number of processing target data by the determination in the continuity determination step, As a continuation, a first encoding is performed for continuous length compression of a plurality of identical data.
  • the dividing step when the same data as the processing target data is not a predetermined number or more, each data of the processing target data is divided into upper bits and lower bits.
  • the upper bit continuity determination step it is determined whether or not the upper bit data is the same value among the data to be processed divided in the division step and is a predetermined number or more, and is continuous.
  • the second encoding step as the continuation of semi-identical data, the higher-order bits of each data are subjected to continuous length compression, and the second encoding is performed in which the lower-order bits of each data are arranged.
  • the first encoding is performed as all the same data and compression is performed, so that the compression efficiency can be improved. If the same data does not continue for a predetermined number or more, the data is divided. If the upper bits are the same and continue for a predetermined number or more, compression is performed by the second encoding as a continuation of semi-identical data. Therefore, the compression efficiency can be improved even for data with low continuity of the same data.
  • FIG. 1 is a block diagram illustrating a schematic configuration of the data compression apparatus according to the embodiment.
  • the data compression apparatus is provided with, for example, image data as processing target data, and outputs it as compressed image data.
  • the computer 1 includes a CPU 1a, a memory 1b, a disk drive 1c, a disk 1d, an input / output interface, and the like. Functionally, the computer 1 includes a reading unit 3, a holding data register 5, a comparison unit 7, a FIFO 9, an all-identical counter 11, a semi-identical counter 13, and a non-identical counter 15. .
  • the disk 1d is a storage medium that stores programs to be described later in advance.
  • the disk drive 1c is configured such that the disk 1d is detachable, and reads / writes from / to the disk 1d. Here, the program on the disk 1d is read.
  • the CPU 1a reads the program via the disk drive 1c and loads the program into the memory 1b.
  • the CPU 1a performs a process described later by executing a program in the memory 1b.
  • the reading unit 3 reads a part of the image data that is “processing target data” (here, the data of the minimum processing unit, which is 1 byte).
  • the holding data register 5 holds a part of the image data read by the reading unit 3.
  • the comparison unit 7 compares the data in the reading unit 3 and the holding data register 5 and determines the degree of coincidence of all matching (all the same), half matching (semi-identical), and all mismatching (non-identical).
  • the FIFO 9 is a first-in first-out register, and holds the data in the holding data register 5 sequentially.
  • the all-identical counter 11, the semi-identical counter 13, and the non-identical counter 15 indicate the number of data of each type in the FIFO 9.
  • the all-identical counter 11 holds a count value Nf indicating the number of all-identical data
  • the half-identical counter 13 holds a count value Nh indicating the number of half-identical data
  • a non-identical counter indicating the number of non-identical data
  • 15 holds a count value Nn indicating the number of non-identical data.
  • all the same data means that all bits are the same as the data to be compared among the data of 8 bits / pixel.
  • “Semi-identical data” is the same as the comparison target data in the 8-bit / pixel data, and the lower bit (4 bits) is different from the comparison target data. To do.
  • “Non-identical data” refers to data other than the same data and semi-identical data described above.
  • This compression technique compresses data by recording continuous / discontinuous lengths of the same data.
  • “ ⁇ ” represents the same, and “+” represents non-identity.
  • the processing target data “A_A_A_A” expressed by 4 bytes is “ ⁇ 4_A”, which is also expressed by 4 bytes, and the processing target data “A_B_C_D” is “+ 4_A_B_C_D”.
  • the former is 4 bytes ⁇ 2 bytes, and the latter is 4 bytes ⁇ 5 bytes. That is, the former has a compression effect, but the latter has no compression effect.
  • each piece of data to be processed is divided into upper 4 bits and lower 4 bits, and the upper 4 bits handle the same data as “same data”.
  • the processing target data is “70_71_72_73_74_75_76_77”
  • the processing target data is “70_71_72_73_74_75_76_77”
  • the processing target data is expressed as “7” in the upper bits and “0 to 7” in the lower bits.
  • the compression effect is obtained from 8 bytes to 9 bytes, whereas in the present invention, the compression effect is obtained from 8 bytes to 6 bytes.
  • the present invention requires 2 bits for discrimination in order to classify data into three types that are completely identical, semi-identical, and non-identical. Therefore, the data is counted up to 64 consecutive numbers.
  • the compression effect will be described taking the case where the data to be processed is as follows as an example.
  • the same data is treated as non-identical data when it is less than 3 consecutive, and semi-identical data is treated as non-identical data when it is less than 5 consecutive. This is “improved point 2” with respect to Pack Bits of the present invention.
  • the processing target data is “00_10_10_11_12_13_21_20_20_20_21_00”.
  • both the second and third data are “10”, but are not treated as the same data because they are two consecutive.
  • the second to sixth data are handled as semi-identical data with the upper 4 bits being “1”.
  • the 8th to 10th data are all “10” and are 3 or more continuous, and therefore are treated as the same data.
  • the 7th to 11th data have the upper 4 bits of “2”. Although it can be handled as some semi-identical data, since the same data is three or more consecutive, the same data is given priority and is not treated as semi-identical data.
  • Step S4 The comparison unit 7 compares the data currently in the reading unit 3 with the data in the holding data register 5. Then, the process branches according to the comparison result. Specifically, if it is all the same data, the process proceeds to step S5, if it is semi-identical data, the process proceeds to step S6, and if it is non-identical data, the process proceeds to step S7. Details of these processes will be described later.
  • Step S5 The process branches depending on whether or not it is the last of the data constituting the image data. If it is the last, the process proceeds to step S9 to perform the final data processing. If it is not the last, the process proceeds to step S2 to move the data from the reading unit 3 to the holding data register 5. Details of the final data processing will be described later.
  • Step S11 to S14 This route is a process when 64 identical data are consecutive. If all the same counters 11 are 63 in step S11, the process proceeds to step S12 and the subsequent steps, and the number of continuous data is set to 64 in addition to the code as all the same data, and the value of the holding data register 5 is added and output. To do. In step S13, the count values of all the identical counters 11, the half identical counters 13, and the non-identical counters 15 are set to zero. In step S ⁇ b> 14, the data of the reading unit 3 is written into the holding data register 5.
  • Route 1-2 to Route 1-5 These paths are processes when it is determined that three or more identical data are continuous.
  • step S15 the process branches depending on whether or not all the same counters 11 are 1 or more. If the FIFO 9 already has one or more all the same data, the process branches in step S16 depending on whether or not the semi-identical counter 13 is Nf + 5 or more. If there are Nf + 5 or more semi-identical data, the semi-identical data is output in step S17. The output is the value of the code (sequential data number is Nh-1) + FIFO9 data as semi-identical data. In step S18, the FIFO 9 is cleared, and in step S19, all the same counters 11 are incremented.
  • step S20 If the number of semi-identical counters 13 is not equal to or greater than the count value Nf + 5 of all identical counters 11 in step S16, the process proceeds to step S20.
  • non-identical counter 15 is equal to or greater than the count value Nf + 1 of all the identical counters 11 (step S20) and the non-identical counter 15 is equal to or greater than the count value Nf + 129 of all the identical counters 11 (step S21)
  • non-identical data Is output (step S22).
  • the output is the continuous data number 128, and further the data value of the FIFO 9 is added. Thereafter, non-identical data is output (step S23).
  • the output In addition to the code as the non-identical data, the output is the continuous number Nn-1, and the FIFO 9 data is added.
  • non-identical counter 15 is less than the count value Nf + 129 of all the identical counters 11 in step S21, non-identical data is output in step S23.
  • the output is the continuous number Nn-1, and the FIFO 9 data is added.
  • Path 1-6 This path is a process when the same data is less than 3 consecutive. If all the same counters 11 are less than 1 in step S15, the value of the holding data register 5 is written in the FIFO 9 in step S24, and all the counters 11, 13, 15 are incremented in step S25.
  • This semi-identical data processing corresponds to the “division step” and the “second encoding step” in the present invention.
  • Route 2-1 This route is a process in the case where all three or more identical data are continuous. If all the same counters 11 are 2 or more in step S31, all the same data is output in step S32. The output is the number of continuous data Nf + 1 in addition to the code as all the same data, and the value of the holding data register 5 is added. In step S ⁇ b> 34, the data of the reading unit 3 is written in the retained data resist 5.
  • Path 2-2 This route is a process when 64 pieces of semi-identical data are consecutive. If all the same counters 11 are less than 2 in step S31, if the half-same counter 13 is 63 or more in step S35, the value of the holding data register 5 is written in the FIFO 9 in step S36. In step S37, semi-identical data is output. In addition to the code as semi-identical data, the output is set to 64, and the value of FIFO 9 is added. In step S38, all the same counters 11 are set to 0, half-same counter 13 is set to Nh-64 + 1, and non-identical counter 15 is set to Nh-64 + 1.
  • Path 2-3 to 2-4 are processes when it is determined that five or more pieces of semi-identical data are continuous.
  • step S41 If the semi-identical counter 13 is 4 or more in step S39 and the non-identical counter 15 is greater than or equal to the count value Nh + 1 of the semi-identical counter 13 in step S40, non-identical data is output in step S41. In addition to the code as non-identical data, the output is the continuous number Nn-Nh, and the data of FIFO 9 is added.
  • step S42 the data in the holding data register 5 is written into the FIFO 9, and in step S42, the all-identical counter 11 is set to 0, the semi-identical counter 13 is set to Nh + 1, and the non-identical counter 15 is set to 0.
  • step S39 If the semi-identical counter 13 is less than 4 in step S39, the data in the holding data register 5 is written in the FIFO 9 in step S44. In step S45, all the same counters 11 are set to 0, half-same counter 13 is set to Nf + 1, and non-identical counter 15 is set to Nn + 1.
  • step S51 if all the same counters 11 are 2 or more, all the same data is output in step S52. In addition to the code as non-identical data, the output is the continuous number Nf + 1, and the data of the holding register data 5 is added. In step S53, all the identical counters 11, the half identical counters 13, and the non-identical counters 15 are all set to zero. Then, in step S54, the data of the reading unit 3 is written into the holding data register 5.
  • Paths 3-2 and 3-3 These paths are processes when five or more semi-identical data are continuous.
  • step S55 If the semi-identical counter 13 is 4 or more (step S55) and the non-identical counter 15 is the count value Nh + 1 of the semi-identical counter 13, non-identical data is output in step S57.
  • the output In addition to the code as non-identical data, the output is the continuous number Nn-Nh, and the data of FIFO 9 is added.
  • step S58 the data in the holding data register 5 is written into the FIFO 9. Further, half-same data is output in step S59.
  • the output In addition to the code as the semi-identical data, the output is the continuous number Nh + 1, and the data of FIFO 9 is added. Thereafter, in step S60, all the same counter 11, half-same counter 13, and non-identical counter 15 are all set to zero.
  • Route 3-4 This path is a process when 128 non-identical data are consecutive.
  • step S61 If the non-identical counter 13 is 127 or more (step S61), the data of the holding data register 5 is written into the FIFO 9 in step S63.
  • step S64 non-identical data is output. In addition to the code as the non-identical data, the output is the continuous number 128 and the data of the FIFO 9 is added.
  • step S65 all the same counters 11 are set to 0, half-same counters 13 are set to 0, and non-identical counters 15 are set to Nn ⁇ 128 + 1.
  • Route 3-5 This path is a process in the case where there are less than 128 non-identical data.
  • step S61 If the non-identical counter 13 is less than 127 (step S61), the data in the holding data register 5 is written into the FIFO 9 in step S65. In step S66, all the same counters 11 are set to 0, half-same data 13 is set to 0, and non-identical counters 15 are set to Nn + 1.
  • Routes 4-1 and 402 are processes when all three or more identical data continue.
  • Route 4-1 If all the same counters 11 are 2 or more and 64 (steps S71 and S72), all the same data is output in step S73. In addition to the code as all the same data, the output is the continuous number 64, and the data of the holding data register 5 is added. In step S74, non-identical data is output. In addition to the code as the non-identical data, the output is the continuous number 1, and the data of the holding data register 5 is added.
  • Route 4-2 If all the same counters 11 are not 64 in step S72, all the same data is output in step S75.
  • the output is the continuous number Nf + 1 in addition to the code as all the same data, and the data of the holding data register 5 is added.
  • Route 4-3, 4-4 These paths are processes when five or more semi-identical data are continuous.
  • Step S76 and S77 When the semi-identical counter 13 is 4 or more and 64 or more (steps S76 and S77), the data of the holding data register 5 is written to the FIFO 9 in step S78.
  • semi-identical data is output in step S79.
  • the output In addition to the code as the semi-identical data, the output is the number of continuous 64 and the FIFO 9 data is added.
  • non-identical data is output. The output is a continuous number Nh + 64 + 1 in addition to the code as non-identical data.
  • Step S77 If the semi-identical data is less than 64 in step S77, the data in the retained data register 5 is written into the FIFO 9 in step S81. Next, in step S82, semi-identical data is output. In addition to the code as semi-identical data, the output is set to Nh + 1 and the data of FIFO 9 is added.
  • Step S84 the retained data register 5 is written into the FIFO 9 at step S84.
  • step S85 non-identical data is output.
  • the output is the continuous number 128 and the data of the FIFO 9 is added.
  • step S86 non-identical data is output.
  • the output is the consecutive increase number Nn ⁇ 128 + 1, and the data of FIFO 9 is added.
  • step S83 If the non-identical counter 15 is less than 128 in step S83, the retained data register 5 is written to the FIFO 9 in step S87. Next, in step S88, non-identical data is output. In addition to the code as non-identical data, the output is the continuous number Nf + 1, and the data of FIFO 9 is added.
  • step S71 corresponds to the “continuity determination step” in the present invention
  • step S76 corresponds to the “upper bit continuity determination step” in the present invention.
  • FIG. 7 to FIG. 7 to 11 are diagrams for explaining an example of the processing process.
  • Example 1 (Fig. 7) This is a case where the same data is continuous, for example, a case where the processing target data is ABCC. In this case, it is not treated as a series of the same data
  • Example 2 This is a case where the same data is three consecutive, for example, a case where the processing target data is ABBBC.
  • Example 3 (Fig. 9) This is the case where the same data is four consecutive, for example, the case where the processing target data is ABBBBBC.
  • Example 4 This is a case where the same data is 64 consecutive, for example, a case where the processing target data is ABBB... BBC.
  • Example 5 This is a case where the same data is 65 continuous, for example, a case where the processing target data is ABBB... BBBC.
  • the data compressing apparatus when the same data for the processing target data is continuous for a predetermined number or more, a plurality of the same data are consecutively compressed as continuous of all the same data. To do. If the same data is not continuous for the processing target data, the data of the processing target data is divided into upper bits and lower bits. Of each data of the divided processing target data, it is determined whether the upper bit data has the same value and is a predetermined number or more, and if it is continuous, The upper bits of each data are continuously compressed, and the lower bits of each data are enumerated.
  • the first encoding is performed as all the same data and compression is performed, so that the compression efficiency can be improved. If the same data does not continue for a predetermined number or more, the data is divided. If the upper bits are the same and continue for a predetermined number or more, compression is performed by the second encoding as a continuation of semi-identical data. Therefore, the compression efficiency can be improved even for data with low continuity of the same data.
  • the first encoding is not performed, and if the half-identical data is not “5” or more, the second encoding is not performed. It does not occur and a compression effect can be expected.
  • the present invention is not limited to the above embodiment, and can be modified as follows.
  • processing is performed according to the procedure shown in FIGS. 2 to 6, but the present invention is not limited to such a procedure.
  • image data is exemplified as the processing target data.
  • the present invention does not limit the processing target data to image data.
  • document data may be processed. Can do.
  • the present invention is suitable for a technique for compressing processing target data such as image data.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Description

データ圧縮方法及びその装置並びにそのプログラム
 本発明は、画像データなどの処理対象データを圧縮するデータ圧縮方法及びその装置並びにそのプログラムに係り、特に、連続するデータを連長圧縮する技術に関する。
 従来、この種の方法としては、画像データなどのデータ圧縮のために、同一データの連続性に着目したPack Bits(連長圧縮やランレングス圧縮とも呼ばれる)がある(例えば、特許文献1参照)。このPack Bitsは、同一データの連続/不連続の長さを記録することでデータの可逆圧縮を行う。
特開2005-277932号公報
 しかしながら、このような構成を有する従来例の場合には、次のような問題がある。
 すなわち、従来の方法は、多くの同一データが連続する場合にしか圧縮効果が得られない。例えば、画像データは、同一のデータが多く連続する割合は多くはなく、ノイズ的に近似データ状になっていることが多くある。したがって、画像データを効率的に圧縮することができないという問題がある。
 本発明は、このような事情に鑑みてなされたものであって、同一データの連続性が低いデータであっても圧縮効率を向上することができるデータ圧縮方法及びその装置並びにそのプログラムを提供することを目的とする。
 本発明は、このような目的を達成するために、次のような構成をとる。
 すなわち、請求項1に記載の発明は、処理対象データを圧縮するデータ圧縮方法において、前記処理対象データについて同一のデータが所定数以上の連続であるか否かを判定する連続性判定ステップと、前記連続性判定ステップによる判定により、前記処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、前記複数個の同一のデータを連長圧縮するための第1の符号化を行う第1の符号化ステップと、前記連続性判定ステップによる判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、前記処理対象データの各データを上位ビットと下位ビットに分割する分割ステップと、前記分割ステップによって分割された前記処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定する上位ビット連続性判定ステップと、前記上位ビット連続性判定ステップによる判定により、前記各データのうち上位ビットのデータが同一であって所定数以上の連続である場合には、半同一データの連続として、前記各データの前記上位ビットを連長圧縮し、前記各データの下位ビットを羅列する第2の符号化を行う第2の符号化ステップと、を有することを特徴とするものである。
 [作用・効果]請求項1に記載の発明によれば、第1の符号化ステップでは、連続性判定ステップの判定により、処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、複数個の同一のデータを連長圧縮するための第1の符号化を行う。分割ステップでは、処理対象データについて同一のデータが所定数以上の連続でない場合には、処理対象データの各データを上位ビットと下位ビットに分割する。上位ビット連続性判定ステップでは、分割ステップによって分割された処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定し、連続である場合には、第2の符号化ステップにおいて、半同一データの連続として、各データの上位ビットを連長圧縮し、各データの下位ビットを羅列する第2の符号化を行う。このように、同一データが所定数以上連続する場合は、全同一データとして第1の符号化を行って圧縮を図るので圧縮効率を向上できる。また、同一データが所定数以上連続しない場合にはデータを分割し、上位ビットが同一で所定数以上連続している場合は、半同一データの連続として第2の符号化により圧縮を図る。したがって、同一データの連続性が低いデータであっても圧縮効率を向上することができる。
 また、本発明において、前記連続性判定ステップによる判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、所定数未満の各データを非同一データとし、前記第1の符号化ステップを実施しないことが好ましく(請求項2)、前記上位ビット連続性判定ステップによる判定により、上位ビットのデータが同一であって所定数以上の連続でない場合には、所定数未満の各データを非同一データとし、前記第2の符号化ステップを実施しないことが好ましい(請求項3)。圧縮効果が期待できない場合には、第1の符号化ステップや第2の符号化ステップを実施しない方が結果が好ましくなる。
 また、本発明において、前記連続性判定ステップにおける所定数は「3」であることが好ましく(請求項4)、前記上位ビット連続性判定ステップにおける所定数は「5」であることが好ましい(請求項5)。同一データの連続数は、「3」以上であれば圧縮効果が期待でき、半同一データの連続数は、「5」以上であれば圧縮効果を期待できる。
 また、請求項6に記載の発明は、処理対象データを圧縮するデータ圧縮装置において、前記処理対象データについて同一のデータが所定数以上の連続であるか否かを判定する連続性判定手段と、前記連続性判定手段による判定により、前記処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、前記複数個の同一のデータを連長圧縮するための第1の符号化を行う第1の符号化手段と、前記連続性判定手段による判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、前記処理対象データの各データを上位ビットと下位ビットに分割するするデータ分割手段と、前記データ分割手段によって分割された前記処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定する上位ビット連続性判定手段と、前記上位ビット連続性判定手段による判定により、前記各データのうち上位ビットのデータが同一であって所定数以上の連続である場合には、半同一データの連続として、前記各データの前記上位ビットを連長圧縮し、前記各データの下位ビットを羅列する第2の符号化を行う第2の符号化手段と、を備えていることを特徴とするものである。
 [作用・効果]請求項6に記載の発明によれば、第1の符号化手段は、連続性判定手段の判定により、処理対象データについて同一のデータが所定数以上の連続である場合には、同一データの連続として、複数個の同一のデータを連長圧縮するための第1の符号化を行う。分割手段は、処理対象データについて同一のデータが所定数以上の連続でない場合には、処理対象データの各データを上位ビットと下位ビットに分割する。上位ビット連続性判定手段は、分割手段によって分割された処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定し、連続である場合には、第2の符号化手段が、半同一データの連続として、各データの上位ビットを連長圧縮し、各データの下位ビットを羅列する第2の符号化を行う。このように、同一データが所定数以上連続する場合は、全同一データとして第1の符号化手段により第1の符号化を行って圧縮を図るので圧縮効率を向上できる。また、同一データが所定数以上連続しない場合にはデータを分割し、上位ビットが同一で所定数以上連続している場合は、第2の符号化手段により半同一データの連続として第2の符号化により圧縮を図る。したがって、同一データの連続性が低いデータであっても圧縮効率を向上することができる。
 また、請求項9に記載の発明は、処理対象データをコンピュータによって圧縮するデータ圧縮プログラムであって、前記コンピュータのCPUがメモリにおいて実行することにより、前記処理対象データについて同一のデータが所定数以上の連続である否かを判定する連続性判定機能と、前記連続性判定機能による判定により、前記処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、前記複数個の同一のデータを連長圧縮するための第1の符号化を行う第1の符号化機能と、前記連続性判定機能による判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、前記処理対象データの各データを上位ビットと下位ビットに分割する分割機能と、前記分割機能によって分割された前記処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定する上位ビット連続性判定機能と、前記上位ビット連続性判定機能による判定により、前記各データのうち上位ビットのデータが同一であって所定数以上の連続である場合には、半同一データの連続として、前記各データの前記上位ビットを連長圧縮し、前記各データの下位ビットを羅列する第2の符号化を行う第2の符号化機能と、を実現させるためのデータ圧縮プログラムである。
 本発明に係るデータ圧縮方法によれば、第1の符号化ステップでは、連続性判定ステップの判定により、処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、複数個の同一のデータを連長圧縮するための第1の符号化を行う。分割ステップでは、処理対象データについて同一のデータが所定数以上の連続でない場合には、処理対象データの各データを上位ビットと下位ビットに分割する。上位ビット連続性判定ステップでは、分割ステップによって分割された処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定し、連続である場合には、第2の符号化ステップにおいて、半同一データの連続として、各データの上位ビットを連長圧縮し、各データの下位ビットを羅列する第2の符号化を行う。このように、同一データが所定数以上連続する場合は、全同一データとして第1の符号化を行って圧縮を図るので圧縮効率を向上できる。また、同一データが所定数以上連続しない場合にはデータを分割し、上位ビットが同一で所定数以上連続している場合は、半同一データの連続として第2の符号化により圧縮を図る。したがって、同一データの連続性が低いデータであっても圧縮効率を向上することができる。
実施例に係るデータ圧縮装置の概略構成を示すブロック図である。 データ圧縮装置の動作を示すフローチャートである。 全同一データ処理の動作を示すフローチャートである。 半同一データ処理の動作を示すフローチャートである。 非同一データ処理の動作を示すフローチャートである。 最終データ処理の動作を示すフローチャートである。 処理過程の例を説明するための図である。 処理過程の例を説明するための図である。 処理過程の例を説明するための図である。 処理過程の例を説明するための図である。 処理過程の例を説明するための図である。
 以下、図面を参照して本発明の一実施例について説明する。
 図1は、実施例に係るデータ圧縮装置の概略構成を示すブロック図である。
 実施例に係るデータ圧縮装置は、処理対象データとして例えば画像データを与えられ、それを圧縮画像データとして出力するものであり、コンピュータ1から構成されている。コンピュータ1は、CPU1a、メモリ1b、ディスクドライブ1c、ディスク1dや、入出力インターフェイス等を備えている。コンピュータ1は、機能的には、読み取り部3と、保持データレジスタ5と、比較部7と、FIFO9と、全同一カウンタ11と、半同一カウンタ13と、非同一カウンタ15とから構成されている。なお、ディスク1dは、後述するプログラムを予め記憶している記憶媒体である。ディスクドライブ1cは、ディスク1dが着脱自在に構成され、ディスク1dに対する読み書きを行う。ここでは、ディスク1dのプログラムを読み取るものである。CPU1aは、ディスクドライブ1cを介してプログラムを読みとり、メモリ1bにそのプログラムをロードする。CPU1aは、メモリ1bのプログラムを実行することで、後述する処理を行う。
 読み取り部3は、「処理対象データ」である画像データの一部のデータ(ここでは最小の処理単位のデータであり、1バイトである)を読み取る。保持データレジスタ5は、読み取り部3で読み取った画像データの一部を保持する。比較部7は、読み取り部3と保持データレジスタ5のデータ同士を比較し、全て一致(全同一)、半部一致(半同一)、全て不一致(非同一)の一致度合いを判断する。FIFO9は、先入れ先出し式のレジスタであり、保持データレジスタ5のデータを順次に保持する。全同一カウンタ11と、半同一カウンタ13と、非同一カウンタ15とは、FIFO9内におけるそれぞれの種類のデータ数を示す。全同一カウンタ11は、全同一データの個数を示すカウント値Nfを保持し、半同一カウンタ13は、半同一データの個数を示すカウント値Nhを保持し、非同一データの個数を示す非同一カウンタ15は、非同一データの個数を示すカウント値Nnを保持する。
 なお、上述したコンピュータ1が本発明における「連続性判定手段」と、「第1の符号化判定手段」と、「データ分割手段」と、「上位ビット連続性判定手段」と、「第2の符号化手段」とに相当する。
 ここでは、上述した「全同一データ」は、8ビット/ピクセルのデータのうち、比較対象のデータと全ビットが同一であることをいう。また、「半同一データ」は、8ビット/ピクセルのデータのうち、上位ビット(4ビット)だけが比較対象のデータと同一であって、下位ビット(4ビット)が比較対象のデータとは相違することをいう。また、「非同一データ」は、上述した同一データ及び半同一データ以外のことをいう。
 ここで、本発明の理解を容易にするために、まず従来例であるPack Bitsについて説明する。この圧縮技術は、同一データの連続/不連続する長さを記録していくことでデータの圧縮を行うものである。なお、以下の符号「-」は同一を表し、符号「+」は非同一を表す。
 例えば、4バイトで表現される「A_A_A_A」という処理対象データは、同じく4バイトで表現される「-4_A」とされ、「A_B_C_D」という処理対象データは、「+4_A_B_C_D」とされる。前者は、4バイト→2バイトとなり、後者は、4バイト→5バイトとなる。つまり、前者は圧縮効果が得られているが、後者は圧縮効果が得られていない。
 そこで、本発明は、以下に説明するPack Bitsに対する「改良点1」を加えた。
 つまり、処理対象データの各データを上位4ビットと下位4ビットに分割し、上位4ビットが同一データの連続を「半同一データ」として扱う。
 例えば、処理対象データが「70_71_72_73_74_75_76_77」である場合には、従来のPack Bitsと本発明とで圧縮を行うと結果は次のようになる。なお、以下の符号「¥」は半同一を表すものとする。処理対象データは、上位ビットが「7」として表現され、下位ビットが「0~7」として表現されているものとする。
 従来例では、「+8_70_71_72_73_74_75_76_77」となる。一方、本発明では、「¥8_70_12_34_56_7x」となる。なお、ここでの符号「x」は、空いた下位4ビットを埋めるだけのものである。ここで、本発明は、上位4ビットだけが共通している半同一データが8個連続していることを示し、それに続いて上位4ビットの同一データである「7」を記し、それに続けて各半同一データの下位4ビットを羅列している。
 従来例では、8バイト→9バイトとなって圧縮効果が得られていない一方、本発明では、8バイト→6バイトとなって圧縮効果が得られている。
 なお、本発明は、データを全同一、半同一、非同一の三種類に分類するために判別用に2ビットを必要とする。そのため、データは64個の連続数までのカウントとなる。
 処理対象データの全てのデータが非同一データの連続であった場合、Pack Bitsにより符号が付加されるので、圧縮前のデータサイズよりも大きくなる。つまり、符号の付加以上の圧縮ができない場合には、圧縮率が100%を越えて圧縮効果が期待できないということになる。
 例えば、処理対象データが「00_01_02_02_03_04」である場合、Pack Bitsでは「+2_00_01_-2_02_+2_03_04」となり、6バイト→8バイトとなる。Pack Bitsで全てを非同一データとして扱った場合には、「+6_00_01_02_02_03_04」となり、6バイト→7バイトとなる。つまり、このような場合には、同一データとして扱うよりも、全てを非同一データとして扱った方が圧縮効率がよいことになる。これにより、圧縮効果を得るためには、同一データが3連続以上である場合にのみ同一データとして扱うことが適切である。
 また、半同一データは、処理対象データの各データが5個以上連続して半同一である場合にのみ半同一データとして扱うことが適切である。
 例えば、処理対象データが以下の場合を例にとって圧縮効果について説明する。
 3連続である場合
 「00_10_11_12_00」は、「+1_00_¥3_10_12_+1_00」となり、5バイト→7バイトとなる。
 4連続である場合
 「00_10_11_12_13_00」は、「+1_00_¥4_10_12_3x_+1_00」となり、6バイト→8バイトとなる。
 5連続の場合
 「00_10_11_12_13_14_00」は、「+1_00_¥5_10_12_34_+1_00」となり、7バイト→8バイトとなる。これは、全てが非同一データである場合と同じ圧縮率となる。
 上述した点から、本発明では、同一データについては、3連続未満のときは非同一データとして扱い、半同一データについては、5連続未満のときは非同一データとして扱う。これが本発明のPack Bitsに対する「改良点2」である。
 具体的な例を示すと、例えば、処理対象データが「00_10_10_11_12_13_21_20_20_20_21_00」であったとする。この場合、第2番目と第3番目のデータはともに「10」であるが、2連続であるので同一データとして扱わない。また、第2番目から第6番目のデータは、上位4ビットが「1」である半同一データとして扱う。また、第8番目から第10番目のデータは全て「10」であり、3連続以上であるので、同一データとして扱い、第7番目~第11番目のデータは、上位4ビットが「2」である半同一データとしても扱えるが、同一データが3連続以上であるので、同一データを優先して半同一データとしては扱わない。
 次に、図2~図6を参照して、上述したデータ圧縮装置の動作について説明する。
 ステップS1~S3
 処理対象データである画像データを構成する各データのうち、最初のデータ(1バイト)を読み取り部3で読み込むとともに、そのデータを保持データレジスタ5に保持する。さらに、次のデータを読み取り部3に読み込む。ステップS2,S3により、画像データを構成している各データを順次1バイトずつ読み込んでいく。
 ステップS4
 比較部7は、現時点において読み取り部3にあるデータと、保持データレジスタ5にあるデータとを比較する。そして、その比較結果に応じて処理を分岐する。具体的には、全同一データであるならばステップS5へ移行し、半同一データであるならばステップS6へ移行し、非同一データであるならばステップS7へ移行する。なお、これらの各処理については詳細を後述する。
 ステップS5
 画像データを構成する各データの最後であるか否かにより処理を分岐する。最後である場合には、ステップS9に移行して最終データ処理を行い、最後でない場合には、ステップS2に移行して、読み取り部3から保持データレジスタ5へのデータ移動を行う。なお、最終データ処理については詳細を後述する。
 ここで、図3を参照して「全同一データ処理」について説明する。なお、図3において「↓1-1」等の表記は、その下方の経路であることを示す。また、以下の説明において、半同一データの出力は、8ビットデータのうちの下位4ビットを使用する。この全同一データ処理が本発明における「第1の符号化ステップ」に相当する。
 経路1-1
 ステップS11~S14(経路1-1)
 この経路は、同一データが64個連続している場合の処理である。ステップS11において全同一カウンタ11が63であるならばステップS12以降に処理を移行し、全同一データとしての符号に加えて連続データ数を64とし、さらに保持データレジスタ5の値を付加して出力する。そして、ステップS13において全同一カウンタ11と、半同一カウンタ13と、非同一カウンタ15とのカウント値を0にする。そして、ステップS14において、読み取り部3のデータを保持データレジスタ5に書き込む。
 経路1-2~経路1-5
 これらの経路は、同一データが3個以上連続することが確定する場合の処理である。
 経路1-2
 ステップS15では、全同一カウンタ11が1以上であるか否かにより処理を分岐する。既にFIFO9に全同一データが1個以上ある場合には、ステップS16において、半同一カウンタ13がNf+5個以上であるか否かにより処理を分岐する。半同一データがNf+5個以上ある場合には、ステップS17において半同一データを出力する。出力は、半同一データとしての符号(連続データ数は、Nh-1)+FIFO9のデータの値である。また、ステップS18においてFIFO9をクリアし、ステップS19において全同一カウンタ11をインクリメントする。
 経路1-3
 ステップS16において半同一カウンタ13が全同一カウンタ11のカウント値Nf+5個以上でなかった場合には、ステップS20に移行する。非同一カウンタ15が全同一カウンタ11のカウント値Nf+1個以上であって(ステップS20)、非同一カウンタ15が全同一カウンタ11のカウント値Nf+129以上である場合(ステップS21)には、非同一データを出力する(ステップS22)。出力は、非同一データとしての符号に加えて連続データ数128とし、さらにFIFO9のデータの値を付加する。その後、非同一データを出力する(ステップS23)。出力は、非同一データとしての符号に加えて連続数Nn-1とし、さらにFIFO9のデータを付加する。
 経路1-4
 ステップS21において非同一カウンタ15が全同一カウンタ11のカウント値Nf+129未満である場合には、ステップS23にて非同一データを出力する。出力は、非同一データとしての符号に加えて連続数Nn-1とし、さらにFIFO9のデータを付加する。
 経路1-5
 ステップS20において非同一カウンタ15が全同一カウンタ11のカウント値Nf+1未満である場合には、出力を行わずにステップS18でFIFO9をクリアする。
 経路1-6
 この経路は、同一データが3連続未満である場合の処理である。ステップS15において全同一カウンタ11が1未満である場合には、ステップS24で保持データレジスタ5の値をFIFO9に書き込み、ステップS25で全てのカウンタ11,13,15をインクリメントする。
 ここで、図4を参照して「半同一データ処理」について説明する。この半同一データ処理が本発明における「分割ステップ」及び「第2の符号化ステップ」に相当する。
 経路2-1
 この経路は、全同一データが3個以上連続している場合の処理である。ステップS31において全同一カウンタ11が2以上である場合には、ステップS32において全同一データを出力する。出力は、全同一データとしての符号に加えて連続データ数Nf+1とし、さらに保持データレジスタ5の値を付加する。ステップS34において、読み取り部3のデータを保持データレジスト5に書き込む。
 経路2-2
 この経路は、半同一データが64個連続している場合の処理である。ステップS31において全同一カウンタ11が2未満である場合には、ステップS35において半同一カウンタ13が63以上である場合、ステップS36において保持データレジスタ5の値をFIFO9に書き込む。ステップS37では、半同一データを出力する。出力は、半同一データとしての符号に加えて連続数を64とし、さらにFIFO9の値を付加する。ステップS38では、全同一カウンタ11を0とし、半同一カウンタ13をNh―64+1とし、非同一カウンタ15をNh-64+1とする。
 経路2-3~2-4
 これらの経路は、半同一データが5個以上連続するのが確定している場合の処理である。
 経路2-3
 ステップS39で半同一カウンタ13が4以上であって、ステップS40で非同一カウンタ15が半同一カウンタ13のカウント値Nh+1以上である場合には、ステップS41にて非同一データを出力する。出力は、非同一データとしての符号に加えて連続数Nn-Nhとし、FIFO9のデータを付加する。次いで、ステップS42では、保持データレジスタ5のデータをFIFO9に書き込み、ステップS42では、全同一カウンタ11を0とし、半同一カウンタ13をNh+1とし、非同一カウンタ15を0にする。
 経路2-4
 ステップS40において非同一カウンタ15が半同一カウンタ13のカウント値Nh+1未満である場合には、ステップS41を実行せずに、上述したステップS42,S43へ移行する。
 経路2-5
 ステップS39において半同一カウンタ13が4未満である場合には、ステップS44にて保持データレジスタ5のデータをFIFO9に書き込む。そして、ステップS45において、全同一カウンタ11を0とし、半同一カウンタ13をNf+1とし、非同一カウンタ15をNn+1とする。
 ここで、図5を参照して「非同一データ処理」について説明する。
 経路3-1
 ステップS51において、全同一カウンタ11が2以上であるならば、ステップS52にて全同一データを出力する。出力は、非同一データとしての符号に加えて連続数Nf+1とし、保持レジスタデータ5のデータを付加する。ステップS53において、全同一カウンタ11と、半同一カウンタ13と、非同一カウンタ15とを全て0にする。そして、ステップS54において、読み取り部3のデータを保持データレジスタ5に書き込む。
 経路3-2、3-3
 これらの経路は、半同一データが5個以上連続している場合の処理である。
 経路3-2
 半同一カウンタ13が4以上で(ステップS55)、かつ、非同一カウンタ15が半同一カウンタ13のカウント値Nh+1である場合には、ステップS57にて非同一データを出力する。出力は、非同一データとしての符号に加えて連続数Nn-Nhとし、FIFO9のデータを付加する。ステップS58において、保持データレジスタ5のデータをFIFO9に書き込む。さらに、ステップS59にて半同一データを出力する。出力は、半同一データとしての符号に加えて連続数Nh+1とし、FIFO9のデータを付加する。その後、ステップS60にて、全同一カウンタ11と、半同一カウンタ13と、非同一カウンタ15の全てを0とする。
 経路3-3
 ステップS56において、非同一カウンタ13がNh+1未満であった場合には、ステップS57を実施することなく、上述したステップS58以降に処理を分岐する。
 経路3-4
 この経路は、非同一データが128個連続している場合の処理である。
 非同一カウンタ13が127以上である場合には(ステップS61)、ステップS63において保持データレジスタ5のデータをFIFO9に書き込む。次に、ステップS64において、非同一データを出力する。出力は、非同一データとしての符号に加えて連続数128とし、FIFO9のデータを付加する。ステップS65では、全同一カウンタ11を0とし、半同一カウンタ13を0とし、非同一カウンタ15をNn-128+1とする。
 経路3-5
 この経路は、非同一データが128個未満の連続である場合の処理である。
 非同一カウンタ13が127未満である場合には(ステップS61)、ステップS65にいて保持データレジスタ5のデータをFIFO9に書き込む。続いて、ステップS66において、全同一カウンタ11を0とし、半同一データ13を0とし、非同一カウンタ15をNn+1とする。
 次に、図6を参照して、「最終データ処理」について説明する。
 経路4-1,402は、全同一データが3個以上連続する場合の処理である。
 経路4-1
 全同一カウンタ11が2以上かつ64である場合には(ステップS71,S72)、ステップS73にて全同一データを出力する。出力は、全同一データとしての符号に加えて連続数64とし、保持データレジスタ5のデータを付加する。ステップS74では、非同一データを出力する。出力は、非同一データとしての符号に加えて連続数1とし、保持データレジスタ5のデータを付加する。
 経路4-2
 ステップS72において全同一カウンタ11が64でない場合には、ステップS75において全同一データを出力する。出力は、全同一データとしての符号に加えて連続数Nf+1とし、保持データレジスタ5のデータを付加する。
 経路4-3、4-4
 これらの経路は、半同一データが5個以上連続している場合の処理である。
 経路4-3
 半同一カウンタ13が4以上かつ64以上である場合には(ステップS76、S77)、ステップS78で保持データレジスタ5のデータをFIFO9に書き込む。次に、ステップS79において半同一データを出力する。出力は、半同一データとしての符号に加えて連続数64とし、FIFO9のデータを付加する。さらに、ステップS80において、非同一データを出力する。出力は、非同一データとしての符号に加えて連続数Nh+64+1とする。
 経路4-4
 ステップS77において半同一データが64未満である場合には、ステップS81にて保持データレジスタ5のデータをFIFO9に書き込む。次に、ステップS82において、半同一データを出力する。出力は、半同一データとしての符号に加えて連続数をNh+1とし、FIFO9のデータを付加する。
 経路4-5、4-6
 これらの経路は、非同一データの処理である。
 経路4-5
 ステップS76において半同一カウンタ13が4未満であり、非同一カウンタ15が128以上である場合には(ステップS83)、ステップS84において保持データレジスタ5をFIFO9に書き込む。次に、ステップS85において、非同一データを出力する。出力は、非同一データとしての符号に加えて連続数128とし、FIFO9のデータを付加する。さらに、ステップS86において、非同一データを出力する。出力は、非同一データとしての符号に加えて連増数Nn-128+1とし、FIFO9のデータを付加する。
 経路4-6
 ステップS83において非同一カウンタ15が128未満であれば、ステップS87において、保持データレジスタ5をFIFO9に書き込む。次に、ステップS88において、非同一データを出力する。出力は、非同一データとしての符号に加えて連続数Nf+1とし、FIFO9のデータを付加する。
 なお、上述したステップS71が本発明における「連続性判定ステップ」に相当し、ステップS76が本発明における「上位ビット連続性判定ステップ」に相当する。
 ここで、図7~図11を参照する。なお、図7~図11は、処理過程の例を説明するための図である。
 例1(図7)
 同一データが2連続の場合であり、例えば、処理対象データがABBC……である場合を示す。この場合には、同一データの連続として扱わない
 例2(図8)
 同一データが3連続の場合であり、例えば、処理対象データがABBBC……である場合を示す。
 例3(図9)
 同一データが4連続の場合であり、例えば、処理対象データがABBBBC……である場合を示す。
 例4(図10)
 同一データが64連続の場合であり、例えば、処理対象データがABBB……BBC……である場合を示す。
 例5(図11)
 同一データが65連続の場合であり、例えば、処理対象データがABBB……BBBC……である場合を示す。
 上述したように実施例に係るデータ圧縮装置によると、処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、複数個の同一のデータを連長圧縮する。処理対象データについて同一のデータが所定数以上の連続でない場合には、処理対象データの各データを上位ビットと下位ビットに分割する。分割された処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定し、連続である場合には、半同一データの連続として、各データの上位ビットを連長圧縮し、各データの下位ビットを羅列する。このように、同一データが所定数以上連続する場合は、全同一データとして第1の符号化を行って圧縮を図るので圧縮効率を向上できる。また、同一データが所定数以上連続しない場合にはデータを分割し、上位ビットが同一で所定数以上連続している場合は、半同一データの連続として第2の符号化により圧縮を図る。したがって、同一データの連続性が低いデータであっても圧縮効率を向上することができる。
 また、同一データが「3」以上連続でなければ第1の符号化を行わず、半同一データが「5」以上連続でなければ第2の符号化を行わないので、符号追加による逆効果が生じず、圧縮効果が期待できる。
 本発明は、上記実施形態に限られることはなく、下記のように変形実施することができる。
 (1)上述した実施例では、図2~図6に示すような手順で処理を行うようにしたが、本発明はこのような手順のみに限定されるものではない。
 (2)上述した実施例では、処理対象データとして画像データを例示したが、本発明は処理対象データを画像データに限定するものではなく、例えば、文書データなどであっても処理対象とすることができる。
 以上のように、本発明は、画像データなどの処理対象データを圧縮する技術に適している。
 1 … コンピュータ
 3 … 読み取り部
 5 … 保持データレジスタ
 7 … 比較部
 9 … FIFO
 11 … 全同一カウンタ
 13 … 半同一カウンタ
 15 … 非同一カウンタ

Claims (9)

  1.  処理対象データを圧縮するデータ圧縮方法において、
     前記処理対象データについて同一のデータが所定数以上の連続であるか否かを判定する連続性判定ステップと、
     前記連続性判定ステップによる判定により、前記処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、前記複数個の同一のデータを連長圧縮するための第1の符号化を行う第1の符号化ステップと、
     前記連続性判定ステップによる判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、前記処理対象データの各データを上位ビットと下位ビットに分割する分割ステップと、
     前記分割ステップによって分割された前記処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定する上位ビット連続性判定ステップと、
     前記上位ビット連続性判定ステップによる判定により、前記各データのうち上位ビットのデータが同一であって所定数以上の連続である場合には、半同一データの連続として、前記各データの前記上位ビットを連長圧縮し、前記各データの下位ビットを羅列する第2の符号化を行う第2の符号化ステップと、
     を有することを特徴とするデータ圧縮方法。
  2.  請求項1に記載のデータ圧縮方法において、
     前記連続性判定ステップによる判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、所定数未満の各データを非同一データとし、前記第1の符号化ステップを実施しないことを特徴とするデータ圧縮方法。
  3.  請求項1または2に記載のデータ圧縮方法において、
     前記上位ビット連続性判定ステップによる判定により、上位ビットのデータが同一であって所定数以上の連続でない場合には、所定数未満の各データを非同一データとし、前記第2の符号化ステップを実施しないことを特徴とするデータ圧縮方法。
  4.  請求項1から3のいずれかに記載のデータ圧縮方法において、
     前記連続性判定ステップにおける所定数は「3」であることを特徴とするデータ圧縮方法。
  5.  請求項1から4のいずれかに記載のデータ圧縮方法において、
     前記上位ビット判定ステップにおける所定数は「5」であることを特徴とするデータ圧縮方法。
  6.  処理対象データを圧縮するデータ圧縮装置において、
     前記処理対象データについて同一のデータが所定数以上の連続であるか否かを判定する連続性判定手段と、
     前記連続性判定手段による判定により、前記処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、前記複数個の同一のデータを連長圧縮するための第1の符号化を行う第1の符号化手段と、
     前記連続性判定手段による判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、前記処理対象データの各データを上位ビットと下位ビットに分割するするデータ分割手段と、
     前記データ分割手段によって分割された前記処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定する上位ビット連続性判定手段と、
     前記上位ビット連続性判定手段による判定により、前記各データのうち上位ビットのデータが同一であって所定数以上の連続である場合には、半同一データの連続として、前記各データの前記上位ビットを連長圧縮し、前記各データの下位ビットを羅列する第2の符号化を行う第2の符号化手段と、
     を備えていることを特徴とするデータ圧縮装置。
  7.  請求項6に記載のデータ圧縮装置において、
     前記連続性判定手段による判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、所定数未満の各データを非同一データとし、前記第1の符号化手段による処理を実施しないことすることを特徴とするデータ圧縮装置。
  8.  請求項6または7に記載のデータ圧縮装置において、
     前記上位ビット連続性判定手段による判定により、上位ビットのデータが同一であって所定数以上の連続でない場合には、所定数未満の各データを非同一データとし、前記第2の符号化手段による処理を実施しないことを特徴とするデータ圧縮装置。
  9.  処理対象データをコンピュータによって圧縮するデータ圧縮プログラムであって、
     前記コンピュータのCPUがメモリにおいて実行することにより、
     前記処理対象データについて同一のデータが所定数以上の連続である否かを判定する連続性判定機能と、
     前記連続性判定機能による判定により、前記処理対象データについて同一のデータが所定数以上の連続である場合には、全同一データの連続として、前記複数個の同一のデータを連長圧縮するための第1の符号化を行う第1の符号化機能と、
     前記連続性判定機能による判定により、前記処理対象データについて同一のデータが所定数以上の連続でない場合には、前記処理対象データの各データを上位ビットと下位ビットに分割する分割機能と、
     前記分割機能によって分割された前記処理対象データの各データのうち、上位ビットのデータが同一値であって所定数以上の連続であるか否かを判定する上位ビット連続性判定機能と、
     前記上位ビット連続性判定機能による判定により、前記各データのうち上位ビットのデータが同一であって所定数以上の連続である場合には、半同一データの連続として、前記各データの前記上位ビットを連長圧縮し、前記各データの下位ビットを羅列する第2の符号化を行う第2の符号化機能と、
     を実現させるためのデータ圧縮プログラム。
PCT/JP2013/001926 2012-08-17 2013-03-21 データ圧縮方法及びその装置並びにそのプログラム Ceased WO2014027429A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012-181097 2012-08-17
JP2012181097A JP2014039198A (ja) 2012-08-17 2012-08-17 データ圧縮方法及びその装置並びにそのプログラム

Publications (1)

Publication Number Publication Date
WO2014027429A1 true WO2014027429A1 (ja) 2014-02-20

Family

ID=50287004

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/001926 Ceased WO2014027429A1 (ja) 2012-08-17 2013-03-21 データ圧縮方法及びその装置並びにそのプログラム

Country Status (2)

Country Link
JP (1) JP2014039198A (ja)
WO (1) WO2014027429A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106507108A (zh) * 2016-12-07 2017-03-15 中国石油大学(华东) 图像编码、解码的方法和装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0234038A (ja) * 1988-07-23 1990-02-05 Hitachi Ltd データ圧縮装置
JPH05336378A (ja) * 1992-05-28 1993-12-17 Nec Corp 画像処理装置
JPH08107360A (ja) * 1994-10-07 1996-04-23 Matsushita Electric Ind Co Ltd データ記憶装置ならびにデータ読出装置
JPH09162748A (ja) * 1995-12-01 1997-06-20 Fujitsu Ltd データ符号化方法、データ復号方法、データ圧縮装置、データ復元装置、及びデータ圧縮・復元システム
JP2008035066A (ja) * 2006-07-27 2008-02-14 Fujifilm Corp データ圧縮装置およびデータ圧縮プログラム
JP2011035460A (ja) * 2009-07-29 2011-02-17 Fujifilm Corp データ圧縮装置およびデータ圧縮プログラム
JP2011151572A (ja) * 2010-01-21 2011-08-04 Renesas Electronics Corp 画像データ処理装置およびその動作方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0234038A (ja) * 1988-07-23 1990-02-05 Hitachi Ltd データ圧縮装置
JPH05336378A (ja) * 1992-05-28 1993-12-17 Nec Corp 画像処理装置
JPH08107360A (ja) * 1994-10-07 1996-04-23 Matsushita Electric Ind Co Ltd データ記憶装置ならびにデータ読出装置
JPH09162748A (ja) * 1995-12-01 1997-06-20 Fujitsu Ltd データ符号化方法、データ復号方法、データ圧縮装置、データ復元装置、及びデータ圧縮・復元システム
JP2008035066A (ja) * 2006-07-27 2008-02-14 Fujifilm Corp データ圧縮装置およびデータ圧縮プログラム
JP2011035460A (ja) * 2009-07-29 2011-02-17 Fujifilm Corp データ圧縮装置およびデータ圧縮プログラム
JP2011151572A (ja) * 2010-01-21 2011-08-04 Renesas Electronics Corp 画像データ処理装置およびその動作方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106507108A (zh) * 2016-12-07 2017-03-15 中国石油大学(华东) 图像编码、解码的方法和装置
CN106507108B (zh) * 2016-12-07 2018-04-17 杜昀晓 图像编码、解码的方法和装置

Also Published As

Publication number Publication date
JP2014039198A (ja) 2014-02-27

Similar Documents

Publication Publication Date Title
CN111985636B (zh) 适用于人工神经网络的数据结构压缩技术
US8659452B2 (en) Data compression devices, operating methods thereof, and data processing apparatuses including the same
CN103458460B (zh) 对信号数据进行压缩和解压缩的方法和装置
CN106549673B (zh) 一种数据压缩方法及装置
US10884744B2 (en) System and method of loop vectorization by compressing indices and data elements from iterations based on a control mask
JP4814291B2 (ja) データ圧縮装置および方法
CN111028897B (zh) 一种基于Hadoop的基因组索引构建的分布式并行计算方法
US10721019B2 (en) Encoding variable length symbols to enable parallel decoding
CN104038232B (zh) 基于二次异或运算的测试数据压缩与解压缩方法
US20130019029A1 (en) Lossless compression of a predictive data stream having mixed data types
CN111061722B (zh) 一种数据压缩、数据解压缩方法、装置及设备
US10394763B2 (en) Method and device for generating pileup file from compressed genomic data
US20160171030A1 (en) Sorting an array consisting of a large number of elements
CN113285720B (zh) 基因数据无损压缩方法、集成电路及无损压缩设备
CN110288666B (zh) 一种数据压缩方法及装置
WO2014027429A1 (ja) データ圧縮方法及びその装置並びにそのプログラム
US8018359B2 (en) Conversion of bit lengths into codes
CN111370070B (zh) 一种针对大数据基因测序文件的压缩处理方法
CN111382849B (zh) 数据压缩方法、处理器、数据压缩装置及存储介质
US20190361909A1 (en) Optimizing data conversion using pattern frequency
US12537541B2 (en) Method and apparatus with data compression and/or decompression
JP6203823B2 (ja) データ圧縮方法及びその装置並びにそのプログラム
JP2013058203A (ja) 命令語圧縮装置、命令語圧縮方法及びコンピュータで読み取り可能な記録媒体
US20250028685A1 (en) Lossless compression and decompression method for data
CN112911314B (zh) 一种熵编码器的编码方法及熵编码器

Legal Events

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

Ref document number: 13879410

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13879410

Country of ref document: EP

Kind code of ref document: A1