WO2002001728A1 - Method for numerical compression and decompression of binary data - Google Patents

Method for numerical compression and decompression of binary data Download PDF

Info

Publication number
WO2002001728A1
WO2002001728A1 PCT/IT2001/000329 IT0100329W WO0201728A1 WO 2002001728 A1 WO2002001728 A1 WO 2002001728A1 IT 0100329 W IT0100329 W IT 0100329W WO 0201728 A1 WO0201728 A1 WO 0201728A1
Authority
WO
WIPO (PCT)
Prior art keywords
string
sub
compressed
binary
strings
Prior art date
Application number
PCT/IT2001/000329
Other languages
French (fr)
Inventor
Elena Leanza
Original Assignee
Atop Innovation S.P.A.
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 Atop Innovation S.P.A. filed Critical Atop Innovation S.P.A.
Priority to US10/311,924 priority Critical patent/US6788224B2/en
Priority to EP01949885A priority patent/EP1297630A1/en
Priority to AU70995/01A priority patent/AU7099501A/en
Publication of WO2002001728A1 publication Critical patent/WO2002001728A1/en

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction

Definitions

  • the first classification type divides the concerned encoding methods into methods having no information loss or "lossless” methods, in which the data reconstructed or decoded from the encoded data are identical to the original ones, and methods having information losses or “lossy” methods, in which the reconstructed data lose a portion of the original data information.
  • lossless methods are the Run Lenght Encoding (RLE), the Huffman encoding method and the Lempel- Ziv-Welch or LZW encoding method; an example of lossy method is the Coarser Sampling and/or Quantization or CS&Q method.
  • the RLE and LZW encoding methods entail variable length original data and fixed length encoded data
  • the Huffman encoding method entails fixed length original data and variable length encoded data
  • the CS&Q encoding method entails both original data and encoded data with fixed length.
  • each item s k of said succession S is equal to a polynomial of the p preceding items, where l ⁇ p ⁇ r, according to formula
  • the method according to this invention can comprise: - an initial step in which the information relating to the number L of bits of said input data binary string is stored;
  • - a check step to check whether said CURRENT STRING has been effectively compressed;
  • - a check step performed when the result of the preceding check step (7) is positive, to check whether said COMPRESSED STRING has a size greater than a pre-established value D , where D ⁇ L , - an allotment step, performed when the result of the preceding check step is positive, to allot COMPRESSED STRING to CURRENT STRING, and subsequent repetition of the step loop, starting from said compression block;
  • - a check step performed when the result of one of the two preceding check steps is negative, to check whether the size of, the juxtaposition of the information concerning the size L and of the COMPRESSED STRING is smaller than L ;
  • the information concerning the number! of bits of the input data binary string is stored by a pre-established number t of bits.
  • STRING comprises the following steps: ⁇ .. subdividing said CURRENT STRING into / sub-strings comprising n bits, where n ⁇ n ⁇ , and
  • said step block for compressing said CURRENT STRING to said COMPRESSED STRING, when the size W of said CURRENT STRING is not a multiple of n fills at least a sub-string with a tail of bits equal to "0".
  • step block for compressing said CURRENT STRING to said COMPRESSED STRING, when the size W of said
  • CURRENT STRING is not a multiple of n , fills the last sub-string with a tail of bits equal to "0".
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING, for each sub- string not comprising two consecutive bits equal to "1", designated as canonical sub-string, and not successive to an other canonical sub-string, in the scanning order creates a corresponding compressed binary substring d m _ x d m _ 2 ...d d 0 .
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING, for each sub-string not comprising two consecutive bits equal to "1", designated as canonical substring, creates a corresponding compressed binary sub-string d m _ x d m _ 2 ...d d ⁇ .
  • STRING to said COMPRESSED STRING performs a processing operation on each sub-string comprising at least two consecutive bits equal to "1", designated as redundant or not canonical sub-string, and not successive in the scanning order to an other sub-string for which a compressed binary sub-string has been created, and, when the sub-string obtained by processing said redundant sub-string is canonical, creates a compressed binary sub-string d m _ x d m _ 2 ...d x d Q corresponding to said processed sub-string.
  • STRING to said COMPRESSED STRING performs a processing operation on each sub-string comprising at least two consecutive bits equal to "1", designated as redundant or not canonical sub-string, and, when the sub-string obtained by processing said redundant sub-string is canonical, creates a compressed binary sub-string d m _ x d m _ 2 ...d x d 0 corresponding to said processed sub-string.
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING performs said processing operation during the same scan of the / sub-strings in which it creates the compressed binary sub-strings corresponding to the canonical sub-strings.
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING performs said processing operation in a scan of the / sub-strings subsequent to the scan during which it creates the compressed binary sub-strings corresponding to the canonical sub-strings.
  • said compression block performs said processing operation for each redundant or not canonical sub-string that is not adjacent , in the scanning order, to another sub-string for which a compressed binary sub-string has been created.
  • said processing operation can include a logic NOT operation.
  • processing operation can include a logic
  • XOR operation with at least one mask or a logic XOR operation with a mask, comprising a number r of bits not higher than n (r ⁇ n ), which mask is defined as the one that makes the maximum number of redundant sub-strings to be processed canonical.
  • said processing operation can comprise a binary arithmetic operation, preferably performed by means of at least a binary constant, comprising a number r of bits not higher than n (r ⁇ n ).
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING also creates a header string comprising, for each of the / sub-strings into which said
  • CURRENT STRING is subdivided, an assembly of bits which indicates whether the corresponding sub-string of the CURRENT STRING has been compressed and/or whether the corresponding sub-string of the
  • the header string comprises / bits, each of which uniquely corresponds to a sub-string of the CURRENT STRING and it is equal to "1", if the corresponding sub-string is compressed, or it is equal to
  • the header string comprises, for each sub-string of said CURRENT STRING that is compressed after having been processed, at least a corresponding bit to indicate the processing type performed on the corresponding sub-string.
  • the header string further comprises said at least one mask. In an other particular embodiment of the method according to this invention, the header string further comprises said at least one binary constant.
  • said compression block compresses at least one sub-string a n ._ x a n ,_ 2 ...a x a Q > having a number of bits, where ri ⁇ I , of the header string according to the Run Length
  • a flag conmprising one or more bits is inserted ahead of or following to said COMPRESSED
  • the block for compressing said CURRENT STRING to a COMPRESSED STRING comprises:
  • T designated as canonical sub-string, a corresponding compressed binary string d m _ d m _ 2 ...d x d 0 is created, a first header string being also created during such scan and comprising, for each of said / sub-string into which said CURRENT STRING is subdivided, a bit that is equal to "1", if the corresponding sub-string is compressed, or a bit that is equal to "0", if the corresponding sub-string is not compressed, and - one or more further step iterations, in which a processing operation is performed on each sub-string in respect of which, during the preceding iteration, no corresponding compressed binary sub-string d m ⁇ d m _ 2 ...d d 0 has been created, and, when the sub-string as furnished by said processing operation is canonical, a compressed binary sub-string d m _ x d m _ 2 ..d x d 0 corresponding to the processed sub-string, is
  • said processing operation comprises a logic NOT and/or a logic XOR with at least one mask and/or a logic XOR with at least one mask including a number r of bits not higher than n (r ⁇ n ), which is designated as the mask that makes the maximum number of sub-strings, in respect of which no corresponding compressed binary sub-string d m - ⁇ d m _ 2 --d d 0 was created during the preceding iteration, canonical.
  • said header string further comprises said at least one mask.
  • said processing operation comprises a binary arithmetic operation, particularly performed with at least one binary constant comprising a number r of bits not higher than n ( r ⁇ n ).
  • said header string can comprise said at least one binary constant.
  • said step block for compressing said CURRENT STRING to said COMPRESSED STRING also compresses the first header string and/or at least one of said further header strings.
  • said compression block compresses the first header string and/or at least one of said further header strings according to the method in which said compression block compresses at least one sub-string a n ,_ x a n ,_ 2 ...a x a 0 , having a number ri of bits, where ri ⁇ I , of the header string according to the method , in which the succession 5 is defined by the following formula:
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING comprises: a) a first iteration of steps, in which:
  • a first scan of the CURRENT STRING is performed by means of a first window (59) having a size n n ⁇ n ⁇ n not higher than a maximum value WD , said first window scanning said CURRENT STRING by shifting itself by a bit pitch WS in the range of M WD (1 ⁇ WS X ⁇ WD ),
  • a scan of the reject string furnished by the preceding iteration is performed by means of a corresponding further window having a progressively decreasing size n lg ⁇ « lg _, said further window scanning the concerned reject string by shifting itself by a bit pitch WS g in the range of 1 ⁇ o WS g _ x ( ⁇ ⁇ WS g ⁇ WS g x ),
  • WD ⁇ M and preferably
  • n Xg n Xg _ x -I .
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING comprises, preliminarly to said first iteration of steps, a processing operation of said CURRENT STRING.
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING comprises a first step for counting the number P of bits equal to "1" occurring in said CURRENT STRING.
  • L v a logic NOT operation is performed on said current string and an extended string is created starting from the string generated by said not operation by juxtaposing a bit "0" to each bit equal to "1" .
  • said block for compressing said CURRENT STRING to said COMPRESSED STRING comprises performing a logic XOR operation on said CURRENT STRING by means of at least one mask comprising a number r of bits not higher than L (r ⁇ L ), designed in order that the string generated by said XOR operation fulfils the following condition
  • each of said / sub-strings, into which said CURRENT STRING is subdivided is compressed to a compressed sub-string including a first portion, designated as "mantissa", comprising a number m of bits, furnished by the method according to the Fibonacci compression procedure, and a second portion, designated as "exponent”, comprising a number z of bits, that is variable as the mantissa varies, where z > 0 and equal to the number of bits needed for representing the number of n-bit strings to which the same whole numeric value N corresponds, when they are construed by means of the succession according to the Fibonacci compression procedure, said compression block further providing for pre-establishing an order of all of the 77 -bit strings, to which the same whole numeric value N corresponds, and for the exponent to identify the index of the redundant representation corresponding to the compressed
  • the method can be terminated as soon as all of the sub-strings into which the input binary string was subdivided are compressed.
  • the n-b ⁇ strings construed according the Fibonacci succession, not comprising two consecutive bits equal to "1" and designated as canonical strings, bolong to the first redundancy order.
  • This invention further concerns a method for decompression of a compressed binary string characterized in that said compressed binary string is generated starting from a data binary string comprising a number L of bits, by means of the descriobed compression method.
  • This invention also covers an electronic apparatus comprising at least a central processing unit and at least a memory unit, characterized in that it performs the compression method as above described, as well as an electronic apparatus comprising at least a central processing unit and at least a memory unit, characterized in that it performs the described decompression method.
  • an electric, magnetic or electromagnetic signal modulated by a digital signal comprising at least one data string, wherein said at least one data string is a compressed binary string generated, starting from a data binary string having a number
  • This invention further describes and claims a memory medium readable by a processor containing at least one data string, characterized in that said at least one data string is a compressed binary string generated, starting from a data binary string having a number L of bits, by means of the above described compression method.
  • processor program comprising code means adapted to perform, when they operate on a processor, the herein described and claimed compression method
  • FIG. 1 schematically shows a binary_ string compression in which use is made of a new fractional numeric representation
  • Figure 2 schematically shows a binary string compression according to a preferred embodiment of the method of this invention
  • Figure 3 shows a flow diagram of a first embodiment of the method according to this invention
  • Figure 4 schematically shows two strings as used and/or processed by the method of Figure 3;
  • Figure 5 shows a flow diagram of a particular step block of the method of Figure 3;
  • Figure 6 schematically shows some strings used and/or processed by a second embodiment of the compression method according to this invention.
  • Figure 7 shows a flow diagram of a particular step block of the method of Figure 6;
  • Figure 8 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention.
  • Figure 9 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention.
  • Figure 10 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention
  • Figure 11 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention
  • Figure 12 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention.
  • the starting consideration of this invention relates to the symbolic representation of numerals.
  • the more generalised representation of numerals is based upon weighed positional numeration systems.
  • Such systems utilise a limited assembly of elementary symbols ⁇ c 0 ci ... c b ., ⁇ , called “figures”, to which a generally progressive numeric value is assigned, whose number b (equal to a positive whole number higher than 1 ) is called “base" of the numeric system.
  • the decimal portion can be computed by introducing, on the right side of the symbol having the least significant weight, further symbols whose numeric weights are equal to powers of said base b in which the exponent is again function of the position and negative.
  • the most popular numeric system is the decimal system, in which the base b is equal to 10.
  • the digital data generally have representations utilising a binary system, in which the base b is equal to 2 and whose two figures are symbols "0" and "1".
  • the generalised use of such binary representation is firstly due to the efficiency and reliability of its implementations, in which the two mentioned figures correspond to only two states of a pre-established physical entity (for instance: absence or presence of a signal, minimum value or maximum value of a voltage).
  • the data can also be construed by means of different numeric systems, such as the octal (base b equal to 8) and hexadecimal (base b equal to 16) systems.
  • particular codes such as the decimal code represented in binary form or BCD, can exploit the binary system.
  • a n-bit binary string a n - ⁇ a n . 2 ... a 0 construed according a binary representation, represents a whole numeric value N equal to the sum of the items of succession B, among the first n items, whose corresponding bit a,- is equal to "1".
  • the inventor developed a novel method for compressing digital data which, provided that certain conditions are fulfilled, enables them to be retrieved by a corresponding decompression method adapted to maintain their integrity.
  • n-bit numeral F will have a generally not-whole value furnished by formula [1].
  • Fiw x that can be represented by a fractionally represented 7-bit numeral F is equal to: ff-l LU _ ⁇
  • a /7-bit fractionally represented numeric value can be fractionally represented numeric value can be expressed in a binary representation by a m-bit string, in which the number m of bits is not higher than n (m ⁇ n).
  • the inventor developed a novel numeric representation that can be alternatively utilisabie in stead of the above described fractional representation and enables the original binary string to be retrieved in simple manner, starting from a compressed string, so as to guarantee an effective bit saving.
  • the method according to this invention utilises the formalism expressed in formula (2) for representing a positive whole numeral, by resorting to an increasing monotonic succession S ⁇ fso, Si, s l ... ⁇ of whole numerals other than the binary succession B.
  • s 0 1
  • said ratio R k trends to a constant value R as said index k increases:
  • any item S k at least starting from an index r (being k ⁇ r) can be equal to a function f adapted to return whole values of p preceding items, where 1 ⁇ p ⁇ r.
  • function f of formula (11) can be a polynominal of said p preceding items:
  • constant coefficients e (for h- 1 , 2, ...p) are preferably whole numerals having positive, negative or zero values.
  • Tables l a and l b evidence, under variation of the number n of bits of a binary string a n . ⁇ a n . 2 ... a 1 a 0 by which a whole numeric value N is represented by the Fibonacci succession, item S k of succession S t corresponding to the most significant bit a n . ⁇ (S n - ⁇ ), the maximum whole value NpibM x that can be represented by formula (10) as well as the number m of bits of the binary string means d m - ⁇ d m . 2 ... di do by which N FibMA x can be represented by means of a binary representation.
  • Table l a and Table l b are related to values of n variable from 1 to 42 and from 43 to 64, respectively.
  • n-bit binary strings is equal to the number of dispositions with repetitions of 2 items of class n, equal to 2"
  • the number of values that can be represented by a n-bit Fibonacci representation is equal to (N F ; b MAX + 1) or is lower than 2"
  • some numeric values N can be represented by a Fibonacci representation by more than one string. This is apparent from formula (13) which evidences that a binary string "100" as construed by a Fibonacci representation furnishes the same numeric value as binary string "011".
  • the binary strings construed by the Fibonacci representation are designed as “canonical” strings, when they do not include two consecutive bits equal to "1" (in other words they do not include bit pairs equal to "11"), while they are designed as “non canonical” strings or also “redundant” strings, when they include at least two consecutive bits equal to "1” (in other words, they include at least a bit pair equal to "11").
  • the number Ncs of canonical strings is equal to
  • strings as canonical strings, including also strings comprising at least a bit pair equal to "11".
  • the starting binary string 1 not always can be unequivocally ascertained without furnishing further information that enable to identify which Fibonacci string, taken among the various possible ones, corresponds to said numeric value N.
  • the inventor developed various embodiments of the compression and decompression methods according to this invention that account for the possible redundant strings.
  • the flow chart of the first embodiment of the compression method according to this invention includes a starting step 3 in which the size of the input binary string to be compressed, equal to the number of L bits, is stored.
  • the methods stores said size L always with the same number t of bits.
  • the method includes then a step 4 in which the maximum size D as desired for the compressed binary string is established.
  • size D can be established by an operator also by allotting a maximum percentage value of the compressed binary string with respect to the size L of the input binary string.
  • the input string is allotted to an auxiliary string designated as "CURRENT STRING".
  • the method performs a set of steps starting with a compression block 6 wherein the CURRENT STRING is compressed, according to some steps that will be hereinbelow more detailedly described and the compression result is allotted to a second auxiliary string, designated as "COMPRESSED STRING".
  • the method performs then a step 7 wherein it is checked that the CURRENT STRING has been effectively compressed or that the COMPRESSED " STRING has a smaller size than the CURRENT STRING; in the positive, a step 8 is performed to check whether the COMPRESSED STRING has a size greater than D and, in the positive, a step 9 is carried out to allot the COMPRESSED STRING to the CURRENT STRING and, subsequently, the method repeats the loop starting again from the compression block 6.
  • step 10 the method performs a step 10 to check whether the juxtaposition (designated by operator "&") of the information relating to size L (preferably stored by t bits) and of the COMPRESSE STRING is smaller than L: in the positive, the method performs a step 11 in which the juxtaposition of the information concerning size L and of the COMPRESSED STRING is allotted to an output string; in the negative, the method performs a step 12 wherein the input string is allotted to the output string, because it was not possible to compress such input string.
  • step corresponding to steps 10, 11 and 12 can be provided also for other embodiments of the compression method according to this invention.
  • Compression block 6 carries out a compression of the current string by subdividing it into sub-strings each comprising n bits (where n ⁇ n m in- 7) and by compressing only the canonical strings, according to the procedure shown in Figure 2, and by avoiding to compress two consecutive sub-strings.
  • n 10; even more preferably, n > 13.
  • Block 6 creates a header string, having a number of bits equal to the number of sub-strings, such that each bit of the header string is equal to "1", if the corresponding sub-string is compressed, otherwise is equal to "0". Lastly, block 6 also compresses the header string, that is certainly canonical, since two consecutive sub-strings are never compressed. More detailedly, by referring to Figures 4 and 5, it can be observed that the compression block 6 performs a starting step 14 wherein the CURRENT STRING 15, comprising W bits, is subdivided into sub-strings each of which comprises n bits. In particular, the number / of sub-strings is given by
  • the compression block 6 subsequently performs an initialisation step 16 wherein
  • a first auxiliary pointer variable designated as "PRECEDING BIT" is initialised to point to a constant having a binary value equal to "0";
  • CURRENT BIT a second auxiliary pointer variable, designated as "CURRENT BIT" is initialised to point to the first bit of the header string; and - the first sub-string of the CURRENT STRING 15 is allotted to an auxiliary variable designated as "CURRENT SUBSTRING".
  • the compression block 6 performs a set of steps whist starts with a step 18 by checking whether the value pointer to by PRECEDENT BIT is equal to "0". In the positive, a subsequent step 19 is carried out in order to check whether the CURRENT SUB-STRING is canonical.
  • a step 20 is performed to compress the CURRENT SUB-STRING according to the procedure shown in Figure 2, henceforth designated as "Fibonacci compression".
  • the n bits a ⁇ - ⁇ a n-2 ... a ? a 0 of the CURRENT SUB-STRING are construed according to the Fibonacci representation by computing their numeric value N, expressed by formula (10), that is then represented by a m-bit binary representation d m . ⁇ d m . 2 ... d 1 d 0 , that is allotted to an auxiliary variable designated as "COMPRESSED SU- STRING".
  • step 21 is performed to add (by juxtaposition) the COMPRESSED SUB-STRING to the PENDING CONSTRUCTION STRING and a step 22 is performed to allot a binary value "1" to the header string bit pointed to by the CURRENT BIT.
  • the method performs a step 23 to add (by juxtaposition) the CURRENT SUB-STRING to the PENDING CONSTRUCTION STRING as well as a step 24 to allot a binary value "0" to the header string bit pointed to by the CURRENT BIT.
  • step 25 is performed in order to check whether the CURRENT SUB-STRING was the last sub-string of the CURRENT STRING 15.
  • a step 26 is performed to compress the header string and a step 27 is performed to allot the juxtaposition of the compressed header string and of the PENDING CONSTRUCTION STRING to the COMPRESSED STRING.
  • said step 26 can compress the header string by Run Length Encoding (RLE) or by means of a Fibonacci compression operation, possibly by subdividing the header string into sub-strings comprising a number n' of bits also different from n, by filling the last of them with the necessary zero tail and, preferably, by providing a pre- established number of sub-strings forming the header string.
  • RLE Run Length Encoding
  • Fibonacci compression operation possibly by subdividing the header string into sub-strings comprising a number n' of bits also different from n, by filling the last of them with the necessary zero tail and, preferably, by providing a pre- established number of sub-strings forming the header string.
  • the header string can be compressed both by RLE and by Fibonacci compression, by inserting ahead of the COMPRESSED STRING an indication bit or flag, the value of which indicates the compression type utilised to compress the header string.
  • step 28 is performed:
  • - CURRENT BIT is allotted to PRECEDING BIT
  • - CURRENT BIT is up-dated to point to the subsequent bit of the header string
  • Figure 4 shows the situation relating to the third iteration of the step set in the flow chart of Figure 5.
  • each bit of the header string could be equal to "0", if the corresponding sub-string is compressed, or equal to "1", if the corresponding sub-string is not compressed.
  • a second embodiment of the compression method according to this invention provides for processing at least a portion of the sub-string of the CURRENT STRING appearing not to be canonical, in order to make them canonical.
  • a logic NOT operation is performed (by inverting the value of each individual bit) in order to check whether the concerned sub-string becomes canonical and, in the positive, the inverted sub-string is compressed.
  • the above second embodiment provides a slightly different set of steps of the compression block 6 with respect to the one shown in the flow chart of Figure 5.
  • the step set also includes a further check step 19. If the result of the check is positive, a step 19 is performed to allot a binary value "1" to the bit pointed to by the CURRENT BIT, a step 30 is performed to up-date said CURRENT BIT, that is updated so as to point to the subsequent bit of the header string, and a step 31 is performed to allot a binary value "0" to the bit pointed to by the CURRENT BIT.
  • the considered sub-string of the CURRENT STRING 15 is canonical and can be compressed, under allotment of a binary value "10" to the corresponding bit pair of the header string.
  • step 32 is performed as a logic NOT operation on said CURRENT SUB-STRING, whose bits are individually converted from “0" to "1” or from "1" to "0".
  • a step 33 is carried out to check that the CURRENT SUB-STRING is canonical.
  • step 33 furnishes a positive resulf
  • a step 34 is performed to allot a binary value "1" to the bit of the header " string pointed to by the CURRENT BIT
  • a step 35 is performed for up-dating the CURRENT BIT, that is up-dated so as to point to the subsequent bit of the header string
  • a step 36 is performed to allot a binary value "1" to the bit of the header string pointed to by the CURRENT BIT.
  • a step 20 is performed in order to compress the CURRENT SUB-STRING to a COMPRESSED SUB-STRING
  • a step 21 is performed in order to add (by juxtaposition) the COMPRESSED SUB-STRING to a PENDING CONSTRUCTION STRING
  • a step 37 is performed to up-date the PRECEDING BIT, that up-dated so as to point to the bit of the header string that precedes the one pointed to by the CURRENT BIT (in order to point to the first bit of the pair corresponding to the compressed substring).
  • step 38 is performed as a logic NOT operation on the CURRENT SUB-STRING, in order to counteract the NOT operation of step 32 and reversing it to its original contents.
  • step 23 is performed to juxtapose the CURRENT SUB-STRING to the PENDING CONSTRUCTION STRING, a step 24 is performed to allot a binary value "0" to the header string bit pointed to by the CURRENT BIT and step 39 is performed in order to up-date the PRECEDING BIT to which the CURRENT BIT is allotted.
  • a step 25 is performed in order to check whether the CURRENT SUB-STRING were or not the last sub-string of the CURRENT STRING 15. If the result is positive, a step 26 is performed so as to compress the header string and a step 27 is performed in order to allot the juxtaposition of the compressed header string and of PENDING CONSTRUCTION STRING.
  • the header string can also advantageously include the number of sub-strings into which said CURRENT STRING 15 is subdivided.
  • an up- dating step 40 is performed including:
  • the CURRENT BIT is up-dated so as to point to the subsequent bit of the header section
  • Figure 6 illustrates the situation relating to the third iteration of the step set of the flow chard of Figure 7.
  • the canonical sub-strings of the CURRENT STRING 15 are designated by letter C, while the not-canonical or redundant ones are designates by letters ⁇ /C.
  • the sub-strings designated by letter are the ones that cannot be compressed because they are subsequent to a compressed sub-string and, in respect thereof, the result of the check step 18 is negative.
  • the first sub-string is directly compressed, as it is a canonical one, and the corresponding bit pair in the header string has a binary value of "10", the second sub-string has a binary value is not compressed and the corresponding bit in the header string has a value of "0”, the third sub-string is compressed after having been subjected to a logic NOT operation, so that the corresponding bit pair in the header string has a binary value of "11".
  • the step set of the compression block 6 shown in Figure 7 does not include the step 18 aimed at checking whether the value pointed to by the PRECEDING BIT is equal to "0".
  • the header string comprises bit pair equal to "11”
  • the control of step 18 can be considered as quite unnecessary, because the insertion of pairs that make the header string non-canonical is anyway allowed.
  • the utilisation of the pointer variable PRECEDING BIT is fruitless. Consequently, step 16 of the compression lock should be modified by climatating the initialisation of the PRECEDING BIT and the step set of Figure 7 does not even include a step 37 and a step 39.
  • the processing operation of at least a portion of the sub- strings of the CURRENT STRING appearing not to be canonical, so as to make them canonical takes place at the end of the CURRENT STRING scan, in contrast to the second embodiment in which such processing operation occurs sub-string by sub-string during such scan.
  • said compression block 6 again includes the steps illustrated in the flow chart of Figure 5, but, ahead of step 6 which compresses the header string, a new scan of the PENDING CONSTRUCTION STRING during which:
  • the identified sub-strings are processed, preferably by performing a logic NOT operation
  • the header string is the same as that obtained in connection with the first embodiment of the method according to Figures 4 and 5.
  • a bit for each compressed substring is added to the header string, more specifically a bit equal to "0", if the sub-string has (already) been compressed to its original format, or a bit equal to "1", if the sub-string is compressed after having been processed. If the sub-string is compressed after having been processed, the corresponding bit of the first section of the header string is also converted from "0" to "1".
  • the CURRENT STRING 15 comprises both canonical sub-strings C and not canonical sub-strings ⁇ /C.
  • CONSTRUCTION STRING 41 comprises compressed sub-strings CS and not canonical sub-strings NC, while the header string 42 comprises a bit for each sub-string, such bit being equal to "1", if it corresponds to a not canonical (and not compressed) sub-string NC.
  • a tail 43 of the header string is created so as to have bits corresponding to compressed sub-strings CS; n particular, for each compressed sub-string starting from the original sub-string, or for each bit 80 having a value "1" of the header string 42 as obtained at the end of the CURRENT STRING 15 scan, said tail 43 comprises a bit having a value "0".
  • the not canonical substrings 44 and 44' are identified as processable sub-strings, because they are not adjacent to compressed sub-strings CS.
  • the corresponding bits 45 and 45' of the header string are equal to "0" and are adjacent to preceding or subsequent bits also equal to "0".
  • the not canonical sub-strings 44 and 44' are subjected to a logic NOT operation and after having been so processed, they can appear to be canonical (as sub-string 46 in Figure 8) or still not canonical (as substring 47 in Figure 8).
  • the sub-string 46 that became canonical after said logic NOT operation are compressed to corresponding sub-strings 48 which are substituted for the corresponding original sub-string 44 in the PENDING CONSTRUCTION STRING 41 , while the corresponding bit 45 of the first section of the header string is converted from "0" to "1" and a corresponding bit 49 having a value "1" is added to the tail portion 43 of the header string.
  • the header string 50 obtained as a result of the juxtaposition of the first portion 42' (some bits of which have been possibly converted during the new scan course) and of the tail 43, is compressed.
  • the compressed string, not shown, furnished by the compression block is obtained by juxtaposition of the header string and of the PENDING CONSTRUCTION STRING 41.
  • the first portion 42' of the header string can be separately compressed with respect to the tail portion 43 and the compressed string can be obtained by juxtaposition, at any order, of the first compressed portion of the header string, of the PENDING CONSTRUCTION STRING 41 and of the compressed tail portion of the header string.
  • the compressed substring can also be separately juxtaposed to the items comprising the compressed string.
  • the processing operation of at least some of the sub-string of the CURRENT STRING appearing not to be canonical still takes place at the end of the CURRENT STRING scan, but ajogic XOR operation is performed by means of a purposely computed mask.
  • the mask comprises a number r of bits not higher than n (where r ⁇ n) and it is designed as the mask adapted to make the maximum number of not canonical processable sub-strings canonical (or, in other words, not adjacent to compressed sub-strings).
  • the XOR operation mask is inserted, possibly compressed separately from or together with a portion of the header string, into the compressed string furnished by compression block 6.
  • the sub-strings of the CURRENT STRING are compressed, possibly after having been processed in successive iterations in order to make them canonical, without imposing the condition that at least one of two adjacent strings be not compressed.
  • STRING 15 comprises canonical sub-string C and not canonical substrings NC.
  • a first iteration is carried out in order that all canonical sub-strings C are compressed and a first header string 51 is created which comprises a number of bits equal to the number of sub-strings of the CURRENT STRING 15, having each bit equal to "1", if the corresponding sub-string C has been compressed due to the fact that it is a canonical sub-string, or it is equal to "0", if the corresponding sub-string ⁇ /C has not been compressed, due to the fact that it is a not canonical sub-string.
  • a second iteration is subsequently carried out in which the not canonical sub-strings NC of the CURRENT STRING 15 are subjected to a logic XOR operation 52 by means of a mask M-i designed so as to make the maximum number of sub-strings ⁇ /C canonical.
  • said mask M-i comprises a number r of bits not higher than the number n of bits comprising the CURRENT STRING 15 (where r ⁇ n).
  • the string 53 as obtained by said XOR operation performed on the sub-strings ⁇ /C of the CURRENT STRING 15 and on the mask 7 comprises canonical sub-strings C and not canonical sub-strings NC.
  • all canonical sub-strings C of said string 53 are compressed and the method provides for creating a second header string 54 comprising a number of bits equal to the number of sub-strings of said string 53, similarly to the first header string 51 in respect of the CURRENT STRING 15.
  • the method provides for a third iteration in which the not canonical sub-strings of said string 53 are subjected to a logic XOR operation 55 by means of a r-bit mask M 2 , designed so as to make the maximum number of not canonical sub-strings ⁇ /C canonical.
  • the string 53 as obtained by said XOR operation performed on the sub-strings ⁇ /C of said string 53 and on the mask M 2 comprises canonical sub-strings C and not canonical sub-strings NC.
  • all canonical sub-strings C of string 55 are compressed and the method provides for creating a third header string 57, comprising a number of bits equal to the number of sub-strings of the string 56, similarly to the previous header strings 51 and 54.
  • the iteration number in this method can be pre-established or variable.
  • the iterations can be terminated when the number of still not canonical strings (equal to the number of bit having a value "0" in the lastly generated header string) is lower than a minimum threshold value, depending on the bit saving A for each sub-string as well as on the bit amount needed to store a further possibly compressed header string and a further possibly compressed mask.
  • a seventh embodiment of the compression method according to this invention provides for a repeatable set of operations aimed at performing a dynamic subdivision of the input binary string to be compressed.
  • Such dynamic subdivision identifies and interactively compresses canonical sub-strings wherever positioned within the input string and having a size, namely a number of bits, progressively decreasing at each iteration, by also storing an index assembly that indicates the position of each sub-string within the input binary string.
  • the method also provides for a possible processing operation of the string obtained at the end of the iterations of each repetition.
  • the input data string 58 to be compressed has a length L not greater than the allowed maximum length M.
  • M is equal to 1024.
  • the above mentioned seventh embodiment of the compression method scans said string 58 by means of a window 59 having a size nn not greater than a maximum value WD ⁇ M.
  • window 59 identifies a canonical sub-string C n n, having a size nn, within string 58, an index identifying the position of the canonical sub-string C m n is stored and said canonical sub-string C m n is compressed to a sub-string of smaller size, according to the Fibonacci compression procedure.
  • nn is not lower than n mm - 7 (where n mm ⁇ n-u ⁇ WD).
  • Figure 10 shows two canonical sub-strings C n n having an index in and i 12 , respectively, that are compressed to two corresponding sub-strings SC and SC 12 .
  • said indexes in and i 12 are the address of the first bit of the respective canonical sub-string C n n within said string 58; even more preferably, upon identifying a canonical sub-string C n11 , said window 59 starts again scanning from the first bit subsequent to the canonical sub-string C n11 (in the example of Figure 10, it starts again scanning from bits (in + n ) and (i ⁇ 2 + n-n)).
  • the number Gi of canonical sub-strings C 1 that have been compressed is stored.
  • These portions 60, 60' and 60" of said string 58 not including canonical substrings C n n with size nn are then juxtaposed to one another in a reject string (preferably, the juxtaposition is carried out bit during scanning).
  • n ⁇ 2 n»- 1.
  • an index i 2 ⁇ and i 22 which identifies the position of said canonical sub-string Cn 12 is stored and each canonical sub-string Cn-12 is compressed to a corresponding sub-string SC 12 and SC 2 2 , according to the Fibonacci compression procedure.
  • the concerned compression method iterates the scans of the reject strings as obtained from the previous scan, by means of subsequent windows having a progressively decreasing size n- ⁇ g .
  • n 1g n 1g .- ⁇ - 1.
  • no canonical sub-.string n 1g having a size n ig is identified during one or more intermediate iterations; in such case, only the number G g of canonical sub- strings Cn ?g that have been compressed, equal to zero, is stored.
  • the canonical sub-strings Cn 1g are juxtaposed to one another, so as to form groups comprising at least two of them; then the Fibonacci compression is carried out on the so obtained juxtaposition.
  • the iterations are terminated when it is no more possible to compress the last generated reject string; this occurs in three cases:
  • the method provides for creating a compressed string 65 comprising: - the number F of scans carried out up to the last scan in which an effective compression operation has been performed (such number also accounts for any intermediate possible iterations that have not identified and compressed canonical sub-strings);
  • the various previously listed information items can be stored in the compressed string 65 by juxtaposition according to any pre-established order, preferably with the scan number F positioned at the begin or at the end of the compressed string 65.
  • the compressed string 65 is subsequently subjected to a second repetition of the previously described iterations.
  • the method provides for performing further repetitions of the iterative scans on the compressed strings as achieved at the end of each repetition.
  • the method provides for processing the compressed string generated by the last repetition in which at least one canonical sub-string has been compressed in at least one iteration.
  • processing operation preferably includes: - a logic NOT operation carried out on the whole compressed string, and/or
  • the method can also provide for storing a flag indicating the types of the processing operation carried out (in the case it could provide for more than one) and/or of the possible masks of the logic XOR operation and/or of the possible constant binary values and/or of any identification indexes to identify the bit blocks of the compressed string subjected to a processing operation. In this way, the method is terminated when the desired value of the compression ratio CR is reached.
  • an eighth embodiment of the compression method provides for a first counting step aimed at counting the number P of bits having a value "1" included in the input binary string 66 to be compressed, having a size L
  • a suitable threshold value P MA X aimed at counting the number P of bits having a value "1" included in the input binary string 66 to be compressed, having a size L
  • P MA X a suitable threshold value
  • an extended string 67 is created from said string 66 by juxtaposition of a bit "0" to each one of the P bits equal to "1"; the extended string 67 has a size (L+P).
  • the Fibonacci compression procedure is carried out on said extended string 67, that comprises only canonical sub-strings, in order to generate a complex string 68 having a size X.
  • the threshold value P MAX is given by the maximum value of P that enables to make
  • the number P of bits equal to "1" appearing in the input binary string 66 to be compressed ought to be not higher than the following percentage value of size L of the binary string 66.
  • the method can provide for a preliminary logic NOT operation carried out on said binary string 66 so as to enable the method of Figure 11 to be applied to the inverted string.
  • the method can also provide for a logic XOR operation to be carried out on said binary string 66 by means of mask comprising a number r of bits not higher than L (where r ⁇ L), suitably designed so that the string furnished by said XOR operation fulfils condition (12) and consequently the method of Figure 11 is applicable to sit.
  • the logic XOR operation can be carried out by subdividing said string 66 into packets including a number r of bits.
  • the above mentioned eighth embodiment of the compression method can be applied to a data binary string to be compressed in combination with one or more embodiments.
  • numeric values N As previously described, given a n-bit binary string and considered the assembly of numeric values N that can be represented by means of the Fibonacci representation, while all numeric values N are represented by a canonical string, not all of the numeric values N are represented by further redundant strings and, consequently, the number of redundant strings generally varies as the specific numeric value N (among the ones also represented by redundant strings) varies.
  • a ninth embodiment of the compression method according to the invention exploits this property of the Fibonacci representation.
  • the input binary string 69 to be compressed having a size L, is subdivided into sub- strings 70 each comprising n bits. Should said size L of the binary string be not a multiple of n, the last sub-string is filled with a tail of bits equal to "0".
  • Each sub-string 70 is compressed by the Fibonacci compression procedure to a sub-string 71 including a first portion 72, designated as "mantissa", comprising a number m of bits fixed in respect of all sub-strings 71 , and a second portion 73, designated as "exponent', comprising a number Z of bits, that is variable as the mantissa 72 varies.
  • the number Z of bits in the exponent 73, where z ⁇ O, is equal to the number of bits needed for representing the number of redundant strings of the Fibonacci representation of the numeric value N represented by the binary representation 73.
  • the order of all of the canonical and redundant strings of the Fibonacci representation of each numeric value N is pre-established and the exponent 73 identifies the index of the Fibonacci representation furnished by the corresponding sub-string 70.
  • the number of its possible Fibonacci representations, or the number of any possible redundant strings appears to be uniquely determined and, therefore, the number Z of bits of the exponent 73 is uniquely determined, as well.
  • the index relating to the canonical string as stored in said exponent 73 is the one having all of the bits equal to "0".
  • the method provides for creating a compressed string 74 with a size X by juxtaposition of a sub-string 75 for storing the size L of the input binary string 69 and of the ordered assembly of compressed sub-strings 71.
  • said sub-string 75 is not compressed and preferably comprises always the same number of bits.
  • said compressed string 74 is in turn subjected to compression, as it is shown in Figure 12, with exclusion of said sub-string 75 that remains un-compressed and is also part of the further string generated by the second iteration of the compression procedure.
  • the compression method of Figure 12 can be iterated as long as the size XEN D of the last compressed string appears to be not greater than a maximum pre-established value D, selectable by an operator.
  • the de-compression method For each compressed sub-string 71 , the de-compression method according to the above ninth embodiment of the compression method, automatically computers, by reading the numeric value N contained in the mantissa 72, the number of the corresponding Fibonacci representations and, should such number be higher than 1 , and, by reading the binary value of said exponent 73, it identifies which Fibonacci representation, between the canonical and the redundant ones, ought to be allotted to the de-compressed sub-string 70.
  • such identification can be realised by means of a suitable processing operation following under the possibilities of a person skilled in the art, based upon the teaching of this invention, or by directly reading a table structured in order that the mantissa 72 and the exponent 73 furnish the address value of the item of the table in which the specific Fibonacci string to be allotted to the de-compressed sub-string 70 is stored.
  • a tenth embodiment of the compression method according to this invention is based upon definition of a pre-established order of all the canonical and redundant strings of the Fibonacci representation of each numeric value N, so as to establish a redundancy order of the strings.
  • the canonical strings corresponds to the first redundancy order.
  • the input binary string to be compressed having a size L, is subdivided into sub-strings each comprising n bits. Should the dimension L of the input binary string be not a multiple of n, the last substring is filled with a tail of bits equal to "0".
  • the method performs a first iteration in which it compresses all strings corresponding to the first redundancy order and stores information relating to their position in the input binary string (for instance, the serial index of the sub-string within the input binary string).
  • the- number of sub-strings corresponding to the first redundancy order that have been all compressed is stored. Those portions of the input string not including sub-strings corresponding to the first redundancy order are juxtaposed to one another in a first reject string.
  • the method performs a second iteration in which it compresses all strings corresponding to the second redundancy order and stores information relating to their position in the first reject string (for instance, the serial index of the sub-string within the first reject string).
  • the number of sub-strings corresponding to the second redundancy order that have been all compressed is stored.
  • Those portions of the reject string not including substrings corresponding to the second redundancy order are juxtaposed to one another in a second reject string.
  • the method again performs further similar iterations, in each of which it compresses all of the sub-strings corresponding to a further redundancy order.
  • the method performa all of the iterations up to the last redundancy order or it is terminated as soon as all of the sub-strings into which the input binary string had been subdivided are compressed (and, therefore, the last generated reject string is void).
  • the last iteration does not store the information relating to the position of the sub-string that are being compressed within the reject string generated by the preceding iteration, due to the fact that, since all of the sub-strings are stored, it is only sufficient to know their number.
  • the compressed output data binary string comprises, for each iteration, the compressed sub-strings and all information in respect of their numeber and of the positions (with exclusion of the last iteration) of the starting sub-strings.
  • the inventor in some laboratory lests, the inventor ascertained the possibility to compress an input data binary string having a size L to an output binary string having a size D, with a very high compression ratio, defined as between the bit amount saved in the compressed string and the size of the input string.
  • the compression method according to this invention is adapted to compress in the same way input binary strings of any type, without applying compression optimization techniques specifically conceived for a particular file type, as it occurs in presently most generally adopted conventional compression methods.
  • the software and/or hardware implementation of this invention turn out to be extremely efficient and substantially rapid.
  • the compression method according to this inventin allows to store, upon compression, large data amounts under an extremely restricted and freely selective memory occupation. This enables for instance stationery or movement image sequences to be stored without information loss (lossless) on memory media of limited capability (for instance movie films presently recorded on DVD, upon compression by the method according to this invention, could be stored on a single CD- ROM).
  • the compression method allows to transmit large data amounts upon compression, in short times on channels of restricted capability, thereby achieving a very noticeable cost reduction.
  • This could allow to transmit for instance television channel in real time on the Internet network , without image degradation (lossless), thereby also realizing interactive channels, such as Video on Demand.
  • the concerned method could also allow the cellular radiotelephones to be connected in real time and at low cost to the Intemet network.
  • the present invention could also be applied to cryptographying information and/or messages, by suitably processing the concerned data during compression (for instance by performing a binary arithmetic operation on at least a portion of the string to be compressed, before, during or at the end of the compression procedure).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Devices For Executing Special Programs (AREA)
  • Preparation Of Compounds By Using Micro-Organisms (AREA)
  • Holo Graphy (AREA)

Abstract

This invention relates to a method for numerical representation particularly advantageously applicable to storage of data and to transmit and receive operations of signals modulated by digital data and adapted to minimize by a selective rate the data amount, under maintainment of their integrity.

Description

METHOD FOR NUMERICAL COMPRESSION AND DECOMPRESSION OF BINARY DATA
This broadly relates to a method for numerical representation that can be advantageously applied to a method for compression and decompression of digital data, while allowing a minimization of selectable degree of the data amount and while maintaining their integrity.
It is known that one of the main problems in the computer technology and, more broadly, in the telecommunication technology, lies in the even increasing amount of data to be processed.
This entails a heavy exploitation of computer readable memories, such as removable (for instance CD-ROMS and floppy disks) or fixed (so-called computer Hard Disks) memory medium as well as an extended occupation of the telecommunication networks during information transmission, which, in turn, entails a higher transmission error probability, a higher transmission cost and a physical limitation to the feasibility of real time specific applications. In this regard, some applications can be mentioned in which transmission channels with limited capability are required for transmission of a noticeable amount of data; in detail, mention can be made of the attempt to realise an interactive television system, known as Video-on-Demand, based upon a twin wire telephone network that, due to intrinsic relevant channel limitations, is necessarily bound to transmit a lower data amount, thereby jeopardising the television image resolution. The present numeric representation of digital data, namely the binary representation, is believed to be the most efficient and reliable.
When it is considered that the amount of information pieces stored in computers and/or exchanged through telecommunication networks is at present rapidly increasing, also due to the strong thrust exerted by the Internet Informatic Network extensively utilising information comprising large data amounts (such as the digital images), the problem of reducing the amount of data representing both information and application programs appears to be extremely critic.
Many approaches have been developed to solve the above mentioned problem, providing for encoding data represented in binary format, according to suitable methods, in order to reduce the memory occupancy. Such encoding methods are usually particularly advantageous when they are applied to specific data types to be encoded, with specific characteristics. In other words, each individual encoding method turns out to be more or less advantageous according to whether it is applied for instance to data representing stationary images or to data representing video images or to data representing sounds. The encoding methods can be classified based upon congruence between decoded data and original data or based upon fixed or variable length representation of original data and encoded data.
The first classification type divides the concerned encoding methods into methods having no information loss or "lossless" methods, in which the data reconstructed or decoded from the encoded data are identical to the original ones, and methods having information losses or "lossy" methods, in which the reconstructed data lose a portion of the original data information. Examples of lossless methods are the Run Lenght Encoding (RLE), the Huffman encoding method and the Lempel- Ziv-Welch or LZW encoding method; an example of lossy method is the Coarser Sampling and/or Quantization or CS&Q method.
According to the second classification type, the RLE and LZW encoding methods entail variable length original data and fixed length encoded data, the Huffman encoding method entails fixed length original data and variable length encoded data, the CS&Q encoding method entails both original data and encoded data with fixed length.
However, just because each encoding method is purposedly designed in connection with a specific type of data to be encoded, newer and newer encoding requirements for data having particular characteristics are being encountered.
Furthermore, the search of improved encoding methods aimed at even more compressing the data to be stored and/or transmitted is being even more developed.
The approach according to this invention is to be considered in this context.
It is an object of this invention, therefore, to provide a method for numeric representation that is valid for any kind of data, is available to a "lossless" compression and decompression method for digital data, while it enables the data amount to be selectively minimised. It is specific subject matter of this invention a compression method for compressing an input data binary string , having a number i of bits, to a compressed output data binary string, having a number ^ of bits, characterized in that at least one sub-string a~_xan_2...axaQ (1, 46, 70), having a number n of bits, of the input binary "string is construed by assigning a whole numeric value N equal to the sum of the items of a monotonic increasing succession 5' = {J0,J'1,J2,...} of whole numbers, among the first n items of such succession S, whose corresponding at is equal to u1", according to formula
N = an_x-sn_x + aπ_2-sπ_2+... + ax-sx+a0-s0 = ∑a,-s,
(=0 and, for each sub-string an_lan_2..Mlaϋ, a compressed binary sub-string dm_xdm_2...dxd0 is created, comprising m bits, in which the binary representation of said whole numeric value N, as allotted to the corresponding sub-string an_xan_2..Mxa0, is stored, the binary representation of N being furnished by formula m-\
N = dm_ .2m-l +dm_2.2m-2+... + dx-2l +d0-2°=∑di-2', ι=0 said input data binary string comprising, for each sub-string an_xan_2..Ma0, the corresponding compressed binary sub-string dm_xdm_2..AxdQ and the data of said input binary string lacking of said at least one sub-string an Xan_2..£txaQ, the ratio Rk=—-, where £ = 1,2,...,
between two consecutive items of said succession S, fulfilling the condition expressed by formula Rk <2 where k ≥ q ≥ 1 the number n of bits of said at least one sub-string anxan_2..nxa0 being in the range between a minimum value n^ and the number L of bits included in said input data binary string, according to formula: ^≤n≤L , the minimum value nmin being equal to the minimum value of n that fulfils the following condition:
Figure imgf000004_0001
where the function y = intsup[ ] returns the minimum wlole value not lower than x (y≥x).
In particular, according to the invention, the first item ^0 of said succession S is equal to 1 (_?„ =1), while the second item sx of said succession S is equal to 2 (s, =2). Again according to this invention, the__ ratio Rk between two consecutive items of said succession 5 trends to a constant value R when said index k increases, according to formula lim Rk = R k-y∞ Further according to this invention, said ratio Rk between two consecutive items of said succession S is never higher than 2, or
Rk≤2 where k>\ .
Again according to this invention, starting from the (r + l)-th item, or, for k≥r, each item sk of said succession S is equal to a polynomial of the p preceding items, where l≤p≤r, according to formula
P sk=∑e -sk-h peτ k≥r≥p where the p coefficients eh, where h = l,2,...,ρ, are constant positive, negative or zero whole numeric values. In particular, the succession S is defined by the following formula:
SQ =1
^Fώ — \So>S >S2>—) ~ sx =2 sk = sk_x + sk_2 where k ≥ 2
Preferably, according to this invention, n > 10 or n ≥ 13. The method according to this invention can comprise: - an initial step in which the information relating to the number L of bits of said input data binary string is stored;
- a subsequent step in which the input binary string is allotted to an auxiliary string designated as "CURRENT STRING";
- a loop of steps comprising in this order: - a compression block to compress the CURRENT
STRING to a second auxiliary string designated as "COMPRESSED STRING";
- a check step to check whether said CURRENT STRING has been effectively compressed; - a check step, performed when the result of the preceding check step (7) is positive, to check whether said COMPRESSED STRING has a size greater than a pre-established value D , where D < L , - an allotment step, performed when the result of the preceding check step is positive, to allot COMPRESSED STRING to CURRENT STRING, and subsequent repetition of the step loop, starting from said compression block; - a check step, performed when the result of one of the two preceding check steps is negative, to check whether the size of, the juxtaposition of the information concerning the size L and of the COMPRESSED STRING is smaller than L ;
- an allotment step, performed when the result of the preceding check step that checks the size of the juxtaposition is positive, to allot the juxtaposition of the information relating to size L and of the COMPRESSED STRING to the output data binary string; and
- an allotment step, performed when the result of the preceding check step that checks the size of the juxtaposition is negative, to allot the input data binary string to the compressed output data binary string.
In particular, the information concerning the number! of bits of the input data binary string is stored by a pre-established number t of bits.
According to a first embodiment of this invention, said step block for compressing said CURRENT STRING to said COMPRESSED
STRING comprises the following steps: τ.. subdividing said CURRENT STRING into / sub-strings comprising n bits, where n ≥ n^ , and
- scanning said sub-strings at least once. Preferably, according to this invention, said step block for compressing said CURRENT STRING to said COMPRESSED STRING, when the size W of said CURRENT STRING is not a multiple of n , fills at least a sub-string with a tail of bits equal to "0".
Furthermore, said step block for compressing said CURRENT STRING to said COMPRESSED STRING, when the size W of said
CURRENT STRING is not a multiple of n , fills the last sub-string with a tail of bits equal to "0".
Again according to this invention, said block for compressing said CURRENT STRING to said COMPRESSED STRING, for each sub- string not comprising two consecutive bits equal to "1", designated as canonical sub-string, and not successive to an other canonical sub-string, in the scanning order, creates a corresponding compressed binary substring dm_xdm_2...d d0 .
Additionally, said block for compressing said CURRENT STRING to said COMPRESSED STRING, for each sub-string not comprising two consecutive bits equal to "1", designated as canonical substring, creates a corresponding compressed binary sub-string dm_xdm_2...d dύ .
In particular, said block for compressing said CURRENT
STRING to said COMPRESSED STRING, performs a processing operation on each sub-string comprising at least two consecutive bits equal to "1", designated as redundant or not canonical sub-string, and not successive in the scanning order to an other sub-string for which a compressed binary sub-string has been created, and, when the sub-string obtained by processing said redundant sub-string is canonical, creates a compressed binary sub-string dm_xdm_2...dxdQ corresponding to said processed sub-string.
Additionally, said block for compressing said CURRENT
STRING to said COMPRESSED STRING, performs a processing operation on each sub-string comprising at least two consecutive bits equal to "1", designated as redundant or not canonical sub-string, and, when the sub-string obtained by processing said redundant sub-string is canonical, creates a compressed binary sub-string dm_xdm_2...dxd0 corresponding to said processed sub-string.
Furthermore, said block for compressing said CURRENT STRING to said COMPRESSED STRING performs said processing operation during the same scan of the / sub-strings in which it creates the compressed binary sub-strings corresponding to the canonical sub-strings.
Again according- to this invention, said block for compressing said CURRENT STRING to said COMPRESSED STRING performs said processing operation in a scan of the / sub-strings subsequent to the scan during which it creates the compressed binary sub-strings corresponding to the canonical sub-strings.
Again according to this invention, said compression block performs said processing operation for each redundant or not canonical sub-string that is not adjacent , in the scanning order, to another sub-string for which a compressed binary sub-string has been created. In particular, said processing operation can include a logic NOT operation.
Furthermore, said processing operation can include a logic
XOR operation with at least one mask or a logic XOR operation with a mask, comprising a number r of bits not higher than n (r ≤ n ), which mask is defined as the one that makes the maximum number of redundant sub-strings to be processed canonical.
Again particularly, said processing operation can comprise a binary arithmetic operation, preferably performed by means of at least a binary constant, comprising a number r of bits not higher than n (r ≤ n ).
Again according to this invention, said block for compressing said CURRENT STRING to said COMPRESSED STRING also creates a header string comprising, for each of the / sub-strings into which said
CURRENT STRING is subdivided, an assembly of bits which indicates whether the corresponding sub-string of the CURRENT STRING has been compressed and/or whether the corresponding sub-string of the
CURRENT STRING has been compressed after having been processed and/or the processing type performed on the corresponding sub-string of the CURRENT STRING. In particular, the header string comprises / bits, each of which uniquely corresponds to a sub-string of the CURRENT STRING and it is equal to "1", if the corresponding sub-string is compressed, or it is equal to
"0", if the corresponding sub-string is not compressed.
Further according to this invention, the header string comprises, for each sub-string of said CURRENT STRING that is compressed after having been processed, at least a corresponding bit to indicate the processing type performed on the corresponding sub-string.
In a particular embodiment of the method according to this invention, the header string further comprises said at least one mask. In an other particular embodiment of the method according to this invention, the header string further comprises said at least one binary constant.
In particular, the block for compressing said CURRENT
STRING to said COMPRESSED STRING also compresses said header string.
Still more particularly, said compression step block compresses at least one sub-string an^an,_2...axa0 , having a number ri of bits, where ri≤ I , of the header string according to the method , in which the succession S is defined by the following formula: s0 = 1
S ~ Spib ~ i S0 ' S\ > S72 ,... X - sx = 2 k = sk_ι + sk_2 where k > 2 and particularly with = n . Again according to this invention, said compression block compresses at least one sub-string an._xan,_2...axaQ > having a number of bits, where ri≤ I , of the header string according to the Run Length
Encoding (RLE) method.
Further according to this invention, a flag conmprising one or more bits is inserted ahead of or following to said COMPRESSED
STRING, whose binary value indicates the compression type of the header string.
In a further embodiment of the method according to this invention, the block for compressing said CURRENT STRING to a COMPRESSED STRING comprises:
- a first step iteration, in which a scan of the / sub-strings into which the CURRENT STRING is subdivided is effected and during which , for each sub-string not comprising two consecutive bits equal to
T, designated as canonical sub-string, a corresponding compressed binary string dm_ dm_2...dxd0 is created, a first header string being also created during such scan and comprising, for each of said / sub-string into which said CURRENT STRING is subdivided, a bit that is equal to "1", if the corresponding sub-string is compressed, or a bit that is equal to "0", if the corresponding sub-string is not compressed, and - one or more further step iterations, in which a processing operation is performed on each sub-string in respect of which, during the preceding iteration, no corresponding compressed binary sub-string dm^dm_2...d d0 has been created, and, when the sub-string as furnished by said processing operation is canonical, a compressed binary sub-string dm_xdm_2..dxd0 corresponding to the processed sub-string, is created; during each further iteration, a corresponding header string is created which comprises, for each sub-string in connection with which no corresponding compressed binary sub-string dm_xdm_2...dxd0 has been created, a bit that is equal to "1", if the corresponding sub-string has been compressed after having been processed, or a bit That is equal to "0", if the corresponding sub-string is not compressed after having been processed.
In particular, said processing operation comprises a logic NOT and/or a logic XOR with at least one mask and/or a logic XOR with at least one mask including a number r of bits not higher than n (r ≤ n ), which is designated as the mask that makes the maximum number of sub-strings, in respect of which no corresponding compressed binary sub-string dm-\dm_2--d d0 was created during the preceding iteration, canonical.
Further according to this invention, said header string further comprises said at least one mask.
Again according to this invention, that said processing operation comprises a binary arithmetic operation, particularly performed with at least one binary constant comprising a number r of bits not higher than n ( r ≤ n ). Furthermore, said header string can comprise said at least one binary constant.
Again according to this invention, said step block for compressing said CURRENT STRING to said COMPRESSED STRING also compresses the first header string and/or at least one of said further header strings.
In particular, said compression block compresses the first header string and/or at least one of said further header strings according to the method in which said compression block compresses at least one sub-string an,_xan,_2...axa0 , having a number ri of bits, where ri≤ I , of the header string according to the method , in which the succession 5 is defined by the following formula:
Figure imgf000010_0001
l + Sk-2 where k ≥ 2 and particularly with ri= n .
In further embodiment according to this invention, said block for compressing said CURRENT STRING to said COMPRESSED STRING comprises: a) a first iteration of steps, in which:
- a first scan of the CURRENT STRING is performed by means of a first window (59) having a size nn ≥ n^n not higher than a maximum value WD , said first window scanning said CURRENT STRING by shifting itself by a bit pitch WS in the range of M WD (1 < WSX < WD ),
- each time said first window identifies a sub-string not comprising two consecutive bits equal to "1", designated as canonical sub- string C having a size n , an index that identifies the position of said canonical sub-string C within said CURRENT STRING is stored and said canonical sub-string C is compressed to a compressed binary substring according to the Fibonacci compression procedure,
- at the end of the scan, the number Gx of canonical sub- strings C„u that have been compressed and those portions of the
CURRENT STRING not belonging to canonical sub-strings C having a size n x , are juxtaposed to one another in a first reject string, and b) one or more further steps in which
- a scan of the reject string furnished by the preceding iteration is performed by means of a corresponding further window having a progressively decreasing size nlg < «lg_, , said further window scanning the concerned reject string by shifting itself by a bit pitch WSg in the range of 1 \o WSg_x (\ ≤ WSg < WSg x ),
- each time said first windows identifies a canonical sub- string
Cng having a size nXg , an index that identifies the position of said canonical sub-string Cng within said reject string furnished by said preceding iteration is stored and said canonical sub-string Cng is compressed to a compressed binary sub-string according to the Fibonacci procedure,
- at the end of the scan, the number Gg of canonical substrings Cng that have been compressed and those portions of the reject string furnished by the preceding iteration, not belonging to canonical substrings Cng having a size nXg , are juxtaposed to one another in a corresponding further reject string, the iteration of the steps being terminated when
- the latest generated reject string is void, or
- the latest generated reject string is too small to be effectively compressed, or - the size nXg of the last scanning window is equal to
("min " 1) . said COMPRESSED STRING comprising:
- the number F of scans performed up to the latest scan during which an effective compression operation has been performed,
- the reject string generated by the latest iteration F , and - for each scan g , where g = \,...,F :
- the number Gg of canonical sub-strings C that have been compressed,
- for each canonical sub-string C :
- the index igs (where s = \,...,Gg ) identifying the position of the canonical sub-string within the reject string generated by the preceding iteration (g-l), and
- the compressed sub-string SCgs (where ^ = l,...,Gg ).
In particular, said CURRENT STRING has a size not greater than a maximum value M and preferably =1024. Again according to this invention, WD < M and preferably
WD = 64.
Again according to this invention, nXg = nXg_x -I .
Further according to this invention, WSg = WSg_x . In particular, according to this invention, WSx = l . Preferably according to this invention, said block for compressing said CURRENT STRING to said COMPRESSED STRING comprises, preliminarly to said first iteration of steps, a processing operation of said CURRENT STRING.
In a further embodiment of the mothod according to this invention, said block for compressing said CURRENT STRING to said COMPRESSED STRING comprises a first step for counting the number P of bits equal to "1" occurring in said CURRENT STRING.
In particular, when said number P fulfils the following condition
P (,
< 1 -—
L l J an extended string is created starting from the CURRENT STRING by juxtaposing a bit "0" to each of said P bits equal to "1" .
Further according to this invention, when said number P fulfils the following condition
P (. m^ — >
L v a logic NOT operation is performed on said current string and an extended string is created starting from the string generated by said not operation by juxtaposing a bit "0" to each bit equal to "1" .
In a further embodiment of the method according to this invention, said block for compressing said CURRENT STRING to said COMPRESSED STRING comprises performing a logic XOR operation on said CURRENT STRING by means of at least one mask comprising a number r of bits not higher than L (r ≤ L ), designed in order that the string generated by said XOR operation fulfils the following condition
Figure imgf000013_0001
and subsequently creating an extended string starting from the string generated by said xor operation by juxtaposing a bit "0" to each bit equal to "1 ".
In a further embodiment of the method according to this invention, in the frame of said block for compressing said CURRENT STRING to said COMPRESSED STRING, each of said / sub-strings, into which said CURRENT STRING is subdivided is compressed to a compressed sub-string including a first portion, designated as "mantissa", comprising a number m of bits, furnished by the method according to the Fibonacci compression procedure, and a second portion, designated as "exponent", comprising a number z of bits, that is variable as the mantissa varies, where z > 0 and equal to the number of bits needed for representing the number of n-bit strings to which the same whole numeric value N corresponds, when they are construed by means of the succession according to the Fibonacci compression procedure, said compression block further providing for pre-establishing an order of all of the 77 -bit strings, to which the same whole numeric value N corresponds, and for the exponent to identify the index of the redundant representation corresponding to the compressed sub-string, said COMPRESSED STRING comprising said compressed sub-strings.
In particular, according to this invention, when the number of n- bit strings to which the same whole numeric value iV corresponds, when they are construed by means of the succession according to the Fibonacci compression procedure,, is higher than 1 , the string not comprising two consecutive bits equal to "1", designated as canonical string, is expressed by said exponent by means of ∑ bits equal to "0". Again according to this invention, said" block for compressing said CURRENT STRING to said COMPRESSED "STRING can comprise the following steps:
- providing a redundancy ordering of all of said « -bit strings to which the same whole numeric value N corresponds, when they are construed by means of the succession according to Fibonacci, said string redundancy ordering including a first and a second redundancy order,
- performing a first step iteration comprising:
- compressing all of the sub-strings corresponding to the first redundancy order and storing information concerning their position within the input binary string
- forming a first reject string by juxtaposing those portions of said input binary string not comprising sub-strings corresponding to the first redundancy order to one another, - performing a set of further step iterations, each in respect of a corresponding further redundancy order, each further iteration comprising:
- compressing all of the sub-strings corresponding to the further redundancy order and storing information concerning their position within the reject string furnished by the preceding iteration,
- forming a further reject string by juxtaposing those portions of said reject string furnished by said preceding iteration not comprising sub-strings corresponding to the further redundancy order to one another, - forming said COMPRESSED STRING by juxtaposing at least the following data for each iteration:
- the number of compressed sub-strings,
- the compressed sub-strings, and for each iteration with exclusion of the last one: - information concerning the positions of the compressed sub-strings within said input binary string or within said reject string furnished by said preceding iteration.
In particular, the method can be terminated as soon as all of the sub-strings into which the input binary string was subdivided are compressed.
Preferably, according to this invention, the n-b\\ strings construed according the Fibonacci succession, not comprising two consecutive bits equal to "1" and designated as canonical strings, bolong to the first redundancy order.
This invention further concerns a method for decompression of a compressed binary string characterized in that said compressed binary string is generated starting from a data binary string comprising a number L of bits, by means of the descriobed compression method.
This invention also covers an electronic apparatus comprising at least a central processing unit and at least a memory unit, characterized in that it performs the compression method as above described, as well as an electronic apparatus comprising at least a central processing unit and at least a memory unit, characterized in that it performs the described decompression method.
It is further subject matter of this invention an electric, magnetic or electromagnetic signal modulated by a digital signal comprising at least one data string, wherein said at least one data string is a compressed binary string generated, starting from a data binary string having a number
L of bits, by means of the above compression method.
This invention further describes and claims a memory medium readable by a processor containing at least one data string, characterized in that said at least one data string is a compressed binary string generated, starting from a data binary string having a number L of bits, by means of the above described compression method.
Further specific subject matter of this invention is a processor program comprising code means adapted to perform, when they operate on a processor, the herein described and claimed compression method,
• as well as a memory medium readable by a processor, having a program stored therein, characterized in that said program is a processor program as above mentioned.
Again specific subject matter of this invention is a processor program comprising code means adapted to perform, when they operate on a processor, the herein described and claimed decompression method, as well as a memory medium readable by a processor, having a program stored therein, characterized in that said program is a processor program as above described. This invention will be now described by way of illustration, not by way of limitation, according to its preferred embodiments, by particularly referring to the Figures of the annexed drawings, in which: Figure 1 schematically shows a binary_ string compression in which use is made of a new fractional numeric representation;
Figure 2 schematically shows a binary string compression according to a preferred embodiment of the method of this invention; Figure 3 shows a flow diagram of a first embodiment of the method according to this invention;
Figure 4 schematically shows two strings as used and/or processed by the method of Figure 3;
Figure 5 shows a flow diagram of a particular step block of the method of Figure 3;
Figure 6 schematically shows some strings used and/or processed by a second embodiment of the compression method according to this invention.
Figure 7 shows a flow diagram of a particular step block of the method of Figure 6;
Figure 8 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention;
Figure 9 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention;
Figure 10 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention; Figure 11 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention;
Figure 12 schematically shows some strings used and/or processed by a further embodiment of the compression method according to this invention.
In the following description the same reference numerals will be utilised to designate the same items in the Figures.
The starting consideration of this invention relates to the symbolic representation of numerals. At present, the more generalised representation of numerals, as utilised also in representation of digital data, is based upon weighed positional numeration systems. Such systems utilise a limited assembly of elementary symbols {c0 ci ... cb.,}, called "figures", to which a generally progressive numeric value is assigned, whose number b (equal to a positive whole number higher than 1 ) is called "base" of the numeric system. Given a numeral Z, which, for the sake of simplicity, but without loss of generalisation, is assumed as whole and positive, its numeric representation in base b and with n figures is furnished by a string of n symbols, each of which is equal to any one of said b figures and has a different numeric weight as a function of the position which it find itself in. The weights are equal to powers of said base b and the exponent is a function of the position. In other words, given a string of n symbols an-ι an-2 ... a1 a0 , the corresponding numeral Z is given by a polynomial of n addends each of which is equal to the product of the numeric value of the corresponding figure by the corresponding numeric weight: Z = αn_x -bn-' + αn_2 - bn-1 +... + αx -b + α0 - b0 = α, - b' (1 )
As it is known, in the general case of not-whole positive numerals, the decimal portion can be computed by introducing, on the right side of the symbol having the least significant weight, further symbols whose numeric weights are equal to powers of said base b in which the exponent is again function of the position and negative. In the case of negative numerals, various possible approaches exist to account for the sign of the numeral; for instance, the first symbol an.ι can have a significance of sign "+" or "-", or it can have also a negative weight equal to (-bπ~1). In the following specification, it is assumed that the represented numerals are positive numerals and, therefore, the representations of negative numerals (as well as other known representation, different from formula [1], such as the ones based upon mantissa and exponent) will be omitted.
The most popular numeric system is the decimal system, in which the base b is equal to 10.
In the computer and telecommunication technologies, the digital data generally have representations utilising a binary system, in which the base b is equal to 2 and whose two figures are symbols "0" and "1". The generalised use of such binary representation is firstly due to the efficiency and reliability of its implementations, in which the two mentioned figures correspond to only two states of a pre-established physical entity (for instance: absence or presence of a signal, minimum value or maximum value of a voltage). In particular, in the frame of such binary coding, the data can also be construed by means of different numeric systems, such as the octal (base b equal to 8) and hexadecimal (base b equal to 16) systems. Furthermore, particular codes, such as the decimal code represented in binary form or BCD, can exploit the binary system.
The binary /7-figure representation of a numeral, on a /7-bit binary numeral, can also be construed as the sum of powers b'= 2\ where i = 0,1, ...π-1, whose corresponding figure is equal to "1". Only by way of exemplification, the 7-bit binary numeral 1000001 is equal to 100000=26+ 2°= 64 + 1= 65
Two properties of a binary representation significant for comprehension of this invention are the following:
- the maximum positive whoie value that can be represented by a n-bit binary numeral is equal to (2n-1 ), and
- the number of different π-bit binary representations is equal to the number of arrangements with repetitions of 2 items in class n, equal to 2"'
The power succession bk = 2k (where /c=0,1,2...) is an increasing monotonic succession of whole numerals B= {bo, bi, b ■■■} such that bo =1 and the ratio Rk between two subsequent items is a constant equal to base b:
Figure imgf000018_0001
Therefore, a n-bit binary string an-ι an.2 ...
Figure imgf000018_0002
a0 construed according a binary representation, represents a whole numeric value N equal to the sum of the items of succession B, among the first n items, whose corresponding bit a,- is equal to "1". n-l
N = αn_] -bn_ + αn_2 - bn_2 + ...+ αl -bl + 0 - b0 = ∑α, - b, (2)
1=0
Based upon a novel numeric representation, the inventor developed a novel method for compressing digital data which, provided that certain conditions are fulfilled, enables them to be retrieved by a corresponding decompression method adapted to maintain their integrity.
Let us consider a numeric representation, which will be hereinbelow indicated as "fractional representation", in which the elementary symbol assembly again comprises the two binary bits "0" and "1", but whose base b is a non-whole numeral between 1 and 2: 1<b<2
A fractionally represented n-bit numeral F will have a generally not-whole value furnished by formula [1]. In particular, the maximum value Fiw xthat can be represented by a fractionally represented 7-bit numeral F is equal to: ff-l LU _ ι
FUΛX = l b' = -7—. - ,=o o - 1
It is apparent that F x< 2n - 1, namely FMAX is smaller than the maximum, whole and positive value that can be represented by a n-bit binary numeral.
This means that, neglecting the decimal portion, a /7-bit fractionally represented numeric value can be fractionally represented numeric value can be expressed in a binary representation by a m-bit string, in which the number m of bits is not higher than n (m ≤n).
Figure imgf000019_0001
where the function y = intsup [x] furnishes the maximum whole value not smaller than x(y ≥x). In particular, a minimum n value, nm;n , starting from which m is lower than n, for any numeric value that can be represented. m < n for n > nm!n (4)
Furthermore, it is apparent from formula (3) that the greater the n value, the greater is the difference (n-m) between the number of bits of the fractional representation and that of the fractional representation, thereby consequently enabling to achieve a greater reduction Δ = (n-m) of representation bits.
By referring to Figure 1 , it can be observed that this makes a compression of digital data, as represented by means of binary strings and as utilised in computer and telecommunication technologies.
In fact, given a n-bit binary string 1 with n > nmin, in which the bits are designated in the Figure by an index i= 0, 1 , 2, ... , n-1 (such a string can be stored for instance in one or more memory registers, when such string 1 is construed by means of a n-bit fractional representation, a generally non-whole value F is obtained from formula (1). By neglecting the fractional portion of said value F, the whole portion of value F is represented in a binary representation by a m-bit string 21 with m<n, whose bits are indicated in the Figure by an index 7= 0, 1 , 2, ..., m-1 , thereby saving Δ bits. It is, however, apparent that, since the decimal portion of value
F has been disregarded, it is not generally possible to retrieve the starting binary string 1 from the binary string 21 by performing a simple decompression operation in order to inversely follow the compression steps illustrated by referring to Figure 1. More precisely, when it is desired to retrieve the original binary string 1 starting from binary string 2r , it would be necessary, during the compression operation, to maintain further information relating to the decimal portion of value F, whose storage would counterbalance the saving of Δ bits, with possible increase in the number of bits representing the information contained in the starting binary string 1.
The inventor developed a novel numeric representation that can be alternatively utilisabie in stead of the above described fractional representation and enables the original binary string to be retrieved in simple manner, starting from a compressed string, so as to guarantee an effective bit saving.
The method according to this invention utilises the formalism expressed in formula (2) for representing a positive whole numeral, by resorting to an increasing monotonic succession S^fso, Si, s l ...} of whole numerals other than the binary succession B. Preferably s0= 1
Even more preferably,
The generally non-whole ratio Rk = — - (where K = 1 ,2,...)
S k-\
between two subsequent items of succession S is generally variable according to the k index. Obviously, since S is an increasing monotonic succession, said ratio Rk \s always higher than 1 :
Rk> 1 for k > 1 (6) The items Sk (for k= 0, 1 , 2, ...) of succession S according to this invention fulfil the condition that, starting from the (q+1)th item where q ≥ 1, said ratio Rk\s a non-whole numeral lower than 2:
Rk < 2 for k ≥q k ≥ l (7)
Preferably, said ratio Rk trends to a constant value R as said index k increases:
]im Rk = R (8) k→∞
Even more preferably, said ratio Rk\s never higher than 2: Rk <2 fork > 1 (9) Therefore, given a n-bit binary string an.ι an.2 ... a? a0, the compression method according to this invention construes the same by allowing to it a whole numeric value N equal to the sum of the items of succession S, among the first n items, whose corresponding bit a,- is equal to "1" rt-l N = απ_x -s„_ln_2 -s„_2 +... + αl - sl0 - sl> = ∑α s, (10)
;=o
Based upon the property expressed by formula (7), it is apparent that, given a whole numeric value N, the properties expressed by formulae (3) and (4) also apply to the representation according to formula (10). More precisely, given a whole numeric value N represented by a n-bit binary string an.ι an.2 ... a1 a0, according to formula (10), such value N can be represented in a binary representation by a rn-bit binary string dm-ι dm.2 ... d1 d0< whose number of bits is not higher than n. Additionally, a minimum value nmιn exists for n, starting from which m is always lower than n, for any value N. In particular, the higher is the value of n, the greater is the difference (n-m) between the number of bits of the representation according to formula (10) and the number of bits of the binary representation, thereby allowing a consequent even higher saving Δ = (n- m) in the representation bits.
The inventor has developed many methods to establish a succession S whose items Sk (where k= 0, 1 , 2, :..) fulfil the condition set forth by formula (7). Only by way of exemplification, bit not by way of limitation, any item Sk , at least starting from an index r (being k ≥ r) can be equal to a function f adapted to return whole values of p preceding items, where 1 ≤p ≤r.
= /k. \ > Sk- >Sk-P ) per fc ≥ . (11) For instance, function f of formula (11) can be a polynominal of said p preceding items:
Figure imgf000022_0001
where the constant coefficients e, (for h- 1 , 2, ...p) are preferably whole numerals having positive, negative or zero values.
The preferred embodiment of the invention utilises a succession SFib directly stemming from the succession known as "Fibonacci succession", wherein each item, with the exception of at least the first two items ("at least" because different definitions of the Fibonacci succession exist in the literature in respect of the first items), is equal to the sum of the two immediately preceding items. More precisely, the succession utilised in the preferred embodiment of this invention is defined as follows: 0 = 1
S = S Fib
Figure imgf000022_0002
sx = 2 (13)
Sk Sk-\ + Sk-2 per k ≥ 2
In the following description, the representation of a whole numeric value by means of succession SFib according to formula (10) is designed as "Fibonacci representation".
It is immediately apparent that the items of succession SFib fulfil the condition set forth by formula (5) and can be expressed by formula (12) by assuming p = r = 2
Figure imgf000022_0003
It is also immediately apparent that the ratio R between two consecutive items Sk and Sk.ι of succession SFib fulfils the conditions set forth by formula (6), by formula (7) where k > 2 (or where qf = 2), by formula (8) where R = 1 , 61803... and by formula (9).
Figure imgf000022_0004
26 196418
27 317811
28 514229
29 832040
30 1346269
31 2178309
32 3524578
33 5702887
34 9227465
35 14930352
36 24157817
37 39088169
38 63245986
39 1.02E+08
40 1.66E+08
41 2.68E+08
Figure imgf000023_0001
42 4.33E+08
Figure imgf000023_0002
Table la
Tables la and lb evidence, under variation of the number n of bits of a binary string an.ι an.2 ... a1 a0by which a whole numeric value N is represented by the Fibonacci succession, item Sk of succession S t corresponding to the most significant bit an.ι (Sn-ι), the maximum whole value NpibM x that can be represented by formula (10) as well as the number m of bits of the binary string means dm-ι dm.2 ... di do by which NFibMAx can be represented by means of a binary representation. In particular, Table la and Table lb are related to values of n variable from 1 to 42 and from 43 to 64, respectively. The minimum value nmin of formula (4) is equal to 7 (n-n = 7) and it will be apparent that, when n increases, the difference Δ = (n-m) between the number of bits of the Fibonacci representation and the number of bits of the binary representation increases, as well.
Figure imgf000023_0003
437,01E+0 441.13E+09 451.84E+09 462.97E+09 474,81 E+09 487.78E+09 491.26E+10 502.04E+10 51 3.3E+10 525.33E+10
Figure imgf000024_0001
538.63E+10
Figure imgf000024_0002
Figure imgf000024_0003
Table lb
By referring to Figure 2, given a n-bit binary string 1 , where n ≥ 7, whose bits are marked in the Figure by an index / = 0, 1 , 2, ... , n-1 , when such string 1 is construed by means of a n-bit Fibonacci representation, one obtains a whole numeric value N, given formula (10), that can be represented in a binary representation by a n-bit string 2, whose bits are marked in Figure 2 by an index j= 0, 1, 2, ..., m-1. In particular, the number m of bits of binary string 2 is equal to the number of bits of the binary representation of the maximum whole value NFib MAx that can be represented by the Fibonacci representation. As above said, when the number n of bits of the starting binary string 1 increases, a higher saving of Δ bits is achieved in the compressed binary string 2 and, therefore, a higher compression is performed. On the other hand, value Δ being the same, it is convenient that said number n of bits be minimum, so as to achieve the maximum compression ratio CR. n — m m
= 1 - (14) n n
In particular, Table II, that can be derived from Tables la and lb, evidences for each value Δ, the most convenient number n of bits, when n varies in the range nmiπ = 6 to 64.
Figure imgf000024_0004
Figure imgf000025_0003
Figure imgf000025_0001
Figure imgf000025_0004
Table II
Anyway, since the number of different n-bit binary strings is equal to the number of dispositions with repetitions of 2 items of class n, equal to 2", while the number of values that can be represented by a n-bit Fibonacci representation is equal to (NF;b MAX + 1) or is lower than 2" , some numeric values N can be represented by a Fibonacci representation by more than one string. This is apparent from formula (13) which evidences that a binary string "100" as construed by a Fibonacci representation furnishes the same numeric value as binary string "011". In the following description, the binary strings construed by the Fibonacci representation are designed as "canonical" strings, when they do not include two consecutive bits equal to "1" (in other words they do not include bit pairs equal to "11"), while they are designed as "non canonical" strings or also "redundant" strings, when they include at least two consecutive bits equal to "1" (in other words, they include at least a bit pair equal to "11").
In particular, given n bits, the number Ncs of canonical strings is equal to
Figure imgf000025_0002
while the number Λ/RSof redundant strings is equal to NRS=2n-NCs
# » = 2" TV s. c (16)
It will be immediately apparent to those skilled in the art to modify the method according to the invention by considering other strings as canonical strings, including also strings comprising at least a bit pair equal to "11".
It will additionally be immediately apparent to those skilled in the art to identify also by means of processing methods the canonical string and any redundant strings for each numeric value N that can be represented by a n-bit Fibonacci representation.
Therefore, by referring again to Figure 2, during a decompression operation, given a compressed binary string 2, the starting binary string 1 not always can be unequivocally ascertained without furnishing further information that enable to identify which Fibonacci string, taken among the various possible ones, corresponds to said numeric value N. In particular, the most convenient number of bits for each value Δ, as set forth in Table II for n variable in the range nm/π= 7 to 64, turns out to the advantageous also in connection with the number of redundant strings, which appears to be minimum (with respect to other values of n corresponding to the same Δ).
The inventor developed various embodiments of the compression and decompression methods according to this invention that account for the possible redundant strings. By referring to Figure 3, it can be observed that the flow chart of the first embodiment of the compression method according to this invention includes a starting step 3 in which the size of the input binary string to be compressed, equal to the number of L bits, is stored. Preferably, the methods stores said size L always with the same number t of bits.
The method includes then a step 4 in which the maximum size D as desired for the compressed binary string is established. Such size D can be established by an operator also by allotting a maximum percentage value of the compressed binary string with respect to the size L of the input binary string.
In a subsequent step 5, the input string is allotted to an auxiliary string designated as "CURRENT STRING".
Subsequently, the method performs a set of steps starting with a compression block 6 wherein the CURRENT STRING is compressed, according to some steps that will be hereinbelow more detailedly described and the compression result is allotted to a second auxiliary string, designated as "COMPRESSED STRING". The method performs then a step 7 wherein it is checked that the CURRENT STRING has been effectively compressed or that the COMPRESSED" STRING has a smaller size than the CURRENT STRING; in the positive, a step 8 is performed to check whether the COMPRESSED STRING has a size greater than D and, in the positive, a step 9 is carried out to allot the COMPRESSED STRING to the CURRENT STRING and, subsequently, the method repeats the loop starting again from the compression block 6.
When the result of step 7 or of step 8 is negative (the CURRENT STRING has not been compressed or the COMPRESSED STRING has a size smaller than or equal to D), the method performs a step 10 to check whether the juxtaposition (designated by operator "&") of the information relating to size L (preferably stored by t bits) and of the COMPRESSE STRING is smaller than L: in the positive, the method performs a step 11 in which the juxtaposition of the information concerning size L and of the COMPRESSED STRING is allotted to an output string; in the negative, the method performs a step 12 wherein the input string is allotted to the output string, because it was not possible to compress such input string. In particular, step corresponding to steps 10, 11 and 12 can be provided also for other embodiments of the compression method according to this invention.
The method performs then a final exiting step 13. Should the method be executed by a processor, the input string, the current string, the compressed string and the output string can be stored in suitable corresponding memory areas. Compression block 6 carries out a compression of the current string by subdividing it into sub-strings each comprising n bits (where n ≥ nmin- 7) and by compressing only the canonical strings, according to the procedure shown in Figure 2, and by avoiding to compress two consecutive sub-strings. Preferably, n > 10; even more preferably, n > 13. Block 6 creates a header string, having a number of bits equal to the number of sub-strings, such that each bit of the header string is equal to "1", if the corresponding sub-string is compressed, otherwise is equal to "0". Lastly, block 6 also compresses the header string, that is certainly canonical, since two consecutive sub-strings are never compressed. More detailedly, by referring to Figures 4 and 5, it can be observed that the compression block 6 performs a starting step 14 wherein the CURRENT STRING 15, comprising W bits, is subdivided into sub-strings each of which comprises n bits. In particular, the number / of sub-strings is given by
Figure imgf000028_0001
In Figure 4, the sub-strings are marked by an index u= 0,1 ,2,.../ -1. Should the size W of the CURRENT STRING 15 be not a multiple of n, the last sub-string is filled by a bit tail equal to "0".
The compression block 6 subsequently performs an initialisation step 16 wherein
- a header string 17 is created comprising I bits, as shown in Figure 4 by index v= 0, 1 , 2, .../ -1 ;
- an auxiliary string, designated as "PENDING CONSTRUCTION STRING" is created and initialised to a null or void string"";
- a first auxiliary pointer variable, designated as "PRECEDING BIT", is initialised to point to a constant having a binary value equal to "0";
- a second auxiliary pointer variable, designated as "CURRENT BIT" is initialised to point to the first bit of the header string; and - the first sub-string of the CURRENT STRING 15 is allotted to an auxiliary variable designated as "CURRENT SUBSTRING". Subsequently, the compression block 6 performs a set of steps whist starts with a step 18 by checking whether the value pointer to by PRECEDENT BIT is equal to "0". In the positive, a subsequent step 19 is carried out in order to check whether the CURRENT SUB-STRING is canonical.
When the result of checking step 19 is positive, a step 20 is performed to compress the CURRENT SUB-STRING according to the procedure shown in Figure 2, henceforth designated as "Fibonacci compression". In particular, the n bits aπ-ι an-2 ... a? a0 of the CURRENT SUB-STRING are construed according to the Fibonacci representation by computing their numeric value N, expressed by formula (10), that is then represented by a m-bit binary representation dm.ι dm.2 ... d1 d0 , that is allotted to an auxiliary variable designated as "COMPRESSED SU- STRING". After execution of step 20, a step 21 is performed to add (by juxtaposition) the COMPRESSED SUB-STRING to the PENDING CONSTRUCTION STRING and a step 22 is performed to allot a binary value "1" to the header string bit pointed to by the CURRENT BIT. When, however, the result of step 18 or of step 19 is negative
(the value pointed to by the PRECEDING BIT is equal to "1" or the CURRENT SUB-STRING is not canonical), the method performs a step 23 to add (by juxtaposition) the CURRENT SUB-STRING to the PENDING CONSTRUCTION STRING as well as a step 24 to allot a binary value "0" to the header string bit pointed to by the CURRENT BIT.
Subsequently both to step 22 and to step 24, a step 25 is performed in order to check whether the CURRENT SUB-STRING was the last sub-string of the CURRENT STRING 15. When the result is positive, a step 26 is performed to compress the header string and a step 27 is performed to allot the juxtaposition of the compressed header string and of the PENDING CONSTRUCTION STRING to the COMPRESSED STRING. Preferably, said step 26 can compress the header string by Run Length Encoding (RLE) or by means of a Fibonacci compression operation, possibly by subdividing the header string into sub-strings comprising a number n' of bits also different from n, by filling the last of them with the necessary zero tail and, preferably, by providing a pre- established number of sub-strings forming the header string. Again, the header string can be compressed both by RLE and by Fibonacci compression, by inserting ahead of the COMPRESSED STRING an indication bit or flag, the value of which indicates the compression type utilised to compress the header string.
Should the result of step 25 be negative, an up-dating step 28 is performed:
- CURRENT BIT is allotted to PRECEDING BIT, - CURRENT BIT is up-dated to point to the subsequent bit of the header string, and
- the subsequent sub-string of CURRENT STRING 15 is allotted to CURRENT SUB-STRING.
In particular, Figure 4 shows the situation relating to the third iteration of the step set in the flow chart of Figure 5.
It will be immediately apparent to those skilled in the art to modify the embodiment of the just above described method when the canonical strings are different from those not comprising pairs of consecutive bits equal to "11": in this case, each bit of the header string could be equal to "0", if the corresponding sub-string is compressed, or equal to "1", if the corresponding sub-string is not compressed. A second embodiment of the compression method according to this invention provides for processing at least a portion of the sub-string of the CURRENT STRING appearing not to be canonical, in order to make them canonical. According to such second embodiment, for each not canonical sub-string subsequent to a not compressed sub-string, a logic NOT operation is performed (by inverting the value of each individual bit) in order to check whether the concerned sub-string becomes canonical and, in the positive, the inverted sub-string is compressed. For each compressed sub-string, a bit pair is stored in the header string: the first bit of the pair is equal to "1", so as to indicate that the concerned sub-string is compressed, while the second bit of the pair is equal to "0", when the substring has not been inverted by said NOT operation, before being compressed, therefore, the header string has a generally not foreseeable number /' > / of bits (/' = / only in the case of no compressed string).
In particular, the above second embodiment provides a slightly different set of steps of the compression block 6 with respect to the one shown in the flow chart of Figure 5.
By referring to Figures 6 and 7, it can be observed that, when the result of the check step 18 is positive, the step set also includes a further check step 19. If the result of the check is positive, a step 19 is performed to allot a binary value "1" to the bit pointed to by the CURRENT BIT, a step 30 is performed to up-date said CURRENT BIT, that is updated so as to point to the subsequent bit of the header string, and a step 31 is performed to allot a binary value "0" to the bit pointed to by the CURRENT BIT. In other words, the considered sub-string of the CURRENT STRING 15 is canonical and can be compressed, under allotment of a binary value "10" to the corresponding bit pair of the header string.
If the result of step 19 is negative, a step 32 is performed as a logic NOT operation on said CURRENT SUB-STRING, whose bits are individually converted from "0" to "1" or from "1" to "0".
Subsequently to step 32, a step 33 is carried out to check that the CURRENT SUB-STRING is canonical. When step 33 furnishes a positive resulf, a step 34 is performed to allot a binary value "1" to the bit of the header "string pointed to by the CURRENT BIT, a step 35 is performed for up-dating the CURRENT BIT, that is up-dated so as to point to the subsequent bit of the header string, and a step 36 is performed to allot a binary value "1" to the bit of the header string pointed to by the CURRENT BIT. In other words, the considered sub-string of the CURRENT STRING 15 becomes canonical after the logic NOT operation and can be compressed, under allotment of a binary value "11" to the corresponding bit pair of the header string. Subsequently both to step 31 and to step 32, a step 20 is performed in order to compress the CURRENT SUB-STRING to a COMPRESSED SUB-STRING, a step 21 is performed in order to add (by juxtaposition) the COMPRESSED SUB-STRING to a PENDING CONSTRUCTION STRING and a step 37 is performed to up-date the PRECEDING BIT, that up-dated so as to point to the bit of the header string that precedes the one pointed to by the CURRENT BIT (in order to point to the first bit of the pair corresponding to the compressed substring).
Should the result of step 33 be negative, a step 38 is performed as a logic NOT operation on the CURRENT SUB-STRING, in order to counteract the NOT operation of step 32 and reversing it to its original contents.
Both in the case the result of step 33 is negative and after step 38 (the value pointed to by the PRECEDING BIT is equal to "1" or the CURRENT SUB-STRING is not canonical and cannot be changed to a canonical one after a logic NOT operation), a step 23 is performed to juxtapose the CURRENT SUB-STRING to the PENDING CONSTRUCTION STRING, a step 24 is performed to allot a binary value "0" to the header string bit pointed to by the CURRENT BIT and step 39 is performed in order to up-date the PRECEDING BIT to which the CURRENT BIT is allotted.
Subsequently both to step 37 and to step 39, a step 25 is performed in order to check whether the CURRENT SUB-STRING were or not the last sub-string of the CURRENT STRING 15. If the result is positive, a step 26 is performed so as to compress the header string and a step 27 is performed in order to allot the juxtaposition of the compressed header string and of PENDING CONSTRUCTION STRING. The header string can also advantageously include the number of sub-strings into which said CURRENT STRING 15 is subdivided.
Should, however, the result of the step 25 be negative, an up- dating step 40 is performed including:
- the CURRENT BIT is up-dated so as to point to the subsequent bit of the header section, and
- the subsequent su-string of the CURRENT STRING 15 is allotted to the CURRENT SUB-STRING. In particular, Figure 6 illustrates the situation relating to the third iteration of the step set of the flow chard of Figure 7. In Figure 6, the canonical sub-strings of the CURRENT STRING 15 are designated by letter C, while the not-canonical or redundant ones are designates by letters Λ/C. Additionally, the sub-strings designated by letter are the ones that cannot be compressed because they are subsequent to a compressed sub-string and, in respect thereof, the result of the check step 18 is negative. It can be observed that the first sub-string is directly compressed, as it is a canonical one, and the corresponding bit pair in the header string has a binary value of "10", the second sub-string has a binary value is not compressed and the corresponding bit in the header string has a value of "0", the third sub-string is compressed after having been subjected to a logic NOT operation, so that the corresponding bit pair in the header string has a binary value of "11".
In a third embodiment of the compression method according to this invention, the step set of the compression block 6 shown in Figure 7 does not include the step 18 aimed at checking whether the value pointed to by the PRECEDING BIT is equal to "0". The reason of this is that, since, in respect of compressed strings, after having subjected them to a logic NOT operation, the header string comprises bit pair equal to "11", the control of step 18 can be considered as quite unnecessary, because the insertion of pairs that make the header string non-canonical is anyway allowed. In such a case, the utilisation of the pointer variable PRECEDING BIT is fruitless. Consequently, step 16 of the compression lock should be modified by climatating the initialisation of the PRECEDING BIT and the step set of Figure 7 does not even include a step 37 and a step 39.
In a fourth embodiment of the compression method according to this invention, the processing operation of at least a portion of the sub- strings of the CURRENT STRING appearing not to be canonical, so as to make them canonical, takes place at the end of the CURRENT STRING scan, in contrast to the second embodiment in which such processing operation occurs sub-string by sub-string during such scan. In other words, said compression block 6 again includes the steps illustrated in the flow chart of Figure 5, but, ahead of step 6 which compresses the header string, a new scan of the PENDING CONSTRUCTION STRING during which:
- any not compressed sub-string not adjacent to compressed sub-strings are located;
- the identified sub-strings are processed, preferably by performing a logic NOT operation;
- if the processed sub-strings are canonical, they are compressed; - the compressed sub-string is substituted for the corresponding original sub-string in the PENDING CONSTRUCTION STRING. In this case and up to the last occurrence of step 25, the header string is the same as that obtained in connection with the first embodiment of the method according to Figures 4 and 5. During the new scan set of the PENDING CONSTRUCTION STRING, a bit for each compressed substring is added to the header string, more specifically a bit equal to "0", if the sub-string has (already) been compressed to its original format, or a bit equal to "1", if the sub-string is compressed after having been processed. If the sub-string is compressed after having been processed, the corresponding bit of the first section of the header string is also converted from "0" to "1".
It can be observed in the example of Figure 8 that the CURRENT STRING 15 comprises both canonical sub-strings C and not canonical sub-strings Λ/C.
At the end of the CURRENT STRING 15 scan, the PENDING
CONSTRUCTION STRING 41 comprises compressed sub-strings CS and not canonical sub-strings NC, while the header string 42 comprises a bit for each sub-string, such bit being equal to "1", if it corresponds to a not canonical (and not compressed) sub-string NC.
During a new scan of the PENDING CONSTRUCTION STRING 41 , a tail 43 of the header string is created so as to have bits corresponding to compressed sub-strings CS; n particular, for each compressed sub-string starting from the original sub-string, or for each bit 80 having a value "1" of the header string 42 as obtained at the end of the CURRENT STRING 15 scan, said tail 43 comprises a bit having a value "0".
Furthermore, during such new scan set, the not canonical substrings 44 and 44' are identified as processable sub-strings, because they are not adjacent to compressed sub-strings CS. In particular, the corresponding bits 45 and 45' of the header string are equal to "0" and are adjacent to preceding or subsequent bits also equal to "0".
The not canonical sub-strings 44 and 44' are subjected to a logic NOT operation and after having been so processed, they can appear to be canonical (as sub-string 46 in Figure 8) or still not canonical (as substring 47 in Figure 8). The sub-string 46 that became canonical after said logic NOT operation are compressed to corresponding sub-strings 48 which are substituted for the corresponding original sub-string 44 in the PENDING CONSTRUCTION STRING 41 , while the corresponding bit 45 of the first section of the header string is converted from "0" to "1" and a corresponding bit 49 having a value "1" is added to the tail portion 43 of the header string.
At the end of the new scan course, the header string 50, obtained as a result of the juxtaposition of the first portion 42' (some bits of which have been possibly converted during the new scan course) and of the tail 43, is compressed. The compressed string, not shown, furnished by the compression block is obtained by juxtaposition of the header string and of the PENDING CONSTRUCTION STRING 41. Alternatively, the first portion 42' of the header string can be separately compressed with respect to the tail portion 43 and the compressed string can be obtained by juxtaposition, at any order, of the first compressed portion of the header string, of the PENDING CONSTRUCTION STRING 41 and of the compressed tail portion of the header string. Again, the compressed substring, can also be separately juxtaposed to the items comprising the compressed string. In a fifth embodiment of the compression method according to this invention, the processing operation of at least some of the sub-string of the CURRENT STRING appearing not to be canonical still takes place at the end of the CURRENT STRING scan, but ajogic XOR operation is performed by means of a purposely computed mask. In particular, the mask comprises a number r of bits not higher than n (where r≤ n) and it is designed as the mask adapted to make the maximum number of not canonical processable sub-strings canonical (or, in other words, not adjacent to compressed sub-strings). In this fifth embodiment of the method, the XOR operation mask is inserted, possibly compressed separately from or together with a portion of the header string, into the compressed string furnished by compression block 6. In a sixth embodiment of the compression method according to this invention, the sub-strings of the CURRENT STRING are compressed, possibly after having been processed in successive iterations in order to make them canonical, without imposing the condition that at least one of two adjacent strings be not compressed. By referring to Figure 9, it can be observed that the CURRENT
STRING 15 comprises canonical sub-string C and not canonical substrings NC.
In the above mentioned sixth embodiment of the method, a first iteration is carried out in order that all canonical sub-strings C are compressed and a first header string 51 is created which comprises a number of bits equal to the number of sub-strings of the CURRENT STRING 15, having each bit equal to "1", if the corresponding sub-string C has been compressed due to the fact that it is a canonical sub-string, or it is equal to "0", if the corresponding sub-string Λ/C has not been compressed, due to the fact that it is a not canonical sub-string.
According to this method, a second iteration is subsequently carried out in which the not canonical sub-strings NC of the CURRENT STRING 15 are subjected to a logic XOR operation 52 by means of a mask M-i designed so as to make the maximum number of sub-strings Λ/C canonical. In particular, said mask M-i comprises a number r of bits not higher than the number n of bits comprising the CURRENT STRING 15 (where r≤ n).
The string 53 as obtained by said XOR operation performed on the sub-strings Λ/C of the CURRENT STRING 15 and on the mask 7 comprises canonical sub-strings C and not canonical sub-strings NC. According to this method, all canonical sub-strings C of said string 53 are compressed and the method provides for creating a second header string 54 comprising a number of bits equal to the number of sub-strings of said string 53, similarly to the first header string 51 in respect of the CURRENT STRING 15.
In similar way, the method provides for a third iteration in which the not canonical sub-strings of said string 53 are subjected to a logic XOR operation 55 by means of a r-bit mask M2, designed so as to make the maximum number of not canonical sub-strings Λ/C canonical.
The string 53 as obtained by said XOR operation performed on the sub-strings Λ/C of said string 53 and on the mask M2 comprises canonical sub-strings C and not canonical sub-strings NC. Accordmg to this method, all canonical sub-strings C of string 55 are compressed and the method provides for creating a third header string 57, comprising a number of bits equal to the number of sub-strings of the string 56, similarly to the previous header strings 51 and 54. The iteration number in this method can be pre-established or variable. In particular, according to this method, the iterations can be terminated when the number of still not canonical strings (equal to the number of bit having a value "0" in the lastly generated header string) is lower than a minimum threshold value, depending on the bit saving A for each sub-string as well as on the bit amount needed to store a further possibly compressed header string and a further possibly compressed mask.
A seventh embodiment of the compression method according to this invention provides for a repeatable set of operations aimed at performing a dynamic subdivision of the input binary string to be compressed. Such dynamic subdivision identifies and interactively compresses canonical sub-strings wherever positioned within the input string and having a size, namely a number of bits, progressively decreasing at each iteration, by also storing an index assembly that indicates the position of each sub-string within the input binary string. The method also provides for a possible processing operation of the string obtained at the end of the iterations of each repetition. Since all the indexes indicating the position of each sub-string within the input binary string ought to be stored, it is convenient that this be not longer than a maximum number of bits, by eventually subdividing a very extended data sequence into packets having a length not higher than said maximum bit number. By referring now to the example of Figure 10, let us initially assume that the input data string 58 to be compressed has a length L not greater than the allowed maximum length M. Preferably, M is equal to 1024. The above mentioned seventh embodiment of the compression method scans said string 58 by means of a window 59 having a size nn not greater than a maximum value WD<M. Preferably, nn - WD = 64 and the window 99 scans said string 58 by shifting itself by a bit pitch WS-j in the range of 1 to WD (where 1 < WS-, < WD), even more preferably, WSi = 1.
At each time window 59 identifies a canonical sub-string Cnn, having a size nn, within string 58, an index identifying the position of the canonical sub-string Cmn is stored and said canonical sub-string Cmn is compressed to a sub-string of smaller size, according to the Fibonacci compression procedure. This also entails that nn is not lower than nmm - 7 (where nmm < n-u ≤ WD). Figure 10 shows two canonical sub-strings Cnn having an index in and i12 , respectively, that are compressed to two corresponding sub-strings SC and SC12. Preferably, said indexes in and i12are the address of the first bit of the respective canonical sub-string Cnn within said string 58; even more preferably, upon identifying a canonical sub-string Cn11 , said window 59 starts again scanning from the first bit subsequent to the canonical sub-string Cn11 (in the example of Figure 10, it starts again scanning from bits (in + n ) and (iι2 + n-n)).
At the end of the scan by means of window 59, the number Gi of canonical sub-strings C 1 that have been compressed is stored. These portions 60, 60' and 60" of said string 58 not including canonical substrings Cnn with size nn are then juxtaposed to one another in a reject string (preferably, the juxtaposition is carried out bit during scanning).
The compression method performs a second scanning operation on the reject string 61 by means of a window 62 having a size n12 smaller than nn, provided that it is not again lower than nm/π = 7 (where min≤ 12≤nn). Preferably, nϊ2 = n»- 1. Preferably, said window 62 scans said string 58 by shifting itself with a bit pitch
Figure imgf000037_0001
the range of 1 to WS, (where 1 < WS2< WSi), even more preferably WS2= WSι = 1. Similarly to scanning string 58 by means of the window 59, at each time said window identifies a canonical sub-string Cn12 having a size nι2 within string 61 , an index i2ι and i22 , which identifies the position of said canonical sub-string Cn12 is stored and each canonical sub-string Cn-12 is compressed to a corresponding sub-string SC12 and SC22 , according to the Fibonacci compression procedure.
At the end of the scan by means of window 62, the number G2 of canonical sub-strings Cn12 that have been compressed is stored. These portions 63, 63' and 63" of said string 61 not belonging to canonical substrings Cn12 having a size n12 are juxtaposed to one another in order to form a second reject string 64.
Subsequently, the concerned compression method iterates the scans of the reject strings as obtained from the previous scan, by means of subsequent windows having a progressively decreasing size n-ιg. Preferably, n1g = n1g.-ι - 1. In particular, it is also possible that no canonical sub-.string n1g having a size nig is identified during one or more intermediate iterations; in such case, only the number Ggof canonical sub- strings Cn?g that have been compressed, equal to zero, is stored.
Furthermore, according to this method, at least starting from a specific scan (or from a specific size nig of the scanning window), the canonical sub-strings Cn1g are juxtaposed to one another, so as to form groups comprising at least two of them; then the Fibonacci compression is carried out on the so obtained juxtaposition.
The iterations are terminated when it is no more possible to compress the last generated reject string; this occurs in three cases:
- when the latest generated reject string is void, or when the whole input data string 58 has been compressed, or - when the latest generated reject string is too small to be effectively compressed or the bits added to store Ggand the portion indexes officer the saving (Gg .Δ) that can be achieved by the maximum number of compressable strings, or - when the size n1g = n1Gι f the last scan window by which it has been attempted to identify canonical sub-strings is equal to 6 bits. At the end of the iterations, the method provides for creating a compressed string 65 comprising: - the number F of scans carried out up to the last scan in which an effective compression operation has been performed (such number also accounts for any intermediate possible iterations that have not identified and compressed canonical sub-strings);
- the reject string generated by the last iteration F, and
- for each scan g, where g= 1 , ... , F: - the number Gg of compressed canonical sub-strings,
- for each canonical sub-string Cmιg :
- the index igs- (where S = 1 , ... , Gg) that identifies the position of the canonical sub-string within the reject string generated by preceding iteration (g-1), and - the compressed sub-string SCgs (where S = 1 , ... Gg).
In particular, the various previously listed information items can be stored in the compressed string 65 by juxtaposition according to any pre-established order, preferably with the scan number F positioned at the begin or at the end of the compressed string 65. According to this method, the compressed string 65 is subsequently subjected to a second repetition of the previously described iterations. In particular, the compressed string 65 is scanned by means of a first window having a size n21 not greater than the maximum value WD, preferably n21 = n2ι in similar way, in the iterations subsequent to the first one, the window sizes are preferably equal to the sizes relating to the first repetition (n2g = n1g).
The method provides for performing further repetitions of the iterative scans on the compressed strings as achieved at the end of each repetition. At the end of a repetition, should no iteration succeeded in identifying a canonical sub-string to be compressed, the method provides for processing the compressed string generated by the last repetition in which at least one canonical sub-string has been compressed in at least one iteration. Such processing operation preferably includes: - a logic NOT operation carried out on the whole compressed string, and/or
- a logic XOR operation of at least one portion of the compressed string by means of at least one mask suitably computed in order to maximise the difference between the number of bit pairs equal to "11" which are eliminated and the number of bits pairs equal to "11" which are created, and/or - an operation of binary arithmetics, such as, for instance, the addition of at least one bit lock of the compressed string to at least one constant binary value. The method can also provide for storing a flag indicating the types of the processing operation carried out (in the case it could provide for more than one) and/or of the possible masks of the logic XOR operation and/or of the possible constant binary values and/or of any identification indexes to identify the bit blocks of the compressed string subjected to a processing operation. In this way, the method is terminated when the desired value of the compression ratio CR is reached.
By newly referring to the example of Figure 10, it can be observed that, when the input data sequence 58' to be compressed has a size Y greater than the maximum allowable size M, said sequence 58' is subdivided into data packets 58 having a size L=M, each of which is separately subjected to the seventh embodiment of the just now described. Since, in general, Y is not a multiple of M, the last data packet has a size smaller than M. Eventually, after a pre-established number of repetitions, the method can provide for a juxtaposition of at least two compressed strings belonging to different data packets.
By referring now to Figure 11 , it can be observed that an eighth embodiment of the compression method according to this invention provides for a first counting step aimed at counting the number P of bits having a value "1" included in the input binary string 66 to be compressed, having a size L Subsequently, when the number P is not higher than a suitable threshold value PMAX, an extended string 67 is created from said string 66 by juxtaposition of a bit "0" to each one of the P bits equal to "1"; the extended string 67 has a size (L+P). Lastly, the Fibonacci compression procedure is carried out on said extended string 67, that comprises only canonical sub-strings, in order to generate a complex string 68 having a size X.
The threshold value PMAX is given by the maximum value of P that enables to make
X<L (18) In particular, referring to formula (14), the PMAX value is furnished by the following formula
Figure imgf000041_0001
Therefore, it applies:
Figure imgf000041_0002
In other words, the number P of bits equal to "1" appearing in the input binary string 66 to be compressed ought to be not higher than the following percentage value of size L of the binary string 66. m
— P < 1-- I (21) L
When the number V of bits equal to "0" appearing in the input binary string 66 is not higher than the threshold value PMAX or when the number P of bits equal to "1" is not lower than a value (L- PMAX), the method can provide for a preliminary logic NOT operation carried out on said binary string 66 so as to enable the method of Figure 11 to be applied to the inverted string. Similarly, the method can also provide for a logic XOR operation to be carried out on said binary string 66 by means of mask comprising a number r of bits not higher than L (where r ≤ L), suitably designed so that the string furnished by said XOR operation fulfils condition (12) and consequently the method of Figure 11 is applicable to sit. When the size r of the mask is smaller than or size value L of the input binary string 66, the logic XOR operation can be carried out by subdividing said string 66 into packets including a number r of bits.
In particular, the above mentioned eighth embodiment of the compression method can be applied to a data binary string to be compressed in combination with one or more embodiments.
As previously described, given a n-bit binary string and considered the assembly of numeric values N that can be represented by means of the Fibonacci representation, while all numeric values N are represented by a canonical string, not all of the numeric values N are represented by further redundant strings and, consequently, the number of redundant strings generally varies as the specific numeric value N (among the ones also represented by redundant strings) varies.
A ninth embodiment of the compression method according to the invention exploits this property of the Fibonacci representation.
By referring to Figure 12, it can be observed that the input binary string 69 to be compressed, having a size L, is subdivided into sub- strings 70 each comprising n bits. Should said size L of the binary string be not a multiple of n, the last sub-string is filled with a tail of bits equal to "0".
Each sub-string 70, both canonical and redundant, is compressed by the Fibonacci compression procedure to a sub-string 71 including a first portion 72, designated as "mantissa", comprising a number m of bits fixed in respect of all sub-strings 71 , and a second portion 73, designated as "exponent', comprising a number Z of bits, that is variable as the mantissa 72 varies. The number Z of bits in the exponent 73, where z ≥O, is equal to the number of bits needed for representing the number of redundant strings of the Fibonacci representation of the numeric value N represented by the binary representation 73. In particular, according to the method, the order of all of the canonical and redundant strings of the Fibonacci representation of each numeric value N is pre-established and the exponent 73 identifies the index of the Fibonacci representation furnished by the corresponding sub-string 70.
Starting from the numeric value N furnished by the binary mantissa 72, the number of its possible Fibonacci representations, or the number of any possible redundant strings, appears to be uniquely determined and, therefore, the number Z of bits of the exponent 73 is uniquely determined, as well. In particular, when the numeric value N has one only (canonical) Fibonacci representation, exponent 73 is void (Z = 0). Preferably, when the numeric value N has also at least one redundant Fibonacci representation, the index relating to the canonical string as stored in said exponent 73 is the one having all of the bits equal to "0". The method provides for creating a compressed string 74 with a size X by juxtaposition of a sub-string 75 for storing the size L of the input binary string 69 and of the ordered assembly of compressed sub-strings 71. In particular, said sub-string 75 is not compressed and preferably comprises always the same number of bits. According to this method, said compressed string 74 is in turn subjected to compression, as it is shown in Figure 12, with exclusion of said sub-string 75 that remains un-compressed and is also part of the further string generated by the second iteration of the compression procedure. The compression method of Figure 12 can be iterated as long as the size XEND of the last compressed string appears to be not greater than a maximum pre-established value D, selectable by an operator. Based upon the fact that not all of t re numeric value N are represented, by means of a Fibonacci representation, by further redundant strings and that the number of redundant strings varies as the specific numeric value N varies, it is easy to realise that, mainly when the number n of bits included in said sub-strings 70 varies, the above illustrated ninth embodiment of the concerned compression method has been found to be efficient in view of the fact that the bit saving that can be obtained by means of said sub-strings 71 having a number (m + Z) of bits higher than n. For each compressed sub-string 71 , the de-compression method according to the above ninth embodiment of the compression method, automatically computers, by reading the numeric value N contained in the mantissa 72, the number of the corresponding Fibonacci representations and, should such number be higher than 1 , and, by reading the binary value of said exponent 73, it identifies which Fibonacci representation, between the canonical and the redundant ones, ought to be allotted to the de-compressed sub-string 70. In particular, such identification can be realised by means of a suitable processing operation following under the possibilities of a person skilled in the art, based upon the teaching of this invention, or by directly reading a table structured in order that the mantissa 72 and the exponent 73 furnish the address value of the item of the table in which the specific Fibonacci string to be allotted to the de-compressed sub-string 70 is stored.
A tenth embodiment of the compression method according to this invention is based upon definition of a pre-established order of all the canonical and redundant strings of the Fibonacci representation of each numeric value N, so as to establish a redundancy order of the strings. Preferably, the canonical strings corresponds to the first redundancy order. In particular, the input binary string to be compressed, having a size L, is subdivided into sub-strings each comprising n bits. Should the dimension L of the input binary string be not a multiple of n, the last substring is filled with a tail of bits equal to "0".
Subsequently, the method performs a first iteration in which it compresses all strings corresponding to the first redundancy order and stores information relating to their position in the input binary string (for instance, the serial index of the sub-string within the input binary string). Preferably, at the end of the first iteration, the- number of sub-strings corresponding to the first redundancy order that have been all compressed is stored. Those portions of the input string not including sub-strings corresponding to the first redundancy order are juxtaposed to one another in a first reject string.
Subsequently, the method performs a second iteration in which it compresses all strings corresponding to the second redundancy order and stores information relating to their position in the first reject string (for instance, the serial index of the sub-string within the first reject string). Preferably, at the end of the second iteration, the number of sub-strings corresponding to the second redundancy order that have been all compressed is stored. Those portions of the reject string not including substrings corresponding to the second redundancy order are juxtaposed to one another in a second reject string. The method again performs further similar iterations, in each of which it compresses all of the sub-strings corresponding to a further redundancy order. The method performa all of the iterations up to the last redundancy order or it is terminated as soon as all of the sub-strings into which the input binary string had been subdivided are compressed (and, therefore, the last generated reject string is void). The last iteration does not store the information relating to the position of the sub-string that are being compressed within the reject string generated by the preceding iteration, due to the fact that, since all of the sub-strings are stored, it is only sufficient to know their number. The compressed output data binary string comprises, for each iteration, the compressed sub-strings and all information in respect of their numeber and of the positions (with exclusion of the last iteration) of the starting sub-strings.
Since, by exploiting this invention, it is possible to compress a data sequence up to reaching very small sizes, the advantages achievable by exploitation if this invention will be apparent, particularly in the field of the computer and telecommunication technologies.
In some laboratory lests, the inventor ascertained the possibility to compress an input data binary string having a size L to an output binary string having a size D, with a very high compression ratio, defined as between the bit amount saved in the compressed string and the size of the input string. In particular, the compression method according to this invention is adapted to compress in the same way input binary strings of any type, without applying compression optimization techniques specifically conceived for a particular file type, as it occurs in presently most generally adopted conventional compression methods.
On the other hand, since the methods according to this invention are substantiallly straightforward from a processing view point, the software and/or hardware implementation of this invention turn out to be extremely efficient and substantially rapid. The compression method according to this inventin allows to store, upon compression, large data amounts under an extremely restricted and freely selective memory occupation. This enables for instance stationery or movement image sequences to be stored without information loss (lossless) on memory media of limited capability (for instance movie films presently recorded on DVD, upon compression by the method according to this invention, could be stored on a single CD- ROM).
In similar way, as concerns the telecommunication field, the compression method allows to transmit large data amounts upon compression, in short times on channels of restricted capability, thereby achieving a very noticeable cost reduction. This could allow to transmit for instance television channel in real time on the Internet network , without image degradation (lossless), thereby also realizing interactive channels, such as Video on Demand. The concerned method could also allow the cellular radiotelephones to be connected in real time and at low cost to the Intemet network.
Lastly, the present invention could also be applied to cryptographying information and/or messages, by suitably processing the concerned data during compression (for instance by performing a binary arithmetic operation on at least a portion of the string to be compressed, before, during or at the end of the compression procedure).
The preferred embodiments have been above described and some modifications of this invention have been suggested, but it should be understood that those skilled in the art can make other modifications and changes without departing from the scope of the invention as defined in the following claims.

Claims

1.- A compression method for compressing an input data binary string (15, 58, 58', 69), having a number L of bits, to a compressed output data binary string (65, 68, 74), having a number X of bits, characterized in that at least one sub-string an_an_2..na0 (1, 46, 70), having a number n of bits, of the input binary string is construed by assigning a whole numeric value N equal to the sum of the items of a monotonic increasing succession S = {s0,sl,s2,..} of whole numbers, among the first n items of such succession S, whose corresponding α, is equal to "1", according to formula n-I
N = an_x-sn_x +an_2-sn_2+... + a -sx+a0-s0 =∑α,-J, ι=0 and, for each sub-string an_xan_2..xιλa0, a compressed binary sub-string dm_xdm_2...dxd0 (2, 48, 72) is created, comprising m bits, in which the binary representation of said whole numeric value N, as allotted to the corresponding sub-string aπ_xan_2..nxa0, is stored, the binary representation of N being furnished by formula m-l
N = dm_x -2^+dm_2 -2m~2 +... + dx -2x+d0 -2° =.£«/, -2' ,
;=0 said input data binary string comprising, for each sub-string an__an_2..χιaQ, the corresponding compressed binary sub-string dm_xdm_2..Jxd0 and the data of said input binary string lacking of said at least one sub-string aπ_xan 2..Ma0, the ratio where £ = 1,2,...,
Figure imgf000046_0001
between two consecutive items of said succession S, fulfilling the condition expressed by formula Rk < 2 where k≥q≥l the number n of bits of said at least one sub-string a n-\ a n-z— \ ao being in the range between a minimum value nmm and the number L of bits included in said input data binary string, according to formula: nmn≤n≤L , the minimum value ^ being equal to the minimum value of n that fulfils the following condition:
Figure imgf000046_0002
where the function jμ = intsup r] returns the minimum wlole value not lower than x (y≥x).
2. A method according to claim 1, characterized in that the first item s0 of said succession S is equal to 1 (s0 =1).
3. A method according to claim 2, characterized in that the second item sl of said succession S is equal to 2 (sx =2).
4. A method according to any one of preceding claims, characterized in that said ratio Rk between two consecutive items of said succession S trends to a constant value R when said index k increases, according to formula lim Rk = R
5. A method according to any one of preceding claims, characterized in that said ratio Rk between two consecutive items of said succession S is never higher than 2, or Rk ≤2 nere k≥l ■
6. A method according to any one of preceding claims, characterized in that, starting from the (r + l)-th item, or, for k≥r, each item sk of said succession S is equal to a polynomial of the p preceding items, where l≤p≤r , according to. formula
Figure imgf000047_0001
where the p coefficients eh, where A = 1,2,...,/?, are constant positive, negative or zero whole numeric values.
7. A method according to each one of preceding claims, characterized in that said succession S is defined by the following formula:
Figure imgf000047_0002
+sk-ι here£>2
8. A method- according to claim 7, characterized in that w≥lO.
9. A method according to claim 8, characterized in that n≥\3.
10. A method according to any one of preceding claims, characterized in that it includes: - an initial step (3) in which the information relating to the number L of bits of said input data binary string is stored;
- a subsequent step (5) in which the input binary string is allotted to an auxiliary string designated as "CURRENT STRING"; - a loop of steps comprising in this order:
- a compression block (6) to compress the CURRENT STRING to a second auxiliary string designated as "COMPRESSED STRING";
- a check step (7) to check whether said CURRENT STRING has been effectively compressed;
- a check step (8), performed when the result of the preceding check step (7) is positive, to check whether said COMPRESSED STRING has a size greater than a pre-established value D , where D <L , - an allotment step (9), performed when the result of the preceding check step (8) is positive, to allot COMPRESSED STRING to CURRENT STRING, and subsequent repetition of the step loop, starting from said compression block (6);
- a check step (10), performed when the result of one of the two preceding check steps (7, 8) is negative, to check whether the size of the juxtaposition of the information concerning the size L and of the COMPRESSED STRING is smaller than L ;
- an allotment step (11), performed when the result of the preceding check step (10) that checks the size of the juxtaposition is positive, to allot the juxtaposition of the information relating to size L and of the COMPRESSED STRING to the output data binary string; and
- an allotment step (12), performed when the result of the preceding check step (10) that checks the size of the juxtaposition is negative, to allot the input data binary string to the compressed output data binary string.
11. ' A method according to claim 10, characterized in that the information concerning the number Z of bits of the input data binary string is stored by a pre-established number / of bits.
12. A method according to claim 10 or 11 , when dependant on claim 7, characterized in that said step block (6) for compressing said
CURRENT STRING (15) to said COMPRESSED STRING comprises the following steps: - subdividing said CURRENT STRING (15) into / sub-strings comprising n bits, where n ≥ «mn , and
- scanning said sub-strings at least once.
13. A method according to claim 12, characterized in that said step block (6) for compressing said CURRENT STRING (15) to said
COMPRESSED STRING, when the size W of said CURRENT STRING (15) is not a multiple of n , fills at least a sub-string with a tail of bits equal to "0".
14. A method according to claim 13, characterized in that said step block (6) for compressing said CURRENT STRING (15) to said
COMPRESSED STRING, when the size W of said CURRENT STRING (15) is not a multiple of n , fills the last sub-string with a tail of bits equal to "0".
15. A method according to any one of preceding claims 12 to 14, characterized in that said block (6) for compressing said CURRENT
STRING (15) to said COMPRESSED STRING, for each sub-string not comprising two consecutive bits equal to "1", designated as canonical substring, and not successive to an other canonical sub-string, in the scanning order, creates a corresponding compressed binary sub-string dm_xdm_2..J dQ .
16. A method according to any one of preceding claims 12 to
14, characterized in that said block (6) for compressing said CURRENT
STRING (15) to said COMPRESSED STRING, for each sub-string not comprising two consecutive bits equal to "1", designated as canonical sub- string, creates a corresponding compressed binary sub-string dm-\dm-2...d d0 .
17. A method according to claim 15, characterized in that said block (6) for compressing said CURRENT STRING (15) to said COMPRESSED STRING, performs a processing operation on each sub- string comprising at least two consecutive bits equal to "1", designated as redundant or not canonical sub-string, and not successive in the scanning order to an other sub-string for which a compressed binary sub-string has been created, and, when the sub-string obtained by processing said redundant sub-string is canonical, creates a compressed binary sub-string dm_xdm_2...d\d0 corresponding to said processed sub-string.
18. A method according to claim 16, characterized in that said block (6) for compressing said CURRENT STRING (15) to said COMPRESSED STRING, performs a processing operation on each substring comprising at least two consecutive bits equal to "1", designated as redundant or not canonical sub-string, and, when the sub-string obtained by processing said redundant sub-string is canonical, creates a compressed binary sub-string dm_xdm_2...dxdϋ corresponding to said processed sub-string.
19. A method according to claim 17 or 18, characterized in that said block (6) for compressing said CURRENT STRING (15) to said COMPRESSED STRING performs said processing operation during the same scan of fhe / sub-strings in which it creates the compressed binary sub-strings corresponding to the canonical sub-strings.
20. A method according to claim 17 or 18, characterized in that said block (6) for compressing said CURRENT STRING (15) to said COMPRESSED STRING performs said processing operation in a scan of the I sub-strings subsequent to the scan during which it creates the compressed binary sub-strings corresponding to the canonical sub-strings.
21. A method according to claim 20, characterized in that said compression block (6) performs said processing operation for each redundant or not canonical sub-string that is not adiacent , in the scanning order, to another sub-string for which a compressed binary sub-string has been created.
22. A method according to any one of preceding claims 17 to
21 , characterized in that said processing operation includes a logic NOT operation.
23. A method according to any one of preceding claims 17 to
22, characterized in that said processing operation includes a logic XOR operation with at least one mask.
24. A method according to claim 23, characterized in that said processing operation includes a logic XOR operation with a mask, comprising a number r of bits not higher than n (r ≤ n ), which mask is defined as the one that makes the maximum number of redundant substrings to be processed canonical.
25. A method according to any one of preceding claims 17 to 24, characterized in that said processing operation comprises a binary arithmetic operation.
26. A method according to claim 25, characterized in that said binary arithmetic operation is performed by means of at least a binary constant, comprising a number r of bits not higher than n (r ≤ n ).
27. A method according to any one of preceding claims 15 to 26, characterized in that said block (6) for compressing said CURRENT
STRING to said COMPRESSED STRING also creates a header string comprising, for each of the / sub-strings into which said CURRENT STRING is subdivided, an assembly of bits which indicates whether the corresponding sub-string of the CURRENT STRING has been compressed and/or whether the corresponding sub-string of the CURRENT STRING has been compressed after having been processed and/or the processing type performed on the corresponding sub-string of the CURRENT STRING.
28. A method according to claim 27, characterized in that said header string comprises / bits, each of which uniquely corresponds to a sub-string of the CURRENT STRING and it is equal to "1", if the corresponding sub-string is compressed, or it is equal to "0", if the corresponding sub-string is not compressed.
29. A method according to any one of preceding claims 17 to 28, characterized in that said header string comprises, for each sub-string of said CURRENT STRING that is compressed after having been processed, at least a corresponding bit to indicate the processing type performed on the corresponding sub-string.
30. A method according to any one of preceding claims 27 to 29, when dependant on claim 23, characterized in that said header string further comprises said at least one mask.
31. A method according to any one of preceding claims 27 to
30, when dependant on claim 26, characterized in that said header string further comprises said at least one binary constant.
32. A method according to any one of preceding claims 27 to
31 , characterized in that said block (6) for compressing said CURRENT STRING to said COMPRESSED STRING also compresses said header string.
33. A method according to claim 32, characterized in that said compression step block (6) compresses at least one sub-string αn'_(απ._2..Mlα0 , having a number ri of hits, where ri≤ I , of the header string according to the method of claim 7.
34. A method according to claim 33, characterized in that ri= n .
35. A method according to claim 32, characterized in that said compression block (6) compresses at least one sub-string an._xan._2..MxaQ , having a number ri of bits, where ri≤ I , of the header string according to the Run Length Encoding (RLE) method.
36. A method according to any one of preceding claims 32 to 35, characterized in that a flag conmprising one or more bits is inserted ahead of or following to said COMPRESSED STRING, whose binary value indicates the compression type of the header string.
37. A method according to any one of preceding claims 12 to 14, characterized in that said block (6) for compressing said CURRENT STRING (15) to a COMPRESSED STRING comprises:
- a first step iteration, in which a scan of the sub-strings into which the CURRENT STRING is subdivided is effected and during which , for each sub-string not comprising two consecutive bits equal to
"1", designated as canonical sub-string, a corresponding compressed binary string dm_xdm_2...d dQ is created, a first header string being also created during such scan and comprising, for each of said / sub-string into which said CURRENT STRING is subdivided, a bit that is equal to "1", if the corresponding sub-string is compressed, or a bit that is equal to "0", if the corresponding sub-string is not compressed, and
- one or more further step iterations, in which a processing operation is performed on each sub-string in respect of which, during the preceding iteration, no corresponding compressed binary sub-string dm_ dm_2...dxd0 has been created, and, when the sub-string as furnished by said processing operation is canonical, a compressed binary sub-string dm_ dm_2..d dQ corresponding to the processed sub-string, is created; during each further iteration, a corresponding header string is created which comprises, for each sub-string in connection with which no corresponding compressed binary sub-string dm_xdm_2...d d0 has been created, a bit that is equal to "1", if the corresponding sub-string has been compressed after having been processed, or a bit that is equal to "0", if the corresponding sub-string is not compressed after having been processed.
38. A method according to claim 37, characterized in that said processing operation comprises a logic NOT.
39. A method according to claim 37-or 38, characterized in that said processing operation comprises a logic XOR with at least one mask.
40. A method according to claim 39, characterized in that said processing operation comprises a logic XOR with at least one mask including a number r of bits not higher than n (r ≤ n ), which is designated as the mask that makes the maximum number of sub-strings, in respect of which no corresponding compressed binary sub-string m-\ m-2- xd0 was created during the preceding iteration, canonical.
41. A method according to claim 39 or 40, characterized in that said header string further comprises said at least one mask.
42. A method according to any one of preceding claims 37 to 41 , characterized in that said processing operation comprises a binary arithmetic operation.
43. A method according to claim 42, characterized in that binary arithmetic operation is performed with at least one binary constant comprising a number r of bits not higher than n (r ≤ n ).
44. A method according to claim 43, characterized in that said header string further comprises said at least one binary constant.
45. A method according to any one of preceding claims 37 to
44, characterized in that said step block (6) for compressing said CURRENT STRING to said COMPRESSED STRING also compresses the first header string and/or at least one of said further header strings.
46. A method according to claim 45, characterized in that said compression step block (6) compresses the first header string and/or at least one of said further header strings according to the method recited in any one of the preceding claims 33 to 35.
47. A method according to claim 10 or 11 , when depending on claim 7, characterized in that said step block (6) for compressing said CURRENT STRING (15) to said COMPRESSED STRING comprises: a) a first iteration of steps, in which:
- a first scan of the CURRENT STRING is performed by means of a first window (59) having a size nn > n^ not higher than a maximum value WD , said first window scanning said CURRENT STRING by shifting itself by a bit pitch WS{ in the range of 1 to WD (1 < WS ≤ WD ),
- each time said first window identifies a sub-string not comprising two consecutive bits equal to "1", designated as canonical sub- string C ι having a size nu , an index that identifies the position of said canonical sub-string C within said CURRENT STRING is stored and said canonical sub-string C is compressed to a compressed binary substring according to claim 7, - at the end of the scan, the number G, of canonical substrings C„I 1 that have been compressed and those portions (60, 60', 60") of the CURRENT STRING not belonging to canonical sub-strings C„n having a size n , are juxtaposed to one another in a first reject string (61), and b) one or more further steps in which
- a scan of the reject string furnished by the preceding iteration is performed by means of a corresponding further window having a progressively decreasing size n < n g_ , said further window scanning the concerned reject string by shifting itself by a bit pitch WSg in the range of 1 to WSg_x (l ≤ WSg ≤ WSg_x ),
- each time said first windows identifies a canonical substring
Cng having a size nXg , an index that identifies the position of said canonical sub-string Cng within said reject string furnished by said preceding iteration is stored and said canonical sub-string C„g is compressed to a compressed binary sub-string according to claim 7,
- at the end of the scan, the number Gg of canonical substrings Cng that have been compressed and those portions of the reject string furnished by the preceding iteration, not belonging to canonical sub- strings Cng having a size nXg , are juxtaposed to one another in a corresponding further reject string, the iteration of the steps being terminated when
- the latest generated reject string is void, or
- the latest generated reject string is too small to be effectively compressed, or
- the size n g of the last scanning window is equal to
("mm - 1) - said COMPRESSED STRING comprising:
- the number F of scans performed up to the latest scan during which an effective compression operation has been performed,
- the reject string generated by the latest iteration F , and - for each scan , where g = 1,..., T _
- the number Gg of canonical sub-strings C that have been compressed,
- for each canonical sub-string Cm : - the index igs (where s = l,...,Gg ) identifying the position of the canonical sub-string within the reject string generated by the preceding iteration (g -l), and
- the compressed sub-string SCg!. (where s = l,...,Gg).
48. A method according to claim 47, characterized in that said CURRENT STRING has a size not greater than a maximum value
M .
49. A method according to claim 48, characterized in that =1024.
50. A method according to claim 48 or 49, characterized in that WD < M .
51. A method according to any one of preceding claims 47 to
50, characterized in that WD = 64 .
52. A method according to any one of preceding claims 47 to
51 , characterized in that nXg = n g_ -1.
53. A method according to any one of preceding claims 47 to
52, characterized in that WS„ = WS9 . .
54. A method according to any one of preceding claims 47 to
53, characterized in that WS, = 1
55. A method according to any one of preceding claims 47 to 54, characterized in that said block (6) for compressing said CURRENT
STRING (15) to said COMPRESSED STRING comprises, preliminarly to said first iteration of steps, a processing operation of said CURRENT STRING.
56. A method according to claim 10 or 11 , when dependin on claim 7, characterized in that said block (6) for compressing said
CURRENT STRING (15) to said COMPRESSED STRING comprises a first step for counting the number P of bits equal to "1" occurring in said CURRENT STRING.
57. A method according to claim 56, characterized in that, when said number P fulfils the following condition
P (, m
< 1 -—
L n j an extended string is created starting from the CURRENT STRING by juxtaposing a bit "0" to each of said P bits equal to "1" .
58. A method according to claim 56, characterized in that, when said number P fulfils the following condition
Figure imgf000056_0001
a logic NOT operation is performed on said current string and an extended string (67) is created starting from the string generated by said not operation by juxtaposing a bit "0" to each bit equal to "1" .
59. A method according to claim 10 or 11 , when dependant on claim 7, characterized in that said step block (6) for compressing said
CURRENT STRING (15) to said COMPRESSED STRING comprises performing a logic XOR operation on said CURRENT STRING by means of at least one mask comprising a number r of bits not higher than L (r ≤ L), designed in order that the string generated by said XOR operation fulfils the following condition
P (. m^
< 1 -
L n j and subsequently creating an extended string starting from the string generated by said xor operation by juxtaposing a bit "0" to each bit equal to "1".
60. A method according to any one of preceding claims 12 to
24, characterized in that, in the frame of said block (6) for compressing
said CURRENT STRING (15) to said COMPRESSED STRING, each of said / sub-strings (70), into which said CURRENT STRING is subdivided is compressed to a compressed sub-string (71) including a first portion (72), designated as "mantissa", comprising a number m of bits, furnished by the method according to claim 7, and a second portion (73), designated as "exponent", comprising a number z of bits, that is variable as the mantissa (72) varies, where z > 0 and equal to the number of bits needed for representing the number of n -bit strings to which the same whole numeric value N corresponds, when they are construed by means of the succession according to claim 7, said compression block further providing for pre-establishing an order of all of the A -bit strings, to which the same whole numeric value N corresponds, and for the exponent (73) to identify the index of the redundant representation corresponding to the compressed sub-string (70), said COMPRESSED STRING comprising said compressed sub-strings (71).
61. A method according to claim~60, characterized in that, when the number of n-bit strings to which the same whole numeric value N corresponds, when they are construed by means of the succession according to claim 7, is higher than 1 , the string not comprising two consecutive bits equal to "1", designated as canonical string, is expressed by said exponent (73) by means of z bits equal to "0".
62. A method according to any one of preceding claims 12 to 24, characterized in that said block (6) for compressing said CURRENT STRING (15) to said COMPRESSED STRING comprises the following steps:
- providing a redundancy ordering of all of said -bit strings to which the same whole numeric value N corresponds, when they are construed by means of the succession according to claim 7, said string redundancy ordering including a first and a second redundancy order, - performing a first step iteration comprising:
- compressing all of the sub-strings corresponding to the first redundancy order and storing information concerning their position within the input binary string
- forming a first reject string by juxtaposing those portions of said input binary string not comprising sub-strings corresponding to the first redundancy order to one another,
- performing a set of further step iterations, each in respect of a corresponding further redundancy order, each further iteration comprising: - compressing all of the sub-strings corresponding to the further redundancy order and storing information concerning their position within the reject string furnished by the preceding iteration,
- forming a further reject string by juxtaposing those portions of said reject string furnished by said preceding iteration not comprising sub-strings corresponding to the further redundancy order -to one another, ' '
- forming said COMPRESSED STRING by juxtaposing at least the following data for each iteration:
- the number of compressed sub-strings, - the compressed sub-strings, and for each iteration with exclusion of the last one: - information concerning -the positions of the compressed sub-strings within said input binary string or within said reject string furnished by said preceding iteration.
63. A method according to claim 62, characterized in that the method is terminated as soon as all of the sub-strings into which the input binary string was subdivided are compressed.
64. A method according to claim 62 or 63, characterized in that the n -bit strings construed according the succession of the method according to claim 7, not comprising two consecutive bits equal to "1" and designated as canonical strings, bolong to the first redundancy order.
65. A method for de-compression of a compressed binary string characterized in that said compressed binary string is generated starting from a data binary string comprising a number L of bits, by means of the compression method according to any one of the preceding claims 1 to 64.
66.- An electronic apparatus comprising at least a central processing unit and at least a memory unit, characterized in that it performs the compression method according to any one of claims 1 to 64.
67.- An electronic apparatus comprising at least a central processing unit and at least a memory unit, characterized in that it performs the de-compression method according to claim 65.
68.- An electric, magnetic or electromagnetic signal modulated by a digital signal comprising at least one data string, characterized in that said at least one data string is a compressed binary string generated, starting from a data binary string having a number L of bits, by means of the compression method according to any one of claims 1 to 64.
69.- A memory medium readable by a processor containing at least one data string, characterized in that said at least one data string is a compressed binary string generated, starting from a data binary string having a number L of bits, by means of the compression method according to any one of claims 1 to 64.
70.- A processor program comprising code means adapted to perform, when they operate on a processor, the compression method according to any one of claims 1 to 64.
71.- A memory medium readable by a processor, having a program stored therein, characterized in that said program is a processor program according to claim 70.
72.- A processor program comprising -Ode means adapted to perform, when they operate on a processor, the de-compression method according to claim 65.
73.- A memory medium readable by a processor, having a program stored therein, characterized in that said program is a processor program according to claim 72.
PCT/IT2001/000329 2000-06-26 2001-06-25 Method for numerical compression and decompression of binary data WO2002001728A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US10/311,924 US6788224B2 (en) 2000-06-26 2001-06-25 Method for numeric compression and decompression of binary data
EP01949885A EP1297630A1 (en) 2000-06-26 2001-06-25 Method for numerical compression and decompression of binary data
AU70995/01A AU7099501A (en) 2000-06-26 2001-06-25 Method for numerical compression and decompression of binary data

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
ITRM2000A000347 2000-06-26
IT2000RM000347A ITRM20000347A1 (en) 2000-06-26 2000-06-26 NUMERICAL REPRESENTATION METHOD.

Publications (1)

Publication Number Publication Date
WO2002001728A1 true WO2002001728A1 (en) 2002-01-03

Family

ID=11454804

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/IT2001/000329 WO2002001728A1 (en) 2000-06-26 2001-06-25 Method for numerical compression and decompression of binary data

Country Status (4)

Country Link
EP (1) EP1297630A1 (en)
AU (1) AU7099501A (en)
IT (1) ITRM20000347A1 (en)
WO (1) WO2002001728A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110504973A (en) * 2018-05-16 2019-11-26 北京京东尚科信息技术有限公司 Compressing file, decompressing method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4187500A (en) * 1976-07-19 1980-02-05 Taganrogsky Radiotekhnichesky Institut, USSR, Taganrog Method and device for reduction of Fibonacci p-codes to minimal form

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4187500A (en) * 1976-07-19 1980-02-05 Taganrogsky Radiotekhnichesky Institut, USSR, Taganrog Method and device for reduction of Fibonacci p-codes to minimal form

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
APOSTOLICO A ET AL: "Robust transmission of unbounded strings using Fibonacci representations", IEEE TRANSACTIONS ON INFORMATION THEORY, MARCH 1987, USA, vol. IT-33, no. 2, pages 238 - 245, XP001024782, ISSN: 0018-9448 *
FRAENKEL A S ET AL: "Robust universal complete codes for transmission and compression", DISCRETE APPLIED MATHEMATICS, 4 JAN. 1996, ELSEVIER, NETHERLANDS, vol. 64, no. 1, pages 31 - 55, XP001034292, ISSN: 0166-218X *
FROUGNY C: "FIBONACCI REPRESENTATIONS AND FINITE AUTOMATA", IEEE TRANSACTIONS ON INFORMATION THEORY, IEEE INC. NEW YORK, US, vol. 37, no. 2, 1 March 1991 (1991-03-01), pages 393 - 399, XP000147151, ISSN: 0018-9448 *
RAO K N: "Security audit for embedded avionics systems", FIFTH ANNUAL COMPUTER SECURITY APPLICATIONS CONFERENCE (CAT. NO.89TH0287-3), TUCSON, AZ, USA, 4-8 DEC. 1989, 1990, Los Alamitos, CA, USA, IEEE Comput. Soc. Press, USA, pages 78 - 84, XP001034273, ISBN: 0-8186-2006-4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110504973A (en) * 2018-05-16 2019-11-26 北京京东尚科信息技术有限公司 Compressing file, decompressing method and device

Also Published As

Publication number Publication date
AU7099501A (en) 2002-01-08
ITRM20000347A0 (en) 2000-06-26
ITRM20000347A1 (en) 2001-12-26
EP1297630A1 (en) 2003-04-02

Similar Documents

Publication Publication Date Title
US5471207A (en) Compression of palettized images and binarization for bitwise coding of M-ary alphabets therefor
US20060171533A1 (en) Method and apparatus for encoding and decoding key data
US5818877A (en) Method for reducing storage requirements for grouped data values
US6633242B2 (en) Entropy coding using adaptable prefix codes
EP1322119A2 (en) Apparatus for encoding and decoding key data and keyvalue data of coordinate interpolator and recording medium
US7365658B2 (en) Method and apparatus for lossless run-length data encoding
US5696507A (en) Method and apparatus for decoding variable length code
EP0949589B1 (en) Data compression by use of prime exponents
US6788224B2 (en) Method for numeric compression and decompression of binary data
CN1139861A (en) Length changeable code and segment and device
US5594435A (en) Permutation-based data compression
KR100604364B1 (en) Arithmetic encoding and decoding of an information signal
JP3990464B2 (en) Data efficient quantization table for digital video signal processor
US20220005229A1 (en) Point cloud attribute encoding method and device, and point cloud attribute decoding method and devcie
JP3230933B2 (en) Data decompression device, data decompression method, decoding device, decoding method, encoding device, and entropy decoder
EP1297630A1 (en) Method for numerical compression and decompression of binary data
EP1289302B1 (en) Coding and decoding apparatus of key data for graphic animation and method thereof
GB2319689A (en) An entropy encoder using context modelling with data reordering
EP1320266A2 (en) Method and apparatus for encoding and decoding data
EP1322118A2 (en) Method and apparatus for encoding and decoding key data
EP0047382A2 (en) Adaptive compression encoding of a binary-source symbol string
JP2934603B2 (en) Method and apparatus for decoding variable length code
JP2548122B2 (en) Encoder
EP1750447A2 (en) Method and apparatus for encoding and decoding key data
JP3093451B2 (en) Redundancy reduction coding device

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ PL PT RO RU SD SE SG SI SK SL TJ TM TR TT TZ UA UG US UZ VN YU ZA ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZW AM AZ BY KG KZ MD RU TJ TM AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE TR BF BJ CF CG CI CM GA GN GW ML MR NE SN TD TG

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2001949885

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 10311924

Country of ref document: US

WWP Wipo information: published in national office

Ref document number: 2001949885

Country of ref document: EP

REG Reference to national code

Ref country code: DE

Ref legal event code: 8642

NENP Non-entry into the national phase

Ref country code: JP

WWW Wipo information: withdrawn in national office

Ref document number: 2001949885

Country of ref document: EP