JPH11234671A - Signal processing unit - Google Patents

Signal processing unit

Info

Publication number
JPH11234671A
JPH11234671A JP2997598A JP2997598A JPH11234671A JP H11234671 A JPH11234671 A JP H11234671A JP 2997598 A JP2997598 A JP 2997598A JP 2997598 A JP2997598 A JP 2997598A JP H11234671 A JPH11234671 A JP H11234671A
Authority
JP
Japan
Prior art keywords
code
code amount
stuffing
amount
target value
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
JP2997598A
Other languages
Japanese (ja)
Inventor
Satoshi Motosu
聰 本巣
Yuichi Okuda
裕一 奥田
Yukio Isobe
幸雄 磯部
Hideo Arai
英雄 新井
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2997598A priority Critical patent/JPH11234671A/en
Publication of JPH11234671A publication Critical patent/JPH11234671A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent occurrence of overflow and underflow of an image buffer verification device as to a buffer for smoothing in the case of transmission of coded moving image data. SOLUTION: A discrete cosine transform DCT coefficient quantized by a quantization device 2 and processed by a scan order converter 3 is given to a variable length coder 4, where the coefficient is coded in variable length and the result is smoothed by a buffer 5 and then transmitted. A rate controller 8 determines an objective code amount to each picture and compares it with a code amount for each picture by the variable-length coder 4. When the code amount is deficient, code amount supplement devices 10, 11 use a specific code denoting a deficiency and stuffing process is conducted. Furthermore, the rate controller 8 determines an objective code amount for each macro block and a code amount adjustment device 9 reduces the excess codes with respect to the objective code amount by reducing the quantization DCT coefficient or supplements the deficiency by fixed-length coding.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、ディジタル動画像
信号を高能率符号化する信号処理装置に係り、特に、符
号量制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a signal processing apparatus for encoding digital video signals with high efficiency, and more particularly to a code amount control method.

【0002】[0002]

【従来の技術】動画像を圧縮する代表的な方式として、
「ITU−Tホワイトブック、オーディオビジュアル/マル
チメディア関連(Hシリーズ)勧告集」(財)日本ITU
協会 平成7年2月18日発行 pp.375−595(以下、文献1
という)に規定されている動画像圧縮規格H.262(通
称、MPEG2方式)と、「ディジタル記録媒体のため
の動画信号および付随する音響信号の1.5Mbit/s符号化
−第2部 動画」(日本工業規格 X4322−1996)(以下、
文献2という) に規定されている動画像圧縮規格ISO/IE
C 11172−2(通称、MPEG1方式)とが知られている。
2. Description of the Related Art As a typical method for compressing a moving image,
"ITU-T White Book, Audiovisual / Multimedia Related (H Series) Recommendations" ITU Japan
Association Published February 18, 1995 pp.375-595 (hereinafter referred to as Reference 1)
) And "1.5 Mbit / s encoding of moving picture signal and accompanying audio signal for digital recording medium-Part 2: Moving picture" (hereinafter referred to as "MPEG2 method"). Japanese Industrial Standard X4322-1996)
Moving image compression standard ISO / IE specified in Reference 2)
C 11172-2 (commonly known as the MPEG1 system) is known.

【0003】MPEG1方式及びMPEG2方式による
動画像圧縮の一般的な手順は以下の通りである。
The general procedure of moving picture compression by the MPEG1 system and the MPEG2 system is as follows.

【0004】圧縮単位とされたフィールドまたはフレー
ムのマクロブロックに対して、MPEG1方式あるいは
MPEG2方式に定められた信号となるように処理を行
なって圧縮する。MPEG1方式やMPEG2方式で
は、動画像情報の冗長性や人間の視覚特性を利用し、冗
長な情報や人間の視覚特性上重要でない情報を削除する
ことにより、ディジタル動画像情報を圧縮している。圧
縮の結果得られるディジタル情報(ビットストリーム)の
符号量は、同じ圧縮条件でも、入力画像の性質、例え
ば、フレームまたはフィールド間の相関や高空間周波数
成分の量によって大きく変化する。そのため、圧縮単位
である1フレーム期間または1フィールド期間の中で
も、圧縮の結果得られる符号量は刻々と変化する。一般
的には、圧縮単位であるフレームまたはフィールド毎に
符号量の目標を定め、符号量がこの目標に一致するよう
に圧縮パラメータを制御する。
[0004] A macroblock of a field or a frame as a compression unit is processed and compressed so as to be a signal specified in the MPEG1 system or the MPEG2 system. In the MPEG1 system and the MPEG2 system, digital moving image information is compressed by using redundancy of moving image information and human visual characteristics and deleting redundant information and information that is not important to human visual characteristics. The code amount of digital information (bit stream) obtained as a result of compression greatly changes depending on the properties of an input image, for example, the correlation between frames or fields and the amount of high spatial frequency components, even under the same compression conditions. Therefore, the code amount obtained as a result of compression changes every moment during one frame period or one field period which is a compression unit. In general, a target of the code amount is determined for each frame or field that is a compression unit, and the compression parameter is controlled so that the code amount matches the target.

【0005】このようなストリームを、データ転送レー
ト一定の伝送路を経由して伝送するためには、符号量が
多い期間は伝送容量を越える符号をバッファに蓄えて伝
送量を制限し、符号量が少ない期間はバッファから符号
を取り出して所定のデータ転送レートにして伝送する必
要がある。このような平滑化処理を行なうためには、送
信側で予めある程度の情報量を蓄えておき、発生符号量
が変化しても一定速度で伝送が可能にしておき、さら
に、受信側でもバッファを用意し、デコードに必要な符
号量が変化しても、デコードが継続できるようにする必
要がある。
In order to transmit such a stream via a transmission line having a constant data transfer rate, during a period in which the code amount is large, codes exceeding the transmission capacity are stored in a buffer to limit the transmission amount. It is necessary to take out the code from the buffer and transmit it at a predetermined data transfer rate during the period when the number is small. In order to perform such a smoothing process, a certain amount of information is stored in advance on the transmission side, transmission can be performed at a constant speed even if the generated code amount changes, and a buffer is also used on the reception side. It is necessary to prepare such that even if the code amount required for decoding changes, decoding can be continued.

【0006】図6はかかる従来の符号量制御付き動画像
圧縮符号化のための信号処理装置の一例を示すブロック
図であって、1は入力端子、2は量子化装置、3はスキ
ャン順変換装置、4は可変長符号化装置、5はバッフ
ァ、6は出力端子、7は符号量集計装置、8はレート制
御装置である。
FIG. 6 is a block diagram showing an example of such a conventional signal processing apparatus for moving image compression coding with code amount control, wherein 1 is an input terminal, 2 is a quantization device, and 3 is scan order conversion. The device, 4 is a variable length coding device, 5 is a buffer, 6 is an output terminal, 7 is a code amount totalizing device, and 8 is a rate control device.

【0007】同図において、入力端子1から入力された
動画像信号は、量子化装置2で量子化されて非可逆圧縮
される。MPEG1,2方式の場合には、量子化装置2
の前段で、フレームまたはフィールドの最小単位である
ブロック(8×8画素)毎に離散コサイン変換(DCT)
処理がなされている。スキャン順変換装置3では、量子
化装置2によって量子化された信号が内蔵のバッファに
蓄えられ、後段の可変長符号化装置4での処理が有利に
なるように、その量子化単位(MPEG1方式やMPE
G2方式の場合には、量子化されたDCT係数である。
以下では、MPEG1方式やMPEG2方式によって符
号化されるものとし、量子化単位を量子化DCT係数と
いう)の順序が入れ替えられて出力される。この入替え
の方法として、MPEG1,2方式では、ジグザクスキ
ャンの方法があるが、MPEG2方式では、さらに、オ
ルタネートスキャンも用いられる。
In FIG. 1, a moving image signal input from an input terminal 1 is quantized by a quantization device 2 and irreversibly compressed. In the case of MPEG1 and MPEG2, the quantization device 2
, Discrete cosine transform (DCT) for each block (8 × 8 pixels) which is the minimum unit of a frame or a field
Processing has been done. In the scan order conversion device 3, the signal quantized by the quantization device 2 is stored in a built-in buffer, and its quantization unit (MPEG1 system) is processed so that the processing in the subsequent variable length coding device 4 becomes advantageous. And MPE
In the case of the G2 system, it is a quantized DCT coefficient.
Hereinafter, it is assumed that the encoding is performed by the MPEG1 system or the MPEG2 system, and the order of the quantization unit is referred to as a quantized DCT coefficient. As a method of the replacement, a zigzag scan method is used in the MPEG1 and 2 systems, but an alternate scan is further used in the MPEG2 system.

【0008】可変長符号化装置4では、可変長符号を利
用して量子化DCT係数が符号化されて情報量の可逆圧
縮を行なう。可変長符号化装置4のかかる符号からなる
出力信号はバッファ5に一旦格納され、読み出されてビ
ットストリームとして出力端子6から出力される。この
バッファ5が、上記のように、出力端子6からの伝送路
の伝送容量による伝送レートと可変長符号化装置4から
出力される実際の符号量との差を吸収し、この符号量が
変化しても、この伝送路を一定の伝送レートで伝送でき
るようにする。
[0008] In the variable length coding device 4, the quantized DCT coefficients are coded by using the variable length code and lossless compression of the information amount is performed. The output signal of the variable length coding device 4 composed of such a code is temporarily stored in the buffer 5, read out, and output from the output terminal 6 as a bit stream. As described above, the buffer 5 absorbs the difference between the transmission rate due to the transmission capacity of the transmission path from the output terminal 6 and the actual code amount output from the variable length coding device 4, and this code amount changes. Even so, the transmission path can be transmitted at a constant transmission rate.

【0009】符号量集計装置7は、可変長符号化装置4
からのマクロブロック単位の符号量を集計し、レート制
御装置8は、その集計結果に応じて、量子化装置2を制
御してDCT係数を割り算する量子化スケールの大きさ
を変化させることにより、符号量の制御を行なう。
The code amount totalizing device 7 includes a variable length coding device 4
, And the rate control device 8 controls the quantization device 2 to change the size of the quantization scale for dividing the DCT coefficient in accordance with the result of the calculation. The code amount is controlled.

【0010】かかる符号量の制御は、レート制御装置8
が符号量集計装置7の集計結果に応じて次のピクチャで
の発生符号量の目標値を設定し、実際に発生する符号量
が目標値となるように量子化装置2での量子化スケール
を制御するものであり、可変長符号化装置4から出力さ
れる符号量の平均が伝送路の伝送レートになるようにな
るものである。従って、符号化処理したピクチャの発生
符号量がその目標値よりも少なければ、その目標値から
その目標値と発生符号量との差を差し引いた値を次のピ
クチャの目標値とし、符号化処理したピクチャの発生符
号量がその目標値よりも多ければ、その目標値からその
発生符号量とその目標値との差を差し引いた値を次のピ
クチャの目標値とする。そして、バッファ5は、可変長
符号化装置4から出力される符号量を平滑化して、一定
の伝送レートとなるように伝送路に送りこむ。
The control of the code amount is performed by the rate control device 8.
Sets the target value of the generated code amount for the next picture in accordance with the result of counting by the code amount counting device 7, and sets the quantization scale in the quantization device 2 so that the code amount actually generated becomes the target value. The control is performed so that the average of the code amount output from the variable length coding device 4 becomes the transmission rate of the transmission path. Therefore, if the generated code amount of the coded picture is smaller than the target value, a value obtained by subtracting the difference between the target value and the generated code amount from the target value is set as the target value of the next picture, and If the generated code amount of the picture obtained is larger than the target value, a value obtained by subtracting the difference between the generated code amount and the target value from the target value is set as the target value of the next picture. Then, the buffer 5 smoothes the code amount output from the variable length coding device 4 and sends the code amount to the transmission path so as to have a constant transmission rate.

【0011】[0011]

【発明が解決しようとする課題】従来の符号量制御方法
では、発生符号量の目標値と実際の符号発生量に差が生
じた場合、その差を次のピクチャの目標値にフィードバ
ックして補償する。しかし、発生符号量と目標値が大き
くかけ離れた場合、バッファでもその差を吸収できない
可能性がある。
In the conventional code amount control method, when a difference occurs between the target value of the generated code amount and the actual code generation amount, the difference is fed back to the target value of the next picture to compensate. I do. However, if the generated code amount and the target value are far apart, the buffer may not be able to absorb the difference.

【0012】一般に、符号量制御は圧縮パラメータの操
作による制御であるので、このような特性を有するピク
チャを連続してMPEG1方式で符号化すると、符号化
装置は平滑化に失敗する。このとき、上記文献2のp
p.52−53 に記載の「動画バッファ検証器」がオーバー
フローし、MPEG1方式に違反する。
In general, since the code amount control is control by manipulating the compression parameter, if pictures having such characteristics are successively encoded by the MPEG1 system, the encoding apparatus fails in smoothing. At this time, p
The "Movie Buffer Verifier" described on pages 52-53 overflows and violates the MPEG1 system.

【0013】MPEG2方式の場合には、可変ビットレ
ートを用いることにより、かかる問題を回避することが
できるが、通信や放送など、固定ビットレートの符号化
が必要な場合が多い。MPEG2方式の場合でも、固定
ビットレートでこのような特性を有するピクチャを連続
して符号化すると、平滑化に失敗し、上記文献1のp
p.531−535 に記載の「画像バッファ検証器」がオーバ
ーフローし、MPEG2方式に違反する。
In the case of the MPEG2 system, such a problem can be avoided by using a variable bit rate. However, encoding at a fixed bit rate is often required for communication and broadcasting. Even in the case of the MPEG2 system, if pictures having such characteristics are continuously encoded at a fixed bit rate, smoothing fails, and p.
The "image buffer verifier" described on pages 531-535 overflows and violates the MPEG2 system.

【0014】なお、上記の「動画バッファ検証器」と「画
像バッファ検証器」は同じものであって、以下、「画像バ
ッファ検証器」で統一して表記する。「画像バッファ検証
器」とは、受信側のバッファの容量を想定した仮想的な
検証器である。受信側でも、送信側からの符号化動画デ
ータを受信すると、この符号化動画データは1ピクチャ
当りの符号量が多くなったり、少なくなったりしてい
る。かかる符号化動画データを転送レート一定の伝送路
を通して受信側に伝送して連続して復号するためには、
送信側,受信側双方にバッファを持つ必要がある。送信
側で受信側のバッファの容量を仮想し、この仮想容量の
バッファが溢れる(オーバーフローする)ことなく、受
信側が復号処理を行なえるようかどうかを検証するの
が、「画像バッファ検証器」である。
The above-mentioned "moving image buffer verifier" and "image buffer verifier" are the same, and will be hereinafter referred to as "image buffer verifier". The “image buffer verifier” is a virtual verifier that assumes the capacity of the buffer on the receiving side. When the receiving side receives the encoded moving image data from the transmitting side, the encoded moving image data has a larger or smaller code amount per picture. In order to transmit such coded moving image data to the receiving side through a transmission path having a constant transfer rate and continuously decode the data,
It is necessary to have buffers on both the transmitting and receiving sides. The image buffer verifier simulates the capacity of the buffer on the receiving side on the transmitting side and verifies whether the receiving side can perform the decoding process without overflowing (overflowing) the buffer of this virtual capacity. is there.

【0015】ピクチャの平均符号量は伝送路の転送レー
トと同一であるが、ピクチャ間の符号量の偏りが大きい
と、大きな符号量の画像を伝送するためにより多くの時
間を要するため、受信側のバッファの残量を高めに設定
しておくことが必要である。このため、符号量の小さい
画像が連続する区間では、受信側のバッファがオーバー
フローする懸念がある。また、符号量が大きい画像を復
号した直後では、受信側のバッファの残量が減少してい
るため、受信側のバッファがアンダーフローする可能性
がある。このようなオーバーフロー,アンダーフロー
は、MPEG1,2方式の規格に反するものである。
Although the average code amount of a picture is the same as the transfer rate of the transmission path, if the deviation of the code amount between the pictures is large, it takes more time to transmit an image with a large code amount, so that the receiving side It is necessary to set the remaining amount of the buffer higher. For this reason, there is a concern that the buffer on the receiving side may overflow in a section in which images with a small code amount continue. Immediately after decoding an image having a large code amount, the buffer on the receiving side may underflow because the remaining amount of the buffer on the receiving side is reduced. Such overflows and underflows are against the standards of the MPEG1 and MPEG2 systems.

【0016】かかる問題を解決するための方法として、
特開平8−65683号公報などでスタッフィングを用いる方
法が提案されてきた。このスタッフィングとは、ビット
ストリームに挿入することができて復号処理で廃棄され
る符号語を挿入することである。スタッフィングビット
は、復号処理で廃棄されるため、画像に影響を与えるこ
となく、目標値に対する実際の符号量の不足分を充填す
ることができる。
As a method for solving such a problem,
A method using stuffing has been proposed in JP-A-8-65683 and the like. The stuffing is to insert a codeword that can be inserted into a bit stream and discarded in decoding processing. Since the stuffing bits are discarded in the decoding process, the shortage of the actual code amount with respect to the target value can be filled without affecting the image.

【0017】MPEG2方式では、GOPやピクチャ,
スライスの単位でスタッフィングを行なうことが可能で
あり、また、MPEG1方式では、GOPやピクチャ,
スライス,マクロブロックの単位でスタッフィングを行
なうことが可能である。スタッフィングは、マクロブロ
ックやスライスのような小さな画像単位で行なうより
も、ピクチャのような大きな画像単位で行なう方が、画
質の面で有利になる。ピクチャ単位でスタッフィングす
る場合には、個々のマクロブロックの画像の複雑さに応
じて、より自由に個々のマクロブロックに符号量の割り
当てることができるからである。
In the MPEG2 system, GOPs, pictures,
It is possible to perform stuffing in units of slices, and in the MPEG1 system, GOP, picture,
Stuffing can be performed in units of slices and macroblocks. It is more advantageous in terms of image quality to perform stuffing in large image units such as pictures than in small image units such as macroblocks or slices. This is because, when stuffing is performed on a picture basis, the code amount can be more freely assigned to each macroblock according to the complexity of the image of each macroblock.

【0018】しかしながら、ピクチャ単位のスタッフィ
ング処理には、次のような問題がある。
However, the stuffing process for each picture has the following problems.

【0019】ピクチャ単位のスタッフィングは、1ピク
チャ分の符号化を終えて、1ピクチャ分の符号量の集計
を算出してからでないと、実行することができない。動
画を実時間で符号化する場合では、1ピクチャ分の符号
化を終えてから次のピクチャの符号化処理を始めるまで
の期間は、例えば、垂直ブランキング期間のように、極
めて短い期間である。一方、ピクチャ単位でスタッフィ
ングを行なう場合、そのスタッフィング量はかなり大き
くなる可能性がある。従って、極めて短時間に大量のス
タッフィングビットを追加する必要がある。つまり、符
号化装置のバッファ(図4でのバッファ5)に極めて高
い転送レートでビットストリーム(スタッフィングビッ
ト)を書き込む必要がある。ところが、バッファはRA
Mにより構成されているので、入力データの転送レート
が物理的に限られている。
The stuffing on a picture basis cannot be executed until the encoding of one picture is completed and the total of the code amount for one picture is calculated. In the case of encoding a moving image in real time, the period from the end of encoding for one picture to the start of encoding processing of the next picture is an extremely short period, for example, a vertical blanking period. . On the other hand, when stuffing is performed on a picture basis, the stuffing amount may be considerably large. Therefore, it is necessary to add a large amount of stuffing bits in a very short time. That is, it is necessary to write a bit stream (stuffing bits) at a very high transfer rate into the buffer (the buffer 5 in FIG. 4) of the encoding device. However, the buffer is RA
M, the transfer rate of input data is physically limited.

【0020】このような理由から、実時間で符号化を行
なう動画像符号化においては、ピクチャ単位のスタッフ
ィング処理装置を実現するのが困難であった。これが第
1の課題である。
For the above reasons, it has been difficult to realize a stuffing processing apparatus for each picture in moving picture coding which performs coding in real time. This is the first problem.

【0021】また、場合によっては、マクロブロック単
位での符号発生量を厳密に目標値通りにしたい場合もあ
り得る。ところが、MPEG2方式の場合、規格では、
マクロブロック単位でのスタッフィングが定義されてい
ない。従って、MPEG2方式でのマクロブロック単位
の符号量充填を実現することが第2の課題である。
In some cases, it may be desired that the amount of code generation in macroblock units be strictly set to a target value. However, in the case of the MPEG2 system, the standard specifies that
Stuffing in macro block units is not defined. Therefore, realizing filling of the code amount in macroblock units in the MPEG2 system is a second problem.

【0022】さらに、目標値よりも極端に大きな符号量
が発生した場合にも、平滑化に失敗する可能性がある。
従来の符号化装置では、符号量制御の操作対象の圧縮パ
ラメータとして量子化スケールを用いてきた。量子化ス
ケールはMPEG2方式のストリームに付加しなければ
ならない情報であり、上記文献1,2で規定されてい
る。量子化スケールの大きさの上限も規定されており、
それを超えた値を符号化制御に用いることはできない。
量子化前の符号量が極端に大きい場合、量子化スケール
を最大値にしても、符号量が目標値にまで圧縮されない
可能性がある。このよう特性を有するフレームまたはフ
ィールドを連続して符号化すると、符号化装置は平滑化
に失敗する。このとき、「画像バッファ検証器」がアン
ダーフローし、MPEG1方式及びMPEG2方式に違
反する。
Further, even when a code amount extremely larger than the target value occurs, the smoothing may fail.
In a conventional encoding device, a quantization scale has been used as a compression parameter to be operated for code amount control. The quantization scale is information that must be added to the MPEG2 stream, and is specified in the above-mentioned documents 1 and 2. There is also an upper limit for the size of the quantization scale,
Values beyond that cannot be used for coding control.
If the code amount before quantization is extremely large, the code amount may not be compressed to the target value even if the quantization scale is set to the maximum value. If a frame or a field having such characteristics is continuously encoded, the encoding device fails in smoothing. At this time, the "image buffer verifier" underflows, violating the MPEG1 system and the MPEG2 system.

【0023】かかる問題を解決するための方法として、
量子化DCT係数を強制的にカットする方法が、特開平
8−46964号公報や特開平8−65683号公報などで提案され
ている。
As a method for solving such a problem,
A method for forcibly cutting quantized DCT coefficients is disclosed in
It has been proposed in JP-A-8-46964 and JP-A-8-65683.

【0024】特開平8−46964号公報に記載の方法は、1
ピクチャに含まれる全てのマクロブロックの符号化を終
えてから、各マクロブロックに対する目標値を設定し、
改めて、各マクロブロックの目標値よりも小さくなるよ
うに、量子化DCT係数を強制的にカットしていくもの
である。この方法は、1つのピクチャに対する圧縮処理
を2段階で行なうので、動画像を実時間で符号化する際
に用いるのは困難である。
The method described in Japanese Patent Application Laid-Open No. 8-46964
After encoding of all macroblocks included in the picture, set a target value for each macroblock,
Again, the quantized DCT coefficients are forcibly cut so as to be smaller than the target value of each macroblock. Since this method performs compression processing for one picture in two stages, it is difficult to use it when encoding a moving image in real time.

【0025】特開平8−65683号公報に記載の方法は、マ
クロブロック毎に目標値を定め、目標値に応じて量子化
DCT係数をカットする個数を決定してから、各マクロ
ブロックの符号化を進めていくものである。この方法の
問題点は、符号化前に予め量子化DCT係数をカットす
る個数を決定してしまうので、実際の符号量が目標値通
りになるとは限らないことである。つまり、この方法を
用いても、画像バッファ検証器のアンダーフローを完全
に防ぐことができるとは限らないのである。
In the method described in Japanese Patent Application Laid-Open No. 8-65683, a target value is determined for each macroblock, and the number of quantized DCT coefficients to be cut is determined according to the target value. It is something that advances. The problem with this method is that the number of quantized DCT coefficients to be cut is determined in advance before encoding, so that the actual code amount does not always match the target value. That is, even if this method is used, the underflow of the image buffer verifier cannot always be completely prevented.

【0026】このように従来から提案されてきた手法を
用いても、実時間で符号化を行なう動画像符号化におい
ては、画像バッファ検証器のアンダーフローを完全に防
ぐのは困難であった。これが第3の課題である。
As described above, it is difficult to completely prevent the underflow of the image buffer verifier in the moving picture coding in which the coding is performed in real time even by using the method conventionally proposed. This is the third problem.

【0027】本発明の目的は、上記夫々の課題を解決
し、画像バッファ検証器のオーバーフローやアンダーフ
ローを防止して、実時間で動画像の符号化を可能とした
信号処理装置を提供することにある。
An object of the present invention is to provide a signal processing apparatus which solves each of the above-mentioned problems, prevents overflow and underflow of an image buffer verifier, and enables video encoding in real time. It is in.

【0028】[0028]

【課題を解決するための手段】上記第1の課題を解決す
るために、本発明は、符号量の平滑化のためのバッファ
の後段に符号量充填手段を配置する。
In order to solve the above-mentioned first problem, according to the present invention, a code amount filling means is arranged at a subsequent stage of a buffer for smoothing a code amount.

【0029】本発明は、符号化手段が該バッファにビッ
トストリームを書き込む際にスタッフィングコードを挿
入するのではなく、該バッファから画像出力端子にビッ
トストリームを出力する際に、該符号量充填手段によっ
てスタッフィングコードを出力する。これにより、バッ
ファへの転送レートの制約とは関係なく、スタッフィン
グが可能となる。
According to the present invention, the encoding means does not insert a stuffing code when writing a bit stream into the buffer, but outputs the bit stream from the buffer to an image output terminal by using the code amount filling means. Output the stuffing code. This enables stuffing irrespective of the restriction on the transfer rate to the buffer.

【0030】しかし、ビットストリーム中にスタッフィ
ングコードを挿入できる位置は、MPEG1,MPEG
2規格によって定められている。符号化の段階では、ス
タッフィングコードを挿入する位置を判断するのは容易
であるが、ビットストリームの形になって該バッファに
蓄えられた状態では、スタッフィングコードを挿入する
位置を判断するのは容易ではない。
However, the positions where the stuffing code can be inserted into the bit stream are MPEG1, MPEG
It is defined by two standards. At the encoding stage, it is easy to determine the position where the stuffing code is inserted, but in the state of being stored in the buffer in the form of a bit stream, it is easy to determine the position where the stuffing code is inserted. is not.

【0031】そこで、本発明では、符号化手段が符号化
する段階で、スタッフィングコードを挿入すべき位置を
示す符号を、他の符号とは区別でき、かつビットストリ
ーム中で許可されていない符号語(以下、特殊コードと
称す)として該符号化手段からのビットストリームに挿
入するとともに、この特殊コードに続いてスタッフィン
グ量を示す情報(以下、スタッフィング量情報という)
もこのビットストリームに挿入し、該バッファに格納す
る。このように、ビットストリーム中で許可されていな
い符号語を上記のスタッフィングに関する符号として用
いるため、ビットストリームを構成する符号語との区別
が容易であり、スタッフィングすべき位置を容易に検出
できる。
Therefore, in the present invention, at the stage of encoding by the encoding means, the code indicating the position where the stuffing code is to be inserted can be distinguished from other codes, and the codeword which is not permitted in the bit stream. (Hereinafter, referred to as a special code) is inserted into the bit stream from the encoding means, and information indicating the stuffing amount (hereinafter, referred to as stuffing amount information) follows the special code.
Is also inserted into this bit stream and stored in the buffer. As described above, since the codeword that is not permitted in the bitstream is used as the code related to the stuffing, it is easy to distinguish the codeword from the codeword constituting the bitstream, and the position to be stuffed can be easily detected.

【0032】該符号量充填装置は、通常動作中では、該
バッファからビットストリームを読み出して該特殊コー
ドの検出を行ない、該特殊コードが検出されないときに
は、この読み出したビットストリームをそのまま出力端
子から伝送路に出力する通常動作を続行するが、該特殊
コードを検出すると、バッファからのビットストリーム
の読込みを一時停止し、該特殊コードによって示される
量のスタッフィングコードを出力端子から伝送路に出力
する。そして、特殊コードによって示される量のスタッ
フィングコードの出力を終えると、該符号量充填装置
は、該バッファからのビットストリームの読込みを再開
して、通常動作に戻る。
During the normal operation, the code amount filling device reads the bit stream from the buffer and detects the special code, and when the special code is not detected, transmits the read bit stream as it is from the output terminal. The normal operation of outputting to the channel is continued, but when the special code is detected, the reading of the bit stream from the buffer is suspended, and the amount of stuffing code indicated by the special code is output from the output terminal to the transmission line. Then, when the output of the stuffing code of the amount indicated by the special code is completed, the code amount filling apparatus resumes reading the bit stream from the buffer and returns to the normal operation.

【0033】上記第2の課題を解決するために、本発明
は、固定長符号を用いることにより、マクロブロック単
位の符号量を充填するものである。
In order to solve the second problem, the present invention is to fill the code amount in macroblock units by using a fixed length code.

【0034】MPEG1方式及びMPEG2方式では、
量子化DCT係数を符号化するために、可変長符号が定
義されており、この可変長符号とは、発生頻度の多いデ
ータには短い符号長を、発生頻度の少ないデータには長
い符号長を割り当てることにより、全体の符号量を小さ
くすることを目的とした圧縮手法であるが、MPEG2
方式では、量子化DCT係数は2ビットから17ビット
までの可変長符号と24ビットの固定長符号が割り当て
られている。
In the MPEG1 system and the MPEG2 system,
In order to encode the quantized DCT coefficients, a variable length code is defined. The variable length code is a short code length for data with a high frequency of occurrence and a long code length for data with a low frequency of occurrence. This is a compression method aimed at reducing the total code amount by assigning, but MPEG2
In the scheme, the quantized DCT coefficient is assigned a variable length code of 2 to 17 bits and a fixed length code of 24 bits.

【0035】本来、この固定長符号は、可変長符号表で
網羅されていないデータを扱うために使用するものであ
るが、可変長符号が割り当てられているデータを固定長
符号で符号化することに問題はない。そこで、本発明で
は、可変長符号化が可能な量子化DCT係数データを可
変長符号よりもビット長が大きい固定長符号で符号化す
ることにより、マクロブロック単位での符号量の充填を
行なうものである。
Originally, this fixed-length code is used to handle data that is not covered by the variable-length code table. However, data to which the variable-length code is assigned is encoded with the fixed-length code. There is no problem. Accordingly, in the present invention, the coding amount is filled in macroblock units by coding the quantized DCT coefficient data that can be subjected to variable length coding with a fixed length code having a bit length larger than that of the variable length code. It is.

【0036】上記第3の課題を解決するために、本発明
は、目標値決定手段が、ピクチャ単位の目標値とそのピ
クチャ内の符号化済みマクロブロックの符号量集計量か
ら、次に符号化するマクロブロックの符号化後の符号量
の目標値を設定し、符号化手段はマクロブロック毎に目
標値より符号量が小さくなるように符号化する。
In order to solve the third problem, according to the present invention, the target value determining means determines a next encoding value based on a target value for each picture and a total code amount of encoded macroblocks in the picture. The target value of the code amount after coding of the macroblock to be encoded is set, and the coding means performs coding so that the code amount is smaller than the target value for each macroblock.

【0037】具体的には、マクロブロックにおいて、例
えば、ジグザグスキャン順またはオルタネートスキャン
順に夫々の量子化DCT係数を符号化し、量子化DCT
係数が符号化される毎にそこまでの総符号量を監視し
て、この総符号量が該目標値を超えた時点でそれ以降の
量子化DCT係数の符号化を中止し、終了符号(EO
B)を出力してこのマクロブロックでの量子化DCT係
数の符号化を停止する。
More specifically, in a macroblock, for example, each quantized DCT coefficient is encoded in a zigzag scan order or an alternate scan order, and
Every time a coefficient is encoded, the total code amount up to that point is monitored, and when this total code amount exceeds the target value, encoding of the quantized DCT coefficients thereafter is stopped, and the end code (EO
B) is output to stop encoding the quantized DCT coefficients in this macroblock.

【0038】この場合、ジグザグスキャン順またはオル
タネートスキャン順に夫々の量子化DCT係数を符号化
しているので、符号化が途中で停止したときには、高周
波成分が削除されてしまうが、かかる高周波成分は人間
の視覚特性上重要でない場合が多いので、特に画質を劣
化させるものではない。この方法は、動画像を実時間で
符号化する際にも、充分可能な方法であり、かつ、画像
バッファ検証器のアンダーフローを完全に防ぐことがで
きる。
In this case, since the respective quantized DCT coefficients are encoded in the zigzag scan order or the alternate scan order, when the encoding is stopped halfway, the high-frequency components are deleted. In many cases, the visual characteristics are not important, so that the image quality is not particularly deteriorated. This method is sufficiently possible even when encoding a moving image in real time, and can completely prevent underflow of the image buffer verifier.

【0039】[0039]

【発明の実施の形態】以下、本発明の実施形態を図面に
より説明する。図1は本発明による信号処理装置の一実
施形態を示すブロック図であって、9は符号量調整装
置、10,11は符号量充填装置であり、図6に対応す
る部分には同一符号を付けて重複する説明を省略する。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of a signal processing device according to the present invention, wherein 9 is a code amount adjusting device, 10 and 11 are code amount filling devices, and portions corresponding to FIG. A duplicate description will be omitted.

【0040】同図において、スキャン順変換装置3と可
変長符号化装置4との間に符号量調整装置9が、可変長
符号化装置4とバッファ5との間に符号量充填装置10
が、バッファ5と出力端子6との間に符号量充填装置1
1が夫々設けられており、レート制御装置8は、可変長
符号化装置4の出力と符号量集計装置7の集計結果とに
応じて、量子化装置2や符号量調整装置9,符号量充填
装置10を制御する。これ以外の構成は、図6に示した
従来の信号処理装置と同様である。
In the figure, a code amount adjusting device 9 is provided between the scan order conversion device 3 and the variable length coding device 4, and a code amount filling device 10 is provided between the variable length coding device 4 and the buffer 5.
Is the code amount filling device 1 between the buffer 5 and the output terminal 6.
1 are provided, and the rate control device 8 is provided with a quantization device 2, a code amount adjustment device 9, and a code amount filling device in accordance with the output of the variable length coding device 4 and the result of aggregation of the code amount aggregation device 7. The device 10 is controlled. Other configurations are the same as those of the conventional signal processing device shown in FIG.

【0041】かかる構成により、レート制御装置8は、
量子化装置2を制御して量子化スケールの大きさの調節
だけではなく、符号量調整装置9や符号量充填装置1
0,11を制御してピクチャ当りの符号量の調整を直接
行なう。
With such a configuration, the rate control device 8
In addition to controlling the quantization device 2 to adjust the size of the quantization scale, the code amount adjusting device 9 and the code amount filling device 1 are controlled.
By controlling 0 and 11, the code amount per picture is directly adjusted.

【0042】即ち、符号量調整装置9は、スキャン順変
換装置3から量子化DCT係数の列を受け、マクロブロ
ック単位での符号量調整を行なう。この符号量調整とし
ては、レート制御装置8から供給される制御情報を用い
て、スキャン順変換装置3と可変長符号化装置4とを制
御し、符号量の削減と充填とを行なうものである。
That is, the code amount adjustment device 9 receives the sequence of the quantized DCT coefficients from the scan order conversion device 3 and adjusts the code amount in macroblock units. As the code amount adjustment, the scan order conversion device 3 and the variable length coding device 4 are controlled using the control information supplied from the rate control device 8 to reduce and fill the code amount. .

【0043】符号量充填装置10は、MPEG1方式で
は、ピクチャ,スライス,マクロブロック単位で、ま
た、MPEG2方式では、ピクチャ,スライス単位で夫
々符号量の充填(スタッフィング)を行なうものであ
り、レート制御装置8から得られる制御情報を用いて可
変長符号化装置4を制御することにより、符号量を充填
するものである。また、符号量充填装置10は、それ自
身のスタッフィング能力の限界で目標とする符号量全部
のスタッフィングコードの充填を行なうことができない
場合、MPEG1,2方式では規定されない特殊コード
と充填しきれなかった符号量を表わすスタッフィング量
情報とを可変長符号化装置4からのビットストリームに
挿入する。あるいはまた、符号量充填装置10は、スタ
ッフィングコードを充填する代わりに、特殊コードとス
タッフィング量情報だけをビットストリームに挿入する
ようにしてもよい。この場合には、スタッフィング量情
報はピクチャ単位のスタッフィングコードの符号量を表
わしている。
The code amount filling device 10 performs filling (stuffing) of the code amount in picture, slice, and macroblock units in the MPEG1 system, and in the picture and slice units in the MPEG2 system. By controlling the variable length coding device 4 using the control information obtained from the device 8, the code amount is filled. Further, when the code amount filling apparatus 10 cannot fill the stuffing code of the entire target code amount due to the limit of its own stuffing ability, the code amount filling apparatus 10 cannot fully fill the stuffing code with the special code which is not defined by the MPEG1 and MPEG2 systems. The stuffing amount information indicating the code amount is inserted into the bit stream from the variable length coding device 4. Alternatively, instead of filling the stuffing code, the code amount filling apparatus 10 may insert only the special code and the stuffing amount information into the bit stream. In this case, the stuffing amount information indicates the code amount of the stuffing code in picture units.

【0044】符号量充填装置11は、ピクチャ単位での
符号量充填を行なうために用いる。符号量充填装置11
はビットストリームを解析し、符号量充填装置10によ
って挿入された特殊コードを検出してスタッフィング量
情報からスタッフィングコードの充填量を得、この量の
スタッフィングコードをビットストリームに充填する。
この場合、特殊コードとスタッフィング量情報とは廃棄
され、この特殊コードが挿入されていた位置からスタッ
フィングコードが挿入される。これにより、出力端子6
から出力されるビットストリームでは、MPEG1,2
方式では規定されない特殊コードが除かれているから、
MPEG1,2方式を満たしたものとなっている。
The code amount filling device 11 is used for filling the code amount in picture units. Code amount filling device 11
Analyzes the bit stream, detects the special code inserted by the code amount filling device 10, obtains the amount of stuffing code from the stuffing amount information, and fills the bit stream with this amount of stuffing code.
In this case, the special code and the stuffing amount information are discarded, and the stuffing code is inserted from the position where the special code was inserted. Thereby, the output terminal 6
Output from MPEG1, MPEG2
Since special codes not specified in the system have been removed,
It satisfies the MPEG1 and MPEG2 systems.

【0045】ここで、スタッフィングとは、ビットスト
リームに挿入することができ、かつ復号処理で廃棄され
る符号語(スタッフィングコード)を挿入することであ
る。MPEG2方式におけるスタッフィング処理は、上
記文献1のp.392及び上記文献2のp.18にnext_start_
code()関数として定義されている。next_start_code()
関数は、復号中の現在位置をバイト境界の最初のビット
まで進め、開始符号が現れるまでの以後の全てのゼロバ
イトを除去する関数として定義されている。従って、ne
xt_start_code()関数によるスタッフィングは、1バイ
ト単位で行なうことができる。
Here, the stuffing is to insert a code word (stuffing code) that can be inserted into a bit stream and is discarded in decoding processing. The stuffing process in the MPEG2 system is described in next_start_p.
Defined as code () function. next_start_code ()
The function is defined as a function that advances the current position under decoding to the first bit of a byte boundary and removes all zero bytes after the start code. Therefore, ne
The stuffing by the xt_start_code () function can be performed in 1-byte units.

【0046】MPEG2方式では、上記文献1のpp.4
04−418に定義されるように、next_start_code()関数が
次の各レイヤ、即ち、シーケンスヘッダや拡張データ及
びユーザデータ,ユーザデータ,シーケンス拡張,シー
ケンス表示拡張,シーケンススケーラブル拡張,グルー
プオブピクチャヘッダ,ピクチャヘッダ,ピクチャコー
ディング拡張,量子化マトリックス拡張,ピクチャディ
スプレイ拡張,時間スケーラブル画像拡張,空間スケー
ラブル画像拡張,コピーライト拡張,ピクチャデータ,
スライスに含まれている。従って、これらのデータ単位
でスタッフィングが可能である。マクロブロックやマク
ロブロックモード,動きベクトル,符号化ブロックパタ
ーンには next_start_code()関数が含まれておらず、従
って、これらのデータ単位でのスタッフィングは不可能
である。
In the MPEG2 system, pp. 4
As defined in 04-418, the next_start_code () function has the following layers: sequence header, extension data and user data, user data, sequence extension, sequence display extension, sequence scalable extension, group of picture header, Picture header, picture coding extension, quantization matrix extension, picture display extension, temporal scalable image extension, spatial scalable image extension, copyright extension, picture data,
Included in the slice. Therefore, stuffing can be performed in these data units. The macro_block, macroblock mode, motion vector, and coded block pattern do not include a next_start_code () function, and therefore cannot be stuffed in these data units.

【0047】MPEG1方式では、上記文献2のp.22
−24に定義されるように、動画系列レイヤや系列ヘッ
ダ,画像群レイヤ,画像レイヤ,ースライスレイヤにne
xt_start_code()関数が含まれており、これらのデータ
単位でスタッフィングが可能である。MPEG1方式の
マクロブロックレイヤやブロックレイヤにはnext_start
_code()が含まれていないが、マクロブロックレイヤに
は、これとは別のスタッフィングが定義されている。マ
クロブロックレイヤの定義の最初の部分で11ビットの
スタッフィングコードの繰返しによるスタッフィングが
定義されている。従って、MPEG1方式のマクロブロ
ック単位でのスタッフィングは、11ビット単位であ
る。
In the MPEG1 system, p.
As defined in −24, the video sequence layer, sequence header, image group layer, image layer,
An xt_start_code () function is included, and stuffing can be performed on these data units. Next_start for MPEG1 macroblock layer and block layer
Although _code () is not included, another stuffing is defined in the macroblock layer. In the first part of the definition of the macroblock layer, stuffing by repeating an 11-bit stuffing code is defined. Therefore, the stuffing in MPEG1 macroblock units is in 11-bit units.

【0048】スタッフィングコードは、復号処理で廃棄
されるため、スタッフィングコードによって画質が変化
することは全くない。これが、スタッフィングを用いた
符号量充填のメリットである。
Since the stuffing code is discarded in the decoding process, the image quality does not change at all by the stuffing code. This is an advantage of code amount filling using stuffing.

【0049】図2は図1における符号量充填装置10,
11の一具体例を示すブロック図であって、10aはス
タッフィング部、10bは符号量比較部、11aはバッ
ファ部、11bはスタッフィング部、11cは特殊コー
ド検出部であり、図1に対応する部分には同一符号を付
けている。
FIG. 2 shows the code amount filling apparatus 10 in FIG.
11 is a block diagram showing a specific example of 11, where 10a is a stuffing unit, 10b is a code amount comparing unit, 11a is a buffer unit, 11b is a stuffing unit, 11c is a special code detecting unit, and a part corresponding to FIG. Have the same reference numerals.

【0050】同図において、符号量充填装置10はスタ
ッフィング部10aと符号量比較部10bとによって構
成されており、MPEG2方式及びMPEG1方式の場
合、ピクチャ,スライスでは、1バイト単位のスタッフ
ィングを行ない、MPEG1方式の場合には、さらに、
マクロブロック毎に11ビット単位でのスタッフィング
を行なう。
In the figure, the code amount filling device 10 is composed of a stuffing unit 10a and a code amount comparison unit 10b. In the case of the MPEG2 system and the MPEG1 system, stuffing is performed in 1-byte units for pictures and slices. In the case of the MPEG1 system,
Stuffing is performed in 11-bit units for each macro block.

【0051】レート制御装置8がピクチャまたはスライ
スまたはマクロブロックの単位で符号量の下限の目標値
を決定する。符号量比較部10bは、この下限目標値と
符号量集計装置7から得られる実際の符号量(集計値)
とを比較し、この実際の符号量が下限目標値よりも小さ
いときには、可変長符号化装置4とスタッフィング部1
0aを制御してスタッフィング処理を行なう。
The rate control device 8 determines the lower limit target value of the code amount for each picture, slice or macroblock. The code amount comparing unit 10b calculates the lower limit target value and the actual code amount (total value) obtained from the code amount totaling device 7.
When the actual code amount is smaller than the lower limit target value, the variable length coding device 4 and the stuffing unit 1
0a is controlled to perform the stuffing process.

【0052】具体的には、符号量比較部10bは、実際
の符号量が下限目標値よりも小さいときには、可変長符
号化装置4に停止信号を、スタッフィング部10aにス
タッフィング量を指示する情報を夫々供給する。このス
タッフィング量は下限目標値と符号量の差分であり、バ
イト単位となっている。可変長符号化装置4は、この停
止信号を受けると、next_start_code()関数の出力の段
階で処理を停止し、スタッフィング部10aにスタッフ
ィング処理を指示する。スタッフィング部10aは、通
常、可変長符号化装置4から出力されるビットストリー
ムをそのまま出力するが、可変長符号化装置4からスタ
ッフィング処理の指示を受けると、符号量比較部10b
から指示された量のスタッフィングコードを出力する。
以上の動作によりスタッフィングが実現される。
More specifically, when the actual code amount is smaller than the lower limit target value, the code amount comparison unit 10b transmits a stop signal to the variable length coding device 4 and information indicating the stuffing amount to the stuffing unit 10a. Supply each. This stuffing amount is a difference between the lower limit target value and the code amount, and is in byte units. Upon receiving the stop signal, the variable-length encoding device 4 stops the process at the stage of outputting the next_start_code () function, and instructs the stuffing unit 10a to perform the stuffing process. The stuffing unit 10a normally outputs the bit stream output from the variable length coding device 4 as it is, but when receiving a stuffing processing instruction from the variable length coding device 4, the code amount comparing unit 10b
Output the stuffing code of the amount specified by.
The stuffing is realized by the above operation.

【0053】図3(a)はスタッフィング部10aから
出力されるビットストリームを模式的に示したものであ
って、符号化されたピクチャAと次の符号化されたピク
チャBとの間の垂直ブランキング期間に、このピクチャ
Aの符号量と下限目標値との差に相当する量のスタッフ
ィングデータが付加される。
FIG. 3A schematically shows a bit stream output from the stuffing unit 10a, and shows a vertical stream between a coded picture A and the next coded picture B. During the ranking period, an amount of stuffing data corresponding to the difference between the code amount of the picture A and the lower limit target value is added.

【0054】しかし、符号量充填装置10には次のよう
な問題点もある。本発明の動画像圧縮符号化装置は実時
間での符号化を想定しているから、符号化に費やすこと
のできる時間は限られている。スタッフィングはnext_s
tart_code()関数の出力のタイミングでしか行なえない
ので、スタッフィング処理を行なえる期間も、例えば、
垂直ブランキング期間と限られたものとなっている。一
方、バッファ5はRAMにより構成されているので、そ
の入力データの転送レートが限られている。従って、符
号量充填装置10の充填可能な符号量(スタッフィング
コードの符号量)には上限があり、それを超えたスタッ
フィングを行なうことはできない。
However, the code amount filling apparatus 10 has the following problems. Since the moving image compression encoding apparatus of the present invention assumes encoding in real time, the time that can be spent for encoding is limited. Stuffing is next_s
Since it can be performed only at the output timing of the tart_code () function, the period during which the stuffing process can be performed is, for example,
The vertical blanking period is limited. On the other hand, since the buffer 5 is constituted by a RAM, the transfer rate of the input data is limited. Therefore, the code amount that can be filled by the code amount filling device 10 (the code amount of the stuffing code) has an upper limit, and stuffing exceeding the upper limit cannot be performed.

【0055】このような問題を解決するために、この実
施形態では、符号量充填装置10のスタッフィング能力
を超えた分は、あるいは符号量充填装置10のスタッフ
ィング能力を超えたときには、符号量充填装置11によ
って符号量充填(スタッフィング)を行なうものであ
る。
In order to solve such a problem, in this embodiment, when the stuffing capability of the code amount filling device 10 is exceeded or when the stuffing capability of the code amount filling device 10 is exceeded, the code amount filling device 10 is used. 11 performs code amount filling (stuffing).

【0056】このために、符号量充填装置10は、符号
量比較部10bから指示されるスタッフィング量がその
スタッフィング能力を越えているときには、符号量充填
装置11でスタッフィング処理を行なうのに必要な情報
を、ビットストリーム中での他の符号とは区別できて、
かつビットストリーム中で許可されていない符号(即
ち、特殊コード)として、ビットストリームに挿入する
とともに、この特殊コードに続いて挿入すべきスタッフ
ィング量を示す情報(即ち、スタッフィング量情報)も
このビットストリームに挿入する。この特殊コードとし
ては、例えば、MPEG1及びMPEG2方式で定義さ
れている「予約」符号を用いる。この「予約」とは、その
値が、将来、拡張されて使用され得ることを示すもので
ある。この特殊コードは符号量充填装置10と符号量充
填装置11との間で一時的に使用されるものであり、符
号量充填装置11によって廃棄される。
For this reason, when the stuffing amount specified by the code amount comparing section 10b exceeds the stuffing ability, the code amount filling device 10 provides information necessary for the code amount filling device 11 to perform the stuffing process. Can be distinguished from other codes in the bitstream,
In addition, information indicating a stuffing amount to be inserted following the special code (ie, stuffing amount information) is inserted into the bit stream as a code not permitted in the bit stream (ie, special code). Insert As the special code, for example, a “reserved” code defined in the MPEG1 and MPEG2 system is used. The “reservation” indicates that the value can be extended and used in the future. This special code is used temporarily between the code amount filling device 10 and the code amount filling device 11, and is discarded by the code amount filling device 11.

【0057】図3(b)は、符号量比較部10bから指
示されるスタッフィング量がそのバッファ5のスタッフ
ィング能力を越えているときのスタッフィング部10a
から出力されるビットストリームの一具体例を模式的に
示したものであって、符号化されたピクチャAと次の符
号化されたピクチャBとの間の垂直ブランキング期間
に、このピクチャAの符号量と下限目標値との差に相当
する量の一部のスタッフィングコードと、この差の残り
の量を示す特殊データとスタッフィング量情報とが付加
されている場合を示している。
FIG. 3B shows the stuffing unit 10a when the stuffing amount specified by the code amount comparing unit 10b exceeds the stuffing capability of the buffer 5.
1 schematically shows a specific example of a bit stream output from a picture A. In a vertical blanking period between an encoded picture A and a next encoded picture B, This figure shows a case where a part of the stuffing code corresponding to the difference between the code amount and the lower limit target value, special data indicating the remaining amount of the difference, and stuffing amount information are added.

【0058】また、図3(c)は、同じく符号量比較部
10bから指示されるスタッフィング量がそのバッファ
5のスタッフィング能力を越えているときのスタッフィ
ング部10aから出力されるビットストリームの他の具
体例を模式的に示したものであって、符号化されたピク
チャAと次の符号化されたピクチャBとの間の垂直ブラ
ンキング期間に、指示された全スタッフィング量に対す
る特殊データとスタッフィング量情報とが付加されてい
る場合を示している。
FIG. 3C shows another specific example of the bit stream output from the stuffing unit 10a when the stuffing amount specified by the code amount comparing unit 10b exceeds the stuffing capability of the buffer 5. FIG. 4 schematically shows an example, in a vertical blanking period between a coded picture A and a next coded picture B, special data and stuffing quantity information for all designated stuffing quantities. And the case where "." Is added.

【0059】符号量充填装置10は可変長符号化装置4
に直接接続されているため、スタッフィング処理のタイ
ミングは可変長符号化装置4によって直接指示すること
ができる。それに対し、符号量充填装置11はバッファ
5を介して可変長符号化装置4に接続されているので、
スタッフィング処理のタイミングを可変長符号化装置4
から直接得ることはできない。特殊コードは、符号量充
填装置11におけるスタッフィング処理のタイミング制
御を容易にすることを目的として、バッファ5から出力
されるビットストリーム中のスタッフィングコードを挿
入すべき位置に挿入されるのである。
The code amount filling device 10 is a variable length coding device 4
, The timing of the stuffing process can be directly instructed by the variable-length coding device 4. On the other hand, since the code amount filling device 11 is connected to the variable length coding device 4 via the buffer 5,
The stuffing processing timing is changed by the variable length coding device 4
Cannot be obtained directly from The special code is inserted at the position where the stuffing code is to be inserted in the bit stream output from the buffer 5 for the purpose of facilitating the timing control of the stuffing process in the code amount filling device 11.

【0060】特殊コードに続いてスタッフィング量情報
が、固定長符号として、ビットストリームに付加されて
スタッフィング部10aから出力される。符号量充填装
置11はバッファ5からビットストリームを読み出し、
このビットストリームから特殊コードを検出する。
Following the special code, the stuffing amount information is added to the bit stream as a fixed length code and output from the stuffing unit 10a. The code amount filling device 11 reads the bit stream from the buffer 5,
The special code is detected from this bit stream.

【0061】バッファ5は、大きな記憶容量を必要とす
るため、DRAMやSDRAMによって構成される。D
RAMやSDRAMは、まとまった量のデータを連続し
て読み出す動作(即ち、バースト読出し)を高速に処理
することができる。バッファ5は、高速な動作が要求さ
れるために、DRAMやSDRAMを用いてバースト読
出し動作を採用している。
Since the buffer 5 requires a large storage capacity, it is constituted by a DRAM or an SDRAM. D
The RAM and the SDRAM can process an operation of continuously reading a large amount of data (ie, a burst read) at a high speed. Since a high-speed operation is required, the buffer 5 employs a burst read operation using a DRAM or an SDRAM.

【0062】符号量充填装置11はビットストリームを
まとまったデータ単位で読み出さなければならず、符号
量充填装置11での特殊コードの検出動作及びスタッフ
ィング処理を容易にするために、符号量充填装置10は
ビットストリームでの特殊コードでの挿入位置を調整す
る。例えば、特殊コードの挿入位置としては、バースト
読出し処理するデータのまとまりの先頭とする(例え
ば、符号量充填装置11の後述する特殊コード検出部1
1cがデータのまとまりとして4バイト単位で処理をす
る場合、特殊コード検出部11cがこの特殊コードを検
出し易い4バイト単位の先頭に位置付ける)。このよう
にすることにより、特殊コード検出部11cが作りやす
くなるというような効果も得られる。特殊コードの挿入
位置(即ち、符号量充填装置11でのスタッフィングコ
ードの挿入開始位置)は、符号量充填装置10が、図3
(b)で示すように、一部のスタッフィングコードを付
加する場合には、このスタッフィングコードの次に特殊
コードが位置するように調整する。
The code amount filling device 11 must read out a bit stream in a unit of data. In order to facilitate the special code detecting operation and the stuffing process in the code amount filling device 11, the code amount filling device 10 Adjusts the insertion position of the special code in the bit stream. For example, the insertion position of the special code is set at the head of a group of data to be subjected to the burst read processing (for example, a special code detection unit 1 described later of the code amount filling apparatus 11).
When 1c processes data as a unit of data in units of 4 bytes, the special code detection unit 11c positions the special code at the head of the unit of 4 bytes where detection is easy. By doing so, there is also obtained an effect that the special code detecting unit 11c is easily made. The insertion position of the special code (that is, the insertion start position of the stuffing code in the code amount filling device 11) is determined by the code amount filling device 10 in FIG.
As shown in (b), when a part of the stuffing code is added, the adjustment is performed so that the special code is located next to the stuffing code.

【0063】次に、図2に示す符号量充填装置11につ
いて説明する。
Next, the code amount filling device 11 shown in FIG. 2 will be described.

【0064】符号量充填装置11はバッファ部11a,
スタッフィング部11b及び特殊コード検出部11cに
よって構成され、ピクチャ単位でmバイト(但し、mは
1以上の整数)のスタッフィングを行なう。
The code amount filling device 11 includes a buffer unit 11a,
The stuffing unit 11b and the special code detecting unit 11c perform stuffing of m bytes (where m is an integer of 1 or more) in picture units.

【0065】バッファ部11aとスタッフィング部11
bとは、特殊コード検出部11cによって制御される。
バッファ5から出力されたビットストリームは、一旦バ
ッファ部11aに蓄えられ、また、特殊コード検出部1
1cに供給されて符号量充填装置10によって挿入され
た特殊コードとスタッフィング量情報との検出を行な
う。特殊コードは、バッファ5からのバースト読出し動
作によって読み出されてくる連続するデータ群の先頭の
位置に存在することが約束されているから、特殊コード
の検出もそこを調べるだけで済む。
Buffer section 11a and stuffing section 11
b is controlled by the special code detecting unit 11c.
The bit stream output from the buffer 5 is temporarily stored in the buffer unit 11a, and is stored in the special code detection unit 1a.
The special code and the stuffing amount information supplied to 1c and inserted by the code amount filling device 10 are detected. Since it is promised that the special code exists at the head position of a continuous data group read by the burst read operation from the buffer 5, the detection of the special code only needs to be checked.

【0066】特殊コード検出部11cは、供給されるビ
ットストリームから特殊コードを検出しないときには、
バッファ部11aにビットストリームの出力の許可を出
し、スタッフィング部11bにこのビットストリームを
選択して出力することを指示するが、特殊コードを検出
すると、これに続くスタッフィング量情報を検出すると
ともに、バッファ部11aにビットストリームの出力動
作停止を指示し、また、スタッフィング部11bにスタ
ッフィングコードの選択を指示して、この特殊コードに
続いて検出するスタッフィング量情報で指示される量の
スタッフィング量を示す情報をスタッフィング部11b
に供給する。
When no special code is detected from the supplied bit stream, the special code detecting unit 11c
The output of the bit stream is permitted to the buffer unit 11a, and the stuffing unit 11b is instructed to select and output the bit stream. When the special code is detected, the stuffing amount information following the special code is detected, and the buffer is detected. The stuffing unit 11a instructs the unit 11a to stop the output operation of the bit stream, and instructs the stuffing unit 11b to select the stuffing code, and indicates the stuffing amount indicated by the stuffing amount information detected following the special code. The staffing section 11b
To supply.

【0067】そこで、バッファ部11aは、特殊コード
検出部11cからビットストリームの出力許可の指示を
受けると、それ自身が保持しているビットストリームを
出力し、また、特殊コード検出部11cからビットスト
リームの出力動作停止の指示を受けると、ビットストリ
ームの出力を停止する。スタッフィング部11bは、特
殊コード検出部11cからビットストリーム選択の指示
を受けると、バッファ部11aが出力するビットストリ
ームをそのまま出力端子6に出力するが、特殊コード検
出部11cからスタッフィングコードの選択指示を受け
ると、特殊コード検出部11cから供給されるスタッフ
ィング量を示す情報で指示された量のスタッフィングコ
ードを出力端子6に出力する。
When the buffer unit 11a receives a bit stream output instruction from the special code detection unit 11c, the buffer unit 11a outputs the bit stream held by itself, and outputs the bit stream from the special code detection unit 11c. When the instruction to stop the output operation is received, the output of the bit stream is stopped. Upon receiving the bit stream selection instruction from the special code detection unit 11c, the stuffing unit 11b outputs the bit stream output from the buffer unit 11a to the output terminal 6 as it is, but issues a stuffing code selection instruction from the special code detection unit 11c. Upon receiving the stuffing code, the stuffing code of the amount indicated by the information indicating the stuffing amount supplied from the special code detecting unit 11c is output to the output terminal 6.

【0068】図3(d)はスタッフィング部11bから
出力されるビットストリームのスタッフィングコードが
挿入されている部分を模式的に示したものであって、図
3(b)または図3(c)に示すビットストリームから
得られるものである。
FIG. 3D schematically shows a portion of the bit stream output from the stuffing section 11b into which the stuffing code is inserted, and FIG. 3B or FIG. From the indicated bit stream.

【0069】以上の動作により、可変長符号化装置4か
らの符号量が下限目標値よりも小さい場合、符号量充填
装置10のスタッフィング能力を越えるスタッフィング
量のスタッフィングコードを必要としても、画像バッフ
ァ検証器をオーバーフローさせずに、スタッフィングを
行なうことができる。
With the above operation, when the code amount from the variable length coding device 4 is smaller than the lower limit target value, even if a stuffing code having a stuffing amount exceeding the stuffing ability of the code amount filling device 10 is required, the image buffer verification is performed. The stuffing can be performed without overflowing the vessel.

【0070】図4は図1における符号量調整装置9の一
具体例を示すブロック図であって、9aは係数付加部、
9bは非零成分計数部、9cは符号量比較部であり、図
1に対応する部分には同一符号を付けている。
FIG. 4 is a block diagram showing a specific example of the code amount adjusting device 9 shown in FIG.
9b is a non-zero component counting section, 9c is a code amount comparing section, and portions corresponding to FIG. 1 are denoted by the same reference numerals.

【0071】同図において、符号量調整装置9は、マク
ロブロック単位で符号量の削減や充填を行なうものであ
り、係数付加部9aや非零成分計数部9b,符号量比較
部9cによって構成されている。係数付加部9aは、量
子化装置2によって量子化されたブロック(8×8画
素)でのDCT係数(以下、量子化DCT係数という)
の非零成分に1を付加するものである。非零成分計数部
9bは、1ブロック内における量子化DCT係数の非零
成分の個数を計数するものである。符号量比較部9cは
レート制御装置8から得られるマクロブロック単位の下
限目標値及び上限目標値と可変長符号化装置4から得ら
れる符号量とを比較し、非零成分計数部9bから得られ
る非零成分の個数を基に、その比較結果に応じてスキャ
ン順変換装置3と係数付加部9aと可変長符号化装置4
とを制御するものである。
In the figure, a code amount adjusting device 9 reduces or fills a code amount in macroblock units, and comprises a coefficient adding unit 9a, a non-zero component counting unit 9b, and a code amount comparing unit 9c. ing. The coefficient adding unit 9a is a DCT coefficient (hereinafter referred to as a quantized DCT coefficient) in a block (8 × 8 pixels) quantized by the quantization device 2.
Is added to the non-zero component of. The non-zero component counting section 9b counts the number of non-zero components of the quantized DCT coefficient in one block. The code amount comparing section 9c compares the lower limit target value and the upper limit target value in macroblock units obtained from the rate control device 8 with the code amount obtained from the variable length coding device 4, and is obtained from the non-zero component counting section 9b. On the basis of the number of non-zero components, the scan order converter 3, the coefficient adding unit 9a, and the variable-length encoder 4
Is to be controlled.

【0072】次に、この符号量調整装置9の動作につい
て説明する。
Next, the operation of the code amount adjusting device 9 will be described.

【0073】スキャン順変換装置3からの量子化DCT
係数を符号化するに際しては、符号量比較部9cは、レ
ート制御装置8からマクロブロック毎に上限目標値と下
限目標値とを受け取り、これらをマクロブロック内の各
ブロックに割り振る。4:2:0フォーマットの画像のマ
クロブロックでは、4個の輝度信号(Y)ブロックと1個
の色差信号(Cb)ブロックと1個の色差信号(Cr)ブロ
ックとの計6ブロックがあり、レート制御装置8からの
上限目標値に応じて、これら6個のブロックに夫々上限
目標値,下限目標値を割り当てる。その割り当て方法と
して種々考えられるが、その一具体例を図5により、上
限目標値を例にして説明する。
Quantized DCT from scan order converter 3
When coding the coefficients, the code amount comparison unit 9c receives the upper target value and the lower target value for each macroblock from the rate control device 8, and allocates these to each block in the macroblock. In the macro block of the image of the 4: 2: 0 format, there are a total of six blocks of four luminance signal (Y) blocks, one color difference signal (Cb) block and one color difference signal (Cr) block. An upper target value and a lower target value are assigned to these six blocks, respectively, according to the upper target value from the rate controller 8. There are various possible allocation methods, and a specific example will be described with reference to FIG. 5 using an upper limit target value as an example.

【0074】同図において、この具体例では、4個のY
ブロックを、図示するように、夫々Y1,Y2,Y3,Y
4ブロックとすると、Y1,Y2,Y3,Y4,Cb,Cr
の順に符号化しながら上限目標値を割り当てるものであ
る。
In this example, in this specific example, four Y
The blocks are represented by Y1, Y2, Y3, Y
If there are four blocks, Y1, Y2, Y3, Y4, Cb, Cr
And assigns the upper limit target value while encoding in the order of.

【0075】いま、レート制御装置8から符号化しよう
とする当該マクロブロックに割り当てられる上限目標値
をM1とすると、まず、図5(a)に示すように、この上
限目標値M1の1/4の値M1/4をY1ブロックの上限目
標値として割り当てる。可変長符号化装置4はスキャン
順変換装置3から係数付加部9aを介して供給されるY
1ブロックの量子化DCT係数を順次符号化していく
が、1つの量子化DCT係数が符号化される毎に(零の
量子化DCT係数が続く場合には、それが続いた個数を
示す符号が得られる毎に)、Y1ブロックでのこれまで
符号化された量子化DCT係数の累積符号量が検出され
て符号量比較部9cに供給され、この累積符号量とこの
Y1ブロックに割り当てられた上限目標値M1/4と比較
される。
[0075] Now, when the upper limit target value assigned to the macroblock to be encoded from the rate control unit 8 and M 1, first, as shown in FIG. 5 (a), 1 of the upper limit target value M 1 / assign a value of 4 M 1/4 as the upper limit target value of the Y1 block. The variable-length encoding device 4 receives Y from the scan order conversion device 3 via the coefficient adding unit 9a.
One block of quantized DCT coefficients is sequentially encoded. Each time one quantized DCT coefficient is encoded (when a zero quantized DCT coefficient continues, a code indicating the number of successive zero DCT coefficients is added). Every time it is obtained), the accumulated code amount of the quantized DCT coefficient encoded so far in the Y1 block is detected and supplied to the code amount comparison unit 9c, and the accumulated code amount and the upper limit assigned to the Y1 block are calculated. It is compared with the target value M 1/4.

【0076】Y1ブロックの全ての量子化DCT係数の
符号化が終了し、このときの累積符号量(Y1ブロック
の実際の符号量)をN1とし、N1<M1/4であるときに
は、図5(b)に示すように、M2=M1−N1なる値の1/
4、即ち、M2/4を次に符号化するY2ブロックの上限
目標値とする。そして、このY2ブロックでの符号化処
理を行ない、このときの累積符号量とこの上限目標値M
2/4とを比較する。
[0076] encoding is completed for all the quantized DCT coefficients of the Y1 block, the (actual code amount of the Y1 block) accumulated code amount at this time as N 1, when it is N 1 <M 1/4, the As shown in FIG. 5B, the value of M 2 = M 1 −N 1 is 1 /
4, i.e., the upper limit target value for Y2 block which then encode the M 2/4. Then, the encoding process in this Y2 block is performed, and the accumulated code amount at this time and the upper limit target value M
It is compared with the 2/4.

【0077】以下、同様にして、Y2ブロックの実際の
符号量をN2とすると、図5(c)に示すように、M3
2−N2として、M3/2をY3ブロックの上限値として
割り当て、Y3ブロックの実際の符号量をN3とする
と、次に、図5(d)に示すように、M4=M3−N3
して、M4/2をY4ブロックの上限値として割り当て、
Y4ブロックの実際の符号量をN4とすると、次に、図
5(e)に示すように、M5=M4−N4として、M5/2
をCbブロックの上限値として割り当て、Cbブロック
の実際の符号量をN5とすると、次に、図5(f)に示す
ように、M5−N5をCrブロックの上限値として割り当
てる。
[0077] In the same manner, the actual code amount of the Y2 block When N 2, as shown in FIG. 5 (c), M 3 =
As M 2 -N 2, assigned to M 3/2 as the upper limit of Y3 block, when the actual code amount of the Y3 block and N 3, then, as shown in FIG. 5 (d), M 4 = M as 3 -N 3, assigned to M 4/2 as the upper limit of Y4 block,
If the actual code amount of Y4 block and N 4, then, as shown in FIG. 5 (e), as M 5 = M 4 -N 4, M 5/2
Assignment as the upper limit of Cb blocks and the actual code amount of the Cb block and N 5, then, as shown in FIG. 5 (f), assigning the M 5 -N 5 as the upper limit of Cr blocks.

【0078】以上は上限目標値についてであったが、下
限目標値の割り当てについても同様である。
Although the above description is for the upper target value, the same applies to the assignment of the lower target value.

【0079】このようにして、最初に符号化する輝度信
号ブロックにレート制御装置8から与えられる上限目標
値M1の1/4を割り当て、残りの3個の輝度信号ブロッ
クには、この上限値M1からその前に符号化した輝度信
号ブロックでの実際の符号量を順次差し引いた値の1/
4または1/2を上限目標値として夫々に割り当て、色
差信号ブロックについては、上記の上限目標値M1から
4個の輝度信号ブロックの符号量を引いた残りの値を1
/2にして割り当てるものであるから、各ブロックに対
して割り当てる上限値は引き算と1/2,1/4の乗算と
で求めることができ、かかる乗算はビットシフトによっ
て行なうことができるので、演算回路の回路構成を小規
模とすることができる。
In this way, 1/4 of the upper limit target value M 1 given from the rate control device 8 is assigned to the luminance signal block to be encoded first, and the upper limit value is assigned to the remaining three luminance signal blocks. 1 / of the value obtained by sequentially subtracting the actual code amount in the previously encoded luminance signal block from M 1
4 or と し て is assigned as an upper limit target value, and the remaining value obtained by subtracting the code amount of the four luminance signal blocks from the upper limit target value M 1 is 1 for the color difference signal block.
Therefore, the upper limit value to be assigned to each block can be obtained by subtraction and multiplication by 1/2, 1/4, and such multiplication can be performed by bit shift. The circuit configuration of the circuit can be reduced in scale.

【0080】また、この割り当て方法によると、輝度信
号に目標値が多く割り当てられることになる。このこと
は、情報量が大きい輝度信号の方に多くの符号量が割り
当てられることになって人間の視覚特性上有利となる。
Further, according to this allocation method, many target values are allocated to the luminance signal. This means that a larger amount of code is allocated to a luminance signal having a larger amount of information, which is advantageous in human visual characteristics.

【0081】次に、符号量調整装置9の動作として、ま
ず、符号量の削減の動作について説明するが、この場
合、符号量調整装置9は符号量削減手段として量子化D
CT係数の削除を行なう。
Next, as the operation of the code amount adjusting device 9, the operation of reducing the code amount will be described first. In this case, the code amount adjusting device 9 uses the quantization D as the code amount reducing means.
The CT coefficient is deleted.

【0082】いま、スキャン順変換装置3からあるブロ
ックの量子化DCT係数が順序が変換されて周波数が低
い係数順に読み出され始めると、これら量子化DCT係
数が係数付加部9aを介して可変長符号化装置4に供給
され、可変長符号でもって符号化される(但し、零の量
子化DCT係数に対しては、その連続する個数を表わす
可変長符号に符号化される)。可変長符号化装置4は、
また、量子化DCT係数を符号化する毎に、そのブロッ
クの既に符号化した量子化DCT係数の累積符号量を求
めている。符号量比較部9cは、このブロックに上記の
ようにして割り当てられた上限目標値と可変長符号化装
置4で得られるこのブロックでの累積符号量とを常時比
較しており、この累積符号量がこの上限目標値に達しな
いときには、可変長符号化装置4にスキャン順変換装置
3から量子化DCT係数を読み取って符号化する処理動
作を継続させるが、この累積符号量がこの上限目標値を
越えると、スキャン順変換装置3の動作を停止させてこ
のブロックのその時点以降の量子化DCT係数の読出し
を禁止して0を出力させ、また、可変長符号化装置4の
動作も停止させる。この場合、可変長符号化装置4は、
累積符号量が上限目標値を越えたときの量子化DCT係
数の符号も出力しない。
Now, when the quantized DCT coefficients of a certain block are converted from the scan order transforming device 3 and are read out in order of the coefficients having the lower frequencies, the quantized DCT coefficients are changed in variable length via the coefficient adding section 9a. It is supplied to the encoding device 4 and encoded with a variable length code (however, a zero quantized DCT coefficient is encoded into a variable length code representing the continuous number thereof). The variable length coding device 4
Further, every time the quantized DCT coefficient is encoded, the accumulated code amount of the already encoded quantized DCT coefficient of the block is obtained. The code amount comparing unit 9c constantly compares the upper limit target value assigned to this block as described above with the cumulative code amount in this block obtained by the variable length coding device 4, and this cumulative code amount Does not reach the upper limit target value, the variable-length encoder 4 continues the processing operation of reading and coding the quantized DCT coefficients from the scan order converter 3, and the accumulated code amount becomes equal to the upper limit target value. If it exceeds, the operation of the scan order conversion device 3 is stopped, the reading of the quantized DCT coefficient after this point in this block is prohibited, 0 is output, and the operation of the variable length coding device 4 is also stopped. In this case, the variable length coding device 4
The code of the quantized DCT coefficient when the accumulated code amount exceeds the upper limit target value is not output.

【0083】このようにして、スキャン順変換装置3か
らのブロックでの符号量がこのブロックに割り当てられ
た上限目標値を越える場合には、この上限目標値以下の
符号量に制限されるように符号化されることになり、過
剰な符号量の削減が行なわれる。
As described above, when the code amount of the block from the scan order conversion device 3 exceeds the upper limit target value assigned to this block, the code amount is limited to the upper limit target value or less. The encoding is performed, and an excessive amount of code is reduced.

【0084】なお、かかる符号量の削減処理を行なう場
合、削減される量子化DCT係数は視覚上目立たない高
周波成分であるから、これによる画質の劣化を回避する
ことが可能であり、人間の視覚特性上有利になる。
When such code amount reduction processing is performed, since the reduced quantized DCT coefficient is a high-frequency component that is inconspicuous visually, it is possible to avoid deterioration of the image quality due to this, and it is possible to prevent human vision. This is advantageous in characteristics.

【0085】次に、符号量調整装置9の動作として、符
号量の充填動作について説明するが、この場合には、符
号量充填方法として、固定長符号化・可変長符号化の切
替え及び量子化DCT係数の強制付加を用いる。
Next, a description will be given of a code amount filling operation as an operation of the code amount adjusting device 9. In this case, as a code amount filling method, switching between fixed length coding / variable length coding and quantization are performed. Forced addition of DCT coefficients is used.

【0086】可変長符号とは、発生頻度の多いデータに
は短い符号長を、また、発生頻度の少ないデータには長
い符号長を夫々割り当てるものであり、これにより、全
体の符号量を小さくすることを目的とした圧縮手法であ
る。MPEG2方式では、量子化DCT係数に対して2
ビットから17ビットまでの可変長符号と24ビットの
固定長符号が割り当てられている。本来、固定長符号
は、可変長符号表で網羅されていないデータを扱うため
に使用するものであるが、可変長符号が割り当てられて
いるデータを固定長符号で符号化することに問題はな
い。本発明では、可変長符号化が可能な量子化DCT係
数データを固定長符号化することにより、符号量の充填
を行なうものである。
The variable-length code assigns a short code length to data with a high frequency of occurrence and a long code length to data with a low frequency of occurrence, thereby reducing the overall code amount. This is a compression method for the purpose. In the MPEG2 system, 2 for the quantized DCT coefficient
A variable length code from bits to 17 bits and a fixed length code of 24 bits are allocated. Originally, the fixed-length code is used to handle data that is not covered by the variable-length code table, but there is no problem in encoding the data to which the variable-length code is assigned with the fixed-length code. . In the present invention, the code amount is filled by performing fixed-length coding on quantized DCT coefficient data that can be subjected to variable-length coding.

【0087】ところが、MPEG2方式では、レベル0
の量子化DCT係数の固定長符号は禁止されている。非
零成分の(即ち、零でない)量子化DCT係数が少ない
と、全ての非零成分を固定長符号化しても、符号量が下
限目標値に達しないことがあり得る。このような場合に
は、零成分の(即ち、零の)量子化DCT係数に順に微
弱な信号とする値1を付加して固定長符号化する。この
ような微弱な信号を付加しても、人間の視覚特性上の画
質劣化は小さい。また、この値1を付加する手段が、符
号量調整装置9での係数付加部9aである。
However, in the MPEG2 system, level 0
The fixed-length code of the quantized DCT coefficient is prohibited. If the quantized DCT coefficients of the non-zero components (that is, non-zero) are small, the code amount may not reach the lower limit target value even if all non-zero components are fixed-length coded. In such a case, fixed-length encoding is performed by sequentially adding a value 1 as a weak signal to quantized DCT coefficients of zero components (that is, zero). Even if such a weak signal is added, the image quality deterioration in human visual characteristics is small. The means for adding the value 1 is the coefficient adding unit 9a in the code amount adjusting device 9.

【0088】先の符号量の削減動作のときと同様に、可
変長符号化装置4が量子化DCT係数を符号化してその
ときのブロックでの累積符号量を求め、符号量比較部9
cはこのブロックに割り当てられた下限目標値とこの累
積符号量とを比較する。また、このとき、非零成分計数
部9bは量子化装置2から出力される量子化DCT係数
の非零成分を計数する。符号量比較部9cは、この非零
成分の計数数と累積符号量とから、固定長符号化すべき
量子化DCT係数の個数と量子化DCT係数の付加をす
べき個数とを見積もり、その結果から固定長符号化とす
るか、可変長符号化するかの判断と量子化DCT係数の
付加の判断を行なう。具体的には、以下のアルゴリズム
に従って判断する。
As in the case of the code amount reduction operation, the variable length coding device 4 codes the quantized DCT coefficients to obtain the accumulated code amount in the block at that time, and the code amount comparison unit 9
c compares the lower limit target value assigned to this block with this accumulated code amount. At this time, the non-zero component counting unit 9b counts the non-zero components of the quantized DCT coefficients output from the quantization device 2. The code amount comparing unit 9c estimates the number of quantized DCT coefficients to be fixed-length coded and the number to be added with quantized DCT coefficients from the count number of the non-zero component and the accumulated code amount, and from the result, A determination is made as to whether to perform fixed-length coding or variable-length coding, and to determine whether to add a quantized DCT coefficient. Specifically, the determination is made according to the following algorithm.

【0089】即ち、符号化する当該ブロックに割り当て
られた下限目標値をT、非零成分計数部9bによる非零
成分の計数値をn、固定長符号長をfとし(MPEG2
の場合、f=24)、可変長符号化装置4から量子化D
CT係数が符号化される毎に出力されてくる当該ブロッ
クの累積符号量をs、量子化装置2から出力される量子
化DCT係数の現在の非零成分の番号をi(i=1〜
n)、量子化DCT係数の現在の零成分の番号をk(k=
1〜64−n)とすると、可変長符号とするか、固定長
符号とするかの判断と量子化DCT計数の付加の判断は
以下の判定式によってて行なう。s+f×(n−i)>T
のとき、可変長符号化し、f×(n+k)<Tのとき、量
子化DCT係数の付加を行なう この演算には乗算が含まれるが、固定符号長fが固定値
であるので、小規模なテーブル引き回路により実現でき
る。
That is, T is the lower limit target value assigned to the block to be encoded, n is the count value of the non-zero component by the non-zero component counting unit 9b, and f is the fixed-length code length (MPEG2
In the case of f = 24), the quantization length D
The accumulated code amount of the block output every time the CT coefficient is encoded is s, and the number of the current non-zero component of the quantized DCT coefficient output from the quantization device 2 is i (i = 1 to 1).
n), the number of the current zero component of the quantized DCT coefficient is k (k =
1-64-n), the determination as to whether to use a variable-length code or a fixed-length code and the addition of a quantized DCT count are made according to the following determination formula. s + f × (ni)> T
When f × (n + k) <T, add a quantized DCT coefficient when f × (n + k) <T This operation includes multiplication, but since the fixed code length f is a fixed value, It can be realized by a table drawing circuit.

【0090】符号量比較部9cは、この可変長符号化す
るか、固定長符号化するかの判断結果を可変長符号化装
置4に供給し、可変長符号化装置4は、この判断結果に
従って、可変長符号化と判断されたときには、供給され
る量子化DCT係数を2〜17ビットの可変長符号に符
号化し、固定長符号かと判断されたときには、供給され
る量子化DCT係数を24ビットの固定長符号に符号化
する。このようにして、このブロックでの符号量が増加
する。
The code amount comparing section 9c supplies the variable length coding device 4 with the result of the determination whether to perform the variable length coding or the fixed length coding, and the variable length coding device 4 according to the determination result. When it is determined that the variable-length encoding is performed, the supplied quantized DCT coefficient is encoded into a variable-length code of 2 to 17 bits. To a fixed-length code of Thus, the code amount in this block increases.

【0091】また、符号量比較部9cが量子化DCT係
数の付加と判断したときには、その判断結果が係数付加
部9aに供給される。係数付加部9aは、符号量比較部
9cから量子化DCT係数の付加の指示を受けていない
ときには、スキャン順変換装置3からの量子化DCT係
数をそのまま可変長符号化装置4に供給するが、符号量
比較部9cから量子化DCT係数の付加の指示を受け
と、スキャン順変換装置3からの量子化DCT係数の零
成分の代わりに、値1の微弱な信号を量子化DCT係数
として可変長符号化装置4に供給する。可変長符号化装
置4はこの微弱な信号を、符号量比較部9cからの上記
指示に従って、可変長または固定長符号化する。このよ
うにして、零成分が夫々目立たない非零成分となって個
々に符号化されることになり、従って、このブロックで
の符号量が増加する。
When the code amount comparing section 9c determines that a quantized DCT coefficient is added, the result of the determination is supplied to the coefficient adding section 9a. The coefficient adding unit 9a supplies the quantized DCT coefficient from the scan order conversion device 3 to the variable length coding device 4 as it is when the instruction to add the quantized DCT coefficient is not received from the code amount comparing unit 9c. Upon receiving an instruction to add a quantized DCT coefficient from the code amount comparing unit 9c, a weak signal having a value of 1 is replaced with a variable length as a quantized DCT coefficient instead of the zero component of the quantized DCT coefficient from the scan order converter 3. It is supplied to the encoding device 4. The variable-length encoding device 4 performs variable-length or fixed-length encoding on the weak signal in accordance with the instruction from the code amount comparing unit 9c. In this way, the zero components are individually coded as inconspicuous non-zero components, and therefore the code amount in this block increases.

【0092】[0092]

【発明の効果】以上説明したように、本発明によれば、
符号を直接、充填・削除することにより、画像バッファ
検証器のオーバーフローやアンダーフローを完全に防ぐ
ことができ、実時間での動画像符号化が可能とする。
As described above, according to the present invention,
By directly filling and deleting codes, overflow and underflow of the image buffer verifier can be completely prevented, and moving image coding in real time becomes possible.

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

【図1】本発明による信号処理装置の一実施形態を示す
ブロック図である。
FIG. 1 is a block diagram showing an embodiment of a signal processing device according to the present invention.

【図2】図1における2つの符号量充填装置の一具体例
を示すブロック図である。
FIG. 2 is a block diagram showing a specific example of two code amount filling devices in FIG.

【図3】ず1における2つの符号量充填装置間のスタッ
フィングが行なわれたビットストリームの形態を模式的
に示した図である。
FIG. 3 is a diagram schematically illustrating a form of a bit stream in which stuffing is performed between two code amount filling devices in FIG.

【図4】図1における符号量調整装置の一具体例を示す
ブロック図である。
FIG. 4 is a block diagram showing a specific example of a code amount adjusting device in FIG. 1;

【図5】図4に示した具体例でのブロック毎の目標符号
量の割り当て方法の一具体例を示す説明図である。
FIG. 5 is an explanatory diagram showing a specific example of a method of assigning a target code amount for each block in the specific example shown in FIG. 4;

【図6】従来の信号処理装置の一例を示すブロック図で
ある。
FIG. 6 is a block diagram illustrating an example of a conventional signal processing device.

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

1 入力端子 2 量子化装置 3 スキャン順変換装置 4 可変長符号化装置 5 バッファ 6 画像出力端子 7 符号量集計装置 8 レート制御装置 9 符号量調整装置 9a 係数付加部 9b 非零成分計数部 9c 符号量比較部 10 符号量充填装置 10a スタッフィング部 10b 符号量比較部 11 符号量充填装置 11a バッファ部 11b スタッフィング部 11c 特殊コード検出部 REFERENCE SIGNS LIST 1 input terminal 2 quantization device 3 scan order conversion device 4 variable length coding device 5 buffer 6 image output terminal 7 code amount totaling device 8 rate control device 9 code amount adjusting device 9a coefficient adding portion 9b non-zero component counting portion 9c code Amount comparison unit 10 Code amount filling unit 10a Stuffing unit 10b Code amount comparison unit 11 Code amount filling unit 11a Buffer unit 11b Stuffing unit 11c Special code detection unit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 磯部 幸雄 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マルチメディアシステム 開発本部内 (72)発明者 新井 英雄 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マルチメディアシステム 開発本部内 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Yukio Isobe 292 Yoshida-cho, Totsuka-ku, Yokohama-shi, Kanagawa Prefecture Inside the multimedia system development headquarters of Hitachi, Ltd. (72) Inventor Hideo Arai Yoshida-cho, Totsuka-ku, Yokohama-shi, Kanagawa 292 Hitachi Multimedia Systems Development Division

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 動画像信号を符号化する符号化手段を有
する信号処理装置において、 該動画像信号のピクチャ毎に、該動画像信号を符号化し
て得られる符号列の符号量の目標値を決定する第1の手
段と、 該ピクチャ毎の該目標値に対する符号量の不足分を示す
第1の符号と該第1の符号の該符号列での挿入位置を示
す第2の符号とを該符号列に挿入する第2の手段と、 該第2の手段からの該符号列から該第2の符号を基に該
第1の符号を検出し、該符号列での該第1,第2の符号
を該第1の符号が示す該符号量の不足分に相当する符号
量の復号処理で廃棄される符号語と入れ替える第3の手
段とを有することを特徴とする信号処理装置。
1. A signal processing apparatus having encoding means for encoding a moving image signal, comprising: for each picture of the moving image signal, a target value of a code amount of a code sequence obtained by encoding the moving image signal; First means for determining, a first code indicating a deficiency of a code amount with respect to the target value for each picture, and a second code indicating an insertion position of the first code in the code string. Second means for inserting into the code sequence, detecting the first code from the code sequence from the second means based on the second code, and detecting the first and second codes in the code sequence. And a third means for replacing the code with a code word discarded in the decoding process of the code amount corresponding to the shortage of the code amount indicated by the first code.
【請求項2】 動画像の各ピクチャをブロックに分割
し、該ブロック毎に符号化して符号列を得る符号化手段
を有する信号処理装置において、 該ピクチャでの該符号列の符号量の目標値を設定する目
標値設定手段と、 該ピクチャでの該符号列の符号量の目標値と該ピクチャ
での既に符号化処理したブロックの符号量集計量とか
ら、次に符号化処理するブロックに対する符号列の符号
量の目標値を決定する目標値決定手段と、 該ブロックを、該目標値決定手段によりそれに対して決
定された目標値以内の符号量となるように、該符号化手
段を制御する制御手段とを有することを特徴とする信号
処理装置。
2. A signal processing apparatus comprising an encoding unit for dividing each picture of a moving image into blocks and encoding the blocks to obtain a code sequence, wherein a target value of a code amount of the code sequence in the picture is provided. From the target value of the code amount of the code sequence in the picture and the total code amount of the already-coded blocks in the picture, A target value determining means for determining a target value of the code amount of the column; and controlling the encoding means such that the block has a code amount within a target value determined for the block by the target value determining means. A signal processing device comprising: a control unit.
【請求項3】 請求項2において、 前記ブロック毎に動画像信号を直交変換して空間周波数
成分を導出し、前記ブロックでの符号列の符号量が、そ
のブロックに対して決定された前記目標値よりも小さく
なるように、該空間周波数成分での高周波成分をカット
する手段を有することを特徴とする信号処理装置。
3. The target according to claim 2, wherein a video signal is orthogonally transformed for each block to derive a spatial frequency component, and a code amount of a code sequence in the block is determined for the block. A signal processing device comprising means for cutting a high-frequency component of the spatial frequency component so as to be smaller than the value.
【請求項4】 動画像信号を可変長符号化を用いて圧縮
する符号化手段を有する信号処理装置において、 同一の符号化単位に対して、語長の異なる複数の符号語
候補から1つを選択し、符号語として出力する手段を有
することを特徴とする信号処理装置。
4. A signal processing apparatus having an encoding means for compressing a moving image signal using variable length encoding, wherein one of a plurality of codeword candidates having different word lengths is assigned to the same encoding unit. A signal processing device comprising means for selecting and outputting as a codeword.
【請求項5】 請求項4記載において、 動画像圧縮規格H.262で定めたマクロブロック毎に目標
符号量を定め、目標符号量に対する実際の符号量の不足
分を、語長の長い前記符号語候補を選択することによ
り、充填する手段を有することを特徴とする信号処理装
置。
5. The method according to claim 4, wherein a target code amount is determined for each macroblock defined by the moving picture compression standard H.262, and the shortage of the actual code amount with respect to the target code amount is determined by using a code having a long word length. A signal processing device comprising means for filling by selecting a word candidate.
JP2997598A 1998-02-12 1998-02-12 Signal processing unit Pending JPH11234671A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2997598A JPH11234671A (en) 1998-02-12 1998-02-12 Signal processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2997598A JPH11234671A (en) 1998-02-12 1998-02-12 Signal processing unit

Publications (1)

Publication Number Publication Date
JPH11234671A true JPH11234671A (en) 1999-08-27

Family

ID=12290972

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2997598A Pending JPH11234671A (en) 1998-02-12 1998-02-12 Signal processing unit

Country Status (1)

Country Link
JP (1) JPH11234671A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001063938A1 (en) * 2000-02-28 2001-08-30 Kabushiki Kaisha Toshiba Video encoding apparatus and video encoding method
US6816550B2 (en) 2000-03-29 2004-11-09 Renesas Technology Corp. Image signal coding apparatus with bit stream buffer of reduced storage capacity
JP2007158430A (en) * 2005-11-30 2007-06-21 Matsushita Electric Ind Co Ltd Image information encoder
JP2009153138A (en) * 2007-12-19 2009-07-09 Sony Corp Video data compression with no visual loss
US8345992B2 (en) 2007-10-23 2013-01-01 Hitachi Kokusai Electric Inc. Method and device of image encoding and image processing apparatus

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001063938A1 (en) * 2000-02-28 2001-08-30 Kabushiki Kaisha Toshiba Video encoding apparatus and video encoding method
US6819712B2 (en) 2000-02-28 2004-11-16 Kabushiki Kaisha Toshiba Video encoding apparatus and video encoding method
US6816550B2 (en) 2000-03-29 2004-11-09 Renesas Technology Corp. Image signal coding apparatus with bit stream buffer of reduced storage capacity
JP2007158430A (en) * 2005-11-30 2007-06-21 Matsushita Electric Ind Co Ltd Image information encoder
US8345992B2 (en) 2007-10-23 2013-01-01 Hitachi Kokusai Electric Inc. Method and device of image encoding and image processing apparatus
JP2009153138A (en) * 2007-12-19 2009-07-09 Sony Corp Video data compression with no visual loss

Similar Documents

Publication Publication Date Title
US5719632A (en) Motion video compression system with buffer empty/fill look-ahead bit allocation
JP3756346B2 (en) Method and system for processing multiple streams of video frames
KR100343352B1 (en) Two-pass encoding method of digital motion video sequences for constant-or variable bit rate
US5619341A (en) Method and apparatus for preventing overflow and underflow of an encoder buffer in a video compression system
EP0562787B1 (en) Image coding method and apparatus
US6219381B1 (en) Image processing apparatus and method for realizing trick play
KR970003789B1 (en) Bit allocation method for controlling bit-rate of video encoder
EP2403248B1 (en) Moving picture encoding device, moving picture encoding method, and moving picture encoding computer program
US6229849B1 (en) Coding device and method
EP0998151A2 (en) Joint data rate control for stereoscopic video signal coding
US9479781B2 (en) Motion video encoding apparatus, motion video encoding method, and motion video encoding computer program
US8948242B2 (en) Encoding device and method and multimedia apparatus including the encoding device
JPH11317951A (en) Data encoding device/method and data transmitting method
EP1280356A2 (en) Apparatus and method for compressing multiplexed video signals
US8724710B2 (en) Method and apparatus for video encoding with hypothetical reference decoder compliant bit allocation
GB2377573A (en) Storing images from a plurality of transmitters in a plurality of frame stores
KR20050020710A (en) Coding device and coding method
JP3839911B2 (en) Image processing apparatus and image processing method
JPH11234671A (en) Signal processing unit
US20100272170A1 (en) Image encoding apparatus, image encoding method and medium on which image encoding program is recorded
JPH1013826A (en) Picture encoder, its method, picture decoder, its method, picture transmitter, picture receiver and recording medium
JP3646849B2 (en) Stereo moving image encoding device
JP2000041240A (en) Variable bit rate coder and its method
JP2002199408A (en) Moving image coding method and moving image coder
JPH114445A (en) Image coder and its method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060811

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060822

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20061219