JPH05236448A - Compressed moving image code amount controller - Google Patents

Compressed moving image code amount controller

Info

Publication number
JPH05236448A
JPH05236448A JP3175992A JP3175992A JPH05236448A JP H05236448 A JPH05236448 A JP H05236448A JP 3175992 A JP3175992 A JP 3175992A JP 3175992 A JP3175992 A JP 3175992A JP H05236448 A JPH05236448 A JP H05236448A
Authority
JP
Japan
Prior art keywords
code
compressed
code amount
block
blocks
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
JP3175992A
Other languages
Japanese (ja)
Inventor
Susumu Takahashi
将 高橋
Masuo Oku
万寿男 奥
Yukitoshi Tsuboi
幸利 坪井
Kenji Ichige
健志 市毛
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 JP3175992A priority Critical patent/JPH05236448A/en
Publication of JPH05236448A publication Critical patent/JPH05236448A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

PURPOSE:To execute encoding so as not to considerably degrade picture quality even when overflow is generated by reducing codes in the low priority order in the group of the prescribed number of blocks to be turned to a constant rate in the case of overflow. CONSTITUTION:In the entire group composed of the prescribed number of blocks to be turned to the constant rate, the priority order of variable length codes is judged by a code priority order judging equipment 14. When overflow is generated by a data stream former 15, the codes in the low priority order are reduced so as to settle the code amount in the group of the prescribed number of blocks to be stored in a data stream buffer 6 in a recording capacity. Afterwards, a corrected code, synchronizing code and ID code or the like are added by a corrected code former 7, converted to a code suitable for recording by a channel encoder 8 and recorded onto the recording medium by a head 9.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は離散コサイン変換などの
直交変換と可変長符号を組合せて動画像データの圧縮を
行う装置の圧縮後の符号量を一定化する圧縮動画像符号
量制御装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compressed moving image code amount control device for making constant a compressed code amount of a device for compressing moving image data by combining orthogonal transform such as discrete cosine transform and variable length code. ..

【0002】[0002]

【従来の技術】画像データのデータ量を圧縮して記録媒
体に記録、あるいは伝送路を通じて伝送する装置に関し
て、画像データを小さなブロックに分割して離散コサイ
ン変換などの直交変換を行い、これに可変長符号を割り
当ててデータ量を圧縮する方法がよく知られている。こ
のような装置では、記録レートあるいは伝送レートにあ
わせて圧縮後の符号量が一定レートになるように制御す
る必要がある。しかしながら、可変長符号を用いるた
め、実際の符号量は符号化してみるまでわからないとい
う問題があった。これに対し従来は、公開特許公報平3
―229570に記載のように、直交変換係数の統計を
用いて符号量を予測する手法が提案されている。しか
し、100%完全な予測を行うことは不可能であるので
画像によっては符号のオーバーフローが生じる。従来技
術は、オーバーフローが生じた場合に画質に重大な影響
を与える符号が伝送されなくなり、大きな画質劣化を生
じてしまう恐れがあることにたいして配慮されていなか
った。
2. Description of the Related Art In a device for compressing the data amount of image data and recording it on a recording medium or transmitting it through a transmission path, the image data is divided into small blocks and orthogonal transformation such as discrete cosine transformation is performed and variable A method of allocating a long code and compressing the amount of data is well known. In such a device, it is necessary to control the code amount after compression to a constant rate according to the recording rate or the transmission rate. However, since the variable length code is used, there is a problem that the actual code amount cannot be known until encoding. On the other hand, conventionally, Japanese Patent Laid-Open No. Hei 3
As described in -229570, there has been proposed a method of predicting the code amount by using statistics of orthogonal transform coefficients. However, since it is impossible to perform 100% perfect prediction, a code overflow occurs in some images. The prior art has not taken into consideration that a code that seriously affects the image quality may not be transmitted when an overflow occurs, resulting in a large deterioration of the image quality.

【0003】[0003]

【発明が解決しようとする課題】従来技術は、オーバー
フロー時の画質劣化について配慮されていなかった。
In the prior art, no consideration was given to deterioration of image quality at the time of overflow.

【0004】本発明の目的は、オーバーフローが起きた
場合に画質劣化の小さい符号量制御装置を提供すること
にある。
It is an object of the present invention to provide a code amount control device that causes little deterioration in image quality when an overflow occurs.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するた
め、定レート化を行う所定の個数のブロック内のすべて
の可変長符号の情報を記憶する手段と、これらの符号間
の優先順位を決定する手段とオーバーフロー時に優先順
位の低い符号を削除してオーバーフローを解消する手段
を設ける。
In order to achieve the above object, means for storing information of all variable-length codes in a predetermined number of blocks for constant rate conversion, and a priority order between these codes are determined. And means for eliminating the overflow by deleting the code having a lower priority when overflowing.

【0006】[0006]

【作用】オーバーフロー時に欠落するのは優先順位の低
い符号となるので、画質劣化を小さく抑さえることがで
きる。
Since a code having a low priority is missing at the time of overflow, deterioration of image quality can be suppressed.

【0007】[0007]

【実施例】図1に本発明による第1の実施例の記録装置
のブロック図を示す。映像データ入力端子1に入来した
信号は遅延回路2、離散コサイン変換器3、量子化器
4、可変長符号器5、データストリームバッファ6、訂
正符号形成器7およびチャネル符号化器8を通り、ヘッ
ド9に供給されている。可変長符号器5は、符号情報記
憶部10と接続されている。また、映像データ入力端子
1に入来した信号は符号量予測器11にも供給され、符
号量予測器11の出力は量子化制御器12に供給され、
量子化制御器12の出力は量子化器4に供給されてい
る。符号情報記憶部10から符号量検出器13に信号が
供給され、符号量検出器13の出力も量子化制御器12
に供給されている。符号情報記憶部10の出力は符号優
先順位判定器14にも供給され、符号優先順位判定器1
4の出力はデータストリーム形成器15に供給され、デ
ータストリーム形成器15の出力が可変長符号器5およ
びデータストリームバッファ6に供給されている。
1 is a block diagram of a recording apparatus according to a first embodiment of the present invention. The signal input to the video data input terminal 1 passes through the delay circuit 2, the discrete cosine transformer 3, the quantizer 4, the variable length encoder 5, the data stream buffer 6, the correction code former 7 and the channel encoder 8. , To the head 9. The variable length encoder 5 is connected to the code information storage unit 10. Further, the signal input to the video data input terminal 1 is also supplied to the code amount predictor 11, and the output of the code amount predictor 11 is supplied to the quantization controller 12.
The output of the quantization controller 12 is supplied to the quantizer 4. A signal is supplied from the code information storage unit 10 to the code amount detector 13, and the output of the code amount detector 13 is also the quantization controller 12
Is being supplied to. The output of the code information storage unit 10 is also supplied to the code priority determining unit 14, and the code priority determining unit 1
The output of 4 is supplied to the data stream former 15, and the output of the data stream former 15 is supplied to the variable length encoder 5 and the data stream buffer 6.

【0008】次に動作を説明する。本実施例では、入来
した映像データを画面上の小ブロックに分割してブロッ
ク毎に離散コサイン変換を行い、得られた変換係数を量
子化し、その結果に可変長符号を割り当てることにより
データの圧縮を行う。この際、圧縮後の符号量を記録フ
ォーマットにより決まる記録レートのなかに収めるた
め、量子化器4、符号量予測器11、量子化制御器1
2、符号量検出器13により構成される定レート化回路
16により、所定の個数のブロックのまとまり毎に可変
長符号化後の符号量が一定となるように制御を行う。符
号情報記憶部10は、この定レート制御を行う所定の個
数のブロックのまとまり分の可変長符号の情報を記憶す
る。符号量の制御は量子化器4における量子化ステップ
を制御することにより行う。まず、符号量予測器11が
予めいくつかの量子化ステップで量子化を行う等の手法
により発生する符号量を予測する。量子化制御器12は
この予測結果に基づき、実際の符号化における量子化ス
テップを適当な値に設定する。遅延回路2は符号量予測
器11における処理時間を稼ぐためのものである。符号
量検出器13は実際の符号化の結果の符号量を検出し、
目標値とのずれにより量子化ステップの設定にフィード
バックをかける。
Next, the operation will be described. In the present embodiment, the incoming video data is divided into small blocks on the screen, the discrete cosine transform is performed for each block, the obtained transform coefficient is quantized, and the variable length code is assigned to the result to obtain the data. Perform compression. At this time, the quantizer 4, the code amount predictor 11, and the quantization controller 1 are included in order to keep the code amount after compression within the recording rate determined by the recording format.
2. The constant rate conversion circuit 16 constituted by the code amount detector 13 controls so that the code amount after variable length coding becomes constant for each group of a predetermined number of blocks. The code information storage unit 10 stores information on variable length codes for a group of a predetermined number of blocks for which the constant rate control is performed. The code amount is controlled by controlling the quantization step in the quantizer 4. First, the code amount predictor 11 predicts the code amount generated by a method such as performing quantization in advance in several quantization steps. The quantization controller 12 sets the quantization step in actual encoding to an appropriate value based on this prediction result. The delay circuit 2 is for increasing the processing time in the code amount predictor 11. The code amount detector 13 detects the code amount of the actual encoding result,
Feedback is given to the setting of the quantization step due to the deviation from the target value.

【0009】以上により定レート化が図られるが、符号
量の予測を100%確実に行うことはできないため、符
号量が記録レートをオーバーしてしまう場合が生じる。
そこで、符号優先順位判定器14において定レート化を
行う所定の個数のブロックのまとまり全体のなかでの可
変長符号の優先順位を判定し、データストリーム形成器
15によりオーバーフローが生じた場合に優先順位の低
い符号を削減し、データストリームバッファ6に蓄えら
れる所定の個数のブロックのまとまり分の符号量が記録
容量内に収まるようにする。このあと、訂正符号形成器
7において訂正符号、同期符号、ID符号等を付加し、
チャネル符号化器8において記録に適した符号に変換
し、ヘッド9により記録媒体上へ記録する。
Although a constant rate is achieved as described above, since the code amount cannot be predicted with 100% certainty, the code amount may exceed the recording rate.
Therefore, the code priority determination unit 14 determines the priority of the variable-length code in the entire group of a predetermined number of blocks for which the constant rate conversion is performed, and when the data stream former 15 overflows, the priority is determined. The number of codes having a low number is reduced so that the code amount of a predetermined number of blocks stored in the data stream buffer 6 fits within the recording capacity. After that, the correction code forming unit 7 adds a correction code, a synchronization code, an ID code, etc.,
The channel encoder 8 converts the code into a code suitable for recording, and the head 9 records on the recording medium.

【0010】図2に、符号化部の詳細ブロック図を示
す。量子化器4の出力は走査変換器51を通して0ラン
計測器52へ供給され、0ラン計測器52から符号情報
記憶部10へ情報が送られている。符号情報記憶部10
から符号発生器53および符号順序変換器141へ情報
が送られている。符号発生器53から符号テーブル54
および符号長テーブル55へ情報が供給され、符号テー
ブル54および符号長テーブル55から符号発生器53
へ情報が返されており、符号発生器53からデータスト
リームバッファ6へ信号が供給されている。また、量子
化器4の出力は直流成分符号化器56へも供給されてお
り、直流成分符号化器56の出力もデータストリームバ
ッファ6へ供給されている。一方、符号順序変換器14
1から符号発生制御器151へ信号が供給され、符号発
生制御器151から符号発生器53へ信号が供給されて
いる。符号長テーブル55からの情報はオーバーフロー
検出器152へも供給され、オーバーフロー検出器15
2からも符号発生制御器151へ信号が供給されてい
る。オーバーフロー検出器152からはブロック終了符
号付加器153へも信号が供給され、ブロック終了符号
付加器153からデータストリームバッファ6へ信号が
供給されている。
FIG. 2 shows a detailed block diagram of the encoding unit. The output of the quantizer 4 is supplied to the 0-run measuring device 52 through the scan converter 51, and information is sent from the 0-run measuring device 52 to the code information storage unit 10. Code information storage unit 10
From the code generator 53 to the code order converter 141. Code generator 53 to code table 54
Information is supplied to the code length table 55 and the code length table 55.
Information is returned to the data stream buffer 6 from the code generator 53. The output of the quantizer 4 is also supplied to the DC component encoder 56, and the output of the DC component encoder 56 is also supplied to the data stream buffer 6. On the other hand, the code order converter 14
A signal is supplied from 1 to the code generation controller 151, and a signal is supplied from the code generation controller 151 to the code generator 53. The information from the code length table 55 is also supplied to the overflow detector 152, and the overflow detector 15
A signal is also supplied from 2 to the code generation controller 151. A signal is also supplied from the overflow detector 152 to the block end code adder 153, and a signal is supplied from the block end code adder 153 to the data stream buffer 6.

【0011】次に動作を説明する。図3(a)に離散コ
サイン変換ブロックの構成を示す。輝度信号と色差信号
とでサンプリング周波数を変え、4つの輝度ブロックと
2つの色差ブロックで1つのまとまり(以下、これをマ
クロブロックという)とする。本実施例では1ブロック
は8×8画素で構成される。各々のブロックにつき、量
子化された離散コサイン変換係数のうち、直流成分につ
いてはそのまま固定長で符号化し、データストリームバ
ッファ6へ書き込む。交流成分に対しては、まず走査変
換器51においてジグザグスキャンを行い、低周波から
高周波の順に並び替える。図3(b)にジグザグスキャ
ンの様子を示す。図3(b)において、矢印はジグザグ
スキャンの順番を示しており、ブロック内でeと添字で
表記されているのは0でない値を持つ係数であり、それ
以外の係数は0である。0ラン計測器52は、0でない
係数が現われるまでのジグザグスキャンに沿った0の連
続の長さ(0ラン長)を計測する。可変長符号は0ラン
長と係数値の組合せ(以下、これをイベントという)に
1対1に対応させる。ブロックの終りまで0であった場
合は特別なブロック終了符号を対応させる。
Next, the operation will be described. FIG. 3A shows the structure of the discrete cosine transform block. The sampling frequency is changed between the luminance signal and the color difference signal, and four luminance blocks and two color difference blocks form one group (hereinafter referred to as a macro block). In this embodiment, one block is composed of 8 × 8 pixels. For each block, the DC component of the quantized discrete cosine transform coefficient is encoded as it is with a fixed length, and is written in the data stream buffer 6. For the AC component, first, the scan converter 51 performs zigzag scanning and rearranges in order from low frequency to high frequency. FIG. 3B shows the state of zigzag scanning. In FIG. 3B, arrows indicate the order of zigzag scanning, and a coefficient denoted by e in the block is a coefficient having a value other than 0, and the other coefficients are 0. The 0-run measuring device 52 measures the length of continuous 0s (0-run length) along the zigzag scan until a non-zero coefficient appears. The variable length code has a one-to-one correspondence with a combination of a 0 run length and a coefficient value (hereinafter, this is referred to as an event). If it is 0 until the end of the block, a special block end code is associated.

【0012】本実施例では定レート化の単位を90ブロ
ック(15マクロブロック)とする。以下、これを圧縮
ブロックという。1圧縮ブロック分のブロックの符号を
並べると図4(a)のようになる。符号情報記憶部10
は、1圧縮ブロック分のすべてのイベントの0ラン長と
係数値をメモリする。符号順序変換器141は、まず各
ブロックの1番目のイベント、次に各ブロックの2番目
のイベントというようにイベントの順序を変換する。1
番目のイベントの中での順序は、図5の発生符号量の欄
に示すように、まず1番目のマクロブロックの1番目の
ブロック、次に2番目のマクロブロックの1番目のブロ
ックというようにマクロブロック毎に交互にする。符号
発生制御器151はその順序にしたがって符号を発生す
るように符号発生器53を制御する。符号発生器53は
符号テーブル54および符号長テーブル55を用いて符
号を生成する。データストリームバッファ6は発生した
符号を蓄える。データストリームバッファ6の内部はマ
クロブロック毎に別れており、図4(b)に示すように
蓄えられる。以上により、マクロブロック毎のデータス
トリームが形成される。
In this embodiment, the unit of constant rate conversion is 90 blocks (15 macroblocks). Hereinafter, this is referred to as a compressed block. When the codes of the blocks for one compressed block are arranged, it becomes as shown in FIG. Code information storage unit 10
Stores 0 run lengths and coefficient values of all events for one compressed block. The code order converter 141 converts the order of events, such as the first event of each block, and then the second event of each block. 1
The order in the second event is, as shown in the column of the generated code amount in FIG. 5, first the first block of the first macroblock and then the first block of the second macroblock. Alternate for each macroblock. The code generation controller 151 controls the code generator 53 to generate a code according to the order. The code generator 53 generates a code using the code table 54 and the code length table 55. The data stream buffer 6 stores the generated code. The inside of the data stream buffer 6 is divided for each macroblock and is stored as shown in FIG. As described above, a data stream for each macroblock is formed.

【0013】図5に示すように符号量がオーバーフロー
する場合は、オーバーフロー検出器152がこれを検出
し、オーバーフローする直前に符号の書込みを中止し、
ブロック終了符号付加器153を用いて未だブロック終
了符号を書き込んでいないブロックにブロック終了符号
を付加して書込みを終了し、データストリームバッファ
6に蓄える符号の量がオーバーフローしないようにす
る。このとき当然ながら、オーバーフローの検出は最後
に付加するブロック終了符号の符号量も勘定にいれて行
う。以上により、図5の例においては、e78以降の符
号が削除される。
When the code amount overflows as shown in FIG. 5, the overflow detector 152 detects this and stops writing the code immediately before the overflow.
The block end code adding unit 153 is used to add the block end code to the block to which the block end code has not been written yet to end the writing so that the amount of the code stored in the data stream buffer 6 does not overflow. At this time, of course, the overflow is detected by counting the code amount of the block end code added at the end. As described above, in the example of FIG. 5, the symbols after e78 are deleted.

【0014】なお、最後の交流成分に0でない係数があ
ってこれが符号化されている場合は、この符号によりブ
ロックの終了が判明するので、ブロック終了符号は書き
込まなくてもよい。
If the last AC component has a coefficient which is not 0 and is coded, the end of the block is known from this code, so the block end code need not be written.

【0015】図6に、訂正符号形成器7において形成さ
れるエラー訂正積ブロックの例を示す。同期信号の後に
どのマクロブロックであるかを示すIDを付け、その
後、固定長の直流成分と交流成分のデータストリームを
続ける。収まりきらなかったデータは符号量の少ないマ
クロブロックのデータの後に埋め込んでゆく。データス
トリームバッファ6に蓄えられた15マクロブロックの
データストリームの総符号量は、オーバーフローするこ
となく一定量に収まっているので、決まった大きさのエ
ラー訂正積ブロックの中に収めることができる。縦方向
に見た符号列に対して外訂正符号を付加し、横方向に見
た符号列に対して内訂正符号を付加する。
FIG. 6 shows an example of the error correction product block formed in the correction code forming unit 7. After the synchronization signal, an ID indicating which macroblock is attached is added, and then a data stream of a fixed length DC component and an AC component is continued. The data that does not fit is embedded after the data of the macroblock with a small code amount. Since the total code amount of the data stream of the 15 macroblocks stored in the data stream buffer 6 does not overflow and is within a fixed amount, it can be stored in an error correction product block having a predetermined size. The outer correction code is added to the code string viewed in the vertical direction, and the inner correction code is added to the code string viewed in the horizontal direction.

【0016】以上、本実施例によれば、オーバーフロー
時に定レート化を行う所定の個数のブロックのまとまり
全体の中で優先順位の低い符号を削減することにより、
オーバーフローが生じても大きな画質劣化を伴わずに符
号化を行うことができる。
As described above, according to the present embodiment, by reducing the code having the low priority in the entire group of the predetermined number of blocks which are subjected to the constant rate at the time of overflow,
Even if an overflow occurs, it is possible to perform encoding without causing a significant deterioration in image quality.

【0017】以上述べた実施例では、各ブロックの同じ
番目の符号の中での優先順位は、マクロブロックおよび
ブロックの順序で決まっていたが、これを各符号の符号
長により優先順位を決めるようにしてもよい。図7に、
そのような本発明の第2の実施例の符号化部の詳細ブロ
ック図を示す。
In the embodiments described above, the priority order of the same code of each block is determined by the order of the macroblock and the block, but the priority order is determined by the code length of each code. You can In Figure 7,
The detailed block diagram of such an encoding part of the 2nd Example of this invention is shown.

【0018】量子化器4、走査変換器51、0ラン計測
器52、符号情報記憶部10、符号発生器53、符号テ
ーブル54、符号長テーブル55、直流成分符号化器5
6、符号順序変換器141、符号発生制御器151およ
びオーバーフロー検出器152の構成は図2に示した実
施例と全く同じである。直流成分符号化器56の出力は
データストリームバッファ6へ供給されており、符号発
生器53の出力は符号バッファ66を通してデータスト
リームバッファ6へ供給されている。オーバーフロー検
出器152の出力が符号選択器154に供給され、符号
選択器154の出力は符号バッファ66およびブロック
終了符号付加器153へ供給され、ブロック終了符号付
加器153からデータストリームバッファ6へ信号が供
給されている。符号長テーブル55の出力が符号長記憶
部155へ供給され、符号長記憶部155から符号選択
器154へ信号が供給されている。
Quantizer 4, scan converter 51, 0-run measuring unit 52, code information storage unit 10, code generator 53, code table 54, code length table 55, DC component encoder 5
6, the code sequence converter 141, the code generation controller 151, and the overflow detector 152 are exactly the same as those in the embodiment shown in FIG. The output of the DC component encoder 56 is supplied to the data stream buffer 6, and the output of the code generator 53 is supplied to the data stream buffer 6 through the code buffer 66. The output of the overflow detector 152 is supplied to the code selector 154, the output of the code selector 154 is supplied to the code buffer 66 and the block end code adder 153, and the signal is output from the block end code adder 153 to the data stream buffer 6. Is being supplied. The output of the code length table 55 is supplied to the code length storage unit 155, and the signal is supplied from the code length storage unit 155 to the code selector 154.

【0019】次に動作を説明する。直流成分は図2の実
施例と同じく固定長でデータストリームバッファ6に書
き込む。交流成分についても図2の実施例と同じ順序で
符号を発生するが、各ブロックの同じ番目の符号は一旦
符号バッファ66に蓄える。オーバーフローしない場合
は、符号バッファ66に蓄えた符号をそのままデータス
トリームバッファ6に書き込む。符号長記憶部155
は、符号バッファ66に蓄えた同じ番目の符号の符号長
の情報をメモリする。オーバーフロー検出器152がオ
ーバーフローを検出すると、符号選択器154がこの符
号長情報を用いて符号長の小さい符号から順にオーバー
フローする直前まで符号を選んでゆく。図8(a)に示
すように8番目の符号でオーバーフローした場合の符号
長記憶部155の記憶内容の例を図8(b)に示す。こ
の例の場合、符号の選択順序は図8(a)の様になり、
e18が除外される。符号選択器154は選択された符
号についてのみデータストリームバッファ6に書き込
み、ブロック終了符号付加器153を用いて未だブロッ
ク終了符号を書き込んでいないブロックにブロック終了
符号を付加して書込みを終了する。
Next, the operation will be described. The DC component has a fixed length and is written in the data stream buffer 6 as in the embodiment of FIG. Codes are generated for the AC component in the same order as in the embodiment of FIG. 2, but the same code in each block is temporarily stored in the code buffer 66. When no overflow occurs, the code stored in the code buffer 66 is written in the data stream buffer 6 as it is. Code length storage unit 155
Stores the code length information of the same code stored in the code buffer 66. When the overflow detector 152 detects an overflow, the code selector 154 uses this code length information to select the code in order from the code with the smallest code length until just before the overflow. FIG. 8B shows an example of the stored contents of the code length storage unit 155 when the eighth code overflows as shown in FIG. In this example, the code selection order is as shown in FIG.
e18 is excluded. The code selector 154 writes only the selected code into the data stream buffer 6, and uses the block end code adder 153 to add the block end code to the block to which the block end code has not been written yet, and ends the writing.

【0020】以上、本実施例によれば、オーバーフロー
時に各ブロックの同じ番目の符号の中での優先順位も判
定することにより、より最適な符号削減を行うことがで
きるので、オーバーフロー時の画質劣化をさらに小さく
することができる。
As described above, according to the present embodiment, by determining the priority in the same code of each block at the time of overflow, more optimal code reduction can be performed. Can be further reduced.

【0021】本実施例では符号長により同じ番目の符号
間の優先順位を決定したが、係数値の大きいものを優先
するように構成してもよいし、図3(b)に示したジグ
ザグスキャンに沿った位置の早いもの(低周波のもの)
を優先するように構成してもよい。
In the present embodiment, the priority order between the same number of codes is determined by the code length, but it may be configured such that the one having the larger coefficient value has the priority, or the zigzag scan shown in FIG. 3B. Faster position along (low frequency)
May be prioritized.

【0022】図9に、本発明の第3の実施例の符号化部
のブロック図を示す。量子化器4、走査変換器51、0
ラン計測器52、符号発生器53、符号テーブル54、
直流成分符号化器56およびデータストリームバッファ
6の構成は図2に示した実施例と全く同じである。0ラ
ン計測器52から符号情報記憶部10へ情報が送られて
いる。また、0ラン計測器52から符号長テーブル55
へ情報が供給され、符号長テーブル55から符号情報記
憶部10へ情報が供給されている。符号情報記憶部10
から符号発生器53および削減符号選定器142へ情報
が送られている。一方、削減符号選定器142から符号
発生制御器151へ信号が供給され、符号発生制御器1
51から符号発生器53へ信号が供給されている。
FIG. 9 shows a block diagram of an encoding unit according to the third embodiment of the present invention. Quantizer 4, scan converter 51, 0
Run measuring instrument 52, code generator 53, code table 54,
The configurations of the DC component encoder 56 and the data stream buffer 6 are exactly the same as those of the embodiment shown in FIG. Information is sent from the 0-run measuring device 52 to the code information storage unit 10. In addition, the 0 run measuring instrument 52 to the code length table 55
Information is supplied to the code information storage unit 10 from the code length table 55. Code information storage unit 10
From the code generator 53 and the reduction code selector 142. On the other hand, a signal is supplied from the reduction code selector 142 to the code generation controller 151, and the code generation controller 1
A signal is supplied from 51 to the code generator 53.

【0023】次に動作を説明する。符号情報記憶部10
は0ラン長と係数値に符号長の情報を加えた3つの情報
をメモリする。符号情報の具体例を図10(a)に示
す。本図では、係数を数字で、符号長を長さで表してあ
る(0ラン長は省略してある)。削減符号選定器142
は、これらの情報を用い、図10(b)に示すように符
号量がオーバーフローする場合に、削除する符号をオー
バーフローしなくなるまで選んでゆく。
Next, the operation will be described. Code information storage unit 10
Stores 0 run length and three pieces of information obtained by adding code length information to the coefficient value. A specific example of the code information is shown in FIG. In the figure, the coefficient is represented by a numeral and the code length is represented by a length (0 run length is omitted). Reduction code selector 142
Using these pieces of information, when the code amount overflows as shown in FIG. 10B, the code to be deleted is selected until it does not overflow.

【0024】符号の選択は、各ブロックの最後尾の符号
(ブロック終了符号を除く)の中で係数値の小さいもの
から順番に行う。係数値の等しいものについては、符号
長の長いもの(削減効果の大きいもの)から選んでゆ
く。以上により、図10の例においては、e18および
e26が削除される。
The codes are selected in order from the code having the smallest coefficient value among the codes at the end of each block (excluding the block end code). Those with the same coefficient value are selected from those with a long code length (those with a large reduction effect). As described above, e18 and e26 are deleted in the example of FIG.

【0025】なお、最後尾の符号が削除されたブロック
については最後から2番目の符号が次の削除の候補にな
る。但し、1つのブロックに符号削除による画質劣化が
集中することを防ぐため、2番目以降の符号を削除しよ
うとする場合には削除による誤差(削除した係数値の二
乗和で定義する)を評価し、これが小さくなるほうのブ
ロックの符号を削除する。したがって、図4(b)の例
では削除するのはe26までであるが、この次にもし削
除するとすれば(符号長に関係なく)e25ではなくe
32の方となる。
For the block from which the last code has been deleted, the second last code is a candidate for the next deletion. However, in order to prevent concentration of image quality deterioration due to code deletion in one block, when deleting the second and subsequent codes, the error due to deletion (defined by the sum of squares of the deleted coefficient values) is evaluated. , The code of the block with the smaller value is deleted. Therefore, in the example of FIG. 4 (b), it is up to e26 to be deleted, but if it is next deleted (regardless of the code length), it is not e25 but e.
32.

【0026】符号発生制御器151は、削減符号選定器
142で選定されなかったすべての可変長符号(ブロッ
ク終了符号を含む)がデータストリームバッファ6へ書
込まれるように制御を行う。
The code generation controller 151 controls so that all the variable length codes (including the block end code) not selected by the reduction code selector 142 are written in the data stream buffer 6.

【0027】以上、本実施例によれば、オーバーフロー
時に係数値の小さい符号から削除し、かつ符号削除によ
る画質劣化が1つのブロックに集中しないようにするこ
とにより、オーバーフロー時の画質劣化を目立たなくす
ることができる。
As described above, according to the present embodiment, the code having a small coefficient value is deleted at the time of overflow, and the image quality deterioration due to the code deletion is not concentrated on one block, so that the image quality deterioration at the time of overflow is not noticeable. can do.

【0028】なお、本実施例では最後尾の符号から削除
する符号を選んだが、符号の位置によらずすべての符号
の中から削除する符号を選び、削除した符号の後ろの符
号を削除した符号の分だけ0ラン長を延ばした符号に置
き換える構成とすることにより、中ほどに小さい係数の
符号がある場合にも誤差を最小にする符号削除が行われ
るようにしてもよい。
In this embodiment, the code to be deleted is selected from the last code, but the code to be deleted is selected from all the codes regardless of the code position, and the code after the deleted code is deleted. Even if there is a code with a coefficient that is small in the middle, the code may be deleted so as to minimize the error by adopting a configuration in which the code is extended by 0 run length.

【0029】図11に、本発明による第4の実施例の符
号化部のブロック図を示す。量子化器4、走査変換器5
1、0ラン計測器52、符号情報記憶部10、符号発生
器53、符号テーブル54、符号長テーブル55、直流
成分符号化器56、符号順序変換器141および符号発
生制御器151の構成は図2に示した実施例と全く同じ
である。符号発生器53からバッファ切換器18を通し
て第1データストリームバッファ61および第2データ
ストリームバッファ62へ信号が供給されている。直流
成分符号化器56の出力は第1データストリームバッフ
ァ61へ供給されている。符号長テーブル55からの情
報は第1バッファオーバーフロー検出器17へも供給さ
れ、第1バッファオーバーフロー検出器17からバッフ
ァ切換器18へ信号が供給されている。第1バッファオ
ーバーフロー検出器17からはブロック終了符号付加器
153へも信号が供給され、ブロック終了符号付加器1
53から第1データストリームバッファ61へ信号が供
給されている。そして、第1データストリームバッファ
61および第2データストリームバッファ62の出力が
訂正符号形成器7へ供給されている。
FIG. 11 shows a block diagram of an encoding unit according to the fourth embodiment of the present invention. Quantizer 4, scan converter 5
The configurations of the 1,0 run measuring device 52, the code information storage unit 10, the code generator 53, the code table 54, the code length table 55, the DC component encoder 56, the code sequence converter 141, and the code generation controller 151 are as shown in FIG. This is exactly the same as the embodiment shown in FIG. A signal is supplied from the code generator 53 to the first data stream buffer 61 and the second data stream buffer 62 through the buffer switch 18. The output of the DC component encoder 56 is supplied to the first data stream buffer 61. The information from the code length table 55 is also supplied to the first buffer overflow detector 17, and the signal is supplied from the first buffer overflow detector 17 to the buffer switch 18. A signal is also supplied from the first buffer overflow detector 17 to the block end code adder 153, and the block end code adder 1
A signal is supplied from 53 to the first data stream buffer 61. The outputs of the first data stream buffer 61 and the second data stream buffer 62 are supplied to the correction code forming unit 7.

【0030】次に動作を説明する。本実施例では定レー
ト化を行う1つの圧縮ブロックを3つの圧縮サブブロッ
クに分ける。1つの圧縮サブブロックの符号容量は5マ
クロブロックすなわち30ブロック分の平均符号量に相
当する。ブロック間のばらつきにより、5マクロブロッ
クの符号量が圧縮サブブロックの符号容量内に収まるも
のもあればオーバーするものもある。オーバーフローし
ない間は、図2に示した実施例においてデータストリー
ムバッファ6への書込みを行ったのと全く同様の順序
で、第1データストリームバッファ61への書込みを行
う。ある圧縮サブブロックの符号量がオーバーフローす
る場合は、第1バッファオーバーフロー検出器17がこ
れを検出し、オーバーフローする直前に符号の書込みを
中止し、ブロック終了符号付加器153を用いてブロッ
ク終了符号を付加して第1データストリームバッファ6
1への書込みを終了し、バッファ切換器18により続き
の符号を第2データストリームバッファ62へ書き込む
ようにする。
Next, the operation will be described. In this embodiment, one compressed block for constant rate division is divided into three compressed sub-blocks. The code capacity of one compressed sub-block corresponds to the average code amount of 5 macroblocks, that is, 30 blocks. Depending on the block-to-block variation, the code amount of 5 macroblocks may fall within the code capacity of the compressed sub-blocks, and the code amount may exceed. While the overflow does not occur, the writing to the first data stream buffer 61 is performed in the same order as the writing to the data stream buffer 6 in the embodiment shown in FIG. When the code amount of a certain compressed sub-block overflows, the first buffer overflow detector 17 detects this, the writing of the code is stopped immediately before the overflow, and the block end code adder 153 is used to detect the block end code. First data stream buffer 6 added
The writing to 1 is completed, and the subsequent code is written to the second data stream buffer 62 by the buffer switch 18.

【0031】図12に、圧縮サブブロックがオーバーフ
ローする場合の第1データストリームバッファ61およ
び第2データストリームバッファ62に蓄えられるデー
タストリームの例を示す。訂正符号形成器7は、これら
のデータストリームからエラー訂正積ブロックを形成す
る。図13に、図12の例に対するエラー訂正積ブロッ
クを示す。第1データストリームバッファ61に蓄えた
データストリームは1つの圧縮サブブロックに収め、第
2データストリームバッファ62に蓄えたデータストリ
ームは容量に空きのある他の圧縮サブブロックに収め
る。
FIG. 12 shows an example of the data streams stored in the first data stream buffer 61 and the second data stream buffer 62 when the compressed sub-block overflows. The correction code former 7 forms an error correction product block from these data streams. FIG. 13 shows an error correction product block for the example of FIG. The data stream stored in the first data stream buffer 61 is stored in one compressed sub-block, and the data stream stored in the second data stream buffer 62 is stored in another compressed sub-block having a free space.

【0032】以上により、1つの圧縮サブブロックの中
には優先順位の高い符号が含まれているので、5マクロ
ブロック単位でデータストリームを再生して復号を行っ
ても、画質劣化の少ない再生画像を得ることができる。
したがって、5マクロブロック単位で定レート化を行う
フォーマットに対して定レート化の単位を15マクロブ
ロックに広げて高画質化を図ったモードを設ける場合、
互換性を確保することができる。
As described above, since one compressed sub-block contains a code with a high priority, even if the data stream is reproduced and decoded in units of 5 macroblocks, a reproduced image with little deterioration in image quality is obtained. Can be obtained.
Therefore, in the case of providing a mode in which the unit of constant rate conversion is expanded to 15 macroblocks for a format in which constant rate conversion is performed in units of 5 macroblocks, and a mode for improving image quality is provided
Compatibility can be ensured.

【0033】[0033]

【発明の効果】本発明によれば、オーバーフロー時に定
レート化を行う所定の個数のブロックのまとまり全体の
中で優先順位の低い符号を削減することにより、オーバ
ーフローが生じても大きな画質劣化を伴わずに符号化を
行うことができる。
According to the present invention, a code having a low priority is eliminated from the entire group of a predetermined number of blocks for which constant rate conversion is performed at the time of overflow, so that even if an overflow occurs, the image quality is greatly deteriorated. The encoding can be performed without any.

【0034】また、優先順位の高いものでサブブロック
を形成することにより、サブブロック単位で定レート化
を行うモードとの互換性を確保することができる。
Further, by forming the sub-blocks with the highest priority, compatibility with the mode in which constant rate conversion is performed in sub-block units can be ensured.

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

【図1】本発明の第1の実施例の記録装置のブロック図
である。
FIG. 1 is a block diagram of a recording apparatus according to a first embodiment of the present invention.

【図2】第1の実施例の符号化部の詳細ブロック図であ
る。
FIG. 2 is a detailed block diagram of an encoding unit according to the first embodiment.

【図3】離散コサイン変換ブロックの構成図である。FIG. 3 is a configuration diagram of a discrete cosine transform block.

【図4】各ブロックの可変長符号とマクロブロック毎の
データストリームの例を示す図である。
FIG. 4 is a diagram showing an example of a variable length code of each block and a data stream of each macro block.

【図5】第1の実施例における符号削減の様子を示す図
である。
FIG. 5 is a diagram showing how codes are reduced in the first embodiment.

【図6】第1の実施例におけるエラー訂正積ブロックの
構成図である。
FIG. 6 is a configuration diagram of an error correction product block in the first embodiment.

【図7】本発明の第2の実施例の符号化部のブロック図
である。
FIG. 7 is a block diagram of an encoding unit according to a second embodiment of the present invention.

【図8】第2の実施例における符号削減の様子を示す図
である。
FIG. 8 is a diagram showing how codes are reduced in the second embodiment.

【図9】本発明の第3の実施例の符号化部のブロック図
である。
FIG. 9 is a block diagram of an encoding unit according to a third embodiment of the present invention.

【図10】第3の実施例における符号削減の様子を示す
図である。
FIG. 10 is a diagram showing how codes are reduced in the third embodiment.

【図11】本発明の第4の実施例の符号化部のブロック
図である。
FIG. 11 is a block diagram of an encoding unit according to a fourth embodiment of the present invention.

【図12】第4の実施例におけるデータストリームバッ
ファの内容を示す図である。
FIG. 12 is a diagram showing the contents of a data stream buffer in the fourth embodiment.

【図13】第4の実施例におけるエラー訂正積ブロック
の構成図である。
FIG. 13 is a configuration diagram of an error correction product block in the fourth embodiment.

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

5…可変長符号器、 6…データストリームバッファ、 7…訂正符号形成器、 10…符号情報記憶部、 14…符号優先順位判定器、 15…データストリーム形成器。 5 ... Variable-length encoder, 6 ... Data stream buffer, 7 ... Correction code former, 10 ... Code information storage unit, 14 ... Code priority determination unit, 15 ... Data stream former.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 市毛 健志 神奈川県横浜市戸塚区吉田町292番地株式 会社日立製作所映像メディア研究所内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Takeshi Ichige 292 Yoshida-cho, Totsuka-ku, Yokohama, Kanagawa Prefecture

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】動画像データをブロックに分割して直交変
換を行い、得られた変換係数を量子化し、その結果に可
変長符号を割り当てることによりデータの圧縮を行う動
画像圧縮方式における、所定の個数のブロックより成る
圧縮ブロックの圧縮後の符号量を一定にする圧縮動画像
符号量制御装置において、 上記圧縮ブロック内のすべての可変長符号に関する情報
を記憶する符号情報記憶手段と、記憶された可変長符号
の優先順位を付ける優先順位決定手段と、圧縮後の符号
量が所定の符号量を超えた場合に優先順位の低い可変長
符号を削除して所定の符号量内に収める符号削減手段を
備えていることを特徴とする圧縮動画像符号量制御装
置。
1. A predetermined method in a moving image compression method for compressing data by dividing moving image data into blocks, performing orthogonal transformation, quantizing the obtained transform coefficient, and assigning a variable length code to the result. In a compressed moving image code amount control device for making a compressed code amount of a compressed block consisting of a number of blocks constant, code information storage means for storing information on all variable length codes in the compressed block, Priority-determining means for prioritizing the variable-length codes, and reducing the variable-length codes having a lower priority by deleting the variable-length codes having a lower priority when the code amount after compression exceeds a predetermined code amount. A compressed moving image code amount control device comprising means.
【請求項2】請求項1において、優先順位決定手段は圧
縮ブロックの中で低周波の変換係数に対応する可変長符
号から高周波の変換係数に対応する可変長符号への並び
換えを行う手段であり、符号削減手段は並び換えた可変
長符号のつながりが所定の符号量を超えた場合にそれ以
降の可変長符号を捨てる手段であることを特徴とする圧
縮動画像符号量制御装置。
2. The priority determining means according to claim 1, wherein the variable length code corresponding to the low frequency transform coefficient in the compression block is rearranged to the variable length code corresponding to the high frequency transform coefficient. A compressed moving image code amount control device, wherein the code reduction unit is a unit that discards the variable length codes after that when the connection of the rearranged variable length codes exceeds a predetermined code amount.
【請求項3】請求項2において、符号削減手段により可
変長符号の捨てられたブロックに対してブロック終了符
号を付加する手段を備えていることを特徴とする圧縮動
画像符号量制御装置。
3. The compressed moving picture code amount control device according to claim 2, further comprising means for adding a block end code to the block in which the variable length code is discarded by the code reduction means.
【請求項4】請求項1において、優先順位決定手段は圧
縮ブロックの中で最も優先順位の低い可変長符号を選定
する手段であり、符号削減手段は所定の符号量に収まる
まで選定された可変長符号を削除してゆく手段であるこ
とを特徴とする圧縮動画像符号量制御装置。
4. The priority determining means according to claim 1 is a means for selecting a variable length code having the lowest priority among the compressed blocks, and the code reducing means is a variable selected until the code quantity falls within a predetermined code amount. A compressed moving image code amount control device characterized in that it is means for deleting a long code.
【請求項5】動画像データをブロックに分割して直交変
換を行い、得られた変換係数を量子化し、その結果に可
変長符号を割り当てることによりデータの圧縮を行う動
画像圧縮方式における、所定の個数のブロックより成る
圧縮ブロックの圧縮後の符号量を一定にする圧縮動画像
符号量制御装置において、 上記圧縮ブロックを複数に分割した圧縮サブブロック内
のすべての可変長符号に関する情報を記憶する符号情報
記憶手段と、圧縮サブブロックの中での可変長符号の優
先順位を付ける手段と、優先順位の高い符号から順に圧
縮サブブロックに均等に割り当てた符号量に達するまで
の符号で符号列を形成し、均等に割り当てた符号量より
溢れた優先順位の低い符号は均等に割り当てた符号量に
達しない他の圧縮サブブロックの符号とあわせて符号列
を形成する符号列形成手段を備えていることを特徴とす
る圧縮動画像符号量制御装置。
5. A predetermined method in a moving image compression method for compressing data by dividing moving image data into blocks, performing orthogonal transformation, quantizing the obtained transform coefficient, and assigning a variable length code to the result. In a compressed moving picture code amount control device for making a compressed code amount of a compressed block composed of a number of blocks constant, information on all variable length codes in a compressed sub-block obtained by dividing the compressed block into a plurality of pieces is stored. Code information storage means, means for prioritizing variable-length codes in the compressed sub-blocks, and a code string with codes up to the code amount evenly allocated to the compressed sub-blocks in order from the code with the highest priority. Codes that are formed and have a lower priority that overflows the evenly allocated code amount are combined with the codes of other compressed sub-blocks that do not reach the evenly allocated code amount. A compressed moving image code amount control device, comprising: a code string forming means for forming a code string.
JP3175992A 1992-02-19 1992-02-19 Compressed moving image code amount controller Pending JPH05236448A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3175992A JPH05236448A (en) 1992-02-19 1992-02-19 Compressed moving image code amount controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3175992A JPH05236448A (en) 1992-02-19 1992-02-19 Compressed moving image code amount controller

Publications (1)

Publication Number Publication Date
JPH05236448A true JPH05236448A (en) 1993-09-10

Family

ID=12339960

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3175992A Pending JPH05236448A (en) 1992-02-19 1992-02-19 Compressed moving image code amount controller

Country Status (1)

Country Link
JP (1) JPH05236448A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007295023A (en) * 2006-04-20 2007-11-08 Pioneer Electronic Corp Moving picture processing apparatus and method, and computer program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007295023A (en) * 2006-04-20 2007-11-08 Pioneer Electronic Corp Moving picture processing apparatus and method, and computer program

Similar Documents

Publication Publication Date Title
EP0677969B1 (en) Moving picture coding method and an apparatus therefor
US20070237230A1 (en) Video encoding method and apparatus, and video decoding method and apparatus
US20100172593A1 (en) Image encoding apparatus, image encoding method, and image encoding program
JPH09214962A (en) Moving video image compression system having vacant/ full buffer look ahead bit allocator
KR19980042772A (en) Moving picture variable bit rate coding apparatus, moving picture variable bit rate coding method, and moving picture variable bit rate coding program recording medium
US6628839B1 (en) Image coding system converting apparatus, image coding system converting method, and recording medium
JPH10243399A (en) Code amount controller and moving image encoder provided with the same
KR100796857B1 (en) Moving image encoding method and apparatus
WO1998041027A1 (en) Video signal coding method and coding device
JP2002027469A (en) Bit stream converting method and device, and program recording medium
JPH10164577A (en) Dynamic image encoder
JP2000324494A (en) Animation encoding device
JP3818819B2 (en) Image coding method conversion apparatus, image coding method conversion method, and recording medium
US7751474B2 (en) Image encoding device and image encoding method
JP3599942B2 (en) Moving picture coding method and moving picture coding apparatus
JPH08130746A (en) Coefficient quantization processing method
JPH10215460A (en) Moving image variable bit rate encoding device and method, and recording medium for moving image variable bit rate encoding program
JPH05236448A (en) Compressed moving image code amount controller
JP2002199408A (en) Moving image coding method and moving image coder
JP2001069012A (en) Variable length decoder and moving picture decoder using it
JPH1023432A (en) Picture compression-encoding device
JP3767007B2 (en) Encoding apparatus and encoding method
JPH11234671A (en) Signal processing unit
JP3175328B2 (en) Image coding device
JP2000333180A (en) Skip macro block inhibit control method, skip macro block inhibit controller and medium recording skip macro block inhibit control program