1、INTERNATIONAL TELECOMMUNICATION UNION ITU-T TELECOMMUNICATION STANDARDIZATION SECTOR OF ITU T.45 (02/2000) SERIES T: TERMINALS FOR TELEMATIC SERVICES Run-length colour encoding ITU-T Recommendation T.45 (Previously CCITT Recommendation) ITU-T RECOMMENDATION T.45 RUN-LENGTH COLOUR ENCODING Summary Th
2、is Recommendation, “Run-length colour encoding“, specifies a run-length encoding procedure which has been optimised for the encoding of lists of colour values. Use of T.45 to encode the colour values of the T.88 (JBIG2) related colour tag procedure is one targeted application. Recommendation T.88 ha
3、s been shown to be particularly effective in the coding of coloured text when the colours of the foreground layer associated with a T.88 encoded MRC mask layer (i.e. text shapes) are represented by colour tags (i.e. colour values). Use of the Recommendation T.88 together with the colour tag provisio
4、n can realise more than twice the compression gains associated with conventional bitmap image encoding of text colours. The colour tag provision takes advantage of the fact that T.88 codes text regions by generating discrete symbols (i.e. symbols are used to represent text characters) and the text c
5、haracters are usually a single flat colour. Colour tagging uses a single colour value (i.e. a colour tag) to represent the colour of each T.88 symbol occurrence, one colour value for each corresponding mask layer (X, Y, ID) symbol triplet. The colour values are ordered identically to the symbol occu
6、rrences. The ordered list of foreground layer colour tags (i.e. colour values) are compressed using T.45 “Run-length colour encoding“. Source ITU-T Recommendation T.45 was prepared by ITU-T Study Group 8 (1997-2000) and was approved under the WTSC Resolution No. 1 procedure on 10 February 2000. Reco
7、mmendation T.45 (02/2000) 1 FOREWORD ITU (International Telecommunication Union) is the United Nations Specialized Agency in the field of telecommuni- cations. The ITU Telecommunication Standardization Sector (ITU-T) is a permanent organ of the ITU. The ITU-T is responsible for studying technical, o
8、perating and tariff questions and issuing Recommendations on them with a view to standardizing telecommunications on a worldwide basis. The World Telecommunication Standardization Conference (WTSC), which meets every four years, establishes the topics for study by the ITU-T Study Groups which, in th
9、eir turn, produce Recommendations on these topics. The approval of Recommendations by the Members of the ITU-T is covered by the procedure laid down in WTSC Resolution No. 1. In some areas of information technology which fall within ITU-Ts purview, the necessary standards are prepared on a collabora
10、tive basis with IS0 and IEC. NOTE In this Recommendation, the expression “Administration“ is used for conciseness to indicate both a telecommunication administration and a recognized operating agency. INTELLECTUAL PROPERTY RIGHTS The ITU draws attention to the possibility that the practice or implem
11、entation of this Recommendation may involve the use of a claimed Intellectual Property Right. The ITU takes no position concerning the evidence, validity or applicability of claimed Intellectual Property Rights, whether asserted by ITU members or others outside of the Recommendation development proc
12、ess. As of the date of approval of this Recommendation, the ITU had not received notice of intellectual property, protected by patents, which may be required to implement this Recommendation. However, implementors are cautioned that this may not represent the latest information and are therefore str
13、ongly urged to consult the TSB patent database. O ITU 2000 All rights reserved. No part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing fiom the ITU. Recommendation T.45 (02/2
14、000) 11 CONTENTS Page 1 Scope 1 2 Coding method . 1 2.1 Structure 1 2.1.1 Header . 1 2.1.2 Data 2 3 . Appendix I - Example of a complete run-length colour encoded data stream . Recommendation T.45 (02/2000) 1 111 Recommendation T.45 RUN-LENGTH COLOUR ENCODING (Geneva, 2000) 1 Scope This run-length c
15、olour encoding Recommendation is restricted to the coding of a sequence of colour values or palette indices. It is general enough to handle any number of colour components at any depth. Colour interpretation of the colour values or palette indices is beyond the scope of this Recommendation and shall
16、 be defined elsewhere. 2 Coding method The coding method begins with a six-octet header. The header specifies the number of colour components, a count of the number of octets used to specify each component value and a count of the number of colour values coded. The data is stored as a sequence of ru
17、ns, which is composed of a count of the times in succession that the colour value or palette index appears. Colour interpretation parameters, such as colour space, gamut range, illuminant or colour values associated with palette indices, which are required to interpret the colour values are stored o
18、utside of this run-length colour encoding mechanism. 2.1 Structure All multi-octet values shall be stored in “bigendian“ format, with the highest order octet coming first and the lowest- order octet coming last. The encoding structure consists of a header immediately followed by data. HEADER DATA I
19、2.1.1 Header The coding method shall begin with a six-octet header of the form: NCOMP 1 octet COMFLEN 1 octet WALS 4 octets The NCOMF (Number of Components) field specifies how many colour components there are. NCOMF shall consist of one octet. It shall take on a value from 1 to 255. The COMFLEN (Co
20、mponent Length) field specifies the length (in octets) of each components value. COMFLEN shall consist of one octet. It shall take on one of the values 1 , 2 or 4. The WALS (Number of Values) field specifies how many colour values are coded. WALS shall consist of four octets. It shall take on a valu
21、e from O to (2“32 - 1). To code indexes into a colour palette, set NCOMF = 1, COMFLEN = 1 (or 2 if there are 256 entries in the palette; or 4 if there are 65536 entries in the palette) and use the WALS to specify the number of indexes in the palette. DATA COMPLEN Recommendation T.45 (02/2000) 1 2.1.
22、2 Data The data shall begin immediately following the header and it shall be stored as a sequence of runs. Each run shall have the form: RUNLEN 1 or 3 octets CVAL NCOMF * COMFLEN octets The RUNLEN (Run Length) field specifies the number of times in succession that the colour value or palette index (
23、CVAL) appears. RUNLEN shall consist of one or three octets. It shall take on a value from O to 65535. The one-octet or three-octet RUNLEN coding sequence shall be as follows: If the first octet has a value in the range Ox01 to OxFF, then RUNLEN shall have the value of that single octet. If the first
24、 octet has a value equal to 0x00, then the first octet shall be followed by two additional octets. RUNLEN shall have the value indicated by the two additional octets. Example of RUNLEN one or three octet sequence: The sequence of octets: 0x05 indicates a RUNLEN of 5 The sequence of octets: Ox00 Ox01
25、 0x04 indicates a RUNLEN of 260 (256 * 1 + 4) The CVAL (Colour Value) field specifies the colour value or palette index of the run. CVAL shall consist of NCOMF fields. Each field shall consist of COMFLEN octets. Example of CVAL sequences: If the value of NCOMF is 3 and COMFLEN is 1 , then the CVAL s
26、equence of octets OxFF OxCO Ox00 corresponds to the colour triple (255, 192, O). The interpretation of this colour triple is left to the colour interpretation system, which shall be specified outside of this Recommendation. The end of the coding shall be determined when the sum of all the RUNLEN val
27、ues decoded is equal to NVALS. Example: If the values decoded were: RUNLEN1 cvAL1 RUNLEN2 cvAL2 . RUNLENn CVALn then the sequence of colour values represented by this encoded data stream is: RUNLEN1 instances of CVAL1 RUNLEN2 instances of CVAL2 . RUNLENn instances of CVALn 2 Recommendation T.45 (02/
28、2000) totalling NVALS colour values. HEADER DATA Appendix I RUNLEN1 CVAL1 Example of a complete run-length colour encoded data stream RUNLEN2 CVAL2 . RUNLENn An example of a complete run-length colour encoded data stream is: 0x03 Ox01 Ox00 Ox00 Ox00 OxOA 0x03 OxFF OxFF OxFF 0x02 ox00 ox00 ox00 OxOOO
29、xOOOxO1 OxFFOxFFOxFF 0x04 0x80 0x80 Ox00 In this data stream: NCOMF = 3 - each colour value has 3 components COMFLEN = 1 - each component is 1 octet long NVALS = 10 - there are 10 total colour instances RUNLENl= 3 CVALl= (255,255,255) RUNLEN2 = 2 cvAL2 = (O, o, O) RUNLEN3 = 1 (note that this is code
30、d as three octets; one would have been sufficient, but the three-octet form is used for illustration) CVAL3 = (255,255,255) RUNLEN4 = 4 CVALA = (128, 128, O) Thus, the sequence of 10 3-component colour values decoded is: (255,255,255) (255,255,255) (255,255,255) (OYO, 0) (OYO, 0) (255,255,255) (128,
31、 128, O) (128, 128, O) (128, 128, O) (128, 128, O) Recommendation T.45 (02/2000) 3 Series A Series B Series C Series D Series E Series F Series G Series H Series I Series J Series K Series L Series M Series N Series O Series P Series Q Series R Series S Series T Series U Series V Series X Series Y S
32、eries Z ITU-T RECOMMENDATIONS SERIES Organization of the work of the U-T Means of expression: definitions, symbols, classification General telecommunication statistics General tariff principles Overall network operation, telephone service, service operation and human factors Non-telephone telecommun
33、ication services Transmission systems and media, digital systems and networks Audiovisual and multimedia systems Integrated services digital network Transmission of television, sound programme and other multimedia signals Protection against interference Construction, installation and protection of c
34、ables and other elements of outside plant TMN and network maintenance: international transmission systems, telephone circuits, telegraphy, facsimile and leased circuits Maintenance: international sound programme and television transmission circuits Specifications of measuring equipment Telephone tra
35、nsmission quality, telephone installations, local line networks Switching and signalling Telegraph transmission Telegraph services terminal equipment Terminals for telematic services Telegraph switching Data communication over the telephone network Data networks and open system communications Global information infrastructure and Internet protocol aspects Languages and general software aspects for telecommunication systems