CN101207705A - Graphic file management method - Google Patents
Graphic file management method Download PDFInfo
- Publication number
- CN101207705A CN101207705A CNA2007102028726A CN200710202872A CN101207705A CN 101207705 A CN101207705 A CN 101207705A CN A2007102028726 A CNA2007102028726 A CN A2007102028726A CN 200710202872 A CN200710202872 A CN 200710202872A CN 101207705 A CN101207705 A CN 101207705A
- Authority
- CN
- China
- Prior art keywords
- picture
- file
- photographs
- address
- management method
- 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
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a graphics management technology, in particular to a management system for graphics storage, output and display. The invention discloses a graphics file management method with saved memory space, improved storage and output accuracy and time efficiency. The technical proposal of the invention comprises the following steps: a. photographs are compressed; b. the photograph attribute of the photographs, the photograph address offset and the initial address which is used for storing database files are inputted into a database file; c. the currently displayed photographs are called out of the database file and into the memory, a storage address of the currently displayed photographs is an initial address which is used for storing the database file and the photographs address offset; d. the currently displayed photographs are decompressed and displayed. The invention has the advantages of the reduced amount of occupied memory, reduced cost of memory request, improved time efficiency and accuracy of photograph output and greatly reduced workload for computing the position of the photographs during the complete procedure of the process, the storage, the call of the photographs.
Description
Technical field
The present invention relates to the graphics management technology, particularly to the storage of figure, the management system that output shows.
Background technology
For the user that gives embedded product (as set-top box) with aesthetic property and convenience, often all need in the operation interface of set-top box, use a large amount of pictures.In the control system of set-top box, to the picture that uses in the operation interface, usually it all is embedded in the program, manage by array of pointers.In writing the process of picture, the programmer at first will obtain the size of picture, again hand computation being carried out in the position of each picture is stitched together each picture, size such as 10 each pictures of picture is 50 bytes, the address in internal memory of each picture is followed successively by A like this, A+50, A+100, A+150, A+200, A+250, A+300, A+350, A+400, A+450 (wherein A is the initial address of dress picture internal memory) is because the size of each picture is general different, so changing picture all needs the address of each picture is calculated at every turn, workload is big, such as existing in the internal memory 200 pictures is arranged, and the picture that change is for leaving first position in, then need the memory location of the picture of 199 of back is calculated again, workload is very big.The weak point of above-mentioned method to pictures management is as follows:
1, on the space management, this mode not only accounts for internal memory but also take FLASH (program is kept among the FLASH, is called in internal memory during startup);
2, in the generative process of picture, the program origin that the programmer needs ten minutes carefully to calculate picture is caused operation extremely loaded down with trivial details, and is made mistakes easily, and a slight internal memory displacement will cause program to be collapsed fully;
When 3, picture is changed, change the position that the figure sector-meeting causes the programmer to calculate whole pictures, increased programmer's the workload and the probability of makeing mistakes.
Summary of the invention
Technical problem to be solved by this invention is to provide a kind of saving memory headroom, the graphic file management method of raising storage and output accuracy rate and time efficient.
The technical scheme that the present invention solve the technical problem employing is that graphic file management method is characterized in that, comprises the following steps:
A, picture is compressed;
B, with the picture attribute, the initial address of picture address side-play amount and stored data base file writes database file;
C, the picture of current demonstration is called in internal memory from database file, the memory address of the picture of described current demonstration is that the initial address of stored data base file adds the picture address side-play amount;
D, decompress(ion) also show the picture of current demonstration.
Further, described database file comprises file header and file data, and file header is deposited picture attribute, picture address side-play amount; The initial address of file data storing stored data base file;
Further, described picture attribute comprises picture name, picture format, picture width, picture height, picture size and palette flag bit and palette setting.
The invention has the beneficial effects as follows, reduced in the process of handling, storing, call at whole picture internal memory occupancy, reduced the memory requirements cost, improved the picture input time efficiency, accuracy rate, significantly reduced the workload of calculating the picture position.The present invention is not only applicable to the control system of set-top box, is equally applicable to other embedded products, such as mobile phone, and the control system of Internet Protocol Television monolithic etc.
The invention will be further described below in conjunction with embodiment.
Embodiment
The present invention is applied in the operation interface graphic file management method of set-top box, adopt the compressed format of class LZ77 to compress in the picture that uses in the operation interface, picture attribute after will compressing again, the picture address side-play amount (with respect to the address offset amount of database file initial address) and the initial address of stored data base write database file; Database file is stored in FLASH or the on-chip memory, only when showing, picture just the picture of current demonstration is called in internal memory (memory address of every pictures is the picture address side-play amount that the initial address of stored data base file adds picture), picture by the current demonstration of index from database file of figure title also reads out, decompress(ion) also is shown on the display device, thereby has saved memory headroom greatly.
Database file comprises file header and file data two parts, and file header is used to describe pictorial information, deposits picture attribute, picture address side-play amount; File data is the data block link information of each database file, deposits the information such as initial address of stored data base file.A data library file comprises a plurality of file headers and a file data, and every pictures all comprises a file header.The form of file header is as shown in the table:
Data name | Take the position |
Magic number | 2BYTE |
Database file head number | 2BYTE |
Palette service marking position | 2BYTE |
Palette | 3*256BYTE |
Picture/mb-type | 4BYTE |
The figure title | 12BYTE |
The picture address side-play amount | 4BYTE |
The continuous table of going up:
The picture width | 4BYTE |
The picture height | 4BYTE |
Picture size | 4BYTE |
Whether compress | 4BYTE |
Wherein:
Magic number is used to deposit file type;
Picture/mb-type is supported BMP8, BMPS (2 bitmap sheet), MPEG, GAM (565), GAM (ARGB4444), GAM (ARGB1555), GAM (YCBCR422), GIF etc.
The detailed process that generates database file is:
At first adopt the compressed format of class LZ77 to compress every pictures, obtain the picture attribute (figure title, picture format, picture width, picture height, picture size etc.) of every pictures, the picture address side-play amount, and show in advance;
Then these pictorial informations (picture attribute, the picture address side-play amount) charges in the small-sized data structure, during database file to be generated, pictorial information in the data structure and file data are write in the database file together, generate " binary file format " database file; If the picture/mb-type of picture is GAM (ARGB4444), can revise the transparency of picture in real time by corresponding transparency options;
When the picture that will add adds " binary file format " database file, if need carry out validation test, then directly import the database file that generated just now, by the picture in the right and left key switch data library file, just can see and add the picture in the database file to again.Confirm by verifying whether each picture that adds can correctly show on computers whether database file is correct like this.
Automatically after interpolation meets the picture (as winnamp adds song) of picture/mb-type with the database file Core Generator, pass through the function of database file head again, retrieve the corresponding information of picture by the figure title, so concerning the developer, the initial address of database file, the picture address side-play amount of each picture all is transparent, realizes automatically, improve operating efficiency, reduced the chance of makeing mistakes.Also make the replacing of picture more fast, make time efficiency than improving more than 3 times originally.The compressed format of picture is adopted the compressed format of class LZ77, can realize quick decompress(ion), when decompress(ion) Shows Picture, do not stagnate sense; Compression ratio has reduced the cost of memory about 30%.
The procedure operation that the database file of realization picture generates is as follows:
-<body>
-<head>
<MAGIC〉be fixed as " 16PC " useless</MAGIC
<headcount〉headcount represent to have what picture U16</headcount
<b_use_palette〉U16 whether use palette</b_use_palette
<palette〉overall palette data U8*3*256 when b_use_palette=0 do not have this field</palette
-<head_info>
-<Type>
Picture/mb-type has BMP_TYPE GIF_TYPE MPG_TYPE U32
-</types of comments 〉
<Bmp_deep8>PIC_TYPE_BMP8=0</Bmp_deep8>
<Bmp_s>PIC_TYPE_BMPS=1</Bmp_s>
<GIF>PIC_TYPE_GIF=2</GIF>
<MPEG>PIC_TYPE_MPEG=3</MPEG>
<BMP565>PIC_TYPE_BMP16_565=4</BMP565>
<BMPA555>PIC_TYPE_BMP16_A555=5</BMPA555>
<BMPA444>PIC_TYPE_BMP16_A444=6</BMPA444>
<YCbCr422>PIC_TYPE_YCBCR422=7</YCbCr422>
-</types of comments 〉
-<Type>
<Name〉character string</Name 〉
<Offset〉with respect to the shift offset of database file initial address</Offset
<Width〉the picture width</Width 〉
<Height〉the picture height</Height 〉
<Size〉picture size</Size 〉
<CRC〉whether compress</CRC 〉
</head_info>
</head>
-<Date>
<DataInfor〉file data</DataInfo 〉
</Date>
Realization is as follows to the algorithm of picture (separating) compression storage:
/*
*Func:PicUncompress
* Desc: the algorithm that is used for the picture decompress(ion)
* In:pCompress-〉former data
* pObjData-〉target data
* uByteLen-〉length of packed data
*Out:n/a
* Notice: the length of target data can be passed through the picture width, and the picture elevation information is calculated
*/
void PicUncompress(U8* pCompress,U16* pObjData,U32 uByteLen)
{
U32 uLoop1,uLoop2,uSrcIndex;
tuple_node tuple;
uLoop1=0;
uLoop2=0;
uSrcIndex=0;
do{
tuple.uOffset=(pCompress[uSrcIndex+3]<<24)+(pCompress[uSrcIndex+2]<<16)+(pCompress[uSrcIndex+1]<<8)+pCompress[uSrcIndex];
uSrcIndex+=4;
tuple.uSize=(pCompress[uSrcIndex+1]<<8)+pCompress[uSrcIndex];
uSrcIndex+=2;
if(tuple.uOffset==0 && tuple.uSize==0)
{
tuple.uData=(pCompress[uSrcIndex+1]<<8)+pCompress[uSrcIndex];
uSrcIndex +=2;
pObjData[uLoop1++]=tuple.uData;
}
else
{
memcpy(&pObjData[uLoop1],&pObjData[tuple.uOffset],(tuple.uSize-1)*2);
uLoop1+=(tuple.uSize-1);
}
}while(uLoop1<uByteLen/2);
return;
}
Claims (7)
1. graphic file management method is characterized in that, comprises the following steps:
A, picture is compressed;
B, with the picture attribute, the initial address of picture address side-play amount and stored data base file writes database file;
C, the picture of current demonstration is called in internal memory from database file, the memory address of the picture of described current demonstration is that the initial address of stored data base file adds the picture address side-play amount;
D, decompress(ion) also show the picture of current demonstration.
2. graphic file management method as claimed in claim 1 is characterized in that described database file comprises file header and file data, and file header is deposited picture attribute, picture address side-play amount; The initial address of file data storing stored data base file.
3. graphic file management method as claimed in claim 2 is characterized in that, described picture attribute comprises picture name, picture format, picture width, picture height, picture size.
4. graphic file management method as claimed in claim 3 is characterized in that, described picture attribute also comprises: palette flag bit and palette setting.
5. as claim 1,2,3 or 4 described graphic file management methods, it is characterized in that among the described step a, the compressed format of picture is the LZ77 form.
6. graphic file management method as claimed in claim 1 is characterized in that described database file leaves in the built-in storage.
7. graphic file management method as claimed in claim 1 is characterized in that described database file leaves in the FLASH memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA2007102028726A CN101207705A (en) | 2007-12-06 | 2007-12-06 | Graphic file management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA2007102028726A CN101207705A (en) | 2007-12-06 | 2007-12-06 | Graphic file management method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101207705A true CN101207705A (en) | 2008-06-25 |
Family
ID=39567543
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNA2007102028726A Pending CN101207705A (en) | 2007-12-06 | 2007-12-06 | Graphic file management method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101207705A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102768662A (en) * | 2011-05-05 | 2012-11-07 | 阿里巴巴集团控股有限公司 | Method and device for loading picture |
CN102982502A (en) * | 2012-11-26 | 2013-03-20 | 康佳集团股份有限公司 | Picture batch conversion method and system |
CN103020584A (en) * | 2012-10-09 | 2013-04-03 | 成都因纳伟盛科技股份有限公司 | Rapid certificate inquiring and identifying method |
CN104156192A (en) * | 2014-08-25 | 2014-11-19 | 广东威创视讯科技股份有限公司 | Displaying method and system of massive bayonet data |
CN110874416A (en) * | 2018-09-04 | 2020-03-10 | 深圳云天励飞技术有限公司 | Image characteristic value storage method and device and electronic equipment |
CN111506550A (en) * | 2020-04-22 | 2020-08-07 | 印推互联网络科技无锡有限公司 | Bluetooth printer picture processing and storing system |
-
2007
- 2007-12-06 CN CNA2007102028726A patent/CN101207705A/en active Pending
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102768662A (en) * | 2011-05-05 | 2012-11-07 | 阿里巴巴集团控股有限公司 | Method and device for loading picture |
CN103020584A (en) * | 2012-10-09 | 2013-04-03 | 成都因纳伟盛科技股份有限公司 | Rapid certificate inquiring and identifying method |
CN102982502A (en) * | 2012-11-26 | 2013-03-20 | 康佳集团股份有限公司 | Picture batch conversion method and system |
CN102982502B (en) * | 2012-11-26 | 2018-10-12 | 康佳集团股份有限公司 | A kind of picture Batch conversion method and system |
CN104156192A (en) * | 2014-08-25 | 2014-11-19 | 广东威创视讯科技股份有限公司 | Displaying method and system of massive bayonet data |
CN110874416A (en) * | 2018-09-04 | 2020-03-10 | 深圳云天励飞技术有限公司 | Image characteristic value storage method and device and electronic equipment |
CN110874416B (en) * | 2018-09-04 | 2022-06-24 | 深圳云天励飞技术有限公司 | Image characteristic value storage method and device and electronic equipment |
CN111506550A (en) * | 2020-04-22 | 2020-08-07 | 印推互联网络科技无锡有限公司 | Bluetooth printer picture processing and storing system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108563711B (en) | Time sequence data storage method based on time nodes | |
CN101207705A (en) | Graphic file management method | |
CN104217023B (en) | It is a kind of to solve the method for map tile storage using packaging technique | |
CN103177077B (en) | The storage of a kind of APK file and output intent | |
CN105009067A (en) | Managing operations on stored data units | |
CN113568995A (en) | Dynamic tile map making method based on retrieval conditions and tile map system | |
CN115438114B (en) | Storage format conversion method, system, device, electronic equipment and storage medium | |
CN114185895A (en) | Data import and export method and device, electronic equipment and storage medium | |
CN108573000A (en) | A kind of method for exhibiting data, device, system and electronic equipment | |
CN113901395B (en) | Data processing method, data processing device, computer equipment and storage medium | |
CN112365598A (en) | Method, device and terminal for converting oblique photography data into three-dimensional data | |
CN115759018A (en) | Report generation method and device, computer equipment and storage medium | |
CN102193873B (en) | Method of quickly reading and writing mass data file | |
CN101369953B (en) | Font network distribution method and system | |
CN110019636A (en) | A kind of storage mode of GIS tile map | |
US20150212991A1 (en) | Content rendition generation and control | |
CN105448236A (en) | LED correction coefficient data segmentation method | |
CN102135954A (en) | Method for describing bill conversion relationships in service management software based on extensive markup language (XML) | |
CN116051345A (en) | Image data processing method, device, computer equipment and readable storage medium | |
CN101382961A (en) | Method for making update file and updating data | |
US8494288B2 (en) | Methods for digital image compression | |
CN102541878B (en) | Method and device for storing project file in non-linear editing | |
CN102841933B (en) | Method and device for writing raster data and method for reading raster data | |
CN103324740A (en) | Set-top box and method and device for displaying pictures | |
CN102404009B (en) | Data compressing and uncompressing method based on information conversion and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Open date: 20080625 |