JP2009055124A - Encoder - Google Patents
Encoder Download PDFInfo
- Publication number
- JP2009055124A JP2009055124A JP2007217452A JP2007217452A JP2009055124A JP 2009055124 A JP2009055124 A JP 2009055124A JP 2007217452 A JP2007217452 A JP 2007217452A JP 2007217452 A JP2007217452 A JP 2007217452A JP 2009055124 A JP2009055124 A JP 2009055124A
- Authority
- JP
- Japan
- Prior art keywords
- input data
- code
- code table
- level
- length code
- 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.)
- Withdrawn
Links
Images
Abstract
Description
本発明は一般に符号化装置に関し、詳しくは可変長符号化処理を用いた符号化装置に関する。 The present invention generally relates to an encoding apparatus, and more particularly to an encoding apparatus using variable-length encoding processing.
図1は、MPEG方式に基づく一般的なビデオ符号化装置のブロック構成図である。図1のビデオ符号化装置10は、DCT部11、量子化部12、可変長符号化部13、逆量子化部14、逆DCT部15、フレームメモリ16、動き予測部17、及び減算器18を含む。
FIG. 1 is a block diagram of a general video encoding apparatus based on the MPEG system. 1 includes a
まず入力ビデオ信号に対して、動き予測処理に基づいた画像間の差分を減算器18により計算し、差分信号を求める。その差分信号に対してDCT部11によるDCT(Discrete Cosine Transform)変換処理及び量子化部12による量子化処理を施した後、量子化後のDCT係数を可変長符号化部13により可変長符号化処理することによりビデオストリームを生成して出力する。この処理と並行して、量子化後の信号に逆DCT部15による逆量子化処理及び逆DCT部15による逆DCT変換処理を施して、得られたデコード画像をフレームメモリ16に一時的に保存する。動き予測部17が、フレームメモリ16に保存されたデコード画像を演算により求めた動きベクトル分だけ移動させて画像を再構築するとともに、減算器18が、その再構築画像と入力ビデオ信号の元画像との差分を求めることにより、上記動き予測処理を実行する。なお入力ビデオ信号中のフレーム内符号化ピクチャは、そのピクチャの情報のみによって符号化され、動き予測処理の対象とはならない。
First, with respect to the input video signal, a difference between images based on the motion prediction process is calculated by the
図2は、MPEG方式に基づく一般的なビデオ復号装置のブロック構成図である。図2のビデオ復号装置20は、可変長復号化部21、逆量子化部22、逆DCT部23、フレームメモリ24、動き補償部25、及び加算部26を含む。
FIG. 2 is a block diagram of a general video decoding apparatus based on the MPEG system. 2 includes a variable
ビデオ復号装置20では、受信したビデオストリームを可変長復号化部21による可変長復号化により量子化後のDCT係数信号に戻し、量子化後のDCT係数信号に逆量子化部22による逆量子化処理及び逆DCT部23による逆DCT変換処理を施すことにより、デコードされた差分画像を復元する。この処理と並行して、逆DCT変換処理後のデコード画像を一時的にフレームメモリ24に保存する。動き補償部25が、フレームメモリ24に保存されたデコード画像を動きベクトル分だけ移動させて画像を再構築し、加算部26が、この再構築画像と差分画像とを加算することにより動き補償処理を実行する。加算部26による加算後の信号が、復号されたビデオ信号として出力される。なおフレーム内符号化ピクチャは、そのピクチャの情報のみによって復号化され、動き補償処理の対象とはならない。
In the
上記のようなビデオ符号化装置10で生成されビデオ復号装置20により復号されるべきビデオストリームを配布する場合、配布ビデオストリームに何らかのマークをつけることにより、そのビデオストリームが正当な権利(ライセンス)に基づいて符号化されたものであることを示すことが望まれる。このようなマークの有無により、正当な権利に基づいて符号化されたビデオストリームであるか否かを判断できるようにすれば、不当な手段(違法コピー等)を用いて生成されたビデオストリームを排除することが可能になる。
When distributing a video stream generated by the
例えば、元の映像の一部分に会社名等のロゴをマークとして挿入したり、またはビデオストリームのユーザーデータ領域に個別情報をマークとして添付したりする手法が考えられる。しかしながら映像にロゴを挿入してしまうと、表示される画面に常にロゴが表示されることになり、観賞性を著しく損なってしまう恐れがある。またユーザーデータ領域に添付された個別情報は、エディタ等で容易に改竄されてしまう恐れがあるため、このような個別情報を添付する手法は最適なものであるとは言えない。即ち、ユーザーデータ領域等の容易に特定されてしまう位置に個別情報等の容易に識別可能なマークを挿入する手法は、改竄が容易であるために好ましくない。
以上を鑑みて本発明は、表示映像に影響を与えることなく且つ容易に特定されないマークをビデオストリームに含める符号化装置及び符号化方法を提供することを目的とする。 In view of the above, an object of the present invention is to provide an encoding device and an encoding method that include in a video stream a mark that does not affect a displayed video and that is not easily specified.
符号化装置は、入力データが第1の符号表と一致する場合に該入力データに対応する該第1の符号表の第1の符号を出力し、該入力データが該第1の符号表と一致しない場合に該入力データに対応する第2の符号表の第2の符号を出力する符号化部と、該入力データが該第1の符号表と一致するデータであり且つ所定の条件を満たすか否かを判定する条件判定部を含み、該条件判定部により該入力データが該第1の符号表と一致するデータであり且つ該所定の条件を満たすと判断されると、該符号化部に該第1の符号の代わりに該第2の符号を出力させることを特徴とする。 When the input data matches the first code table, the encoding device outputs the first code of the first code table corresponding to the input data, and the input data matches the first code table. An encoding unit that outputs the second code of the second code table corresponding to the input data when they do not match, and the input data is data that matches the first code table and satisfies a predetermined condition A condition determining unit that determines whether or not the input data is data that matches the first code table and satisfies the predetermined condition by the condition determining unit. The second code is output instead of the first code.
符号化方法は、入力データが第1の符号表と一致し且つ所定の条件を満たさない場合に該入力データに対応する該第1の符号表の符号を出力し、該入力データが該第1の符号表と一致しない場合に該入力データに対応する第2の符号表の符号を出力し、該入力データが該第1の符号表と一致するデータであり且つ該所定の条件を満たす場合に該入力データに対応する該第2の符号表の符号を出力する各段階を含むことを特徴とする。 The encoding method outputs a code of the first code table corresponding to the input data when the input data matches the first code table and does not satisfy a predetermined condition, and the input data is the first code table. If the code of the second code table corresponding to the input data is output when the input data does not match the code table, and the input data is data that matches the first code table and satisfies the predetermined condition Each step of outputting the code of the second code table corresponding to the input data is included.
本発明の少なくとも1つの実施例によれば、表示映像に影響を与えることなく、且つ容易に特定、改竄、模倣されないマークをビデオストリームに含めることができる。また本発明の実施例により生成されたビデオストリームは、MPEGの規格に完全に準拠するものであるので、受信側の復号化装置で何らの問題もなく正常に復号化することができる。 According to at least one embodiment of the present invention, a mark that is not easily identified, falsified, or imitated can be included in the video stream without affecting the displayed video. In addition, since the video stream generated by the embodiment of the present invention is completely compliant with the MPEG standard, it can be normally decoded without any problem by the decoding device on the receiving side.
以下に、本発明の実施例を添付の図面を用いて詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
図3は、本発明によるMPEG方式に基づくビデオ符号化装置のブロック構成図である。図3において、図1と同一の構成要素は同一の番号で参照し、その説明は省略する。 FIG. 3 is a block diagram of a video encoding apparatus based on the MPEG system according to the present invention. 3, the same components as those in FIG. 1 are referred to by the same numerals, and a description thereof will be omitted.
図3のビデオ符号化装置30は、DCT部11、量子化部12、可変長符号化部33、逆量子化部14、逆DCT部15、フレームメモリ16、動き予測部17、及び減算器18を含む。図1の従来技術のビデオ符号化装置10と比較して、可変長符号化部13が可変長符号化部33により置き換えられている点が異なる。
3 includes a
可変長符号化部33における可変長符号化においては、量子化処理後のDCT係数に対してゼロランレングス符号が割り当てられる。ゼロランレングス符号とは、符号化対象となる信号中の連続するゼロレベル信号とそれに続くゼロレベル以外の信号との組み合わせに対して一つの符号を割り当てる方式である。この際、複数個のゼロレベル信号の数(RUN)と、ゼロレベル以外の信号の値(LEVEL)と、符号とを組として第1の符号表を作成しておく。RUNとLEVELとの組み合わせの頻度に応じてハフマン符号を割り当てることにより、頻度の高い組み合わせには短い符号を割り当て、頻度の低い組み合わせに対しては長い符号を割り当てる。即ち、第1の符号表は可変長符号表である。
In the variable length coding in the variable
図4は、可変長符号表の一例を示す図である。図4に示されるように、可変長符号表には、可変長符号が、RUN及びLEVLの組み合わせと対応付けて格納されている。例えばRUNが1でLEVELが1、即ち符号化対象データが"01"である場合、可変長符号010sが割り当てられる。ここで末尾のsは符号を表し、s=0ならLEVELの値が正であることを示し、s=1ならLEVELの値が負であることを示す。従って、符号化対象データが"0,+1"に対応する可変長符号は0100であり、符号化対象データが"0,−1"に対応する可変長符号は0101である。また例えば、例えばRUNが0でLEVELが−3、即ち符号化対象データが"−3"である場合、可変長符号は01111となる。また例えば、RUNが3でLEVELが+1、即ち符号化対象データが"0,0,0,+1"である場合、可変長符号は001110となる。
FIG. 4 is a diagram illustrating an example of a variable length code table. As shown in FIG. 4, the variable length code table stores variable length codes in association with combinations of RUN and LEVL. For example, when RUN is 1 and LEVEL is 1, that is, the data to be encoded is “01”, a variable-
一般的に、RUNとLEVELの組み合わせは多数存在するため、発生確率の高いRUN及びLEVELの組み合わせの分のみを図4のような可変長符号化表として用意しておく。可変長符号表に存在しないRUN及びLEVELの組み合わせに対しては、エスケープ(Escape)符号と、それに続くRUNに対応する固定長符号、更にそれに続くLEVELに対応する固定長符号が用いられる。RUNに対する固定長符号表及びLEVELに対する固定長符号表は第2の符号表として用意されている。 In general, since there are many combinations of RUN and LEVEL, only the combination of RUN and LEVEL with a high probability of occurrence is prepared as a variable length coding table as shown in FIG. For combinations of RUN and LEVEL that do not exist in the variable-length code table, an escape code, a fixed-length code corresponding to RUN that follows, and a fixed-length code corresponding to LEVEL that follows the escape code are used. A fixed-length code table for RUN and a fixed-length code table for LEVEL are prepared as a second code table.
図5は、RUNに対する固定長符号表及びLEVELに対する固定長符号表を示す図である。図5(a)にはRUNに対する固定長符号表が示される。図に示されるように、例えばRUNが2の場合には6ビットの固定長符号000010が使用される。図5(b)にはLEVELに対する固定長符号表が示される。図に示されるように、例えばLEVELが+2047の場合には、12ビットの固定長符号011111111111が使用される。従って、RUNが2でLEVELが+2047の場合、即ち符号化対象データが"0,0,+2047"である場合、固定長符号は000010+011111111111となる("+"記号は見やすくするために挿入したものであり実際には存在しない)。この18ビットの固定長符号が、エスケープ符号000001(図4の可変長符号表に定義されている)に続いて出力される。
FIG. 5 is a diagram illustrating a fixed-length code table for RUN and a fixed-length code table for LEVEL. FIG. 5A shows a fixed-length code table for RUN. As shown in the figure, for example, when RUN is 2, a 6-bit fixed-
このようにエスケープ符号を用いると、符号長が長くなってしまうという短所がある。しかしエスケープ符号を用いさえすれば、全てのRUN及びLEVELの組み合わせに対して符号を割り当てることが可能となる。 When the escape code is used in this way, there is a disadvantage that the code length becomes long. However, as long as escape codes are used, codes can be assigned to all combinations of RUN and LEVEL.
一般に、図5の固定長符号表を用いるのは、符号化対象データが図4の可変長符号表に存在しないRUNとLEVELとの組み合わせの場合である。即ち、図1に示す従来技術の可変長符号化部13では、符号化対象である入力データ(入力ビデオ信号の量子化DCT係数)が可変長符号表に一致する場合にその入力データに対応する可変長符号表の符号を出力し、入力データが可変長符号表と一致しない場合にその入力データに対応する固定長符号表の符号を出力する。
In general, the fixed-length code table shown in FIG. 5 is used in the case of a combination of RUN and LEVEL whose data to be encoded does not exist in the variable-length code table shown in FIG. That is, in the conventional variable
それに対して本願発明の可変長符号化部33においては、以下に説明するように、図4の可変長符号表に存在するRUNとLEVELとの組み合わせの符号化対象データであっても、所定の条件を満たす場合には、図5の固定長符号表を用いて、(エスケープ符号)+(RUNの固定長符号)+(LEVELの固定長符号)を符号化対象データに割り当てる。即ち、入力データが可変長符号表と一致するデータであり且つ所定の条件を満たすと判断されると、その入力データに対応する可変長符号表の符号ではなく、その入力データに対応する固定長符号表の符号を出力するように構成する。
On the other hand, in the variable
上記の所定の条件は、入力データが可変長符号表中の特定のパターンと一致するデータであることを少なくとも条件の一部としてよい。即ち、図4の可変長符号表中で例えばRUNが2でLEVELが−1のパターン(組み合わせ)を、上記の所定の条件としてもよい。この場合、入力データストリーム中に入力データ"0,0,−1"(RUNが2でLEVELが−1)が出現すると、本来この入力データに対応する可変長符号は001011であるが、図3の可変長符号化部33は、この可変長符号の代わりに、図5の固定長符号表から抽出された固定長符号000010+111111111111をエスケープ符号の後に続けて出力する。
The predetermined condition may be at least a part of the condition that the input data is data that matches a specific pattern in the variable length code table. That is, in the variable length code table of FIG. 4, for example, a pattern (combination) in which RUN is 2 and LEVEL is −1 may be set as the predetermined condition. In this case, when the input data “0, 0, −1” (RUN is 2 and LEVEL is −1) appears in the input data stream, the variable length code corresponding to this input data is originally 001011. The variable-
また上記所定の条件は、入力データストリーム中で特定のパターンと一致する複数個の入力データのうち特定のものを指定する条件を含んでよい。例えば上記の例では、入力データストリーム中に出現する入力データ"0,0,−1"を全てエスケープ符号に続く固定長符号に変換してしまうと、符号化効率の劣化が好ましくないレベルに達してしまう可能性がある。また正当な権利に基づくビデオストリームであるか否かを示すマークを改竄或いは模倣しようとするものにとっては、本来可変長符号表に対応する入力データ"0,0,−1"が常にエスケープ符号に続く固定長符号に置き換えられていると、比較的容易にそのマーク生成のアルゴリズムが解読されてしまう。 The predetermined condition may include a condition for designating a specific one of a plurality of input data matching a specific pattern in the input data stream. For example, in the above example, if all the input data “0, 0, −1” appearing in the input data stream is converted into a fixed-length code following the escape code, the deterioration of the encoding efficiency reaches an undesirable level. There is a possibility that. In addition, for those who intend to tamper or imitate a mark indicating whether or not the video stream is based on a legitimate right, the input data “0, 0, −1” originally corresponding to the variable length code table is always an escape code. If it is replaced with the following fixed-length code, the mark generation algorithm can be decoded relatively easily.
そこで入力データストリーム中に出現する複数の入力データ"0,0,−1"の全てに対して、エスケープ符号に続く固定長符号を割り当てるのではなく、そのような複数の入力データのうちで特定のものに対してのみ、エスケープ符号に続く固定長符号を割り当て、それ以外には通常の可変長符号を割り当てるようにしてよい。例えば、後述するように、各ピクチャ(フレーム)内で最初に出現した入力データ"0,0,−1"のみをエスケープ符号に続く固定長符号に変換し、それ以外の入力データ"0,0,−1"を可変長符号に変換してよい。 Therefore, instead of assigning a fixed-length code following the escape code to all of the plurality of input data “0, 0, −1” appearing in the input data stream, it is specified among such a plurality of input data. A fixed-length code following an escape code may be assigned only to those, and a normal variable-length code may be assigned otherwise. For example, as described later, only the input data “0, 0, −1” that first appears in each picture (frame) is converted into a fixed-length code following the escape code, and the other input data “0, 0” , -1 "may be converted into a variable length code.
図6は、可変長符号化部33が実行する可変長符号化処理の手順を示すフローチャートである。この可変長符号化処理は、入力ビデオ信号の着目ブロックの量子化処理後のDCT係数に対して実行される。
FIG. 6 is a flowchart illustrating a procedure of variable length encoding processing executed by the variable
ステップS1において、量子化処理後のDCT係数を低周波数領域側から高周波数領域側に向けて走査し、ゼロ以外の係数が存在するか否かを判定する。ゼロ以外の係数が出現すると(ステップS1でYes)、ステップS2において、RUNとLEVELとの組み合わせ(RUN,LEVEL)を抽出する。 In step S1, the DCT coefficient after the quantization process is scanned from the low frequency region side to the high frequency region side to determine whether a coefficient other than zero exists. When a coefficient other than zero appears (Yes in step S1), in step S2, a combination of RUN and LEVEL (RUN, LEVEL) is extracted.
ステップS3で、抽出された(RUN,LEVEL)の組み合わせが可変長符号表に存在するか否かを判定する。存在する場合には、ステップS4において、抽出された(RUN,LEVEL)の組み合わせが指定された条件を満たしているか否かを判定する。指定された条件を満たしていない場合には、ステップS5で、抽出された(RUN,LEVEL)の組み合わせに対して、可変長符号表に従い可変長符号を割り当てる。 In step S3, it is determined whether or not the extracted (RUN, LEVEL) combination exists in the variable length code table. If it exists, it is determined in step S4 whether or not the extracted (RUN, LEVEL) combination satisfies the specified condition. If the specified condition is not satisfied, in step S5, a variable length code is assigned to the extracted (RUN, LEVEL) combination according to the variable length code table.
抽出された(RUN,LEVEL)の組み合わせが可変長符号表に存在しないとステップS3で判定された場合、或いは抽出された(RUN,LEVEL)の組み合わせが指定された条件を満たしているとステップS4で判定された場合、処理はステップS6に進む。ステップS6では、エスケープ符号を挿入する。更にステップS7で、抽出された(RUN,LEVEL)の組み合わせに対して固定長符号表の対応する固定長符号を割り当てる。以上ステップS6及びS7の処理により、エスケープ符号とそれに続く固定長符号として、符号化データが生成される。 If it is determined in step S3 that the extracted (RUN, LEVEL) combination does not exist in the variable-length code table, or if the extracted (RUN, LEVEL) combination satisfies the specified condition, step S4 When the determination is made in step S6, the process proceeds to step S6. In step S6, an escape code is inserted. Further, in step S7, a corresponding fixed-length code in the fixed-length code table is assigned to the extracted (RUN, LEVEL) combination. Through the processes in steps S6 and S7, encoded data is generated as an escape code and a fixed-length code following the escape code.
ステップS5又はステップS7で符号化データが生成されると、ステップS1に戻り以降の処理を繰り返す。ステップS1でゼロ以外の係数が存在しない場合、即ち着目ブロックの終わりまでゼロが続く場合には、ステップS8に進み、EOB(End of Block)符号を挿入する。即ち、図4の可変長符号表に示すEOBに対応する符号を符号化データとして出力する。以上で、着目ブロックに対する符号化処理が終了する。 When encoded data is generated in step S5 or step S7, the process returns to step S1 and the subsequent processing is repeated. If there is no coefficient other than zero in step S1, that is, if zero continues until the end of the block of interest, the process proceeds to step S8, and an EOB (End of Block) code is inserted. That is, a code corresponding to EOB shown in the variable length code table of FIG. 4 is output as encoded data. Thus, the encoding process for the block of interest ends.
図7は、図3の可変長符号化部33の構成の一例を示すブロック構成図である。図7の可変長符号化部33は、係数位置カウンター41、レベル検出部42、零ラン数検出部43、固定長符号割り当て部44、可変長符号割り当て部45、条件判定部46、セレクタ47、セレクタ48、EOB符号割り当て部49、及びセレクタ50を含む。
FIG. 7 is a block configuration diagram showing an example of the configuration of the variable
可変長符号化部33による可変長符号化処理は、入力ビデオ信号の着目ブロックの量子化処理後のDCT係数に対して実行される。この着目ブロックの量子化処理後のDCT係数は、ブロック内を所定の走査パターンで走査した順番に供給される。
The variable length coding process by the variable
まず係数位置カウンター41が、入力DCT係数をカウントすることにより走査カウント位置(0〜63)を求め、求めた走査カウント位置(0〜63)出力する。またレベル検出部42が、入力DCT係数のレベル(係数値)を検出することにより、DCT係数値が零レベルである期間を示すZero_Enable指示信号を出力する。
First, the coefficient position counter 41 obtains the scan count position (0 to 63) by counting the input DCT coefficient, and outputs the obtained scan count position (0 to 63). Further, the
零ラン数検出部43は、走査カウント位置とZero_Enable指示信号とに応じてゼロラン数RUNを生成して出力する。このゼロラン数RUNは、走査順で供給されるDCT係数列においてゼロ以外の係数が出現した時点で出力される。現在のDCT係数が着目ブロックの最後である場合、零ラン数検出部43は、EOB_Enable指示信号をアサートする。
The zero run
固定長符号割り当て部44は、零ラン数検出部43からのRUN及びレベル検出部42からのLEVELに応じて対応する固定長符号を特定し、エスケープ符号に続いて当該特定した固定長符号が並ぶ符号化データを出力する。具体的には、固定長符号割り当て部44は内部に図5に示す固定長符号表を備えており、入力されたRUN及びLEVELに一致する固定長符号表中の固定長符号を特定する。更に、エスケープ符号に特定した固定長符号を繋げて、(エスケープ符号)+(RUNの固定長符号)+(LEVELの固定長符号)を出力する。
The fixed-length
可変長符号割り当て部45は、零ラン数検出部43からのRUN及びレベル検出部42からのLEVELを可変長符号表と照合し、入力されるRUN及びLEVELの組み合わせが可変長符号表中の何れかのRUN及びLEVELの組み合わせと一致するときにVLC_Enable指示信号を1に設定し、一致しないときにはVLC_Enable指示信号を0に設定する。また可変長符号割り当て部45は更に、入力されるRUN及びLEVELの組み合わせが可変長符号表中の何れかのRUN及びLEVELの組み合わせと一致するとき、入力されるRUN及びLEVELの組み合わせに対応する可変長符号を符号化データとして出力する。具体的には、可変長符号割り当て部45は内部に図4に示す可変長符号表を備えており、入力されたRUN及びLEVELの組み合わせに一致するRUN及びLEVELの組み合わせを可変長符号表中で検索し、一致するものがある場合には、一致したRUN及びLEVELの組み合わせに対応する可変長符号を出力する。
The variable length
条件判定部46は、零ラン数検出部43からのRUN及びレベル検出部42からのLEVELと、可変長符号化部33に外部から供給される指定条件及び位置情報とに応じて、ESC_Enable指示信号を1又は0に設定する。具体的には、例えば指定条件が満たされる場合にはESC_Enable指示信号が1に設定され、指定条件が満たされない場合にはESC_Enable指示信号が0に設定される。
The condition determination unit 46 generates an ESC_Enable instruction signal according to the RUN from the zero-run
ここで指定条件は、特定のRUNとLEVELとの組み合わせをエスケープ処理(強制的に固定長符号を割り当てる処理)の対象とする場合には、そのRUNとLEVELとの組み合わせを示す情報を含んでよい。例えば前述の例のように、入力データ"0,0,−1"(RUNが2でLEVELが−1)をエスケープ処理の対象とする場合には、RUNが2でLEVELが−1であることを示す情報が指定条件に含まれる。 Here, the specification condition may include information indicating a combination of the RUN and LEVEL when a specific combination of RUN and LEVEL is a target of escape processing (processing for forcibly assigning a fixed-length code). . For example, when the input data “0, 0, −1” (RUN is 2 and LEVEL is −1) is the target of escape processing as in the above example, RUN is 2 and LEVEL is −1. Is included in the specified condition.
また指定条件には、例えば各ピクチャ(フレーム)内で最初に出現した特定のRUNとLEVELとの組み合わせのみをエスケープ処理の対象とすること等が指示されてよい。或いは、各スライスで最初に出現した特定のRUNとLEVELとの組み合わせのみをエスケープ処理の対象とすること等が指示されてよい。このように指定条件は、複数個の入力データが特定のRUNとLEVELとの組み合わせに該当する場合に、これら複数個の入力データのうち特定の入力データのみをエスケープ処理の対象として指定してよい。このような指定をするためには、フレーム、スライス、マクロブロック、及びブロック等の単位を参照することにより、入力データの現在位置を特定することが必要になる。この目的のために、条件判定部46には、現在のフレーム、現在のスライス、現在のマクロブロック、及び現在のブロックの位置(番号)を示す位置情報などが供給されてよい。 In addition, for example, the designation condition may indicate that only a combination of a specific RUN and LEVEL that first appears in each picture (frame) is an object of escape processing. Alternatively, it may be instructed that only a combination of a specific RUN and LEVEL that first appears in each slice is an object of escape processing. As described above, when a plurality of input data corresponds to a combination of a specific RUN and LEVEL, only the specific input data among the plurality of input data may be specified as an escape process target. . In order to make such designation, it is necessary to specify the current position of the input data by referring to units such as a frame, a slice, a macroblock, and a block. For this purpose, the condition determining unit 46 may be supplied with position information indicating the current frame, current slice, current macroblock, and current block position (number).
セレクタ47は、固定長符号割り当て部44からのエスケープ及び固定長符号又は可変長符号割り当て部45からの可変長符号の何れかを、セレクタ48の出力に応じて選択する。セレクタ48の出力が1の場合には可変長符号割り当て部45からの可変長符号が選択される。セレクタ48の出力が0の場合には固定長符号割り当て部44からのエスケープ及び固定長符号が選択される。
The
セレクタ48は、可変長符号割り当て部45が出力するVLC_Enable指示信号と0との何れかを、条件判定部46からのESC_Enable指示信号に応じて選択し出力する。具体的には、ESC_Enable指示信号が0の場合にはVLC_Enable指示信号が選択出力され、ESC_Enable指示信号が1の場合には0が選択出力される。
The
セレクタ47の出力は、セレクタ50に供給される。セレクタ50は、零ラン数検出部43からのEOB_Enable指示信号がアサート状態であればEOB符号割り当て部49が供給するEOB符号を選択して出力し、EOB_Enable指示信号がネゲート状態であればセレクタ47の出力を選択して出力する。
The output of the
以上の構成により、入力データが可変長符号表と一致する場合にその入力データに対応する可変長符号表の可変長符号を出力し、入力データが可変長符号表と一致しない場合にその入力データに対応する固定長符号表の固定長符号を出力する符号化部において、入力データが可変長符号表と一致するデータであり且つ所定の条件を満たすと判断されると、可変長符号の代わりに固定長符号を出力することができる。 With the above configuration, when the input data matches the variable length code table, the variable length code of the variable length code table corresponding to the input data is output, and when the input data does not match the variable length code table, the input data In the encoding unit that outputs the fixed-length code of the fixed-length code table corresponding to, when it is determined that the input data is data that matches the variable-length code table and satisfies a predetermined condition, instead of the variable-length code A fixed-length code can be output.
図8は、指定条件の一例を説明するための図である。図8の例では、ピクチャ内で一番最初に出現した所定の組み合わせの(RAN,LEVEL)をエスケープ処理の対象とすることを、指定条件とする。図8に示す例では、一枚のピクチャ60は複数のスライス(Slice1乃至Slice8)に区画化されており、更に各スライスが複数のマクロブロック(MB1乃至MB12)に分割されている。1つのマクロブロックには、4つの輝度ブロックが示されている。この例では、例えば(RAN,LEVEL)が(2,−1)を特定のパターンとして指定し、このパターンに一致する入力データがエスケープ処理の候補となる。
FIG. 8 is a diagram for explaining an example of the designation condition. In the example of FIG. 8, the specified condition is that a predetermined combination (RAN, LEVEL) that appears first in the picture is the target of the escape process. In the example shown in FIG. 8, one
図中の△印は、(RAN,LEVEL)が(2,−1)であるデータが出現したピクチャ60中の箇所を示す。また×印は、(RAN,LEVEL)が(2,−1)である複数個のデータのうちで、ピクチャ60内で最初に出現したものの位置を示す。図8に示す例では、この×印の位置にある(RAN,LEVEL)が(2,−1)である入力データを、強制的に(エスケープ符号)+(RUNの固定長符号)+(LEVELの固定長符号)に変換し、その他の位置にある(RAN,LEVEL)が(2,−1)である入力データについては、通常通りの可変長符号に変換する。
The Δ mark in the figure indicates a location in the
図9は、指定条件の別の一例を説明するための図である。図9の例では、各スライスにおいて2番目のマクロブロックで最初に出現した所定の組み合わせの(RAN,LEVEL)をエスケープ処理の対象とすることを、指定条件とする。図8と同様に、一枚のピクチャ60は複数のスライス(Slice1乃至Slice8)に区画化されており、更に各スライスが複数のマクロブロック(MB1乃至MB12)に分割されている。1つのマクロブロックには、4つの輝度ブロックが示されている。この例では、例えば(RAN,LEVEL)が(2,−1)を特定のパターンとして指定し、このパターンに一致する入力データがエスケープ処理の候補となる。
FIG. 9 is a diagram for explaining another example of the designation condition. In the example of FIG. 9, the specified condition is that a predetermined combination (RAN, LEVEL) that first appears in the second macroblock in each slice is the target of the escape process. Similarly to FIG. 8, one
図中の△印は、(RAN,LEVEL)が(2,−1)であるデータが出現したピクチャ60中の箇所を示す。また×印は、(RAN,LEVEL)が(2,−1)である複数個のデータのうちで、各スライスにおいて2番目のマクロブロックで最初に出現したものの位置を示す。図9に示す例では、この×印の位置にある(RAN,LEVEL)が(2,−1)である入力データを、強制的に(エスケープ符号)+(RUNの固定長符号)+(LEVELの固定長符号)に変換し、その他の位置にある(RAN,LEVEL)が(2,−1)である入力データについては、通常通りの可変長符号に変換する。
The Δ mark in the figure indicates a location in the
図10は、指定条件の別の一例を説明するための図である。図10の例では、ピクチャ内で一番最初に出現したブロック番号0のブロック内の所定の組み合わせの(RAN,LEVEL)をエスケープ処理の対象とすることを、指定条件とする。図8と同様に、ピクチャ60が複数のスライス及び複数のマクロブロックに分割され、各マクロブロックがブロック番号0乃至3の4つの輝度ブロックを含む。各マクロブロックの左上のブロックがブロック番号0の輝度ブロックである。この例では、例えば(RAN,LEVEL)が(2,−1)を特定のパターンとして指定し、このパターンに一致する入力データがエスケープ処理の候補となる。
FIG. 10 is a diagram for explaining another example of the designation condition. In the example of FIG. 10, the specified condition is that a predetermined combination (RAN, LEVEL) in the block of
図中の△印は、(RAN,LEVEL)が(2,−1)であるデータが出現したピクチャ60中の箇所を示す。また×印は、(RAN,LEVEL)が(2,−1)である複数個のデータのうちで、ブロック番号0のブロックにおいてピクチャ内で一番最初に出現したものの位置を示す。図9に示す例では、この×印の位置にある(RAN,LEVEL)が(2,−1)である入力データを、強制的に(エスケープ符号)+(RUNの固定長符号)+(LEVELの固定長符号)に変換し、その他の位置にある(RAN,LEVEL)が(2,−1)である入力データについては、通常通りの可変長符号に変換する。
The Δ mark in the figure indicates a location in the
図11は、図7に示す条件判定部46によるESC_Enable指示信号の設定動作を示すフローチャートである。 FIG. 11 is a flowchart showing the setting operation of the ESC_Enable instruction signal by the condition determination unit 46 shown in FIG.
まずステップS1で、ESC_Count及びESC_Enableがそれぞれ0に初期設定される。なおESC_Countは、指定条件を満たした回数をカウントするために使用される変数である。またESC_Enableは、指定条件が満たされる場合に1に設定され、指定条件が満たされない場合に0に設定される変数であり、図7のESC_Enable指示信号に対応する。 First, in step S1, ESC_Count and ESC_Enable are each initialized to 0. ESC_Count is a variable used to count the number of times that the specified condition is satisfied. ESC_Enable is a variable that is set to 1 when the specified condition is satisfied, and is set to 0 when the specified condition is not satisfied, and corresponds to the ESC_Enable instruction signal in FIG.
ステップS2で、ESCカウンタ初期化条件が満たされるか否かが判定される。即ち、ESC_Countを0に初期化するべきか否かが判定される。このESCカウンタ初期化条件は、エスケープ処理を実行する指定条件により異なる。例えば、図8に示す例の指定条件の場合は、各ピクチャの先頭においてESCカウンタを初期化する必要がある。従って、現在の入力データの位置がピクチャの先頭に対応するのであれば、ESCカウンタ初期化条件が満たされることになる。また図9に示す例の指定条件の場合は、各スライスの先頭においてESCカウンタを初期化する必要がある。従って、現在の入力データの位置が各スライスの先頭に対応するのであれば、ESCカウンタ初期化条件が満たされることになる。また図10に示す例の指定条件の場合は、各ピクチャの先頭においてESCカウンタを初期化する必要がある。従って、現在の入力データの位置がピクチャの先頭に対応するのであれば、ESCカウンタ初期化条件が満たされることになる。 In step S2, it is determined whether or not an ESC counter initialization condition is satisfied. That is, it is determined whether or not ESC_Count should be initialized to 0. This ESC counter initialization condition differs depending on the specified condition for executing the escape process. For example, in the case of the designation condition shown in FIG. 8, it is necessary to initialize the ESC counter at the beginning of each picture. Therefore, if the current input data position corresponds to the top of the picture, the ESC counter initialization condition is satisfied. Further, in the case of the designation condition shown in FIG. 9, it is necessary to initialize the ESC counter at the head of each slice. Therefore, if the current input data position corresponds to the head of each slice, the ESC counter initialization condition is satisfied. Further, in the case of the designation condition shown in FIG. 10, it is necessary to initialize the ESC counter at the head of each picture. Therefore, if the current input data position corresponds to the top of the picture, the ESC counter initialization condition is satisfied.
ステップS3で、ESC_Countを0に設定する。ステップS4で、入力データの(RUN,LEVEL)の組み合わせが、指定条件に指定された(RUN,LEVEL)の組み合わせと一致するか否かが判定される。一致する場合にはステップS5で、ESC使用条件が満たされるか否かを判定する。ESC使用条件は、エスケープ処理を実行する指定条件により異なる。例えば、図8に示す例の指定条件の場合、ESC使用条件の指定はなく、ステップS5の判断結果は常にYesとなる。また図9に示す例の指定条件の場合、現在の入力データが各スライスの2番目のマクロブロックのものであるか否かがESC使用条件となる。即ち、現在の入力データが各スライスの2番目のマクロブロックである場合、ステップS5の判断結果はYesとなる。また図10に示す例の指定条件の場合、現在の入力データがブロック番号0のブロックのものであるか否かがESC使用条件となる。即ち、現在の入力データがブロック番号0のブロックのものである場合、ステップS5の判断結果はYesとなる。
In step S3, ESC_Count is set to 0. In step S4, it is determined whether or not the combination (RUN, LEVEL) of the input data matches the combination (RUN, LEVEL) specified in the specified condition. If they match, it is determined in step S5 whether or not the ESC use condition is satisfied. The ESC use condition varies depending on the designated condition for executing the escape process. For example, in the case of the designation condition of the example shown in FIG. 8, there is no designation of the ESC use condition, and the determination result in step S5 is always Yes. In addition, in the case of the specification condition of the example shown in FIG. 9, whether or not the current input data is that of the second macroblock of each slice is the ESC use condition. That is, when the current input data is the second macroblock of each slice, the determination result in step S5 is Yes. In addition, in the case of the designation condition shown in FIG. 10, whether the current input data is for the block with
ステップS6で、ESC_Countが0であるか否かが判定される。この判定結果がYesとなるのは、ステップS2のESCカウンタ初期化条件が満たされて以来、初めてエスケープ処理を実行する指定条件が満たされる場合である。ステップS6に続きステップS7でESC_Enableを1に設定し、更にステップS8でESC_Countを1に設定し、処理はステップS2に戻る。またステップS4乃至ステップS6の何れかのステップで判定結果がNoの場合、ステップS9において、ESC_Enableを0に設定する。 In step S6, it is determined whether ESC_Count is 0 or not. The determination result is Yes when the specified condition for executing the escape process is satisfied for the first time since the ESC counter initialization condition in step S2 is satisfied. Subsequent to step S6, ESC_Enable is set to 1 in step S7, ESC_Count is set to 1 in step S8, and the process returns to step S2. If the determination result is No in any of steps S4 to S6, ESC_Enable is set to 0 in step S9.
上述の処理を条件判定部46が実行することにより、ESC_Enable指示信号を設定する。これによって、図8乃至図10の各例に示されるように、×印の箇所においてのみESC_Enable指示信号を1に設定することができる。 The condition determination unit 46 executes the above process, thereby setting an ESC_Enable instruction signal. As a result, as shown in the examples of FIGS. 8 to 10, the ESC_Enable instruction signal can be set to 1 only at the portion marked with a cross.
図10の例において、各スライスにおいて2番目のマクロブロックで最初に出現した所定の組み合わせの(RAN,LEVEL)をエスケープ処理の対象としているが、2番目ではなく他の所望の位置のマクロブロック(N番目のマクロブロック)を対象としてもよい。また図11の例において、ピクチャ内で最初に出現したブロック番号0のブロックの所定の組み合わせの(RAN,LEVEL)をエスケープ処理の対象としているが、ブロック番号0ではなく他の所望の位置のブロック(ブロック番号Mのブロック)を対象としてもよい。また図8乃至図10の各例において、最初に出現したデータという条件ではなく、例えば2番目に出現したデータといった条件にしてもよい。
In the example of FIG. 10, the predetermined combination (RAN, LEVEL) that first appears in the second macroblock in each slice is the target of the escape process, but the macroblocks at other desired positions (not the second) ( Nth macroblock) may be the target. Further, in the example of FIG. 11, the predetermined combination (RAN, LEVEL) of the block of
また例えばピクチャカウント値を3で割った時の余りの値が0の時は図8に示す指定条件を用い、ピクチャカウント値を3で割った時の余りの値が1の時は図9に示す指定条件を用い、ピクチャカウント値を3で割った時の余りの値が2の時は図10に示す指定条件を用いるというように、各ピクチャ毎に指定条件を変えるようにしてもよい。 Further, for example, when the remainder value when the picture count value is divided by 3 is 0, the specified condition shown in FIG. 8 is used, and when the remainder value when the picture count value is divided by 3 is 1, FIG. The designated condition may be changed for each picture, for example, when the remainder when the picture count value is divided by 3 is 2, the designated condition shown in FIG. 10 is used.
以上、本発明を実施例に基づいて説明したが、本発明は上記実施例に限定されるものではなく、特許請求の範囲に記載の範囲内で様々な変形が可能である。 As mentioned above, although this invention was demonstrated based on the Example, this invention is not limited to the said Example, A various deformation | transformation is possible within the range as described in a claim.
なお本発明は以下の内容を含むものである。
(付記1)
入力データが第1の符号表と一致する場合に該入力データに対応する該第1の符号表の第1の符号を出力し、該入力データが該第1の符号表と一致しない場合に該入力データに対応する第2の符号表の第2の符号を出力する符号化部と、
該入力データが該第1の符号表と一致するデータであり且つ所定の条件を満たすか否かを判定する条件判定部
を含み、該条件判定部により該入力データが該第1の符号表と一致するデータであり且つ該所定の条件を満たすと判断されると、該符号化部に該第1の符号の代わりに該第2の符号を出力させることを特徴とする符号化装置。
(付記2)
該所定の条件は、該入力データが該第1の符号表中の特定のパターンと一致するデータであることを少なくとも条件の一部とすることを特徴とする付記1記載の符号化装置。
(付記3)
該所定の条件は、入力データストリーム中で該特定のパターンと一致する複数個の入力データのうち特定のものを指定する条件を含むことを特徴とする付記2記載の符号化装置。
(付記4)
該入力データは各フレームが複数のスライス及び複数のブロックを含む映像データであり、該所定の条件は、該フレーム、該スライス、及び該ブロックの少なくとも1つを参照して該複数個の入力データのうち特定のものを指定することを特徴とする付記3記載の符号化装置。
(付記5)
該第1の符号表は可変長符号表であり該第2の符号表は固定長符号表であることを特徴とする付記1記載の符号化装置。
(付記6)
該符号化部は、該第2の符号をエスケープ符号に続いて出力するように構成されることを特徴とする付記1記載の符号化装置。
(付記7)
入力データが第1の符号表と一致し且つ所定の条件を満たさない場合に該入力データに対応する該第1の符号表の符号を出力し、
該入力データが該第1の符号表と一致しない場合に該入力データに対応する第2の符号表の符号を出力し、
該入力データが該第1の符号表と一致するデータであり且つ該所定の条件を満たす場合に該入力データに対応する該第2の符号表の符号を出力する
各段階を含むことを特徴とする符号化方法。
(付記8)
該第1の符号表は可変長符号表であり該第2の符号表は固定長符号表であることを特徴とする付記7記載の符号化方法。
(付記9)
該第2の符号表の符号を出力する場合には、まずエスケープ符号を出力し、該エスケープ符号に続いて該第2の符号表の符号を出力することを特徴とする付記7記載の符号化方法。
The present invention includes the following contents.
(Appendix 1)
When the input data matches the first code table, the first code of the first code table corresponding to the input data is output, and when the input data does not match the first code table, the An encoding unit that outputs the second code of the second code table corresponding to the input data;
A condition determination unit that determines whether the input data is data that matches the first code table and satisfies a predetermined condition, and the condition determination unit inputs the input data to the first code table; An encoding apparatus, characterized in that if the data match and the predetermined condition is determined, the encoding unit outputs the second code instead of the first code.
(Appendix 2)
The encoding apparatus according to
(Appendix 3)
The encoding apparatus according to
(Appendix 4)
The input data is video data in which each frame includes a plurality of slices and a plurality of blocks, and the predetermined condition refers to the plurality of input data with reference to at least one of the frames, the slices, and the blocks. The encoding apparatus according to
(Appendix 5)
The encoding apparatus according to
(Appendix 6)
The encoding apparatus according to
(Appendix 7)
When the input data matches the first code table and does not satisfy a predetermined condition, the code of the first code table corresponding to the input data is output,
When the input data does not match the first code table, the code of the second code table corresponding to the input data is output,
And including each step of outputting a code of the second code table corresponding to the input data when the input data is data matching the first code table and satisfies the predetermined condition. Encoding method.
(Appendix 8)
The encoding method according to
(Appendix 9)
The encoding according to
11 DCT部
12 量子化部
13 可変長符号化部
14 逆量子化部
15 逆DCT部
16 フレームメモリ
17 動き予測部
18 減算器
33 可変長符号化部
41 係数位置カウンター
42 レベル検出部
43 零ラン数検出部
44 固定長符号割り当て部
45 可変長符号割り当て部
46 条件判定部
47 セレクタ
48 セレクタ
49 EOB符号割り当て部
50 セレクタ
11
Claims (5)
該入力データが該第1の符号表と一致するデータであり且つ所定の条件を満たすか否かを判定する条件判定部
を含み、該条件判定部により該入力データが該第1の符号表と一致するデータであり且つ該所定の条件を満たすと判断されると、該符号化部に該第1の符号の代わりに該第2の符号を出力させることを特徴とする符号化装置。 When the input data matches the first code table, the first code of the first code table corresponding to the input data is output, and when the input data does not match the first code table, the An encoding unit that outputs the second code of the second code table corresponding to the input data;
A condition determination unit that determines whether the input data is data that matches the first code table and satisfies a predetermined condition, and the condition determination unit inputs the input data to the first code table; An encoding apparatus, characterized in that if the data match and the predetermined condition is determined, the encoding unit outputs the second code instead of the first code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007217452A JP2009055124A (en) | 2007-08-23 | 2007-08-23 | Encoder |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007217452A JP2009055124A (en) | 2007-08-23 | 2007-08-23 | Encoder |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009055124A true JP2009055124A (en) | 2009-03-12 |
Family
ID=40505825
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007217452A Withdrawn JP2009055124A (en) | 2007-08-23 | 2007-08-23 | Encoder |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009055124A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011244101A (en) * | 2010-05-14 | 2011-12-01 | Ricoh Co Ltd | Image processing apparatus and image processing method |
-
2007
- 2007-08-23 JP JP2007217452A patent/JP2009055124A/en not_active Withdrawn
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011244101A (en) * | 2010-05-14 | 2011-12-01 | Ricoh Co Ltd | Image processing apparatus and image processing method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4248241B2 (en) | Watermarking of compressed information signals | |
KR100309521B1 (en) | Video data encoder | |
JP3764458B2 (en) | Image encoding method, image decoding method, image encoding device, image decoding device, and program | |
KR102267770B1 (en) | Method and device for determining a set of modifiable elements in a group of pictures | |
JP2004536531A (en) | Processing compressed media signals | |
JP2009534968A (en) | Digital watermarking method | |
US20050089189A1 (en) | Embedding a watermark in an image signal | |
JP2009260572A (en) | Image decoder and control method thereof | |
JP2009055124A (en) | Encoder | |
KR101490686B1 (en) | Apparatus and Method for Encoding Video | |
JP2002330279A (en) | Method for embedding data in image and method for extracting the data | |
JP4042887B2 (en) | Video watermarking device | |
JP2008502256A (en) | Compensation for watermark irregularities caused by moved objects | |
WO2005122081A1 (en) | Watermarking based on motion vectors | |
JP2009081489A (en) | Moving picture encoding device and moving picture decoding device | |
JP4169161B2 (en) | Video watermarking device | |
JP2001007705A (en) | System and method for inserting information into dct coefficient | |
JP4847423B2 (en) | Moving picture encoding apparatus and computer program | |
JP2005197879A (en) | Video signal coding apparatus | |
JP2008278534A (en) | Electronic watermark detecting device for moving image | |
WO2001033861A1 (en) | Mpeg encoding method for logo insertion | |
JP2008131526A (en) | Moving image coding apparatus, and moving image coding program | |
JP2000013764A (en) | Device and method for processing picture signal, and device and method for decoding picture signal | |
JP2008259018A (en) | Scene change detector | |
EP1356683A1 (en) | Watermarking a compressed information signal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100430 |
|
A761 | Written withdrawal of application |
Free format text: JAPANESE INTERMEDIATE CODE: A761 Effective date: 20101208 |