ISO/IEC JTC 1 / SC 29 /WG 1 N 1359
Date: 1999 July 16
ISO/IEC JTC 1 / SC 29/ WG 1
(ITU–T SG8)
Coding of Still Pictures
JBIG
Joint Bi-level Image
Experts Group
JPEG
Joint Photographic
Experts Group
TITLE: 14492 FCD
SOURCE: JBIG Committee
PROJECT: JTC 1.29.10
STATUS: Final Committee Draft
REQUESTED
ACTION: For ballot
DISTRIBUTION: WG1 mailing list
Contact:
ISO/IEC JTC 1/SC 29 / WG 1 Convenor – Dr. Daniel T. Lee
Hewlett-Packard Company, 11000 Wolfe Road, MS42U0, Cupertino CA 95014, USA
Telephone: +1 408 447 4160, Fax: +1 408 447 2842, Email: Daniel
Lee@hp.com
14492 FCD
INFORMATION TECHNOLOGY — CODED REPRESENTATION OF
PICTURE AND AUDIO INFORMATION — LOSSY/LOSSLESS
CODING OF BI-LEVEL IMAGES
JBIG committee
1999 July 16
Contents
0 Introduction 11
0.1 Interpretationanduseoftherequirements .............................. 11
0.1.1 SubjectmatterforJBIG2coding............................... 11
0.1.2 Relationshipbetweensegmentsanddocuments....................... 12
0.1.3 Structureanduseofsegments ................................ 12
0.1.4 Internalrepresentations.................................... 13
0.1.5 Decodingresults ....................................... 13
0.1.6 Decodingprocedures..................................... 13
0.2 Lossycoding ............................................. 15
0.2.1 Symbolcoding ........................................ 16
0.2.2 Genericcoding........................................ 16
0.2.3 Halftonecoding........................................ 16
0.2.4 Consequencesofinadequatesegmentation.......................... 16
1Scope 18
2 Normative References 19
3 Terms and Definitions 20
4 Symbols and Abbreviations 25
4.1 Abbreviations............................................. 25
4.2 Symboldefinitions .......................................... 25
4.3 Operatordefinitions.......................................... 32
5 Conventions 34
5.1 Typographic conventions . . . .................................... 34
5.2 Binarynotation ............................................ 34
5.3 Hexadecimalnotation......................................... 34
5.4 Integervaluesyntax.......................................... 34
5.4.1 Bitpacking.......................................... 34
5.4.2 Multi-byte values . . . .................................... 34
5.4.3 Bitnumbering ........................................ 34
5.4.4 Signedness .......................................... 34
5.5 Arraynotationandconventions.................................... 34
5.6 Imageandbitmapconventions .................................... 35
6 Decoding Procedures 36
6.1 Introduction to decoding procedures . ................................ 36
6.2 GenericRegionDecodingProcedure................................. 36
6.2.1 Generaldescription...................................... 36
6.2.2 Input parameters . . . .................................... 37
6.2.3 Returnvalue ......................................... 37
6.2.4 Variablesusedindecoding.................................. 37
6.2.5 Decodingusingatemplateandarithmeticcoding...................... 37
6.2.5.1 Generaldescription ................................ 37
6.2.5.2 Codingorderandedgeconventions........................ 37
6.2.5.3 Fixedtemplates .................................. 38
6.2.5.4 Adaptivetemplatepixels ............................. 39
6.2.5.5 Typicalpredictionforgenericdirectcoding(TPGD)............... 41
6.2.5.6 Skippedpixels................................... 41
6.2.5.7 Decodingthebitmap................................ 41
1
6.2.6 DecodingusingMMRcoding ................................ 42
6.3 GenericRefinementRegionDecodingProcedure .......................... 43
6.3.1 Generaldescription...................................... 43
6.3.2 Input parameters . . . .................................... 43
6.3.3 Returnvalue ......................................... 43
6.3.4 Variablesusedindecoding.................................. 43
6.3.5 Decodingusingatemplateandarithmeticcoding...................... 45
6.3.5.1 Generaldescription ................................ 45
6.3.5.2 Codingorderandedgeconventions........................ 45
6.3.5.3 Fixedtemplatesandadaptivetemplates...................... 45
6.3.5.4 Adaptivetemplatepixels ............................. 46
6.3.5.5 Typicalpredictionforgenericrefinement(TPGR) ................ 46
6.3.5.6 Decodingtherefinementbitmap ......................... 46
6.4 TextRegionDecodingProcedure................................... 47
6.4.1 Generaldescription...................................... 47
6.4.2 Input parameters . . . .................................... 49
6.4.3 Returnvalue ......................................... 49
6.4.4 Variablesusedindecoding.................................. 49
6.4.5 Decodingthetextregion................................... 51
6.4.6 StripdeltaT ......................................... 54
6.4.7 FirstsymbolinstanceScoordinate.............................. 54
6.4.8 SubsequentsymbolinstanceScoordinate.......................... 54
6.4.9 SymbolinstanceTcoordinate ................................ 54
6.4.10 SymbolinstancesymbolID ................................. 54
6.4.11 Symbolinstancebitmap ................................... 54
6.4.11.1 Symbolinstancerefinementdeltawidth...................... 55
6.4.11.2 Symbolinstancerefinementdeltaheight ..................... 55
6.4.11.3 SymbolinstancerefinementXoffset ....................... 55
6.4.11.4 SymbolinstancerefinementYoffset ....................... 55
6.4.11.5 Symbolinstancerefinementbitmapdatasize................... 55
6.5 SymbolDictionaryDecodingProcedure............................... 56
6.5.1 Generaldescription...................................... 56
6.5.2 Input parameters . . . .................................... 56
6.5.3 Returnvalue ......................................... 56
6.5.4 Variablesusedindecoding.................................. 56
6.5.5 Decodingthesymboldictionary............................... 56
6.5.6 Heightclassdeltaheight................................... 60
6.5.7 Deltawidth.......................................... 60
6.5.8 Symbolbitmap........................................ 60
6.5.8.1 Direct-codedsymbolbitmap ........................... 60
6.5.8.2 Refinement/aggregate-codedsymbolbitmap ................... 60
6.5.8.2.1 Numberofsymbolinstancesinaggregation .............. 61
6.5.8.2.2 Decoding a bitmap when REFAGGNINST
=1
............ 61
6.5.8.2.3 Setting SBSYMCODES and SBSYMCODELEN .......... 63
6.5.8.2.4 Setting SBSYMS ............................ 63
6.5.9 Heightclasscollectivebitmap ................................ 63
6.5.10 Exported symbols . . .................................... 64
6.6 HalftoneRegionDecodingProcedure ................................ 65
6.6.1 Generaldescription...................................... 65
6.6.2 Input parameters . . . .................................... 65
6.6.3 Returnvalue ......................................... 65
6.6.4 Variablesusedindecoding.................................. 65
6.6.5 Decodingthehalftoneregion................................. 66
6.6.5.1 ComputingHSKIP................................. 68
2
6.6.5.2 Renderingthepatterns............................... 68
6.7 PatternDictionaryDecodingProcedure ............................... 69
6.7.1 Generaldescription...................................... 69
6.7.2 Input parameters . . . .................................... 69
6.7.3 Returnvalue ......................................... 69
6.7.4 Variablesusedindecoding.................................. 69
6.7.5 Decodingthepatterndictionary ............................... 70
7 Control Decoding Procedure 71
7.1 Generaldescription.......................................... 71
7.2 Segmentheadersyntax ........................................ 72
7.2.1 Segmentheaderfields .................................... 72
7.2.2 Segmentnumber ....................................... 72
7.2.3 Segmentheaderflags..................................... 72
7.2.4 Referred-to segment count and retention flags . . . ..................... 73
7.2.5 Referred-tosegmentnumbers ................................ 74
7.2.6 Segmentpageassociation .................................. 74
7.2.7 Segmentdatalength ..................................... 74
7.2.8 Segmentheaderexample................................... 75
7.3 Segmenttypes............................................. 75
7.3.1 Rulesforsegmentreferences................................. 77
7.3.2 Rulesforpageassociations.................................. 78
7.4 Segmentsyntaxes........................................... 78
7.4.1 Regionsegmentinformationfield .............................. 78
7.4.1.1 Regionsegmentbitmapwidth........................... 78
7.4.1.2 Regionsegmentbitmapheight .......................... 79
7.4.1.3 RegionsegmentbitmapXlocation ........................ 79
7.4.1.4 RegionsegmentbitmapYlocation ........................ 79
7.4.1.5 Regionsegmentflags ............................... 79
7.4.2 Symboldictionarysegmentsyntax.............................. 80
7.4.2.1 Symboldictionarysegmentdataheader...................... 80
7.4.2.1.1 Symboldictionaryflags......................... 80
7.4.2.1.2 SymboldictionaryATflags....................... 81
7.4.2.1.3 SymboldictionaryrefinementATflags................. 82
7.4.2.1.4 Number of exported symbols (SDNUMEXSYMS) .......... 82
7.4.2.1.5 Number of new symbols (SDNUMNEWSYMS) ........... 82
7.4.2.1.6 SymboldictionarysegmentHuffmantableselection.......... 83
7.4.2.2 Decodingasymboldictionarysegment...................... 83
7.4.3 Textregionsegmentsyntax.................................. 85
7.4.3.1 Textregionsegmentdataheader ......................... 85
7.4.3.1.1 Textregionsegmentflags........................ 85
7.4.3.1.2 TextregionsegmentHuffmanflags................... 86
7.4.3.1.3 TextregionrefinementATflags..................... 88
7.4.3.1.4 Number of symbol instances (SBNUMINSTANCES)......... 88
7.4.3.1.5 TextregionsegmentsymbolIDHuffmandecodingtable ....... 88
7.4.3.1.6 TextregionsegmentHuffmantableselection.............. 88
7.4.3.1.7 SymbolIDHuffmantabledecoding .................. 89
7.4.3.2 Decodingatextregionsegment.......................... 94
7.4.4 Patterndictionarysegmentsyntax .............................. 94
7.4.4.1 Patterndictionarysegmentdataheader...................... 94
7.4.4.1.1 Patterndictionaryflags ......................... 94
7.4.4.1.2 Width of the patterns in the pattern dictionary (HDPW)........ 96
7.4.4.1.3 Height of the patterns in the pattern dictionary (HDPH)........ 96
7.4.4.1.4 Largest gray-scale value (GRAYMAX) ................ 96
3