ISO/IEC 14492:2019 情報技術—2レベル画像の不可逆/可逆コーディング | ページ 3

※一部、英文及び仏文を自動翻訳した日本語訳を使用しています。

0 はじめに

このおすすめ |非公式に JBIG2 と呼ばれる国際標準は、2 値画像 (たとえば、白黒の印刷物) のコーディング方法を定義します。これらは、単一の長方形のビット プレーンで構成されるイメージで、各ピクセルは 2 つの可能な色のうちの 1 つを取ります。複数の色は、ITU-T 勧告 T.44 などの適切な上位レベルの標準を使用して処理する必要があります。これは、1988 年に設立され、ISO/IEC JTC 1/SC29/WG1 と ITU-T の両方に報告する「共同チーム」である、Joint Bi-level Image Experts Group (JBIG) によって起草されています。

このタイプの画像の圧縮は、既存のファクシミリ標準でも対処されています。たとえば、ITU-T 勧告 T., T., T.8, および T の圧縮アルゴリズムです。 .85 (ファクシミリ用 JBIG1 のアプリケーション プロファイル)明らかなファクシミリ アプリケーションに加えて、JBIG2 はドキュメントの保存とアーカイブ、World Wide Web での画像のコーディング、ワイヤレス データ送信、印刷スプーリング、さらには電話会議にも役立ちます。

1993 年に終了したプロセスの結果として、JBIG は正式に勧告 ITU-T T.82 と指定された最初のコーディング標準を作成しました。非公式に JBIG または JBIG1 として知られている国際規格 ISO/IEC 1154 JBIG1 は、ロスレスおよびプログレッシブ (ロッシーからロスレス) コーディングとして動作することを目的としています。非可逆符号化の機能がありますが、JBIG1 によって生成される非可逆画像は、元の画像のピクセル数が元の画像の 4 分の 1 を超えることができないため、元の画像よりも大幅に品質が低下します。

それどころか、JBIG2 は非可逆、可逆、および非可逆から可逆の画像圧縮用に明示的に準備されていました。 JBIG2 の設計目標は、既存の標準よりも優れた可逆圧縮パフォーマンスを実現し、既存の標準の可逆圧縮率よりもはるかに高い圧縮率で非可逆圧縮を可能にすることであり、目に見える品質の低下はほとんどありません。さらに、JBIG2 では、低品質から高品質 (またはロスレス) に進行する品質プログレッシブ コーディングと、さまざまな種類の画像データ (たとえば、最初のテキスト、次にハーフトーンなど) を連続して追加するコンテンツ プログレッシブ コーディングの両方が可能です。一般的な JBIG2 エンコーダーは、入力された 2 値画像をいくつかの領域に分解し、異なるコーディング方法を使用して各領域を個別にコーディングします。このようなコンテンツベースの分解は、特にインタラクティブなマルチメディア アプリケーションでは非常に望ましいものです。 JBIG2 は、明示的な方法で一連の画像 (複数ページのドキュメント) を処理することもできます。

画像圧縮規格でよくあることですが、JBIG2 はビットストリーム準拠の要件を明示的に定義し、デコーダの動作を定義します。 JBIG2 は、標準のエンコーダーを明示的に定義していませんが、代わりに、洗練されたエンコーダーの設計を可能にするのに十分な柔軟性を備えています。実際、エンコーダの設計は、競合する JBIG2 実装の主要な差別化要因になります。

この推奨事項 |国際標準は、ビットストリームを解釈するためにデコーダーによって実行されるアクションの観点から表現されます。実際に実行するアクションに関係なく、正しい結果 (これらのアクションによって定義される) を生成するデコーダーは準拠しています。

附属書 A, B, C, D, E, および F は規範的であり、したがって、この勧告の不可欠な部分を形成します。国際規格。附属書 G, H, I, J および K は参考情報であり、したがって、この勧告の不可欠な部分を構成するものではありません。国際規格。

0.1 要件の解釈と使用

このセクションは参考情報であり、この勧告の要件を解釈するのに役立つように設計されています。国際規格。要件は、実装の柔軟性を大幅に高めるために、可能な限り一般的に記述されています。したがって、要件の文言は、アプリケーションまたは実装に固有のものではありません。このセクションでは、要件の一般的な文言とこの勧告の意図された使用との間の対応を示します。典型的なアプリケーションの国際規格。

0.1.1 JBIG2コーディングの主題

JBIG2 は、2 レベル ドキュメントのコーディングに使用されます。 2 段階文書には、1 つまたは複数のページが含まれます。典型的なページには、いくつかのテキスト データ、つまり、横または縦の行に配置された小さなサイズの文字が含まれています。ページのテキスト部分の文字は、JBIG2 ではシンボルと呼ばれます。ページには、「ハーフトーン データ」、つまり 2 値画像を生成するためにディザリングされたグレースケールまたはカラーの多値画像 (写真など) も含まれる場合があります。ページのハーフトーン部分の周期的なビットマップ セルは、JBIG2 ではパターンと呼ばれます。さらに、ページには線画やノイズなどの他のデータが含まれる場合があります。このような非テキスト、非ハーフトーン データは、JBIG2 ではジェネリックデータと呼ばれます。

JBIG2 イメージ モデルは、テキスト データとハーフトーン データを特殊なケースとして扱います。 JBIG2 エンコーダーは、ページのコンテンツを、デジタル化されたテキストを含むテキスト領域、デジタル化されたハーフトーンを含むハーフトーン領域、および線画などの残りのデジタル化された画像データを含む一般的な領域に分割することが期待されます。状況によっては、(画質または圧縮データ サイズの点で) テキストまたはハーフトーンを一般的なデータと見なした方がよい場合があります。逆に、状況によっては、特殊なケースの 1 つを使用して汎用データを検討する方が適切な場合があります。

エンコーダーは 1 ページを任意の数の領域に分割できますが、多くの場合、テキスト シンボル用に 1 つ、ハーフトーン パターン用に 1 つ、一般的な残りの部分用に 3 つの領域で十分です。場合によっては、すべてのタイプのデータが存在するわけではなく、ページが 3 つ未満の領域で構成されていることがあります。

さまざまな領域が物理ページ上で重なる場合があります。 JBIG2 は、重なり合う領域を再結合して最終的なページ イメージを形成する方法を指定する手段を提供します。

テキスト領域は、背景の指定された位置に配置された多数の記号で構成されます。記号は通常、個々のテキスト文字に対応しています。 JBIG2 は、個々のシンボルを複数回使用することで、その効果の多くを得ることができます。シンボルを再利用するには、エンコーダーまたはデコーダーがそれを参照する簡潔な方法を備えている必要があります。 JBIG2 では、シンボルは 1 つ以上のシンボル辞書に集められます。シンボル ディクショナリは、テキスト シンボルのビットマップのセットであり、シンボル ビットマップをインデックス番号で参照できるようにインデックスが付けられています。

ハーフトーン領域は、規則的なグリッドに沿って配置された多数のパターンで構成されます。パターンは通常、グレースケール値に対応します。実際、パターン インデックスのコーディング方法は、グレースケール コーダーとして設計されています。圧縮は、1 つのグリッド セルのバイナリ ピクセルを 1 つの整数、ハーフトーン インデックス (通常はレンダリングされたグレースケール値) で表すことによって実現できます。この多対 1 のマッピング (セル内のパターンをグレースケール値に変換する) は、元のビットマップに存在するエッジ情報がハーフトーン コーディングによって失われる可能性があります。このため、ハーフトーンがハーフトーン コーディングではなく一般的なコーディングでコーディングされている場合、ハーフトーンのロスレスまたはロスレスに近いコーディングは、多くの場合、画質が向上します (サイズは大きくなります)

0.1.2 セグメントとドキュメントの関係

JBIG2 ファイルには、バイレベル ドキュメントをデコードするために必要な情報が含まれています。 JBIG2 ファイルはセグメントで構成されています。典型的なページは、いくつかのセグメントを使用してコーディングされています。単純なケースでは、ページ情報セグメント、記号辞書セグメント、テキスト領域セグメント、パターン辞書セグメント、ハーフトーン領域セグメント、およびページ終了セグメントがあります。ページ情報セグメントは、サイズや解像度など、ページに関する一般的な情報を提供します。ディクショナリ セグメントは、リージョン セグメントで参照されるビットマップを収集します。領域セグメントは、辞書からビットマップを参照し、ページ上のどこに表示するかを指定することによって、テキスト領域とハーフトーン領域の外観を記述します。ページの終わりセグメントは、ページの終わりを示します。

0.1.3 セグメントの構造と使用

各セグメントには、セグメント ヘッダー、データ ヘッダー、およびデータが含まれます。セグメント ヘッダーは、セグメント参照情報を伝達するために使用されます。また、複数ページのドキュメントの場合は、ページ関連付け情報を伝達するために使用されます。データ ヘッダーは、セグメント内のデータのデコードに使用される情報を提供します。データは、画像領域または辞書を記述したり、その他の情報を提供したりします。

セグメントには順番に番号が付けられます。セグメントは、番号の小さいセグメントまたは以前のセグメントを参照する場合があります。リージョン セグメントは、常にドキュメントの特定の 1 ページに関連付けられています。辞書セグメントは、文書の 1 ページに関連付けることも、文書全体に関連付けることもできます。

リージョン セグメントは、1 つまたは複数の以前の辞書セグメントを参照する場合があります。このような参照の目的は、画像に存在する辞書セグメント内のシンボルをデコーダが識別できるようにすることです。

領域セグメントは、以前の領域セグメントを参照する場合があります。このような参照の目的は、以前のセグメントで説明されたイメージをページの現在の表現と結合することです。

辞書セグメントは、以前の辞書セグメントを参照する場合があります。辞書セグメントに追加された記号は、直接記述されるか、同じ辞書セグメントまたは以前の辞書セグメントのいずれかで、以前に記述された記号の改良として記述される場合があります。

JBIG2 ファイルは、シーケンシャル アクセスまたはランダム アクセスの 2 つの方法で編成できます。順次編成では、各セグメントのセグメント ヘッダーは、そのセグメントのデータ ヘッダーとデータの直前に、すべて順番に並んでいます。ランダム アクセス方式では、すべてのセグメント ヘッダーがファイルの先頭に集められ、その後にすべてのセグメントのデータ (データ ヘッダーを含む) が同じ順序で続きます。この 2 番目の構成により、デコーダーはファイル全体を読み取ることなく、すべてのセグメントの依存関係を判別できます。

JBIG2 でエンコードされたデータをカプセル化する 3 つ目の方法は、JBIG2 以外のファイルにデータを埋め込むことです。これは、埋め込み組織と呼ばれることもあります。この場合、別のファイル形式で JBIG2 セグメントが伝送されます。セグメント ヘッダー、データ ヘッダー、および各セグメントのデータは一緒に格納されますが、埋め込みファイル形式では、セグメントを任意の順序で、独自の構造内の任意のセットの場所に格納できます。

0.1.4 内部表現

デコードされたデータは、印刷または表示する前に保存する必要があります。この勧告 |国際標準は、それを格納する方法を指定していません。そのデコード モデルは、特定のデータ構造、特にバッファと辞書を想定しています。

図 1 は、主要なデコーダ コンポーネントと関連するバッファを示しています。この図では、デコード手順は太い線で概説され、メモリ コンポーネントは非太線で概説されています。また、太い矢印は、1 つの復号化手順が別の復号化手順を呼び出すことを示します。たとえば、記号辞書デコード手順は、汎用領域デコード手順を呼び出して、それが定義する記号のビットマップをデコードします。太字でない矢印はデータの流れを示します。テキスト領域のデコード手順は、シンボル メモリからシンボルを読み取り、それらをページ バッファまたは補助バッファに描画します。図 1 には示されていませんが、エンコードされたデータ ストリームはデコード手順に流れ、「ページおよび補助バッファー」とラベル付けされたブロックは、最終的なデコードされたページ イメージを生成します。

図 1 —主要なデコーダ コンポーネントのブロック図

特定の JBIG2 ビットストリームをデコードするために必要なリソースは、そのビットストリームの複雑さによって異なります。ストライピングなどの一部の手法を使用して、デコーダのメモリ要件を減らすことができます。フル機能のデコーダーは、ほとんどのビットストリームをデコードするために、2 つのフルページ バッファー、ほぼ同じ量の辞書メモリ、および約 100 キロバイトの算術コーディング コンテキスト メモリを必要とする可能性があると推定されます。

バッファはビットマップの表現です。バッファーは大量のデータ (通常はページのサイズ) を保持することを目的としています。バッファには、領域またはページ全体の説明が含まれる場合があります。バッファーが領域のみを記述している場合でも、ページ上の配置を指定する情報が関連付けられています。リージョン セグメントをデコードすると、バッファの内容が変更されます。

page bufferという特別なバッファが 1 つあります。ページが完全にデコードされるまで、デコーダが領域データをページ バッファに直接蓄積することを意図しています。その後、データを出力デバイスまたはファイルに送信できます。即時領域セグメントをデコードすると、ページ バッファーの内容が変更されます。ページを準備する通常の方法は、1 つまたは複数の即時領域セグメントをデコードし、それぞれがページ バッファーを変更することです。デコーダーは、プログレッシブ送信の一部として、またはユーザー入力に応答して、不完全なページ バッファーを出力する場合があります。このような出力はオプションであり、その内容はこの勧告によって指定されていません。国際規格。

他のすべてのバッファーは補助バッファーです。デコーダーが補助バッファーを埋め、後でそれを使用してページバッファーを調整することを意図しています。アプリケーションでは、多くの場合、補助バッファーを使用する必要はありません。中間領域セグメントをデコードすると、補助バッファーの内容が変更されます。デコーダーは補助バッファーを使用して、プログレッシブ送信の一部として、またはユーザー入力に応答して、完全なページ バッファーにあるページ以外のページを出力する場合があります。このような出力はオプションであり、その内容はこの勧告によって指定されていません。国際規格。

シンボル ディクショナリは、インデックス付きの一連のビットマップで構成されます。通常、ディクショナリ内のビットマップは小さく、ほぼテキスト文字のサイズです。バッファとは異なり、ディクショナリ内のビットマップには、関連付けられたページ位置情報がありません。

0.1.5 デコード結果

セグメントのデコードには、1 つまたは複数のデコード手順の呼び出しが含まれます。呼び出されるデコード手順は、セグメント タイプによって決まります。

リージョン セグメントをデコードした結果は、バッファ (場合によってはページ バッファ) に格納されたビットマップになります。領域セグメントをデコードすると、新しいバッファがいっぱいになるか、既存のバッファが変更される場合があります。典型的なアプリケーションでは、データをバッファに配置するには、ピクセルを背景色から前景色に変更する必要があります。国際標準では、バッファのピクセルを変更するその他の許容される方法を指定しています。

典型的なページは、1 つまたは複数の直接領域セグメントによって記述され、それぞれがページ バッファの変更をもたらします。

以前に指定されたシンボルを改良することによって辞書内の新しいシンボルを指定できるように、既存のバッファを改良することによって新しいバッファを指定することもできます。しかしながら、領域は、一般的な改良復号手順によってのみ改良され得る。このような改良では、改良されるバッファ内の領域の内部構造は使用されません。バッファーが調整されると、元のバッファーは使用できなくなります。

辞書セグメントをデコードした結果が新しい辞書です。ディクショナリ内の記号は、後でテキスト領域デコード手順によってバッファに配置される場合があります。

0.1.6 デコード手順

一般的な領域デコード手順は、算術コーディングが使用されている場合はピクセルごとに、MMR およびハフマン コーディングが使用されている場合は前景ピクセルと背景ピクセルの実行によって、バッファを直接埋めたり変更したりします。算術符号化の場合、予測コンテキストには、現在のセグメント内で既に復号化されたデータによって決定されるピクセルのみが含まれます。

一般的なリファインメント領域デコード手順では、算術コーディングを使用してピクセルごとにバッファーを変更します。予測コンテキストは、現在のセグメント内で既にデコードされたデータによって決定されるピクセルと、ページ バッファーまたは補助バッファーのいずれかに既に存在するピクセルを使用します。

テキスト領域のデコード手順では、1 つまたは複数の記号辞書から記号を取得し、それらをバッファに配置します。このプロシージャは、テキスト領域セグメントのデコード中に呼び出されます。テキスト領域セグメントには、バッファに配置される各シンボルの位置とインデックス情報が含まれています。シンボルのビットマップは、シンボル辞書から取得されます。

シンボル ディクショナリのデコード手順では、シンボル ディクショナリ、つまりインデックス付きのシンボル ビットマップのセットが作成されます。ディクショナリ内のビットマップは直接コーディングできます。すでに辞書にあるシンボルの改良版としてコード化することができます。または、すでに辞書にある 2 つ以上の記号の集合体としてコード化される場合もあります。このデコード手順は、記号辞書セグメントのデコード中に呼び出されます。

ハーフトーン領域のデコード処理では、パターン ディクショナリからパターンを取得し、それらをバッファに配置します。この手順は、ハーフトーン領域セグメントのデコード中に呼び出されます。ハーフトーン領域セグメントには、バッファに配置されるすべてのパターンの位置情報と、パターン自体のインデックス情報が含まれています。ハーフトーンの固定サイズのビットマップであるパターンは、ハーフトーン ディクショナリから取得されます。

パターン ディクショナリのデコード手順では、ディクショナリ、つまり固定サイズのビットマップ (パターン) のインデックス付きセットが作成されます。ディクショナリ内のビットマップは、直接かつ結合してコーディングされます。このデコード手順は、パターン辞書セグメントのデコード中に呼び出されます。

制御デコード手順は、セグメント タイプ情報を含むセグメント ヘッダーをデコードします。セグメント タイプは、セグメントをデコードするためにどのデコード プロシージャを呼び出す必要があるかを決定します。セグメント タイプは、セグメントからのデコードされた出力が配置される場所も決定します。セグメント ヘッダーにも存在し、制御デコード手順によってデコードされるセグメント参照情報は、現在のセグメントをデコードするために他のどのセグメントを使用する必要があるかを決定します。制御デコード手順は、図 1 に示されているすべてに影響するため、個別のブロックとして示されていません。

表 1 は、デコードされるデータの種類、データのデコードを担当するデコード手順、およびデコードされたデータの最終的な表現をまとめたものです。

表 1 —解読プロセスのエンティティ

概念JBIG2
ビット ストリーム エンティティ
JBIG2
解読エンティティ
物理的
表現
ドキュメントJBIG2 ファイルJBIG2 デコーダー出力メディアまたはデバイス
ページセグメントのコレクション制御解読手順で暗黙的ページバッファ
領域地域セグメントリージョンデコード手順ページバッファーまたは補助バッファー
辞書辞書セグメント辞書解読手順記号一覧
文字記号辞書セグメント内のフィールド記号辞書解読手順ビットマップ アイコン
グレースケール値ハーフトーン辞書セグメント内のフィールドパターン辞書解読手順パターン

0.2 ロッシーコーディング

このおすすめ |国際標準では、2 値画像の非可逆符号化を制御する方法を定義していません。むしろ、エンコーダーがエンコードすることを選択したビットマップの完全な再構築を実行する方法を定義します。エンコーダーが元のビットマップとは異なるビットマップをエンコードすることを選択した場合、プロセス全体が非可逆コーディングの 1 つになります。さまざまなコーディング方法により、収益性の高い方法で損失を導入するさまざまな方法が可能になります。

0.2.1 シンボルコーディング

ロッシー シンボル コーディングは、テキスト領域のロッシー コーディングを行う自然な方法を提供します。この考え方は、元のシンボル ビットマップとシンボル ディクショナリでインデックス付けされたものとの間の小さな違いを許容することです。大きなディクショナリをコーディングする必要がなく、その後、小さなディクショナリの結果として安価なシンボル インデックス コーディングを行うことによって、圧縮ゲインが得られます。 2 つのビットマップが本質的に同じか、本質的に異なるかを判断するのは、エンコーダーです。この手法は、[1] で最初に説明されました。

ロッシー シンボル コーディングの危険性は、置換エラーが発生することです。つまり、エンコーダーが 1 つの文字に対応するビットマップを別の文字を表すビットマップに置き換えて、人間のリーダーが文字を読み違えてしまうことです。置換エラーのリスクは、ビットマップ間の差異の複雑な測定を使用することによって、および/またはインデックス付きビットマップの重要なピクセルが正しいことを確認することによって減らすことができます。 [5] で説明されている、これを制御する 1 つの方法は、間違っている可能性のあるシンボルにインデックスを付けてから、そのシンボル ビットマップに改良コーディングを適用することです。アイデアは、基本的な文字形状をわずかなコストでエンコードし、エンコーダーが文字の意味を変更すると信じるピクセルを修正することです。

テキスト領域に損失を効果的に導入するプロセスは、ドキュメントからフライスペックを削除したり、文字のエッジを正規化したりするなど、より単純な形式を取る場合もあります。ほとんどの場合、このような変更により、領域の全体的な外観に影響を与えることなく、領域のコード長が短縮されます。場合によっては、外観が改善されることさえあります。

JBIG2 でこの種の不可逆シンボル コーディングを実行する多くの例は、[7] に記載されています。

注 — 「テキスト領域」という用語は、シンボル コーディングを使用してコード化されたページの領域に使用されますが、シンボル コーディングの他の可能な用途には、線画やその他の非テキスト データのコーディングが含まれます。

0.2.2 ジェネリックコーディング

ジェネリック コーディングを使用してニアロスレス コーディングを実行するために、エンコーダは元のイメージに前処理を適用し、変更されたイメージをロスレスでエンコードします。難しいのは、変更によってコード長が短くなり、変更されたイメージの品質が変更によってひどく損なわれないようにすることです。 [11] には、2 つの可能な前処理が示されています。これらの前処理はピクセルを反転します。反転すると、領域の合計コード長が大幅に短くなりますが、視覚的な品質を著しく損なうことなく反転できます。前処理により、周期的なハーフトーンの効果的なほぼ無損失のコーディングが可能になり、他のデータ タイプの圧縮が適度に向上します。前処理は、誤差拡散画像やブルー ノイズでディ​​ザリングされた画像にはあまり適していません。

0.2.3 ハーフトーンコーディング

ハーフトーン コーディングは、クラスタ化されたドットで順序付けられたディザ画像など、周期的なハーフトーンに対して非常に高い圧縮率を得る自然な方法です。上記の一般的な非可逆コーディングとは対照的に、ハーフトーン コーディングは元のビットマップを保持することを意図していませんが、これは特別な場合に可能です。元の画像のすべてのパターンをディクショナリに入れるわけではないため、追加の圧縮のために損失を導入することもできます。これにより、ハーフトーン パターンの数と、どのパターンがどの位置で使用されるかを指定するために必要なビット数の両方が減少します。

誤差拡散イメージとブルー ノイズでディ​​ザリングされたイメージのロッシー コーディングには、小さいグリッド サイズのハーフトーン コーディングを使用することをお勧めします。再構成された画像は細部が欠けており、ブロックが表示される場合がありますが、はっきりと認識できます。ブロック性は、後処理でデコーダ側で減らすことができます。たとえば、辞書に載っているパターン以外の再構成パターンを使用します。誤差拡散画像は、一般的なコーディングを使用して、ロスレスで、または上記のように損失を制御してコーディングすることもできます。

このハーフトーン コーディングの実行の詳細については、[12] を参照してください。

0.2.4 不適切なセグメンテーションの結果

品質とファイル サイズの両方の点で最適なコーディングを行うには、ドキュメント ページの適切な領域に対して正しい形式のエンコーディングを使用する必要があります。この節では、このセグメンテーションにおけるエラーの結果について簡単に説明します。

テキスト データとハーフトーン データの両方を含むドキュメントにロッシー シンボル コーディングを使用すると、圧縮率が低下します。エンコーダーによって、ハーフトーン データの品質が良い場合と悪い場合があります。 [5] で説明されているロッシー シンボル コーディングの形式を使用すると、おそらく視覚的な品質が低下することはありません。

通常、シンボルとハーフトーン データの両方を含むドキュメントにロッシー ジェネリック コーディングを使用すると ([11] に記載されている前処理を使用)、良好な品質と適度な圧縮が得られます。

線画と手書きテキストの領域は、一般的なコーディングを使用して効率的にコーディングできますが、エンコーダによっては、これらのタイプの領域もシンボル コーディングで非常に効果的にコーディングできます。

0 Introduction

This Recommendation | International Standard, informally called JBIG2, defines a coding method for bi-level images (e.g., black and white printed matter). These are images consisting of a single rectangular bit plane, with each pixel taking on one of just two possible colours. Multiple colours are to be handled using an appropriate higher level standard such as Recommendation ITU-T T.44. It is being drafted by the Joint Bi-level Image Experts Group (JBIG), a “Collaborative Team”, established in 1988, that reports both to ISO/IEC JTC 1/SC29/WG1 and to ITU-T.

Compression of this type of image is also addressed by existing facsimile standards, for example by the compression algorithms in Recommendations ITU-T T.4 (MH, MR), T.6 (MMR), T.82 (JBIG1), and T.85 (Application profile of JBIG1 for facsimile). Besides the obvious facsimile application, JBIG2 will be useful for document storage and archiving, coding images on the World Wide Web, wireless data transmission, print spooling, and even teleconferencing.

As the result of a process that ended in 1993, JBIG produced a first coding standard formally designated Recommendation ITU-T T.82 | International Standard ISO/IEC 11544, which is informally known as JBIG or JBIG1. JBIG1 is intended to behave as lossless and progressive (lossy-to-lossless) coding. Though it has the capability of lossy coding, the lossy images produced by JBIG1 have significantly lower quality than the original images because the number of pixels in the lossy image cannot exceed one quarter of those in the original image.

On the contrary, JBIG2 was explicitly prepared for lossy, lossless, and lossy-to-lossless image compression. The design goal for JBIG2 was to allow for lossless compression performance better than that of the existing standards, and to allow for lossy compression at much higher compression ratios than the lossless ratios of the existing standards, with almost no visible degradation of quality. In addition, JBIG2 allows both quality-progressive coding, with the progression going from lower to higher (or lossless) quality, and content-progressive coding, successively adding different types of image data (for example, first text, then halftones). A typical JBIG2 encoder decomposes the input bi-level image into several regions and codes each of the regions separately using a different coding method. Such content-based decomposition is very desirable especially in interactive multimedia applications. JBIG2 can also handle a set of images (multiple page document) in an explicit manner.

As is typical with image compression standards, JBIG2 explicitly defines the requirements of a compliant bitstream, and thus defines decoder behaviour. JBIG2 does not explicitly define a standard encoder, but instead is flexible enough to allow sophisticated encoder design. In fact, encoder design will be a major differentiator among competing JBIG2 implementations.

Although this Recommendation | International Standard is phrased in terms of actions to be taken by decoders to interpret a bitstream, any decoder that produces the correct result (as defined by those actions) is compliant, regardless of the actions it actually takes.

Annexes A, B, C, D, E and F are normative, and thus form an integral part of this Recommendation | International Standard. Annexes G, H, I, J and K are informative, and thus do not form an integral part of this Recommendation | International Standard.

0.1 Interpretation and use of the requirements

This section is informative and designed to aid in interpreting the requirements of this Recommendation | International Standard. The requirements are written to be as general as possible to allow a large amount of implementation flexibility. Hence the language of the requirements is not specific about applications or implementations. In this section a correspondence is drawn between the general wording of the requirements and the intended use of this Recommendation | International Standard in typical applications.

0.1.1 Subject matter for JBIG2 coding

JBIG2 is used to code bi-level documents. A bi-level document contains one or more pages. A typical page contains some text data, that is, some characters of a small size arranged in horizontal or vertical rows. The characters in the text part of a page are called symbols in JBIG2. A page may also contain “halftone data”, that is, gray-scale or colour multilevel images (e.g., photographs) that have been dithered to produce bi-level images. The periodic bitmap cells in the halftone part of the page are called patterns in JBIG2. In addition, a page may contain other data, such as line art and noise. Such non-text, non-halftone data is called generic data in JBIG2.

The JBIG2 image model treats text data and halftone data as special cases. It is expected that a JBIG2 encoder will divide the content of a page into a text region containing digitized text, a halftone region containing digitized halftones, and a generic region containing the remaining digitized image data, such as line-art. In some circumstances, it is better (in image quality or compressed data size) to consider text or halftones as generic data; conversely, in some circumstances it is better to consider generic data using one of the special cases.

An encoder is permitted to divide a single page into any number of regions, but often three regions will be sufficient, one for textual symbols, one for halftone patterns, and the third for the generic remainder. In some cases, not all types of data may be present, and the page may consist of fewer than three regions.

The various regions may overlap on the physical page. JBIG2 provides the means to specify how the overlapping regions are recombined to form the final page image.

A text region consists of a number of symbols placed at specified locations on a background. The symbols usually correspond to individual text characters. JBIG2 obtains much of its effectiveness by using individual symbols more than once. To reuse a symbol, an encoder or decoder must have a succinct way of referring to it. In JBIG2, the symbols are collected into one or more symbol dictionaries. A symbol dictionary is a set of bitmaps of text symbols, indexed so that a symbol bitmap may be referred to by an index number.

A halftone region consists of a number of patterns placed along a regular grid. The patterns usually correspond to gray-scale values. Indeed, the coding method of the pattern indices is designed as a gray-scale coder. Compression can be realized by representing the binary pixels of one grid cell by a single integer, the halftone index (which is usually a rendered gray-scale value). This many-to-one mapping (the pattern in a cell into a gray-scale value) may have the effect that edge information present in the original bitmap is lost by halftone coding. For this reason, lossless or near-lossless coding of halftones will often be better in image quality (though larger in size) if the halftone is coded with generic coding rather than halftone coding.

0.1.2 Relationship between segments and documents

A JBIG2 file contains the information needed to decode a bi-level document. A JBIG2 file is composed of segments. A typical page is coded using several segments. In a simple case, there will be a page information segment, a symbol dictionary segment, a text region segment, a pattern dictionary segment, a halftone region segment, and an end-of-page segment. The page information segment provides general information about the page, such as its size and resolution. The dictionary segments collect bitmaps referred to in the region segments. The region segments describe the appearance of the text and halftone regions by referencing bitmaps from a dictionary and specifying where they should appear on the page. The end-of-page segment marks the end of the page.

0.1.3 Structure and use of segments

Each segment contains a segment header, a data header, and data. The segment header is used to convey segment reference information and, in the case of multi-page documents, page association information. A data header gives information used for decoding the data in the segment. The data describes an image region or a dictionary, or provides other information.

Segments are numbered sequentially. A segment may refer to a lower-numbered, or earlier, segment. A region segment is always associated with one specific page of the document. A dictionary segment may be associated with one page of the document, or it may be associated with the document as a whole.

A region segment may refer to one or more earlier dictionary segments. The purpose of such a reference is to allow the decoder to identify symbols in a dictionary segment that are present into the image.

A region segment may refer to an earlier region segment. The purpose of such a reference is to combine the image described by the earlier segment with the current representation of the page.

A dictionary segment may refer to earlier dictionary segments. The symbols added to a dictionary segment may be described directly, or may be described as refinements of symbols described previously, either in the same dictionary segment or in earlier dictionary segments.

A JBIG2 file may be organized in two ways, sequential or random access. In the sequential organization, each segment’s segment header immediately precedes that segment’s data header and data, all in sequential order. In the random access organization, all the segment headers are collected together at the beginning of the file, followed by the data (including data headers) for all the segments, in the same order. This second organization permits a decoder to determine all segment dependencies without reading the entire file.

A third way of encapsulating of JBIG2-encoded data is to embed it in a non-JBIG2 file – this is sometimes called the embedded organization. In this case a different file format carries JBIG2 segments. The segment header, data header, and data of each segment are stored together, but the embedding file format may store the segments in any order, at any set of locations within its own structure.

0.1.4 Internal representations

Decoded data must be stored before printing or display. While this Recommendation | International Standard does not specify how to store it, its decoding model presumes certain data structures, specifically buffers and dictionaries.

Figure 1 illustrates major decoder components and associated buffers. In this figure, decoding procedures are outlined in bold lines, and memory components are outlined in non-bold lines. Also, bold arrows indicate that one decoding procedure invokes another decoding procedure; for example, the symbol dictionary decoding procedure invokes the generic region decoding procedure to decode the bitmaps for the symbols that it defines. Non-bold arrows indicate flow of data: the text region decoding procedure reads symbols from the symbol memory and draws them into the page buffer or an auxiliary buffer. Although it is not shown in Figure 1, the encoded data stream flows to the decoding procedures, and the block labelled “Page and auxiliary buffers” produces the final decoded page images.

Figure 1—Block diagram of major decoder components

The resources required to decode any given JBIG2 bitstream depend on the complexity of that bitstream. Some techniques such as striping can be used to reduce decoder memory requirements. It is estimated that a full-featured decoder may need two full-page buffers, plus about the same amount of dictionary memory, plus about 100 kilobytes of arithmetic coding context memory, to decode most bitstreams.

A buffer is a representation of a bitmap. A buffer is intended to hold a large amount of data, typically the size of a page. A buffer may contain the description of a region or of an entire page. Even if the buffer describes only a region, it has information associated with it that specifies its placement on the page. Decoding a region segment modifies the contents of a buffer.

There is one special buffer, the page buffer. It is intended that the decoder accumulate region data directly in the page buffer until the page has been completely decoded; then the data can be sent to an output device or file. Decoding an immediate region segment modifies the contents of the page buffer. The usual way of preparing a page is to decode one or more immediate region segments, each one modifying the page buffer. The decoder may output an incomplete page buffer, either as part of progressive transmission or in response to user input. Such output is optional, and its content is not specified by this Recommendation | International Standard.

All other buffers are auxiliary buffers. It is intended that the decoder fill an auxiliary buffer, then later use it to refine the page buffer. In an application, it will often be unnecessary to have any auxiliary buffers. Decoding an intermediate region segment modifies the contents of an auxiliary buffer. The decoder may use auxiliary buffers to output pages other than those found in a complete page buffer, either as part of progressive transmission or in response to user input. Such output is optional, and its content is not specified by this Recommendation | International Standard.

A symbol dictionary consists of an indexed set of bitmaps. The bitmaps in a dictionary are typically small, approximately the size of text characters. Unlike a buffer, a bitmap in a dictionary does not have page location information associated with it.

0.1.5 Decoding results

Decoding a segment involves invocation of one or more decoding procedures. The decoding procedures to be invoked are determined by the segment type.

The result of decoding a region segment is a bitmap stored in a buffer, possibly the page buffer. Decoding a region segment may fill a new buffer, or may modify an existing buffer. In typical applications, placing the data into a buffer involves changing pixels from the background colour to the foreground colour, but this Recommendation | International Standard specifies other permissible ways of changing a buffer’s pixels.

A typical page will be described by one or more immediate region segments, each one resulting in modification of the page buffer.

Just as it is possible to specify a new symbol in a dictionary by refining a previously specified symbol, it is also possible to specify a new buffer by refining an existing buffer. However, a region may be refined only by the generic refinement decoding procedure. Such a refinement does not make use of the internal structure of the region in the buffer being refined. After a buffer has been refined, the original buffer is no longer available.

The result of decoding a dictionary segment is a new dictionary. The symbols in the dictionary may later be placed into a buffer by the text region decoding procedure.

0.1.6 Decoding procedures

The generic region decoding procedure fills or modifies a buffer directly, pixel-by-pixel if arithmetic coding is being used, or by runs of foreground and background pixels if MMR and Huffman coding are being used. In the arithmetic coding case, the prediction context contains only pixels determined by data already decoded within the current segment.

The generic refinement region decoding procedure modifies a buffer pixel-by-pixel using arithmetic coding. The prediction context uses pixels determined by data already decoded within the current segment as well as pixels already present either in the page buffer or in an auxiliary buffer.

The text region decoding procedure takes symbols from one or more symbol dictionaries and places them in a buffer. This procedure is invoked during the decoding of a text region segment. The text region segment contains the position and index information for each symbol to be placed in the buffer; the bitmaps of the symbols are taken from the symbol dictionaries.

The symbol dictionary decoding procedure creates a symbol dictionary, that is, an indexed set of symbol bitmaps. A bitmap in the dictionary may be coded directly; it may be coded as a refinement of a symbol already in a dictionary; or it may be coded as an aggregation of two or more symbols already in dictionaries. This decoding procedure is invoked during the decoding of a symbol dictionary segment.

The halftone region decoding procedure takes patterns from a pattern dictionary and places them in a buffer. This procedure is invoked during the decoding of a halftone region segment. The halftone region segment contains the position information for all the patterns to be placed in the buffer, as well as index information for the patterns themselves. The patterns, the fixed-size bitmaps of the halftone, are taken from the halftone dictionaries.

The pattern dictionary decoding procedure creates a dictionary, that is, an indexed set of fixed-size bitmaps (patterns). The bitmaps in the dictionary are coded directly and jointly. This decoding procedure is invoked during the decoding of a pattern dictionary segment.

The control decoding procedure decodes segment headers, which include segment type information. The segment type determines which decoding procedure must be invoked to decode the segment. The segment type also determines where the decoded output from the segment will be placed. The segment reference information, also present in the segment header and decoded by the control decoding procedure, determines which other segments must be used to decode the current segment. The control decoding procedure affects everything shown in Figure 1, and so is not shown there as a separate block.

Table 1 summarizes the types of data being decoded, which decoding procedure is responsible for decoding them, and what the final representations of the decoded data are.

Table 1—Entities in the decoding process

ConceptJBIG2
bitstream entity
JBIG2
decoding entity
Physical
representation
DocumentJBIG2 fileJBIG2 decoderOutput medium or device
PageCollection of segmentsImplicit in control decoding procedurePage buffer
RegionRegion segmentRegion decoding procedurePage buffer or auxiliary buffer
DictionaryDictionary segmentDictionary decoding procedureList of symbols
CharacterField within a symbol dictionary segmentSymbol dictionary decoding procedureSymbol bitmap
Gray-scale valueField within a halftone dictionary segmentPattern dictionary decoding procedurePattern

0.2 Lossy coding

This Recommendation | International Standard does not define how to control lossy coding of bi-level images. Rather it defines how to perform perfect reconstruction of a bitmap that the encoder has chosen to encode. If the encoder chooses to encode a bitmap that is different than the original, the entire process becomes one of lossy coding. The different coding methods allow for different methods of introducing loss in a profitable way.

0.2.1 Symbol coding

Lossy symbol coding provides a natural way of doing lossy coding of text regions. The idea is to allow small differences between the original symbol bitmap and the one indexed in the symbol dictionary. Compression gain is effected by not having to code a large dictionary and, afterwards, by having a cheap symbol index coding as a consequence of the smaller dictionary. It is up to the encoder to decide when two bitmaps are essentially the same or essentially different. This technique was first described in [1].

The hazard of lossy symbol coding is to have substitution errors, that is, to have the encoder replace a bitmap corresponding to one character by a bitmap depicting a different character, so that a human reader misreads the character. The risk of substitution errors can be reduced by using intricate measures of difference between bitmaps and/or by making sure that the critical pixels of the indexed bitmap are correct. One way to control this, described in [5], is to index the possibly wrong symbol and then to apply refinement coding to that symbol bitmap. The idea is to encode the basic character shape at little cost, then correct pixels that the encoder believes alter the meaning of the character.

The process of beneficially introducing loss in textual regions may also take simpler forms such as removing flyspecks from documents or regularizing edges of letters. Most likely such changes will lower the code length of the region without affecting the general appearance of the region – possibly even improving the appearance.

A number of examples of performing this sort of lossy symbol coding with JBIG2 can be found in [7].

NOTE — Although the term “text region” is used for regions of the page coded using symbol coding, other possible uses of symbol coding include coding line-art and other non-textual data.

0.2.2 Generic coding

To effect near-lossless coding using generic coding, the encoder applies a preprocess to an original image and encodes the changed image losslessly. The difficulties are to ensure that the changes result in a lower code length and that the quality of the changed image does not suffer badly from the changes. Two possible preprocesses are given in [11]. These preprocesses flip pixels that, when flipped, significantly lower the total code length of the region, but can be flipped without seriously impairing the visual quality. The preprocesses provide for effective near-lossless coding of periodic halftones and for a moderate gain in compression for other data types. The preprocesses are not well-suited for error diffused images and images dithered with blue noise as perceptually lossless compression will not be achieved at a significantly lower rate than the lossless rate.

0.2.3 Halftone coding

Halftone coding is the natural way to obtain very high compression for periodic halftones, such as clustered-dot ordered dithered images. In contrast to lossy generic coding as described above, halftone coding does not intend to preserve the original bitmap, although this is possible in special cases. Loss can also be introduced for additional compression by not putting all the patterns of the original image into the dictionary, thereby reducing both the number of halftone patterns and the number of bits required to specify which pattern is used in which location.

For lossy coding of error diffused images and images dithered with blue noise, it is advisable to use halftone coding with a small grid size. A reconstructed image will lack fine details and may display blockiness but will be clearly recognizable. The blockiness may be reduced on the decoder side in a postprocess; for instance, by using other reconstruction patterns than those that appear in the dictionary. Error diffused images may also be coded losslessly, or with controlled loss as described above, using generic coding.

More details on performing this halftone coding can be found in [12].

0.2.4 Consequences of inadequate segmentation

In order to obtain optimum coding, both in terms of quality and file size, the correct form of encoding should be used for the appropriate regions of the document pages. This subclause briefly describes the consequences of errors in this segmentation.

Using lossy symbol coding for a document containing both text and halftone data will result in poor compression. Depending on the encoder, the quality of the halftone data may be good or bad. Using the form of lossy symbol coding described in [5], the visual quality will probably not suffer.

Using lossy generic coding (using the preprocesses given in [11]) for a document containing both symbol and halftone data usually results in good quality and moderate compression.

Line art and regions of handwritten text may be coded efficiently using generic coding, but depending on the encoder, these types of regions can also be very effectively coded with symbol coding.