JP2009055124A - Encoder - Google Patents

Encoder Download PDF

Info

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
Application number
JP2007217452A
Other languages
Japanese (ja)
Inventor
Takahiko Tahira
孝彦 田平
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.)
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Semiconductor 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 Fujitsu Semiconductor Ltd filed Critical Fujitsu Semiconductor Ltd
Priority to JP2007217452A priority Critical patent/JP2009055124A/en
Publication of JP2009055124A publication Critical patent/JP2009055124A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an encoder which includes a mark not to be specified easily in a video stream without affecting a display image, and to provide an encoding method. <P>SOLUTION: The encoder includes an encoding section for outputting a first code on a first code table which matches input data according with the first code table or outputting a second code on a second code table which corresponds to input data not according with the first code table and a section for deciding whether input data accords with the first code table and satisfies predetermined conditions. When the condition decision section determines that the input data accords with the first code table and satisfies predetermined conditions, the encoder makes the encoding section output a second code in place of the first code. <P>COPYRIGHT: (C)2009,JPO&INPIT

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 DCT unit 11, a quantization unit 12, a variable length coding unit 13, an inverse quantization unit 14, an inverse DCT unit 15, a frame memory 16, a motion prediction unit 17, and a subtractor 18. including.

まず入力ビデオ信号に対して、動き予測処理に基づいた画像間の差分を減算器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 subtracter 18 to obtain a difference signal. The differential signal is subjected to DCT (Discrete Cosine Transform) conversion processing by the DCT unit 11 and quantization processing by the quantization unit 12, and then the quantized DCT coefficients are variable length encoded by the variable length encoding unit 13. By processing, a video stream is generated and output. In parallel with this processing, the quantized signal is subjected to inverse quantization processing by the inverse DCT unit 15 and inverse DCT conversion processing by the inverse DCT unit 15, and the obtained decoded image is temporarily stored in the frame memory 16. To do. The motion prediction unit 17 reconstructs the image by moving the decoded image stored in the frame memory 16 by the motion vector obtained by the operation, and the subtractor 18 reconstructs the reconstructed image and the original image of the input video signal. The motion prediction process is executed by obtaining the difference between the motion prediction process and the motion prediction process. Note that the intra-frame encoded picture in the input video signal is encoded only by the information of the picture, and is not a target of motion prediction processing.

図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 length decoding unit 21, an inverse quantization unit 22, an inverse DCT unit 23, a frame memory 24, a motion compensation unit 25, and an addition unit 26.

ビデオ復号装置20では、受信したビデオストリームを可変長復号化部21による可変長復号化により量子化後のDCT係数信号に戻し、量子化後のDCT係数信号に逆量子化部22による逆量子化処理及び逆DCT部23による逆DCT変換処理を施すことにより、デコードされた差分画像を復元する。この処理と並行して、逆DCT変換処理後のデコード画像を一時的にフレームメモリ24に保存する。動き補償部25が、フレームメモリ24に保存されたデコード画像を動きベクトル分だけ移動させて画像を再構築し、加算部26が、この再構築画像と差分画像とを加算することにより動き補償処理を実行する。加算部26による加算後の信号が、復号されたビデオ信号として出力される。なおフレーム内符号化ピクチャは、そのピクチャの情報のみによって復号化され、動き補償処理の対象とはならない。   In the video decoding device 20, the received video stream is converted back to the quantized DCT coefficient signal by variable length decoding by the variable length decoding unit 21, and the quantized DCT coefficient signal is dequantized by the inverse quantization unit 22. The decoded difference image is restored by performing inverse DCT conversion processing by the processing and inverse DCT unit 23. In parallel with this process, the decoded image after the inverse DCT conversion process is temporarily stored in the frame memory 24. The motion compensation unit 25 reconstructs the image by moving the decoded image stored in the frame memory 24 by the motion vector, and the addition unit 26 adds the reconstructed image and the difference image to perform motion compensation processing. Execute. The signal after the addition by the adding unit 26 is output as a decoded video signal. Note that an intra-frame coded picture is decoded only by information about the picture, and is not a target of motion compensation processing.

上記のようなビデオ符号化装置10で生成されビデオ復号装置20により復号されるべきビデオストリームを配布する場合、配布ビデオストリームに何らかのマークをつけることにより、そのビデオストリームが正当な権利(ライセンス)に基づいて符号化されたものであることを示すことが望まれる。このようなマークの有無により、正当な権利に基づいて符号化されたビデオストリームであるか否かを判断できるようにすれば、不当な手段(違法コピー等)を用いて生成されたビデオストリームを排除することが可能になる。   When distributing a video stream generated by the video encoding apparatus 10 as described above and to be decoded by the video decoding apparatus 20, the distribution of the video stream is given a right (license) by marking the distribution video stream. It is desirable to show that it has been encoded based on. If it is possible to determine whether or not the video stream is encoded based on legitimate rights based on the presence or absence of such a mark, a video stream generated using illegal means (illegal copy or the like) It becomes possible to eliminate.

例えば、元の映像の一部分に会社名等のロゴをマークとして挿入したり、またはビデオストリームのユーザーデータ領域に個別情報をマークとして添付したりする手法が考えられる。しかしながら映像にロゴを挿入してしまうと、表示される画面に常にロゴが表示されることになり、観賞性を著しく損なってしまう恐れがある。またユーザーデータ領域に添付された個別情報は、エディタ等で容易に改竄されてしまう恐れがあるため、このような個別情報を添付する手法は最適なものであるとは言えない。即ち、ユーザーデータ領域等の容易に特定されてしまう位置に個別情報等の容易に識別可能なマークを挿入する手法は、改竄が容易であるために好ましくない。
特開平6−105296号公報 特開平9−128874号公報
For example, a method of inserting a logo such as a company name as a mark in a part of the original video or attaching individual information as a mark to a user data area of a video stream is conceivable. However, if the logo is inserted into the video, the logo is always displayed on the screen to be displayed, and there is a possibility that the viewability may be significantly impaired. In addition, since the individual information attached to the user data area may be easily tampered with by an editor or the like, the method of attaching such individual information is not optimal. That is, a method of inserting easily identifiable marks such as individual information at positions that are easily specified in a user data area or the like is not preferable because tampering is easy.
JP-A-6-105296 JP-A-9-128874

以上を鑑みて本発明は、表示映像に影響を与えることなく且つ容易に特定されないマークをビデオストリームに含める符号化装置及び符号化方法を提供することを目的とする。   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 DCT unit 11, a quantization unit 12, a variable length coding unit 33, an inverse quantization unit 14, an inverse DCT unit 15, a frame memory 16, a motion prediction unit 17, and a subtractor 18. including. Compared to the conventional video encoding apparatus 10 of FIG. 1, the variable length encoding unit 13 is replaced by a variable length encoding unit 33.

可変長符号化部33における可変長符号化においては、量子化処理後のDCT係数に対してゼロランレングス符号が割り当てられる。ゼロランレングス符号とは、符号化対象となる信号中の連続するゼロレベル信号とそれに続くゼロレベル以外の信号との組み合わせに対して一つの符号を割り当てる方式である。この際、複数個のゼロレベル信号の数(RUN)と、ゼロレベル以外の信号の値(LEVEL)と、符号とを組として第1の符号表を作成しておく。RUNとLEVELとの組み合わせの頻度に応じてハフマン符号を割り当てることにより、頻度の高い組み合わせには短い符号を割り当て、頻度の低い組み合わせに対しては長い符号を割り当てる。即ち、第1の符号表は可変長符号表である。   In the variable length coding in the variable length coding unit 33, a zero run length code is assigned to the DCT coefficient after the quantization process. The zero run length code is a system in which one code is assigned to a combination of a continuous zero level signal and a subsequent non-zero level signal in a signal to be encoded. At this time, a first code table is created by combining a number of zero level signals (RUN), a signal value other than zero level (LEVEL), and a code. By assigning a Huffman code according to the frequency of the combination of RUN and LEVEL, a short code is assigned to a high-frequency combination, and a long code is assigned to a low-frequency combination. That is, the first code table is a variable length code table.

図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-length code 010s is assigned. Here, s at the end represents a sign. If s = 0, the LEVEL value is positive, and if s = 1, the LEVEL value is negative. Therefore, the variable length code corresponding to the encoding target data “0, +1” is 0100, and the variable length code corresponding to the encoding target data “0, −1” is 0101. For example, for example, when RUN is 0 and LEVEL is -3, that is, the data to be encoded is "-3", the variable length code is 01111. For example, when the RUN is 3 and the LEVEL is +1, that is, the encoding target data is “0, 0, 0, +1”, the variable length code is 001110.

一般的に、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-length code 000010 is used. FIG. 5B shows a fixed-length code table for LEVEL. As shown in the figure, for example, when LEVEL is +2047, a 12-bit fixed length code 011111111111 is used. Therefore, when RUN is 2 and LEVEL is +2047, that is, when the data to be encoded is “0, 0, +2047”, the fixed-length code is 000010 + 0111111111111 (the “+” symbol is inserted for easy viewing). Yes, but not really) This 18-bit fixed length code is output following the escape code 000001 (defined in the variable length code table of FIG. 4).

このようにエスケープ符号を用いると、符号長が長くなってしまうという短所がある。しかしエスケープ符号を用いさえすれば、全ての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 length encoding unit 13 shown in FIG. 1, when the input data to be encoded (quantized DCT coefficient of the input video signal) matches the variable length code table, the input data is handled. The code of the variable length code table is output, and when the input data does not match the variable length code table, the code of the fixed length code table corresponding to the input data is output.

それに対して本願発明の可変長符号化部33においては、以下に説明するように、図4の可変長符号表に存在するRUNとLEVELとの組み合わせの符号化対象データであっても、所定の条件を満たす場合には、図5の固定長符号表を用いて、(エスケープ符号)+(RUNの固定長符号)+(LEVELの固定長符号)を符号化対象データに割り当てる。即ち、入力データが可変長符号表と一致するデータであり且つ所定の条件を満たすと判断されると、その入力データに対応する可変長符号表の符号ではなく、その入力データに対応する固定長符号表の符号を出力するように構成する。   On the other hand, in the variable length coding unit 33 of the present invention, as described below, even if the data to be coded is a combination of RUN and LEVEL existing in the variable length code table of FIG. If the condition is satisfied, (escape code) + (RUN fixed length code) + (LEVEL fixed length code) is assigned to the encoding target data using the fixed length code table of FIG. That is, when it is determined that the input data is data that matches the variable length code table and satisfies a predetermined condition, the fixed length corresponding to the input data is used instead of the code of the variable length code table corresponding to the input data. It is configured to output the code of the code table.

上記の所定の条件は、入力データが可変長符号表中の特定のパターンと一致するデータであることを少なくとも条件の一部としてよい。即ち、図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-length encoding unit 33 outputs the fixed-length code 000010 + 1111111111111 extracted from the fixed-length code table of FIG. 5 following the escape code instead of the variable-length code.

また上記所定の条件は、入力データストリーム中で特定のパターンと一致する複数個の入力データのうち特定のものを指定する条件を含んでよい。例えば上記の例では、入力データストリーム中に出現する入力データ"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 length encoding unit 33. This variable length encoding process is performed on the DCT coefficient after the quantization process of the target block of the input video signal.

ステップ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 length encoding unit 33 in FIG. 7 includes a coefficient position counter 41, a level detection unit 42, a zero run number detection unit 43, a fixed length code allocation unit 44, a variable length code allocation unit 45, a condition determination unit 46, a selector 47, A selector 48, an EOB code assigning unit 49, and a selector 50 are included.

可変長符号化部33による可変長符号化処理は、入力ビデオ信号の着目ブロックの量子化処理後のDCT係数に対して実行される。この着目ブロックの量子化処理後のDCT係数は、ブロック内を所定の走査パターンで走査した順番に供給される。   The variable length coding process by the variable length coding unit 33 is executed on the DCT coefficient after the quantization process of the target block of the input video signal. The DCT coefficients after the quantization processing of the block of interest are supplied in the order in which the block is scanned with a predetermined scanning pattern.

まず係数位置カウンター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 level detection unit 42 detects the level (coefficient value) of the input DCT coefficient, and outputs a Zero_Enable instruction signal indicating a period during which the DCT coefficient value is zero level.

零ラン数検出部43は、走査カウント位置とZero_Enable指示信号とに応じてゼロラン数RUNを生成して出力する。このゼロラン数RUNは、走査順で供給されるDCT係数列においてゼロ以外の係数が出現した時点で出力される。現在のDCT係数が着目ブロックの最後である場合、零ラン数検出部43は、EOB_Enable指示信号をアサートする。   The zero run number detection unit 43 generates and outputs a zero run number RUN according to the scan count position and the Zero_Enable instruction signal. The zero run number RUN is output when a non-zero coefficient appears in the DCT coefficient sequence supplied in the scanning order. When the current DCT coefficient is the last of the block of interest, the zero run number detection unit 43 asserts an EOB_Enable instruction signal.

固定長符号割り当て部44は、零ラン数検出部43からのRUN及びレベル検出部42からのLEVELに応じて対応する固定長符号を特定し、エスケープ符号に続いて当該特定した固定長符号が並ぶ符号化データを出力する。具体的には、固定長符号割り当て部44は内部に図5に示す固定長符号表を備えており、入力されたRUN及びLEVELに一致する固定長符号表中の固定長符号を特定する。更に、エスケープ符号に特定した固定長符号を繋げて、(エスケープ符号)+(RUNの固定長符号)+(LEVELの固定長符号)を出力する。   The fixed-length code assigning unit 44 identifies the corresponding fixed-length code according to the RUN from the zero-run number detecting unit 43 and the LEVEL from the level detecting unit 42, and the identified fixed-length code is arranged following the escape code. Output encoded data. Specifically, the fixed-length code assigning unit 44 includes a fixed-length code table shown in FIG. 5 and identifies a fixed-length code in the fixed-length code table that matches the input RUN and LEVEL. Further, the fixed-length code specified as the escape code is connected, and (escape code) + (RUN fixed-length code) + (LEVEL fixed-length code) is output.

可変長符号割り当て部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 code assigning unit 45 collates the RUN from the zero run number detection unit 43 and the LEVEL from the level detection unit 42 with the variable length code table, and the combination of the input RUN and LEVEL is any of the variable length code tables. The VLC_Enable instruction signal is set to 1 when the combination of RUN and LEVEL matches, and the VLC_Enable instruction signal is set to 0 when they do not match. Further, the variable length code assigning unit 45 further includes a variable corresponding to the combination of the input RUN and LEVEL when the combination of the input RUN and LEVEL matches one of the combinations of RUN and LEVEL in the variable length code table. A long code is output as encoded data. Specifically, the variable-length code assigning unit 45 includes a variable-length code table shown in FIG. 4, and the combination of RUN and LEVEL that matches the input combination of RUN and LEVEL is included in the variable-length code table. If there is a match, a variable length code corresponding to the matched RUN and LEVEL combination is output.

条件判定部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 number detection unit 43, the LEVEL from the level detection unit 42, and the designation condition and position information supplied from the outside to the variable length coding unit 33. Is set to 1 or 0. Specifically, for example, when the specified condition is satisfied, the ESC_Enable instruction signal is set to 1, and when the specified condition is not satisfied, the ESC_Enable instruction signal is set to 0.

ここで指定条件は、特定の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 selector 47 selects either the escape from the fixed length code assigning unit 44 and the fixed length code or the variable length code from the variable length code assigning unit 45 according to the output of the selector 48. When the output of the selector 48 is 1, the variable length code from the variable length code assigning unit 45 is selected. When the output of the selector 48 is 0, the escape from the fixed length code assigning unit 44 and the fixed length code are selected.

セレクタ48は、可変長符号割り当て部45が出力するVLC_Enable指示信号と0との何れかを、条件判定部46からのESC_Enable指示信号に応じて選択し出力する。具体的には、ESC_Enable指示信号が0の場合にはVLC_Enable指示信号が選択出力され、ESC_Enable指示信号が1の場合には0が選択出力される。   The selector 48 selects and outputs either the VLC_Enable instruction signal output from the variable length code assigning unit 45 or 0 according to the ESC_Enable instruction signal from the condition determining unit 46. Specifically, when the ESC_Enable instruction signal is 0, the VLC_Enable instruction signal is selectively output, and when the ESC_Enable instruction signal is 1, 0 is selectively output.

セレクタ47の出力は、セレクタ50に供給される。セレクタ50は、零ラン数検出部43からのEOB_Enable指示信号がアサート状態であればEOB符号割り当て部49が供給するEOB符号を選択して出力し、EOB_Enable指示信号がネゲート状態であればセレクタ47の出力を選択して出力する。   The output of the selector 47 is supplied to the selector 50. The selector 50 selects and outputs the EOB code supplied from the EOB code allocation unit 49 if the EOB_Enable instruction signal from the zero run number detection unit 43 is in the asserted state, and if the EOB_Enable instruction signal is in the negated state, the selector 47 Select an output to output.

以上の構成により、入力データが可変長符号表と一致する場合にその入力データに対応する可変長符号表の可変長符号を出力し、入力データが可変長符号表と一致しない場合にその入力データに対応する固定長符号表の固定長符号を出力する符号化部において、入力データが可変長符号表と一致するデータであり且つ所定の条件を満たすと判断されると、可変長符号の代わりに固定長符号を出力することができる。   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 picture 60 is partitioned into a plurality of slices (Slice 1 to Slice 8), and each slice is further divided into a plurality of macro blocks (MB1 to MB12). In one macroblock, four luminance blocks are shown. In this example, for example, (RAN, LEVEL) specifies (2, -1) as a specific pattern, and input data that matches this pattern is a candidate for escape processing.

図中の△印は、(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 picture 60 where data with (RAN, LEVEL) of (2, −1) has appeared. Further, the x mark indicates the position of the first occurrence in the picture 60 among a plurality of data with (RAN, LEVEL) being (2, -1). In the example shown in FIG. 8, input data having (RAN, LEVEL) of (2, −1) at the position of the x mark is forcibly (escape code) + (fixed length code of RUN) + (LEVEL). Input data with (RAN, LEVEL) of (2, -1) at other positions is converted into a normal variable length code.

図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 picture 60 is partitioned into a plurality of slices (Slice 1 to Slice 8), and each slice is further divided into a plurality of macro blocks (MB1 to MB12). In one macroblock, four luminance blocks are shown. In this example, for example, (RAN, LEVEL) specifies (2, -1) as a specific pattern, and input data that matches this pattern is a candidate for escape processing.

図中の△印は、(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 picture 60 where data with (RAN, LEVEL) of (2, −1) has appeared. The cross indicates the position of the first occurrence of the second macroblock in each slice among a plurality of data with (RAN, LEVEL) being (2, -1). In the example shown in FIG. 9, input data having (RAN, LEVEL) of (2, −1) at the position of the × mark is forcibly (escape code) + (fixed length code of RUN) + (LEVEL). Input data with (RAN, LEVEL) of (2, -1) at other positions is converted into a normal variable length code.

図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 block number 0 that appears first in the picture is the target of the escape process. Similar to FIG. 8, the picture 60 is divided into a plurality of slices and a plurality of macroblocks, and each macroblock includes four luminance blocks of block numbers 0 to 3. The upper left block of each macro block is the luminance block with block number 0. In this example, for example, (RAN, LEVEL) specifies (2, -1) as a specific pattern, and input data that matches this pattern is a candidate for escape processing.

図中の△印は、(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 picture 60 where data with (RAN, LEVEL) of (2, −1) has appeared. The cross indicates the position of the first occurrence in the picture in the block of block number 0 among the plurality of data with (RAN, LEVEL) being (2, -1). In the example shown in FIG. 9, input data having (RAN, LEVEL) of (2, −1) at the position of the × mark is forcibly (escape code) + (fixed length code of RUN) + (LEVEL). Input data with (RAN, LEVEL) of (2, -1) at other positions is converted into a normal variable length code.

図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 block number 0 is the ESC use condition. That is, if the current input data is for the block with block number 0, the determination result in step S5 is Yes.

ステップ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 block number 0 that appears first in the picture is the target of the escape process, but the block at another desired position instead of block number 0 (Block of block number M) may be the target. Further, in each example of FIGS. 8 to 10, the condition such as the data that appears second may be used instead of the condition that the data appears first.

また例えばピクチャカウント値を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 1, wherein the predetermined condition includes at least part of the condition that the input data is data that matches a specific pattern in the first code table.
(Appendix 3)
The encoding apparatus according to claim 2, wherein the predetermined condition includes a condition for designating a specific one of a plurality of input data matching the specific pattern in the input data stream.
(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 3, wherein a specific one is designated.
(Appendix 5)
The encoding apparatus according to supplementary note 1, wherein the first code table is a variable-length code table, and the second code table is a fixed-length code table.
(Appendix 6)
The encoding apparatus according to appendix 1, wherein the encoding unit is configured to output the second code following an escape code.
(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 7, wherein the first code table is a variable length code table and the second code table is a fixed length code table.
(Appendix 9)
The encoding according to appendix 7, wherein when the code of the second code table is output, an escape code is output first, and then the code of the second code table is output following the escape code Method.

MPEG方式に基づく一般的なビデオ符号化装置のブロック構成図である。It is a block diagram of a general video encoding device based on the MPEG system. MPEG方式に基づく一般的なビデオ復号装置のブロック構成図である。It is a block diagram of a general video decoding device based on the MPEG system. 本発明によるMPEG方式に基づくビデオ符号化装置のブロック構成図である。1 is a block diagram of a video encoding apparatus based on an MPEG system according to the present invention. 可変長符号表の一例を示す図である。It is a figure which shows an example of a variable length code table. RUNに対する固定長符号表及びLEVELに対する固定長符号表を示す図である。It is a figure which shows the fixed length code table with respect to RUN, and the fixed length code table with respect to LEVEL. 図3の可変長符号化部が実行する可変長符号化処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the variable length encoding process which the variable length encoding part of FIG. 3 performs. 図3の可変長符号化部の構成の一例を示すブロック構成図である。It is a block block diagram which shows an example of a structure of the variable length encoding part of FIG. 指定条件の一例を説明するための図である。It is a figure for demonstrating an example of designation | designated conditions. 指定条件の別の一例を説明するための図である。It is a figure for demonstrating another example of designation | designated conditions. 指定条件の別の一例を説明するための図である。It is a figure for demonstrating another example of designation | designated conditions. 図7に示す条件判定部によるESC_Enable指示信号の設定動作を示すフローチャートである。It is a flowchart which shows the setting operation | movement of the ESC_Enable instruction | indication signal by the condition determination part shown in FIG.

符号の説明Explanation of symbols

11 DCT部
12 量子化部
13 可変長符号化部
14 逆量子化部
15 逆DCT部
16 フレームメモリ
17 動き予測部
18 減算器
33 可変長符号化部
41 係数位置カウンター
42 レベル検出部
43 零ラン数検出部
44 固定長符号割り当て部
45 可変長符号割り当て部
46 条件判定部
47 セレクタ
48 セレクタ
49 EOB符号割り当て部
50 セレクタ
11 DCT unit 12 Quantization unit 13 Variable length coding unit 14 Inverse quantization unit 15 Inverse DCT unit 16 Frame memory 17 Motion prediction unit 18 Subtractor 33 Variable length coding unit 41 Coefficient position counter 42 Level detection unit 43 Zero run number Detection unit 44 Fixed length code allocation unit 45 Variable length code allocation unit 46 Condition determination unit 47 Selector 48 Selector 49 EOB code allocation unit 50 Selector

Claims (5)

入力データが第1の符号表と一致する場合に該入力データに対応する該第1の符号表の第1の符号を出力し、該入力データが該第1の符号表と一致しない場合に該入力データに対応する第2の符号表の第2の符号を出力する符号化部と、
該入力データが該第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.
該所定の条件は、該入力データが該第1の符号表中の特定のパターンと一致するデータであることを少なくとも条件の一部とすることを特徴とする請求項1記載の符号化装置。   2. The encoding apparatus according to claim 1, wherein the predetermined condition includes at least part of the condition that the input data is data that matches a specific pattern in the first code table. 該所定の条件は、入力データストリーム中で該特定のパターンと一致する複数個の入力データのうち特定のものを指定する条件を含むことを特徴とする請求項2記載の符号化装置。   3. The encoding apparatus according to claim 2, wherein the predetermined condition includes a condition for designating a specific one of the plurality of input data matching the specific pattern in the input data stream. 該入力データは各フレームが複数のスライス及び複数のブロックを含む映像データであり、該所定の条件は、該フレーム、該スライス、及び該ブロックの少なくとも1つを参照して該複数個の入力データのうち特定のものを指定することを特徴とする請求項3記載の符号化装置。   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. 4. The encoding apparatus according to claim 3, wherein a specific one is designated. 該第1の符号表は可変長符号表であり該第2の符号表は固定長符号表であることを特徴とする請求項1記載の符号化装置。   2. The encoding apparatus according to claim 1, wherein the first code table is a variable-length code table, and the second code table is a fixed-length code table.
JP2007217452A 2007-08-23 2007-08-23 Encoder Withdrawn JP2009055124A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (1)

* Cited by examiner, † Cited by third party
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