JP2008283701A - Data processor and data processing method, and recording medium - Google Patents

Data processor and data processing method, and recording medium Download PDF

Info

Publication number
JP2008283701A
JP2008283701A JP2008160003A JP2008160003A JP2008283701A JP 2008283701 A JP2008283701 A JP 2008283701A JP 2008160003 A JP2008160003 A JP 2008160003A JP 2008160003 A JP2008160003 A JP 2008160003A JP 2008283701 A JP2008283701 A JP 2008283701A
Authority
JP
Japan
Prior art keywords
data
encoded data
unit
temporary
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.)
Granted
Application number
JP2008160003A
Other languages
Japanese (ja)
Other versions
JP4507130B2 (en
Inventor
Tetsujiro Kondo
哲二郎 近藤
Kazutaka Ando
一隆 安藤
Koji Ota
浩二 太田
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2008160003A priority Critical patent/JP4507130B2/en
Publication of JP2008283701A publication Critical patent/JP2008283701A/en
Application granted granted Critical
Publication of JP4507130B2 publication Critical patent/JP4507130B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To embed second data without increasing an amount of encoded data generated by encoding first data and to accurately decode the first and second data. <P>SOLUTION: An encoder 11 generates the encoded data in which the second data has been embedded by shifting the correspondence relationship between quantized code obtained by quantizing the first data and a quantization error by a manipulated variable corresponding to the second data. A decoder 12 decodes temporary encoded data by shifting the correspondence relationship between a quantized code of the buried encoded data and a quantization error by a specified manipulated variable, and decodes temporary decoded data from the temporary encoded data. It is determined whether the temporary encoded data are correct, and the first and second data are decoded based upon the judgment result. The present invention is applicable to a case where the second data are embedded without increasing the amount of encoded data generated by encoding the first data, etc. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、データ処理装置およびデータ処理方法、並びに記録媒体に関し、特に、例えば、復号画像の画質を劣化させることなく、かつデータ量を増加せずに、画像に情報を埋め込むことができるようにするデータ処理装置およびデータ処理方法、並びに記録媒体に関する。   The present invention relates to a data processing device, a data processing method, and a recording medium, and in particular, for example, so that information can be embedded in an image without degrading the image quality of a decoded image and without increasing the amount of data. The present invention relates to a data processing apparatus, a data processing method, and a recording medium.

データに対して、そのデータ量を増加させることなく、情報を埋め込む手法としては、例えば、ディジタルオーディオデータの最下位ビットや、下位2ビットなどを、埋め込む情報に変換するものなどがある。この手法は、ディジタルオーディオデータの下位ビットが、その音質にあまり影響を与えないことを利用し、その下位ビットを、単に、埋め込む情報に置き換えるものであり、従って、再生時には、情報が埋め込まれたディジタルオーディオデータは、その下位ビットを元に戻さずに、そのまま出力される。即ち、情報が埋め込まれた下位ビットを、元に戻すのは困難であり、また、下位ビットは、音質に、あまり影響を与えないことから、ディジタルオーディオデータは、情報が埋め込まれた状態で出力される。   As a technique for embedding information without increasing the amount of data, there is, for example, a method of converting the least significant bit or the lower two bits of digital audio data into information to be embedded. This method uses the fact that the lower bits of the digital audio data do not significantly affect the sound quality, and simply replaces the lower bits with information to be embedded. Therefore, at the time of playback, the information is embedded. The digital audio data is output as it is without returning its lower bits. In other words, it is difficult to restore the low-order bits embedded with information, and the low-order bits do not affect the sound quality so much, so the digital audio data is output with the information embedded. Is done.

しかしながら、上述のような手法では、本来のデータと異なるデータが出力される。従って、データがオーディオデータである場合には、その音質に、また、データがビデオデータである場合には、その画質に、少なからず影響がある。   However, with the above-described method, data different from the original data is output. Therefore, when the data is audio data, the sound quality is affected, and when the data is video data, the image quality is affected.

本発明は、このような状況に鑑みてなされたものであり、例えば、画像の画質を劣化させることなく、かつデータ量を増加せずに、画像に情報を埋め込むこと等ができるようにするものである。   The present invention has been made in view of such circumstances. For example, information can be embedded in an image without degrading the image quality and without increasing the data amount. It is.

本発明の第1の側面のデータ処理装置、又は、記録媒体は、第1のデータを、量子化し、その結果得られる量子化コードと量子化誤差を、符号化データとして出力する符号化手段と、前記符号化データとしての量子化コードの各値と量子化誤差との対応関係を、第2のデータに対応する操作量でシフトすることにより、前記第2のデータが埋め込まれた埋め込み符号化データを生成する埋め込み手段とを備えるデータ処理装置、又は、データ処理装置として、コンピュータを機能させるためのプログラムが記録された記録媒体である。   The data processing apparatus or the recording medium according to the first aspect of the present invention includes an encoding unit that quantizes the first data and outputs a quantization code and a quantization error obtained as a result as encoded data. The embedded encoding in which the second data is embedded by shifting the correspondence between each value of the quantization code as the encoded data and the quantization error by an operation amount corresponding to the second data A data processing apparatus including an embedding unit for generating data, or a recording medium on which a program for causing a computer to function as a data processing apparatus is recorded.

本発明の第1のデータ処理方法は、データ処理装置が、第1のデータを、量子化し、その結果得られる量子化コードと量子化誤差を、符号化データとして出力し、前記符号化データとしての量子化コードの各値と量子化誤差との対応関係を、第2のデータに対応する操作量でシフトすることにより、前記第2のデータが埋め込まれた埋め込み符号化データを生成するステップを含むデータ処理方法である。   In the first data processing method of the present invention, the data processing apparatus quantizes the first data, and outputs a quantization code and a quantization error obtained as a result as encoded data. A step of generating embedded encoded data in which the second data is embedded by shifting the correspondence between each value of the quantization code and the quantization error by an operation amount corresponding to the second data. It is a data processing method including.

本発明の第1の側面においては、第1のデータが、量子化され、その結果得られる量子化コードと量子化誤差が、符号化データとして出力される。さらに、前記符号化データとしての量子化コードの各値と量子化誤差との対応関係を、第2のデータに対応する操作量でシフトすることにより、前記第2のデータが埋め込まれた埋め込み符号化データが生成される。   In the first aspect of the present invention, the first data is quantized, and the resulting quantization code and quantization error are output as encoded data. Furthermore, the embedded code in which the second data is embedded by shifting the correspondence between each value of the quantization code as the encoded data and the quantization error by an operation amount corresponding to the second data Data is generated.

本発明の第2の側面のデータ処理装置、又は、記録媒体は、第1のデータを量子化することにより得られる量子化コードと量子化誤差を含む符号化データに第2のデータが埋め込まれた埋め込み符号化データにおける、前記量子化コードの各値と量子化誤差との対応関係を、特定の操作量でシフトすることにより、仮の符号化データを復号する仮符号化データ復号手段と、所定のコードブックに応じて、前記仮の符号化データから、仮の復号データを復号する仮復号データ復号手段と、前記量子化コードと量子化誤差と、前記仮復号データ復号手段により復号された仮の復号データを再度符号化することにより得られた量子化コードと量子化誤差とを比較することにより、前記仮の符号化データが正しいか否かを判定する判定手段とを備え、前記仮符号化データ復号手段は、前記判定手段による判定結果に応じて前記操作量を変更して再び仮の符号化データを復号し、前記判定手段は、前記仮の符号化データが正しいと判定したとき、前記操作量に対応するデータを前記第2のデータとして出力し、前記仮復号データ復号手段からの仮の復号データを真の復号データとして出力するデータ処理装置、又は、データ処理装置として、コンピュータを機能させるためのプログラムが記録された記録媒体である。   In the data processing apparatus or the recording medium according to the second aspect of the present invention, the second data is embedded in the encoded data including the quantization code and the quantization error obtained by quantizing the first data. Temporary encoded data decoding means for decoding the temporary encoded data by shifting the correspondence between each value of the quantization code and the quantization error in the embedded encoded data by a specific operation amount; Temporary decoded data decoding means for decoding temporary decoded data, the quantization code and the quantization error, and the temporary decoded data decoding means decoded from the temporary encoded data according to a predetermined code book A determination unit that determines whether or not the temporary encoded data is correct by comparing a quantization code and a quantization error obtained by re-encoding the temporary decoded data; The temporary encoded data decoding means changes the manipulated variable according to the determination result by the determination means and decodes the temporary encoded data again, and the determination means determines that the temporary encoded data is correct. A data processing device that outputs data corresponding to the manipulated variable as the second data, and outputs temporary decoded data from the temporary decoded data decoding means as true decoded data, or a data processing device A recording medium on which a program for causing a computer to function is recorded.

本発明の第2の側面のデータ処理方法は、データ処理装置が、第1のデータを量子化することにより得られる量子化コードと量子化誤差を含む符号化データに第2のデータが埋め込まれた埋め込み符号化データにおける、前記量子化コードの各値と量子化誤差との対応関係を、特定の操作量でシフトすることにより、仮の符号化データを復号する仮符号化データ復号ステップと、所定のコードブックに応じて、前記仮の符号化データから、仮の復号データを復号する仮復号データ復号ステップと、前記量子化コードと量子化誤差と、前記仮復号データ復号ステップにより復号された仮の復号データを再度符号化することにより得られた量子化コードと量子化誤差とを比較することにより、前記仮の符号化データが正しいか否かを判定する判定ステップとを含み、前記仮符号化データ復号ステップにおいて、前記判定ステップによる判定結果に応じて前記操作量を変更して再び仮の符号化データを復号し、前記判定ステップにおいて、前記仮の符号化データが正しいと判定したとき、前記操作量に対応するデータを前記第2のデータとして出力し、前記仮復号データ復号ステップで復号した仮の復号データを真の復号データとして出力するデータ処理方法である。   In the data processing method according to the second aspect of the present invention, the data processing device embeds the second data in the encoded data including the quantization code and the quantization error obtained by quantizing the first data. A temporary encoded data decoding step of decoding the temporary encoded data by shifting the correspondence between each value of the quantization code and the quantization error in the embedded encoded data by a specific operation amount; In accordance with a predetermined code book, the temporary decoded data decoding step for decoding the temporary decoded data from the temporary encoded data, the quantization code and the quantization error, and the temporary decoded data decoding step Determination of whether or not the temporary encoded data is correct by comparing the quantization code obtained by re-encoding the temporary decoded data with a quantization error In the temporary encoded data decoding step, the operation amount is changed according to the determination result in the determination step, and the temporary encoded data is decoded again. In the determination step, the temporary encoding data is decoded. A data processing method for outputting data corresponding to the manipulated variable as the second data and outputting the provisional decoded data decoded in the provisional decoded data decoding step as true decoded data when it is determined that the data is correct; is there.

本発明の第2の側面においては、第1のデータを量子化することにより得られる量子化コードと量子化誤差を含む符号化データに第2のデータが埋め込まれた埋め込み符号化データにおける、前記量子化コードの各値と量子化誤差との対応関係を、特定の操作量でシフトすることにより、仮の符号化データが復号される。また、所定のコードブックに応じて、前記仮の符号化データから、仮の復号データが復号され、前記量子化コードと量子化誤差と、仮の復号データを再度符号化することにより得られた量子化コードと量子化誤差とを比較することにより、前記仮の符号化データが正しいか否かが判定される。この場合において、前記仮の符号化データが正しいか否かの判定結果に応じて前記操作量が変更されて再び仮の符号化データが復号され、前記仮の符号化データが正しいと判定されたとき、前記操作量に対応するデータが前記第2のデータとして出力され、仮の復号データが真の復号データとして出力される。   In the second aspect of the present invention, in the embedded encoded data in which the second data is embedded in the encoded data including the quantization code obtained by quantizing the first data and the quantization error, Temporarily encoded data is decoded by shifting the correspondence between each value of the quantization code and the quantization error by a specific operation amount. Further, the temporary decoded data is decoded from the temporary encoded data according to a predetermined code book, and the quantization code, the quantization error, and the temporary decoded data are encoded again. By comparing the quantization code and the quantization error, it is determined whether or not the temporary encoded data is correct. In this case, the manipulated variable is changed according to the determination result as to whether or not the temporary encoded data is correct, the temporary encoded data is decoded again, and the temporary encoded data is determined to be correct. At this time, data corresponding to the manipulated variable is output as the second data, and provisional decoded data is output as true decoded data.

本発明の第1及び第2の側面によれば、第1のデータを符号化した符号化データのデータ量を増加させることなく、第2のデータを埋め込むことができ、さらに、そのような第2のデータを埋め込んだデータから、第1および第2のデータを、正確に復号することが可能となる。   According to the first and second aspects of the present invention, the second data can be embedded without increasing the data amount of the encoded data obtained by encoding the first data. The first and second data can be accurately decoded from the data in which the second data is embedded.

図1は、本発明を適用した埋め込み圧縮/復号システム(システムとは、複数の装置が論理的に集合した物をいい、各構成の装置が同一筐体中にあるか否かは問わない)の一実施の形態の構成例を示している。   FIG. 1 shows an embedded compression / decoding system to which the present invention is applied (a system means a logical collection of a plurality of devices, regardless of whether or not each component device is in the same casing). 2 shows a configuration example of an embodiment.

この埋め込み圧縮/復号システムは、符号化装置1および復号装置2で構成されており、符号化装置は、符号化対象としての、例えば、画像を符号化し、復号装置2は、その符号化結果を、元の画像に復号するようになっている。   The embedded compression / decoding system includes an encoding device 1 and a decoding device 2, and the encoding device encodes, for example, an image as an encoding target, and the decoding device 2 displays the encoding result. The original image is decoded.

即ち、符号化装置1は、埋め込み圧縮符号化器11で構成され、そこには、符号化対象としての画像と、その画像に埋め込まれる情報(以下、適宜、付加情報という)とが供給されるようになっている。そして、埋め込み圧縮符号化器11は、画像(ディジタル画像データ)を、所定の符号化ルールにしたがって圧縮符号化するとともに、その符号化ルールを、付加情報(ディジタルデータ)に基づいて破壊することにより、その付加情報を埋め込み、埋め込み符号化データを得て出力する。埋め込み圧縮符号化器11が出力する埋め込み符号化データは、例えば、半導体メモリ、光磁気ディスク、磁気ディスク、光ディスク、磁気テープ、相変化ディスクなどでなる記録媒体3に記録され、あるいは、また、例えば、地上波、衛星回線、CATV(Cable Television)網、インターネット、公衆回線などでなる伝送媒体4を介して伝送され、復号装置2に提供される。   In other words, the encoding apparatus 1 includes an embedded compression encoder 11, and an image to be encoded and information embedded in the image (hereinafter referred to as additional information as appropriate) are supplied thereto. It is like that. The embedded compression encoder 11 compresses and encodes the image (digital image data) according to a predetermined encoding rule, and destroys the encoding rule based on the additional information (digital data). The additional information is embedded, and embedded encoded data is obtained and output. The embedded encoded data output from the embedded compression encoder 11 is recorded on the recording medium 3 formed of, for example, a semiconductor memory, a magneto-optical disk, a magnetic disk, an optical disk, a magnetic tape, a phase change disk, or the like. The data is transmitted via a transmission medium 4 including a terrestrial wave, a satellite line, a CATV (Cable Television) network, the Internet, a public line, and the like, and is provided to the decoding device 2.

復号装置2は、復号器12で構成され、そこでは、記録媒体3または伝送媒体4を介して提供される埋め込み符号化データが受信される。そして、復号器12は、その埋め込み符号化データを、所定の符号化ルールにしたがって符号化された符号化データに復元することにより、そこに埋め込まれている付加情報を復号し、さらに、符号化データを、元の画像に復号する。復号された画像は、例えば、図示せぬモニタ等に供給されて表示される。   The decoding device 2 includes a decoder 12 in which embedded encoded data provided via the recording medium 3 or the transmission medium 4 is received. Then, the decoder 12 restores the embedded encoded data to encoded data encoded according to a predetermined encoding rule, thereby decoding the additional information embedded therein, and further encoding Decode the data into the original image. The decoded image is supplied to and displayed on a monitor (not shown), for example.

なお、付加情報としては、例えば、元の画像に関連するテキストデータや、音声データ、その画像を縮小した縮小画像等は勿論、元の画像に無関係なデータを用いることも可能である。即ち、付加情報としては、あらゆるデータ(プログラムも含む)を用いることが可能である。   As additional information, for example, text data related to the original image, audio data, a reduced image obtained by reducing the image, and data irrelevant to the original image can be used. That is, any data (including programs) can be used as the additional information.

また、付加情報としては、埋め込み圧縮符号化器11に供給する符号化対象としての画像の一部を用いることも可能である。即ち、埋め込み圧縮符号化器11には、画像の一部を付加情報として供給するとともに、残りの画像を符号化対象として供給することが可能である。   Further, as the additional information, it is possible to use a part of an image as an encoding target supplied to the embedded compression encoder 11. That is, it is possible to supply a part of an image as additional information to the embedded compression encoder 11 and supply the remaining image as an encoding target.

次に、図2は、図1の埋め込み圧縮符号化器11の構成例を示している。   Next, FIG. 2 shows a configuration example of the embedded compression encoder 11 of FIG.

フレームメモリ21は、埋め込み圧縮符号化器11に供給される画像データを、例えば、フレーム単位で記憶する。付加情報メモリ22は、埋め込み圧縮符号化器11に供給される付加情報を記憶する。   The frame memory 21 stores the image data supplied to the embedded compression encoder 11 in units of frames, for example. The additional information memory 22 stores additional information supplied to the embedded compression encoder 11.

可変長符号化部23は、フレームメモリ21に記憶された画像データを、可変長符号化としての、例えば、ハフマン符号化し、その結果得られる符号化データを、符号化ルール破壊部25に供給する。また、可変長符号化部23は、ハフマン符号化の際、後述するようにして、ハフマンテーブルを作成するが、そのハフマンテーブルを、変換テーブル作成部24に供給する。さらに、可変長符号化部23は、変換テーブル作成部24に出力したハフマンテーブルを得るのに必要な情報としてのハフマンテーブル関連情報を、MUX(マルチプレクサ)26に供給する。   The variable length coding unit 23 performs, for example, Huffman coding on the image data stored in the frame memory 21 as variable length coding, and supplies the resulting coded data to the coding rule destruction unit 25. . In addition, the variable length coding unit 23 creates a Huffman table as described later at the time of Huffman coding, and supplies the Huffman table to the conversion table creation unit 24. Furthermore, the variable length encoding unit 23 supplies HUXman table related information as information necessary for obtaining the Huffman table output to the conversion table creating unit 24 to the MUX (multiplexer) 26.

変換テーブル作成部24は、可変長符号化部23から供給されるハフマンテーブルにおける符号を変換するための変換テーブルを、付加情報メモリ22に記憶された付加情報に基づいて作成する。即ち、ハフマンテーブルは、ハフマン符号化する対象の値(ここでは、画像の画素値)と、各符号長の符号(符号化データ)との対応関係を記述したものであるが、変換テーブル作成部24は、そのようなハフマンテーブルにおける符号を、付加情報に基づく符号に変換するための変換テーブルを作成する。変換テーブル作成部24で作成された変換テーブルは、符号化ルール破壊部25に供給される。   The conversion table creation unit 24 creates a conversion table for converting codes in the Huffman table supplied from the variable length coding unit 23 based on the additional information stored in the additional information memory 22. That is, the Huffman table describes the correspondence between values to be Huffman encoded (here, pixel values of an image) and codes (encoded data) of each code length. 24 creates a conversion table for converting codes in such a Huffman table into codes based on additional information. The conversion table created by the conversion table creation unit 24 is supplied to the encoding rule destruction unit 25.

符号化ルール破壊部25は、付加情報に基づき、可変長符号化部23における符号化ルールを破壊することにより、その付加情報を埋め込む。即ち、符号化ルール破壊部25は、変換テーブル作成部24が付加情報に基づき作成した変換テーブルにしたがって、可変長符号化部23が出力する符号化データ(符号)を変換(操作)し、可変長符号化部23における符号化ルールを破壊した符号化ルールにより符号化された符号化データを得る。この破壊された符号化ルールにより符号化された符号化データは、元の符号化データに、付加情報が埋め込まれた埋め込み符号化データとして、符号化ルール破壊部25からMUX26に供給される。   The encoding rule destruction unit 25 embeds the additional information by destroying the encoding rule in the variable length encoding unit 23 based on the additional information. That is, the encoding rule destruction unit 25 converts (manipulates) the encoded data (code) output from the variable length encoding unit 23 according to the conversion table created by the conversion table creation unit 24 based on the additional information, and changes the variable. Encoded data encoded according to an encoding rule that destroys the encoding rule in the long encoding unit 23 is obtained. The encoded data encoded by the destroyed encoding rule is supplied from the encoding rule destruction unit 25 to the MUX 26 as embedded encoded data in which additional information is embedded in the original encoded data.

MUX26は、符号化ルール破壊部25からの埋め込み符号化データと、可変長符号化部23からのハフマンテーブル関連情報とを多重化し、多重化データとして出力する。この多重化データが、図1で説明したように、記録媒体3または伝送媒体4を介して、復号装置2に提供される。   The MUX 26 multiplexes the embedded encoded data from the encoding rule destruction unit 25 and the Huffman table related information from the variable length encoding unit 23 and outputs the multiplexed data. This multiplexed data is provided to the decoding device 2 via the recording medium 3 or the transmission medium 4 as described in FIG.

次に、図3は、図2の可変長符号化部23の構成例を示している。   Next, FIG. 3 shows a configuration example of the variable length encoding unit 23 of FIG.

図2のフレームメモリ21においては、そこに記憶された画像データの各フレームが、例えば、時間順に、順次、注目フレームとされ、その注目フレームの画像データが読み出される。この注目フレームの画像データは、頻度テーブル作成部31と符号化部34に供給される。   In the frame memory 21 of FIG. 2, each frame of the image data stored therein is sequentially set as the attention frame, for example, in time order, and the image data of the attention frame is read out. The image data of the frame of interest is supplied to the frequency table creation unit 31 and the encoding unit 34.

頻度テーブル作成部31は、そこに供給される注目フレームを構成する画素について、各画素値と、その出現頻度とを対応付けた頻度テーブルを作成し、ハフマン木作成部32に供給する。また、頻度テーブルは、ハフマンテーブル関連情報として、頻度テーブル作成部31から、図3のMUX26に供給される。   The frequency table creation unit 31 creates a frequency table in which each pixel value is associated with the appearance frequency for the pixels constituting the target frame supplied thereto, and supplies the frequency table to the Huffman tree creation unit 32. Further, the frequency table is supplied from the frequency table creation unit 31 to the MUX 26 in FIG. 3 as Huffman table related information.

ここで、図3の実施の形態では、頻度テーブルを、ハフマンテーブル関連情報として用いるようにしたが、ハフマンテーブル関連情報は、後述するハフマンテーブル作成部33が作成するハフマンテーブルを得ることができるような情報であれば、特に限定されるものではなく、従って、ハフマンテーブル関連情報としては、頻度テーブルの他、例えば、ハフマンテーブル作成部33が作成するハフマンテーブルそのもの等を用いることが可能である。   Here, in the embodiment of FIG. 3, the frequency table is used as the Huffman table related information, but the Huffman table related information can obtain a Huffman table created by the Huffman table creating unit 33 described later. Therefore, as the Huffman table related information, for example, the Huffman table itself created by the Huffman table creation unit 33 or the like can be used as the Huffman table related information.

ハフマン木作成部32は、頻度テーブル作成部31から供給される頻度テーブルに基づいて、いわゆるハフマン木を作成し、ハフマンテーブル作成部33に供給する。ハフマンテーブル作成部33は、ハフマン木作成部32からのハフマン木に基づき、ハフマンテーブルを作成する。即ち、ハフマンテーブル作成部33は、注目フレームにおける各画素値に対して、その画素値の出現頻度が高いほど、短い符号長の符号(出現頻度が低いほど長い符号長の符号)が割り当てられたハフマンテーブルを作成する。このハフマンテーブルは、符号化部34に供給されるとともに、図2の変換テーブル作成部24に供給される。   The Huffman tree creation unit 32 creates a so-called Huffman tree based on the frequency table supplied from the frequency table creation unit 31 and supplies the so-called Huffman table creation unit 33. The Huffman table creation unit 33 creates a Huffman table based on the Huffman tree from the Huffman tree creation unit 32. That is, the Huffman table creation unit 33 is assigned to each pixel value in the frame of interest a code having a shorter code length (a code having a longer code length as the appearance frequency is lower) as the appearance frequency of the pixel value is higher. Create a Huffman table. This Huffman table is supplied to the encoding unit 34 and also to the conversion table creating unit 24 in FIG.

符号化部34は、そこに供給される注目フレームの画素を、例えば、ラスタスキャン順に、順次、注目画素とし、その注目画素の画素値を、ハフマンテーブル作成部33からのハフマンテーブルにおいて対応付けられている符号に変換し、符号化データとして出力する。   The encoding unit 34 sequentially sets the pixel of the target frame supplied thereto as the target pixel in order of, for example, raster scan, and associates the pixel value of the target pixel in the Huffman table from the Huffman table creation unit 33. And is output as encoded data.

以上のように構成される可変長符号化部23では、頻度テーブル作成部31において、注目フレームについて頻度テーブルが作成され、ハフマン木作成部32に供給される。ハフマン木作成部32では、頻度テーブル作成部31からの頻度テーブルに基づいて、ハフマン木が作成され、ハフマンテーブル作成部33に供給される。ハフマンテーブル作成部33では、ハフマン木作成部32からのハフマン木に基づき、ハフマンテーブルが作成され、符号化部34に供給される。符号化部34では、注目フレームの各画素値が、ハフマンテーブルにおいて、その画素値に対応付けられている符号に変換され、符号化データとして出力される。   In the variable-length encoding unit 23 configured as described above, the frequency table creation unit 31 creates a frequency table for the frame of interest and supplies it to the Huffman tree creation unit 32. In the Huffman tree creation unit 32, a Huffman tree is created based on the frequency table from the frequency table creation unit 31 and supplied to the Huffman table creation unit 33. The Huffman table creation unit 33 creates a Huffman table based on the Huffman tree from the Huffman tree creation unit 32 and supplies the Huffman table to the encoding unit 34. In the encoding unit 34, each pixel value of the frame of interest is converted into a code associated with the pixel value in the Huffman table and output as encoded data.

次に、図4を参照して、可変長符号化部23における可変長符号化処理について、さらに説明する。   Next, the variable length coding process in the variable length coding unit 23 will be further described with reference to FIG.

いま、頻度テーブル作成部31において、例えば、図4(A)に示すような頻度テーブルが作成されたとする。ここで、図4(A)は、注目フレームにおいて、画素値「0」、「1」、「2」、「3」、「4」が、それぞれ、5,4,3,2,1回ずつ現れていることを表している。   Assume that the frequency table creation unit 31 creates a frequency table as shown in FIG. 4A, for example. Here, FIG. 4A shows that the pixel values “0”, “1”, “2”, “3”, and “4” are respectively 5, 4, 3, 2, and 1 times in the frame of interest. Indicates that it is appearing.

図4(A)の頻度テーブルについては、ハフマン木作成部32において、例えば、図4(B)乃至図4(E)に示すように、各画素値の出現頻度に基づき、いわばボトムアップ式に、ハフマン木が作成される。   With respect to the frequency table of FIG. 4A, in the Huffman tree creation unit 32, for example, as shown in FIGS. 4B to 4E, based on the appearance frequency of each pixel value, in a so-called bottom-up manner. A Huffman tree is created.

即ち、ハフマン木作成部32は、頻度テーブルにおける画素値の中から、出現頻度が最も低いものを2つ選択し、1つの接点を構成する。さらに、ハフマン木作成部32は、選択した2つの画素値のうちの、出現頻度が低い方に、ビット"0"または"1"のうちの、例えば、"0"を割り当て、他方に、"1"を割り当てる。そして、ハフマン木作成部32は、選択した2つの画素値によって構成した接点に対して、その選択した2つの画素値の出現頻度の加算値を、その接点の出現頻度として割り当てる。   That is, the Huffman tree creation unit 32 selects two pixels having the lowest appearance frequency from the pixel values in the frequency table, and configures one contact point. Further, the Huffman tree creation unit 32 assigns, for example, “0” of the bits “0” or “1” to the lower one of the two selected pixel values, and “ Assign 1 ". Then, the Huffman tree creation unit 32 assigns the added value of the appearance frequencies of the two selected pixel values as the appearance frequency of the contact points to the contact points constituted by the selected two pixel values.

従って、図4(A)に示した頻度テーブルにおいては、図4(B)に示すように、出現頻度が1の画素値「4」と、出現頻度が2の画素値「3」が選択され、接点#1が構成されるとともに、その接点#1の出現頻度として、3(=1+2)が割り当てられる。さらに、選択された2つの画素値「4」と「3」のうち、出現頻度が低い方の画素値「4」に、ビット"0"が割り当てられるとともに、出現頻度が高い方の画素値「3」に、ビット"1"が割り当てられる。   Accordingly, in the frequency table shown in FIG. 4A, as shown in FIG. 4B, the pixel value “4” having the appearance frequency 1 and the pixel value “3” having the appearance frequency 2 are selected. The contact # 1 is configured, and 3 (= 1 + 2) is assigned as the appearance frequency of the contact # 1. Further, among the selected two pixel values “4” and “3”, the bit value “0” is assigned to the pixel value “4” having the lower appearance frequency, and the pixel value “4” having the higher appearance frequency is assigned. Bit “1” is assigned to “3”.

ここで、図4(B)乃至図4(E)では、出現頻度を表す数字を、カッコ()で囲って表してある。   Here, in FIGS. 4B to 4E, numbers representing the appearance frequencies are enclosed in parentheses ().

なお、選択された2つの画素値の出現頻度が同一の場合には、いずれの画素値に、ビット"0"または"1"を割り当てても良い。但し、例えば、画素値が小さい方に、ビット"0"を割り当てるといったように、どちらの画素値に、ビット"0"または"1"を割り当てるかを、あらかじめ決めておく必要がある。   Note that when the frequency of appearance of the two selected pixel values is the same, the bit “0” or “1” may be assigned to any pixel value. However, it is necessary to determine in advance which pixel value the bit “0” or “1” is assigned to, for example, the bit “0” is assigned to the smaller pixel value.

ハフマン木作成部32では、以下、同様の処理が、接点が1つ収束するまで繰り返される。   In the Huffman tree creation unit 32, the same processing is repeated until one contact converges.

従って、図4(B)の状態からは、図4(C)に示すように、出現頻度がいずれも3の接点#1と画素値「2」が選択され、その接点#1と画素値「2」が、1つの接点#2とされる。さらに、接点#2の出現頻度が6(=3+3)とされ、接点#1と画素値「2」には、それぞれビット"0"と"1"が割り当てられる。   Therefore, from the state of FIG. 4B, as shown in FIG. 4C, the contact # 1 and the pixel value “2” having the appearance frequency of 3 are selected, and the contact # 1 and the pixel value “2” are selected. “2” is one contact # 2. Further, the appearance frequency of the contact # 2 is 6 (= 3 + 3), and bits “0” and “1” are assigned to the contact # 1 and the pixel value “2”, respectively.

図4(C)の状態からは、図4(D)に示すように、出現頻度が4の画素値「1」と、出現頻度が5の画素値「0」が選択され、その画素値「1」と「0」が、1つの接点#3とされる。さらに、接点#3の出現頻度が9(=4+5)とされ、画素値「1」と「0」には、それぞれビット"0"と"1"が割り当てられる。   From the state of FIG. 4C, as shown in FIG. 4D, a pixel value “1” having an appearance frequency of 4 and a pixel value “0” having an appearance frequency of 5 are selected. “1” and “0” are one contact # 3. Further, the appearance frequency of the contact # 3 is 9 (= 4 + 5), and the bits “0” and “1” are assigned to the pixel values “1” and “0”, respectively.

図4(D)の状態からは、図4(E)に示すように、出現頻度が6の接点#2と、出現頻度が9の接点#3が選択され、その接点#2と#3が、1つの接点#4とされる。さらに、接点#4の出現頻度が15(=6+9)とされ、接点#2と#3には、それぞれビット"0"と"1"が割り当てられる。   From the state of FIG. 4D, as shown in FIG. 4E, the contact # 2 with the appearance frequency 6 and the contact # 3 with the appearance frequency 9 are selected, and the contacts # 2 and # 3 are selected. One contact # 4. Further, the appearance frequency of the contact # 4 is 15 (= 6 + 9), and bits “0” and “1” are assigned to the contacts # 2 and # 3, respectively.

図4(E)の状態では、接点が、1つの接点#4に収束しているので、ハフマン木の完成となり、ハフマン木作成部32は、このハフマン木を、ハフマンテーブル作成部33に供給する。   In the state shown in FIG. 4E, since the contacts converge to one contact # 4, the Huffman tree is completed, and the Huffman tree creating unit 32 supplies the Huffman tree to the Huffman table creating unit 33. .

ハフマンテーブル作成部33は、ハフマン木を、収束した接点から、画素値の方向に辿っていくことで、各画素値に割り当てられた符号を認識する。   The Huffman table creation unit 33 recognizes the code assigned to each pixel value by tracing the Huffman tree from the converged contact point in the direction of the pixel value.

即ち、例えば、図4(E)に示したハフマン木を、接点#4から、画素値「0」の方向に辿っていき、各接点(または画素値)に割り当てられたビットを並べると、"0"→"0"→"0"となる。これにより、ハフマンテーブル作成部33は、画素値「0」に対して、符号"000"が割り当てられたことを認識する。また、図4(E)に示したハフマン木を、接点#4から、画素値「1」の方向に辿っていき、各接点に割り当てられたビットを並べると、"0"→"0"→"1"となる。これにより、ハフマンテーブル作成部33は、画素値「1」に対して、符号"001"が割り当てられたことを認識する。   That is, for example, when the Huffman tree shown in FIG. 4E is traced from the contact # 4 in the direction of the pixel value “0” and the bits assigned to the respective contacts (or pixel values) are arranged, “ 0 "→" 0 "→" 0 ". Thereby, the Huffman table creation unit 33 recognizes that the code “000” is assigned to the pixel value “0”. Further, when the Huffman tree shown in FIG. 4E is traced from the contact # 4 in the direction of the pixel value “1” and the bits assigned to the respective contacts are arranged, “0” → “0” → It becomes "1". Thereby, the Huffman table creation unit 33 recognizes that the code “001” is assigned to the pixel value “1”.

以下、同様にして、ハフマンテーブル33は、各画素値に割り当てられた符号を認識し、画素値と符号との対応関係を表すハフマンテーブルを作成する。従って、図4(E)に示したハフマン木からは、図4(F)に示すようなハフマンテーブルが作成されることになる。   Hereinafter, similarly, the Huffman table 33 recognizes the code assigned to each pixel value, and creates a Huffman table representing the correspondence between the pixel value and the code. Therefore, a Huffman table as shown in FIG. 4F is created from the Huffman tree shown in FIG.

なお、可変長符号化部23には、その他、例えば、特許第2977570号に記載されている方法等によって、可変長符号化を行わせることが可能である。   In addition, the variable length coding unit 23 can perform variable length coding by other methods such as those described in Japanese Patent No. 2977570.

図4(E)に示したハフマンテーブルにおいては、出現頻度が5,4,3,2,1回の画素値「0」、「1」、「2」、「3」、「4」それぞれに、符号"11","10","01","001","000"が割り当てられており、従って、基本的に、出現頻度が高いほど、符号長の短い符号が割り当てられている。   In the Huffman table shown in FIG. 4 (E), the pixel values “0”, “1”, “2”, “3”, and “4” each having an appearance frequency of 5, 4, 3, 2, and 1 are shown. The codes “11”, “10”, “01”, “001”, and “000” are assigned. Therefore, basically, the higher the appearance frequency, the shorter the code length.

ところで、図4(E)のハフマンテーブルにおいては、画素値「0」、「1」、「2」、「3」、「4」の出現頻度は異なるが、出現頻度が比較的高い画素値「0」、「1」、「2」には、2ビットの符号が割り当てられており、出現頻度が比較的低い画素値「3」、「4」には、3ビットの符号が割り当てられている。   Incidentally, in the Huffman table of FIG. 4E, the pixel values “0”, “1”, “2”, “3”, and “4” have different appearance frequencies but the pixel values “relatively high appearance frequency”. A 2-bit code is assigned to “0”, “1”, and “2”, and a 3-bit code is assigned to pixel values “3” and “4” that have relatively low appearance frequencies. .

このように、ハフマンテーブルにおいては、出現頻度が異なっていても、同一の符号長の符号が割り当てられる場合があり、画素値の出現頻度と、その画素値に割り当てられる符号の符号長との関係は、一般に、図5に示すようになる。   In this way, in the Huffman table, even if the appearance frequencies are different, codes having the same code length may be assigned, and the relationship between the appearance frequency of the pixel value and the code length of the code assigned to the pixel value Is generally as shown in FIG.

いま、図5において、nビットの符号が割り当てられる画素値がx個あるとすると(但し、xは2n以下の整数)、そのx個の画素値に対するnビットの符号の割り当てパターンは、x!パターンだけ存在するが(!は階乗を表す)、ハフマンテーブルにおいては、そのx!パターンのうちの1つだけが、上述したハフマン木を作成する際のルールに基づいて採用されているにすぎない。 Now, in FIG. 5, if there are x pixel values to which an n-bit code is assigned (where x is an integer equal to or less than 2 n ), an n-bit code assignment pattern for the x pixel values is x ! There are only patterns (! Represents the factorial), but in the Huffman table, that x! Only one of the patterns is employed based on the rules for creating the Huffman tree described above.

一方、ハフマンテーブルにおける、x個の画素値に対するnビットの符号の割り当てパターンを変更しても、符号量は増加しない。即ち、ハフマンテーブルにおいて、nビットのある符号が割り当てられるある画素値に、他のnビットの符号を割り当てても、割り当てられる符号長は、nビットのままであるから、符号量は増加しない。   On the other hand, even if the n-bit code allocation pattern for x pixel values in the Huffman table is changed, the code amount does not increase. That is, in the Huffman table, even if another n-bit code is assigned to a certain pixel value to which an n-bit code is assigned, the assigned code length remains n bits, so the code amount does not increase.

さらに、ハフマンテーブルにおける、x個の画素値に対するnビットの符号の割り当てパターンを変更しても、例えば、そのx個の画素値の出現頻度に基づいて、符号の割り当てパターンは、元に戻すことができる。   Furthermore, even if the n-bit code allocation pattern for the x pixel values in the Huffman table is changed, the code allocation pattern is restored to the original, for example, based on the appearance frequency of the x pixel values. Can do.

以上から、ハフマンテーブルにおいて同一の符号長の符号が割り当てられている画素値に対する符号の割り当てパターンを変更しても、即ち、可変長符号化の符号化ルールを破壊しても、符号量は増加せず、さらに、変更後の割り当てパターンは、元に戻すことができる。   From the above, even if the code allocation pattern for the pixel values to which the code of the same code length is assigned in the Huffman table is changed, that is, even if the coding rule of variable length coding is destroyed, the code amount increases. In addition, the changed assignment pattern can be restored.

このことは、画素値に対する符号の割り当てパターンの変更を、何らかの情報に基づいて行うことで、全体のデータ量を増加させずに、情報を埋め込むことができ、かつ、その埋め込んだ情報を、オーバヘッドなしで復号することができることを意味する。   This is because, by changing the code allocation pattern for pixel values based on some information, it is possible to embed information without increasing the overall data amount, and to embed the embedded information in overhead. It means that it can be decrypted without.

即ち、図6は、8ビットで表される画素値(0乃至255)について作成されたハフマンテーブルの例を示している。なお、図6においては、画素値と、その画素値に割り当てられた符号(符号化データ)の他、各画素値の出現頻度も示してある。   That is, FIG. 6 shows an example of a Huffman table created for pixel values (0 to 255) represented by 8 bits. In FIG. 6, in addition to the pixel value and the code (encoded data) assigned to the pixel value, the appearance frequency of each pixel value is also shown.

図6において、例えば、画素値「12」乃至「18」の7つの画素値に注目すると、これらの7つの画素値には、いずれも、9ビットの符号が割り当てられており、この7つの画素値に対する9ビットの符号の割り当て方は、7!パターンだけ存在する。従って、この7つの画素値に対する9ビットの符号の割り当てパターンを変更することで、int[log27!]ビットの情報を埋め込むことができる。なお、int[]は、[]内の値以下の最大の整数値を意味する。 In FIG. 6, for example, when attention is paid to seven pixel values of pixel values “12” to “18”, a 9-bit code is assigned to each of these seven pixel values. How to assign a 9-bit code to a value is 7! Only patterns exist. Therefore, int [log 2 7!] Bit information can be embedded by changing the 9-bit code allocation pattern for these seven pixel values. Note that int [] means the maximum integer value less than or equal to the value in [].

ここで、図7(A)は、図6における画素値「12」乃至「18」それぞれの出現頻度をグラフによって表したものであり、図7(B)は、図6において、画素値「12」乃至「18」それぞれに割り当てられた9ビットの符号を表している。   Here, FIG. 7A shows the appearance frequencies of the pixel values “12” to “18” in FIG. 6 in a graph, and FIG. 7B shows the pixel value “12” in FIG. "To" 18 "represent 9-bit codes assigned to each.

いま、図7(B)に示した符号の割り当てを、int[log27!]ビット以下の付加情報に基づいて、例えば、図7(C)に示すように変更したとする。 Now, it is assumed that the code assignment shown in FIG. 7B is changed as shown in FIG. 7C, for example, based on additional information of int [log 2 7!] Bits or less.

即ち、図7(B)においては、画素値「12」乃至「18」に対して、符号"110111111","110111010","110100001","110011001","11011000","011101011","010001010"が、それぞれ割り当てられており、図7(C)では、画素値「12」に割り当てられていた符号"110111111"が画素値「15」に、画素値「15」に割り当てられていた符号"110011001"が画素値「12」に、画素値「16」に割り当てられていた符号"11011000"が顔値「17」に、画素値「17」に割り当てられていた符号"011101011"が画素値「18」に、画素値「18」に割り当てられていた符号"010001010"が画素値「16」に、それぞれ割り当て変更されている。なお、図7では、他の画素値に対する符号の割り当ては、変更されていない。   That is, in FIG. 7B, for the pixel values “12” to “18”, the signs “110111111”, “110111010”, “110100001”, “110011001”, “11011000”, “011101011”, “010001010” "Is assigned, and in FIG. 7C, the code" 110111111 "assigned to the pixel value" 12 "is assigned to the pixel value" 15 "and the code assigned to the pixel value" 15 ". 110011001 "is assigned to the pixel value" 12 ", the code" 11011000 "assigned to the pixel value" 16 "is assigned to the face value" 17 ", and the code" 011101011 "assigned to the pixel value" 17 "is assigned to the pixel value" The code “010001010” assigned to the pixel value “18” is changed to the pixel value “16”. In FIG. 7, the code assignment to other pixel values is not changed.

ここで、他の符号長の符号が割り当てられた画素値についても、符号の割り当てパターンを、付加情報に基づいて変更することができる。図8に、付加情報に基づいて、図6における符号の割り当てパターンを変更した符号化データとしての埋め込み符号化データの例を示す。なお、図8には、埋め込み符号化データとともに、その埋め込み符号化データを、図6に示したハフマンテーブルにしたがって可変長復号を行うことにより得られる復号画素値(埋め込み符号化データを、符号化データを得るときに用いたハフマンテーブルによって復号した画素値)も示してある。   Here, also for pixel values to which codes having other code lengths are assigned, the code assignment pattern can be changed based on the additional information. FIG. 8 shows an example of embedded encoded data as encoded data in which the code allocation pattern in FIG. 6 is changed based on the additional information. FIG. 8 shows the decoded pixel values (embedded encoded data encoded by the variable length decoding of the embedded encoded data together with the embedded encoded data according to the Huffman table shown in FIG. 6. The pixel value decoded by the Huffman table used when obtaining data) is also shown.

図8において、例えば、画素値「12」乃至「18」の7つの画素値に注目し、埋め込み符号化データを、図6のハフマンテーブルにしたがって復号すると、図9(A)に示すような復号画素値が得られる。即ち、埋め込み符号化データを、符号化時に用いたハフマンテーブルにしたがって復号した画素値を、埋め込み復号画素値というものとすると、符号"110011001","110111010","110100001","110111111","010001010","11011000","011101011"は、埋め込み復号画素値「15」、「13」、「14」、「12」、「18」、「16」、「17」に、それぞれ可変長復号される。   In FIG. 8, for example, when attention is paid to seven pixel values of pixel values “12” to “18” and the embedded encoded data is decoded in accordance with the Huffman table of FIG. 6, the decoding as shown in FIG. A pixel value is obtained. That is, if the pixel values obtained by decoding the embedded encoded data according to the Huffman table used at the time of encoding are referred to as embedded decoded pixel values, the codes “110011001”, “110111010”, “110100001”, “110111111”, “ 010001010 "," 11011000 "," 011101011 "are variable length decoded into embedded decoded pixel values" 15 "," 13 "," 14 "," 12 "," 18 "," 16 "," 17 ", respectively The

この埋め込み復号画素値「12」乃至「18」について、その出現頻度をカウントすると、図9(B)に示すようになる。即ち、図6のハフマンテーブルにおいて、画素値「12」乃至「18」に対して割り当てられた符号を、図7(B)および図7(C)に示したように変更したことから、画素値「12」、「15」、「16」乃至「18」については、その出現頻度が、図7(A)に示したものに一致せず、具体的には、可変長符号化前の画素値「15」、「12」、「18」、「16」、「17」の出現頻度にそれぞれ一致したものとなる。   The appearance frequencies of the embedded decoded pixel values “12” to “18” are counted as shown in FIG. 9B. That is, in the Huffman table of FIG. 6, since the codes assigned to the pixel values “12” to “18” are changed as shown in FIG. 7B and FIG. The appearance frequencies of “12”, “15”, “16” to “18” do not match those shown in FIG. 7A, specifically, pixel values before variable-length encoding. “15”, “12”, “18”, “16”, “17” respectively correspond to the appearance frequencies.

しかしながら、元(可変長符号化前)の画素値「12」乃至「18」それぞれの出現頻度と、可変長復号の結果得られる画素値「12」乃至「18」それぞれの出現頻度とは一致するはずであるから、上述のように、画素値の出現頻度が、可変長符号化前と、可変長復号後とで異なるのはおかしい。   However, the appearance frequencies of the original (before variable length coding) pixel values “12” to “18” and the appearance frequencies of the pixel values “12” to “18” obtained as a result of variable length decoding match. Therefore, as described above, it is strange that the appearance frequency of the pixel value is different between before the variable length coding and after the variable length decoding.

そこで、図7(A)に示した元の画素値の出現頻度と、図9(B)に示した埋め込み復号画素値の出現頻度とを比較し、一致する出現頻度を検出することで、付加情報に基づいて変更された符号(可変長符号)の割り当てパターンを元に戻すことができる。即ち、埋め込み符号化データを、ハフマンテーブルに基づいて符号化された符号化データに戻すことができる。そして、埋め込み符号化データを符号化データに戻すときの符号の割り当てパターンの変更の仕方から、埋め込まれた付加情報を復号することができ、また、元に戻した符号化データを可変長復号することで、元の画素値を復号することができる。   Therefore, the appearance frequency of the original pixel value shown in FIG. 7A is compared with the appearance frequency of the embedded decoded pixel value shown in FIG. The allocation pattern of the code (variable length code) changed based on the information can be restored. In other words, the embedded encoded data can be returned to the encoded data encoded based on the Huffman table. Then, the embedded additional information can be decoded from the method of changing the code allocation pattern when the embedded encoded data is returned to the encoded data, and the original encoded data is variable-length decoded. Thus, the original pixel value can be decoded.

具体的には、図7(A)に示した元の画素値の出現頻度と、図9(B)に示した埋め込み復号画素値の出現頻度とを比較することで、埋め込み復号画素値「15」、「13」、「14」、「12」、「17」、「18」、「16」の出現頻度が、元の画素値「12」乃至「18」の出現頻度とそれぞれ一致することを検出することができる。   Specifically, by comparing the appearance frequency of the original pixel value shown in FIG. 7A and the appearance frequency of the embedded decoded pixel value shown in FIG. 9B, the embedded decoded pixel value “15” is compared. ”,“ 13 ”,“ 14 ”,“ 12 ”,“ 17 ”,“ 18 ”,“ 16 ”, and the appearance frequencies of the original pixel values“ 12 ”to“ 18 ”respectively match. Can be detected.

これにより、埋め込み復号画素値「15」、「13」、「14」、「12」、「17」、「18」、「16」が得られた埋め込み符号化データ"110011001","110111010","110100001","110111111","010001010","11011000","011101011"は、付加情報が埋め込まれる前は、図6のハフマンテーブルにおいて、元の画素値「12」乃至「18」に割り当てられている符号"110111111","110111010","110100001","110011001","11011000","011101011","010001010"であったことが分かる。   As a result, the embedded encoded data values “110011001”, “110111010”, “15”, “13”, “14”, “12”, “17”, “18”, “16” are obtained. “110100001”, “110111111”, “010001010”, “11011000”, “011101011” are assigned to the original pixel values “12” to “18” in the Huffman table of FIG. 6 before the additional information is embedded. It can be seen that the codes are “110111111”, “110111010”, “110100001”, “110011001”, “11011000”, “011101011”, “010001010”.

従って、図9(C)に示すように、図7(A)に示した元の画素値の出現頻度と、図9(B)に示した埋め込み復号画素値の出現頻度が一致するように、埋め込み符号化データを変換することにより、図6に示したハフマンテーブルにしたがって符号化された符号化データを復元するとともに、埋め込み符号化データと、復元された符号化データとの対応関係から、付加情報を復号することができる。さらに、復元された符号化データを可変長復号することで、図9(D)に示すように、元の画素値を復号することができる。   Therefore, as shown in FIG. 9C, the appearance frequency of the original pixel value shown in FIG. 7A matches the appearance frequency of the embedded decoded pixel value shown in FIG. By converting the embedded encoded data, the encoded data encoded according to the Huffman table shown in FIG. 6 is restored, and added from the correspondence between the embedded encoded data and the recovered encoded data. Information can be decoded. Furthermore, by performing variable length decoding on the restored encoded data, the original pixel value can be decoded as shown in FIG.

図2の埋め込み圧縮符号化器11では、以上のように、データ量を増加させずに、オーバヘッドなしの復号が可能な埋め込み符号化処理が行われるようになっている。   In the embedded compression encoder 11 of FIG. 2, as described above, the embedded encoding process capable of decoding without overhead is performed without increasing the data amount.

次に、図10のフローチャートを参照して、図2の埋め込み圧縮符号化器11が行う埋め込み符号化処理について、さらに説明する。   Next, the embedded encoding process performed by the embedded compression encoder 11 of FIG. 2 will be further described with reference to the flowchart of FIG.

可変長符号化部23は、ステップS1において、フレームメモリ21から供給される注目フレームの各画素の画素値を可変長符号化し、その結果得られる符号化データを、符号化ルール破壊部25に出力する。また、可変長符号化部23(図3)は、ステップS1における可変長符号化において、その頻度テーブル作成部31で作成される頻度テーブルを、ハフマンテーブル関連情報として、MUX26に出力するとともに、ハフマンテーブル作成部33で作成されるハフマンテーブルを、変換テーブル作成部24に出力する。   In step S <b> 1, the variable length encoding unit 23 performs variable length encoding on the pixel value of each pixel of the target frame supplied from the frame memory 21, and outputs the encoded data obtained as a result to the encoding rule destruction unit 25. To do. Further, the variable length coding unit 23 (FIG. 3) outputs the frequency table created by the frequency table creation unit 31 to the MUX 26 as Huffman table related information in the variable length coding in step S1, and also Huffman. The Huffman table created by the table creation unit 33 is output to the conversion table creation unit 24.

そして、ステップS2において、変換テーブル作成部24が、可変長符号化部23からのハフマンテーブルにおける同一符号長の符号の割り当てパターンを、付加情報メモリ22から供給される付加情報に基づいて変更し、その変更前の符号と変更後の符号とを対応付けた変換テーブルを作成する変換テーブル作成処理を行う。この変換テーブルは、変換テーブル作成部24から符号化ルール破壊部25に供給される。   In step S2, the conversion table creation unit 24 changes the code allocation pattern of the same code length in the Huffman table from the variable length coding unit 23 based on the additional information supplied from the additional information memory 22, Conversion table creation processing for creating a conversion table in which the code before the change and the code after the change are associated is performed. This conversion table is supplied from the conversion table creation unit 24 to the encoding rule destruction unit 25.

符号化ルール破壊部25は、ステップS3において、可変長符号化部23からの符号化データを、変換テーブル作成部24からの変換テーブルにしたがって埋め込み符号化データに変換する符号化データ変換処理を行い、その結果得られる埋め込み符号化データを、MUX26に供給する。   In step S3, the encoding rule destruction unit 25 performs encoded data conversion processing for converting the encoded data from the variable-length encoding unit 23 into embedded encoded data according to the conversion table from the conversion table creation unit 24. The embedded encoded data obtained as a result is supplied to the MUX 26.

MUX26は、ステップS4において、符号化ルール破壊部25からの注目フレームの埋め込み符号化データと、可変長符号化部23からのハフマンテーブル関連情報とを多重化して出力し、ステップS5に進む。   In step S4, the MUX 26 multiplexes and outputs the embedded encoded data of the frame of interest from the encoding rule destruction unit 25 and the Huffman table related information from the variable length encoding unit 23, and proceeds to step S5.

ステップS5では、フレームメモリ21に、注目フレームの次のフレームが記憶されているかどうかが判定される。ステップS5において、フレームメモリ21に、次のフレームが記憶されていると判定された場合、その、次のフレームが、新たに注目フレームとされ、ステップS1に戻り、以下、同様の処理が繰り返される。   In step S5, it is determined whether or not the frame memory 21 stores a frame next to the frame of interest. If it is determined in step S5 that the next frame is stored in the frame memory 21, the next frame is newly set as a frame of interest, the process returns to step S1, and the same processing is repeated thereafter. .

また、ステップS5において、フレームメモリ21に、次のフレームが記憶されていないと判定された場合、埋め込み符号化処理を終了する。   If it is determined in step S5 that the next frame is not stored in the frame memory 21, the embedded encoding process is terminated.

次に、図11のフローチャートを参照して、図2の変換テーブル作成部24が図10のステップS2で行う変換テーブル作成処理について、さらに説明する。   Next, the conversion table creation process performed by the conversion table creation unit 24 in FIG. 2 in step S2 in FIG. 10 will be further described with reference to the flowchart in FIG.

変換テーブル作成処理では、まず最初に、ステップS11において、変換テーブル作成部24は、可変長符号化部23からのハフマンテーブルにおける符号の、ある符号長に注目し、その注目符号長の符号の数を認識する。即ち、変換テーブル作成部24は、注目符号長と同一の符号長を有する符号の数を認識する。   In the conversion table creation process, first, in step S11, the conversion table creation unit 24 pays attention to a certain code length of codes in the Huffman table from the variable length coding unit 23, and the number of codes of the code length of interest. Recognize That is, the conversion table creation unit 24 recognizes the number of codes having the same code length as the target code length.

さらに、変換テーブル作成部24は、ステップS12において、ステップS11で認識した注目符号長の符号の数に基づいて、その注目符号長の符号に埋め込むことのできる付加情報のビット数を算出する。即ち、注目符号長の符号の数をxとすると、変換テーブル作成部24は、y=int[log2(x!)]を演算することにより、埋め込み可能な付加情報のビット数yを求める。 Further, in step S12, the conversion table creation unit 24 calculates the number of bits of additional information that can be embedded in the code of the target code length based on the number of codes of the target code length recognized in step S11. That is, assuming that the number of codes of the target code length is x, the conversion table creation unit 24 calculates y = int [log 2 (x!)] To obtain the number of bits y of additional information that can be embedded.

そして、ステップS13に進み、変換テーブル作成部24は、ステップS12で求めたビット数y分の付加情報を、付加情報メモリ22から読み出し、ステップS14に進む。ステップS14では、変換テーブル作成部24は、注目符号長の符号について、ステップS13で付加情報メモリ22から読み出した付加情報に基づいて、変換テーブルを作成する。即ち、変換テーブル作成部24は、ハフマンテーブルにおいて、各画素値に割り当てられている注目符号長のx個の符号の割り当てパターンを、yビットの付加情報に基づいて変更し、その変更前の符号と、変更後の符号とを対応付けた変換テーブルを、注目符号長の符号についての変換テーブルとして作成する。   In step S13, the conversion table creation unit 24 reads the additional information for the number of bits y obtained in step S12 from the additional information memory 22, and proceeds to step S14. In step S14, the conversion table creation unit 24 creates a conversion table for the code of interest code length based on the additional information read from the additional information memory 22 in step S13. That is, the conversion table creation unit 24 changes the allocation pattern of the x codes of the target code length assigned to each pixel value in the Huffman table based on the additional information of y bits, and the code before the change And the code after the change are created as a conversion table for the code of the target code length.

その後、変換テーブル作成部24は、ステップS15において、付加情報が、付加情報メモリ22に、まだ記憶されているかどうかを判定し、記憶されていないと判定した場合、それまでに、注目フレームについて作成した変換テーブルを、符号化ルール破壊部25(図2)に出力して、変換テーブル作成処理を終了する。   Thereafter, in step S15, the conversion table creation unit 24 determines whether the additional information is still stored in the additional information memory 22, and if it is determined that the additional information is not stored, the conversion table creation unit 24 generates the attention frame until then. The converted table is output to the encoding rule destruction unit 25 (FIG. 2), and the conversion table creation process is terminated.

また、ステップS15において、付加情報が、付加情報メモリ22に、まだ記憶されていると判定された場合、ステップS16に進み、変換テーブル作成部24は、ハフマンテーブルにおけるすべての符号長の符号について変換テーブルを作成したかどうかを判定し、まだ作成していないと判定した場合、ステップS11に戻る。この場合、ステップS11では、変換テーブルを作成していない符号長のうちのいずれかが、新たに注目符号長とされ、以下、同様の処理が繰り返される。   If it is determined in step S15 that the additional information is still stored in the additional information memory 22, the process proceeds to step S16, where the conversion table creation unit 24 converts all codes of codes in the Huffman table. It is determined whether the table has been created. If it is determined that the table has not been created, the process returns to step S11. In this case, in step S11, one of the code lengths for which no conversion table has been created is newly set as the target code length, and the same processing is repeated thereafter.

一方、ステップS16において、ハフマンテーブルにおけるすべての符号長の符号について変換テーブルを作成したと判定された場合、変換テーブル作成処理を終了する。   On the other hand, if it is determined in step S16 that a conversion table has been created for all codes of codes in the Huffman table, the conversion table creation process ends.

次に、図12のフローチャートを参照して、図2の符号化ルール破壊部25が図10のステップS3で行う符号化データ変換処理について、さらに説明する。   Next, the encoded data conversion processing performed by the encoding rule destruction unit 25 in FIG. 2 in step S3 in FIG. 10 will be further described with reference to the flowchart in FIG.

可変長符号化部23は、上述したように、注目フレームにおける各画素を、ラスタスキャン順に、注目画素として、その注目画素の画素値を可変長符号化し、その結果得られる符号化データを、順次出力する。いま、可変長符号化部23が注目画素について出力した符号化データを、注目符号化データというものとすると、符号化ルール破壊部25は、まず最初に、ステップS21において、注目符号化データの符号長を認識し、ステップS22に進む。   As described above, the variable length coding unit 23 performs variable length coding on the pixel value of the target pixel with each pixel in the target frame as the target pixel in the raster scan order, and sequentially obtains the encoded data obtained as a result. Output. Now, assuming that the encoded data output by the variable length encoding unit 23 for the target pixel is referred to as target encoded data, the encoding rule destruction unit 25 firstly encodes the target encoded data in step S21. The length is recognized and the process proceeds to step S22.

ステップS22では、符号化ルール破壊部25は、ステップS21で認識した注目符号化データの符号長についての変換テーブルにしたがって、注目符号化データを変換し、埋め込み符号化データとして、MUX26(図2)に出力する。   In step S22, the encoding rule destruction unit 25 converts the encoded data of interest in accordance with the conversion table for the code length of the encoded data of interest recognized in step S21, and MUX 26 (FIG. 2) as embedded encoded data. Output to.

そして、ステップS23に進み、符号化ルール破壊部25は、可変長符号化部23からの次の符号化データがあるかどうかを判定し、あると判定した場合、その、次の符号化データを、新たに注目符号化データとして、ステップS21に戻り、以下、同様の処理を繰り返す。   Then, the process proceeds to step S23, where the encoding rule destruction unit 25 determines whether there is next encoded data from the variable length encoding unit 23, and if it is determined that there is, the next encoded data is determined. Then, the process returns to step S21 as newly encoded data of interest, and the same processing is repeated thereafter.

また、ステップS23において、次の符号化データがないと判定された場合、符号化データ変換処理を終了する。   If it is determined in step S23 that there is no next encoded data, the encoded data conversion process ends.

次に、図2の埋め込み圧縮符号化器11では、可変長符号化部23における可変長符号化により得られた符号化データを、変換テーブルにしたがって変換することにより、付加情報が埋め込まれた埋め込み符号化データを得るようにしたが、その他、例えば、可変長符号化部23において、画素値と符号との対応関係を変更したハフマンテーブル(以下、適宜、変更ハフマンテーブルという)を作成し、その変更ハフマンテーブルを用いることで、可変長符号化と付加情報の埋め込みとを同時に行う、即ち、破壊した符号化ルールに基づく可変長符号化を行うようにすることが可能である。   Next, in the embedded compression encoder 11 shown in FIG. 2, the encoded data obtained by the variable length encoding in the variable length encoding unit 23 is converted according to the conversion table to embed the additional information embedded therein. In addition, for example, the variable length encoding unit 23 creates a Huffman table in which the correspondence between the pixel value and the code is changed (hereinafter, referred to as a changed Huffman table as appropriate) By using the modified Huffman table, it is possible to perform variable length coding and embedding additional information at the same time, that is, variable length coding based on a broken coding rule.

即ち、図13は、そのような埋め込み符号化処理を行う埋め込み圧縮符号化器11の構成例を示している。なお、図中、図2または図3における場合と対応する部分については、同一の符号を付してあり、以下では、その説明は、適宜省略する。即ち、図13の埋め込み圧縮符号化器11は、符号化ルール破壊部25が設けられておらず、その替わりに、可変長符号化部23が符号化ルール破壊部41を内蔵している他は、図2における場合と同様に構成されている。   That is, FIG. 13 shows a configuration example of the embedded compression encoder 11 that performs such an embedded encoding process. In the figure, portions corresponding to those in FIG. 2 or FIG. 3 are denoted by the same reference numerals, and description thereof will be omitted below as appropriate. That is, the embedded compression encoder 11 of FIG. 13 is not provided with the encoding rule destruction unit 25. Instead, the variable length encoding unit 23 includes the encoding rule destruction unit 41. The configuration is the same as in FIG.

符号化ルール破壊部41には、ハフマンテーブル作成部33が出力するハフマンテーブルと、変換テーブル作成部24が出力する変換テーブルが供給されるようになっている。   The encoding rule destruction unit 41 is supplied with a Huffman table output from the Huffman table creation unit 33 and a conversion table output from the conversion table creation unit 24.

符号化ルール破壊部41は、ハフマンテーブルにおいて各画素値に対応付けられている符号(符号化データ)を、変換テーブルにおいて、その符号に対応付けられている埋め込み符号化データに変更し、これにより、ハフマンテーブル作成部33からのハフマンテーブルを、画素値と埋め込み符号化データとが対応付けられたハフマンテーブルである変更ハフマンテーブルに変更する。この変更ハフマンテーブルは、符号化部34に供給され、符号化部34は、変更ハフマンテーブルにしたがって、画素値を変換する。   The encoding rule destruction unit 41 changes the code (encoded data) associated with each pixel value in the Huffman table to the embedded encoded data associated with the code in the conversion table, thereby Then, the Huffman table from the Huffman table creation unit 33 is changed to a changed Huffman table that is a Huffman table in which pixel values and embedded encoded data are associated with each other. The changed Huffman table is supplied to the encoding unit 34, and the encoding unit 34 converts the pixel value according to the changed Huffman table.

従って、図13においては、符号化部34からは、埋め込み符号化データが出力される。   Therefore, in FIG. 13, the encoded unit 34 outputs embedded encoded data.

次に、図14は、埋め込み圧縮符号化器11が、図2または図13に示したように構成される場合の、図1の復号器12の構成例を示している。   Next, FIG. 14 shows a configuration example of the decoder 12 of FIG. 1 when the embedded compression encoder 11 is configured as shown in FIG. 2 or FIG.

DEMUX(デマルチプレクサ)51は、図2または図13の埋め込み圧縮符号化器11から提供されるデータを、埋め込み符号化データとハフマンテーブル関連情報とに、フレーム単位で分離し、各フレームについての埋め込み符号化データを、可変長復号部52および符号化ルール復元部55に供給するとともに、ハフマンテーブル関連情報を、可変長復号部52、逆変換テーブル作成部54、および可変長復号部56に供給する。   The DEMUX (demultiplexer) 51 separates the data provided from the embedded compression encoder 11 shown in FIG. 2 or FIG. 13 into embedded encoded data and Huffman table related information, and embeds each frame. The encoded data is supplied to the variable length decoding unit 52 and the encoding rule restoration unit 55, and the Huffman table related information is supplied to the variable length decoding unit 52, the inverse conversion table creation unit 54, and the variable length decoding unit 56. .

可変長復号部52は、DEMUX51が出力する埋め込み符号化データおよびハフマン関連情報のフレームを、順次、注目フレームとし、注目フレームについてのハフマンテーブル関連情報としての頻度テーブルから、図3の可変長符号化部23における場合と同様にして、ハフマンテーブルを作成して、逆変換テーブル作成部54に供給する。   The variable length decoding unit 52 sequentially sets the embedded encoded data output from the DEMUX 51 and the frame of the Huffman related information as the frame of interest, and the variable length encoding of FIG. 3 from the frequency table as the Huffman table related information for the frame of interest. As in the case of the unit 23, a Huffman table is created and supplied to the inverse conversion table creation unit 54.

ここで、ハフマンテーブル関連情報としての頻度テーブルから作成されるハフマンテーブルは、可変長符号化部23での可変長符号化に用いられるものと同一のものであり、以下、適宜、正ハフマンテーブルという。また、正ハフマンテーブルを得るのに用いられるハフマンテーブル関連情報としての頻度テーブルを、以下、適宜、正頻度テーブルという。   Here, the Huffman table created from the frequency table as the Huffman table related information is the same as that used for variable-length coding in the variable-length coding unit 23, and is hereinafter referred to as a normal Huffman table as appropriate. . In addition, the frequency table as the Huffman table related information used for obtaining the normal Huffman table is hereinafter referred to as a positive frequency table as appropriate.

可変長復号部52は、さらに、注目フレームについての埋め込み符号化データを、正ハフマンテーブルにしたがって可変長復号し、その結果得られる画素値の復号値、即ち、埋め込み復号画素値を、ハフマンテーブル生成部53に供給する。   The variable length decoding unit 52 further performs variable length decoding of the embedded encoded data for the frame of interest according to the normal Huffman table, and generates a decoded value of the pixel value obtained as a result, that is, an embedded decoded pixel value, as a Huffman table. To the unit 53.

ハフマンテーブル生成部53は、可変長復号部52から供給される注目フレームについての埋め込み復号画素値を可変長符号化するハフマンテーブルを作成し、そのハフマンテーブルと、そのハフマンテーブルを作成する過程で作成される頻度テーブルを、逆変換テーブル作成部54に供給する。   The Huffman table generating unit 53 generates a Huffman table for variable-length encoding the embedded decoded pixel value for the target frame supplied from the variable-length decoding unit 52, and the Huffman table and the Huffman table are generated in the process of generating the Huffman table The frequency table to be processed is supplied to the inverse conversion table creation unit 54.

ここで、ハフマンテーブル生成部53が作成するハフマンテーブルは、埋め込み復号画素値(埋め込み符号化データを、正ハフマンテーブルによって可変長復号したもの)を可変長符号化するものであり、基本的に、符号化データを正しく復号することができるものではない。そこで、この埋め込み復号画素値から得られるハフマンテーブルを、以下、適宜、正ハフマンテーブルに対して、誤ハフマンテーブルという。また、誤ハフマンテーブルを得るのに用いられる頻度テーブルを、以下、適宜、正頻度テーブルに対して、誤頻度テーブルという。   Here, the Huffman table generated by the Huffman table generation unit 53 is a variable length encoding of embedded decoding pixel values (embedded encoded data obtained by variable length decoding using a normal Huffman table). The encoded data cannot be correctly decoded. Therefore, the Huffman table obtained from the embedded decoded pixel value is hereinafter referred to as an erroneous Huffman table as appropriate for the correct Huffman table. In addition, the frequency table used to obtain the erroneous Huffman table is hereinafter referred to as an erroneous frequency table as appropriate with respect to the correct frequency table.

逆変換テーブル作成部54は、可変長復号部52からの正ハフマンテーブル、DEMUX51からのハフマンテーブル関連情報としての正頻度テーブル、ハフマンテーブル生成部53からの誤ハフマンテーブルおよび誤頻度テーブルに基づいて、埋め込み符号化データを、元の符号化データに変換するための逆変換テーブルを作成する。即ち、逆変換テーブル作成部54は、図2(または図13)の変換テーブル作成部24が作成する変換テーブルと同一の逆変換テーブルを作成する。この逆変換テーブルは、符号化ルール復元部55に供給される。   Based on the normal Huffman table from the variable length decoding unit 52, the normal frequency table as the Huffman table related information from the DEMUX 51, the erroneous Huffman table and the erroneous frequency table from the Huffman table generating unit 53, the inverse conversion table creation unit 54 An inverse conversion table for converting the embedded encoded data into the original encoded data is created. That is, the reverse conversion table creation unit 54 creates the same reverse conversion table as the conversion table created by the conversion table creation unit 24 of FIG. 2 (or FIG. 13). This inverse conversion table is supplied to the encoding rule restoration unit 55.

符号化ルール復元部55は、逆変換テーブル作成部54から供給される逆変換テーブルに基づき、DEMUX51からの埋め込み符号化データを、符号化ルールとしての正ハフマンテーブルにしたがって符号化された符号化データに復元する。さらに、符号化ルール復元部55は、埋め込み符号化データと、復元した符号化データとの対応関係、即ち、逆変換テーブルに基づいて、埋め込み符号化データに埋め込まれていた付加情報を復号する。そして、符号化ルール復元部55は、復元した符号化データを、可変長復号部56に出力するとともに、復号した付加情報を、復号付加情報として出力する。   The encoding rule restoration unit 55 encodes the embedded encoded data from the DEMUX 51 based on the normal Huffman table as an encoding rule based on the inverse conversion table supplied from the inverse conversion table creation unit 54. Restore to. Further, the encoding rule restoration unit 55 decodes the additional information embedded in the embedded encoded data based on the correspondence relationship between the embedded encoded data and the recovered encoded data, that is, the inverse conversion table. Then, the encoding rule restoration unit 55 outputs the restored encoded data to the variable length decoding unit 56, and outputs the decoded additional information as decoded additional information.

可変長復号部56は、DEMUX51から供給されるハフマン関連情報から、正ハフマンテーブルを作成し、その正ハフマンテーブルに基づいて、符号化ルール復元部55から供給される符号化データを可変長復号して、その結果得られる復号画素値を出力する。   The variable length decoding unit 56 creates a normal Huffman table from the Huffman related information supplied from the DEMUX 51, and variable length decodes the encoded data supplied from the encoding rule restoration unit 55 based on the normal Huffman table. The decoded pixel value obtained as a result is output.

次に、図15は、図14の可変長復号部52の構成例を示している。   Next, FIG. 15 shows a configuration example of the variable length decoding unit 52 of FIG.

DEMUX51が出力する埋め込み符号化データは、復号部63に供給されるようになっており、同じく、DEMUX51が出力するハフマンテーブル関連情報としての頻度テーブルは、ハフマン木作成部61に供給されるようになっている。   The embedded encoded data output from the DEMUX 51 is supplied to the decoding unit 63. Similarly, the frequency table as the Huffman table related information output from the DEMUX 51 is supplied to the Huffman tree creating unit 61. It has become.

ハフマン木作成部61は、図3のハフマン木作成部32と同様に、注目フレームについての頻度テーブルから、ハフマン木を作成し、ハフマンテーブル作成部62に供給する。   Similar to the Huffman tree creation unit 32 in FIG. 3, the Huffman tree creation unit 61 creates a Huffman tree from the frequency table for the frame of interest and supplies it to the Huffman table creation unit 62.

ハフマンテーブル作成部62は、図3のハフマンテーブル作成部33と同様に、ハフマン木作成部61からのハフマン木に基づいて、ハフマンテーブルを作成し、復号部63に供給する。   The Huffman table creation unit 62 creates a Huffman table based on the Huffman tree from the Huffman tree creation unit 61 and supplies it to the decoding unit 63, as with the Huffman table creation unit 33 in FIG.

復号部63は、ハフマンテーブル作成部62からのハフマンテーブルにしたがい、そこに供給される埋め込み符号化データを、画素値(埋め込み復号画素値)に復号して出力する。   In accordance with the Huffman table from the Huffman table creation unit 62, the decoding unit 63 decodes the embedded encoded data supplied thereto into a pixel value (embedded decoded pixel value) and outputs it.

なお、図14の可変長復号部56も、図15に示した可変長復号部52と同様に構成される。   14 is configured in the same manner as the variable length decoding unit 52 shown in FIG.

次に、図16は、図14のハフマンテーブル生成部53の構成例を示している。   Next, FIG. 16 shows a configuration example of the Huffman table generation unit 53 of FIG.

ハフマンテーブル生成部53において、可変長復号部52が出力する埋め込み復号画素値は、頻度テーブル71に供給される。頻度テーブル71、ハフマン木作成部72、またはハフマンテーブルテーブル作成部73は、図3の頻度テーブル作成部31、ハフマン木作成部32、またはハフマンテーブル作成部33における場合とそれぞれ同様の処理を行う。   In the Huffman table generation unit 53, the embedded decoded pixel value output from the variable length decoding unit 52 is supplied to the frequency table 71. The frequency table 71, the Huffman tree creation unit 72, or the Huffman table table creation unit 73 performs the same processing as in the frequency table creation unit 31, the Huffman tree creation unit 32, or the Huffman table creation unit 33 in FIG.

これにより、頻度テーブル作成部71では、注目フレームの埋め込み復号画素値についての頻度テーブルである誤頻度テーブル(元の画素値についての頻度テーブルではない)が作成され、逆変換テーブル作成部54(図14)に供給される。また、ハフマンテーブル作成部73では、注目フレームの埋め込み復号画素値を、その出現頻度に応じた符号長の符号に変換するためのハフマンテーブルである誤ハフマンテーブル(元の画素値についてのハフマンテーブルではない)が作成され、逆変換テーブル作成部54に供給される。   As a result, the frequency table creation unit 71 creates an error frequency table (not a frequency table for the original pixel values), which is a frequency table for the embedded decoded pixel value of the frame of interest, and the inverse conversion table creation unit 54 (FIG. 14). In addition, the Huffman table creation unit 73 converts an embedded decoded pixel value of the target frame into a code having a code length corresponding to the appearance frequency, and an erroneous Huffman table (in the Huffman table for the original pixel value). Is created) and supplied to the inverse conversion table creation unit 54.

次に、図17は、図14の逆変換テーブル作成部54の構成例を示している。   Next, FIG. 17 shows a configuration example of the inverse conversion table creation unit 54 of FIG.

逆変換テーブル作成部54には、上述したように、正ハフマンテーブル、正頻度テーブル、誤ハフマンテーブル、および誤頻度テーブルが供給されるようになっており、逆変換テーブル作成部54では、これらのテーブルに基づき、図6乃至図9で説明したようにして、埋め込み符号化データと、正ハフマンテーブルによって符号化された符号化データとの対応関係が認識され、その対応関係が記述された逆変換テーブルが作成される。   As described above, a normal Huffman table, a normal frequency table, an erroneous Huffman table, and an erroneous frequency table are supplied to the reverse conversion table creation unit 54. Based on the table, as described with reference to FIGS. 6 to 9, the inverse relationship in which the correspondence relationship between the embedded encoded data and the encoded data encoded by the normal Huffman table is recognized and the corresponding relationship is described. A table is created.

即ち、正ハフマンテーブルおよび誤ハフマンテーブルは、符号対応付け部82に供給され、正頻度テーブルおよび誤頻度テーブルは、比較部81に供給される。   That is, the correct Huffman table and the incorrect Huffman table are supplied to the code association unit 82, and the correct frequency table and the incorrect frequency table are supplied to the comparison unit 81.

そして、比較部81は、正頻度テーブルと誤頻度テーブルとを比較し、各符号長の符号ごとに、正頻度テーブルと誤頻度テーブルにおいて、同一の頻度となっている画素値を検出する。さらに、比較部81は、正頻度テーブルと誤頻度テーブルにおいて、同一の頻度となっている画素値を対応付けた対応画素値テーブルを作成し、符号対応付け部82に供給する。   Then, the comparison unit 81 compares the correct frequency table and the incorrect frequency table, and detects pixel values having the same frequency in the correct frequency table and the incorrect frequency table for each code of each code length. Furthermore, the comparison unit 81 creates a corresponding pixel value table in which pixel values having the same frequency are associated in the correct frequency table and the incorrect frequency table, and supplies the corresponding pixel value table to the code association unit 82.

符号対応付け部82は、比較部81からの対応画素値テーブルにおいて対応付けられている画素値を、正ハフマンテーブルと誤ハフマンテーブルから検索し、その検索した画素値に対応付けられている符号どうしを対応付けることにより、逆変換テーブルを作成する。この逆変換テーブルは、符号化ルール復元部55に供給される。   The code association unit 82 retrieves the pixel values associated in the corresponding pixel value table from the comparison unit 81 from the correct Huffman table and the erroneous Huffman table, and associates the codes associated with the retrieved pixel values. Is created to create an inverse conversion table. This inverse conversion table is supplied to the encoding rule restoration unit 55.

次に、図18のフローチャートを参照して、図14の復号器12による復号処理について説明する。   Next, decoding processing by the decoder 12 in FIG. 14 will be described with reference to the flowchart in FIG.

DEMUX(デマルチプレクサ)51は、そこに供給されるデータを、埋め込み符号化データとハフマンテーブル関連情報とに分離し、各フレームについての埋め込み符号化データを、可変長復号部52および符号化ルール復元部55に供給するとともに、ハフマンテーブル関連情報を、可変長復号部52、逆変換テーブル作成部54、および可変長復号部56に供給する。   A DEMUX (demultiplexer) 51 separates data supplied thereto into embedded encoded data and Huffman table related information, and converts the embedded encoded data for each frame into a variable length decoding unit 52 and an encoding rule restoration And the Huffman table related information is supplied to the variable length decoding unit 52, the inverse conversion table creating unit 54, and the variable length decoding unit 56.

可変長復号部52は、ステップS31において、DEMUX51が出力する埋め込み符号化データおよびハフマン関連情報のフレームを、順次、注目フレームとし、注目フレームについての埋め込み符号化データを可変長復号する。   In step S31, the variable length decoding unit 52 sequentially uses the embedded encoded data and the Huffman related information frame output from the DEMUX 51 as a frame of interest, and performs variable length decoding of the embedded encoded data for the frame of interest.

即ち、可変長復号部52は、注目フレームについてのハフマンテーブル関連情報としての頻度テーブル(正頻度テーブル)から、ハフマンテーブル(正ハフマンテーブル)を作成し、逆変換テーブル作成部54に供給する。さらに、可変長復号部52は、注目フレームについての埋め込み符号化データを、正ハフマンテーブルにしたがって可変長復号し、その結果得られる埋め込み復号画素値を、ハフマンテーブル生成部53に供給する。   That is, the variable length decoding unit 52 creates a Huffman table (correct Huffman table) from the frequency table (correct frequency table) as the Huffman table related information for the frame of interest, and supplies it to the inverse conversion table creation unit 54. Further, the variable length decoding unit 52 performs variable length decoding on the embedded encoded data for the frame of interest according to the normal Huffman table, and supplies the embedded decoded pixel value obtained as a result to the Huffman table generating unit 53.

そして、ステップS32に進み、ハフマンテーブル生成部53は、可変長復号部52から供給される注目フレームについての埋め込み復号画素値から、頻度テーブル(誤頻度テーブル)を作成し、さらに、その誤頻度テーブルから、誤ハフマンテーブルを作成する。この誤頻度テーブルおよび誤ハフマンテーブルは、逆変換テーブル作成部54に供給される。   In step S32, the Huffman table generating unit 53 creates a frequency table (error frequency table) from the embedded decoded pixel values for the frame of interest supplied from the variable length decoding unit 52, and further, the error frequency table. From this, a false Huffman table is created. The error frequency table and the error Huffman table are supplied to the inverse conversion table creation unit 54.

逆変換テーブル作成部54は、ステップS33において、正ハフマンテーブル、ハフマンテーブル関連情報としての正頻度テーブル、誤ハフマンテーブル、および誤頻度テーブルに基づいて、図17で説明したように、逆変換テーブルを作成し、符号化ルール復元部55に供給する。   In step S33, the reverse conversion table creating unit 54 converts the reverse conversion table into the reverse Huffman table, the normal frequency table as the Huffman table related information, the erroneous Huffman table, and the erroneous frequency table as described in FIG. Created and supplied to the encoding rule restoration unit 55.

符号化ルール復元部55は、ステップS34において、逆変換テーブル作成部54から供給される逆変換テーブルにおける各符号長ごとの埋め込み符号化データと符号化データとの対応関係を参照することにより、埋め込み符号化データに埋め込まれていた付加情報を復号し、その結果得られる復号付加情報を出力する。   In step S34, the encoding rule restoration unit 55 refers to the correspondence between the embedded encoded data and the encoded data for each code length in the inverse conversion table supplied from the inverse conversion table creating unit 54, thereby embedding. The additional information embedded in the encoded data is decoded, and the decoded additional information obtained as a result is output.

さらに、符号化ルール復元部55は、ステップS35に進み、逆変換テーブルを参照することにより、DEMUX51からの埋め込み符号化データを、符号化データに変換し、可変長復号部56に供給する。   Further, the encoding rule restoration unit 55 proceeds to step S35, refers to the inverse conversion table, converts the embedded encoded data from the DEMUX 51 into encoded data, and supplies the encoded data to the variable length decoding unit 56.

可変長復号部56は、DEMUX51から供給されるハフマン関連情報から、正ハフマンテーブルを作成し、その正ハフマンテーブルに基づいて、符号化ルール復元部55から供給される符号化データを可変長復号して、その結果得られる復号画素値を出力する。   The variable length decoding unit 56 creates a normal Huffman table from the Huffman related information supplied from the DEMUX 51, and variable length decodes the encoded data supplied from the encoding rule restoration unit 55 based on the normal Huffman table. The decoded pixel value obtained as a result is output.

その後、ステップS37に進み、次のフレームについての埋め込み符号化データおよびハフマンテーブル関連情報が、DEMUX51から出力されているかどうかが判定され、出力されていると判定された場合、その、次のフレームが、新たに注目フレームとされ、ステップS31に戻り、以下、同様の処理が繰り返される。   Thereafter, the process proceeds to step S37, where it is determined whether the embedded encoded data and the Huffman table related information for the next frame are output from the DEMUX 51. If it is determined that the output is performed, the next frame is The frame is newly set as the attention frame, and the process returns to step S31. Thereafter, the same processing is repeated.

また、ステップS37において、次のフレームについての埋め込み符号化データおよびハフマンテーブル関連情報が、DEMUX51から出力されていないと判定された場合、復号処理を終了する。   If it is determined in step S37 that the embedded encoded data and the Huffman table related information for the next frame have not been output from the DEMUX 51, the decoding process ends.

なお、上述したように、ハフマンテーブル関連情報としては、頻度テーブルではなく、ハフマンテーブルそのものを用いることが可能である。但し、この場合には、ハフマンテーブル関連情報としてのハフマンテーブルは、そのハフマンテーブルを参照することで、同一符号長の符号(符号化データ)が割り当てられる画素値の出現頻度の高低を認識することができるように(認識できるようなルールで)作成する必要がある。   As described above, as the Huffman table related information, the Huffman table itself can be used instead of the frequency table. However, in this case, the Huffman table as the Huffman table related information recognizes the appearance frequency of pixel values to which the code (encoded data) of the same code length is assigned by referring to the Huffman table. Must be created (with rules that can be recognized).

また、上述の場合には、フレーム単位で、ハフマンテーブルを作成するようにしたが、ハフマンテーブルは、その他、例えば、フィールド単位や、2フレーム以上の単位で作成するようにすることも可能である。   In the above case, the Huffman table is created in units of frames. However, the Huffman table can be created in units of fields or in units of two frames or more. .

さらに、ハフマンテーブルは、例えば、所定の画像データを用いて、あらかじめ作成しておき、埋め込み圧縮符号化器11と復号器12には、そのあらかじめ作成されたハフマンテーブルによって処理を行わせるようにすることも可能である。但し、この場合、処理する画像データからハフマンテーブルを作成したときに、そのハフマンテーブルが、所定の画像データから作成されたハフマンテーブルと一致していないと、復号器12において、埋め込み符号化データを符号化データに復元することが困難となるため、付加情報は、所定の画像データから作成されたハフマンテーブルと同一のハフマンテーブルが得られる画像データだけを対象に埋め込むようにする必要がある。   Further, the Huffman table is created in advance using, for example, predetermined image data, and the embedded compression encoder 11 and the decoder 12 are caused to perform processing using the previously created Huffman table. It is also possible. However, in this case, when the Huffman table is created from the image data to be processed and the Huffman table does not match the Huffman table created from the predetermined image data, the decoder 12 converts the embedded encoded data into Since it becomes difficult to restore the encoded data, the additional information needs to be embedded only in the image data from which the same Huffman table as the Huffman table created from the predetermined image data is obtained.

次に、図19は、図1の埋め込み圧縮符号化器11の他の構成例を示している。   Next, FIG. 19 shows another configuration example of the embedded compression encoder 11 of FIG.

符号化部91には、符号化対象としての画像データが供給されるようになっており、符号化部91は、画像データを、所定の符号化ルールにしたがって符号化し、その結果得られる符号化データを、埋め込み部92に出力する。   The encoding unit 91 is supplied with image data as an encoding target. The encoding unit 91 encodes the image data according to a predetermined encoding rule, and the resulting encoding is performed. The data is output to the embedding unit 92.

埋め込み部92には、付加情報が供給されるようになっており、埋め込み部92は、符号化部91から供給される符号化データを、付加情報に基づいて操作して、破壊された符号化ルールにしたがって符号化された符号化データとすることにより、その付加情報を、符号化データに埋め込む。   Additional information is supplied to the embedding unit 92, and the embedding unit 92 operates the encoded data supplied from the encoding unit 91 based on the additional information, thereby destroying the encoded data. By making the encoded data encoded according to the rule, the additional information is embedded in the encoded data.

次に、図20のフローチャートを参照して、図19の埋め込み圧縮符号化器11の処理(埋め込み符号化処理)について説明する。   Next, the process (embedded encoding process) of the embedded compression encoder 11 of FIG. 19 will be described with reference to the flowchart of FIG.

符号化部91には、符号化対象としての画像データが、例えば、フレーム単位で供給され、符号化部91は、各フレームを、順次、注目フレームとし、ステップS41において、注目フレームの画像データを、所定の符号化ルールにしたがって符号化する。そして、符号化部91は、その結果得られる符号化データを、埋め込み部92に出力する。   The encoding unit 91 is supplied with image data as an encoding target, for example, in units of frames. The encoding unit 91 sequentially sets each frame as a frame of interest, and in step S41, the image data of the frame of interest is converted. Encoding is performed according to a predetermined encoding rule. Then, the encoding unit 91 outputs the encoded data obtained as a result to the embedding unit 92.

埋め込み部92は、ステップS42において、符号化部91における符号化ルールを、付加情報に基づいて破壊することにより、その付加情報を埋め込む。即ち、埋め込み部92は、符号化部91から供給される符号化データを、付加情報に基づいて操作し、これにより、その付加情報を符号化データに埋め込む。さらに、埋め込み部92は、符号化データに付加情報を埋め込むことにより得られる埋め込み符号化データを出力し、ステップS43に進む。   In step S42, the embedding unit 92 embeds the additional information by destroying the encoding rule in the encoding unit 91 based on the additional information. That is, the embedding unit 92 operates the encoded data supplied from the encoding unit 91 based on the additional information, and thereby embeds the additional information in the encoded data. Furthermore, the embedding unit 92 outputs embedded encoded data obtained by embedding additional information in the encoded data, and the process proceeds to step S43.

ステップS43では、符号化部91が、次に符号化すべきフレームがあるかどうかを判定し、あると判定した場合、その、次のフレームが、新たに注目フレームとされ、ステップS41に戻り、以下、同様の処理が繰り返される。   In step S43, the encoding unit 91 determines whether there is a frame to be encoded next. If it is determined that there is a next frame, the next frame is newly set as a frame of interest, and the process returns to step S41. The same process is repeated.

また、ステップS43において、次に符号化すべきフレームがないと判定された場合、埋め込み符号化処理を終了する。   If it is determined in step S43 that there is no next frame to be encoded, the embedded encoding process is terminated.

次に、図21は、図19の符号化部91の構成例を示している。   Next, FIG. 21 shows a configuration example of the encoding unit 91 of FIG.

図21の符号化部91においては、例えば、画像データを構成する画素値が、RGB(Red,Green,Blue)で表現されるものとして、各画素値が、RGBの色空間においてベクトル量子化され、セントロイドベクトルを表すコード(以下、適宜、VQコードという)、そのコードに対応するセントロイドベクトルで表される画素値の、元の画素値に対する誤差(以下、適宜、VQ残差という)、およびベクトル量子化に用いられたコードブックが、符号化データとして出力されるようになっている。   In the encoding unit 91 in FIG. 21, for example, the pixel values constituting the image data are expressed in RGB (Red, Green, Blue), and each pixel value is vector-quantized in the RGB color space. , A code representing a centroid vector (hereinafter referred to as VQ code as appropriate), an error of the pixel value represented by the centroid vector corresponding to the code with respect to the original pixel value (hereinafter referred to as VQ residual as appropriate), The code book used for vector quantization is output as encoded data.

即ち、符号化対象の画像データは、フレームメモリ101に供給され、フレームメモリ101は、そこに供給される画像データを、例えば、フレーム単位で、順次記憶する。   That is, the image data to be encoded is supplied to the frame memory 101, and the frame memory 101 sequentially stores the image data supplied thereto, for example, in units of frames.

コードブック作成部102は、フレームメモリ101に記憶された画像データのフレームを、順次、注目フレームとし、その注目フレームを構成する各画素の画素値から、その色空間におけるベクトル量子化に用いるコードブックを、例えば、いわゆるLBGアルゴリズムによって作成する。このコードブックは、ベクトル量子化部103に供給されるとともに、符号化データ(の一部)として出力される。   The code book creation unit 102 sequentially sets the frames of the image data stored in the frame memory 101 as a target frame, and the code book used for vector quantization in the color space from the pixel value of each pixel constituting the target frame. Is created by, for example, a so-called LBG algorithm. This code book is supplied to the vector quantization unit 103 and is output as (a part of) encoded data.

ベクトル量子化部103は、フレームメモリ101から注目フレームを読み出し、その注目フレームを構成する各画素を、例えば、ラスタスキャン順に、順次、注目画素とする。そして、ベクトル量子化部103は、注目画素の画素値を、コードブック作成部102からのコードブックを用いてベクトル量子化し、その結果得られるVQコードおよびVQ残差を、符号化データ(の一部)として出力する。   The vector quantization unit 103 reads the target frame from the frame memory 101, and sequentially sets each pixel constituting the target frame as the target pixel in the raster scan order, for example. Then, the vector quantization unit 103 performs vector quantization on the pixel value of the pixel of interest using the code book from the code book creation unit 102, and the resulting VQ code and VQ residual are converted into encoded data (one). Part).

以上のように構成される符号化部91では、図22に示すように、コードブック作成部102において、注目フレームを構成する各画素の画素値から、コードブックが作成され、ベクトル量子化部103に供給される。ベクトル量子化部103は、注目画素の画素値を、コードブック作成部102からのコードブックを用いてベクトル量子化する。   In the coding unit 91 configured as described above, as shown in FIG. 22, the code book creating unit 102 creates a code book from the pixel values of each pixel constituting the frame of interest, and the vector quantization unit 103 To be supplied. The vector quantization unit 103 performs vector quantization on the pixel value of the target pixel using the code book from the code book creation unit 102.

即ち、ベクトル量子化部103は、注目画素の画素値によって表されるRGB空間上の点との距離が最も短い点を表すセントロイドベクトルを、コードブックから検出し、そのセントロイドベクトルを表すVQコードを出力する。さらに、ベクトル量子化部103は、そのVQコードが表すセントロイドベクトルと、注目画素の画素値によって表されるRGB空間上の点に対応するベクトルとの差分を求め、その結果得られる差分ベクトルを、VQ残差として出力する。   That is, the vector quantization unit 103 detects a centroid vector representing a point having the shortest distance from the point on the RGB space represented by the pixel value of the target pixel from the code book, and VQ representing the centroid vector. Output code. Further, the vector quantization unit 103 obtains a difference between the centroid vector represented by the VQ code and a vector corresponding to a point on the RGB space represented by the pixel value of the target pixel, and obtains the difference vector obtained as a result. , Output as a VQ residual.

そして、符号化部91では、以上のようにして得られるコードブック、並びに注目フレームの各画素についてのVQコードおよびVQ残差を、注目フレームについての符号化データとして出力する。   Then, the encoding unit 91 outputs the code book obtained as described above, and the VQ code and VQ residual for each pixel of the target frame as encoded data for the target frame.

次に、図23は、符号化部91が図21に示したように構成される場合の、図19の埋め込み部92の構成例を示している。   Next, FIG. 23 illustrates a configuration example of the embedding unit 92 in FIG. 19 when the encoding unit 91 is configured as illustrated in FIG.

符号化部91が出力する注目フレームのVQコード、VQ残差、コードブックは、VQコードメモリ111、VQ残差メモリ112、コードブックメモリ113に、それぞれ供給されて記憶される。   The VQ code, VQ residual, and code book of the frame of interest output from the encoding unit 91 are supplied and stored in the VQ code memory 111, the VQ residual memory 112, and the code book memory 113, respectively.

VQコードメモリ111とコードブックメモリ113にそれぞれ記憶されたVQコードとコードブックは、そこから読み出され、圧縮部115に供給される。   The VQ code and code book respectively stored in the VQ code memory 111 and the code book memory 113 are read out from the code and supplied to the compression unit 115.

一方、ラインシフト部114は、注目フレームの各ライン(水平ライン)を、例えば、上から下方向に、順次、注目ラインとし、その注目ラインについて、VQ残差メモリ112に記憶されたVQ残差を読み出す。さらに、ラインシフト部114は、注目ラインを構成する画素数を、xとすると、int[log2x]で表されるビット数の付加情報を受信し、例えば、図24に示すように、その付加情報に対応する画素数だけ、注目ラインのVQ残差を右シフトすることにより、その付加情報を、注目ラインに埋め込む。即ち、このラインシフトにより、注目ライン上のある画素に注目すれば、基本的に、その画素についてのVQ残差は、ベクトル量子化により得られるものとは異なるものとなり、ベクトル量子化の符号化ルールが破壊される。そして、符号化ルールが破壊されることにより、付加情報が埋め込まれる。 On the other hand, the line shift unit 114 sequentially sets each line (horizontal line) of the frame of interest, for example, from the top to the bottom as the line of interest, and the VQ residual stored in the VQ residual memory 112 for the line of interest. Is read. Further, the line shift unit 114 receives additional information of the number of bits represented by int [log 2 x], where x is the number of pixels constituting the target line, and for example, as shown in FIG. By shifting the VQ residual of the target line to the right by the number of pixels corresponding to the additional information, the additional information is embedded in the target line. That is, if attention is paid to a certain pixel on the target line due to this line shift, basically, the VQ residual for the pixel is different from that obtained by vector quantization. The rule is destroyed. And additional information is embedded by destroying an encoding rule.

その後、ラインシフト部114は、付加情報を埋め込んだ注目ラインのVQ残差を、圧縮部115に供給する。   Thereafter, the line shift unit 114 supplies the VQ residual of the target line in which the additional information is embedded to the compression unit 115.

ここで、注目ラインのVQ残差を右シフトする場合、注目ラインの右端の画素のVQ残差は、注目ラインの左端の画素にシフトされるものとする。同様に、注目ラインのVQ残差を左シフトする場合、左端の画素のVQ残差は、右端の画素にシフトされるものとする。   Here, when the VQ residual of the target line is shifted to the right, the VQ residual of the rightmost pixel of the target line is shifted to the leftmost pixel of the target line. Similarly, when the VQ residual of the target line is shifted to the left, the VQ residual of the leftmost pixel is shifted to the rightmost pixel.

圧縮部115は、そこに供給されるVQコード、VQ残差、コードブックを、例えば、空間相関やエントロピーの偏り等を利用して圧縮し、その圧縮結果を、MUX116に出力する。MUX116は、圧縮部115からのVQコード、VQ残差、コードブックそれぞれの圧縮結果を多重化して出力する。   The compression unit 115 compresses the VQ code, VQ residual, and code book supplied thereto using, for example, spatial correlation, entropy bias, and the like, and outputs the compression result to the MUX 116. The MUX 116 multiplexes and outputs the compression results of the VQ code, the VQ residual, and the code book from the compression unit 115.

次に、図25のフローチャートを参照して、符号化部91が図21に示したように構成され、埋め込み部92が図23に示したように構成される場合の、図19の埋め込み圧縮符号化器11の処理(埋め込み符号化処理)について説明する。   Next, referring to the flowchart of FIG. 25, the embedded compression code of FIG. 19 when the encoding unit 91 is configured as shown in FIG. 21 and the embedding unit 92 is configured as shown in FIG. The process (embedded encoding process) of the encoder 11 will be described.

符号化部91(図21)では、フレームメモリ101に記憶された所定のフレームが注目フレームとされ、ステップS51において、その注目フレームの各画素が、上述したように、ベクトル量子化されることにより符号化される。注目フレームのベクトル量子化の結果得られる符号化データとしてのVQコード、VQ残差、およびコードブックは、埋め込み部92に供給される。   In the encoding unit 91 (FIG. 21), a predetermined frame stored in the frame memory 101 is set as a target frame, and in step S51, each pixel of the target frame is subjected to vector quantization as described above. Encoded. The VQ code, VQ residual, and code book as encoded data obtained as a result of vector quantization of the frame of interest are supplied to the embedding unit 92.

埋め込み部92(図23)では、符号化部91からの注目フレームについてのVQコード、VQ残差、コードブックが、VQコードメモリ111、VQ残差メモリ112、コードブックメモリ113に、それぞれ供給されて記憶される。そして、ラインシフト部114は、ステップS52において、VQ残差メモリ112にVQ残差が記憶された注目フレームのすべてのラインを処理したかどうかを判定する。   In the embedding unit 92 (FIG. 23), the VQ code, VQ residual, and code book for the frame of interest from the encoding unit 91 are supplied to the VQ code memory 111, the VQ residual memory 112, and the code book memory 113, respectively. Is remembered. In step S52, the line shift unit 114 determines whether all lines of the frame of interest in which the VQ residual is stored in the VQ residual memory 112 have been processed.

ステップS52において、VQ残差メモリ112にVQ残差が記憶された注目フレームのすべてのラインを、まだ処理していないと判定された場合、ラインシフト部114は、注目フレームにおいて、まだ処理してないラインのうちの最も上部に位置するものを、新たに注目ラインとし、ステップS53に進む。   If it is determined in step S52 that all the lines of the target frame for which the VQ residual is stored in the VQ residual memory 112 have not yet been processed, the line shift unit 114 performs processing on the target frame. The line located at the top of the unexisting lines is newly set as the attention line, and the process proceeds to step S53.

ステップS53では、ラインシフト部114は、注目ラインの、VQ残差を画素値とする各画素を、付加情報に対応する画素数だけ右シフトし、これにより、注目ラインに付加情報を埋め込んで、圧縮部115に供給する。その後は、ステップS52に戻り、以下、同様の処理が繰り返される。   In step S53, the line shift unit 114 right-shifts each pixel having the pixel value of the VQ residual of the target line by the number of pixels corresponding to the additional information, thereby embedding the additional information in the target line, It supplies to the compression part 115. Thereafter, the process returns to step S52, and the same processing is repeated thereafter.

そして、ステップS52において、VQ残差メモリ112にVQ残差が記憶された注目フレームのすべてのラインを処理したと判定された場合、ステップS54に進み、圧縮部115は、VQコードメモリ111に記憶された注目フレームについてのVQコードを読み出すとともに、コードブックメモリ113に記憶された注目フレームについてのコードブックを読み出す。そして、圧縮部115は、そのVQコードおよびコードブック、さらには、ラインシフト部114からの付加情報が埋め込まれたVQ残差を圧縮し、MUX116に供給する。   If it is determined in step S52 that all lines of the frame of interest in which the VQ residual is stored in the VQ residual memory 112 have been processed, the process proceeds to step S54, and the compression unit 115 stores the data in the VQ code memory 111. The VQ code for the noticed frame of interest is read out, and the code book for the noticed frame stored in the codebook memory 113 is read out. Then, the compression unit 115 compresses the VQ code and codebook, and further the VQ residual in which the additional information from the line shift unit 114 is embedded, and supplies the compressed VQ code to the MUX 116.

MUX116は、ステップS55において、圧縮部115からのVQコード、VQ残差、およびコードブックを多重化して出力し、ステップS56に進む。   In step S55, the MUX 116 multiplexes and outputs the VQ code, VQ residual, and code book from the compression unit 115, and the process proceeds to step S56.

ステップS56では、符号化部91において、次に符号化すべきフレームがあるかどうかがが判定され、あると判定された場合、その、次に符号化すべきフレームが、新たに注目フレームとされ、ステップS51に戻り、以下、同様の処理が繰り返される。   In step S56, it is determined whether or not there is a frame to be encoded next in the encoding unit 91. If it is determined that there is a frame to be encoded next, the frame to be encoded next is a new frame of interest. Returning to S51, the same processing is repeated thereafter.

また、ステップS56において、次に符号化すべきフレームがないと判定された場合、埋め込み符号化処理を終了する。   If it is determined in step S56 that there is no next frame to be encoded, the embedded encoding process is terminated.

次に、図26は、埋め込み圧縮符号化器11が図19に示したように構成される場合の、図1の復号器12の構成例を示している。   Next, FIG. 26 shows a configuration example of the decoder 12 in FIG. 1 when the embedded compression encoder 11 is configured as shown in FIG.

図19の埋め込み部92が出力する埋め込み符号化データは、符号化ルール復元部121に供給される。   The embedded encoded data output from the embedding unit 92 in FIG. 19 is supplied to the encoding rule restoration unit 121.

符号化ルール復元部121は、埋め込み符号化データを、図19の符号化部91における符号化ルールにしたがって符号化された符号化データに復元し、これにより、埋め込み符号化データに埋め込まれていた付加情報を復号する。   The encoding rule restoration unit 121 restores the embedded encoded data to the encoded data encoded according to the encoding rule in the encoding unit 91 of FIG. 19, and thereby embedded in the embedded encoded data. Decode additional information.

即ち、符号化ルール復元部121は、埋め込み符号化データに対して、パラメータコントローラ124から供給されるパラメータに基づく操作を施すことにより、符号化データの候補(以下、適宜、仮符号化データという)を求める。さらに、符号化ルール復元部121は、埋め込み符号化データを仮符号化データに復元する操作に基づいて、埋め込み符号化データに埋め込まれていた付加情報の候補(以下、仮復号付加情報という)を復号する。そして、仮符号化データは、復号部122および判定部123に、仮復号付加情報は、判定部123に供給される。   In other words, the encoding rule restoration unit 121 performs an operation based on the parameters supplied from the parameter controller 124 on the embedded encoded data, so that encoded data candidates (hereinafter, referred to as temporary encoded data as appropriate). Ask for. Further, the encoding rule restoration unit 121 selects additional information candidates embedded in the embedded encoded data (hereinafter referred to as temporary decoded additional information) based on an operation of recovering the embedded encoded data to temporary encoded data. Decrypt. The provisionally encoded data is supplied to the decoding unit 122 and the determination unit 123, and the provisional decoding additional information is supplied to the determination unit 123.

復号部122は、符号化ルール復元部121からの仮符号化データに対して、図19の符号化部91における符号化ルールに基づく復号処理を施すことにより、元の画素値の候補(以下、適宜、仮復号画素値という)を復号する。この仮復号画素値は、判定部123に供給される。   The decoding unit 122 performs a decoding process based on the encoding rule in the encoding unit 91 in FIG. 19 on the provisionally encoded data from the encoding rule restoration unit 121, so that the original pixel value candidates (hereinafter, As appropriate, this is decoded). The provisional decoded pixel value is supplied to the determination unit 123.

判定部123は、パラメータコントローラ124を制御することにより、1つ以上の値のパラメータを、符号化ルール復元部121に供給させ、その1つ以上の値のパラメータそれぞれに対応して得られる1つ以上の仮復号画素値の中から、正しい(元の画素値に一致する)仮復号画素値を判定する。さらに、判定部123は、1つ以上の仮復号画素値それぞれに付随して、符号化ルール復元部121から供給される1つ以上の仮復号付加情報の中から、正しい復号画素値が得られたときのものを、正しい復号付加情報として選択し、正しい仮復号画素値と仮復号付加情報を、画素値と付加情報の最終的な復号結果(復号画素値と復号付加情報)として、それぞれ出力する。   The determination unit 123 controls the parameter controller 124 to supply the encoding rule restoration unit 121 with one or more parameter values, and obtains one corresponding to each of the one or more parameter values. A correct temporary decoded pixel value (matching the original pixel value) is determined from the above temporary decoded pixel values. Further, the determination unit 123 obtains a correct decoded pixel value from the one or more provisional decoding additional information supplied from the encoding rule restoration unit 121 in association with each of the one or more provisional decoding pixel values. Is selected as correct decoding additional information, and the correct temporary decoded pixel value and temporary decoding additional information are output as the final decoding result (decoded pixel value and additional decoding information) of the pixel value and additional information, respectively. To do.

パラメータコントローラ124は、判定部123の制御にしたがい、埋め込み符号化データを操作するための所定のパラメータを、符号化ルール復元部121に供給する。   The parameter controller 124 supplies predetermined parameters for operating the embedded encoded data to the encoding rule restoration unit 121 under the control of the determination unit 123.

次に、図27のフローチャートを参照して、図26の復号器12の処理(復号処理)について説明する。   Next, processing (decoding processing) of the decoder 12 in FIG. 26 will be described with reference to the flowchart in FIG.

判定部123は、まず最初に、ステップS61において、パラメータコントローラ124を制御することにより、符号化ルール復元部121に与えるパラメータを設定する。これにより、パラメータコントローラ126は、判定部123の制御にしたがったパラメータを、符号化ルール復元部121に供給する。   First, the determination unit 123 sets parameters to be given to the encoding rule restoration unit 121 by controlling the parameter controller 124 in step S61. As a result, the parameter controller 126 supplies parameters according to the control of the determination unit 123 to the encoding rule restoration unit 121.

符号化ルール復元部121は、ステップS62において、埋め込み符号化データに対して、パラメータコントローラ124から供給されるパラメータに基づく操作を施すことにより、仮符号化データに変換し、復号部122および判定部123に供給する。さらに、符号化ルール復元部121は、埋め込み符号化データを仮符号化データに復元する操作、つまりは、パラメータコントローラ124からのパラメータに基づいて、埋め込み符号化データに埋め込まれていた付加情報を復号し、仮復号付加情報として、判定部123に供給する。   In step S62, the encoding rule restoration unit 121 converts the embedded encoded data into temporary encoded data by performing an operation based on the parameters supplied from the parameter controller 124, and decodes the decoding unit 122 and the determination unit. 123. Further, the encoding rule restoration unit 121 decodes the additional information embedded in the embedded encoded data based on an operation for recovering the embedded encoded data to temporary encoded data, that is, based on the parameter from the parameter controller 124. The provisional decoding additional information is supplied to the determination unit 123.

復号部122は、ステップS63において、符号化ルール復元部121からの仮符号化データを、図19の符号化部91における符号化ルールに基づいて復号し、その復号の結果得られる画素値を、仮復号画素値として、判定部123に供給する。   In step S63, the decoding unit 122 decodes the temporary encoded data from the encoding rule restoration unit 121 based on the encoding rule in the encoding unit 91 in FIG. 19, and the pixel value obtained as a result of the decoding is The provisional decoded pixel value is supplied to the determination unit 123.

判定部123は、ステップS64において、復号部122からの仮復号画素値が、正しい復号結果であるかどうか(元の画素値に一致しているかどうか)を判定し、一致していないと判定した場合、ステップS61に戻る。この場合、判定部123は、ステップS61において、パラメータコントローラ124に出力させるパラメータとして、新たな値を設定し、以下、同様の処理を繰り返す。   In step S64, the determination unit 123 determines whether or not the provisional decoded pixel value from the decoding unit 122 is a correct decoding result (matches the original pixel value), and determines that they do not match. If so, the process returns to step S61. In this case, the determination unit 123 sets a new value as a parameter to be output to the parameter controller 124 in step S61, and thereafter repeats the same processing.

一方、ステップS64において、復号部122からの仮復号画素値が、正しい復号結果であると判定された場合、ステップS65に進み、判定部123は、その仮復号画素値を、元の画素値の復号結果である復号画素値として出力する。さらに、判定部123は、その復号画素値が得られたときの仮復号付加情報を、埋め込まれていた付加情報の復号結果である復号付加情報として出力し、ステップS66に進む。   On the other hand, when it is determined in step S64 that the temporary decoded pixel value from the decoding unit 122 is a correct decoding result, the process proceeds to step S65, and the determination unit 123 sets the temporary decoded pixel value to the original pixel value. It outputs as a decoded pixel value which is a decoding result. Further, the determination unit 123 outputs the provisional decoding additional information when the decoded pixel value is obtained as decoding additional information that is a decoding result of the embedded additional information, and proceeds to step S66.

ステップS66では、まだ復号すべき埋め込み符号化データがあるかどうかが判定され、あると判定された場合、ステップS61に戻り、その復号すべき埋め込み符号化データを対象に、以下、同様の処理が繰り返される。   In step S66, it is determined whether there is still embedded encoded data to be decoded. If it is determined that there is, the process returns to step S61, and the same processing is performed for the embedded encoded data to be decoded. Repeated.

また、ステップS66において、復号すべき埋め込み符号化データがないと判定された場合、復号処理を終了する。   If it is determined in step S66 that there is no embedded encoded data to be decoded, the decoding process ends.

次に、図28は、図19の埋め込み部92が図23に示したように構成される場合の、図26の符号化ルール復元部121の構成例を示している。   Next, FIG. 28 illustrates a configuration example of the encoding rule restoration unit 121 in FIG. 26 when the embedding unit 92 in FIG. 19 is configured as illustrated in FIG.

図23のMUX116が出力するデータは、DEMUX131に供給され、DEMUX131は、そこに供給されるデータを、圧縮されたVQコード、VQ残差、およびコードブックに分離し、伸張部132に供給する。伸張部132は、DEMUX131からの、圧縮されたVQコード、VQ残差、コードブックを伸張し、その伸張後のVQコード、VQ残差、コードブックを、VQコードメモリ133、VQ残差メモリ134、コードブックメモリ135にそれぞれ供給する。   Data output from the MUX 116 in FIG. 23 is supplied to the DEMUX 131, and the DEMUX 131 separates the data supplied thereto into a compressed VQ code, a VQ residual, and a code book, and supplies them to the decompression unit 132. The decompression unit 132 decompresses the compressed VQ code, VQ residual, and code book from the DEMUX 131, and decompresses the decompressed VQ code, VQ residual, and code book into the VQ code memory 133 and the VQ residual memory 134. , To the code book memory 135, respectively.

VQコードメモリ133、VQ残差メモリ134、コードブックメモリ135は、伸張部132からのVQコード、VQ残差、コードブックを、それぞれ、フレーム単位で記憶する。   The VQ code memory 133, the VQ residual memory 134, and the code book memory 135 store the VQ code, VQ residual, and code book from the decompression unit 132, respectively, in units of frames.

ラインシフト部136は、VQ残差メモリ134に記憶されたフレームの各ラインを、例えば、上から下方向に、順次、注目ラインとし、その注目ラインについて、VQ残差メモリ134に記憶されたVQ残差を読み出す。さらに、ラインシフト部136は、注目ラインを構成する画素数を、xとすると、0乃至xの範囲の整数値を、パラメータコントローラ124(図26)から、パラメータとして受信し、そのパラメータに対応する画素数だけ、注目ラインのVQ残差を左シフトする。そして、ラインシフト部136は、そのシフト後の各ラインのVQ残差を、VQコードメモリ133に記憶されたVQコード、およびコードブックメモリ135に記憶されたコードブックとともに、仮符号化データとして出力する。   The line shift unit 136 sets each line of the frame stored in the VQ residual memory 134 as a target line sequentially from the top to the bottom, for example, and the VQ stored in the VQ residual memory 134 for the target line. Read the residual. Further, the line shift unit 136 receives an integer value in a range from 0 to x as a parameter from the parameter controller 124 (FIG. 26), where x is the number of pixels constituting the target line, and corresponds to the parameter. The VQ residual of the target line is shifted to the left by the number of pixels. Then, the line shift unit 136 outputs the VQ residual of each line after the shift as temporary encoded data together with the VQ code stored in the VQ code memory 133 and the code book stored in the code book memory 135. To do.

さらに、ラインシフト部136は、パラメータコントローラ124からのパラメータの値を、仮復号付加情報として出力する。   Further, the line shift unit 136 outputs the parameter value from the parameter controller 124 as provisional decoding additional information.

次に、図29は、図19の符号化部91が図21に示したように構成される場合の、図26の復号部122の構成例を示している。   Next, FIG. 29 illustrates a configuration example of the decoding unit 122 in FIG. 26 when the encoding unit 91 in FIG. 19 is configured as illustrated in FIG.

復号部122は、符号化ルール復元部121から供給される符号化データとしての1フレームのVQコード、VQ残差、およびコードブックに基づき、ベクトル逆量子化を行うことにより、画素値を復号する。   The decoding unit 122 decodes the pixel value by performing vector inverse quantization based on one frame of the VQ code, the VQ residual, and the code book as the encoded data supplied from the encoding rule restoration unit 121. .

即ち、ベクトル逆量子化部141には、VQコードおよびコードブックが供給されるようになっており、ベクトル逆量子化部141は、VQコードに対応するセントロイドベクトルを、コードブックから検出し、そのセントロイドベクトルを、加算部142に供給する。加算部142には、ベクトル逆量子化部141からセントロイドベクトルが供給される他、VQ残差としての差分ベクトルも供給されるようになっており、加算部142は、セントロイドベクトルと差分ベクトルとを加算する。そして、加算部142は、その加算の結果得られるベクトルの各成分を、R,G,B値とする画素値を、仮復号画素値として出力する。   That is, the vector inverse quantization unit 141 is supplied with a VQ code and a code book, and the vector inverse quantization unit 141 detects a centroid vector corresponding to the VQ code from the code book, The centroid vector is supplied to the adding unit 142. In addition to the centroid vector supplied from the vector dequantization unit 141, the addition unit 142 is also supplied with a difference vector as a VQ residual, and the addition unit 142 includes the centroid vector and the difference vector. And add. Then, the adding unit 142 outputs a pixel value having R, G, and B values for each component of the vector obtained as a result of the addition as a provisional decoded pixel value.

次に、図30は、符号化ルール復元部121と復号部122が、図28と図29に示したようにそれぞれ構成される場合の、図26の判定部123の構成例を示している。   Next, FIG. 30 illustrates a configuration example of the determination unit 123 in FIG. 26 when the encoding rule restoration unit 121 and the decoding unit 122 are configured as illustrated in FIGS. 28 and 29, respectively.

メモリ151には、符号化ルール復元部121からの仮復号付加情報と、復号部122からの仮復号画素値が供給されるようになっており、メモリ151は、その仮復号付加情報と仮復号画素値を一時記憶するとともに、正誤判定部154の制御にしたがい、記憶した仮復号付加情報と仮復号画素値を読み出し、それぞれを、復号付加情報と復号画素値として出力する。   The memory 151 is supplied with the provisional decoding additional information from the encoding rule restoration unit 121 and the provisional decoding pixel value from the decoding unit 122. The memory 151 stores the provisional decoding additional information and the provisional decoding. The pixel value is temporarily stored, and the stored temporary decoding additional information and temporary decoding pixel value are read according to the control of the correctness determination unit 154, and are output as decoding additional information and decoded pixel value, respectively.

符号化部152には、符号化ルール復元部121が出力する仮符号化データのうちのコードブックと、復号部122が出力する仮復号画素値が供給されるようになっており、符号化部152は、仮復号画素値を、図19の符号化部91と同様に符号化する。即ち、符号化部152は、仮復号画素値を、符号化ルール復元部121からのコードブックを用いてベクトル量子化し、その結果得られるVQコードとVQ残差を、比較部153に供給する。ここで、以下、適宜、仮復号画素値をベクトル量子化して得られるVQコードとVQ残差を、それぞれ、仮VQコードと仮VQ残差という。   The encoding unit 152 is supplied with the codebook of the temporary encoded data output from the encoding rule restoration unit 121 and the temporary decoded pixel value output from the decoding unit 122. 152 encodes the provisional decoded pixel value in the same manner as the encoding unit 91 in FIG. That is, the encoding unit 152 performs vector quantization on the provisional decoded pixel value using the code book from the encoding rule restoration unit 121, and supplies the VQ code and VQ residual obtained as a result to the comparison unit 153. Here, hereinafter, the VQ code and the VQ residual obtained by vector quantization of the temporary decoded pixel value will be referred to as a temporary VQ code and a temporary VQ residual, respectively.

比較部153には、符号化部152が出力する仮VQコードおよび仮VQ残差の他、復号部122が出力する仮符号化データのうちのVQコードおよびVQ残差が供給されるようになっている。比較部153は、仮VQコードと、仮符号化データのVQコードとを比較するとともに、仮VQ残差と、仮符号化データのVQ残差とを比較し、それぞれの比較結果を、正誤判定部154に供給する。   In addition to the temporary VQ code and the temporary VQ residual output from the encoding unit 152, the comparison unit 153 is supplied with the VQ code and the VQ residual in the temporary encoded data output from the decoding unit 122. ing. The comparison unit 153 compares the temporary VQ code with the VQ code of the temporarily encoded data, compares the temporary VQ residual with the VQ residual of the temporarily encoded data, and determines whether each comparison result is correct or incorrect. To the unit 154.

正誤判定部154は、パラメータコントローラ124を制御することにより、パラメータコントローラ124に、ラインシフトを行うビット数を、パラメータとして、符号化ルール復元部121に供給させる。また、正誤判定部154は、比較部153からの仮VQコードと仮符号化データのVQコードとの比較結果、および仮VQ残差と仮符号化データのVQ残差との比較結果に基づいて、仮復号画素値が復号結果として正しいかどうかを判定し、その判定結果に基づき、メモリ151からの仮復号画素値および仮復号付加情報の読み出しを制御する。   The correctness determination unit 154 controls the parameter controller 124 to cause the parameter controller 124 to supply the number of bits to be shifted to the encoding rule restoration unit 121 as a parameter. Further, the correctness determination unit 154 is based on the comparison result between the temporary VQ code from the comparison unit 153 and the VQ code of the temporarily encoded data, and the comparison result between the temporary VQ residual and the VQ residual of the temporarily encoded data. Then, it is determined whether the temporary decoded pixel value is correct as a decoding result, and reading of the temporary decoded pixel value and the temporary decoding additional information from the memory 151 is controlled based on the determination result.

次に、図31を参照して、図30の正誤判定部154が、仮復号画素値が復号結果として正しいかどうかを判定する判定原理について説明する。   Next, with reference to FIG. 31, a description will be given of the determination principle by which the correctness / incorrectness determination unit 154 in FIG. 30 determines whether the provisional decoded pixel value is correct as a decoding result.

符号化部91(図19)では、RGB空間においてベクトル量子化が行われるから、そのベクトル量子化に用いられるセントロイドベクトルは、R成分、B成分、およびG成分の3つの成分から構成される。いま、このR成分、B成分、およびG成分からなるセントロイドベクトルを、(R,G,B)と表すとともに、説明を簡単にするために、コードブックにおけるセントロイドベクトルのR成分、B成分、およびG成分が、いずれも10の倍数で表されるものとすると、R,B,G成分が、例えば、それぞれ102,103,99の画素値(以下、適宜、画素値(102,103,99)と表す)は、セントロイドベクトル(100,100,100)との距離を最も短くするから、セントロイドベクトル(100,100,100)に対応するVQコードにベクトル量子化される。ここで、セントロイドベクトル(100,100,100)に対応するVQコードを、例えば、0とする。   In the encoding unit 91 (FIG. 19), vector quantization is performed in the RGB space, so that the centroid vector used for the vector quantization is composed of three components: an R component, a B component, and a G component. . Now, the centroid vector composed of the R component, the B component, and the G component is expressed as (R, G, B), and in order to simplify the explanation, the R component and the B component of the centroid vector in the codebook Assuming that the G component and the G component are all expressed by multiples of 10, the R, B, and G components are, for example, pixel values of 102, 103, and 99 (hereinafter, pixel values (102, 103, 99) is vector-quantized into a VQ code corresponding to the centroid vector (100, 100, 100) since the distance from the centroid vector (100, 100, 100) is the shortest. Here, the VQ code corresponding to the centroid vector (100, 100, 100) is set to 0, for example.

この場合、VQ残差は、画素値(102,103,99)から、セントロイドベクトル(100,100,100)を減算して、(2,3,−1)となる。従って、画素値(102,103,99)は、VQコード0と、VQ残差(2,3,−1)に符号化される。   In this case, the VQ residual is (2, 3, -1) by subtracting the centroid vector (100, 100, 100) from the pixel value (102, 103, 99). Accordingly, the pixel value (102, 103, 99) is encoded into VQ code 0 and VQ residual (2, 3, -1).

そして、このようにして符号化部91で得られる符号化データとしてのVQコード0と、VQ残差(2,3,−1)をベクトル逆量子化すると、図31(A)に示すように、VQコード0に対応するセントロイドベクトル(100,100,100)と、VQ残差(2,3,−1)とを加算することにより、画素値(102,103,99)が得られ、従って、元の画素値に正しく復号される。   Then, when vector inverse quantization is performed on the VQ code 0 and the VQ residual (2, 3, −1) as encoded data obtained by the encoding unit 91 in this way, as shown in FIG. By adding the centroid vector (100, 100, 100) corresponding to the VQ code 0 and the VQ residual (2, 3, -1), the pixel value (102, 103, 99) is obtained. Therefore, the original pixel value is correctly decoded.

さらに、この復号された画素値(102,103,99)を、再度ベクトル量子化すると、図31(A)に示すように、やはり、VQコード0と、VQ残差(2,3,−1)が得られる。   Further, when the decoded pixel values (102, 103, 99) are vector quantized again, as shown in FIG. 31A, the VQ code 0 and the VQ residual (2, 3, −1) are also obtained. ) Is obtained.

以上から、符号化データとしてのVQコードとVQ残差を復号し、正しい復号結果を得て、その復号結果を再度符号化(ここでは、ベクトル量子化)すると、その符号化の結果得られるVQコードとVQ残差は、符号化データとしてのVQコードとVQ残差に、それぞれ一致する。   As described above, when the VQ code and the VQ residual as encoded data are decoded, a correct decoding result is obtained, and the decoding result is encoded again (here, vector quantization), the VQ obtained as a result of the encoding is obtained. The code and the VQ residual coincide with the VQ code and the VQ residual as encoded data, respectively.

一方、符号化部91で得られる符号化データとしてのVQコード0と、VQ残差(2,3,−1)のうちの、VQ残差(2,3,−1)について、上述したようにラインシフトが行われることにより付加情報が埋め込まれると、VQコード0と、VQ残差(2,3,−1)に対応する画素のVQ残差には、他の画素について得られたVQ残差が割り当てられる。いま、この、他の画素のVQ残差が、例えば、図31(B)に示すように、(10,11,12)であったとすると、VQコード0と、VQ残差(10,11,12)は、図31(B)に示すように、VQコード0に対応するセントロイドベクトル(100,100,100)と、VQ残差(10,11,12)とを加算することにより、画素値(110,111,112)に復号され、従って、元の画素値(102,103,99)には、正しく復号されない。   On the other hand, VQ residual (2, 3, -1) out of VQ code 0 and VQ residual (2, 3, -1) as encoded data obtained by encoding section 91 is as described above. When the additional information is embedded by performing the line shift, the VQ code 0 and the VQ residual of the pixel corresponding to the VQ residual (2, 3, −1) are the VQ obtained for the other pixels. A residual is assigned. Now, assuming that the VQ residuals of the other pixels are (10, 11, 12) as shown in FIG. 31B, for example, VQ code 0 and VQ residuals (10, 11, 12), by adding the centroid vector (100, 100, 100) corresponding to the VQ code 0 and the VQ residual (10, 11, 12) as shown in FIG. Therefore, the original pixel value (102, 103, 99) is not correctly decoded.

従って、この正しく復号されない画素値(110,111,112)を、再度ベクトル量子化しても、図31(B)に示すように、符号化データとしてのVQコード0またはVQ残差(2,3,−1)と一致するVQコードまたはVQ残差は得られない。   Therefore, even if the pixel values (110, 111, 112) that are not correctly decoded are subjected to vector quantization again, as shown in FIG. 31B, VQ code 0 or VQ residual (2, 3) as encoded data is obtained. , -1), a VQ code or a VQ residual is not obtained.

即ち、いまの場合、コードブックにおけるセントロイドベクトルのR成分、B成分、およびG成分は、いずれも10の倍数で表されるものとしてあるから、画素値(110,111,112)との距離を最も短くするセントロイドベクトルは、(110,110,110)となる。従って、セントロイドベクトル(110,110,110)を表すVQコードを、例えば、1とすると、画素値(110,111,112)は、VQコード1と、VQ残差(0,1,2)(=(110,111,112)−(110,110,110))にベクトル量子化され、この場合、VQコードも、また、VQ残差も、元の符号化データであるVQコード0またはVQ残差(10,11,12)に一致しない。   That is, in this case, since the R component, B component, and G component of the centroid vector in the codebook are all expressed by multiples of 10, the distance from the pixel value (110, 111, 112) The shortest centroid vector is (110, 110, 110). Therefore, if the VQ code representing the centroid vector (110, 110, 110) is, for example, 1, the pixel value (110, 111, 112) is the VQ code 1, and the VQ residual (0, 1, 2). (= (110, 111, 112) − (110, 110, 110)). In this case, both the VQ code and the VQ residual are VQ code 0 or VQ which is the original encoded data. Does not match the residual (10, 11, 12).

以上から、図28のラインシフト部136で、パラメータにしたがってシフトされる画素数が、付加情報に一致していない場合、即ち、仮符号化データが、付加情報が埋め込まれる前の符号化データに一致していない場合には、そのような仮符号化データから得られる仮復号画素値を再度符号化して得られるVQコードとVQ残差が、仮符号化データとしてのVQコードとVQ残差に、それぞれ一致せず、これにより、仮符号化データを復号して得られる仮復号画素値が、正しい復号結果でないことを判定することができる。   From the above, when the number of pixels shifted in accordance with the parameters in the line shift unit 136 in FIG. 28 does not match the additional information, that is, the temporary encoded data is changed to the encoded data before the additional information is embedded. If they do not match, the VQ code and VQ residual obtained by re-encoding the provisional decoded pixel value obtained from such provisionally encoded data become the VQ code and VQ residual as provisionally encoded data. Therefore, it can be determined that the provisional decoded pixel values obtained by decoding the provisionally encoded data are not correct decoding results.

一方、図28のラインシフト部136で、パラメータにしたがってシフトされる画素数が、付加情報に一致している場合、即ち、仮符号化データが、付加情報が埋め込まれる前の符号化データに一致している場合には、そのような仮符号化データから得られる仮復号画素値を再度符号化して得られるVQコードとVQ残差が、仮符号化データとしてのVQコードとVQ残差に、それぞれ一致し、これにより、仮符号化データを復号して得られる仮復号画素値が、正しい復号結果であることを判定することができる。   On the other hand, in the line shift unit 136 of FIG. 28, when the number of pixels shifted according to the parameters matches the additional information, that is, the temporary encoded data is equal to the encoded data before the additional information is embedded. If so, the VQ code and VQ residual obtained by re-encoding the provisional decoded pixel value obtained from such provisionally encoded data become the VQ code and VQ residual as provisionally encoded data, Accordingly, it can be determined that the provisional decoded pixel value obtained by decoding the provisionally encoded data is a correct decoding result.

次に、図32のフローチャートを参照して、符号化ルール復元部121、復号部122、判定部123が、図28乃至図30にそれぞれ示したように構成される場合の、図26の復号器12の復号処理について説明する。   Next, referring to the flowchart of FIG. 32, the decoder of FIG. 26 in the case where the encoding rule restoration unit 121, the decoding unit 122, and the determination unit 123 are configured as shown in FIGS. 28 to 30, respectively. The 12 decoding processes will be described.

復号処理では、符号化ルール復元部121のDEMUX131が、そこに供給されるデータを、圧縮されたVQコード、VQ残差、およびコードブックに分離し、伸張部132に供給する。伸張部132は、ステップS71において、DEMUX131からの、圧縮されたVQコード、VQ残差、コードブックを伸張し、その伸張後のVQコード、VQ残差、コードブックを、VQコードメモリ133、VQ残差メモリ134、コードブックメモリ135にそれぞれ供給して記憶させる。   In the decoding process, the DEMUX 131 of the encoding rule restoration unit 121 separates the data supplied thereto into a compressed VQ code, VQ residual, and code book, and supplies the compressed data to the decompression unit 132. In step S71, the decompressing unit 132 decompresses the compressed VQ code, VQ residual, and code book from the DEMUX 131, and decompresses the decompressed VQ code, VQ residual, and code book into the VQ code memory 133, VQ. The residual memory 134 and the code book memory 135 are respectively supplied and stored.

その後、ステップS72において、判定部123(図30)の正誤判定部154は、パラメータコントローラ124(図26)を制御することにより、所定の値のパラメータを設定し、そのパラメータを、符号化ルール復元部121に供給させる。   Thereafter, in step S72, the correctness determination unit 154 of the determination unit 123 (FIG. 30) controls the parameter controller 124 (FIG. 26) to set a parameter having a predetermined value, and the parameter is restored to the coding rule. To the unit 121.

ここで、正誤判定部154は、例えば、各フレームの各ラインについて、ステップS72の処理が行われるごとに、0から、1ラインの画素数までの範囲の整数値を、順次、パラメータの値として設定する。   Here, the correctness determination unit 154, for example, for each line of each frame, every time the process of step S72 is performed, an integer value ranging from 0 to the number of pixels of one line is sequentially set as the parameter value. Set.

符号化ルール復元部121は、パラメータコントローラ124から、パラメータを受信すると、ステップS73において、ラインシフト部136が、そのパラメータに対応する画素数だけ、注目ラインのVQ残差を左シフトし、その左シフト後のVQ残差を、VQコードメモリ133に記憶された注目ラインのVQコード、およびコードブックメモリ135に記憶されたコードブックとともに、仮符号化データとして、復号部122に供給する。さらに、ラインシフト部136は、注目ラインをシフトした画素数を、仮復号付加情報として、判定部123に供給する。   When the encoding rule restoration unit 121 receives a parameter from the parameter controller 124, in step S73, the line shift unit 136 shifts the VQ residual of the target line to the left by the number of pixels corresponding to the parameter, and the left The shifted VQ residual is supplied to the decoding unit 122 as temporary encoded data together with the VQ code of the line of interest stored in the VQ code memory 133 and the code book stored in the code book memory 135. Further, the line shift unit 136 supplies the number of pixels shifted from the target line to the determination unit 123 as provisional decoding additional information.

復号部122は、ステップS74において、符号化ルール復元部121からの仮符号化データとしてのVQコード、VQ残差、およびコードブックに基づいて、ベクトル逆量子化を行うことにより、注目ラインの画素値の復号を行い、その復号の結果得られる仮復号画素値を、判定部123に供給する。   In step S74, the decoding unit 122 performs vector inverse quantization on the basis of the VQ code, the VQ residual, and the code book as provisional encoded data from the encoding rule restoration unit 121, so that the pixel of the target line The value is decoded, and a provisional decoded pixel value obtained as a result of the decoding is supplied to the determination unit 123.

判定部123(図30)では、符号化ルール復元部121が出力する仮復号付加情報と、復号部122が出力する仮復号画素値が、メモリ151に記憶される。さらに、判定部123では、ステップS75において、符号化部152が、復号部122からの仮復号画素値をベクトル量子化し、その結果得られる仮VQコードと仮VQ残差を、比較部153に供給する。   In the determination unit 123 (FIG. 30), the provisional decoding additional information output from the encoding rule restoration unit 121 and the provisional decoded pixel value output from the decoding unit 122 are stored in the memory 151. Further, in the determination unit 123, in step S75, the encoding unit 152 vector-quantizes the provisional decoded pixel value from the decoding unit 122, and supplies the resultant provisional VQ code and provisional VQ residual to the comparison unit 153. To do.

比較部153は、注目ラインについて、符号化部152からの仮VQコードと、仮符号化データとしてのVQコードとを比較するとともに、符号化部152からの仮VQ残差と、仮符号化データとしてのVQ残差とを比較し、それぞれの比較結果を、正誤判定部154に供給する。正誤判定部154は、ステップS76において、注目ラインについて、仮VQコードと、仮符号化データとしてのVQコードとが一致し、かつ仮VQ残差と、仮符号化データとしてのVQ残差とが一致しているかどうかを判定し、いずれかが、または両方が一致していないと判定した場合、即ち、直前のステップS72で設定したパラメータの値が、付加情報に一致していない場合、ステップS72に戻り、新たな値のパラメータが設定され、以下、同様の処理が繰り返される。   The comparison unit 153 compares the temporary VQ code from the encoding unit 152 with the VQ code as the temporary encoded data for the target line, and the temporary VQ residual from the encoding unit 152 and the temporary encoded data. Are compared with the VQ residuals, and the respective comparison results are supplied to the correctness determination unit 154. In step S76, the correctness determination unit 154 determines that the temporary VQ code matches the VQ code as temporary encoded data for the target line, the temporary VQ residual, and the VQ residual as temporary encoded data. If it is determined whether or not one or both of them match, that is, if the value of the parameter set in the immediately preceding step S72 does not match the additional information, step S72 Returning to, a new value parameter is set, and the same processing is repeated thereafter.

また、ステップS76において、仮VQコードと、仮符号化データとしてのVQコードとが一致し、かつ仮VQ残差と、仮符号化データとしてのVQ残差とが一致していると判定された場合、即ち、直前のステップS72で設定したパラメータの値が、付加情報に一致しており、従って、符号化データが復元されるとともに、仮復号付加情報として、元の付加情報が正しく復号された場合、ステップS77に進み、正誤判定部154は、メモリ151を制御することにより、そこに記憶された注目ラインの各画素の仮復号画素値と、仮復号付加情報を、正しい復号結果である復号画素値と復号付加情報として、それぞれ出力させ、ステップS78に進む。   In step S76, it is determined that the temporary VQ code matches the VQ code as the temporary encoded data, and the temporary VQ residual matches the VQ residual as the temporary encoded data. In this case, that is, the parameter value set in the immediately preceding step S72 matches the additional information. Therefore, the encoded data is restored, and the original additional information is correctly decoded as provisional decoding additional information. In this case, the process proceeds to step S77, and the correctness determination unit 154 controls the memory 151 to decode the provisional decoding pixel value of each pixel of the target line stored therein and provisional decoding additional information as a correct decoding result. The pixel value and the decoding additional information are output, and the process proceeds to step S78.

ステップS78では、次に復号すべきラインがあるかどうかが判定され、あると判定された場合、ステップS72に戻り、その、次に復号すべきラインを、新たに注目ラインとして、以下、同様の処理が繰り返される。   In step S78, it is determined whether or not there is a line to be decoded next. When it is determined that there is a line, the process returns to step S72, and the line to be decoded next is newly set as a noticed line. The process is repeated.

また、ステップS78において、次に復号すべきラインがないと判定された場合、復号処理を終了する。   If it is determined in step S78 that there is no line to be decoded next, the decoding process ends.

なお、図32の復号処理は、各フレームについて行われる。   Note that the decoding process of FIG. 32 is performed for each frame.

以上のように、符号化データを得るための符号化ルールを、付加情報に基づいて破壊し、その破壊した符号化ルールによって符号化された埋め込み符号化データに対して、所定の操作を施すことにより、仮符号化データを得て、その仮符号化データを復号し、その復号結果を符号化して得られるものが、仮符号化データに一致するかどうかを判定することによって、符号化ルールが破壊される前の符号化データを復元するようにしたので、この符号化ルールの破壊および復元を利用して、符号化データのデータ量を増加させることなく、付加情報を埋め込むとともに、復号を行うことができる。   As described above, the encoding rule for obtaining the encoded data is destroyed based on the additional information, and a predetermined operation is performed on the embedded encoded data encoded by the destroyed encoding rule. Thus, the provisional encoded data is obtained, the provisional encoded data is decoded, and the result obtained by encoding the decoding result is determined to match the provisionally encoded data. Since the encoded data before being destroyed is restored, the destruction and restoration of this encoding rule is used to embed additional information and perform decoding without increasing the data amount of the encoded data. be able to.

ここで、本件出願人は、例えば、画像の相関性等を利用して、付加情報を画像に埋め込む手法を先に提案している。即ち、先に提案した方法は、例えば、フレームを構成するラインを、付加情報に基づいて入れ替え、その入れ替え後のフレームのラインを、元のフレームにおいて近接しているラインどうしの相関が高いことを利用して、元の位置に戻すものであるが、この相関を利用した方法では、場合によって、付加情報を埋め込むことが困難であることがあった。即ち、相関を利用した方法は、簡単には、付加情報が埋め込まれたフレームのあるラインに注目して、その注目ラインとの相関が最も高いラインを、注目ラインの隣に入れ替えることにより、ラインを、すべて、元の位置に戻すものであるが、画像によっては、注目ラインとの相関が最も高いラインが、注目ラインの隣に位置すべきラインではないことがあり、このようなラインについては、付加情報を埋め込むことにより、ラインを入れ替えてしまうと、相関を利用して、元の位置に戻すことができないため、付加情報を埋め込むことが困難であった。   Here, the applicant of the present application has previously proposed a method of embedding additional information in an image using, for example, image correlation. That is, in the method proposed previously, for example, the lines constituting the frame are replaced based on the additional information, and the line of the frame after the replacement is highly correlated with the adjacent lines in the original frame. It is used to return to the original position, but in the method using this correlation, it may be difficult to embed additional information in some cases. That is, the method using the correlation is simply to pay attention to a line with a frame in which additional information is embedded, and replace the line having the highest correlation with the target line next to the target line. However, depending on the image, the line with the highest correlation with the target line may not be the line that should be located next to the target line. If the line is replaced by embedding the additional information, it is difficult to embed the additional information because the correlation cannot be used to return to the original position.

これに対して、上述した手法では、そのような復号の失敗がない。   On the other hand, in the above-described method, there is no such decoding failure.

なお、図26の実施の形態では、復号器12を、符号化ルール復元部122と復号部122との組を1系統だけ設けて構成し、パラメータコントローラ124から出力するパラメータを順次変えることにより、各値のパラメータに対応する仮符号化データを順次得るようにしたが、復号器12は、例えば、図33に示すように、M系統の符号化ルール復元部1211乃至121Mと復号部1221乃至122Mを設けて構成し、各系統の符号化ルール復元部121m(m=1,2,・・・,M)に、異なる値のパラメータを与えて、各値のパラメータに対応する仮符号化データを同時に得るようにすることが可能である。 In the embodiment of FIG. 26, the decoder 12 is configured by providing only one system of the encoding rule restoration unit 122 and the decoding unit 122, and sequentially changing the parameters output from the parameter controller 124, Although provisionally encoded data corresponding to the parameter of each value is sequentially obtained, the decoder 12 is configured such that, for example, as shown in FIG. 33, the M system encoding rule restoring units 121 1 to 121 M and the decoding unit 122 1 to 122 M are provided, and different value parameters are given to the encoding rule restoration unit 121 m (m = 1, 2,..., M) of each system to correspond to the parameters of each value. It is possible to obtain provisionally encoded data at the same time.

また、上述の場合には、図19の符号化部91に、ベクトル量子化を行わせるようにしたが、符号化部91には、ベクトル量子化以外の、例えば、予測符号化等を行わせることが可能である。そして、この場合、埋め込み部92では、予測符号化による予測残差を、付加情報に基づいて操作することにより、付加情報を埋め込むようにすることが可能である。   In the above-described case, the encoding unit 91 in FIG. 19 performs vector quantization. However, the encoding unit 91 performs, for example, predictive encoding other than vector quantization. It is possible. In this case, the embedding unit 92 can embed the additional information by operating the prediction residual based on the predictive coding based on the additional information.

さらに、上述の場合には、各ラインのVQ残差を、付加情報に基づいてシフトすることにより、その付加情報を埋め込むようにしたが、付加情報は、その他、例えば、VQ残差を表す値のビット列をシフトしたりすること等によって埋め込むことが可能である。   Further, in the above-described case, the VQ residual of each line is shifted based on the additional information to embed the additional information. However, the additional information is, for example, a value representing the VQ residual. Can be embedded by shifting or the like.

また、上述の場合には、フレームごとに、コードブックを作成し、符号化データに含めるようにしたが、コードブックは、あらかじめ作成しておき、埋め込み圧縮符号化器11と復号器12それぞれにおいて記憶しておくようにすることが可能である。さらに、コードブックは、複数フレームごとや、1フレームの所定の領域ごとに作成することも可能である。   In the above-described case, a code book is created for each frame and included in the encoded data. However, the code book is created in advance, and the embedded compression encoder 11 and decoder 12 respectively. It is possible to memorize it. Furthermore, the code book can be created for each of a plurality of frames or for each predetermined area of one frame.

次に、上述した一連の処理は、ハードウェアにより行うこともできるし、ソフトウェアにより行うこともできる。一連の処理をソフトウェアによって行う場合には、そのソフトウェアを構成するプログラムが、汎用のコンピュータ等にインストールされる。   Next, the series of processes described above can be performed by hardware or software. When a series of processing is performed by software, a program constituting the software is installed in a general-purpose computer or the like.

そこで、図34は、上述した一連の処理を実行するプログラムがインストールされるコンピュータの一実施の形態の構成例を示している。   Therefore, FIG. 34 shows a configuration example of an embodiment of a computer in which a program for executing the above-described series of processing is installed.

プログラムは、コンピュータに内蔵されている記録媒体としてのハードディスク205やROM203に予め記録しておくことができる。   The program can be recorded in advance in a hard disk 205 or ROM 203 as a recording medium built in the computer.

あるいはまた、プログラムは、フロッピー(登録商標)ディスク、CD-ROM(Compact Disc Read Only Memory),MO(Magneto optical)ディスク,DVD(Digital Versatile Disc)、磁気ディスク、半導体メモリなどのリムーバブル記録媒体211に、一時的あるいは永続的に格納(記録)しておくことができる。このようなリムーバブル記録媒体211は、いわゆるパッケージソフトウエアとして提供することができる。   Alternatively, the program is stored in a removable recording medium 211 such as a floppy (registered trademark) disk, a CD-ROM (Compact Disc Read Only Memory), an MO (Magneto optical) disk, a DVD (Digital Versatile Disc), a magnetic disk, or a semiconductor memory. It can be stored (recorded) temporarily or permanently. Such a removable recording medium 211 can be provided as so-called package software.

なお、プログラムは、上述したようなリムーバブル記録媒体211からコンピュータにインストールする他、ダウンロードサイトから、ディジタル衛星放送用の人工衛星を介して、コンピュータに無線で転送したり、LAN(Local Area Network)、インターネットといったネットワークを介して、コンピュータに有線で転送し、コンピュータでは、そのようにして転送されてくるプログラムを、通信部208で受信し、内蔵するハードディスク205にインストールすることができる。   The program is installed on the computer from the removable recording medium 211 as described above, or transferred from the download site to the computer wirelessly via a digital satellite broadcasting artificial satellite, LAN (Local Area Network), The program can be transferred to a computer via a network such as the Internet. The computer can receive the program transferred in this way by the communication unit 208 and install it in the built-in hard disk 205.

コンピュータは、CPU(Central Processing Unit)202を内蔵している。CPU202には、バス201を介して、入出力インタフェース210が接続されており、CPU202は、入出力インタフェース210を介して、ユーザによって、キーボードや、マウス、マイク等で構成される入力部207が操作等されることにより指令が入力されると、それにしたがって、ROM(Read Only Memory)203に格納されているプログラムを実行する。あるいは、また、CPU202は、ハードディスク205に格納されているプログラム、衛星若しくはネットワークから転送され、通信部208で受信されてハードディスク205にインストールされたプログラム、またはドライブ209に装着されたリムーバブル記録媒体211から読み出されてハードディスク205にインストールされたプログラムを、RAM(Random Access Memory)204にロードして実行する。これにより、CPU202は、上述したフローチャートにしたがった処理、あるいは上述したブロック図の構成により行われる処理を行う。そして、CPU202は、その処理結果を、必要に応じて、例えば、入出力インタフェース210を介して、LCD(Liquid CryStal Display)やスピーカ等で構成される出力部206から出力、あるいは、通信部208から送信、さらには、ハードディスク205に記録等させる。   The computer includes a CPU (Central Processing Unit) 202. An input / output interface 210 is connected to the CPU 202 via the bus 201, and the CPU 202 operates the input unit 207 including a keyboard, a mouse, a microphone, and the like by the user via the input / output interface 210. When a command is input as a result of this, the program stored in a ROM (Read Only Memory) 203 is executed accordingly. Alternatively, the CPU 202 also receives a program stored in the hard disk 205, a program transferred from a satellite or a network, received by the communication unit 208 and installed in the hard disk 205, or a removable recording medium 211 attached to the drive 209. The program read and installed in the hard disk 205 is loaded into a RAM (Random Access Memory) 204 and executed. Thereby, the CPU 202 performs processing according to the above-described flowchart or processing performed by the configuration of the above-described block diagram. Then, the CPU 202 outputs the processing result from the output unit 206 configured with an LCD (Liquid Crystal Display), a speaker, or the like, for example, via the input / output interface 210, or from the communication unit 208 as necessary. Transmission, and further recording on the hard disk 205 is performed.

ここで、本明細書において、コンピュータに各種の処理を行わせるためのプログラムを記述する処理ステップは、必ずしもフローチャートとして記載された順序に沿って時系列に処理する必要はなく、並列的あるいは個別に実行される処理(例えば、並列処理あるいはオブジェクトによる処理)も含むものである。   Here, in this specification, the processing steps for describing a program for causing a computer to perform various types of processing do not necessarily have to be processed in time series according to the order described in the flowchart, but in parallel or individually. This includes processing to be executed (for example, parallel processing or processing by an object).

また、プログラムは、1のコンピュータにより処理されるものであっても良いし、複数のコンピュータによって分散処理されるものであっても良い。さらに、プログラムは、遠方のコンピュータに転送されて実行されるものであっても良い。   Further, the program may be processed by a single computer, or may be processed in a distributed manner by a plurality of computers. Furthermore, the program may be transferred to a remote computer and executed.

なお、本実施の形態では、画像データを符号化の対象としたが、符号化の対象とするデータは、画像データに限定されるものではなく、音声データ(オーディオデータ)や、コンピュータのプログラム等の各種のデータを採用することが可能である。   In this embodiment, image data is a target for encoding. However, data to be encoded is not limited to image data, and audio data (audio data), a computer program, etc. It is possible to adopt various types of data.

本発明を適用した埋め込み圧縮/復号システムの一実施の形態の構成例を示す図である。It is a figure which shows the structural example of one Embodiment of the embedding compression / decoding system to which this invention is applied. 埋め込み圧縮符号化器11の第1の構成例を示すブロック図である。2 is a block diagram illustrating a first configuration example of an embedded compression encoder 11. FIG. 可変長符号化部23の構成例を示すブロック図である。3 is a block diagram illustrating a configuration example of a variable length encoding unit 23. FIG. 可変長符号化を説明するための図である。It is a figure for demonstrating variable length coding. 画素値の出現頻度と、画素値に割り当てられる符号の符号長との関係を示す図である。It is a figure which shows the relationship between the appearance frequency of a pixel value, and the code length of the code allocated to a pixel value. ハフマンテーブルの例を示す図である。It is a figure which shows the example of a Huffman table. 画素値の出現頻度に応じて割り当てられた符号と、その符号の変換を説明する図である。It is a figure explaining the code | symbol allocated according to the appearance frequency of a pixel value, and conversion of the code | symbol. 埋め込み符号化データの例を示す図である。It is a figure which shows the example of embedded encoding data. 埋め込み符号化データを、元の符号化データに復元する方法を説明する図である。It is a figure explaining the method to decompress | restore embedded encoding data to the original encoding data. 埋め込み符号化処理を説明するフローチャートである。It is a flowchart explaining an embedded encoding process. 変換テーブル作成処理を説明するフローチャートである。It is a flowchart explaining a conversion table creation process. 符号化データ変換処理を説明するフローチャートである。It is a flowchart explaining an encoding data conversion process. 埋め込み圧縮符号化器11の第2の構成例を示すブロック図である。3 is a block diagram illustrating a second configuration example of the embedded compression encoder 11. FIG. 復号器12の第1の構成例を示すブロック図である。3 is a block diagram illustrating a first configuration example of a decoder 12. FIG. 可変長復号部52および56の構成例を示すブロック図である。It is a block diagram which shows the structural example of the variable-length decoding parts 52 and 56. FIG. ハフマンテーブル生成部53の構成例を示すブロック図である。4 is a block diagram illustrating a configuration example of a Huffman table generation unit 53. FIG. 逆変換テーブル作成部54の構成例を示すブロック図である。6 is a block diagram illustrating a configuration example of an inverse conversion table creation unit 54. FIG. 復号処理を説明するフローチャートである。It is a flowchart explaining a decoding process. 埋め込み圧縮符号化器11の第3の構成例を示すブロック図である。11 is a block diagram illustrating a third configuration example of the embedded compression encoder 11. FIG. 埋め込み符号化処理を説明するフローチャートである。It is a flowchart explaining an embedded encoding process. 符号化部91の構成例を示すブロック図である。3 is a block diagram illustrating a configuration example of an encoding unit 91. FIG. ベクトル量子化による符号化を説明する図である。It is a figure explaining the encoding by vector quantization. 埋め込み部92の構成例を示すブロック図である。3 is a block diagram illustrating a configuration example of an embedding unit 92. FIG. ラインをシフトすることによる付加情報の埋め込みを説明する図である。It is a figure explaining embedding of additional information by shifting a line. 埋め込み符号化処理を説明するフローチャートである。It is a flowchart explaining an embedded encoding process. 復号器12の第2の構成例を示すブロック図である。11 is a block diagram illustrating a second configuration example of the decoder 12. FIG. 復号処理を説明するフローチャートである。It is a flowchart explaining a decoding process. 符号化ルール復元部121の構成例を示すブロック図である。3 is a block diagram illustrating a configuration example of an encoding rule restoration unit 121. FIG. 復号部122の構成例を示すブロック図である。22 is a block diagram illustrating a configuration example of a decoding unit 122. FIG. 判定部123の構成例を示すブロック図である。3 is a block diagram illustrating a configuration example of a determination unit 123. FIG. 判定部123の処理を説明する図である。It is a figure explaining the process of the determination part. 復号処理を説明するフローチャートである。It is a flowchart explaining a decoding process. 復号器12の第3の構成例を示すブロック図である。11 is a block diagram illustrating a third configuration example of the decoder 12. FIG. 本発明を適用したコンピュータの一実施の形態の構成例を示すブロック図である。It is a block diagram which shows the structural example of one Embodiment of the computer to which this invention is applied.

符号の説明Explanation of symbols

1 符号化装置, 2 復号装置, 3 記録媒体, 4 伝送媒体, 11
埋め込み圧縮符号化器, 12 復号器, 21 フレームメモリ, 22 付加情報メモリ, 23 可変長符号化部, 24 変換テーブル作成部, 25 符号化ルール破壊部, 26 MUX, 31 頻度テーブル作成部, 32 ハフマン木作成部, 33 ハフマンテーブル作成部, 34 符号化部,
41 符号化ルール破壊部, 51 DEMUX, 52 可変長復号部, 53 ハフマンテーブル生成部, 54 逆変換テーブル作成部, 55 符号化ルール復元部, 56 可変長復号部, 61 ハフマン木作成部, 62 ハフマンテーブル作成部, 63 復号部, 71 頻度テーブル作成部, 72 ハフマン木作成部, 73 ハフマンテーブル作成部, 81 比較部, 82 符号対応付け部, 91 符号化部, 92 埋め込み部, 101 フレームメモリ, 102 コードブック作成部, 103 ベクトル量子化部, 111 VQコードメモリ, 112 VQ残差メモリ, 113 コードブックメモリ, 114 ラインシフト部, 115 圧縮部, 116 MUX, 121,1211乃至121M 符号化ルール復元部, 122,1221乃至122M 復号部, 123 判定部, 124 パラメータコントローラ,
131 DEMUX, 132 伸張部, 133 VQコードメモリ, 134 VQ残差メモリ, 135 コードブックメモリ, 136 ラインシフト部, 141 ベクトル逆量子化部, 142 加算部, 151 メモリ,
152 符号化部, 153 比較部, 154 正誤判定部, 201 バス, 202 CPU, 203 ROM, 204 RAM, 205 ハードディスク, 206 出力部, 207 入力部, 208 通信部, 209 ドライブ, 210 入出力インタフェース, 211 リムーバブル記録媒体
DESCRIPTION OF SYMBOLS 1 Encoding apparatus, 2 Decoding apparatus, 3 Recording medium, 4 Transmission medium, 11
Embedded compression encoder, 12 decoder, 21 frame memory, 22 additional information memory, 23 variable length encoding unit, 24 conversion table creation unit, 25 coding rule destruction unit, 26 MUX, 31 frequency table creation unit, 32 Huffman Tree creation part, 33 Huffman table creation part, 34 encoding part,
41 Coding rule destruction unit, 51 DEMUX, 52 Variable length decoding unit, 53 Huffman table generation unit, 54 Inverse conversion table creation unit, 55 Coding rule restoration unit, 56 Variable length decoding unit, 61 Huffman tree creation unit, 62 Huffman Table creation unit, 63 decoding unit, 71 frequency table creation unit, 72 Huffman tree creation unit, 73 Huffman table creation unit, 81 comparison unit, 82 code association unit, 91 coding unit, 92 embedding unit, 101 frame memory, 102 Codebook creation unit, 103 vector quantization unit, 111 VQ code memory, 112 VQ residual memory, 113 codebook memory, 114 line shift unit, 115 compression unit, 116 MUX, 121, 121 1 to 121 M coding rule restoration parts, 122, 122 1 to 122 M decoder, 1 Third determining unit, 124 parameter controller,
131 DEMUX, 132 decompression unit, 133 VQ code memory, 134 VQ residual memory, 135 codebook memory, 136 line shift unit, 141 vector inverse quantization unit, 142 addition unit, 151 memory,
152 encoding unit, 153 comparison unit, 154 correctness determination unit, 201 bus, 202 CPU, 203 ROM, 204 RAM, 205 hard disk, 206 output unit, 207 input unit, 208 communication unit, 209 drive, 210 I / O interface, 211 Removable recording medium

Claims (7)

第1のデータを、量子化し、その結果得られる量子化コードと量子化誤差を、符号化データとして出力する符号化手段と、
前記符号化データとしての量子化コードの各値と量子化誤差との対応関係を、第2のデータに対応する操作量でシフトすることにより、前記第2のデータが埋め込まれた埋め込み符号化データを生成する埋め込み手段と
を備えるデータ処理装置。
Encoding means for quantizing the first data and outputting the resulting quantization code and quantization error as encoded data;
Embedded encoded data in which the second data is embedded by shifting the correspondence between each value of the quantization code as the encoded data and a quantization error by an operation amount corresponding to the second data A data processing apparatus comprising: an embedding means for generating
データ処理装置が、
第1のデータを、量子化し、その結果得られる量子化コードと量子化誤差を、符号化データとして出力し、
前記符号化データとしての量子化コードの各値と量子化誤差との対応関係を、第2のデータに対応する操作量でシフトすることにより、前記第2のデータが埋め込まれた埋め込み符号化データを生成する
ステップを含むデータ処理方法。
Data processing device
The first data is quantized, and the resulting quantization code and quantization error are output as encoded data,
Embedded encoded data in which the second data is embedded by shifting the correspondence between each value of the quantization code as the encoded data and a quantization error by an operation amount corresponding to the second data A data processing method including generating a step.
第1のデータを、量子化し、その結果得られる量子化コードと量子化誤差を、符号化データとして出力する符号化手段と、
前記符号化データとしての量子化コードの各値と量子化誤差との対応関係を、第2のデータに対応する操作量でシフトすることにより、前記第2のデータが埋め込まれた埋め込み符号化データを生成する埋め込み手段と
して、コンピュータを機能させるためのプログラムが記録された記録媒体。
Encoding means for quantizing the first data and outputting the resulting quantization code and quantization error as encoded data;
Embedded encoded data in which the second data is embedded by shifting the correspondence between each value of the quantization code as the encoded data and a quantization error by an operation amount corresponding to the second data A recording medium on which is recorded a program for causing a computer to function as an embedding means for generating an image.
第1のデータを量子化することにより得られる量子化コードと量子化誤差を含む符号化データに第2のデータが埋め込まれた埋め込み符号化データにおける、前記量子化コードの各値と量子化誤差との対応関係を、特定の操作量でシフトすることにより、仮の符号化データを復号する仮符号化データ復号手段と、
所定のコードブックに応じて、前記仮の符号化データから、仮の復号データを復号する仮復号データ復号手段と、
前記量子化コードと量子化誤差と、前記仮復号データ復号手段により復号された仮の復号データを再度符号化することにより得られた量子化コードと量子化誤差とを比較することにより、前記仮の符号化データが正しいか否かを判定する判定手段と
を備え、
前記仮符号化データ復号手段は、前記判定手段による判定結果に応じて前記操作量を変更して再び仮の符号化データを復号し、
前記判定手段は、前記仮の符号化データが正しいと判定したとき、前記操作量に対応するデータを前記第2のデータとして出力し、前記仮復号データ復号手段からの仮の復号データを真の復号データとして出力する
データ処理装置。
Each value of the quantization code and the quantization error in the embedded encoded data in which the second data is embedded in the encoded data including the quantization code and the quantization error obtained by quantizing the first data Temporary encoded data decoding means for decoding temporary encoded data by shifting the correspondence relationship with a specific operation amount,
Temporary decoded data decoding means for decoding temporary decoded data from the temporary encoded data according to a predetermined code book;
By comparing the quantization code and the quantization error with the quantization error obtained by re-encoding the provisional decoded data decoded by the provisional decoded data decoding unit and the quantization error, Determining means for determining whether or not the encoded data is correct,
The temporary encoded data decoding means changes the manipulated variable according to the determination result by the determination means and decodes the temporary encoded data again,
When the determination means determines that the provisional encoded data is correct, the determination means outputs data corresponding to the manipulated variable as the second data, and the provisional decoded data from the provisional decoded data decoding means is Data processing device that outputs as decrypted data.
前記第1のデータは、画像データである
請求項4に記載のデータ処理装置。
The data processing apparatus according to claim 4, wherein the first data is image data.
データ処理装置が、
第1のデータを量子化することにより得られる量子化コードと量子化誤差を含む符号化データに第2のデータが埋め込まれた埋め込み符号化データにおける、前記量子化コードの各値と量子化誤差との対応関係を、特定の操作量でシフトすることにより、仮の符号化データを復号する仮符号化データ復号ステップと、
所定のコードブックに応じて、前記仮の符号化データから、仮の復号データを復号する仮復号データ復号ステップと、
前記量子化コードと量子化誤差と、前記仮復号データ復号ステップにより復号された仮の復号データを再度符号化することにより得られた量子化コードと量子化誤差とを比較することにより、前記仮の符号化データが正しいか否かを判定する判定ステップと
を含み、
前記仮符号化データ復号ステップにおいて、前記判定ステップによる判定結果に応じて前記操作量を変更して再び仮の符号化データを復号し、
前記判定ステップにおいて、前記仮の符号化データが正しいと判定したとき、前記操作量に対応するデータを前記第2のデータとして出力し、前記仮復号データ復号ステップで復号した仮の復号データを真の復号データとして出力する
データ処理方法。
Data processing device
Each value of the quantization code and the quantization error in the embedded encoded data in which the second data is embedded in the encoded data including the quantization code and the quantization error obtained by quantizing the first data A temporary encoded data decoding step for decoding the temporary encoded data by shifting the correspondence relationship with a specific operation amount;
Temporary decoded data decoding step for decoding temporary decoded data from the temporary encoded data according to a predetermined codebook;
By comparing the quantization code and the quantization error with the quantization error obtained by re-encoding the temporary decoded data decoded in the temporary decoded data decoding step and the temporary error, A determination step for determining whether or not the encoded data is correct,
In the temporary encoded data decoding step, the operation amount is changed according to the determination result in the determination step and the temporary encoded data is decoded again,
In the determination step, when it is determined that the temporary encoded data is correct, the data corresponding to the manipulated variable is output as the second data, and the temporary decoded data decoded in the temporary decoded data decoding step is true. Data processing method to output as decrypted data.
第1のデータを量子化することにより得られる量子化コードと量子化誤差を含む符号化データに第2のデータが埋め込まれた埋め込み符号化データにおける、前記量子化コードの各値と量子化誤差との対応関係を、特定の操作量でシフトすることにより、仮の符号化データを復号する仮符号化データ復号手段と、
所定のコードブックに応じて、前記仮の符号化データから、仮の復号データを復号する仮復号データ復号手段と、
前記量子化コードと量子化誤差と、前記仮復号データ復号手段により復号された仮の復号データを再度符号化することにより得られた量子化コードと量子化誤差とを比較することにより、前記仮の符号化データが正しいか否かを判定する判定手段と
を備え、
前記仮符号化データ復号手段は、前記判定手段による判定結果に応じて前記操作量を変更して再び仮の符号化データを復号し、
前記判定手段は、前記仮の符号化データが正しいと判定したとき、前記操作量に対応するデータを前記第2のデータとして出力し、前記仮復号データ復号手段からの仮の復号データを真の復号データとして出力する
データ処理装置として、コンピュータを機能させるためのプログラムが記録された記録媒体。
Each value of the quantization code and the quantization error in the embedded encoded data in which the second data is embedded in the encoded data including the quantization code and the quantization error obtained by quantizing the first data Temporary encoded data decoding means for decoding temporary encoded data by shifting the correspondence relationship with a specific operation amount,
Temporary decoded data decoding means for decoding temporary decoded data from the temporary encoded data according to a predetermined code book;
By comparing the quantization code and the quantization error with the quantization error obtained by re-encoding the provisional decoded data decoded by the provisional decoded data decoding unit and the quantization error, Determining means for determining whether or not the encoded data is correct,
The temporary encoded data decoding means changes the manipulated variable according to the determination result by the determination means and decodes the temporary encoded data again,
When the determination unit determines that the temporary encoded data is correct, the determination unit outputs the data corresponding to the operation amount as the second data, and the temporary decoded data from the temporary decoded data decoding unit is A recording medium on which a program for causing a computer to function as a data processing device to output as decoded data is recorded.
JP2008160003A 2008-06-19 2008-06-19 Data processing apparatus, data processing method, and recording medium Expired - Fee Related JP4507130B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008160003A JP4507130B2 (en) 2008-06-19 2008-06-19 Data processing apparatus, data processing method, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008160003A JP4507130B2 (en) 2008-06-19 2008-06-19 Data processing apparatus, data processing method, and recording medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2000319418A Division JP4214440B2 (en) 2000-10-19 2000-10-19 Data processing apparatus, data processing method, and recording medium

Publications (2)

Publication Number Publication Date
JP2008283701A true JP2008283701A (en) 2008-11-20
JP4507130B2 JP4507130B2 (en) 2010-07-21

Family

ID=40144084

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008160003A Expired - Fee Related JP4507130B2 (en) 2008-06-19 2008-06-19 Data processing apparatus, data processing method, and recording medium

Country Status (1)

Country Link
JP (1) JP4507130B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11243489A (en) * 1998-02-26 1999-09-07 Matsushita Electric Ind Co Ltd Image processing method and image processor thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11243489A (en) * 1998-02-26 1999-09-07 Matsushita Electric Ind Co Ltd Image processing method and image processor thereof

Also Published As

Publication number Publication date
JP4507130B2 (en) 2010-07-21

Similar Documents

Publication Publication Date Title
JP4214440B2 (en) Data processing apparatus, data processing method, and recording medium
KR100552666B1 (en) Encoding/decoding apparatus for coordinate interpolator, and recordable medium containing coordinate interpolator encoded bit stream
JP5258664B2 (en) Image coding apparatus, method and program, and image decoding apparatus, method and program
US7738711B2 (en) Coding apparatus and method, decoding apparatus and method, data processing system, storage medium, and signal
JP2000059743A (en) Image processing unit, and image processing method and serving medium thereof
JP2002325170A (en) Image processing unit and its method, and program code, storage medium
JP4768728B2 (en) Method and apparatus for encoding a block of values
JP2000184181A (en) Encoder, encoding method, decoder, decoding method, recording medium and data processor
JP4556087B2 (en) DATA PROCESSING DEVICE, DATA PROCESSING METHOD, PROGRAM, AND PROGRAM RECORDING MEDIUM
JP2000232365A (en) Encoding device, encoding method, decoding device, decoding method, recording medium and data processor
JP4254003B2 (en) Embedding device and embedding method, decoding device and decoding method, and recording medium
JP4507130B2 (en) Data processing apparatus, data processing method, and recording medium
JP4556147B2 (en) Decoding device, decoding method, recording medium, and data processing device
JP2006074338A (en) Data concealing device, concealed data extraction device, data concealing method, concealed data extraction method, and program for them
JP2002077585A (en) Apparatus and method for processing data as well as recording medium
JP2003248838A (en) Method and device for encoding and decoding key value data of coordinate interpolator
Kraichingrith HIGH CAPACITY IMAGE STEGANOGRAPHY TOLERATING IMAGE COMPRESSION
JP2000101827A (en) Digital video coding device and decoding device using watermarking and its method
JP2006121460A (en) Method for embedding electronic watermark and method for extracting the same
JP4374712B2 (en) Data processing apparatus, data processing method, and recording medium
JP4548434B2 (en) Data processing apparatus, data processing method, and recording medium
JP2003125194A (en) Data processing apparatus, data processing method, program and recording medium
JP3944821B2 (en) Data processing apparatus, data processing method, and program
JP2005057454A (en) Verification device
JP2006166075A (en) Image encoder and image encoding program, and image decoder and image decoding program

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100114

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100304

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100408

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100421

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130514

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130514

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees