title>GB/T 15121.2-1994 Information processing systems - Metatext for storage and transmission of graphic description information for computer graphics - Part 2: Character encoding - GB/T 15121.2-1994 - Chinese standardNet - bzxz.net
Home > GB > GB/T 15121.2-1994 Information processing systems - Metatext for storage and transmission of graphic description information for computer graphics - Part 2: Character encoding
GB/T 15121.2-1994 Information processing systems - Metatext for storage and transmission of graphic description information for computer graphics - Part 2: Character encoding

Basic Information

Standard ID: GB/T 15121.2-1994

Standard Name: Information processing systems - Metatext for storage and transmission of graphic description information for computer graphics - Part 2: Character encoding

Chinese Name: 信息处理系统 计算机图形 存储和传送图片描述信息的元文卷 第二部分:字符编码

Standard category:National Standard (GB)

state:Abolished

Date of Release1994-07-16

Date of Implementation:1995-03-01

Date of Expiration:2005-10-14

standard classification number

Standard ICS number:Information technology, office machinery and equipment >> 35.140 Computer graphics technology

Standard Classification Number:Electronic Components and Information Technology>>Information Processing Technology>>L81 Computer Graphics

associated standards

alternative situation:void;

Procurement status:ISO 8632-2-1987

Publication information

other information

Review date:2004-10-14

Drafting unit:Electronic Standardization Institute of Ministry of Electronics Industry

Focal point unit:National Information Technology Standardization Technical Committee

Publishing department:State Bureau of Technical Supervision

competent authority:National Standardization Administration

Introduction to standards:

This standard specifies a character encoding for computer graphics files. A code is specified for each element specified in the first part of this series of standards. The encoding of computer graphics files provides highly compressed file representation, which is suitable for applications requiring minimum file size and for transmission of character transmission services. GB/T 15121.2-1994 Information processing system Computer graphics Metafile for storage and transmission of picture description information Part 2: Character encoding GB/T15121.2-1994 Standard download decompression password: www.bzxz.net

Some standard content:

National Standard of the People's Republic of China
Information processing systems--Computer graphics Metafile for storage and transfer of picture description informationlon --Part 2.Character encoding
Information processing systems--Computer graphics Metafile for storage and transfer of picture description informationlon --Part 2.Character encodingCB/r 15121.2---94
ISO 8632-2—1987
This standard is equivalent to the International Standard IS()8632-2—1987 Information processing systems--Computer graphics Metafile for storage and transfer of picture description informationlon --Part 2.Character encoding》0 Introduction
0. 1 Purpose of character encoding
The character encoding of computer graphics metafile (CGM) provides a representation of the syntax of the metatext. It is intended for use in situations where emphasis is placed on minimizing the size of the metatext or sending the metatext over a character-oriented communication service. The encoding uses a compressed representation of data that is most suitable for storage and transfer between computer systems.
Reducing processing overhead is more important than data compression, and the binary encoding of Part 3 of this series of standards is more appropriate. If human readability is the most important criterion, then the clear text encoding of Part 1 of this series of standards is more appropriate. 0.2 Objectives
The design objectives of this encoding are as follows:
Regular syntax: All elements of the metatext should be encoded in the same way to simplify the analysis of the metatext;
b. Compression: The encoding should provide highly compressed metatext, which is suitable for systems with limited storage capacity or transmission bandwidth;
c. Scalability: The encoding allows for future expansion;
d. Operability: This encoding should be suitable for use with a transport mechanism designed for character-oriented data based on GB1988. 0.3 Metatext Features
Each CGM command follows a simple regular syntax. Therefore, new commands can be added in future versions of this series of standards, and existing CGM interpreters can recognize (and ignore) these new commands. Also, new operands may be added to existing commands in future versions of this family of standards, so that existing CGM interpreters can recognize (and ignore) the added operands. Each CGM operand follows a simple regular syntax. The length of the operands may vary, allowing small values ​​to be represented with a minimum number of bytes. A certain range of operand values ​​for
standard commands is reserved for special use; the remaining range is either standardized or reserved for future standardization. 0.4 Relationship with other standards
This code complies with the code expansion rules specified in GB 2311 within the scope of the complete coding system. The character data representation in this standard follows the rules of GB 2311 and GB1988. For certain purple elements, CGM defines a range of values ​​reserved for registration. These values ​​and their meanings will be defined in accordance with established procedures (see Part 1, 4.11 of this series of standards) Approved by the State Administration of Technical Supervision on July 16, 1994 and implemented on March 1, 1995
0.5 Explanation on the appendix
The appendix to this standard is a reference
1 Subject content and scope of application
CB/T 15121.2 94
This standard specifies a character encoding for computer graphics metatext. An encoding is specified for each element specified in the first part of this series of standards.
The encoding of computer graphics metatext provides a highly compressed metatext representation, which is suitable for applications requiring minimal metatext size and for transmission by inter-character transmission services.
2 Referenced standards"
Information processing Seven-bit coded character set for information interchange GB1988
Information processing Seven-bit and eight-bit coding character set code extension technology GH2311
GB 5261 Information processing Seven-bit and eight-bit coded character sets Supplementary control functions for text and symbol forming equipment GB12054 Data processing escape sequence registration procedures 3 Numbering conventions
3.1 Seven-bit and eight-bit code tables
The bits of the seven-bit coded bit group are identified as b7., b storage, b5, b1, b3, b2 and b1. Among them, h7 is the highest bit or the most significant bit, and b1 is the lowest bit or the least significant bit.
The bit group can be interpreted as representing 0 in binary notation by assigning the following weights to each bit Integers in the range of 1 to 127: bits
In this standard, bit groups are identified by the x/y notation, where x is a number between 0 and 7, and is a number between 0 and 15. The correspondence between the x/y notation and the bit groups consisting of b7 to b1 is as follows: x is a number represented by b7, b6 and b5, and the weights of these bits are 4, 2 and 1 respectively: -y is a number represented by b4, b3, b2 and b1, and the weights of these bits are 8, 4, 2 and 1 respectively. The x/y notation is similar to the notation used to identify the position of the code table - , where x is the column number and y is the row number. A seven-bit code table includes 128 positions arranged in 8 columns and 16 rows. The column numbers are 0 to 7 and the row numbers are 0 to 15. Figure 1 shows a seven-bit code table. For example, "1/11\ represents a bit group in column 1 and row 11 of the code table, that is, binary 0011011. The bits in the bit group of the eight-bit code are marked as b8, b7, b6, b5, b4.b3, b2 and b1, where b8 is the highest bit or the most significant bit, and b1 is the lowest bit or the least significant bit.
bits The group can be interpreted as representing an integer in the range of 0 to 255 in binary notation by assigning the following weights to each bit: bit
Using these weights, the bit group of the eight-bit code is interpreted as representing a number between 0 and 25. In this standard, the bit group of the eight-bit code is identified by a notation of the form xx/yy, where xx is the number between 00 and 15, using the following instructions:
1 This chapter removes FCMA-96 and CEPTT/CD6.1 in ISOR632-2-1987 because they are not referenced in the standard. GB/T 15121.2-94
y is the number between 00 and 15. The correspondence between the xx/yy notation and the bit group consisting of bits b8 to b1 is as follows: - xx is a number represented by b8, b7, b6 and b5, and the weights of these bits are 8, 4, 2 and 1 respectively - yy is a number represented by b4, b3, b2 and bt, and the weights of these bits are 8, 4, 2 and 1 respectively. The xx/yy notation and the bit code table used to identify a person include 256 positions arranged in 16 columns and 16 rows. The column numbers and row numbers are 00 to 15. Figure 2 shows an eight-bit code table. For example: 04/01 represents the eight-bit byte 01000001. And 4/1 represents the seven-bit byte 1000001. 3.2 Code expansion technical vocabulary
In describing the characters that may appear in the application parameters, some terms introduced from other standards (such as GB2311) are useful. In the above text of CGM, these terms and concepts are only used for the string parameters of the metafiles "Main Text", "Supplementary Text" and "Restricted Text". 3.2.1 C0 Set
The C0 set is a control character set consisting of 30 control characters. In the seven-bit encoding, these control characters are represented by 0/0~1/15 (except 0/11 and 0/15 which are not used). In the eight-bit encoding, 00/0001/15 (except 00/14 and 00/15 which are not used) indicates that the C0 set occupies columns 0 and 1 of the seven-bit code table, or columns 00 to 01 of the eight-bit code table. The meaning of the C0 control character in the string parameter is described in: 6.9.3.
3.2.2 C1 Set
The C1 set is a set of 32 control characters. In the eight-bit code table, these control characters are represented by byte groups 08/00 to D9/15; the C1 set occupies columns 08 and 09 in the eight-bit code table. In the seven-bit encoding, the C1 control function is represented by a 2-byte escape sequence. This CGM encoding reserves byte groups 9/8 and 9/12 (ESC 5/8 and ESC5/12 in the seven-bit environment. FSC=1/11.); these should not be part of the string parameter. Other C1 control characters in other standards (such as GB5261) can be used as string parameters through agreement between the parties to the exchange.
3.2.3G Set
G Set (G0.G1, G2 and G3) are coded character sets consisting of 94 or 96 characters. The "character set index" indicates which character set is the G0 set, and the supplementary character set index indicates which character set can be used as the G1 and G2 sets. G set can be transferred into columns 2 to 7 of the seven-bit code table; or columns 02 to 07 and columns 10 to 15 of the eight-bit code table. This CGM encoding uses G0 and G1/G2 sets in character declaration parameters. G3 set can be used in string parameters of consistent metatext, which requires the selection of extended seven-bit or extended eight-bit mode in the "Character Code Declaration". CGM does not provide elements that explicitly specify G3 set; it can be completed in the text string that conforms to GB2311, or by other means agreed upon by the parties to the exchange.
b4b3b2b5
GB/T 15121.2-94
Figure 1 Seven-bit code table
GL consisting of 16 byte groups
Figure 2 Eight-bit code table
94 or 96 byte groups or G set
9 or byte groups consisting of GR nest
15 / 15
4 Entering and exiting the metatext environment
4.1 Implicit entry into the metatext environment
GB/T15121.2—94
It is possible to enter the CGM coding environment implicitly through agreement between the exchange parties. It is only applicable when there is no exchange with services using other coding methods.
4.2 Indicating and calling the CGM coding environment from CB2311 In order to exchange information with services using GB2311 code extension technology, the CGM coding environment should be indicated and called from the GB 2311 environment through the following escape sequence:
FSC 2/5 F
where ESC: is bit group 1/11, and F is the bit group assigned for registration according to the provisions of GR12054. The first bit group appearing after this escape sequence will represent the operation code of a CGM metatext element. After the end of one or more metatexts (i.e. after the "metatext end" element), or between pictures (after the "picture end" element), the following escape sequence element can be used to return to the GB2311 coding environment: ESC2/54/
This not only returns to the GB2311 coding environment, but also restores the designation and call of the coded character set to the state that existed before entering the CGM coding environment with the ESC2/5F sequence. 5 Operation code encoding method
Each metatext element consists of an operation code and required parameters. The operation code is encoded as the bit sequence of columns 2 and 3 in the code table. The end code method provides:
-Basic opcode set:
"Extended opcode set.
5.1 Encoding method of basic opcode set
The basic opcode set includes single-byte and double-byte opcodes. The single-byte opcode comes from column 2 of the code table, and bits b1 to bl are used to encode the opcode, and its format is as follows:
"The X\ bit (bit b8) is the parity bit (or omitted bit) in a seven-bit environment. It is 0 in an eight-bit environment. For double-byte opcodes, the first byte comes from column 3 of the code table, and the second byte comes from column 2 or column 3 of the code table. Bits l4--b1 of the th byte and bits b5 to bl of the first byte are used to encode the opcode: b8
Bit group 3/15, i.e., the \Extended Operation Code Space (FOS) allows expansion of the basic opcode space (see 5.2). Therefore, the basic opcode set provided by the encoding method includes 496 opcodes: -16 single-byte opcodes (column 2)
15×32 (480) double-byte opcodes (except for byte group 3/15, the first byte comes from column 3, the second byte comes from column 2 or column 3). 5.2 Expansion mechanism
The basic opcode set can be expanded by the \expanded opcode interval\code (FOS, 3/15) to an unlimited number of expanded opcode sets, GB/T 15121. 2 -- 94
The Nth extended opcode set includes the opcodes of the basic opcode set preceded by N codes EOS. The three possible formats of an opcode in the Nth extended opcode set are:Opcode format
Where:(E0S)=3/15;
X-0.1,2,*15;
Y-0.1.2..-14.
Z-0.1.2...15.
=0.1.2,*+*| |tt||n=0 selects the basic opcode set;
extended code
(EOS...(EOS)
(EOS.....(EOS)
(EOS.....{EOS)
n=1 selects the -th extended opcode set,
class-N selects the Nth extended opcode set.
basic opcode set code
<3/Y)(2/Z)
(3 /Y(3/Z)
The number of opcodes provided by this encoding method (basic opcode set plus extended opcode set) is 496×(n+1) where n is the number of extended sets (each extended set has 496 opcodes, i.e. 16 single-byte opcodes plus 480 double-byte opcodes). 5.3 Opcode Allocation
Table 1 lists the opcode allocation for CGM elements. All opcodes come from the basic opcode set. They are arranged as follows: Single-byte opcodes are allocated Assigned to graphic source elements except some circle and ellipse output elements: the first byte of the two-byte operation code assigned to these circle and ellipse output elements is 3/4; all other metatext elements have two-byte operation codes, and the first byte of the two-byte operation code is as follows
3/5 and 3/6
Operation code
Metatext volume start operation code
Metatext volume cleanup operation code
Picture start operation code
Picture body start operation code|| tt||Medical film end operation code
Bounded derivative element
Metatext volume descriptor element
Picture descriptor element
Control element
Attribute element
Escape and external element
Table! Metatext volume element operation code
Seven-bit code
3/g2/0
3/02/1
3/0272
3/02/3
3 /0274
Octet encoding
03/002/0
63/002/1
03/002/2
03/002/3
C3/002/4
Operation code
Metatext volume version operation code
Metatext volume description operation code
VLC type operation code
Integer precision operation code
Real precision operation code|| tt||Index precision operation code
Color precision operation code
Color index precision operation code
Maximum color index operation code
Color value range operation code
Metatext element table operation code
Metatext default replacement start operation code
Metatext default replacement end operation code
School table operation code
Character set operation code
Ningfu encoding operation code||tt| |Ratio mode operation code
Color selection mode operation code
Line width description mode operation code
Mark size description mode operation code
Inverse width description mode operation code
VDC range operation code
Background color operation code
VDC integer precision operation code
VIDC real precision operation code
Auxiliary color selection operation code
Transparency operation code
GB/T 15121.2—94
Continued Table 1
Seven-digit code
3/12/0
3/12/1
3/12/2| |tt||3/12/3
3/12/4
3/12/5|| tt||3/12/8
8/13/9
3/12/10
3/12/11
3/12/12|| tt||3/12/13
3/12/14
3/2/ 15
a/22/0
3/22/1
3/22/2
3/22/3
3/23/ 4
3/22/5
3/22/6
3/32/ 0
3/32/1
3/32/2
3732/3
eight-digit code
03/102/0||tt ||13/103/10
03/102/12
03/102/13
03/302/3
Operation code
Cut rectangle operation code
Cut indicator operation code
Broken line operation Code
Disconnected broken line operation code
Multiple point mark operation code
Main text operation code
Restricted certificate text operation code
Supplementary stop text operation Polygon operation code
Polygon nest operation code
Pixel array operation code
Generalized drawing source language operation code
Shape operation code
Circle operation code
Three-point arc operation code
Three-point closed circle operation code
Center arc operation code
Central closed drawing operation code
Ellipse operation code
Circle class operation code
Closed tree circle extension operation code
Line harness lead operation code||tt| |Line type opcode
Line spot opcode
Line color opcode
Token bundle index opcode
Token convex type opcode
GB /T 15121.2-94
Continued Table 1
Seven-digit reduced code
3/32/4
3/32/5
3/42/0
3/42/1
3/42/2
3/42/3|| tt||3/42/4
3/42/5
3/42/6
3/42/7
3/52/0|| tt||3/52/1
3/52/2
3/52/3
3/52 /4
3/52/5
Eight-bit code
03/3C274
03/302/5
03/403/门| |tt||03/102/1
03/402/2
03/ 402/3
93/402/4
05/40275
03/402/6
03/402/7
03/502/ 0
3/502/1
037502/2|| tt||03/502/3
03/502/4
03/502/5
Operation code
Token size operation code
Token Color opcode
Justice beam index opcode
Text font opcode
Text accuracy opcode
Character expansion factor opcode
Operation code
Text color operation code
Character height operation code
Character direction operation code
Text path operation code
Text pair Quasi-replacement Code
Character set index operation code
Add character set index operation code
Filling bundle index operation code
Internal pattern operation code
Fill color operation code
Shadow index operation code
Pattern index operation code
Border index operation code
Border type conversion code||tt ||Border width operation code
Over color operation code
Border visibility operation code
Fill reference point operation code
Pattern table operation code||tt| |Pattern size code
GB/T 15121.2 94
Continued Table 1
Seven-path coding
3/52/6
3/52/7
3/53/0||tt ||3/5 3/1
3/53/2
3/5373
a/53/4
$/53/5
3/53/ 6||tt ||3/53/7
3/53/8
3/53/9
3/53/10
3/53/11||tt ||3/ 62/0
3/62/1
3/62/2
3/62/3
3/62/4
3/ 62/5||t t||3/62/6
3/62/7
3/62/8
3/62/9
3/62/10|| tt||3/ 62/11
3/62/12
Bahua wenbo
03/502/6
03/502/7
03/50 3/0
03/50/1
113/5103/2
43/503/3
03/503/4
0 3/303/5
G3/503/6
03/503/7
03/503/8
03703/
03/503/10
03/503/11
03/602/G
03/602/1
03/602/3
03/602/4
03/602/5
03/602/6
03/602/7
03/62 /8
03/602/9
03/602/10
03/602/11
/602/12
Operation code|| tt||Color table opcode
Appearance source flag opcode
Escape opcode
Ring range opcode
Message opcode
Previous data operation code
6 parameter encoding method
GB/T15121.2-94
Continued table 1
Seven codes
3/63 /0
3/63/1
3/72/0
3/73/0
3/72/1
3/72 /2||t t||Eight-bit mining
03/603/0
03/603/1
03/782/0
03/703/0||tt ||03/702/1
03/702/2
The parameter part of CGM can contain one or more parameters, each parameter contains one or more bytes. Parameters are encoded in columns 4 to 7 (and a string parameter code representation may include bits from other columns of the code table, see 6.9 for a description of string parameters). The general form of a parameter byte is: b8
\X\ bit (h8 bit) is the parity bit (or ignore bit) in the seven-bit environment. In the eight-bit environment it is 0. b7 bit is the parameter flag. All parameters except "strings" and "data records" are encoded in one or both of two formats, basic format or bitstream format.
6.1 Basic format
Each Each basic format parameter is encoded as a sequence of one or more bytes, constructed as follows: h8
first byte
last byte
\X\ bits (h8 bits) In a seven-bit environment it is the parity bit (or ignore bit), in an eight-bit environment it is 0,b7 is the parameter identifier. "e" b6 of each byte is the extension flag. For single-byte parameters, the extension flag is 0; for multi-byte parameters, except for the last byte which is 0, the extension flag is on in all bytes! .b5 to b1 are the data bits of the parameter, "s\ is the sign bit; if it is 0, the integer is non-negative; if it is 1, the integer is negative. The number 0 should always be encoded as \positive 0\ (4/0) negative 0\ encoding is reserved for special purposes (see 6.6.3). The basic format is used to encode the following types: enumeration type (L):
b, color index (CI);
c. Index other than color index (IX) 1
d integer (I);
e: real number (R):
f, non-increasing coordinates.
CB/T 15121. 2-- 94
The most significant part of the parameter is encoded in the first byte. The least significant part of the parameter is encoded in the last byte. 6.2 Bitstream format
Each bitstream format parameter is encoded as a sequence of one or more bytes, which is constructed as follows: b8
The first byte
The last byte
"X\ bit (b8 bit) is the parity bit (or ignore bit) in a seven-bit environment. In an eight-bit environment it is 0, b7 bit is the parameter flag
b6 bit to b1 bit are the data bits of the parameter. The bit format is used to encode the following types: a. Incremental coordinates (see 6.6.2):
b. Direct color value (see 6.8);
c. Color index table (see 6.8).
Bitstream format data is pushed into continuous data bits. For the most significant part of the bitstream data, it is pushed in from the high-order bit of the first byte to the low-order bit, and so on for the other parts.
The end of the bitstream format parameter cannot be derived from the bitstream format itself (the format cannot be delimited by itself). Instead: for incremental coordinates, the end of the data (marking the end of the bitstream format parameter) is marked with the (block end) code: for the color index table, the number of bits required to encode the color index table (marking the end of the bitstream format parameter) is the "color index precision" element or the local color precision \parameter (for elements with such parameters): For color direct data values, the number of bits required to encode the data (marking the end of the bitstream format operand) is set using the "color precision\element or the "local color precision\parameter (for elements with such parameters). 6.3 Integer encoding
Integers are encoded as sequences of bytes in the range 4/0 to 7/15 of the basic format. If a byte comes from column 4 or column 5 of the code table, it is either the last byte of the integer code representation or a single-byte integer. A multi-byte integer is encoded using a byte from column 6 of the code table. or column 7.
Integer parameters are constructed as described in their format (see 6.1). \bbb…\ are bits indicating the digit level of the integer. The most significant part of the parameter is encoded in the first byte, and the least significant part is encoded in the last byte. Any integer can be encoded with the most significant bit leading to all zeros. For example, 4/3 and 6/06/04/3 are both valid encodings of the integer "-3"; however, efficient metatext generators should avoid encodings of this length. The size of integer parameters is limited by the current value of "integer precision". GB/T15121.2—94
Integers in the range -15 to +15 can be encoded in a single byte. (integer: + 1) = -4/1
(integer: + 15) = 4/15
A larger integer requires more bytes,
(integer + 16) - 6/05/0
(Integer: +1034) = 6/16/04/10
6.4 Real Number Abbreviation
(Integer: -1) = 5/1
Integer: -15) = 5/15
(Integer: -16) = 7/05/0
(Integer: -1034) = 7/16/04/10
Each real number is encoded as a number followed by an optional exponent The exponent is the power of 2 by which the integer exponent is multiplied.
The exponent can be defined implicitly as a default exponent to be omitted in the real format, or it can be defined explicitly as the second part of the real format: (real format)-(mantissa part)(exponent part》]Depending on the "Exponent Permission" parameter of the \realPrecision\ element, a bit in the first byte of the mantissa indicates whether an exponent follows. If the "Exponent Permission" bit in the mantissa is 0, or if the "realPrecision\ specifies no "Exponent Permission" bit, the exponent part is ignored and the default value set by the other parameter of the "realPrecision" element is used. Note: The encoding of real VTXC coordinates is controlled by *VDCRealPrecision\, not by "realPrecision". H. The rules for the default exponent in the real VDC coordinate system are only slightly different ( See 6.5 and 6.6). The mantissa is an integer encoded in the basic format. The first byte has two formats, which format is used depending on whether the "real precision" element has been specified to include an "exponent follower". The format (first byte) is as follows; b8
\c\ is the extension flag, see 6.1.
"s\ is the exponent follower (b5 bit of the first byte) 0 (positive mantissa) or up (negative mantissa). {If explicit exponent permission - "permitted\,
the exponent follower appears)
(If explicit exponent permission is prohibited\,
there is no exponent follower!
(last byte:
Here "β" is the exponent limit follower. If the current "exponent exponent permission\ value of the "real precision" element is "permitted", then bit b4 of the first byte of the mantissa is used as \Exponent follows bit\; set to 1 if an explicit exponent follows; set to 0 if no exponent follows the mantissa (the default exponent set by the "real precision" is used). If the current "exponent permission" value of the "real precision" is "disabled", bit b4 of the first byte is used as the data bit, using the default exponent set by the "real precision". The exponent is encoded as an integer in the basic format, see 6.3. "Negative 0" mantissa or exponent is not allowed and is reserved for future use. For example. Assuming that the "real precision" specifies that each real number parameter is encoded as an "exponent follows bit" in the mantissa, then the binary number +1.!10010110011 is encoded as follows:
(real number: binary number +1.110010110011) (mantissa: +1110010110011.Exponent follows) (exponent: -12)Instead: for incremental coordinates, the end of the data (marking the end of the bitstream format parameters) is marked by the (block end) code: for the color index table, the number of bits required to encode the color index table (marking the end of the bitstream format parameters) is set by the "color index precision" element or the "local color precision" parameter (for elements containing such parameters): for color direct data values, the number of bits required to encode the data (marking the end of the bitstream format operand) is set by the "color precision" element or the "local color precision" parameter (for elements containing such parameters). 6.3 Integer encoding
Integers are encoded in a sequence of bytes in the range of 4/0 to 7/15 in the basic format. If a byte comes from column 4 or column 5 of the code table, it is either the last byte represented by the integer code or a single-byte integer. A multi-byte integer is represented by a byte from column 6 or column 7 of the code table. The integer parameter is constructed as described in its format (see 6.1). \bbb…\ is the number of bits that represent the integer's digits. The most significant part of the parameter is encoded in the first byte, and the least significant part is encoded in the last byte. Any integer can be encoded with the most significant bit leading to all zeros. For example, 4/3 and 6/06/04/3 are both valid encodings of the integer "-3"; however, valid metatext generators should avoid encodings of this length. The size of an integer parameter is limited by the current value of the "integer precision". GB/T15121.2—94
Integers in the range -15 to +15 can be encoded in a single byte. (integer: + 1) = -4/1
(integer: + 15) = 4/15
Larger integers require more bytes,
(integer + 16) - 6/05/0
(Integer: +1034) = 6/16/04/10
6.4 Real Number Abbreviation
(Integer: -1) = 5/1
Integer: -15) = 5/15
(Integer: -16) = 7/05/0
(Integer: -1034) = 7/16/04/10
Each real number is encoded as a number followed by an optional exponent The exponent is the power of 2 by which the integer exponent is multiplied.
The exponent can be defined implicitly as a default exponent to be omitted in the real format, or it can be defined explicitly as the second part of the real format: (real format)-(mantissa part)(exponent part》]Depending on the "Exponent Permission" parameter of the \realPrecision\ element, a bit in the first byte of the mantissa indicates whether an exponent follows. If the "Exponent Permission" bit in the mantissa is 0, or if the "realPrecision\ specifies no "Exponent Permission" bit, the exponent part is ignored and the default value set by the other parameter of the "realPrecision" element is used. Note: The encoding of real VTXC coordinates is controlled by *VDCRealPrecision\, not by "realPrecision". H. The rules for the default exponent in the real VDC coordinate system are only slightly different ( See 6.5 and 6.6). The mantissa is an integer encoded in the basic format. The first byte has two formats, which format is used depending on whether the "real precision" element has been specified to include an "exponent follower". The format (first byte) is as follows; b8
\c\ is the extension flag, see 6.1.
"s\ is the exponent follower (b5 bit of the first byte) 0 (positive mantissa) or up (negative mantissa). {If explicit exponent permission - "permitted\,
the exponent follower appears)
(If explicit exponent permission is prohibited\,
there is no exponent follower!
(last byte:
Here "β" is the exponent limit follower. If the current "exponent exponent permission\ value of the "real precision" element is "permitted", then bit b4 of the first byte of the mantissa is used as \Exponent follows bit\; set to 1 if an explicit exponent follows; set to 0 if no exponent follows the mantissa (the default exponent set by the "real precision" is used). If the current "exponent permission" value of the "real precision" is "disabled", bit b4 of the first byte is used as the data bit, using the default exponent set by the "real precision". The exponent is encoded as an integer in the basic format, see 6.3. "Negative 0" mantissa or exponent is not allowed and is reserved for future use. For example. Assuming that the "real precision" specifies that each real number parameter is encoded as an "exponent follows bit" in the mantissa, then the binary number +1.!10010110011 is encoded as follows:
(real number: binary number +1.110010110011) (mantissa: +1110010110011.Exponent follows) (exponent: -12)Instead: for incremental coordinates, the end of the data (marking the end of the bitstream format parameters) is marked by the (block end) code: for the color index table, the number of bits required to encode the color index table (marking the end of the bitstream format parameters) is set by the "color index precision" element or the "local color precision" parameter (for elements containing such parameters): for color direct data values, the number of bits required to encode the data (marking the end of the bitstream format operand) is set by the "color precision" element or the "local color precision" parameter (for elements containing such parameters). 6.3 Integer encoding
Integers are encoded in a sequence of bytes in the range of 4/0 to 7/15 in the basic format. If a byte comes from column 4 or column 5 of the code table, it is either the last byte represented by the integer code or a single-byte integer. A multi-byte integer is represented by a byte from column 6 or column 7 of the code table. The integer parameter is constructed as described in its format (see 6.1). \bbb…\ is the number of bits that represent the integer's digits. The most significant part of the parameter is encoded in the first byte, and the least significant part is encoded in the last byte. Any integer can be encoded with the most significant bit leading to all zeros. For example, 4/3 and 6/06/04/3 are both valid encodings of the integer "-3"; however, valid metatext generators should avoid encodings of this length. The size of an integer parameter is limited by the current value of the "integer precision". GB/T15121.2—94
Integers in the range -15 to +15 can be encoded in a single byte. (integer: + 1) = -4/1
(integer: + 15) = 4/15
Larger integers require more bytes,
(integer + 16) - 6/05/0
(Integer: +1034) = 6/16/04/10
6.4 Real Number Abbreviation
(Integer: -1) = 5/1
Integer: -15) = 5/15
(Integer: -16) = 7/05/0
(Integer: -1034) = 7/16/04/10
Each real number is encoded as a number followed by an optional exponent The exponent is the power of 2 by which the integer exponent is multiplied.
The exponent can be defined implicitly as a default exponent to be omitted in the real format, or it can be defined explicitly as the second part of the real format: (real format)-(mantissa part)(exponent part》]Depending on the "Exponent Permission" parameter of the \realPrecision\ element, a bit in the first byte of the mantissa indicates whether an exponent follows. If the "Exponent Permission" bit in the mantissa is 0, or if the "realPrecision\ specifies no "Exponent Permission" bit, the exponent part is ignored and the default value set by the other parameter of the "realPrecision" element is used. Note: The encoding of real VTXC coordinates is controlled by *VDCRealPrecision\, not by "realPrecision". H. The rules for the default exponent in the real VDC coordinate system are only slightly different ( See 6.5 and 6.6). The mantissa is an integer encoded in the basic format. The first byte has two formats, which format is used depending on whether the "real precision" element has been specified to include an "exponent follower". The format (first byte) is as follows; b8
\c\ is the extension flag, see 6.1.
"s\ is the exponent follower (b5 bit of the first byte) 0 (positive mantissa) or up (negative mantissa). {If explicit exponent permission - "permitted\,
the exponent follower appears)
(If explicit exponent permission is prohibited\,
there is no exponent follower!
(last byte:
Here "β" is the exponent limit follower. If the current "exponent exponent permission\ value of the "real precision" element is "permitted", then bit b4 of the first byte of the mantissa is used as \Exponent follows bit\; set to 1 if an explicit exponent follows; set to 0 if no exponent follows the mantissa (the default exponent set by the "real precision" is used). If the current "exponent permission" value of the "real precision" is "disabled", bit b4 of the first byte is used as the data bit, using the default exponent set by the "real precision". The exponent is encoded as an integer in the basic format, see 6.3. "Negative 0" mantissa or exponent is not allowed and is reserved for future use. For example. Assuming that the "real precision" specifies that each real number parameter is encoded as an "exponent follows bit" in the mantissa, then the binary number +1.!10010110011 is encoded as follows: www.bzxz.net
(real number: binary number +1.110010110011) (mantissa: +1110010110011.Exponent follows) (exponent: -12)
Tip: This standard content only shows part of the intercepted content of the complete standard. If you need the complete standard, please go to the top to download the complete standard document for free.