[go: up one dir, main page]

RU2382492C1 - Method of compressing and retrieving data without loss - Google Patents

Method of compressing and retrieving data without loss Download PDF

Info

Publication number
RU2382492C1
RU2382492C1 RU2008130744/09A RU2008130744A RU2382492C1 RU 2382492 C1 RU2382492 C1 RU 2382492C1 RU 2008130744/09 A RU2008130744/09 A RU 2008130744/09A RU 2008130744 A RU2008130744 A RU 2008130744A RU 2382492 C1 RU2382492 C1 RU 2382492C1
Authority
RU
Russia
Prior art keywords
prefix
group
numbers
data
code
Prior art date
Application number
RU2008130744/09A
Other languages
Russian (ru)
Inventor
Сергей Борисович Муллов (RU)
Сергей Борисович Муллов
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 RU2008130744/09A priority Critical patent/RU2382492C1/en
Application granted granted Critical
Publication of RU2382492C1 publication Critical patent/RU2382492C1/en

Links

Landscapes

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

Abstract

FIELD: physics; communication.
SUBSTANCE: invention relates to telecommunication and specifically to reducing redundancy of transmitted information and can be used for compressing and retrieving without loss of digital data in information systems and telecommunication systems. Faster compression and retrieval of data is achieved due to that, prefix codes are assigned not to all n bit numbers, but only groups whose number is considerably less, as well as due to that the number of calculation operations is reduced, particularly operations for reading variable-length codes. These calculation operations are replaced with operations for reading records from a table which takes considerably less time.
EFFECT: faster compression and retrieval of data, increased compression ratio of high-entropy data, easy realisation of the compression and retrieval method, reduced number of operations of compressing and retrieving data.
4 tbl

Description

Изобретение относится к области электросвязи, а именно к области, связанной с сокращением избыточности передаваемой информации, и может быть использовано для сжатия и восстановления без потерь цифровых данных в информационных системах и системах электросвязи.The invention relates to the field of telecommunications, and in particular to the field associated with reducing the redundancy of transmitted information, and can be used to compress and restore without loss of digital data in information systems and telecommunication systems.

Основы теории информации были заложены К.Шенноном в 1948 году в своей пионерской работе по теории информации (Д.Сэломон "Сжатие данных, изображений и звука", Москва, Техносфера, 2004, стр.25), в которой он ввел понятие энтропии источника. Фундаментально значение этой величины состоит в том, что она задает нижнюю границу возможного сжатия (Д.Сэломон «Сжатие данных, изображений и звука», Москва, Техносфера, 2004, стр.8). К этой границе можно приближаться сколь угодно близко с помощью подходящего способа кодирования источника. Под энтропией символа а, имеющего вероятность Р, подразумевается количество информации, содержащейся в а, которая равна -P·log2(P). (Д.Сэломон «Сжатие данных, изображений и звука», Москва, Техносфера, 2004, стр.25).The foundations of the theory of information were laid by C. Shannon in 1948 in his pioneering work on the theory of information (D. Salomon "Compression of data, images and sound", Moscow, Technosphere, 2004, p. 25), in which he introduced the concept of source entropy. The fundamental value of this value is that it sets the lower limit of possible compression (D. Salomon “Compressing data, images and sound”, Moscow, Technosphere, 2004, p. 8). This boundary can be approached arbitrarily close using a suitable source coding method. By the entropy of the symbol a, with probability P, is meant the amount of information contained in a, which is equal to -P · log 2 (P). (D. Salomon “Compression of data, images and sound”, Moscow, Technosphere, 2004, p. 25).

Различают сжатие без потерь, при котором возможно полностью восстановить исходную информацию, и сжатие с частичной потерей данных, при котором происходит восстановление данных с частичной потерей информации.Distinguish between lossless compression, in which it is possible to completely restore the original information, and compression with partial data loss, in which data is restored with a partial loss of information.

Известен способ сжатия и восстановления данных без потерь с использованием кодов переменной длины (Д.Сэломон "Сжатие данных, изображений и звука", Москва, Техносфера, 2004 г., стр.26), включающий, выбор алфавита - набора символов от a1 до an, сбор статистики - вероятностей каждого символа алфавита в сжимаемом потоке данных, составление кодов переменной длины и замену исходных символов кодами переменной длины. Для восстановления первоначального потока данных в соответствии с построенными кодами переменной длины заменяют коды переменной длины на исходные символы алфавита.A known method of compressing and restoring lossless data using variable-length codes (D. Salomon "Compressing data, images and sound", Moscow, Technosphere, 2004, p. 26), including, the choice of alphabet - a set of characters from a 1 to a n , collecting statistics - the probabilities of each character of the alphabet in a compressible data stream, compiling codes of variable length and replacing the original characters with codes of variable length. To restore the original data stream in accordance with the constructed codes of variable length, replace the codes of variable length with the original characters of the alphabet.

Недостатком известного способа является:The disadvantage of this method is:

- низкая скорость операций сжатия и восстановления;- low speed of compression and recovery operations;

- большое число вычислительных операций, необходимых для построения кодов переменной длины и восстановления данных.- A large number of computational operations necessary for constructing codes of variable length and data recovery.

Известен также способ сжатия и восстановления данных без потерь методом Хаффмана (Д.Сэломон "Сжатие данных, изображений и звука", Москва, Техносфера, 2004 г., стр.30; М.Вернер "Основы кодирования", Москва, Техносфера, 2004 г., стр.29), включающий для выбранного алфавитаThere is also a known method of compressing and restoring lossless data using the Huffman method (D. Salomon "Compressing data, images and sound", Moscow, Technosphere, 2004, p. 30; M. Werner "Fundamentals of coding", Moscow, Technosphere, 2004 ., p. 29), including for the selected alphabet

- составление списка символов алфавита в порядке убывания их вероятностей;- compiling a list of alphabet symbols in descending order of their probabilities;

- объединение двух символов с наименьшими вероятностями в один составной знак. Переупорядочивание списка символов в соответствии с предыдущим шагом. Затем продолжают этот процесс до тех пор, пока все символы не будут объединены;- combining the two characters with the least probabilities into one composite sign. Reorder the list of characters according to the previous step. Then continue this process until all the characters are combined;

- начинают с последнего объединения. Приписывают первой компоненте составного символа символ 0, второй - символ 1. Продолжают до тех пор, пока все простые символы не будут закодированы.- start with the last association. The symbol 0 is assigned to the first component of the composite symbol, symbol 1 is continued to the second. Continue until all simple symbols are encoded.

Для восстановления необходимо в соответствии с построенными кодами Хаффмана преобразовать сжатый поток к первоначальному виду (Д.Сэломон "Сжатие данных, изображений и звука", Москва, Техносфера, 2004 г., стр.38.; М.Вернер "Основы кодирования", Москва, Техносфера, 2004 г., стр.29). Для этого начинают с исходного узла построенного кодового дерева и двигаются в зависимости от считанного символа вверх или вниз до конечного узла.For recovery, it is necessary, in accordance with the constructed Huffman codes, to transform the compressed stream to its original form (D. Salomon “Compressing data, images and sound”, Moscow, Technosphere, 2004, p. 38; M. Werner “Fundamentals of coding”, Moscow , Technosphere, 2004, p. 29). To do this, start from the source node of the constructed code tree and move up or down depending on the character read up to the end node.

Недостатками известного способа являются:The disadvantages of this method are:

- низкая скорость операций сжатия и восстановления данных;- low speed of data compression and recovery operations;

- максимальное сжатие достигается, если вероятности символов равны отрицательным степеням числа 2;- maximum compression is achieved if the probabilities of the characters are equal to the negative powers of 2;

- различные длины кодовых слов приводят к неравномерным задержкам при восстановлении данных.- different codeword lengths lead to uneven delays in data recovery.

Техническим результатом заявляемого изобретения является повышение скорости операций сжатия и восстановления данных, повышение коэффициента сжатия данных для данных с высокой энтропией, упрощение реализации способа сжатия и восстановления, снижение числа операций сжатия и восстановления данных.The technical result of the claimed invention is to increase the speed of compression and data recovery operations, increase the data compression ratio for data with high entropy, simplify the implementation of the compression and recovery method, reduce the number of compression and data recovery operations.

Указанный технический результат достигается тем, что в способе сжатия и восстановления данных, включающем выбор равных длин отрезков, на которые затем разбивают поток сжимаемых данных и обозначают эту длину через n бит, затем подсчитывают вероятности каждого из чисел длины n бит во всем сжимаемом потоке данных, согласно изобретению числа объединяют в префиксные группы и обозначают эти группы префиксными кодами, при этом в первую группу помещают числа с наибольшими вероятностями и присваивают данной префиксной группе самый короткий префиксный код, в следующую группу также помещают числа с наибольшими вероятностями из тех чисел, которые не были помещены в предыдущую группу, и присваивают данной префиксной группе следующий по длине префиксный код, а всего префиксных групп не должно быть больше n, после чего в каждой префиксной группе все числа нумеруют по порядку начиная с нуля и получают порядковый номер числа в префиксной группе, при этом для записи любого порядкового номера числа в конкретной префиксной группе выделяют такое количество бит, которое необходимо для записи максимального порядкового номера числа в данной префиксной группе, при этом как минимум сумма длины в битах самого короткого префиксного кода и длины в битах, выделенной для записи порядковых номеров чисел в префиксной группе, обозначенной самым коротким префиксным кодом, должна быть меньше n, затем числа от нуля до 2n-1, префиксные коды, порядковые номера чисел в префиксных группах заносят в таблицу и сохраняют ее, после этого преобразуют весь поток сжимаемых данных таким образом, что вместо исходного числа длины n бит записывают код префиксной группы и порядковый номер числа в префиксной группе, всю дальнейшую последовательность действий повторяют для следующего числа длины n бит, для восстановления потока данных считывают префиксный код группы и порядковый номер числа в префиксной группе и в соответствии с таблицей заменяют префиксный код группы и порядковый номер числа в префиксной группе на число, соответствующее префиксному коду группы и порядковому номеру числа в префиксной группе, затем считывают следующий префиксный код группы и порядковый номер числа в префиксной группе и всю дальнейшую последовательность действий повторяют.The specified technical result is achieved in that in a method for compressing and restoring data, including selecting equal lengths of segments into which the stream of compressible data is then divided and denoting this length by n bits, then the probabilities of each number of length n bits in the entire compressible data stream are calculated, According to the invention, numbers are combined into prefix groups and designated by prefix codes. In this case, the numbers with the highest probability are placed in the first group and the shortest prefix is assigned to this prefix group. code, the next group also puts the numbers with the highest probabilities of those numbers that were not placed in the previous group, and assign the next prefix code to the given prefix group, and there should not be more than n prefix groups, after which each prefix to the group, all numbers are numbered in order starting from zero and get the serial number number in the prefix group, while for recording any serial number number in a specific prefix group, the number of bits that are necessary for writing is allocated the maximum serial number number in a given prefix group, while at least the sum of the bit lengths of the shortest prefix code and the bit length allocated to record the sequence numbers of numbers in the prefix group indicated by the shortest prefix code must be less than n, then the numbers from zeros to 2n-1, prefix codes, serial numbers in prefix groups are entered into the table and saved, then the entire stream of compressible data is converted in such a way that instead of the original number of length n bits, the prefix code is written group and the serial number in the prefix group, repeat the entire subsequent sequence for the next number of length n bits, read the group prefix code and serial number in the prefix group to restore the data stream, and replace the group prefix code and serial number in accordance with the table in the prefix group, by the number corresponding to the group prefix code and the serial number number in the prefix group, then the next group prefix code and the serial number number in the prefix are read group and the entire subsequent sequence of actions is repeated.

Способ осуществляют следующим образом.The method is as follows.

Выбирают равные длины отрезков, на которые затем разбивают поток сжимаемых данных и обозначают эту длину через n бит. Затем подсчитывают вероятности каждого из чисел длины n бит во всем сжимаемом потоке данных. Числа объединяют в префиксные группы и обозначают эти группы префиксными кодами, при этом в первую группу помещают числа с наибольшими вероятностями и присваивают данной префиксной группе самый короткий префиксный код, в следующую группу также помещают числа с наибольшими вероятностями из тех чисел, которые не были помещены в предыдущую группу, и присваивают данной префиксной группе следующий по длине префиксный код. Всего префиксных групп не должно быть больше n. После этого в каждой префиксной группе все числа нумеруют по порядку начиная с нуля и получают порядковый номер числа в префиксной группе, при этом для записи любого порядкового номера числа в конкретной префиксной группе выделяют такое количество бит, которое необходимо для записи максимального порядкового номера числа в данной префиксной группе. Как минимум сумма длины в битах самого короткого префиксного кода и длины в битах, выделенной для записи порядковых номеров чисел в префиксной группе, обозначенной самым коротким префиксным кодом, должна быть меньше n. Затем числа от нуля до 2n-1, префиксные коды, порядковые номера чисел в префиксных группах заносят в таблицу и сохраняют ее. Теперь преобразуют непосредственно поток данных. Для этого вместо первого числа длиной n бит записывают код префиксной группы и порядковый номер числа в префиксной группе. Всю дальнейшую последовательность действий повторяют для следующего числа длины n бит.Equal lengths of segments are selected into which the stream of compressible data is then divided and this length is denoted by n bits. Then, the probabilities of each of the numbers of length n bits in the entire compressible data stream are calculated. Numbers are combined into prefix groups and denote these groups by prefix codes; in this case, the numbers with the highest probabilities are placed in the first group and the shortest prefix code is assigned to this prefix group, and the numbers with the highest probabilities from those numbers that were not placed in the next group are also placed the previous group, and assign the next longest prefix code to the given prefix group. Total prefix groups must not be greater than n. After that, in each prefix group, all numbers are numbered in order starting from zero and get the serial number number in the prefix group, and to record any serial number number in a particular prefix group, the number of bits that is necessary to record the maximum serial number number in this prefix group. At a minimum, the sum of the bit length of the shortest prefix code and the bit length allocated to record the sequence numbers of the numbers in the prefix group indicated by the shortest prefix code must be less than n. Then the numbers from zero to 2n-1, prefix codes, serial numbers in the prefix groups are entered into the table and save it. Now directly convert the data stream. To do this, instead of the first number of length n bits, the code of the prefix group and the serial number in the prefix group are written. The entire subsequent sequence of actions is repeated for the next number of length n bits.

Для восстановления потока данных считывают префиксный код группы и порядковый номер числа в префиксной группе и в соответствии с таблицей заменяют префиксный код группы и порядковый номер числа в префиксной группе на число, соответствующее префиксному коду группы и порядковому номеру числа в префиксной группе. Затем считывают следующий префиксный код группы и порядковый номер числа в префиксной группе и всю дальнейшую последовательность действий повторяют.To restore the data stream, the group prefix code and the serial number number in the prefix group are read and, in accordance with the table, the group prefix code and the serial number number in the prefix group are replaced by the number corresponding to the group prefix code and the serial number number in the prefix group. Then read the next prefix code of the group and the serial number in the prefix group and repeat the rest of the sequence.

Пример конкретного выполнения способа.An example of a specific implementation of the method.

Выбирают равные длины отрезков, на которые затем разбивают поток сжимаемых данных. Обозначают эту длину через n бит, например 4 бит (см. табл.1). Затем подсчитывают вероятности каждого из чисел длины 4 бит во всем сжимаемом потоке данных (табл.1, графа 3). После этого числа объединяют в префиксные группы и обозначают эти группы префиксными кодами (см. табл.2). В первую группу помещают числа с наибольшими вероятностями и присваивают данной префиксной группе самый короткий префиксный код. Так в первую префиксную группу объединены числа 0001, 0010, 0100, 1000 и этой группе присвоен префиксный код 0. В следующую группу также помещают числа с наибольшими вероятностями из тех чисел, которые не были помещены в предыдущую группу. Это числа 0111, 1011, 1101, 1110. Этой группе присваивают префиксный код 10. Всего префиксных групп сформировано 4. После чего в каждой префиксной группе все числа нумеруют по порядку начиная с нуля и получают порядковый номер числа в префиксной группе (таблица 2, графа 4).Equal lengths of segments are selected into which the stream of compressible data is then divided. This length is denoted by n bits, for example 4 bits (see table 1). Then, the probabilities of each of the 4-bit numbers are calculated in the entire compressible data stream (Table 1, column 3). After this, the numbers are combined into prefix groups and designated by prefix codes for these groups (see Table 2). The first group contains the numbers with the highest probability and assigns the shortest prefix code to this prefix group. So the numbers 0001, 0010, 0100, 1000 are combined in the first prefix group and the prefix code 0 is assigned to this group. The numbers with the highest probabilities from those numbers that were not placed in the previous group are also placed in the next group. These are numbers 0111, 1011, 1101, 1110. A prefix code of 10 is assigned to this group. A total of 4 prefix groups are formed. After that, in each prefix group, all numbers are numbered in order starting from zero and get the serial number in the prefix group (table 2, column four).

Таблица 1Table 1 Все числа от 0 до 24-1 (в двоичном виде)All numbers from 0 to 2 4 -1 (binary) Количество чисел в сжимаемой последовательностиThe number of numbers in a compressible sequence Вероятности чисел в сжимаемом потоке данныхProbabilities of numbers in a compressible data stream 1one 22 33 00000000 100one hundred 100/3200100/3200 00010001 300300 300/3200300/3200 00100010 300300 300/3200300/3200 00110011 100one hundred 100/3200100/3200 01000100 300300 300/3200300/3200 01010101 100one hundred 100/3200100/3200 01100110 100one hundred 100/3200100/3200 01110111 300300 300/3200300/3200 10001000 300300 300/3200300/3200 10011001 100one hundred 100/3200100/3200 10101010 100one hundred 100/3200100/3200 10111011 300300 300/3200300/3200 11001100 100one hundred 100/3200100/3200 11011101 300300 300/3200300/3200 11101110 300300 300/3200300/3200 11111111 100one hundred 100/3200100/3200

Для записи любого порядкового номера числа в конкретной префиксной группе выделяют такое количество бит, которое необходимо для записи максимального порядкового номера числа в данной префиксной группе, поэтому в примере для записи порядковых номеров чисел во всех префиксных группах выделяют по два бита.To record any serial number number in a particular prefix group, the number of bits is allocated that is necessary to record the maximum serial number number in a given prefix group, therefore, in the example, two bits are allocated in all prefix groups for recording the serial number numbers.

При этом как минимум сумма длины в битах самого короткого префиксного кода и длины в битах, выделенной для записи порядковых номеров чисел в префиксной группе, обозначенной самым коротким префиксным кодом, должна быть меньше 4. В приведенном примере код первой префиксной группы 0 занимает один бит, для записи порядкового номера числа в данной префиксной группе необходимо 2 бит.At the same time, at least the sum of the bit length of the shortest prefix code and the bit length allocated for recording the sequence numbers of the numbers in the prefix group indicated by the shortest prefix code should be less than 4. In the above example, the code of the first prefix group 0 occupies one bit, 2 bits are needed to record the sequence number in a given prefix group.

Таблица 2table 2 Все числа от 0 до 24-1 (в двоичном виде)All numbers from 0 to 2 4 -1 (binary) Количество в сжимаемом потоке данныхAmount in compressible data stream Префиксные коды группGroup Prefix Codes Порядковый номер числа в префиксной группеThe sequence number of the number in the prefix group 1one 22 33 4four 00000000 100one hundred 111111 0000 00010001 300300 00 0000 00100010 300300 00 0101 00110011 100one hundred 110110 0000 01000100 300300 00 1010 01010101 100one hundred 110110 0101 01100110 100one hundred 110110 1010 01110111 300300 1010 0000 10001000 300300 00 11eleven 10011001 100one hundred 110110 11eleven 10101010 100one hundred 111111 0101 10111011 300300 1010 0101 11001100 100one hundred 111111 1010 11011101 300300 1010 1010 11101110 300300 1010 11eleven 11111111 100one hundred 111111 11eleven

Таким образом, для записи любого числа, которое отнесено к первой префиксной группе потребуется 3 бит. При этом выигрыш от такого преобразования составит один бит на каждое число длиной 4 бит.Thus, to write any number that is assigned to the first prefix group, 3 bits are required. In this case, the gain from such a conversion will be one bit for each number with a length of 4 bits.

Все числа от нуля до 24-1, префиксные коды, порядковые номера чисел в префиксных группах заносят в таблицу 3 и сохраняют ее.All numbers from zero to 2 4 -1, prefix codes, serial numbers in prefix groups are entered in table 3 and save it.

Таблица 3Table 3 Все числа от 0 до 24-1 (в двоичном виде)All numbers from 0 to 2 4 -1 (binary) Префиксные коды группGroup Prefix Codes Порядковый номер числа в префиксной группеThe sequence number of the number in the prefix group 1one 22 33 00000000 111111 0000 00010001 00 0000 00100010 00 0101 00110011 110110 0000 01000100 00 1010 01010101 110110 0101 01100110 110110 1010 01110111 1010 0000 10001000 00 11eleven 10011001 110110 11eleven 10101010 111111 0101 10111011 1010 0101 11001100 111111 1010 11011101 1010 1010 11101110 1010 11eleven 11111111 111111 11eleven

Все вышеперечисленные действия предшествуют преобразованию потока данных.All of the above actions precede the transformation of the data stream.

Теперь преобразуют непосредственно поток данных. Для этого вместо первого числа длиной 4 бит исходного потока данных записывают код префиксной группы и порядковый номер числа в префиксной группе в соответствии с таблицей 3. Всю дальнейшую последовательность действий повторяют для всех последующих отрезков длины 4 бит.Now directly convert the data stream. To do this, instead of the first number 4 bits long of the initial data stream, the code of the prefix group and the serial number number in the prefix group are recorded in accordance with Table 3. The entire subsequent sequence of actions is repeated for all subsequent segments of 4 bits in length.

Для восстановления потока данных считывают префиксный код группы и порядковый номер числа в префиксной группе и в соответствии с таблицей 3 заменяют префиксный код группы и порядковый номер числа в префиксной группе на число, соответствующее префиксному коду группы и порядковому номеру числа в префиксной группе, затем считывают следующий префиксный код группы и порядковый номер числа в префиксной группе и всю дальнейшую последовательность действий повторяют.To restore the data stream, the group prefix code and the serial number number in the prefix group are read and, in accordance with Table 3, the group prefix code and the serial number number in the prefix group are replaced by the number corresponding to the group prefix code and the serial number number in the prefix group, then the following is read the prefix code of the group and the serial number in the prefix group and the entire subsequent sequence of actions are repeated.

В таблице 4 показан расчет итогового размера, до которого будет сжат исходный поток данных без учета количества бит, необходимого для записи таблицы 3.Table 4 shows the calculation of the final size to which the original data stream will be compressed without taking into account the number of bits required to write table 3.

Размер всего потока данных до сжатия составлял: 4 бит*3200=12800 бит.The size of the entire data stream before compression was: 4 bits * 3200 = 12800 bits.

Размер данных после сжатия составил 12400 бит.The data size after compression was 12400 bits.

Заявляемый способ позволяет достичьThe inventive method allows to achieve

- более высокого коэффициента сжатия данных по сравнению с методом сжатия данных Хаффмана для данных с высокой энтропией;- a higher data compression ratio compared to the Huffman data compression method for data with high entropy;

- высокой скорости операций сжатия и восстановления данных, достигаемой, за счет замены операций вычисления операциями поиска по таблице и сокращения вычислительных операций;- the high speed of compression and data recovery operations achieved by replacing calculation operations with table searches and reducing computational operations;

Таблица 4Table 4 Все числа от 0 до 24-1 (в двоичном виде)All numbers from 0 to 2 4 -1 (binary) Количество чисел в сжимаемом потоке (в десятичном виде)The number of numbers in the compressible stream (in decimal) Запись числа после преобразования (код группы и порядковый номер в группе)Record the number after conversion (group code and serial number in the group) Количество бит, которое занимает сжатое число (в десятичном виде)The number of bits that the compressed number occupies (in decimal) Количество бит, необходимое для сжатия всех чисел: графу 2×графу 4 (в десятичном виде)The number of bits required to compress all numbers: column 2 × column 4 (in decimal) 1one 22 33 4four 55 00000000 100one hundred 111 00111 00 55 500500 00010001 300300 0 000 00 33 900900 00100010 300300 0 010 01 33 900900 00110011 100one hundred 110 00110 00 55 500500 01000100 300300 0 100 10 33 900900 01010101 100one hundred 110 01110 01 55 500500 01100110 100one hundred 110 10110 10 55 500500 01110111 300300 10 0010 00 4four 12001200 10001000 300300 0 110 11 33 900900 10011001 100one hundred 110 11110 11 55 500500 10101010 100one hundred 111 01111 01 55 500500 10111011 300300 10 0110 01 4four 12001200 11001100 100one hundred 111 10111 10 55 500500 11011101 300300 10 1010 10 4four 12001200 11101110 300300 10 1110 11 4four 12001200 11111111 100one hundred 111 11111 11 55 500500 Итого:Total: 32003200 1240012400

- заявляемый способ может быть использован для отрезков различной длины;- the inventive method can be used for segments of various lengths;

- способ прост в реализации.- the method is easy to implement.

Таким образом, более высокая скорость выполнения операция сжатия и восстановления данных достигается за счет того, что префиксные коды присваиваются не всем числам длины n бит, а только группам, число которых значительно меньше, а также за счет того, что снижается количество вычислительных операций, в частности операций чтения кодов переменной длины, эти вычислительные операции заменяются операциями чтения записей из таблицы, что занимает значительно меньше времени.Thus, a higher speed of the data compression and data recovery operation is achieved due to the fact that prefix codes are assigned not to all numbers of length n bits, but only to groups whose number is much smaller, and also due to the fact that the number of computational operations is reduced, particular operations of reading codes of variable length, these computational operations are replaced by the operations of reading records from the table, which takes significantly less time.

Более высокий коэффициент сжатия достигается за счет того, что производятся операции группировки чисел и префиксные коды присваиваются не всем числам длины n бит, а только префиксным группам.A higher compression ratio is achieved due to the fact that operations of grouping numbers are performed and prefix codes are assigned not to all numbers of length n bits, but only to prefix groups.

Claims (1)

Способ сжатия и восстановления данных, согласно которому выбирают равные длины отрезков, на которые затем разбивают поток сжимаемых данных и обозначают эту длину через n бит, затем подсчитывают вероятности каждого из чисел длины n бит во всем сжимаемом потоке данных, отличающийся тем, что числа объединяют в префиксные группы и обозначают эти группы префиксными кодами, при этом в первую группу помещают числа с наибольшими вероятностями и присваивают данной префиксной группе самый короткий префиксный код, в следующую группу также помещают числа с наибольшими вероятностями из тех чисел, которые не были помещены в предыдущую группу и присваивают данной префиксной группе следующий по длине префиксный код, а всего префиксных групп не должно быть больше n, после чего в каждой префиксной группе все числа нумеруют по порядку начиная с нуля и получают порядковый номер числа в префиксной группе, при этом для записи любого порядкового номера числа в конкретной префиксной группе выделяют такое количество бит, которое необходимо для записи максимального порядкового номера числа в данной префиксной группе, при этом как минимум сумма длины в битах самого короткого префиксного кода и длины в битах, выделенной для записи порядковых номеров чисел в префиксной группе, обозначенной самым коротким префиксным кодом, должна быть меньше n, затем числа от нуля до 2n-1, префиксные коды, порядковые номера чисел в префиксных группах заносят в таблицу и сохраняют ее, после этого преобразуют весь поток сжимаемых данных таким образом, что вместо исходного числа длины n бит записывают код префиксной группы и порядковый номер числа в префиксной группе, всю дальнейшую последовательность действий повторяют для следующего числа длины n бит, для восстановления потока данных считывают префиксный код группы и порядковый номер числа в префиксной группе и в соответствии с таблицей заменяют префиксный код группы и порядковый номер числа в префиксной группе на число, соответствующее префиксному коду группы и порядковому номеру числа в префиксной группе, затем считывают следующий префиксный код группы и порядковый номер числа в префиксной группе и всю дальнейшую последовательность действий повторяют. A method of compressing and restoring data, according to which equal lengths of segments are selected, into which the stream of compressible data is then divided and denoted by n bits, then the probabilities of each of the numbers of length n bits in the entire compressible data stream are calculated, characterized in that the numbers are combined into prefix groups and denote these groups by prefix codes, while the numbers in the first group are placed with the highest probability and the shortest prefix code is assigned to this prefix group, the next group is also placed the numbers with the highest probabilities of those numbers that were not placed in the previous group and assign the next prefix code to the given prefix group, and the total number of prefix groups should not be more than n, after which in each prefix group all numbers are numbered in order starting from zero and get the serial number in the prefix group, while to record any serial number in a particular prefix group, the number of bits that is necessary to record the maximum serial number in the data is allocated prefix group, and at least the sum of the bit length of the shortest prefix code and the bit length allocated to record the serial numbers of the numbers in the prefix group indicated by the shortest prefix code must be less than n, then numbers from zero to 2n-1 , prefix codes, serial numbers in prefix groups are entered into a table and saved, then the entire stream of compressible data is converted in such a way that instead of the original number of length n bits, the code of the prefix group and the serial number are written in the prefix group, the entire subsequent sequence of actions is repeated for the next number of length n bits, to restore the data stream, read the group prefix code and serial number in the prefix group and, in accordance with the table, replace the group prefix code and serial number in the prefix group with the number corresponding to the group prefix code and the serial number number in the prefix group, then the next group prefix code and the serial number number in the prefix group and the entire subsequent sequence are read actions are repeated.
RU2008130744/09A 2008-07-24 2008-07-24 Method of compressing and retrieving data without loss RU2382492C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2008130744/09A RU2382492C1 (en) 2008-07-24 2008-07-24 Method of compressing and retrieving data without loss

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2008130744/09A RU2382492C1 (en) 2008-07-24 2008-07-24 Method of compressing and retrieving data without loss

Publications (1)

Publication Number Publication Date
RU2382492C1 true RU2382492C1 (en) 2010-02-20

Family

ID=42127239

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2008130744/09A RU2382492C1 (en) 2008-07-24 2008-07-24 Method of compressing and retrieving data without loss

Country Status (1)

Country Link
RU (1) RU2382492C1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2510941C1 (en) * 2012-12-05 2014-04-10 Владимир Петрович Панов Information transmission and reception system
RU2510942C1 (en) * 2012-12-05 2014-04-10 Владимир Петрович Панов Method of transmitting and receiving information
RU2622875C2 (en) * 2015-05-18 2017-06-20 федеральное государственное автономное образовательное учреждение высшего образования "Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики (Университет ИТМО) Method of digital data prefix deduplication

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6008745A (en) * 1998-02-17 1999-12-28 Sun Microsystems, Inc. Variable length decoding using lookup tables
RU2158057C1 (en) * 1998-05-06 2000-10-20 Самсунг Электроникс Ко., Лтд. Device for encoding and decoding without errors
WO2002082661A2 (en) * 2001-04-04 2002-10-17 Honeywell International Inc. Canonical huffman encoded data decompression algorithm
RU2005104018A (en) * 2004-03-15 2006-07-20 Майкрософт Корпорейшн (Us) DATA COMPRESSION
RU2321169C2 (en) * 2003-07-15 2008-03-27 Интел, Закрытое Акционерное Общество Method for decoding prefix codes of alternating length

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6008745A (en) * 1998-02-17 1999-12-28 Sun Microsystems, Inc. Variable length decoding using lookup tables
RU2158057C1 (en) * 1998-05-06 2000-10-20 Самсунг Электроникс Ко., Лтд. Device for encoding and decoding without errors
WO2002082661A2 (en) * 2001-04-04 2002-10-17 Honeywell International Inc. Canonical huffman encoded data decompression algorithm
RU2321169C2 (en) * 2003-07-15 2008-03-27 Интел, Закрытое Акционерное Общество Method for decoding prefix codes of alternating length
RU2005104018A (en) * 2004-03-15 2006-07-20 Майкрософт Корпорейшн (Us) DATA COMPRESSION

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2510941C1 (en) * 2012-12-05 2014-04-10 Владимир Петрович Панов Information transmission and reception system
RU2510942C1 (en) * 2012-12-05 2014-04-10 Владимир Петрович Панов Method of transmitting and receiving information
RU2622875C2 (en) * 2015-05-18 2017-06-20 федеральное государственное автономное образовательное учреждение высшего образования "Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики (Университет ИТМО) Method of digital data prefix deduplication

Similar Documents

Publication Publication Date Title
RU2403677C1 (en) Method for lossless data compression and retrieval
EP1147612B1 (en) Code book construction for variable to variable length entropy encoding
WO2023130676A1 (en) Dna storage cascade encoding and decoding methods for type-1 and type-2 segmented error correction internal codes
JP6681313B2 (en) Method, computer program and system for encoding data
JPH03204233A (en) Data compression method
US9698819B1 (en) Huffman code generation
CN112152634B (en) Block compression coding method, device, computer equipment and readable storage medium
US20060087460A1 (en) Method of generating Huffman code length information
JP3241788B2 (en) Data compression method
RU2382492C1 (en) Method of compressing and retrieving data without loss
Belodedov et al. Development of an algorithm for optimal encoding of WAV files using genetic algorithms
CN119135188A (en) Data compression method and device based on Huffman coding and data decompression method and device
KR101023536B1 (en) Data Lossless Compression Method
KR102118328B1 (en) Coding and decoding of polar codes extended to a length not equal to 2
JPH03204234A (en) Restoration of compressed data
JPH03204235A (en) Decoding of compressed data
CN104682966A (en) Lossless compression method for list data
CN108429553B (en) Encoding method, encoding device and equipment of polarization code
RU2386210C2 (en) Method for data compression
WO2006087792A1 (en) Encoding apparatus and encoding method
US20060125660A1 (en) Digital data compression robust relative to transmission noise
RU2437148C1 (en) Method to compress and to restore messages in systems of text information processing, transfer and storage
US20220060196A1 (en) Data compression using reduced numbers of occurrences
JPH0628149A (en) Data compression method for multiple types of data
RU2739705C1 (en) Compression data storage device and device for its implementation

Legal Events

Date Code Title Description
NF4A Reinstatement of patent

Effective date: 20110810

MM4A The patent is invalid due to non-payment of fees

Effective date: 20180725