JP2010130213A - Image coding device and image coding method - Google Patents
Image coding device and image coding method Download PDFInfo
- Publication number
- JP2010130213A JP2010130213A JP2008301333A JP2008301333A JP2010130213A JP 2010130213 A JP2010130213 A JP 2010130213A JP 2008301333 A JP2008301333 A JP 2008301333A JP 2008301333 A JP2008301333 A JP 2008301333A JP 2010130213 A JP2010130213 A JP 2010130213A
- Authority
- JP
- Japan
- Prior art keywords
- zero
- coefficient
- code
- input
- unit
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/93—Run-length coding
Abstract
Description
本発明は、画像符号化装置及び画像符号化方法に関する。 The present invention relates to an image encoding device and an image encoding method.
静止画像データの圧縮方式として、JPEGベースライン方式があり、JPEGベースライン方式の可変長符号化方式には、ハフマン符号が用いられる。8×8画素のブロックに分割された画像データをDCT変換し量子化して得られる係数は、ゼロ(0)とゼロではない値からなる。ハフマン符号化は、係数がゼロ(ゼロ係数)であるときのゼロの数(ゼロランレングス)と、ゼロ係数の後に続くゼロでない係数である非ゼロ係数の組み合わせを、発生頻度の高い順にコード長の短いコードを割り当てる。これにより、効率的な符号化を行うことができる。 As a still image data compression method, there is a JPEG baseline method, and a Huffman code is used as a variable length coding method of the JPEG baseline method. Coefficients obtained by DCT transforming and quantizing image data divided into 8 × 8 pixel blocks consist of zero (0) and non-zero values. Huffman coding uses a combination of the number of zeros (zero run length) when the coefficient is zero (zero coefficient) and the nonzero coefficient that is a nonzero coefficient following the zero coefficient in order of increasing frequency. Assign a short code. Thereby, efficient encoding can be performed.
従来のハフマン符号では、符号化の際、DCT係数ブロック内の全データについて、ブロック毎に、DCT係数がゼロであるか、又は非ゼロ係数であるかを判別する必要があった。例えば、DCT係数ブロックは、8×8のブロックであり、64データであるため、ハフマン符号で符号化する場合、通常1ブロックあたり64クロック以上を要した。そこで、例えば特許文献1には、ハフマン符号の処理時間の短縮化を図る技術が開示されている。
In the conventional Huffman code, it is necessary to determine whether the DCT coefficient is zero or a non-zero coefficient for each block of all data in the DCT coefficient block at the time of encoding. For example, since the DCT coefficient block is an 8 × 8 block and has 64 data, when coding with a Huffman code, normally 64 clocks or more are required per block. Thus, for example,
従来、可変長符号化において、連続するゼロ係数を数え上げてゼロランレングスを算出しており、1つのゼロ係数を数えるのに1クロックを必要としていた。そこで、特許文献1の技術では、符号化の際の処理クロック数を抑えるため、ゼロランレングス及び非ゼロ係数から可変長符号を生成する可変長符号化の前段で、ゼロランレングスと非ゼロ係数を組み合わせて1つの係数を生成する。そして、可変長符号化では、生成した1つの係数をもとに可変長符号を生成する。従って、特許文献1の可変長符号化では、ゼロランレングスを算出するための処理クロック数が不要となり、ゼロランレングスと非ゼロ係数が直接入力されるため、符号化の際の処理クロック数を削減できた。
Conventionally, in variable-length coding, consecutive zero coefficients are counted to calculate a zero run length, and one clock is required to count one zero coefficient. Therefore, in the technique of
しかし、この方法では、ゼロ係数が長く連続しているとき、即ちゼロランレングスが大きいときには処理クロック数の削減効果があるが、非ゼロ係数が1ブロック内で多いときは、処理クロック数の削減効果が低くなる。また、量子化後の係数が全て非ゼロ係数になったときは、処理クロック数の削減効果は全くなくなるという問題があった。 However, this method has an effect of reducing the number of processing clocks when the zero coefficients are long and continuous, that is, when the zero run length is large, but when the number of non-zero coefficients is large in one block, the number of processing clocks is reduced. Less effective. In addition, when all the quantized coefficients are non-zero coefficients, there is a problem that the effect of reducing the number of processing clocks is completely lost.
そこで、本発明は、上記問題に鑑みてなされたものであり、本発明の目的とするところは、可変長符号化において実質的な処理速度を向上させることが可能な、新規かつ改良された画像符号化装置及び画像符号化方法を提供することにある。 Accordingly, the present invention has been made in view of the above problems, and an object of the present invention is to provide a new and improved image capable of improving a substantial processing speed in variable-length coding. An encoding device and an image encoding method are provided.
上記課題を解決するために、本発明のある観点によれば、画像データを直交変換し直交変換係数を生成する直交変換部と、直交変換係数を量子化し量子化係数を生成する量子化部と、量子化係数の値がゼロ(0)であるゼロ係数の連続数を示すゼロランレングスと、ゼロ係数の後に続く、量子化係数の値がゼロでない非ゼロ係数とを検出する係数検出部と、順次検出された非ゼロ係数又はゼロランレングスを2以上の所定数毎に順次組み合わせると共に、非ゼロ係数及びゼロランレングスのいずれであるかを識別する識別子を非ゼロ係数及びゼロランレングス毎に付与して中間コードを生成する中間コード生成部と、中間コードの非ゼロ係数又はゼロランレングスと、識別子に基づいて、それぞれ1つの非ゼロ係数と1つのゼロランレングスが入力されて可変長符号化処理する、上記所定数と同一数以上からなる複数の符号化部とを有する画像符号化装置が提供される。 In order to solve the above problems, according to an aspect of the present invention, an orthogonal transform unit that orthogonally transforms image data to generate an orthogonal transform coefficient, a quantization unit that quantizes the orthogonal transform coefficient and generates a quantization coefficient, and A coefficient detection unit that detects a zero run length indicating the number of consecutive zero coefficients whose quantization coefficient value is zero (0), and a non-zero coefficient whose quantization coefficient value is not zero, following the zero coefficient; The sequentially detected non-zero coefficient or zero run length is sequentially combined every two or more predetermined numbers, and an identifier for identifying whether it is a non-zero coefficient or zero run length is provided for each non-zero coefficient and zero run length. An intermediate code generation unit that generates an intermediate code by adding the non-zero coefficient or zero run length of the intermediate code, and one non-zero coefficient and one zero run length based on the identifier, respectively It is input to process variable length coding, the image coding device having a plurality of encoding unit consisting of the predetermined number and above same number is provided.
かかる構成により、直交変換部が、画像データを直交変換し直交変換係数を生成し、量子化部が、直交変換係数を量子化し量子化係数を生成する。また、係数検出部が、量子化係数の値がゼロ(0)であるゼロ係数の連続数を示すゼロランレングスと、ゼロ係数の後に続く、量子化係数の値がゼロでない非ゼロ係数とを検出し、中間コード生成部が、順次検出された非ゼロ係数又はゼロランレングスを2以上の所定数毎に順次組み合わせると共に、非ゼロ係数及びゼロランレングスのいずれであるかを識別する識別子を非ゼロ係数及びゼロランレングス毎に付与して中間コードを生成する。また、上記所定数と同一数以上からなる複数の符号化部が、中間コードの非ゼロ係数又はゼロランレングスと、識別子に基づいて、それぞれ1つの非ゼロ係数と1つのゼロランレングスが入力されて可変長符号化処理する。 With this configuration, the orthogonal transform unit orthogonally transforms the image data to generate an orthogonal transform coefficient, and the quantization unit quantizes the orthogonal transform coefficient to generate a quantized coefficient. In addition, the coefficient detection unit calculates a zero run length indicating the number of consecutive zero coefficients whose quantization coefficient value is zero (0), and a non-zero coefficient whose quantization coefficient value is not zero following the zero coefficient. And the intermediate code generator sequentially combines the sequentially detected non-zero coefficients or zero run lengths every two or more predetermined numbers, and identifies an identifier that identifies whether the non-zero coefficient or zero run length is non-zero. An intermediate code is generated for each zero coefficient and zero run length. In addition, a plurality of encoding units having the same number or more as the predetermined number are inputted with one non-zero coefficient and one zero-run length based on the non-zero coefficient or zero run length of the intermediate code and the identifier, respectively. Variable-length encoding processing.
上記量子化部、係数検出部及び中間コード生成部は、並列した複数の系統からなってもよい。かかる構成により、量子化部、係数検出部及び中間コード生成部において、画像データを並行に処理することができる。 The quantization unit, the coefficient detection unit, and the intermediate code generation unit may include a plurality of systems in parallel. With this configuration, image data can be processed in parallel in the quantization unit, the coefficient detection unit, and the intermediate code generation unit.
また、上記課題を解決するために、本発明の別の観点によれば、直交変換部が、画像データを直交変換し直交変換係数を生成するステップと、量子化部が、直交変換係数を量子化し量子化係数を生成するステップと、係数検出部が、量子化係数の値がゼロ(0)であるゼロ係数の連続数を示すゼロランレングスと、ゼロ係数の後に続く、量子化係数の値がゼロでない非ゼロ係数とを検出するステップと、中間コード生成部が、順次検出された非ゼロ係数又はゼロランレングスを2以上の所定数毎に順次組み合わせると共に、非ゼロ係数及びゼロランレングスのいずれであるかを識別する識別子を非ゼロ係数及びゼロランレングス毎に付与して中間コードを生成するステップと、上記所定数と同一数以上からなる複数の符号化部が、中間コードの非ゼロ係数又はゼロランレングスと、識別子に基づいて、それぞれ1つの非ゼロ係数と1つのゼロランレングスが入力されて可変長符号化処理するステップとを有する画像符号化方法が提供される。 In order to solve the above problem, according to another aspect of the present invention, an orthogonal transform unit orthogonally transforms image data to generate an orthogonal transform coefficient, and a quantization unit quantizes the orthogonal transform coefficient. And generating a quantized coefficient, and a coefficient detecting unit, a zero run length indicating a continuous number of zero coefficients whose quantized coefficient value is zero (0), and a quantized coefficient value following the zero coefficient Detecting a non-zero coefficient that is not zero, and an intermediate code generator sequentially combines the detected non-zero coefficient or zero run length every two or more predetermined numbers, and the non-zero coefficient and zero run length of A step of generating an intermediate code by assigning an identifier for identifying each for each non-zero coefficient and zero run length, and a plurality of encoding units having the same number or more as the predetermined number, And a non-zero coefficient or zero run length, based on the identifier, the image coding method and a step of processing variable-length coding are each one nonzero coefficient and one zero run length of the input is provided.
かかる構成により、画像データが直交変換されて直交変換係数が生成され、直交変換係数が量子化されて量子化係数を生成される。そして、量子化係数の値がゼロ(0)であるゼロ係数の連続数を示すゼロランレングスと、ゼロ係数の後に続く、量子化係数の値がゼロでない非ゼロ係数とを検出され、順次検出された非ゼロ係数又はゼロランレングスが2以上の所定数毎に順次組み合わされると共に、非ゼロ係数及びゼロランレングスのいずれであるかを識別する識別子が非ゼロ係数及びゼロランレングス毎に付与されて中間コードが生成される。その後、上記所定数と同一数以上からなる複数の符号化部で、中間コードの非ゼロ係数又はゼロランレングスと、識別子に基づいて、それぞれ1つの非ゼロ係数と1つのゼロランレングスが入力されて可変長符号化処理が行われる。 With this configuration, image data is orthogonally transformed to generate orthogonal transform coefficients, and the orthogonal transform coefficients are quantized to generate quantized coefficients. Then, a zero run length indicating the number of consecutive zero coefficients whose quantization coefficient value is zero (0) and a non-zero coefficient whose quantization coefficient value is not zero following the zero coefficient are detected and sequentially detected. Non-zero coefficients or zero run lengths are sequentially combined every two or more predetermined numbers, and an identifier identifying whether the non-zero coefficient or zero run length is given to each non-zero coefficient or zero run length. Intermediate code is generated. Thereafter, one non-zero coefficient and one zero-run length are respectively input based on the non-zero coefficient or zero run length of the intermediate code and the identifier in a plurality of encoding units having the same number or more as the predetermined number. Thus, the variable length encoding process is performed.
本発明によれば、可変長符号化において実質的な処理速度を向上させることができる。 According to the present invention, a substantial processing speed can be improved in variable length coding.
以下に添付図面を参照しながら、本発明の好適な実施の形態について詳細に説明する。なお、本明細書及び図面において、実質的に同一の機能構成を有する構成要素については、同一の符号を付することにより重複説明を省略する。 Exemplary embodiments of the present invention will be described below in detail with reference to the accompanying drawings. In addition, in this specification and drawing, about the component which has the substantially same function structure, duplication description is abbreviate | omitted by attaching | subjecting the same code | symbol.
(第1の実施形態)
[第1の実施形態の構成]
まず、本発明の第1の実施形態に係る画像符号化装置100について説明する。図1は、本実施形態に係る画像符号化装置100の構成を示すブロック図である。画像符号化装置100は、例えば、2次元DCT部101と、第1バッファ102と、ジグザグスキャン部103と、量子化部104と、中間コード生成部105と、第2バッファ106と、可変長符号化部107などからなる。
(First embodiment)
[Configuration of First Embodiment]
First, the image coding apparatus 100 according to the first embodiment of the present invention will be described. FIG. 1 is a block diagram illustrating a configuration of an image encoding device 100 according to the present embodiment. The image encoding device 100 includes, for example, a two-
2次元DCT部101は、入力された画像データをDCT変換(離散コサイン変換:Discrete Cosine Transform)(直交変換)し、DCT係数を生成する。ここで、入力される画像データとは、例えば撮像素子から出力された画像信号を8×8画素のブロックに分割してブロック化処理したデータである。2次元DCT部101が画像データをDCT変換することによって、8×8画素のブロック毎に8×8のDCT係数ブロックが生成される。
第1バッファ102は、2次元DCT部101で生成されたDCT係数のデータをDCT係数ブロック単位で格納する。
The two-
The
ジグザグスキャン部103は、第1バッファ102からDCT係数を読み出して、読み出したDCT係数を量子化部104に送る。ジグザグスキャン部103は、第1バッファ102からDCT係数のデータを読み出す際、DCT係数ブロック毎にジグザグスキャンをする。図2は、8×8のDCT係数ブロックを示しており、DCT係数ブロックにおけるジグザグスキャンを示す説明図である。DCT係数ブロックでは、2次元DCT部101で生成されたDCT係数が、図2に示す0→63の順番で配置されている。ジグザグスキャン部103は、図2の矢印に示すように、DCT係数ブロックの低周波数領域を優先してDCT係数を読み出して、次第に高周波領域となるようにDCT係数を読み出していく。
The
量子化部104は、ジグザグスキャン部103でジグザグスキャンによって読み出されたDCT係数を、所定の量子化値で量子化する。量子化部104は、量子化されたDCT係数を中間コード生成部105に送る。このとき、量子化されたDCT係数は、量子化部104で出力された後、バッファ等に一時的に格納されることなく、直接中間コード生成部105に送られる。
The
中間コード生成部105は、量子化されたDCT係数に基づいて、中間コードを生成する。中間コードは、DCT係数の非ゼロ係数、ゼロランレングス及びそれぞれの識別子(ID)からなる。中間コード生成部105は、生成した中間コードを第2バッファ106に送る。
第2バッファ106は、中間コード生成部105で生成された中間コードを格納する。
The intermediate
The
可変長符号化部107は、第2バッファ106から中間コードを読み出して、中間コードの非ゼロ係数、ゼロランレングスを示すIDに基づいて、非ゼロ係数、ゼロランレングスを判別する。そして、可変長符号化部107は、非ゼロ係数、ゼロランレングスに基づいてハフマン符号を生成し、生成したハフマン符号を出力する。本実施形態の可変長符号化部107は、後述するとおり、1セット(中間コードセット)に含まれる中間コードの数に対応して、複数の符号部を有する。例えば、1セットに含まれる中間コードが2組である場合は、可変長符号化部107の符号部は2つからなる。
The variable
[中間コードの生成]
次に、本実施形態に係る中間コードの生成について説明する。
中間コードは、量子化されたDCT係数に基づいて生成される。量子化されたDCT係数は、ゼロ(0)とゼロではない値からなる。そこで、中間コード生成部105は、係数検出部の一例であり、まず、DCT係数について、値がゼロでない係数である非ゼロ係数と、値がゼロである係数(ゼロ係数)を判別する。そして、中間コード生成部105は、DCT係数が非ゼロ係数であると判別したときは、その値を出力する。また、中間コード生成部105は、出力値が非ゼロ係数であることを示す識別子(ID)を出力する。本実施形態では、非ゼロ係数であることを示すIDは、「1」とした。中間コード生成部105は、非ゼロ係数の値とIDを組み合わせて1組の中間コードを生成する。IDは、中間コードのMSB(最上位ビット:most significant bit)に付加される。
[Generate intermediate code]
Next, the generation of the intermediate code according to the present embodiment will be described.
The intermediate code is generated based on the quantized DCT coefficient. The quantized DCT coefficient consists of zero (0) and a non-zero value. Therefore, the intermediate
一方、中間コード生成部105は、DCT係数がゼロ係数であると判別したときは、非ゼロ係数の後に連続するゼロ係数の数を、次に非ゼロ係数が判別されるまで数え上げる。そして、中間コード生成部105は、数え上げたゼロ係数の数をゼロランレングスとして出力する。また、中間コード生成部105は、出力値がゼロランレングスであることを示す識別子(ID)を出力する。本実施形態では、ゼロランレングスであることを示すIDは、「0」とした。中間コード生成部105は、ゼロランレングスの値とIDを組み合わせて1組の中間コードを生成する。IDは、中間コードのMSB(最上位ビット:most significant bit)に付加される。
On the other hand, when the intermediate
[中間コードの配置]
次に、図3を参照して、第2バッファ106に格納される中間コードの配置について説明する。図3は、本実施形態の第2バッファ106に格納される中間コードの配置を示す説明図である。
[Placement of intermediate code]
Next, the arrangement of intermediate codes stored in the
第2バッファ106は、時系列で連続する複数の中間コードを、時間的に先行するものを下位に配置し、時間的に後行するものを上位に配置して格納する。本実施形態では、2組の中間コードを1セット(中間コードセット)とする。図3上では、1セットを1行で表した。図3における「係数データ」とは、非ゼロ係数の値を示し、「ゼロランレングス」とは、ゼロランレングスの値を示す。本実施形態では、中間コードの非ゼロ係数の値又はゼロランレングスの値は、11bitで表す。また、IDは、1bitで表す。従って、本実施形態では、1組の中間コードは12bitで表され、2組の中間コードを合わせた1つの中間コードセットは、24bitで表される。よって、1つのDCT係数ブロックは64のDCT係数からなるため、中間コードのバッファ容量は最大でも768bit(=12bit×64)でよい。
The
一方、特許文献1では、ゼロランレングスと非ゼロ係数を組み合わせて生成する1つの係数は、ゼロランレングスを表す4bitと非ゼロ係数を表す11bitを合わせた15bitで表される。従って、係数のバッファ容量は最大960bit(=15bit×64)となる。よって、本実施形態の中間コードのバッファ容量は特許文献1に比べて少ない容量でよい。
On the other hand, in
図4を用いて、中間コード生成部105で生成される中間コードの一例を説明する。図4は、時系列順に配置された量子化後のDCT係数(A)と、量子化後のDCT係数から生成した中間コード(B)を示す説明図である。
An example of the intermediate code generated by the intermediate
中間コードは、図4(B)に示すように、中間コードの値(非ゼロ係数の値又はゼロランレングスの値)と、IDからなる。図4(B)ではゼロランレングス値を網掛けで示した。中間コードの値は、中間コードのMSBに付加されたIDによって、非ゼロ係数の値であるか、ゼロランレングスの値であるか識別することができる。 As shown in FIG. 4B, the intermediate code includes an intermediate code value (a non-zero coefficient value or a zero run length value) and an ID. In FIG. 4B, the zero run length value is shown by shading. The intermediate code value can be identified as a non-zero coefficient value or a zero run length value by the ID added to the MSB of the intermediate code.
[中間コードの読出し]
次に、図5を参照して、可変長符号化部107による第2バッファ106からの中間コードの読み出しについて説明する。図5は、第2バッファ106と、第2バッファ106から中間コードを読み出す可変長符号化部107を示すブロック図である。
[Read intermediate code]
Next, reading of the intermediate code from the
可変長符号化部107は、図5に示すように、分離部110を有する。分離部110は、第2バッファ106に格納された中間コードセットから、上位に配置された中間コード(上位コード)と、下位に配置された中間コード(下位コード)を分離する。また、分離部110は、遅延部(DFF:D型フリップフロップ)111を有する。遅延部111は、1つ先行する中間コードセットのうち上位コードが入力され、入力された上位コードを1クロック遅延して出力する。これにより、遅延した上位コードがゼロランレングスであったとき、遅延した上位コードと下位コードで符号化することができる。以上より、分離部110は、上位コード、下位コード及び1クロック遅延した上位コードを同時に出力する。
The variable
[可変長符号化部107による符号化]
次に、図6を参照して、可変長符号化部107による符号化について説明する。図6は、本実施形態の可変長符号化部107を示すブロック図である。第2バッファ106に入力された中間コードセットのうち、下位コードをC0、そのIDをID0とし、上位コードをC1、そのIDをID1とする。また、1クロック遅延した上位コードは、末尾に_dを付け、例えばC1_d、そのIDをID1_dと表わす。
[Encoding by variable length encoding unit 107]
Next, the encoding by the variable
可変長符号化部107は、図6に示すように、セレクタ121,122と、第1符号部131と、第2符号部132と、連結部141を有する。1セット(中間コードセット)に含まれる中間コードが2組である場合、可変長符号化部107は、可変長符号化部107の符号部は2つからなることから、可変長符号化部107は、第1符号部131と第2符号部132を有する。
As shown in FIG. 6, the variable
第1符号部131、第2符号部132の入力における「A」は、非ゼロ係数の入力を示し、「Z」はゼロランレングスの入力を示す。第1符号部131、第2符号部132は、非ゼロ係数とゼロランレングスに基づき、例えば2次元ハフマンテーブルを参照してハフマン符号を出力する。第1符号部131、第2符号部132におけるハフマン符号化は、係数がゼロ(ゼロ係数)であるときのゼロの数(ゼロランレングス)と、ゼロ係数の後に続くゼロでない非ゼロ係数との組み合わせを、発生頻度の高い順にコード長の短いコードを割り当てる。これにより、効率的な符号化を行うことができる。
“A” at the input of the
第1符号部131は、中間コードに含まれるIDの組み合わせに基づいて、前段のセレクタ121,122で切り替えて、入力A及び入力Zの入力処理を行う。
Based on the combination of IDs included in the intermediate code, the
図6に示すように、第1符号部131の入力Aに入力される非ゼロ係数は、上位コードC1又は下位コードC0である。第1符号部131の入力Zに入力されるゼロランレングスは、値が0、下位コードC0又は1クロック前の上位コードC1_dである。第2符号部132の入力Aに入力される非ゼロ係数は、上位コードC1である。第2符号部132の入力Zに入力されるゼロランレングスは、値が0である。第2符号部132は、中間コードセットの上位コードC1、下位コードC0両方が非ゼロ係数であるときのみ動作し、ハフマン符号を出力する。
As shown in FIG. 6, the non-zero coefficient input to the input A of the
第1符号部131と第2符号部132の入力Aは、非ゼロ係数である。2組の中間コードからなる中間コードセットのうち、下位コードC0に非ゼロ係数があるときは、下位コードC0の非ゼロ係数が第1符号部131の入力Aに入力される。下位コードC0に非ゼロ係数があり、上位コードC1にも非ゼロ係数があるときは、下位コードC0の非ゼロ係数が第1符号部131の入力Aに入力され、上位コードC1の非ゼロ係数が第2符号部132の入力Aに入力される。下位コードC0にゼロランレングスがあり、上位コードC1に非ゼロ係数があるときは、上位コードC1の非ゼロ係数が第1符号部131の入力Aに入力される。
The input A of the
第1符号部131の入力Zは、ゼロランレングスであり、第1符号部131の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。例えば、第1符号部131の入力Aが下位コードC0の非ゼロ係数であり、下位コードC0の直前の1クロック遅延した上位コードC1_dにゼロランレングスがあるときは、C1_dのゼロランレングスが第1符号部131の入力Zに入力される。また、第1符号部131の入力Aが下位コードC0の非ゼロ係数であり、下位コードC0の直前の1クロック遅延した上位コードC1_dに非ゼロ係数があるときは、入力Aに入力される非ゼロ係数の直前のゼロランレングスは、0である。従って、ゼロランレングス値=0が第1符号部131の入力Zに入力される。また、第1符号部131の入力Aが上位コードC1の非ゼロ係数であるときは、下位コードC0のゼロランレングスが第1符号部131の入力Zに入力される。
The input Z of the
第2符号部132の入力Zは、ゼロランレングスであり、第2符号部132の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。第2符号部132の入力A,Zに入力が行われるときは、中間コードセットの上位コードC1、下位コードC0両方が非ゼロ係数であるときである。従って、第2符号部132の入力Aに入力される非ゼロ係数の直前のゼロランレングスは、0であるから、ゼロランレングス値=0が第2符号部132の入力Zに入力される。
The input Z of the
セレクタ121,122における入力の切り替えは、中間コードに含まれるIDに基づいて行われる。セレクタ121,122は、中間コードセットが入力されると、中間コードセットに含まれる上位コードのIDであるID1、下位コードのIDであるID0、1クロック前の上位コードのIDであるID1_dの組み合わせによって、入力A及び入力Zの入力を切り替える。IDの組合せと、入力される中間コードの種類の関係を図7に示す。図7は、IDの組合せと、入力される中間コードの種類の関係を示す表である。
The input switching in the
例えば、組合せが(ID1,ID0,ID1_d)=(0,1,0)であれば、上位コードC1がゼロランレングス、下位コードC0が非ゼロ係数、1クロック前の上位コードC1_dがゼロランレングスである。図4に示す例では、例えば、係数が0→0→0→0→6→0→0→0の部分であり(図4(A))、中間コードは1クロック前の上位コードC1_dが4、下位コードC0が6、上位コードC1が3である(図4(B))。このとき、図7によれば、第1符号部131には、入力Aとして下位コードC0が入力され、入力Zとして1クロック前の上位コードC1_dが入力される。第2符号部132は使用しない。
For example, if the combination is (ID1, ID0, ID1_d) = (0, 1, 0), the upper code C1 has a zero run length, the lower code C0 has a non-zero coefficient, and the upper code C1_d before one clock has a zero run length. It is. In the example shown in FIG. 4, for example, the coefficient is a part of 0 → 0 → 0 → 0 → 6 → 0 → 0 → 0 (FIG. 4A), and the intermediate code has 4 upper codes C1_d before one clock. The lower code C0 is 6 and the upper code C1 is 3 (FIG. 4B). At this time, according to FIG. 7, the lower code C0 is input as the input A to the
例えば、組合せが(ID1,ID0,ID1_d)=(1,0,1)であれば、上位コードC1が非ゼロ係数、下位コードC0がゼロランレングス、1クロック前の上位コードC1_dが非ゼロ係数である。図4に示す例では、例えば、係数が2→0→1の部分であり(図4(A))、中間コードは1クロック前の上位コードC1_dが2、下位コードC0が1、上位コードC1が1である(図4(B))。このとき、図7によれば、第1符号部131には、入力Aとして上位コードC1が入力され、入力Zとして下位コードC0が入力される。第2符号部132は使用しない。
For example, if the combination is (ID1, ID0, ID1_d) = (1, 0, 1), the upper code C1 is a non-zero coefficient, the lower code C0 is a zero run length, and the upper code C1_d before one clock is a non-zero coefficient. It is. In the example shown in FIG. 4, for example, the coefficient is a part of 2 → 0 → 1 (FIG. 4 (A)), and the intermediate code is 2 for the upper code C1_d, 1 for the lower code C0, and 1 for the upper code C1. Is 1 (FIG. 4B). At this time, according to FIG. 7, the
また、例えば、組合せが(ID1,ID0,ID1_d)=(1,1,1)であれば、上位コードC1が非ゼロ係数、下位コードC0が非ゼロ係数、1クロック前の上位コードC1_dが非ゼロ係数である。図4に示す例では、例えば、係数が1→1→2の部分であり(図4(A))、中間コードは1クロック前の上位コードC1_dが1、下位コードC0が1、上位コードC1が2である(図4(B))。このとき、図7によれば、第1符号部131には、入力Aとして下位コードC0が入力され、入力Zとして値0が入力される。第2符号部132には、入力Aとして上位コードC1が入力され、入力Zとして値0が入力される。
For example, if the combination is (ID1, ID0, ID1_d) = (1, 1, 1), the upper code C1 is a non-zero coefficient, the lower code C0 is a non-zero coefficient, and the upper code C1_d before one clock is not Zero coefficient. In the example shown in FIG. 4, for example, the coefficient is a part of 1 → 1 → 2 (FIG. 4A), and the intermediate code is 1 for the upper code C1_d, 1 for the lower code C0, and 1 for the upper code C1. Is 2 (FIG. 4B). At this time, according to FIG. 7, the lower code C0 is input as the input A and the
なお、図7にない組み合わせは、出現することがない組み合わせである。例えば、1クロック前の上位コードがゼロランレングス(IDが0)の場合、下位コードはゼロランレングスになることはなく、下位コードのIDが0になることはない。中間コードがゼロランレングスの後は必ず非ゼロ係数の中間コードとなるためである。 Note that combinations not shown in FIG. 7 are combinations that do not appear. For example, when the upper code one clock before is zero run length (ID is 0), the lower code is never zero run length, and the lower code ID is never 0. This is because the intermediate code always becomes an intermediate code having a non-zero coefficient after the zero run length.
連結部141は、第1符号部131、第2符号部132から出力されたハフマン符号をビット単位での結合を行う。例えば、第1符号部131から出力されるハフマン符号が11bitであり、第2符号部132から出力されるハフマン符号が5bitであるときは、連結部141は、16bitの結合したハフマン符号を出力する。
The
本実施形態によれば、可変長符号化の前段で、DCT係数の非ゼロ係数、ゼロランレングス及びそれぞれの識別子(ID)からなる中間コードを生成する。そして、可変長符号化部107において、符号部が複数設けられることで、符号化に要する処理時間を短縮することができる。例えば、中間コードを2つ組み合わせて1組の中間コードセットとし、符号部を2つ設けることによって、符号化に要する処理クロック数を1/2以下に抑えることができる。
According to the present embodiment, an intermediate code including non-zero coefficients of DCT coefficients, zero run lengths, and respective identifiers (IDs) is generated before the variable length coding. The variable
更に、上述した特許文献1の技術では、画像データを量子化した後の係数を一旦バッファに格納した後、ジグザグスキャン(zigzag scan)をして、ゼロランレングスと非ゼロ係数を組み合わせて1つの係数を生成している。しかし、この処理の順序では、ジグザグスキャン後に量子化を行う場合に比べて、反対に処理クロック数が増加してしまうという問題があった。一方、本実施形態によれば、ジグザグスキャン後に量子化しているため、特許文献1のように処理クロック数が増加するという問題がない。
Furthermore, in the technique of
[第1の実施形態の第1変更例]
次に、本発明の第1の実施形態に係る画像符号化装置100の第1変更例について説明する。
上述した画像符号化装置100では、2組の中間コードを1つの中間コードセットとする場合について説明したが、本発明はかかる例に限定されない。例えば3組の中間コードを1つの中間コードセットとする等、3組以上の中間コードを1セットとしてもよい。
[First Modification of First Embodiment]
Next, a first modification of the image encoding device 100 according to the first embodiment of the present invention will be described.
In the image coding apparatus 100 described above, the case where two sets of intermediate codes are used as one intermediate code set has been described, but the present invention is not limited to such an example. For example, three sets of intermediate codes may be set as one set, such as three sets of intermediate codes as one intermediate code set.
まず、3組の中間コードを1つの中間コードセットとする場合について説明する。この場合、可変長符号化部107は、図8に示すように、3つの符号部、即ち第1符号部231、第2符号部232、第3符号部233を有する。図8は、本実施形態の可変長符号化部107の変更例を示すブロック図である。
First, a case where three sets of intermediate codes are used as one intermediate code set will be described. In this case, the variable
まず、中間コード生成部105は、非ゼロ係数とゼロランレングスに基づいて、非ゼロ係数の値又はゼロランレングスの値と、IDからなる中間コードを生成する。生成された中間コードは、第2バッファ106を介して、可変長符号化部107に送られる。本変更例では、3組の中間コードを1セット(中間コードセット)とする。
First, the intermediate
次に、可変長符号化部107による符号化について説明する。第2バッファ106に入力された3組の中間コードからなる中間コードセットのうち、下位側の中間コードから、C0、C1、C2とし、それぞれのIDをID0、ID1、ID2とする。また、1クロック遅延した最上位コードは、末尾に_dを付け、例えばC2_d、そのIDをID2_dと表わす。
Next, encoding by the variable
可変長符号化部107は、図8に示すように、セレクタ221,222,223,224、第1符号部231、第2符号部232、第3符号部233、連結部241を有する。1セット(中間コードセット)に含まれる中間コードが3組である場合、可変長符号化部107は、可変長符号化部107の符号部は3つからなることから、可変長符号化部107は、第1符号部231と第2符号部232と第3符号部233を有する。
As shown in FIG. 8, the variable
第1符号部231、第2符号部232、第3符号部233は、非ゼロ係数とゼロランレングスに基づき、例えば2次元ハフマンテーブルを参照してハフマン符号を出力する。第1符号部231、第2符号部232、第3符号部233は、中間コードに含まれるIDの組み合わせに基づいて、前段のセレクタ221,222,223,224で切り替えて、入力A及び入力Zの入力処理を行う。
The
図8に示すように、第1符号部231の入力Aに入力される非ゼロ係数は、中位コードC1又は下位コードC0である。第1符号部231の入力Zに入力されるゼロランレングスは、値が0、下位コードC0又は1クロック前の上位コードC2_dである。第2符号部232の入力Aに入力される非ゼロ係数は、上位コードC2又は中位コードC1である。第2符号部232の入力Zに入力されるゼロランレングスは、値が0又は中位コードC1である。第3符号部233の入力Aに入力される非ゼロ係数は、上位コードC2である。第3符号部233の入力Zに入力されるゼロランレングスは、値が0である。第3符号部233は、中間コードセットの中間コードC2,C1,C0全てが非ゼロ係数であるときのみ動作し、ハフマン符号を出力する。
As shown in FIG. 8, the non-zero coefficient input to the input A of the
第1符号部231、第2符号部232及び第3符号部233の入力Aは、非ゼロ係数である。3組の中間コードからなる中間コードセットのうち、非ゼロ係数は、下位側の非ゼロ係数から上位側の非ゼロ係数の順で、第1符号部231→第2符号部232→第3符号部233の順番で入力Aの入力に割り当てられる。例えば、下位コードC0はゼロランレングスであり、中位コードC1に非ゼロ係数があるときは、中位コードC1の非ゼロ係数が第1符号部231の入力Aに入力される。下位コードC0に非ゼロ係数があり、中位コードC1にも非ゼロ係数があるときは、下位コードC0の非ゼロ係数が第1符号部231の入力Aに入力され、中位コードC1の非ゼロ係数が第2符号部232の入力Aに入力される。中間コードC2,C1,C0全てが非ゼロ係数であるときは、下位側の中間コードの非ゼロ係数から順に、第1符号部231の入力Aに入力され、中位コードC1の非ゼロ係数が第2符号部232の入力Aに入力され、上位コードC2の非ゼロ係数が第3符号部233の入力Aに入力される。
The input A of the
第1符号部231の入力Zは、ゼロランレングスであり、第1符号部231の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。例えば、第1符号部231の入力Aが下位コードC0の非ゼロ係数であり、下位コードC0の直前の1クロック遅延した上位コードC2_dにゼロランレングスがあるときは、C2_dのゼロランレングスが第1符号部231の入力Zに入力される。また、第1符号部231の入力Aが下位コードC0の非ゼロ係数であり、下位コードC0の直前の1クロック遅延した上位コードC2_dに非ゼロ係数があるときは、入力Aに入力される非ゼロ係数の直前のゼロランレングスは、0である。従って、ゼロランレングス値=0が第1符号部231の入力Zに入力される。また、第1符号部231の入力Aが中位コードC1の非ゼロ係数であるときは、下位コードC0のゼロランレングスが第1符号部231の入力Zに入力される。
The input Z of the
第2符号部232の入力Zは、ゼロランレングスであり、第2符号部232の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。例えば、第2符号部232の入力Aが上位コードC2の非ゼロ係数であり、上位コードC2の直前の中位コードC1に非ゼロ係数があるときは、入力Aに入力される非ゼロ係数の直前のゼロランレングスは、0である。従って、ゼロランレングス値=0が第2符号部232の入力Zに入力される。また、第2符号部232の入力Aが中位コードC1の非ゼロ係数であるときは、ゼロランレングス値=0が第2符号部232の入力Zに入力される。
The input Z of the
第3符号部233の入力Zは、ゼロランレングスであり、第3符号部233の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。第3符号部233の入力A,Zに入力が行われるときは、中間コードセットの上位コードC2、中位コードC1、下位コードC0全てが非ゼロ係数であるときである。従って、第3符号部233の入力Aに入力される非ゼロ係数の直前のゼロランレングスは、0であるから、ゼロランレングス値=0が第3符号部233の入力Zに入力される。
The input Z of the
セレクタ221,222,223,224における入力の切り替えは、中間コードに含まれるIDに基づいて行われる。セレクタ221,222,223,224は、中間コードセットが入力されると、中間コードセットに含まれる上位コードのIDであるID2、中位コードのIDであるID1、下位コードのIDであるID0、1クロック前の上位コードのIDであるID2_dの組み合わせによって、入力A及び入力Zの入力を切り替える。IDの組合せと、入力される中間コードの種類の関係を図9に示す。図9は、IDの組合せと、入力される中間コードの種類の関係を示す表である。
The input switching in the
例えば、組合せが(ID2,ID1,ID0,ID2_d)=(0,1,1,0)であれば、上位コードC2がゼロランレングス、中位コードC1が非ゼロ係数、下位コードC0が非ゼロ係数、1クロック前の上位コードC2_dがゼロランレングスである。このとき、図9によれば、第1符号部231には、入力Aとして下位コードC0が入力され、入力Zとして1クロック前の上位コードC2_dが入力される。第2符号部232には、入力Aとして下位コードC1が入力され、入力Zとして値0が入力される。第3符号部233は使用しない。
For example, if the combination is (ID2, ID1, ID0, ID2_d) = (0, 1, 1, 0), the upper code C2 is a zero run length, the middle code C1 is a nonzero coefficient, and the lower code C0 is nonzero. The upper code C2_d one coefficient before the coefficient is zero run length. At this time, according to FIG. 9, the
また、例えば、組合せが(ID2,ID1,ID0,ID1_d)=(1,0,1,0)であれば、上位コードC2が非ゼロ係数、中位コードC1がゼロランレングス、下位コードC0が非ゼロ係数、1クロック前の上位コードC2_dがゼロランレングスである。このとき、図9によれば、第1符号部231には、入力Aとして下位コードC0が入力され、入力Zとして1クロック前の上位コードC2_dが入力される。第2符号部232には、入力Aとして上位コードC2が入力され、入力Zとして中位コードC1が入力される。第3符号部233は使用しない。
Also, for example, if the combination is (ID2, ID1, ID0, ID1_d) = (1, 0, 1, 0), the upper code C2 is a non-zero coefficient, the middle code C1 is zero run length, and the lower code C0 is The non-zero coefficient, the upper code C2_d one clock before is the zero run length. At this time, according to FIG. 9, the
例えば、組合せが(ID2,ID1,ID0,ID1_d)=(1,1,0,1)であれば、上位コードC2が非ゼロ係数、中位コードC1が非ゼロ係数、下位コードC0がゼロランレングス、1クロック前の上位コードC2_dが非ゼロ係数である。このとき、図9によれば、第1符号部231には、入力Aとして中位コードC1が入力され、入力Zとして下位コードC0が入力される。第2符号部232には、入力Aとして上位コードC2が入力され、入力Zとして下位コードC0が入力される。第3符号部233は使用しない。
For example, if the combination is (ID2, ID1, ID0, ID1_d) = (1, 1, 0, 1), the upper code C2 is a non-zero coefficient, the middle code C1 is a non-zero coefficient, and the lower code C0 is a zero run. The upper code C2_d with a length of one clock is a non-zero coefficient. At this time, according to FIG. 9, the middle code C <b> 1 is input as the input A and the lower code C <b> 0 is input as the input Z to the
連結部241は、第1符号部231、第2符号部232、第3符号部233から出力されたハフマン符号をビット単位での結合を行う。例えば、第1符号部231から出力されるハフマン符号が11bitであり、第2符号部232から出力されるハフマン符号が5bitであり、第3符号部233からハフマン符号が出力されないときは、連結部241は、16bitの結合したハフマン符号を出力する。
The concatenating
本変更例によれば、可変長符号化の前段で、DCT係数の非ゼロ係数、ゼロランレングス及びそれぞれの識別子(ID)からなる中間コードを生成する。そして、中間コードを3つ組み合わせて1組の中間コードセットとし、符号部を3つ設けることによって、符号化に要する処理クロック数を1/3以下に抑えることができる。 According to this modification, an intermediate code including a non-zero coefficient of a DCT coefficient, a zero run length, and each identifier (ID) is generated before the variable length coding. Then, by combining three intermediate codes to form one intermediate code set and providing three encoding units, the number of processing clocks required for encoding can be suppressed to 1/3 or less.
[第1の実施形態の第2変更例]
4組以上の中間コードを含む1つの中間コードセットの場合も、上述した2組又は3組の中間コードを含む中間コードセットの場合と同様に処理できる。例えば、4組の中間コードを1つの中間コードセットとする場合、可変長符号化部107は、図10に示すように、4つの符号部、即ち第1符号部331、第2符号部332、第3符号部333、第4符号部334を有する。図10は、符号化を行う可変長符号化部107の変更例を示すブロック図である。
[Second Modification of First Embodiment]
The case of one intermediate code set including four or more sets of intermediate codes can be processed in the same manner as the case of the intermediate code set including two or three sets of intermediate codes described above. For example, when four sets of intermediate codes are used as one intermediate code set, the variable-
まず、中間コード生成部105は、非ゼロ係数とゼロランレングスに基づいて、非ゼロ係数の値又はゼロランレングスの値と、IDからなる中間コードを生成する。生成された中間コードは、第2バッファ106を介して、可変長符号化部107に送られる。本変更例では、4組の中間コードを1セット(中間コードセット)とする。
First, the intermediate
次に、可変長符号化部107による符号化について説明する。第2バッファ106に入力された4組の中間コードからなる中間コードセットのうち、下位側の中間コードから、C0、C1、C2、C3とし、それぞれのIDをID0、ID1、ID2、ID3とする。また、1クロック遅延した最上位コードは、末尾に_dを付け、例えばC3_d、そのIDをID3_dと表わす。
Next, encoding by the variable
可変長符号化部107は、図10に示すように、セレクタ321,322,323,324,325,326、第1符号部331、第2符号部332、第3符号部333、第4符号部334、連結部341を有する。1セット(中間コードセット)に含まれる中間コードが4組である場合、可変長符号化部107は、可変長符号化部107の符号部は4つからなることから、可変長符号化部107は、第1符号部331と第2符号部332と第3符号部333と第4符号部334を有する。
As shown in FIG. 10, the variable
第1符号部331、第2符号部332、第3符号部333、第4符号部334は、非ゼロ係数とゼロランレングスに基づき、例えば2次元ハフマンテーブルを参照してハフマン符号を出力する。第1符号部331、第2符号部332、第3符号部333、第4符号部334は、中間コードに含まれるIDの組み合わせに基づいて、前段のセレクタ321,322,323,324,325,326で切り替えて、入力A及び入力Zの入力処理を行う。
The
図10に示すように、第1符号部331の入力Aに入力される非ゼロ係数は、中間コードC1又はC0である。第1符号部331の入力Zに入力されるゼロランレングスは、値が0、中間コードC0又はC3_dである。第2符号部332の入力Aに入力される非ゼロ係数は、中間コードC3、C2又はコードC1である。第2符号部332の入力Zに入力されるゼロランレングスは、値が0、中間コードC2又はC1である。第3符号部333の入力Aに入力される非ゼロ係数は、中間コードC3又はC2である。第3符号部333の入力Zに入力されるゼロランレングスは、値が0又は中間コードC2である。第4符号部334の入力Aに入力される非ゼロ係数は、中間コードC3である。第4符号部334の入力Zに入力されるゼロランレングスは、値が0である。第4符号部334は、中間コードセットの中間コードC3,C2,C1,C0全てが非ゼロ係数であるときのみ動作し、ハフマン符号を出力する。
As shown in FIG. 10, the non-zero coefficient input to the input A of the
第1符号部331、第2符号部332、第3符号部333及び第4符号部334の入力Aは、非ゼロ係数である。4組の中間コードからなる中間コードセットのうち、非ゼロ係数は、下位側の非ゼロ係数から上位側の非ゼロ係数の順で、第1符号部331→第2符号部332→第3符号部333→第4符号部334の順番で入力Aの入力に割り当てられる。
The input A of the
第1符号部331の入力Zは、ゼロランレングスであり、第1符号部331の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。第2符号部332の入力Zは、ゼロランレングスであり、第2符号部332の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。第3符号部333の入力Zは、ゼロランレングスであり、第3符号部333の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。第4符号部334の入力Zは、ゼロランレングスであり、第4符号部334の入力Aに入力される非ゼロ係数の直前のゼロランレングスである。
The input Z of the
セレクタ321,322,323,324,325,326における入力の切り替えは、中間コードに含まれるIDに基づいて行われる。セレクタ321,322,323,324,325,326は、中間コードセットが入力されると、中間コードセットに含まれるID3、ID2、ID1、ID0、ID3_dの組み合わせによって、入力A及び入力Zの入力を切り替える。IDの組合せと、入力される中間コードの種類の関係を図11に示す。図11は、IDの組合せと、入力される中間コードの種類の関係を示す表である。
The input switching in the
例えば、組合せが(ID3,ID2,ID1,ID0,ID2_d)=(1,0,1,1,0)であれば、C3が非ゼロ係数、C2がゼロランレングス、C1が非ゼロ係数、C0が非ゼロ係数、1クロック前のC3_dがゼロランレングスである。このとき、図11に示すように、第1符号部331には、入力AとしてC0が入力され、入力Zとして1クロック前のC3_dが入力される。第2符号部332には、入力AとしてC1が入力され、入力Zとして値0が入力される。第3符号部333には、入力AとしてC3が入力され、入力ZとしてC2が入力される。第4符号部334は使用しない。
For example, if the combination is (ID3, ID2, ID1, ID0, ID2_d) = (1, 0, 1, 1, 0), C3 is a non-zero coefficient, C2 is a zero-run length, C1 is a non-zero coefficient, C0 Is the non-zero coefficient, and C3_d one clock before is the zero run length. At this time, as shown in FIG. 11, C0 is input as the input A and C3_d one clock before is input as the input Z to the
連結部341は、第1符号部331、第2符号部332、第3符号部333、第4符号部334から出力されたハフマン符号をビット単位での結合を行う。例えば、第1符号部331から出力されるハフマン符号が11bitであり、第2符号部332から出力されるハフマン符号が5bitであり、第3符号部333及び第4符号部334からハフマン符号が出力されないときは、連結部341は、16bitの結合したハフマン符号を出力する。
The concatenating
本変更例によれば、可変長符号化の前段で、DCT係数の非ゼロ係数、ゼロランレングス及びそれぞれの識別子(ID)からなる中間コードを生成する。そして、中間コードを4つ組み合わせて1組の中間コードセットとし、符号部を4つ設けることによって、符号化に要する処理クロック数を1/3以下に抑えることができる。 According to this modification, an intermediate code including a non-zero coefficient of a DCT coefficient, a zero run length, and each identifier (ID) is generated before the variable length coding. Then, by combining four intermediate codes into one intermediate code set and providing four encoding units, the number of processing clocks required for encoding can be suppressed to 1/3 or less.
(第2の実施形態)
次に、図12を参照して、本発明の第2の実施形態に係る画像符号化装置200について説明する。図12は、本実施形態に係る画像符号化装置200の構成を示すブロック図である。
(Second Embodiment)
Next, an image encoding device 200 according to the second embodiment of the present invention will be described with reference to FIG. FIG. 12 is a block diagram illustrating a configuration of the image encoding device 200 according to the present embodiment.
画像符号化装置200は、例えば、2次元DCT部401と、第1バッファ402−1,402−2と、ジグザグスキャン部403−1,403−2と、量子化部404−1,404−2と、中間コード生成部405−1,405−2と、第2バッファ406−1,406−2と、可変長符号化部407などからなる。
The image coding apparatus 200 includes, for example, a two-
本実施形態の画像符号化装置200は、第1の実施形態の画像符号化装置100と異なり、第1バッファ402−1,402−2から、第2バッファ406−1,406−2までの各機能ブロックが並列して2系統で構成される。第1バッファ402−1,402−2と、ジグザグスキャン部403−1,403−2と、量子化部404−1,404−2と、中間コード生成部405−1,405−2と、第2バッファ406−1,406−2の構成及び作用は、第1の実施形態の第1バッファ102と、ジグザグスキャン部103と、量子化部104と、中間コード生成部105と、第2バッファ106と同様であるため、詳細な説明は省略する。
Unlike the image encoding device 100 according to the first embodiment, the image encoding device 200 according to the present embodiment includes each of the first buffers 402-1 and 402-2 to the second buffers 406-1 and 406-2. Functional blocks are composed of two systems in parallel. First buffers 402-1 and 402-2, zigzag scanning units 403-1 and 403-2, quantization units 404-1 and 404-2, intermediate code generation units 405-1 and 405-2, The configurations and operations of the two buffers 406-1 and 406-2 are the same as the
2次元DCT部401は、画像データをDCT変換して、8×8画素のブロック毎に8×8のDCT係数ブロックを生成する。2次元DCT部401は、生成したDCT係数ブロックを交互に第1バッファ402−1と第1バッファ402−2に出力する。図13は、本実施形態の画像符号化装置200の動作を示すタイミングチャートである。図13における「BLK」とはブロックの略である。
The two-
2次元DCT部401は、第1の実施形態の2次元DCT部101に比べて、例えば2倍速で行う。例えば2次元DCT部401は、1つのDCT係数ブロックを32クロック以内で処理する。
The two-
第1バッファ402−1,402−2から、第2バッファ406−1,406−2までの各機能ブロックが並列して2系統で構成されることで、ジグザグスキャンから中間コード生成までの処理について、実質1DCT係数ブロックを32クロック以内で処理できる。 The function blocks from the first buffer 402-1 and 402-2 to the second buffer 406-1 and 406-2 are configured in parallel in two systems, so that processing from zigzag scanning to intermediate code generation is performed. The 1 DCT coefficient block can be processed within 32 clocks.
そして、可変長符号化部407は、中間コードに基づいて、DCT係数をハフマン符号化する。可変長符号化部407は、第1の実施形態の可変長符号化部107と同様に、符号部を複数有するため、符号化に要するクロック数をデータ数の1/2以下に抑えることができる。従って、ジグザグスキャンから中間コード生成までの処理を、実質1DCT係数ブロックを32クロック以内で処理したとしても、可変長符号化部407は、1つのDCT係数ブロックの符号化を終えた後に、次のDCT係数ブロックの符号化を開始することができる。
Then, the variable
よって、第2の実施形態によれば、第1の実施形態のように符号化だけでなく、例えばJPEG全体の符号化を2倍速で行うことができる。図14は、従来の画像符号化装置の動作を示すタイミングチャートである。従来は、可変長符号化の処理クロック数は、2次元DCTの処理クロック数と同じであった。 Therefore, according to the second embodiment, not only encoding as in the first embodiment but also, for example, encoding of the entire JPEG can be performed at double speed. FIG. 14 is a timing chart showing the operation of the conventional image coding apparatus. Conventionally, the number of processing clocks for variable length encoding is the same as the number of processing clocks for two-dimensional DCT.
なお、ジグザグスキャンから中間コード生成までの処理が並列して3系統以上で行われ、その系統数に合わせて、可変長符号化部407が符号部を3つ以上有する場合は、更に、JPEG全体の符号処理を短縮することができる。
If the processes from zigzag scanning to intermediate code generation are performed in three or more systems in parallel, and the variable
以上、添付図面を参照しながら本発明の好適な実施形態について詳細に説明したが、本発明はかかる例に限定されない。本発明の属する技術の分野における通常の知識を有する者であれば、特許請求の範囲に記載された技術的思想の範疇内において、各種の変更例または修正例に想到し得ることは明らかであり、これらについても、当然に本発明の技術的範囲に属するものと了解される。 The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to such examples. It is obvious that a person having ordinary knowledge in the technical field to which the present invention pertains can come up with various changes or modifications within the scope of the technical idea described in the claims. Of course, it is understood that these also belong to the technical scope of the present invention.
100,200 画像符号化装置
101,401 2次元DCT部
102,402−1,402−2 第1バッファ
103,403−1,403−2 ジグザグスキャン部
104,404−1,404−2 量子化部
105,405−1,405−2 中間コード生成部
106,406−1,406−2 第2バッファ
107,407 可変長符号化部
110 分離部
111 遅延部
121,122,221,222,223,224,321,322,323,324,325,326 セレクタ
131,231,331 第1符号部
132,232,332 第2符号部
141,241,341 連結部
233,333 第3符号部
334 第4符号部
100, 200
Claims (3)
前記直交変換係数を量子化し量子化係数を生成する量子化部と、
前記量子化係数の値がゼロ(0)であるゼロ係数の連続数を示すゼロランレングスと、前記ゼロ係数の後に続く、前記量子化係数の値がゼロでない非ゼロ係数とを検出する係数検出部と、
順次検出された前記非ゼロ係数又は前記ゼロランレングスを2以上の所定数毎に順次組み合わせると共に、前記非ゼロ係数及び前記ゼロランレングスのいずれであるかを識別する識別子を前記非ゼロ係数及び前記ゼロランレングス毎に付与して中間コードを生成する中間コード生成部と、
前記中間コードの前記非ゼロ係数又は前記ゼロランレングスと、前記識別子に基づいて、それぞれ1つの前記非ゼロ係数と1つの前記ゼロランレングスが入力されて可変長符号化処理する、前記所定数と同一数以上からなる複数の符号化部と
を有する、画像符号化装置。 An orthogonal transform unit that orthogonally transforms image data and generates orthogonal transform coefficients;
A quantization unit that quantizes the orthogonal transform coefficient to generate a quantization coefficient;
Coefficient detection for detecting a zero run length indicating the number of consecutive zero coefficients whose quantization coefficient value is zero (0) and a non-zero coefficient whose quantization coefficient value is not zero following the zero coefficient. And
The non-zero coefficient or the zero run length sequentially detected is sequentially combined every two or more predetermined numbers, and an identifier for identifying whether the non-zero coefficient or the zero run length is the non-zero coefficient and the zero run length. An intermediate code generation unit that generates an intermediate code by giving each zero run length;
Based on the non-zero coefficient or the zero-run length of the intermediate code, and the identifier, one non-zero coefficient and one zero-run length are respectively input and variable length coding is performed, and the predetermined number An image encoding apparatus having a plurality of encoding units including the same number or more.
量子化部が、前記直交変換係数を量子化し量子化係数を生成するステップと、
係数検出部が、前記量子化係数の値がゼロ(0)であるゼロ係数の連続数を示すゼロランレングスと、前記ゼロ係数の後に続く、前記量子化係数の値がゼロでない非ゼロ係数とを検出するステップと、
中間コード生成部が、順次検出された前記非ゼロ係数又は前記ゼロランレングスを2以上の所定数毎に順次組み合わせると共に、前記非ゼロ係数及び前記ゼロランレングスのいずれであるかを識別する識別子を前記非ゼロ係数及び前記ゼロランレングス毎に付与して中間コードを生成するステップと、
前記所定数と同一数以上からなる複数の符号化部が、前記中間コードの前記非ゼロ係数又は前記ゼロランレングスと、前記識別子に基づいて、それぞれ1つの前記非ゼロ係数と1つの前記ゼロランレングスが入力されて可変長符号化処理するステップと
を有する、画像符号化方法。
An orthogonal transform unit orthogonally transforms the image data to generate an orthogonal transform coefficient;
A quantizing unit that quantizes the orthogonal transform coefficient to generate a quantized coefficient;
A coefficient detection unit includes a zero run length indicating the number of consecutive zero coefficients whose value of the quantization coefficient is zero (0), and a non-zero coefficient whose value of the quantization coefficient is not zero, which follows the zero coefficient. Detecting steps,
An intermediate code generation unit sequentially combines the detected non-zero coefficient or the zero-run length every two or more predetermined numbers, and an identifier for identifying whether the non-zero coefficient or the zero-run length is Providing an intermediate code for each non-zero coefficient and zero run length; and
A plurality of encoding units having the same number or more as the predetermined number are each configured to have one non-zero coefficient and one zero run based on the non-zero coefficient or the zero-run length of the intermediate code and the identifier, respectively. And a variable length encoding process by inputting a length.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008301333A JP5230375B2 (en) | 2008-11-26 | 2008-11-26 | Image coding apparatus and image coding method |
KR20090068407A KR20100059665A (en) | 2008-11-26 | 2009-07-27 | Appratus for coding an image and method for coding the image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008301333A JP5230375B2 (en) | 2008-11-26 | 2008-11-26 | Image coding apparatus and image coding method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010130213A true JP2010130213A (en) | 2010-06-10 |
JP5230375B2 JP5230375B2 (en) | 2013-07-10 |
Family
ID=42330299
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008301333A Expired - Fee Related JP5230375B2 (en) | 2008-11-26 | 2008-11-26 | Image coding apparatus and image coding method |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP5230375B2 (en) |
KR (1) | KR20100059665A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63132530A (en) * | 1986-09-13 | 1988-06-04 | フィリップス エレクトロニクス ネムローゼ フェンノートシャップ | Method and apparatus for reducing bit-rate |
JPH06237448A (en) * | 1993-02-12 | 1994-08-23 | Toshiba Corp | Variable length coder and decoder |
JP2003125362A (en) * | 2001-10-15 | 2003-04-25 | Nec Corp | Additional information inserting device and additional information extracting device, and additional information inserting method and additional information extracting method |
JP2003143604A (en) * | 1990-02-27 | 2003-05-16 | Qualcomm Inc | Adaptive block size image compression method and system |
JP2003174366A (en) * | 2001-12-04 | 2003-06-20 | Sony Corp | Data decoding device and its method |
-
2008
- 2008-11-26 JP JP2008301333A patent/JP5230375B2/en not_active Expired - Fee Related
-
2009
- 2009-07-27 KR KR20090068407A patent/KR20100059665A/en not_active Application Discontinuation
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63132530A (en) * | 1986-09-13 | 1988-06-04 | フィリップス エレクトロニクス ネムローゼ フェンノートシャップ | Method and apparatus for reducing bit-rate |
JP2003143604A (en) * | 1990-02-27 | 2003-05-16 | Qualcomm Inc | Adaptive block size image compression method and system |
JPH06237448A (en) * | 1993-02-12 | 1994-08-23 | Toshiba Corp | Variable length coder and decoder |
JP2003125362A (en) * | 2001-10-15 | 2003-04-25 | Nec Corp | Additional information inserting device and additional information extracting device, and additional information inserting method and additional information extracting method |
JP2003174366A (en) * | 2001-12-04 | 2003-06-20 | Sony Corp | Data decoding device and its method |
Non-Patent Citations (1)
Title |
---|
JPN7013000630; WEN-HSIUNG CHEN,WILLIAM K.PRATT: 'Scene Adaptive Coder' IEEE TRANSACTIONS ON COMMUNICATIONS Vol.Com-32,No.3, 198403, P.225-P.232, IEEE * |
Also Published As
Publication number | Publication date |
---|---|
KR20100059665A (en) | 2010-06-04 |
JP5230375B2 (en) | 2013-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11671599B2 (en) | Data encoding and decoding | |
US11039142B2 (en) | Encoding and decoding of significant coefficients in dependence upon a parameter of the significant coefficients | |
RU2417518C2 (en) | Efficient coding and decoding conversion units | |
JP2016528789A (en) | Data encoding and decoding | |
JP6045123B2 (en) | Encoder, decoder and method | |
JP2007116436A (en) | Coding device and decoding device | |
US9544599B2 (en) | Context adaptive data encoding | |
GB2496209A (en) | Entropy encoder with first and second, bypass encoding systems | |
JP2009021775A (en) | Coder and coding method | |
WO2014131526A1 (en) | Entropy modifier and method | |
JPH07170517A (en) | Picture compression coder | |
JPH06350854A (en) | Picture compression encoding device | |
WO2013068733A1 (en) | Context adaptive data encoding | |
JP5230375B2 (en) | Image coding apparatus and image coding method | |
KR101549740B1 (en) | Binary data compression and decompression method and apparatus | |
KR100753282B1 (en) | VLC table selection method for CAVLC decoding and CAVLC decoding method thereof | |
KR102109768B1 (en) | Cabac binary arithmetic encoder for high speed processing of uhd imge | |
CN110431748B (en) | Binary arithmetic decoder and binary arithmetic decoding device | |
KR101676420B1 (en) | Data compression and restoration method and apparatus | |
JP2668900B2 (en) | High efficiency coding device | |
JP2005176169A (en) | Video coding method and apparatus | |
JP2004179752A (en) | Huffman decoder | |
JPH10163880A (en) | Data decoder | |
KR20170124004A (en) | Compressed manchester line coding method and apparatus thereof by universal code |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20101005 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20111117 |
|
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: 20130226 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130319 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160329 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5230375 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
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 |