1、INTERNATIONAL STANDARD ISO/IEC 11544 First edition 1993-I 2-l 5 Information technology - Coded representation of picture and audio information - Progressive bi-level image compression Technologies de Iinforma tion - Repr - the bottom of the image shall be extended downward as far as necessary by pix
2、el replicating the actual last line of the image. Furthermore, in referencing pixels across stripe boundaries, the following rules shall be used: - A pixel reference in a stripe above the current one shall return the actual value of the pixel, unless the pixel is above the image, in which case the b
3、ackground-border-rule for the image top shall be applied. - A pixel reference in a stripe below the current one shall be satisfied by pixel replioating the last line of the current stripe. In particular, actual values shall not be used even if the reference is still within the image. NOTE - This lat
4、ter tule is only of consequence for the low-resolution image, as for decodability there can never be any references to high-resolution pixels in the line below. Also, the described resolution reduction algorithm happens to never reference even low-resolution pixels in the line below. 6.1.3 Byte alig
5、nment NOTE - Because of the header and marker conventions to be described in 6.2, marker segments are always byte aligned in a datastream. 6.2 Data organization 6.2.1 Image decomposition The highest level data structure described in this Specification is known as a bi-level image entity (BIE). A giv
6、en BIE may contain data for one or more resolution layers and bit-planes. The data describing a given image in all its available resolutions and bit-planes may, but need not necessarily be, contained in more than one BIE. CCITT Rec. T.82 (1993 E) 7 Copyright American National Standards Institute Pro
7、vided by IHS under license with ANSINot for ResaleNo reproduction or networking permitted without license from IHS-,-,-ISO/IEC 11544 : 1993(E) NOTE - A multiple BIB description of an image is needed when images are first made available at low or intermediate resolution or bit-plane precision and the
8、re may or may not be a request for enhancement to higher resolution or precision. 6.2.2 Bi-level image entity and header (BIE and BIH) decomposition As shown in Table 5, a bi-level image entity (BIE) shall comprise a bi-level image header (BIH) and bi-level image data (BID). Table 5 - Decomposition
9、of BIE The bi-level image header shall comprise the fields shown in Tables 6, 7 and 8 Table 6 - Decomposition of BIH BIH DL D P - XD YD Lo Mx MY Order Options DPTABLB 1 1 1 1 4 4 4 1 1 1 1 Oor 1728 Table 7 - Decomposition of order byte Order MSB LSB - - HITOLO SEQ ILEAVB SMID l/8 l/8 l/8 l/8 l/8 l/8
10、 118 I/8 Table 8 - Decomposition of options byte MSB - l/8 LRLTNO VLENQTH l/8 l/8 Options . . . LSB TPDON TPBON DPON DPPRIV DPLAST l/8 l/8 l/8 l/8 l/8 The first byte of the BIB shall specify DL, the initial resolution layer to be specified in this BIE. Most frequently, this number will be zero in wh
11、ich case the data transmitted will allow building up the image without any prior knowledge about it. It will be non-zero if a previous BIE has already defined the image to some intermediate layer and only incremental information is to be specified. The second byte specifies D, the final resolution l
12、ayer described in this BIE. Note that with such multiple BIBS, when DL is zero than D equals a number of differential layers, but not the total number of differential layers. The third byte shall specify P, the number of bit-planes. If the image is bi-level, P shall be 1. 8 CCITT Rec. T.82 (1993 E)
13、Copyright American National Standards Institute Provided by IHS under license with ANSINot for ResaleNo reproduction or networking permitted without license from IHS-,-,-ISOAEC 11544 : 1993(E) The fourth byte is fill. It shall always be written as 0. The three subsequent four-byte fields specify XD,
14、 Ir, and ho, which are respectively, the horizontal dimension at highest resolution, the vertical dimension at highest resolution, and the number of lines per stripe at lowest resolution. These three integers are coded most significant byte first. In other words, XD is the sum of 2563 times the fift
15、h byte in BIH, 2562 times the sixth byte, 256 times the seventh byte, and the eighth byte. The seventeenth and eighteenth bytes shall specify MX and My, the maximum horizontal and vertical offsets allowed for the AT pixel. These parameters are discussed further in 6.7.3. The nineteenth byte of the B
16、IH shall carry the binary parameters HITOLO, SEQ, ILEAVE and SMID, which together specify the order in which stripe data is concatenated to form BID. More detail is provided in 6.2.4. The four most significant bits of this byte are till and shall always be written as 0. The twentieth byte of the BIH
17、 shall specify options. Its most significant bit is till and shall always be written as 0. The template used for coding the lowest resolution layer shall have 2 or 3 lines as LRLTWO is 1 or 0 (see 6.7.1). If the VLRNGTH bit is 0, there shall be no NEWLEN marker segments (see 6.2.6.2). If VLENGTH is
18、1, there may or may not be NEWLEN marker segments present. The TPDON, TPBON and DPON bits are I when it is desired to enable respectively, differential-layer TP, lowest-resolution-layer TP, and DP. The DPPRIV and DPLAST bits are only meaningful if DPON equals 1. If DPON is 1 and DPPRIV is 1, a priva
19、te DP table is to be used. If DPLAST is 0, the private DP table ( 1728 bytes) is to be loaded. Otherwise the DP table last used is to be reused. The DPTABLE field of BIH shall only be present if DPON equals 1, DPPRIV equals 1, and DPLAST equals 0. Its size and interpretation are defined in 6.6. The
20、variables DL. D, P, XD. YD, Lo, Mx, MY, HITOLO, SEQ, ILEAVE, SMID, LRLTO,VLENGTH, TPDON, TPBON, DPON, DPPRIV and DPLAST are free parameters. Some applications standards may restrict the choices for some or all of them. Table 9 shows the limits on these parameters as set by either their implicit natu
21、res or the field sizes allowed for them in a BIH. A JBIG datastream is any datastream created as described in the normative portions of this Specification with parameters in the range of Table 9. In the interests of creating as large as possible a community of applications for which it is possible t
22、o share hardware and exchange decodable data, Annex A suggests minimum support for these free parameters. Different applications are encouraged to choose parameter values within the suggested ranges of minimum support whenever it is possible to do so. Implementations desiring to be compatible with a
23、 broad range of applications may wish to support all free parameter choices within the suggested ranges. Table 9 - Absolute limits on free parameters Parameter Minimum Maximum DL 0 D D DL 255 P I 255 XD 1 4 294 961295 YD 1 4294961295 Lo I 4294961295 Mx 0 127 MY 0 255 HITOLO 0 1 SEQ 0 I ILEAVE 0 1 SM
24、ID 0 1 LRLTWO 0 I VLENC3TH 0 1 TPDON 0 1 TPBON 0 1 DPON 0 1 DPPRIV 0 1 DPLAST 0 1 CCITT Rec. T.82 (1993 E) 9 Copyright American National Standards Institute Provided by IHS under license with ANSINot for ResaleNo reproduction or networking permitted without license from IHS-,-,-ISO/IEC 11544 : 1993(
25、E) 6.2.3 Iteration for parameters dependent on resolution layer The image dimensions at lower layers (indexed by d) shall be defined recursively for D 2 d 2 1 by the iterations. x,-, = Xd 12-j (1) Yd-1 = Yd 4 where r.1 denotes the ceiling function, or, in other words, the smallest integer greater th
26、an or equal to the argument. For 15 d I D the number of lines per stripe at layer d shall be defined by L(j = 2 x L&, (3) At all layers there will necessarily be s = ryo4l1 (4) stripes. In many cases, the last stripe in any layer d will have fewer than Ld lines. 6.2.4 Bi-level image data (BID) decom
27、position The coded data C, d, , defining a given stripe s at resolution d and bit plane p shall be contained in a stripe data entity or SDE. The BID shall consist of a concatenation of SDES and floating marker segments as shown in Table 10. Table 10 - Decomposition of BID BID Floating marker segment
28、(s) Varies SD%, d. p Varies Floating marker segments(s) Varies SDEs, d. p Varies Floating marker segment(s) Varies SDEs, d, p Varies The ordering of the SDES depends on HITOLO, SEQ, ILEAVE and SMID. Index nesting shall be as defined by Table 11. Only the six combinations of the three variables SEQ,
29、ILEAVE and SMID shown in Table 11 are allowed. The remaining two combinations shall never occur. The loops over the dummy variables s and p are respectively from 0 to S-l (top to bottom) and f-l to 0 (MSB to LSB). If HITOLO is 0, the dummy variable d shall range from DL to D. Otherwise it shall rang
30、e from D to DL. For a tutorial example see Table Intro. 2. Table 11 - Ordering of stripe encodings in BID SEQ Loops I I ILEAVE SMID Outer Middle Inner 10 CCITT Rec. T.82 (1993 E) Copyright American National Standards Institute Provided by IHS under license with ANSINot for ResaleNo reproduction or n
31、etworking permitted without license from IHS-,-,-ISOAEC 11544 : 1993(E) 6.2.5 Stripe data entity (SDE) decomposition As shown in Table 12, each SDE shall be terminated by an ESC byte and either an SDNORW byte or an SDRST byte. Table 12 - Structure of the SDE SDE PSCD ESC SDNORM or SDRST Varies 1 1 N
32、ormally the terminating byte will be SDNOM, which implies that all “state” information is saved. If instead the terminating byte is SDRST, the “state” for that particular bit-plane and that particular resolution layer shall be reset prior to encoding or decoding the next stripe of that plane and lay
33、er. Resetting the state with SDRST requires initializing the adaptive probability estimators as at the top of the image, resetting (if necessary) the AT pixel to its default location, and initializing LNTPy-1 to 1 when in the lowest resolution layer. It also requires that all functions including res
34、olution reduction, deterministic prediction, typical prediction, and model templates start the next stripe as they do when at the top of the image, that is, as defined in 6.1.2. NOTE - Resetting the state with SDRST should not be done unnecessarily as doing so degrades compression efficiency and may
35、 introduce artifacts at stripe borders in lower-resolution images. Protected stripe coded data (PSCD) is defined as the bytes of SDE that remain after removing the two terminating bytes. A decoder shall create stripe coded data (SCD) from the PSCD by replacing all occurrences of an ESC byte followed
36、 by a STUFF byte with a single ESC byte. An encoder shall create PSCD from SCD by replacing all occurrences of an ESC byte with an ESC byte followed by a STUPF byte. The use of SCD is described in 6.8. PSCD is used in defining the SDE rather than SCD so that data for one stripe can be unambiguously
37、located in the BID. An ESC byte and ABORT byte may be used to prematurely terminate the BID as shown in Table 13. NOTE - Without a mechanism like this an encoder encountering a problem would “hang” its associated decoder indefinitely. There would be no way to restart the decoder as it would not rese
38、t until after it had received the announced amount of data. Table 13 - Marker code to prematurely terminate a BID 6.2.6 Floating marker segments Floating marker segments provide control information. They shall not occur within an SDE. They may occur between SDES or before the first SDE. There are th
39、ree floating marker segments: ATMOVE, NEWLEN, and COMMENT. (See Note 2 in 6.2.6.2.) 6.2.6.1 Adaptive-template (AT) movement The location of the AT pixel may be changed with the ATMOVE marker segment shown in Table 14. Table 14 - Structure of the ATMOVE floating marker segment ESC ATMOVE YAT 7X TY 1
40、1 4 1 1 The third, fourth, fifth, and sixth byte define YAT, the line at which the template changes. The seventh and eighth bytes define zx and zy, the horizontal and vertical offsets for the new AT pixel. The line Y,Q shall be decoded as the sum of 2563 times the third byte, 2562 times the fourth b
41、yte, 256 times the fifth byte, and the sixth byte. CCITT Rec. T.82 (1993 E) 11 Copyright American National Standards Institute Provided by IHS under license with ANSINot for ResaleNo reproduction or networking permitted without license from IHS-,-,-ISO/IEC 11544 : 1993(E) The probability estimator i
42、s not re-initialized following an ATblOvE. The resolution layer and bit plane for which a given ATMOVE marker segment is to be effective shall be that of the first SDB to follow the marker segment. The line numbering for YAT restarts at 0 for each stripe so that if, for example, a change is to be ef
43、fective on the initial line of a stripe, YAT equals 0. Further discussion of adaptive template pixels and the variables YAT, zx, and zy appears in 6.7.3. 6.2.6.2 Redefining image length If VLENGTH is 1, it is permissible to change the length YD of the image with a new-length marker segment as shown
44、in Table 15. Table 15 - Marker segment to indicate a new vertical dimension At most only one new length marker segment shall appear in any BIE. However, a marker segment could refer to a line in the immediately preceding stripe due to an unexpected termination of the image or the use of only one str
45、ipe. Such a marker segment is followed immediately by ESC + SDNORWSDRST, and the new Yu given by the newlength marker segment can be less than the line number at the end of the preceding stripe. The encoder shall not code more than the number of lines in each layer corresponding to the new YD. Withi
46、n the new length marker segment, YD shall be packed into its four byte field exactly as it is packed into its four byte field in BIH. The new Yo shall never be greater than the original. NOTES 1 The new length marker has been defined so that it is possible to begin coding an image of unknown length.
47、 In this case the original dimension YD placed into the header serves as an indication of the maximum length that the image might possibly be. 2 Some applications might need the new length marker segment to immediately follow a PSCD just before the ESC + SDNORl&DRST in order to prematurely terminate
48、. This usage is currently under study. 6.2.6.3 Comment marker segment An ESC byte followed by a COMMENT byte and a four-byte integer Lc shall begin a comment marker segment as shown in Table 16. The number Lc shall be equal to the sum of 2563 times the third byte, 2562 times the fourth byte, 256 tim
49、es the fifth byte, and the sixth byte. This number shall give the length of only the private comment portion of the comment marker segment. In other words, the total length of the comment marker segment shall be L, + 6 bytes. Table 16 - Comment marker segment 6.2.7 Reserved marker byte An ESC byte followed by a RESERVE byte is a reserved marker. One possible use of this marker is described in 6.8.2.8. No future extensions of this Specification shall use this marker for any purpo