JP2011135330A - Encoding device, decoding device, encoding method, and decoding method - Google Patents

Encoding device, decoding device, encoding method, and decoding method Download PDF

Info

Publication number
JP2011135330A
JP2011135330A JP2009292981A JP2009292981A JP2011135330A JP 2011135330 A JP2011135330 A JP 2011135330A JP 2009292981 A JP2009292981 A JP 2009292981A JP 2009292981 A JP2009292981 A JP 2009292981A JP 2011135330 A JP2011135330 A JP 2011135330A
Authority
JP
Japan
Prior art keywords
bit
length
code word
position information
encoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009292981A
Other languages
Japanese (ja)
Inventor
Katsuyoshi Nishitani
勝義 西谷
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.)
JVCKenwood Holdings Inc
Original Assignee
JVCKenwood Holdings Inc
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 JVCKenwood Holdings Inc filed Critical JVCKenwood Holdings Inc
Priority to JP2009292981A priority Critical patent/JP2011135330A/en
Publication of JP2011135330A publication Critical patent/JP2011135330A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that a decoder should be provided in an encoding device in the conventional manner. <P>SOLUTION: The encoding device includes: a memory 101; a position selector 104 for comparing a plurality of pieces of digital signal data stored in the memory 101 in a bit unit and determining position information from the most significant bit of the digital signal data to the first bit determined to be different; a code word length selector 105 for selecting an r-bit to be a code word length optimum to encoding; an encoder 102 for extracting r-bits from the plurality of pieces of digital signal data stored in the memory 101 and outputting the r-bits as a code word string on the basis of the position information and the code word length; a format device 103 for formatting the position information, the code word length and the code word string according to a prescribed rule and outputting them as a bit stream; and a controller 106 for calculating a code word length to be used to encode the next continuous video digital signal data from the code length of the output bit stream. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、映像のディジタル信号データを符号化及び復号化する装置、方法に関するものである。   The present invention relates to an apparatus and method for encoding and decoding video digital signal data.

現在、テレビ放送ではアナログ放送からディジタル放送への移行が促進され、記録メディアではDVD(Digital Versatile Disc)からBD(Blu−ray Disc)へと大容量記録の対応が巷間に広がり始め、従来のSD(Standard Definition)画像からHD(High Definition)画像への移行が加速している。ディスプレイ装置もCRT方式のテレビからプラズマテレビや液晶テレビといった薄型、大型の傾向となっており、特に液晶テレビでは液晶特有の画像の残像感を軽減する為に、従来の毎秒60フレームであった表示を、前後の映像の差分から動きの情報を算出し、動きの方向と大きさに合わせて中間の映像を作り出して補間して倍の120フレームまで引き上げて表示することで残像感を抑える倍速表示化技術を採用している。   Currently, the transition from analog broadcasting to digital broadcasting is being promoted in television broadcasting, and the support for large-capacity recording from DVD (Digital Versatile Disc) to BD (Blu-ray Disc) has begun to spread quickly in recording media. The transition from (Standard Definition) images to HD (High Definition) images is accelerating. Display devices also tend to be thin and large, such as CRT televisions, plasma televisions, and liquid crystal televisions. In particular, liquid crystal televisions have a display that was 60 frames per second in order to reduce the image lag that is typical of liquid crystals. , By calculating the motion information from the difference between the previous and next video, creating an intermediate video according to the direction and size of the motion, interpolating it, and raising it to 120 frames to display it, double-speed display that suppresses the afterimage feeling Adopt technology.

HD画像による高画質化は、従来に比べてデータ量や処理負荷が増加し、ディスプレイ装置や記録装置等の機器で使用するメモリ容量の増加や内部バスの伝送量の高速化が要求される。画像データの高効率な圧縮技術としてMPEGやJPEG等が挙げられるが、処理負荷が高く、専用のハードウェアを機器内に装備することが必要となり、コスト高になる。   High image quality using HD images requires a larger amount of data and processing load than before, and requires an increase in memory capacity used in devices such as a display device and a recording device, and an increase in the transmission amount of the internal bus. MPEG and JPEG are examples of highly efficient image data compression techniques. However, the processing load is high, and it is necessary to install dedicated hardware in the device, resulting in high costs.

そこで、圧縮率が低いもののメモリ容量や伝送量を低減する軽負荷の処理による手法が提案されている。   In view of this, there has been proposed a method using a light load process for reducing the memory capacity and the transmission amount although the compression rate is low.

特許文献1,2ともに近接画素間の相関性を利用して、Rビットで表される画像信号をrビット(0<r<R)に変換する予測符号化方式である。共通する予測処理は、連続して画素単位に入力される画像データの画像信号に対して、直前に符号化処理された画像信号の復号値を予測値とし、続いて入力される画素信号との差分により、予測誤差値を出力することで実現される。   Both Patent Documents 1 and 2 are predictive coding schemes that convert the image signal represented by R bits into r bits (0 <r <R) using the correlation between adjacent pixels. A common prediction process is to use a decoded value of an image signal that has been encoded immediately before as a predicted value for an image signal of image data that is continuously input in units of pixels, and a pixel signal that is subsequently input. This is realized by outputting a prediction error value based on the difference.

特許文献1では、復号化で復号値が元画像のビット精度の範囲を超えないように、予め符号化時に入力画像信号、及び予測値の最大値と最小値に制限をかけて、予測誤差値を算出し、その誤差値の範囲に該当する符号語を変換テーブルから選択する。   In Patent Document 1, in order to prevent the decoded value from exceeding the bit accuracy range of the original image by decoding, the input image signal and the maximum and minimum values of the prediction value are limited in advance at the time of encoding, and the prediction error value And a codeword corresponding to the range of the error value is selected from the conversion table.

特許文献2では、複数の変換テーブルから予測値に基づき最適なテーブルが選択される。テーブルには予測誤差値が取り得る範囲とその範囲に割当てられたrビットの符号語が列記されており、予測誤差値の該当する範囲の符号語を出力する。   In Patent Document 2, an optimal table is selected from a plurality of conversion tables based on predicted values. The table lists possible ranges of prediction error values and r-bit codewords assigned to the ranges, and outputs codewords in the corresponding range of prediction error values.

特許文献1,2で使用される変換テーブルは、近接画素間の相関性を考慮して、予測誤差値が0に近い程、1つの符号語に割当てる予測誤差値の範囲を狭くし、予測誤差値が大きくなる程、1つの符号語に割当てる予測誤差値の範囲を広くするようにしている。   In the conversion tables used in Patent Documents 1 and 2, in consideration of the correlation between adjacent pixels, the prediction error value assigned to one codeword becomes narrower as the prediction error value is closer to 0. The larger the value, the wider the range of prediction error values assigned to one codeword.

特開平7−15347号公報Japanese Patent Laid-Open No. 7-15347 特開平3−145887号公報Japanese Patent Laid-Open No. 3-14587

上述した特許文献においては、
・符号化装置内に復号装置を備える必要がある。
・原信号のビット精度から変換されたビット精度で表される誤差よりも、誤差が大きくなる。
・符号化及び復号化の為の変換テーブルが必要である為、ROMとしてメモリを機器内に用意する必要がある。
といった課題が挙げられる。
In the above-mentioned patent document,
It is necessary to provide a decoding device in the encoding device.
The error is larger than the error represented by the bit accuracy converted from the bit accuracy of the original signal.
-Since a conversion table for encoding and decoding is necessary, it is necessary to prepare a memory in the device as a ROM.
The problem is mentioned.

そこで、本発明の目的は、上記したような事情に鑑み成されたもので、処理が軽負荷で、符号化で生じる誤差を抑えるとともに、符号語変換の為の変換テーブルを必要としない映像信号の符号化装置、復号化装置、符号化方法、及び、復号化方法を提供するものである。   Accordingly, an object of the present invention has been made in view of the circumstances as described above, and is a video signal that does not require a conversion table for codeword conversion while suppressing processing errors due to light processing. Encoding apparatus, decoding apparatus, encoding method, and decoding method are provided.

上記目的を達成するため、所定の単位ビット数(Rビット)で表される連続した映像のディジタル信号データを入力とし、ディジタル信号データを符号語長rビット(r<R)に圧縮符号化する符号化装置において、連続した映像の複数のディジタル信号データを蓄積するメモリ手段と、メモリ手段に蓄積された複数のディジタル信号データをビット単位に比較し、ディジタル信号データの最上位ビットから最初に異なると判定したビットまでの位置情報を求める選定手段と、符号化に最適な符号語長となるrビットを選択する判定手段と、位置情報及び符号語長に基づいて、メモリ手段に蓄積された複数のディジタル信号データからrビットを抽出して符号語列として出力する符号化手段と、位置情報、符号語長及び符号語列を所定規則に則ってフォーマット化し、ビットストリームとして出力するフォーマット手段を備えることを特徴とする符号化装置を提供するものである。   In order to achieve the above object, continuous video digital signal data represented by a predetermined number of unit bits (R bits) is input, and the digital signal data is compression-coded to a code word length r bits (r <R). In the encoding device, the memory means for storing a plurality of digital signal data of continuous video and the plurality of digital signal data stored in the memory means are compared bit by bit, and are first different from the most significant bit of the digital signal data. Selection means for obtaining position information up to the determined bit, determination means for selecting r bits having the optimum code word length for encoding, and a plurality of data stored in the memory means based on the position information and code word length Encoding means for extracting r bits from the digital signal data and outputting it as a code word string, and position information, code word length and code word string in accordance with predetermined rules And formatting I, there is provided an encoding device, characterized in that it comprises a format means for outputting a bitstream.

また、上記記載の符号化装置のフォーマット手段において、入力される位置情報及び符号語長の記述に必要とする領域のビット長を算出し、位置情報の領域のビット長と符号語長の領域のビット長及び符号化列のビット長との総計がバイト単位に配置可能な長さのビットストリームを生成する為に、空領域を付加して、位置情報の領域、符号語長の領域、符号化列及び空領域の順にビットストリームとして出力する規則を有するフォーマット手段を備えることを特徴とする符号化装置を提供する。   Further, in the format means of the encoding device described above, the bit length of the area required for the description of the input position information and code word length is calculated, and the bit length of the position information area and the area of the code word length are calculated. In order to generate a bit stream whose length is the total of the bit length and the bit length of the encoded sequence that can be arranged in bytes, an empty area is added, a position information area, a code word length area, and an encoding There is provided an encoding device characterized by comprising formatting means having a rule for outputting a bit stream in the order of columns and empty areas.

また、上記記載の符号化装置から出力されるビットストリームを復号化して元のRビットで表される映像、音声等のディジタル信号データを得る復号化装置において、ビットストリームを格納するメモリ手段と、メモリ手段に蓄積されたビットストリームを位置情報、符号語長及び符号語列に分離するデフォーマット手段と、位置情報及び符号語長と符号化列から元の所定の単位ビット数で表される映像のディジタル信号データに復号化する復号化手段とを備えることを特徴とする復号化装置を提供する。   In addition, in a decoding device that obtains digital signal data such as video and audio represented by the original R bits by decoding the bitstream output from the encoding device described above, memory means for storing the bitstream; Deformatting means for separating the bit stream stored in the memory means into position information, codeword length and codeword string, and video represented by the original predetermined number of unit bits from the position information, codeword length and coded string And a decoding means for decoding the digital signal data.

また、所定の単位ビット数(Rビット)で表される連続した映像のディジタル信号データを符号語長rビット(r<R)に圧縮符号化する符号化方法において、連続した映像の複数のディジタル信号データをメモリ手段に蓄積する蓄積ステップと、メモリ手段に蓄積された複数のディジタル信号データをビット単位に比較し、ディジタル信号データの最上位ビットから最初に異なると判定したビットまでの位置情報を求める選定ステップと、符号化に最適な符号語長となるrビットを選択する判定ステップと、位置情報及び符号語長に基づいて、メモリ手段に蓄積された複数のディジタル信号データからrビットを抽出して符号語列として出力する符号化ステップと、位置情報、符号語長及び符号語列を所定規則に則ってフォーマット化し、ビットストリームとして出力するフォーマットステップと、出力されたビットストリームの符号長から次の連続した映像のディジタル信号データの符号化に使用する符号語長を算出する制御ステップとを含むことを特徴とする符号化方法を提供する。   Further, in an encoding method for compressing and encoding digital signal data of a continuous video represented by a predetermined number of unit bits (R bits) to a code word length r bits (r <R), a plurality of digitals of continuous video An accumulation step for accumulating signal data in the memory means and a plurality of digital signal data accumulated in the memory means are compared bit by bit, and position information from the most significant bit of the digital signal data to the first bit determined to be different is obtained. A selection step for obtaining, a determination step for selecting r bits to be the optimum code word length for encoding, and extraction of r bits from a plurality of digital signal data stored in the memory means based on the position information and the code word length Encoding step of outputting as a code word string, and formatting the position information, code word length and code word string in accordance with a predetermined rule, And a control step for calculating a codeword length used for encoding the digital signal data of the next continuous video from the code length of the output bitstream. Provide a method.

また、上記記載の符号化方法のフォーマットステップにおいて、入力される位置情報及び符号語長の記述に必要とする領域のビット長を算出し、位置情報の領域のビット長と符号語長の領域のビット長及び符号化列のビット長との総計がバイト単位に配置可能な長さのビットストリームを生成する為に、空領域を付加して、位置情報の領域、符号語長の領域、符号化列及び空領域の順にビットストリームとして出力する規則を有するフォーマットステップを含むことを特徴とする符号化方法を提供する。   Further, in the formatting step of the encoding method described above, the bit length of the area required for the description of the input position information and the code word length is calculated, and the bit length of the position information area and the area of the code word length are calculated. In order to generate a bit stream whose length is the total of the bit length and the bit length of the encoded sequence that can be arranged in bytes, an empty area is added, a position information area, a code word length area, and an encoding There is provided an encoding method including a formatting step having a rule of outputting a bit stream in the order of a sequence and an empty region.

更に、上記記載の符号化方法によって得られたビットストリームを復号化して元のRビットで表される映像のディジタル信号データを得る復号化方法において、入力される位置情報及び符号語長の記述に必要とする領域のビット長を算出し、位置情報の領域のビット長と符号語長の領域のビット長及び符号化列のビット長との総計がバイト単位に配置可能な長さのビットストリームを生成する為に、空領域を付加して、位置情報の領域、符号語長の領域、符号化列及び空領域の順にビットストリームとして出力する規則に則ったビットストリームをメモリ手段に格納する格納ステップと、メモリ手段に蓄積されたビットストリームを位置情報、符号語長及び符号語列に分離するデフォーマットステップと、位置情報及び符号語長と符号化列から元の所定の単位ビット数で表される映像のディジタル信号データに復号化する復号化ステップとを含むことを特徴とする復号化方法を提供する。   Furthermore, in the decoding method for decoding the bit stream obtained by the above-described encoding method to obtain the digital signal data of the video represented by the original R bits, the input position information and the code word length are described. The bit length of the required area is calculated, and a bit stream of a length in which the sum of the bit length of the position information area, the bit length of the code word length area, and the bit length of the encoded sequence can be arranged in bytes. A storage step of storing in the memory means a bit stream in accordance with the rule of outputting as a bit stream in the order of a position information area, a code word length area, a coded sequence, and an empty area in order to generate an empty area A deformatting step for separating the bit stream stored in the memory means into position information, codeword length and codeword string, and position information, codeword length and encoded string It provides a decoding method which comprises a decoding step of decoding the digital signal data of the image represented by the original predetermined unit bit number.

本発明の符号化装置、復号化装置、符号化方法、及び、復号化方法によれば、画像信号の符号化、復号化は加減算及びビット演算のみで構成される為、高速処理が可能であり、符号化で生じる誤差を抑えることが可能である。更に、符号語変換の為の変換テーブルを必要としないので、ROM等のメモリを削減するという効果を得ることが出来る。   According to the encoding device, the decoding device, the encoding method, and the decoding method of the present invention, the encoding and decoding of the image signal is configured only by addition / subtraction and bit operation, so that high-speed processing is possible. It is possible to suppress errors caused by encoding. Furthermore, since a conversion table for codeword conversion is not required, an effect of reducing memory such as ROM can be obtained.

本発明に係る符号化装置の実施例を示すブロック図である。It is a block diagram which shows the Example of the encoding apparatus which concerns on this invention. 本発明に係る復号化装置の実施例を示すブロック図である。It is a block diagram which shows the Example of the decoding apparatus which concerns on this invention. 本発明に係る符号化装置の選定器の構成を示すブロック図である。It is a block diagram which shows the structure of the selector of the encoding apparatus which concerns on this invention. 本発明に係る符号化装置の符号化器の構成を示すブロック図である。It is a block diagram which shows the structure of the encoder of the encoding apparatus which concerns on this invention. 本発明に係る伝送フォーマットの構成を示す一例である。It is an example which shows the structure of the transmission format which concerns on this invention. 本発明に係る伝送フォーマットの構成を示す一例である。It is an example which shows the structure of the transmission format which concerns on this invention. 本発明に係る復号化装置の復号化器の構成を示すブロック図である。It is a block diagram which shows the structure of the decoder of the decoding apparatus which concerns on this invention. 本発明に係る符号化装置及び復号化装置を具備した液晶テレビの構成概要を示すブロック図である。It is a block diagram which shows the structure outline | summary of the liquid crystal television provided with the encoding apparatus and decoding apparatus which concern on this invention. 本発明に係る符号化装置の処理を示すフローチャートである。It is a flowchart which shows the process of the encoding apparatus which concerns on this invention. 本発明に係る復号化装置の処理を示すフローチャートである。It is a flowchart which shows the process of the decoding apparatus which concerns on this invention.

本発明を実施する好適な例として、倍速表示機能を搭載した液晶テレビが挙げられる。倍速表示機能は、通常1秒間に60コマで表示している映像を倍の120コマに増やして表示させ、液晶テレビ特有の映像ぶれを解決する技術であり、その為にはコマとコマの間に新たな映像を生成する必要がある。コマ数が増えると液晶テレビのメモリ容量が増加し、内部バスのトラフィックが増加する為、機器の負荷やコストが増すことになる。この問題を解決する為に、本発明に係る符号化装置及び復号化装置を装備した液晶テレビ内部の構成概要を図8に示す。   As a suitable example for carrying out the present invention, there is a liquid crystal television equipped with a double speed display function. The double-speed display function is a technology that solves image blurring peculiar to LCD televisions by increasing the number of images normally displayed at 60 frames per second to 120 frames and displaying them. It is necessary to generate a new video. As the number of frames increases, the memory capacity of the liquid crystal television increases and traffic on the internal bus increases, which increases the load and cost of the equipment. In order to solve this problem, FIG. 8 shows a schematic configuration inside a liquid crystal television equipped with the encoding device and the decoding device according to the present invention.

受信した放送信号はMPEGデコーダ804に入力される。放送信号はMPEG形式の符号化が施されたビットストリームであり、MPEGデコーダ804で映像のディジタル信号データに復号される。ディジタル信号データは本発明に係る符号化装置805にて圧縮符号化されビットストリームとして出力し、内部バス801を経由してメモリ808に蓄積される。メモリ808に蓄積されたビットストリームを本発明に係る符号/復号化装置806にて復号して、倍速画像生成装置807にて倍速表示用の補間映像を生成、再度符号/復号化装置806にて符号化され、ビットストリームと出力し、内部バスを経由して、本発明に係る復号化装置803に入力する。復号化装置803ではビットストリームから映像のディジタル信号データに復号して、描画エンジン802に送信する。描画エンジン802では映像信号に変換して、パネルに映像を表示する。   The received broadcast signal is input to the MPEG decoder 804. The broadcast signal is a bit stream that has been encoded in the MPEG format, and is decoded into video digital signal data by the MPEG decoder 804. The digital signal data is compressed and encoded by the encoding device 805 according to the present invention, is output as a bit stream, and is stored in the memory 808 via the internal bus 801. The bit stream stored in the memory 808 is decoded by the encoding / decoding device 806 according to the present invention, the double-speed image generation device 807 generates an interpolated video for double-speed display, and the encoding / decoding device 806 again. It is encoded and output as a bit stream, and is input to the decoding device 803 according to the present invention via the internal bus. The decoding device 803 decodes the bit stream into video digital signal data and transmits the video signal to the drawing engine 802. The drawing engine 802 converts the video signal into a video signal and displays the video on the panel.

以下に、図8で示される本発明に係る符号化装置805、復号化装置803及び符号/復号化装置806の処理の詳細を説明する。   Details of the processes of the encoding device 805, the decoding device 803, and the encoding / decoding device 806 according to the present invention shown in FIG. 8 will be described below.

本発明に係る実施形態による符号化装置及び復号化装置の図を用いて、画像信号の符号化及び復号化について説明する。   The encoding and decoding of an image signal will be described with reference to diagrams of an encoding device and a decoding device according to an embodiment of the present invention.

尚、符号化装置と対応する復号化装置にて処理する画像の横幅と高さの画素数が公知であることとする。また、符号化装置にて出力される符号語は本発明に係る伝送フォーマットに従ってフォーマット化されたビットストリームを成し、復号化装置ではそのビットストリームの構造が既知であり、フォーマットに準拠したビットストリームのみを復号化可能とする。   It is assumed that the number of pixels of the width and height of an image processed by a decoding apparatus corresponding to the encoding apparatus is known. The code word output from the encoding device forms a bit stream formatted according to the transmission format according to the present invention, and the decoding device has a known bit stream structure, and the bit stream conforming to the format. Only can be decrypted.

本実施例は説明を円滑に進める為、符号化前の画像データの画像信号のビット精度Rビットを8ビットとし、符号化による変換後の符号語rビットを、既定ビットとして4ビットとし、最大6ビットと設定する。復号化はr(r≦6)ビットの符号語を元の画像信号8ビットに復号することとする。   In order to facilitate the explanation of this embodiment, the bit precision R bit of the image signal of the image data before encoding is set to 8 bits, the codeword r bit after conversion by encoding is set to 4 bits as a default bit, Set to 6 bits. Decoding is performed by decoding a codeword of r (r ≦ 6) bits into an original image signal of 8 bits.

(符号化実施例)
図1は本発明の符号化装置の構成を示す。図1の装置番号を参照し、図9に示すフローチャートの処理順に従い、説明を行うこととする。以下、文中の括弧内の番号は図9のステップ番号を示す。
(Encoding example)
FIG. 1 shows the configuration of the encoding apparatus of the present invention. Referring to the apparatus numbers in FIG. 1, the description will be made according to the processing order of the flowchart shown in FIG. Hereinafter, the numbers in parentheses in the sentences indicate the step numbers in FIG.

図1の符号化装置において、画像信号がメモリ101に入力される。メモリ101に入力される画像信号は、1枚の画像を、画像の左上から右下にかけてラスタスキャン順にライン毎に入力されることとし、メモリ101には一度にN(N>1)画素の画像信号が格納され、格納された画素数毎に符号化処理を行う(S901)。   In the encoding apparatus of FIG. 1, an image signal is input to the memory 101. As the image signal input to the memory 101, one image is input line by line in the raster scan order from the upper left to the lower right of the image, and an image of N (N> 1) pixels at a time is input to the memory 101. A signal is stored, and an encoding process is performed for each number of stored pixels (S901).

本実施例ではN=6として、以下説明を行う。画像信号の入力がライン端に達し、メモリ101に格納される画像信号が6画素未満になった場合は、不足分の画素の画像信号を“0”として、実際に画素の後に仮想的に続けてメモリ101に格納して6画素として符号化する。   In this embodiment, N = 6 will be described below. When the input of the image signal reaches the end of the line and the image signal stored in the memory 101 becomes less than 6 pixels, the image signal of the deficient pixel is set to “0” and is virtually continued after the pixel. Are stored in the memory 101 and encoded as 6 pixels.

メモリ101に格納された6画素はまず、位置選定器104に出力される。ここで便宜上メモリ101に格納される6画素の画像信号は入力順にx0,x1,x2,・・・,x5で表すこととし、各画像信号は以下の二進数で表わされる8ビット信号の値を持つこととする。
x0 : 1011 1101
x1 : 1010 1111
x2 : 1010 0011
x3 : 1001 1000
x4 : 1001 1011
x5 : 1000 1110
The six pixels stored in the memory 101 are first output to the position selector 104. Here, for convenience, the image signals of 6 pixels stored in the memory 101 are represented by x0, x1, x2,..., X5 in the order of input, and each image signal has an 8-bit signal value represented by the following binary number. I will have it.
x0: 1011 1101
x1: 1010 1111
x2: 1010 0011
x3: 1001 1000
x4: 1001 1011
x5: 1000 1110

位置選定器104では、入力された6画素の8ビット画像信号に対して、共通するMSBを検出する(S902)。つまり、6画素の8ビット画像信号をビット毎に比較し、最上位ビットから見て最初に異なるビットが出現するまでの最上位ビットからの位置を求める。例えば、最上位ビットが同じで次の桁のビットが異なった場合は“1”となる。本実施例での画像信号xi(i=0,...,5)では、上位の7ビット目と6ビット目が“10”と共通であるので、この場合選定位置は“2”となり、以下に選定位置を求める位置選定器104の動作を記述する。   The position selector 104 detects a common MSB for the inputted 6-pixel 8-bit image signal (S902). That is, the 6-bit 8-bit image signal is compared for each bit, and the position from the most significant bit until the first different bit appears from the most significant bit is obtained. For example, when the most significant bit is the same and the next digit bit is different, “1” is set. In the image signal xi (i = 0,..., 5) in this embodiment, since the upper 7th bit and the 6th bit are common with “10”, the selection position is “2” in this case. The operation of the position selector 104 for obtaining the selected position will be described below.

位置選定器104の構成を図3に示す。メモリ101に格納された画像信号がスイッチャ301に入力される。   The configuration of the position selector 104 is shown in FIG. An image signal stored in the memory 101 is input to the switcher 301.

スイッチャ301に入力される8ビットの画素信号が先頭画素の場合、信号レジスタ302に一時的に格納する。この時、スイッチャ301はリセット信号を生成し、判定レジスタ303に送る。判定レジスタ303は8ビット長のビット信号を持ち、画素信号の各ビットが同一か否かの判定を行う為のビット信号であり、同一であれば“0”、異なれば“1”のビットで表す。判定レジスタ303はリセット信号によって全てのビットが“0”にリセットされる。ここではR=8ビットのビット長となり、判定レジスタ303は“00000000”にセットされる。スイッチャ301に入力される画素信号が先頭画素でない場合、スイッチャ301は信号分岐を切換え、画素信号をOR回路304及びXOR回路305に送る。   When the 8-bit pixel signal input to the switcher 301 is the first pixel, it is temporarily stored in the signal register 302. At this time, the switcher 301 generates a reset signal and sends it to the determination register 303. The determination register 303 has a bit signal having an 8-bit length, and is a bit signal for determining whether or not each bit of the pixel signal is the same. If it is the same, the bit is “0”, and if it is different, the bit is “1”. To express. In the determination register 303, all bits are reset to “0” by the reset signal. Here, the bit length is R = 8 bits, and the determination register 303 is set to “00000000”. When the pixel signal input to the switcher 301 is not the first pixel, the switcher 301 switches the signal branch and sends the pixel signal to the OR circuit 304 and the XOR circuit 305.

OR回路304では、信号レジスタ302に一時的に格納された画素信号とスイッチャ301から出力された画素信号との論理和をとり、その結果を信号レジスタ302に格納する。   The OR circuit 304 calculates the logical sum of the pixel signal temporarily stored in the signal register 302 and the pixel signal output from the switcher 301 and stores the result in the signal register 302.

XOR回路305では、信号レジスタ302に一時的に格納された画素信号とスイッチャ301から出力された画素信号との排他論理和をとる。この排他論理和は画素信号同士のビット単位の合致を示すものである。この排他論理和をOR回路306に送る。   The XOR circuit 305 performs an exclusive OR of the pixel signal temporarily stored in the signal register 302 and the pixel signal output from the switcher 301. This exclusive OR represents a bit unit match between pixel signals. This exclusive OR is sent to the OR circuit 306.

OR回路306では判定レジスタ303に格納された値とXOR回路305から出力された排他論理和との論理和をとる。ここでの論理和は画素信号の中でビット単位に異なるビットが存在する場合に“1”を、同じビットであれば“0”のビットをとることを示す。OR回路306で算出された論理和は判定レジスタ303に格納される。以上の行程をメモリ101に格納された画素数分繰り返し、最終的なOR回路306からの出力を選定値として得る。   The OR circuit 306 calculates the logical sum of the value stored in the determination register 303 and the exclusive OR output from the XOR circuit 305. The logical sum here indicates that “1” is taken when there are different bits in the pixel signal and “0” is taken if they are the same bit. The logical sum calculated by the OR circuit 306 is stored in the determination register 303. The above process is repeated for the number of pixels stored in the memory 101, and the final output from the OR circuit 306 is obtained as a selected value.

本実施例での画像信号x0,...,x5に対して適用した場合の選定値は“00111111”となる。選定値の上位ビットから数えて最初に“1”ビットが出現するのは2ビット目の位置であり、この位置をp(=2)とする。即ち、メモリ101の中に格納された6画素の画像信号の上位p(=2)ビットは同じビットであると判定される。このpを選定位置として出力する。   The image signals x0,. . . , X5, the selected value is “00111111”. The first “1” bit appears from the upper bits of the selected value is the position of the second bit, and this position is assumed to be p (= 2). That is, it is determined that the upper p (= 2) bits of the 6-pixel image signal stored in the memory 101 are the same bits. This p is output as the selected position.

次に、位置選定器104によって導出された選定位置pを符号語長選定器105に送り、符号語長rを導出する(S903)。符号語長rは選定位置pで示される画素信号の最上位ビットからのビットの位置以降のビット信号が対象となる。本実施例での画像信号x0,...,x5に対して選定位置p=2であるので、画素信号の最上位ビットから数えて2ビット以降の6ビットとなる。一方、制御器106からは、予め設定した圧縮率になるように符号化する為に、符号化により発生した符号語のビットストリームの符号量により算出された次のN画素に対する符号語長が符号語長選定器105に入力される。選定位置pにより算出される値と制御器106からの入力値とを比較し、小さい方の値を選択し、その値を符号語長rとして出力する。尚、本実施例での画像信号x0,...,x5は画像の最初の入力値であり、制御器106から入力される符号語長が無いので、この場合既定ビットの“4”を初期値として使用することとし、以降のN画素からは上述の制御器106からフィードバックされる符号語長を使用することとする。   Next, the selected position p derived by the position selector 104 is sent to the codeword length selector 105 to derive the codeword length r (S903). The code word length r is a bit signal after the bit position from the most significant bit of the pixel signal indicated by the selected position p. The image signals x0,. . . , X5, the selected position p = 2, so that 6 bits are counted from 2 bits after the most significant bit of the pixel signal. On the other hand, in order to perform encoding so as to obtain a preset compression rate, the controller 106 determines the codeword length for the next N pixels calculated from the code amount of the bitstream of the codeword generated by encoding. This is input to the word length selector 105. The value calculated by the selected position p is compared with the input value from the controller 106, the smaller value is selected, and that value is output as the codeword length r. The image signals x0,. . . , X5 are the first input values of the image and there is no code word length input from the controller 106. In this case, the predetermined bit “4” is used as the initial value, and the subsequent N pixels are used as described above. The codeword length fed back from the controller 106 is used.

位置選定器104によって導出された選定位置p、符号語長選定器105によって導出された符号語長r及びメモリ101からの画素信号を符号化器102に送り、画素信号の符号化を行う(S904)。   The selected position p derived by the position selector 104, the codeword length r derived by the codeword length selector 105, and the pixel signal from the memory 101 are sent to the encoder 102, and the pixel signal is encoded (S904). ).

符号化器102の構成を図4に示す。   The configuration of the encoder 102 is shown in FIG.

図4において、メモリ101に格納された画像信号が画素毎にスイッチャ401に入力される。スイッチャ401は入力される画像信号が先頭画素か否かで処理を変更する。先頭画素x0がスイッチャ401に入力される場合、そのままの値で出力しy0とする。先頭画素以外の画素x1,...,x5がスイッチャ401に入力される場合、スイッチャ401は処理を切換え、画像信号を符号抽出器402に送る。   In FIG. 4, the image signal stored in the memory 101 is input to the switcher 401 for each pixel. The switcher 401 changes processing depending on whether or not the input image signal is the first pixel. When the first pixel x0 is input to the switcher 401, it is output as it is and is set to y0. Pixels x1,. . . , X5 are input to the switcher 401, the switcher 401 switches processing and sends an image signal to the code extractor 402.

符号抽出器402では、Rビット信号からrビット信号に変換する。ここでは8ビット画像信号を4ビットの符号語に変換する。画像信号と同時に選定位置p(=2)が入力され、選定位置pにより画像信号から4ビット抽出する為のビットシフト量sが次式により計算される。
s = R − r − p = 8 − 4 − 2 = 2
The code extractor 402 converts an R bit signal into an r bit signal. Here, an 8-bit image signal is converted into a 4-bit code word. The selected position p (= 2) is input simultaneously with the image signal, and the bit shift amount s for extracting 4 bits from the image signal at the selected position p is calculated by the following equation.
s = R-r-p = 8-4-2 = 2

画像信号はs(=2)ビット右シフトされた後、符号語抽出の為のr(=4)ビットのマスク信号2−1(=2−1=15)との論理和をとり、4ビットの符号語yi(i=1,...,5)が算出される。以上の操作により上述のxi(i=0,...,5)に対応する符号語yi(i=0,...,5)は次の様になる。
y0 : 1011 1101
y1 : 1011
y2 : 1000
y3 : 0110
y4 : 0110
y5 : 0011
The image signal is right-shifted by s (= 2) bits, and then ORed with an r (= 4) bit mask signal 2 r −1 (= 2 4 −1 = 15) for codeword extraction, A 4-bit codeword yi (i = 1,..., 5) is calculated. With the above operation, the code word yi (i = 0,..., 5) corresponding to the above xi (i = 0,..., 5) is as follows.
y0: 1011 1101
y1: 1011
y2: 1000
y3: 0110
y4: 0110
y5: 0011

符号化器102で求められた符号語yi(i=0,...,5)と選定位置p及び符号語長rはフォーマット器103に入力される。フォーマット器103ではPCやデジタル機器で容易に扱えるように、メモリ101に格納した画素分の符号語と選定位置及び符号語長をバイト単位で処理出来るようにフォーマット化する(S905)。まず、選定位置を表すビット列を置き、次に符号語長を表すビット列、更に画素の符号語y0からy5までを順に配置する。ここで選定位置を表すビット列に必要とするビット長qは次式により算出される。   The code word yi (i = 0,..., 5) obtained by the encoder 102, the selected position p, and the code word length r are input to the formatter 103. The formatter 103 formats the code word, the selected position, and the code word length for the pixels stored in the memory 101 so that they can be processed in bytes so that they can be easily handled by a PC or digital device (S905). First, a bit string representing the selected position is placed, then a bit string representing the code word length, and then pixel code words y0 to y5 are sequentially arranged. Here, the bit length q required for the bit string representing the selected position is calculated by the following equation.

R − r < 2
但し、qは正整数であり、R−rを超える最小の2となるqであることとする。本実施例ではR=8であり、rは最小値が“0”であるので、8<2を満たす最小のqは“4”となる。また、符号語長を表すビット列に必要とするビット長uはrビットの最大値として“6”としているので、3ビットで表されることからu=3となる。メモリ101に格納した画素数N=6である場合の総ビット長Bは次式により表される。
B = R + r × (N − 1) + q + u
本実施例では、B=8+4×(6−1)+4+3=35となり、バイト単位とする為、パディングビットを付加する(S906)。
R-r < 2q
However, q is a positive integer, and is q which is the minimum 2 q exceeding R−r. In this embodiment a R = 8, r Since the minimum value is "0", the minimum q is "4" satisfying 8 <2 q. Also, since the bit length u required for the bit string representing the codeword length is set to “6” as the maximum value of r bits, u = 3 because it is represented by 3 bits. The total bit length B when the number of pixels N = 6 stored in the memory 101 is expressed by the following equation.
B = R + r * (N-1) + q + u
In this embodiment, B = 8 + 4 × (6-1) + 4 + 3 = 35, and padding bits are added to make the unit of bytes (S906).

本実施例では、パディングビットのビット長nとして、n=5ビットを付加して、合計40ビット=5バイトで表すことが可能となる。   In the present embodiment, n = 5 bits are added as the bit length n of padding bits, and the total can be expressed by 40 bits = 5 bytes.

尚、パディングビットとしてのビットは、“0”ビットが一般的な使用とされるが、“1”ビットが混在する形態でもよく、また他の情報を格納するのにも使用してもよい。   The “0” bit is generally used as the padding bit. However, the “1” bit may be mixed, or may be used to store other information.

このようにして、パディングビットを付加することで、図5に示されるようなバイト単位でのフォーマット化が可能となり、複数画素単位に処理したビットストリームとして出力する(S907)。   By adding padding bits in this way, formatting in units of bytes as shown in FIG. 5 becomes possible, and a bit stream processed in units of a plurality of pixels is output (S907).

また、図6に示されるように、選定位置pが“8”の場合、先頭画素x0と以降の画素x1,x2,・・・,x5とが同一の画素信号であることから、先頭画素のみ送るフォーマット形態として、発生符号量を抑制するようにしてもよい。   Also, as shown in FIG. 6, when the selected position p is “8”, the first pixel x0 and the subsequent pixels x1, x2,. As a format format to be sent, the generated code amount may be suppressed.

ビットストリームを出力する一方で、ビットストリームの符号量が制御器106に入力される。制御器106では、予め設定された圧縮率になるようにビットストリームの発生符号量を制御する為に、次のN画素の符号化で使用する符号語長を算出する(S908)。   While outputting the bitstream, the code amount of the bitstream is input to the controller 106. The controller 106 calculates the codeword length used in the encoding of the next N pixels in order to control the generated code amount of the bitstream so as to obtain a preset compression rate (S908).

N画素毎に予め設定された圧縮率で算出される目標符号量の総和と発生符号量の総和との比較を行い、前の符号化に使用した符号語長rに対して、発生符号量の総和が目標符号量の総和よりも大きい場合はrから1減じた値“r−1”を、発生符号量の総和が目標符号量の総和よりも小さい場合はrに1加えた値“r+1”を、発生符号量の総和が目標符号量の総和と等しい場合は加減操作せず“r”として符号語長選定器105に出力する。   The total of the target code amount calculated at a compression rate set in advance for each N pixel is compared with the total of the generated code amount, and the generated code amount is compared with the codeword length r used for the previous encoding. When the sum is larger than the sum of the target code amounts, a value “r−1” obtained by subtracting 1 from r is obtained. When the sum of the generated code amounts is smaller than the sum of the target code amounts, a value “r + 1” obtained by adding 1 to r. Is output to the codeword length selector 105 as “r” without adding or subtracting when the sum of the generated code amounts is equal to the sum of the target code amounts.

また、目標符号量に閾値を設け、その閾値との発生符号量の総和との比較により、前の符号化に使用した符号語長rに対する加減量の大きさを±1から±2或いはそれ以上に増やしてもよい。   Further, a threshold value is set for the target code amount, and the amount of addition / subtraction with respect to the codeword length r used for the previous encoding is changed from ± 1 to ± 2 or more by comparing the threshold with the total of the generated code amount. You may increase it.

以上の処理を画面1ラインのN画素単位毎に行い、ライン端に達したら、次のラインに移動し、同様の処理を繰り返す。更に画面の最終ラインに達したら、次の画面の先頭ラインから同様に処理を繰り返し、符号化処理を終了するまで連続してビットストリームを出力する(S909)。   The above processing is performed for each N pixels of one line of the screen. When the line end is reached, the process moves to the next line and the same processing is repeated. When the final line of the screen is reached, the same process is repeated from the first line of the next screen, and the bit stream is continuously output until the encoding process is completed (S909).

(復号化実施例)
図2は本発明の復号化装置の構成を示す。符号化実施例と同様に、図2の装置番号を参照し、図10に示すフローチャートの処理順に従い、説明を行うこととする。以下、文中の括弧内の番号は図10のステップ番号を示す。
(Decoding example)
FIG. 2 shows the configuration of the decoding apparatus of the present invention. Similar to the encoding embodiment, the apparatus number in FIG. 2 will be referred to and will be described in the order of processing in the flowchart shown in FIG. Hereinafter, the numbers in parentheses in the sentences indicate the step numbers in FIG.

上述の符号化装置で符号化されたビットストリームが復号化装置のメモリ201に蓄積される(S1001)。メモリ201には符号化装置にて符号化した複数画素(本実施例ではN=6画素)毎のビットストリームが蓄積された後に、デフォーマット器202に入力される。   The bit stream encoded by the above encoding apparatus is stored in the memory 201 of the decoding apparatus (S1001). A bit stream for each of a plurality of pixels (N = 6 pixels in this embodiment) encoded by the encoding device is accumulated in the memory 201 and then input to the deformatter 202.

デフォーマット器202では、符号化装置で複数画素単位の符号化されたビットストリームを選定位置p、符号語長r及び符号語yi(i=0,...,N−1)に分解され、復号化器203に出力される(S1002)。   In the deformatter 202, the bit stream encoded in units of a plurality of pixels is decomposed into a selected position p, a code word length r, and a code word yi (i = 0,..., N−1) by the encoding device, The data is output to the decoder 203 (S1002).

ビットストリーム先頭から、まず、選定位置のビット長、次に、符号語長のビット長が取り出され、最初のN画素のビットストリームを構成するバイト長を算出する(S1003)。バイト長は、上述の符号化実施例にて総ビット長Bを算出する際に使用した計算式から求められ、更にバイトアラインした値をビットストリームのバイト長として算出する。算出されたバイト長分のビットストリームをメモリ201から読み出し、符号語yi(i=0,...,N−1)とパディングビットを得る。パディングビットは復号化過程では必要としないので、破棄する。同時に、メモリ201では、読み出されたビットストリームのバイト長分だけ読み出し位置を進め、次に、処理するビットストリームの先頭に保持しておく。この操作はN画素毎のビットストリームの復号化処理毎に行われ、メモリ201内の読み取り位置を判断し、必要に応じてビットストリームからデータを追加することとする。   First, the bit length at the selected position and then the bit length of the codeword length are extracted from the head of the bit stream, and the byte length constituting the bit stream of the first N pixels is calculated (S1003). The byte length is obtained from the calculation formula used when calculating the total bit length B in the above-described encoding embodiment, and further, a byte aligned value is calculated as the byte length of the bit stream. The bit stream for the calculated byte length is read from the memory 201, and a code word yi (i = 0,..., N−1) and padding bits are obtained. Since the padding bits are not needed in the decoding process, they are discarded. At the same time, in the memory 201, the read position is advanced by the byte length of the read bitstream, and then held at the head of the bitstream to be processed. This operation is performed for each decoding process of the bit stream for each N pixel, and the reading position in the memory 201 is determined, and data is added from the bit stream as necessary.

符号語yi(i=0,...,N−1)は、先頭の符号語y0のRビット、以降の符号語yi(i=1,...,N−1)のrビットが取り出される(S1004)。   For the codeword yi (i = 0,..., N−1), the R bit of the first codeword y0 and the r bits of the subsequent codeword yi (i = 1,..., N−1) are extracted. (S1004).

ここで、本実施例では上述の符号化装置で説明に使用した値をそのまま復号化装置の説明でも使用することとする。即ち、元の画像信号はR=8ビット信号、符号化後の符号語のビット長は符号語長r=4ビットである。選定位置はビットストリームの先頭に4ビット長で記述されたp=2とする。また、ビットストリームを構成する符号語列は、上述の符号化装置で説明した処理単位となる画素数N=6とし、符号語列yi(i=0,...,5)とする。   Here, in this embodiment, the values used for the description in the above-described encoding apparatus are used as they are in the description of the decoding apparatus. That is, the original image signal is R = 8 bit signal, and the bit length of the encoded code word is code word length r = 4 bits. The selection position is assumed to be p = 2 described in a 4-bit length at the beginning of the bitstream. In addition, the code word string constituting the bit stream has the number of pixels N = 6 as the processing unit described in the above encoding apparatus, and is the code word string yi (i = 0,..., 5).

復号化器203の構成を図7に示す。   The configuration of the decoder 203 is shown in FIG.

図7において、デフォーマット器202で分解された符号語が順に復号化器203の中のスイッチャ701に入力される。スイッチャ701は入力されるデフォーマット器202で分解された最初の符号語y0と以降の符号語y1,...,y5とで復号化処理を切り換える。最初の符号語y0が入力される場合、元と同じ画像信号の8ビット信号であり、そのまま出力され、復号値x0’を得る。更に、最初の符号語の入力と同時に選定位置pがデフォーマット器202から入力され、最初の符号語y0とともに上位ビット抽出器702に入力される。上位ビット抽出器702では、選定位置p(=2)から符号語yi(i=1,...,5)を元の8ビット信号に戻す為に、先頭画素の符号語y0と共通する上位pビットを共通マスク値mとして取り出す。mは次式にて表される。
m = (y0 >> (R − p)) << (R − p)
ここで、演算子“>>”は右へのビットシフト、演算子“<<”は左へのビットシフトを表す。
In FIG. 7, the codewords decomposed by the deformatter 202 are sequentially input to the switcher 701 in the decoder 203. The switcher 701 receives the first code word y0 decomposed by the input formatter 202 and the subsequent code words y1,. . . , Y5 to switch the decoding process. When the first code word y0 is input, it is an 8-bit signal of the same image signal as the original and is output as it is to obtain a decoded value x0 ′. Further, the selected position p is input from the deformatter 202 simultaneously with the input of the first code word, and is input to the upper bit extractor 702 together with the first code word y0. In the upper bit extractor 702, in order to return the code word yi (i = 1,..., 5) from the selected position p (= 2) to the original 8-bit signal, the upper bit common to the code word y0 of the first pixel is used. p bits are taken out as a common mask value m. m is represented by the following equation.
m = (y0 >> (R-p)) << (R-p)
Here, the operator “>>” represents a bit shift to the right, and the operator “<<” represents a bit shift to the left.

本実施例ではy0=1011 1101であるから、共通マスク値mは“1000 0000”となり、この値は次のビットストリームの選定位置が入力されるまで上位ビット抽出器702に保持される。   In this embodiment, since y0 = 1011 1101, the common mask value m is “1000 0000”, and this value is held in the upper bit extractor 702 until the next bit stream selection position is input.

一方、デフォーマット器202にて抽出された選定位置p及び符号語長rはシフト量算出器707に入力される(S1005)。シフト量算出器707では、y0以降の符号語yi(i=1,...,5)を復号化する際にシフト器703にて使用するビットシフト量tを算出する。ビットシフト量tは次式で算出され、本実施例ではt=2となる。
t = R − r − p = 8 − 4 − 2 = 2
On the other hand, the selected position p and codeword length r extracted by the deformatter 202 are input to the shift amount calculator 707 (S1005). The shift amount calculator 707 calculates the bit shift amount t used by the shifter 703 when decoding the codeword yi (i = 1,..., 5) after y0. The bit shift amount t is calculated by the following equation, and in this embodiment, t = 2.
t = R−r−p = 8−4−2 = 2

次に、y0以降の符号語yi(i=1,...,5)が入力される場合、スイッチャ701は処理を切換え、復号化処理が行われる(S1006)。符号語yi(i=1,...,5)はスイッチャ701を経由してシフト器703に入力される。シフト器703では符号語yi(i=1,...,5)とともにシフト量算出器707からビットシフト量tが入力され、符号語をビットシフト量tにて左シフトを行う。   Next, when a code word yi (i = 1,..., 5) after y0 is input, the switcher 701 switches processing and performs decoding processing (S1006). The code word yi (i = 1,..., 5) is input to the shifter 703 via the switcher 701. The shift unit 703 receives the bit shift amount t from the shift amount calculator 707 together with the code word yi (i = 1,..., 5), and shifts the code word to the left by the bit shift amount t.

例えば、y1=1011の場合、右シフトした値y1’=10 1100となり、OR回路704に出力される。   For example, in the case of y1 = 1011, the right-shifted value y1 ′ = 10 1100 is obtained and output to the OR circuit 704.

OR回路704は、右シフトした値yi’(i=1,...,5)と上位ビット抽出器702にて保持されている共通マスク値mとの論理和をとる。例えば、y1’=10 1100の場合、論理和y1’’=1010 1100となる。   The OR circuit 704 calculates the logical sum of the right shifted value yi ′ (i = 1,..., 5) and the common mask value m held in the upper bit extractor 702. For example, when y1 ′ = 10 1100, the logical sum y1 ″ = 1010 1100 is obtained.

更に、ビットシフト量tが補正項算出器705に入力される(S1007)。補正項算出器705では、符号化により生じる元の画像信号との誤差を抑える為の補正項を算出する。符号化時にr(=4)ビット符号語を得る為に、元の画像信号をビットシフト量s(=R−r−p=8−4−2=2)ビット右シフトしたので、元の画像信号に対して下位sビット、即ち最大2−1の誤差が生じる。この誤差を抑える為に、符号化時と同様に求められたビットシフト量t(=s)を求め、2t−1を補正項として算出する(但し、t=0の場合は補正項は0)。本実施例では2t−1を=22−1=2が補正項となる。 Further, the bit shift amount t is input to the correction term calculator 705 (S1007). The correction term calculator 705 calculates a correction term for suppressing an error from the original image signal caused by encoding. In order to obtain an r (= 4) bit codeword at the time of encoding, the original image signal is shifted right by a bit shift amount s (= Rrp = 8-4-2 = 2) bits, so that the original image There will be an error of the lower s bits, ie a maximum of 2 s −1, for the signal. In order to suppress this error, the bit shift amount t (= s) obtained in the same manner as in encoding is obtained, and 2 t−1 is calculated as a correction term (provided that the correction term is 0 when t = 0). ). In this embodiment, 2 t−1 = 2 = 2−1 = 2 is a correction term.

OR回路704からの論値和出力値yi’’(i=1,...,5)と上記補正項とをOR回路706にて論理和をとり、復号値xi’(i=1,...,5)を得ることが出来る。例えば、y1’’= 1010 1100の場合、復号値x1’=1010 1110となり、元の画像信号x1に対して誤差を1で抑えることが出来る。こうして復号化されたxi’(i=0,...,5)の6画素を画素信号として出力する(S1008)。   The logical sum of the logical sum output values yi ″ (i = 1,..., 5) from the OR circuit 704 and the correction term are ORed by the OR circuit 706, and the decoded values xi ′ (i = 1,. ..., 5) can be obtained. For example, when y1 ″ = 1010 1100, the decoded value x1 ′ = 1010 1110, and the error can be suppressed to 1 with respect to the original image signal x1. Six pixels of xi ′ (i = 0,..., 5) decoded in this way are output as pixel signals (S1008).

以上の処理を繰り返し、復号化処理を終了するまで連続して画素信号を出力する(S1009)。   The above processing is repeated, and pixel signals are continuously output until the decoding processing is completed (S1009).

以上のように、本発明に係る符号化装置及び復号化装置によれば、画像信号の符号化、復号化は加減算及びビット演算のみで構成される為、高速処理が可能であり、符号化で生じる誤差を抑えることが可能である。更に符号語変換の為の変換テーブルを必要としないので、ROM等のメモリを削減することが出来る。   As described above, according to the encoding device and the decoding device according to the present invention, since the encoding and decoding of the image signal is configured only by addition / subtraction and bit operation, high-speed processing is possible. It is possible to suppress errors that occur. Furthermore, since a conversion table for codeword conversion is not required, memory such as ROM can be reduced.

尚、本実施例では、符号化装置と対応する復号化装置にて処理する画像の横幅と高さの画素数が公知であることとしたが、伝送フォーマットにて定義した選択位置及び符号語長を格納する領域の中に、選択位置及び符号語長以外の情報を格納しても構わない。例えば、本実施例では符号語長を格納する領域として3ビットを定義したが、1ビット拡張して4ビットとし、符号語長には下位3ビットのみ使用するので、最上位1ビットに対して、画面の横幅単位でライン処理をする場合に、ライン毎の先頭画素を含む画素群を符号化する場合のみ余った1ビットを“1”とし、それ以外の同一ライン上で処理する画素群には“0”とすることで、ライン数のカウントや同期をとることを可能とする。   In this embodiment, the number of pixels of the width and height of the image processed by the decoding apparatus corresponding to the encoding apparatus is known, but the selection position and codeword length defined in the transmission format are known. Information other than the selected position and codeword length may be stored in the area for storing. For example, in this embodiment, 3 bits are defined as an area for storing the code word length, but 1 bit is extended to 4 bits, and only the lower 3 bits are used for the code word length. When line processing is performed in units of the horizontal width of the screen, the remaining 1 bit is set to “1” only when the pixel group including the first pixel for each line is encoded, and other pixel groups to be processed on the same line By setting “0”, it is possible to count and synchronize the number of lines.

更に、パディングビットを格納する領域のビット数を拡張して、処理する画像の横幅と高さの画素数等の情報を記録するようにしてもよく、この場合符号化装置と復号化装置とで伝送フォーマット上の整合性を満たしていれば問題は無い。   Further, the number of bits in the area for storing padding bits may be expanded to record information such as the number of pixels of the width and height of the image to be processed. In this case, the encoding device and the decoding device There is no problem as long as consistency in the transmission format is satisfied.

101 メモリ
102 符号化器
103 フォーマット器
104 位置選定器
105 符号語長選定器
106 制御器
201 メモリ
202 デフォーマット器
203 復号化器
301 スイッチャ
302 信号レジスタ
303 判定レジスタ
304 OR回路
305 XOR回路
306 OR回路
401 スイッチャ
402 符号抽出器
701 スイッチャ
702 上位ビット抽出器
703 シフト器
704 OR回路
705 補正項算出器
706 OR回路
707 シフト量算出器
801 内部バス
802 描画エンジン
803 復号化装置
804 MPEGデコーダ
805 符号化装置
806 符号/復号化装置
807 画像生成装置
808 メモリ
DESCRIPTION OF SYMBOLS 101 Memory 102 Encoder 103 Formatter 104 Position selector 105 Code word length selector 106 Controller 201 Memory 202 Deformatter 203 Decoder 301 Switcher 302 Signal register 303 Determination register 304 OR circuit 305 XOR circuit 306 OR circuit 401 Switcher 402 Code extractor 701 Switcher 702 Upper bit extractor 703 Shifter 704 OR circuit 705 Correction term calculator 706 OR circuit 707 Shift amount calculator 801 Internal bus 802 Drawing engine 803 Decoder 804 MPEG decoder 805 Encoder 806 Code / Decoding device 807 Image generation device 808 Memory

Claims (6)

所定の単位ビット数(Rビット)で表される連続した映像のディジタル信号データを入力とし、ディジタル信号データを符号語長rビット(r<R)に圧縮符号化する符号化装置において、
連続した映像の複数のディジタル信号データを蓄積するメモリ手段と、
メモリ手段に蓄積された複数のディジタル信号データをビット単位に比較し、ディジタル信号データの最上位ビットから最初に異なると判定したビットまでの位置情報を求める選定手段と、
符号化に最適な符号語長となるrビットを選択する判定手段と、
位置情報及び符号語長に基づいて、メモリ手段に蓄積された複数のディジタル信号データからrビットを抽出して符号語列として出力する符号化手段と、
位置情報、符号語長及び符号語列を所定規則に則ってフォーマット化し、ビットストリームとして出力するフォーマット手段と、
出力されたビットストリームの符号長から次の連続した映像のディジタル信号データの符号化に使用する符号語長を算出する制御手段と
を備えることを特徴とする符号化装置。
In an encoding apparatus that receives digital signal data of continuous video represented by a predetermined number of unit bits (R bits) and compresses and encodes the digital signal data into a code word length r bits (r <R),
Memory means for storing a plurality of digital signal data of continuous video;
A selection means for comparing a plurality of digital signal data stored in the memory means bit by bit, and obtaining position information from the most significant bit of the digital signal data to the bit first determined to be different;
Determining means for selecting r bits to be an optimal codeword length for encoding;
Encoding means for extracting r bits from a plurality of digital signal data stored in the memory means based on the position information and the code word length and outputting them as a code word string;
Formatting means for formatting position information, codeword length and codeword string in accordance with a predetermined rule, and outputting as a bit stream;
An encoding device comprising: control means for calculating a code word length used for encoding digital signal data of the next continuous video from the code length of the output bit stream.
請求項1に記載の符号化装置のフォーマット手段において、
入力される位置情報及び符号語長の記述に必要とする領域のビット長を算出し、位置情報の領域のビット長と符号語長の領域のビット長及び符号化列のビット長との総計がバイト単位に配置可能な長さのビットストリームを生成する為に、空領域を付加して、位置情報の領域、符号語長の領域、符号化列及び空領域の順にビットストリームとして出力する規則を有するフォーマット手段を備えることを特徴とする符号化装置。
In the formatting means of the encoding device according to claim 1,
The bit length of the area required for the description of the input position information and code word length is calculated, and the sum of the bit length of the position information area, the bit length of the code word length area, and the bit length of the coded sequence is In order to generate a bit stream of a length that can be arranged in byte units, an empty area is added, and a rule for outputting a bit stream in the order of a position information area, a codeword length area, a coded sequence, and an empty area is provided. An encoding apparatus comprising: formatting means having
請求項1に記載の符号化装置から出力されるビットストリームを復号化して元のRビットで表される映像のディジタル信号データを得る復号化装置において、
入力される位置情報及び符号語長の記述に必要とする領域のビット長を算出し、位置情報の領域のビット長と符号語長の領域のビット長及び符号化列のビット長との総計がバイト単位に配置可能な長さのビットストリームを生成する為に、空領域を付加して、位置情報の領域、符号語長の領域、符号化列及び空領域の順にビットストリームとして出力する規則に則ったビットストリームを格納するメモリ手段と、
メモリ手段に蓄積されたビットストリームを位置情報、符号語長及び符号語列に分離するデフォーマット手段と、
位置情報及び符号語長と符号化列から元の所定の単位ビット数で表される映像のディジタル信号データに復号化する復号化手段と
を備えることを特徴とする復号化装置。
In the decoding apparatus which decodes the bit stream output from the encoding apparatus of Claim 1, and obtains the digital signal data of the image | video represented by the original R bit,
The bit length of the area required for the description of the input position information and code word length is calculated, and the sum of the bit length of the position information area, the bit length of the code word length area, and the bit length of the coded sequence is In order to generate a bitstream of a length that can be arranged in byte units, an empty area is added, and a bit stream is output in the order of a position information area, a codeword length area, a coded string, and an empty area. Memory means for storing a compliant bitstream;
Deformatting means for separating the bitstream stored in the memory means into position information, codeword length and codeword string;
A decoding device comprising: decoding means for decoding the position information, the code word length, and the encoded sequence into video digital signal data represented by an original predetermined number of unit bits.
所定の単位ビット数(Rビット)で表される連続した映像のディジタル信号データを符号語長rビット(r<R)に圧縮符号化する符号化方法において、
連続した映像の複数のディジタル信号データをメモリ手段に蓄積する蓄積ステップと、
メモリ手段に蓄積された複数のディジタル信号データをビット単位に比較し、ディジタル信号データの最上位ビットから最初に異なると判定したビットまでの位置情報を求める選定ステップと、
符号化に最適な符号語長となるrビットを選択する判定ステップと、
位置情報及び符号語長に基づいて、メモリ手段に蓄積された複数のディジタル信号データからrビットを抽出して符号語列として出力する符号化ステップと、
位置情報、符号語長及び符号語列を所定規則に則ってフォーマット化し、ビットストリームとして出力するフォーマットステップと、
出力されたビットストリームの符号長から次の連続した映像のディジタル信号データの符号化に使用する符号語長を算出する制御ステップと
を含むことを特徴とする符号化方法。
In an encoding method for compressing and encoding digital video data of a continuous video represented by a predetermined number of unit bits (R bits) to a code word length r bits (r <R),
An accumulation step of accumulating a plurality of digital signal data of continuous video in the memory means;
A selection step for comparing a plurality of digital signal data stored in the memory means bit by bit, and obtaining position information from the most significant bit of the digital signal data to the bit first determined to be different;
A determination step of selecting r bits to be an optimal codeword length for encoding;
An encoding step of extracting r bits from a plurality of digital signal data stored in the memory means based on the position information and the code word length, and outputting as a code word string;
Formatting position information, codeword length and codeword string according to a predetermined rule, and outputting as a bit stream;
And a control step of calculating a code word length used for encoding digital signal data of the next continuous video from the code length of the output bit stream.
請求項4に記載の符号化方法のフォーマットステップにおいて、
入力される位置情報及び符号語長の記述に必要とする領域のビット長を算出し、位置情報の領域のビット長と符号語長の領域のビット長及び符号化列のビット長との総計がバイト単位に配置可能な長さのビットストリームを生成する為に、空領域を付加して、位置情報の領域、符号語長の領域、符号化列及び空領域の順にビットストリームとして出力する規則を有するフォーマットステップを含むことを特徴とする符号化方法。
In the formatting step of the encoding method according to claim 4,
The bit length of the area required for the description of the input position information and code word length is calculated, and the sum of the bit length of the position information area, the bit length of the code word length area, and the bit length of the coded sequence is In order to generate a bit stream of a length that can be arranged in byte units, an empty area is added, and a rule for outputting a bit stream in the order of a position information area, a codeword length area, a coded sequence, and an empty area is provided. A coding method comprising a formatting step.
請求項4に記載の符号化方法によって得られたビットストリームを復号化して元のRビットで表される映像のディジタル信号データを得る復号化方法において、
入力される位置情報及び符号語長の記述に必要とする領域のビット長を算出し、位置情報の領域のビット長と符号語長の領域のビット長及び符号化列のビット長との総計がバイト単位に配置可能な長さのビットストリームを生成する為に、空領域を付加して、位置情報の領域、符号語長の領域、符号化列及び空領域の順にビットストリームとして出力する規則に則ったビットストリームをメモリ手段に格納する格納ステップと、
メモリ手段に蓄積されたビットストリームを位置情報、符号語長及び符号語列に分離するデフォーマットステップと、
位置情報及び符号語長と符号化列から元の所定の単位ビット数で表される映像のディジタル信号データに復号化する復号化ステップと
を含むことを特徴とする復号化方法。
In the decoding method which decodes the bit stream obtained by the encoding method of Claim 4, and acquires the digital signal data of the image | video represented by the original R bit,
The bit length of the area required for the description of the input position information and code word length is calculated, and the sum of the bit length of the position information area, the bit length of the code word length area, and the bit length of the coded sequence is In order to generate a bitstream of a length that can be arranged in byte units, an empty area is added, and a bit stream is output in the order of a position information area, a codeword length area, a coded string, and an empty area. A storage step of storing a compliant bitstream in the memory means;
A deformatting step of separating the bitstream stored in the memory means into position information, codeword length and codeword string;
A decoding step comprising: decoding the position information, the code word length, and the encoded sequence into video digital signal data represented by an original predetermined number of unit bits.
JP2009292981A 2009-12-24 2009-12-24 Encoding device, decoding device, encoding method, and decoding method Pending JP2011135330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009292981A JP2011135330A (en) 2009-12-24 2009-12-24 Encoding device, decoding device, encoding method, and decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009292981A JP2011135330A (en) 2009-12-24 2009-12-24 Encoding device, decoding device, encoding method, and decoding method

Publications (1)

Publication Number Publication Date
JP2011135330A true JP2011135330A (en) 2011-07-07

Family

ID=44347595

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009292981A Pending JP2011135330A (en) 2009-12-24 2009-12-24 Encoding device, decoding device, encoding method, and decoding method

Country Status (1)

Country Link
JP (1) JP2011135330A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016171422A (en) * 2015-03-12 2016-09-23 株式会社東芝 Image processing device and image processing method
CN114257336A (en) * 2020-09-23 2022-03-29 瑞昱半导体股份有限公司 Signal transmission system and transmitting terminal coding device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016171422A (en) * 2015-03-12 2016-09-23 株式会社東芝 Image processing device and image processing method
CN114257336A (en) * 2020-09-23 2022-03-29 瑞昱半导体股份有限公司 Signal transmission system and transmitting terminal coding device

Similar Documents

Publication Publication Date Title
KR100335707B1 (en) Coding method, coding apparatus, decoding method and decoding apparatus of image signal
EP1326449B1 (en) Data decoding method and decoding system
JP4734168B2 (en) Image decoding apparatus and image decoding method
KR960001482B1 (en) Information recording/reproducing apparatus
JP4491349B2 (en) Intra-coding method and apparatus for video data
US8908982B2 (en) Image encoding device and image encoding method
JPH03280624A (en) Coding and decoding device for variable length data
US20120093227A1 (en) Data compression method and data compression device
JP2011135330A (en) Encoding device, decoding device, encoding method, and decoding method
JP4735294B2 (en) Video signal encoding transmission and decoding method
JP2008187694A (en) Image encoder and method thereof
JP5093171B2 (en) Data compression device, data decompression device, and display device equipped with the same
JP6221820B2 (en) Encoding apparatus, encoding method, and encoding program
JP5739262B2 (en) Image transmission device, image transmission method, image reception device, and image reception method
JP3689437B2 (en) Image signal encoding method and apparatus
JP2010056600A (en) Device for encoding video signal and device for decoding video signal
CN1980343A (en) System for processing reducing and enlarging operation to a sub-picture, firmware system and multimedia data reproduction system
JPH0678297A (en) Method for encoding of digital video signal
JP5381668B2 (en) Encoding device and decoding device
JP3115013B2 (en) Image display device
JP2010276686A (en) Image control apparatus
US20210076048A1 (en) System, apparatus and method for data compaction and decompaction
JP3689626B2 (en) Image signal decoding method and apparatus
JP2001112002A (en) Digital moving picture decoder capable of image size conversion
JP4408933B2 (en) Digital image or video file size reduction method