JP2005012496A - Adaptive variable length encoder, adaptive variable length encoding method, and adaptive variable length encoding program - Google Patents

Adaptive variable length encoder, adaptive variable length encoding method, and adaptive variable length encoding program Download PDF

Info

Publication number
JP2005012496A
JP2005012496A JP2003174248A JP2003174248A JP2005012496A JP 2005012496 A JP2005012496 A JP 2005012496A JP 2003174248 A JP2003174248 A JP 2003174248A JP 2003174248 A JP2003174248 A JP 2003174248A JP 2005012496 A JP2005012496 A JP 2005012496A
Authority
JP
Japan
Prior art keywords
data
encoding
adaptive variable
appearance frequency
variable length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2003174248A
Other languages
Japanese (ja)
Other versions
JP4125642B2 (en
Inventor
Kenichi Onomura
研一 小野村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Olympus Corp
Original Assignee
Olympus Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Olympus Corp filed Critical Olympus Corp
Priority to JP2003174248A priority Critical patent/JP4125642B2/en
Publication of JP2005012496A publication Critical patent/JP2005012496A/en
Application granted granted Critical
Publication of JP4125642B2 publication Critical patent/JP4125642B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an adaptive variable length encoder in which the memory capacity of a counter for storing occurrence frequency can be reduced, and to provide an adaptive variable length encoding method and an adaptive variable length encoding program. <P>SOLUTION: The adaptive variable length encoder comprises a data storage meas 2 for storing input data, an encoding table 4 representing the relation of the input data and encoded data, a means 3 for encoding the input data with reference to the encoding table, a means 5 for dividing the input data into some groups, a means 6 for operating the occurrence frequency of each group of input data, and a means 7 for updating the encoding table based on the occurrence frequency of group data. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
この発明は、画像データ等のデータの符号長を適応的に変えて圧縮した符号化データを生成するための適応型可変長符号化装置、適応型可変長符号化方法及び適応型可変長符号化プログラムに関する。
【0002】
【従来の技術】
【特許文献1】特開平8−316848号公報
【0003】
一般に、画像データ等のデータを記録媒体に記録する場合などにおいては、データの圧縮処理がなされている。この圧縮処理の手法には種々の手法があるが、その中の代表的な手法として、例えば特開平8−316848号公報(特許文献1)に開示されているような、データの出現頻度を利用したハフマン符号化方式(適応型可変長符号化方式)がある。この方式においては、出現頻度が高いデータをビット長の短い符号化データとし、逆に出現頻度が低いデータはビット長の長い符号化データとすることにより、統計的にデータの圧縮効率を高めようとしている。このハフマン符号化の際は、リアルタイムに演算して符号化することも可能であるが、通常は予め用意した符号化テーブルを参照する場合が多い。テーブル参照の場合、1つのテーブルを使い続ける方式や複数のテーブルから選択する方式があるが、中でも優れた方式の1つに、符号化対象データの発生頻度を値別に計数した結果を基に符号化テーブルを適宜更新する適応型ハフマン符号化方式がある。これによれば、符号化対象データの発生傾向が変化したとしても、それに応じたテーブルを用意できるため、更なる高効率圧縮が望める。
【0004】
【発明が解決しようとする課題】
しかしながら、この符号化方式においては、画像データ等のデータが取り得るデータ値の大きさ、例えば画像データを8ビットとすると、0から255 までのデータ値毎に、その最大出現頻度をカウント可能なメモリ、上記例では 256個のメモリが必要になり、最近のデジタルカメラなどのように、画素数が数百万画素にも及ぶ撮像素子からの画像データを符号化するような場合は、カウンタのメモリ容量が極めて膨大なものとなる。例えば、画素数が 100万画素で各画素あたりの画像データが8ビットとすると、従来の符号化方式では、符号化テーブル作成のために20ビットのカウンタが 256個も必要になる。最大カウント値を制限してカウンタのメモリ容量をある程度小さくすることもできるが、それでも、ある程度のメモリ容量のカウンタを備えていないと符号化精度が低下してしまう。
【0005】
本発明は、従来の適応型可変長符号化方式における上記問題点を解消するためになされたもので、出現頻度を記憶するカウンタのメモリ容量を低減できるようにした適応型可変長符号化装置、適応型可変長符号化方法及び適応型可変長符号化プログラムを提供することを目的とする。
【0006】
【課題を解決するための手段】
上記問題点を解決するため、請求項1に係る発明は、データの出現頻度に基づいて作成された符号化テーブルを参照して前記データの符号化を行う適応型可変長符号化装置であって、入力データを記憶するデータ記憶手段と、前記入力データと符号化データとの関係を表す符号化テーブルと、該符号化テーブルを参照して前記データ記憶手段に記憶された入力データを符号化する符号化手段と、前記入力データをいくつかのグループに分割するグループ化手段と、前記グループ化された入力データの各グループ毎のデータ出現頻度を演算するグループデータ出現頻度演算手段と、前記グループデータ出現頻度に基づいて前記符号化テーブルを更新するための符号化テーブル更新手段とを有することを特徴とするものである。
【0007】
請求項2に係る発明は、請求項1に係る適応型可変長符号化装置において、前記グループ化手段は、入力データをデータ値の大きさの順に所定の予め決められた間隔毎にグループ化することを特徴とするものである。
【0008】
請求項3に係る発明は、請求項1に係る適応型可変長符号化装置において、前記グループ化手段は、入力データをデータ値の大きさの順に前記データの態様を解析するデータ解析手段による解析結果に基づいて決められる間隔毎にグループ化することを特徴とするものである。
【0009】
請求項4に係る発明は、請求項1に係る適応型可変長符号化装置において、前記グループデータ出現頻度に基づいて、入力データの各データの有する出現頻度を予測するデータ出現頻度予測手段を、更に有することを特徴とするものである。
【0010】
請求項5に係る発明は、請求項1に係る適応型可変長符号化装置において、前記符号化テーブル更新手段は、所定のタンミングで前記グループデータ出現頻度演算手段によるグループデータ出現頻度に基づいて符号化テーブルを更新することを特徴とするものである。
【0011】
請求項6に係る発明は、請求項5に係る適応型可変長符号化装置において、前記所定のタンミングは、フレーム毎、ライン毎又はキーフレーム毎であることを特徴とするものである。
【0012】
請求項7に係る発明は、請求項1〜6のいずれか1項に係る適応型可変長符号化装置において、前記入力データを符号化する際に用いた符号化テーブルのデータを符号化データに埋め込む符号化テーブルデータ埋め込み手段を更に備えていることを特徴とするものである。
【0013】
請求項8に係る発明は、データの出現頻度に基づいて作成された符号化テーブルを参照して前記データの符号化処理を行う適応型可変長符号化方法であって、入力データを記憶するステップと、前記記憶された入力データをいくつかのグループに分割するステップと、グループ化された入力データの各グループ毎のデータ出現頻度を演算するステップと、各グループ毎のデータ出現頻度に基づいて前記符号化テーブルを更新するステップと、前記更新された符号化テーブルを参照して前記記憶された入力データを符号化するステップとからなることを特徴とするものである。
【0014】
請求項9に係る発明は、請求項8に係る適応型可変長符号化方法において、更に、入力データを符号化する際に用いた符号化テーブルのデータを符号化データに埋め込むステップを有することを特徴とするものである。
【0015】
請求項10に係る発明は、コンピュータに対して、データの出現頻度に基づいて作成された符号化テーブルを参照して前記データの符号化処理を実行させるための適応型可変長符号化プログラムであって、入力データを記憶する手順と、前記記憶された入力データをいくつかのグループに分割する手順と、グループ化された入力データの各グループ毎のデータ出現頻度を演算する手順と、各グループ毎のデータ出現頻度に基づいて前記符号化テーブルを更新する手順と、前記更新された符号化テーブルを参照して前記記憶された入力データを符号化する手順とを実行させるように構成するものである。
【0016】
請求項11に係る発明は、請求項10に係る適応型可変長符号化プログラムにおいて、更に、入力データを符号化する際に用いた符号化テーブルのデータを符号化データに埋め込む手順を有することを特徴とするものである。
【0017】
【発明の実施の形態】
次に、実施の形態について説明する。図1は、本発明に係る適応型可変長符号化装置の実施の形態を示すブロック構成図であり、また適応型可変長符号化方法の実施の形態を説明するための説明図でもある。なお、この実施の形態は、画像データを符号化する態様を示しているが、符号化の対象となるデータは画像データに限らない。図1において、1は被写体像を光電変換して画像信号を生成する撮像素子、2は撮像素子1からの撮像信号を図示しないA/D変換器でA/D変換した画像データを記憶するデータ記憶手段、3は画像データをデータの出現頻度に基づいて符号化し符号化データとして出力する符号化手段、4は画像データと符号化データとの関係を示す符号化手段3で用いる符号化テーブルで、ハフマン・ラングレスなどのエントロピー符号化テーブルや、ルックアップテーブルなどが用いられる。5は画像データをいくつかのグループに分割するグループ化手段、6はグループ化手段5でグループ化されたデータの各グループ毎のデータ出現頻度を演算するグループデータ出現頻度演算手段、7はグループデータ出現頻度演算手段6により得られたグループデータ出現頻度に基づいて符号化テーブルを更新する符号化テーブル更新手段である。
【0018】
次に、このように構成されている適応型可変長符号化装置の動作について説明する。撮像素子1で生成されA/D変換された画像データは、一旦データ記憶手段2に格納される。そして、データ記憶手段2に格納された画像データは、符号化手段3に入力すると同時にグループ化手段5にも入力する。この際、画像データはデータ記憶手段2に一旦格納することはせず、直接符号化手段3及びグループ化手段5に入力させるようにしてもよい。また画像データの符号化手段3とグループ化手段5への入力は同時でなく、ずらして入力させるようにしてもよい。
すなわち、グループ化手段5及びグループデータ出現頻度演算手段6における処理時間を必要とし、その演算結果に基づいて符号化テーブルを更新して、それが符号化手段3に反映されるまでタイムラグがあるので、符号化手段3への入力よりグループ化手段5への入力を先行させた方が、符号化手段3における符号化処理の際に、入力画像データに最適な符号化テーブルをリアルタイムに用意できるようになる。このように符号化手段3への入力を遅らすには、デレイバッファを介して画像データを入力させるようにすればよい。
【0019】
グループ化手段5においては、符号化手段3で符号化の対象となるデータのデータ値を特定の条件でグループ化する。例えば、入力データを8ビットとし、0〜255 の値が出現するとし、例えば図2に示すように、0〜15の符号化対象値をグループ1,16〜31の符号化対象値をグループ2,・・・・・ 240〜255 の符号化対象値をグループ16のようにグループ分けを行い、グループデータ出現頻度演算手段6で各グループ内での発生頻度をカウントする。
【0020】
このようにグループ分けして発生頻度をカウントすることにより、カウンタを1/16にすることができ、カウンタのメモリ容量を低減することができる。もっとも、このグループ分けにより情報を減らすことになるので、精度は低下するが、一般的な画像データや動画データの発生頻度の分布からみて、さほど大きな問題にはならない。
【0021】
上記グループ化例では、入力データをデータ値の大きさの順に等間隔で単純に16分割したものを示したが、この手法より精度のよいグループ化手法として、次のような手法がある。すなわち、出現頻度の高い値ほど小規模のグループ化をした方が、より精度のよい適切なテーブル更新ができる。したがって、静止画や動画などの場合は、空間的な差分値あるいはフレーム差分値は、通常零に近い値ほど発生頻度が高いので、0〜1の符号化対象値をグループ1,2〜5の符号化対象値をグループ2,6〜11の符号化対象値をグループ3,・・・・・ 192〜255の符号化対象値をグループ16というようにグループ分けを行う。これにより、比較的精度のよいグループ分けを行うことができる。なお、この際、入力データの発生頻度の特性を解析する手段を別途設けておいて、その解析手段の解析結果に基づいて、グループ化の間隔を設定するようにすれば、入力データにより適したテーブル更新が可能となる。
【0022】
また、上記グループ分け手法では、固定的に各グループ内の符号化対象値の個数を設定したものについて説明したが、グループ分けの条件をユーザが自由に設定可能に構成するのも有効である。すなわち、例えば、グループの個数は16個と固定しておき、グループ1にはn1個、グループ1にはn2個、・・・・・グループ16にはn16個の符号化対象値が属するようにし、各グループの符号化対象値n1〜n16を、レジスタで変更可能にするように構成することもできる。
【0023】
例えば、符号化対象値が零を中心にして分布していても、例えば図3の(A)に示すように零中心に集中して分布している場合と、図3の(B)に示すように零中心ではあるが、なだらかに分布している場合もあるので、図3の(A)に示す分布の場合には、零を中心とした細かいグループ分けを行った方が高精度となるが、図3の(B)に示す分布の場合には、零を中心とした細かいグループ分けを行うと、他のなだらかな分布領域に対する影響が大きくなり、不適切なグループ分けとなる。したがって、このような場合には、ユーザが適切に任意にグループの規模を変えられるように構成しておいた方が好適である。
【0024】
以上のようにして、グループ化手段5でグループ化されたデータは、グループデータ出現頻度演算手段6で各グループ毎にデータ出現頻度がカウントされる。
そして、符号化テーブル更新手段7では、グループデータ出現頻度演算手段6で得られた出現頻度に基づいて決められた符号化テーブルと現在選択されている符号化テーブルとを対比し、出現頻度に基づいて決められた新たな符号化テーブルが現在選択されているものと異なる場合は、符号化テーブルの更新に適切なタイミングを見計らって、新たな符号化テーブルを、符号化手段3で使用する符号化テーブルとして選択更新する。符号化手段3は、更新された符号化テーブルを参照しながら符号化処理を行う。
【0025】
前記符号化テーブル更新手段7による更新のタイミングとしては、種々の設定が可能であるが、例えばライン毎、フレーム毎、キーフレーム(他のフレームの情報を用いずに符号化処理を行うフレーム)毎のタイミングで更新を行う。また更新のタイミングは、符号化テーブル更新手段7が自動で判断して更新するようにしてもよい。例えば、現在用いられている符号化テーブルにおいて、最も短い符号を割り振っている入力データが属するグループAの符号化対象値の出現頻度が、他のグループBより低くなった場合には、符号化テーブル更新手段7が、この状態を検出して、グループBに属する入力データに最も短い符号を割り振る符号化テーブルに自動的に更新するように構成する。
【0026】
上記実施の形態においては、グループ化手段5でグループ化したデータの各グループ毎のデータ出現頻度に対応した符号化テーブルに更新するようにしたものを示したが、グループ分けによるデータ出現頻度には連続性がなく荒さがあるので、この荒さを緩和するため、図4に示すように、線形補間などによる改善手法を用いることができる。すなわち、別途データ出現頻度予測手段を設け、線形補間により、点線で示すように個別の符号化対象値に対する出現頻度を予測し、その予測値に対応させてテーブル更新を行う。これにより、グループ分けによる荒さが緩和されて、精度のよい符号化テーブルの再構築が可能となる。
【0027】
また、上記実施の形態において、符号化手段3において符号化データを出力する際に、図5の(A)に示すように、符号化データ列中に符号化手段3で用いた符号化テーブルのデータを埋め込んで、復号化のためのフォーマットで符号化データを構成するようにしてもよい。この場合、符号化手段中に埋め込み機能をもたせることになる。符号化テーブルデータの埋め込みのタイミングは、符号化テーブルの更新のタイミングで、つまりライン単位、あるいはフレーム単位などのタイミングで、符号化データ列中に埋め込まれ、符号化データが構成される。なお、この際、埋め込まれる符号化テーブルデータとしては、任意の手段で圧縮されたデータを用いると、データサイズを無駄に増大させずに済む。
【0028】
上記埋め込み手法により符号化テーブルデータを埋め込んだ符号化データでは、どこに符号化テーブルデータが挿入されているかデータフォーマット的にわかりずらいので、その点を考慮して、図5の(B)に示すように、フレーム単位で、フレームヘッダに、そのフレームの符号化データの符号化の際に用いた複数の符号化テーブルデータをまとめて書き込み、符号化データ列中には符号化テーブルの更新点を示す情報のみを挿入しておく手法もある。
【0029】
更に、図5の(C)に示すように、フレームヘッダに複数の符号化テーブルデータをまとめて書き込むと同時に、符号化テーブルを更新する座標データを書き込んでおき、符号化データ列中には何も挿入せず連続的に出力させるように構成してもよい。
【0030】
以上のように、符号化データ中に符号化テーブル情報を埋め込んだフォーマットで符号化データを構成した場合は、符号化データ中に埋め込まれた符号化テーブル情報やタイミング情報をもとに、復号化処理が行われる。
【0031】
上記実施の形態に係る適応型可変長符号化装置による画像データ等のデータの符号化処理は、ハードウェアによる処理に限らず、上記各構成手段による各処理手順をプログラム化し、コンピュータに実行させるソフトウェア処理とすることも、勿論可能である。
【0032】
【発明の効果】
以上実施の形態に基づいて説明したように、本発明によれば、入力データをいくつかにグループ化して、グループ単位で出現頻度を算出するようにしているので、出現頻度を記憶するカウンタのメモリ容量の低減可能な適応型可変長符号化装置、適応型可変長符号化方法及び適応型可変長符号化プログラムを実現することができる。
【図面の簡単な説明】
【図1】本発明に係る適応型可変長符号化装置の実施の形態を示すブロック構成図である。
【図2】図1に示した実施の形態におけるグループ化手段によるグループ化の態様例を示す図である。
【図3】符号化対象値が零を中心にして分布している場合の発生頻度態様を示す図である。
【図4】グループ化によるデータ出現頻度を線形補間することにより、個別の符号化対象値に対する出現頻度を予測する態様を示す図である。
【図5】符号化手段から出力される符号化データに符号化テーブルデータを埋め込んだ態様を示す図である。
【符号の説明】
1 撮像素子
2 データ記憶手段
3 符号化手段
4 符号化テーブル
5 グループ化手段
6 グループデータ出現頻度演算手段
7 符号化テーブル更新手段
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an adaptive variable length coding apparatus, adaptive variable length coding method, and adaptive variable length coding for generating compressed encoded data by adaptively changing the code length of data such as image data. Regarding the program.
[0002]
[Prior art]
[Patent Document 1] JP-A-8-316848
In general, when data such as image data is recorded on a recording medium, data compression processing is performed. There are various compression processing methods. As a representative method, for example, the data appearance frequency disclosed in Japanese Patent Laid-Open No. 8-316848 (Patent Document 1) is used. Huffman coding method (adaptive variable length coding method). In this method, data compression efficiency is statistically increased by using data with high appearance frequency as encoded data with a short bit length and data with low appearance frequency as encoded data with a long bit length. It is said. In this Huffman encoding, it is possible to calculate and encode in real time, but usually, an encoding table prepared in advance is often referred to. In the case of table reference, there are a method that keeps using one table and a method that selects from a plurality of tables, but one of the excellent methods is coding based on the result of counting the frequency of occurrence of encoding target data by value. There is an adaptive Huffman coding method that updates the coding table as appropriate. According to this, even if the generation tendency of the data to be encoded changes, a table corresponding to that can be prepared, so that further efficient compression can be expected.
[0004]
[Problems to be solved by the invention]
However, in this encoding method, the maximum appearance frequency can be counted for each data value from 0 to 255 if the size of the data value that can be taken by the data such as image data, for example, the image data is 8 bits. In the above example, 256 memories are required. When image data from an image sensor having a number of pixels of several million pixels is encoded, such as a recent digital camera, The memory capacity becomes extremely large. For example, if the number of pixels is 1 million pixels and the image data per pixel is 8 bits, the conventional encoding method requires 256 20-bit counters to create an encoding table. Although it is possible to limit the maximum count value and reduce the memory capacity of the counter to some extent, the encoding accuracy is still lowered if a counter having a certain amount of memory capacity is not provided.
[0005]
The present invention has been made in order to solve the above-mentioned problems in the conventional adaptive variable length coding system, and an adaptive variable length coding apparatus capable of reducing the memory capacity of a counter for storing the appearance frequency, An object of the present invention is to provide an adaptive variable length coding method and an adaptive variable length coding program.
[0006]
[Means for Solving the Problems]
In order to solve the above problem, the invention according to claim 1 is an adaptive variable length encoding device that encodes the data with reference to an encoding table created based on the appearance frequency of the data. A data storage means for storing the input data, an encoding table representing the relationship between the input data and the encoded data, and the input data stored in the data storage means is encoded with reference to the encoding table Encoding means; grouping means for dividing the input data into several groups; group data appearance frequency calculating means for calculating data appearance frequency for each group of the grouped input data; and the group data And coding table updating means for updating the coding table based on the appearance frequency.
[0007]
According to a second aspect of the present invention, in the adaptive variable length coding apparatus according to the first aspect, the grouping means groups the input data at predetermined intervals in the order of the data values. It is characterized by this.
[0008]
According to a third aspect of the present invention, in the adaptive variable length coding apparatus according to the first aspect, the grouping means analyzes the input data by data analysis means for analyzing the mode of the data in order of the magnitude of the data value. Grouping is performed at intervals determined based on the results.
[0009]
The invention according to claim 4 is the adaptive variable length coding device according to claim 1, wherein data appearance frequency predicting means for predicting the appearance frequency of each data of the input data based on the group data appearance frequency, Furthermore, it is characterized by having.
[0010]
According to a fifth aspect of the present invention, in the adaptive variable length coding apparatus according to the first aspect, the coding table updating means performs coding based on the group data appearance frequency by the group data appearance frequency calculating means at a predetermined tamming. The update table is updated.
[0011]
The invention according to claim 6 is the adaptive variable length coding apparatus according to claim 5, wherein the predetermined tamming is for each frame, for each line, or for each key frame.
[0012]
The invention according to claim 7 is the adaptive variable length coding device according to any one of claims 1 to 6, wherein the data of the coding table used when coding the input data is coded data. An encoding table data embedding unit for embedding is further provided.
[0013]
The invention according to claim 8 is an adaptive variable length encoding method that performs an encoding process of the data with reference to an encoding table created based on the appearance frequency of the data, the step of storing input data And dividing the stored input data into several groups, calculating a data appearance frequency for each group of the grouped input data, and based on the data appearance frequency for each group The method comprises a step of updating a coding table and a step of coding the stored input data with reference to the updated coding table.
[0014]
The invention according to claim 9 is the adaptive variable length encoding method according to claim 8, further comprising the step of embedding the data of the encoding table used when encoding the input data in the encoded data. It is a feature.
[0015]
The invention according to claim 10 is an adaptive variable-length encoding program for causing a computer to execute an encoding process of the data with reference to an encoding table created based on the appearance frequency of the data. A procedure for storing the input data, a procedure for dividing the stored input data into several groups, a procedure for calculating the data appearance frequency for each group of the grouped input data, and for each group The encoding table is updated based on the data appearance frequency and the stored input data is encoded with reference to the updated encoding table. .
[0016]
The invention according to claim 11 is the adaptive variable length encoding program according to claim 10, further comprising a procedure of embedding the data of the encoding table used when encoding the input data into the encoded data. It is a feature.
[0017]
DETAILED DESCRIPTION OF THE INVENTION
Next, embodiments will be described. FIG. 1 is a block diagram showing an embodiment of an adaptive variable length coding apparatus according to the present invention, and is also an explanatory diagram for explaining an embodiment of an adaptive variable length coding method. In addition, although this embodiment has shown the aspect which encodes image data, the data used as the object of an encoding are not restricted to image data. In FIG. 1, 1 is an image sensor that photoelectrically converts a subject image to generate an image signal, and 2 is data that stores image data obtained by A / D converting an image signal from the image sensor 1 by an A / D converter (not shown). Storage means 3 is an encoding means for encoding image data based on the appearance frequency of the data and outputs it as encoded data, and 4 is an encoding table used by the encoding means 3 indicating the relationship between the image data and the encoded data. An entropy coding table such as Huffman Langles, a lookup table, or the like is used. 5 is a grouping means for dividing the image data into several groups, 6 is a group data appearance frequency calculating means for calculating the data appearance frequency for each group of the data grouped by the grouping means 5, and 7 is group data. It is a coding table update means for updating the coding table based on the group data appearance frequency obtained by the appearance frequency calculation means 6.
[0018]
Next, the operation of the adaptive variable length coding apparatus configured as described above will be described. The image data generated by the image sensor 1 and A / D converted is temporarily stored in the data storage means 2. The image data stored in the data storage unit 2 is input to the encoding unit 3 and simultaneously to the grouping unit 5. At this time, the image data may not be temporarily stored in the data storage unit 2 but may be directly input to the encoding unit 3 and the grouping unit 5. Further, the input of the image data to the encoding means 3 and the grouping means 5 may be input in a shifted manner instead of simultaneously.
That is, the processing time in the grouping means 5 and the group data appearance frequency calculating means 6 is required, and there is a time lag until the encoding table is updated based on the calculation result and reflected in the encoding means 3. When the input to the grouping unit 5 precedes the input to the encoding unit 3, an encoding table optimum for input image data can be prepared in real time during the encoding process in the encoding unit 3. become. In order to delay the input to the encoding means 3 in this way, the image data may be input via the delay buffer.
[0019]
In the grouping means 5, the data values of the data to be encoded by the encoding means 3 are grouped under a specific condition. For example, assume that the input data is 8 bits and a value of 0 to 255 appears. For example, as shown in FIG. 2, the encoding target values of 0 to 15 are group 1 and the encoding target values of 16 to 31 are group 2. ,... Are encoded into groups 16 as in group 16, and the group data appearance frequency calculation means 6 counts the frequency of occurrence within each group.
[0020]
By counting the occurrence frequency by grouping in this way, the counter can be reduced to 1/16, and the memory capacity of the counter can be reduced. Of course, the information is reduced by this grouping, so the accuracy is lowered, but it is not a big problem in terms of the distribution of the occurrence frequency of general image data and moving image data.
[0021]
In the above grouping example, the input data is simply divided into 16 in order of the size of the data value. However, as a grouping technique with higher accuracy than this technique, there is the following technique. That is, the table can be updated more accurately and more accurately when the value having a higher appearance frequency is grouped into smaller groups. Therefore, in the case of a still image or a moving image, the spatial difference value or the frame difference value is more frequently generated as the value is usually closer to zero. Therefore, the encoding target values 0 to 1 are assigned to the groups 1 to 5. The encoding target values are grouped such that the encoding target values of groups 2 and 6 to 11 are the encoding target values of group 3,... 192 to 255. Thereby, grouping with relatively high accuracy can be performed. At this time, if a means for analyzing the characteristics of the occurrence frequency of the input data is separately provided, and the grouping interval is set based on the analysis result of the analysis means, it is more suitable for the input data. Table update is possible.
[0022]
In the above grouping method, the fixed number of encoding target values in each group has been described. However, it is also effective to allow the user to freely set the grouping conditions. In other words, for example, the number of groups is fixed at 16, and n1 is assigned to group 1, n2 is assigned to group 1,. The encoding target values n1 to n16 of each group can be configured to be changeable by a register.
[0023]
For example, even if the encoding target value is distributed around zero, for example, as shown in FIG. 3A, it is concentrated in the center of zero, and as shown in FIG. As shown in FIG. 3A, although the center is zero, the distribution may be gentle. Therefore, in the case of the distribution shown in FIG. However, in the case of the distribution shown in FIG. 3B, if the fine grouping centered on zero is performed, the influence on other gentle distribution areas becomes large, resulting in inappropriate grouping. Therefore, in such a case, it is preferable that the user can appropriately and arbitrarily change the group size.
[0024]
As described above, the data grouped by the grouping means 5 is counted for each group by the group data appearance frequency calculating means 6.
Then, the coding table updating means 7 compares the coding table determined based on the appearance frequency obtained by the group data appearance frequency calculating means 6 with the currently selected coding table, and based on the appearance frequency. If the new coding table determined in this step is different from the currently selected coding table, the coding means 3 uses the new coding table for the timing appropriate for updating the coding table. Select and update as a table. The encoding unit 3 performs an encoding process while referring to the updated encoding table.
[0025]
Various timings can be set as the update timing by the encoding table update means 7, for example, for each line, for each frame, for each key frame (frame for which encoding processing is performed without using information of other frames). Update at the timing. The update timing may be automatically determined and updated by the encoding table update means 7. For example, in the currently used encoding table, when the appearance frequency of the encoding target value of the group A to which the input data to which the shortest code is assigned belongs is lower than that of the other group B, the encoding table The updating means 7 is configured to detect this state and automatically update the coding table that assigns the shortest code to the input data belonging to the group B.
[0026]
In the above-described embodiment, the coding table corresponding to the data appearance frequency for each group of the data grouped by the grouping means 5 is shown. Since there is roughness without continuity, an improvement technique such as linear interpolation can be used as shown in FIG. 4 in order to reduce the roughness. That is, a separate data appearance frequency prediction means is provided, and the appearance frequency for each individual encoding target value is predicted by linear interpolation as indicated by the dotted line, and the table is updated in accordance with the predicted value. As a result, the roughness due to grouping is alleviated, and an accurate coding table can be reconstructed.
[0027]
In the above embodiment, when the encoded data is output by the encoding means 3, as shown in FIG. 5A, the encoding table used by the encoding means 3 in the encoded data string is displayed. The encoded data may be configured in a format for decoding by embedding data. In this case, an embedding function is provided in the encoding means. The timing of embedding the encoding table data is embedded in the encoded data string at the timing of updating the encoding table, that is, at the timing of line unit or frame unit, and the encoded data is configured. At this time, if data compressed by any means is used as the encoding table data to be embedded, the data size does not need to be increased unnecessarily.
[0028]
In the encoded data in which the encoding table data is embedded by the above-described embedding method, it is difficult to know where the encoding table data is inserted in terms of the data format. As described above, in a frame unit, a plurality of encoding table data used when encoding the encoded data of the frame is written together in the frame header, and the update point of the encoding table is set in the encoded data string. There is also a method of inserting only the information shown.
[0029]
Furthermore, as shown in FIG. 5C, a plurality of encoding table data are written together in the frame header, and at the same time, coordinate data for updating the encoding table is written. Also, it may be configured to output continuously without inserting.
[0030]
As described above, when the encoded data is configured in a format in which the encoding table information is embedded in the encoded data, decoding is performed based on the encoding table information and timing information embedded in the encoded data. Processing is performed.
[0031]
Encoding processing of data such as image data by the adaptive variable length encoding device according to the above embodiment is not limited to hardware processing, but software that causes each processing procedure by each of the above constituent means to be programmed and executed by a computer Of course, processing is also possible.
[0032]
【The invention's effect】
As described above based on the embodiments, according to the present invention, the input data is grouped into several groups, and the appearance frequency is calculated in units of groups. Therefore, the counter memory that stores the appearance frequency An adaptive variable length coding apparatus, an adaptive variable length coding method, and an adaptive variable length coding program capable of reducing capacity can be realized.
[Brief description of the drawings]
FIG. 1 is a block configuration diagram showing an embodiment of an adaptive variable length coding apparatus according to the present invention.
FIG. 2 is a diagram showing an example of grouping by the grouping unit in the embodiment shown in FIG. 1;
FIG. 3 is a diagram showing an occurrence frequency mode when encoding target values are distributed around zero.
FIG. 4 is a diagram illustrating an aspect of predicting appearance frequencies for individual encoding target values by linearly interpolating data appearance frequencies by grouping.
FIG. 5 is a diagram illustrating a mode in which encoding table data is embedded in encoded data output from an encoding unit.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 Image pick-up element 2 Data storage means 3 Encoding means 4 Encoding table 5 Grouping means 6 Group data appearance frequency calculation means 7 Encoding table update means

Claims (11)

データの出現頻度に基づいて作成された符号化テーブルを参照して前記データの符号化を行う適応型可変長符号化装置であって、入力データを記憶するデータ記憶手段と、前記入力データと符号化データとの関係を表す符号化テーブルと、該符号化テーブルを参照して前記データ記憶手段に記憶された入力データを符号化する符号化手段と、前記入力データをいくつかのグループに分割するグループ化手段と、前記グループ化された入力データの各グループ毎のデータ出現頻度を演算するグループデータ出現頻度演算手段と、前記グループデータ出現頻度に基づいて前記符号化テーブルを更新するための符号化テーブル更新手段とを有することを特徴とする適応型可変長符号化装置。An adaptive variable-length encoding device that encodes the data with reference to an encoding table created based on the appearance frequency of data, the data storage means for storing input data, and the input data and code A coding table representing a relationship with the coded data, coding means for coding the input data stored in the data storage means with reference to the coding table, and dividing the input data into several groups Grouping means, group data appearance frequency calculating means for calculating the data appearance frequency for each group of the grouped input data, and encoding for updating the encoding table based on the group data appearance frequency And an adaptive variable-length coding apparatus comprising: a table updating unit; 前記グループ化手段は、入力データをデータ値の大きさの順に所定の予め決められた間隔毎にグループ化することを特徴とする請求項1に係る適応型可変長符号化装置。2. The adaptive variable length coding apparatus according to claim 1, wherein the grouping means groups the input data at predetermined intervals in order of the magnitude of the data value. 前記グループ化手段は、入力データをデータ値の大きさの順に前記データの態様を解析するデータ解析手段による解析結果に基づいて決められる間隔毎にグループ化することを特徴とする請求項1に係る適応型可変長符号化装置。The said grouping means groups input data for every interval determined based on the analysis result by the data analysis means which analyzes the aspect of the said data in order of the magnitude | size of a data value. Adaptive variable length coding device. 前記グループデータ出現頻度に基づいて、入力データの各データの有する出現頻度を予測するデータ出現頻度予測手段を、更に有することを特徴とする請求項1に係る適応型可変長符号化装置。The adaptive variable length coding apparatus according to claim 1, further comprising data appearance frequency predicting means for predicting an appearance frequency of each data of the input data based on the group data appearance frequency. 前記符号化テーブル更新手段は、所定のタンミングで前記グループデータ出現頻度演算手段によるグループデータ出現頻度に基づいて符号化テーブルを更新することを特徴とする請求項1に係る適応型可変長符号化装置。2. The adaptive variable length coding apparatus according to claim 1, wherein the coding table updating unit updates the coding table based on a group data appearance frequency by the group data appearance frequency calculating unit at a predetermined tamming. . 前記所定のタンミングは、フレーム毎、ライン毎又はキーフレーム毎であることを特徴とする請求項5に係る適応型可変長符号化装置。6. The adaptive variable length coding apparatus according to claim 5, wherein the predetermined tamming is performed for each frame, for each line, or for each key frame. 前記入力データを符号化する際に用いた符号化テーブルのデータを符号化データに埋め込む符号化テーブルデータ埋め込み手段を更に備えていることを特徴とする請求項1〜6のいずれか1項に係る適応型可変長符号化装置。7. The method according to claim 1, further comprising encoding table data embedding means that embeds data of an encoding table used when encoding the input data into encoded data. Adaptive variable length coding device. データの出現頻度に基づいて作成された符号化テーブルを参照して前記データの符号化処理を行う適応型可変長符号化方法であって、入力データを記憶するステップと、前記記憶された入力データをいくつかのグループに分割するステップと、グループ化された入力データの各グループ毎のデータ出現頻度を演算するステップと、各グループ毎のデータ出現頻度に基づいて前記符号化テーブルを更新するステップと、前記更新された符号化テーブルを参照して前記記憶された入力データを符号化するステップとからなることを特徴とする適応型可変長符号化方法。An adaptive variable length encoding method for performing an encoding process of the data with reference to an encoding table created based on the appearance frequency of data, the step of storing input data, and the stored input data Dividing the data into several groups, calculating the data appearance frequency for each group of the grouped input data, and updating the encoding table based on the data appearance frequency for each group; And encoding the stored input data with reference to the updated encoding table. An adaptive variable length encoding method comprising: 更に、入力データを符号化する際に用いた符号化テーブルのデータを符号化データに埋め込むステップを有することを特徴とする請求項8に係る適応型可変長符号化方法。9. The adaptive variable length encoding method according to claim 8, further comprising a step of embedding data in an encoding table used when encoding input data in the encoded data. コンピュータに対して、データの出現頻度に基づいて作成された符号化テーブルを参照して前記データの符号化処理を実行させるための適応型可変長符号化プログラムであって、入力データを記憶する手順と、前記記憶された入力データをいくつかのグループに分割する手順と、グループ化された入力データの各グループ毎のデータ出現頻度を演算する手順と、各グループ毎のデータ出現頻度に基づいて前記符号化テーブルを更新する手順と、前記更新された符号化テーブルを参照して前記記憶された入力データを符号化する手順とを実行させることを特徴とする適応型可変長符号化プログラム。An adaptive variable-length encoding program for causing a computer to execute an encoding process of data by referring to an encoding table created based on the appearance frequency of data, and a procedure for storing input data And the procedure for dividing the stored input data into several groups, the procedure for calculating the data appearance frequency for each group of the grouped input data, and the data appearance frequency for each group An adaptive variable-length encoding program characterized by causing a procedure for updating an encoding table and a procedure for encoding the stored input data with reference to the updated encoding table. 更に、入力データを符号化する際に用いた符号化テーブルのデータを符号化データに埋め込む手順を有することを特徴とする請求項10に係る適応型可変長符号化プログラム。11. The adaptive variable length coding program according to claim 10, further comprising a step of embedding coding table data used when coding input data into the coded data.
JP2003174248A 2003-06-19 2003-06-19 Adaptive variable length coding apparatus, adaptive variable length coding method, and adaptive variable length coding program Expired - Fee Related JP4125642B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003174248A JP4125642B2 (en) 2003-06-19 2003-06-19 Adaptive variable length coding apparatus, adaptive variable length coding method, and adaptive variable length coding program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003174248A JP4125642B2 (en) 2003-06-19 2003-06-19 Adaptive variable length coding apparatus, adaptive variable length coding method, and adaptive variable length coding program

Publications (2)

Publication Number Publication Date
JP2005012496A true JP2005012496A (en) 2005-01-13
JP4125642B2 JP4125642B2 (en) 2008-07-30

Family

ID=34097783

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003174248A Expired - Fee Related JP4125642B2 (en) 2003-06-19 2003-06-19 Adaptive variable length coding apparatus, adaptive variable length coding method, and adaptive variable length coding program

Country Status (1)

Country Link
JP (1) JP4125642B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006345374A (en) * 2005-06-10 2006-12-21 Oki Electric Ind Co Ltd Data encoding device, data decoding device, data encoding method, and data decoding method
WO2010035373A1 (en) * 2008-09-25 2010-04-01 株式会社ルネサステクノロジ Image decoding method and image coding method
KR101590790B1 (en) 2014-03-04 2016-02-02 김정훈 Binary data compression and restoration method and apparatus
JP2018160827A (en) * 2017-03-23 2018-10-11 富士ゼロックス株式会社 Coding apparatus, decoding apparatus, and program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006345374A (en) * 2005-06-10 2006-12-21 Oki Electric Ind Co Ltd Data encoding device, data decoding device, data encoding method, and data decoding method
JP4497029B2 (en) * 2005-06-10 2010-07-07 沖電気工業株式会社 Data encoding apparatus and data encoding method
WO2010035373A1 (en) * 2008-09-25 2010-04-01 株式会社ルネサステクノロジ Image decoding method and image coding method
KR101590790B1 (en) 2014-03-04 2016-02-02 김정훈 Binary data compression and restoration method and apparatus
JP2018160827A (en) * 2017-03-23 2018-10-11 富士ゼロックス株式会社 Coding apparatus, decoding apparatus, and program

Also Published As

Publication number Publication date
JP4125642B2 (en) 2008-07-30

Similar Documents

Publication Publication Date Title
JP4427003B2 (en) Data encoding apparatus, data decoding apparatus, data encoding method, data decoding method, and program
JPH10191336A (en) Variable length coder
JPH0365823A (en) Entropy coder and coding method, entropy decoder and decoding method
JPS58197984A (en) Adaptive forecasting encoding device of television signal
JP2829954B2 (en) Apparatus and method for highly efficient encoding of image signal
US7515761B2 (en) Encoding device and method
KR20010016662A (en) Variable Length Coding method and device therefore
JP4125642B2 (en) Adaptive variable length coding apparatus, adaptive variable length coding method, and adaptive variable length coding program
US20050232362A1 (en) High-speed image compression apparatus using last non-zero detection circuit
JP2007129403A (en) Image encoder and image processing system
AU2002230101A2 (en) Moving picture information compressing method and its system
KR100570488B1 (en) Information compressor and method for compressing information, program and recording medium
JP2002064821A (en) Method for compressing dynamic image information and its system
JP2005012495A (en) Image processing apparatus, image processing method, and image processing program
JP2000165873A (en) Compression method for moving picture information and its system
JP4493552B2 (en) Data encoding apparatus, data decoding apparatus, data encoding method, data decoding method, and program
JP4493551B2 (en) Data encoding apparatus, data decoding apparatus, data encoding method, data decoding method, and program
US7269288B2 (en) Apparatus for parallel calculation of prediction bits in a spatially predicted coded block pattern and method thereof
JP2002152049A (en) Data processing apparatus and data processing method
JP2004179752A (en) Huffman decoder
JP2003230138A (en) Apparatus and method for coding processing and decoding processing, and computer program
JPH10271502A (en) Compression method for moving image information and its system
JPH06216784A (en) Quantizer for digital signal
JP2002209220A (en) Method and system for compressing moving image information
JPH0397320A (en) Data compressor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060228

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080421

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080430

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080508

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110516

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130516

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140516

Year of fee payment: 6

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees