JPH057303A - Encoder - Google Patents

Encoder

Info

Publication number
JPH057303A
JPH057303A JP3156514A JP15651491A JPH057303A JP H057303 A JPH057303 A JP H057303A JP 3156514 A JP3156514 A JP 3156514A JP 15651491 A JP15651491 A JP 15651491A JP H057303 A JPH057303 A JP H057303A
Authority
JP
Japan
Prior art keywords
code
layer
quantization table
code amount
data
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.)
Pending
Application number
JP3156514A
Other languages
Japanese (ja)
Inventor
Yasuhiko Yamane
靖彦 山根
Rumi Tsubota
留美 坪田
Takumi Hasebe
巧 長谷部
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP3156514A priority Critical patent/JPH057303A/en
Publication of JPH057303A publication Critical patent/JPH057303A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To suppress total code data quantity after encoding less definite quantity at the time of encoding picture data. CONSTITUTION:A coefficient processed by an orthogonal tranaforming part 101 is quantized by a quantizing part 102 in conformity to a quantization table 108, and this coefficient is encoded for every hierarchy by hierarch separation, and the code quantity of every hierarchy is counted by a counter part 104 for the code quantity classified by the hierarchy. The hierarchy to be discarded is determined by a code quantity control part 105 based on this information and set coding quantity, and is outputted to a quantization table control part 106. The quantization table to make a coefficient value after the hierarchy to be discarded by this information zero is generated in a quantization table setting part 107, and the coefficient is encoded again by this quantization table so that the total code quantity is suppressed less than the definite quantity. Thus, since sequential code date in which the code quantity is suppressed less than the definite quantity can obtained without converting hierarchical data into the sequential code data, a hardware scale can be miniaturized, and in addition, high-speed processing can be attained.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は符号化により圧縮した画
像データを蓄積したり伝送したりする画像データ蓄積装
置や画像データ伝送装置等に用いられ、特に符号化後の
符号データ量を一定量以下に抑制する符号化装置に関す
るものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is used for an image data storage device, an image data transmission device, etc. for storing and transmitting image data compressed by encoding. The present invention relates to an encoding device to be suppressed below.

【0002】[0002]

【従来の技術】静止画像等の画像データを符号化してデ
ータ圧縮する際、近接する画像のデータは相関性が高い
ことに着目して、例えば画像データをN×N画素のブロ
ックに分割し、N×N画素からなるブロック内のデータ
に離散コサイン変換(DCT)等の直交変換を施し、そ
の変換係数を符号化して圧縮する方式が用いられること
がある。
2. Description of the Related Art When encoding image data such as a still image and compressing the data, attention is paid to the fact that the data of adjacent images have a high correlation, and for example, the image data is divided into blocks of N × N pixels, A method may be used in which data in a block made up of N × N pixels is subjected to orthogonal transform such as discrete cosine transform (DCT), and the transform coefficient is encoded and compressed.

【0003】上記N×Nの2次元のブロックの画素に対
して、離散コサイン変換を施して得られる変換係数は、
一般に例えば、図12に斜線で示す低次にエネルギーが
集中するため比較的大きな値を有することが多い。特
に、低周波成分の多いブロックの変換係数は、ブロック
の左上に数値の大きいものが集中し、右下には数値の小
さいものや零であるものが多くなる。
The transform coefficient obtained by applying the discrete cosine transform to the pixels of the N × N two-dimensional block is
In general, for example, in many cases, the energy is concentrated in the low order shown by diagonal lines in FIG. In particular, the transform coefficients of a block having many low frequency components are concentrated in the upper left corner of the block and have a large numerical value, and in the lower right corner, many of them have a small numerical value or zero.

【0004】そこで、上記のような変換係数を量子化し
て符号化する場合には、次のような処理によって、デー
タ圧縮の高能率化を図る可変長符号化方式手法が多く用
いられている。すなわち、例えば8×8画素のブロック
に直交変換を施した変換係数を符号化する場合には、図
13に矢印で示す方向に係数データを順次スキャンして
1次元のデータに配列し、連続する零係数の個数と非零
係数値とを組にして組データを形成し、この組データを
符号化する。
Therefore, when the above transform coefficients are quantized and coded, a variable length coding method is often used to improve the efficiency of data compression by the following processing. That is, for example, when encoding a transform coefficient obtained by performing orthogonal transform on a block of 8 × 8 pixels, coefficient data is sequentially scanned in the direction shown by the arrow in FIG. The set data is formed by combining the number of zero coefficients and the non-zero coefficient value, and the set data is encoded.

【0005】より具体的には、例えば図14に示すよう
に、記号Zで示す係数だけが非零係数である場合、係数
Zよりも手前の零係数の個数と、係数Zとを組データと
して符号化し、係数Z以降の零係数については符号化を
行わずにEOB(End Of Block)符号を付
加して、いわゆるシーケンシャル符号データを生成す
る。
More specifically, for example, as shown in FIG. 14, when only the coefficient indicated by the symbol Z is a non-zero coefficient, the number of zero coefficients before the coefficient Z and the coefficient Z are used as group data. The so-called sequential code data is generated by encoding the zero coefficient after the coefficient Z and adding the EOB (End Of Block) code without performing the encoding.

【0006】このように符号はブロックが処理単位とな
り、このブロック単位の処理を画像全体に対して施す。
ところで、画像データの蓄積や伝送をおこなう場合、符
号化後の符号データ量を一定量以下にしたいという要求
がある。例えば、蓄積媒体の容量が制限されている場
合、扱う画像により蓄積枚数が可変であるのは望ましく
ない。同様にスチルカメラ等に応用する場合、記憶媒体
(磁気ディスク、メモリカード等)に記録される画像の
枚数を保証する必要がある。また、動画に対応しようと
すれば、一定時間内に記憶媒体からの読出得るデータ量
以下に符号量を抑える必要がある。
As described above, in the code, the block is a processing unit, and the processing of this block unit is performed on the entire image.
By the way, in the case of accumulating and transmitting image data, there is a demand that the amount of coded data after encoding be kept below a certain amount. For example, when the capacity of the storage medium is limited, it is not desirable that the number of stored sheets be variable depending on the image to be handled. Similarly, when applied to a still camera or the like, it is necessary to guarantee the number of images recorded on a storage medium (magnetic disk, memory card, etc.). Further, in order to deal with moving images, it is necessary to suppress the code amount to be equal to or less than the amount of data that can be read from the storage medium within a fixed time.

【0007】このような符号量を一定量以下に抑える方
式として、直交変換のあとの係数を周波数帯域毎に階層
的に符号化し、一定量をオーバーした符号データに関し
ては、以降の階層の符号データを切り捨てることで総符
号量を一定量以下に抑える方式がある。(特願平3−3
5883)図9、図10はこの従来方式を説明した図で
ある。このうち図9はブロック内を3つの階層(階層
A、階層B、階層C)に分割した例である。符号化時に
は各階層ごとに符号化する。図10の(a)に各階層ご
とに画像全体について符号化した際のデータ構造を示
す。このような符号構造にすることで、各階層の符号量
がわかる。例えば、同図において、一定量以下の符号量
を満たすデータ量が階層Bまでであるとすれば、階層C
の符号データは切り捨てる。次に、同一ブロック内の階
層Aと階層Bの符号データをパッキングし、(b)の符
号構造に変換する。これは、復号化の際にブロック単位
に処理するため、同一ブロックの符号データが分散して
存在するのは効率が悪くなるためである。
As a method of suppressing the code amount below a certain amount, the coefficients after orthogonal transformation are hierarchically encoded for each frequency band, and the code data exceeding a certain amount is code data of the subsequent layers. There is a method in which the total code amount is suppressed to a certain amount or less by truncating. (Japanese Patent Application 3-3
5883) FIGS. 9 and 10 are diagrams for explaining this conventional method. Of these, FIG. 9 shows an example in which the block is divided into three layers (layer A, layer B, and layer C). At the time of encoding, each layer is encoded. FIG. 10A shows a data structure when the entire image is encoded for each layer. With such a code structure, the code amount of each layer can be known. For example, in the figure, if the data amount satisfying the code amount of a certain amount or less is up to layer B, layer C
The code data of is truncated. Next, the code data of the layer A and the layer B in the same block are packed and converted into the code structure of (b). This is because the decoding process is performed in block units, and therefore code data of the same block exists in a dispersed manner because the efficiency becomes poor.

【0008】図11は図10の(b)を復号した際の、
ブロック内の係数の様子である。このように、切り捨て
た階層Cに対応する係数値は零として処理される。
FIG. 11 is a diagram when decoding (b) of FIG.
It is a state of the coefficient in the block. In this way, the coefficient value corresponding to the truncated layer C is processed as zero.

【0009】[0009]

【発明が解決しようとする課題】しかしながら、上記従
来の符号化装置では、総符号量を一定量以下に抑えたシ
ーケンシャル符号に変換する際に、階層的に符号化して
得られた各階層の符号量から、切り捨てる階層を算出し
た後、階層的に格納された有効な階層の符号データをシ
ーケンシャル符号に再変換する必要があり、この再変換
のために階層的な符号データを保持する符号メモリと、
一定量以下に抑えられたシーケンシャル符号データを保
持するメモリ等を備える必要があり、ハードウェアの規
模が大きくなりがちであるという問題点を有していた。
However, in the above-mentioned conventional encoding device, when converting to a sequential code in which the total code amount is suppressed to a fixed amount or less, the code of each layer obtained by hierarchically encoding. After calculating the truncation layer from the amount, it is necessary to reconvert the hierarchically stored code data of the valid layer into a sequential code, and for this reconversion, a code memory that holds the hierarchical code data and ,
It is necessary to provide a memory or the like for holding sequential code data that is suppressed to a certain amount or less, and there is a problem that the scale of hardware tends to increase.

【0010】そのうえ、変換処理にあたって、同一ブロ
ック内の分散して格納されている各階層の符号データを
一度復号し、可変長の各符号語の符号長を算出し、同一
のブロックの符号データをパッキングするため、変換処
理時間が長くかかるという問題点も有していた。本発明
はかかる点に鑑み、総符号量を一定量以下に抑えたシー
ケンシャル符号化処理を高速に行わせることができ、し
かもハードウェアの規模を小さくすることができる符号
化装置の提供を目的としている。
In addition, in the conversion process, the code data of each layer stored in the same block in a distributed manner is once decoded, the code length of each variable-length code word is calculated, and the code data of the same block is calculated. There is also a problem that the conversion processing takes a long time because of packing. In view of the above point, the present invention has an object to provide an encoding device capable of performing sequential encoding processing with a total code amount suppressed to a certain amount or less at high speed, and further reducing the scale of hardware. There is.

【0011】[0011]

【課題を解決するための手段】上記目的を達成するため
請求項1に係る第1発明は、N×N画素に分割された画
像データを直交変換する直交変換手段と、第1の量子化
テーブルを保有するテーブル保有手段と、ブロック内の
直交変換係数を第1の量子化テーブルで量子化する第1
の量子化手段と、前記第1の量子化手段で量子化された
係数データを複数の階層に分割し、各階層において低次
の階層の係数からの符号量の和をカウントする符号量カ
ウント手段と、そのカウント値が設定符号量を越える階
層を検出する符号量超過階層検出手段と、前記検出手段
で検出された階層を含み、それより高次の階層の係数を
零とする第2の量子化テーブルを作成する量子化テーブ
ル作成手段と、第2の量子化手段で量子化された係数デ
ータを符号化して送出する符号化手段とを備えているこ
とを特徴としている。
To achieve the above object, a first invention according to claim 1 is an orthogonal transformation means for orthogonally transforming image data divided into N × N pixels, and a first quantization table. And a first table for quantizing orthogonal transformation coefficients in the block with a first quantization table.
And a code amount counting unit for dividing the coefficient data quantized by the first quantization unit into a plurality of layers and counting the sum of the code amounts from the coefficients of the lower layers in each layer. And a second quantum that includes a code amount excess layer detection unit that detects a layer whose count value exceeds the set code amount, and a layer of a layer higher than the layer number detected by the detection unit and that is zero. It is characterized in that it is provided with a quantization table creating means for creating a quantization table, and an encoding means for encoding and transmitting the coefficient data quantized by the second quantization means.

【0012】前記第2の量子化テーブルは、一画面等所
定規模の画像データに対して単一個作成される。さらに
前記符号化装置は、第1の量子化手段で量子化された各
ブロック係数データを符号化する際にブロック内の最後
に連続する零係数の個数に割り当てられるEOB符号の
数を各階層毎にカウントするEOB符号カウント手段を
備え、かつ、前記符号量超過階層検出手段が、前記符号
量カウント手段のカウント値と、そのカウント値の属す
る階層以降に含まれるEOB符号との総和が設定符号量
を越える階層を検出する構成とすることができる。
A single second quantization table is created for image data of a predetermined scale such as one screen. Further, the encoding device, when encoding each block coefficient data quantized by the first quantizing means, sets the number of EOB codes assigned to the number of zero coefficients that are continuous last in the block for each layer. And an EOB code counting means for counting the EOB code counting means, wherein the code amount excess layer detecting means has a sum of a count value of the code amount counting means and an EOB code included in a layer to which the count value belongs and a set code amount. It is possible to adopt a configuration in which the hierarchy exceeding the above is detected.

【0013】[0013]

【作用】本発明によれば、上記構成によって (1)第1の量子化手段で得られた各階層の符号量によ
り、切り捨てる階層情報を得、この情報に基づき、切り
捨てる階層以降の係数を零にする第2の量子化手段を用
い、再符号化することで総符号量を一定量以下に抑え
る。 (2)第1の量子化手段で得られた各階層の符号量と、
各階層のEOB符号の個数により、切り捨てる階層情報
を得、この情報に基づき、切り捨てる階層以降の係数を
零にする第2の量子化手段を用い、再符号化することで
総符号量を一定量以下に抑える。
According to the present invention, (1) layer information to be truncated is obtained from the code amount of each layer obtained by the first quantizing means according to the above configuration, and the coefficient after the layer to be truncated is set to zero based on this information. By using the second quantizing means for re-encoding, the total code amount is suppressed below a certain amount. (2) The code amount of each layer obtained by the first quantization means,
The layer information to be truncated is obtained according to the number of EOB codes in each layer, and based on this information, a second quantizing means for making the coefficients after the layer to be truncated to zero is used to re-encode the total amount of code. Keep below.

【0014】[0014]

【実施例】以下、本発明の一実施例の符号化装置につい
て、図面を参照しながら説明する。図1は本発明の実施
例における符号化装置のブロック図を示すものである。
図1において、100は、例えば一画面分の画像データ
を格納するメモリ、101は直交変換部で、1画面を例
えば8×8画素のブロックに分割した各ブロックの画像
データに対して直交変換を施す回路である。任意の1つ
のブロックの画像データに対して直交変換を行った結果
得られる係数データを図5(a)に示す。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An encoding apparatus according to an embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram of an encoding device according to an embodiment of the present invention.
In FIG. 1, 100 is a memory for storing image data for one screen, 101 is an orthogonal transformation unit, which performs orthogonal transformation on image data of each block obtained by dividing one screen into blocks of 8 × 8 pixels. This is the circuit to apply. FIG. 5A shows coefficient data obtained as a result of performing orthogonal transformation on image data of any one block.

【0015】102は直交変換によって得られたデータ
を量子化する量子化部である。この量子化部102は量
子化テーブル部108の保有している図5(b)に示す
量子化テーブルを用いて直交変換係数データを量子化す
る第1のステップと、量子化テーブル制御部106を通
じて量子化テーブル設定部で新たに作成される図5
(e)に示す量子化テーブルを用いて直交変換係数デー
タを量子化する第2のステップとの2つのステップを実
行する。各ステップともメモリ100に格納された一画
面分のブロック全てを量子化するまで継続され、それを
完了すると第2のステップ若しくは新たな画像の第1ス
テップに移行する。なお、量子化部102の構成は、1
ブロック分の直交変換された係数を保持するメモリと、
図5(b)(e)に示す量子化テーブルを保持するメモ
リと、両メモリの内容を読み出して量子化処理を行う演
算部とからなっている。量子化処理によって得られたデ
ータを保有するメモリは有していないので、量子化後の
係数データはそのまま出力される。
Reference numeral 102 is a quantizer for quantizing the data obtained by the orthogonal transformation. The quantization unit 102 uses the quantization table shown in FIG. 5B held by the quantization table unit 108 to quantize the orthogonal transform coefficient data and the quantization table control unit 106. FIG. 5 newly created by the quantization table setting unit
Two steps including the second step of quantizing the orthogonal transform coefficient data using the quantization table shown in (e) are executed. Each step is continued until all the blocks for one screen stored in the memory 100 are quantized, and when it is completed, the process moves to the second step or the first step of a new image. The configuration of the quantizer 102 is 1
A memory that holds the coefficients that have been orthogonally transformed for blocks,
It is composed of a memory that holds the quantization table shown in FIGS. 5B and 5E, and an arithmetic unit that reads the contents of both memories and performs the quantization processing. Since the memory holding the data obtained by the quantization processing is not included, the quantized coefficient data is output as it is.

【0016】103は量子化部102で量子化された係
数データの出力方向を切り換える切換え部で、量子化部
102が第1ステップの実行を完了するまでは量子化部
102の出力データを階層別符号量カウンタ部104に
出力する状態にあり、第1ステップの実行完了後、第2
ステップの実行完了するまでは量子化部102の出力デ
ータを符号化部109に出力する状態にある。
A switching unit 103 switches the output direction of the coefficient data quantized by the quantization unit 102, and the output data of the quantization unit 102 is classified by layers until the quantization unit 102 completes the execution of the first step. It is in the state of outputting to the code amount counter unit 104, and after the completion of the execution of the first step, the second
Until the execution of the steps is completed, the output data of the quantization unit 102 is in a state of being output to the encoding unit 109.

【0017】階層別符号量カウンタ部104は、量子化
部102が第1ステップにおいて得る、量子化後の係数
を任意の階層に分割し、各階層の符号量をカウントす
る。カウンタ部104のカウントする符号量は符号化部
109で行うエントロピー符号化を行った場合の符号量
をいう。図3にブロック内の分割の一例を示す。同図に
おいて、第1領域は最も低次の階層で、第4領域は最も
高次の階層である。尚、図では4つの階層に分けている
が、分割数は任意に定めることができる。
The code amount counter unit for each layer 104 divides the quantized coefficient obtained by the quantization unit 102 in the first step into arbitrary layers, and counts the code amount of each layer. The code amount counted by the counter unit 104 is the code amount when entropy coding is performed by the coding unit 109. FIG. 3 shows an example of division within a block. In the figure, the first area is the lowest hierarchy and the fourth area is the highest hierarchy. In addition, although it is divided into four layers in the figure, the number of divisions can be arbitrarily determined.

【0018】符号量制御部105は前記符号量カウンタ
部104から得られた各階層符号量と設定された符号量
とから切り捨てる階層を検出する。量子化テーブル制御
部106は符号量制御部105から得る切り捨てる階層
の情報を得て、量子化テーブル部108の保有するテー
ブルを改変制御するためのテーブルを作成する。
The code amount control unit 105 detects a layer to be truncated from the code amount of each layer obtained from the code amount counter unit 104 and the set code amount. The quantization table control unit 106 obtains the information on the layer to be cut off obtained from the code amount control unit 105, and creates a table for modifying and controlling the table held by the quantization table unit 108.

【0019】量子化テーブル設定部107は、量子化部
102が第1ステップを実行中は量子化テーブル108
の保有するテーブルをそのまま量子化部102に与え、
量子化部102が第2ステップを実行中は前記量子化テ
ーブル制御部106の作成するテーブルと量子化テーブ
ル108の保有するテーブルとに基づいて新たな量子化
テーブル(第2の量子化テーブル)を作成し、それを量
子化部102に与える働きをする。
The quantization table setting unit 107 is provided with a quantization table 108 while the quantization unit 102 is executing the first step.
The table held by is directly given to the quantization unit 102,
While the quantization unit 102 is executing the second step, a new quantization table (second quantization table) is created based on the table created by the quantization table control unit 106 and the table held by the quantization table 108. It functions to create and give it to the quantizer 102.

【0020】符号化部109は量子化部102が第2の
ステップを実行することによって得る量子化係数データ
をエントロピー符号化して送出する。次に、上記構成の
動作につき説明する。先ず、一画面分の画像データがメ
モリ100に蓄積されると、このメモリ100から8×
8画素のブロック単位で画像データが読み出され、直交
変換部101に入力される。そして、この直交変換部1
01で図5(a)に示すように周波数領域に変換され
る。この変換係数は量子化部102で量子化される。こ
の場合、量子化テーブル部108の保有するテーブル
(図5(b)参照)により量子化される。
The coding unit 109 entropy-codes the quantized coefficient data obtained by the quantizing unit 102 executing the second step, and sends it. Next, the operation of the above configuration will be described. First, when image data for one screen is stored in the memory 100, 8 ×
Image data is read in units of blocks of 8 pixels and input to the orthogonal transformation unit 101. Then, this orthogonal transformation unit 1
At 01, it is converted to the frequency domain as shown in FIG. The transform coefficient is quantized by the quantizer 102. In this case, the quantization is performed by the table held by the quantization table unit 108 (see FIG. 5B).

【0021】量子化部102で量子化された係数は階層
別符号量カウンタ部104に送られ、階層別符号量カウ
ンタ部104で各階層の符号量がカウントされる。各階
層の符号量カウントは一画面分の全ブロックに対して行
われる。各階層の符号量の総カウント数は符号量制御部
105に検出され、ここで、全ての階層の符号量の総カ
ウント数を合算すると共に、そのカウント値と設定符号
量との比較を行う。設定符号量とは符号データを最終的
に所定のデータ量以下に抑えるという目標値である。図
4に全階層の総符号量と設定符号量の様子を示す。同図
の場合、設定符号量を満足する階層は第2階層までであ
る。従って、符号量制御部105は、全階層の符号量と
設定符号量より、第3階層以降の符号データを切り捨て
る旨を量子化テーブル制御部106に知らせる。量子化
テーブル制御部106は、符号量制御部105からの切
り捨てる階層の情報を得、量子化テーブル制御パターン
を生成する。図5(d)に量子化テーブル制御パターン
の一例を示す。同図の量子化テーブル制御パターンは第
3階層以降の符号データを切り捨てる場合である。この
場合、直交変換後の係数の精度が4ビットであることを
前提としている。このように、切り捨てたい階層のテー
ブル値を直交変換後の係数の精度で表現されうる最大値
に1を加算した値に設定することで、量子化後の係数値
を零にしている。
The coefficient quantized by the quantizer 102 is sent to the code amount counter 104 for each layer, and the code amount counter 104 for each layer counts the code amount of each layer. The code amount count of each layer is performed on all blocks for one screen. The total code amount counts of the respective layers are detected by the code amount control unit 105, and the total count numbers of the code amounts of all the layers are added together, and the count value and the set code amount are compared. The set code amount is a target value for finally suppressing the code data to a predetermined data amount or less. FIG. 4 shows the states of the total code amount and the set code amount of all layers. In the case of the same drawing, the layers that satisfy the set code amount are up to the second layer. Therefore, the code amount control unit 105 notifies the quantization table control unit 106 that the code data of the third and subsequent layers will be truncated based on the code amounts of all the layers and the set code amounts. The quantization table control unit 106 obtains the information on the layer to be truncated from the code amount control unit 105 and generates a quantization table control pattern. FIG. 5D shows an example of the quantization table control pattern. The quantization table control pattern shown in the figure is for the case of truncating code data of the third and subsequent layers. In this case, it is premised that the accuracy of the coefficients after orthogonal transformation is 4 bits. In this way, the coefficient value after quantization is set to zero by setting the table value of the layer to be truncated to a value obtained by adding 1 to the maximum value that can be expressed with the accuracy of the coefficient after orthogonal transformation.

【0022】量子化テーブル設定部107は、量子化テ
ーブル制御部106からの量子化テーブル制御パターン
と、量子化テーブル108より第2の量子化テーブルを
生成する。図5(e)、(f)に第2の量子化テーブル
と、この量子化テーブルで量子化された係数を示す。こ
のように、第3階層以降の係数は零として処理される。
The quantization table setting unit 107 generates a second quantization table from the quantization table control pattern from the quantization table control unit 106 and the quantization table 108. FIGS. 5E and 5F show the second quantization table and the coefficients quantized by this quantization table. In this way, the coefficients of the third and subsequent layers are processed as zero.

【0023】量子化部102が第1のステップの実行を
完了すると、再びメモリ100からブロック単位で画像
データを読出し、直交変換部101で直交変換を行うと
共に、量子化部102が直交変換係数に対して第2のス
テップの実行を行う。即ち、第1ステップで作成した第
2の量子化テーブルを用いて量子化を行い、量子化され
た係数を符号化部103へ送出し、符号化する。以上の
処理によって総符号量が一定量以下のシーケンシャル符
号を得ることができる。尚、上記実施例では、符号量カ
ウンタ部104がブロック内の各階層の符号量を各別に
カウントしているが、本発明はこれに限らず、低次の階
層から順に符号量を積算する態様で実施することもでき
る。この場合には、符号量制御部105はカウンタ部1
04から得る符号量積算値と設定符号量を比較するだけ
で切り捨てる階層を検出することができる。
When the quantizing unit 102 completes the execution of the first step, the image data is read again from the memory 100 in block units, the orthogonal transforming unit 101 performs orthogonal transform, and the quantizing unit 102 converts it into orthogonal transform coefficients. On the other hand, the second step is executed. That is, quantization is performed using the second quantization table created in the first step, and the quantized coefficient is sent to the encoding unit 103 and encoded. By the above processing, it is possible to obtain a sequential code having a total code amount equal to or less than a certain amount. In the above embodiment, the code amount counter unit 104 separately counts the code amount of each layer in the block, but the present invention is not limited to this, and the code amount is sequentially accumulated from the lower layers. Can also be carried out. In this case, the code amount control unit 105 has the counter unit 1
The layer to be truncated can be detected only by comparing the code amount integrated value obtained from 04 with the set code amount.

【0024】図2は本発明の他の一実施例における符号
化装置のブロック図を示すものである。図2の構成は図
1の構成と基本的に同じであり、同一の構成要素につい
ては詳細な説明は省略する。図中、200は一画面分の
画像データを格納するメモリ、201はブロックに分割
された画像データに直交変換を施す直交変換部、202
は直交変換部201で得られた係数を量子化する量子化
部、203は量子化部202で量子化された係数を符号
化する符号化部、204は各階層の符号量をカウントす
る階層別符号量カウンタ部、206は各階層のEOB符
号の個数をカウントする階層別EOB符号カウンタ部、
205は階層別符号量カウンタ部204と階層別EOB
符号カウンタ部206から得られた各階層の符号量と各
階層のEOBの符号長と設定された符号量より切り捨て
る階層を検出し符号量を制御する符号量制御部、208
は第1の量子化テーブル、209は符号量制御部205
から得られる切り捨てる階層の情報を得、量子化テーブ
ル208を制御する量子化テーブル制御部、207は量
子化テーブル208と量子化テーブル制御部209より
第2の量子化テーブルを設定する量子化テーブル設定
部、210は実際に符号データを生成する符号化部20
3と各階層の符号量をカウントし、量子化テーブルを操
作する処理を切り換えるセレクタである。
FIG. 2 is a block diagram of an encoding apparatus according to another embodiment of the present invention. The configuration of FIG. 2 is basically the same as the configuration of FIG. 1, and detailed description of the same components will be omitted. In the figure, 200 is a memory for storing image data for one screen, 201 is an orthogonal transformation unit for performing orthogonal transformation on the image data divided into blocks, 202
Is a quantizer for quantizing the coefficient obtained by the orthogonal transform unit 201, 203 is an encoder for encoding the coefficient quantized by the quantizer 202, and 204 is a hierarchy for counting the code amount of each hierarchy. A code amount counter unit 206 is a layer-specific EOB code counter unit that counts the number of EOB codes in each layer.
Reference numeral 205 denotes a code amount counter unit 204 for each layer and EOB for each layer.
A code amount control unit 208 for detecting a layer to be truncated based on the code amount of each layer obtained from the code counter unit 206, the EOB code length of each layer and the set code amount and controlling the code amount, 208
Is a first quantization table, 209 is a code amount control unit 205
A quantization table control unit for controlling the quantization table 208 by obtaining the information of the cut-off layer obtained from the above, and a quantization table setting unit 207 for setting the second quantization table from the quantization table 208 and the quantization table control unit 209. And 210 is an encoding unit 20 that actually generates encoded data.
3 is a selector that counts the code amount of each layer and 3 and switches the process of operating the quantization table.

【0025】尚、第2の量子化テーブルはメモリ100
に格納した一画面分の画像データを1単位として作成し
たが、本発明はこれに限られるものではなく、所定規模
のデータ量を単位として第2の量子化テーブルを作成す
るものであればよい。次に、第2の符号化装置の動作
を、図2、図6、図7および図8を用いて説明する。
The second quantization table is the memory 100.
Although the image data for one screen stored in 1 is created as one unit, the present invention is not limited to this, and the second quantization table may be created in units of a predetermined amount of data. . Next, the operation of the second coding device will be described with reference to FIGS. 2, 6, 7, and 8.

【0026】図6はブロック内を4つの階層に分割した
図であり、各ブロック内の記号Zの手前まではすべて非
零係数であり、記号Z以降はすべて零係数である。この
ようなブロックを階層ごとに符号化した例を図7に示
す。同図において、第1階層の符号データは(BLK1
−第1階層の符号)(BLK2−第1階層の符号)(B
LK3−第1階層の符号)・・・であり、第2階層の符
号データは(BLK1−第2階層の符号)(BLK2−
第2階層の符号)(EOB)(BLK3−第2階層の符
号)・・・であり、第3階層の符号データは(BLK3
−第3階層の符号)(EOB)(BLK3−第3階層の
符号)・・・であり、第4階層の符号データは(BLK
3−第4階層の符号)(EOB)・・・である。このよ
うに、ブロック内の第M階層でEOB符号が生成される
と、同一ブロック内において第M+1階層以降に符号デ
ータは存在しない。つまり、ブロック内には1つ以上の
EOBは存在しない。ここで、符号量が一定量以下を満
たす階層が第3階層までの符号データであるとすれば、
第4階層の符号データを切り捨てた斜線の部分が総符号
量になる。しかし、この第1階層から第3階層までの階
層化された符号データをシーケンシャルな符号データに
変換すれば図8に示すように、BLK3においてEOB
符号が付加されることになる。つまり、図7の斜線部の
符号量に比べて、図8の符号量はEOBの符号長分多い
ことになる。このように、総符号量を一定量以下に抑え
る場合、切り捨てる階層にEOBが存在していれば、そ
の分、符号量が増えることになる。
FIG. 6 is a diagram in which the inside of a block is divided into four hierarchies, all the non-zero coefficients up to the symbol Z in each block, and all the zero coefficients after the symbol Z. FIG. 7 shows an example of coding such a block for each layer. In the figure, the code data of the first layer is (BLK1
-First layer code) (BLK2-First layer code) (B
LK3-the code of the first layer) ..., and the code data of the second layer is (BLK1-the code of the second layer) (BLK2-
Second layer code) (EOB) (BLK3-second layer code) ... and the third layer code data is (BLK3
-Third layer code) (EOB) (BLK3-third layer code) ... and the fourth layer code data is (BLK
(3rd-level code) (EOB) ... In this way, when the EOB code is generated in the Mth layer in the block, code data does not exist in the M + 1th layer and subsequent layers in the same block. That is, there is no more than one EOB in the block. Here, if it is assumed that the hierarchies in which the code amount is equal to or less than a certain amount are code data up to the third layer
The shaded portion of the code data of the fourth layer is cut off and becomes the total code amount. However, if the layered code data from the first layer to the third layer is converted into sequential code data, as shown in FIG.
A code will be added. That is, the code amount in FIG. 8 is larger than the code amount in the shaded area in FIG. 7 by the EOB code length. In this way, when the total code amount is suppressed to a certain amount or less, if the EOB exists in the layer to be cut off, the code amount increases by that amount.

【0027】ところで、本実施例においては、各階層ご
とに符号量をカウントするとともに、各階層内で発生す
るEOBの数をカウントし、まず各階層の符号量で暫定
的に切り捨てる階層を決め、有効な階層に含まれるEO
Bの数を算出し、画像全体で存在しうるEOBの総数か
ら、切り捨てられる階層内に存在するEOBの総数を算
出し、そのEOBの符号量を有効階層の総符号量に付加
し、設定符号量をオーバーすれば、切り捨てる階層を1
つ増やす。以降、同様な処理を行い、付加されるEOB
を含め、設定符号量以下となる階層を算出する。
By the way, in the present embodiment, the code amount is counted for each layer, the number of EOBs generated in each layer is counted, and the layer to be temporarily cut off is determined by the code amount of each layer. EO included in valid hierarchy
The number of Bs is calculated, the total number of EOBs existing in the layer to be truncated is calculated from the total number of EOBs that can exist in the entire image, the code amount of the EOB is added to the total code amount of the effective layer, and the set code is added. If the amount is exceeded, the layer to be cut off is 1
Increase one. After that, similar processing is performed and EOB added
Including the above, the layer having the set code amount or less is calculated.

【0028】図2において、階層別符号量カウンタ部2
04の各階層の符号量の情報と、階層別EOB符号カウ
ンタ部206の各階層内のEOB符号量情報より、符号
量制御部205において、上記のアルゴリズムでEOB
符号を含め、設定量以下に符号量を抑える階層を求め、
量子化テーブル制御部209に切り捨てる階層情報を与
える。このようにして、新たな量子化テーブルを量子化
テーブル設定部207で生成し、再度量子化および符号
化をおこない、総符号量を一定量以下に抑えた、シーケ
ンシャル符号データを得る。
In FIG. 2, the code amount counter unit 2 for each layer is provided.
04, and the EOB code amount information in each layer of the layer-specific EOB code counter unit 206, the code amount control unit 205 uses the above algorithm to perform EOB.
Include a code, find a layer that suppresses the code amount below the set amount,
The quantization table control unit 209 is provided with the cut-off layer information. In this way, a new quantization table is generated by the quantization table setting unit 207, quantization and coding are performed again, and sequential code data in which the total code amount is suppressed to a fixed amount or less is obtained.

【0029】[0029]

【発明の効果】以上、説明したように本発明によれば、
第1の量子化手段を用いて符号化された符号データに対
し、階層別に符号量およびEOB符号量情報を有し、こ
の情報により一定量を越える階層を検出し、該階層以降
を零にする第2の量子化テーブルを生成し、該第2の量
子化手段を用いて量子化および符号化処理を行うので、
階層符号データからシーケンシャル符号への変換処理が
必要なく、階層符号データ用のメモリ等も必要ない。
As described above, according to the present invention,
The coded data encoded using the first quantizing means has code amount and EOB code amount information for each layer, and a layer exceeding a certain amount is detected by this information, and the layers after the layer are set to zero. Since the second quantization table is generated and the quantization and coding processing is performed using the second quantization means,
Conversion processing from hierarchical code data to sequential code is not necessary, and a memory for hierarchical code data is not necessary.

【0030】したがって、ハードウェア規模を小さく抑
え、しかも符号化を高速に行わせることができる。
Therefore, the hardware scale can be reduced and the encoding can be performed at high speed.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の第1の実施例における符号化装置の構
成をしめすブロック図である。
FIG. 1 is a block diagram showing a configuration of an encoding device according to a first embodiment of the present invention.

【図2】本発明の第2の実施例における符号化装置の構
成をしめすブロック図である。
FIG. 2 is a block diagram showing a configuration of an encoding device according to a second embodiment of the present invention.

【図3】ブロック内を階層分割した例を示す図である。FIG. 3 is a diagram showing an example in which a block is hierarchically divided.

【図4】各階層の符号データの様子を示す図である。FIG. 4 is a diagram showing a state of code data of each layer.

【図5】ブロック内の係数と量子化テーブルの様子を示
す図である。
FIG. 5 is a diagram showing a state of coefficients in a block and a quantization table.

【図6】ブロック内を階層分割した例を示す図である。FIG. 6 is a diagram showing an example in which a block is hierarchically divided.

【図7】各階層の符号データと各ブロックの符号データ
の様子を示す図である。
FIG. 7 is a diagram showing a state of code data of each layer and code data of each block.

【図8】図7の符号をシーケンシャル符号に変換した様
子を示す図である。
FIG. 8 is a diagram showing a state in which the code of FIG. 7 is converted into a sequential code.

【図9】ブロック内を階層分割した例を示す図である。FIG. 9 is a diagram showing an example in which a block is hierarchically divided.

【図10】階層化符号をシーケンシャル符号に変換する
様子を示す図である。
FIG. 10 is a diagram showing how a hierarchical code is converted into a sequential code.

【図11】図10のシーケンシャル符号を復号した場合
のブロック内の係数の様子を示す図である。
11 is a diagram showing a state of coefficients in a block when the sequential code in FIG. 10 is decoded.

【図12】直交変換後の係数の様子を示す図である。FIG. 12 is a diagram showing a state of coefficients after orthogonal transformation.

【図13】ブロック内の係数を1次元に配列する際、ス
キャンする方向を示す図である。
FIG. 13 is a diagram showing a scanning direction when the coefficients in a block are arranged one-dimensionally.

【図14】ブロック内の係数を1次元に配列する際、ス
キャンする方向を示す図である。
FIG. 14 is a diagram showing a scanning direction when the coefficients in a block are arranged one-dimensionally.

【符号の説明】[Explanation of symbols]

101 直交変換部 102 量子化部 103 符号化部 104 階層別符号量カウンタ部 105 符号量制御部 106 量子化テーブル制御部 107 量子化テ ーブル設定部 108 量子化テーブル 109 セレクタ 101 Orthogonal transformation unit 102 quantizer 103 encoding unit 104 Code amount counter unit for each layer 105 code amount control unit 106 quantization table control unit 107 Quantization table setting section 108 quantization table 109 selector

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 N×N画素に分割された画像データを直
交変換する直交変換手段と、第1の量子化テーブルを保
有するテーブル保有手段と、ブロック内の直交変換係数
を第1の量子化テーブルで量子化する第1の量子化手段
と、前記第1の量子化手段で量子化された係数データを
複数の階層に分割し、各階層において低次の階層の係数
からの符号量の和をカウントする符号量カウント手段
と、そのカウント値が設定符号量を越える階層を検出す
る符号量超過階層検出手段と、前記検出手段で検出され
た階層を含み、それより高次の階層の係数を零とする第
2の量子化テーブルを作成する量子化テーブル作成手段
と、第2の量子化手段で量子化された係数データを符号
化して送出する符号化手段と、を備えていることを特徴
とする符号化装置。
1. An orthogonal transformation means for orthogonally transforming image data divided into N × N pixels, a table holding means for holding a first quantization table, and a first quantization for an orthogonal transformation coefficient in a block. A first quantizing means for quantizing in a table and coefficient data quantized by the first quantizing means are divided into a plurality of hierarchies, and the sum of the code amounts from the coefficients of the lower hierarchies in each hierarchy Including a code amount counting means for counting, a code amount excess layer detecting means for detecting a layer whose count value exceeds a set code amount, and a layer detected by the detecting means. It is provided with a quantization table creating means for creating a second quantization table that is set to zero, and an encoding means for encoding and transmitting coefficient data quantized by the second quantization means. And an encoding device.
【請求項2】 前記第2の量子化テーブルは、一画面等
所定規模の画像データに対して単一個作成されることを
特徴とする請求項1記載の符号化装置。
2. The encoding apparatus according to claim 1, wherein a single single second quantization table is created for image data of a predetermined scale such as one screen.
【請求項3】 請求項2に記載の符号化装置は、更に第
1の量子化手段で量子化された各ブロック係数データを
符号化する際にブロック内の最後に連続する零係数の個
数に割り当てられるEOB符号の数を各階層毎にカウン
トするEOB符号カウント手段を備え、かつ、前記符号
量超過階層検出手段が、前記符号量カウント手段のカウ
ント値と、そのカウント値の属する階層以降に含まれる
EOB符号との総和が設定符号量を越える階層を検出す
るものであることを特徴とする符号化装置。
3. The encoding device according to claim 2, further, when encoding each block coefficient data quantized by the first quantizing means, determines the number of zero coefficients that are continuous last in a block. EOB code counting means for counting the number of EOB codes to be allocated for each layer is provided, and the code amount excess layer detecting means is included in the count value of the code amount counting means and a layer after the layer to which the count value belongs. An encoding device for detecting a layer in which the sum total of the EOB code and an EOB code is greater than a set code amount.
JP3156514A 1991-06-27 1991-06-27 Encoder Pending JPH057303A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3156514A JPH057303A (en) 1991-06-27 1991-06-27 Encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3156514A JPH057303A (en) 1991-06-27 1991-06-27 Encoder

Publications (1)

Publication Number Publication Date
JPH057303A true JPH057303A (en) 1993-01-14

Family

ID=15629443

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3156514A Pending JPH057303A (en) 1991-06-27 1991-06-27 Encoder

Country Status (1)

Country Link
JP (1) JPH057303A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6509929B1 (en) 1999-05-06 2003-01-21 Nec Corporation Apparatus and method for coding a moving picture

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6509929B1 (en) 1999-05-06 2003-01-21 Nec Corporation Apparatus and method for coding a moving picture

Similar Documents

Publication Publication Date Title
EP1271926B1 (en) Image processing method, apparatus and computer program for compression-encoding
KR930009872B1 (en) Changing coding apparatus
US5539468A (en) Coding device and decoding device adaptive to local characteristics of an image signal
EP0677969A2 (en) Moving picture coding method and an apparatus therefor
JPH07262175A (en) Function transformation arithmetic unit
JPH0379182A (en) Image encoding control system
CN110896483A (en) Method for compressing and decompressing image data
CN101502122A (en) Encoding device and encoding method
JPH0832037B2 (en) Image data compression device
JP3292221B2 (en) Image compression coding method
JP3105906B2 (en) Image processing device
JP2871139B2 (en) Image data encoding device and decoding device
JP3835273B2 (en) Image encoding / decoding device
JPH057303A (en) Encoder
JPH0723385A (en) Highly efficient encoding device
JP3624450B2 (en) Image data encoding method and image data encoding apparatus
JP2915922B2 (en) Image signal compression coding device
JP3559314B2 (en) Image compression device
JP2993212B2 (en) How to combine images
JP2781535B2 (en) Digital encoding device and digital code decoding device
JPH04971A (en) Picture encoding system
JP2937455B2 (en) Image data compression device and image data decompression device
JPH03238970A (en) Conversion coding system
JPH04274674A (en) Data converter
JPH0344187A (en) Coder for picture signal