KR19990085045A - Lossless data compression and decompression - Google Patents

Lossless data compression and decompression Download PDF

Info

Publication number
KR19990085045A
KR19990085045A KR1019980017184A KR19980017184A KR19990085045A KR 19990085045 A KR19990085045 A KR 19990085045A KR 1019980017184 A KR1019980017184 A KR 1019980017184A KR 19980017184 A KR19980017184 A KR 19980017184A KR 19990085045 A KR19990085045 A KR 19990085045A
Authority
KR
South Korea
Prior art keywords
values
bits
group
bit
information
Prior art date
Application number
KR1019980017184A
Other languages
Korean (ko)
Inventor
박인철
Original Assignee
박인철
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 박인철 filed Critical 박인철
Priority to KR1019980017184A priority Critical patent/KR19990085045A/en
Publication of KR19990085045A publication Critical patent/KR19990085045A/en

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

본 발명은 반복순환에 의한 비손실 데이터 압축 및 신장방법에 관한 것으로서, 본 발명에 의한 비손실 데이터 압축방법은 N비트의 정보를 받아들여 K비트 단위로 나누는 단계; 나뉘어진 K비트의 정보들이 갖는 2K가지의 값들 중에서 2가지 이상의 값을 대표하는 소정의 수의 대표값을 정하고 정보비트에 의해 구분하는 단계; 2K가지의 값들을 K비트의 정보들에서의 빈도수에 따라 2 이상의 그룹들로 분류하되, 적은 빈도수의 값들이 속한 그룹에는 상기 대표값을 포함시키고 많은 빈도수의 값들이 속한 그룹에는 상기 대표값이 결정됨으로 인해 삭제된 값을 포함시키는 단계; 각 그룹을 구분할 수 있는 선두비트 필드를 생성하고, 생성된 선두비트에 따라 각 그룹들 중에서 선택된 2 이상의 그룹들에 포함된 값들을 1개 이상씩 결합하여 새로운 값을 생성하는 단계; 및 비트 절감이 이루어진 경우에는 압축 대상 비트스트림으로부터 추가로 정보를 받아들여 비트 절감이 이루어진 비트스트림과 결합한 다음 다시 압축 과정을 반복 수행하고, 비트 절감이 이루어지지 않은 경우에는 N비트의 정보를 그대로 보관하고 압축 대상 비트스트림으로부터 새로이 N비트의 정보를 받아들여 압축과정을 반복 수행하는 단계를 포함함을 특징으로 한다.The present invention relates to a lossless data compression and decompression method by iterative circulation, comprising: receiving N bits of information and dividing the information into K bits; Determining a predetermined number of representative values representing two or more values among 2 K values of divided K bits of information and dividing the information by information bits; 2 but classify K kinds of values into two or more groups based on the frequency of in the K-bit information, the group that have a low frequency value that group that the value of the number of frequencies to include the representative value is the representative value Including the value deleted due to being determined; Generating a first bit field for distinguishing each group, and generating a new value by combining one or more values included in two or more groups selected from each group according to the generated first bit; And if bit savings are made, additional information is received from the bitstream to be compressed, combined with the bitstreams with bit savings, and the compression process is repeated again. If no bit savings are made, the information of N bits is kept as it is. And receiving a new N-bit information from the compression target bitstream and repeating the compression process.

본 발명에 의하면, 높은 압축률에 의해 데이터를 비손실 압축할 수 있으며, 비손실 압축된 데이터를 용이하게 신장할 수 있다.According to the present invention, data can be losslessly compressed at a high compression rate, and the losslessly compressed data can be easily extended.

Description

비손실 데이터 압축 및 신장방법Lossless data compression and decompression

본 발명은 데이터 압축 및 신장방법에 관한 것으로서, 특히 반복순환에 의한 비손실 데이터 압축 및 신장방법에 관한 것이다.The present invention relates to a data compression and decompression method, and more particularly, to a lossless data compression and decompression method by iterative circulation.

컴퓨터 및 네트워크에 의해 처리되는 데이터의 정보의 양이 급속도로 늘어남에 따라, 다량의 정보를 저장하기 위한 기록매체 및 고속의 정보전송이 요구되고 있다. 그러나, 기록매체의 기록용량을 증대시키기 위한 하드웨어 기술의 진보속도 및 네트워크를 통한 정보 전송속도는 정보량의 신장속도에 비해 완만하게 증가하여, 많은 양의 정보를 제한된 용량의 기록매체에 어떻게 효율적으로 저장하고 네트워크를 통해 어떻게 빠른 시간 내에 전송할 수 있는가에 대한 연구가 활발히 진행되고 있다.As the amount of information of data processed by computers and networks increases rapidly, recording media and high-speed information transmission for storing a large amount of information are required. However, the advancement speed of hardware technology to increase the recording capacity of the recording medium and the information transmission speed through the network are gradually increased compared to the expansion speed of the information amount, so that a large amount of information is efficiently stored in the limited capacity recording medium. In addition, research is being actively conducted on how to transmit data through a network in a short time.

제한된 용량의 기록매체에 많은 양의 데이터를 저장하기 위해서는 데이터를 압축하여 저장하고 압축되어 저장된 데이터를 신장하여 사용하는 방법이 있다. 또한, 제한된 시간 내에 더욱 많은 데이터를 네트워크로 전송하기 위해서는 송신단에서 데이터를 압축하여 전송하고 수신단에서 압축되어 전송된 데이터를 신장하여 사용하는 방법이 있다. 이와 같은 데이터 압축방식에는 압축된 데이터의 모든 정보를 그대로 복원할 수 있는 비손실 압축방식과 압축 및 복원과정에서 일부의 데이터가 손실되는 손실 데이터 압축방식이 있다.In order to store a large amount of data in a limited-capacity recording medium, there is a method of compressing and storing data, and expanding and using the compressed and stored data. In addition, in order to transmit more data to the network within a limited time, there is a method of compressing and transmitting data at a transmitting end and extending and using the compressed and transmitted data at a receiving end. Such data compression methods include a lossless compression method in which all information of compressed data can be restored as it is, and a loss data compression method in which some data is lost during compression and restoration.

현재, 비손실 데이터 압축방식은 3:1 정도의 압축률을 달성할 수 있으며, 손실 데이터 압축방식은 100:1 이상의 압축률을 달성할 수 있다. 손실 데이터 압축방식은 비손실 데이터 압축방식에 비하여 데이터 압축률이 훨씬 좋으나, 일부 데이터가 손실되어 복원시에 모든 정보의 복원이 불가능한 단점이 있으므로 주로 리던던시가 많은 화상 또는 음성 정보의 압축분야에서 많이 사용되고 있다. 따라서, 궁극적으로는 데이터의 손실이 없으면서도 데이터의 압축률이 높은 데이터 압축방식의 개발이 요구되고 있다.Currently, the lossless data compression method can achieve a compression ratio of about 3: 1, and the lossy data compression method can achieve a compression ratio of 100: 1 or more. The lossy data compression method has a much better data compression ratio than the lossless data compression method. However, since some data are lost, it is impossible to restore all the information. . Therefore, development of a data compression method having a high data compression rate without ultimately losing data is required.

본 발명은 상기의 문제점을 해결하기 위하여 창작된 것으로서, 데이터를 압축하고 새 정보를 입력받는 것을 반복순환하는 비손실 데이터 압축방법을 제공함을 제1의 목적으로 한다.SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and a first object of the present invention is to provide a lossless data compression method of repeatedly compressing data and receiving new information.

그리고, 비손실 압축된 정보를 반복순환에 의해 신장하는 비손실 압축데이터 신장방법을 제공함을 제2의 목적으로 한다.It is a second object of the present invention to provide a lossless compressed data decompression method for decompressing lossless compressed information by iterative circulation.

도 1은 본 발명에 의한 비손실 데이터 압축 과정을 도시한 흐름도이다.1 is a flowchart illustrating a lossless data compression process according to the present invention.

도 2는 본 발명에 의한 비손실 데이터 압축방법의 일실시예를 도시한 흐름도이다.2 is a flowchart illustrating an embodiment of a lossless data compression method according to the present invention.

도 3은 도 2의 240 단계를 보다 상세히 설명하는 흐름도이다.3 is a flowchart illustrating step 240 of FIG. 2 in more detail.

도 4는 그룹1에 속하는 값들과 그룹2에 속하는 값들이 결합하는 경우의 수를 설명하기 위한 도면이다.4 is a diagram for explaining the number of cases where values belonging to group 1 and values belonging to group 2 are combined.

도 5는 본 발명에 의한 비손실 데이터 압축방법의 다른 실시예를 도시한 흐름도이다.5 is a flowchart illustrating another embodiment of a lossless data compression method according to the present invention.

도 6은 본 발명에 의한 비손실 압축데이터의 신장 과정을 도시한 흐름도이다.6 is a flowchart illustrating a process of expanding lossless compressed data according to the present invention.

상기의 제1의 목적을 달성하기 위하여, 본 발명에 의한 비손실 데이터 압축방법은 (a) N비트의 정보를 받아들여 K비트 단위로 나누는 단계(N>K>1); (b) 상기 (a)단계에서 나뉘어진 K비트의 정보들이 갖는 2K가지의 값들 중에서 2가지 이상의 값을 대표하는 소정의 수의 대표값을 정하고 정보비트에 의해 구분하는 단계; (c) 상기 2K가지의 값들을 상기 K비트의 정보들에서의 빈도수에 따라 2 이상의 그룹들로 분류하되, 적은 빈도수의 값들이 속한 그룹에는 상기 대표값을 포함시키고 많은 빈도수의 값들이 속한 그룹에는 상기 대표값이 결정됨으로 인해 삭제된 값을 포함시키는 단계; (d) 각 그룹을 구분할 수 있는 선두비트 필드를 생성하고, 생성된 선두비트에 따라 각 그룹들 중에서 선택된 2 이상의 그룹들에 포함된 값들을 1개 이상씩 결합하여 새로운 값을 생성하는 단계; 및 (e) 상기 (a)단계 내지 상기 (d)단계를 통해 비트 절감이 이루어진 경우에는 압축 대상 비트스트림으로부터 추가로 정보를 받아들여 비트 절감이 이루어진 비트스트림과 결합한 다음 상기 (a)단계 내지 상기 (d)단계를 반복 수행하고, 비트 절감이 이루어지지 않은 경우에는 상기 N비트의 정보를 그대로 보관하고 압축 대상 비트스트림으로부터 새로이 N비트의 정보를 받아들여 상기 (a)단계 내지 상기 (d)단계를 반복 수행하는 단계를 포함함을 특징으로 한다.In order to achieve the first object described above, the lossless data compression method according to the present invention includes the steps of: (a) receiving N bits of information and dividing the information into K bits (N>K>1); (b) the representative value of the decided number of predetermined representing at least two values from the values of 2 K of the K-bit information which are divided in the step (a) divided by the information bits; (c) to group within, but divided into two or more groups according to frequency, to groups within the low frequency value, including the representative value and number of the frequency value at the of the K bits of the 2 K kinds of values of the information Including a value deleted due to the representative value being determined; (d) generating a head bit field for distinguishing each group, and generating a new value by combining one or more values included in two or more groups selected from each group according to the generated head bits; And (e) in the case where the bit reduction is made through the steps (a) to (d), additional information is received from the bitstream to be compressed and combined with the bitstream where the bit reduction is made. If step (d) is repeated and bit saving is not achieved, the N-bit information is kept as it is and new N-bit information is received from the bit stream to be compressed, and the steps (a) to (d) are performed. It characterized in that it comprises the step of repeatedly performing.

상기의 제1의 목적을 달성하기 위하여, 본 발명에 의한 다른 비손실 데이터 압축방법은 (a) N비트의 정보를 받아들여 K비트 단위로 나누는 단계(N>K>1); (b) 상기 2K가지의 값들을 상기 K비트의 정보들에서의 빈도수에 따라 2 이상의 그룹들로 분류하되, 상기 (a)단계에서 나뉘어진 K비트의 정보들이 갖는 2K가지의 값들 중에서 2가지 이상의 값을 대표하는 소정의 수의 대표값을 정한 것으로 가정할 때, 적은 빈도수의 값들이 속한 그룹에는 가정된 대표값에 대응되는 값들을 포함시키고 많은 빈도수의 값들이 속한 그룹에는 가정된 대표값이 결정됨으로 인해 삭제된 값을 포함시켜 각 그룹에 속하는 값들의 가지수에 편차를 두는 단계; (c) 각 그룹을 구분할 수 있는 선두비트 필드를 생성하고, 생성된 선두비트에 따라 각 그룹들 중에서 선택된 2 이상의 그룹들에 포함된 값들을 1개 이상씩 결합하여 새로운 값을 생성하는 단계; 및 (d) 상기 (a)단계 내지 상기 (c)단계를 통해 비트 절감이 이루어진 경우에는 압축 대상 비트스트림으로부터 추가로 정보를 받아들여 비트 절감이 이루어진 비트스트림과 결합한 다음 상기 (a)단계 내지 상기 (c)단계를 반복 수행하고, 비트 절감이 이루어지지 않은 경우에는 상기 N비트의 정보를 그대로 보관하고 압축 대상 비트스트림으로부터 새로이 N비트의 정보를 받아들여 상기 (a)단계 내지 상기 (c)단계를 반복 수행하는 단계를 포함함을 특징으로 한다.In order to achieve the first object described above, another lossless data compression method according to the present invention comprises the steps of: (a) receiving N bits of information and dividing it by K bits (N>K>1); (b) 2 in 2 K of values which are information of K bits, divided from the (a) step, but divided into two or more groups based on the frequency in the said second K kinds of values of the K bits of the information Assuming that a predetermined number of representative values representing more than one value is specified, the groups to which the values belong to a small frequency include values corresponding to the hypothesized representative values, and the assumed representative values to a group to which many values belong. Including the deleted value due to the determination to make a deviation in the number of branches belonging to each group; (c) generating a first bit field for distinguishing each group, and generating a new value by combining one or more values included in two or more groups selected from each group according to the generated first bit; And (d) in the case where the bit reduction is made through the steps (a) to (c), additional information is received from the bitstream to be compressed and combined with the bitstream where the bit reduction is made. If step (c) is repeated and bit saving is not achieved, the N-bit information is kept as it is and the new N-bit information is received from the bit stream to be compressed, and the steps (a) to (c) are performed. It characterized in that it comprises the step of repeatedly performing.

상기의 제2의 목적을 달성하기 위하여, 본 발명에 의한 비손실 압축된 비트스트림을 원래의 비트스트림으로 신장하는 방법은 (a) 상기 압축된 비트스트림으로부터 N비트의 정보를 취하는 단계; (b) 상기 N비트의 정보에서 복원된 X비트를 추출하는 단계; (c) 상기 N비트의 정보에서 남은 (N-X)비트를 M비트(M>N-X)로 신장하는 단계; 및 (d) 신장 후, 시작 비트가 '0'이면 N을 M으로 변경하여 상기 (b)단계를 계속하고, 시작 비트가 '1'이면 상기 (a)단계를 계속하는 단계를 포함함을 특징으로 한다.In order to achieve the above second object, the method for decompressing a lossless compressed bitstream into the original bitstream comprises: (a) taking N bits of information from the compressed bitstream; (b) extracting the recovered X bits from the N bits of information; (c) decompressing the remaining (N-X) bits from the N bits of information into M bits (M> N-X); And (d) continuing the step (b) by changing N to M if the start bit is '0' after the decompression, and continuing the step (a) if the start bit is '1'. It is done.

이하에서 첨부된 도면을 참조하여 본 발명을 상세히 설명한다.Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.

도 1에 의하면, 본 발명에 의한 비트스트림을 비손실 압축하는 과정은 다음과 같다.Referring to FIG. 1, a process of losslessly compressing a bitstream according to the present invention is as follows.

먼저, 압축 대상 비트스트림으로부터 N비트의 정보를 취한다(100 단계).First, N bits of information are taken from the compression target bitstream (step 100).

다음, N비트의 정보를 소정의 압축 방식에 의해 N비트 미만의 정보로 압축한다(110 단계). 이때, 압축된 정보의 크기를 X비트(N>X)라 하자.Next, N bits of information are compressed into less than N bits of information by a predetermined compression method (step 110). In this case, let the size of the compressed information be X bits (N> X).

다음, 추가로 압축할 정보가 더 있는지 여부를 확인하고(120 단계), 더 압축할 정보가 없으면 압축 과정을 종료한다.Next, it is checked whether there is more information to be compressed (step 120), and if there is no more information to be compressed, the compression process is terminated.

압축할 정보가 더 있다면, 압축 대상 비트스트림으로부터 새로운 Y비트의 정보를 취하고(130 단계), 압축된 X비트의 정보와 새로운 Y비트의 정보로 새로운 M(M=X+Y)비트의 정보를 구축하여 상기 110 단계를 계속한다(140 단계). 이때, Y는 (N-X)와 동일한 값이 될 수도 있지만, 압축 과정과 신장 과정 사이에 소정의 규칙을 정함에 의해 (N-X)와 다른 값이 될 수도 있다.If there is more information to be compressed, new Y bits of information are taken from the bit stream to be compressed (step 130), and new M (M = X + Y) bits are converted into the information of the compressed X bits and the new Y bits. Build and continue with step 110 (step 140). In this case, Y may be the same value as (N-X), but may be different from (N-X) by setting a predetermined rule between the compression process and the decompression process.

도 2에 의하면, 본 발명에 의한 비손실 데이터 압축방법의 일실시예가 수행되는 과정은 다음과 같다.Referring to FIG. 2, a process of performing an embodiment of a lossless data compression method according to the present invention is as follows.

압축이 필요한 비트스트림에서 N비트를 취하여 1비트 이상 단축시키는 과정을 1개의 압축 사이클로 정의한다. 먼저, 압축 대상 비트스트림으로부터 N비트의 정보를 취한다(200 단계).The process of taking N bits from a bitstream requiring compression and shortening them by more than one bit is defined as one compression cycle. First, N bits of information are taken from the compression target bitstream (step 200).

N비트의 압축 대상 비트스트림을 K(N>K>1)비트로 나누면, 나누어진 K비트의값들은 각각 0 ~ (2K-1)의 2K가지의 값들 중 하나의 값을 갖게 된다(210 단계). 따라서, N비트의 압축 대상 비트스트림에서 0 ~ (2K-1)의 2K가지의 값들에 각각 대응되는 K비트의 비트스트림의 빈도수를 계산한다. 이때, 빈도수가 가장 적은 2 이상의 값들을 하나의 대표값에 대응시키고 플래그로 구분한다(220 단계). 그리고, 2K가지의 값들을 그 빈도수에 따라 2 이상의 그룹으로 구분하고, 각 그룹별로 필요에 따라 1개 이상의 대표값을 포함시키도록 한다(230 단계). 그 다음, 압축대상 비트스트림을 스캔하면서 그 값이 속하는 그룹을 구분할 수 있는 선두비트 필드를 생성하고, 선두비트 필드를 스캔하면서 각 그룹에 속하는 값들을 1개 이상씩 결합한 새로운 결합값에 의해 표시함으로써 전체비트수를 절감하는 방법을 찾아간다(240 단계).When the N bit bitstream to be compressed is divided by K (N>K> 1) bits, the divided K bit values each have one of 2 K values of 0 to (2 K -1) (210). step). Therefore, to calculate the frequency of 2 K of the K bits of the bit stream that correspond to the values of 0 ~ (2 K -1) in the compressed bit stream of N-bit destination. In this case, two or more values having the lowest frequency correspond to one representative value and are divided into flags (step 220). Then, to include one or more of the representative value, if needed, by each of the K 2 according to the frequency is divided into two or more groups, each group of values (step 230). Next, by scanning the bit stream to be compressed, it creates a head bit field that can distinguish the group to which the value belongs, and scans the head bit field and marks it by a new combined value combining one or more values belonging to each group. The method to reduce the total number of bits is found (step 240).

이하에서는 2K가지의 값들을 3개의 그룹으로 나누어 변환하는 방법을 설명한다.Hereinafter will be described a method for converting into a 2 K kinds of values into three groups.

먼저, 0 ~ (2K-1)의 값 중 가장 적은 빈도를 갖는 4개의 값을 취하고, 이 4개의 값을 정보필드의 F1/F2플래그에 기록한다. 가장 적은 빈도의 2개의 값을 F1에 대응시키고, 그 다음 적은 빈도의 2개의 값을 F2에 대응시킨다. 그 다음, 0 ~ (2K-1)의 값 중 상기 4개의 값 다음으로 적은 빈도를 갖는 (2K-2-3)개의 값들을 F1 및 F2에 대응하는 값들과 함께 그룹1로 분류한다.First, four values having the lowest frequency among the values of 0 to ( 2K- 1) are taken, and these four values are recorded in the F1 / F2 flag of the information field. The two least frequent values correspond to F1, and the next two less frequent values correspond to F2. Then, (2 K-2 -3) values having the least frequency next to the four values among the values of 0 to (2 K -1) are classified into Group 1 together with the values corresponding to F1 and F2.

0 ~ (2K-1)의 값 중 가장 많은 빈도를 갖는 (2K-2-1)개의 값들은 그룹2로 분류하고, 나머지 2K-1개의 값들은 그룹3으로 분류한다.(2 K-2 -1) values having the highest frequency among values of 0 to (2 K -1) are classified into Group 2, and the remaining 2 K -1 values are classified into Group 3.

그룹 분류Group classification 그룹3Group3 그룹2Group2 그룹1Group 1 2K-12 K-1 pieces XX XX (2K-2-1)개(2 K-2 -1) F1F1 F2F2 (2K-2-3)개(2 K-2 -3)

표 1의 그룹 분류에서 그룹1 및 그룹2의 'X'표시는 가장 적은 빈도를 갖는 값 4개가 F1 및 F2에 각각 2개씩 대응됨으로써 2개의 값이 그룹1과 그룹2에서 각각 1개씩 삭제되었다고 간주한다는 의미이다.In the grouping of Table 1, the 'X' marks in Group 1 and Group 2 assume that the four values with the lowest frequency correspond to F1 and F2, respectively, so that two values are deleted from Group 1 and Group 2, respectively. I mean.

도 2의 240 단계는 도 3에 의해 상세히 설명된다.Step 240 of FIG. 2 is described in detail by FIG.

먼저, 그룹1로 선택된 값들의 빈도수의 총합과 그룹2로 선택된 값들의 빈도수의 총합을 비교한다(300 단계). 즉, 본 발명에 의해 비트 절감을 이루기 위해서는 다음과 같은 조건이 필요하다.First, the sum of the frequency of the values selected as the group 1 and the sum of the frequency of the values selected as the group 2 are compared (step 300). That is, in order to achieve bit savings according to the present invention, the following conditions are required.

< 조 건 > : 그룹1로 선택된 값들의 빈도수의 총합이 그룹2로 선택된 값들의 빈도수의 총합과 같거나 적어야 한다.<Requirement>: The sum of the frequencies of the values selected as Group 1 shall be less than or equal to the sum of the frequencies of the values selected as Group 2.

상기 <조건>이 만족되는 경우에는 다음과 같이 처리된다.If the above <condition> is satisfied, it is processed as follows.

그룹3의 2K-1개의 값들은 선두비트 '1'로 구분하고, 그룹2의 (2K-2-1)개의 값들은 선두비트 '00'으로 구분하고, 그룹1의 (2K-2-1)개의 값들은 선두비트 '01'로 구분하여, N비트의 압축 대상 비트스트림의 순서에 대응하는 선두비트 필드를 생성한다.2 K-1 values of group 3 are separated by the first bit '1', (2 K-2 -1) values of group 2 are separated by the first bit '00', and (2 K-2) of group 1 The -1) values are separated by the first bit '01' to generate a first bit field corresponding to the order of the N bit bitstream to be compressed.

선두비트 필드를 생성하는 동시에 N비트의 압축 대상 비트스트림을 차례대로 스캔하면서 K비트의 값들을 다음과 같이 변환한다(310 단계).While generating the first bit field and sequentially scanning the N-bit compression target bitstream, K-bit values are converted as follows (step 310).

그룹1에서 F1에 대응하는 값들은 '0'으로, F2에 대응하는 값들은 '1'로, 나머지 값들은 각각 그 값의 크기가 작은 값부터 순서대로 '2'에서 (2K-2-2)로 변환한다. 마찬가지로, 그룹2에 속하는 값들을 그 값의 크기가 작은 값부터 순서대로 '0'에서 (2K-2-2)로 변환하고, 그룹3에 속하는 값들을 그 값의 크기가 작은 값부터 순서대로 '0'에서 (2K-1-1)로 변환한다. 그룹1의 변환값 및 그룹2의 변환값은 (K-2)비트로 표시할 수 있고, 그룹3의 변환값은 (K-1)비트로 표시할 수 있다.In Group 1, the values corresponding to F1 are '0', the values corresponding to F2 are '1', and the remaining values are in order from '2' (2 K-2 -2) To. Similarly, the values belonging to group 2 are converted from '0' to (2 K-2 -2) in order from the smallest values, and the values belonging to group 3 are ordered from the smallest values Convert from '0' to (2 K-1 -1). The converted value of group 1 and the converted value of group 2 can be represented by (K-2) bits, and the converted value of group 3 can be represented by (K-1) bits.

따라서, 각 그룹에 속하는 값들은 각각의 선두비트의 수와 변환값을 위한 비트수를 합하여 모두 K비트로 표시된다. 즉,Therefore, the values belonging to each group are all expressed as K bits by adding up the number of each leading bit and the number of bits for the conversion value. In other words,

그룹3 : '1' + 2K-1가지의 값들,Group 3: '1' + 2 K-1 values,

그룹2 : '00' + 2K-2-1가지의 값들(많은 빈도를 갖는 값들),Group 2: '00' + 2 K-2 -1 values (values with high frequency),

그룹1 : '01' + 2K-2-1가지의 값들(적은 빈도를 갖는 값들).Group 1: '01' + 2 K-2 −1 values (values with less frequency).

선두비트 필드를 차례로 스캔하여, 그룹3의 선두비트에 해당하는 변환값은 그대로 두고, 그룹1과 그룹2의 선두비트에 해당하는 변환값들은 결합한 결합값으로 표기한다(320 단계). 즉, 첫 번째 그룹1의 선두비트를 만나게 되면 그 위치에 대응하는 변환값을 찾고, 첫 번째 그룹2의 선두비트의 위치에 대응하는 변환값을 찾아, 찾은 두 변환값에 대응하는 결합값을 표시한다. 2개의 변환값과 결합값의 매핑은 테이블을 설정하여 압축 과정 및 신장 과정에서 사용할 수 있다. 이때, 그룹1에 속하는 변환값과 그룹2에 속하는 변환값이 상호 결합하는 순서는 일정하게 유지되어야 한다.The first bit field is sequentially scanned, and the converted values corresponding to the first bits of the group 3 are left as they are, and the converted values corresponding to the first bits of the group 1 and the group 2 are expressed as a combined value combined (step 320). That is, when the first bit of the first group 1 is encountered, the converted value corresponding to the position of the first group 2 is found, the converted value corresponding to the position of the first bit of the first group 2 is found, and the combined value corresponding to the found two converted values is displayed. do. The mapping of the two transformed and combined values can be used in the compression and decompression processes by setting up a table. At this time, the order in which the transform values belonging to the group 1 and the transform values belonging to the group 2 should be kept constant.

상기한 바와 같이 그룹1의 변환값과 그룹2의 변환값들을 결합하는 이유를 설명하기로 한다.As described above, the reason for combining the transform values of group 1 and the transform values of group 2 will be described.

그룹1의 변환값은 0 ~ (2K-2-2)로 (2K-2-1)가지이고, 그룹2의 변환값도 0 ~ (2K-2-2)로 (2K-2-1)가지이다. 따라서, 이들 변환값들을 결합할 때의 경우의 수는 총 (2K-2-1)2가지, 즉 (22K-4-2K-1+1)가지이다. 따라서, 두 변환값들을 결합한 경우의 수 중 일부의 경우는 (2K-5)비트로 표현되고, 그 나머지 즉The conversion value of group 1 is from 0 to (2 K-2 -2) to (2 K-2 -1), and the conversion value of group 2 is also from 0 to (2 K-2 -2) to (2 K-2 -1) Thus, the number of cases of combining these converted values is a total of (2 K-2 -1) 2 kinds, that is, (2 2K-4 -2 K- 1 +1). Therefore, some of the number of cases where the two conversion values are combined are represented by (2K-5) bits,

(22K-4-2K-1+1)-22K-5= (22K-5-2K-1+1)(2 2K-4 -2 K-1 +1) -2 2K-5 = (2 2K-5 -2 K-1 +1)

가지의 경우는 (2K-4)비트로 표현된다. 한편, 그룹1의 F1 및 F2의 변환값과 결합하는 경우의 수는 각각 (2K-2-1)가지로, 전체Branches are represented by (2K-4) bits. On the other hand, the number of cases combined with the converted values of F1 and F2 in Group 1 is (2 K-2 -1), respectively,

2 × (2K-2-1) = (2K-1-2)2 × (2 K-2 -1) = (2 K-1 -2)

가지이다.It is eggplant.

그룹1의 F1 및 F2의 변환값과 결합하는 경우에 (2K-5)비트를 할당하면, (2K-5)비트를 할당할 수 있는 나머지 경우의 수는If (2K-5) bits are assigned when combined with the converted values of F1 and F2 in group 1, the remaining number of cases in which (2K-5) bits can be allocated is

22K-5-(2K-1-2) = (22K-5-2K-1+2)2 2K-5- (2 K-1 -2) = (2 2K-5 -2 K-1 +2)

가지이다. 따라서, 그룹1의 F1 및 F2의 변환값과 결합하는 경우를 제외하고 (2K-5)비트를 할당할 수 있는 경우의 수는 (2K-4)비트를 할당하는 경우의 수에 비해 정확히 하나 더 많다. 이와 같은 관계는 도 4에 도시되어 있다.It is eggplant. Therefore, except when combined with the converted values of F1 and F2 in Group 1, the number of cases in which (2K-5) bits can be allocated is exactly one more than the number of cases in which (2K-4) bits are allocated. many. This relationship is shown in FIG.

이때, 그룹1의 F1 및 F2의 변환값과 결합하는 경우, 즉 수학식 2에 의해 그 가지수가 표시된 경우에는 최초 K비트로 표시되었던 2개의 비트스트림에 대하여 F1 및 F2에 대응된 각각의 2가지 값 중 하나를 정확히 복원하기 위해 1비트, 선두비트를 위해 4비트 및 결합 경우의 수를 표시하기 위해 (2K-5)비트가 소요되어 총 비트수에는 변동이 없게 된다.In this case, when combined with the transformed values of F1 and F2 of Group 1, that is, when the number is indicated by Equation 2, each of the two values corresponding to F1 and F2 for the two bitstreams indicated by the first K bits It takes 1 bit to correctly restore either, 4 bits for the leading bit, and (2K-5) bits to indicate the number of combined cases so that the total number of bits remains unchanged.

그리고, 수학식 3에 의해 표시된 경우의 수는 수학식 1에 표시된 경우의 수보다 1개 더 많으므로, 이 1가지 경우를 제외한 나머지 경우는 선두비트를 위해 4비트, 결합 경우의 수를 표시하기 위해 (2K-5)비트 및 수학식 1에 표시된 경우와 구별하기 위한 1비트가 소요되어 총 비트수에는 변동이 없게 된다.In addition, since the number represented by Equation 3 is one more than the number represented by Equation 1, the remaining cases except for this one case represent 4 bits for the first bit and the number of combined cases. It takes one bit to distinguish from the case shown in (2K-5) bits and the equation (1), so that the total number of bits remains unchanged.

또한, 수학식 1에 표시된 경우에도 선두비트를 위해 4비트, 결합 경우의 수를 표시하기 위해 (2K-4)비트가 소요되어 총 비트수에는 변동이 없게 된다.In addition, even in the case shown in Equation 1, 4 bits are used for the first bit and (2K-4) bits are required to indicate the number of combined cases, so that the total number of bits remains unchanged.

다만, 수학식 3에 표시된 경우 중 하나의 경우만이 선두비트를 위해 4비트, 결합 경우의 수를 표시하기 위해 (2K-5)비트가 소요되어 총 비트수를 줄일 수 있는 요인이 된다. 따라서, F1 및 F2가 포함되지 않는 경우 중 가장 높은 빈도를 갖는 경우에 대해 그 값을 정보필드의 최다빈도플래그에 포함시키고, (2K-5)비트를 할당하는 것이 유리하다.However, only one of the cases shown in Equation 3 takes 4 bits for the first bit and (2K-5) bits to indicate the number of combined cases, thereby reducing the total number of bits. Therefore, it is advantageous to include the value in the highest frequency flag of the information field and allocate (2K-5) bits for the case with the highest frequency among the cases where F1 and F2 are not included.

상기한 방법으로 그룹1의 변환값과 그룹2의 변환값을 결합한 후에도 그룹2의 변환값이 남는 경우에는 남은 그룹2의 변환값을 그대로 두거나, 그룹2의 변환값들끼리 결합하여 추가로 비트를 절감하는 방법을 사용할 수 있다(330 단계). 그룹2의 변환값들끼리만 결합하는 경우에는 F1, F2와 결합하는 경우가 없으므로 (2K-2-1)가지의 경우를 선택하고, 이 경우에 해당할 때마다 1비트씩 절감할 수 있다.If the converted value of group 2 remains after combining the converted value of group 1 and the converted value of group 2 by the above-described method, the remaining converted value of group 2 remains as it is, or the combined values of group 2 are combined to further add bits. A method of saving may be used (step 330). In case of combining only the conversion values of group 2, there is no case of combining with F1 and F2. Therefore, the case of (2 K-2 -1) can be selected, and each bit can be reduced by 1 bit.

이와 같은 방법으로 주어진 압축 대상 비트스트림을 압축시킬 수 있는데 상기 <조건>이 만족되지 않는 경우에는 다음과 같은 몇가지 방법들을 동시에 고려하여 압축방법을 찾아가도록 한다.In this way, a given compression target bitstream can be compressed. If the <condition> is not satisfied, several compression methods are considered simultaneously to find a compression method.

첫째 방법으로는 상기 <조건>이 만족하지 아니한 경우, 배타논리합(XOR)을 이용하여 비트스트림을 재구성하는 방법이다.In the first method, when the <condition> is not satisfied, the bitstream is reconstructed using an exclusive logic sum (XOR).

이 방법에 의하면, N비트의 비트스트림을 K비트씩 구분한 상태에서 첫 번째 K비트의 값과 이것에 이어지는 두 번째 K비트의 값을 배타논리합하고, 배타논리합하여 생성된 값을 두 번째 K비트의 값으로 대치한다. 계속하여 대치되기 전의 두 번째 K비트의 값과 그 다음에 이어지는 세 번째 K비트의 값을 배타논리합하여 세 번째 K비트의 값으로 대치한다. 이와 같은 방식으로 N비트의 비트스트림 전체에 대하여 차례로 배타논리합하는 것을 1차 배타논리합변환이라 한다.According to this method, an N-bit bitstream is divided by K bits, and the first K-bit value and the second K-bit value following this are exclusively logically summed and the value generated by the exclusive logical sum is added to the second K-bits. Replace with the value of. Subsequently, the value of the second K-bit before the substitution and the value of the third K-bit following it are exclusively replaced with the value of the third K-bit. In this manner, the exclusive logical sum of all the N-bit bitstreams in order is called a first-order exclusive logical sum conversion.

1차 배타논리합을 한 후 상기 <조건>을 만족하는지 여부를 검사하고, <조건>에 만족하는 경우에는 그룹1에 속하는 값들과 그룹2에 속하는 값들을 변환하여 서로 결합함으로써 압축을 시도하고, <조건>이 만족하지 않는 경우에는 같은 방식으로 2차 배타논리합변환을 한다. 이와 같은 변환을 계속 반복하면 1차 배타논리합변환 전의 N비트의 비트스트림과 완전히 일치하는 비트스트림이 반드시 다시 나타나게 되는데, 이 때의 변환을 M차 배타논리합변환이라 하고 차수변환은 여기까지가 한계이다(340 단계).After the first exclusive logic sum, it is checked whether the <condition> is satisfied. If the <condition> is satisfied, the compression is performed by converting the values belonging to the group 1 and the values belonging to the group 2 and combining them, and < If the condition> is not satisfied, the second exclusive logical OR is performed in the same manner. If the conversion is repeated repeatedly, the bitstream that exactly matches the bitstream of the N bits before the first exclusive logical sum conversion will always appear again. The conversion at this time is called the M-order exclusive logical sum conversion, and the order conversion is the limit. (340 steps).

M차 배타논리합변환이 이루어지기 전에 N비트 전체에 대하여 약속된 특정비트값을 배타논리합하도록 하는 것을 1회 이상 약속된 회차에 하도록 하여 전체 N비트값의 배타논리합변환에 따른 정해진 흐름을 중간에 임의로 변환하도록 하면 조건에 맞는 비트 상태를 얻을 수 있는 확률이 높아진다.Before the M-order exclusive logical conversion is performed, the exclusive logical sum of a specific bit value promised for all of the N bits must be performed at least once in a promised sequence so that a predetermined flow according to the exclusive logical-conversion of all N-bit values is arbitrarily selected. The conversion increases the probability of obtaining a bit state that meets the condition.

배타논리합변환의 방식에도 여러 가지 방식이 이용될 수 있다. 예를들면, 4의 배수번째의 K비트의 값과 그 다음의 K비트의 값만을 배타논리합하는 방식이 사용될 수도 있다.Various methods may also be used for the exclusive logical sum conversion method. For example, a method of exclusive logical sum of only the value of the K bits in the multiples of four and the value of the next K bits may be used.

이와 같이 어떤 방식에 의해 몇 차까지 변환했는가 또는 중도에 임의변환을 하였는가 등에 관한 정보는 정보필드의 XOR횟수플래그, XOR임의변환플래그 및 XOR방법플래그에 표시되어 원래의 데이터를 복구할 때 사용될 수 있도록 한다.In this way, information on how many times the conversion is made or whether the random conversion is performed in the middle is displayed on the XOR count flag, the XOR random conversion flag, and the XOR method flag of the information field so that it can be used when restoring the original data. do.

둘째 방법은 첫째 방법에 의해서도 상기 <조건>을 만족하지 못하는 경우에 사용되는 것으로서 다음과 같은 과정을 거친다.The second method is used when the above <Condition> is not satisfied by the first method, and goes through the following process.

먼저, 그룹1에 속하는 값들의 총빈도수에서 그룹2에 속하는 값들의 총빈도수를 뺀 초과개수를 구하고, N비트의 압축대상 비트스트림에 대한 선두비트 필드 및 변환값을 생성한다(350, 360 단계).First, the excess number is obtained by subtracting the total frequency of the values belonging to Group 1 by subtracting the total frequency of the values belonging to Group 2, and generating a leading bit field and a transform value for the N-bit compression bitstream (steps 350 and 360). .

그 다음, 그룹1과 그룹2에 각각 속하는 변환값들을 1대1로 결합하고 난 후에 여분으로 남는 그룹1의 변환값들을 F1 및 F2에 대응되는 원래의 4가지 값들을 복원하여 새로운 변환값을 만들면, 그룹1은 (2K-2+1)가지의 변환값들을 가진다. 이 변환값들 중 가장 적은 빈도수를 갖는 2가지 변환값에 (K-2)비트의 소정의 값을 할당하여 표현한 후, 1비트를 더 추가하여 2가지 변환값을 구분하고, 나머지 (2K-2-1)가지의 변환값들에 대해서는 (K-2)비트의 다른 값들을 할당하여 표현한다. 따라서, 그룹1에 속하는 값들의 총빈도수에서 그룹2에 속하는 값들의 총빈도수 만큼을 뺀 개수의 값들을 그룹1에서 미리 선택하는데, 몇가지 선택방법을 정하여 두고 그 중 선택된 값들 중에서 가장 적은 빈도수를 갖는 2가지의 값들의 총빈도수가 가장 적은 방법을 선정한다(370, 380 단계).Then, after combining the transformed values belonging to Group 1 and Group 2 in a one-to-one, and restoring the original four values corresponding to F1 and F2 to make the new converted value , Group 1 has (2 K-2 +1) transform values. Among the transformed values, the two transformed values having the lowest frequency are allocated by expressing a predetermined value of (K-2) bits, and then one more bit is added to distinguish the two transformed values, and the remaining (2 K- 2 -1) conversion values are expressed by allocating different values of (K-2) bits. Therefore, the number of values subtracted by the total frequency of the values belonging to Group 2 from the total frequency of the values belonging to Group 1 is preselected from Group 1, with some selection methods defined and 2 The method with the lowest total frequency of eggplant values is selected (steps 370 and 380).

여기에서 초과 개수에 대한 정보 및 선택방법은 각각 정보필드의 초과갯수플래그 및 초과선별플래그에 기록되어야 한다. 초과갯수플래그는 각 그룹의 개수를 통해서 계산할 수 있으므로 생략될 수 있다.Here, the information on the excess number and the selection method should be recorded in the excess number flag and the excess sorting flag of the information field, respectively. The excess number flag can be omitted because it can be calculated from the number of each group.

다시 도 2를 설명하면, 이상과 같은 방법으로 주어진 N비트의 비트스트림을 1비트 이상 단축시키는 과정을 1개의 압축 사이클이라 칭한다. 압축 사이클의 후단에서는 추가로 압축될 정보가 있는지 여부를 확인하여 더 이상의 압축 대상 정보가 없다면 압축과정을 종료한다(250 단계).Referring to FIG. 2 again, a process of shortening a given N-bit bitstream by more than one bit in the above-described manner is called one compression cycle. At the end of the compression cycle, it is checked whether there is information to be further compressed, and if there is no further compression target information, the compression process is terminated (step 250).

압축 사이클은 정보필드로 사용되는 비트수에 비해 압축에 의해 절감되는 비트의 수가 하나 이상 많아야 성공적이 된다. 만약 압축 사이클이 진행되어 상기한 여러 방법을 적용하더라도 압축 대상 비트스트림을 1비트 이상 단축할 수 없다면, 그 상태로 N비트의 비트스트림은 그대로 두고 다시 시작 비트를 '1'로 하여 최초의 압축 사이클을 시작한다(260, 280 단계). 압축 사이클이 성공적인 경우에는 추가 정보를 입력하여 다시 압축 사이클을 시작한다(260, 270 단계). 최초의 압축 사이클을 시작할 때 시작 비트를 '1'로 하고, 그 다음 압축 사이클부터는 '0'으로 하여 복구시에 압축 사이클이 반복되는 한계를 구분할 수 있도록 한다. 시작 비트로 정보 필드에 포함된다.The compression cycle is successful only if the number of bits saved by compression is one or more than the number of bits used for the information field. If the compression cycle progresses and the above-described methods are not applied, and the bit stream to be compressed cannot be shortened by more than one bit, the first compression cycle is performed with the start bit set to '1' while leaving the N bit stream as it is. Start (step 260, 280). If the compression cycle is successful, input additional information to start the compression cycle again (steps 260 and 270). The start bit is set to '1' at the beginning of the first compression cycle and '0' from the next compression cycle so that the limit in which the compression cycle is repeated upon recovery can be distinguished. It is included in the information field as a start bit.

이하에서는 구체적인 숫자를 예로들어 설명하기로 한다. 여기에서는 2K가지의 값들을 2개의 그룹으로 분류하는 것으로 가정한다.Hereinafter, a specific number will be described as an example. It is assumed here that 2K values are classified into two groups.

압축 대상 비트스트림의 크기를 N = 3,840,000비트로 두고, 이 압축 대상 비트스트림을 구분 단위 K = 6비트로 나누면, 640,000개의 값들이 생성된다. 이 640,000개의 값들은 0 ~ 63의 64가지의 값들 중 하나의 값을 취하며, 64가지의 값들은 각각 평균 10,000개씩의 빈도수를 가지나, 대응하는 빈도수는 각각 다를 수 있다.If the size of the bit stream to be compressed is N = 3,840,000 bits and the bit stream to be divided is divided by the division unit K = 6 bits, 640,000 values are generated. These 640,000 values take one of the 64 values of 0 to 63, and the 64 values each have an average frequency of 10,000, but the corresponding frequencies may be different.

여기에서 64가지 값들 중 빈도수가 가장 적은 4개를 선택하는데 그 값들이 빈도수가 적은 순서대로 (20, 14, 55, 8)이라 가정한다. 그러면, 20과 14의 값을 가지는 것을 F1에 대응시키고, 55와 8의 값을 F2에 대응시킨다. 이 4가지의 값은 정보필드에 6×4 = 24비트를 할당하여 기록한다.Here, four of the 64 values are selected with the lowest frequency, and the values are assumed to be (20, 14, 55, 8) in order of decreasing frequency. Then, the values 20 and 14 correspond to F1, and the values 55 and 8 correspond to F2. These four values are recorded with 6 × 4 = 24 bits assigned to the information field.

그리고, 64가지의 값 중 상기 4가지의 값을 제외한 60가지의 값에서 가장 적은 빈도수를 갖는 (2(6-1)-3), 즉 29가지의 값을 선택하여 F1, F2와 함께 그룹1로 분류하고, 선택되지 않은 나머지 31가지의 값들은 많은 빈도수를 갖는 값들로서 그룹2로 분류한다.The group 1 together with F1 and F2 is selected by selecting (2 (6-1) -3), that is, 29 values having the lowest frequency among the 60 values except the 4 values among the 64 values. The remaining 31 values that are not selected are classified into Group 2 as values having a high frequency.

그룹 분류Group classification 그룹2Group2 그룹1Group 1 XX XX 많은 빈도의 31가지 값들31 high frequency values F1=20F1 = 20 F2=55F2 = 55 적은빈도의 29가지 값들29 values of low frequency

표 2에서 'X'는 각 그룹의 32개의 값들에서 F1 및 F2에 각각 대응되는 14 및 8의 값이 삭제된 것으로 가정하기 위한 것이다(실제로는 그룹1에 31가지의 값들이 속하는 것이 아니라 33가지의 값들이 속하는 것이다).In Table 2, 'X' is intended to assume that the values of 14 and 8 corresponding to F1 and F2 are deleted from the 32 values of each group (actually, 31 values are not included in Group 1 Values belong to).

3,840,000비트의 압축 대상 비트스트림을 6비트씩 나누어 스캔하면서, 그 값이 그룹1에 속하는 33가지의 값이면 선두비트를 '1'로 표시하고, 그룹2에 속하는 31가지 값이면 선두비트를 '0'으로 표시하여 640,000비트의 선두비트 필드를 생성한다.The 3,840,000-bit bitstream to be compressed is scanned by 6 bits, and if the value is 33 values belonging to group 1, the first bit is marked as '1', and if the 31 values belonging to group 2, the first bit is set to '0' 'To create a 640,000-bit leading bit field.

한편, 선두비트 필드를 생성하면서 그룹1에 속하는 값들 중 F1에 대응하는 값들(20, 14)은'0'으로, F2에 대응하는 값들(55, 8)은 '1'로, 나머지 선택된 29가지의 값들은 그 값들의 크기 순서대로 각각 '2' ~ '30'으로 변환한다. 그리고, 그룹2에 속하는 값들도 크기 순서대로 각각 '0' ~ '30'으로 변환한다.Meanwhile, among the values belonging to Group 1 while generating the first bit field, the values 20 and 14 corresponding to F1 are '0', and the values 55 and 8 corresponding to F2 are '1', and the remaining 29 kinds are selected. The values of are converted into '2' to '30' in order of their magnitude. The values belonging to the group 2 are also converted into '0' to '30' in order of magnitude.

이제, 그룹1에 속하는 값들의 총빈도수와 그룹2에 속하는 값들의 총빈도수를 비교한다. 먼저, 그룹1에 속하는 적은 빈도를 갖는 33가지의 값들의 총빈도수가 그룹2에 속하는 많은 빈도를 갖는 31가지의 값들의 총빈도수와 같거나 적은 경우를 가정한다. 이하의 과정들을 "방법 1"이라 정의한다.Now, compare the total frequency of the values belonging to group 1 with the total frequency of the values belonging to group 2. First, it is assumed that the total frequency of 33 values having a low frequency belonging to group 1 is less than or equal to the total frequency of 31 values having a high frequency belonging to Group 2. The following procedures are defined as "Method 1".

그룹1을 선두에 두는 것으로 하여 그룹1에 속하는 값과 그룹2에 속하는 값을 한 개씩 쌍으로 처리한다. 즉, 선두비트 필드 640,000개의 값을 스캔하면서 순차적으로 그 비트값이 '1'인 것과 '0'인 것을 1개씩 묶어서 취급하는데, 그룹마다 31가지의 값이 있으므로 2개의 값을 결합하여 생성되는 값의 경우의 수는 31×31=961가지이다.By putting group 1 at the head, the values belonging to group 1 and the values belonging to group 2 are processed one by one. In other words, while scanning 640,000 values of the first bit field, the bit values of '1' and '0' are sequentially processed one by one. Since there are 31 values in each group, the values generated by combining two values The number of cases is 31 x 31 = 961 types.

그런데, 원래에는 6비트인 값 2개, 즉 12비트로 표현되었고, 각각의 변환값이 대응하는 선두비트가 2비트가 사용되었으므로 각 결합값을 표현하기 위해서는 961가지의 경우의 수를 10비트 이하로 표현하면 된다. 이 961가지의 경우의 수에는 F1, F2와 결합한 경우의 수도 포함된다.By the way, it was originally expressed as two 6-bit values, that is, 12 bits. Since the first bit corresponding to each converted value used 2 bits, the number of 961 cases was less than 10 bits to represent each combined value. You can express it. The number of these 961 cases includes the number of cases combined with F1 and F2.

이 961가지의 경우를 도 4과 같은 구조로 표현하면 다음과 같다.The 961 cases are expressed as shown in FIG. 4 as follows.

961가지의 경우의 수 중에서 F1과 결합한 31가지의 경우의 수 및 F2와 결합한 31가지의 경우의 수를 먼저 구분하고, 나머지 899가지의 경우의 수는 다시 450가지의 경우의 수와 449가지의 경우의 수로 분리한다.Among the 961 cases, 31 cases combined with F1 and 31 cases combined with F2 are distinguished first.The remaining 899 cases are again 450 and 449 cases. Separate by number of cases.

이렇게 하여 F1 및 F2와 결합한 62가지의 경우의 수는 9비트로 표현한다. 이때, F1 및 F2와 결합한 62가지의 경우의 수에 대해서는 F1에 결합된 2가지 값들(20, 14) 중 원래의 값을 복구하고 F2에 결합된 2가지 값들(55, 8) 중 원래의 값을 복구하기 위해 각각 1비트가 추가되어야 하므로 결합값을 표현하기 위해 총 10비트가 그대로 사용된다. 나머지 899가지의 경우의 수 중 1가지의 경우의 수를 제외한 898가지는 449가지씩 2부류로 나누어, F1 및 F2와 결합한 62가지의 경우의 수를 위해 사용된 9비트의 값을 제외한 나머지 9비트의 값을 각각 할당하고, 1비트를 사용하여 그 부류를 구분하므로 결합값을 표현하기 위해 총 10비트가 사용된다.In this way, the number of 62 cases combined with F1 and F2 is represented by 9 bits. At this time, for the number of 62 cases combined with F1 and F2, the original value of the two values 20 and 14 coupled to F1 is restored and the original value of the two values 55 and 8 coupled to F2. Since 1 bit must be added to recover the data, a total of 10 bits are used as it is to represent the combined value. Of the remaining 899 cases, 898 except for one case are divided into two classes of 449, and the remaining 9 bits are used except for the 9-bit value used for the 62 cases combined with F1 and F2. A total of 10 bits are used to represent the combined value since each value is assigned and one bit is used to distinguish the class.

다만, 여기에서 남는 1가지 경우만이 9비트로 표현되어 1비트를 절감할 수 있다. 따라서, 899가지의 경우의 수 중 가장 빈도가 많은 경우의 값을 이 경우로 하여 9비트로 표현하고, 그 값을 정보필드의 최다빈도플래그에 9비트를 할당하여 기록한다.However, only one remaining case is represented by 9 bits, thereby saving 1 bit. Therefore, the value of the most frequent number among the 899 cases is expressed as 9 bits in this case, and the value is recorded by assigning 9 bits to the highest frequency flag of the information field.

그리하여, 선두비트 필드 640,000비트에 이어서 두 그룹이 결합된 결합값을 각각 10비트씩 할당하여 표현하는데, 단 예외적인 한 경우에만 그 결합값이 9비트가 할당되어 표현된다. 따라서, 압축된 데이터의 신장 과정에서는 최초 9비트가 결합값을 정보필드 최다빈도플래그의 9비트와 비교하여 같은 경우에는 그대로 9비트만을 취하여 복원하고, 다른 경우에는 1비트를 더 취하여 복원한다.Thus, the combined value of the two groups combined after the leading bit field 640,000 bits is assigned by 10 bits, respectively, except that the combined value is assigned with 9 bits. Therefore, in the decompression process of the compressed data, the first 9 bits compare the combined value with the 9 bits of the information field maximum frequency flag, and restore only 9 bits in the same case as it is.

만일 두 그룹에 속하는 값들의 총빈도수가 같은 경우에는 도 2와 같은 방법에 의해 그 처리가 완료된다. 그런데, 그룹2에 속하는 값들의 총빈도수가 그룹1에 속하는 값들의 총빈도수보다 많은 경우에는 그 초과된 그룹2의 값들에 대하여 31가지의 변환값을 5비트를 사용하여 표현하고, 다만 그룹2에서 가장 빈도가 많은 값을 '1111'의 4비트로 표현함으로써 추가적인 비트 절감을 이룰 수 있다.If the total frequencies of the values belonging to the two groups are the same, the process is completed by the method as shown in FIG. However, if the total frequency of the values belonging to group 2 is greater than the total frequency of the values belonging to group 1, 31 converted values are expressed using 5 bits for the excess values of group 2, except in group 2 Additional bit savings can be achieved by representing the most frequent value as 4 bits of '1111'.

상기한 방법에 의해 변환된 비트스트림의 구조는 표 3과 같다.The structure of the bitstream converted by the above method is shown in Table 3.

변환된 비트스트림의 구조Structure of Converted Bitstream 1군Group 1 2군Group 2 3군Group 3 4군4th group 비트스트림Bitstream 정보필드Info Field 선두비트 필드(640,000비트)Lead bit field (640,000 bits) 그룹1과 그룹2의 결합값Combined value of group 1 and group 2 결합되지 않은 그룹2의 변형값Variant of Unjoined Group2 복원방법Restoration method 먼저 9비트를 읽고 결과에 따라 1비트를 추가로 읽음Read 9 bits first, then read 1 additional bit based on the result 먼저 4비트를 읽고 결과에 따라 1비트를 추가로 읽음Read 4 bits first, then read 1 additional bit based on the result

표 3에서 3군에서 9비트로 표현되는 1가지 경우의 빈도수만큼의 비트수가 절감되는데, 그 값이 1군의 정보필드에 필요한 비트수보다 큰 경우에는 변환된 비트스트림의 비트수는 최초의 N비트수보다는 적게 된다. 이와같은 1개의 사이클이 완료되어 절감된 비트수만큼 새로운 비트수를 받아들여 다시 새로운 사이클을 시작한다.In Table 3, the number of bits is reduced by the frequency of one case represented by 9 bits in group 3. If the value is larger than the number of bits required for the group 1 information field, the number of bits in the converted bitstream is the first N bits. Less than a number. One such cycle is completed, and the new cycle is started again by accepting the new bits as many as the saved bits.

한편, 그룹1에 속하는 값들의 총빈도수가 그룹2에 속하는 값들의 총빈도수보다 많은 경우, 즉 상기 <조건>이 만족되지 않는 경우에는 다음과 같은 여러 가지 방법들을 고려하여 압축한다.On the other hand, when the total frequency of the values belonging to the group 1 is greater than the total frequency of the values belonging to the group 2, that is, when the <condition> is not satisfied, the following various methods are compressed.

이하에서는 "방법 2"를 위한 과정들을 설명한다.The following describes the procedures for "Method 2".

"방법 2"에 의하면, 3,840,000비트의 비트스트림을 6비트의 단위로 나누어 배타논리합에 의해 변환한다.According to "Method 2", the bit stream of 3,840,000 bits is divided into 6-bit units and converted by exclusive logic sum.

그 방식으로 본 발명의 실시예에서는, 첫째 방식으로 홀수번째 6비트 단위의 값을 바로 다음의 짝수번째 6비트의 값과 배타논리합하여 짝수번째 6비트의 값을 대체하는 방식과, 두 번째 방식으로 처음 2개의 6비트의 값을 배타논리합하여 후자의 값을 대체하고 그 다음 6비트의 값을 대체된 6비트의 값과 배타논리합하여 그 다음 6비트의 값을 대체하는 과정을 계속하는 방식을 채택한다.In this manner, in the embodiment of the present invention, in the first method, the value of the odd 6-bit unit is exclusively summed with the value of the next even 6-bit, and the value of the even 6-bit is replaced. Adopts the method of performing the exclusive logic on the first two 6-bit values to replace the latter value, and then performing the exclusive logic on the next 6-bit value with the replaced 6-bit value to replace the next 6-bit value. do.

이때, 두가지 방식을 사용함에 있어 배타논리합변환 이후 <조건>에 적합한지 여부를 검사하여, <조건>에 합당한 경우에는 이 상태를 정보필드에 기록하고, "방법 1"을 사용하여 한 개의 압축 사이클을 완료한다. 그러나, <조건>에 합당하지 않은 경우에는 변환된 값을 기준으로 <조건>에 합당할 때까지 배타논리합변환을 계속하는데 그 변환의 반복횟수는 255회 이하로 제한하여 정보필드의 XOR횟수플래그가 8비트를 갖도록 정한다.In this case, in case of using the two methods, it checks whether the <Condition> is suitable after the Exclusive Logic Conversion, records this state in the information field if it meets the <Condition>, and uses one compression cycle using "Method 1". To complete. However, if it does not meet <condition>, the exclusive logical sum conversion continues until it meets <condition> based on the converted value, and the number of repetitions of the transformation is limited to 255 or less so that the XOR flag of the information field is Decide to have 8 bits.

XOR임의변환플래그는 255회를 지속해서 배타논리합하지 않고 약속된 비트값을 약속된 배타논리합 횟수 이후에 N비트와 배타논리합하도록 하여 임의로 N비트의 값을 변환하기 위한 플래그이다. 여기서는 10회의 배타논리합 이후 1번 실시하도록 한다. 따라서 XOR횟수플래그 값이 10 이하이면 배타논리합임의변환은 하지 않은 것으로 할 수 있으며 XOR임의변환플래그 값이 0이면 배타논리합임의변환은 하지 않은 것이고, 1이면 10회 직후에 배타논리합임의변환을 실시한 것으로 취급한다.The XOR random conversion flag is a flag for arbitrarily converting the value of N bits by causing the promised bit value to be exclusive logically summed with N bits after the promised exclusive logic sum count without continuing exclusively 255 times. In this case, it is conducted once after 10 exclusive logic sums. Therefore, if the XOR count flag value is 10 or less, the exclusive logical sum conversion may not be performed.If the XOR arbitrary conversion flag value is 0, the exclusive logical sum conversion is not performed.If the 1 is 10, the exclusive logical sum conversion is performed immediately after 10 times. Handle

255회 반복이 이루어지기 이전에 <조건>에 일치하면 그 상태를 정보필드에 기록하고 "방법 1"을 통하여 압축을 하도록 하며, 그래도 <조건>에 일치하지 않으면 다른 방법을 찾도록 한다.If <condition> is met before 255 iterations are made, the status is recorded in the information field and compressed through "Method 1".

따라서, 본 발명의 실시예에서는 정보필드 중에 XOR횟수플래그를 위해 8비트, XOR임의변환플래그를 위해 1비트, XOR방법플래그를 위해 1비트를 할당한다(이 때, XOR횟수플래그의 값이 0이면 XOR변환이 일어나지 않은 것으로 보아 XOR방법 플래그를 위한 비트 할당은 생략된다).Therefore, in the embodiment of the present invention, 8 bits for the XOR number flag in the information field, 1 bit for the XOR arbitrary conversion flag, and 1 bit for the XOR method flag are allocated (at this time, if the value of the XOR number flag is 0, Since no XOR conversion has occurred, the bit allocation for the XOR method flag is omitted).

이하에서는 "방법 3"를 위한 과정들을 설명한다.The following describes the procedures for "Method 3".

"방법 2"에 의해서도 상기 <조건>이 만족되지 않는 경우, 그룹1에 속하는 값들의 총 빈도수에서 그룹2에 속하는 값들의 총 빈도수를 초과하는 개수만큼을 그룹1에 속하는 값에서 선별하여 추출하도록 한다.If the <Condition> is not satisfied even by "Method 2", the number of values exceeding the total frequency of the values belonging to the group 2 from the total frequency of the values belonging to the group 2 is selected and extracted from the values belonging to the group 1 .

먼저, 몇 개가 초과되었는지를 알 수 있도록 그 개수를 정보필드의 초과갯수플래그에 표시하도록 한다(본 발명의 실시예에서는 20,000개를 넘지 않는 것으로 보아 초과갯수플래그를 위해 15비트를 할당한다). 그리고, 선두비트 필드를 스캔하면서 '1'로 표기된 값들의 위치에 대응하는 변환값들을 찾아 다음의 선별방식들 중 하나의 방식에 의해 결정된 값들을 선별한다.First, the number is indicated on the excess number flag of the information field so as to know how many are exceeded (in the embodiment of the present invention, 15 bits are allocated for the excess number flag because it does not exceed 20,000). Then, the first bit field is scanned to find the conversion values corresponding to the positions of the values indicated by '1' and to select values determined by one of the following screening methods.

본 발명의 실시예에서 사용되는 선별방식으로는As the sorting method used in the embodiment of the present invention

첫째, 처음부터 2의 배수번째를 선택하되, 초과 개수만큼만을 선택.First, choose a multiple of 2 from the beginning, but only overtime.

둘째, 처음부터 3의 배수번째를 선택하되, 초과 개수만큼만을 선택.Second, choose a multiple of 3 from the beginning, but only the excess number.

셋째, 처음부터 5의 배수번째를 선택하되, 초과 개수만큼만을 선택.Third, select the multiple of 5 from the beginning, but only the excess number.

넷째, 처음부터 7의 배수번째를 선택하되, 초과 개수만큼만을 선택.Fourth, select a multiple of 7 from the beginning, but select only the excess number.

다섯째, 처음부터 초과 개수만큼 연속하여 선택.Fifth, the number of consecutive selections from the beginning.

여섯째, 위 다섯째 방식에서 결정된 값 다음부터 초과 개수만큼 연속하여 선택.Sixth, successive selections after the value determined in the fifth method above.

일곱째, 위 여섯째 방식에서 결정된 값 다음부터 초과 개수만큼 연속하여 선택.Seventh, the number of consecutive selections after the value determined in the sixth method above.

여덟째, 위 일곱째 방식에서 결정된 값 다음부터 초과 개수만큼 연속하여 선택.Eighth, successive selections after the value determined in the seventh method above.

이상과 같은 8가지 선별방식 중에서 한가지를 선택하는 기준은 F1, F2를 모두 복구하여 33가지의 값으로 변경한 후, 33가지의 값들 중 가장 빈도수가 적은 2가지 값의 총빈도수가 가장 적은 방식을 선택하는 것이다. 따라서, 정보필드에는 초과갯수플래그를 위해 15비트, 초과선별플래그를 위해 3비트가 할당된다.The criteria for selecting one of the eight screening methods described above is to recover both F1 and F2 and change it to 33 values, and then select the method with the smallest total frequency of the 2 of the 33 values. To choose. Accordingly, the information field is allocated 15 bits for the excess number flag and 3 bits for the excess sorting flag.

이렇게 선별한 후, 상기의 방식에 의해 선택된 값들에서 가장 빈도수가 적은 2가지 값들의 총빈도수와 정보비트수와의 합이 "방법 1"에 의해 절감된 비트수보다 적은 경우에는 선별되지 않은 그룹1과 그룹2에 속하는 변환값들의 총 개수는 같으므로, 그룹1에 속하는 변환값과 그룹2에 속하는 변환값을 각각 1개씩 결합하여 "방법 1"에 의해 처리하고, 선별된 변환값들은 5비트로 표시하되 그 중 가장 빈도수가 적은 2가지 값은 동일한 값의 5비트로 표시하고 1비트를 추가하여 구분한다.After the selection, if the sum of the total frequency and the number of information bits of the two least frequent values among the values selected by the above method is less than the number of bits saved by "Method 1," Group 1 is not selected. Since the total number of transform values belonging to and group 2 is the same, the transform value belonging to group 1 and the transform value belonging to group 2 are combined and processed by "Method 1", respectively, and the selected transform values are represented by 5 bits. However, two values with the least frequency are indicated by 5 bits of the same value and 1 bit is added to distinguish.

이상과 같은 본 발명의 실시예에서 사용되는 정보필드의 구성을 살펴보면 다음과 같다.Looking at the configuration of the information field used in the embodiment of the present invention as described above are as follows.

▼ 시작비트(1비트) : 최초 압축 사이클을 시작할 때는 '1'로, 그 다음 압축 사이클부터는 '0'으로 설정.▼ Start bit (1 bit): Set to '1' to start the first compression cycle and to '0' from the next compression cycle.

▼ F1/F2플래그(24비트) : F1, F2에 의해 대표되는 4개의 값을 기록(6비트×4개).F1 / F2 flag (24 bits): Records four values represented by F1 and F2 (6 bits x 4).

▼ 그룹1선택플래그(60비트) : F1, F2에 의해 대표되는 4개의 값을 제외한 60개 값들이 그룹별로 분류된 상태를 표시.▼ Group 1 selection flag (60 bits): It displays the status of 60 values classified by group except 4 values represented by F1 and F2.

▼ 최다빈도플래그(9비트) : F1, F2를 제외한 그룹1의 변환값과 그룹2의 변환값이 결합한 경우 그 빈도수가 최다인 결합값을 기록.▼ Maximum Frequency Flag (9 bit): When the combined value of Group 1 and Group 2 except F1 and F2 is combined, record the combined value with the highest frequency.

▼ XOR횟수플래그(8비트) : 배타논리합 변환의 횟수를 기록, 그 값이 0인 경우에는 배타논리합을 하지 않은 것을 의미.▼ XOR number flag (8 bits): Records the number of exclusive logical sum conversion. If the value is 0, it means that the exclusive logical sum is not performed.

▼ XOR방법플래그(1비트) : 어떤 XOR방법을 사용하였는지를 기록. XOR횟수플래그의 값이 0인 경우에는 할당되지 않음.▼ XOR method flag (1 bit): Record which XOR method was used. Not assigned if the value of XOR flag is 0.

▼ 초과갯수플래그(15비트) : 그룹1에 속하는 값들의 총 빈도수가 그룹2에 속하는 값들의 총 빈도수보가 큰 경우, 그 초과 빈도수를 기록. XOR횟수플래그의 값이 0인 경우에는 할당되지 않음. 이 플래그는 각 그룹의 개수를 통해서 알 수 있으므로 생략 가능함.▼ Overnumber flag (15 bits): If the total frequency of the values belonging to group 1 is large, the excess frequency is recorded. Not assigned if the value of XOR flag is 0. This flag can be omitted because it can be seen from the number of each group.

▼ 초과선별플래그(3비트) : 그룹1에서 어떤 방법으로 초과갯수플래그에 기록된 초과갯수 만큼을 선별하였는지를 기록. 초과갯수플래그의 값이 0인 경우에는 할당되지 않음.▼ Over-screen flag (3 bits): Record how the group 1 selected the excess number recorded in the excess number flag. Not assigned if the value of the excess number flag is zero.

▼ XOR임의변환플래그(1비트) : 배타논리합변환을 여러 횟수 실시하던 중 약속된 횟수차에 약속된 값으로 배타논리합을 하였는지 여부와 그 횟수를 표시. 예를들면, 만약 플래그의 값이 '1'이면, 2비트를 그 횟수를 표시하기 위하여 할당할 수 있다.▼ XOR Arbitrary Conversion Flag (1 bit): Indicates whether or not the number of exclusive logic sums is performed with the promised value in the number of promises. For example, if the value of the flag is '1', two bits may be allocated to indicate the number of times.

이상과 같은 과정을 거쳐 1개의 압축 사이클을 마치면서 절감되는 총비트수는 "방법 1"에서 9비트로 표시되는 값의 발생 빈도수와 그룹2의 총빈도수가 클 경우 그룹2에 속하는 값들만을 별도로 표시할 때의 가장 빈도수가 높은 특정값의 빈도수를 합한 값이고, 소비되는 총 비트수는 정보비트수와 "방법 3"에서 선택된 값들 중 빈도수가 가장 적은 2가지 값들의 총빈도수를 합한 값이다.The total number of bits saved by completing one compression cycle through the above process is displayed separately only the values belonging to Group 2 when the frequency of occurrence represented by 9 bits in "Method 1" and the total frequency of Group 2 are large. The total number of bits consumed is the sum of the number of information bits and the total frequency of the two values with the lowest frequency among the values selected in "Method 3".

따라서, 소비되는 총 비트수보다 절감된 총 비트수가 1개 이상 크게 되면, 그 비트수 만큼 1개의 압축 사이클에서 표시되는 전체 비트수가 줄어들게 되므로 그 비트수 만큼의 새로운 압축 대상 비트를 받아들여 다시 압축 사이클을 반복한다. 만일 절감된 총 비트수가 소비된 총 비트수보다 적거나 같은 경우에는 직전 압축 사이클이 시작되기 전의 N비트의 비트스트림을 그대로 보관하고 새로이 N비트의 비트스트림을 받아들여 다시 최초의 압축 사이클을 시작한다.Therefore, if the total number of bits saved by one or more is larger than the total number of bits consumed, the total number of bits displayed in one compression cycle is reduced by the number of bits, so that a new compression target bit corresponding to the number of bits is accepted and the compression cycle is performed again. Repeat. If the total number of bits saved is less than or equal to the total number of bits consumed, the N-bit bitstream is kept as it was before the last compression cycle started, and the new N-bit bitstream is accepted and the first compression cycle is started again. .

한편, 지금까지 특정값을 대표하기 위해 F1, F2의 2가지 대표값을 사용하는 방식에 대해 설명하였는데, F1 한가지의 대표값을 설정하는 방법과 F1, F2 및 F3의 3가지 대표값 또는 그 이상의 대표값을 설정하는 방법에서도 상기한 바와 유사하게 압축과정을 진행할 수 있다.Meanwhile, the method of using two representative values of F1 and F2 to represent a specific value has been described so far.How to set one representative value of F1 and three representative values of F1, F2 and F3 or more In the method of setting the representative value, the compression process can be performed similarly to the above.

도 5에 의하면, 본 발명에 의해 비손실 데이터 압축방법의 다른 실시예는 다음과 같은 과정에 의한다.Referring to FIG. 5, another embodiment of the lossless data compression method according to the present invention is based on the following process.

도 5의 참조번호 520 단계를 제외한 500 단계 내지 510 단계 및 530 단계 내지 570 단계는 도 2의 200 단계 내지 210 단계 및 240 단계 내지 280 단계와 유사하게 처리된다.Steps 500 to 510 and steps 530 to 570 except for step 520 of FIG. 5 are processed similarly to steps 200 to 210 and 240 to 280 of FIG. 2.

다만, 참조번호 520 단계에서는 대표값을 사용하지 않고 그룹 기준 개수인 2K-2가지의 값들 중에서 1개 이상의 값을 다른 그룹에 포함시킴으로써 어떤 그룹은 2K-2가지보다 적은 가지수의 값들을 포함하고 어떤 그룹은 2K-2가지보다 많은 가지수의 값들을 포함하게 하여 그룹의 기준 개수에 변동을 준다. 즉, 2K가지의 값들을 K비트의 정보들에서의 빈도수에 따라 2 이상의 그룹들로 분류하되, K비트의 정보들이 갖는 2K가지의 값들 중에서 2가지 이상의 값을 대표하는 소정의 수의 대표값을 정한 것으로 가정할 때, 적은 빈도수의 값들이 속한 그룹에는 가정된 대표값에 대응되는 값들을 포함시키고 많은 빈도수의 값들이 속한 그룹에는 가정된 대표값이 결정됨으로 인해 삭제된 값을 포함시켜 각 그룹에 속하는 값들의 가지수에 편차를 둔다. 따라서, 540 단계에서는 변동된 2개 이상의 그룹을 쌍으로 결합함으로써 주어진 비트스트림을 압축할 수 있다.However, in step 520, one group includes less than 2 K-2 branches by including one or more values among the 2 K-2 branches, the group reference number, without using the representative value. Some groups, including more than 2 K-2 branches, contain variations in the baseline number of groups. That is, but divided into two or more groups based on the frequency in the 2 K of the the K-bit values, the predetermined number of representatives of which represents at least two values from the 2 K of values which have a K-bit information Assuming that the value is set, each group of low frequency values contains values corresponding to the hypothesized representative value, and a group of high frequency values includes the deleted value because the hypothesized representative value is determined. The number of branches in the group is varied. Accordingly, in step 540, a given bitstream may be compressed by combining two or more changed groups in pairs.

도 6에 의하면, 본 발명에 의한 비손실 압축된 데이터의 신장과정은 다음과 같다.6, the decompression process of the lossless compressed data according to the present invention is as follows.

기본적으로, 데이터의 신장과정은 압축 과정의 역순에 의해 압축 과정에서 생성된 정보 필드의 각종 플래그를 이용하여 원래의 비트스트림을 복구할 수 있다.Basically, the data decompression process may restore the original bitstream using various flags of the information field generated in the compression process in the reverse order of the compression process.

먼저, 압축된 비트스트림으로부터 N비트의 데이터를 취한다(600 단계).First, N bits of data are taken from the compressed bitstream (step 600).

다음, N비트의 데이터에 포함된 정보비트 필드를 이용하여 N비트의 정보에서 이미 복원된 X비트를 추출하여 저장하고(610 단계), N비트의 데이터에서 남은 (N-X)비트를 M비트(M>N-X)로 신장한다(620 단계).Next, by using the information bit field included in the N-bit data, the X-bit that has already been restored from the N-bit information is extracted and stored (step 610), and the remaining (NX) bits in the N-bit data are M bits (M > NX) (step 620).

데이터 신장 후, 시작 비트가 '0'이면 M을 N으로 간주하여 610 단계를 계속하고, 시작 비트가 '1'이면 신장할 압축데이터가 더 있는지 여부를 확인한다(630 단계 내지 650 단계). 신장할 압축데이터가 더 있으면 다시 600 단계에서 새로운 신장 대상 비트스트림을 입력받아 신장 과정을 계속하고, 그렇지 않은 경우에는 비손실 압축 데이터의 신장과정을 종료한다.After the data decompression, if the start bit is '0', M is regarded as N, and step 610 is continued. If the start bit is '1', it is checked whether there is more compressed data to decompress (steps 630 to 650). If there is more compressed data to be decompressed, the decompression process is continued by receiving the new decompression bitstream in step 600. Otherwise, the decompression process of the lossless compressed data is terminated.

본 발명에 의하면, 높은 압축률에 의해 데이터를 비손실 압축할 수 있으며, 비손실 압축된 데이터를 용이하게 신장할 수 있다.According to the present invention, data can be losslessly compressed at a high compression rate, and the losslessly compressed data can be easily extended.

Claims (10)

비트스트림을 비손실 압축하는 방법에 있어서,In the method of lossless compression of a bitstream, (a) 상기 비트스트림으로부터 N비트의 정보를 취하는 단계;(a) taking N bits of information from the bitstream; (b) 상기 N비트의 정보를 N비트 미만의 X비트(N>X)의 정보로 압축하는 단계;(b) compressing the N-bit information into less than N bits of X bits (N> X); (c) 상기 비트스트림으로부터 새로운 Y비트의 정보를 취하는 단계;(c) taking new Y bits of information from the bitstream; (d) 압축된 X비트의 정보와 새로운 Y비트의 정보로 새로운 M(M=X+Y)비트의 정보를 구축하는 단계; 및(d) constructing new M (M = X + Y) bits with compressed X bits of information and new Y bits of information; And (e) 상기 (c)단계에서 더 이상의 취할 새로운 정보가 없을 때까지 상기 (b)단계 내지 (d)단계를 반복하는 것을 특징으로 하는 데이터 압축방법.(e) repeating steps (b) to (d) until there is no new information to take in step (c). (a) N비트의 정보를 받아들여 K비트 단위로 나누는 단계(N>K>1);(a) receiving N bits of information and dividing the information into K bits (N> K> 1); (b) 상기 (a)단계에서 나뉘어진 K비트의 정보들이 갖는 2K가지의 값들 중에서 2가지 이상의 값을 대표하는 소정의 수의 대표값을 정하고 정보비트에 의해 구분하는 단계;(b) the representative value of the decided number of predetermined representing at least two values from the values of 2 K of the K-bit information which are divided in the step (a) divided by the information bits; (c) 상기 2K가지의 값들을 상기 K비트의 정보들에서의 빈도수에 따라 2 이상의 그룹들로 분류하되, 적은 빈도수의 값들이 속한 그룹에는 상기 대표값을 포함시키고 많은 빈도수의 값들이 속한 그룹에는 상기 대표값이 결정됨으로 인해 삭제된 값을 포함시키는 단계;(c) to group within, but divided into two or more groups according to frequency, to groups within the low frequency value, including the representative value and number of the frequency value at the of the K bits of the 2 K kinds of values of the information Including a value deleted due to the representative value being determined; (d) 각 그룹을 구분할 수 있는 선두비트 필드를 생성하고, 생성된 선두비트에 따라 각 그룹들 중에서 선택된 2 이상의 그룹들에 포함된 값들을 1개 이상씩 결합하여 새로운 값을 생성하는 단계; 및(d) generating a head bit field for distinguishing each group, and generating a new value by combining one or more values included in two or more groups selected from each group according to the generated head bits; And (e) 상기 (a)단계 내지 상기 (d)단계를 통해 비트 절감이 이루어진 경우에는 압축 대상 비트스트림으로부터 추가로 정보를 받아들여 비트 절감이 이루어진 비트스트림과 결합한 다음 상기 (a)단계 내지 상기 (d)단계를 반복 수행하고, 비트 절감이 이루어지지 않은 경우에는 상기 N비트의 정보를 그대로 보관하고 압축 대상 비트스트림으로부터 새로이 N비트의 정보를 받아들여 상기 (a)단계 내지 상기 (d)단계를 반복 수행하는 단계를 포함함을 특징으로 하는 데이터 압축방법.(e) In the case where the bit reduction is made through the steps (a) to (d), additional information is received from the bitstream to be compressed and combined with the bitstream in which the bit reduction is made. If step d) is repeated and bit saving is not achieved, the N-bit information is kept as it is and the N-bit information is newly received from the bit stream to be compressed to perform steps (a) to (d). And repeatedly performing the data compression method. (a) N비트의 정보를 받아들여 K비트 단위로 나누는 단계(N>K>1);(a) receiving N bits of information and dividing the information into K bits (N> K> 1); (b) 상기 2K가지의 값들을 상기 K비트의 정보들에서의 빈도수에 따라 2 이상의 그룹들로 분류하되, 상기 (a)단계에서 나뉘어진 K비트의 정보들이 갖는 2K가지의 값들 중에서 2가지 이상의 값을 대표하는 소정의 수의 대표값을 정한 것으로 가정할 때, 적은 빈도수의 값들이 속한 그룹에는 가정된 대표값에 대응되는 값들을 포함시키고 많은 빈도수의 값들이 속한 그룹에는 가정된 대표값이 결정됨으로 인해 삭제된 값을 포함시켜 각 그룹에 속하는 값들의 가지수에 편차를 두는 단계;(b) 2 in 2 K of values which are information of K bits, divided from the (a) step, but divided into two or more groups based on the frequency in the said second K kinds of values of the K bits of the information Assuming that a predetermined number of representative values representing more than one value is specified, the groups to which the values belong to a small frequency include values corresponding to the hypothesized representative values, and the assumed representative values to a group to which many values belong. Including the deleted value due to the determination to make a deviation in the number of branches belonging to each group; (c) 각 그룹을 구분할 수 있는 선두비트 필드를 생성하고, 생성된 선두비트에 따라 각 그룹들 중에서 선택된 2 이상의 그룹들에 포함된 값들을 1개 이상씩 결합하여 새로운 값을 생성하는 단계; 및(c) generating a first bit field for distinguishing each group, and generating a new value by combining one or more values included in two or more groups selected from each group according to the generated first bit; And (d) 상기 (a)단계 내지 상기 (c)단계를 통해 비트 절감이 이루어진 경우에는 압축 대상 비트스트림으로부터 추가로 정보를 받아들여 비트 절감이 이루어진 비트스트림과 결합한 다음 상기 (a)단계 내지 상기 (c)단계를 반복 수행하고, 비트 절감이 이루어지지 않은 경우에는 상기 N비트의 정보를 그대로 보관하고 압축 대상 비트스트림으로부터 새로이 N비트의 정보를 받아들여 상기 (a)단계 내지 상기 (c)단계를 반복 수행하는 단계를 포함함을 특징으로 하는 데이터 압축방법.(d) In the case where the bit reduction is made through the steps (a) to (c), additional information is received from the bitstream to be compressed and combined with the bitstream where the bit reduction is made. Repeat step c), and if no bit reduction is made, the N-bit information is kept as it is and new N-bit information is received from the bit stream to be compressed to perform steps (a) to (c). And repeatedly performing the data compression method. (a) N비트의 정보를 받아들여 K비트 단위로 나누고(N>K>1), 2K가지의 값들에 각각 대응하는 K비트 정보들의 빈도수를 구하는 단계;(a) accepting the information of N bits divided into K bits, (N>K> 1), obtaining the frequency of the K-bit information corresponding to 2 K of values; (b) 상기 (a)단계의 2K가지의 값들 중에서 가장 빈도수가 적은 2가지 값을 F1에 의해 대표시키고, 빈도수가 적은 소정의 수의 값들을 F1과 함께 그룹1에 포함시키고, 빈도수가 많은 소정의 수의 값들을 그룹2에 포함시킴으로써, 2K가지의 값들을 빈도수에 따라 2개 이상의 그룹으로 구분하는 단계;(b) wherein (a) represented by the two values the low frequency to F1 in 2 K of values of the phase and, the frequency is to include in the group 1 with the F1 values of a number of small predetermined, a number of frequency by including the predetermined number of values of the second group, comprising: divided into two or more groups based on the frequency of the 2 K kinds of values; (c) 그룹1에 속한 값과 그룹2에 속한 값을 차례로 결합하여 결합값으로 변환하는 단계; 및(c) combining the values belonging to the group 1 and the values belonging to the group 2 in order to convert them into combined values; And (d) 상기 (a)단계 내지 상기 (c)단계를 통해 비트 절감이 이루어진 경우에는 압축 대상 비트스트림으로부터 추가로 정보를 받아들여 비트 절감이 이루어진 비트스트림과 결합한 다음 상기 (a)단계 내지 상기 (c)단계를 반복 수행하고, 비트 절감이 이루어지지 않은 경우에는 상기 N비트의 정보를 그대로 보관하고 압축 대상 비트스트림으로부터 새로이 N비트의 정보를 받아들여 상기 (a)단계 내지 상기 (c)단계를 반복 수행하는 단계를 포함함을 특징으로 하는 데이터 압축방법.(d) In the case where the bit reduction is made through the steps (a) to (c), additional information is received from the bitstream to be compressed and combined with the bitstream where the bit reduction is made. Repeat step c), and if no bit reduction is made, the N-bit information is kept as it is and new N-bit information is received from the bit stream to be compressed to perform steps (a) to (c). And repeatedly performing the data compression method. 제4항에 있어서, 상기 (c)단계는The method of claim 4, wherein step (c) (c.1) 그룹1에 속하는 값들의 총 빈도수와 그룹2에 속하는 값들의 총 빈도수의 크기를 비교하는 단계;(c.1) comparing the magnitude of the total frequency of the values belonging to group 1 with the total frequency of the values belonging to group 2; (c.2) 상기 (c.1)단계에서 그룹2에 속하는 값들의 총 빈도수가 그룹1에 속하는 값들의 총 빈도수보다 더 많거나 같은 경우에는, 그룹1에 속한 값과 그룹2에 속한 값을 차례로 결합하여 결합값으로 변환하는 단계; 및(c.2) If the total frequency of the values belonging to group 2 is greater than or equal to the total frequency of the values belonging to group 1 in step (c.1), the values belonging to group 1 and the values belonging to group 2 are selected. Combining them in turn to convert them into combined values; And (c.3) 상기 (c.1)단계에서 그룹2에 속하는 값들의 총 빈도수가 그룹1에 속하는 값들의 총 빈도수보다 적은 경우에는, 복구 가능하게 비트 구성을 변환하여 상기 (c.1)단계의 비교를 다시 시도하는 단계를 포함하여 이루어짐을 특징으로 하는 데이터 압축방법.(c.3) If the total frequency of the values belonging to the group 2 is less than the total frequency of the values belonging to the group 1 in step (c.1), the step (c.1) by converting the bit configuration to recover And retrying a comparison of the data compression method. 제5항에 있어서, 상기 (c.2)단계는The method of claim 5, wherein step (c.2) (c.2.1) K비트로 나누어진 N비트의 정보들을 순서대로 그 값이 속하는 그룹을 표시하는 선두비트 필드를 생성하고, 각 값들은 그 값이 속하는 그룹별로 주어지는 새로운 변환값으로 변환하는 단계;(c.2.1) generating a head bit field indicating a group to which the value belongs in order of N bits of information divided by K bits, and converting each value into a new conversion value given for each group to which the value belongs; (c.2.2) 그룹1에 속하는 하나의 변환값과 그룹2에 속하는 하나의 변환값을 쌍으로 결합하여 새로운 결합값으로 변환하는 단계; 및(c.2.2) combining one transform value belonging to group 1 and one transform value belonging to group 2 into pairs and converting the result into a new combined value; And (c.2.3) 그룹2에 속하는 여분의 변환값들 중 가장 적은 빈도수를 갖는 변환값에 대해 다른 변환값들보다 1비트 적게 비트수를 할당하여 표현하는 단계를 포함하여 이루어짐을 특징으로 하는 데이터 압축방법.(c.2.3) data compression, comprising assigning and expressing a bit number of bits less than other transform values for the transform value having the lowest frequency among the redundant transform values belonging to Group 2 Way. 제6항에 있어서, 상기 변환값은The method of claim 6, wherein the conversion value 그룹1에 있어서 F1에 의해 대표되는 값들에 대해서는 0이고, 나머지 값들에 대해서는 그 값의 크기 순서대로 각각 매핑된 1 이상의 값이고, 그룹2에 속하는 값들에 대해서는 그 값의 크기 순서대로 각각 매핑된 0 이상의 값인 것을 특징으로 하는 데이터 압축방법.0 for the values represented by F1 in Group 1, one or more values mapped to the order of magnitude of the remaining values, and 0 mapped to the order of magnitude for the values belonging to Group 2. The data compression method characterized by the above value. 제5항에 있어서, 상기 (c.3)단계의 비트 구성의 변환이 소정의 횟수 이상 반복되는 경우에는 상기 (c.1)단계의 비교를 중단하고 수행되는The method of claim 5, wherein if the conversion of the bit configuration of step (c.3) is repeated more than a predetermined number of times, the comparison of step (c.1) is stopped and performed. (c.4.1) 그룹1에 속하는 값들의 총 빈도수에서 그룹2에 속하는 값들의 총 빈도수를 뺀 초과갯수를 구하는 단계;(c.4.1) obtaining an excess number by subtracting the total frequency of the values belonging to Group 2 from the total frequency of the values belonging to Group 1; (c.4.2) K비트로 나누어진 N비트의 정보들을 순서대로 그 값이 속하는 그룹을 표시하는 선두비트 필드를 생성하고, 각 값들은 그 값이 속하는 그룹별로 주어지는 새로운 변환값으로 변환하는 단계;(c.4.2) generating a first bit field indicating a group to which the value belongs by sequentially converting N bits of information divided by K bits, and converting each value into a new conversion value given for each group to which the value belongs; (c.4.3) 그룹1에 속하는 변환값들 중에서 상기 초과갯수 만큼의 변환값들을 선별하되, F1을 대응하는 본래의 값으로 복원하였을 후 가장 적은 빈도수를 갖는 2가지 변환값들의 총빈도수가 가장 적게 포함되도록 변환값들을 선별하는 단계;(c.4.3) The excess number of transformed values among the transformed values belonging to Group 1 are selected, but the total frequency of the two transformed values having the lowest frequency after restoring F1 to the corresponding original value is lowest. Selecting the transform values to include; (c.4.4) 그룹1에 속하고 상기 (c.4.3)단계에서 선별되지 않은 변환값들 중 하나의 변환값과 그룹2에 속하는 하나의 변환값을 쌍으로 결합하여 새로운 결합값으로 변환하는 단계; 및(c.4.4) converting one transform value from one of the transform values belonging to group 1 and not selected in step (c.4.3) and one transform value belonging to group 2 into pairs to convert to a new combined value; ; And (c.4.5) 상기 (c.4.3)단계에서 선별된 변환값들을 새로운 변환값으로 변환한 후, 가장 적은 빈도수를 갖는 2가지 변환값들에 대해서는 추가적인 1비트를 덧붙여 구분하는 단계를 포함하여 이루어진 단계를 더 포함함을 특징으로 하는 데이터 압축방법.(c.4.5) converting the transformed values selected in the step (c.4.3) into a new transformed value, and then adding an additional 1 bit for the two transformed values having the least frequency. The method of claim 1, further comprising a step. 제4항에 있어서, 상기 (a)단계 내지 상기 (c)단계를 통해 압축된 데이터 정보에는The method of claim 4, wherein the data information compressed through the steps (a) to (c) 최초 N비트의 정보를 받아들인 경우에는 '1'의 값을 갖고, 비트 절감이 이루어진 경우 추가로 압축 대상 정보를 받아들인 경우에는 '0'의 값을 갖는 시작비트를 포함함을 특징으로 하는 데이터 압축방법.Data having a value of '1' when the first N bits of information are received, and a start bit having a value of '0' when the compression target information is additionally received when bit reduction is made. Compression method. 비손실 압축된 비트스트림을 원래의 비트스트림으로 신장하는 방법에 있어서,A method of extending a lossless compressed bitstream to an original bitstream, (a) 상기 압축된 비트스트림으로부터 N비트의 정보를 취하는 단계;(a) taking N bits of information from the compressed bitstream; (b) 상기 N비트의 정보에서 이미 복원된 X비트를 추출하는 단계;(b) extracting X bits already restored from the N bits of information; (c) 상기 N비트의 정보에서 남은 (N-X)비트를 M비트(M>N-X)로 신장하는 단계; 및(c) decompressing the remaining (N-X) bits from the N bits of information into M bits (M> N-X); And (d) 신장 후, 시작 비트가 소정의 값이면 M을 N으로 간주하여 상기 (b)단계를 계속하고, 시작 비트가 상기 소정의 값과 다른 값이면 상기 (a)단계를 계속하는 단계를 포함함을 특징으로 하는 비손실 압축 데이터 신장방법.(d) after decompression, if step M is a predetermined value, consider M as N and continue with step (b); if step A is different from the predetermined value, continuing step (a); Lossless compressed data decompression method characterized in that.
KR1019980017184A 1998-05-13 1998-05-13 Lossless data compression and decompression KR19990085045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019980017184A KR19990085045A (en) 1998-05-13 1998-05-13 Lossless data compression and decompression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019980017184A KR19990085045A (en) 1998-05-13 1998-05-13 Lossless data compression and decompression

Publications (1)

Publication Number Publication Date
KR19990085045A true KR19990085045A (en) 1999-12-06

Family

ID=65891871

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019980017184A KR19990085045A (en) 1998-05-13 1998-05-13 Lossless data compression and decompression

Country Status (1)

Country Link
KR (1) KR19990085045A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100389702B1 (en) * 2000-09-18 2003-06-27 주식회사 보람씨앤씨 The method for compressing and expanding data-stream without loss by bit-substitution
KR100505471B1 (en) * 2002-12-11 2005-07-29 학교법인 명지학원 A waveform generation method using data conversion

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100389702B1 (en) * 2000-09-18 2003-06-27 주식회사 보람씨앤씨 The method for compressing and expanding data-stream without loss by bit-substitution
KR100505471B1 (en) * 2002-12-11 2005-07-29 학교법인 명지학원 A waveform generation method using data conversion

Similar Documents

Publication Publication Date Title
KR100894002B1 (en) Device and data method for selective compression and decompression and data format for compressed data
JP3278297B2 (en) Data compression method, data decompression method, data compression device, and data decompression device
EP0577330A2 (en) Improved variable length decoder
US4488143A (en) Fixed rate run length limited (RLL) code string generation using length oriented arithmetic code data string expansion and data string recovery using arithmetic code compression of RLL code strings
US5717393A (en) Apparatus for data compression and data decompression
JPH04223717A (en) Method for data compression, method for selection of system and dynamic model, and system
WO1996041423A1 (en) Compression of an electronic programming guide
US5353024A (en) Method for data compression having an improved encoding algorithm which utilizes a token stacking technique
CN104040899B (en) Generate the code alphabet of symbol to be that the word being used together with program generates code word
JP5656593B2 (en) Apparatus and method for decoding encoded data
US7548175B2 (en) Encoding apparatus, decoding apparatus, encoding method, computer readable medium storing program thereof, and computer data signal
KR100224815B1 (en) Data compression and expansion method
US9236881B2 (en) Compression of bitmaps and values
US5394143A (en) Run-length compression of index keys
US6919827B2 (en) Method and apparatus for effectively decoding Huffman code
KR19990085045A (en) Lossless data compression and decompression
JP4758494B2 (en) Circuit and method for converting bit length to code
WO2014003248A1 (en) Spacial data compression device and method for same, and compressed spacial data restoration device and method for same
JP6833643B2 (en) Compression processing device, decompression processing device, compression processing program, decompression processing program
CN115913248A (en) Live broadcast software development data intelligent management system
US20030113029A1 (en) Skim encoding method for compression of a two dimensional array of data
Hameed et al. A new lossless method of Huffman coding for text data compression and decompression process with FPGA implementation
US6411958B1 (en) Data processing system and method for generating a structured listing of symbols
CN110865299B (en) Folding set layered compression method and device based on forward compatibility
CN114337680B (en) Compression processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E601 Decision to refuse application