CN102185612A - Run-length coding and decoding methods and devices - Google Patents

Run-length coding and decoding methods and devices Download PDF

Info

Publication number
CN102185612A
CN102185612A CN2011100321418A CN201110032141A CN102185612A CN 102185612 A CN102185612 A CN 102185612A CN 2011100321418 A CN2011100321418 A CN 2011100321418A CN 201110032141 A CN201110032141 A CN 201110032141A CN 102185612 A CN102185612 A CN 102185612A
Authority
CN
China
Prior art keywords
sign indicating
indicating number
character string
replace
select
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011100321418A
Other languages
Chinese (zh)
Inventor
张环蚀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN2011100321418A priority Critical patent/CN102185612A/en
Publication of CN102185612A publication Critical patent/CN102185612A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a run-length coding method, a run-length coding device, a run-length decoding method and a run-length decoding device. The run-length coding method comprises a selective code replacement step, and specifically comprises the following steps of: 1, acquiring a first character string; 2, reading the data of the first character string according to an appointed code, performing a mutual replacement operation on codes of a first type and a second type between a first specified value and a second specified value in the first character string, and replacing the second specified value by using the first specified value to obtain a second character string; and 3, outputting the second character string. The of two different types in the data are selectively replaced to code a run-length into another run-length, replacing the codes of different bit numbers to compress the data, and performing the replacement operation for many times, thereby increasing a compression ratio in a data compression process.

Description

Distance of swimming decoding method and device
Technical field
The present invention relates to data encoding and decoding field, relate in particular to a kind of distance of swimming decoding method and device.
Background technology
Run-Length Coding (RLC, Run-length coding) is widely used in as digital camera, smart mobile phone etc., being used in the various digital devices to various data (such as the coding of DID), be used for the amount of information of data is compressed, to reduce memory and bandwidth consumption.
Run-Length Coding utilizes in the data coding that repeats of sign indicating number, generally continuous 0 number and continuous 1 number are encoded, the typical case uses as facsimile machine, generally carry out Code And Decode with codeword table, its problem is a more complicated, under a large amount of situations about existing of the short distance of swimming, compression ratio improves difficulty.
Summary of the invention
The present invention aims to provide a kind of distance of swimming decoding method and device, to solve compression method complexity and the lower problem of compression ratio in the prior art.
To achieve these goals, according to a first aspect of the invention, provide a kind of run length encoding method.This method includes selects to replace coding step: step 1: obtain first character string; Step 2: sign indicating number reads the data of first character string by appointment, first kind sign indicating number between first setting in first character string and second setting and the second class sign indicating number are carried out the mutual alternative operation, and second setting is replaced with first setting obtain second character string; Step 3 is exported second character string.
Further, this method also comprises: carry out not have before execution has the replacement of selection coding step and select to replace coding step, to the 3rd class sign indicating number in the data and the operation of the 4th class sign indicating number execution mutual alternative; Perhaps carrying out after having executed selection replacement coding step does not have the replacement of selection coding step, and the 3rd class sign indicating number among the replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
Further, this method also comprises: repeatedly carry out not have to select to replace coding step and have and select to replace coding step.
According to a second aspect of the invention, provide a kind of runs decoding method.This method includes selects to replace decoding step: step 1, and obtain second character string, and obtain second setting in first character string; Step 2, sign indicating number reads the data of second character string by appointment, with first setting in second character string and first kind sign indicating number between second setting and the operation of second class sign indicating number execution mutual alternative, and second setting in second character string replaced with second setting in first character string, obtain described first character string; Step 3 is exported first character string.
Further, this method also comprises: carry out not have before execution has the replacement of selection decoding step and select to replace decoding step, to the 3rd class sign indicating number in the data and the operation of the 4th class sign indicating number execution mutual alternative; Perhaps carrying out after having executed selection replacement decoding step does not have the replacement of selection decoding step, and the 3rd class sign indicating number among the replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
Further, this method also comprises: repeatedly carry out not have to select to replace decoding step and have and select to replace decoding step.
According to a third aspect of the invention we, provide a kind of Run-Length Coding device.This device comprises encoder, encoder comprises: have and select to replace coding module, be used for carrying out having and select to replace coding step, obtain first character string, sign indicating number reads the data of first character string by appointment, the first kind sign indicating number between first setting and second setting in described first character string and the second class sign indicating number are carried out the mutual alternative operation, and second setting is replaced with first setting, obtain second character string.
Further, encoder also comprises not having selects to replace coding module, be used for carrying out not having and select to replace coding step: carrying out before execution has selection to replace coding step does not have the replacement of selection coding step, and the 3rd class sign indicating number in the data and the 4th class sign indicating number are carried out the mutual alternative operation; Perhaps carrying out after having executed selection replacement coding step does not have the replacement of selection coding step, and the 3rd class sign indicating number among the replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
Further, repeatedly carrying out nothing selects to replace coding step and the replacement of selection coding step is arranged.
According to a forth aspect of the invention, provide a kind of runs decoding device.This device comprises decoder, decoder includes selects to replace decoder module, be used for carrying out having and select to replace decoding step, obtain second character string, and obtain second setting in first character string, sign indicating number reads the data of second character string by appointment, with first setting in second character string and first kind sign indicating number between second setting and the operation of second class sign indicating number execution mutual alternative, and second setting in second character string replaced with second setting in first character string, obtain first character string.
Further, decoder also comprises not having selects to replace decoder module, be used for carrying out not having and select to replace decoding step, before execution has selection to replace decoding step, carry out and do not have the replacement of selection decoding step, the 3rd class sign indicating number in the data and the 4th class sign indicating number are carried out the mutual alternative operation; Perhaps after executing selection replacement decoding step, carry out not have and select the replacement decoding step: the 3rd class sign indicating number among the replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
Further, repeatedly carrying out nothing selects to replace decoding step and the replacement of selection decoding step is arranged.
Use technical scheme of the present invention, can realize compression by following step: obtain first character string data; Sign indicating number reads the data of first character string by appointment, and the first kind sign indicating number between first setting in first character string and second setting and the second class sign indicating number are carried out the mutual alternative operation, and second setting is replaced with first setting obtains second character string; Export second character string.Like this, selectively two kinds of different sign indicating numbers in the data are carried out mutual alternative, simplified the compression process of data, and improved the compression ratio in the data compression process.
Except purpose described above, feature and advantage, the present invention also has other purpose, feature and advantage.With reference to figure, the present invention is further detailed explanation below.
Description of drawings
Accompanying drawing is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 shows the coding example one according to the distance of swimming decoding method of the embodiment of the invention;
Fig. 2 shows the coding example two according to the distance of swimming decoding method of the embodiment of the invention;
Fig. 3 shows the decoded instance three according to the distance of swimming decoding method of the embodiment of the invention;
Fig. 4 shows the decoded instance four according to the distance of swimming decoding method of the embodiment of the invention;
Fig. 5 shows according to coding example shown in Figure 2 two and carries out the flow chart that has selection to replace coding step;
Fig. 6 shows according to decoded instance shown in Figure 3 three and carries out the flow chart that does not have selection replacement encoding and decoding step;
Fig. 7 shows the flow chart that comprises the run length encoding method of repeatedly replacing coding step according to the embodiment of the invention;
Fig. 8 shows the flow chart that comprises the runs decoding method of repeatedly replacing decoding step according to the embodiment of the invention;
Fig. 9 shows the Run-Length Coding apparatus structure schematic diagram of repeatedly replacing coding step according to comprising of the embodiment of the invention;
Figure 10 shows the runs decoding apparatus structure schematic diagram of repeatedly replacing decoding step according to comprising of the embodiment of the invention; And
Figure 11 shows the image processing system schematic diagram according to the embodiment of the invention.
Embodiment
Below in conjunction with accompanying drawing embodiments of the invention are elaborated, but the multitude of different ways that the present invention can be defined by the claims and cover is implemented.
The invention provides a kind of run length encoding method.This method includes selects to replace coding step: step 1: obtain first character string; Step 2: sign indicating number reads the data of first character string by appointment, the first kind sign indicating number between first setting in first character string and second setting and the second class sign indicating number are carried out the mutual alternative operation, and second setting replaced with first setting, obtain second character string; Step 3 is exported second character string.
In the present embodiment, this method also comprises: carry out not have before execution has the replacement of selection coding step and select to replace coding step, to the 3rd class sign indicating number in the data and the operation of the 4th class sign indicating number execution mutual alternative; Perhaps carrying out after having executed selection replacement coding step does not have the replacement of selection coding step, and the 3rd class sign indicating number among the replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
Wherein, can repeatedly carry out nothing selects to replace coding step and the replacement of selection coding step is arranged.
The present invention also provides a kind of runs decoding method.This method includes selects to replace decoding step: step 1, and obtain second character string, and obtain second setting in first character string; Step 2, sign indicating number reads the data of second character string by appointment, with first setting in second character string and first kind sign indicating number between second setting and the operation of second class sign indicating number execution mutual alternative, and second setting in second character string replaced with second setting in first character string, obtain first character string; Step 3 is exported first character string.
In the present embodiment, this method also comprises: carry out not have before execution has the replacement of selection decoding step and select to replace decoding step, to the 3rd class sign indicating number in the data and the operation of the 4th class sign indicating number execution mutual alternative; Perhaps carrying out after having executed selection replacement decoding step does not have the replacement of selection decoding step, and the 3rd class sign indicating number among the replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
Wherein, can repeatedly carry out nothing selects to replace decoding step and the replacement of selection decoding step is arranged.
The present invention also provides a kind of Run-Length Coding device.This device comprises encoder, encoder comprises having selects to replace coding module, be used for carrying out having and select to replace coding step, obtain first character string, sign indicating number reads the data of first character string by appointment, the first kind sign indicating number between first setting in first character string and second setting and the second class sign indicating number are carried out the mutual alternative operation, and second setting is replaced with first setting, obtain second character string.
In the present embodiment, this encoder also comprises not having selects to replace coding module, be used for carrying out not having and select to replace coding step: carrying out before execution has selection to replace coding step does not have the replacement of selection coding step, and the 3rd class sign indicating number in the data and the 4th class sign indicating number are carried out the mutual alternative operation; Perhaps carrying out after having executed selection replacement coding step does not have the replacement of selection coding step, and the 3rd class sign indicating number among the replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
Wherein, can repeatedly carry out nothing selects to replace coding step and the replacement of selection coding step is arranged.
The present invention also provides a kind of runs decoding device.This device comprises decoder, decoder includes selects to replace decoder module, be used for carrying out having and select to replace decoding step, obtain second character string, and obtain second setting in first character string, sign indicating number reads the data of second character string by appointment, with first setting in second character string and first kind sign indicating number between second setting and the operation of second class sign indicating number execution mutual alternative, and second setting in second character string replaced with second setting in first character string, obtain first character string.
In the present embodiment, this decoder also comprises not having selects to replace decoder module, be used for carrying out not having and select to replace decoding step, before execution has selection to replace decoding step, carry out and do not have the replacement of selection decoding step, the 3rd class sign indicating number in the data and the 4th class sign indicating number are carried out the mutual alternative operation; Perhaps after executing selection replacement decoding step, carry out not have and select the replacement decoding step: the 3rd class sign indicating number among the replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
Wherein repeatedly carry out not have to select to replace decoding step and have and select to replace decoding step.
Fig. 1 shows the coding example one according to the distance of swimming decoding method of the embodiment of the invention.As shown in Figure 1, be seen as selection from top to bottom and replaced cataloged procedure: input image data is 0 11 11 11 11 11 11 10 10 00001, and dateout is: 011 00000 10 10 11 0001.The view data of input is according to sign indicating number 11, and sign indicating number 10 and sign indicating number 0 are understood, and sign indicating number 11 between first setting 11 and second setting 0 and sign indicating number 0 are carried out mutual alternative operation (that is, sign indicating number 11 replaces with sign indicating number 0 output, and sign indicating number 0 replaces with sign indicating number 11 outputs).Second setting 0 replaces with first setting 11, and the part that does not need to replace is directly exported.
As shown in Figure 1, be seen as selection from the bottom up and replaced decode procedure: input image data is 0 11 00000 10 10 11 00 01, and dateout is: 0 11 11 11 11 11 11 10 10 00001.The view data of input is according to sign indicating number 11, and sign indicating number 10 and sign indicating number 0 are understood, and 11 and 0 between first setting 11 and second setting 11 carried out mutual alternative operation (that is, sign indicating number 11 replaces with sign indicating number 0 output, and sign indicating number 0 replaces with sign indicating number 11 outputs).Second setting 11 replaces with second setting 0 in the coding step, and the part that does not need to replace is directly exported.
Fig. 2 shows the coding example two according to the distance of swimming decoding method of the embodiment of the invention.As shown in Figure 2, be seen as selection from top to bottom and replaced cataloged procedure: input image data is 0111111111111101000001, and dateout is: 0011111111111100011110.The view data of input is understood according to sign indicating number 0 and sign indicating number 1, and sign indicating number 0 between first setting 0 and second setting 1 and sign indicating number 1 are carried out mutual alternative operation (that is, sign indicating number 0 replaces with sign indicating number 1 output, and sign indicating number 1 replaces with sign indicating number 0 output).Second setting 1 replaces with first setting 0, and the part that does not need to replace is directly exported.
As shown in Figure 2, be seen as selection from the bottom up and replaced decode procedure: input image data is 001111111111 11 00011110, and dateout is: 0111111111111101000001.The view data of input is understood according to sign indicating number 0 and sign indicating number 1, and 0 and 1 between first setting 0 and second setting 0 carried out mutual alternative operation (that is, sign indicating number 0 replaces with sign indicating number 1 output, and sign indicating number 1 replaces with sign indicating number 0 output).Second setting 0 replaces with second setting 1 in the coding step, and the part that does not need to replace is directly exported.
Fig. 3 shows the decoded instance three according to the distance of swimming decoding method of the embodiment of the invention.As shown in Figure 3, being seen as nothing from top to bottom selects to replace cataloged procedure: input image data is 0 11 11 11 11 11 11 10 10 00001, and dateout is: 11 000000 10 10 11 11 11 11 1.The view data of input is according to sign indicating number 11, and sign indicating number 10 and sign indicating number 0 are understood, the view data actuating code 11 of input and sign indicating number 0 mutual alternative (that is, sign indicating number 11 replaces with 0 output, and sign indicating number 0 replaces with sign indicating number 11 outputs), and sign indicating number 10 is output directly.The part that does not need to replace is directly exported.
As shown in Figure 3, being seen as nothing from the bottom up selects to replace decode procedure: input image data is 11 000000 10 10 11 1,111 11 1, and dateout is: 0 11 11 11 11 11 11 10 10 00001.The view data of input is according to sign indicating number 11, and sign indicating number 10 and sign indicating number 0 are understood, to severals images of input according to an actuating code 11 and sign indicating number 0 mutual alternative (that is, sign indicating number 11 replaces with 0 output, and sign indicating number 0 replaces with sign indicating number 11 and exports).Sign indicating number 10 is output directly.The part that does not need to replace is directly exported.
Fig. 4 shows the decoded instance four according to the distance of swimming decoding method of the embodiment of the invention.As shown in Figure 4, being seen as nothing from top to bottom selects to replace cataloged procedure: input image data is 0 111 111 111 111 101 000001, and dateout is: 1,110 000 101 111 111 111 111 111 1.The view data of input is understood according to sign indicating number 111, sign indicating number 110, sign indicating number 101, sign indicating number 100 and sign indicating number 0, to the view data actuating code 111 and sign indicating number 0 mutual alternative (that is, sign indicating number 111 replaces with 0 output, and sign indicating number 0 replaces with sign indicating number 111 outputs) of input.The part that does not need to replace is directly exported.
As shown in Figure 4, being seen as nothing from the bottom up selects to replace decode procedure: input image data is 111 0000 101 111 111,111 111 111 1, and dateout is: 0 111 111 111 111 101 000001.The view data of input is understood according to sign indicating number 111, sign indicating number 110, sign indicating number 101, sign indicating number 100 and sign indicating number 0, to the view data actuating code 111 and sign indicating number 0 mutual alternative (that is, sign indicating number 111 replaces with 0 output, and sign indicating number 0 replaces with sign indicating number 111 outputs) of input.The part that does not need to replace is directly exported.
Fig. 5 shows according to coding example shown in Figure 2 two and carries out the flow chart that has selection to replace coding step.This step comprises step S10, obtains first character string; Step S12, sign indicating number (in the present embodiment, the agreement sign indicating number is sign indicating number 0 and sign indicating number 1) reads the data of first character string by appointment; Step S14, the first kind sign indicating number 0 between first setting 0 and second setting 1 and the second class sign indicating number 1 are carried out the mutual alternative operation (promptly, first kind sign indicating number 0 replaces with 1 output of the second class sign indicating number, the second class sign indicating number 1 replaces with 0 output of first kind sign indicating number), and it is constant with second setting 1 data and first setting 0 afterwards before that second setting 0 is replaced with first setting, 1, the first setting 0; Step S16 generates second character string behind first string encoding; Step S18, dateout.
For the replacement of selection coding was arranged, having selection to replace decoding was to have selection to replace the inverse process of encoding.In the replacement of selection decode procedure is arranged, identical by first setting in second character string that obtains behind first string encoding with second setting in this second character string, and second setting 0 in second character string replaces with second setting 1 in first character string.
Fig. 6 shows according to decoded instance shown in Figure 3 three and carries out the flow chart that does not have selection replacement encoding and decoding step.This step comprises: step S20, order reads image data; Step S22 carries out the 3rd class sign indicating number 11 and the 4th class sign indicating number 0 mutual alternative (that is, the 3rd class sign indicating number 11 replaces with 0 output of the 4th class, and the 4th class sign indicating number 0 replaces with 11 outputs of the 3rd class sign indicating number) to view data, and sign indicating number 10 is constant; Step S24, dateout.
For not having the replacement of selection coding, nothing is selected to replace and decoded is not have the inverse process that coding is replaced in selection.
Fig. 7 shows the flow chart that comprises the run length encoding method of repeatedly replacing coding step according to the embodiment of the invention.In the present embodiment, carry out earlier not have and select to replace coding step, carry out again to have and select to replace coding step.Preferably, also can carry out earlier and select to replace coding step, carry out again not have and select to replace coding step.Particularly, as shown in Figure 7, step S30 carries out not have and selects to replace coding step; Step S32 carries out to have and selects to replace coding step.Repeatedly carry out above-mentioned steps, the number of times of execution can be selected as required.In the present embodiment, the number of times of execution in step S30 is 4 times, and the number of times of execution in step S32 is 3 times.The concrete steps of step S30 can (the 3rd class sign indicating number 11 replaces with 0 output of the 4th class sign indicating number as shown in Figure 6, the 4th class sign indicating number 0 replaces with 11 outputs of the 3rd class sign indicating number), the concrete steps of step S32 are (first kind sign indicating number 0 replaces with 1 output of the second class sign indicating number, and the second class sign indicating number 1 replaces with 0 output of first kind sign indicating number) as shown in Figure 5.
In the present embodiment, can also carry out continuously to have and select to replace coding step, perhaps only carry out repeatedly to have and select to replace coding step.
Fig. 8 shows the flow chart that comprises the runs decoding method of repeatedly replacing decoding step according to the embodiment of the invention.For the run length encoding method that coding step is repeatedly replaced in execution shown in Figure 7, the runs decoding method that decoding step is repeatedly replaced in execution shown in Figure 8 is that the inverse process of the run length encoding method of coding step is repeatedly replaced in execution shown in Figure 7.In the present embodiment, carry out earlier not have and select to replace decoding step, carry out again to have and select to replace decoding step.Particularly, as shown in Figure 8, step S40 carries out not have and selects to replace decoding step; Step S42 carries out to have and selects to replace decoding step.Repeatedly carry out above-mentioned steps, the number of times of execution can be selected as required.In the present embodiment, the number of times of execution in step S40 is 4 times, and the number of times of execution in step S42 is 3 times.
Fig. 9 shows the Run-Length Coding apparatus structure schematic diagram of repeatedly replacing coding step according to comprising of the embodiment of the invention, this device comprises: first does not have the replacement of selection coding module 10, second does not have the replacement of selection coding module 12, the 3rd does not have the replacement of selection coding module 14, the 4th does not have the replacement of selection coding module 16, first has the replacement of selection coding module 20, the second to have selects to replace coding module 22, the three has selection to replace coding module 24.First does not have the replacement of selection coding module 10 and first has the replacement of selection coding module 20 to be connected; First has the replacement of selection coding module 20 and second not have selects to replace coding module 12; Second does not have the replacement of selection coding module 12 and second has the replacement of selection coding module 22 to be connected; Second has the replacement of selection coding module 22 and the 3rd not have the replacement of selection coding module 14 is connected; The 3rd does not have the replacement of selection coding module 14 and the 3rd has the replacement of selection coding module 24 to be connected; The 3rd has the replacement of selection coding module 24 and the 4th not have the replacement of selection coding module 16 is connected.
Wherein, first does not have the replacement of selection coding module 10, second does not have the replacement of selection coding module 12, the 3rd nothing is selected replacement coding module 14 and the 4th nothing to select replacement coding module 16 all to be used for carrying out the nothing selection and is replaced coding step, to the 3rd class sign indicating number in the data and the operation of the 4th class sign indicating number execution mutual alternative; First has selection replacement coding module 20, the second to have the replacement of selection coding module 22 and the 3rd to have the replacement of selection coding module 24 all to be used for execution the replacement of selection coding step; Step 1: obtain first character string; Step 2: sign indicating number reads the data of first character string by appointment, the first kind sign indicating number between first setting and second setting and the second class sign indicating number are carried out the mutual alternative operation, and second setting replaced with first setting, before first setting and the data and first setting after second setting constant; Step 3 is by second character string behind step 2 generation first string encoding.
When carry out not have select replacing coding step and the number of times of selecting to replace coding step being arranged when being not limited to four times and three times respectively, can correspondingly increase or reduce the coding/decoding module of correspondence.
Figure 10 shows the runs decoding apparatus structure schematic diagram of repeatedly replacing decoding step according to comprising of the embodiment of the invention, this device comprises: first does not have the replacement of selection decoder module 30, second does not have the replacement of selection decoder module 32, the 3rd does not have the replacement of selection decoder module 34, the 4th does not have the replacement of selection decoder module 36, first has the replacement of selection decoder module 40, the second to have selects to replace decoder module 42, the three has selection to replace decoder module 44.First does not have the replacement of selection decoder module 30 and first has the replacement of selection decoder module 40 to be connected; First has the replacement of selection decoder module 40 and second not have selects to replace decoder module 32; Second does not have the replacement of selection decoder module 32 and second has the replacement of selection decoder module 42 to be connected; Second has the replacement of selection decoder module 42 and the 3rd not have the replacement of selection decoder module 34 is connected; The 3rd does not have the replacement of selection decoder module 34 and the 3rd has the replacement of selection decoder module 44 to be connected; The 3rd has the replacement of selection decoder module 44 and the 4th not have the replacement of selection decoder module 36 is connected.
Wherein, first does not have the replacement of selection decoder module 10, second does not have the replacement of selection decoder module 12, the 3rd nothing is selected replacement decoder module 14 and the 4th nothing to select replacement decoder module 16 all to be used for carrying out the nothing selection and is replaced decoding step, to the 3rd class sign indicating number in the data and the operation of the 4th class sign indicating number execution mutual alternative; First has selection replacement decoder module 20, the second to have the replacement of selection decoder module 22 and the 3rd to have the replacement of selection decoder module 24 all to be used for execution the replacement of selection decoding step: step 1, and obtain second character string, and obtain second setting in first character string; Step 2, sign indicating number reads the data of second character string by appointment, with first setting in second character string and first kind sign indicating number between second setting and the operation of second class sign indicating number execution mutual alternative, second setting in second character string is replaced with second setting in first character string, before first setting in second character string and data and first setting in second character string after second setting in second character string constant, wherein, first setting in second character string is identical with second setting in second character string; Step 3 generates decoded first character string of second character string by step 2.
When carry out not have select replacing decoding step and the number of times of selecting to replace decoding step being arranged when being not limited to four times and three times respectively, can correspondingly increase or reduce the coding/decoding module of correspondence.
Figure 11 shows the image processing system schematic diagram according to the embodiment of the invention.Can use image processing system operation the various embodiments described above of the present invention shown in Figure 11.This system comprises CPU 600, and RAM 602, and ROM 604, system bus 606, hard disk controller 608, keyboard controller 610, serial interface controller 612, parallel interface controller 614, display controller 616, hard disk 618, keyboard 620, camera 622, printer 624 and display 626.In these parts, what link to each other with system bus 606 has CPU 600, RAM 602, ROM 604, hard disk controller 608, keyboard controller 610, serial interface controller 612, parallel interface controller 614 and a display controller 616.Hard disk 618 links to each other with hard disk controller 608, and keyboard 620 links to each other with keyboard controller 610, and camera 622 links to each other with serial interface controller 612, and printer 624 links to each other with parallel interface controller 614, and display 626 links to each other with display controller 616.
As can be seen from the above description, the above embodiments of the present invention have realized following technique effect: by selectively two kinds of different sign indicating numbers in the view data being carried out mutual alternative, realize that the distance of swimming is encoded as the another kind of distance of swimming, simplified compression process.Use the few sign indicating number of bit number to replace the many sign indicating numbers of bit number, and carry out repeatedly replacement operation, thereby improve the compression ratio in the data compression process data compression.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with the general calculation device, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation element forms, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the storage device and carry out by calculation element, perhaps they are made into each integrated circuit modules respectively, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.Should be understood that the variation in these concrete enforcements is conspicuous for a person skilled in the art, do not break away from spiritual protection range of the present invention.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (12)

1. a run length encoding method is characterized in that, includes to select to replace coding step:
Step 1: obtain first character string;
Step 2: sign indicating number reads the data of described first character string by appointment, the first kind sign indicating number between first setting and second setting in described first character string and the second class sign indicating number are carried out the mutual alternative operation, and described second setting replaced with described first setting, obtain second character string;
Step 3 is exported described second character string.
2. method according to claim 1 is characterized in that, also comprises:
Carry out described have to carry out not have before selecting to replace coding step select to replace coding step, the 3rd class sign indicating number in the described data and the 4th class sign indicating number are carried out the mutual alternative operation; Perhaps
Execute described have to carry out not have after select replacing coding step select to replace coding step, the 3rd class sign indicating number among the described replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
3. method according to claim 2 is characterized in that, repeatedly carry out described nothing select to replace coding step and described have select to replace coding step.
4. a runs decoding method is characterized in that, includes to select to replace decoding step:
Step 1 is obtained second character string, and obtains second setting in first character string;
Step 2, sign indicating number reads the data of described second character string by appointment, with first setting in described second character string and first kind sign indicating number between second setting and the operation of second class sign indicating number execution mutual alternative, and second setting in described second character string replaced with second setting in described first character string, obtain described first character string;
Step 3 is exported described first character string.
5. method according to claim 4 is characterized in that, also comprises:
Carry out described have to carry out not have before selecting to replace decoding step select to replace decoding step, the 3rd class sign indicating number in the described data and the 4th class sign indicating number are carried out the mutual alternative operation; Perhaps
Execute described have to carry out not have after select replacing decoding step select to replace decoding step, the 3rd class sign indicating number among the described replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
6. method according to claim 5 is characterized in that, repeatedly carry out described nothing select to replace decoding step and described have select to replace decoding step.
7. Run-Length Coding device, it is characterized in that, comprise encoder, described encoder comprises: have and select to replace coding module, be used for carrying out having and select to replace coding step, obtain first character string, sign indicating number reads the data of described first character string by appointment, the first kind sign indicating number between first setting and second setting in described first character string and the second class sign indicating number are carried out the mutual alternative operation, and described second setting is replaced with described first setting, obtain second character string.
8. device according to claim 7 is characterized in that, described encoder also comprises not having to be selected to replace coding module, is used for carrying out not having and selects to replace coding step:
Carry out described have to carry out not have before selecting to replace coding step select to replace coding step, the 3rd class sign indicating number in the described data and the 4th class sign indicating number are carried out the mutual alternative operation; Perhaps
Execute described have to carry out not have after select replacing coding step select to replace coding step, the 3rd class sign indicating number among the described replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
9. device according to claim 8 is characterized in that, repeatedly carry out described nothing select to replace coding step and described have select to replace coding step.
10. runs decoding device, it is characterized in that, comprise decoder, described decoder comprises: have and select to replace decoder module, be used for carrying out having and select to replace decoding step, obtain second character string, and obtain second setting in first character string, sign indicating number reads the data of described second character string by appointment, with first setting in described second character string and first kind sign indicating number between second setting and the operation of second class sign indicating number execution mutual alternative, and second setting in described second character string replaced with second setting in described first character string, obtain described first character string.
11. device according to claim 10 is characterized in that, described decoder also comprises not having to be selected to replace decoder module, is used for carrying out not having and selects to replace decoding step:
Carry out described have to carry out not have before selecting to replace decoding step select to replace decoding step, the 3rd class sign indicating number in the described data and the 4th class sign indicating number are carried out the mutual alternative operation; Perhaps
Execute described have to carry out not have after select replacing decoding step select to replace decoding step, the 3rd class sign indicating number among the described replacement result and the 4th class sign indicating number are carried out the mutual alternative operation.
12. device according to claim 11 is characterized in that, repeatedly carry out described nothing select to replace decoding step and described have select to replace decoding step.
CN2011100321418A 2011-01-28 2011-01-28 Run-length coding and decoding methods and devices Pending CN102185612A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011100321418A CN102185612A (en) 2011-01-28 2011-01-28 Run-length coding and decoding methods and devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011100321418A CN102185612A (en) 2011-01-28 2011-01-28 Run-length coding and decoding methods and devices

Publications (1)

Publication Number Publication Date
CN102185612A true CN102185612A (en) 2011-09-14

Family

ID=44571689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011100321418A Pending CN102185612A (en) 2011-01-28 2011-01-28 Run-length coding and decoding methods and devices

Country Status (1)

Country Link
CN (1) CN102185612A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102339592A (en) * 2011-09-29 2012-02-01 中山大学 Video memory compression method based on LCD (liquid crystal display) controller
CN103746704B (en) * 2014-01-01 2016-09-14 安庆师范学院 Test data of chip transmission methods based on double distance of swimming alternate coded
CN107945807A (en) * 2016-10-12 2018-04-20 厦门雅迅网络股份有限公司 Audio recognition method and its system based on the mute distance of swimming
CN111565272A (en) * 2020-04-30 2020-08-21 蔚复来(浙江)科技股份有限公司 Device and method for long-distance transmission of camera data through parallel bus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4929946A (en) * 1989-02-09 1990-05-29 Storage Technology Corporation Adaptive data compression apparatus including run length encoding for a tape drive system
US5109433A (en) * 1989-10-13 1992-04-28 Microsoft Corporation Compressing and decompressing text files
CN1902826A (en) * 2003-09-25 2007-01-24 皮尔雷斯系统公司 Split runlength encoding method and apparatus
CN101807924A (en) * 2010-03-17 2010-08-18 黄斐芝 Method for carrying out lossless coding compression on binary data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4929946A (en) * 1989-02-09 1990-05-29 Storage Technology Corporation Adaptive data compression apparatus including run length encoding for a tape drive system
US5109433A (en) * 1989-10-13 1992-04-28 Microsoft Corporation Compressing and decompressing text files
CN1902826A (en) * 2003-09-25 2007-01-24 皮尔雷斯系统公司 Split runlength encoding method and apparatus
CN101807924A (en) * 2010-03-17 2010-08-18 黄斐芝 Method for carrying out lossless coding compression on binary data

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102339592A (en) * 2011-09-29 2012-02-01 中山大学 Video memory compression method based on LCD (liquid crystal display) controller
CN103746704B (en) * 2014-01-01 2016-09-14 安庆师范学院 Test data of chip transmission methods based on double distance of swimming alternate coded
CN107945807A (en) * 2016-10-12 2018-04-20 厦门雅迅网络股份有限公司 Audio recognition method and its system based on the mute distance of swimming
CN111565272A (en) * 2020-04-30 2020-08-21 蔚复来(浙江)科技股份有限公司 Device and method for long-distance transmission of camera data through parallel bus

Similar Documents

Publication Publication Date Title
CN101816177B (en) Textual image coding
CN107292808B (en) Image processing method and device and image coprocessor
US11949868B2 (en) Method and device for selecting context model of quantization coefficient end flag bit
CN106170922A (en) The source code of data and the equipment of decoding and method
CN103918273A (en) Method of determining binary codewords for transform coefficients
CN105959797A (en) Video decoding method and digital TV
CN103368582A (en) Data coding and decoding method and device
CN103997650A (en) Video decoding method and video decoder
JP2008011460A (en) Turbo decoder
CN102185612A (en) Run-length coding and decoding methods and devices
CN104424498A (en) Method and device for transforming two-dimensional codes at high speed
CN102224727A (en) Image processing apparatus, image processing method and program
Abas et al. Increasing data storage of coloured QR code using compress, multiplexing and multilayered technique
CN105163126A (en) Hardware decoding method and device based on HEVC protocol
CN111242259A (en) Intelligent anti-counterfeiting code encoding and decoding method and system
CN104038765A (en) Rapid and efficient damage-free image compression method oriented to hardware achievement
Abas et al. Expanding the data capacity of QR codes using multiple compression algorithms and base64 encode/decode
CN104519355B (en) Device and method for compact bit-planes data compression
JP5110304B2 (en) Screen data transmitting apparatus, screen data transmitting method, and screen data transmitting program
CN103716445A (en) Dynamic barcode-based data exchange method
CN109474826B (en) Picture compression method and device, electronic equipment and storage medium
CN109379591A (en) Picture code-transferring method, electronic device and computer readable storage medium
CN106874979B (en) Bar code processing, displaying and reading method and device
JP2005055825A (en) Image display device, image display method and image display program
CN108280502B (en) QR code capacity improving method and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20180123

AD01 Patent right deemed abandoned