JPH06105296A - Variable length coding and decoding method - Google Patents
Variable length coding and decoding methodInfo
- Publication number
- JPH06105296A JPH06105296A JP4249790A JP24979092A JPH06105296A JP H06105296 A JPH06105296 A JP H06105296A JP 4249790 A JP4249790 A JP 4249790A JP 24979092 A JP24979092 A JP 24979092A JP H06105296 A JPH06105296 A JP H06105296A
- Authority
- JP
- Japan
- Prior art keywords
- code
- level
- length
- run
- output
- 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
Links
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
(57)【要約】
【目的】符号化効率を下げずに、2次元ハフマン符号テ
ーブルが用意する係数のレベルについて範囲を拡張する
方法を提案する。
【構成】符号化では、要求される画質に応じて必要とさ
れる直交変換係数の精度を切り換え、それにより2次元
ハフマン等の可変長符号テーブルの係数のレベル範囲を
適応的に拡張する。また、復号化では、伝送されてくる
直交変換係数の精度に応じて適応的に2次元ハフマン符
号等の可変長符号テーブルの拡張を行う。
(57) [Summary] [Objective] To propose a method for expanding the range of coefficient levels prepared by a two-dimensional Huffman code table without lowering the coding efficiency. In encoding, the required accuracy of the orthogonal transform coefficient is switched according to the required image quality, thereby adaptively expanding the level range of the coefficient of the variable-length code table such as two-dimensional Huffman. In the decoding, the variable length code table such as the two-dimensional Huffman code is adaptively expanded according to the accuracy of the transmitted orthogonal transform coefficient.
Description
【0001】[0001]
【産業上の利用分野】本発明は、動画像の符号化及び復
号化装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a moving picture coding and decoding apparatus.
【0002】[0002]
【従来の技術】符号化方式の代表的なものとしてハフマ
ン符号化がある。その1つである2次元ハフマン符号化
は、動画像の符号化方式として代表的なものである2次
元のDCT(Discrete Cosine Transform)の変換係数
の伝送に関して、広く用いられている。2. Description of the Related Art Huffman coding is a typical coding method. One of them, two-dimensional Huffman coding, is widely used for transmission of transform coefficients of two-dimensional DCT (Discrete Cosine Transform), which is a typical moving picture coding system.
【0003】2次元のDCTの変換係数の伝送に関し
て、図1、図3にそって説明する。Transmission of transform coefficients of a two-dimensional DCT will be described with reference to FIGS. 1 and 3.
【0004】 2次元DCT 画像を8×8からなるブロックに分割し、各ブロックに
2次元DCTを施し、DCT変換係数を得る。A two-dimensional DCT image is divided into 8 × 8 blocks, and each block is subjected to two-dimensional DCT to obtain DCT transform coefficients.
【0005】 変換係数の量子化 DCT変換係数を量子化器により与えられた量子化ステ
ップで量子化する。Quantization of Transform Coefficients DCT transform coefficients are quantized at the quantization step given by the quantizer.
【0006】 ジグザグ走査 量子化後の変換係数を図2に示すようなジグザグ走査を
しながら、1次元配列に格納する。Zigzag scanning The quantized transform coefficients are stored in a one-dimensional array while performing zigzag scanning as shown in FIG.
【0007】 2次元ハフマン符号化 1次元配列に格納された量子化係数を、この順序で見て
いき、零でない値をもつ変換係数について、その値と相
対位置をセットにして可変長符号を構成し、伝送する。
まず、符号化対象の有意変換係数とその直前のすでに符
号化済みの有意変換係数との間に挟まれた量子化出力が
零の変換係数(非有意係数)の個数を求め、それをラン
長(run-lengthという)とする。このラン長と符号化対
象の有意変換係数の値(levelという)の組合せ(run-l
ength,level)を、予め用意された2次元ハフマン符号
テーブル(表1)に基づいて符号化する。そして、ブロ
ック内のすべての有意係数の符号化を完了したならば、
表1のハフマン符号を用いてEOB(end of block)と
いう符号を送る。Two-dimensional Huffman Coding A quantized coefficient stored in a one-dimensional array is examined in this order, and for a conversion coefficient having a non-zero value, its value and relative position are set to form a variable length code. And transmit.
First, find the number of transform coefficients (insignificant coefficients) with a quantized output of zero sandwiched between the significant transform coefficient to be coded and the preceding significant transform coefficient that has already been coded, and then calculate the run length. (Called run-length). The combination (run-l) of this run length and the value of the significant conversion coefficient to be encoded (called level)
ength, level) based on a two-dimensional Huffman code table (Table 1) prepared in advance. And if you have coded all the significant coefficients in the block, then
A code called EOB (end of block) is sent using the Huffman code in Table 1.
【0008】以上が、ハフマン符号化のアルゴリズムで
ある。The above is the Huffman coding algorithm.
【0009】次いで、表1〜5の2次元ハフマン符号テ
ーブルについて説明する。表1〜5は、ISO/IEC
/JTC1/SC2/WG11(通称MPEGという)
において、決められた動画像符号化の標準方式(通称M
PEG1という)で使用されているDCT係数の符号化
用の2次元ハフマン符号テーブルである。Next, the two-dimensional Huffman code table of Tables 1 to 5 will be described. Tables 1 to 5 are ISO / IEC
/ JTC1 / SC2 / WG11 (commonly called MPEG)
, A standard method of moving image coding that has been decided (commonly known as M
2 is a two-dimensional Huffman code table for coding DCT coefficients used in (referred to as PEG1).
【0010】[0010]
【表1】 [Table 1]
【0011】[0011]
【表2】 [Table 2]
【0012】[0012]
【表3】 [Table 3]
【0013】[0013]
【表4】 [Table 4]
【0014】[0014]
【表5】 [Table 5]
【0015】表1〜4の表において2カラム目は符号化
対象の有意変換係数とその直前のすでに符号化済みの有
意変換係数との間に挟まれた量子化出力が零の変換係数
(非有意係数)の個数、すなわちラン長(run-lengthと
いう)をあらわし、3カラム目は符号化対象の有意変換
係数の絶対値(levelという)を表す。そして、1カラ
ム目が上記の(run-length,level)の組合せに対応し
たハフマン符号である。In the tables of Tables 1 to 4, the second column is a conversion coefficient (non-conversion) having a zero quantized output sandwiched between the significant conversion coefficient to be encoded and the immediately preceding significant conversion coefficient already encoded. It represents the number of significant coefficients, that is, the run length (called run-length), and the third column represents the absolute value (called level) of the significant conversion coefficient to be encoded. The first column is the Huffman code corresponding to the above (run-length, level) combination.
【0016】2次元ハフマン符号テーブルは、すべての
ラン長(0から63)とすべてのレベル(−255〜+
255)の組合せについて、VLC(可変長符号)コー
ドが用意されているわけではなく、使用頻度が低いと考
えられるラン長とレベルの組合せについては、表5で示
されるFLC(固定長符号)コードが用意される。The two-dimensional Huffman code table has all run lengths (0 to 63) and all levels (-255 to +).
No VLC (variable length code) code is prepared for the combination (255), and the FLC (fixed length code) code shown in Table 5 for the combinations of run length and level which are considered to be infrequently used. Is prepared.
【0017】与えられたラン長とレベルの組合せが表1
〜5の表に存在しない場合、可変長符号化器はまず、"e
scape"コード(表1)を出力し、次いで、ラン長を6ビ
ットのFLCコード(表5)で出力し、次いで、レベル
を表5に基づいて出力する。The given combination of run length and level is shown in Table 1.
If it does not exist in the table of ~ 5, the variable length coder first uses "e
The "scape" code (Table 1) is output, then the run length is output as a 6-bit FLC code (Table 5), and then the level is output based on Table 5.
【0018】まず、レベルが−127〜+127の範囲
である場合は、8ビットのFLCコードで出力する。レ
ベルがこの範囲外である場合は8ビットの"escape"コー
ド("0000 0000" or "1000 0000)を出力し、次いで8
ビットのFLCコードでレベルを出力する。First, when the level is in the range of -127 to +127, an 8-bit FLC code is output. If the level is out of this range, the 8-bit "escape" code ("0000 0000" or "1000 0000") is output and then 8
The level is output with a bit FLC code.
【0019】ハフマン符号で使用される2次元ハフマン
符号テーブルは、すべての有意変換係数の値に対して用
意されているとは限らないため、問題が生ずることがあ
る。たとえばMPEG1では、入力画像の画素値の範囲
が9ビット(−255〜+255)であるので、2次元
DCTされた変換係数の範囲は12ビット(−2048
〜+2047)に及ぶ。The two-dimensional Huffman code table used in the Huffman code is not always prepared for all the values of the significant transform coefficients, which may cause a problem. For example, in MPEG1, the range of the pixel value of the input image is 9 bits (-255 to +255), so the range of the two-dimensional DCT conversion coefficient is 12 bits (-2048).
To +2047).
【0020】しかし、表1〜5で参照したMPEG1で
使用されている2次元ハフマン符号テーブルは、level
に関しては−255〜+255の範囲でしか用意されて
いない。そのため図1の量子化の段に際しては、量子化
後の係数値が−255〜+255の範囲に収まるように
量子化後の係数値を監視する必要がある。もし、量子化
後の係数値がこの範囲を越える場合は、範囲内に収まる
ように量子化ステップをさらに大きくしなければならな
い。However, the two-dimensional Huffman code table used in MPEG1 referred to in Tables 1 to 5 is
Is prepared only in the range of -255 to +255. Therefore, at the quantization stage in FIG. 1, it is necessary to monitor the quantized coefficient values so that the quantized coefficient values fall within the range of −255 to +255. If the quantized coefficient value exceeds this range, the quantization step must be further increased so that it falls within the range.
【0021】従って、このような大きなレベルの変換係
数が発生したブロックでは、当初に望んでいたより、大
きな量子化ステップを用いなければならないことにな
り、画質を下げざるを得なくなってしまう。Therefore, in a block in which a transform coefficient of such a large level has occurred, a quantization step larger than initially desired must be used, and the image quality must be lowered.
【0022】このような現状から見て、MPEG1にお
いて、より高画質を目指すためには2次元ハフマン符号
テーブルが用意する係数のレベルについてその範囲を拡
張する必要があると考えられるが、その拡張方法に関し
て具体的な方法は、未だ提示されていない。In view of such a current situation, it is considered that the range of the coefficient level prepared by the two-dimensional Huffman code table needs to be expanded in order to achieve higher image quality in MPEG1. No specific method has yet been presented for.
【0023】[0023]
【発明が解決しようとする課題】従来ある−255〜+
255の範囲しか用意されていない2次元ハフマン符号
テーブルをより大きな範囲に拡張する場合、単純に最大
の範囲である12ビット(−2048〜+2047)に
広げるのでは、符号化の効率で無駄が生ずる。[Problems to be Solved by the Invention] Conventionally, -255 to +
When a two-dimensional Huffman code table prepared only for the range of 255 is expanded to a larger range, simply expanding the maximum range to 12 bits (-2048 to +2047) causes waste of coding efficiency. .
【0024】すなわち、要求される画質が量子化された
DCT係数の精度として12ビットを必要としない場合
でも、テーブルとして12ビット範囲に拡張されたもの
しか用意されていない場合は、冗長な符号を出力してし
まうことになる。そのため、2次元ハフマン符号テーブ
ルの拡張に際しては、要求される画質に応じたビット数
のテーブル拡張を行なう工夫が必要となる。That is, even if the required image quality does not require 12 bits as the precision of the quantized DCT coefficient, if only a table extended to the 12-bit range is prepared as a table, a redundant code is used. It will be output. Therefore, when expanding the two-dimensional Huffman code table, it is necessary to devise a table expansion of the number of bits according to the required image quality.
【0025】[0025]
【課題を解決するための手段】符号器側では、要求され
る画質に応じて、必要とされるDCTなどの直交変換係
数の精度(ビット数)をシーケンス、またはGOP(gr
oup of Pictures)、またはピクチャ、またはスライ
ス、またはMB(macro block)またはブロック単位で
伝送し、その情報に従って、可変長符号化器は適応的に
2次元ハフマン符号などの可変長符号テーブルの拡張を
おこない、可変長符号を出力することを特徴とする。On the encoder side, the accuracy (the number of bits) of an orthogonal transform coefficient such as DCT required according to the required image quality is sequenced or GOP (gr
oup of Pictures) or pictures or slices, or MB (macro block) or block units, and the variable length encoder adaptively extends the variable length code table such as the two-dimensional Huffman code according to the information. And output a variable length code.
【0026】また復号器側では、伝送されてくるDCT
などの直交変換係数の精度(ビット数)をシーケンス、
またはGOP(group of Pictures)、またはピクチ
ャ、またはスライス、またはMB(macro block)また
はブロック単位で受けとり、それに応じて、復号化器
は、適応的に2次元ハフマン符号などの可変長符号テー
ブルの拡張をおこない、伝送されてくるDCTなどの直
交変換係数を復号することを特徴とする。On the decoder side, the transmitted DCT
Sequences the accuracy (number of bits) of orthogonal transform coefficients, such as
Or, a GOP (group of Pictures), a picture, or a slice, or an MB (macro block) or a block unit is received, and accordingly, the decoder adaptively extends a variable length code table such as a two-dimensional Huffman code. Is performed and the transmitted orthogonal transform coefficient such as DCT is decoded.
【0027】[0027]
【作用】本発明の符号器によれば、要求される画質に応
じて、必要とされるDCT等の直交変換係数の精度(ビ
ツト数)に従い、適応的に可変長テーブルの拡張を行
い、可変長符号を出力するので、無駄の無い符号化が可
能となる。According to the encoder of the present invention, the variable length table is adaptively expanded according to the required accuracy (bit number) of the orthogonal transform coefficient such as DCT according to the required image quality. Since the long code is output, it is possible to perform coding without waste.
【0028】また、本発明の復号器によれば、伝送され
てくるDCT等の直交変換係数の精度に応じて、適応的
に2次元ハフマン符号等の可変長符号のテーブルの拡張
を行い、復号するので、無駄の無い復号化が可能とな
る。Further, according to the decoder of the present invention, the table of the variable length code such as the two-dimensional Huffman code is adaptively expanded and decoded according to the accuracy of the orthogonal transform coefficient such as the DCT transmitted. Therefore, it is possible to perform decoding without waste.
【0029】[0029]
【実施例】実施例の説明に入る前に、先ず、シーケン
ス、GOP、ピクチャ、スライス、MB(マクロブロツ
ク)、ブロツクについて図8を用いて説明する。DESCRIPTION OF THE PREFERRED EMBODIMENTS Before starting the description of the embodiments, first, sequences, GOPs, pictures, slices, MBs (macro blocks), and blocks will be described with reference to FIG.
【0030】ブロツク層 ブロツクは、輝度または色差の隣あった例えば8ライン
×8画素から構成される。例えば、DCTはこの単位で
実行される。Block Layer The block is composed of, for example, 8 lines × 8 pixels adjacent to each other in luminance or color difference. For example, DCT is executed in this unit.
【0031】MB層 MBは、左右及び上下に隣あった4つの輝度ブロツク
と、画像上では同じ位置にあたるCb ,Cr それぞれの
色差ブロツクの全部で6つのブロツクで構成される。伝
送の順はY0,Y1,Y2,Y3,Cb,Cr である。予測データ
に何を用いるか、差分を送らなくても良いかなどは、こ
の単位で判断される。MB layer MB is composed of four luminance blocks adjacent to each other on the left, right, top and bottom, and a total of six color difference blocks of Cb and Cr corresponding to the same position on the image. The order of transmission is Y0, Y1, Y2, Y3, Cb, Cr. What is used for the prediction data, whether it is not necessary to send the difference, and the like are determined in this unit.
【0032】スライス層 画像の走査順に連なる1つまたは複数のマクロブロツク
で構成される。スライスの頭では、画像内における動き
ベクトル、DC成分の差分がリセツトされ、最初のマク
ロブロツクは画像内での位置を示すデータを持ってお
り、エラーが起こった場合でも復帰できるように考えら
れている。そのためスライスの長さ、始まる位置は任意
で、伝送路のエラー状態によって変えられるようになっ
ている。The slice layer image is composed of one or a plurality of macroblocks arranged in the scanning order. At the head of the slice, the difference between the motion vector and the DC component in the image is reset, and the first macroblock has the data indicating the position in the image, so that it is possible to recover even if an error occurs. There is. Therefore, the length and starting position of the slice are arbitrary and can be changed depending on the error condition of the transmission path.
【0033】ピクチヤ層 ピクチヤつまり1枚1枚の画像は、少なくとも1つまた
は複数のスライスから構成される。そして符号化される
方式にしたがって、Iピクチヤ、Pピクチヤ、Bピクチ
ヤ、Dピクチヤに分類される。PICTURE LAYER PICTURE, that is, each image is composed of at least one or more slices. Then, it is classified into I-picture, P-picture, B-picture and D-picture according to the encoding method.
【0034】GOP GOPは、1又は複数枚のIピクチヤと0又は複数枚の
非Iピクチヤから構成される。GOP A GOP is composed of one or more I-pictures and zero or more non-I-pictures.
【0035】ビデオシーケンス層 ビデオシーケンスは、画像サイズ、画像レート等が同じ
1または複数のGOPから構成される。Video Sequence Layer A video sequence is composed of one or more GOPs having the same image size, image rate and the like.
【0036】(1)実施例1 実施例1では、MPEG1で用いられているDCT係数
用の2次元ハフマン符号テーブルの係数レベル範囲を拡
張する場合に関して説明する。(1) First Embodiment In the first embodiment, the case of expanding the coefficient level range of the two-dimensional Huffman code table for DCT coefficients used in MPEG1 will be described.
【0037】符号化装置の動作を図4に基づいて説明す
る。 ステツプ(e−1) 要求される画質に応じて、必要とされるDCTなどの直
交変換係数の精度(ビット数)を表す信号をシーケン
ス、またはGOP(group of Pictures)、またはピク
チャ、またはスライス、またはMB(macro block)ま
たはブロック単位で伝送する。The operation of the encoder will be described with reference to FIG. Step (e-1) Depending on the required image quality, a signal representing the required accuracy (number of bits) of the orthogonal transform coefficient such as DCT is sequenced, or GOP (group of Pictures), picture, or slice, Alternatively, it is transmitted in MB (macro block) or block units.
【0038】例えば精度が、 8ビットである場合は、−127〜+127 9ビットである場合は、−255〜+255 10ビットである場合は、−511〜+511 11ビットである場合は、−1023〜+1023 12ビットである場合は、−2047〜+2047 のレベル範囲を表現可能となる。For example, when the precision is 8 bits, -127 to +127 9 bits, -255 to +255 10 bits, -511 to +511 11 bits, -1023 to. In the case of +1023 12 bits, the level range of -2047 to +2047 can be expressed.
【0039】ステツプ(e−2) 符号化すべきrun-lengthとlevelの組合せがVLCテー
ブル(表1〜4)に存在するかしないかを調べる。存在
する場合は、あてはまるVLCコードを出力する。そう
でない時はステツプ(e−3)へ進む。Step (e-2) It is checked whether or not the combination of run-length and level to be encoded exists in the VLC table (Tables 1 to 4). If so, it outputs the applicable VLC code. If not, proceed to step (e-3).
【0040】ステツプ(e−3) 符号化すべきrun-lengthとlevelの組合せがVLCテー
ブルに存在しない場合は、まず、"escape"コード(表
1)を出力し、次いで、表5を参照し、ラン長を6ビッ
トのFLCコード(表5)で出力する。Step (e-3) If the combination of run-length and level to be encoded does not exist in the VLC table, first output the "escape" code (Table 1), then refer to Table 5, The run length is output as a 6-bit FLC code (Table 5).
【0041】ステツプ(e−4) ステツプ(e−1)での直交変換係数の精度(ビット
数)を表す信号に基づいて表6を参照し、レベルをその
ビット幅で出力する。Step (e-4) Referring to Table 6 on the basis of the signal indicating the accuracy (the number of bits) of the orthogonal transform coefficient in step (e-1), the level is output with the bit width.
【0042】[0042]
【表6】 [Table 6]
【0043】復号化装置の動作を図5に基づいて説明す
る。 ステツプ(d−1) シーケンス、またはGOP(group of Pictures)、ま
たはピクチャ、またはスライス、またはMB(macro bl
ock)またはブロック単位で伝送されてくるDCT変換
係数の精度(ビット数)を表す信号を受けとる。The operation of the decoding device will be described with reference to FIG. Step (d-1) sequence, GOP (group of Pictures), picture, slice, or MB (macro bl)
ock) or a signal representing the precision (the number of bits) of the DCT transform coefficient transmitted in block units.
【0044】ステツプ(d−2) 伝送されてきた2次元ハフマンコードを復号する。run-
lengthが"escape"コード(表1)でない場合、復号され
た run-lengthとlevelの値を得る。そうでない場合はス
テツプ(d−3)へ進む。Step (d-2) The transmitted two-dimensional Huffman code is decoded. run-
If the length is not an "escape" code (Table 1), get the decoded run-length and level values. Otherwise, go to step (d-3).
【0045】ステツプ(d−3) run-lengthが"escape"コード(表1)である場合、次い
で、表5を参照し、6ビットのrun-lengthを読み込む。
得られた値が run-length となる。Step (d-3) If the run-length is the "escape" code (Table 1), then referring to Table 5, read the 6-bit run-length.
The value obtained is the run-length.
【0046】ステツプ(d−4) ステツプ(d−1)での直交変換係数の精度(ビット
数)を表す信号に基づいて、表6を参照し、レベルをそ
のビット数で読み込む。得られた値がレベルとなる。Step (d-4) Based on the signal indicating the accuracy (the number of bits) of the orthogonal transform coefficient in step (d-1), refer to Table 6 and read the level in the number of bits. The obtained value becomes the level.
【0047】(2)実施例2 実施例1と同様に、MPEG1で用いられているDCT
係数用の2次元ハフマン符号テーブルの係数範囲を拡張
する場合に関して説明する。符号化装置の動作を図6に
基づいて説明する。(2) Second Embodiment Similar to the first embodiment, the DCT used in MPEG1
A case of expanding the coefficient range of the two-dimensional Huffman code table for coefficients will be described. The operation of the encoding device will be described based on FIG.
【0048】ステツプ(e−1) 要求される画質に応じて、必要とされるDCTなどの直
交変換係数の精度(ビット数)を表す信号をシーケン
ス、またはGOP(group of Pictures)、またはピク
チャ、またはスライス、またはMB(macro block)ま
たはブロック単位で伝送する。Step (e-1) A signal representing the required accuracy (the number of bits) of the orthogonal transform coefficient such as DCT is sequenced, or GOP (group of Pictures), or picture, according to the required image quality. Alternatively, it is transmitted in units of slices, MBs (macro blocks), or blocks.
【0049】ステツプ(e−2) 符号化すべきrun-lengthとlevelの組合せがVLCテー
ブル(表1〜4)に存在するかいないかを調べる。存在
する場合は、あてはまるVLCコードを出力する。そう
でない時はステツプ(e−3)へ進む。Step (e-2) It is checked whether or not the combination of run-length and level to be encoded exists in the VLC table (Tables 1 to 4). If so, it outputs the applicable VLC code. If not, proceed to step (e-3).
【0050】ステツプ(e−3) 符号化すべきrun-lengthとlevelの組合せがVLCテー
ブルに存在しない場合は、まず、"escape"コード(表
1)を出力し、次いで、表5を参照し、ラン長を6ビッ
トのFLCコード(表5)で出力する。Step (e-3) If the combination of run-length and level to be encoded does not exist in the VLC table, first output the "escape" code (Table 1), then refer to Table 5, The run length is output as a 6-bit FLC code (Table 5).
【0051】ステツプ(e−4) レベルが −127〜+127の範囲である時は、8ビ
ットのFLCコードで出力する。そうでない時はステツ
プ(e−5)へ進む。When the step (e-4) level is in the range of -127 to +127, the 8-bit FLC code is output. If not, proceed to step (e-5).
【0052】ステツプ(e−5) レベルが、正の値である時は "0000 0000"のコードを、
また負の値である時は"1000 0000"のコードを出力す
る。次いで、ステツプ(e−1)での直交変換係数の精
度(ビット数)を表す信号に基づいて、表7を参照し、
レベルを(そのビット数−1)の幅で出力する。Step (e-5) When the level is a positive value, the code "0000 0000"
When the value is negative, the code "1000 0000" is output. Then, referring to Table 7, based on the signal representing the accuracy (the number of bits) of the orthogonal transform coefficient in step (e-1),
The level is output with a width of (the number of bits-1).
【0053】[0053]
【表7】 [Table 7]
【0054】復号化装置の動作を図7に基づいて説明す
る。 ステツプ(d−1) シーケンス、またはGOP(group of Pictures)、ま
たはピクチャ、またはスライス、またはMB(macro bl
ock)またはブロック単位で伝送されてくるDCT変換
係数の精度(ビット数)を表す信号を受けとる。The operation of the decoding device will be described with reference to FIG. Step (d-1) sequence, GOP (group of Pictures), picture, slice, or MB (macro bl)
ock) or a signal representing the precision (the number of bits) of the DCT transform coefficient transmitted in block units.
【0055】ステツプ(d−2) 伝送されてきた2次元ハフマンコードを復号する。run-
lengthが"escape"コード(表1)でない場合、復号され
た run-lengthとlevelの値を得る。そうでない場合は、
ステツプ(d−3)へ進む。Step (d-2) The transmitted two-dimensional Huffman code is decoded. run-
If the length is not an "escape" code (Table 1), get the decoded run-length and level values. If not,
Proceed to step (d-3).
【0056】ステツプ(d−3) run-lengthが"escape"コード(表1)である場合、次い
で、表5を参照し、6ビットのrun-lengthを読み込む。
得られた値が run-length となる。Step (d-3) If the run-length is the "escape" code (Table 1), then referring to Table 5, read the 6-bit run-length.
The value obtained is the run-length.
【0057】ステツプ(d−4) 次いで、8ビットを読み込む。この時の値が"0000 000
0"または"1000 0000"でない場合は、この値をレベルと
する。そうでない場合は(d−5)へ進む。Step (d-4) Next, 8 bits are read. The value at this time is "0000 000
If it is not 0 "or" 1000 0000 ", this value is set as the level. If not, proceed to (d-5).
【0058】ステツプ(d−5) 値が"0000 0000"または"1000 0000"である場合は、次い
でステツプ(d−1)での直交変換係数の精度(ビット
数)を表す信号に基づいて、表7を参照し、レベルを
(そのビット数−1)の幅で読み込む。得られた値がレ
ベルとなる。If the step (d-5) value is "0000 0000" or "1000 0000", then, based on the signal representing the precision (the number of bits) of the orthogonal transform coefficient at step (d-1), Referring to Table 7, the level is read with a width of (the number of bits-1). The obtained value becomes the level.
【0059】ところで、以下に、シーケンス、またはG
OP(group of Pictures)、またはピクチャ、または
スライス、またはMB(macro block)またはブロック
単位で伝送するDCTなどの変換係数の精度(ビット
数)を変更する方法を説明する。By the way, the sequence or G
A method for changing the precision (the number of bits) of a transform coefficient such as an OP (group of pictures), a picture, a slice, an MB (macro block), or a DCT transmitted in block units will be described.
【0060】(A)符号化前に、精度を決めておく場合 (a)リアルタイムで符号化を行なう場合 要求される画質に応じて、DCTなどの変換係数の精度
を予め決定し、それにより必要に応じて、係数用の可変
長テーブルの拡張をシーケンス単位で指示する。例え
ば、DCT係数レベルの最大範囲が−2047〜+20
47(これはMPEGのDCTモジュールから出力され
る最大範囲)である時、要求される画質として劣化なし
(Loss-Less coding)を望んでいる場合、必要とされる
係数用の可変長テーブルのレベルの範囲としては、最大
限の12ビットを用意しなければならない。(A) When the accuracy is determined before the encoding (a) When the encoding is performed in real time The accuracy of the transform coefficient such as DCT is determined in advance in accordance with the required image quality, and it is necessary accordingly. According to the above, expansion of the variable length table for coefficients is instructed in sequence units. For example, the maximum range of the DCT coefficient level is -2047 to +20.
If it is 47 (this is the maximum range output from the MPEG DCT module) and you want Loss-Less coding as the required image quality, the level of the variable length table for the required coefficients. For the range of, a maximum of 12 bits must be prepared.
【0061】(b)ノンリアルタイムで符号化を行なう
場合 まず、符号化したい動画像に対して、あらかじめDCT
などの直交変換を施し、変換係数のレベルについて統計
的な分布を調査する。次に、この統計データと要求され
る画質とに基づいて、必要とされる係数用の可変長テー
ブルのレベルの範囲を決定する。例えば、上記の統計デ
ータの最大レベルが1000であり、また要求される画
質として劣化なし(Loss-Less coding)を望んでいる場
合、必要とされる係数用の可変長テーブルのレベルの範
囲としては、−1023〜+1023(11ビット)必
要となる。(B) When encoding in non-real time First, the DCT is previously performed on the moving image to be encoded.
Orthogonal transformation such as is performed, and the statistical distribution of the transformation coefficient level is investigated. Then, based on this statistical data and the required image quality, the level range of the variable length table for the required coefficient is determined. For example, when the maximum level of the above statistical data is 1000 and the desired image quality is Loss-Less coding, the level range of the variable length table for the required coefficient is , -1023 to +1023 (11 bits) are required.
【0062】上記の統計データをシーケンス、またはG
OP、またはピクチャ、またはスライス、またはMB単
位で調査を行ない、それぞれの統計データに基づいて適
応的に係数用の可変長テーブルのレベルの範囲を決定す
る。可変長テーブルのレベルの範囲の初期指定、もしく
は処理中においての変更に際しては、シーケンス、また
はGOP、またはピクチャ、またはスライス、またはM
B単位に存在する1ビットのフラグでその旨を指示し、
次いで使用する可変長テーブルのレベルの範囲を示す情
報を伝送する。The above statistical data is sequenced or G
By investigating in units of OP, picture, slice, or MB, the range of the level of the variable length table for coefficients is adaptively determined based on the respective statistical data. When initializing the level range of the variable length table or changing it during processing, a sequence, or GOP, or picture, or slice, or M
This is indicated by a 1-bit flag that exists in B units,
Then, information indicating the level range of the variable length table to be used is transmitted.
【0063】(B)符号化中に精度を変更を行なう場合 リアルタイムで動画像を符号化している最中に、MB単
位またはブロック単位で変更する場合である。MB単位
で入力されてくる画像データにDCTなどの直交変換を
施し、係数の量子化を行なった後に、量子化値の絶対値
の最大値をもとめ、その最大値が初期指定されている可
変長テーブルのレベルの範囲を越えた場合、符号化器
は、可変長テーブルのレベルの範囲の変更を指示する。(B) Case where accuracy is changed during encoding This is a case where the accuracy is changed in MB units or block units while a moving image is being encoded in real time. After the image data input in MB units is subjected to orthogonal transformation such as DCT and the coefficients are quantized, the maximum absolute value of the quantized value is determined, and the maximum value is initially designated as a variable length. If the level range of the table is exceeded, the encoder indicates to change the level range of the variable length table.
【0064】たとえば、初期指定されている可変長テー
ブルのレベルの範囲が9ビット(−255〜+255)
である時、量子化値の絶対値の最大値が300となった
場合、符号化器は、可変長テーブルのレベルの範囲を1
0ビットにするように指示する。また、その次以降のア
ドレスのMBを処理した時、量子化値の絶対値の最大値
が、9ビット(−255〜+255)の範囲に収まる場
合は、符号化器は、可変長テーブルのレベルの範囲を再
び9ビットと戻すように指示する。For example, the level range of the initially designated variable length table is 9 bits (-255 to +255).
When the maximum absolute value of the quantized value is 300, the encoder sets the level range of the variable length table to 1
Instruct to set to 0 bit. If the maximum absolute value of the quantized value falls within the range of 9 bits (-255 to +255) when processing MBs of the addresses after that, the encoder determines the level of the variable length table. Instructs to return the range of to 9 bits again.
【0065】可変長テーブルのレベルの範囲の処理中に
おいての変更に際しては、MBまたはブロック単位に存
在する1ビットのフラグでその旨を指示し、次いで使用
する可変長テーブルのレベルの範囲を示す情報を伝送す
る。When changing the level range of the variable length table during processing, a 1-bit flag existing in the MB or block unit is used to indicate that, and information indicating the level range of the variable length table to be used next. To transmit.
【0066】以上、実施例1または実施例2により、符
号器側では、要求される画質に応じて、必要とされるD
CTなどの直交変換係数の精度(ビット数)に従って、
適応的に可変長符号テーブルの拡張をおこない、可変長
符号を出力することが可能となる。As described above, according to the first embodiment or the second embodiment, the D required according to the required image quality on the encoder side.
According to the accuracy (number of bits) of the orthogonal transform coefficient such as CT,
It is possible to output the variable length code by adaptively expanding the variable length code table.
【0067】また、復号器側では、伝送されてくるDC
Tなどの直交変換係数の精度に応じて、適応的に2次元
ハフマン符号などの可変長符号テーブルの拡張をおこな
い、係数の復号が可能となる。On the decoder side, the transmitted DC
Depending on the accuracy of the orthogonal transform coefficient such as T, the variable length code table such as the two-dimensional Huffman code is adaptively expanded, and the coefficient can be decoded.
【0068】[0068]
【発明の効果】本発明により、符号器側では、要求され
る画質に応じて、必要とされるDCTなどの直交変換係
数の精度(ビット数)を切替え、それにより2次元ハフ
マンなどの可変長符号テーブルの係数のレベル範囲を適
応的に拡張することがができるため、無駄のない符号化
が可能となる。According to the present invention, the encoder side switches the required accuracy (the number of bits) of the orthogonal transform coefficient such as DCT according to the required image quality, thereby changing the variable length such as two-dimensional Huffman. Since the level range of the coefficient of the code table can be adaptively expanded, efficient coding is possible.
【0069】また、復号器側では、伝送されてくるDC
Tなどの直交変換係数の精度に応じて、適応的に2次元
ハフマン符号などの可変長符号テーブルの拡張をおこな
い、係数の復号が可能となる。On the decoder side, the transmitted DC
Depending on the accuracy of the orthogonal transform coefficient such as T, the variable length code table such as the two-dimensional Huffman code is adaptively expanded, and the coefficient can be decoded.
【図1】直交変換係数の符号化及び復号化方法を示す図
である。FIG. 1 is a diagram showing a method for encoding and decoding orthogonal transform coefficients.
【図2】直交変換係数のジグザグスキャン順序を示す図
である。FIG. 2 is a diagram showing a zigzag scan order of orthogonal transform coefficients.
【図3】DCT係数の符号化及び復号化方法を示す図で
ある。FIG. 3 is a diagram showing a method of encoding and decoding a DCT coefficient.
【図4】実施例1での可変長符号の符号化のアルゴリズ
ムを示す図である。FIG. 4 is a diagram showing an algorithm for encoding a variable length code according to the first embodiment.
【図5】実施例1での可変長符号の復号化のアルゴリズ
ムを示す図である。FIG. 5 is a diagram showing an algorithm for decoding a variable-length code according to the first embodiment.
【図6】実施例2での可変長符号の符号化のアルゴリズ
ムを示す図である。FIG. 6 is a diagram illustrating an algorithm for encoding a variable length code according to the second embodiment.
【図7】実施例2での可変長符号の復号化のアルゴリズ
ムを示す図である。FIG. 7 is a diagram illustrating an algorithm for decoding a variable-length code according to the second embodiment.
Claims (6)
直交変換係数の精度をシーケンス、またはGOP(grou
p of Pictures)、またはピクチャ、またはスライス、
またはMB(macro block)またはブロック単位で伝送
し、その情報に従って、適応的に可変長符号テーブルの
拡張をおこない、可変長符号を出力することを特徴とす
る可変長符号化方法。1. The required accuracy of the orthogonal transform coefficient is sequenced or GOP (grou (grou) according to the required image quality.
p of Pictures), or pictures, or slices,
Alternatively, the variable length coding method is characterized in that the variable length coding table is transmitted in MB (macro block) or block units, the variable length coding table is adaptively expanded according to the information, and the variable length coding is output.
ーケンス、またはGOP(group of Pictures)、また
はピクチャ、またはスライス、またはMB(macro bloc
k)またはブロック単位で受けとり、それに応じて、適
応的に可変長符号テーブルの拡張をおこない、伝送され
てくる直交変換係数を復号することを特徴とする可変長
復号化方法。2. The accuracy of transmitted orthogonal transform coefficients is sequence, GOP (group of Pictures), picture, slice, or MB (macro bloc).
k) or in block units, adaptively expanding the variable-length code table accordingly, and decoding the transmitted orthogonal transform coefficient.
直交変換係数の精度を表す信号をシーケンス、またはG
OP(group of Pictures)、またはピクチャ、または
スライス、またはMB(macro block)またはブロック
単位で伝送し、符号化すべきrun-lengthとlevelの組合
せがVLCテーブルに存在するかしないかを調べ、存在
する場合は、あてはまるVLCコードを出力し、符号化
すべきrun-lengthとlevelの組合せがVLCテーブルに
存在しない場合は、まず、"escape"コードを出力し、次
いで、ラン長を所定ビツトのFLCコードで出力し、上
記直交変換係数の精度を表す信号に基づいてレベルをそ
のビット幅で出力することを特徴とする可変長符号化方
法。3. A signal, which represents the required accuracy of the orthogonal transform coefficient, is sequenced or G depending on the required image quality.
OP (group of Pictures), or picture or slice, or MB (macro block) or block is transmitted, and it is checked whether or not a combination of run-length and level to be encoded exists in the VLC table and exists. In this case, the applicable VLC code is output, and if the combination of run-length and level to be encoded does not exist in the VLC table, first the "escape" code is output, and then the run length is the FLC code of the given bit. A variable-length coding method which outputs the level and outputs the level in the bit width based on a signal indicating the accuracy of the orthogonal transform coefficient.
ictures)、またはピクチャ、またはスライス、または
MB(macro block)またはブロック単位で伝送されて
くる直交変換係数の精度を表す信号を受けとり、伝送さ
れてきた2次元ハフマンコードを復号し、run-length
が"escape"コードでない場合、復号された run-length
とlevelの値を得、run-lengthが"escape"コードである
場合は、次いで、所定ビツトのrun-lengthを読み込み、
得られた値を run-length とし、上記直交変換係数の精
度を表す信号に基づいて、レベルをそのビット数で読み
込み、得られた値をレベルとする可変長復号化方法。4. A sequence or GOP (group of P)
ictures), pictures, slices, or MB (macro block) or a signal representing the accuracy of orthogonal transform coefficients transmitted in block units, decodes the transmitted two-dimensional Huffman code, and
Is the "escape" code, the decoded run-length
And the values of level and run-length are "escape" codes, then read the run-length of the given bit,
A variable length decoding method in which the obtained value is set as run-length, the level is read in the number of bits based on the signal representing the accuracy of the orthogonal transform coefficient, and the obtained value is set as the level.
直交変換係数の精度(ビット数)を表す信号をシーケン
ス、またはGOP(group of Pictures)、またはピク
チャ、またはスライス、またはMB(macro block)ま
たはブロック単位で伝送し、符号化すべきrun-lengthと
levelの組合せがVLCテーブルに存在するかいないか
を調べ、存在する場合は、あてはまるVLCコードを出
力し、符号化すべきrun-lengthとlevelの組合せがVL
Cテーブルに存在しない場合は、まず、"escape"コード
を出力し、次いで、ラン長を第1のビット数のFLCコ
ードで出力し、レベルが所定の範囲内である時は、第2
のビツト数のFLCコードで出力し、該範囲内でない時
は、レベルが、正の値である時は第1のコードを、また
負の値である時は第2のコードを出力し、次いで、上記
直交変換係数の精度を表す信号に基づいて、レベルを
(そのビット数−1)の幅で出力することを特徴とする
可変長符号化方法。5. A signal representing the required accuracy (the number of bits) of the orthogonal transform coefficient is sequenced, or GOP (group of Pictures), or picture or slice, or MB (macro) according to the required image quality. block) or the block-unit, and the run-length to be encoded and
It is checked whether or not a level combination exists in the VLC table. If so, the applicable VLC code is output, and the combination of run-length and level to be encoded is VL.
If it does not exist in the C table, the "escape" code is first output, and then the run length is output as the FLC code of the first bit number. When the level is within the predetermined range, the second code is output.
The FLC code of the bit number of is output when the level is not within the range, the first code is output when the level is a positive value, and the second code is output when the level is a negative value. A variable length coding method, wherein the level is output in a width of (the number of bits-1) based on a signal indicating the accuracy of the orthogonal transform coefficient.
ictures)、またはピクチャ、またはスライス、または
MB(macro block)またはブロック単位で伝送されて
くる直交変換係数の精度を表す信号を受けとり、伝送さ
れてきた2次元ハフマンコードを復号し、run-length
が"escape"コードでない場合、復号された run-length
とlevelの値を得、run-lengthが"escape"コードである
場合、次いで、第1のビット数のrun-lengthを読み込
み、得られた値を run-length とし、次いで、第2のビ
ット数を読み込み、この時の値が第1のコードまたは第
2のでない場合は、この値をレベルとし、値が第1のコ
ードまたは第2のコードである場合は、次いでステツプ
上記直交変換係数の精度を表す信号に基づいて、レベル
を(そのビット数−1)の幅で読み込み、得られた値を
レベルとする可変長復号化方法。 【0000】6. A sequence or GOP (group of P)
ictures), pictures, slices, or MB (macro block) or a signal representing the accuracy of orthogonal transform coefficients transmitted in block units, decodes the transmitted two-dimensional Huffman code, and
Is the "escape" code, the decoded run-length
And the value of level, and if run-length is "escape" code, then read run-length of the first number of bits, set the obtained value as run-length, and then the second number of bits If the value at this time is not the first code or the second code, this value is set as the level, and if the value is the first code or the second code, then the step A variable-length decoding method in which a level is read in a width of (the number of bits-1) based on a signal indicating, and the obtained value is used as a level. [0000]
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4249790A JPH06105296A (en) | 1992-09-18 | 1992-09-18 | Variable length coding and decoding method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4249790A JPH06105296A (en) | 1992-09-18 | 1992-09-18 | Variable length coding and decoding method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH06105296A true JPH06105296A (en) | 1994-04-15 |
Family
ID=17198265
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP4249790A Pending JPH06105296A (en) | 1992-09-18 | 1992-09-18 | Variable length coding and decoding method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH06105296A (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2001292450A (en) * | 2000-04-05 | 2001-10-19 | Sony Corp | Encoding device and method, and decoding device and method |
| US6931658B1 (en) | 1999-10-26 | 2005-08-16 | Fujitsu Limited | Image on-demand transmitting device and a method thereof |
| JP2009177850A (en) * | 2009-05-11 | 2009-08-06 | Sony Corp | Decoding device and method |
| JP2009194927A (en) * | 2009-04-27 | 2009-08-27 | Sony Corp | Decoding apparatus and method, recording medium, and program |
| JP2010519858A (en) * | 2007-02-21 | 2010-06-03 | マイクロソフト コーポレーション | Control of computational complexity and accuracy in transform-based digital media codecs |
| JP2010233273A (en) * | 2010-07-22 | 2010-10-14 | Sony Corp | Decoding device and method |
| JP2010233274A (en) * | 2010-07-22 | 2010-10-14 | Sony Corp | Decoding device and method |
-
1992
- 1992-09-18 JP JP4249790A patent/JPH06105296A/en active Pending
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6931658B1 (en) | 1999-10-26 | 2005-08-16 | Fujitsu Limited | Image on-demand transmitting device and a method thereof |
| JP2001292450A (en) * | 2000-04-05 | 2001-10-19 | Sony Corp | Encoding device and method, and decoding device and method |
| JP2010519858A (en) * | 2007-02-21 | 2010-06-03 | マイクロソフト コーポレーション | Control of computational complexity and accuracy in transform-based digital media codecs |
| US8942289B2 (en) | 2007-02-21 | 2015-01-27 | Microsoft Corporation | Computational complexity and precision control in transform-based digital media codec |
| JP2009194927A (en) * | 2009-04-27 | 2009-08-27 | Sony Corp | Decoding apparatus and method, recording medium, and program |
| JP2009177850A (en) * | 2009-05-11 | 2009-08-06 | Sony Corp | Decoding device and method |
| JP2010233273A (en) * | 2010-07-22 | 2010-10-14 | Sony Corp | Decoding device and method |
| JP2010233274A (en) * | 2010-07-22 | 2010-10-14 | Sony Corp | Decoding device and method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP1435063B1 (en) | Method and system for context-based adaptive binary arithmetic coding | |
| KR101091751B1 (en) | decoding apparatus and decoding method | |
| US5945930A (en) | Data processing apparatus | |
| CN100581252C (en) | Method of Improving Entropy Coding | |
| CN100571365C (en) | Method and apparatus for selecting scan mode in dual pass encoding | |
| KR20040018413A (en) | Lossless intraframe encoding using golomb-rice | |
| AU2002334271A1 (en) | Method and system for context-based adaptive binary arithmetic coding | |
| JPH10243399A (en) | Code amount control device and video encoding device including the code amount control device | |
| CN1241395C (en) | Method and device for processing compressed media signals | |
| KR100227298B1 (en) | Code amount control method of encoded image | |
| JP4254147B2 (en) | Image information encoding method and apparatus, program, and recording medium | |
| EP2196031B1 (en) | Method for alternating entropy coding | |
| JPH06105296A (en) | Variable length coding and decoding method | |
| EP1713279A1 (en) | Image data decoding apparatus and method | |
| US20070019875A1 (en) | Method of further compressing JPEG image | |
| KR960013232B1 (en) | Image Compression Coding and Decoding for Bit Fixing | |
| EP1933568A2 (en) | Method and system for context-based adaptive binary arithmetic coding | |
| KR100215563B1 (en) | Input Data Formatting Method for Line Length Decoder | |
| JPH06153178A (en) | Moving picture data coding/decoding method and its device | |
| AU2014202978B2 (en) | Method and system for context-based adaptive binary arithmetic coding | |
| JPH0730889A (en) | Image data encoder | |
| HK40000199B (en) | Multiple sign bit hiding within a transform unit | |
| HK40000199A (en) | Multiple sign bit hiding within a transform unit | |
| HK1126606A (en) | Method and system for context-based adaptive binary arithmetic coding | |
| JPH03124124A (en) | Inter-frame/in-frame adaptive coding system |