CN105022788A - Lossless compression algorithm for bin file in PNG picture format and full liquid crystal instrument display system - Google Patents
Lossless compression algorithm for bin file in PNG picture format and full liquid crystal instrument display system Download PDFInfo
- Publication number
- CN105022788A CN105022788A CN201510345514.5A CN201510345514A CN105022788A CN 105022788 A CN105022788 A CN 105022788A CN 201510345514 A CN201510345514 A CN 201510345514A CN 105022788 A CN105022788 A CN 105022788A
- Authority
- CN
- China
- Prior art keywords
- bin file
- pixel
- rgbn
- memory headroom
- numerical value
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
- G06F16/1744—Redundancy elimination performed by the file system using compression, e.g. sparse files
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Liquid Crystal Display Device Control (AREA)
Abstract
The invention relates to a lossless compression algorithm for a bin file in a PNG format and a full liquid crystal instrument display system. The lossless compression algorithm comprises the steps of: reading RGBN pixel points of the bin file in sequence, making statistics on the number of adjacent RGBN pixel points with the same pixel values, and storing the pixel values and the number of the same RGBN pixel points in a memory space; and meanwhile, storing the number of the statistical RGBN pixel points with different pixel values as a feature value in the memory space, and storing corresponding different pixel values in sequence behind the memory space to form the compressed bin file. The lossless compaction algorithm for the bin file in the PNG format and the full liquid crystal instrument display system can realize lossless compression, and have the advantages of high compression ratio, simplicity for operation, high compression speed and high decompression speed.
Description
Technical field
The present invention relates to a kind of 32 PNG picture format pictures and be converted into the compression algorithm after bin file and full liquid crystal instrument display system.
Background technology
At current motor-dom, carrying full liquid crystal instrument has become a kind of new custom.Because full liquid crystal instrument more can embody current technical development, can show more abundant information, interface is hommization and fashion-orientation more, is therefore subject to the favor of motor-dom.The figure that the BMW 7 changing money is at present, the external vehicle such as Cadillac XTS and the BYD Qin, Harvard H7 have full liquid crystal instrument, full liquid crystal instrument starts new trend in car industry.
Because the abundant information of full liquid crystal instrument display, style varied, the files such as this just makes its hardware design and Software for Design quite complicated, needs more picture, video import flash.The selection of flash size is particularly important.But from cost angle analysis, flash is less, cost is lower.In order to reduce costs, file must be made enough little.
Summary of the invention
The object of this invention is to provide a kind of bin file lossless compression algorithm of PNG picture format and full liquid crystal instrument display system, to solve, bin file is effectively compressed, to save the storage space of flash module.
In order to solve the problems of the technologies described above, the invention provides a kind of bin file lossless compression algorithm of PNG picture format, comprise: each RGBN pixel reading bin file from starting position successively, add up individual numerical value that is adjacent and the RGBN pixel of same pixel value, and the pixel value of this identical RGBN pixel and individual numerical value are stored in memory headroom, and also the individual numerical value of the RGBN pixel of the different pixel values of statistics is stored in described memory headroom as eigenwert simultaneously, and after memory headroom, store corresponding different pixel value successively, to form the bin file of compression.
Further, the distribution method of described step memory headroom comprises:
Step S101, the directory address according to original bin file reads bin file, allocation address space;
Step S102, obtains original bin file size by file management instruction;
Step S103, divides according to original bin file size the memory headroom being used in the bin file depositing compression.
Further, the described method pixel value of identical RGBN pixel and individual numerical value being stored in memory headroom comprises: with pixel value and individual numerical value, i.e. R, G, B, N, conter of five byte representation RGBN pixels, wherein, and conter represents a numerical value.
Another aspect, present invention also offers a kind of full liquid crystal instrument display system, comprising: processor module, the LCD MODULE be connected with this processor module, and this processor module is also connected with flash module.
Further, described processor module is suitable for the PNG picture format of importing to be converted to bin file, then stored in described flash module after compressing this bin file.
Further, described processor module is suitable for each RGBN pixel reading bin file from starting position successively, add up individual numerical value that is adjacent and the RGBN pixel of same pixel value, and the pixel value of this identical RGBN pixel and individual numerical value are stored in memory headroom, and also the individual numerical value of the RGBN pixel of the different pixel values of statistics is stored in described memory headroom as eigenwert simultaneously, and after memory headroom, store corresponding different pixel value successively, to form the bin file of compression.
The invention has the beneficial effects as follows, bin file lossless compression algorithm and the full liquid crystal instrument display system of (1) PNG picture format of the present invention can realize Lossless Compression, and it is high to have ratio of compression, and simple to operate, compression speed is fast, the fireballing advantage of decompress(ion); (2) full liquid crystal instrument display system of the present invention can also not reduce on the basis of image display effect, reduces the storage space of flash module, saves the cost of manufacture of display system.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the present invention is further described.
Fig. 1 is the bin file lossless compression algorithm process flow diagram of PNG picture format of the present invention;
Fig. 2 is the process flow diagram of the distribution method of memory headroom of the present invention;
Fig. 3 is the theory diagram of full liquid crystal instrument display system of the present invention.
Embodiment
In conjunction with the accompanying drawings, the present invention is further detailed explanation.These accompanying drawings are the schematic diagram of simplification, only basic structure of the present invention are described in a schematic way, and therefore it only shows the formation relevant with the present invention.
Embodiment 1
As shown in Figure 1, the invention provides a kind of bin file lossless compression algorithm of PNG picture format, comprise: step S1, each RGBN pixel of bin file is read successively from starting position, add up individual numerical value that is adjacent and the RGBN pixel of same pixel value, and the pixel value of this identical RGBN pixel and individual numerical value are stored in memory headroom; Step S2, is also stored in the individual numerical value of the RGBN pixel of the different pixel values of statistics in described memory headroom as eigenwert simultaneously, and after memory headroom, store corresponding different pixel value successively, to form the bin file of compression.
Concrete, by the pixel value of identical RGBN pixel and individual numerical value are stored in memory headroom, to save a large amount of storage space.
As shown in Figure 2, further, the distribution method of described memory headroom comprises:
Step S101, the directory address according to original bin file reads bin file, allocation address space.
Step S102, obtains original bin file size by file management instruction.
Step S103, divides according to original bin file size the memory headroom being used in the bin file depositing compression.
Further, the described method pixel value of identical RGBN pixel and individual numerical value being stored in memory headroom comprises: with pixel value and individual numerical value, i.e. R, G, B, N, conter of five byte representation RGBN pixels, wherein, and conter represents a numerical value.
Embodiment 2
As shown in Figure 2, on embodiment 1 basis, present invention also offers a kind of full liquid crystal instrument display system, comprising: processor module, the LCD MODULE be connected with this processor module, and this processor module is also connected with flash module.
Further, described processor module is suitable for the PNG picture format of importing to be converted to bin file, then stored in described flash module after compressing this bin file.
Further, described processor module is suitable for each RGBN pixel reading bin file from starting position successively, add up individual numerical value that is adjacent and the RGBN pixel of same pixel value, and the pixel value of this identical RGBN pixel and individual numerical value are stored in memory headroom; And be also stored in described memory headroom as eigenwert by the individual numerical value of the RGBN pixel of the different pixel values of statistics, and after memory headroom, store corresponding different pixel value successively, to form the bin file of compression simultaneously.
Embodiment 3
In embodiment 1 and embodiment 2 basis, to this bin file lossless compression algorithm and use the described processor module of this algorithm to launch to be described.
Concrete implementation process comprises:
Preparatory stage, namely the PNG pictures such as 32,24 or 16 are changed into scale-of-two bin file.
Can be confirmed whether to compress by selection.
If without the need to compression, then bin file can not be compressed, but can calculate the size of bin file and store, and be instrument software application, storage size mostly is 20 bytes most.
(1) first decompress(ion) bin file is treated according to src_bin() directory address reading bin file, allocation address space.
(2) then by src_bin_bytes=ftell (fp1); File management instruction obtains fp1 source document size.
(3) then by fread (buffer+20, src_bin_bytes, 1, fp1); File reading bin file to internal memory, the simultaneously memory headroom of allocate file size 20 bytes.
(4) owing to not needing compression, so directly the value of file size, assignment gives the memory headroom of 20 bytes of distributing.
(5) again, by fp2=fopen (des_bin_path, " wb "); Create fp2, be used for storing the file generated.
(6) finally by fwrite (buffer, src_bin_bytes+20,1, fp2); Original bin file is write the core position after distribution 20 byte.
The un-compressed file f p2 of final acquisition, for follow-up functions such as displays.
If bin file is compressed, namely
(1) first decompress(ion) bin file is treated according to src_bin() directory address reading bin file, allocation address space.
(2) then by src_bin_bytes=ftell (fp1); Namely file management instruction obtains fp1 source document size.
(3) then by fread (buffer+20, src_bin_bytes, 1, fp1); File reading bin file to internal memory, the simultaneously memory headroom of allocate file size 20 bytes.
(4) from RGBN starting position, read buffer and terminate, each reading four bytes.
if((buffer[i] == buffer[i+4])&&(buffer[i+1] == buffer[i+5])&&(buffer[i+2] == buffer[i+6])&&(buffer[i+3] == buffer[i+7]))
If condition is set up, then think that adjacent two pixels are identical, record same pixel point number conter,
By that analogy, 256 same pixel can be recorded at most, because the buffer space distributed to conter is 1 byte (variable), therefore, the storage space of same pixel point just can use five byte representations, is R, G, B, N, conter respectively.
(5) record the number of different pixels point, i.e. eigenwert, use eigenwert so that calculate the size of the rear file of compression, assignment gives 20 bytes simultaneously.
(6), after compressing file success by the time, the value of file size after compression, assignment gives the memory headroom of 20 bytes of distributing, and R, G, B, N associated pixel data copies 20 byte positions below of buffer to.
(7) each different pixels is stored in position after 20 bytes successively according to reading order, the internal memory buffer that the compressed file that will generate like this is corresponding just generates.
(8) more afterwards by fp2=fopen (des_bin_path, " wb "); Create fp2, be used for storing the file generated.
(9) final step, fwrite (buffer, src_bin_bytes+20,1, fp2); Original bin file is write the core position after distribution 20 byte.
Finally obtain the fp2 compressed file needed, the bin file namely compressed.
With above-mentioned according to desirable embodiment of the present invention for enlightenment, by above-mentioned description, relevant staff in the scope not departing from this invention technological thought, can carry out various change and amendment completely.The technical scope of this invention is not limited to the content on instructions, must determine its technical scope according to right.
Claims (6)
1. a bin file lossless compression algorithm for PNG picture format, is characterized in that, comprising:
Each RGBN pixel of bin file is read successively from starting position, add up individual numerical value that is adjacent and the RGBN pixel of same pixel value, and the pixel value of this identical RGBN pixel and individual numerical value are stored in memory headroom, and also the individual numerical value of the RGBN pixel of the different pixel values of statistics is stored in described memory headroom as eigenwert simultaneously, and after memory headroom, store corresponding different pixel value successively, to form the bin file of compression.
2. the bin file lossless compression algorithm of PNG picture format according to claim 1, is characterized in that,
The distribution method of described step memory headroom comprises:
Step S101, the directory address according to original bin file reads bin file, allocation address space;
Step S102, obtains original bin file size by file management instruction;
Step S103, divides according to original bin file size the memory headroom being used in the bin file depositing compression.
3. the bin file lossless compression algorithm of PNG picture format as claimed in claim 2, it is characterized in that, the described method pixel value of identical RGBN pixel and individual numerical value being stored in memory headroom comprises: with pixel value and the individual numerical value of five byte representation RGBN pixels, i.e. R, G, B, N, conter, wherein, conter represents a numerical value.
4. a full liquid crystal instrument display system, is characterized in that, comprising: processor module, the LCD MODULE be connected with this processor module, and this processor module is also connected with flash module.
5. full liquid crystal instrument display system as claimed in claim 4, it is characterized in that, described processor module is suitable for the PNG picture format of importing to be converted to bin file, then stored in described flash module after compressing this bin file.
6. full liquid crystal instrument display system as claimed in claim 5, it is characterized in that, described processor module is suitable for each RGBN pixel reading bin file from starting position successively, add up individual numerical value that is adjacent and the RGBN pixel of same pixel value, and the pixel value of this identical RGBN pixel and individual numerical value are stored in memory headroom, and also the individual numerical value of the RGBN pixel of the different pixel values of statistics is stored in described memory headroom as eigenwert simultaneously, and after memory headroom, store corresponding different pixel value successively, to form the bin file of compression.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510345514.5A CN105022788A (en) | 2015-06-19 | 2015-06-19 | Lossless compression algorithm for bin file in PNG picture format and full liquid crystal instrument display system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510345514.5A CN105022788A (en) | 2015-06-19 | 2015-06-19 | Lossless compression algorithm for bin file in PNG picture format and full liquid crystal instrument display system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105022788A true CN105022788A (en) | 2015-11-04 |
Family
ID=54412758
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510345514.5A Pending CN105022788A (en) | 2015-06-19 | 2015-06-19 | Lossless compression algorithm for bin file in PNG picture format and full liquid crystal instrument display system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105022788A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105389387A (en) * | 2015-12-11 | 2016-03-09 | 上海爱数信息技术股份有限公司 | Compression based deduplication performance and deduplication rate improving method and system |
CN106740113A (en) * | 2017-01-12 | 2017-05-31 | 苏州速显微电子科技有限公司 | A kind of type pointer virtual instrument disk and its implementation |
CN109271538A (en) * | 2018-08-20 | 2019-01-25 | 深圳和而泰智能控制股份有限公司 | A kind of picture storage method and relevant device |
CN109640065A (en) * | 2018-10-26 | 2019-04-16 | 深圳市华星光电技术有限公司 | A method of for picture data processing |
CN116309893A (en) * | 2023-05-18 | 2023-06-23 | 深圳市微克科技有限公司 | Picture compression method and device, storage medium and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6389340B1 (en) * | 1998-02-09 | 2002-05-14 | Gary A. Rayner | Vehicle data recorder |
CN1595452A (en) * | 2003-09-10 | 2005-03-16 | 联想(北京)有限公司 | Lossless compression method for graphic file |
CN1866314A (en) * | 2006-04-19 | 2006-11-22 | 秦国锋 | Multi-circuitry dynamic scheduling vehicular terminal |
CN101079762A (en) * | 2006-05-25 | 2007-11-28 | 秦国锋 | Onboard terminal for real-time collecting and distributing traveling records |
CN101977061A (en) * | 2010-10-19 | 2011-02-16 | 广西师范大学 | Lossless compression and decompression method for general information |
-
2015
- 2015-06-19 CN CN201510345514.5A patent/CN105022788A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6389340B1 (en) * | 1998-02-09 | 2002-05-14 | Gary A. Rayner | Vehicle data recorder |
CN1595452A (en) * | 2003-09-10 | 2005-03-16 | 联想(北京)有限公司 | Lossless compression method for graphic file |
CN1866314A (en) * | 2006-04-19 | 2006-11-22 | 秦国锋 | Multi-circuitry dynamic scheduling vehicular terminal |
CN101079762A (en) * | 2006-05-25 | 2007-11-28 | 秦国锋 | Onboard terminal for real-time collecting and distributing traveling records |
CN101977061A (en) * | 2010-10-19 | 2011-02-16 | 广西师范大学 | Lossless compression and decompression method for general information |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105389387A (en) * | 2015-12-11 | 2016-03-09 | 上海爱数信息技术股份有限公司 | Compression based deduplication performance and deduplication rate improving method and system |
CN105389387B (en) * | 2015-12-11 | 2018-12-14 | 上海爱数信息技术股份有限公司 | A kind of data de-duplication performance based on compression and the method and system for deleting rate promotion again |
CN106740113A (en) * | 2017-01-12 | 2017-05-31 | 苏州速显微电子科技有限公司 | A kind of type pointer virtual instrument disk and its implementation |
CN109271538A (en) * | 2018-08-20 | 2019-01-25 | 深圳和而泰智能控制股份有限公司 | A kind of picture storage method and relevant device |
CN109640065A (en) * | 2018-10-26 | 2019-04-16 | 深圳市华星光电技术有限公司 | A method of for picture data processing |
CN116309893A (en) * | 2023-05-18 | 2023-06-23 | 深圳市微克科技有限公司 | Picture compression method and device, storage medium and electronic equipment |
CN116309893B (en) * | 2023-05-18 | 2023-08-11 | 深圳市微克科技有限公司 | Picture compression method and device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105022788A (en) | Lossless compression algorithm for bin file in PNG picture format and full liquid crystal instrument display system | |
US8990518B2 (en) | Methods of and apparatus for storing data in memory in data processing systems | |
CN105431831B (en) | Data access method and the data access device for utilizing same procedure | |
US20080186318A1 (en) | Memory management for systems for generating 3-dimensional computer images | |
CN105933708B (en) | A kind of method and apparatus of data compression and decompression | |
CN111311716B (en) | Animation playing method, device, terminal equipment and storage medium | |
CN109840879B (en) | Image rendering method and device, computer storage medium and terminal | |
US11769234B2 (en) | Methods and apparatus for histogram based tone mapping | |
CN108027637A (en) | System and method for carrying out control memory frequency using feedforward compression statistics | |
CN104952088A (en) | Method for compressing and decompressing display data | |
US10824357B2 (en) | Updating data stored in a memory | |
WO2022104964A1 (en) | Dynamic partition customization method and apparatus, and device | |
CN108388461A (en) | A kind of screen picture intercept method and device for firmware | |
CN106227506A (en) | A kind of multi-channel parallel Compress softwares system and method in memory compression system | |
CN101924950A (en) | Data compression method for intelligent accelerating image display and device | |
CN101207705A (en) | Graphic file management method | |
CN103093413B (en) | A kind of remote sensing image data write and the method and apparatus read | |
CN106095365B (en) | Screen adjustment menu data processing method and processing device | |
CN109983533A (en) | Extraction for fixing color and pattern subframe is reduced | |
US20220398686A1 (en) | Methods of and apparatus for storing data in memory in graphics processing systems | |
US11907855B2 (en) | Data transfers in neural processing | |
CN103530417B (en) | file unpacking method and device | |
CN105279279B (en) | From the method and device of low speed data source load compression data file | |
US11954028B2 (en) | Accessing encoded blocks of data | |
EP1225704A1 (en) | "A process and system for compressing and decompressing digital information and computer program product therefor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20151104 |