A method and device for establishing and querying a linked list code table of a GIF file
Through the method of establishing a linked list code table, the problems of high resource occupation and low storage efficiency during the decoding of GIF files are solved, efficient code table storage and fast query are realized, and hardware resources are saved.
Patent Information
- Application Number
- CN202111357252.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-11-16
AI Technical Summary
The existing GIF file decoding process relies on software, occupies a large amount of resources, and has low code table storage efficiency, resulting in wasted hardware resources.
The method of establishing a linked list code table is adopted, and the arrangement order of the basic codeword units is used as the index address to form a basic character area, and combined with the index addresses of other codeword units to form an extended character area to realize efficient storage and fast query of the code table.
Reduces the resources occupied by code table storage, improves resource utilization, simplifies the query process, and saves hardware resources.
Smart Images

Figure CN114022579B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image coding and decoding, and in particular relates to a method and device for establishing and querying a linked list code table of a GIF file. Background Art
[0002] With the rapid development of automotive electronics, Internet of Things, artificial intelligence, and smart wearable industries, microcontroller unit (MCU) companies have created a broad market and also driven the rapid development of the MCU industry. High performance, low power consumption, high integration, and high security have gradually become the development trend of MCU. The implementation of these MCU applications mostly relies on the graphical user interface (GUI) for human-computer control interaction and information transmission. The GUI interface uses pictures to identify different function definitions, making human-computer interaction simple, easy to understand, and easy to operate. At the same time, as people have higher requirements for the functions provided by these devices, ordinary static pictures can no longer meet the needs, so dynamic pictures are needed to fill the gap.
[0003] The common dynamic picture format is Graphics Interchange Format (GIF for short), and currently GIF files almost all rely on software to complete the decoding process, which requires a lot of software processing time and resources. Although Liao Teng proposed a hardware implementation method for GIF image decoding in 2009, the decoding power consumption was reduced by reducing the number of times of reading and writing RAM in hardware design, but it only involved improvements in low power consumption, and did not provide the process of code table establishment. According to the GIF encoding principle, the code table is established by hardware implementation, which requires a large space for storage. This is because the length of each code word is not equal, and the position where the maximum code word appears is also uncertain, so the reserved length of each code word needs to be designed according to the maximum code word length space. However, not every code word has reached the maximum code word length, and in fact, most of the code word lengths are shorter, so the utilization rate of the code word storage space is very low, and there is a lot of waste of space. Summary of the invention
[0004] Based on the problems existing in the prior art, the present invention proposes a method and device for establishing and querying a linked list code table for GIF files. Through a new GIF encoding code table implementation method proposed by the present invention, the combination relationship of basic code words can be fully utilized, so that the combined basic code words can store more code word information; so that the resources occupied by the code table storage can be reduced, the resource utilization rate can be maximized, and the query and implementation are convenient.
[0005] In a first aspect of the present invention, the present invention provides a method for establishing a linked list code table of a GIF file, the method comprising:
[0006] Obtain basic codeword units in the GIF file, each of which includes a basic character and a corresponding link address;
[0007] The arrangement order of the basic codeword units is used as the corresponding index address, and the basic character area is formed according to the order of the index addresses;
[0008] The basic codeword unit of the basic character area is combined with the index addresses of other codeword units to form a new codeword unit, and then the sorting order of the basic character area is continued, and the arrangement order is used as the index address corresponding to the codeword unit to form an extended character area;
[0009] The index addresses corresponding to all codeword units are used as code table addresses to form a linked list code table of the GIF file. Further, the basic codeword unit of the basic character area is combined with the index addresses of other basic codeword units, including combining the index addresses of the previous one or more consecutive basic codeword units with the current codeword unit.
[0010] Furthermore, combining the basic codewords of the basic character area with the index addresses of other codeword units also includes combining the basic codewords of the basic character area with the index addresses of other basic codeword units, or combining the basic codewords of the basic character area with the index addresses of other codeword units in the extended character area.
[0011] In a second aspect of the present invention, the present invention further provides a linked list code table establishment device for a GIF file, the device comprising:
[0012] A first acquisition module is used to acquire basic codeword units in a GIF file, each of which includes a basic character and a corresponding link address;
[0013] The first encoding module uses the arrangement order of the basic codeword units as the corresponding index addresses, and forms a basic character area according to the order of the index addresses;
[0014] The second encoding module combines the basic codeword unit of the basic character area with the index address of other codeword units to form a new codeword unit, and then continues to arrange the sorting order of the basic character area, using the arrangement order as the index address corresponding to the codeword unit, and forming an extended character area;
[0015] The code table embedding module uses the index addresses corresponding to all code word units as code table addresses and forms a linked list code table of the GIF file.
[0016] Furthermore, the second encoding module includes:
[0017] A parsing unit, which parses out the index addresses of the basic code word unit and other code word units in the basic character area;
[0018] A combining unit, combining the parsed basic codeword unit of the basic character area with the index addresses of other codeword units;
[0019] The encoding unit arranges the combined new code word units in the sorting order of the basic character area, uses the arrangement order as the index address corresponding to the code word unit, and forms an extended character area.
[0020] In a third aspect of the present invention, the present invention further provides a linked list code table query method for a GIF file, the method comprising:
[0021] Obtain an index value of a linked list code table of a GIF file, and obtain a corresponding codeword unit according to the index value;
[0022] If the obtained code word unit is a basic code word unit in the basic character area, the query decoding of the basic code word unit is directly completed;
[0023] If the obtained codeword unit is a codeword unit in the extended character area, then the basic codeword part of the codeword unit is taken out as the constituent element of the codeword unit, and the index address information is taken out as the index address of the next basic codeword unit;
[0024] The index address is used as a new index value, and the next basic codeword is obtained using the new index value;
[0025] Until the remaining index address is within the index address range of the basic code word unit, the query decoding of the new code word unit is completed.
[0026] Furthermore, before completing the query decoding of the new codeword unit, the step further includes reverse splicing one or more basic codeword units taken out of the new codeword unit.
[0027] In a fourth aspect of the present invention, the present invention further provides a linked list code table query device for a GIF file, the device comprising:
[0028] The second acquisition module is used to obtain the linked list code table of the GIF file and the index value corresponding to its decoding;
[0029] A first query module obtains a corresponding codeword unit according to the index value;
[0030] The first decoding module directly completes the query decoding of the basic code word unit if the obtained code word unit is a basic code word unit in the basic character area;
[0031] The second decoding module, if the obtained code word unit is a code word unit in the extended character area, takes out the basic code word part of the code word unit as the constituent element of the code word unit, takes out the index address information as the index address of the next basic code word unit; uses the index address as the new index value, and uses this new index value to obtain the next basic code word unit; until the remaining index address is the index address range of the basic code word unit, the query decoding of the new code word unit is completed.
[0032] Furthermore, the second decoding module includes:
[0033] The decoding unit extracts the basic codeword unit from the new codeword unit, extracts the index address of the next basic codeword unit to obtain the next codeword unit, that is, extracts the new index address to obtain the next codeword unit, until all basic codewords are extracted;
[0034] The concatenation unit concatenates one or more basic codeword units taken out from each codeword unit in reverse order.
[0035] Beneficial effects of the present invention:
[0036] The code table format of the present invention is stored in the format of "link address + new basic code word", so that the number of bits required to store each code word unit is reduced to 20 bits, that is, only 12 bits of linked list address + 8 bits of basic character are needed, which greatly reduces the waste of code table storage space and saves hardware resources. At the same time, the present invention can quickly query the corresponding code word character with the help of the chain relationship between the basic code word and the index address. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 : is a flow chart of a method for establishing a linked list code table of a GIF file in an embodiment of the present invention;
[0038] Figure 2 It is a schematic diagram of a linked list code in an embodiment of the present invention;
[0039] Figure 3 1 is a structural diagram of a linked list code table establishment device for a GIF file in an embodiment of the present invention;
[0040] Figure 4 : is a flow chart of a linked list code table query method for a GIF file in an embodiment of the present invention;
[0041] Figure 5 It is a schematic diagram of a linked list code in an embodiment of the present invention;
[0042] Figure 6 It is a structural diagram of a linked list code table query device for GIF files in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] The current GIF file decoding needs to rely on a large amount of software resources and time costs. Based on this, the present invention considers using hardware RTL to implement the decoding of GIF files, and completes the linked list code table establishment and query process of GIF files. The RTL code table is implemented through a readable and writable MEM. A 4096x20bit single-port MEM is opened. Through the read GIF file information, the basic codeword, extended codeword and link address are written into the corresponding address of MEM according to the index value. When querying, the index value obtained by the GIF file is used to obtain the codeword information at the corresponding address of MEM.
[0045] Figure 1 : is a flow chart of a method for establishing a linked list code table of a GIF file in an embodiment of the present invention. Figure 1 As shown, the method includes:
[0046] 101. Obtain basic codeword units in a GIF file, each of which includes a basic character and a corresponding link address;
[0047] GIF files store image-related information in units of data blocks. A GIF file consists of data blocks representing graphics / images, data sub-blocks, and control information blocks for displaying graphics / images, which are called GIF data streams. All control information blocks and data blocks in the data stream must be between the file header and the file trailer. The GIF file format uses the LZW (Lempel-Ziv Walch) compression algorithm to store image data and defines a transparency attribute that allows users to set the background for the image. In addition, the GIF file format can store multiple color graphics / images in one file. If multiple images are stored in a GIF file, they can be displayed like a slide show or demonstrated like an animation.
[0048] In an embodiment of the present invention, a GIF file contains multiple basic codeword units, and these basic codeword units themselves contain some link addresses. Each basic codeword unit corresponds to a link address, and this link address can point to the basic codeword unit, that is, the basic codeword unit can be found through the link address. The link address here is the arrangement order of the basic codeword units, that is, the index address corresponding to the basic codeword unit.
[0049] 102. Using the arrangement order of the basic codeword units as corresponding index addresses, and arranging them in order of the index addresses to form a basic character area;
[0050] In the embodiment of the present invention, the link address of the basic codeword unit is used as the corresponding index address, and the basic codeword unit can be pointed to by the index address. In the decoding process, the basic codeword unit can be queried by the index address; at the same time, the present invention also sorts the index address corresponding to each basic codeword unit. For example, Figure 2 As shown, assuming that a GIF file includes n+1 basic codeword units (0, 1, 2, ..., n), each basic codeword unit corresponds to a link address (index address), then there are a total of n+1 index addresses (addr0, addr1, addr2, ..., addrn), we let the basic codeword unit 0 correspond to the index address addr0, the basic codeword unit 1 corresponds to the index address addr 1, ..., the basic codeword unit n corresponds to the index address addr n, and they are arranged according to addr0, addr1, addr2, ..., addrn to form a basic character area.
[0051] 103. Combine the basic code word unit of the basic character area with the index addresses of other code word units to form a new code word unit, and then continue to arrange the sorting order of the basic character area, use the arrangement order as the index address corresponding to the code word unit, and form an extended character area;
[0052] In the embodiment of the present invention, the basic codeword units are directly given by the GIF file. The present invention needs to use these basic codeword units to combine. The length and order of the combination are different, which is a new codeword unit. At the same time, it can still be given an index value in order. This index value is the location where the codeword unit is stored when the hardware is implemented. For example, Figure 2As shown, the linked list code table takes the code word unit composed of two basic characters as an example. The two combined basic code word units are the combination of the index address of the first basic code word unit and the second basic code word unit, and the combination information is placed at the address of the code word unit index. Assuming that a GIF file includes m combined code word units (x1, x2, ..., xm), each combined code word unit corresponds to a link address (index address), then there are a total of m index addresses (addrn+1, addr n+2, ..., addrn+m). We let the combined code word unit x1 correspond to the index address addr n+1, the combined code word unit x2 corresponds to the index address addr n+2, ..., the combined code word unit xm corresponds to the index address addr n+m, and arrange them according to addr n+1, addrn+2, ..., addr n+m to form an extended character area.
[0053] In a preferred embodiment of the present invention, the index addresses of the first one or more consecutive basic codeword units can be combined with the current basic codeword unit. For example, the index addresses of the first two basic codeword units can be combined with the third basic codeword, and the combination information can be placed at the address of the codeword unit index. Of course, the codeword combination method of the present invention can also be inferred in turn. The present invention does not specifically limit the length and order of the codeword combination.
[0054] In a preferred embodiment of the present invention, the present invention can also combine the basic code word unit of the basic character area with the index addresses of other basic code word units, or combine the basic code word unit of the basic character area with the index addresses of other code word units in the extended character area, that is, the present invention can combine the basic code word unit with the index address of any code word unit, where the arbitrary code word unit can be either a basic code word unit or a newly generated code word unit.
[0055] 104. Use the index addresses corresponding to all code word units as code table addresses, and form a linked list code table of the GIF file.
[0056] In an embodiment of the present invention, the basic character area and the extended character area are placed in a linked list code table, in which they are arranged in sequence according to the index addresses of addr0, addr1, addr2, ..., addrn ... addr n+1, addr n+2, ..., addr n+m, thereby forming a linked list code table of the GIF file of the present invention.
[0057] Figure 3 : is a structural diagram of a linked list code table establishment device for a GIF file in an embodiment of the present invention, such as Figure 3 As shown, the linked list code table establishment device 200 includes:
[0058] The first acquisition module 201 is used to acquire basic code word units in the GIF file, each of which includes a basic character and its corresponding link address;
[0059] In an embodiment of the present invention, the first acquisition module 201 can be an MCU interface or a hardware functional module with an acquisition function. The MCU or the hardware functional module acquires the basic code word units in the GIF file. The basic code word units are determined by the GIF file, and each basic code word unit includes a basic character and its corresponding link address.
[0060] The first encoding module 202 uses the arrangement order of the basic codeword units as corresponding index addresses, and forms a basic character area according to the order of the index addresses;
[0061] In the embodiment of the present invention, the arrangement order of the basic codeword units may correspond to the link addresses of the basic codeword units. The link addresses of the basic codeword units are used as the corresponding index addresses, and the basic codeword units can be pointed to by the index addresses. In the decoding process, the basic codeword units can be queried by the index addresses. At the same time, the present invention also sorts the index addresses corresponding to each basic codeword unit. For example, Figure 2 As shown, assuming that a GIF file includes n+1 basic codeword units (0, 1, 2, ..., n), each basic codeword unit corresponds to a link address (index address), then there are a total of n+1 index addresses (addr0, addr1, addr2, ..., addrn), we let the basic codeword unit 0 correspond to the index address addr0, the basic codeword unit 1 corresponds to the index address addr 1, ..., the basic codeword unit n corresponds to the index address addr n, and they are arranged according to addr0, addr1, addr2, ..., addrn to form a basic character area.
[0062] The second encoding module 203, which can be an MCU or a hardware module with code table recognition, combines the basic codeword units in the basic character area with the index addresses of other codeword units to form the codeword information of the new codeword unit, and then arranges the basic character area in order, and uses the arrangement order as the index address corresponding to the codeword unit to form an extended character area; in an embodiment of the present invention, the basic codeword unit is directly given by a GIF file, and the present invention needs to use these basic codeword units for combination. The length and order of the combination are different, which is a new codeword unit. At the same time, it can still be given an index value in order. This index value is the location where the codeword unit is stored when the hardware is implemented. For example, if Figure 2As shown, the linked list code table takes the code word unit composed of two basic characters as an example. The two combined basic code word units are to combine the index address of the first basic code word unit with the second basic code word unit, and put this combination information at the address of the code word unit index. Still assuming that a GIF file includes m combined code word units (x1, x2, ..., xm), each combined code word unit corresponds to a link address (index address), then there are a total of m index addresses (addrn+1, addr n+2, ..., addrn+m), we let the combined code word unit x1 correspond to the index address addr n+1, the combined code word unit x2 corresponds to the index address addr n+2, ..., the combined code word unit xm corresponds to the index address addr n+m, and arrange them according to addr n+1, addr n+2, ..., addrn+m to form an extended character area.
[0063] In a preferred embodiment of the present invention, the second encoding module 203 includes:
[0064] A parsing unit 2031 is used to parse out information and index addresses of the basic code word unit and other code word units in the basic character area;
[0065] In an embodiment of the present invention, the parsing unit 2031 can parse out the index address of the corresponding basic code word unit and other basic code word units. The parsing unit 2031 can parse the index address and the corresponding basic character area. For example, the basic code word unit 3 and the index address addr2 of the basic code word unit can be parsed.
[0066] In the embodiment of the present invention, the parsing unit 2031 can parse out the code word unit in the basic character area and the index addresses of other basic code word units in the basic character area and parse out the index addresses of other code word units in the extended character area.
[0067] A combining unit 2032 combines the parsed basic code word unit of the basic character area with the index address of the code word unit associated therewith to form new code word unit information, and stores it according to the arranged index address;
[0068] Corresponding to the parsing unit 2031, in an embodiment of the present invention, the combining unit 2032 can combine the code word unit of the basic character area with the index address of other basic code word units in the basic character area, or combine the code word unit of the basic character area with the index address of other code word units in the extended character area.
[0069] In an embodiment of the present invention, the last basic code unit 9 (corresponding to basic character 9) of the parsed code unit and the index address of its associated preceding code unit 4 (corresponding to basic character 4) can be combined as the parsed code unit information.
[0070] The encoding unit 2033 arranges the combined new code word units in the sorting order of the basic character area, uses the arrangement order as the index address corresponding to the code word unit, and forms an extended character area.
[0071] In the embodiment of the present invention, the encoding unit 2033 arranges the combined new codeword units according to their corresponding index addresses as addr n+1, addr n+2, ..., addr n+m to form an extended character area.
[0072] The code table embedding module 204 uses the index addresses corresponding to all the code word units as code table addresses, and forms a linked list code table of the GIF file.
[0073] In an embodiment of the present invention, the code table embedding module 204 puts the basic character area and the extended character area into a linked list code table, in which they are arranged in sequence according to the index addresses of addr0, addr1, addr2,…, addrn…addr n+1, addr n+2,…, addr n+m, thereby forming a linked list code table of the GIF file of the present invention.
[0074] Figure 4 : is a flow chart of a linked list code table query method for a GIF file in an embodiment of the present invention, such as Figure 4 As shown, the query method includes:
[0075] 301. Obtain an index value of a linked list code table of a GIF file, and obtain a corresponding codeword unit according to the index value;
[0076] In an embodiment of the present invention, a linked list code table of a GIF file is generated by the linked list code table establishment method of the above-mentioned GIF file of the present invention. When the code table needs to be queried, the present invention first needs to obtain the linked list code table of the corresponding GIF file and its index value, and obtain the corresponding code word unit therein according to the index value. For example, if the index value addr2 is given, the corresponding code word unit can be found based on the index value addr2.
[0077] 302. If the obtained code word unit is a basic code word unit in the basic character area, directly complete the query decoding of the basic code word unit;
[0078] If the code unit corresponding to the index value is a basic code unit in the basic character area, that is, the index value is any index address among addr0, addr1, addr2, ..., addrn, then the corresponding code unit can be directly found through the index address to complete the code table query process.
[0079] 303. If the obtained codeword unit is a codeword unit in the extended character area, extract the basic codeword part of the codeword unit as a constituent element of the codeword unit, and extract the index address information as the index address of the next basic codeword unit;
[0080] If the codeword unit corresponding to the index value is the corresponding new codeword unit after combination in the extended character area, that is, the index value is any index address among addrn+1, addr n+2,…, addrn+m, then the corresponding combined codeword information can be found through the index address, the basic codeword part of the codeword unit is taken out as the constituent element of the codeword unit, and the index address information is taken out as the index address of the next basic character. For example, assuming that the index address is a combination of the index addresses of the first two basic codeword units and the third basic codeword, then the basic codeword will be extracted here and represented as the third basic codeword, and then the index addresses of the second basic codeword unit and the first basic codeword unit are obtained, and the corresponding second basic codeword is found according to the index address of the second basic codeword unit, and the corresponding first basic codeword is found according to the index address of the first basic codeword, so that all the codewords of this combined codeword unit can be obtained.
[0081] In some other embodiments of the present invention, the present invention can also combine any existing code word unit of any continuous index address with any basic code word unit. For example, addrn+1, addr n+2 can be combined with basic code word unit 0. The advantage of this is that it can expand a wider representation range.
[0082] 304. Use the index address as a new index value, and use the new index value to obtain the next codeword unit;
[0083] In the embodiment of the present invention, the remaining index address after the initial decoding is used to obtain the next codeword unit. Through this cyclic method of decoding and obtaining a new code table index, the maximum codeword resource can be obtained with the minimum query cost.
[0084] 305. Until the remaining index address is within the index address range of the basic code word unit, the query decoding of the new code word unit is completed;
[0085] In an embodiment of the present invention, through the above indexing process, until the remaining index address is the index address range of the basic code word unit is addr0, addr1, addr2, ..., addrn, it means that the index address can only point to the basic code word unit, and the code word query ends until the final basic code word unit is queried.
[0086] In a preferred embodiment of the present invention, before completing the query decoding of the new codeword unit, the process further includes reversing the order of one or more basic codeword units taken out of the new codeword unit, such as Figure 5 As shown, assuming that the parsed index address is addrn+m-1, use this index address to obtain the codeword information, take out the basic character part (basic character 5) from the read data, take out the link address part (addrn+l+1), the addrn+l+1 link address belongs to the extended character part, indicating that the codeword unit has not ended. Then use the index address addrn+l+1 to obtain the code table information, take out the basic character part (basic character 9) from the read data, and take out the link address part (addr3). The addr3 link address belongs to the basic character area, indicating that the next index character is the last character of the codeword unit. Use the index address addr3 to obtain the code table information, take out the basic character part (basic character 3) from the read data, and arrange the obtained basic characters in reverse order (basic character 3+basic character 9+basic character 5), that is, get the codeword unit corresponding to the index address addrn+m+1.
[0087] Figure 6 : is a structural diagram of a linked list code table query device for a GIF file in an embodiment of the present invention, such as Figure 6 As shown, the linked list code table query device 400 includes:
[0088] The second acquisition module 401 is used to obtain the code table index value of the GIF file;
[0089] In the embodiment of the present invention, the second acquisition module 401 may be an MCU interface or a hardware functional module with an acquisition function, and acquires the code table index value of the GIF file from the MCU or the hardware functional module.
[0090] A first query module 402 obtains a corresponding codeword unit according to the index value;
[0091] In the embodiment of the present invention, when the code table needs to be queried, the corresponding code word unit is obtained according to the index value. For example, if the index value addr2 is given, the corresponding code word unit can be found based on the index value addr2.
[0092] The first decoding module 403 directly completes the query decoding of the basic code word unit if the obtained code word unit is a basic code word unit in the basic character area;
[0093] In an embodiment of the present invention, the first decoding module 403 decodes the basic codeword in the basic character area for the codeword unit corresponding to the index value, that is, if the index value is any index address among addr0, addr1, addr2, ..., addrn, then the corresponding basic codeword can be directly found through the index address to complete the code table query process.
[0094] The second decoding module 404, if the obtained code word unit is a code word unit in the extended character area, then takes out the basic code word part of the code word unit as the constituent element of the code word unit, takes out the index address information as the index address of the next basic code word unit; uses the index address as a new index value, and uses this new index value to obtain the next basic code word unit; until the remaining index address is within the index address range of the basic code word unit, the query decoding of the new code word unit is completed.
[0095] In an embodiment of the present invention, the second decoding module 404 decodes the codeword unit corresponding to the index value as the new codeword unit corresponding to the combination in the extended character area, that is, the index value is any index address among addrn+1, addrn+2,…, addrn+m, then the corresponding combined codeword unit can be found through the index address, and this combined codeword unit contains basic character information and the next index address information. For example, assuming that the index address is a combination of the index addresses of the first two basic codeword units and the third basic codeword, then a basic character will be extracted here to represent the last basic codeword of the codeword unit, and then the index address of the second-to-last basic codeword is obtained, and the corresponding second basic codeword and the index information of the first basic codeword are found according to the index address of the second-to-last basic codeword, and the corresponding first basic codeword is found according to the index address of the first basic codeword, so that all the codewords of this combined codeword unit can be obtained.
[0096] In a preferred embodiment of the present invention, the second encoding module 404 includes:
[0097] The decoding unit 4041 extracts the basic codeword in the new codeword information, extracts the index address of the next basic codeword unit, and obtains the next basic codeword according to the index address until all basic codewords are extracted;
[0098] The concatenation unit 4042 concatenates one or more basic codeword units taken out from each codeword unit in reverse order.
[0099] In the description of the present invention, it is necessary to understand that the terms "coaxial", "bottom", "one end", "top", "middle", "the other end", "upper", "one side", "top", "inside", "outside", "front", "center", "both ends" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0100] In the present invention, unless otherwise clearly stipulated and limited, the terms such as "installation", "setting", "connection", "fixation" and "rotation" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. Unless otherwise clearly defined, ordinary technicians in this field can understand the specific meanings of the above terms in the present invention according to the specific circumstances.
[0101] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for establishing a linked list code table of a GIF file, characterized in that: The method comprises: Obtain basic codeword units in the GIF file, each of which includes a basic character and a corresponding link address; The arrangement order of the basic codeword units is used as the corresponding index address, and the basic character area is formed according to the order of the index address; The basic codeword unit of the basic character area is combined with the index addresses of other codeword units to form a new codeword unit, and then the sorting order of the basic character area is continued, and the arrangement order is used as the index address corresponding to the codeword unit to form an extended character area; Among them, the combining of the basic code word units in the basic character area with the index addresses of other code word units includes combining the index addresses of the previous one or more consecutive basic code word units with the current code word unit; or combining the code word units in the basic character area with the index addresses of other basic code word units, or combining the code word units in the basic character area with the index addresses of other code word units in the extended character area; using the index addresses corresponding to all code word units as code table addresses, and forming a linked list code table of the GIF file.
2. A linked list code table creation device for GIF files, characterized in that: The device comprises: A first acquisition module is used to acquire basic codeword units in a GIF file, each of which includes a basic character and a corresponding link address; The first encoding module uses the arrangement order of the basic codeword units as the corresponding index addresses, and forms a basic character area according to the order of the index addresses; The second encoding module combines the basic codeword unit of the basic character area with the index address of other codeword units to form a new codeword unit, and then continues to arrange the sorting order of the basic character area, using the arrangement order as the index address corresponding to the codeword unit, and forming an extended character area; The combining of the basic codeword unit of the basic character area with the index addresses of other codeword units includes combining the index addresses of the previous one or more consecutive basic codeword units with the current codeword unit; or combining the codeword unit of the basic character area with the index addresses of other basic codeword units, or combining the codeword unit of the basic character area with the index addresses of other codeword units in the extended character area; The code table embedding module uses the index addresses corresponding to all code word units as code table addresses and forms a linked list code table of the GIF file.
3. The linked list code table establishment device for a GIF file according to claim 2, characterized in that: The second encoding module includes: A parsing unit, which parses out the index addresses of the basic code word unit and other code word units in the basic character area; A combining unit, combining the basic code word unit of the basic character area with the index addresses of other code word units; The encoding unit arranges the combined new code word units in the sorting order of the basic character area, uses the arrangement order as the index address corresponding to the code word unit, and forms an extended character area.
4. A linked list code table query method for GIF files, characterized in that: The method comprises: Obtaining the index value of the linked list code table of the GIF file, and obtaining the corresponding codeword unit according to the index value; the obtained codeword unit is a new codeword unit, and the new codeword unit is obtained by combining the basic codeword unit of the basic character area with the index addresses of other codeword units; wherein, combining the basic codeword unit of the basic character area with the index addresses of other codeword units includes combining the index addresses of the previous one or more consecutive basic codeword units with the current codeword unit; or combining the codeword unit of the basic character area with the index addresses of other basic codeword units, or combining the codeword unit of the basic character area with the index addresses of other codeword units in the extended character area; If the obtained code word unit is a basic code word unit in the basic character area, the query decoding of the basic code word unit is directly completed; If the obtained codeword unit is a codeword unit in the extended character area, then the basic codeword part of the codeword unit is taken out as the constituent element of the codeword unit, and the index address information is taken out as the index address of the next basic codeword unit; The index address is used as a new index value, and the new index value is used to obtain the next basic codeword unit; Until the remaining index address is within the index address range of the basic code word unit, the query decoding of the new code word unit is completed.
5. A linked list code table query method for a GIF file according to claim 4, characterized in that: Before completing the query decoding of the new codeword unit, the method further includes splicing one or more basic codeword units taken out of the new codeword unit in reverse order.
6. A linked list code table query device for GIF files, characterized in that: The device comprises: The second acquisition module is used to obtain the linked list code table of the GIF file and the index value corresponding to its decoding; The first query module obtains the corresponding codeword unit according to the index value; the obtained codeword unit is a new codeword unit, and the new codeword unit is obtained by combining the basic codeword unit of the basic character area with the index addresses of other codeword units; wherein, combining the basic codeword unit of the basic character area with the index addresses of other codeword units includes combining the index addresses of the previous one or more consecutive basic codeword units with the current codeword unit; or combining the codeword unit of the basic character area with the index addresses of other basic codeword units, or combining the codeword unit of the basic character area with the index addresses of other codeword units in the extended character area; The first decoding module directly completes the query decoding of the basic code word unit if the obtained code word unit is a basic code word unit in the basic character area; The second decoding module, if the obtained code word unit is a code word unit in the extended character area, takes out the basic code word part of the code word unit as the constituent element of the code word unit, takes out the index address information as the index address of the next basic code word unit; uses the index address as the new index value, and uses this new index value to obtain the next basic code word unit; until the remaining index address is the index address range of the basic code word unit, the query decoding of the new code word unit is completed.
7. A linked list code table query device for a GIF file according to claim 6, characterized in that: The second decoding module comprises: The decoding unit extracts the basic codeword unit from the new codeword unit, extracts the index address of the next basic codeword unit to obtain the next codeword unit, until all basic codewords are extracted; The concatenation unit concatenates the basic codeword units taken out from each codeword unit in reverse order.