JP2013138395A - Image filtering device, image decoding device, image encoding device and data structure - Google Patents

Image filtering device, image decoding device, image encoding device and data structure Download PDF

Info

Publication number
JP2013138395A
JP2013138395A JP2012009448A JP2012009448A JP2013138395A JP 2013138395 A JP2013138395 A JP 2013138395A JP 2012009448 A JP2012009448 A JP 2012009448A JP 2012009448 A JP2012009448 A JP 2012009448A JP 2013138395 A JP2013138395 A JP 2013138395A
Authority
JP
Japan
Prior art keywords
offset
pixel
class
class classification
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.)
Pending
Application number
JP2012009448A
Other languages
Japanese (ja)
Inventor
Masanobu Yasugi
将伸 八杉
Tomohiro Igai
知宏 猪飼
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.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP2012009448A priority Critical patent/JP2013138395A/en
Publication of JP2013138395A publication Critical patent/JP2013138395A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

PROBLEM TO BE SOLVED: To accomplish an image filtering device and the like to which an adaptive offset filter reflected with characteristics of pixels is applied.SOLUTION: An image filtering device is configured to add an offset selected from among a plurality of offsets to each of pixel values of an input image comprising a plurality of unit regions. The image filtering device comprises: classification method selection means which selects from among a plurality of candidates a classification method as a method for determining one of a plurality of classes to which a pixel included in the unit region should be sorted; classification means which classifies the pixels in accordance with the classification method selected by the classification method selection means; offset determination method which determines for each unit region the offset to be added to a pixel value of the pixel classified by the classification means in accordance with the class to which the pixel is sorted; and filter means which adds the offset determined by the offset determination means to the pixel values of the pixels included in the unit region.

Description

本発明は、画像のフィルタリングを行う画像フィルタ装置に関する。また、画像フィルタを用いて画像を符号化する画像符号化装置、および、画像フィルタを用いて画像を復号する画像復号装置に関する。また、符号化データのデータ構造に関する。   The present invention relates to an image filter device that performs image filtering. The present invention also relates to an image encoding device that encodes an image using an image filter and an image decoding device that decodes an image using an image filter. The present invention also relates to the data structure of encoded data.

動画像を効率的に伝送または記録するために、動画像を符号化することによって符号化データを生成する動画像符号化装置(符号化装置)、および、当該符号化データを復号することによって復号画像を生成する動画像復号装置(復号装置)が用いられている。具体的な動画像符号化方式としては、例えば、H.264/MPEG−4.AVCに採用されている方式、VCEG(Video Coding Expert Group)における共同開発用コーデックであるKTAソフトウェアに採用されている方式、その後継コーデックであるTMuC(Test Model under Consideration)ソフトウェアに採用されている方式、および、HM(HEVC TestModel)ソフトウェアに採用されている方式などが挙げられる。   In order to efficiently transmit or record a moving image, a moving image encoding device (encoding device) that generates encoded data by encoding the moving image, and decoding by decoding the encoded data A video decoding device (decoding device) that generates an image is used. As a specific moving picture encoding method, for example, H.264 is used. H.264 / MPEG-4. A method adopted in AVC, a method adopted in KTA software, which is a codec for joint development in VCEG (Video Coding Expert Group), and a method adopted in TMuC (Test Model under Consideration) software, which is the successor codec And a method adopted in HM (HEVC TestModel) software.

このような符号化方式において、動画像を構成する画像(ピクチャ)は、画像を分割することにより得られるスライス、スライスを分割することにより得られる最大符号化単位(LCU:Largest Coding Unit、ツリーブロックとも呼ばれる)、最大符号化単位を分割することにより得られる符号化単位(CU:Coding Unit、符号化ノードとも呼ばれる)、および、符号化単位を分割することより得られるブロックおよびパーティションからなる階層構造により管理され、多くの場合、ブロックを最小単位として符号化される。   In such an encoding scheme, an image (picture) that constitutes a moving image is a slice obtained by dividing the image, a maximum coding unit (LCU: Large Coding Unit, tree block obtained by dividing the slice) Hierarchical structure consisting of coding units (CU: Coding Unit, also called coding nodes) obtained by dividing the maximum coding unit, and blocks and partitions obtained by dividing the coding unit In many cases, the block is encoded as a minimum unit.

また、このような符号化方式においては、通常、入力画像を符号化し、復号することによって得られる局所復号画像に基づいて予測画像が生成され、当該予測画像と入力画像との差分データが符号化される。また、予測画像の生成方法としては、画面間予測(インター予測)、および、画面内予測(イントラ予測)と呼ばれる方法が知られている。   In such an encoding method, a prediction image is usually generated based on a local decoded image obtained by encoding and decoding an input image, and difference data between the prediction image and the input image is encoded. Is done. As methods for generating a predicted image, methods called inter-screen prediction (inter prediction) and intra-screen prediction (intra prediction) are known.

イントラ予測においては、同一フレーム内の局所復号画像に基づいて、当該フレームにおける予測画像が順次生成される。具体的には、イントラ予測においては、通常、予測単位(例えば、ブロック)毎に、予め定められた予測方向(予測モード)群に含まれる予測方向から何れかの予測方向が選択されると共に、局所復号画像における参照画素の画素値を、選択された予測方向に外挿することによって、予測対象領域上の予測画素値が生成される。また、インター予測においては、フレーム全体が復号された参照フレーム(復号画像)内の参照画像に対し、動きベクトルを用いた動き補償を適用することによって、予測対象フレーム内の予測画像が予測単位(例えば、ブロック)毎に生成される。   In intra prediction, based on a locally decoded image in the same frame, predicted images in the frame are sequentially generated. Specifically, in intra prediction, usually, one prediction direction is selected from prediction directions included in a predetermined prediction direction (prediction mode) group for each prediction unit (for example, block), and A prediction pixel value on the prediction target region is generated by extrapolating the pixel value of the reference pixel in the locally decoded image in the selected prediction direction. Also, in inter prediction, by applying motion compensation using a motion vector to a reference image in a reference frame (decoded image) in which the entire frame is decoded, a predicted image in a prediction target frame is converted into a prediction unit ( For example, it is generated for each block).

非特許文献1には、復号画像のブロック歪みを低減させるデブロッキングフィルタの後段であって、適応的に決定されたフィルタ係数を用いたフィルタ処理を行う適応的ループフィルタ(「適応フィルタ」とも呼ぶ)の前段に導入された適応的オフセットフィルタ(「適応オフセットフィルタ」とも呼ぶ)が開示されている。この適応オフセットフィルタは、デブロッキングフィルタから出力される画像の各画素値に対して、適応的に設定されたオフセットを加算するというものである。   Non-Patent Document 1 describes an adaptive loop filter (also referred to as an “adaptive filter”) that is a subsequent stage of a deblocking filter that reduces block distortion of a decoded image and performs filter processing using adaptively determined filter coefficients. An adaptive offset filter (also referred to as “adaptive offset filter”) introduced in the preceding stage is disclosed. This adaptive offset filter adds an adaptively set offset to each pixel value of an image output from the deblocking filter.

このような適応オフセットフィルタを備えることによって、ブロック歪みをより効果的に抑制することができる。   By providing such an adaptive offset filter, block distortion can be more effectively suppressed.

“WD4: Working Draft 4 of High-Efficiency Video Coding”,「JCTVC-F803-v5」,Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG16 WP3 and ISO/IEC JCT1/SC29/WG11, 6th Meeting: Torino, IT, 07/2011“WD4: Working Draft 4 of High-Efficiency Video Coding”, “JCTVC-F803-v5”, Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG16 WP3 and ISO / IEC JCT1 / SC29 / WG11, 6th Meeting: Torino, IT, 07/2011

上述した適応オフセットフィルタは、対象となる画素が、輝度画素の場合であっても色差画素の場合であっても同じ処理方法を用いて適用されている。すなわち、輝度画素と色差画素との特性の違いが処理方法に反映されていない。そのため、符号化効率が低下してしまっている。換言すれば、画素の特性に応じた処理方法となっていないため、符号化効率が低下している。   The above-described adaptive offset filter is applied using the same processing method regardless of whether the target pixel is a luminance pixel or a chrominance pixel. That is, the difference in characteristics between the luminance pixel and the color difference pixel is not reflected in the processing method. As a result, the encoding efficiency has been reduced. In other words, since the processing method does not correspond to the characteristics of the pixel, the encoding efficiency is reduced.

本発明は、上記の問題に鑑みてなされたものであり、その目的は画素の特性を反映した適応オフセットフィルタを適用した画像フィルタ装置等を実現することにある。   The present invention has been made in view of the above problems, and an object thereof is to realize an image filter device and the like to which an adaptive offset filter reflecting pixel characteristics is applied.

上記課題を解決するために、本発明に係る画像フィルタ装置は、複数の単位領域から構成される入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備えていることを特徴としている。   In order to solve the above problems, an image filter device according to the present invention is an image filter device that adds an offset selected from a plurality of offsets to each pixel value of an input image composed of a plurality of unit regions. A class classification method selecting means for selecting a class classification method, which is a method for determining which of the plurality of classes the pixels included in the unit area are classified, and the class classification method According to the class classification method selected by the selection means, the class classification means for classifying the pixel, and the offset added to the pixel value of the pixel classified by the class classification means according to the class in which the pixel is classified The offset determining means for determining each unit area, and the offset determined by the offset determining means for the pixels included in the unit area Is characterized by comprising a filter means for adding a pixel value.

上記の構成によれば、クラス分類方法選択手段が選択したクラス分類方法にしたがって、対象画素のクラスが分類される。そして、分類されたクラスに基づいて、対象画素にオフセットが加算される。   According to the above configuration, the class of the target pixel is classified according to the class classification method selected by the class classification method selection unit. Then, an offset is added to the target pixel based on the classified class.

よって、画素毎にクラス分類方法を選択することができるので、画素の特性に応じてクラス分類方法を選択することができる。したがって、画素の特性を反映したクラス分類方法によりクラス分類を行うことができる。   Therefore, since the class classification method can be selected for each pixel, the class classification method can be selected according to the characteristics of the pixel. Therefore, classification can be performed by a classification method that reflects the characteristics of the pixels.

また、画素の特性を反映したクラス分類方法を用いることにより、符号化効率を向上させることができる。   In addition, the coding efficiency can be improved by using a class classification method that reflects pixel characteristics.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、上記単位領域に含まれる画素の画素値が色差を示す場合と輝度を示す場合とで、異なる候補群から、クラス分類方法を選択するものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method from different candidate groups depending on whether a pixel value of a pixel included in the unit region indicates a color difference or luminance. You may do.

上記の構成によれば、クラス分類方法の候補が、対象画素の画素値が色差を示す場合(色差画素)と輝度を示す場合(輝度画素)とで異なる。   According to the above configuration, the classification method candidates differ depending on whether the pixel value of the target pixel indicates a color difference (color difference pixel) or a luminance (luminance pixel).

これにより、色差画素と輝度画素とのそれぞれの特性に応じてクラス分類方法を選択することができる。また、色差画素および輝度画素それぞれの特性に応じてクラス分類方法を選択することができるので、符号化効率を向上させることができる。   Thereby, the class classification method can be selected according to the characteristics of the color difference pixels and the luminance pixels. In addition, since the class classification method can be selected according to the characteristics of the color difference pixels and the luminance pixels, the encoding efficiency can be improved.

本発明に係る画像フィルタ装置では、上記の異なる候補群は、上記クラス分類方法選択手段が、上記単位領域に含まれる画素の画素値が色差を示す場合に選択する候補群を色差候補群とし、上記単位領域に含まれる画素の画素値が輝度を示す場合に選択する候補群を輝度候補群とした場合に、上記色差候補群に含まれるクラス分類方法が示すクラス数が、上記輝度候補群に含まれるクラス分類方法が示すクラス数よりも多いものであってもよい。   In the image filter device according to the present invention, the different candidate group is a color difference candidate group selected by the class classification method selection unit when the pixel value of the pixel included in the unit region indicates a color difference. When the candidate group selected when the pixel value of the pixel included in the unit region indicates luminance is a luminance candidate group, the number of classes indicated by the class classification method included in the color difference candidate group is the luminance candidate group. It may be more than the number of classes indicated by the included class classification method.

上記の構成によれば、色差画素のクラス分類方法に含まれるクラス数は、輝度画素のクラス分類方法に含まれるクラス数よりも多くなる。   According to the above configuration, the number of classes included in the chrominance pixel class classification method is larger than the number of classes included in the luminance pixel class classification method.

これにより、色差画素の場合は、輝度画素よりもオフセットが加算される場合を多くすることができる。   Thereby, in the case of a color difference pixel, the case where an offset is added rather than a luminance pixel can be increased.

本発明に係る画像フィルタ装置では、上記の異なる候補群は、上記クラス分類方法選択手段が、上記単位領域に含まれる画素の画素値が色差を示す場合に選択する候補群を色差候補群とし、上記単位領域に含まれる画素の画素値が輝度を示す場合に選択する候補群を輝度候補群とした場合に、上記色差候補群に含まれるクラス分類方法の種類の数が、上記輝度候補群に含まれるクラス分類方法の種類の数よりも少ないものであってもよい。   In the image filter device according to the present invention, the different candidate group is a color difference candidate group selected by the class classification method selection unit when the pixel value of the pixel included in the unit region indicates a color difference. When the candidate group to be selected when the pixel value of the pixel included in the unit region indicates luminance is a luminance candidate group, the number of types of class classification methods included in the color difference candidate group is the luminance candidate group. It may be less than the number of types of classification methods included.

上記の構成によれば、色差画素のクラス分類方法の種類の数が輝度画素のクラス分類方法の種類の数よりも少なくなる。   According to the above configuration, the number of types of chrominance pixel class classification methods is smaller than the number of types of luminance pixel class classification methods.

これにより、色差画素の場合は、クラス分類方法の種類の全てを処理することに伴う処理量を削減することができる。   Thereby, in the case of a chrominance pixel, it is possible to reduce the amount of processing involved in processing all types of class classification methods.

例えば、クラス分類方法の種類としてオフセットタイプを考えると、上記の構成によれば、色差画素のクラス分類方法に含まれるオフセットタイプ数は、輝度画素のクラス分類方法に含まれるオフセットタイプ数よりも少なくなる。   For example, when an offset type is considered as a type of class classification method, according to the above configuration, the number of offset types included in the color difference pixel class classification method is smaller than the number of offset types included in the luminance pixel class classification method. Become.

これにより、色差画素の場合は、全てのバンドオフセットタイプを処理することに伴う処理量を削減することができる。   Thereby, in the case of a chrominance pixel, the processing amount accompanying processing all the band offset types can be reduced.

本発明に係る画像フィルタ装置では、上記フィルタ手段は、上記クラス分類方法選択手段が、対象画素について、当該画素周辺のエッジの状態に基づいてクラス分類を行うクラス分類方法を選択し、上記対象画素の画素値が色差を示す場合、上記対象画素の画素値が輝度を示す場合であればオフセットを加算しないクラスに分類された画素の画素値にもオフセットを加算するものであってもよい。   In the image filter device according to the present invention, the filter means selects the class classification method for classifying the target pixel based on the state of the edge around the pixel, and the target pixel If the pixel value indicates a color difference, if the pixel value of the target pixel indicates luminance, the offset may be added to the pixel value of a pixel classified into a class to which no offset is added.

本願発明者の実験によれば、対象画素周辺のエッジの状態に基づいてクラス分類を行うクラス分類方法の場合、対象画素が輝度画素のときはオフセットを加算しないクラスであっても、色差画素のときはオフセットを加算することにより符号化効率が向上することがわかった。   According to the experiment of the present inventor, in the case of a class classification method for performing class classification based on the state of the edge around the target pixel, even if the target pixel is a luminance pixel, even if it is a class that does not add an offset, It was found that encoding efficiency is improved by adding an offset.

したがって、上記の構成によれば、対象画素周辺のエッジの状態に基づいてクラス分類を行うクラス分類方法で、対象画素の画素値が色差を示す場合、対象画素の画素値が輝度を示す場合であればオフセットを加算しないクラスであってもオフセットが加算されるので、符号化効率を向上させることができる。   Therefore, according to the above configuration, in the class classification method that performs class classification based on the state of the edge around the target pixel, when the pixel value of the target pixel indicates color difference, the pixel value of the target pixel indicates luminance. If there is a class for which no offset is added, the offset is added, so that the coding efficiency can be improved.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、上記の複数の候補のうちの2つ以上の候補で、オフセット加算処理が行われるクラスに分類される画素値の範囲に重複があるものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates. Two or more of the candidates may be overlapped in the range of pixel values classified into the class for which the offset addition process is performed.

上記の構成によれば、重複する範囲に含まれる画素値に対しては、オフセットが加算されるクラスに分類される可能性が高くなる。よって、画質等に影響を及ぼす可能性が高い画素値を重複する範囲に含まれるようにすることで、画質等の向上を図ることができる。   According to the above configuration, there is a high possibility that pixel values included in the overlapping range are classified into a class to which an offset is added. Therefore, the image quality and the like can be improved by including the pixel values that are highly likely to affect the image quality and the like in the overlapping range.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、上記対象画素の画素値が色差を示す場合、所定の値域の画素が分類されるクラスが重複しているクラス分類方法の候補の中からクラス分類方法を選択するものであってもよい。   In the image filter device according to the present invention, when the pixel value of the target pixel indicates a color difference, the class classification method selection unit selects a class classification method candidate in which classes in which pixels in a predetermined range are classified overlap. A classification method may be selected from among them.

上記の構成によれば、所定の値域の画素が重複しているクラスに分類される可能性が高くなる。よって、当該所定の値域の画素に対しては、オフセットが加算される可能性が高くなる。そして、主観画質に及ぼす影響が大きい値域を所定の値域とすれば、所定の値域に対しオフセットを加算する可能性が高くなることで、主観画質を効率的に向上させることができる。   According to said structure, possibility that it will be classified into the class with which the pixel of a predetermined value range overlaps becomes high. Therefore, there is a high possibility that an offset is added to the pixels in the predetermined range. If a value range having a large influence on the subjective image quality is set as the predetermined value range, the possibility of adding an offset to the predetermined value range is increased, so that the subjective image quality can be improved efficiently.

上記所定の値域は、無彩色あるいは低い彩度を示す値域であってもよい。上記の構成によれば、無彩色あるいは低い彩度の画素に対して、オフセットが加算される可能性が高くなる。そして、無彩色あるいは低い彩度の画素は、主観画質に及ぼす影響が大きいので、無彩色あるいは低い彩度の画素に対しオフセットを加算する可能性が高くなることで、主観画質を向上させることができる。   The predetermined value range may be a value range indicating an achromatic color or low saturation. According to the above configuration, there is a high possibility that an offset is added to an achromatic pixel or a pixel with low saturation. Since achromatic or low-saturation pixels have a large effect on subjective image quality, the possibility of adding an offset to achromatic or low-saturation pixels is increased, so that subjective image quality can be improved. it can.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれており、上記複数の変換テーブルのうち、少なくとも2つの変換テーブルの所定の範囲に含まれる画素値は、オフセット加算処理が行われるクラスと対応付けられているものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, and each of the candidates Includes a plurality of conversion tables in which pixel values and classes are associated with each other. Among the plurality of conversion tables, pixel values included in a predetermined range of at least two conversion tables are subjected to an offset addition process. It may be associated with the class to be performed.

上記の構成によれば、所定の範囲に含まれる画素値に対しては、オフセットが加算される可能性が高くなる。よって、オフセットを加算することが好ましい画素値が含まれる値域を所定の範囲とすれば、当該画素値にオフセットを加算できる可能性が高めることができる。   According to said structure, possibility that an offset will be added with respect to the pixel value contained in a predetermined range becomes high. Therefore, if a value range including a pixel value to which an offset is preferably added is set to a predetermined range, the possibility that the offset can be added to the pixel value can be increased.

所定の範囲は、例えば、中間調、暗部、明部などの値域や、色差の場合における低彩度領域を設定することができる。   As the predetermined range, for example, a value range such as a halftone, a dark part, or a bright part, or a low saturation area in the case of a color difference can be set.

本発明に係る画像フィルタ装置では、上記変換テーブルは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとを対応付けており、上記所定の範囲は、他のクラスよりも対応付けられている値域が少ないクラスと対応付けられている値域の範囲であってもよい。   In the image filter device according to the present invention, in the conversion table, the pixel value is divided into a plurality of value ranges, and each divided value range is associated with a class, and the predetermined range is more than the other classes. It may be a range of value ranges associated with a class with a small number of associated value ranges.

上記の構成によれば、他のクラスよりも対応付けられている値域が少ないクラスと対応付けられている値域の範囲が所定の範囲となる。他のクラスよりも対応付けられている値域が少ないクラスと対応付けられている値域は、クラスが細かく対応付けられている値域ということができる。当該値域は、オフセットを加算することにより主観画質の向上を図ることができる値域と考えられる。そして、上記の構成によれば、この値域の画素値にオフセットを加算する可能性を高めることができる。これにより、主観画質を向上させる可能性を高めることができる。   According to said structure, the range of the value range matched with the class with few value ranges matched with another class becomes a predetermined range. A value range that is associated with a class that has fewer value ranges than other classes can be said to be a value range in which the classes are finely associated. The value range is considered as a value range in which the subjective image quality can be improved by adding an offset. And according to said structure, possibility of adding an offset to the pixel value of this range can be improved. Thereby, the possibility of improving the subjective image quality can be increased.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれており、上記複数の変換テーブルは互いに、オフセット加算処理が行われるクラスと対応付けられている画素値の範囲が異なるものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, and each of the candidates Includes a plurality of conversion tables in which pixel values and classes are associated with each other, and the plurality of conversion tables have different pixel value ranges associated with classes on which offset addition processing is performed. It may be.

上記の構成によれば、1つのクラス分類方法の中に、オフセット加算処理が行われるクラスと対応付けられている画素値の範囲が異なる変換テーブルが含まれるので、画素値の集中している度合に応じて変換テーブルを選択することができる。   According to the above configuration, a conversion table having different pixel value ranges associated with a class for which offset addition processing is performed is included in one class classification method. The conversion table can be selected according to the above.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、上記複数の変換テーブルは互いに、各クラスと対応付けられている値域の数が異なるものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, and each of the candidates Includes a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the conversion tables has pixel values divided into a plurality of value ranges, and each divided value range and class are associated with each other. The plurality of conversion tables may be different from each other in the number of value ranges associated with each class.

上記の構成によれば、1つのクラス分類方法の中に、各クラスと対応付けられている値域の数が異なる変換テーブルが含まれるので、より細かくクラス分類を行った方が好ましい場合にも適切な変換テーブルを提供することができる。   According to the above configuration, a conversion table with different number of value ranges associated with each class is included in one class classification method. Therefore, it is appropriate even when it is preferable to classify more finely. Conversion table can be provided.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、それぞれの上記候補には、画素値とクラスとを対応付けた3つ以上の変換テーブルが含まれており、上記3つ以上の変換テーブルには、オフセット加算処理が行われるクラスと対応する画素値の範囲が、他の変換テーブルよりも広い変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、上記広い変換テーブルにおける画素値の範囲よりも狭い変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域である変換テーブルと、が含まれているものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, and each of the candidates Includes three or more conversion tables in which pixel values and classes are associated with each other, and the three or more conversion tables include a range of pixel values corresponding to a class on which offset addition processing is performed, A conversion table wider than other conversion tables, a conversion table whose pixel value range corresponding to the class for which offset addition processing is performed is narrower than the pixel value range in the wide conversion table, and a class for which offset addition processing is performed And the corresponding pixel value range includes both ends of the pixel value range and a conversion table close to the range. There.

上記の構成によれば、1つのクラス分類方法の中に、オフセット加算処理が行われるクラスと対応する画素値の範囲が、他の変換テーブルよりも広い変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、他の変換テーブルよりも狭い変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域である変換テーブルと、が含まれる。   According to the above configuration, in one class classification method, a conversion table in which the range of pixel values corresponding to a class for which offset addition processing is performed is wider than other conversion tables, and a class for which offset addition processing is performed. The pixel value range corresponding to the conversion table is narrower than other conversion tables, and the pixel value range corresponding to the class for which the offset addition process is performed is the range of the pixel value range and the adjacent range. Conversion table.

これにより、様々な画素値の分布に対応することができる。例えば、画素値が値域全体に渡っている場合や一部に偏っている場合であっても適切な変換テーブルを提供することができる。   Thereby, it can respond to distribution of various pixel values. For example, an appropriate conversion table can be provided even when the pixel values are over the entire value range or are partially biased.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、それぞれの上記候補には、画素値とクラスとを対応付けた3つ以上の変換テーブルが含まれており、上記3つ以上の変換テーブルには、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の中央を含む第1変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域を含む第2変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、上記第1変換テーブルおよび第2変換テーブルにおける画素値の範囲以外の範囲を含む1つ以上の変換テーブルと、が含まれているものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, and each of the candidates Includes three or more conversion tables in which pixel values and classes are associated with each other, and the three or more conversion tables include a range of pixel values corresponding to a class on which offset addition processing is performed, A first conversion table including the center of the range of pixel values, a second conversion table in which the range of pixel values corresponding to the class for which the offset addition processing is performed includes both ends of the range of pixel values and a range close thereto. One or more pixel value ranges corresponding to the class for which the offset addition processing is performed include ranges other than the pixel value ranges in the first conversion table and the second conversion table. And conversion table may be one that contains.

上記の構成によれば、1つのクラス分類方法の中に、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の中央を含む第1変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端および中央を含まない1つ以上の変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域を含む第2変換テーブルと、が含まれる。   According to the above configuration, in one class classification method, the range of pixel values corresponding to the class for which offset addition processing is performed includes the first conversion table including the center of the range of pixel values, and the offset addition processing includes The pixel value range corresponding to the class to be performed is one or more conversion tables not including both ends and the center of the pixel value range, and the pixel value range corresponding to the class to be subjected to the offset addition process is the pixel value range. And a second conversion table including both ends of the range and a range close to the range.

これにより、画素値が広く分布せずいずれかの範囲に集中しやすい場合であっても適切な変換テーブルを提供することができる。   Thus, an appropriate conversion table can be provided even when pixel values are not widely distributed and are likely to be concentrated in any range.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、それぞれの上記候補には、画素値とクラスとを対応付けた3つ以上の変換テーブルが含まれており、上記3つ以上の変換テーブルのいずれかを示す符号化データの符号長が、オフセット加算処理が行われるクラスと対応する画素値の範囲が画素値の値域の中央を含む変換テーブルを示す場合に最も短く、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびその付近を含む変換テーブルを示す場合に最も長くなる符号化データを用いるものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, and each of the candidates Includes three or more conversion tables in which pixel values and classes are associated with each other, and an offset addition process is performed on the code length of encoded data indicating one of the three or more conversion tables. The pixel value range corresponding to the class is the shortest when the pixel value range corresponding to the class indicates a conversion table including the center of the pixel value range, and the pixel value range corresponding to the class to which the offset addition processing is performed is at both ends of the pixel value range and its range. When a conversion table including the vicinity is shown, encoded data that is the longest may be used.

上記の構成によれば、符号化データにおいて上記3つ以上の変換テーブルのいずれかを示す場合の符号長が、オフセット加算処理が行われるクラスと対応する画素値の範囲が画素値の値域の中央を含む変換テーブルを示す場合に最も短く、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびその付近を含む変換テーブルを示す場合に最も長くなる。   According to the above configuration, the code length in the case of indicating any one of the three or more conversion tables in the encoded data is such that the pixel value range corresponding to the class for which the offset addition processing is performed is the center of the pixel value range. Is the shortest when a conversion table is included, and the pixel value range corresponding to the class for which the offset addition processing is performed is the longest when the conversion table includes both ends of the pixel value range and the vicinity thereof.

これにより、値域の中央を含む帯域に対応する変換テーブルを選択する場合に、変換テーブルを示す符号量を低減することができる。   Thereby, when selecting the conversion table corresponding to the band including the center of the range, the code amount indicating the conversion table can be reduced.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであって、それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該複数の変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、上記クラス分類方法選択手段は、前記画素値が色差を示すものである場合には、前記画素値が輝度を示すものである場合よりも、多くの数の値域に区分した変換テーブルを含むクラス分類方法を選択するものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, The candidates include a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the plurality of conversion tables has pixel values divided into a plurality of value ranges, and each of the divided value ranges and classes. And the class classification method selecting means classifies the pixel values into a larger number of value ranges than when the pixel values indicate luminance when the pixel values indicate color differences. The classification method including the converted table may be selected.

上記の構成によれば、画素値が色差を示すものである場合には、前記画素値が輝度を示すものである場合よりも、多くの数の値域に区分した変換テーブルを用いてクラス分類が行われる。これにより、画素値が色差を示す場合は、輝度を示す場合よりもより細かい区分が可能となる。色差は輝度と比較してより狭い範囲に画素値が集中していることが多いので、上記の構成とすることにより、より的確かつ効率的に色差の画素値を分類することができ、符号化効率を向上させることができる。   According to the above configuration, when the pixel value indicates a color difference, the classification is performed using the conversion table divided into a larger number of value ranges than when the pixel value indicates the luminance. Done. Thereby, when the pixel value indicates a color difference, a finer classification is possible than when the pixel value indicates luminance. Since the pixel values are often concentrated in a narrower range than the luminance, the above configuration allows the pixel values of the color difference to be classified more accurately and efficiently. Efficiency can be improved.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであって、それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該複数の変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、上記クラス分類方法選択手段は、前記画素値が色差を示すものである場合、オフセット加算処理が行われないクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域である変換テーブルを含むクラス分類方法を選択するものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, The candidates include a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the plurality of conversion tables has pixel values divided into a plurality of value ranges, and each of the divided value ranges and classes. If the pixel value indicates color difference, the class classification method selection unit is configured such that the range of pixel values corresponding to the class for which the offset addition process is not performed is at both ends of the pixel value range. A class classification method including a conversion table that is a range close to this may be selected.

上記の構成によれば、画素値が色差を示す場合、オフセット加算処理が行われないクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域である変換テーブルを用いてクラス分類が行われる。色差の画素値は、値域の中央付近における発生頻度が高いため。上記の構成により、より的確かつ効率的に色差の画素値を分類することができ、符号化効率を向上させることができる。   According to the above configuration, when the pixel value indicates a color difference, the conversion table is used in which the pixel value range corresponding to the class for which the offset addition process is not performed is the both ends of the pixel value range and the value range close thereto. Classification. This is because the color difference pixel value is frequently generated near the center of the range. With the above configuration, pixel values of color differences can be classified more accurately and efficiently, and encoding efficiency can be improved.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであって、それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該複数の変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、上記クラス分類方法選択手段は、前記画素値が色差を示すものである場合、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の中央を含む第1変換テーブルと、オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の中央を含まない第3変換テーブルと、を含むとともに、上記第1変換テーブルにおけるオフセット加算処理が行われるクラスと対応する画素値の範囲が、上記第3変換テーブルにおけるオフセット加算処理が行われるクラスと対応する画素値の範囲よりも狭いクラス分類方法を選択するものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, The candidates include a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the plurality of conversion tables has pixel values divided into a plurality of value ranges, and each of the divided value ranges and classes. When the pixel value indicates a color difference, the class classification method selection unit has a pixel value range corresponding to the class for which the offset addition process is performed at the center of the pixel value range. A first conversion table including a third conversion table in which a range of pixel values corresponding to a class for which an offset addition process is performed does not include the center of the range of pixel values; In addition, a class classification method in which the range of pixel values corresponding to the class for which the offset addition processing is performed in the first conversion table is narrower than the range of pixel values corresponding to the class for which the offset addition processing is performed in the third conversion table. May be selected.

上記の構成によれば、画素値が色差を示す場合、画素値の値域の中央を含む範囲および、画素値の値域の中央を含まない範囲にオフセットを加算するとともに、画素値の値域の中央を含む範囲が、画素値の値域の中央を含まない範囲よりも狭くなる。
色差の画素値は、低彩度を表す値域の中心付近において発生頻度が高くなる傾向にある。よって、上記の構成により、色差の発生頻度が高い値域付近を細かく分類しながら比較的広範囲の画素値に対しオフセットを加算することができる。
According to the above configuration, when the pixel value indicates a color difference, the offset is added to the range including the center of the pixel value range and the range not including the center of the pixel value range, and the center of the pixel value range is The range including it is narrower than the range not including the center of the pixel value range.
The pixel value of the color difference tends to occur frequently in the vicinity of the center of the value range representing low saturation. Therefore, with the above configuration, it is possible to add an offset to a relatively wide range of pixel values while finely classifying the vicinity of a value range where the color difference occurrence frequency is high.

本発明に係る画像フィルタ装置では、上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該複数の変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、上記複数の変換テーブルには、画素値の値域の中で連続していない複数の範囲が、オフセット加算処理が行われるクラスと対応する画素値の範囲となる変換テーブルが含まれているものであってもよい。   In the image filter device according to the present invention, the class classification method selection unit selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, and each of the candidates Includes a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the plurality of conversion tables includes pixel values divided into a plurality of value ranges, and each of the divided value ranges and classes includes The plurality of conversion tables that are associated with each other include a conversion table in which a plurality of non-contiguous ranges in the pixel value range become pixel value ranges corresponding to a class for which offset addition processing is performed. It may be what is.

上記の構成によれば、クラス分類方法の中に、画素値の値域の中で連続していない複数の範囲が、オフセット加算処理が行われるクラスと対応する画素値の範囲となる変換テーブルが含まれる。これにより、少ないクラス数で多くの画素値をクラス分類することができるので、クラス分類に必要な符号量を削減することができるとともに、符号化効率を向上させることができる。   According to the above configuration, the class classification method includes a conversion table in which a plurality of non-contiguous ranges in the pixel value range are pixel value ranges corresponding to the class on which the offset addition processing is performed. It is. As a result, a large number of pixel values can be classified with a small number of classes, so that the amount of code required for class classification can be reduced and the coding efficiency can be improved.

上記課題を解決するために、本発明に係る画像フィルタ装置は、複数の単位領域から構成される入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、上記画素の画素値の上限値、下限値、およびこれらに近接する画素値の画素について、上記オフセット決定手段が決定したオフセットを加算後の画素値が、上記上限値を上回るか、または上記下限値を下回らないように、加算するオフセットを修正するオフセット修正手段と、上記オフセット決定手段が決定したオフセットまたは上記オフセット修正手段が修正したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備えていることを特徴としている。   In order to solve the above problems, an image filter device according to the present invention is an image filter device that adds an offset selected from a plurality of offsets to each pixel value of an input image composed of a plurality of unit regions. A class classification method selecting means for selecting a class classification method, which is a method for determining which of the plurality of classes the pixels included in the unit area are classified, and the class classification method According to the class classification method selected by the selection means, the class classification means for classifying the pixel, and the offset added to the pixel value of the pixel classified by the class classification means according to the class in which the pixel is classified The offset determining means for determining each unit area, the upper limit value and the lower limit value of the pixel value of the pixel, and the pixels having pixel values close to them. The offset correction means for correcting the offset to be added so that the pixel value after adding the offset determined by the offset determination means does not exceed the upper limit value or falls below the lower limit value, and the offset determination means And a filter unit that adds the determined offset or the offset corrected by the offset correction unit to the pixel value of the pixel included in the unit region.

上記の構成によれば、決定したオフセットを当該画素の画素値に加算した場合に、画素値の値域からはみ出てしまうことを防止することができる。また、オフセットを修正することにより、画素値が値域からはみ出てしまうことを防止するので、その後のクリップ処理を削減することができる。   According to said structure, when adding the determined offset to the pixel value of the said pixel, it can prevent that it protrudes from the range of a pixel value. Further, by correcting the offset, it is possible to prevent the pixel value from protruding from the range, so that subsequent clip processing can be reduced.

上記課題を解決するために、本発明に係る画像復号装置は、符号化データから復号した予測残差に、生成した予測画像を加算して復号画像を生成する画像復号装置であって、上記予測残差に上記予測画像を加算した加算画像に対し、単位領域毎にオフセットを加算するオフセット加算手段と、上記オフセット加算手段がオフセットを加算した画像を復号画像として出力する出力手段と、を備え、上記オフセット加算手段には、上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、が備えられていることを特徴としている。   In order to solve the above-described problem, an image decoding device according to the present invention is an image decoding device that generates a decoded image by adding a generated prediction image to a prediction residual decoded from encoded data. An offset addition unit that adds an offset for each unit region to the addition image obtained by adding the prediction image to the residual, and an output unit that outputs an image obtained by adding the offset by the offset addition unit as a decoded image, The offset addition means includes a class classification method selection means for selecting a class classification method, which is a method for determining which of a plurality of classes a pixel included in the unit area is to be classified from a plurality of candidates, Class classification means for classifying the pixels according to the class classification method selected by the class classification method selection means, and the class classification means An offset to be added to the pixel value of each pixel is determined for each unit region according to the class into which the pixel is classified, and the offset determined by the offset determination unit is included in the unit region. And a filter means for adding to the pixel value of the pixel.

上記の構成によれば、クラス分類方法選択手段が選択したクラス分類方法にしたがって、対象画素のクラスが分類される。そして、分類されたクラスに基づいて、対象画素にオフセットが加算される。   According to the above configuration, the class of the target pixel is classified according to the class classification method selected by the class classification method selection unit. Then, an offset is added to the target pixel based on the classified class.

よって、画素毎にクラス分類方法を選択することができるので、画素の特性に応じてクラス分類方法を選択することができる。したがって、画素の特性を反映したクラス分類方法によりクラス分類を行うことができる。   Therefore, since the class classification method can be selected for each pixel, the class classification method can be selected according to the characteristics of the pixel. Therefore, classification can be performed by a classification method that reflects the characteristics of the pixels.

また、画素の特性を反映したクラス分類方法を用いることにより、符号化効率を向上させることができる。   In addition, the coding efficiency can be improved by using a class classification method that reflects pixel characteristics.

上記課題を解決するために、本発明に係る画像符号化装置は、生成した予測画像と原画像との差分である予測残差を符号化することによって符号化データを生成する画像符号化装置であって、原画像を符号化し、復号した復号画像に対し、単位領域毎にオフセットを加算するオフセット加算手段と、上記オフセット加算手段がオフセットを加算した画像から上記予測画像を生成する予測画像生成手段と、上記予測画像生成手段が生成した予測画像と原画像との差分である予測残差を符号化する符号化手段と、を備え、上記オフセット加算手段には、上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、が備えられていることを特徴としている。   In order to solve the above problems, an image encoding device according to the present invention is an image encoding device that generates encoded data by encoding a prediction residual that is a difference between a generated predicted image and an original image. An offset adding unit that adds an offset for each unit region to a decoded image that is encoded and decoded from an original image, and a predicted image generating unit that generates the predicted image from an image obtained by adding the offset by the offset adding unit Encoding means for encoding a prediction residual that is a difference between the prediction image generated by the prediction image generation means and the original image, and the offset addition means includes pixels included in the unit region. Class classification method selection means for selecting a class classification method, which is a method for determining which of a plurality of classes to classify, from a plurality of candidates, and the class classification method selection unit Class classification means for classifying the pixel according to the selected class classification method, and an offset to be added to the pixel value of the pixel classified by the class classification means according to the class in which the pixel is classified. An offset determining unit that determines each unit region and a filter unit that adds the offset determined by the offset determining unit to the pixel values of the pixels included in the unit region are provided.

上記の構成によれば、クラス分類方法選択手段が選択したクラス分類方法にしたがって、対象画素のクラスが分類される。そして、分類されたクラスに基づいて、対象画素にオフセットが加算される。   According to the above configuration, the class of the target pixel is classified according to the class classification method selected by the class classification method selection unit. Then, an offset is added to the target pixel based on the classified class.

よって、画素毎にクラス分類方法を選択することができるので、画素の特性に応じてクラス分類方法を選択することができる。したがって、画素の特性を反映したクラス分類方法によりクラス分類を行うことができる。   Therefore, since the class classification method can be selected for each pixel, the class classification method can be selected according to the characteristics of the pixel. Therefore, classification can be performed by a classification method that reflects the characteristics of the pixels.

また、画素の特性を反映したクラス分類方法を用いることにより、符号化効率を向上させることができる。   In addition, the coding efficiency can be improved by using a class classification method that reflects pixel characteristics.

上記課題を解決するために、本発明に係る符号化データのデータ構造は、画像復号装置において復号される、予測画像と原画像との差分である予測残差が符号化された符号化データのデータ構造であって、画素値データと、上記画素値データが示す画素値に加算するオフセットを決定するためのクラス分類方法を選択するためのクラス分類方法選択データと、を含み、上記画像復号装置は、上記クラス分類方法選択データが示すクラス分類方法に従って、対象画素のクラスを分類し、該クラスに対応するオフセットを対象画素に加算して、復号画像を生成することを特徴としている。   In order to solve the above problem, the data structure of the encoded data according to the present invention is the encoded data of the encoded data in which the prediction residual, which is the difference between the predicted image and the original image, is encoded by the image decoding apparatus. A data structure, comprising: pixel value data; and class classification method selection data for selecting a class classification method for determining an offset to be added to a pixel value indicated by the pixel value data, and the image decoding device Is characterized by classifying the class of the target pixel according to the class classification method indicated by the class classification method selection data and adding the offset corresponding to the class to the target pixel to generate a decoded image.

上記の構成によれば、クラス分類方法選択データで示されたクラス分類方法にしたがって、対象画素のクラスが分類される。そして、分類されたクラスに基づいて、対象画素にオフセットが加算される。   According to the above configuration, the class of the target pixel is classified according to the class classification method indicated by the class classification method selection data. Then, an offset is added to the target pixel based on the classified class.

よって、画素毎にクラス分類方法を選択することができるので、画素の特性に応じてクラス分類方法を選択することができる。したがって、画素の特性を反映したクラス分類方法によりクラス分類を行うことができる。   Therefore, since the class classification method can be selected for each pixel, the class classification method can be selected according to the characteristics of the pixel. Therefore, classification can be performed by a classification method that reflects the characteristics of the pixels.

また、画素の特性を反映したクラス分類方法を用いることにより、符号化効率を向上させることができる。   In addition, the coding efficiency can be improved by using a class classification method that reflects pixel characteristics.

上記課題を解決するために、本発明に係る画像フィルタ装置は、入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、上記画素値毎に、上記複数のオフセットの中から当該画素値に対し加算するオフセットを選択する方法であるオフセット選択方法を、複数の候補の中から決定するオフセット選択方法決定手段と、上記オフセット選択方法決定手段が決定したオフセット選択方法に従って、上記複数のオフセットの中からオフセットを選択するオフセット選択手段と、上記オフセット選択手段が選択したオフセットを、上記画素値に加算するフィルタ手段と、を備えていることを特徴としている。   In order to solve the above problems, an image filter device according to the present invention is an image filter device that adds an offset selected from a plurality of offsets to each pixel value of an input image, and for each pixel value, An offset selection method for determining an offset selection method for selecting an offset to be added to the pixel value from the plurality of offsets is determined by an offset selection method determination unit for determining from among a plurality of candidates and the offset selection method determination unit. An offset selection unit that selects an offset from the plurality of offsets according to an offset selection method, and a filter unit that adds the offset selected by the offset selection unit to the pixel value. .

上記の構成によれば、画素値に加算するオフセットを選択する方法であるオフセット選択方法を、複数の候補の中から決定することができる。これにより、一律に同じ方法でオフセットが加算されることなく、画素毎にオフセット選択方法を決定することができる。   According to said structure, the offset selection method which is a method of selecting the offset added to a pixel value can be determined from several candidates. Thereby, the offset selection method can be determined for each pixel without adding the offset uniformly by the same method.

よって、画素の特性に応じて、オフセット選択方法を決定することができ、画素の特性を反映したオフセット選択方法によりオフセットを加算することができる。   Therefore, the offset selection method can be determined according to the characteristics of the pixel, and the offset can be added by the offset selection method reflecting the characteristics of the pixel.

また、画素の特性を反映したオフセット選択方法を用いることにより、符号化効率を向上させることができる。   In addition, encoding efficiency can be improved by using an offset selection method that reflects pixel characteristics.

以上のように、本発明に係る画像フィルタ装置は、単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備えている構成である。   As described above, the image filter device according to the present invention selects, from among a plurality of candidates, a class classification method that is a method for determining which of a plurality of classes a pixel included in a unit area is classified into. Class classification method selection means, class classification means for classifying the pixels according to the class classification method selected by the class classification method selection means, and an offset to be added to the pixel values of the pixels classified by the class classification means An offset determining unit that determines each unit region according to a class into which the pixel is classified, and a filter unit that adds the offset determined by the offset determining unit to the pixel value of the pixel included in the unit region. It is the structure provided with.

これにより、画素の特性を反映したクラス分類方法によりクラス分類を行うことができるという効果を奏する。   Thereby, there is an effect that the classification can be performed by the classification method reflecting the characteristics of the pixels.

また、画素の特性を反映したクラス分類方法を用いることにより、符号化効率を向上させることができるという効果を奏する。   In addition, by using a class classification method that reflects the characteristics of the pixels, the encoding efficiency can be improved.

また、本発明に係る画像復号装置は、予測残差に上記予測画像を加算した加算画像に対し、単位領域毎にオフセットを加算するオフセット加算手段と、上記オフセット加算手段がオフセットを加算した画像を復号画像として出力する出力手段と、を備え、上記オフセット加算手段には、上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、が備えられている構成である。   The image decoding apparatus according to the present invention includes an offset addition unit that adds an offset for each unit region to an addition image obtained by adding the prediction image to a prediction residual, and an image obtained by adding the offset by the offset addition unit. Output means for outputting as a decoded image, and the offset adding means includes a plurality of class classification methods for determining which of the plurality of classes the pixels included in the unit area are to be classified. Class classification method selection means for selecting from among candidates, class classification means for classifying the pixels according to the class classification method selected by the class classification method selection means, and pixels of the pixels classified by the class classification means An offset determining unit that determines an offset to be added to the value for each unit region according to a class in which the pixel is classified; An offset offset determining means has determined, a configuration in which a filter means for adding the pixel values of pixels included in the unit area, is provided.

これにより、画素の特性を反映したクラス分類方法によりクラス分類を行うことができるという効果を奏する。   Thereby, there is an effect that the classification can be performed by the classification method reflecting the characteristics of the pixels.

また、画素の特性を反映したクラス分類方法を用いることにより、符号化効率を向上させることができるという効果を奏する。   In addition, by using a class classification method that reflects the characteristics of the pixels, the encoding efficiency can be improved.

また、本発明に係る画像符号化装置は、原画像を符号化し、復号した復号画像に対し、単位領域毎にオフセットを加算するオフセット加算手段と、上記オフセット加算手段がオフセットを加算した画像から上記予測画像を生成する予測画像生成手段と、上記予測画像生成手段が生成した予測画像と原画像との差分である予測残差を符号化する符号化手段と、を備え、上記オフセット加算手段には、上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、が備えられている構成である。   The image coding apparatus according to the present invention encodes an original image and adds an offset for each unit area to a decoded image, and an image obtained by adding the offset by the offset adding unit. A prediction image generation unit that generates a prediction image; and an encoding unit that encodes a prediction residual that is a difference between the prediction image generated by the prediction image generation unit and the original image, and the offset addition unit includes A class classification method selection means for selecting a class classification method, which is a method for determining which of the plurality of classes the pixels included in the unit area are to be classified, and the class classification method selection According to the class classification method selected by the means, the class classification means for classifying the pixel, and the pixel value of the pixel classified by the class classification means is added to the pixel value An offset determining unit that determines a facet for each unit region according to a class in which the pixel is classified, and a filter that adds the offset determined by the offset determining unit to the pixel value of the pixel included in the unit region Means.

これにより、画素の特性を反映したクラス分類方法によりクラス分類を行うことができるという効果を奏する。   Thereby, there is an effect that the classification can be performed by the classification method reflecting the characteristics of the pixels.

また、画素の特性を反映したクラス分類方法を用いることにより、符号化効率を向上させることができるという効果を奏する。   In addition, by using a class classification method that reflects the characteristics of the pixels, the encoding efficiency can be improved.

また、本発明に係る符号化データのデータ構造は、画素値データと、上記画素値データが示す画素値に加算するオフセットを決定するためのクラス分類方法を選択するためのクラス分類方法選択データと、を含み、上記画像復号装置は、上記クラス分類方法選択データが示すクラス分類方法に従って、対象画素のクラスを分類し、該クラスに対応するオフセットを対象画素に加算して、復号画像を生成する構成である。   The data structure of the encoded data according to the present invention includes pixel value data, class classification method selection data for selecting a class classification method for determining an offset to be added to the pixel value indicated by the pixel value data, and The image decoding device classifies the class of the target pixel according to the class classification method indicated by the class classification method selection data, and adds the offset corresponding to the class to the target pixel to generate a decoded image It is a configuration.

これにより、画素の特性を反映したクラス分類方法によりクラス分類を行うことができるという効果を奏する。   Thereby, there is an effect that the classification can be performed by the classification method reflecting the characteristics of the pixels.

また、画素の特性を反映したクラス分類方法を用いることにより、符号化効率を向上させることができるという効果を奏する。   In addition, by using a class classification method that reflects the characteristics of the pixels, the encoding efficiency can be improved.

また、本発明に係る画像フィルタ装置は、画素値毎に、上記複数のオフセットの中から当該画素値に対し加算するオフセットを選択する方法であるオフセット選択方法を、複数の候補の中から決定するオフセット選択方法決定手段と、上記オフセット選択方法決定手段が決定したオフセット選択方法に従って、上記複数のオフセットの中からオフセットを選択するオフセット選択手段と、上記オフセット選択手段が選択したオフセットを、上記画素値に加算するフィルタ手段と、を備えている構成である。   In addition, the image filter device according to the present invention determines, for each pixel value, an offset selection method that is a method for selecting an offset to be added to the pixel value from the plurality of offsets, from among a plurality of candidates. An offset selection method determination unit, an offset selection unit that selects an offset from the plurality of offsets according to the offset selection method determined by the offset selection method determination unit, and the offset selected by the offset selection unit And a filter means for adding to.

これにより、画素の特性に応じて、オフセット選択方法を決定することができ、画素の特性を反映したオフセット選択方法によりオフセットを加算することができるという効果を奏する。   Thus, the offset selection method can be determined according to the characteristics of the pixel, and the offset can be added by the offset selection method reflecting the characteristics of the pixel.

また、画素の特性を反映したオフセット選択方法を用いることにより、符号化効率を向上させることができるという効果を奏する。   In addition, by using an offset selection method that reflects the characteristics of the pixel, the encoding efficiency can be improved.

本発明の実施の形態に係る適応オフセットフィルタの構成を示すブロック図である。It is a block diagram which shows the structure of the adaptive offset filter which concerns on embodiment of this invention. 上記実施形態に係る動画像符号化装置によって生成され、動画像復号装置によって復号される符号化データのデータ構成を示す図であり、(a)〜(d)は、それぞれ、ピクチャレイヤ、スライスレイヤ、ツリーブロックレイヤ、およびCUレイヤを示す図であり、(e)はリーフでないQAOUに関するQAOU情報の構成を示す図であり、(f)はリーフのQAOUに関するQAOU情報の構成を示す図である。It is a figure which shows the data structure of the encoding data produced | generated by the moving image encoder which concerns on the said embodiment, and decoded by a moving image decoder, (a)-(d) is a picture layer and a slice layer, respectively. FIG. 4B is a diagram illustrating a configuration of QAOU information related to a QAOU of a leaf, and FIG. 5F is a diagram illustrating a configuration of QAOU information related to a QAOU of a leaf. 上記実施形態に係るオフセット情報およびQAOU情報のシンタクスを示す図であり、(a)は、(b)および(c)に示すシンタクスを呼び出す適応オフセットフィルタ全体のシンタクスを示す図である。(b)は、QAOU情報のシンタクスを示す図であり、(c)は、オフセット情報のシンタクスを示す図である。It is a figure which shows the syntax of the offset information which concerns on the said embodiment, and QAOU information, (a) is a figure which shows the syntax of the whole adaptive offset filter which calls the syntax shown in (b) and (c). (B) is a figure which shows the syntax of QAOU information, (c) is a figure which shows the syntax of offset information. 上記実施形態に係るオフセット単位の分割の態様を示す図であり、(a)はsao_depth=0の場合を示す図であり、(b)はsao_depth=1の場合を示す図であり、(c)はsao_depth=2の場合を示す図であり、(d)はsao_depth=3の場合を示す図であり、(e)はsao_depth=4の場合を示す図である。It is a figure which shows the aspect of the division | segmentation of the offset unit which concerns on the said embodiment, (a) is a figure which shows the case where sao_depth = 0, (b) is a figure which shows the case where sao_depth = 1, (c) (A) is a figure which shows the case where sao_depth = 2, (d) is a figure which shows the case where sao_depth = 3, (e) is a figure which shows the case where sao_depth = 4. 上記実施形態に係る動画像復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the moving image decoding apparatus which concerns on the said embodiment. 上記実施の形態に係るオフセット情報復号部が用いる変換テーブルの例を示す図である。It is a figure which shows the example of the conversion table which the offset information decoding part which concerns on the said embodiment uses. 上記実施形態を説明するための図であって、(a)は、対象の処理単位を構成する分割深度3の各QAOMUと各QAOMUに割り付けられたQAOUインデックスとを示す図であり、(b)は、QAOUインデックス0〜9の各々に関連付けられたオフセットタイプおよび各オフセットタイプにおいて選択可能な各クラスに関するオフセットを示す図である。It is a figure for demonstrating the said embodiment, Comprising: (a) is a figure which shows each QAOMU of the division | segmentation depth 3 which comprises the object process unit, and the QAOU index allocated to each QAOMU, (b) FIG. 10 is a diagram showing an offset type associated with each of QAOU indexes 0 to 9 and an offset for each class selectable in each offset type. 上記実施形態に係るクラス分類部の構成を示すブロック図である。It is a block diagram which shows the structure of the class classification | category part which concerns on the said embodiment. 上記実施形態に係る適応オフセットフィルタによるオフセット処理を説明するための図であって、(a)〜(d)は、それぞれ、sao_type_idx=1〜4のときに参照される画素を示す図である。It is a figure for demonstrating the offset process by the adaptive offset filter which concerns on the said embodiment, Comprising: (a)-(d) is a figure which shows the pixel referred when sao_type_idx = 1-4, respectively. 上記実施の形態に係る適応オフセットフィルタによるオフセット処理を説明するための図であって、(a)は、処理対象画素xの画素値pix[x]と画素aまたはbの画素値との大小関係を示す模式図、およびその大小関係に応じた関数Signの値を示す図であり、(b)は、処理対象画素xの画素値と、画素aおよびbの画素値との大小関係を示す模式図、およびその大小関係に応じたEdgeClassの値を示す図であり、(c)〜(d)は、EdgeClassからclass_idxへの変換を表す変換テーブルを示す図である。It is a figure for demonstrating the offset process by the adaptive offset filter which concerns on the said embodiment, Comprising: (a) is the magnitude relationship between the pixel value pix [x] of the process target pixel x, and the pixel value of the pixel a or b FIG. 5B is a schematic diagram showing the magnitude relationship between the pixel value of the pixel x to be processed and the pixel values of the pixels a and b. It is a figure which shows the value of EdgeClass according to a figure and its magnitude relationship, (c)-(d) is a figure which shows the conversion table showing the conversion from EdgeClass to class_idx. 上記実施形態に係る適応オフセットフィルタによるオフセット処理を説明するための図であって、(a)は、sao_type_idx=5であるときのクラス分類を概略的に示す図であり、(b)sao_type_idx=6であるときのクラス分類を概略的に示す図である。It is a figure for demonstrating the offset process by the adaptive offset filter which concerns on the said embodiment, Comprising: (a) is a figure which shows a class classification | category when sao_type_idx = 5 schematically, (b) sao_type_idx = 6 It is a figure which shows roughly the class classification | category when it is. 上記実施の形態において、バンドオフセットが指定された場合のクラス分類の一例を示す図であり、(a)は、成分が輝度の場合のクラス分類の一例を示す図であり、(b)は成分が色差の場合のクラス分類の一例を示す図である。(c)は成分が色差の場合のクラス分類の別の一例を示す図であり、(d)は成分が色差の場合のクラス分類のさらに別の一例を示す図である。In the said embodiment, it is a figure which shows an example of the class classification when a band offset is designated, (a) is a figure which shows an example of the class classification in case a component is a brightness | luminance, (b) is a component. It is a figure which shows an example of the class classification | category when is a color difference. (C) is a figure which shows another example of the class classification in case a component is color difference, (d) is a figure which shows another example of the class classification in case a component is color difference. 上記実施形態に係る適応オフセットフィルタ処理部による処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process by the adaptive offset filter process part which concerns on the said embodiment. 上記実施形態に係るオフセット情報復号部の構成を示すブロック図である。It is a block diagram which shows the structure of the offset information decoding part which concerns on the said embodiment. 上記実施形態に係る動画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the moving image encoder which concerns on the said embodiment. 上記実施形態に係る動画像符号化装置の備える適応オフセットフィルタの構成を示すブロック図である。It is a block diagram which shows the structure of the adaptive offset filter with which the moving image encoder which concerns on the said embodiment is provided. 上記実施形態に係る動画像符号化装置の備える適応オフセットフィルタのオフセット算出部による処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process by the offset calculation part of the adaptive offset filter with which the moving image encoder which concerns on the said embodiment is provided. 上記実施形態において、対象の処理単位に含まれるQAOMUに付されたQAOMU番号の一例を示す図であって、(a)は、分割深度が0であるQAOMUに付されたQAOMU番号を示す図であり、(b)は、分割深度が1であるQAOMUに付されたQAOMU番号を示す図であり、(c)は、分割深度が2であるQAOMUに付されたQAOMU番号を示す図であり、(d)は、分割深度が3であるQAOMUに付されたQAOMU番号を示す図であり、(e)は、分割深度が4であるQAOMUに付されたQAOMU番号を示す図である。In the said embodiment, it is a figure which shows an example of the QAOMU number attached | subjected to QAOMU contained in the process unit of object, Comprising: (a) is a figure which shows the QAOMU number attached | subjected to QAOMU whose division depth is 0. (B) is a diagram showing a QAOMU number assigned to a QAOMU having a division depth of 1, and (c) is a diagram showing a QAOMU number attached to a QAOMU having a division depth of 2. (D) is a figure which shows the QAOMU number attached | subjected to QAOMU with a division | segmentation depth of 3, (e) is a figure which shows the QAOMU number attached | subjected to QAOMU with a division | segmentation depth of 4. FIG. 上記実施形態に係る動画像符号化装置の備える適応オフセットフィルタのオフセット情報選択部による処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process by the offset information selection part of the adaptive offset filter with which the moving image encoder which concerns on the said embodiment is provided. 上記実施の形態において、QAOUインデックスが「q」のQAOUについて、オフセットタイプそれぞれについての2乗誤差を算出する概要を示す図である。In the said embodiment, it is a figure which shows the outline | summary which calculates the square error about each offset type about QAOU whose QAOU index is "q". 上記実施形態に係る動画像符号化装置の備える適応オフセットフィルタのオフセット情報選択部による処理を説明するための図であって、(a)は、分割深度が0および1である場合の分割の態様を示す図であり、(b)は、分割深度が1である場合の分割の態様を示す図であり、(c)は、分割深度が2である場合の分割の態様を示す図であり、(d)は、オフセット情報選択部によって決定された分割の一例を示す図である。It is a figure for demonstrating the process by the offset information selection part of the adaptive offset filter with which the moving image encoder which concerns on the said embodiment is provided, Comprising: (a) is the aspect of a division | segmentation in case the division | segmentation depth is 0 and 1 (B) is a diagram showing an aspect of division when the division depth is 1, and (c) is a diagram showing an aspect of division when the division depth is 2. (D) is a figure which shows an example of the division | segmentation determined by the offset information selection part. 上記実施の形態において、画素値の適応クリップ処理の例を示す図である。In the said embodiment, it is a figure which shows the example of the adaptive clip process of a pixel value. 動画像復号装置および動画像符号化装置が、動画像の送受信に利用できることを説明するための図であり、(a)は、動画像符号化装置を搭載した送信装置の構成を示したブロック図であり、(b)は、動画像復号装置を搭載した受信装置の構成を示したブロック図である。It is a figure for demonstrating that a moving image decoding apparatus and a moving image coding apparatus can be utilized for transmission / reception of a moving image, (a) is the block diagram which showed the structure of the transmission device carrying a moving image coding apparatus (B) is a block diagram showing a configuration of a receiving apparatus equipped with a moving picture decoding apparatus. 動画像復号装置および動画像符号化装置が、動画像の記録および再生に利用できることを説明するための図であり、(a)は、動画像符号化装置2を搭載した記録装置の構成を示したブロック図であり、(b)は、動画像復号装置を搭載した再生装置の構成を示したブロックである。It is a figure for demonstrating that a moving image decoding apparatus and a moving image encoding apparatus can be utilized for recording and reproduction | regeneration of a moving image, (a) shows the structure of the recording device carrying the moving image encoding apparatus 2. FIG. 8B is a block diagram illustrating a configuration of a playback device equipped with a video decoding device. 上記実施形態に係る動画像復号装置の備えるオフセット加算部の構成を示すブロック図である。It is a block diagram which shows the structure of the offset addition part with which the moving image decoding apparatus which concerns on the said embodiment is provided. 上記実施形態に係る動画像符号化装置によって生成され、動画像復号装置によって復号される符号化データのデータ構成の別の例のリーフのQAOUに関するQAOU情報の構成を示す図である。It is a figure which shows the structure of the QAOU information regarding QAOU of the leaf of another example of the data structure of the coding data produced | generated by the moving image encoder which concerns on the said embodiment, and decoded by a moving image decoder. 上記実施形態に係る動画像復号装置の備える適応オフセットフィルタによるオフセット処理を説明するための図であって、(a)はオフセットとして加算される値の範囲を示す図であり、(b)はオフセット加算によって演算結果が画素値の下限を下回る場合を示す図であり、(c)はオフセット加算によって演算結果が画素値の上限を超える場合を示す図である。It is a figure for demonstrating the offset process by the adaptive offset filter with which the moving image decoding apparatus which concerns on the said embodiment is provided, Comprising: (a) is a figure which shows the range of the value added as offset, (b) is an offset. It is a figure which shows the case where a calculation result is less than the minimum of a pixel value by addition, (c) is a figure which shows the case where a calculation result exceeds the upper limit of a pixel value by offset addition. 上記実施形態において、オフセット制限領域の設定例を示す図である。In the said embodiment, it is a figure which shows the example of a setting of an offset restriction area. 上記実施形態において、バンドオフセットが指定された場合のクラス分類の別の例を示す図であり、(a)は、オフセット制限領域を無効クラス(クラス0)とする場合の一例を示す図であり、(b)は従来技術とオフセット制限領域を用いる場合とを併用する例を示す図である。In the said embodiment, it is a figure which shows another example of the class classification | category when band offset is designated, (a) is a figure which shows an example in case an offset restriction area | region is made into an invalid class (class 0). (B) is a figure which shows the example which uses together a prior art and the case where an offset restriction | limiting area | region is used. 上記実施形態において、オフセット制限領域の別の設定例を示す図である。In the said embodiment, it is a figure which shows another example of a setting of an offset restriction area | region. (a)〜(c)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類の別の例を示す図である。(A)-(c) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類の別の例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment. 上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図である。In the said embodiment, it is a figure which shows another example of the class classification | category when a band offset is designated. 上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図である。In the said embodiment, it is a figure which shows another example of the class classification | category when a band offset is designated. (a)、(b)は、上記実施形態において、輝度と色差とで、別の量子化方法によってバンドインデックスを算出する方法を示す図である。(A), (b) is a figure which shows the method of calculating a band index by another quantization method with a brightness | luminance and a color difference in the said embodiment. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、色差のクラス分類において、値の小さな範囲および値の大きな範囲を、オフセットを加算しないクラスに分類する例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, In a color difference class classification, the range with a small value and the range with a large value It is a figure which shows the example which classifies | categorizes into the class which does not add offset. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、色差のクラス分類において、値の小さな範囲および値の大きな範囲において広い範囲の値を同じクラスに分類する例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, In a color difference class classification, the range with a small value and the range with a large value It is a figure which shows the example which classify | categorizes the value of a wide range in the same class. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、色差のクラス分類において、中心値およびその付近の画素値の分類を、中心から離れた画素値の分類よりも細かく分類する例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, and the center value and the pixel value of the vicinity of it in a color difference class classification | category are shown. It is a figure which shows the example classified more finely than the classification of the pixel value away from the center. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、色差のクラス分類において、中心値およびその付近の画素値の分類を、中心から離れた画素値の分類よりも細かく分類する例を別の示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, and the center value and the pixel value of the vicinity of it in a color difference class classification | category are shown. It is another figure which shows another example which classify | categorizes finer than the classification of the pixel value away from the center. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、色差のクラス分類において、中心値およびその付近の画素値をオフセットを加算するクラスに分類するクラス分類を、複数のクラス分類の先頭のクラス分類として用いる例を示す別の図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, In the class classification of a color difference, a center value and the pixel value of the vicinity are shown. It is another figure which shows the example which uses the class classification classified into the class which adds an offset as a top class classification of several class classification. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、中心値およびその付近の画素値から離れた画素値を分類するクラス分類において、いずれも量子化された画素値X1、画素値X2、画素値X3(X1<X2<X3)について、互いに隣接しない画素値X1とX3を、X2を分類するクラスとは異なる同じクラスに分類する例を示す図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, and classify | categorizes the pixel value away from the center value and its vicinity pixel value In the class classification, the quantized pixel value X1, pixel value X2, and pixel value X3 (X1 <X2 <X3) are different from the class that classifies X2 as pixel values X1 and X3 that are not adjacent to each other. It is a figure which shows the example classified into a class. (a)、(b)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、中心値およびその付近の画素値から離れた画素値を分類するクラス分類において、いずれも量子化された画素値X1、画素値X2、画素値X3(X1<X2<X3)について、互いに隣接しない画素値X1とX3を、X2を分類するクラスとは異なる同じクラスに分類する例を示す別の図である。(A), (b) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, and classify | categorizes the pixel value away from the center value and its vicinity pixel value In the class classification, the quantized pixel value X1, pixel value X2, and pixel value X3 (X1 <X2 <X3) are different from the class that classifies X2 as pixel values X1 and X3 that are not adjacent to each other. It is another figure which shows the example classified into a class. (a)〜(c)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、中心値およびその付近の画素値から離れた画素値を分類するクラス分類において、いずれも量子化された画素値X1、画素値X2、画素値X3(X1<X2<X3)について、互いに隣接しない画素値X1とX3を、X2を分類するクラスとは異なる同じクラスに分類する例を示す別の図である。(A)-(c) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, and classify | categorizes the pixel value away from the center value and its vicinity pixel value In the class classification, the quantized pixel value X1, pixel value X2, and pixel value X3 (X1 <X2 <X3) are different from the class that classifies X2 as pixel values X1 and X3 that are not adjacent to each other. It is another figure which shows the example classified into a class. (a)〜(c)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、中心値およびその付近の画素値から離れた画素値を分類するクラス分類において、いずれも量子化された画素値X1、画素値X2、画素値X3(X1<X2<X3)について、互いに隣接しない画素値X1とX3を、X2を分類するクラスとは異なる同じクラスに分類する例を示す別の図である。(A)-(c) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, and classify | categorizes the pixel value away from the center value and its vicinity pixel value In the class classification, the quantized pixel value X1, pixel value X2, and pixel value X3 (X1 <X2 <X3) are different from the class that classifies X2 as pixel values X1 and X3 that are not adjacent to each other. It is another figure which shows the example classified into a class. (a)〜(c)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、中心値およびその付近の画素値から離れた画素値を分類するクラス分類において、いずれも量子化された画素値X1、画素値X2、画素値X3(X1<X2<X3)について、互いに隣接しない画素値X1とX3を、X2を分類するクラスとは異なる同じクラスに分類する例を示す別の図である。(A)-(c) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, and classify | categorizes the pixel value away from the center value and its vicinity pixel value In the class classification, the quantized pixel value X1, pixel value X2, and pixel value X3 (X1 <X2 <X3) are different from the class that classifies X2 as pixel values X1 and X3 that are not adjacent to each other. It is another figure which shows the example classified into a class. (a)〜(c)は、上記実施形態において、バンドオフセットが指定された場合のクラス分類のさらに別の例を示す図であり、中心値およびその付近の画素値から離れた画素値を分類するクラス分類において、いずれも量子化された画素値X1、画素値X2、画素値X3(X1<X2<X3)について、互いに隣接しない画素値X1とX3を、X2を分類するクラスとは異なる同じクラスに分類する例を示す別の図である。(A)-(c) is a figure which shows another example of the class classification | category in case the band offset is designated in the said embodiment, and classify | categorizes the pixel value away from the center value and its vicinity pixel value In the class classification, the quantized pixel value X1, pixel value X2, and pixel value X3 (X1 <X2 <X3) are different from the class that classifies X2 as pixel values X1 and X3 that are not adjacent to each other. It is another figure which shows the example classified into a class.

〔実施の形態1〕
(符号化データ#1)
本実施形態に係る動画像符号化装置2および動画像復号装置1の詳細な説明に先立って、動画像符号化装置2によって生成され、動画像復号装置1によって復号される符号化データ#1のデータ構造について説明する。
[Embodiment 1]
(Encoded data # 1)
Prior to detailed description of the video encoding device 2 and the video decoding device 1 according to the present embodiment, the encoded data # 1 generated by the video encoding device 2 and decoded by the video decoding device 1 is described. The data structure will be described.

図2は、符号化データ#1のデータ構造を示す図である。符号化データ#1は、例示的に、シーケンス、およびシーケンスを構成する複数のピクチャを含む。図2の(a)〜(d)は、それぞれ、ピクチャPICTを規定するピクチャレイヤ、スライスSを規定するスライスレイヤ、ツリーブロック(Tree block)TBLKを規定するツリーブロックレイヤ、ツリーブロックTBLKに含まれる符号化単位(Coding Unit;CU)を規定するCUレイヤを示す図である。   FIG. 2 is a diagram illustrating a data structure of the encoded data # 1. The encoded data # 1 exemplarily includes a sequence and a plurality of pictures constituting the sequence. 2A to 2D are included in the picture layer that defines the picture PICT, the slice layer that defines the slice S, the tree block layer that defines the tree block TBLK, and the tree block TBLK, respectively. It is a figure which shows the CU layer which prescribes | regulates a coding unit (Coding Unit; CU).

(ピクチャレイヤ)
ピクチャレイヤでは、処理対象のピクチャPICT(以下、対象ピクチャとも称する)を復号するために動画像復号装置1が参照するデータの集合が規定されている。ピクチャPICTは、図2の(a)に示すように、ピクチャヘッダPH、および、スライスS1〜SNSを含んでいる(NSはピクチャPICTに含まれるスライスの総数)。
(Picture layer)
In the picture layer, a set of data referred to by the video decoding device 1 for decoding a picture PICT to be processed (hereinafter also referred to as a target picture) is defined. As shown in FIG. 2A, the picture PICT includes a picture header PH and slices S1 to SNS (NS is the total number of slices included in the picture PICT).

なお、以下、スライスS1〜SNSのそれぞれを区別する必要が無い場合、符号の添え字を省略して記述することがある。また、以下に説明する符号化データ#1に含まれるデータであって、添え字を付している他のデータについても同様である。   Hereinafter, when it is not necessary to distinguish each of the slices S1 to SNS, the subscripts may be omitted. The same applies to other data with subscripts included in encoded data # 1 described below.

ピクチャヘッダPHには、対象ピクチャの復号方法を決定するために動画像復号装置1が参照する符号化パラメータ群が含まれている。例えば、動画像符号化装置2が符号化の際に用いた可変長符号化のモードを示す符号化モード情報(entropy_coding_mode_flag)は、ピクチャヘッダPHに含まれる符号化パラメータの一例である。   The picture header PH includes a coding parameter group that is referred to by the video decoding device 1 in order to determine a decoding method of the target picture. For example, the encoding mode information (entropy_coding_mode_flag) indicating the variable length encoding mode used in encoding by the moving image encoding device 2 is an example of an encoding parameter included in the picture header PH.

entropy_coding_mode_flagが0の場合、当該ピクチャPICTは、CAVLC(Context-based Adaptive Variable Length Coding)によって符号化されている。また、entropy_coding_mode_flagが1である場合、当該ピクチャPICTは、CABAC(Context-based Adaptive Binary Arithmetic Coding)によって符号化されている。   When entropy_coding_mode_flag is 0, the picture PICT is encoded by CAVLC (Context-based Adaptive Variable Length Coding). When entropy_coding_mode_flag is 1, the picture PICT is encoded by CABAC (Context-based Adaptive Binary Arithmetic Coding).

なお、ピクチャPICTは、ピクチャヘッダPHの他に、ピクチャパラメータセット(PPS:Picture Parameter Set)を含む構成であってもよい。   Note that the picture PICT may include a picture parameter set (PPS) in addition to the picture header PH.

(スライスレイヤ)
スライスレイヤでは、処理対象のスライスS(対象スライスとも称する)を復号するために動画像復号装置1が参照するデータの集合が規定されている。スライスSは、図2の(b)に示すように、スライスヘッダSH、および、ツリーブロックTBLK1〜TBLKNC(NCはスライスSに含まれるツリーブロックの総数)のシーケンスを含んでいる。
(Slice layer)
In the slice layer, a set of data referred to by the video decoding device 1 for decoding the slice S to be processed (also referred to as a target slice) is defined. As shown in FIG. 2B, the slice S includes a slice header SH and a sequence of tree blocks TBLK1 to TBLKNC (NC is the total number of tree blocks included in the slice S).

スライスヘッダSHには、対象スライスの復号方法を決定するために動画像復号装置1が参照する符号化パラメータ群が含まれる。スライスタイプを指定するスライスタイプ指定情報(slice_type)は、スライスヘッダSHに含まれる符号化パラメータの一例である。   The slice header SH includes an encoding parameter group that is referred to by the video decoding device 1 in order to determine a decoding method of the target slice. Slice type designation information (slice_type) for designating a slice type is an example of an encoding parameter included in the slice header SH.

スライスタイプ指定情報により指定可能なスライスタイプとしては、(1)符号化の際にイントラ予測のみを用いるIスライス、(2)符号化の際に単方向予測、または、イントラ予測を用いるPスライス、(3)符号化の際に単方向予測、双方向予測、または、イントラ予測を用いるBスライスなどが挙げられる。   As slice types that can be specified by the slice type specification information, (1) I slice using only intra prediction at the time of encoding, (2) P slice using unidirectional prediction or intra prediction at the time of encoding, (3) B-slice using unidirectional prediction, bidirectional prediction, or intra prediction at the time of encoding may be used.

また、スライスヘッダSHには、動画像復号装置1の備える適応フィルタによって参照されるフィルタパラメータFPが含まれている。なお、フィルタパラメータFPは、ピクチャヘッダPH、またはピクチャパラメータセットPPSに含まれる構成としてもよい。   In addition, the slice header SH includes a filter parameter FP that is referred to by an adaptive filter included in the video decoding device 1. The filter parameter FP may be included in the picture header PH or the picture parameter set PPS.

(ツリーブロックレイヤ)
ツリーブロックレイヤでは、処理対象のツリーブロックTBLK(以下、対象ツリーブロックとも称する)を復号するために動画像復号装置1が参照するデータの集合が規定されている。なお、ツリーブロックのことを最大符号化単位(LCU:Largest Cording Unit)と呼ぶこともある。
(Tree block layer)
In the tree block layer, a set of data referred to by the video decoding device 1 for decoding a processing target tree block TBLK (hereinafter also referred to as a target tree block) is defined. Note that a tree block may be referred to as a maximum coding unit (LCU).

ツリーブロックTBLKは、ツリーブロックヘッダTBLKHと、符号化単位情報CU1〜CUNL(NLはツリーブロックTBLKに含まれる符号化単位情報の総数)とを含む。ここで、まず、ツリーブロックTBLKと、符号化単位情報CUとの関係について説明すると次のとおりである。   The tree block TBLK includes a tree block header TBLKH and coding unit information CU1 to CUNL (NL is the total number of coding unit information included in the tree block TBLK). Here, first, a relationship between the tree block TBLK and the coding unit information CU will be described as follows.

ツリーブロックTBLKは、イントラ予測またはインター予測、および、変換の各処理で用いるブロックサイズを特定するためのユニットに分割される。   The tree block TBLK is divided into units for specifying a block size used in each process of intra prediction or inter prediction and conversion.

ツリーブロックTBLKの上記ユニットは、再帰的な4分木分割により分割されている。この再帰的な4分木分割により得られる木構造のことを以下、符号化ツリー(coding tree)と称する。   The unit of the tree block TBLK is divided by recursive quadtree division. The tree structure obtained by this recursive quadtree partitioning is hereinafter referred to as a coding tree.

以下、符号化ツリーの末端のノードであるリーフ(leaf)に対応するユニットを、符号化ノード(coding node)として参照する。また、符号化ノードは、符号化処理の基本的な単位となるため、以下、符号化ノードのことを、符号化単位(CU)とも称する。   Hereinafter, a unit corresponding to a leaf which is a node at the end of the coding tree is referred to as a coding node. In addition, since the encoding node is a basic unit of the encoding process, hereinafter, the encoding node is also referred to as an encoding unit (CU).

つまり、符号化単位情報(以下、CU情報と称する)CU1〜CUNLは、ツリーブロックTBLKを再帰的に4分木分割して得られる各符号化ノード(符号化単位)に対応する情報である。   That is, encoding unit information (hereinafter referred to as CU information) CU1 to CUNL is information corresponding to each encoding node (coding unit) obtained by recursively dividing the tree block TBLK into quadtrees.

また、符号化ツリーのルート(root)は、ツリーブロックTBLKに対応付けられる。換言すれば、ツリーブロックTBLKは、複数の符号化ノードを再帰的に含む4分木分割の木構造の最上位ノードに対応付けられる。   Also, the root of the coding tree is associated with the tree block TBLK. In other words, the tree block TBLK is associated with the highest node of the tree structure of the quadtree partition that recursively includes a plurality of encoding nodes.

なお、各符号化ノードに対応する画像領域のサイズは、当該符号化ノードが直接に属する符号化ノード(すなわち、当該符号化ノードの1階層上位のノードのユニット)のサイズの縦横とも半分である。   Note that the size of the image area corresponding to each coding node is half the size of the coding node to which the coding node directly belongs (that is, the unit of the node one level higher than the coding node). .

また、各符号化ノードのとり得るサイズは、符号化データ#1のシーケンスパラメータセットSPSに含まれる、符号化ノードのサイズ指定情報および最大階層深度(maximum hierarchical depth)に依存する。例えば、ツリーブロックTBLKのサイズが64×64画素であって、最大階層深度が3である場合には、当該ツリーブロックTBLK以下の階層における符号化ノードは、4種類のサイズ、すなわち、64×64画素、32×32画素、16×16画素、および8×8画素の何れかをとり得る。   The size that each coding node can take depends on the size designation information and the maximum hierarchical depth of the coding node included in the sequence parameter set SPS of the coded data # 1. For example, when the size of the tree block TBLK is 64 × 64 pixels and the maximum hierarchical depth is 3, the coding nodes in the hierarchy below the tree block TBLK have four sizes, that is, 64 × 64. Any of pixel, 32 × 32 pixel, 16 × 16 pixel, and 8 × 8 pixel can be taken.

また、ブロック構造としては、スライスSが分割されて、ツリーブロックTBLKが形成され、ツリーブロックTBLKが分割されて符号化単位CUが形成されている。   As a block structure, a slice S is divided to form a tree block TBLK, and the tree block TBLK is divided to form a coding unit CU.

(ツリーブロックヘッダ)
ツリーブロックヘッダTBLKHには、対象ツリーブロックの復号方法を決定するために動画像復号装置1が参照する符号化パラメータが含まれる。具体的には、図2の(c)に示すように、対象ツリーブロックの各CUへの分割パターンを指定するツリーブロック分割情報SP_TBLK、および、量子化ステップの大きさを指定する量子化パラメータ差分Δqp(qp_delta)が含まれる。
(Tree block header)
The tree block header TBLKH includes an encoding parameter referred to by the video decoding device 1 in order to determine a decoding method of the target tree block. Specifically, as shown in FIG. 2C, tree block division information SP_TBLK that designates a division pattern of the target tree block into each CU, and a quantization parameter difference that designates the size of the quantization step. Δqp (qp_delta) is included.

ツリーブロック分割情報SP_TBLKは、ツリーブロックを分割するための符号化ツリーを表す情報であり、具体的には、対象ツリーブロックに含まれる各CUの形状、サイズ、および、対象ツリーブロック内での位置を指定する情報である。   The tree block division information SP_TBLK is information representing a coding tree for dividing the tree block. Specifically, the shape and size of each CU included in the target tree block, and the position in the target tree block Is information to specify.

なお、ツリーブロック分割情報SP_TBLKは、CUの形状やサイズを明示的に含んでいなくてもよい。例えばツリーブロック分割情報SP_TBLKは、対象ツリーブロック全体またはツリーブロックの部分領域を四分割するか否かを示すフラグ(split_coding_unit_flag)の集合であってもよい。この場合、ツリーブロックの形状やサイズを併用することで各CUの形状やサイズを特定できる。   Note that the tree block division information SP_TBLK may not explicitly include the shape or size of the CU. For example, the tree block division information SP_TBLK may be a set of flags (split_coding_unit_flag) indicating whether or not the entire target tree block or a partial area of the tree block is divided into four. In this case, the shape and size of each CU can be specified by using the shape and size of the tree block together.

また、量子化パラメータ差分Δqpは、対象ツリーブロックにおける量子化パラメータqpと、当該対象ツリーブロックの直前に符号化されたツリーブロックにおける量子化パラメータqp’との差分qp−qp’である。   The quantization parameter difference Δqp is a difference qp−qp ′ between the quantization parameter qp in the target tree block and the quantization parameter qp ′ in the tree block encoded immediately before the target tree block.

(CUレイヤ)
CUレイヤでは、処理対象のCU(以下、対象CUとも称する)を復号するために動画像復号装置1が参照するデータの集合が規定されている。
(CU layer)
In the CU layer, a set of data referred to by the video decoding device 1 for decoding a CU to be processed (hereinafter also referred to as a target CU) is defined.

ここで、CU情報CUに含まれるデータの具体的な内容の説明をする前に、CUに含まれるデータの木構造について説明する。符号化ノードは、予測ツリー(prediction tree;PT)および変換ツリー(transform tree;TT)のルートとなる。予測ツリーおよび変換ツリーについて説明すると次のとおりである。   Here, before describing specific contents of data included in the CU information CU, a tree structure of data included in the CU will be described. The encoding node is the root of a prediction tree (PT) and a transform tree (TT). The prediction tree and the conversion tree are described as follows.

予測ツリーにおいては、符号化ノードが1または複数の予測ブロックに分割され、各予測ブロックの位置とサイズとが規定される。別の表現でいえば、予測ブロックは、符号化ノードを構成する1または複数の重複しない領域である。また、予測ツリーは、上述の分割により得られた1または複数の予測ブロックを含む。   In the prediction tree, the encoding node is divided into one or a plurality of prediction blocks, and the position and size of each prediction block are defined. In other words, the prediction block is one or a plurality of non-overlapping areas constituting the encoding node. The prediction tree includes one or a plurality of prediction blocks obtained by the above division.

予測処理は、この予測ブロックごとに行われる。以下、予測の単位である予測ブロックのことを、予測単位(prediction unit;PU)とも称する。   Prediction processing is performed for each prediction block. Hereinafter, a prediction block that is a unit of prediction is also referred to as a prediction unit (PU).

予測ツリーにおける分割の種類は、大まかにいえば、イントラ予測の場合と、インター予測の場合との2つがある。   Broadly speaking, there are two types of division in the prediction tree: intra prediction and inter prediction.

イントラ予測の場合、分割方法は、2N×2N(符号化ノードと同一サイズ)と、N×Nとがある。   In the case of intra prediction, there are 2N × 2N (the same size as the encoding node) and N × N division methods.

また、インター予測の場合、分割方法は、2N×2N(符号化ノードと同一サイズ)、2N×N、N×2N、および、N×Nなどがある。   In the case of inter prediction, there are 2N × 2N (the same size as the encoding node), 2N × N, N × 2N, N × N, and the like.

また、変換ツリーにおいては、符号化ノードが1または複数の変換ブロックに分割され、各変換ブロックの位置とサイズとが規定される。別の表現でいえば、変換ブロックは、符号化ノードを構成する1または複数の重複しない領域のことである。また、変換ツリーは、上述の分割より得られた1または複数の変換ブロックを含む。   In the transform tree, the encoding node is divided into one or a plurality of transform blocks, and the position and size of each transform block are defined. In other words, the transform block is one or a plurality of non-overlapping areas constituting the encoding node. The conversion tree includes one or a plurality of conversion blocks obtained by the above division.

変換ツリーにおける分割には、符号化ノードと同一のサイズの領域を変換ブロックとして割り付けるものと、上述したツリーブロックの分割と同様、再帰的な4分木分割によるものがある。   There are two types of division in the transformation tree: one in which an area having the same size as that of a coding node is assigned as a transformation block, and the other in division by recursive quadtree division as in the above-described division of a tree block.

変換処理は、この変換ブロックごとに行われる。以下、変換の単位である変換ブロックのことを、変換単位(transform unit;TU)とも称する。   The conversion process is performed for each conversion block. Hereinafter, a transform block that is a unit of transform is also referred to as a transform unit (TU).

(CU情報のデータ構造)
続いて、図2の(d)を参照しながらCU情報CUに含まれるデータの具体的な内容について説明する。図2の(d)に示すように、CU情報CUは、具体的には、スキップフラグSKIP、PT情報PTI、および、TT情報TTIを含んでいる。
(Data structure of CU information)
Next, specific contents of data included in the CU information CU will be described with reference to FIG. As shown in FIG. 2D, the CU information CU specifically includes a skip flag SKIP, PT information PTI, and TT information TTI.

スキップフラグSKIPは、対象のCUについて、スキップモードが適用されているか否かを示すフラグであり、スキップフラグSKIPの値が1の場合、すなわち、対象CUにスキップモードが適用されている場合、そのCU情報CUにおけるPT情報PTI、および、TT情報TTIは省略される。なお、スキップフラグSKIPは、Iスライスでは省略される。   The skip flag SKIP is a flag indicating whether or not the skip mode is applied to the target CU. When the value of the skip flag SKIP is 1, that is, when the skip mode is applied to the target CU, PT information PTI and TT information TTI in the CU information CU are omitted. Note that the skip flag SKIP is omitted for the I slice.

PT情報PTIは、CUに含まれるPTに関する情報である。換言すれば、PT情報PTIは、PTに含まれる1または複数のPUそれぞれに関する情報の集合であり、動画像復号装置1により予測画像を生成する際に参照される。PT情報PTIは、図2の(d)に示すように、予測タイプ情報PType、および、予測情報PInfoを含んでいる。   The PT information PTI is information related to the PT included in the CU. In other words, the PT information PTI is a set of information regarding each of one or a plurality of PUs included in the PT, and is referred to when the moving image decoding apparatus 1 generates a predicted image. As shown in FIG. 2D, the PT information PTI includes prediction type information PType and prediction information PInfo.

予測タイプ情報PTypeは、対象PUについての予測画像生成方法として、イントラ予測を用いるのか、または、インター予測を用いるのかを指定する情報である。   The prediction type information PType is information that specifies whether intra prediction or inter prediction is used as a predicted image generation method for the target PU.

予測情報PInfoは、予測タイプ情報PTypeが何れの予測方法を指定するのかに応じて、イントラ予測情報、または、インター予測情報より構成される。以下では、イントラ予測が適用されるPUをイントラPUとも呼称し、インター予測が適用されるPUをインターPUとも呼称する。   The prediction information PInfo is configured from intra prediction information or inter prediction information depending on which prediction method is specified by the prediction type information PType. Hereinafter, a PU to which intra prediction is applied is also referred to as an intra PU, and a PU to which inter prediction is applied is also referred to as an inter PU.

また、予測情報PInfoは、対象PUの形状、サイズ、および、位置を指定する情報が含まれる。上述のとおり予測画像の生成は、PUを単位として行われる。予測情報PInfoの詳細については後述する。   Further, the prediction information PInfo includes information specifying the shape, size, and position of the target PU. As described above, the generation of the predicted image is performed in units of PU. Details of the prediction information PInfo will be described later.

TT情報TTIは、CUに含まれるTTに関する情報である。換言すれば、TT情報TTIは、TTに含まれる1または複数のTUそれぞれに関する情報の集合であり、動画像復号装置1により残差データを復号する際に参照される。なお、以下、TUのことをブロックと称することもある。   The TT information TTI is information regarding the TT included in the CU. In other words, the TT information TTI is a set of information regarding each of one or a plurality of TUs included in the TT, and is referred to when the moving image decoding apparatus 1 decodes residual data. Hereinafter, a TU may be referred to as a block.

TT情報TTIは、図2の(d)に示すように、対象CUの各変換ブロックへの分割パターンを指定するTT分割情報SP_TT、および、量子化予測残差QD1〜QDNT(NTは、対象CUに含まれるブロックの総数)を含んでいる。   As shown in FIG. 2 (d), the TT information TTI includes TT division information SP_TT that designates a division pattern for each transform block of the target CU, and quantized prediction residuals QD1 to QDNT (NT is a target CU). The total number of blocks contained in).

TT分割情報SP_TTは、具体的には、対象CUに含まれる各TUの形状、サイズ、および、対象CU内での位置を決定するための情報である。例えば、TT分割情報SP_TTは、対象となるノードの分割を行うのか否かを示す情報(split_transform_unit_flag)と、その分割の深度を示す情報(trafoDepth)とから実現することができる。なお、TT分割情報SP_TTは、基本的には四分木の各ノードに対して符号化されるが、変換サイズに関する制約(最大変換サイズ、最小変換サイズ、四分木の最大階層深度)に応じて省略されて推定される場合もある。   Specifically, the TT division information SP_TT is information for determining the shape and size of each TU included in the target CU and the position within the target CU. For example, the TT division information SP_TT can be realized from information (split_transform_unit_flag) indicating whether or not the target node is divided and information (trafoDepth) indicating the division depth. The TT partition information SP_TT is basically encoded for each node of the quadtree, but depends on restrictions on the transform size (maximum transform size, minimum transform size, maximum hierarchy depth of the quadtree). May be omitted and estimated.

各量子化予測残差QDは、動画像符号化装置2が以下の処理1〜3を、処理対象のブロックである対象ブロックに施すことによって生成した符号化データである。   Each quantized prediction residual QD is encoded data generated by the video encoding device 2 performing the following processes 1 to 3 on a target block that is a processing target block.

処理1:符号化対象画像から予測画像を減算した予測残差を周波数領域に直交変換(DCT変換(Discrete Cosine Transform)またはDST変換(Discrete Sine Transform)する;
処理2:処理1にて得られた変換係数を量子化する;
処理3:処理2にて量子化された変換係数を可変長符号化する;
なお、上述した量子化パラメータqpは、動画像符号化装置2が変換係数を量子化する際に用いた量子化ステップQPの大きさを表す(QP=2qp/6)。
Process 1: The prediction residual obtained by subtracting the prediction image from the encoding target image is orthogonally transformed (DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform)) into the frequency domain;
Process 2: Quantize the transform coefficient obtained in Process 1;
Process 3: Variable length coding is performed on the transform coefficient quantized in Process 2;
The quantization parameter qp described above represents the magnitude of the quantization step QP used when the moving image encoding apparatus 2 quantizes the transform coefficient (QP = 2qp / 6).

(予測情報PInfo)
上述のとおり、予測情報PInfoには、インター予測情報およびイントラ予測情報の2種類がある。
(Prediction information PInfo)
As described above, there are two types of prediction information PInfo: inter prediction information and intra prediction information.

インター予測情報には、動画像復号装置1が、インター予測によってインター予測画像を生成する際に参照される符号化パラメータが含まれる。より具体的には、インター予測情報には、対象CUの各インターPUへの分割パターンを指定するインターPU分割情報、および、各インターPUについてのインター予測パラメータが含まれる。   The inter prediction information includes a coding parameter that is referred to when the video decoding device 1 generates an inter prediction image by inter prediction. More specifically, the inter prediction information includes inter PU division information that specifies a division pattern of the target CU into each inter PU, and inter prediction parameters for each inter PU.

インター予測パラメータには、参照画像インデックスと、推定動きベクトルインデックスと、動きベクトル残差とが含まれる。   The inter prediction parameters include a reference image index, an estimated motion vector index, and a motion vector residual.

一方、イントラ予測情報には、動画像復号装置1が、イントラ予測によってイントラ予測画像を生成する際に参照される符号化パラメータが含まれる。より具体的には、イントラ予測情報には、対象CUの各イントラPUへの分割パターンを指定するイントラPU分割情報、および、各イントラPUについてのイントラ予測パラメータが含まれる。イントラ予測パラメータは、各イントラPUについてのイントラ予測方法(予測モード)を指定するためのパラメータである。   On the other hand, the intra prediction information includes an encoding parameter that is referred to when the video decoding device 1 generates an intra predicted image by intra prediction. More specifically, the intra prediction information includes intra PU division information that specifies a division pattern of the target CU into each intra PU, and intra prediction parameters for each intra PU. The intra prediction parameter is a parameter for designating an intra prediction method (prediction mode) for each intra PU.

(オフセット単位)
また、本実施形態において、各ピクチャまたは各スライスは、4分木構造によって複数のオフセット単位(単位領域、QAOU:Quad Adaptive Offset Unitとも呼ぶ)に再帰的に分割される。ここで、QAOUとは、本実施形態に係る適応オフセットフィルタによるオフセットフィルタ処理の処理単位である。
(Offset unit)
In the present embodiment, each picture or each slice is recursively divided into a plurality of offset units (unit area, also referred to as QAOU: Quad Adaptive Offset Unit) by a quadtree structure. Here, QAOU is a processing unit of offset filter processing by the adaptive offset filter according to the present embodiment.

図2(e)、および(f)に示すように、各QAOUに関する情報であるQAOU情報は、自身(自QAOU)が更に分割されるのか否かを示すsao_split_flagを含んでいる。あるQAOUに含まれるsao_split_flagが、該QAOUがさらに分割されるものであることを示している場合(すなわち、当該QAOUがリーフではない場合)には、図2(e)に示すように、該QAOUに関するQAOU情報には、該QAOUに含まれる複数のQAOUの各々に関するQAOU情報が含まれる。   As shown in FIGS. 2E and 2F, the QAOU information that is information about each QAOU includes sao_split_flag that indicates whether or not the own (own QAOU) is further divided. When sao_split_flag included in a certain QAOU indicates that the QAOU is further divided (that is, when the QAOU is not a leaf), as shown in FIG. 2 (e), the QAOU The QAOU information regarding QAOU information regarding each of a plurality of QAOUs included in the QAOU.

一方で、あるQAOUに含まれるsao_split_flagが、該QAOUがそれ以上分割されないものであることを示している場合(すなわち、当該QAOUがリーフである場合)には、図2(f)に示すように、該QAOUに関するQAOU情報には、該QAOUに関するオフセット情報OIが含まれる。また、オフセット情報OIには、図2(f)に示すように、オフセットタイプを指定するオフセットタイプ指定情報OTI、および、オフセットタイプに応じて定まるオフセット群が含まれている。さらに、図2(f)に示すように、オフセット群には、複数のオフセットが含まれている。   On the other hand, when the sao_split_flag included in a certain QAOU indicates that the QAOU is not further divided (that is, when the QAOU is a leaf), as shown in FIG. The QAOU information related to the QAOU includes offset information OI related to the QAOU. Further, as shown in FIG. 2F, the offset information OI includes offset type designation information OTI for designating an offset type and an offset group determined according to the offset type. Furthermore, as shown in FIG. 2F, the offset group includes a plurality of offsets.

なお、符号化データ中のオフセットは量子化された値である。また、符号化データ中のオフセットは、何らかの予測、例えば線形予測を用いることによって得られる予測残差であっても良い。   Note that the offset in the encoded data is a quantized value. Further, the offset in the encoded data may be a prediction residual obtained by using some prediction, for example, linear prediction.

次に、適応オフセットフィルタに関するシンタクスについて、図3を参照して説明する。   Next, the syntax regarding an adaptive offset filter is demonstrated with reference to FIG.

図3(a)は、適応オフセットフィルタ全体のシンタクスであり、図3(b)および図3(c)に示すシンタクスを呼び出すシンタクスである。パラメータsao_flagは適応オフセットフィルタを適用するか否かを選択するフラグであり、当該フラグが真(すなわち「1」)である場合のみ、輝度画素に対する適応オフセットフィルタに対応する、当該フラグに後続するQAOU情報およびオフセット情報OIを格納する。sao_flagが真の場合には、色差(Cb)および色差(Cr)についても、各々に対応するフラグsao_flag_cbおよびsao_flag_crを用いて、画素データの各成分に対して適応オフセットフィルタを適用するか否かを選択する。そして、適用しない場合には当該成分に対応するQAOU情報およびオフセット情報を格納しない。   FIG. 3A shows the syntax of the entire adaptive offset filter, which is a syntax for calling the syntax shown in FIGS. 3B and 3C. The parameter sao_flag is a flag for selecting whether or not to apply the adaptive offset filter. Only when the flag is true (ie, “1”), the QAOU subsequent to the flag corresponding to the adaptive offset filter for the luminance pixel is set. Information and offset information OI are stored. When sao_flag is true, whether or not to apply an adaptive offset filter to each component of the pixel data using the flags sao_flag_cb and sao_flag_cr corresponding to the color difference (Cb) and the color difference (Cr), respectively. select. If not applied, QAOU information and offset information corresponding to the component are not stored.

フラグsao_flag、sao_flag_cb、sao_flag_crによって、適応オフセットフィルタの適用が指定された場合のみ、対応する成分に対して、シンタクスsao_split_param()およびsao_offset_param()が最上位階層を指定して呼び出される。ここで、sao_split_param()はQAOUの分割構造を表し、sao_offset_param()はその分割構造を用いて各リーフQAOUにおけるオフセットを表している。   Only when the application of the adaptive offset filter is specified by the flags sao_flag, sao_flag_cb, and sao_flag_cr, the syntax sao_split_param () and sao_offset_param () are called with the highest hierarchy specified for the corresponding component. Here, sao_split_param () represents the QAOU split structure, and sao_offset_param () represents the offset in each leaf QAOU using the split structure.

sao_split_param()およびsao_offset_param()の各シンタクスに与えられる引数は、component、sao_depth、ys、xsである。sao_depthは、QAOUの分割深度を表すパラメータであり、ysおよびxsは、それぞれ、QAOU(または後述するQAOMUのy方向の位置およびx方向の位置を表すためのパラメータである。最上位階層の呼び出しでは、sao_depthL=0、ys=0、xs=0が与えられる。componentは、輝度(Y)、色差(Cb)、色差(Cr)を表すパラメータであり、輝度(Y)の場合は0、色差(Cb)の場合は1、色差(Cr)の場合は2として呼び出される。なお、componentの値は、処理対象の成分が区別できれば他の値でもよい。   Arguments given to the syntax of sao_split_param () and sao_offset_param () are component, sao_depth, ys, and xs. sao_depth is a parameter representing the QAOU division depth, and ys and xs are parameters for representing the QAOU (or the position of the QAOMU described later in the y direction and the position in the x direction, respectively). , Sao_depthL = 0, ys = 0, and xs = 0, where component is a parameter representing luminance (Y), color difference (Cb), and color difference (Cr), 0 for luminance (Y), color difference ( In the case of Cb), it is called as 1 and in the case of color difference (Cr), it is called 2. The value of component may be another value as long as the component to be processed can be distinguished.

図3(b)は、上述の図2(e)で説明したQAOU情報(図3(b)のsao_split_param()に相当)のシンタクスを示す図である。図3(b)のシンタクス301Bに示すように、分割深度sao_depthが所定のsaoMaxDepthで設定される最大値よりも小さければ、パラメータsao_split_flagによって、QAOUがさらに分割されるかどうかが選択される。より具体的には、sao_split_flagは、前述の引数component,sao_depth,ys,xsによって何れのQAOUに対するフラグかを指定されるものであり、sao_split_flag[component][sao_depth][ys][xs]とも表記する。   FIG. 3B is a diagram showing the syntax of the QAOU information (corresponding to sao_split_param () in FIG. 3B) described in FIG. 2E. As shown in the syntax 301B of FIG. 3B, if the division depth sao_depth is smaller than the maximum value set by a predetermined saoMaxDepth, whether or not the QAOU is further divided is selected by the parameter sao_split_flag. More specifically, sao_split_flag is designated as a flag for which QAOU by the above-mentioned arguments component, sao_depth, ys, xs, and is also expressed as sao_split_flag [component] [sao_depth] [ys] [xs] .

QAOUが分割される場合には、次の階層深度のsao_split_param()が再帰的に呼び出される。分割深度が最大値に達した(sao_depthがsaoMaxDepthより小さくない)場合には、sao_split_flag[component][sao_depth][ys][xs]には0が設定され、それ以上の分割は行われない。   When QAOU is divided, sao_split_param () of the next hierarchical depth is recursively called. When the division depth reaches the maximum value (sao_depth is not smaller than saoMaxDepth), 0 is set in sao_split_flag [component] [sao_depth] [ys] [xs], and no further division is performed.

図3(c)は、オフセット情報のシンタクスを示す図である。図3(c)のシンタクス301Cにおける(cx1)で示すブロックは、上述のsao_split_flagが真の場合に呼び出されるシンタクスを示しており、図2(e)の場合に相当する。   FIG. 3C is a diagram illustrating the syntax of the offset information. The block indicated by (cx1) in the syntax 301C in FIG. 3C indicates the syntax that is called when the above-described sao_split_flag is true, and corresponds to the case in FIG.

一方、シンタクス301Cにおける(cx2)で示すブロックは、上述のsao_split_flagが真でない場合に呼び出されるシンタクスであり、図2(f)の場合に相当する。図3(c)のシンタクス301Cに示すように、オフセット情報OIには、後述するパラメータsao_type_idx[component][sao_depth][ys][xs]が含まれている。また、パラメータsao_type_idx[component][sao_depth][ys][xs]が0でない場合、オフセット情報OIには、後述するパラメータsao_offset[component][sao_depth][ys][xs][i]が含まれている。   On the other hand, the block indicated by (cx2) in the syntax 301C is a syntax called when the above-described sao_split_flag is not true, and corresponds to the case of FIG. As shown in the syntax 301C in FIG. 3C, the offset information OI includes a parameter sao_type_idx [component] [sao_depth] [ys] [xs] described later. Further, when the parameter sao_type_idx [component] [sao_depth] [ys] [xs] is not 0, the offset information OI includes a parameter sao_offset [component] [sao_depth] [ys] [xs] [i] to be described later. Yes.

また、図3に示したDescriptor(記述子)ue(v)は、この記述子に関連付けられたシンタクスは符号なしの数値であり、値が可変長符号化されることを示している。se(v)は、この記述子に関連付けられたシンタクスは符号付きの数値であり、符号と絶対値に分けて可変長符号化されることを示している。ae(v)は、この記述子に関連づけられたシンタクスが算術符号を用いて可変長符号化されることを示している。また、「|」は、いずれかの符号化方法が選択的に用いられることを示している。   Also, Descriptor (descriptor) ue (v) shown in FIG. 3 indicates that the syntax associated with this descriptor is an unsigned numerical value, and the value is variable-length encoded. se (v) indicates that the syntax associated with this descriptor is a signed numerical value, and is variable-length encoded into a sign and an absolute value. ae (v) indicates that the syntax associated with this descriptor is variable-length encoded using an arithmetic code. “|” Indicates that any one of the encoding methods is selectively used.

次に、sao_depthの値に応じたQAOUの分割の態様について、図4を参照して説明する。図4は、sao_depthの値に応じたQAOUの分割の態様を示す図であり、(a)はsao_depth=0の場合の分割の態様を示し、(b)はsao_depth=1の場合の分割の態様を示し、(c)はsao_depth=2の場合の分割の態様を示し、(d)はsao_depth=3の場合の分割の態様を示し、(e)はsao_depth=4の場合の分割の態様を示している。   Next, an aspect of QAOU division according to the value of sao_depth will be described with reference to FIG. FIG. 4 is a diagram illustrating a QAOU division mode according to the value of sao_depth. (A) illustrates a division mode when sao_depth = 0, and (b) illustrates a division mode when sao_depth = 1. (C) shows the mode of division when sao_depth = 2, (d) shows the mode of division when sao_depth = 3, and (e) shows the mode of division when sao_depth = 4 ing.

図4(a)〜(e)に示すように、各QAOUは、sao_depth、および(xs、ys)によって指定される。図4(a)に示すように、sao_depth=0であるとき、xsおよびysはそれぞれ0であり、図4(b)に示すように、sao_depth=1であるとき、xsおよびysはそれぞれ0および1の何れかの値をとり得る。また、図4(c)に示すように、sao_depth=2であるとき、xsおよびysはそれぞれ0、1、2および3の何れかの値をとり得る。一般に、与えられたsao_depthに対して、xsおよびysは、それぞれ0〜2sao_depth−1の値をとり得る。このような分割の態様は、輝度(Y)、色差(Cb)および色差(Cr)において共通である。   As shown in FIGS. 4A to 4E, each QAOU is specified by sao_depth and (xs, ys). As shown in FIG. 4A, when sao_depth = 0, xs and ys are 0, respectively. As shown in FIG. 4B, when sao_depth = 1, xs and ys are 0 and 0, respectively. It can take any value of 1. Further, as shown in FIG. 4C, when sao_depth = 2, xs and ys can take values of 0, 1, 2, and 3, respectively. In general, for a given sao_depth, xs and ys can each take a value from 0 to 2 sao_depth-1. Such a division mode is common to luminance (Y), color difference (Cb), and color difference (Cr).

(sao_type_idx)
sao_type_idx[component][sao_depth][ys][xs]は、上述の図2(f)のオフセットタイプ指定情報OTIに対応するものであり、各QAOUについてのオフセットタイプを指定するためのパラメータである。本実施形態では、sao_type_idx[component][sao_depth][ys][xs]を、単にsao_type_idxやオフセットタイプと呼称することもある。単にsao_type_idxと呼称する場合においても、必要な個々の値はsao_type_idx[component][sao_depth][ys][xs]として参照することが可能である。
(Sao_type_idx)
sao_type_idx [component] [sao_depth] [ys] [xs] corresponds to the offset type designation information OTI in FIG. 2 (f) described above, and is a parameter for designating an offset type for each QAOU. In the present embodiment, sao_type_idx [component] [sao_depth] [ys] [xs] may be simply referred to as sao_type_idx or an offset type. Even when simply called sao_type_idx, necessary individual values can be referred to as sao_type_idx [component] [sao_depth] [ys] [xs].

オフセットタイプには大きく分けてエッジオフセット処理(EO)とバンドオフセット処理(BO)と呼ばれる2種類がある。エッジオフセット処理とは、処理対象画素の画素値とその周辺画素の画素値との差分に応じて、当該処理対象画素の画素値に複数のオフセットの何れかを加算する処理のことをいう。また、バンドオフセット処理とは、処理対象の各画素値の大きさに応じて、当該処理対象画素の画素値に複数のオフセットの何れかを加算する処理のことをいう。エッジオフセット処理およびバンドオフセット処理の具体的内容については後述する。   There are two types of offset types, called edge offset processing (EO) and band offset processing (BO). The edge offset process refers to a process of adding any of a plurality of offsets to the pixel value of the processing target pixel in accordance with the difference between the pixel value of the processing target pixel and the pixel values of the surrounding pixels. Further, the band offset process refers to a process of adding any of a plurality of offsets to the pixel value of the processing target pixel according to the size of each pixel value to be processed. Specific contents of the edge offset process and the band offset process will be described later.

本実施形態において、sao_type_idxは、後述する変形例を除いては0から6までの整数値をとり、オフセットフィルタ前画像(例えば、後述するデブロック済復号画像P_DB)に対して、どのようなフィルタ処理を行うか、あるいはフィルタ処理を行わないかを示す。具体的には以下の通りである。
・sao_type_idx=0は、対象QAOUにおけるオフセットフィルタ前画像に対して、オフセットフィルタ処理を行わないことを示す。
・sao_type_idx=1〜4は、対象QAOUにおけるオフセットフィルタ前画像に対して、エッジオフセット処理(EO)を行うことを示す。さらに、sao_type_idx=1〜4で示されるオフセットタイプを順に、「EO_0」「EO_1」「EO_2」「EO_3」と呼ぶ。
・sao_type_idx=5または6は、対象QAOUにおけるオフセットフィルタ前画像に対して、バンドオフセット処理(BO)を行うことを示す。さらに、sao_type_idx=5または6で示されるオフセットタイプを順に、「BO_0」「BO_1」と呼ぶ。
In the present embodiment, sao_type_idx takes an integer value from 0 to 6 except for a modification described later, and what kind of filter is applied to the pre-offset filter image (for example, a deblocked decoded image P_DB described later). Indicates whether processing is performed or filtering processing is not performed. Specifically, it is as follows.
Sao_type_idx = 0 indicates that the offset filter processing is not performed on the pre-offset filter image in the target QAOU.
Sao_type_idx = 1 to 4 indicates that edge offset processing (EO) is performed on the pre-offset filter image in the target QAOU. Furthermore, the offset types indicated by sao_type_idx = 1 to 4 are sequentially called “EO_0”, “EO_1”, “EO_2”, and “EO_3”.
Sao_type_idx = 5 or 6 indicates that band offset processing (BO) is performed on the pre-offset filter image in the target QAOU. Furthermore, the offset types indicated by sao_type_idx = 5 or 6 are called “BO — 0” and “BO — 1” in order.

なお、後述する一部の変形例では、エッジオフセットおよびバンドオフセットに対し、上記で説明したよりも多くのオフセットタイプが用いられる場合がある。例えば、バンドオフセットのタイプが3個以上用いられる場合には、オフセットタイプの呼称を順に「BO_2」「BO_3」となるよう添字を変えて区別する。さらに、上記のようにオフセットタイプの個数が変形前と異なる場合には、sao_type_idxの値の範囲は、オフセットタイプの総数に応じて変化する。たとえば、オフセットタイプの総数が9個である場合には、sao_type_idxは0から8までの整数値をとる。   In some modified examples described later, more offset types than those described above may be used for the edge offset and the band offset. For example, when three or more band offset types are used, the offset type names are distinguished by changing the subscripts so as to be “BO_2” and “BO_3” in order. Furthermore, when the number of offset types is different from that before the deformation as described above, the range of the value of sao_type_idx changes according to the total number of offset types. For example, when the total number of offset types is 9, sao_type_idx takes an integer value from 0 to 8.

(sao_offset)
sao_offset[component][sao_depth][ys][xs][i]は、本実施形態に係る適応オフセットフィルタ処理において、対象QAOUに含まれる各画素に加算されるオフセットの具体的な値を表すパラメータである。本実施形態では、sao_offset[component][sao_depth][ys][xs][i]のことを単にsao_offsetあるいはオフセットと呼称することもある。単にsao_offsetと呼称する場合においても、必要な個々の値はsao_offset[component][sao_depth][ys][xs][i]として参照することが可能である。
(Sao_offset)
sao_offset [component] [sao_depth] [ys] [xs] [i] is a parameter representing a specific value of an offset added to each pixel included in the target QAOU in the adaptive offset filter processing according to the present embodiment. is there. In the present embodiment, sao_offset [component] [sao_depth] [ys] [xs] [i] may be simply referred to as sao_offset or offset. Even in the case of simply calling sao_offset, the necessary individual values can be referred to as sao_offset [component] [sao_depth] [ys] [xs] [i].

sao_offset[component][sao_depth][ys][xs][i]は、上述の引数component、sao_depth、ys、xsに加えて、インデックス“i”によって指定される。ここで、インデックスiは、クラスを指定するためのインデックスであり、class_idxとも表記する。インデックスiは、エッジオフセットの場合、参照するタイプに属する0以外のクラス数がNec個であれば、0〜Necの何れかの整数値をとる。例えばNec=5のタイプであれば、iは0〜5の何れかの整数値をとる。また、バンドオフセットの場合、参照するタイプに属する0以外のクラス数がNbc個であれば、0〜Nbcの何れかの整数値をとる。例えばNbc=16のタイプであれば、iは0〜16の何れかの整数値をとり、Nbc=8のタイプであれば、iは0〜8の何れかの整数値をとる。何れの場合もiが0の場合は、オフセットを加算しないクラスを表している。このため、iが0の場合はオフセットの符号化は行わない。以下では、i=0のクラスは、無効クラスとも呼称する。また、オフセットを加算するクラスは、有効クラスとも呼称する。また、iの値の最大値は、各オフセットタイプに属する有効クラス数で決まり、(component,sao_type_idx)を添字とする、エンコーダとデコーダで共通な所定の値の配列saoNumClassから参照される。   sao_offset [component] [sao_depth] [ys] [xs] [i] is specified by an index “i” in addition to the above-described arguments component, sao_depth, ys, and xs. Here, the index i is an index for designating a class, and is also expressed as class_idx. The index i takes an integer value of 0 to Nec if the number of non-zero classes belonging to the type to be referenced is Nec in the case of an edge offset. For example, in the case of Nec = 5, i takes any integer value from 0 to 5. In the case of a band offset, if the number of non-zero classes belonging to the type to be referenced is Nbc, an integer value of 0 to Nbc is taken. For example, if the type is Nbc = 16, i takes any integer value from 0 to 16, and if Nbc = 8, i takes any integer value from 0 to 8. In any case, when i is 0, it represents a class to which no offset is added. For this reason, when i is 0, no offset is encoded. Hereinafter, the class with i = 0 is also referred to as an invalid class. A class to which an offset is added is also referred to as an effective class. The maximum value of i is determined by the number of effective classes belonging to each offset type, and is referred to from a predetermined value array saoNumClass common to the encoder and decoder, with (component, sao_type_idx) as a subscript.

後述するように、本実施形態に係る適応オフセットフィルタは、対象QAOUに含まれる対象画素を上記複数のクラスの何れかに分類し、該対象画素に対して、該対象画素が分類されたクラスについてのオフセットOffsetを加算する。   As will be described later, the adaptive offset filter according to the present embodiment classifies the target pixel included in the target QAOU into one of the plurality of classes, and classifies the target pixel with respect to the target pixel. Add the offset of.

(動画像復号装置1)
次に、本実施形態に係る動画像復号装置1について、図1および図5〜8を参照して説明する。動画像復号装置1は、その一部に、H.264/MPEG−4.AVCに採用されている方式、VCEG(Video Coding Expert Group)における共同開発用コーデックであるKTAソフトウェアに採用されている方式、その後継コーデックであるTMuC(Test Model under Consideration)ソフトウェアに採用されている方式、および、HM(HEVC TestModel)ソフトウェアに採用されている技術を含んでいる。
(Moving picture decoding apparatus 1)
Next, the video decoding device 1 according to the present embodiment will be described with reference to FIG. 1 and FIGS. The moving picture decoding apparatus 1 includes H.264 as a part thereof. H.264 / MPEG-4. A method adopted in AVC, a method adopted in KTA software, which is a codec for joint development in VCEG (Video Coding Expert Group), and a method adopted in TMuC (Test Model under Consideration) software, which is the successor codec And the technology employed in HM (HEVC TestModel) software.

図5は、動画像復号装置1の構成を示すブロック図である。図5に示すように、動画像復号装置1は、可変長符号復号部13、動きベクトル復元部14、バッファメモリ15、インター予測画像生成部16、イントラ予測画像生成部17、予測方式決定部18、逆量子化・逆変換部19、加算器20、デブロッキングフィルタ41、適応フィルタ50、および適応オフセットフィルタ60を含む構成である。動画像復号装置1は、符号化データ#1を復号することによって動画像#4を生成するための装置である。   FIG. 5 is a block diagram showing a configuration of the moving picture decoding apparatus 1. As shown in FIG. 5, the moving picture decoding apparatus 1 includes a variable length code decoding unit 13, a motion vector restoration unit 14, a buffer memory 15, an inter prediction image generation unit 16, an intra prediction image generation unit 17, and a prediction method determination unit 18. , An inverse quantization / inverse transform unit 19, an adder 20, a deblocking filter 41, an adaptive filter 50, and an adaptive offset filter 60. The moving picture decoding apparatus 1 is an apparatus for generating moving picture # 4 by decoding encoded data # 1.

可変長符号復号部13は、各パーティションに関する予測パラメータPPを、符号化データ#1から復号する。すなわち、インター予測パーティションに関しては、参照画像インデックスRI、推定動きベクトルインデックスPMVI、および、動きベクトル残差MVDを符号化データ#1から復号し、これらを動きベクトル復元部14に供給する。一方、イントラ予測パーティションに関しては、(1)パーティションのサイズを指定するサイズ指定情報、および、(2)予測インデックスを指定する予測インデックス指定情報を符号化データ#1から復号し、これをイントラ予測画像生成部17に供給する。また、可変長符号復号部13は、CU情報を符号化データから復号し、これを予測方式決定部18に供給する(不図示)。更に、可変長符号復号部13は、各ブロックに関する量子化予測残差QD、および、そのブロックを含むツリーブロックに関する量子化パラメータ差分Δqpを符号化データ#1から復号し、これらを逆量子化・逆変換部19に供給する。また、可変長符号復号部13は、符号化データ#1からFP(フィルタパラメータ)を抽出し、抽出したFPを適応フィルタ50に供給する。また、可変長符号復号部13は、符号化データ#1からQAOU情報を抽出し、抽出したQAOU情報を適応オフセットフィルタ60に供給する。   The variable length code decoding unit 13 decodes the prediction parameter PP for each partition from the encoded data # 1. That is, for the inter prediction partition, the reference image index RI, the estimated motion vector index PMVI, and the motion vector residual MVD are decoded from the encoded data # 1, and these are supplied to the motion vector restoration unit 14. On the other hand, with respect to the intra prediction partition, (1) size designation information for designating the partition size and (2) prediction index designation information for designating the prediction index are decoded from the encoded data # 1, and this is decoded into the intra prediction image. This is supplied to the generation unit 17. In addition, the variable length code decoding unit 13 decodes the CU information from the encoded data, and supplies this to the prediction method determination unit 18 (not shown). Furthermore, the variable length code decoding unit 13 decodes the quantization prediction residual QD for each block and the quantization parameter difference Δqp for the tree block including the block from the encoded data # 1, and dequantizes and decodes them. This is supplied to the inverse conversion unit 19. Further, the variable length code decoding unit 13 extracts an FP (filter parameter) from the encoded data # 1, and supplies the extracted FP to the adaptive filter 50. Further, the variable length code decoding unit 13 extracts QAOU information from the encoded data # 1 and supplies the extracted QAOU information to the adaptive offset filter 60.

動きベクトル復元部14は、各インター予測パーティションに関する動きベクトルmvを、そのパーティションに関する動きベクトル残差MVDと、他のパーティションに関する復元済みの動きベクトルmv’とから復元する。具体的には、(1)推定動きベクトルインデックスPMVIにより指定される推定方法に従って、復元済みの動きベクトルmv’から推定動きベクトルpmvを導出し、(2)導出した推定動きベクトルpmvと動きベクトル残差MVDとを加算することによって動きベクトルmvを得る。なお、他のパーティションに関する復元済みの動きベクトルmv’は、バッファメモリ15から読み出すことができる。動きベクトル復元部14は、復元した動きベクトルmvを、対応する参照画像インデックスRIと共に、インター予測画像生成部16に供給する。なお、双方向予測(重み付き予測)を行うインター予測パーティションについては、復元した2つの動きベクトルmv1およびmv2を、対応する参照画像インデックスRI1およびRI2と共に、インター予測画像生成部16に供給する。   The motion vector restoration unit 14 restores the motion vector mv for each inter prediction partition from the motion vector residual MVD for the partition and the restored motion vector mv ′ for the other partitions. Specifically, (1) the estimated motion vector pmv is derived from the restored motion vector mv ′ according to the estimation method specified by the estimated motion vector index PMVI, and (2) the derived estimated motion vector pmv and the motion vector remaining are derived. The motion vector mv is obtained by adding the difference MVD. It should be noted that the restored motion vector mv ′ relating to other partitions can be read from the buffer memory 15. The motion vector restoration unit 14 supplies the restored motion vector mv together with the corresponding reference image index RI to the inter predicted image generation unit 16. For the inter prediction partition that performs bi-directional prediction (weighted prediction), the restored two motion vectors mv1 and mv2 are supplied to the inter predicted image generation unit 16 together with the corresponding reference image indexes RI1 and RI2.

インター予測画像生成部16は、各インター予測パーティションに関する動き補償画像mcを生成する。具体的には、動きベクトル復元部14から供給された動きベクトルmvを用いて、同じく動きベクトル復元部14から供給された参照画像インデックスRIによって指定されるフィルタ済復号画像P_FL’から動き補償画像mcを生成する。ここで、フィルタ済復号画像P_FL’は、局所復号画像Pに対して、デブロッキングフィルタ41によるデブロック処理、適応オフセットフィルタ60によるオフセットフィルタ処理、および適応フィルタ50による適応的フィルタ処理を施すことによって得られる画像であり、インター予測画像生成部16は、フィルタ済復号画像P_FL’を構成する各画素の画素値をバッファメモリ15から読み出すことができる。インター予測画像生成部16によって生成された動き補償画像mcは、インター予測画像Pred_Interとして予測方式決定部18に供給される。なお、双方向予測(重み付き予測)を行うインター予測パーティションについては、(1)動きベクトルmv1を用いて、参照画像インデックスRI1によって指定されたフィルタ済復号画像P_FL1’から動き補償画像mc1を生成し、(2)動きベクトルmv2を用いて、参照画像インデックスRI2によって指定されたフィルタ済復号画像P_FL2’から動き補償画像mc2を生成し、(3)動き補償画像mc1と動き補償画像mc2との加重平均にオフセット値を加えることによってインター予測画像Pred_Interを生成する。   The inter prediction image production | generation part 16 produces | generates the motion compensation image mc regarding each inter prediction partition. Specifically, using the motion vector mv supplied from the motion vector restoration unit 14, the motion compensated image mc from the filtered decoded image P_FL ′ designated by the reference image index RI also supplied from the motion vector restoration unit 14 is used. Is generated. Here, the filtered decoded image P_FL ′ is obtained by performing deblocking processing by the deblocking filter 41, offset filtering processing by the adaptive offset filter 60, and adaptive filtering processing by the adaptive filter 50 on the local decoded image P. This is an obtained image, and the inter predicted image generation unit 16 can read out the pixel value of each pixel constituting the filtered decoded image P_FL ′ from the buffer memory 15. The motion compensation image mc generated by the inter prediction image generation unit 16 is supplied to the prediction method determination unit 18 as an inter prediction image Pred_Inter. For the inter prediction partition that performs bi-directional prediction (weighted prediction), (1) a motion compensated image mc1 is generated from the filtered decoded image P_FL1 ′ specified by the reference image index RI1 using the motion vector mv1. (2) A motion compensated image mc2 is generated from the filtered decoded image P_FL2 ′ specified by the reference image index RI2 using the motion vector mv2, and (3) a weighted average of the motion compensated image mc1 and the motion compensated image mc2 The inter prediction image Pred_Inter is generated by adding the offset value to the.

イントラ予測画像生成部17は、各イントラ予測パーティションに関する予測画像Pred_Intraを生成する。具体的には、まず、符号化データ#1から復号された予測インデックス指定情報およびサイズ指定情報を参照して予測モードを導出し、該予測モードを対象パーティションに対して、例えば、ラスタスキャン順に割り付ける。続いて、当該予測モードの示す予測方法に従って、バッファメモリから読み出した(不図示)局所復号画像Pから予測画像Pred_Intraを生成する。イントラ予測画像生成部17によって生成されたイントラ予測画像Pred_Intraは、予測方式決定部18に供給される。   The intra predicted image generation unit 17 generates a predicted image Pred_Intra related to each intra prediction partition. Specifically, first, a prediction mode is derived with reference to prediction index designation information and size designation information decoded from encoded data # 1, and the prediction mode is assigned to a target partition in, for example, raster scan order. . Subsequently, a predicted image Pred_Intra is generated from the local decoded image P (not shown) read from the buffer memory according to the prediction method indicated by the prediction mode. The intra predicted image Pred_Intra generated by the intra predicted image generation unit 17 is supplied to the prediction method determination unit 18.

また、イントラ予測画像生成部17は、対象パーティションのサイズ、および、対象パーティションに割り付けられた予測モードを示す情報であるイントラ符号化モード情報IEMを適応フィルタ50に供給する(不図示)。   In addition, the intra predicted image generation unit 17 supplies intra coding mode information IEM, which is information indicating the size of the target partition and the prediction mode assigned to the target partition, to the adaptive filter 50 (not shown).

予測方式決定部18は、CU情報に基づいて、各パーティションがインター予測を行うべきインター予測パーティションであるのか、イントラ予測を行うべきイントラ予測パーティションであるのかを決定する。そして、前者の場合には、インター予測画像生成部16にて生成されたインター予測画像Pred_Interを予測画像Predとして加算器20に供給し、後者の場合には、イントラ予測画像生成部17にて生成されたイントラ予測画像Pred_Intraを予測画像Predとして加算器20に供給する。   Based on the CU information, the prediction method determination unit 18 determines whether each partition is an inter prediction partition that should perform inter prediction or an intra prediction partition that should perform intra prediction. In the former case, the inter predicted image Pred_Inter generated by the inter predicted image generation unit 16 is supplied to the adder 20 as the predicted image Pred. In the latter case, the inter predicted image generation unit 17 generates the inter predicted image Pred_Inter. The intra predicted image Pred_Intra that has been processed is supplied to the adder 20 as the predicted image Pred.

逆量子化・逆変換部19は、(1)量子化予測残差QDを逆量子化し、(2)逆量子化によって得られたDCT(Discrete Cosine Transform)係数またはDST(Discrete Sine Transform)係数を逆DCT変換または逆DST変換し、(3)逆DCT変換または逆DST変換によって得られた予測残差Dを加算器20に供給する。なお、量子化予測残差QDを逆量子化する際に、逆量子化・逆変換部19は、可変長符号復号部13から供給された量子化パラメータ差分Δqpから量子化ステップQPを導出する。量子化パラメータqpは、直前に逆量子化/逆DCT(またはDST)変換したツリーブロックに関する量子化パラメータqp’に量子化パラメータ差分Δqpを加算することによって導出でき、量子化ステップQPは、量子化ステップqpからQP=2pq/6によって導出できる。また、逆量子化・逆変換部19による予測残差Dの生成は、ブロック(変換単位)を単位として行われる。   The inverse quantization / inverse transform unit 19 (1) inversely quantizes the quantized prediction residual QD, and (2) uses a DCT (Discrete Cosine Transform) coefficient or a DST (Discrete Sine Transform) coefficient obtained by the inverse quantization. Inverse DCT transform or inverse DST transform is performed, and (3) prediction residual D obtained by inverse DCT transform or inverse DST transform is supplied to adder 20. When the quantization prediction residual QD is inversely quantized, the inverse quantization / inverse transform unit 19 derives the quantization step QP from the quantization parameter difference Δqp supplied from the variable length code decoding unit 13. The quantization parameter qp can be derived by adding the quantization parameter difference Δqp to the quantization parameter qp ′ relating to the tree block that has been subjected to the inverse quantization / inverse DCT (or DST) transformation immediately before, and the quantization step QP is performed by the quantization step QP. It can be derived from step qp by QP = 2pq / 6. The generation of the prediction residual D by the inverse quantization / inverse transform unit 19 is performed in units of blocks (transform units).

加算器20は、予測方式決定部18から供給された予測画像Predと、逆量子化・逆変換部19から供給された予測残差Dとを加算することによって局所復号画像Pを生成する。   The adder 20 generates the local decoded image P by adding the prediction image Pred supplied from the prediction method determination unit 18 and the prediction residual D supplied from the inverse quantization / inverse conversion unit 19.

デブロッキングフィルタ41は、局所復号画像Pにおけるブロック境界、またはCU境界を介して互いに隣接する画素の画素値の差が予め定められた範囲内である場合にはブロック歪みが存在すると判定し、局所復号画像Pにおける当該ブロック境界、または当該CU境界に対してデブロッキング処理を施すことによって、当該ブロック境界、または当該CU境界付近の画像の平滑化を行う。デブロッキングフィルタ41によりデブロッキング処理が施された画像は、デブロック済復号画像P_DBとして、適応オフセットフィルタ60に出力される。   The deblocking filter 41 determines that there is block distortion when the difference between pixel values of pixels adjacent to each other via a block boundary or a CU boundary in the local decoded image P is within a predetermined range. By performing deblocking processing on the block boundary or the CU boundary in the decoded image P, the image near the block boundary or the CU boundary is smoothed. The image subjected to the deblocking process by the deblocking filter 41 is output to the adaptive offset filter 60 as a deblocked decoded image P_DB.

適応オフセットフィルタ60は、デブロッキングフィルタ41から供給されるデブロック済復号画像P_DBに対して、符号化データ#1から復号されたオフセットを用いたオフセットフィルタ処理を、QAOUを処理単位として施すことによってオフセットフィルタ済復号画像P_OFを生成する。生成されたオフセットフィルタ済復号画像P_OFは、適応オフセットフィルタ60に供給される。適応オフセットフィルタ60の具体的な構成については、後述するため、ここでは説明を省略する。   The adaptive offset filter 60 performs an offset filter process using an offset decoded from the encoded data # 1 on the deblocked decoded image P_DB supplied from the deblocking filter 41, using QAOU as a processing unit. An offset filtered decoded image P_OF is generated. The generated offset filtered decoded image P_OF is supplied to the adaptive offset filter 60. Since a specific configuration of the adaptive offset filter 60 will be described later, description thereof is omitted here.

適応フィルタ50は、適応オフセットフィルタ60から供給されるオフセットフィルタ済復号画像P_OFに対して、符号化データ#1から復号されたフィルタパラメータFP(フィルタセット番号、フィルタ係数群、領域指定情報、並びにオンオフ情報)を用いたフィルタ処理を施すことによって、フィルタ済復号画像P_FLを生成する。フィルタ済復号画像P_FLは、動画像#4として外部に出力されると共に、可変長符号復号部13によって符号化データから復号されたPOC指定情報と関連付けてバッファメモリ15に格納される。   The adaptive filter 50 applies the filter parameter FP (filter set number, filter coefficient group, region designation information, and on / off) decoded from the encoded data # 1 to the offset filtered decoded image P_OF supplied from the adaptive offset filter 60. The filtered decoded image P_FL is generated by performing a filtering process using (information). The filtered decoded image P_FL is output to the outside as the moving image # 4, and is stored in the buffer memory 15 in association with the POC designation information decoded from the encoded data by the variable length code decoding unit 13.

(適応オフセットフィルタ60)
次に、適応オフセットフィルタ60の詳細について、図1を参照して説明する。図1は、適応オフセットフィルタ60の構成を示すブロック図である。図1に示すように、適応オフセットフィルタ60は、適応オフセットフィルタ情報復号部61および適応オフセットフィルタ処理部62を含む構成である。
(Adaptive offset filter 60)
Next, details of the adaptive offset filter 60 will be described with reference to FIG. FIG. 1 is a block diagram showing the configuration of the adaptive offset filter 60. As shown in FIG. 1, the adaptive offset filter 60 includes an adaptive offset filter information decoding unit 61 and an adaptive offset filter processing unit 62.

(適応オフセットフィルタ情報復号部61)
図1に示すように、適応オフセットフィルタ情報復号部61は、オフセット情報復号部611、およびQAOU構造復号部612を含む構成である。
(Adaptive offset filter information decoding unit 61)
As shown in FIG. 1, the adaptive offset filter information decoding unit 61 includes an offset information decoding unit 611 and a QAOU structure decoding unit 612.

オフセット情報復号部611は、符号化データ#1に含まれているQAOU情報を参照し、QAOU情報に含まれているオフセット情報OIを復号する。また、オフセット情報OIを復号することによって得られたsao_type_idx[component][sao_depth][ys][xs]およびsao_offset[component][sao_depth][ys][xs][i]の各値を、それぞれの引数(component,sao_depth,ys,xs)および(component,sao_depth,ys,xs,i)に関連付けて、オフセット情報格納部621に供給する。   The offset information decoding unit 611 refers to the QAOU information included in the encoded data # 1, and decodes the offset information OI included in the QAOU information. Also, the values of sao_type_idx [component] [sao_depth] [ys] [xs] and sao_offset [component] [sao_depth] [ys] [xs] [i] obtained by decoding the offset information OI are The offset information is stored in the offset information storage unit 621 in association with the arguments (component, sao_depth, ys, xs) and (component, sao_depth, ys, xs, i).

より詳細には、オフセット情報復号部611は、符号化データ#1からコードを復号し、復号したコードをsao_type_idxの値に変換して、引数に関連付けてオフセット情報格納部621に供給する。ここで、オフセット情報復号部611は、処理対象のQAOUの画素の成分によってコードの復号方法を変更している。このQAOUの成分などの条件をパラメータ条件と呼ぶ。一般のパラメータ条件に応じたオフセット情報の復号は図14を用いて後述する。   More specifically, the offset information decoding unit 611 decodes the code from the encoded data # 1, converts the decoded code into a sao_type_idx value, and supplies the value to the offset information storage unit 621 in association with the argument. Here, the offset information decoding unit 611 changes the code decoding method according to the pixel component of the QAOU to be processed. The condition such as the QAOU component is called a parameter condition. Decoding of offset information according to general parameter conditions will be described later with reference to FIG.

コードの復号方法は、処理対象が輝度のQAOUである場合と色差のQAOUである場合とで異なるものであってもよい。異なる場合には、例えば輝度と色差とで異なるバイナリゼーションを用いるものや、異なるコンテキストを用いるものであってもよい。   The code decoding method may be different depending on whether the processing target is a luminance QAOU or a color difference QAOU. If they are different, for example, those using different binarization for luminance and color difference or those using different contexts may be used.

また、オフセット情報復号部611は、復号したコードからsao_type_idxの値への変換を、図6に示すような変換テーブル801Aを用いて行う。図6の変換テーブル801Aでは、コードからオフセットタイプへの変換パターンの一例を示している。オフセット情報復号部611は、変換テーブル801Aを用いて、復号したコードをオフセットタイプに変換する。図6の変換テーブル801Aでは、コード「1」に対しオフセットタイプ「EO_0」(sao_type_idx=1)が対応付けられており、コード「2」に対しオフセットタイプ「EO_1」(sao_type_idx=2)が対応付けられており、コード「3」に対しオフセットタイプ「EO_2」(sao_type_idx=3)が対応付けられている。以下、コード4〜6についても同様である。   Also, the offset information decoding unit 611 performs conversion from the decoded code to the value of sao_type_idx using a conversion table 801A as shown in FIG. The conversion table 801A in FIG. 6 shows an example of a conversion pattern from a code to an offset type. The offset information decoding unit 611 converts the decoded code into an offset type using the conversion table 801A. In the conversion table 801A of FIG. 6, the code “1” is associated with the offset type “EO — 0” (sao_type_idx = 1), and the code “2” is associated with the offset type “EO — 1” (sao_type_idx = 2). The offset type “EO_2” (sao_type_idx = 3) is associated with the code “3”. The same applies to the codes 4 to 6 below.

なお、コードとオフセットタイプの対応付けは、変換テーブル801Aに示したものに限られない。図6の変換テーブル801Bに一例を示すように、出現頻度がより高いオフセットタイプをビット長のより短いコードに対応付けたり、あるいは変換テーブル801Cに一例を示すように、用いないオフセットタイプを省略したりしてもよい。また、これらの変換テーブルを動的に変更したり切り替えたりしてもよい。   The association between the code and the offset type is not limited to that shown in the conversion table 801A. As shown in the conversion table 801B in FIG. 6, an offset type having a higher appearance frequency is associated with a code having a shorter bit length, or an unused offset type is omitted as shown in the conversion table 801C. Or you may. Also, these conversion tables may be dynamically changed or switched.

QAOU構造復号部612は、QAOU情報に含まれているsao_split_flag[component][sao_depth][ys][xs]を復号することによって、QAOUの分割構造を決定し、決定されたQAOUの分割構造を表すQAOU構造情報を、オフセット情報格納部621に供給する。   The QAOU structure decoding unit 612 determines the QAOU partition structure by decoding sao_split_flag [component] [sao_depth] [ys] [xs] included in the QAOU information, and represents the determined QAOU partition structure The QAOU structure information is supplied to the offset information storage unit 621.

(適応オフセットフィルタ処理部62)
図1に示すように、適応オフセットフィルタ処理部62は、オフセット情報格納部621、QAOU制御部622、オフセットタイプ導出部623、クラス分類部624、オフセット属性設定部625、オフセット導出部626、およびオフセット加算部627を含む構成である。
(Adaptive offset filter processing unit 62)
As shown in FIG. 1, the adaptive offset filter processing unit 62 includes an offset information storage unit 621, a QAOU control unit 622, an offset type derivation unit 623, a class classification unit 624, an offset attribute setting unit 625, an offset derivation unit 626, and an offset. This is a configuration including an adder 627.

オフセット情報格納部621は、QAOU構造情報、sao_type_idx[component][sao_depth][ys][xs]、およびsao_offset[component][sao_depth][ys][xs][i]に基づいて、各QAOUについて指定されたオフセットタイプ、および該オフセットタイプにおいて選択可能な各クラスに関するオフセットの具体的な値を管理および格納するものであり、マップメモリおよびリストメモリを備えた構成である。   The offset information storage unit 621 specifies each QAOU based on the QAOU structure information, sao_type_idx [component] [sao_depth] [ys] [xs], and sao_offset [component] [sao_depth] [ys] [xs] [i] And a specific value of an offset for each class selectable in the offset type, and is configured to include a map memory and a list memory.

マップメモリ、およびリストメモリについて、図7を参照して説明する。図7は、マップメモリおよびリストメモリに格納される例を示す図であり、図7(a)はマップメモリに格納されるQAOUの識別番号(QAOUインデックス)の一例を説明するための図であり、図7(b)はリストメモリに格納される情報の一例を説明するための図である。   The map memory and list memory will be described with reference to FIG. FIG. 7 is a diagram illustrating examples stored in the map memory and the list memory, and FIG. 7A is a diagram for explaining an example of an identification number (QAOU index) of the QAOU stored in the map memory. FIG. 7B is a diagram for explaining an example of information stored in the list memory.

マップメモリ601には、最大分割深度に対するオフセット最小単位(QAOMU:Quad Adaptive Offset Minimum Unitとも呼称する)に割り付けられたQAOUインデックスが格納されている。言い換えれば、マップメモリ602は、最大分割深度に対するQAOMUを用いてQAOUの分割構造を表すものである。   The map memory 601 stores a QAOU index assigned to a minimum offset unit (also referred to as QAOMU: Quad Adaptive Offset Minimum Unit) with respect to the maximum division depth. In other words, the map memory 602 represents the QAOU division structure using the QAOMU for the maximum division depth.

図7(a)では、対象の処理単位(例えばLCU)を構成する分割深度3の各QAOMUと、各QAOMUを含むQAOUインデックスを示している。なお、図7(a)では、簡易的に連番でインデックス0〜9をQAOUに割り付けているが、実用上は、QAOUインデックスから分割深度をテーブル参照等の容易な手段で導出できることが好ましい。また、図7(a)に示す例においては、QAOUインデックス=Iによって指定されるQAOUをQAOU0〜QAOU9と表記している。また、図7(a)における細線はQAOMUの境界を示しており、太線はQAOUの境界を示している。   FIG. 7A shows each QAOMU having a division depth 3 constituting a target processing unit (for example, LCU) and a QAOU index including each QAOMU. In FIG. 7A, the indexes 0 to 9 are simply assigned to the QAOUs by serial numbers. However, in practice, it is preferable that the division depth can be derived from the QAOU index by an easy means such as table reference. In the example shown in FIG. 7A, QAOUs designated by QAOU index = I are represented as QAOU0 to QAOU9. In addition, the thin line in FIG. 7A indicates the QAOMU boundary, and the thick line indicates the QAOU boundary.

図7(a)に示すQAOU0は、4つの最大分割深度のQAOMUから構成されており、これら4つのQAOMUには、QAOUインデックスとして0が割り付けられている。一方、QAOU3は、1つのQAOMUから構成されており、このQAOMUには、QAOUインデックスとして3が割り付けられている。このように、マップメモリには、各QAOMUに割り付けられたQAOUインデックスが格納されている。   The QAOU0 shown in FIG. 7A is composed of four QAOMUs with the maximum division depth, and 0 is assigned to these four QAOMUs as the QAOU index. On the other hand, QAOU3 is composed of one QAOMU, and 3 is assigned to this QAOMU as a QAOU index. In this way, the map memory stores the QAOU index assigned to each QAOMU.

また、リストメモリ602には、各QAOUインデックスに対し、該QAOUインデックスに関連付けられたオフセットタイプ、および該オフセットタイプにおいて選択可能な各クラスに関するオフセットの具体的な値が互いに関連付けられて格納されている。   The list memory 602 stores, for each QAOU index, an offset type associated with the QAOU index and a specific value of an offset for each class selectable in the offset type in association with each other. .

具体的に、図7(b)を参照して説明する。図7(b)では、QAOUインデックス0〜9の各々に関連付けられたオフセットタイプおよび各オフセットタイプにおいて選択可能な各クラスに関するオフセットを示している。図7(b)における「xxx」は、互いに異なり得る具体的な数値を表している。   Specifically, this will be described with reference to FIG. FIG. 7B shows an offset type associated with each of the QAOU indexes 0 to 9 and an offset for each class selectable in each offset type. “Xxx” in FIG. 7B represents specific numerical values that may be different from each other.

図7(b)に示すように、オフセットタイプがバンドオフセットである場合、該オフセットタイプに関してリストメモリに格納されるオフセットの個数は、図示した場合のバンドオフセットの有効クラス数が16個であることから、オフセット1〜オフセット16の合計16個である。ここで、オフセット1〜オフセット16は、sao_type_idx[component][sao_depth][ys][xs]の値が5または6である場合の、sao_offset[component][sao_depth][ys][xs][1]〜sao_offset[component][sao_depth][ys][xs][16]によってそれぞれ指定される値のことを指す。   As shown in FIG. 7B, when the offset type is a band offset, the number of offsets stored in the list memory with respect to the offset type is that the number of effective classes of the band offset in the illustrated case is 16. Thus, a total of 16 offsets 1 to 16 are provided. Here, offset 1 to offset 16 are sao_offset [component] [sao_depth] [ys] [xs] [1] when the value of sao_type_idx [component] [sao_depth] [ys] [xs] is 5 or 6. ~ Sao_offset [component] [sao_depth] [ys] [xs] It refers to the value specified by [16].

一方、オフセットタイプがエッジオフセットである場合、該オフセットタイプに関してリストメモリに格納されるオフセットの個数は、エッジオフセットの有効クラス数に同じであり、オフセット1〜5の合計5個である。ここで、オフセット1〜5は、sao_type_idx[component][sao_depth][ys][xs]の値が1から4の何れかである場合の、sao_offset[component][sao_depth][ys][xs][1]〜sao_offset[component][sao_depth][ys][xs][5]によってそれぞれ指定される値のことを指す。なお、使用されないオフセットのメモリには何も格納されない。また、常に使用されないオフセットのメモリについては確保を省略してもよく、それにより使用メモリ量の削減が可能である。   On the other hand, when the offset type is an edge offset, the number of offsets stored in the list memory with respect to the offset type is the same as the number of valid classes of the edge offset, which is a total of five offsets 1 to 5. Here, the offsets 1 to 5 indicate that sao_type_idx [component] [sao_depth] [ys] [xs] is any value from 1 to 4, and sao_offset [component] [sao_depth] [ys] [xs] [ 1] to sao_offset [component] [sao_depth] [ys] [xs] [5] Refers to the values specified by each. Note that nothing is stored in the memory of the offset that is not used. In addition, it is possible to omit securing an offset memory that is not always used, thereby reducing the amount of memory used.

また、本実施形態では、処理対象のQAOUが表す成分、すなわち、輝度画素であるか色差画素であるかに応じて、オフセットの個数を異ならせてもよい。例えば、輝度画素については、エッジオフセットの有効クラス数すなわちオフセットの個数をオフセット1〜4の4個とし、色差画素については後述する第5のオフセットを用い、オフセット1〜5の5個を用いる。具体的には、sao_type_idxが1〜4(エッジオフセット)であるときに図3(c)のsaoNumClassを参照して得られる値を、component=0(輝度)に対しては4、component=1または2(色差)に対しては5とする。   In the present embodiment, the number of offsets may be varied depending on the component represented by the QAOU to be processed, that is, whether the pixel is a luminance pixel or a color difference pixel. For example, for the luminance pixel, the number of effective classes of edge offsets, that is, the number of offsets is set to four offsets 1 to 4, and for the color difference pixels, a fifth offset described later is used, and five offsets 1 to 5 are used. Specifically, when sao_type_idx is 1 to 4 (edge offset), a value obtained by referring to saoNumClass in FIG. 3C is 4 for component = 0 (luminance), component = 1 or 5 for 2 (color difference).

発明者の実験によれば、従来技術ではオフセット処理が行われないクラス0に分類されていた画素に対してもオフセット処理をすることで、輝度画素については符号化効率は向上しないが、色差画素に対しては符号化効率が向上することがわかった。   According to the inventor's experiment, encoding processing is not improved for luminance pixels by performing offset processing even on pixels classified as class 0 that are not subjected to offset processing in the prior art, but color difference pixels It was found that the coding efficiency is improved.

よって、上記のように輝度画素と色差画素とで、エッジオフセットで使用するクラス数を異ならせることにより、符号化効率を向上させることができる。したがって上記のように少なくとも色差については第5のオフセットを用いて、従来クラス0に分類されていた画素をクラス5に分類して処理することが好ましい。   Therefore, the coding efficiency can be improved by making the number of classes used for the edge offset different between the luminance pixel and the color difference pixel as described above. Therefore, as described above, it is preferable that at least the color difference is processed by classifying pixels that have been conventionally classified into class 0 into class 5 by using the fifth offset.

QAOU制御部622は、適応オフセットフィルタ処理部62に含まれる各部を制御する。また、QAOU制御部622は、QAOU構造情報を参照して、デブロック済復号画像P_DBを1または複数のQAOUに分割し、各QAOUを所定の順序でスキャンする。また、処理対象とする対象QAOMUを表すQAOMU番号をオフセットタイプ導出部623に供給する。   The QAOU control unit 622 controls each unit included in the adaptive offset filter processing unit 62. Further, the QAOU control unit 622 refers to the QAOU structure information, divides the deblocked decoded image P_DB into one or a plurality of QAOUs, and scans each QAOU in a predetermined order. In addition, the QAOMU number representing the target QAOMU to be processed is supplied to the offset type deriving unit 623.

オフセットタイプ導出部623は、オフセット情報格納部621のマップメモリおよびリストメモリを参照し、QAOU制御部622から供給されたQAOMU番号によって指定されるオフセットタイプを導出する。また、導出したオフセットタイプを、クラス分類部624に供給する。   The offset type deriving unit 623 refers to the map memory and the list memory of the offset information storage unit 621 and derives an offset type specified by the QAOMU number supplied from the QAOU control unit 622. Further, the derived offset type is supplied to the class classification unit 624.

(クラス分類部624)
クラス分類部624は、対象QAOUに含まれる各画素を、オフセットタイプ導出部623から供給されるオフセットタイプにおいて選択可能な複数のクラスの何れかに分類する。また、当該オフセットタイプと、各画素が分類されたクラスを示すクラスインデックスとをオフセット導出部626に供給する。
(Class classification unit 624)
The class classification unit 624 classifies each pixel included in the target QAOU into any of a plurality of classes that can be selected in the offset type supplied from the offset type deriving unit 623. In addition, the offset type and a class index indicating a class into which each pixel is classified are supplied to the offset deriving unit 626.

(クラス分類部624の構成)
図8は、クラス分類部624の構成を示すブロック図である。
(Configuration of class classification unit 624)
FIG. 8 is a block diagram illustrating a configuration of the class classification unit 624.

図8に示すように、クラス分類部624は、適応的エッジオフセットクラス分類部6241、および、適応的バンドオフセットクラス分類部6244、から構成されている。また、適応的エッジオフセットクラス分類部6241は、使用エッジオフセットクラス選択部6242、およびエッジオフセットクラス分類部6243から構成され、適応的バンドオフセットクラス分類部6244は、使用バンドオフセットクラス・バンド幅選択部6245、およびバンドオフセットクラス分類部6246から構成されている。   As shown in FIG. 8, the class classification unit 624 includes an adaptive edge offset class classification unit 6241 and an adaptive band offset class classification unit 6244. The adaptive edge offset class classifying unit 6241 includes a used edge offset class selecting unit 6242 and an edge offset class classifying unit 6243. The adaptive band offset class classifying unit 6244 includes a used band offset class / bandwidth selecting unit. 6245 and a band offset class classifying unit 6246.

クラス分類部624は、パラメータ条件およびオフセットタイプに応じて、各画素をクラスに分類する。オフセットタイプがエッジオフセットを示す場合には、適応的エッジオフセットクラス分類部6241により画素を分類し、オフセットタイプがバンドオフセットの場合には、適応的バンドオフセットクラス分類部6244において、画素を分類する。   The class classification unit 624 classifies each pixel into a class according to the parameter condition and the offset type. If the offset type indicates an edge offset, the adaptive edge offset class classifying unit 6241 classifies the pixel. If the offset type is a band offset, the adaptive band offset class classifying unit 6244 classifies the pixel.

適応的エッジオフセットクラス分類部6241は、パラメータ条件に応じて適応的に、画素をクラスに分類する手段であり、使用エッジオフセットクラス選択部6242とエッジオフセットクラス分類部6243とを備えている。   The adaptive edge offset class classification unit 6241 is a unit that adaptively classifies pixels into classes according to parameter conditions, and includes a use edge offset class selection unit 6242 and an edge offset class classification unit 6243.

使用エッジオフセットクラス選択部6242は、使用するクラスの種類を選択する。使用エッジオフセットクラス選択部6242は、画素の分類に用いるパラメータをエッジオフセットクラス分類部6243に入力する。具体的には、オフセットタイプおよびパラメータ条件に応じて選択したエッジクラス変換テーブルを入力する。パラメータ条件の一つは、画素の表す成分の種別であり、成分が輝度である場合と色差である場合それぞれに応じた変換テーブルを選択して入力する。   The used edge offset class selection unit 6242 selects the type of class to be used. The used edge offset class selection unit 6242 inputs parameters used for pixel classification to the edge offset class classification unit 6243. Specifically, the edge class conversion table selected according to the offset type and parameter conditions is input. One of the parameter conditions is the type of the component represented by the pixel. When the component is luminance and color difference, a conversion table corresponding to each is selected and input.

エッジオフセットクラス分類部6243は、与えられたオフセットタイプに対応する参照画素と、エッジクラス変換テーブルに基づいて画素を分類する。なお、使用エッジオフセットクラス選択部6242は、オフセットタイプをエッジオフセットクラス分類部6243に入力する代わりに、参照画素の位置が特定できる別のパラメータを用いて入力してもよい。例えば、エッジオフセットEO_0〜EO_3に対応づけられた他のインデクスや、処理対象画素と参照画素の相対座標を、入力として用いることができる。   The edge offset class classification unit 6243 classifies the pixels based on the reference pixel corresponding to the given offset type and the edge class conversion table. The used edge offset class selection unit 6242 may input the offset type using another parameter that can specify the position of the reference pixel, instead of inputting the offset type to the edge offset class classification unit 6243. For example, other indexes associated with the edge offsets EO_0 to EO_3 and the relative coordinates of the processing target pixel and the reference pixel can be used as input.

適応的バンドオフセットクラス分類部6244は、パラメータ条件に応じて適応的に、画素をクラスに分類する手段であり、使用バンドオフセットクラス・バンド幅選択部6245とバンドオフセットクラス分類部6246とを備えている。   The adaptive band offset class classifying unit 6244 is means for adaptively classifying pixels into classes according to parameter conditions, and includes a used band offset class / bandwidth selecting unit 6245 and a band offset class classifying unit 6246. Yes.

使用バンドオフセットクラス・バンド幅選択部6245は、画素値の分類に用いるパラメータをバンドオフセットクラス分類部6246に入力する。具体的には、バンド幅とバンドクラス変換テーブルを入力する。パラメータ条件の一つは画素の表す成分の種別であり、成分が輝度である場合と色差である場合それぞれに応じたバンドクラス変換テーブルを選択して入力する。   The used band offset class / bandwidth selection unit 6245 inputs parameters used for pixel value classification to the band offset class classification unit 6246. Specifically, the bandwidth and the band class conversion table are input. One of the parameter conditions is the type of the component represented by the pixel. When the component is luminance and color difference, a band class conversion table corresponding to each is selected and input.

バンドオフセットクラス分類部6246は、入力されたバンド幅とバンドクラス変換テーブルに応じて画素値をクラスに分類する。入力であるバンド幅は、バンド幅自体ではなく、バンド幅に対応する整数でも構わない。例えばバンド幅を2^BWBitとする場合、その2を底とする対数であるBWBitや、画素のビット深度からバンド幅に用いるビット数を求めるための値、例えば、BWBit=PIC_DEPTH−5であれば5を、バンド幅の代わりに用いても構わない。   The band offset class classification unit 6246 classifies the pixel values into classes according to the input bandwidth and the band class conversion table. The input bandwidth may be an integer corresponding to the bandwidth, not the bandwidth itself. For example, when the bandwidth is 2 ^ BWBit, the logarithm of base 2 is BWBit, or a value for obtaining the number of bits used for the bandwidth from the bit depth of the pixel, for example, BWBBit = PIC_DEPTH-5. 5 may be used instead of the bandwidth.

次に、クラス分類部624による分類処理について、図9および図10を参照してさらに詳細に説明する。   Next, the classification process by the class classification unit 624 will be described in more detail with reference to FIGS. 9 and 10.

(エッジオフセットの場合)
オフセットタイプ導出部623から供給されるオフセットタイプが1〜4の何れかであれば、エッジオフセット処理が行われる。このときクラス分類部624は、処理対象の画素の近傍にエッジが存在するか否か、およびエッジが存在する場合にはエッジの種類を判定し、判定した結果に応じて、当該処理対象の画素を、複数のクラスの何れかに分類する。
(For edge offset)
If the offset type supplied from the offset type deriving unit 623 is any one of 1 to 4, edge offset processing is performed. At this time, the class classification unit 624 determines whether or not there is an edge in the vicinity of the pixel to be processed, and if there is an edge, the type of the edge is determined, and according to the determination result, the pixel to be processed Are classified into any of a plurality of classes.

より具体的には、まず、クラス分類部624は、処理対象画素xのエッジ種別を表すEdgeClassを導出する。EdgeClassは、オフセットのクラスインデックスclass_idxを導出するための中間値である。また、EdgeClassは、処理対象画素xの画素値pix[x]と、該処理対象画素に隣接するか、または頂点を共有する2つの画素a、bの画素値pix[a]、pix[b]とを用いて導出する。以降、EdgeClassを導出するために、処理対象画素とともに用いられる画素を参照画素と呼称する。また、何れの画素を参照画素するかは、オフセットタイプに依存する。図9(a)〜(d)は、各エッジオフセットタイプにおける参照画素の位置を説明するための図であり、いずれも画素xが処理対象画素を示し、画素aと画素bが参照画素を示す。   More specifically, first, the class classification unit 624 derives EdgeClass representing the edge type of the processing target pixel x. EdgeClass is an intermediate value for deriving an offset class index class_idx. EdgeClass is a pixel value pix [x] of the processing target pixel x and pixel values pix [a] and pix [b] of two pixels a and b that are adjacent to the processing target pixel or share a vertex. And derived using Hereinafter, in order to derive EdgeClass, a pixel used together with the processing target pixel is referred to as a reference pixel. Which pixel is used as a reference pixel depends on the offset type. FIGS. 9A to 9D are diagrams for explaining the position of the reference pixel in each edge offset type. In any case, the pixel x indicates the processing target pixel, and the pixel a and the pixel b indicate the reference pixel. .

・オフセットタイプEO_0(sao_type_idx=1)のとき
図9(a)に示すように、処理対象画素xの左側に隣接する画素を画素aとし、処理対象画素の右側に隣接する画素を画素bとする。
When the offset type is EO_0 (sao_type_idx = 1) As shown in FIG. 9A, the pixel adjacent to the left side of the processing target pixel x is defined as a pixel a, and the pixel adjacent to the right side of the processing target pixel is defined as a pixel b. .

・オフセットタイプEO_1(sao_type_idx=2)のとき
図9(b)に示すように、処理対象画素xの上側に隣接する画素を画素aとし、処理対象画素の下側に隣接する画素を画素bとする。
When the offset type EO_1 (sao_type_idx = 2) As shown in FIG. 9B, the pixel adjacent to the upper side of the processing target pixel x is defined as a pixel a, and the pixel adjacent to the lower side of the processing target pixel is defined as a pixel b. To do.

・オフセットタイプEO_2(sao_type_idx=3)のとき
図9(c)に示すように、処理対象画素xの左上の頂点を共有する画素を画素aとし、処理対象画素の右下の頂点を共有する画素を画素bとする。
When the offset type is EO_2 (sao_type_idx = 3) As shown in FIG. 9C, the pixel sharing the upper left vertex of the processing target pixel x is defined as a pixel a, and the pixel sharing the lower right vertex of the processing target pixel Is a pixel b.

・オフセットタイプEO_3(sao_type_idx=4)のとき
図9(d)に示すように、処理対象画素xの左下の頂点を共有する画素を画素aとし、処理対象画素の右上の頂点を共有する画素を画素bとする。
When the offset type EO — 3 (sao_type_idx = 4) As shown in FIG. 9D, the pixel sharing the lower left vertex of the processing target pixel x is defined as a pixel a, and the pixel sharing the upper right vertex of the processing target pixel Let it be pixel b.

画素aおよび画素bが定まれば、それらと処理対象画素xとの差分の符号
Sign(pix[x]−pix[a])、および
Sign(pix[x]−pix[b])
を用いて、クラス分類部624は、エッジ種別EdgeClassを導出する。ここで、Sign(z)は、
Sign(z)=+1 (z>0のとき)
Sign(z)=0 (z=0のとき)
Sign(z)=−1 (z<0のとき)
の各値をとる関数である。図10(a)は、図9に示す処理対象画素xの画素値(図中の白丸)と画素aまたはbの画素値(図中の黒丸)との大小関係を丸の高低で示す模式図、およびその大小関係に応じた関数Signの値を示している。よって、画素xの画素値pix[x]と画素p(pはaまたはb)の画素値pix[p]との大小関係と関数Signの値との関係は、
pix[x]<pix[p]の場合はSign(pix[x]−pix[p])=−1、
pix[x]=pix[p]の場合はSign(pix[x]−pix[p])=0、
pix[x]>pix[p]の場合はSign(pix[x]−pix[p])=+1、
となる。
If the pixel a and the pixel b are determined, the sign of the difference between them and the processing target pixel x Sign (pix [x] −pix [a]), and Sign (pix [x] −pix [b])
The class classification unit 624 derives the edge type EdgeClass. Where Sign (z) is
Sign (z) = + 1 (when z> 0)
Sign (z) = 0 (when z = 0)
Sign (z) =-1 (when z <0)
It is a function that takes each value of. FIG. 10A is a schematic diagram showing the magnitude relationship between the pixel value of the processing target pixel x shown in FIG. 9 (white circle in the drawing) and the pixel value of the pixel a or b (black circle in the drawing) by the height of the circle. , And the value of the function Sign according to the magnitude relationship. Therefore, the relationship between the magnitude relationship between the pixel value pix [x] of the pixel x and the pixel value pix [p] of the pixel p (p is a or b) and the value of the function Sign is
When pix [x] <pix [p], Sign (pix [x] −pix [p]) = − 1,
When pix [x] = pix [p], Sign (pix [x] −pix [p]) = 0,
When pix [x]> pix [p], Sign (pix [x] −pix [p]) = + 1,
It becomes.

続いて、クラス分類部624は、Sign(pix[x]−pix[a])、およびSign(pix[x]−pix[b])に基づいて、次式によってEdgeClassを導出する。   Subsequently, the class classification unit 624 derives EdgeClass by the following expression based on Sign (pix [x] −pix [a]) and Sign (pix [x] −pix [b]).

EdgeClass=Sign(pix[x]−pix[a])+Sign(pix[x]−pix[b])+2
図10(b)は、処理対象画素xの画素値と参照画素aおよびbの画素値の大小関係の種別の模式図および、各大小関係に応じたEdgeClass値を示している。図10(b)に示すように、
・画素値pix[x]に対し、画素値pix[a]および画素値pix[b]のいずれも大きい場合は、EdgeClass=0となる。
・画素値pix[x]に対し、画素値pix[a]および画素値pix[b]のうち、一方の画素値が大きく、他方の画素値が同じ場合は、EdgeClass=1となる。
・画素値pix[x]に対し、画素値pix[a]および画素値pix[b]のうち、一方の画素値が小さく、他方の画素値が同じ場合は、EdgeClass=3となる。
・画素値pix[x]に対し、画素値pix[a]および画素値pix[b]のいずれの画素値も小さい場合は、EdgeClass=4となる。
・画素値pix[x]に対し、画素値pix[a]および画素値pix[b]のうち、一方の画素値が小さく、他方の画素値が大きい場合、または、画素値pix[x]に対し、画素値pix[a]および画素値pix[b]のいずれの画素値も同じ場合は、EdgeClass=2となる。
EdgeClass = Sign (pix [x] −pix [a]) + Sign (pix [x] −pix [b]) + 2
FIG. 10B shows a schematic diagram of the type of magnitude relationship between the pixel value of the processing target pixel x and the pixel values of the reference pixels a and b, and the EdgeClass value corresponding to each magnitude relationship. As shown in FIG.
When both the pixel value pix [a] and the pixel value pix [b] are larger than the pixel value pix [x], EdgeClass = 0.
EdgeClass = 1 when one of the pixel value pix [a] and the pixel value pix [b] is larger than the pixel value pix [x] and the other pixel value is the same.
If one of the pixel value pix [a] and the pixel value pix [b] is smaller than the pixel value pix [x] and the other pixel value is the same, EdgeClass = 3.
When the pixel value pix [a] and the pixel value pix [b] are smaller than the pixel value pix [x], EdgeClass = 4.
The pixel value pix [x] has a pixel value pix [a] and a pixel value pix [b], one of which is small and the other pixel value is large, or the pixel value pix [x]. On the other hand, when both the pixel value pix [a] and the pixel value pix [b] are the same, EdgeClass = 2.

続いて、クラス分類部624は、導出したEdgeClassに基づいて、処理対象画素xが属するべきクラスのクラスインデックス(class_idx)を以下のように導出する。
・処理対象画素が輝度画素である場合
class_idx = EoTblY[EdgeClass]
・処理対象画素が色差画素である場合
class_idx = EoTblC[EdgeClass]
ここで、EoTblYおよびEoTblCは、EdgeClassからclass_idxを導出するための変換テーブルであり、以下ではエッジクラス変換テーブルと呼称する。EoTblYは輝度画素に対して用いられ、EoTblCは色差画素に対して用いられる。このように、クラス分類部624は、処理対象画素xの表す成分、すなわち輝度画素か色素画素かに応じてエッジクラス変換テーブルを使い分け、輝度画素と色差画素それぞれの特性に適応するように、各画素をクラスに分類する。
Subsequently, the class classification unit 624 derives the class index (class_idx) of the class to which the processing target pixel x should belong based on the derived EdgeClass as follows.
When the pixel to be processed is a luminance pixel, class_idx = EoTblY [EdgeClass]
When the pixel to be processed is a chrominance pixel, class_idx = EoTblC [EdgeClass]
Here, EoTblY and EoTblC are conversion tables for deriving class_idx from EdgeClass, and are hereinafter referred to as edge class conversion tables. EoTblY is used for luminance pixels, and EoTblC is used for color difference pixels. In this way, the class classification unit 624 uses the edge class conversion table properly according to the component represented by the processing target pixel x, that is, whether it is a luminance pixel or a pigment pixel, and adapts to the characteristics of each of the luminance pixel and the chrominance pixel. Classify pixels into classes.

次に、図10(c)、(d)に、EoTblYおよびEoTblC(クラス分類方法)の具体例を示す。図10(c)の変換テーブル1001Aは、輝度画素に対して用いられるエッジクラス変換テーブルEoTblYであり、EdgeClass=2の画素はクラス0と分類してオフセット処理をしない。   Next, FIGS. 10C and 10D show specific examples of EoTblY and EoTblC (class classification method). A conversion table 1001A in FIG. 10C is an edge class conversion table EoTblY used for luminance pixels. Pixels with EdgeClass = 2 are classified as class 0 and are not subjected to offset processing.

図10(d)の変換テーブル1001Bは、色差画素に対して用いられるエッジクラス変換テーブルEoTblCであり、5種類のエッジ種別すべてに対してオフセット処理をする場合に用いられる。   A conversion table 1001B in FIG. 10D is an edge class conversion table EoTblC used for color difference pixels, and is used when offset processing is performed for all five edge types.

なお、ここでは画素の表す成分をパラメータ条件としてエッジクラス変換テーブルを切り替えたが、これ以外のパラメータ条件に応じて、エッジクラス変換テーブルを選択しても良い。パラメータ条件の他の例としては、分割深度(sao_depth)やQAOUサイズがある。具体例を挙げれば、分割深度が閾値以上の場合にのみ、上記のように輝度画素にはエッジクラス変換テーブル1001Aを、色差画素にはエッジクラス変換テーブル1001Bを用い、それ以外の場合には共通のエッジクラス変換テーブルとして1001Aを用いることができる。また別の例としては、QAOUサイズが閾値未満の場合にのみ、輝度画素にはエッジクラス変換テーブル1001Aを、色差画素にはエッジクラス変換テーブル1001Bを用い、それ以外の場合には共通のエッジクラス変換テーブルとして1001Aを用いることができる。   Here, the edge class conversion table is switched using the component represented by the pixel as the parameter condition, but the edge class conversion table may be selected according to other parameter conditions. Other examples of parameter conditions include division depth (sao_depth) and QAOU size. As a specific example, the edge class conversion table 1001A is used for luminance pixels and the edge class conversion table 1001B is used for color difference pixels as described above only when the division depth is equal to or greater than the threshold value. 1001A can be used as the edge class conversion table. As another example, the edge class conversion table 1001A is used for luminance pixels and the edge class conversion table 1001B is used for chrominance pixels only when the QAOU size is less than the threshold value. In other cases, a common edge class is used. 1001A can be used as the conversion table.

(バンドオフセットの場合)
オフセットタイプ導出部623から供給されるオフセットタイプが5または6であればバンドオフセット処理が行われる。このとき、クラス分類部624は、処理対象画素xの画素値pix[x]に応じて、当該処理対象画素の画素値を複数のクラスの何れかに分類する。本実施形態では、色差画素の画素値の特性を利用するため、輝度画素と色差画素では異なる分類が用いられる。なお、以下で用いる数maxは、処理対象画素xの画素値の取り得る最大値を表しており、例えば8ビットの符号なし整数で表現される画素であれば、最大画素値max=255である。また、便宜上、max1=max+1とする。さらに、“/”による除算の余りは切り捨てとする。
(For band offset)
If the offset type supplied from the offset type deriving unit 623 is 5 or 6, band offset processing is performed. At this time, the class classification unit 624 classifies the pixel value of the processing target pixel into one of a plurality of classes according to the pixel value pix [x] of the processing target pixel x. In this embodiment, since the pixel value characteristics of the color difference pixels are used, different classifications are used for the luminance pixels and the color difference pixels. The number max used below represents the maximum value that can be taken by the pixel value of the processing target pixel x. For example, if the pixel is expressed by an 8-bit unsigned integer, the maximum pixel value max = 255. . For convenience, it is assumed that max1 = max + 1. Furthermore, the remainder of division by “/” is rounded down.

バンドオフセット処理について、図11および図12を用いて説明する。   The band offset process will be described with reference to FIGS.

図11は、適応オフセットフィルタ60によるオフセット処理を説明するための図である。それぞれ、
(a)処理対象画素xが輝度画素かつオフセットタイプBO_0(sao_type_idx=5)
(b)処理対象画素xが輝度画素かつオフセットタイプBO_1(sao_type_idx=6)
(c)処理対象画素xが色差画素かつオフセットタイプBO_0(sao_type_idx=5)
(d)処理対象画素xが色差画素かつオフセットタイプBO_1(sao_type_idx=6)
であるときのクラス分類を概略的に示している。いずれも、斜線が付されていない値域は画素xがクラス0に分類されることを示し、斜線が付された値域はクラス0以外であること示す。(a)〜(d)それぞれの場合について詳細に説明すれば、以下の通りである。
(a)処理対象画素xが輝度画素かつオフセットタイプBO_0(sao_type_idx=5)のとき、クラス分類部624は、処理対象画素xの画素値pix[x]が、
(max1×1/4)≦pix[x]<(max1×3/4) (式E1)
を満たしている場合に、当該処理対象画素をクラス0以外のクラスに分類する。すなわち、処理対象画素の画素値が、図11(a)における斜線の範囲内である場合に、当該処理対象画素をクラス0以外のクラスに分類する。
(b)処理対象画素xが輝度画素かつオフセットタイプBO_1(sao_type_idx=6)のとき、クラス分類部624は、処理対象画素xの画素値pix[x]が、
pix[x]<(max1×1/4)または(max1×3/4)≦pix[x]
(式E2)
を満たしている場合に、当該処理対象画素をクラス0以外のクラスに分類する。すなわち、処理対象画素の画素値が、図11(b)における斜線の範囲内である場合に、当該処理対象画素をクラス0以外のクラスに分類する。
(c)処理対象画素xが色差画素かつオフセットタイプBO_0(sao_type_idx=5)のとき、クラス分類部624は、処理対象画素xの画素値pix[x]が、
(max1×4/32)≦pix[x]<(max1×20/32) (式E3)
を満たしている場合に、当該処理対象画素をクラス0以外のクラスに分類する。すなわち、処理対象画素の画素値が、図11(c)における斜線の範囲内である場合に、当該処理対象画素をクラス0以外のクラスに分類する。
(d)処理対象画素xが色差画素かつオフセットタイプBO_1(sao_type_idx=6)のとき、クラス分類部624は、処理対象画素xの画素値pix[x]が、
(max1×12/32)≦pix[x]<(max1×28/32) (式E4)
を満たしている場合に、当該処理対象画素をクラス0以外のクラスに分類する。すなわち、処理対象画素の画素値が、図11(d)における斜線の範囲内である場合に、当該処理対象画素をクラス0以外のクラスに分類する。
FIG. 11 is a diagram for explaining offset processing by the adaptive offset filter 60. Each,
(A) Processing target pixel x is a luminance pixel and offset type BO_0 (sao_type_idx = 5)
(B) Processing target pixel x is a luminance pixel and offset type BO_1 (sao_type_idx = 6)
(C) Processing target pixel x is a color difference pixel and offset type BO_0 (sao_type_idx = 5)
(D) The processing target pixel x is a color difference pixel and the offset type BO_1 (sao_type_idx = 6)
The class classification when is is shown schematically. In both cases, a value range that is not hatched indicates that the pixel x is classified as class 0, and a value range that is shaded indicates that it is other than class 0. It will be as follows if each of (a)-(d) is demonstrated in detail.
(A) When the processing target pixel x is a luminance pixel and the offset type BO_0 (sao_type_idx = 5), the class classification unit 624 determines that the pixel value pix [x] of the processing target pixel x is
(Max1 × 1/4) ≦ pix [x] <(max1 × 3/4) (formula E1)
Is satisfied, the processing target pixel is classified into a class other than class 0. That is, when the pixel value of the processing target pixel is within the hatched range in FIG. 11A, the processing target pixel is classified into a class other than class 0.
(B) When the processing target pixel x is a luminance pixel and the offset type BO_1 (sao_type_idx = 6), the class classification unit 624 determines that the pixel value pix [x] of the processing target pixel x is
pix [x] <(max1 × 1/4) or (max1 × 3/4) ≦ pix [x]
(Formula E2)
Is satisfied, the processing target pixel is classified into a class other than class 0. That is, when the pixel value of the processing target pixel is within the hatched range in FIG. 11B, the processing target pixel is classified into a class other than class 0.
(C) When the processing target pixel x is a color difference pixel and the offset type BO_0 (sao_type_idx = 5), the class classification unit 624 determines that the pixel value pix [x] of the processing target pixel x is
(Max1 × 4/32) ≦ pix [x] <(max1 × 20/32) (formula E3)
Is satisfied, the processing target pixel is classified into a class other than class 0. That is, when the pixel value of the processing target pixel is within the hatched range in FIG. 11C, the processing target pixel is classified into a class other than class 0.
(D) When the processing target pixel x is the color difference pixel and the offset type BO_1 (sao_type_idx = 6), the class classification unit 624 determines that the pixel value pix [x] of the processing target pixel x is
(Max1 × 12/32) ≦ pix [x] <(max1 × 28/32) (formula E4)
Is satisfied, the processing target pixel is classified into a class other than class 0. That is, when the pixel value of the processing target pixel is within the hatched range in FIG. 11D, the processing target pixel is classified into a class other than class 0.

なお、max=255であるとき、上記の条件(式E1)〜(式E4)は、pix[x]を量子化幅8で量子化し、それぞれ
(式E1) 8≦(pix[x]/8)≦23
(式E2) (pix[x]/8)≦7 または 24≦(pix[x]/8)
(式E3) 4≦(pix[x]/8)≦19
(式E4) 12≦(pix[x]/8)≦27
と表現することもできるし、量子化幅16を用いてそれぞれ、
(式E1) 4≦(pix[x]/16)≦11
(式E2) (pix[x]/16)≦3 または 12≦(pix[x]/16)
(式E3) 2≦(pix[x]/16)≦9
(式E4) 6≦(pix[x]/16)≦13
と表現することもできる。
When max = 255, the above conditions (Equation E1) to (Equation E4) are such that pix [x] is quantized with a quantization width of 8, and (Equation E1) 8 ≦ (pix [x] / 8 ) ≦ 23
(Formula E2) (pix [x] / 8) ≦ 7 or 24 ≦ (pix [x] / 8)
(Formula E3) 4 ≦ (pix [x] / 8) ≦ 19
(Formula E4) 12 ≦ (pix [x] / 8) ≦ 27
Can also be expressed using the quantization width of 16, respectively.
(Formula E1) 4 ≦ (pix [x] / 16) ≦ 11
(Formula E2) (pix [x] / 16) ≦ 3 or 12 ≦ (pix [x] / 16)
(Formula E3) 2 ≦ (pix [x] / 16) ≦ 9
(Formula E4) 6 ≦ (pix [x] / 16) ≦ 13
It can also be expressed as

クラス分類部624によるクラス分類処理をより詳細に説明すれば以下の通りである。   The class classification process by the class classification unit 624 will be described in more detail as follows.

オフセットタイプがBO_0かBO_1の何れかであるとき、クラス分類部624は、処理対象画素xが属するべきクラスのクラスインデックス(class_idx)を、処理対象画素xの表す画素の成分、画素値の値域(バンド)を表すバンドインデックス(band_idx)、およびオフセットタイプ(sao_type_idx)に応じて、次のように導出する。
・処理対象画素が輝度画素である場合
class_idx
= BoTblY[sao_type_idx][band_idx]
・処理対象画素が色差画素である場合
class_idx
= BoTblC[sao_type_idx][band_idx]
ここで、BoTblYおよびBoTblCは、band_idxとsao_type_idxとから、class_idxを導出するために用いられる変換テーブルであり、以下ではバンドクラス変換テーブルと呼ぶ。BoTblYは輝度画素に対して用いられ、BoTblCは色差画素に対して用いられる。このように、クラス分類部624は、処理対象画素xの表す成分、すなわち輝度画素か色差画素かに応じてバンドクラス変換テーブルを使い分け、輝度画素と色差画素それぞれの特性に適応するように、各画素値をクラスに分類する。すなわち、band_idxからclass_idxへの変換が行われる。
When the offset type is either BO_0 or BO_1, the class classification unit 624 indicates the class index (class_idx) of the class to which the processing target pixel x should belong, the pixel component represented by the processing target pixel x, and the range of pixel values ( It is derived as follows according to the band index (band_idx) representing the band) and the offset type (sao_type_idx).
When the pixel to be processed is a luminance pixel, class_idx
= BoTblY [sao_type_idx] [band_idx]
When the pixel to be processed is a color difference pixel, class_idx
= BoTblC [sao_type_idx] [band_idx]
Here, BoTblY and BoTblC are conversion tables used for deriving class_idx from band_idx and sao_type_idx, and are hereinafter referred to as band class conversion tables. BoTblY is used for luminance pixels, and BoTblC is used for color difference pixels. As described above, the class classification unit 624 uses the band class conversion table properly according to the component represented by the processing target pixel x, that is, the luminance pixel or the chrominance pixel, and adapts to the characteristics of the luminance pixel and the chrominance pixel. Classify pixel values into classes. That is, conversion from band_idx to class_idx is performed.

なお、ここでband_idxは次式
band_idx = pix[x]>>BWBit
(“>>”は右シフト演算)
で導出される。BWBitは、画像ビット深度をPIC_DEPTHとする場合に、各々PIC_DEPTH−BWBitで導出される値であり、画素値を2BWBit段階の値に量子化する。BWBitで右シフトすることは、(1<<BWBit)で除算することに対応する(“<<”は左シフト演算)。例えば、BWBit=3であれば、BWBitで右シフトすることは、8での除算に対応し、各画素値の量子化幅(バンド幅)が8であることを意味する。このときPIC_DEPTH=8であれば、band_idxで示されるバンドの数は2/2=32種類となる。
Here, band_idx is the following expression: band_idx = pix [x] >> BWBit
(">>" is a right shift operation)
Is derived by BWBit is a value derived from PIC_DEPTH-BWBit when the image bit depth is set to PIC_DEPTH, and the pixel value is quantized to a value of 2BWBit stage. Shifting to the right by BWBBit corresponds to dividing by (1 << BWBBit) ("<<" is a left shift operation). For example, if BWBit = 3, shifting right by BWBBit corresponds to division by 8 and means that the quantization width (bandwidth) of each pixel value is 8. If this time PIC_DEPTH = 8, the number of bands shown in band_idx becomes 2 8/2 3 = 32 kinds.

続いて、輝度と色差とで、異なる量子化幅を用いる場合を説明する。図38は、輝度および色差のband_idxの算出方法を示す図である。図38(a)に示すように輝度のバンドインデックスband_idx_Yは、以下の式で算出する。   Next, a case where different quantization widths are used for luminance and color difference will be described. FIG. 38 is a diagram illustrating a method of calculating the band_idx of luminance and color difference. As shown in FIG. 38A, the luminance band index band_idx_Y is calculated by the following equation.

BWBitY=BitDepthY - 5
band_idx_Y = pix[x]>>BWBitY
ここで、BitDepthYは輝度の画像ビット深度PIC_DEPTHである。輝度のシフト値BWBitYは輝度のビット深度から所定の定数NY(ここでは5)を引くことによって算出される。
BWBitY = BitDepthY-5
band_idx_Y = pix [x] >> BWBitY
Here, BitDepthY is the luminance image bit depth PIC_DEPTH. The luminance shift value BWBitY is calculated by subtracting a predetermined constant NY (here, 5) from the luminance bit depth.

図38(b)に示すように色差のバンドインデックスband_idx_Cは、以下の式で算出する。   As shown in FIG. 38B, the color difference band index band_idx_C is calculated by the following equation.

BWBitC=BitDepthC - 6
band_idx_C = pix[x]>>BWBitC
ここで、BitDepthCは色差の画像ビット深度PIC_DEPTHである。輝度のシフト値BWBitYは輝度のビット深度から所定の定数NC(ここでは6)を引くことによって算出される。
BWBitC = BitDepthC-6
band_idx_C = pix [x] >> BWBBitC
Here, BitDepthC is the color difference image bit depth PIC_DEPTH. The brightness shift value BWBitY is calculated by subtracting a predetermined constant NC (here, 6) from the brightness bit depth.

上記の算出方法によると、色差のバンド幅の方が、輝度のバンド幅よりも狭い。色差のヒストグラムを観察すると、輝度のヒストグラムと比較して、狭い値の範囲に画素値が集中していることが多い。そのため、色差を効率的に分類するためには、狭いバンド幅を用いて画素値を分類することが有効である。このとき、輝度は32段階、色差は64段階に量子化される。すなわち、輝度をN1段階、色差をN2段階に量子化するとすれば、上記処理は、N2>N1となるように量子化を行う。   According to the above calculation method, the color difference bandwidth is narrower than the luminance bandwidth. When observing a color difference histogram, pixel values are often concentrated in a narrow range of values as compared to a luminance histogram. Therefore, in order to efficiently classify color differences, it is effective to classify pixel values using a narrow bandwidth. At this time, the luminance is quantized to 32 levels and the color difference is quantized to 64 levels. That is, if the luminance is quantized to N1 level and the color difference is quantized to N2 level, the above processing is quantized so that N2> N1.

以上のように、色差のシフト値BWBitCおよび輝度のシフト値BWBitYの算出において、色差のシフト値の算出に用いる所定の定数NCの方が、輝度のシフト値の算出に用いる所定の定数NYよりも大きな値を用いることにより、輝度よりも色差の方が狭いバンド幅を用いることになる。これにより、輝度よりも色差の方が多くの段階に分解され、狭い帯域に集中する色差を好適に分類することができる。すなわち、比較的多くのバンドに分解することができる。これにより輝度の量子化と、色差の量子化を同じ方法で行う場合に比べ符号化効率を向上させることができる。   As described above, in the calculation of the color difference shift value BWBitC and the luminance shift value BWBitY, the predetermined constant NC used for calculating the color difference shift value is more than the predetermined constant NY used for calculating the luminance shift value. By using a large value, a bandwidth having a narrower color difference than luminance is used. Thereby, the color difference is decomposed into more stages than the luminance, and the color difference concentrated in a narrow band can be suitably classified. That is, it can be decomposed into a relatively large number of bands. As a result, the encoding efficiency can be improved as compared with the case where the luminance quantization and the color difference quantization are performed by the same method.

次に、バンドクラス変換テーブルBoTblYおよびBoTblC(クラス分類方法)の具体例を図12に示す。図12(a)、(b)それぞれにおいて、「BO_0」は、sao_type_idx=5であることを示しており、「BO_1」は、sao_type_idx=6であることを示している。図12(a)のバンドクラス変換テーブル1301は、処理対象画素xが輝度画素である場合に用いられる変換テーブルであり、図12(b)のバンドクラス変換テーブル1302は、処理対象画素xが色差画素である場合に用いられる変換テーブルである。   Next, specific examples of the band class conversion tables BoTblY and BoTblC (class classification method) are shown in FIG. In each of FIGS. 12A and 12B, “BO_0” indicates sao_type_idx = 5, and “BO_1” indicates sao_type_idx = 6. The band class conversion table 1301 in FIG. 12A is a conversion table used when the processing target pixel x is a luminance pixel, and the band class conversion table 1302 in FIG. It is a conversion table used when it is a pixel.

処理対象が輝度画素かつsao_type_idx=5(BO_0)のとき、図12(a)の中段に示すように、クラス分類部624は、バンドインデックスband_idxが
8≦band_idx≦23
を満たすband_idxに属する処理対象画素xについて、band_idxの値に応じてクラスインデックス1から16までの何れかのクラスに分類する。
When the processing target is a luminance pixel and sao_type_idx = 5 (BO_0), as shown in the middle part of FIG. 12A, the class classification unit 624 has a band index band_idx of 8 ≦ band_idx ≦ 23.
The processing target pixel x belonging to the band_idx that satisfies the above condition is classified into one of the class indexes 1 to 16 according to the value of the band_idx.

また、処理対象が輝度画素かつsao_type_idx=6(BO_1)のとき、図12(a)の下段に示すように、クラス分類部624は、バンドインデックスband_idxが
band_idx≦7 または 24≦band_idx
を満たすband_idxに属する処理対象画素xについて、band_idxの値に応じてクラスインデックス1から16までの何れかのクラスに分類する。
When the processing target is a luminance pixel and sao_type_idx = 6 (BO_1), as shown in the lower part of FIG. 12A, the class classification unit 624 has a band index band_idx of band_idx ≦ 7 or 24 ≦ band_idx.
The processing target pixel x belonging to the band_idx that satisfies the above condition is classified into one of the class indexes 1 to 16 according to the value of the band_idx.

処理対象が色差画素かつsao_type_idx=5(BO_0)のとき、図12(b)の中段に示すように、クラス分類部624は、バンドインデックスband_idxが
4≦band_idx≦19
を満たすband_idxに属する処理対象画素xについて、band_idxの値に応じてクラスインデックス1から16までの何れかのクラスに分類する。
When the processing target is a color difference pixel and sao_type_idx = 5 (BO_0), as shown in the middle part of FIG. 12B, the class classification unit 624 has a band index band_idx of 4 ≦ band_idx ≦ 19.
The processing target pixel x belonging to the band_idx that satisfies the above condition is classified into one of the class indexes 1 to 16 according to the value of the band_idx.

また、処理対象が色差画素かつsao_type_idx=6(BO_1)のとき、図12(b)の下段に示すように、クラス分類部624は、バンドインデックスband_idxが12≦band_idx≦27を満たすband_idxに属する処理対象画素xについて、band_idxの値に応じてクラスインデックス1から16までの何れかのクラスに分類する。   Further, when the processing target is a color difference pixel and sao_type_idx = 6 (BO_1), as shown in the lower part of FIG. 12B, the class classification unit 624 performs processing that the band index band_idx belongs to band_idx that satisfies 12 ≦ band_idx ≦ 27. The target pixel x is classified into one of class indexes 1 to 16 according to the value of band_idx.

図12(c)および図12(d)は、バンドクラス変換テーブルBoTblCの、別の例である。   FIG. 12C and FIG. 12D are other examples of the band class conversion table BoTblC.

図12(b)に示すバンドクラス変換テーブル1302、および図12(c)に示すバンドクラス変換テーブル1303では、BO_0とBO_1のどちらでもオフセット処理が行われるバンド(2つのタイプで重複するバンド)が存在するが、バンドクラス変換テーブル1302とバンドクラス変換テーブル1303とでは、重複するバンド数が異なる。   In the band class conversion table 1302 shown in FIG. 12B and the band class conversion table 1303 shown in FIG. 12C, bands for which offset processing is performed in both BO_0 and BO_1 (bands overlapping in two types) are provided. Although existing, the band class conversion table 1302 and the band class conversion table 1303 have different numbers of overlapping bands.

また、図12(b)に示すバンドクラス変換テーブル1302、および図12(c)に示すバンドクラス変換テーブル1303では、画素値0付近と画素値max付近のいくつかのバンドが、オフセット処理を行わないことを意味するクラス0に常に分類されているが、図12(d)に示すバンドクラス変換テーブル1304では、全てのバンドがBO_0またはBO_1の何れかでオフセット処理が行われるようにしている。   Further, in the band class conversion table 1302 shown in FIG. 12B and the band class conversion table 1303 shown in FIG. 12C, some bands near the pixel value 0 and the pixel value max perform the offset process. However, in the band class conversion table 1304 shown in FIG. 12D, all bands are subjected to offset processing with either BO_0 or BO_1.

図12(d)に示すバンドクラス変換テーブル1304は、複数のバンドを1つのクラスに分類する例でもあり、色差の各色の中間階調部分について、2バンドを1クラスに分類している。ここでは各色の中間階調部分について2バンドを1クラスに分類する例を示したが、画素値0や画素値max付近のバンドを1クラスに分類してもよい。また、3個以上のバンドを1クラスに分類してもよい。   The band class conversion table 1304 shown in FIG. 12D is also an example in which a plurality of bands are classified into one class, and two bands are classified into one class for the intermediate gradation portion of each color of color difference. Here, an example in which two bands are classified into one class for the intermediate gradation portion of each color is shown, but a band near the pixel value 0 or the pixel value max may be classified into one class. Three or more bands may be classified into one class.

色差画像においては、画素値の中央付近、すなわち無彩色およびそれに近い画素値を含むバンドの出現頻度が高い。したがって、当該バンドをオフセット補正することは主観画質の向上にも有効である。そこで、図12(b)、(c)、(d)に示すバンドクラス変換テーブル1302、1303、1304のように、無彩色付近のバンドを複数のタイプ何れにおいてもオフセット処理するようにすることで、何れのタイプが選択されても当該バンドはオフセット処理の効果を得ることが可能となる。これにより、符号化効率や主観画質を向上させることができる。なお、これは色差画像における無彩色値域に限られず、主観画質上あるいは符号化効率上で重要な画素値域が無彩色およびその付近同様に決定できるのであれば、上記の無彩色の場合と同様に当該値域を複数のタイプでオフセット処理する構成であってもよい。   In the color difference image, the appearance frequency of the band including the vicinity of the center of the pixel value, that is, the achromatic color and the pixel value close thereto is high. Therefore, offset correction of the band is effective for improving subjective image quality. Therefore, as shown in the band class conversion tables 1302, 1303, and 1304 shown in FIGS. 12B, 12C, and 12D, the band near the achromatic color is offset in any of a plurality of types. Regardless of which type is selected, the band can obtain the effect of offset processing. Thereby, encoding efficiency and subjective image quality can be improved. Note that this is not limited to the achromatic value range in the color difference image, and if the pixel value range that is important for subjective image quality or encoding efficiency can be determined in the same manner as in the achromatic color and the vicinity thereof, as in the case of the achromatic color described above. A configuration may be employed in which the value range is offset by a plurality of types.

なお、ここでは画素の表す成分をパラメータ条件としてバンドクラス変換テーブルを切り替えたが、これ以外のパラメータ条件に応じて、バンドクラス変換テーブルを選択しても良い。パラメータ条件の他の例としては、分割深度(sao_depth)やQAOUサイズが挙げられる。例えば、分割深度が閾値以上の場合にのみ、輝度画素と色差画素とで異なるバンドクラス変換テーブルを用い、それ以外の場合には共通のバンドクラス変換テーブルを用いることができる。また別の例では、QAOUサイズが閾値未満の場合にのみ、輝度画素と色差画素とで異なるバンドクラス変換テーブルを用い、それ以外の場合には共通のバンドクラス変換テーブルを用いることができる。   Here, the band class conversion table is switched using the component represented by the pixel as the parameter condition, but the band class conversion table may be selected according to other parameter conditions. Other examples of parameter conditions include division depth (sao_depth) and QAOU size. For example, only when the division depth is equal to or greater than the threshold value, different band class conversion tables can be used for the luminance pixels and the color difference pixels, and in other cases, a common band class conversion table can be used. In another example, only when the QAOU size is less than the threshold, different band class conversion tables can be used for luminance pixels and chrominance pixels, and in other cases, a common band class conversion table can be used.

オフセット属性設定部625は、オフセットのシフト値(OFFSET_SHIFT)を決定し、オフセット導出部に出力する。符号化データのオフセットは、画素ビット深度(PIC_DEPTHとも呼称する)よりも精度の低い、オフセットのビット深度(OFFSET_DEPTHとも呼称する)で符号化される。すなわち、符号化データ中のオフセットは、量子化されており、シフト値とは、逆量子化を行うために必要なビットシフト量を示している。また、オフセット属性設定部625は、オフセットのビット深度とオフセットの値域とを決定する。ここでは、オフセットのビット深度は、オフセット属性設定部625に入力される図示されない画素ビット深度から決定する。画素ビット深度とは、適応オフセットフィルタ60の入力画像を構成する画素値の値域をビット幅で示すものであり、画素ビット深度がNビットのとき、画素値は0から(2^N)−1の範囲を取る。   The offset attribute setting unit 625 determines a shift value (OFFSET_SHIFT) of the offset and outputs it to the offset deriving unit. The encoded data offset is encoded with an offset bit depth (also referred to as OFFSET_DEPTH) that is less accurate than the pixel bit depth (also referred to as PIC_DEPTH). That is, the offset in the encoded data is quantized, and the shift value indicates a bit shift amount necessary for performing inverse quantization. Also, the offset attribute setting unit 625 determines the offset bit depth and the offset value range. Here, the bit depth of the offset is determined from the pixel bit depth (not shown) input to the offset attribute setting unit 625. The pixel bit depth indicates a range of pixel values constituting the input image of the adaptive offset filter 60 by a bit width. When the pixel bit depth is N bits, the pixel value ranges from 0 to (2 ^ N) −1. Take a range of.

SAOのオフセットのビット深度およびシフト値の導出には以下の式を用いる。なお、パラメータ条件に基づいて他の値を用いるようにしても良い。   The following equations are used to derive the SAO offset bit depth and shift value. Other values may be used based on the parameter conditions.

OFFSET_DEPTH = MIN(PIC_DEPTH,10)
OFFSET_SHIFT = PIC_DEPTH―OFFSET_DEPTH
上記の式によれば、例えば、PIC_DEPTHが8ビットの場合には、OFFSET_DEPTHは4ビットであり、PIC_DEPTHが10ビットの場合には、OFFSET_DEPTHは6ビットである。
OFFSET_DEPTH = MIN (PIC_DEPTH, 10)
OFFSET_SHIFT = PIC_DEPTH-OFFSET_DEPTH
According to the above formula, for example, when PIC_DEPTH is 8 bits, OFFSET_DEPTH is 4 bits, and when PIC_DEPTH is 10 bits, OFFSET_DEPTH is 6 bits.

オフセット導出部626は、オフセット情報格納部621のリストメモリを参照し、対象QAOUに含まれる各画素について、クラス分類部624から供給されるオフセットタイプおよびクラスインデックスによって指定されるオフセットを導出する。さらに、オフセット導出部626は、オフセット逆量子化部(不図示)を備える。オフセット逆量子化部は、オフセットのビット深度と画素ビット深度とを合わせるように、オフセット属性設定部625によって設定されたシフト値だけオフセットを左ビットシフトすなわち逆量子化を行う。このような逆量子化を行うことで、後述するオフセット加算部627の加算処理において、同一のビット深度にて、画素値とオフセットの加算を行うことが可能である。各画素について逆量子化したオフセットは、オフセット加算部627に供給される。   The offset deriving unit 626 refers to the list memory of the offset information storage unit 621 and derives an offset specified by the offset type and class index supplied from the class classification unit 624 for each pixel included in the target QAOU. Furthermore, the offset deriving unit 626 includes an offset inverse quantization unit (not shown). The offset inverse quantization unit performs left bit shift, that is, inverse quantization, on the offset by the shift value set by the offset attribute setting unit 625 so that the bit depth of the offset matches the pixel bit depth. By performing such inverse quantization, it is possible to add the pixel value and the offset at the same bit depth in the addition processing of the offset addition unit 627 described later. The offset obtained by inverse quantization for each pixel is supplied to the offset adding unit 627.

図25は、オフセット加算部627の構成を示すブロック図である。オフセット加算部627は加算部6271およびクリップ部6772を含む。加算部6271は、対象QAOUにおけるデブロック済復号画像P_DBの各画素に対して、オフセット導出部626から供給されるオフセットを加算する。クリップ部6272は、加算部6271が出力する結果を、画素ビット深度で表現可能な値に収まるようにクリップ処理をする。なお、クリップ処理とは、任意の値を、所定の値域に包含される値に変換する処理である。ここで、オフセット加算におけるクリップ処理の必要性について、図27を用いて説明する。図27において、(a)は、オフセットの値域が−Q0〜+Q1である場合を表している。オフセットの値域の幅(OFFSET_RANGE(range of offset value)とも呼称する)は、OFFSET_DEPTHに基づいて決定され、その値は以下の式で表される。なお、Dはオフセット精度からオフセットの値域を求めるための差分値を表す項であり、本実施形態においては、D=4を用いる。   FIG. 25 is a block diagram illustrating a configuration of the offset addition unit 627. The offset addition unit 627 includes an addition unit 6271 and a clip unit 6772. The adding unit 6271 adds the offset supplied from the offset deriving unit 626 to each pixel of the deblocked decoded image P_DB in the target QAOU. The clip unit 6272 performs clip processing so that the result output from the adder 6271 falls within a value that can be expressed by the pixel bit depth. Note that the clipping process is a process of converting an arbitrary value into a value included in a predetermined value range. Here, the necessity of clip processing in offset addition will be described with reference to FIG. In FIG. 27, (a) represents a case where the offset value range is -Q0 to + Q1. The width of the offset range (also referred to as OFFSET_RANGE (range of offset value)) is determined based on OFFSET_DEPTH, and the value is expressed by the following equation. Note that D is a term representing a difference value for obtaining the offset value range from the offset accuracy, and D = 4 is used in the present embodiment.

OFFSET_RANGE=OFFSET_DEPTH−D
上記の式によれば、例えば、OFFSET_DEPTHが8ビットの場合、OFFSET_RANGEは4ビットであり、正負の範囲を対称にとれば、オフセットの値域は−8〜7である。すなわち、Q0=8,Q1=7 である。
OFFSET_RANGE = OFFSET_DEPTH-D
According to the above formula, for example, when OFFSET_DEPTH is 8 bits, OFFSET_RANGE is 4 bits. If the positive and negative ranges are symmetrical, the offset value range is −8 to 7. That is, Q0 = 8 and Q1 = 7.

図27(b)は、画素値(pixel value)の範囲を0〜maxで示す数直線であり、オフセット加算後の値が画素値の下限0を下回る場合があることを示している。図27(c)は、同じく画素値の範囲を0〜maxで示す数直線であり、オフセット加算後の値が画素値の上限maxを超える場合があることを示している。図27の(b)および(c)に示したように、オフセットの加算によって画素値が所定の範囲を超える場合があるため、クリップ処理が必要とされる。例えば、画素ビット深度がNビットの場合は、画素値の値域は0〜(2^N)−1であり、オフセット加算後の値がこの範囲内に収まるように、クリップ処理を行う必要がある。なお、図25では、加算部とクリップ部とを別々の構成として表したが、これらの代わりに、演算とクリップ処理とが一体となった飽和演算を用いた飽和演算部(不図示)を用いる構成としてもよい。
オフセット加算部627は、デブロック済復号画像P_DBに含まれる全てのQAOUを処理して得られる画像を、オフセットフィルタ済復号画像P_OFとして出力する。
FIG. 27B is a number line indicating the range of the pixel value from 0 to max, and shows that the value after the offset addition may be below the lower limit 0 of the pixel value. FIG. 27C is a number line that similarly shows the range of pixel values from 0 to max, and shows that the value after the offset addition may exceed the upper limit max of the pixel value. As shown in FIGS. 27B and 27C, since the pixel value may exceed a predetermined range due to the addition of the offset, the clipping process is required. For example, when the pixel bit depth is N bits, the pixel value range is 0 to (2 ^ N) -1, and it is necessary to perform clipping processing so that the value after offset addition falls within this range. . In FIG. 25, the addition unit and the clip unit are shown as separate configurations, but instead of these, a saturation calculation unit (not shown) using a saturation calculation in which calculation and clip processing are integrated is used. It is good also as a structure.
The offset addition unit 627 outputs an image obtained by processing all the QAOUs included in the deblocked decoded image P_DB as an offset filtered decoded image P_OF.

次に、適応オフセットフィルタ処理部62における処理の流れについて、図13を参照して説明する。図13は、適応オフセットフィルタ処理部62による処理の流れを示すフローチャートである。   Next, the flow of processing in the adaptive offset filter processing unit 62 will be described with reference to FIG. FIG. 13 is a flowchart showing the flow of processing by the adaptive offset filter processing unit 62.

(ステップS101)
まず、QAOU制御部622は、オフセット情報格納部621からQAOU構造情報を取得する。
(Step S101)
First, the QAOU control unit 622 acquires QAOU structure information from the offset information storage unit 621.

(ステップS102)
続いて、QAOU制御部622は、処理対象とする対象QAOMUのQAOMU番号をループ変数とする第1のループを開始する。
(Step S102)
Subsequently, the QAOU control unit 622 starts a first loop using the QAOMU number of the target QAOMU to be processed as a loop variable.

(ステップS103)
QAOU制御部622は、オフセットタイプ導出部623にQAOMU番号を供給する。オフセットタイプ導出部623は、QAOU制御部622から供給されたQAOMU番号によって指定されるオフセットタイプを、オフセット情報格納部621のマップメモリおよびリストメモリから読み出す。また、オフセットタイプ導出部623は、読み出したオフセットタイプを、クラス分類部624に供給する。
(Step S103)
The QAOU control unit 622 supplies the QAOMU number to the offset type deriving unit 623. The offset type deriving unit 623 reads the offset type specified by the QAOMU number supplied from the QAOU control unit 622 from the map memory and list memory of the offset information storage unit 621. Further, the offset type deriving unit 623 supplies the read offset type to the class classification unit 624.

(ステップS104)
QAOU制御部622は、オフセットタイプ導出部623が読み出したオフセットタイプが「0」(“sao_type_idx”=0)であったとき(ステップS104でYES)、QAOU制御部622は、処理対象のQAOMUの全画素に対してオフセットを加算しないようオフセット加算部627を制御し、ステップS111から処理を続行する。
(Step S104)
When the offset type read by the offset type deriving unit 623 is “0” (“sao_type_idx” = 0) (YES in step S104), the QAOU control unit 622 determines that all QAOMUs to be processed The offset adding unit 627 is controlled so as not to add an offset to the pixel, and the processing is continued from step S111.

(ステップS105)
QAOU制御部622は、オフセットタイプ導出部623が読み出したオフセットタイプが「0」(“sao_type_idx”=0)ではなかったとき(ステップS104でNO)、続いて、対象QAOMUに含まれる各画素の画素番号をループ変数とする第2のループを開始する。ここで、画素番号とは、対象QAOMUに含まれる画素を互いに識別するためのものであって、例えば、対象QAOMUに含まれる各画素に対して、所定のスキャン順に付されたものである。また、そのような画素番号に代えて、対象QAOMUに含まれる各画素のx座標およびy座標をループ変数としてもよい。
(Step S105)
When the offset type read by the offset type deriving unit 623 is not “0” (“sao_type_idx” = 0) (NO in step S104), the QAOU control unit 622 continues with the pixels of each pixel included in the target QAOMU. Start a second loop with the number as the loop variable. Here, the pixel number is for identifying pixels included in the target QAOMU from each other. For example, the pixel number is assigned to each pixel included in the target QAOMU in a predetermined scan order. Further, instead of such a pixel number, the x coordinate and y coordinate of each pixel included in the target QAOMU may be used as a loop variable.

(ステップS106)
続いて、クラス分類部624は、処理対象の画素を、オフセットタイプ導出部623から供給されるオフセットタイプにおいて選択可能な複数のクラスの何れかに分類する。また、当該オフセットタイプと、処理対象の画素が分類されたクラスを示すクラスインデックスとをオフセット導出部626に供給する。
(Step S106)
Subsequently, the class classification unit 624 classifies the pixel to be processed into any of a plurality of classes selectable in the offset type supplied from the offset type deriving unit 623. Further, the offset type and the class index indicating the class into which the pixel to be processed is classified are supplied to the offset deriving unit 626.

(ステップS107)
QAOU制御部622は、対象画素の分類結果がクラス0(“class_idx”=0)であったとき(ステップS107でYES)、該対象画素に対しては、オフセットを加算しないようオフセット加算部627を制御し、ステップS110から処理を続行する。
(Step S107)
When the classification result of the target pixel is class 0 (“class_idx” = 0) (YES in step S107), the QAOU control unit 622 causes the offset addition unit 627 not to add an offset to the target pixel. Control is continued from step S110.

(ステップS108)
対象画素の分類結果がクラス0(“class_idx”=0)ではなかったとき(ステップS107でNO)、続いて、オフセット導出部626は、処理対象の画素に対して加算すべきオフセットをオフセット情報格納部621から読み出す。すなわち、クラス分類部624から供給されるオフセットタイプおよびクラスインデックスによって指定されるオフセットを読み出す。
(Step S108)
When the target pixel classification result is not class 0 (“class_idx” = 0) (NO in step S107), the offset deriving unit 626 subsequently stores the offset to be added to the pixel to be processed as offset information. Read from the unit 621. That is, the offset specified by the offset type and class index supplied from the class classification unit 624 is read.

(ステップS109)
続いて、オフセット加算部627は、デブロック済復号画像P_DBの処理対象画素の画素値に対して、オフセット導出部626から供給されるオフセットを加算する。
(Step S109)
Subsequently, the offset adding unit 627 adds the offset supplied from the offset deriving unit 626 to the pixel value of the processing target pixel of the deblocked decoded image P_DB.

(ステップS110)
本ステップは、第2のループの終端である。
(Step S110)
This step is the end of the second loop.

(ステップS111)
本ステップは、第1のループの終端である。
(Step S111)
This step is the end of the first loop.

以上が、適応オフセットフィルタ処理部62における処理の流れである。   The above is the flow of processing in the adaptive offset filter processing unit 62.

(バンドオフセットの他のタイプ構成例)
ここで、バンドオフセットの他のタイプ構成例を、図31〜37を用いて説明する。
(Other types of band offset configuration)
Here, another type configuration example of the band offset will be described with reference to FIGS.

図31(a)〜(c)、図32(a)、(b)は、いずれも、それぞれ0を除く8つのクラスを含む2個のバンドオフセットタイプを構成するための、バンドクラス変換テーブルの具体例である。各例とも、画素値の値域を32バンドに分割していくつかのクラスに対応づける点では図12で示した例と同様であるが、バンドとクラスの対応付けの方法において異なる。   31 (a) to 31 (c), 32 (a), and 32 (b) are all band class conversion tables for configuring two band offset types each including eight classes excluding 0. This is a specific example. Each example is the same as the example shown in FIG. 12 in that the range of pixel values is divided into 32 bands and associated with several classes, but differs in the method of associating bands and classes.

図31(a)に示すバンドクラス変換テーブル3101においては、タイプBO_0では各バンドを8個の有効クラスに対応づける。タイプBO_1は、中央付近のバンドを8個の有効クラスと1個の無効クラスに対応づける。分割深度が小さいQAOUは面積が広いために画素値の分布も幅広くなる傾向が強い。この場合でも、タイプBO_0では多くのバンド(この例では全バンド)がいずれかのクラスに対応づけられることから、画素値の分布が幅広い場合であっても、多くの画素に対してオフセット処理適用が可能であるという利点を持つ。一方、タイプBO_1は、色差の画素値をはじめとした中央付近の画素値が多い場合に効果が高くなる。   In the band class conversion table 3101 shown in FIG. 31A, in the type BO_0, each band is associated with eight valid classes. Type BO_1 associates a band near the center with 8 valid classes and 1 invalid class. Since QAOU with a small division depth has a large area, the distribution of pixel values tends to be wide. Even in this case, since many bands (in this example, all bands) are associated with any class in type BO_0, even if the distribution of pixel values is wide, offset processing is applied to many pixels. Has the advantage of being possible. On the other hand, the type BO_1 is highly effective when there are many pixel values in the vicinity of the center including the pixel value of the color difference.

図31(b)に示すバンドクラス変換テーブル3102は、(a)で示したバンドクラス変換テーブル3101よりも、より中央に近い画素値を重視した例である。タイプBO_0は(a)と同様であるが、タイプBO_1は(a)の半分の幅であり、1バンドが1クラスに対応付けられている。これにより、中央付近の画素値の出現頻度が高い場合には、より精度の高いオフセット処理が適用できる。したがって、色差に対しては特に効果的である。   A band class conversion table 3102 shown in FIG. 31B is an example in which a pixel value closer to the center is more important than the band class conversion table 3101 shown in FIG. Type BO_0 is the same as (a), but type BO_1 is half the width of (a), and one band is associated with one class. Thereby, when the appearance frequency of the pixel value near the center is high, more accurate offset processing can be applied. Therefore, it is particularly effective for color differences.

図31(c)に示すバンドクラス変換テーブル3103は、中央付近の画素値に対してさらに重点的にオフセット処理を適用する例である。対応するバンド幅の異なるBO_0およびBO_1を併用することによって、中央付近に画素値が集中する場合であっても、画素値の集中の度合いに応じてタイプを切り替えて、適切にオフセット処理を適用できる。   A band class conversion table 3103 shown in FIG. 31C is an example in which the offset processing is applied more intensively to the pixel value near the center. By using BO_0 and BO_1 with different corresponding bandwidths, even if pixel values are concentrated near the center, the type can be switched according to the degree of concentration of the pixel values, and offset processing can be applied appropriately .

図32(a)に示すバンドクラス変換テーブル3201は、隣接しない画素値のバンドに同一のクラスを対応付ける例である。特に色差画像においては、画素値の分布は集中する傾向にあり、これはQAOUが小さくなるほど顕著である。このとき、大きく異なる画素値が同時にQAOU内に出現する頻度は低い。したがって、バンドクラス変換テーブル3201に示すように大きく異なる画素値を表す複数バンドを同一クラスに対応づけても、実質的にはいずれか一方のバンドにのみオフセット処理をしている場合が多い。このように、大きく異なる画素値を表す複数バンドを同一クラスに対応づけることで、単一のオフセットタイプながら複数の画素値分布に適応することができる。   A band class conversion table 3201 shown in FIG. 32A is an example in which the same class is associated with bands of pixel values that are not adjacent to each other. In particular, in a color difference image, the distribution of pixel values tends to be concentrated, and this is more conspicuous as QAOU becomes smaller. At this time, the frequency with which greatly different pixel values simultaneously appear in the QAOU is low. Therefore, as shown in the band class conversion table 3201, even when a plurality of bands representing pixel values that are greatly different are associated with the same class, in many cases, only one of the bands is subjected to offset processing. Thus, by associating a plurality of bands representing greatly different pixel values with the same class, it is possible to adapt to a plurality of pixel value distributions despite a single offset type.

図32(b)に示すバンドクラス変換テーブル3202は、バンドクラス変換テーブル3201で示した例と同様に複数バンドを同一クラスに対応づける例であるが、中央付近の画素値に対する精度を上げる場合の例である。   The band class conversion table 3202 shown in FIG. 32B is an example in which a plurality of bands are associated with the same class as in the example shown in the band class conversion table 3201. However, when the accuracy with respect to the pixel value near the center is increased. It is an example.

図33(a)、(b)、図34(a)、(b)、図35(a)、(b)、図36、および図37は、いずれも、それぞれ無効クラス(クラス0)を除く8つの有効クラスを含む4個のバンドオフセットタイプを構成するための、バンドクラス変換テーブルの具体例である。各例とも、画素値の値域を32バンドに分割していくつかのクラスに対応づける点では図12で示した例と同様であるが、バンドとクラスの対応付けの方法において異なり、また、バンドオフセットタイプの種類を4個としている。   33 (a), (b), FIG. 34 (a), (b), FIG. 35 (a), (b), FIG. 36, and FIG. 37 all exclude the invalid class (class 0). It is a specific example of a band class conversion table for configuring four band offset types including eight effective classes. Each example is the same as the example shown in FIG. 12 in that the pixel value range is divided into 32 bands and associated with several classes, but the method for associating the band with the class is different. There are four types of offset types.

図33(a)に示すバンドクラス変換テーブル3301は、4個のタイプBO_0〜BO_3を順に、中央部の広帯域、低画素値域および高画素値域、第1の中間調の狭帯域、第2の中間調の狭帯域に割り当てた例である。なお、以下では、「広帯域」とは、各タイプが含む有効クラスが、より多いバンド(例えばバンド半数以上とし、図33〜36では16以上のバンド)を含むことを指し、「狭帯域」とは、より少ないバンド(例えば半数未満のバンドとし、図33〜36では16未満のバンド)を含むことを指す。また、「低画素値域および高画素値域」は、輝度画素においては暗部または明部の画素値を意味し、色差画素においては、彩度の高い画素値を意味する。(a)に示すバンドクラス変換テーブル3301のタイプ構成によれば、タイプBO_0で中央付近の広い範囲に対応し、タイプBO_1で暗部と明部の領域または高彩度領域、タイプBO_2で中間調の低画素値側、BO_3で中間調の高画素値側にそれぞれ対応している。BO_2およびBO_3は、色差の画素値が緑や赤といった一色に集中する場合に適応したタイプである。   In the band class conversion table 3301 shown in FIG. 33A, the four types BO_0 to BO_3 are sequentially arranged in the center wide band, the low pixel value range and the high pixel value range, the first halftone narrow band, and the second intermediate level. This is an example of assigning to a narrow band of keys. In the following, “broadband” means that the effective class included in each type includes more bands (for example, more than half of the bands and 16 or more bands in FIGS. 33 to 36). Refers to including fewer bands (eg, less than half of the bands and less than 16 bands in FIGS. 33-36). The “low pixel value range and high pixel value range” mean a pixel value of a dark part or a bright part in a luminance pixel, and means a pixel value having high saturation in a color difference pixel. According to the type configuration of the band class conversion table 3301 shown in (a), the type BO_0 corresponds to a wide range near the center, the type BO_1 corresponds to a dark part and a bright part or a high saturation area, and the type BO_2 uses a halftone low pixel. The value side and BO_3 correspond to the halftone high pixel value side, respectively. BO_2 and BO_3 are types adapted to the case where pixel values of color differences are concentrated on one color such as green or red.

図33(b)に示すバンドクラス変換テーブル3302は、(a)に示すバンドクラス変換テーブル3301と同様に、4個のタイプBO_0〜BO_3を順に、中央部の広帯域、低画素値域および高画素値域、第1の中間調の狭帯域、第2の中間調の狭帯域に割り当てた例である。バンドクラス変換テーブル3301との違いはタイプBO_0のみである。(b)に示すバンドクラス変換テーブル3302のタイプ構成によれば、タイプBO_0を用いて、中央付近のオフセット補正性能を維持しながら、(a)に示すバンドクラス変換テーブル3301よりも広帯域の画素値分布に対応することが可能である。   The band class conversion table 3302 shown in FIG. 33 (b) is similar to the band class conversion table 3301 shown in FIG. 33 (a), and the four types BO_0 to BO_3 are sequentially arranged in the center, wide band, low pixel value range, and high pixel value range. This is an example of assignment to the first halftone narrow band and the second halftone narrow band. The difference from the band class conversion table 3301 is only the type BO_0. According to the type configuration of the band class conversion table 3302 shown in (b), a pixel value having a wider bandwidth than the band class conversion table 3301 shown in (a) while maintaining offset correction performance near the center using type BO_0. It is possible to correspond to the distribution.

図34(a)に示すバンドクラス変換テーブル3401は、4個のタイプBO_0〜BO_3を順に、広帯域、低画素値域および高画素値域、第1の中間調の狭帯域、第2の中間調の狭帯域に割り当てた例である。図33(a)に示すバンドクラス変換テーブル3301および図33(b)に示すバンドクラス変換テーブル3302との違いはタイプBO_0のみである。図34(a)に示すバンドクラス変換テーブル3401のタイプ構成によれば、タイプBO_0によって大きなQAOUなどで画素値が値域全体にわたって出現する場合に対応できる。さらに、タイプBO_0では、クラス2,3,28,29を無効クラスとしている。映像データの規格によっては、画素値の値域が8bitで0〜255であっても、使用できる画素値の範囲が、輝度で16〜235,色差で16〜240と定められている場合がある。このような場合、予測誤差等により、値域内ながら前記範囲外の値となった画素値に対しては、オフセット加算による補正効果が高い。バンドクラス変換テーブル3401のタイプBO_0では、前記範囲内の両端付近にあたるクラス2,3,28,29を無効クラスとするとで、オフセット加算によって画素値が範囲外となることを防ぎ、範囲外にあたるクラス0,1,30,31については有効クラスとすることで、オフセット加算により範囲内の値へと補正される効果を奏する。   In the band class conversion table 3401 shown in FIG. 34A, four types BO_0 to BO_3 are sequentially arranged in a wide band, a low pixel value range and a high pixel value range, a first halftone narrow band, and a second halftone narrow. It is an example assigned to a band. The difference between the band class conversion table 3301 shown in FIG. 33A and the band class conversion table 3302 shown in FIG. 33B is only type BO_0. According to the type configuration of the band class conversion table 3401 shown in FIG. 34 (a), it is possible to cope with a case where pixel values appear over the entire range due to a large QAOU or the like due to type BO_0. Further, in type BO_0, classes 2, 3, 28, and 29 are invalid classes. Depending on the standard of the video data, even if the pixel value range is 0 to 255 with 8 bits, the usable pixel value range may be defined as 16 to 235 for luminance and 16 to 240 for color difference. In such a case, due to a prediction error or the like, the correction effect by the offset addition is high for a pixel value that is within the range but is outside the range. In the type BO_0 of the band class conversion table 3401, if the classes 2, 3, 28, and 29 near the both ends in the range are invalid classes, the pixel value is prevented from being out of the range by offset addition, and the class is out of the range. By setting 0, 1, 30, and 31 as effective classes, there is an effect of being corrected to a value within the range by offset addition.

図34(b)に示すバンドクラス変換テーブル3402は、図34(a)に示すバンドクラス変換テーブル3401と同様に、4個のタイプBO_0〜BO_3を順に、全帯域、中央部の広帯域、低画素値域、高画素値域に割り当てた例である。ただしバンドクラス変換テーブル3402のタイプ構成によれば、タイプBO_2およびタイプBO_3の対応する帯域が広くとられており、画素値がより広く分布する画像に適している。   The band class conversion table 3402 shown in FIG. 34 (b) is similar to the band class conversion table 3401 shown in FIG. 34 (a). The four types BO_0 to BO_3 are sequentially arranged in the entire band, the wide band at the center, and the low pixel. It is an example assigned to a value range and a high pixel value range. However, according to the type configuration of the band class conversion table 3402, the bands corresponding to the types BO_2 and BO_3 are wide, which is suitable for an image in which pixel values are more widely distributed.

図35(a)に示すバンドクラス変換テーブル3501は、4個のタイプBO_0〜BO_3を順に、全帯域、中央部の狭帯域、低画素値域、高画素値域に割り当てた例である。図34(b)に示すバンドクラス変換テーブル3402とは、タイプBO_1の割り当てにおいてのみ異なる。バンドクラス変換テーブル3501のタイプ構成によれば、タイプBO_1によって中央部をより高い精度で補正することができ、中央に画素値が集中する画像に適している。   The band class conversion table 3501 shown in FIG. 35A is an example in which four types BO_0 to BO_3 are sequentially assigned to the entire band, the central narrow band, the low pixel value range, and the high pixel value range. It differs from the band class conversion table 3402 shown in FIG. 34 (b) only in the assignment of type BO_1. According to the type configuration of the band class conversion table 3501, the center portion can be corrected with higher accuracy by the type BO_1, which is suitable for an image in which pixel values are concentrated in the center.

図35(b)に示すバンドクラス変換テーブル3502は、4個のタイプBO_0〜BO_3を順に、中央部の広帯域、低画素値域および高画素値域、低画素値域、高画素値域に割り当てた例である。各帯域に均等にタイプを適応させることにより、画素値の分布がどの帯域に集中しても適応が容易である。   A band class conversion table 3502 shown in FIG. 35B is an example in which four types BO_0 to BO_3 are sequentially assigned to the wideband, low pixel value range, high pixel value range, low pixel value range, and high pixel value range in the center. . By adapting the type equally to each band, adaptation is easy regardless of which band the pixel value distribution is concentrated on.

図36に示すバンドクラス変換テーブル3601は、4個のタイプBO_0〜BO_3を順に、全帯域、低画素値域および高画素値域、中央部の広帯域、中央部の狭帯域に割り当てた例である。中央部に適応するタイプを2種類設け、中央部を重点的に補正することが可能である。   The band class conversion table 3601 shown in FIG. 36 is an example in which four types BO_0 to BO_3 are sequentially assigned to the entire band, the low pixel value range and the high pixel value range, the central broadband, and the central narrow band. It is possible to provide two types of types that are suitable for the central portion and to intensively correct the central portion.

以上の具体例で示したオフセットタイプは、本実施形態の他のオフセットタイプに追加あるいは交換して用いることができる。その場合、オフセットタイプを指定するsao_type_idxのとりうる値は、オフセットの総数に合わせて設定される。クラスを指定するためのインデックスclass_idxの範囲は、クラス数が8個であることから0〜7となる。   The offset types shown in the above specific examples can be used in addition to or in place of other offset types in the present embodiment. In that case, possible values of sao_type_idx for specifying the offset type are set according to the total number of offsets. The range of the index class_idx for designating a class is 0 to 7 because the number of classes is eight.

また、以上の具体例は、輝度のみあるいは色差のみに選択的に用いてもよいし、輝度と色差とで共通に用いてもよい。特に、図33〜36を参照して説明したように、2個よりも多いオフセットタイプを用いるタイプ構成であれば、輝度や色差の画素値の特性に適したタイプをともに有しているため、輝度と色差でタイプ構成を切り替えることなく、最も効果の高いオフセットタイプを用いることができる。   The above specific examples may be selectively used only for luminance or color difference, or may be used in common for luminance and color difference. In particular, as described with reference to FIGS. 33 to 36, the type configuration using more than two offset types has both types suitable for the characteristics of luminance and color difference pixel values. The most effective offset type can be used without switching the type configuration by luminance and color difference.

また、以上の各具体例においては、複数のタイプが同一のバンドのオフセット処理に対応している場合がある。例えば、図36に示すバンドクラス変換テーブル3601の例では、中央の8バンドは、タイプBO_0,BO_2およびBO_3のいずれによってもオフセット処理される。また、このような重複は中央のバンドに限らず、図33(b)に示すバンドクラス変換テーブル3302の例では、バンド4,5,6,7およびバンド24,25,26,27が、タイプBO_0およびタイプBO_1でオフセット処理の対称となっている。このように、所定の範囲の画素値を複数のタイプでオフセット処理できるようにすることで、所定の範囲の画素値に関してオフセット処理される機会を増加させることができる。所定の範囲としては、色差の中央付近や、輝度の上限付近および下限付近などが挙げられるが、これに限られず、出現頻度の高い画素値やオフセット補正の効果が高い画素値を前記所定の範囲として、複数のタイプでオフセット処理できるようにしておくことで、符号化効率が向上できる。なお、この複数のタイプはバンドオフセットの全てのオフセットタイプである必要はない。   Further, in each of the above specific examples, a plurality of types may correspond to the offset processing of the same band. For example, in the example of the band class conversion table 3601 shown in FIG. 36, the center eight bands are offset by any of the types BO_0, BO_2, and BO_3. Further, such overlap is not limited to the center band, and in the example of the band class conversion table 3302 shown in FIG. 33B, the bands 4, 5, 6, 7 and the bands 24, 25, 26, 27 are typed. The offset processing is symmetrical between BO_0 and type BO_1. In this way, by making it possible to perform offset processing on a plurality of types of pixel values in a predetermined range, it is possible to increase the chance of performing offset processing on the pixel values in the predetermined range. Examples of the predetermined range include the vicinity of the center of the color difference, the vicinity of the upper limit and the lower limit of the luminance, and the like, but are not limited thereto. Pixel values having a high appearance frequency and pixel values having a high effect of offset correction are included in the predetermined range. As described above, encoding efficiency can be improved by enabling offset processing with a plurality of types. The plurality of types need not be all offset types of the band offset.

図37に示すバンドクラス変換テーブル3701は、4個のタイプBO_0〜BO_3を順に、中央部の狭帯域、低画素値域側の中間調域、高画素値域側の中間調域、低画素値域および高画素値域に割り当てた例である。各タイプに狭い範囲に対応するクラスが含まれ、精度の高いオフセット処理が可能である。小さなQAOUの場合、例えば64×64などの局所的なブロックに対して行われる適応オフセット処理の場合には、画素値の分布は、大きなQAOUと比べると一部の範囲に集中する傾向がある。図37に示すバンドクラス変換テーブル3701の例では複数のタイプ間で帯域が重複していないが、比較的小さなブロックを用いる適応オフセットフィルタ処理においては、重要な画素値の範囲に対応する狭帯域と広帯域の複数タイプを用意するよりも、狭帯域に対して精度の高いタイプを複数用意することにより、画素値が中央以外に集中する場合にも適応することができる。   In the band class conversion table 3701 shown in FIG. 37, four types BO_0 to BO_3 are sequentially arranged in a narrow band at the center, a halftone area on the low pixel value range side, a halftone area on the high pixel value range side, a low pixel value range, and a high range. It is an example assigned to the pixel value range. Each type includes a class corresponding to a narrow range, and highly accurate offset processing is possible. In the case of a small QAOU, for example, in the case of adaptive offset processing performed on a local block such as 64 × 64, the distribution of pixel values tends to be concentrated in a part of the range compared to a large QAOU. In the example of the band class conversion table 3701 shown in FIG. 37, bands do not overlap among a plurality of types. However, in adaptive offset filter processing using a relatively small block, a narrow band corresponding to a range of important pixel values Rather than preparing a plurality of types with a wide band, by preparing a plurality of types with high accuracy for a narrow band, it is possible to adapt even when pixel values are concentrated outside the center.

図39(a)に示すバンドテーブル変換テーブル3901は、複数のバンドテーブルで重なりがない。すなわち画素値Xについて、Xが複数のクラスに分類される画素値Xが存在しないことになる。また、各クラス分類は連続である。すなわち、いずれも量子化された画素値X1、X2、X3において、画素値X1と画素値X3が同じクラスに属する場合、必ず画素値X2も画素値X1とX3と同じクラスに属することになる。連続かつ重なりのないバンド変換テーブルを用いる場合には、ある領域の画素値の代表値(例えば平均値や中央値や最頻値)が含まれるクラス分類を選択することにより、エンコーダは簡易な処理で好適な分類を選択することが可能である。   The band table conversion table 3901 shown in FIG. 39A is a plurality of band tables and does not overlap. That is, for the pixel value X, there is no pixel value X in which X is classified into a plurality of classes. Each class classification is continuous. That is, in the quantized pixel values X1, X2, and X3, when the pixel value X1 and the pixel value X3 belong to the same class, the pixel value X2 always belongs to the same class as the pixel values X1 and X3. When using continuous and non-overlapping band conversion tables, the encoder can perform simple processing by selecting a class classification that includes representative values (for example, average value, median value, and mode value) of pixel values in a certain area. It is possible to select a suitable classification.

図39(b)に示すバンド変換テーブル3902は、値の小さな範囲および値の大きな範囲において広い範囲の値を同じクラスに分類する例を示す図である。これにより、分類されない範囲を減らすことができる。   The band conversion table 3902 shown in FIG. 39B is a diagram illustrating an example in which values in a wide range are classified into the same class in a small value range and a large value range. Thereby, the range which is not classified can be reduced.

図40に示すバンド変換テーブル4001、4002は、図38で説明したように色差を64段階に量子化する場合に用いるテーブルである。0〜63までのバンドインデックスを分類するための1つのテーブルを2つに分けて示した図であり、4001は前半(0〜31)、4002は後半(32〜63)を示す。   The band conversion tables 4001 and 4002 shown in FIG. 40 are tables used when the color difference is quantized into 64 levels as described with reference to FIG. It is the figure which divided and showed one table for classifying the band indexes from 0 to 63 into two, 4001 shows the first half (0-31), and 4002 shows the second half (32-63).

図41は、値の小さな範囲および値の大きな範囲を、オフセットを加算しないクラス(無効クラス)に分類する例を示す図である。これにより、色差の発生頻度が高い中心値付近の画素値に対して、細かい分類を行うことが可能になり高い符号化効率を得ることができる。   FIG. 41 is a diagram illustrating an example in which a range with a small value and a range with a large value are classified into classes (invalid classes) to which no offset is added. As a result, it is possible to perform fine classification on pixel values near the center value where the frequency of occurrence of color differences is high, and high coding efficiency can be obtained.

図41に示すバンド変換テーブル4101、4102は、値の小さな範囲および値の大きな範囲において広い範囲の値を同じクラスに分類する例である。   The band conversion tables 4101 and 4102 shown in FIG. 41 are examples in which values in a wide range are classified into the same class in a small value range and a large value range.

図42に示すバンド変換テーブル4201、4202は、色差のクラス分類において、中心値およびその付近の画素値の分類を、中心から離れた画素値の分類よりも細かく分類する例を示す図である。色差のヒストグラムの観察によれば、画素値の発生頻度は低彩度を表す中心付近の画素値において高くなる傾向にある。したがって、図42に示すテーブルを用いることで、色差の発生頻度が高い中心値付近の画素値を細かく分類しながら比較的広範囲の画素値をオフセット加算するクラス(有効クラス)に割り当てることができる。   The band conversion tables 4201 and 4202 illustrated in FIG. 42 are diagrams illustrating examples in which the classification of the center value and the pixel values in the vicinity thereof are classified more finely than the classification of the pixel values far from the center in the color difference class classification. According to the observation of the color difference histogram, the frequency of occurrence of pixel values tends to be higher at pixel values near the center representing low saturation. Therefore, by using the table shown in FIG. 42, it is possible to assign to a class (effective class) in which a relatively wide range of pixel values are offset added while finely classifying pixel values in the vicinity of the center value where the frequency of occurrence of color differences is high.

図43に示すバンド変換テーブル4301、4302も、色差のクラス分類において、中心値およびその付近の画素値の分類を、中心から離れた画素値の分類よりも細かく分類する例である。   The band conversion tables 4301 and 4302 shown in FIG. 43 are also examples in which the classification of the central value and the neighboring pixel values are classified more finely than the classification of the pixel values far from the center in the color difference class classification.

図44に示すバンド変換テーブル4401、4402は、色差のクラス分類において、中心値およびその付近の画素値を有効クラスに分類するクラス分類を、複数のクラス分類の先頭の(最初の)クラス分類として用いる例である。すなわち、より小さな値のオフセットタイプの値を割り当てる。上述したように、色差では中心値およびその付近の画素値は出現頻度が高く、したがって当該画素値を有効クラスに分類するクラス分類の適用頻度も高くなる傾向がある。適用頻度の高いクラス分類に小さなオフセットタイプを割り当てることで、オフセットタイプの符号化に要する符号量を低減することができる。   In the band conversion tables 4401 and 4402 shown in FIG. 44, in the color difference class classification, the class classification that classifies the center value and the pixel values in the vicinity thereof into an effective class is set as the first (first) class classification of the plurality of class classifications. It is an example to use. That is, a smaller offset type value is assigned. As described above, in the color difference, the center value and the pixel values in the vicinity thereof have a high appearance frequency, and accordingly, the application frequency of the class classification for classifying the pixel value into the effective class tends to increase. By assigning a small offset type to a class classification having a high application frequency, it is possible to reduce the amount of code required for encoding the offset type.

図45に示すバンド変換テーブル4501、4502は、中心値およびその付近の画素値から離れた画素値を分類するクラス分類において、いずれも量子化された画素値X1、画素値X2、画素値X3(X1<X2<X3)について、互いに隣接しない画素値X1とX3を、X2を分類するクラスとは異なる同じクラスに分類する例である。同時に発生する確率の低い離れた画素値を同じクラスに分類することによって、量子化幅を小さくし、さらに細かい分類を行うバンド変換テーブルを用いた場合においても広い範囲の値域をカバーすることができる。すなわち、オフセットが加算されない範囲を狭くして、符号化効率を向上することができる。   The band conversion tables 4501 and 4502 shown in FIG. 45 are classified into pixel values X1, pixel values X2, and pixel values X3 (quantized) in the class classification for classifying the pixel values apart from the center value and the neighboring pixel values. In this example, for X1 <X2 <X3), pixel values X1 and X3 that are not adjacent to each other are classified into the same class different from the class that classifies X2. By classifying pixel values with low probability of occurring simultaneously into the same class, it is possible to reduce the quantization width and cover a wide range of values even when using a band conversion table that performs finer classification. . That is, it is possible to narrow the range where the offset is not added and improve the encoding efficiency.

図46に示すバンド変換テーブル4601、4602は、中心値およびその付近の画素値から離れた画素値を分類するクラス分類において、いずれも量子化された画素値X1、画素値X2、画素値X3(X1<X2<X3)について、互いに隣接しない画素値X1とX3を、X2を分類するクラスとは異なる同じクラスに分類する例である。さらに、画像の空間的相関性から近接する画素では画素値も近くなることを利用して、クラス分類のパターンに周期的構造を用いることにより、少ないクラス分類を用いて、広い値域を分類することが可能である。ここでは2つのクラス分類を用いて全ての値域をカバーしつつ、近い値を異なるクラスに分類することができる。つまり、値域を少ないクラスかつ小さな量子化ステップで効率的に分類することが可能であるため、高い符号化効率を得ることができる。また、少ないクラス数を用いることによって、クラス分類に必要なフラグの符号量を削減することができ、高い符号化効率を得ることができる。さらに、少ないクラス数を用いるとことによって、符号化装置で最適なクラス分類を選択する際の処理量も削減できる。   The band conversion tables 4601 and 4602 shown in FIG. 46 are classified into pixel values X1, pixel values X2, and pixel values X3 (quantized) in the class classification for classifying the pixel values apart from the center value and the neighboring pixel values. In this example, for X1 <X2 <X3), pixel values X1 and X3 that are not adjacent to each other are classified into the same class different from the class that classifies X2. Furthermore, by using the fact that pixel values are close to each other because of the spatial correlation of the image, a wide range of values can be classified using fewer class classifications by using a periodic structure for the class classification pattern. Is possible. Here, it is possible to classify close values into different classes while covering all value ranges using two class classifications. That is, since the range can be efficiently classified with a small class and a small quantization step, high encoding efficiency can be obtained. Further, by using a small number of classes, it is possible to reduce the amount of flag codes necessary for class classification, and to obtain high coding efficiency. Furthermore, by using a small number of classes, it is possible to reduce the amount of processing when selecting an optimal class classification in the encoding apparatus.

以下の図47〜図50は、輝度と色差とに対して、異なるクラス分類を用いる例である。   47 to 50 below are examples in which different class classifications are used for luminance and color difference.

図47に示すバンド変換テーブル4701、4702、4703は、周期的構造を備える2つのクラス分類の別の例である。32段階に分類される輝度は変換テーブル4701を用い、64段階に分類される色差は変換テーブル4702、4703を用いる。   The band conversion tables 4701, 4702, and 4703 shown in FIG. 47 are another example of two class classifications having a periodic structure. Luminance classified into 32 levels uses a conversion table 4701, and color differences classified into 64 levels use conversion tables 4702 and 4703.

図48に示すバンド変換テーブル4801、4802、4803は、周期的構造を備える2つのクラス分類の別の例である。32段階に分類される輝度は変換テーブル4801を用い、64段階に分類される色差は変換テーブル4802、4803を用いる。   Band conversion tables 4801, 4802, and 4803 shown in FIG. 48 are another example of two class classifications having a periodic structure. Luminance classified into 32 levels uses a conversion table 4801, and color differences classified into 64 levels use conversion tables 4802 and 4803.

図49に示すバンド変換テーブル4901、4902、4903は、周期的構造を備える2つのクラス分類の別の例である。32段階に分類される輝度は変換テーブル4901を用い、64段階に分類される色差は変換テーブル4902、4903を用いる。   Band conversion tables 4901, 4902, and 4903 shown in FIG. 49 are another example of two class classifications having a periodic structure. Luminance classified into 32 levels uses a conversion table 4901 and color differences classified into 64 levels use conversion tables 4902 and 4903.

図50に示すバンド変換テーブル5001、5002、5003は、周期的構造を備える2つのクラス分類の別の例である。32段階に分類される輝度は変換テーブル5001を用い、64段階に分類される色差は変換テーブル5002、5003を用いる。   Band conversion tables 5001, 5002, and 5003 shown in FIG. 50 are another example of two class classifications having a periodic structure. Luminance classified into 32 levels uses a conversion table 5001, and color differences classified into 64 levels use conversion tables 5002 and 5003.

(オフセット情報復号部611の構成)
次に、オフセット情報復号部611の構成について、図14を参照して説明する。図14は、適応オフセットのパラメータの種類(パラメータ条件)に応じて、使用するオフセットタイプを変更する、かつ/もしくは、適応オフセットのパラメータ条件に応じて、クラスの分類数を変更するオフセット情報復号部611のブロック図である。
(Configuration of Offset Information Decoding Unit 611)
Next, the configuration of the offset information decoding unit 611 will be described with reference to FIG. FIG. 14 shows an offset information decoding unit that changes the offset type to be used according to the type (parameter condition) of the adaptive offset parameter and / or changes the number of class classifications according to the parameter condition of the adaptive offset. FIG. 611 is a block diagram of FIG.

オフセット情報復号部611は、適応的オフセットタイプ復号部6111、および適応的オフセット復号部6114から構成されている。また、適応的オフセットタイプ復号部6111は、使用オフセットタイプ選択部6112、およびオフセットタイプ復号部6113から構成され、適応的オフセット復号部6114は、使用オフセット数選択部6115、およびオフセット復号部6116から構成されている。なお、パラメータ条件とは、画素値から算出される値以外のパラメータであり、既に説明した画素の成分(コンポーネント)の他、階層、オフセットタイプ、ブロックサイズ(QAOUサイズ)、QPがある。   The offset information decoding unit 611 includes an adaptive offset type decoding unit 6111 and an adaptive offset decoding unit 6114. The adaptive offset type decoding unit 6111 includes a use offset type selection unit 6112 and an offset type decoding unit 6113. The adaptive offset decoding unit 6114 includes a use offset number selection unit 6115 and an offset decoding unit 6116. Has been. The parameter condition is a parameter other than a value calculated from the pixel value, and includes a layer, an offset type, a block size (QAOU size), and a QP in addition to the pixel components (components) already described.

適応的オフセットタイプ復号部6111は、符号化データ中のQAOU情報から、パラメータ条件に応じて適応的にオフセットタイプを復号する手段であり、使用オフセットタイプ選択部6112とオフセットタイプ復号部6113を備えている。   The adaptive offset type decoding unit 6111 is a unit that adaptively decodes an offset type according to parameter conditions from QAOU information in the encoded data, and includes a use offset type selection unit 6112 and an offset type decoding unit 6113. Yes.

使用オフセットタイプ選択部6112は、パラメータ条件に応じて使用するオフセットタイプの集合を選択する手段である。使用オフセットタイプ選択部6112は、パラメータ条件に応じて図6で説明したような変換テーブルを選択し、オフセットタイプ復号部6113に入力する。また使用可能なオフセットタイプの最大数をオフセットタイプ復号部6113に入力する。使用可能なオフセットタイプの最大数とは、オフセットタイプのとりうる値の種類の数である。本実施形態では図6の変換テーブルを用いる。したがってオフセットタイプの最大数は7となる。なお、後述の一部の変形例では、8個以上のオフセットタイプを用いる場合がある。それらの例では、特に図示しない場合においても、少なくとも重複のないコードを各オフセットタイプに割り当てる変換テーブルを用いる。   The used offset type selection unit 6112 is means for selecting a set of offset types to be used according to the parameter condition. The used offset type selection unit 6112 selects the conversion table as described with reference to FIG. 6 according to the parameter condition, and inputs it to the offset type decoding unit 6113. Further, the maximum number of usable offset types is input to the offset type decoding unit 6113. The maximum number of offset types that can be used is the number of types of values that the offset type can take. In this embodiment, the conversion table of FIG. 6 is used. Therefore, the maximum number of offset types is 7. In some of the modifications described later, eight or more offset types may be used. In these examples, even when not particularly illustrated, a conversion table that assigns at least codes that do not overlap each offset type is used.

使用オフセットタイプ選択部6112は、パラメータ条件に応じた変換テーブルを供給する。本実施形態では、既に説明したように変換テーブル801を用いる。ただし、複数の変換テーブルを備える構成として、パラメータ条件に応じて何れの変換テーブルを用いるかを切り替えてもよい。例えば、パラメータ条件として画素の成分を用いて、成分が色差である場合に使用するエッジオフセットタイプと、成分が輝度である場合に使用するエッジオフセットタイプを異なるものとしてもよい。具体例を挙げれば、成分が色差である場合には、図6の変換テーブル801Cに示すように、オフセットタイプのうちEO_2およびEO_3を含まないものを用いる。変換テーブル801Cの場合には、オフセットタイプの最大数は5である。   The used offset type selection unit 6112 supplies a conversion table corresponding to the parameter condition. In this embodiment, the conversion table 801 is used as already described. However, as a configuration including a plurality of conversion tables, which conversion table is used may be switched according to the parameter condition. For example, by using a pixel component as a parameter condition, the edge offset type used when the component is a color difference may be different from the edge offset type used when the component is luminance. As a specific example, when the component is a color difference, as shown in the conversion table 801C of FIG. 6, an offset type that does not include EO_2 and EO_3 is used. In the case of the conversion table 801C, the maximum number of offset types is 5.

オフセットタイプ復号部6113は、入力された変換テーブルとオフセットタイプの最大数に応じて符号化データからオフセットタイプを復号する。オフセットタイプの最大数をNとすれば、コードの取り得る範囲が0からN−1までのN個に制限されることから、コードの符号化に要するビット数を低減することができる。例えば、最大数が2−1より大きく、2以下であるときmビットの固定長符号化を用いることができる。また、最大値とN−1とするTruncated unary符号化や、Truncated Rice符号化を用いることもできる。 The offset type decoding unit 6113 decodes the offset type from the encoded data according to the input conversion table and the maximum number of offset types. If the maximum number of offset types is N, the range that the code can take is limited to N from 0 to N−1. Therefore, the number of bits required to code the code can be reduced. For example, m-bit fixed length coding can be used when the maximum number is greater than 2 m -1 and less than or equal to 2 m . Further, Truncated unary encoding with the maximum value and N-1 or Truncated Rice encoding can be used.

適応的オフセット復号部6114は、符号化データ中のQAOU情報から、パラメータ条件に応じて適応的にオフセットを復号する手段であり、使用オフセット数選択部6115とオフセット復号部6116とを備えている。   The adaptive offset decoding unit 6114 is means for adaptively decoding an offset from QAOU information in the encoded data according to the parameter condition, and includes a used offset number selection unit 6115 and an offset decoding unit 6116.

使用オフセット数選択部6115は、パラメータ条件に応じて、使用するオフセット数の最大値とオフセットの精度を選択する手段である。パラメータ条件の一つは画素の表す成分であり、成分が輝度である場合に使用するエッジオフセットの数は、成分が色差である場合に使用するエッジオフセットの数と異なる。例えば、成分が輝度である場合には、オフセット数は4個とし、成分が色差である場合には、オフセット数を5個とすることができる。既に説明したエッジクラス変換テーブルについて、輝度には図10(d)のエッジクラス変換テーブル1001Bを用い、色差には図10(c)のエッジクラス変換テーブル1001Aを用いれば、適応オフセットフィルタ処理が行われないクラス0を除くクラス数はそれぞれ、図10(d)では4個、図10(c)では5個となる。これは、必要なオフセット数を示している。   The used offset number selection unit 6115 is means for selecting the maximum value of the number of offsets to be used and the offset accuracy in accordance with the parameter conditions. One of the parameter conditions is a component represented by a pixel, and the number of edge offsets used when the component is luminance is different from the number of edge offsets used when the component is a color difference. For example, when the component is luminance, the offset number can be four, and when the component is color difference, the offset number can be five. For the edge class conversion table already described, if the edge class conversion table 1001B of FIG. 10D is used for luminance and the edge class conversion table 1001A of FIG. 10C is used for color difference, adaptive offset filter processing is performed. The number of classes excluding class 0, which is not broken, is 4 in FIG. 10 (d) and 5 in FIG. 10 (c). This indicates the required number of offsets.

オフセット復号部6116は、各オフセットタイプで用いるオフセット数に応じて符号化データからオフセットを復号する。   The offset decoding unit 6116 decodes the offset from the encoded data according to the number of offsets used for each offset type.

このように、動画像復号装置1では、パラメータ条件に応じて適応的に符号化データを復号し、画素のクラス分類を行う。   As described above, the moving image decoding apparatus 1 adaptively decodes the encoded data according to the parameter condition and classifies the pixels.

以上のように、本実施形態では、パラメータ条件に応じてクラス分類を変更している。より詳細には、処理対象の画素の表す成分に応じて、エッジオフセットの場合には輝度画素と色差画素とでクラス数が異なるように分類し、バンドオフセットの場合には、輝度画素と色差画素とでバンドとクラスの対応関係が異なるように分類している。これにより、輝度と色差の特性の違いに適応することでき、符号化効率を向上させることができる。   As described above, in this embodiment, the class classification is changed according to the parameter condition. More specifically, according to the component represented by the pixel to be processed, in the case of edge offset, the luminance pixel and the chrominance pixel are classified so that the class numbers are different, and in the case of band offset, the luminance pixel and the chrominance pixel are classified. And so that the correspondence between bands and classes is different. Thereby, it can adapt to the difference of the characteristic of a brightness | luminance and a color difference, and can improve encoding efficiency.

(クリップ処理の削減)
以下、バンドオフセット処理の場合にオフセット加算部627におけるクリップ処理の削減を目的とした、適応オフセットフィルタ処理部62の処理方法について説明する。
(Reduction of clip processing)
Hereinafter, a processing method of the adaptive offset filter processing unit 62 for the purpose of reducing clip processing in the offset addition unit 627 in the case of band offset processing will be described.

(クリップ処理の削減方法1) 画素値の判定によるクリップ処理削減
ここでは、図13の、適応オフセットフィルタ処理部62による処理の流れを示すフローチャートの、ステップS109の代わりに、次のステップS109A(不図示)を用いる。他のステップについては、既に説明したものと同様である。
(ステップS109A)
ステップS108に続いて、オフセット加算部627は、デブロック済復号画像P_DBの処理対象画素の画素値に対して、オフセット導出部626から供給されるオフセットを加算する。ただし、当該画素値が所定の「オフセット制限領域」で表される値域に含まれる場合には、オフセットの加算を行わない。
(Clip Processing Reduction Method 1) Clip Processing Reduction by Determination of Pixel Value Here, instead of step S109 in the flowchart showing the flow of processing by the adaptive offset filter processing unit 62 in FIG. As shown). Other steps are the same as those already described.
(Step S109A)
Subsequent to step S108, the offset adding unit 627 adds the offset supplied from the offset deriving unit 626 to the pixel value of the processing target pixel of the deblocked decoded image P_DB. However, when the pixel value is included in a value range represented by a predetermined “offset restriction region”, no offset is added.

ここで、上記のオフセット制限領域について図28を用いて説明する。図28は、オフセット制限領域の例を示す図である。オフセット制限領域OLR0は、画素値0以上Lim0未満の範囲であり、オフセット制限領域OLR1は、画素値Lim1以上max以下の範囲である。Lim0およびLim1の値は、オフセットの値域が−Q0〜+Q1である場合、Q0≦Lim0 かつ Lim1≦max−Q1 となるように定められる。オフセット制限領域OLR0およびオフセット制限領域OLR1に含まれる画素値は、オフセット処理の結果が画素値の値域0〜maxを超える可能性がある。そこで、ステップS109Aにおいてオフセットの加算を行わないようにすれば、クリップ処理の省略が可能である。オフセット制限領域OLR0およびオフセット制限領域OLR1に含まれない画素値については、オフセット加算後の値が画素値の値域0〜maxを外れないため、クリップ処理は本来必要がない。したがって前記のように設定されたオフセット制限領域を用いれば、画素値の値域全体においてクリップ部6272でのクリップ処理が省略でき、適応オフセット処理の処理量を削減することができる。   Here, the offset restriction region will be described with reference to FIG. FIG. 28 is a diagram illustrating an example of the offset restriction region. The offset limited region OLR0 is a range of pixel values from 0 to less than Lim0, and the offset limited region OLR1 is a range of pixel values from Lim1 to max. The values of Lim0 and Lim1 are determined so that Q0 ≦ Lim0 and Lim1 ≦ max−Q1 when the offset range is −Q0 to + Q1. As for the pixel values included in the offset limiting area OLR0 and the offset limiting area OLR1, the result of the offset process may exceed the pixel value range 0 to max. Therefore, if the offset is not added in step S109A, the clipping process can be omitted. For pixel values that are not included in the offset limit area OLR0 and the offset limit area OLR1, the value after offset addition does not deviate from the pixel value range 0 to max. Therefore, if the offset restriction area set as described above is used, the clipping process in the clipping unit 6272 can be omitted in the entire pixel value range, and the processing amount of the adaptive offset process can be reduced.

(クリップ処理の削減方法2)
使用オフセットタイプ選択部6112における事前分岐によるクリップ処理削減
また、オフセット制限領域に属する画素値が、クラス0(無効クラス)に分類されるようにしてもよい。これを図29を用いて説明する。図29はオフセット制限領域を考慮したバンドクラス変換テーブルの例を示す図である。(a)に示すバンドクラス変換テーブル2901は、BO_1の場合に、従来のBO_1とは異なり、バンドインデックス0,1,30,31のバンドをクラス0としている。これは、8ビットの画素値で表せば、Lim0=16かつLim1=240の場合に対応する。実際には8ビット画素値の場合のオフセットの範囲は−8〜7であり、すなわちQ0=8およびQ1=7であることから、 Q0≦Lim0 かつ Lim1≦max−Q1 を満たす。使用オフセットタイプ選択部6112でこの変換テーブルを用いるようにすれば、クリップが必要な画素値はクラス0となりオフセット加算の対象とはならないため、上記ステップ108Aを用いるまでもなく、元のステップS108を用いつつ、バンドオフセットの加算処理におけるクリップ処理を省略できる。
(Clip processing reduction method 2)
Clipping processing reduction by pre-branching in the used offset type selection unit 6112 Further, pixel values belonging to the offset restriction area may be classified into class 0 (invalid class). This will be described with reference to FIG. FIG. 29 is a diagram showing an example of a band class conversion table in consideration of the offset restriction area. The band class conversion table 2901 shown in (a) is different from the conventional BO_1 in the case of BO_1, and the bands with band indexes 0, 1, 30, and 31 are class 0. This can be expressed in terms of 8-bit pixel values when Lim0 = 16 and Lim1 = 240. Actually, the offset range in the case of the 8-bit pixel value is −8 to 7, that is, Q0 = 8 and Q1 = 7, so that Q0 ≦ Lim0 and Lim1 ≦ max−Q1 are satisfied. If this conversion table is used in the used offset type selection unit 6112, the pixel value that needs to be clipped becomes class 0 and is not subject to offset addition. Therefore, it is not necessary to use step 108A, and the original step S108 is changed. While using, clip processing in band offset addition processing can be omitted.

図29(b)に示すバンドクラス変換テーブル2902は、(a)に示すバンドクラス変換テーブル2901と同様のオフセット制限領域に該当する画素値をクラス0として分類するオフセットタイプをBO_2として、従来のBO_1タイプと併用する場合のバンドクラス変換テーブルの例を示している。この変換テーブルを用いる場合は、符号化データで用いられうるバンドオフセットの種類は3種類であり、オフセットタイプの総数は8個となる。   The band class conversion table 2902 shown in FIG. 29 (b) has a conventional BO_1 with an offset type for classifying pixel values corresponding to the offset restriction region similar to the band class conversion table 2901 shown in (a) as class 0 as BO_2. The example of the band class conversion table in the case of using together with a type is shown. When this conversion table is used, there are three types of band offsets that can be used in the encoded data, and the total number of offset types is eight.

(クリップ処理の削減方法3)
ビットストリーム中のシンタックス要素の値域制限によるクリップ処理削減
さらに、クリップ処理を削減する別の方法を説明する。例えば、符号化データ#1において、図28に示すオフセット制限領域OLR0に対応するクラスにおけるオフセットの範囲を、0または正の値と制限すれば、明らかにオフセット加算後の画素値は0未満とはならない。同様に、オフセット制限領域OLR1に対応するクラスにおけるオフセットの範囲を、0または負の値と制限すれば、明らかにオフセット加算後の画素値はmaxより大きな値となることはない。このように、バンド変換テーブルの特定のクラスに対して、オフセット制限領域を考慮してオフセットの値域を制限すれば、オフセット加算後のクリップ処理を削減することができ、処理の高速化が可能である。この方法をとる場合には、図29に示したような、バンドクラス変換テーブルの変更は不要である。
(Clip processing reduction method 3)
Reduction of Clip Processing by Limiting Range of Syntax Elements in Bitstream Furthermore, another method for reducing clip processing will be described. For example, in the encoded data # 1, if the offset range in the class corresponding to the offset limited area OLR0 shown in FIG. 28 is limited to 0 or a positive value, the pixel value after offset addition is clearly less than 0. Don't be. Similarly, if the range of the offset in the class corresponding to the offset restriction region OLR1 is restricted to 0 or a negative value, the pixel value after the addition of the offset is clearly not greater than max. In this way, if the offset range is restricted in consideration of the offset restriction area for a specific class of the band conversion table, clip processing after offset addition can be reduced, and the processing speed can be increased. is there. When this method is adopted, it is not necessary to change the band class conversion table as shown in FIG.

なお、オフセット制限領域を表すLim0およびLim1については、画素ビット深度に応じた固定値としてもよいし、オフセットタイプがBOである場合には、バンド位置に応じて設定してもよい。あるいは、符号化データ#1に符号化して伝送してもよい。図26は、オフセット制限領域情報RIを含むQAOUを符号化して伝送する場合のデータ構造の一例を示している。オフセットタイプ情報OTIが、バンドオフセットを示している場合に、オフセット制限領域情報RIが符号化される。オフセット制限領域情報RIはオフセット制限領域あるいはオフセット制限領域に相当するクラスの配置が表現できればよく、例として、閾値となる画素値Lim0およびLim1や、あるい別の例として、クラスインデックスを示す閾値LimC0およびLimC1を符号化する。後者の場合、クラスインデックスがLimC0以下またはLimC1以上のクラスを、オフセット制限領域に相当するクラスとして扱う。図28を用いて具体的に説明すれば、オフセット制限領域OLR0に相当するクラスはクラスインデックス0および1であり、オフセット制限領域OLR1に相当するクラスはクラスインデックス30および31である。したがって、LimC0=1,LimC1=30をオフセット制限領域情報RIを符号化するとよい。値の範囲は、PIC_DEPTHが8ビットでバンド幅が2^BWBitであるとき、LimC0は0〜(2^(8−BWBit)−2) であり、LimC1は LimC0+1〜(2^(8−BWBit)−1)である。   Note that Lim0 and Lim1 representing the offset limited region may be fixed values according to the pixel bit depth, or may be set according to the band position when the offset type is BO. Alternatively, the encoded data # 1 may be encoded and transmitted. FIG. 26 shows an example of a data structure when a QAOU including offset limited area information RI is encoded and transmitted. When the offset type information OTI indicates a band offset, the offset limited area information RI is encoded. The offset restriction area information RI only needs to be able to represent the offset restriction area or the arrangement of classes corresponding to the offset restriction area. For example, the pixel values Lim0 and Lim1 serving as threshold values, or as another example, a threshold value LimC0 indicating a class index And LimCl. In the latter case, a class having a class index of LimC0 or lower or LimC1 or higher is handled as a class corresponding to the offset restriction area. Specifically, the classes corresponding to the offset restriction area OLR0 are class indexes 0 and 1, and the classes corresponding to the offset restriction area OLR1 are class indexes 30 and 31. Therefore, it is preferable to encode the offset limited region information RI with LimC0 = 1 and LimC1 = 30. The range of values is that when PIC_DEPTH is 8 bits and the bandwidth is 2 ^ BWBit, LimC0 is 0 to (2 ^ (8-BWBit) -2), and LimC1 is LimC0 + 1 to (2 ^ (8-BWBit) -1).

(クリップ処理の削減方法4)
以上では、値域の下限と上限に1個ずつ1組のオフセット制限領域を設定する例を説明したが、オフセット制限領域の設定はこれに限らず、図30のように、2組以上のオフセット制限領域を設定してもよい。
(Clip processing reduction method 4)
In the above, an example in which one set of offset restriction areas is set for each of the lower limit and upper limit of the range has been described. However, the setting of the offset restriction areas is not limited to this, and two or more sets of offset restriction areas as shown in FIG. An area may be set.

図30は、値域の下限側に2個、上限側に2個のオフセット制限領域を設定する例である。下限側にはオフセット制限領域OLR00およびオフセット制限領域OLR01、上限側にはオフセット制限領域OLR10およびオフセット制限領域OLR11が配置されている。それぞれのオフセット制限領域の範囲は、オフセット制限領域OLR00は画素値0以上Lim00未満であり、オフセット制限領域OLR01は画素値Lim00以上Lim01未満であり、オフセット制限領域OLR11は画素値Lim11以上Lim10未満であり、オフセット制限領域OLR10は画素値Lim10以上max以下である。このようなオフセット制限領域の構成は、使用可能な画素値の範囲が0〜maxよりも狭く設定されている場合に用いるとよい。例えば、画素ビット深度が8ビットのときに輝度で16〜235、色差で16〜240と画素値の範囲が規定されている場合に、オフセット制限領域OLR00およびオフセット制限領域OLR10においては、オフセット加算後の値が画素値の値域を超えず、さらに前記範囲に収まるかまたは近づくようにオフセットの範囲を制限するとよく、オフセット制限領域OLR01およびオフセット制限領域OLR11においては、オフセット加算後の値が前記範囲を超えないように、オフセットの加算をしないか、オフセットの範囲を制限するとよい。これにより、画素値の値域の中にさらに使用可能な画素値の範囲が定められている場合であっても、オフセット値による補正の効果を高めて符号化効率を向上することができる。   FIG. 30 shows an example in which two offset restriction regions are set on the lower limit side and two upper limit sides of the range. An offset restriction area OLR00 and an offset restriction area OLR01 are arranged on the lower limit side, and an offset restriction area OLR10 and an offset restriction area OLR11 are arranged on the upper limit side. The range of each offset restriction area is that the offset restriction area OLR00 has a pixel value of 0 or more and less than Lim00, the offset restriction area OLR01 has a pixel value of Lim00 or more and less than Lim01, and the offset restriction area OLR11 has a pixel value of Lim11 or more and less than Lim10. The offset limiting region OLR10 is a pixel value Lim10 or more and max or less. Such a configuration of the offset restriction region is preferably used when the range of usable pixel values is set narrower than 0 to max. For example, when a pixel value range is defined as 16 to 235 in luminance and 16 to 240 in color difference when the pixel bit depth is 8 bits, in the offset limited area OLR00 and the offset limited area OLR10, after offset addition It is preferable to limit the offset range so that the value of the pixel value does not exceed the range of the pixel value and falls within or approaches the range. In the offset limit region OLR01 and the offset limit region OLR11, the value after the offset addition is within the range. In order not to exceed, it is preferable not to add an offset or limit the range of the offset. As a result, even if a range of usable pixel values is defined in the range of pixel values, the effect of correction using the offset value can be enhanced and the encoding efficiency can be improved.

上記いずれの方法においても、オフセット加算後の画素値が画素ビット深度で表現可能な範囲を超えないようにオフセットの値域を制限するためのオフセット制限領域を設定することで、加算後のクリップ処理を省略し、処理を高速化することができる。   In any of the above methods, the clip processing after the addition is performed by setting an offset restriction region for restricting the offset value range so that the pixel value after the offset addition does not exceed the range that can be expressed by the pixel bit depth. It can be omitted and the processing can be speeded up.

(動画像符号化装置2)
次に、符号化対象画像を符号化することによって符号化データ#1を生成する動画像符号化装置2について、図15〜20を参照して説明する。動画像符号化装置2は、その一部に、H.264/MPEG−4.AVCに採用されている方式、VCEG(Video Coding Expert Group)における共同開発用コーデックであるKTAソフトウェアに採用されている方式、その後継コーデックであるTMuC(Test Model under Consideration)ソフトウェアに採用されている方式、および、HM(HEVC TestModel)ソフトウェアに採用されている技術を含んでいる。
(Moving picture encoding device 2)
Next, the moving image encoding apparatus 2 that generates encoded data # 1 by encoding the encoding target image will be described with reference to FIGS. The moving image encoding apparatus 2 includes H.264 as a part thereof. H.264 / MPEG-4. A method adopted in AVC, a method adopted in KTA software, which is a codec for joint development in VCEG (Video Coding Expert Group), and a method adopted in TMuC (Test Model under Consideration) software, which is the successor codec And the technology employed in HM (HEVC TestModel) software.

図15は、本実施形態に係る動画像符号化装置2の構成を示すブロック図である。図15に示すように、動画像符号化装置2は、変換・量子化部21、可変長符号符号化部22、逆量子化・逆変換部23、バッファメモリ24、イントラ予測画像生成部25、インター予測画像生成部26、動きベクトル検出部27、予測方式制御部28、動きベクトル冗長性削除部29、加算器31、減算器32、デブロッキングフィルタ33、適応フィルタ70、および適応オフセットフィルタ80を含む構成である。動画像符号化装置2は、動画像#10(符号化対象画像)を符号化することによって、符号化データ#1を生成する装置である。   FIG. 15 is a block diagram showing a configuration of the video encoding device 2 according to the present embodiment. As illustrated in FIG. 15, the moving image encoding device 2 includes a transform / quantization unit 21, a variable-length code encoding unit 22, an inverse quantization / inverse transform unit 23, a buffer memory 24, an intra-predicted image generation unit 25, The inter prediction image generation unit 26, motion vector detection unit 27, prediction method control unit 28, motion vector redundancy deletion unit 29, adder 31, subtractor 32, deblocking filter 33, adaptive filter 70, and adaptive offset filter 80 are provided. It is the composition which includes. The moving image encoding device 2 is a device that generates encoded data # 1 by encoding moving image # 10 (encoding target image).

変換・量子化部21は、(1)符号化対象画像から予測画像Predを減算した予測残差Dをブロック毎にDCT変換(Discrete Cosine Transform)またはDST変換(Discrete Sine Transform)し、(2)DCT変換により得られたDCT係数またはDST変換により得られたDST係数を量子化し、(3)量子化により得られた量子化予測残差QDを可変長符号符号化部22および逆量子化・逆変換部23に供給する。なお、変換・量子化部21は、(1)量子化の際に用いる量子化ステップQPを、ツリーブロック毎に選択し、(2)選択した量子化ステップQPの大きさを示す量子化パラメータ差分Δqpを可変長符号符号化部22に供給し、(3)選択した量子化ステップQPを逆量子化・逆変換部23に供給する。ここで、量子化パラメータ差分Δqpとは、DCT(またはDST)変換/量子化するツリーブロックに関する量子化パラメータqp(QP=2pq/6)の値から、直前にDCT(またはDST)変換/量子化したツリーブロックに関する量子化パラメータqp’の値を減算して得られる差分値のことを指す。   The transform / quantization unit 21 performs (1) DCT transform (Discrete Cosine Transform) or DST transform (Discrete Sine Transform) for each block on the prediction residual D obtained by subtracting the predicted image Pred from the encoding target image, and (2) The DCT coefficient obtained by the DCT transform or the DST coefficient obtained by the DST transform is quantized, and (3) the quantized prediction residual QD obtained by the quantization is converted into the variable length code encoder 22 and the inverse quantization / inverse This is supplied to the conversion unit 23. The transform / quantization unit 21 selects (1) a quantization step QP used for quantization for each tree block, and (2) a quantization parameter difference indicating the size of the selected quantization step QP. Δqp is supplied to the variable length code encoding unit 22, and (3) the selected quantization step QP is supplied to the inverse quantization / inverse conversion unit 23. Here, the quantization parameter difference Δqp refers to the DCT (or DST) conversion / quantization immediately before the DCT (or DST) conversion / quantization parameter qp (QP = 2pq / 6) related to the tree block to be quantized. This is a difference value obtained by subtracting the value of the quantization parameter qp ′ relating to the tree block.

可変長符号符号化部22は、(1)変換・量子化部21から供給された量子化予測残差QD並びにΔqp、(2)後述する予測方式制御部28から供給された予測パラメータPP、および、(3)後述する適応フィルタ70から供給されたフィルタパラメータFP(フィルタセット番号、フィルタ係数群、領域指定情報、並びにオンオフ情報)を可変長符号化することによって、符号化データ#1を生成する。また、可変長符号符号化部22は、適応オフセットフィルタ80から供給されるQAOU情報を符号化し、符号化データ#1に含める。   The variable-length code encoding unit 22 includes (1) a quantized prediction residual QD and Δqp supplied from the transform / quantization unit 21, (2) a prediction parameter PP supplied from a prediction scheme control unit 28 described later, and (3) The encoded data # 1 is generated by variable-length encoding the filter parameters FP (filter set number, filter coefficient group, region designation information, and on / off information) supplied from the adaptive filter 70 described later. . Further, the variable length code encoding unit 22 encodes the QAOU information supplied from the adaptive offset filter 80 and includes it in the encoded data # 1.

逆量子化・逆変換部23は、(1)量子化予測残差QDを逆量子化し、(2)逆量子化によって得られたDCT係数あるいはDST係数を逆DCT(Discrete Cosine Transform)変換あるいは逆DST(Discrete Sine Transform)変換し、(3)逆DCT変換あるいは逆DST変換によって得られた予測残差Dを加算器31に供給する。量子化予測残差QDを逆量子化する際には、変換・量子化部21から供給された量子化ステップQPを利用する。なお、逆量子化・逆変換部23から出力される予測残差Dは、変換・量子化部21に入力される予測残差Dに量子化誤差が加わったものであるが、ここでは簡単のために共通の呼称を用いる。   The inverse quantization / inverse transform unit 23 (1) inversely quantizes the quantized prediction residual QD, and (2) performs inverse DCT (Discrete Cosine Transform) transform or inverse DCT coefficient or DST coefficient obtained by inverse quantization. DST (Discrete Sine Transform) conversion is performed, and (3) the prediction residual D obtained by inverse DCT transformation or inverse DST transformation is supplied to the adder 31. When the quantization prediction residual QD is inversely quantized, the quantization step QP supplied from the transform / quantization unit 21 is used. Note that the prediction residual D output from the inverse quantization / inverse transform unit 23 is obtained by adding a quantization error to the prediction residual D input to the transform / quantization unit 21. Common names are used for this purpose.

イントラ予測画像生成部25は、各パーティションに関する予測画像Pred_Intraを生成する。具体的には、(1)各パーティションついてイントラ予測に用いる予測モードを選択し、(2)選択した予測モードを用いて、局所復号画像Pから予測画像Pred_Intraを生成する。イントラ予測画像生成部25は、生成したイントラ予測画像Pred_Intraを、予測方式制御部28に供給する。   The intra predicted image generation unit 25 generates a predicted image Pred_Intra related to each partition. Specifically, (1) a prediction mode used for intra prediction is selected for each partition, and (2) a prediction image Pred_Intra is generated from the local decoded image P using the selected prediction mode. The intra predicted image generation unit 25 supplies the generated intra predicted image Pred_Intra to the prediction method control unit 28.

また、イントラ予測画像生成部25は、各パーティションについて選択された予測モードと、各パーティションのサイズから各パーティションについての予測インデックスPIを特定し、当該予測インデックスPIを予測方式制御部28に供給する。   The intra-predicted image generation unit 25 identifies the prediction index PI for each partition from the prediction mode selected for each partition and the size of each partition, and supplies the prediction index PI to the prediction method control unit 28.

また、イントラ予測画像生成部25は、対象パーティションのサイズ、および、対象パーティションに割り付けられた予測モードを示す情報であるイントラ符号化モード情報IEMを適応フィルタ70に供給する(不図示)。   In addition, the intra predicted image generation unit 25 supplies intra coding mode information IEM, which is information indicating the size of the target partition and the prediction mode assigned to the target partition, to the adaptive filter 70 (not shown).

動きベクトル検出部27は、各パーティションに関する動きベクトルmvを検出する。具体的には、(1)参照画像として利用するフィルタ済復号画像P_FL’を選択し、(2)選択したフィルタ済復号画像P_FL’において対象パーティションを最良近似する領域を探索することによって、対象パーティションに関する動きベクトルmvを検出する。ここで、フィルタ済復号画像P_FL’は、復号済みの復号画像に対して、デブロッキングフィルタ33によるデブロック処理、適応オフセットフィルタ80による適応的オフセット処理、および、適応フィルタ70による適応的フィルタ処理を施すことによって得られる画像であり、動きベクトル検出部27は、フィルタ済復号画像P_FL’を構成する各画素の画素値をバッファメモリ24から読み出すことができる。動きベクトル検出部27は、検出した動きベクトルmvを、参照画像として利用したフィルタ済復号画像P_FL’を指定する参照画像インデックスRIと共に、インター予測画像生成部26および動きベクトル冗長性削除部29に供給する。なお、双方向予測(重み付き予測)を行うパーティションについては、参照画像として2枚のフィルタ済復号画像P_FL1’およびP_FL2’を選択し、2枚のフィルタ済復号画像P_FL1’およびP_FL2’の各々に対応する動きベクトルmv1およびmv2、並びに、参照画像インデックスRI1およびRI2をインター予測画像生成部26および動きベクトル冗長性削除部29に供給する。   The motion vector detection unit 27 detects a motion vector mv regarding each partition. Specifically, (1) the filtered decoded image P_FL ′ to be used as a reference image is selected, and (2) the target partition is searched by searching for the region that best approximates the target partition in the selected filtered decoded image P_FL ′. Detects a motion vector mv. Here, the filtered decoded image P_FL ′ is subjected to deblocking processing by the deblocking filter 33, adaptive offset processing by the adaptive offset filter 80, and adaptive filtering processing by the adaptive filter 70 on the decoded decoded image. The motion vector detection unit 27 can read out the pixel value of each pixel constituting the filtered decoded image P_FL ′ from the buffer memory 24. The motion vector detection unit 27 supplies the detected motion vector mv to the inter predicted image generation unit 26 and the motion vector redundancy deletion unit 29 together with the reference image index RI that specifies the filtered decoded image P_FL ′ used as the reference image. To do. Note that for a partition that performs bi-directional prediction (weighted prediction), two filtered decoded images P_FL1 ′ and P_FL2 ′ are selected as reference images, and each of the two filtered decoded images P_FL1 ′ and P_FL2 ′ is selected. Corresponding motion vectors mv1 and mv2 and reference image indexes RI1 and RI2 are supplied to the inter prediction image generation unit 26 and the motion vector redundancy deletion unit 29.

インター予測画像生成部26は、各インター予測パーティションに関する動き補償画像mcを生成する。具体的には、動きベクトル検出部27から供給された動きベクトルmvを用いて、動きベクトル検出部27から供給された参照画像インデックスRIによって指定されるフィルタ済復号画像P_FL’から動き補償画像mcを生成する。動きベクトル検出部27と同様、インター予測画像生成部26は、フィルタ済復号画像P_FL’を構成する各画素の画素値をバッファメモリ24から読み出すことができる。インター予測画像生成部26は、生成した動き補償画像mc(インター予測画像Pred_Inter)を、動きベクトル検出部27から供給された参照画像インデックスRIと共に、予測方式制御部28に供給する。なお、双方向予測(重み付き予測)をパーティションについては、(1)動きベクトルmv1を用いて、参照画像インデックスRI1によって指定されたフィルタ済復号画像P_FL1’から動き補償画像mc1を生成し、(2)動きベクトルmv2を用いて、参照画像インデックスRI2によって指定されたフィルタ済参照画像P_FL2’から動き補償画像mc2を生成し、(3)動き補償画像mc1と動き補償画像mc2との加重平均にオフセット値を加えることによってインター予測画像Pred_Interを生成する。   The inter prediction image production | generation part 26 produces | generates the motion compensation image mc regarding each inter prediction partition. Specifically, using the motion vector mv supplied from the motion vector detection unit 27, the motion compensated image mc is obtained from the filtered decoded image P_FL ′ designated by the reference image index RI supplied from the motion vector detection unit 27. Generate. Similar to the motion vector detection unit 27, the inter predicted image generation unit 26 can read out the pixel value of each pixel constituting the filtered decoded image P_FL ′ from the buffer memory 24. The inter prediction image generation unit 26 supplies the generated motion compensated image mc (inter prediction image Pred_Inter) together with the reference image index RI supplied from the motion vector detection unit 27 to the prediction method control unit 28. For the partition with bi-directional prediction (weighted prediction), (1) the motion compensated image mc1 is generated from the filtered decoded image P_FL1 ′ specified by the reference image index RI1 using the motion vector mv1, and (2 ) A motion compensated image mc2 is generated from the filtered reference image P_FL2 ′ designated by the reference image index RI2 using the motion vector mv2, and (3) an offset value is added to the weighted average of the motion compensated image mc1 and the motion compensated image mc2. Is added to generate the inter predicted image Pred_Inter.

予測方式制御部28は、イントラ予測画像Pred_Intraおよびインター予測画像Pred_Interを符号化対象画像と比較し、イントラ予測を行うかインター予測を行うかを選択する。イントラ予測を選択した場合、予測方式制御部28は、イントラ予測画像Pred_Intraを予測画像Predとして加算器31および減算器32に供給すると共に、イントラ予測画像生成部25から供給された予測インデックスPIを予測パラメータPPとして可変長符号符号化部22に供給する。一方、インター予測を選択した場合、予測方式制御部28は、インター予測画像Pred_Interを予測画像Predとして加算器31および減算器32に供給すると共に、インター予測画像生成部26から供給された参照画像インデックスRI、並びに、動きベクトル冗長性削除部29(後述)から供給された推定動きベクトルインデックスPMVIおよび動きベクトル残差MVDを予測パラメータPPとして可変長符号符号化部22に供給する。   The prediction scheme control unit 28 compares the intra predicted image Pred_Intra and the inter predicted image Pred_Inter with the encoding target image, and selects whether to perform intra prediction or inter prediction. When the intra prediction is selected, the prediction scheme control unit 28 supplies the intra prediction image Pred_Intra as the prediction image Pred to the adder 31 and the subtractor 32 and also predicts the prediction index PI supplied from the intra prediction image generation unit 25. The parameter PP is supplied to the variable length code encoder 22. On the other hand, when the inter prediction is selected, the prediction scheme control unit 28 supplies the inter prediction image Pred_Inter as the prediction image Pred to the adder 31 and the subtractor 32, and the reference image index supplied from the inter prediction image generation unit 26. RI and an estimated motion vector index PMVI and a motion vector residual MVD supplied from a motion vector redundancy deleting unit 29 (described later) are supplied to the variable length code encoding unit 22 as prediction parameters PP.

予測方式制御部28にて選択された予測画像Predを、符号化対象画像から減算することによって、減算器32にて予測残差Dが生成される。減算器32にて生成された予測残差Dは、上述したとおり、変換・量子化部21によってDCT(またはDST)変換/量子化される。一方、予測方式制御部28にて選択された予測画像Predを、逆量子化・逆変換部23にて生成された予測残差Dに加算することによって、加算器31にて局所復号画像Pが生成される。加算器31にて生成された局所復号画像Pは、デブロッキングフィルタ33、適応オフセットフィルタ80および適応フィルタ70を経由したのち、フィルタ済復号画像P_FLとしてバッファメモリ24に格納され、インター予測における参照画像として利用される。   By subtracting the prediction image Pred selected by the prediction method control unit 28 from the encoding target image, a prediction residual D is generated by the subtractor 32. The prediction residual D generated by the subtractor 32 is DCT (or DST) transformed / quantized by the transform / quantization unit 21 as described above. On the other hand, by adding the prediction image Pred selected by the prediction method control unit 28 to the prediction residual D generated by the inverse quantization / inverse transformation unit 23, the adder 31 generates a local decoded image P. Generated. The local decoded image P generated by the adder 31 passes through the deblocking filter 33, the adaptive offset filter 80, and the adaptive filter 70, and is then stored in the buffer memory 24 as a filtered decoded image P_FL. Used as

なお、動きベクトル冗長性削除部29は、動きベクトル検出部27によって検出された動きベクトルmvにおける冗長性を削除する。具体的には、(1)動きベクトルmvの推定に用いる推定方法を選択し、(2)選択した推定方法に従って推定動きベクトルpmvを導出し、(3)動きベクトルmvから推定動きベクトルpmvを減算することにより動きベクトル残差MVDを生成する。動きベクトル冗長性削除部29は、生成した動きベクトル残差MVDを、選択した推定方法を示す推定動きベクトルインデックスPMVIと共に、予測方式制御部28に供給する。   The motion vector redundancy deletion unit 29 deletes redundancy in the motion vector mv detected by the motion vector detection unit 27. Specifically, (1) an estimation method used for estimating the motion vector mv is selected, (2) an estimated motion vector pmv is derived according to the selected estimation method, and (3) the estimated motion vector pmv is subtracted from the motion vector mv. As a result, a motion vector residual MVD is generated. The motion vector redundancy deletion unit 29 supplies the generated motion vector residual MVD to the prediction method control unit 28 together with the estimated motion vector index PMVI indicating the selected estimation method.

デブロッキングフィルタ33は、局所復号画像Pにおけるブロック境界、またはCU境界を介して互いに隣接する画素の画素値の差が予め定められた閾値よりも小さい場合に、局所復号画像Pにおける当該ブロック境界、または当該CU境界に対してデブロッキング処理を施すことによって、当該ブロック境界、または当該CU境界付近の画像の平滑化を行う。デブロッキングフィルタ33によりデブロッキング処理が施された画像は、デブロック済復号画像P_DBとして、適応オフセットフィルタ80に出力される。   The deblocking filter 33 determines the block boundary in the local decoded image P when the difference between the pixel values of pixels adjacent to each other via the block boundary in the local decoded image P or the CU boundary is smaller than a predetermined threshold. Alternatively, smoothing of the block boundary or an image near the CU boundary is performed by performing deblocking processing on the CU boundary. The image subjected to the deblocking process by the deblocking filter 33 is output to the adaptive offset filter 80 as a deblocked decoded image P_DB.

適応オフセットフィルタ80は、デブロッキングフィルタ33から供給されるデブロック済復号画像P_DBに対して、適応的オフセットフィルタ処理を施すことによってオフセットフィルタ済復号画像P_OFを生成する。生成されたオフセットフィルタ済復号画像P_OFは、適応フィルタ70に供給される。適応オフセットフィルタ80の具体的な構成については、後述するため、ここでは説明を省略する。   The adaptive offset filter 80 generates an offset filtered decoded image P_OF by performing an adaptive offset filter process on the deblocked decoded image P_DB supplied from the deblocking filter 33. The generated offset filtered decoded image P_OF is supplied to the adaptive filter 70. Since a specific configuration of the adaptive offset filter 80 will be described later, description thereof is omitted here.

適応フィルタ70は、適応オフセットフィルタ80から供給されるオフセットフィルタ済復号画像P_OFに対して、適応的なフィルタ処理を施すことによって、フィルタ済復号画像P_FLを生成する。適応フィルタ70によりフィルタ処理が施されたフィルタ済復号画像P_FLは、バッファメモリ24に格納される。適応フィルタ70によって用いられるフィルタ係数は、フィルタ済復号画像P_FLと符号化対象画像#10との誤差がより小さくなるように定められたものであり、このようにして定められたフィルタ係数がフィルタパラメータFPとして符号化され、動画像復号装置1に伝送される。   The adaptive filter 70 generates a filtered decoded image P_FL by performing an adaptive filter process on the offset filtered decoded image P_OF supplied from the adaptive offset filter 80. The filtered decoded image P_FL that has been filtered by the adaptive filter 70 is stored in the buffer memory 24. The filter coefficient used by the adaptive filter 70 is determined so that the error between the filtered decoded image P_FL and the encoding target image # 10 becomes smaller, and the filter coefficient thus determined is the filter parameter. It is encoded as FP and transmitted to the video decoding device 1.

(適応オフセットフィルタ80)
次に、適応オフセットフィルタ80について、図16を参照して説明する。図16は、適応オフセットフィルタ80の構成を示すブロック図である。図16に示すように、適応オフセットフィルタ80は、適応オフセットフィルタ情報設定部81および適応オフセットフィルタ処理部82を含む構成である。
(Adaptive offset filter 80)
Next, the adaptive offset filter 80 will be described with reference to FIG. FIG. 16 is a block diagram showing a configuration of the adaptive offset filter 80. As shown in FIG. 16, the adaptive offset filter 80 includes an adaptive offset filter information setting unit 81 and an adaptive offset filter processing unit 82.

また、図16に示すように、適応オフセットフィルタ情報設定部81は、オフセット算出部811、オフセットクリップ部812、オフセット情報選択部813を含む構成である。   Also, as shown in FIG. 16, the adaptive offset filter information setting unit 81 includes an offset calculation unit 811, an offset clip unit 812, and an offset information selection unit 813.

(オフセット算出部811)
オフセット算出部811は、対象の処理単位(例えばLCU)に含まれる所定の分割深度までの全てのQAOUに対して、処理対象のQAOUの階層に応じて存在する全てのオフセットタイプおよび全てのクラスについてのオフセットを算出する。ここで、オフセットタイプおよびクラスは、動画像復号装置1の説明において説明したものと同じものを指す。
(Offset calculation unit 811)
For all QAOUs up to a predetermined division depth included in the target processing unit (for example, LCU), the offset calculation unit 811 performs all offset types and all classes that exist according to the hierarchy of the processing target QAOU. The offset of is calculated. Here, the offset type and class are the same as those described in the description of the video decoding device 1.

次に、オフセット算出部811における処理の流れについて、図17を参照して説明する。図17は、オフセット算出部811による処理の流れを示すフローチャートである。   Next, the flow of processing in the offset calculation unit 811 will be described with reference to FIG. FIG. 17 is a flowchart showing the flow of processing by the offset calculation unit 811.

(ステップS201)
まず、オフセット算出部811は、処理対象とする対象QAOMUのQAOMU番号をループ変数とする第1のループを開始する。QAOMU番号は、例えば、図18に示すように、各QAOMUを識別する番号である。QAOMU番号は分割深度0から最大の分割深度までを通して、付されている。最大の分割深度が4の場合は、分割深度の全QAOMU(1+4+16+64+256=341個)に対して、図18に示すように、0〜340の値がQAOMU番号として付される。
(Step S201)
First, the offset calculation unit 811 starts a first loop using the QAOMU number of the target QAOMU to be processed as a loop variable. The QAOMU number is a number for identifying each QAOMU, for example, as shown in FIG. The QAOMU number is assigned from the division depth 0 to the maximum division depth. When the maximum division depth is 4, as shown in FIG. 18, values of 0 to 340 are assigned as QAOMU numbers for all QAOMUs (1 + 4 + 16 + 64 + 256 = 341) of the division depth.

例えば、図18では、
(a)に、分割深度が0であるQAOMUに付されたQAOMU番号が示されており、
(b)に、分割深度が1であるQAOMUに付されたQAOMU番号が示されており、
(c)に、分割深度が2であるQAOMUに付されたQAOMU番号が示されており、
(d)に、分割深度が3であるQAOMUに付されたQAOMU番号が示されており、
(e)に、分割深度が4であるQAOMUに付されたQAOMU番号が示されている。
For example, in FIG.
(A) shows the QAOMU number assigned to the QAOMU whose division depth is 0,
(B) shows the QAOMU number assigned to the QAOMU whose division depth is 1.
(C) shows a QAOMU number assigned to a QAOMU having a division depth of 2.
(D) shows the QAOMU number assigned to the QAOMU whose division depth is 3.
In (e), a QAOMU number assigned to a QAOMU having a division depth of 4 is shown.

よって、図18(a)〜(e)に示す例の場合であれば、当該第1のループは、QAOMU番号=0から、QAOMU番号=340までのループである。   Therefore, in the case of the example shown in FIGS. 18A to 18E, the first loop is a loop from QAOMU number = 0 to QAOMU number = 340.

(ステップS202)
続いて、オフセット算出部811は、対象QAOMUに対して選択可能なオフセットタイプをループ変数とする第2のループを開始する。本実施形態ではsao_type_idxとして0から6を用いているが、sao_type_idx=0(オフセット処理無し)の場合のオフセットは0であるため、当該第2のループは、オフセットタイプ1からオフセットタイプ6までのループである。
(Step S202)
Subsequently, the offset calculation unit 811 starts a second loop in which an offset type that can be selected for the target QAOMU is a loop variable. In this embodiment, 0 to 6 are used as sao_type_idx, but when sao_type_idx = 0 (no offset processing), the offset is 0, so the second loop is a loop from offset type 1 to offset type 6 It is.

(ステップS203)
続いて、オフセット算出部811は、対象QAOMUに含まれる画素を単位とする第3のループを開始する。
(Step S203)
Subsequently, the offset calculation unit 811 starts a third loop using the pixels included in the target QAOMU as a unit.

(ステップS204)
続いて、オフセット算出部811は、対象画素を複数のクラスの何れかに分類する。より具体的には、処理対象の画素の成分に応じて選択可能なクラスの何れかに分類する。例えば、処理対象の成分が輝度であり、第2のループ変数であるオフセットタイプが1〜4であるとき、対象画素をクラス1〜4の何れかに分類する。本ステップにおける分類処理は、動画像復号装置1における適応オフセットフィルタ60の備えるクラス分類部624による分類処理と同じ処理である。
(Step S204)
Subsequently, the offset calculation unit 811 classifies the target pixel into one of a plurality of classes. More specifically, it is classified into one of selectable classes according to the component of the pixel to be processed. For example, when the component to be processed is luminance and the offset type that is the second loop variable is 1 to 4, the target pixel is classified into any of classes 1 to 4. The classification process in this step is the same as the classification process performed by the class classification unit 624 included in the adaptive offset filter 60 in the video decoding device 1.

また、対象QAOMUに関して、クラス毎に、当該クラスに分類された画素の数count[component][part_idx][sao_type_idx][class_idx]を算出する。ここで、part_idxは、QAOUインデックスを表す。   For the target QAOMU, the number of pixels classified into the class count [component] [part_idx] [sao_type_idx] [class_idx] is calculated for each class. Here, part_idx represents a QAOU index.

(ステップS205)
続いて、オフセット算出部811は、対象画素におけるデブロック済復号画像P_DBの画素値と該対象画素における符号化対象画像#10の画素値との差分をとることによって該対象画素における差分画素値を算出する。より具体的には、対象画素の位置を(x、y)としたとき、P_DB(x、y)−Org(x、y)を算出する。ここで、P_DB(x、y)は、対象画素におけるデブロック済復号画像P_DBの画素値を表しており、Org(x、y)は、対象画素の位置における符号化対象画像#10の画素値を表している。
(Step S205)
Subsequently, the offset calculation unit 811 obtains the difference pixel value in the target pixel by taking the difference between the pixel value of the deblocked decoded image P_DB in the target pixel and the pixel value of the encoding target image # 10 in the target pixel. calculate. More specifically, P_DB (x, y) −Org (x, y) is calculated when the position of the target pixel is (x, y). Here, P_DB (x, y) represents the pixel value of the deblocked decoded image P_DB at the target pixel, and Org (x, y) represents the pixel value of the encoding target image # 10 at the position of the target pixel. Represents.

(ステップS206)
本ステップは、第3のループの終端である。本ステップが終了した時点で、対象QAOUに含まれる全ての画素に関して、差分画素値が算出されていることになる。
(Step S206)
This step is the end of the third loop. When this step is completed, the difference pixel values are calculated for all the pixels included in the target QAOU.

(ステップS207)
続いて、オフセット算出部811は、対象QAOMUに含まれる各画素についての差分画素値のクラス毎の総和を、該クラスの分類回数で除算することによってオフセットを算出する。より具体的には、オフセット算出部811は、対象QAOMU、対象オフセットタイプ、および対象クラスについてのオフセットoffset[component][part_idx][sao_type_idx][class_idx]を以下の式を用いて算出する。
(Step S207)
Subsequently, the offset calculation unit 811 calculates an offset by dividing the sum of the difference pixel values for each pixel included in the target QAOMU for each class by the number of classifications of the class. More specifically, the offset calculation unit 811 calculates an offset offset [component] [part_idx] [sao_type_idx] [class_idx] for the target QAOMU, the target offset type, and the target class using the following expression.

offset[component][part_idx][sao_type_idx][class_idx] =
Σ(P_DB(x、y)-Org(x、y))/count[component][part_idx][sao_type_idx][class_idx]
ここで、記号Σは、part_idxによって指定される対象QAOMU、およびsao_type_idxによって指定される対象オフセットタイプにおいて、class_idxによって指定される対象クラスに分類された画素についての差分和をとることを示している。
offset [component] [part_idx] [sao_type_idx] [class_idx] =
Σ (P_DB (x, y) -Org (x, y)) / count [component] [part_idx] [sao_type_idx] [class_idx]
Here, the symbol Σ indicates that a difference sum is calculated for pixels classified into the target class specified by class_idx in the target QAOMU specified by part_idx and the target offset type specified by sao_type_idx.

(ステップS208)
本ステップは第2のループの終端である。
(Step S208)
This step is the end of the second loop.

(ステップS209)
本ステップは第3のループの終端である。
(Step S209)
This step is the end of the third loop.

以上の処理により、オフセット算出部811は、対象LCUに含まれる所定の分割深度までの全てのQAOMUに対して、全てのオフセットタイプおよび全てのクラスについてのオフセットを算出する。   Through the above processing, the offset calculation unit 811 calculates offsets for all offset types and all classes for all QAOMUs up to a predetermined division depth included in the target LCU.

オフセット算出部811は、上記の処理によって算出したオフセット、オフセットタイプ、クラス、および、QAOUの分割構造を表すQAOU構造情報からなるオフセット情報をオフセットクリップ部812に供給する。   The offset calculation unit 811 supplies offset information including the offset, offset type, class, and QAOU structure information representing the QAOU division structure calculated by the above processing to the offset clip unit 812.

(オフセットクリップ部812)
オフセットクリップ部812は、オフセット算出部811から供給されるオフセットに対して以下に示すようなクリップ処理1、クリップ処理2の何れかの処理によってクリップの処理を行う。
(Offset clip part 812)
The offset clip unit 812 performs clip processing on the offset supplied from the offset calculation unit 811 by any one of clip processing 1 and clip processing 2 as described below.

(クリップ処理1)
オフセットクリップ部812は、オフセット算出部811から供給される各オフセットの取り得る値を制限するために、最大値と最小値によるクリップ処理を行う。例えば、−8から7までの値にクリップすることにより、各オフセットを4ビットで表現できる。クリップされた各オフセットは、オフセット情報選択部813に供給される。クリップするビット幅は、動画像復号装置1と同様、画像のビット深度とオフセットのビット深度に応じて設定される。
(Clip processing 1)
The offset clip unit 812 performs clip processing using the maximum value and the minimum value in order to limit the values that each offset supplied from the offset calculation unit 811 can take. For example, each offset can be represented by 4 bits by clipping to a value from -8 to 7. Each clipped offset is supplied to the offset information selection unit 813. The bit width to be clipped is set according to the bit depth of the image and the bit depth of the offset, as in the video decoding device 1.

このように、各オフセットをクリップすることによって、各オフセットが格納されるメモリ(不図示)のメモリサイズを削減することができる。また、符号化データ#1に含まれるオフセットの符号量を削減することにより、符号化効率の向上を図ることができる。また、過度なオフセットの加算が抑制されるため、適切な画質が保証される。   Thus, by clipping each offset, the memory size of a memory (not shown) in which each offset is stored can be reduced. Also, by reducing the amount of offset code included in the encoded data # 1, it is possible to improve the encoding efficiency. Further, since excessive offset addition is suppressed, appropriate image quality is guaranteed.

(クリップ処理2)
また、オフセットクリップ部812は、オフセット算出部811から供給される各オフセットのクリップ範囲を、オフセットタイプに応じて異なる範囲に設定する構成としてもよい。
(Clip processing 2)
The offset clip unit 812 may be configured to set the clip range of each offset supplied from the offset calculation unit 811 to a different range depending on the offset type.

例えば、オフセットタイプがエッジオフセットである場合には、オフセットのビット数を8ビットとし、オフセットタイプがバンドオフセットである場合には、オフセットのビット数を4ビットとするようにクリップ範囲を設定する。より一般には、オフセットタイプがエッジオフセットである場合のオフセットのビット数をB0ビットとし、オフセットタイプがバンドオフセットである場合のオフセットのビット数をB1ビットとしたとき、バンドオフセットがエッジオフセットよりも多数のオフセットを必要とするのであれば、B0>B1が満たされるようにオフセットのビット数を定めてクリップ範囲を設定する。   For example, when the offset type is an edge offset, the clip range is set so that the number of offset bits is 8 bits, and when the offset type is a band offset, the number of offset bits is 4 bits. More generally, when the offset type is an edge offset, the number of offset bits is B0 bits, and when the offset type is a band offset, the number of offset bits is B1 bits. If the offset is required, the clip range is set by determining the number of bits of the offset so that B0> B1 is satisfied.

このようにオフセットタイプに応じて、オフセットのビット数を異ならせることによって、各オフセットを格納するためのメモリに過度なメモリサイズを要求することなく、符号化効率の向上を図ることができる。   Thus, by making the number of offset bits different according to the offset type, it is possible to improve the encoding efficiency without requiring an excessive memory size for the memory for storing each offset.

なお、オフセットの値域の幅が2−1以上2未満のとき、当該オフセットを符号化するための符号化方式として、mビットの固定長符号化を用いることができる。より具体的には、最大値をthとするTruncated unary符号化や、Truncated Rice符号化を用いることができる。 Note that when the width of the offset range is 2 m −1 or more and less than 2 m , m-bit fixed-length encoding can be used as an encoding method for encoding the offset. More specifically, Trunked unary coding with a maximum value of th or Truncated Rice coding can be used.

また、上記クリップ処理1および2を組み合わせて得られるクリップ処理も本実施形態に含まれる。また、適応オフセットフィルタ80は、オフセットクリップ部812を備えない構成としてもよい。   The clip processing obtained by combining the above clip processing 1 and 2 is also included in this embodiment. Further, the adaptive offset filter 80 may be configured not to include the offset clip unit 812.

また、オフセットクリップ部812は、オフセット算出部811から供給される各オフセットのクリップ範囲を、処理対象の画素値の表す成分に応じて異なる範囲に設定する構成としてもよい。   Further, the offset clip unit 812 may be configured to set the clip range of each offset supplied from the offset calculation unit 811 to a different range according to the component represented by the pixel value to be processed.

例えば、成分が輝度である場合には、オフセットのビット数を4ビットとし、成分が色差である場合には、オフセットのビット数を5ビットとするようにクリップ範囲を設定する。量子化幅により大きな値を用いられるなどの理由で、色差における画質の劣化が大きくなる場合には上記のようにするとよい。   For example, when the component is luminance, the clip range is set so that the offset bit number is 4 bits, and when the component is color difference, the offset bit number is 5 bits. If the image quality deterioration due to the color difference becomes large due to the fact that a larger value is used depending on the quantization width, it is preferable to perform the above.

(オフセット情報選択部813)
オフセット情報選択部813は、RDコスト(Rate-Distortion cost)がより小さくなるオフセットタイプ、クラス、オフセットの組み合わせ、および、それに対応するQAOU分割構造を決定し、決定したオフセットタイプ、クラス、オフセットおよび、それに対応するQAOU分割構造を示すQAOU情報を可変長符号符号化部22に供給する。また、オフセット情報選択部813は、決定したオフセットをQAOU毎に適応オフセットフィルタ処理部82に供給する。
(Offset information selection unit 813)
The offset information selection unit 813 determines an offset type, a class, a combination of offsets, and a corresponding QAOU partition structure with a smaller RD cost (Rate-Distortion cost), and determines the determined offset type, class, offset, and QAOU information indicating the corresponding QAOU division structure is supplied to the variable-length code encoding unit 22. Also, the offset information selection unit 813 supplies the determined offset to the adaptive offset filter processing unit 82 for each QAOU.

オフセット情報選択部813の処理について図19〜21を参照してより具体的に説明すれば以下の通りである。図19は、オフセット情報選択部813による処理の流れを示すフローチャートである。   The processing of the offset information selection unit 813 will be described in more detail with reference to FIGS. FIG. 19 is a flowchart showing the flow of processing by the offset information selection unit 813.

(ステップS301)
まず、オフセット情報選択部813は、処理対象とする対象QAOMUのQAOMU番号をループ変数とする第1のループを開始する。
(Step S301)
First, the offset information selection unit 813 starts a first loop using the QAOMU number of the target QAOMU to be processed as a loop variable.

(ステップS302)
続いて、オフセット情報選択部813は、対象QAOMUに対して選択可能なオフセットタイプをループ変数とする第2のループを開始する。ここでは適応オフセットフィルタ処理をしないことを選択する場合もあるため、当該第2のループは、オフセットタイプ0からオフセットタイプ6までのループである。
(Step S302)
Subsequently, the offset information selection unit 813 starts a second loop in which an offset type that can be selected for the target QAOMU is a loop variable. Here, since it may be selected not to perform the adaptive offset filter processing, the second loop is a loop from the offset type 0 to the offset type 6.

(ステップS303)
続いて、オフセット情報選択部813は、対象オフセットタイプについて、対象QAOMUにおけるオフセットフィルタ済復号画像P_OFと符号化対象画像#10との二乗誤差を算出する。
(Step S303)
Subsequently, the offset information selection unit 813 calculates a square error between the offset filtered decoded image P_OF and the encoding target image # 10 in the target QAOMU for the target offset type.

(ステップS304)
本ステップは第2のループの終端である。
(Step S304)
This step is the end of the second loop.

(ステップS305)
本ステップは第1のループの終端である。第1および第2のループが終了した時点で、各QAOMUに関して、全てのオフセットタイプについての二乗誤差が算出されることになる。
(Step S305)
This step is the end of the first loop. At the end of the first and second loops, square errors for all offset types are calculated for each QAOMU.

(ステップS306)
続いて、オフセット情報選択部813は、対象の処理単位(例えばLCU)をQAOUに分割するQAOU分割構造のうち、RDコストがより小さくなるQAOU分割構造を決定する。
(Step S306)
Subsequently, the offset information selection unit 813 determines a QAOU partition structure in which the RD cost is smaller among the QAOU partition structures that divide a target processing unit (for example, LCU) into QAOUs.

本ステップにおけるオフセット情報選択部813の具体的な処理例を、図20および図21を参照して説明すれば以下の通りである。   A specific processing example of the offset information selection unit 813 in this step will be described as follows with reference to FIGS.

図20は、QAOUインデックスが「q」のQAOUについて、オフセットタイプそれぞれについての2乗誤差を算出する概要を示す図である。図20に示すように、オフセット情報選択部813は、全てのQAOMUについて、オフセットタイプそれぞれについての2乗誤差を算出する。そして、算出した2乗誤差が最小となるオフセットタイプを当該QAOUのオフセットタイプとする。これにより、全てのQAOMU(QAOMU番号0〜340)について、オフセットタイプが決定する。   FIG. 20 is a diagram showing an outline of calculating a square error for each offset type for a QAOU having a QAOU index of “q”. As shown in FIG. 20, the offset information selection unit 813 calculates a square error for each offset type for all QAOMUs. The offset type that minimizes the calculated square error is set as the offset type of the QAOU. Thereby, the offset type is determined for all QAOMUs (QAOMU numbers 0 to 340).

次に、オフセット情報選択部813は、分割深度を0としたときのRDコストJ0と分割深度を1とした場合の各QAOMUのRDコストJ1〜J4を計算する(図21(a)、(b))。ここでは、分割深度1のRDコストの総和(J1+J2+J3+J4)が分割深度0のRDコストJ0よりも小さいものとして、分割深度1の分割を採用する(図21(c))。   Next, the offset information selection unit 813 calculates the RD cost J0 when the division depth is 0 and the RD costs J1 to J4 of each QAOMU when the division depth is 1 (FIGS. 21A and 21B). )). Here, the division depth 1 division is adopted assuming that the total RD cost (J1 + J2 + J3 + J4) of division depth 1 is smaller than the RD cost J0 of division depth 0 (FIG. 21C).

続いて、オフセット情報選択部813は、分割深度を2とした場合の、各QAOMUのRDコストJ5〜J20を計算する(図21(d))。オフセット情報選択部813は、分割深度1のQAOMUのRDコスト(J1,J2,J3,J4)と、該分割深度1の各QAOMUに含まれる分割深度2のQAOMUのRDコストの和(J5+J6+J9+J10,J7+J8+J11+J12,J13+J14+J17+J18,J15+J16+J19+J20)とをそれぞれ比較し、分割深度2のQAOMUのRDコストの和の方が小さい場合には、該分割深度1のQAOMUを分割深度2のQAOMUに更新する(図21(d))。このように、各QAOMUのRDコストを、さらにもう1階層分割した場合のRDコストと比較してより小さい方に更新する処理を、最大の分割深度に到達するまで繰り返す。これによって、RDコストがより小さくなるQAOU分割構造が決定される。図21(e)は、分割深度1のQAOMUからQAOMU1とQAOMU4が選択され、それ以外は分割深度2のQAOMUが選択された分割状態を示している。   Subsequently, the offset information selection unit 813 calculates the RD costs J5 to J20 of each QAOMU when the division depth is set to 2 (FIG. 21 (d)). The offset information selection unit 813 calculates the sum (J5 + J6 + J9 + J10, J7 + J8 + J11 + J12) of the RD cost (J1, J2, J3, J4) of the QAOMU at the division depth 1 and the RD cost of the QAOMU at the division depth 2 included in each QAOMU at the division depth 1. , J13 + J14 + J17 + J18, J15 + J16 + J19 + J20), and if the sum of the RD costs of the QAOMUs with the division depth 2 is smaller, the QAOMU with the division depth 1 is updated to the QAOMU with the division depth 2 (FIG. 21 (d)). ). In this way, the process of updating the RD cost of each QAOMU to a smaller one as compared with the RD cost in the case of further one-layer division is repeated until the maximum division depth is reached. As a result, a QAOU partition structure with a smaller RD cost is determined. FIG. 21 (e) shows a split state in which QAOMU1 and QAOMU4 are selected from QAOMUs with a division depth of 1, and QAOMUs with a division depth of 2 are selected in the other cases.

(適応オフセットフィルタ処理部82)
適応オフセットフィルタ処理部82は、対象QAOUにおけるデブロック済復号画像P_DBの各画素に対して、オフセット情報選択部813から供給されるオフセットを加算する。適応オフセットフィルタ処理部82は、デブロック済復号画像P_DBに含まれる全てのQAOUに対して処理を行って得られる画像をオフセットフィルタ済復号画像P_OFとして出力する。なお、適応オフセットフィルタ処理部82の構成は、適応オフセットフィルタ処理部62と同一のため、ここでは説明を省略する。
(Adaptive offset filter processing unit 82)
The adaptive offset filter processing unit 82 adds the offset supplied from the offset information selection unit 813 to each pixel of the deblocked decoded image P_DB in the target QAOU. The adaptive offset filter processing unit 82 outputs an image obtained by performing processing on all the QAOUs included in the deblocked decoded image P_DB as an offset filtered decoded image P_OF. Note that the configuration of the adaptive offset filter processing unit 82 is the same as that of the adaptive offset filter processing unit 62, and thus the description thereof is omitted here.

また、適応クリップタイプを用いる構成であってもよい。すなわち、オフセットタイプの1つとして、適応クリップ(AC)タイプを設けるようにしてもよい。この場合、オフセットタイプは、EO、BO、ACの3種類となる。適応クリップタイプ(AC)では、オフセットを用いず、下限値c1と上限値c2とのクリップを用いて、画素値xがc1≦x≦c2となるように画素値を補正する。   Moreover, the structure using an adaptive clip type may be sufficient. That is, an adaptive clip (AC) type may be provided as one of the offset types. In this case, there are three offset types: EO, BO, and AC. In the adaptive clip type (AC), the pixel value is corrected so that the pixel value x satisfies c1 ≦ x ≦ c2 by using a clip of the lower limit value c1 and the upper limit value c2 without using an offset.

図22は適応クリップタイプを説明する図である。図22(a)はビット深度が8ビットの場合に下限値cl1および上限値cl2を用いてクリップを行う例であり、図22(b)および(c)は、下限値cl1および上限値cl2の例として、輝度に対してはcl1=16、cl2=235、色差に対してはcl1=16、cl2=240を用いる例である。テレビ放送の映像信号など、画素値のビット深度で表現可能な範囲とは異なる範囲で下限値および上限値が定められている場合に用いるとよい。   FIG. 22 is a diagram for explaining the adaptive clip type. FIG. 22A shows an example in which clipping is performed using the lower limit value cl1 and the upper limit value cl2 when the bit depth is 8 bits. FIGS. 22B and 22C show the lower limit value cl1 and the upper limit value cl2. For example, cl1 = 16 and cl2 = 235 are used for luminance, and cl1 = 16 and cl2 = 240 are used for color differences. It may be used when the lower limit value and the upper limit value are determined in a range different from the range that can be expressed by the bit depth of the pixel value, such as a television broadcast video signal.

適応クリップタイプを用いることにより、オフセットの符号化処理や多数のオフセットを保持するメモリが不要となる。なお、クリップの下限値および上限値を、固定値でなく適応的に与える場合には、下限値と上限値を符号化すればよい。この場合は、それぞれ適当な固定値からの差分、たとえば下限値は16からのオフセット、上限値は235からのオフセットを符号化することが好ましい。特に、上限値は大きな値となるため、このようにすることで、符号化効率を下げることがない。   By using the adaptive clip type, an offset encoding process and a memory for holding a large number of offsets are not required. When the lower limit value and upper limit value of a clip are adaptively given instead of fixed values, the lower limit value and upper limit value may be encoded. In this case, it is preferable to encode a difference from an appropriate fixed value, for example, an offset from 16 as the lower limit value and an offset from 235 as the upper limit value. In particular, since the upper limit value is a large value, the encoding efficiency is not lowered by doing so.

(クリップ処理の削減)
動画像復号装置1について既に説明したように、バンドオフセット処理においては、クリップ処理の削減が可能である。ここでは、前記動画像復号装置1における各々のクリップ処理の削減方法に対応する符号化データ#1を生成するための、動画像符号化装置2における処理方法について説明する。なお、既出の内容については説明を適宜省略する。
(Reduction of clip processing)
As already described with respect to the video decoding device 1, clip processing can be reduced in the band offset processing. Here, a processing method in the moving image encoding device 2 for generating encoded data # 1 corresponding to each clip processing reduction method in the moving image decoding device 1 will be described. Note that description of the already described contents is omitted as appropriate.

(クリップ処理の削減方法1)
動画像復号装置1におけるクリップ処理の削減方法1の項で説明した方法に対応する、動画像符号化装置2の処理について説明する。動画像符号化装置2における適応オフセットフィルタ処理部82の構成は、動画像復号装置1の適応オフセットフィルタ処理部62と同一であり、動画像復号装置1の説明において適応オフセットフィルタ処理部62の変形として説明した例が、そのまま適用される。
(Clip processing reduction method 1)
The processing of the video encoding device 2 corresponding to the method described in the section of the clip processing reduction method 1 in the video decoding device 1 will be described. The configuration of the adaptive offset filter processing unit 82 in the video encoding device 2 is the same as that of the adaptive offset filter processing unit 62 of the video decoding device 1, and a modification of the adaptive offset filter processing unit 62 in the description of the video decoding device 1. The example described above is applied as it is.

(クリップ処理の削減方法2)
動画像復号装置1におけるクリップ処理の削減方法2の項で説明した方法に対応する、動画像符号化装置2の処理についても、上記の方法1と同様に、動画像復号装置1の説明において適応オフセットフィルタ処理部62の変形として説明した例が、そのまま適用される。加えて、図29の(a)または(b)に示すバンドクラス変換テーブル2901、2902を、適応オフセットフィルタ情報設定部81で用いればよい。
(Clip processing reduction method 2)
The processing of the video encoding device 2 corresponding to the method described in the section 2 on the clip processing reduction method 2 in the video decoding device 1 is also applied in the description of the video decoding device 1 in the same manner as the method 1 described above. The example described as a modification of the offset filter processing unit 62 is applied as it is. In addition, band class conversion tables 2901 and 2902 shown in (a) or (b) of FIG. 29 may be used in the adaptive offset filter information setting unit 81.

(クリップ処理の削減方法3)
動画像復号装置1におけるクリップ処理の削減方法3の項で説明した方法に対応する、動画像符号化装置2の処理について説明する。動画像符号化装置2の適応オフセットフィルタ情報設定部81において、オフセットクリップ部812がオフセットを所定の値域にクリップすることは既に説明した。ここで、オフセットタイプがバンドオフセットの場合に、クラスの値域に応じてオフセットの値を制限することで、クリップ処理を削減することができる。具体的には、図28に示すオフセット制限領域OLR0に対応するクラスにおけるオフセットの範囲を、0または正の値と制限すれば、明らかにオフセット加算後の画素値は0未満とはならない。同様に、オフセット制限領域OLR1に対応するクラスにおけるオフセットの範囲を、0または負の値と制限すれば、明らかにオフセット加算後の画素値はmaxより大きな値となることはない。ただし、これらの制限は、オフセットの精度や分割深度や画素の種別などに基づいて決定される、オフセットの所定の値域を超えない範囲で行う。
(Clip processing reduction method 3)
The processing of the video encoding device 2 corresponding to the method described in the section of the clip processing reduction method 3 in the video decoding device 1 will be described. As described above, in the adaptive offset filter information setting unit 81 of the moving image encoding device 2, the offset clip unit 812 clips the offset into a predetermined value range. Here, when the offset type is a band offset, clip processing can be reduced by limiting the offset value according to the class value range. Specifically, if the offset range in the class corresponding to the offset restriction area OLR0 shown in FIG. 28 is restricted to 0 or a positive value, the pixel value after the offset addition is clearly not less than 0. Similarly, if the range of the offset in the class corresponding to the offset restriction region OLR1 is restricted to 0 or a negative value, the pixel value after the addition of the offset is clearly not greater than max. However, these restrictions are performed in a range that does not exceed a predetermined offset range determined based on the accuracy of the offset, the division depth, the pixel type, and the like.

(クリップ処理の削減方法4)
動画像復号装置1におけるクリップ処理の削減方法4の項で説明した方法に対応する、動画像符号化装置2の処理についても、上記の方法3と同様に、オフセットクリップ部812において、2組以上設定されたオフセット制限領域のそれぞれに対応するクラスの値域に応じた制限を施すとよい。これにより、画素値を規定の範囲に近づけるとともに、クリップ処理を削減することができる。
(Clip processing reduction method 4)
As for the processing of the video encoding device 2 corresponding to the method described in the section 4 on the clip processing reduction method 4 in the video decoding device 1, two or more sets are performed in the offset clip unit 812 similarly to the method 3 described above. It is preferable to apply a restriction according to the value range of the class corresponding to each of the set offset restriction areas. As a result, the pixel value can be brought close to a specified range, and clip processing can be reduced.

上記いずれの方法においても、オフセットの値域と画素ビット深度に基づいて、クリップ処理を生じないオフセット制限領域を設定したうえで符号化された符号化データを用いれば、動画像復号装置1におけるクリップ処理を軽減し、処理を高速化することができる。   In any of the above methods, if encoded data encoded using an offset limited region that does not cause clipping processing based on the offset value range and pixel bit depth is used, clipping processing in the video decoding device 1 is performed. Can be reduced and the processing speed can be increased.

(付記事項1)
上述したように、画素値の成分をはじめとするパラメータ条件に応じてクラス分類のための変換テーブルを切り替える方法は、さらに他のパラメータ条件と組み合わせることもできる。例えば、QAOUの階層が閾値以上である場合や、QAOUのサイズが所定の閾値以下の場合、あるいはQP値が所定の閾値以上である場合にのみ上述のような成分の種類に応じた処理や変換テーブルの切り替えを行い、それ以外の場合には切り替えずに、輝度画素と同一の処理や変換テーブルを色差画素でも用いてもよい。
(Appendix 1)
As described above, the method of switching the conversion table for class classification according to the parameter condition including the pixel value component can be combined with other parameter conditions. For example, processing or conversion according to the type of component as described above only when the QAOU hierarchy is equal to or greater than a threshold, when the size of the QAOU is equal to or smaller than a predetermined threshold, or when the QP value is equal to or greater than a predetermined threshold. The same process or conversion table as the luminance pixel may be used for the chrominance pixels without changing the table in other cases.

(付記事項2)
また、特定タイプのピクチャ、例えばBピクチャや非参照ピクチャ(IDRピクチャ)でのみ、上述のようなパラメータ条件に応じた処理や変換テーブルの切り替えを行ってもよい。例えば、Iピクチャは相対的にPピクチャおよびBピクチャよりも誤差が小さいため、Iピクチャでは輝度画素と色差画素とで変換テーブルの切り替えを行わず、PピクチャおよびBピクチャでのみ上述のような変換テーブルの切り替えを行うとよい。
(Appendix 2)
In addition, only for a specific type of picture, for example, a B picture or a non-reference picture (IDR picture), processing according to the parameter condition as described above or conversion table switching may be performed. For example, since the I picture has a relatively smaller error than the P picture and the B picture, the conversion table is not switched between the luminance pixel and the chrominance pixel in the I picture, and the above-described conversion is performed only in the P picture and the B picture. It is good to switch the table.

(付記事項3)
また、符号化プロファイルやレベル等を表す符号化パラメータに応じて、上述のように、パラメータ条件に応じた処理や変換テーブルの切り替えを行ってもよい。例えば、処理量や複雑度が小さいことが優先される場合には、上述のような変換テーブルの切り替えを行わず、そうでない場合には、変換テーブルの切り替えを行うようにするとよい。
(Appendix 3)
Further, as described above, processing corresponding to the parameter condition or switching of the conversion table may be performed according to the encoding parameter representing the encoding profile, level, and the like. For example, if priority is given to a small amount of processing and complexity, the conversion table switching as described above is not performed, and if not, the conversion table is switched.

(応用例)
上述した動画像復号装置1および動画像符号化装置2は、動画像の送信、受信、記録、再生を行う各種装置に搭載して利用することができる。なお、動画像は、カメラ等により撮像された自然動画像であってもよいし、コンピュータ等により生成された人工動画像(CGおよびGUIを含む)であってもよい)。
(Application examples)
The moving picture decoding apparatus 1 and the moving picture encoding apparatus 2 described above can be used by being mounted on various apparatuses that perform moving picture transmission, reception, recording, and reproduction. Note that the moving image may be a natural moving image captured by a camera or the like, or an artificial moving image (including CG and GUI) generated by a computer or the like).

まず、上述した動画像復号装置1および動画像符号化装置2を、動画像の送信および受信に利用できることを、図23を参照して説明する。   First, the fact that the above-described moving picture decoding apparatus 1 and moving picture encoding apparatus 2 can be used for transmission and reception of moving pictures will be described with reference to FIG.

図23(a)は、動画像符号化装置2を搭載した送信装置Aの構成を示したブロック図である。図23(a)に示すように、送信装置Aは、動画像を符号化することによって符号化データを得る符号化部A1と、符号化部A1が得た符号化データで搬送波を変調することによって変調信号を得る変調部A2と、変調部A2が得た変調信号を送信する送信部A3と、を備えている。上述した動画像符号化装置2は、この符号化部A1として利用される。   FIG. 23A is a block diagram illustrating a configuration of the transmission apparatus A in which the moving image encoding apparatus 2 is mounted. As shown in FIG. 23 (a), the transmitting apparatus A encodes a moving image, obtains encoded data, and modulates a carrier wave with the encoded data obtained by the encoding unit A1. A modulation unit A2 that obtains a modulation signal by the transmission unit A2 and a transmission unit A3 that transmits the modulation signal obtained by the modulation unit A2. The moving image encoding device 2 described above is used as the encoding unit A1.

送信装置Aは、符号化部A1に入力する動画像の供給源として、動画像を撮像するカメラA4、動画像を記録した記録媒体A5、動画像を外部から入力するための入力端子A6、および画像を生成または加工する画像処理部A7を更に備えていてもよい。図23(a)においては、これら全てを送信装置Aが備えた構成を例示しているが、一部を省略しても構わない。   The transmission apparatus A has a camera A4 that captures a moving image, a recording medium A5 that records the moving image, an input terminal A6 for inputting the moving image from the outside, as a supply source of the moving image that is input to the encoding unit A1. You may further provide image processing part A7 which produces | generates or processes an image. FIG. 23A illustrates a configuration in which the transmission apparatus A includes all of these, but some of them may be omitted.

なお、記録媒体A5は、符号化されていない動画像を記録したものであってもよいし、伝送用の符号化方式とは異なる記録用の符号化方式で符号化された動画像を記録したものであってもよい。後者の場合、記録媒体A5と符号化部A1との間に、記録媒体A5から読み出した符号化データを記録用の符号化方式に従って復号する復号部(不図示)を介在させるとよい。   The recording medium A5 may be a recording of a non-encoded moving image, or a recording of a moving image encoded by a recording encoding scheme different from the transmission encoding scheme. It may be a thing. In the latter case, a decoding unit (not shown) for decoding the encoded data read from the recording medium A5 according to the recording encoding method may be interposed between the recording medium A5 and the encoding unit A1.

図23(b)は、動画像復号装置1を搭載した受信装置Bの構成を示したブロック図である。図23(b)に示すように、受信装置Bは、変調信号を受信する受信部B1と、受信部B1が受信した変調信号を復調することによって符号化データを得る復調部B2と、復調部B2が得た符号化データを復号することによって動画像を得る復号部B3と、を備えている。上述した動画像復号装置1は、この復号部B3として利用される。   FIG. 23B is a block diagram illustrating a configuration of the receiving device B on which the moving image decoding device 1 is mounted. As shown in FIG. 23B, the receiving device B includes a receiving unit B1 that receives a modulated signal, a demodulating unit B2 that obtains encoded data by demodulating the modulated signal received by the receiving unit B1, and a demodulating unit. A decoding unit B3 that obtains a moving image by decoding the encoded data obtained by B2. The moving picture decoding apparatus 1 described above is used as the decoding unit B3.

受信装置Bは、復号部B3が出力する動画像の供給先として、動画像を表示するディスプレイB4、動画像を記録するための記録媒体B5、および、動画像を外部に出力するための出力端子B6を更に備えていてもよい。図23(b)においては、これら全てを受信装置Bが備えた構成を例示しているが、一部を省略しても構わない。   The receiving device B has a display B4 for displaying a moving image, a recording medium B5 for recording the moving image, and an output terminal for outputting the moving image as a supply destination of the moving image output from the decoding unit B3. B6 may be further provided. FIG. 23B illustrates a configuration in which the receiving apparatus B includes all of these, but a part of the configuration may be omitted.

なお、記録媒体B5は、符号化されていない動画像を記録するためのものであってもよいし、伝送用の符号化方式とは異なる記録用の符号化方式で符号化されたものであってもよい。後者の場合、復号部B3と記録媒体B5との間に、復号部B3から取得した動画像を記録用の符号化方式に従って符号化する符号化部(不図示)を介在させるとよい。   Note that the recording medium B5 may be for recording an unencoded moving image, or is encoded by a recording encoding method different from the transmission encoding method. May be. In the latter case, an encoding unit (not shown) that encodes the moving image acquired from the decoding unit B3 in accordance with the recording encoding method may be interposed between the decoding unit B3 and the recording medium B5.

なお、変調信号を伝送する伝送媒体は、無線であってもよいし、有線であってもよい。また、変調信号を伝送する伝送態様は、放送(ここでは、送信先が予め特定されていない送信態様を指す)であってもよいし、通信(ここでは、送信先が予め特定されている送信態様を指す)であってもよい。すなわち、変調信号の伝送は、無線放送、有線放送、無線通信、および有線通信の何れによって実現してもよい。   Note that the transmission medium for transmitting the modulation signal may be wireless or wired. Further, the transmission mode for transmitting the modulated signal may be broadcasting (here, a transmission mode in which the transmission destination is not specified in advance) or communication (here, transmission in which the transmission destination is specified in advance). Refers to the embodiment). That is, the transmission of the modulation signal may be realized by any of wireless broadcasting, wired broadcasting, wireless communication, and wired communication.

例えば、地上デジタル放送の放送局(放送設備など)/受信局(テレビジョン受像機など)は、変調信号を無線放送で送受信する送信装置A/受信装置Bの一例である。また、ケーブルテレビ放送の放送局(放送設備など)/受信局(テレビジョン受像機など)は、変調信号を有線放送で送受信する送信装置A/受信装置Bの一例である。   For example, a broadcasting station (such as broadcasting equipment) / receiving station (such as a television receiver) of terrestrial digital broadcasting is an example of a transmitting device A / receiving device B that transmits and receives a modulated signal by wireless broadcasting. A broadcasting station (such as broadcasting equipment) / receiving station (such as a television receiver) for cable television broadcasting is an example of a transmitting device A / receiving device B that transmits and receives a modulated signal by cable broadcasting.

また、インターネットを用いたVOD(Video On Demand)サービスや動画共有サービスなどのサーバ(ワークステーションなど)/クライアント(テレビジョン受像機、パーソナルコンピュータ、スマートフォンなど)は、変調信号を通信で送受信する送信装置A/受信装置Bの一例である(通常、LANにおいては伝送媒体として無線または有線の何れかが用いられ、WANにおいては伝送媒体として有線が用いられる)。ここで、パーソナルコンピュータには、デスクトップ型PC、ラップトップ型PC、およびタブレット型PCが含まれる。また、スマートフォンには、多機能携帯電話端末も含まれる。   Also, a server (workstation or the like) / client (television receiver, personal computer, smartphone, etc.) such as a VOD (Video On Demand) service or a video sharing service using the Internet transmits and receives a modulated signal by communication. This is an example of the A / reception device B (usually, either a wireless or wired transmission medium is used in a LAN, and a wired transmission medium is used in a WAN). Here, the personal computer includes a desktop PC, a laptop PC, and a tablet PC. The smartphone also includes a multi-function mobile phone terminal.

なお、動画共有サービスのクライアントは、サーバからダウンロードした符号化データを復号してディスプレイに表示する機能に加え、カメラで撮像した動画像を符号化してサーバにアップロードする機能を有している。すなわち、動画共有サービスのクライアントは、送信装置Aおよび受信装置Bの双方として機能する。   Note that the client of the video sharing service has a function of encoding a moving image captured by a camera and uploading it to the server in addition to a function of decoding the encoded data downloaded from the server and displaying it on the display. That is, the client of the video sharing service functions as both the transmission device A and the reception device B.

次に、上述した動画像復号装置1および動画像符号化装置2を、動画像の記録および再生に利用できることを、図24を参照して説明する。   Next, the fact that the above-described moving picture decoding apparatus 1 and moving picture encoding apparatus 2 can be used for recording and reproduction of moving pictures will be described with reference to FIG.

図24(a)は、上述した動画像復号装置1を搭載した記録装置Cの構成を示したブロック図である。図24(a)に示すように、記録装置Cは、動画像を符号化することによって符号化データを得る符号化部C1と、符号化部C1が得た符号化データを記録媒体Mに書き込む書込部C2と、を備えている。上述した動画像符号化装置2は、この符号化部C1として利用される。   FIG. 24A is a block diagram showing a configuration of a recording apparatus C in which the above-described moving picture decoding apparatus 1 is mounted. As shown in FIG. 24 (a), the recording device C encodes a moving image to obtain encoded data, and writes the encoded data obtained by the encoding unit C1 to the recording medium M. And a writing unit C2. The moving image encoding device 2 described above is used as the encoding unit C1.

なお、記録媒体Mは、(1)HDD(Hard Disk Drive)やSSD(Solid State Drive)などのように、記録装置Cに内蔵されるタイプのものであってもよいし、(2)SDメモリカードやUSB(Universal Serial Bus)フラッシュメモリなどのように、記録装置Cに接続されるタイプのものであってもよいし、(3)DVD(Digital Versatile Disc)やBD(Blu-ray Disc:登録商標)などのように、記録装置Cに内蔵されたドライブ装置(不図示)に装填されるものであってもよい。   The recording medium M may be of a type built in the recording device C, such as (1) HDD (Hard Disk Drive) or SSD (Solid State Drive), or (2) SD memory. It may be of the type connected to the recording device C, such as a card or USB (Universal Serial Bus) flash memory, or (3) DVD (Digital Versatile Disc) or BD (Blu-ray Disc: registration) (Trademark) or the like may be mounted on a drive device (not shown) built in the recording apparatus C.

また、記録装置Cは、符号化部C1に入力する動画像の供給源として、動画像を撮像するカメラC3、動画像を外部から入力するための入力端子C4、動画像を受信するための受信部C5、および、画像を生成または加工する画像処理部C6を更に備えていてもよい。図24(a)においては、これら全てを記録装置Cが備えた構成を例示しているが、一部を省略しても構わない。   The recording apparatus C also serves as a moving image supply source to be input to the encoding unit C1, a camera C3 that captures moving images, an input terminal C4 for inputting moving images from the outside, and reception for receiving moving images. A unit C5 and an image processing unit C6 that generates or processes an image may be further provided. FIG. 24A illustrates a configuration in which the recording apparatus C includes all of these, but some of them may be omitted.

なお、受信部C5は、符号化されていない動画像を受信するものであってもよいし、記録用の符号化方式とは異なる伝送用の符号化方式で符号化された符号化データを受信するものであってもよい。後者の場合、受信部C5と符号化部C1との間に、伝送用の符号化方式で符号化された符号化データを復号する伝送用復号部(不図示)を介在させるとよい。   The receiving unit C5 may receive an unencoded moving image, or receives encoded data encoded by a transmission encoding method different from the recording encoding method. You may do. In the latter case, a transmission decoding unit (not shown) that decodes encoded data encoded by the transmission encoding method may be interposed between the reception unit C5 and the encoding unit C1.

このような記録装置Cとしては、例えば、DVDレコーダ、BDレコーダ、HD(Hard Disk)レコーダなどが挙げられる(この場合、入力端子C4または受信部C5が動画像の主な供給源となる)。また、カムコーダ(この場合、カメラC3が動画像の主な供給源となる)、パーソナルコンピュータ(この場合、受信部C5または画像処理部C6が動画像の主な供給源となる)、スマートフォン(この場合、カメラC3または受信部C5が動画像の主な供給源となる)なども、このような記録装置Cの一例である。   Examples of such a recording apparatus C include a DVD recorder, a BD recorder, and an HD (Hard Disk) recorder (in this case, the input terminal C4 or the receiving unit C5 is a main source of moving images). In addition, a camcorder (in this case, the camera C3 is a main source of moving images), a personal computer (in this case, the receiving unit C5 or the image processing unit C6 is a main source of moving images), a smartphone (this In this case, the camera C3 or the receiving unit C5 is a main source of moving images).

図24(b)は、上述した動画像復号装置1を搭載した再生装置Dの構成を示したブロックである。図24(b)に示すように、再生装置Dは、記録媒体Mに書き込まれた符号化データを読み出す読出部D1と、読出部D1が読み出した符号化データを復号することによって動画像を得る復号部D2と、を備えている。上述した動画像復号装置1は、この復号部D2として利用される。   FIG. 24B is a block diagram illustrating a configuration of the playback device D in which the above-described video decoding device 1 is mounted. As shown in FIG. 24 (b), the reproducing device D obtains a moving image by decoding the read data D1 read from the read data D and the read data read by the read unit D1. And a decoding unit D2. The moving picture decoding apparatus 1 described above is used as the decoding unit D2.

なお、記録媒体Mは、(1)HDDやSSDなどのように、再生装置Dに内蔵されるタイプのものであってもよいし、(2)SDメモリカードやUSBフラッシュメモリなどのように、再生装置Dに接続されるタイプのものであってもよいし、(3)DVDやBDなどのように、再生装置Dに内蔵されたドライブ装置(不図示)に装填されるものであってもよい。   The recording medium M may be of a type built in the playback device D such as (1) HDD or SSD, or (2) such as an SD memory card or USB flash memory. It may be of a type connected to the playback device D, or (3) may be loaded into a drive device (not shown) built in the playback device D, such as DVD or BD. Good.

また、再生装置Dは、復号部D2が出力する動画像の供給先として、動画像を表示するディスプレイD3、動画像を外部に出力するための出力端子D4、および、動画像を送信する送信部D5を更に備えていてもよい。図24(b)においては、これら全てを再生装置Dが備えた構成を例示しているが、一部を省略しても構わない。   Further, the playback device D has a display D3 for displaying a moving image, an output terminal D4 for outputting the moving image to the outside, and a transmitting unit for transmitting the moving image as a supply destination of the moving image output by the decoding unit D2. D5 may be further provided. FIG. 24B illustrates a configuration in which the playback apparatus D includes all of these, but some of them may be omitted.

なお、送信部D5は、符号化されていない動画像を送信するものであってもよいし、記録用の符号化方式とは異なる伝送用の符号化方式で符号化された符号化データを送信するものであってもよい。後者の場合、復号部D2と送信部D5との間に、動画像を伝送用の符号化方式で符号化する符号化部(不図示)を介在させるとよい。   The transmission unit D5 may transmit a non-encoded moving image, or transmits encoded data encoded by a transmission encoding method different from the recording encoding method. You may do. In the latter case, an encoding unit (not shown) that encodes a moving image with a transmission encoding method may be interposed between the decoding unit D2 and the transmission unit D5.

このような再生装置Dとしては、例えば、DVDプレイヤ、BDプレイヤ、HDDプレイヤなどが挙げられる(この場合、テレビジョン受像機等が接続される出力端子D4が動画像の主な供給先となる)。また、テレビジョン受像機(この場合、ディスプレイD3が動画像の主な供給先となる)、デスクトップ型PC(この場合、出力端子D4または送信部D5が動画像の主な供給先となる)、ラップトップ型またはタブレット型PC(この場合、ディスプレイD3または送信部D5が動画像の主な供給先となる)、スマートフォン(この場合、ディスプレイD3または送信部D5が動画像の主な供給先となる)、デジタルサイネージ(電子看板や電子掲示板等とも称され、ディスプレイD3または送信部D5が動画像の主な供給先となる)なども、このような再生装置Dの一例である。   Examples of such a playback device D include a DVD player, a BD player, and an HDD player (in this case, an output terminal D4 to which a television receiver or the like is connected is a main moving image supply destination). . In addition, a television receiver (in this case, the display D3 is a main destination of moving images), a desktop PC (in this case, the output terminal D4 or the transmission unit D5 is a main destination of moving images), Laptop type or tablet type PC (in this case, display D3 or transmission unit D5 is the main supply destination of moving images), smartphone (in this case, display D3 or transmission unit D5 is the main supply destination of moving images) ), Digital signage (also referred to as an electronic signboard or an electronic bulletin board, and the display D3 or the transmission unit D5 is the main supply destination of moving images) is an example of such a playback device D.

(ソフトウェアによる構成)
最後に、動画像復号装置1および動画像符号化装置2の各ブロック、特に可変長符号復号部13、動きベクトル復元部14、インター予測画像生成部16、イントラ予測画像生成部17、予測方式決定部18、逆量子化・逆変換部19、デブロッキングフィルタ41、適応フィルタ50、適応オフセットフィルタ60、変換・量子化部21、可変長符号符号化部22、逆量子化・逆変換部23、イントラ予測画像生成部25、インター予測画像生成部26、動きベクトル検出部27、予測方式制御部28、動きベクトル冗長性削除部29、デブロッキングフィルタ33、適応フィルタ70、適応オフセットフィルタ80は、集積回路(ICチップ)上に形成された論理回路によってハードウェア的に実現していてもよいし、CPU(central processing unit)を用いてソフトウェア的に実現してもよい。
(Configuration by software)
Finally, each block of the moving picture decoding apparatus 1 and the moving picture encoding apparatus 2, in particular, the variable length code decoding unit 13, the motion vector restoration unit 14, the inter prediction image generation unit 16, the intra prediction image generation unit 17, and the prediction method determination Unit 18, inverse quantization / inverse transform unit 19, deblocking filter 41, adaptive filter 50, adaptive offset filter 60, transform / quantization unit 21, variable length code encoding unit 22, inverse quantization / inverse transform unit 23, The intra prediction image generation unit 25, the inter prediction image generation unit 26, the motion vector detection unit 27, the prediction scheme control unit 28, the motion vector redundancy deletion unit 29, the deblocking filter 33, the adaptive filter 70, and the adaptive offset filter 80 are integrated. It may be realized by hardware by a logic circuit formed on a circuit (IC chip), or a CPU (central proce It may be realized by software using a ssing unit).

後者の場合、動画像復号装置1および動画像符号化装置2は、各機能を実現する制御プログラムの命令を実行するCPU、上記プログラムを格納したROM(read only memory)、上記プログラムを展開するRAM(random access memory)、上記プログラムおよび各種データを格納するメモリ等の記憶装置(記録媒体)などを備えている。そして、本発明の目的は、上述した機能を実現するソフトウェアである動画像復号装置1および動画像符号化装置2の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム、ソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、上記の動画像復号装置1および動画像符号化装置2に供給し、そのコンピュータ(またはCPUやMPU(micro processing unit))が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。   In the latter case, the moving picture decoding apparatus 1 and the moving picture encoding apparatus 2 include a CPU that executes instructions of a control program that realizes each function, a ROM (read only memory) that stores the program, and a RAM that expands the program. (Random access memory), a storage device (recording medium) such as a memory for storing the program and various data. An object of the present invention is to provide a computer with program codes (execution format program, intermediate code program, source program) of control programs for the video decoding device 1 and the video encoding device 2 which are software for realizing the functions described above. A readable recording medium is supplied to the moving picture decoding apparatus 1 and the moving picture encoding apparatus 2, and the computer (or CPU or MPU (micro processing unit)) is recorded on the recording medium. This can also be achieved by reading out and executing.

上記記録媒体としては、例えば、磁気テープやカセットテープ等のテープ類、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやCD−ROM(compact disc read-only memory)/MOディスク(magneto-optical disc)/MD(Mini Disc)/DVD(digital versatile disc)/CD−R(CD Recordable)等の光ディスクを含むディスク類、ICカード(メモリカードを含む)/光カード等のカード類、マスクROM/EPROM(erasable programmable read-only memory)/EEPROM(electrically erasable and programmable read-only memory)/フラッシュROM等の半導体メモリ類、あるいはPLD(Programmable logic device)やFPGA(Field Programmable Gate Array)等の論理回路類などを用いることができる。   Examples of the recording medium include tapes such as a magnetic tape and a cassette tape, a magnetic disk such as a floppy (registered trademark) disk / hard disk, a CD-ROM (compact disc read-only memory) / MO disk (magneto-optical disc). ) / MD (Mini Disc) / DVD (digital versatile disc) / CD-R (CD Recordable) and other optical disks, IC cards (including memory cards) / optical cards, mask ROM / EPROM (Erasable programmable read-only memory) / EEPROM (electrically erasable and programmable read-only memory) / semiconductor memories such as flash ROM, or logic circuits such as PLD (Programmable logic device) and FPGA (Field Programmable Gate Array) Can be used.

また、動画像復号装置1および動画像符号化装置2を通信ネットワークと接続可能に構成し、上記プログラムコードを通信ネットワークを介して供給してもよい。この通信ネットワークは、プログラムコードを伝送可能であればよく、特に限定されない。例えば、インターネット、イントラネット、エキストラネット、LAN(local area network)、ISDN(integrated services digital network)、VAN(value-added network)、CATV(community antenna television/cable television)通信網、仮想専用網(virtual private network)、電話回線網、移動体通信網、衛星通信網等が利用可能である。また、この通信ネットワークを構成する伝送媒体も、プログラムコードを伝送可能な媒体であればよく、特定の構成または種類のものに限定されない。例えば、IEEE(institute of electrical and electronic engineers)1394、USB、電力線搬送、ケーブルTV回線、電話線、ADSL(asymmetric digital subscriber loop)回線等の有線でも、IrDA(infrared data association)やリモコンのような赤外線、Bluetooth(登録商標)、IEEE802.11無線、HDR(high data rate)、NFC(Near Field Communication)、DLNA(Digital Living Network Alliance)、携帯電話網、衛星回線、地上波デジタル網等の無線でも利用可能である。なお、本発明は、上記プログラムコードが電子的な伝送で具現化された、搬送波に埋め込まれたコンピュータデータ信号の形態でも実現され得る。   Further, the moving picture decoding apparatus 1 and the moving picture encoding apparatus 2 may be configured to be connectable to a communication network, and the program code may be supplied via the communication network. The communication network is not particularly limited as long as it can transmit the program code. For example, Internet, intranet, extranet, LAN (local area network), ISDN (integrated services digital network), VAN (value-added network), CATV (community antenna television / cable television) communication network, virtual private network (virtual private network) network), telephone line network, mobile communication network, satellite communication network, and the like. The transmission medium constituting the communication network may be any medium that can transmit the program code, and is not limited to a specific configuration or type. For example, infra red such as IrDA (infrared data association) or remote control even with wired such as IEEE (institute of electrical and electronic engineers) 1394, USB, power line carrier, cable TV line, telephone line, ADSL (asymmetric digital subscriber loop) line , Bluetooth (registered trademark), IEEE 802.11 wireless, HDR (high data rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance), mobile phone network, satellite line, terrestrial digital network, etc. Is possible. The present invention can also be realized in the form of a computer data signal embedded in a carrier wave in which the program code is embodied by electronic transmission.

本発明は上述した各実施の形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。   The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope of the claims, and the embodiments can be obtained by appropriately combining technical means disclosed in different embodiments. The form is also included in the technical scope of the present invention.

本発明は、画像データにオフセットフィルタリングを行う画像フィルタに好適に用いることができる。また、符号化データを復号する復号装置、および、符号化データを符号化する符号化装置に好適に適用することができる。   The present invention can be suitably used for an image filter that performs offset filtering on image data. Further, the present invention can be suitably applied to a decoding device that decodes encoded data and an encoding device that encodes encoded data.

1 動画像復号装置(画像復号装置)
2 動画像符号化装置(画像符号化装置)
16 インター予測画像生成部(予測画像生成手段)
17 イントラ予測画像生成部(予測画像生成手段)
25 イントラ予測画像生成部(予測画像生成手段)
26 インター予測画像生成部(予測画像生成手段)
60 適応オフセットフィルタ(画像フィルタ装置、オフセット加算手段)
80 適応オフセットフィルタ(画像フィルタ装置、オフセット加算手段)
623 オフセットタイプ導出部(オフセット決定手段)
624 クラス分類部(クラス分類方法選択手段、クラス分類手段、オフセット選択方法決定手段、オフセット選択手段)
625 オフセット属性設定部
626 オフセット導出部(オフセット決定手段)
627 オフセット加算部(フィルタ手段、オフセット修正手段)
1 video decoding device (image decoding device)
2 Video encoding device (image encoding device)
16 Inter prediction image generation unit (prediction image generation means)
17 Intra prediction image generation unit (prediction image generation means)
25 Intra prediction image generation unit (prediction image generation means)
26 Inter prediction image generation unit (prediction image generation means)
60 Adaptive offset filter (image filter device, offset addition means)
80 Adaptive offset filter (image filter device, offset addition means)
623 Offset type deriving unit (offset determining means)
624 class classification unit (class classification method selection means, class classification means, offset selection method determination means, offset selection means)
625 Offset attribute setting unit 626 Offset derivation unit (offset determination means)
627 Offset addition unit (filter means, offset correction means)

Claims (24)

複数の単位領域から構成される入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、
上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、
上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、
上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、
上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備えていることを特徴とする画像フィルタ装置。
An image filter device that adds an offset selected from a plurality of offsets to each pixel value of an input image composed of a plurality of unit regions,
Class classification method selection means for selecting a class classification method, which is a method for determining which of the plurality of classes the pixels included in the unit area are to be classified, from a plurality of candidates;
Class classification means for classifying the pixels according to the class classification method selected by the class classification method selection means;
An offset determining unit that determines an offset to be added to the pixel value of the pixel classified by the class classification unit for each unit region according to the class into which the pixel is classified;
An image filter device comprising: a filter unit that adds the offset determined by the offset determination unit to a pixel value of a pixel included in the unit region.
上記クラス分類方法選択手段は、上記単位領域に含まれる画素の画素値が色差を示す場合と輝度を示す場合とで、異なる候補群から、クラス分類方法を選択することを特徴とする請求項1に記載の画像フィルタ装置。   2. The class classification method selection unit selects a class classification method from different candidate groups depending on whether a pixel value of a pixel included in the unit region indicates a color difference or a luminance. The image filter device described in 1. 上記の異なる候補群は、上記クラス分類方法選択手段が、上記単位領域に含まれる画素の画素値が色差を示す場合に選択する候補群を色差候補群とし、上記単位領域に含まれる画素の画素値が輝度を示す場合に選択する候補群を輝度候補群とした場合に、上記色差候補群に含まれるクラス分類方法が示すクラス数が、上記輝度候補群に含まれるクラス分類方法が示すクラス数よりも多いものであることを特徴とする請求項2に記載の画像フィルタ装置。   The different candidate groups are defined as a candidate group selected by the class classification method selection unit when the pixel value of the pixel included in the unit area indicates a color difference, and the pixel of the pixel included in the unit area. When the candidate group to be selected when the value indicates luminance is a luminance candidate group, the number of classes indicated by the class classification method included in the color difference candidate group is the number of classes indicated by the class classification method included in the luminance candidate group. The image filter device according to claim 2, wherein the number of the image filter devices is larger. 上記の異なる候補群は、上記クラス分類方法選択手段が、上記単位領域に含まれる画素の画素値が色差を示す場合に選択する候補群を色差候補群とし、上記単位領域に含まれる画素の画素値が輝度を示す場合に選択する候補群を輝度候補群とした場合に、上記色差候補群に含まれるクラス分類方法の種類の数が、上記輝度候補群に含まれるクラス分類方法の種類の数よりも少ないものであることを特徴とする請求項2に記載の画像フィルタ装置。   The different candidate groups are defined as a candidate group selected by the class classification method selection unit when the pixel value of the pixel included in the unit area indicates a color difference, and the pixel of the pixel included in the unit area. When the candidate group to be selected when the value indicates luminance is a luminance candidate group, the number of types of class classification methods included in the color difference candidate group is the number of types of class classification methods included in the luminance candidate group. The image filter device according to claim 2, wherein the number of the image filter devices is smaller. 上記フィルタ手段は、上記クラス分類方法選択手段が、対象画素について、当該画素周辺のエッジの状態に基づいてクラス分類を行うクラス分類方法を選択し、上記対象画素の画素値が色差を示す場合、上記対象画素の画素値が輝度を示す場合であればオフセットを加算しないクラスに分類された画素の画素値にもオフセットを加算することを特徴とする請求項1〜4のいずれか1項に記載の画像フィルタ装置。   The filter means, when the class classification method selection means selects a class classification method for classifying the target pixel based on the state of the edge around the pixel, and the pixel value of the target pixel indicates a color difference, The offset is also added to the pixel value of a pixel classified into a class to which no offset is added if the pixel value of the target pixel indicates luminance. Image filter device. 上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、上記の複数の候補のうちの2つ以上の候補で、オフセット加算処理が行われるクラスに分類される画素値の範囲に重複があることを特徴とする請求項1に記載の画像フィルタ装置。   The class classification method selection means selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates, and two or more candidates among the plurality of candidates The image filter device according to claim 1, wherein there is an overlap in a range of pixel values classified into a class in which an offset addition process is performed. 上記クラス分類方法選択手段は、上記対象画素の画素値が色差を示す場合、所定の値域の画素が分類されるクラスが重複しているクラス分類方法の候補の中からクラス分類方法を選択することを特徴とする請求項5に記載の画像フィルタ装置。   The class classification method selection means, when the pixel value of the target pixel indicates a color difference, selects a class classification method from among candidate class classification methods in which classes in which pixels in a predetermined range are classified overlap The image filter device according to claim 5. 上記所定の値域は、無彩色あるいは低い彩度を示す値域であることを特徴とする請求項7に記載の画像フィルタ装置。   8. The image filter device according to claim 7, wherein the predetermined value range is a value range indicating an achromatic color or low saturation. 上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、
それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれており、
上記複数の変換テーブルのうち、少なくとも2つの変換テーブルの所定の範囲に含まれる画素値は、オフセット加算処理が行われるクラスと対応付けられていることを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means is for selecting a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates.
Each of the above candidates includes a plurality of conversion tables that associate pixel values with classes,
2. The image filter according to claim 1, wherein among the plurality of conversion tables, pixel values included in a predetermined range of at least two conversion tables are associated with a class on which an offset addition process is performed. apparatus.
上記変換テーブルは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとを対応付けており、
上記所定の範囲は、他のクラスよりも対応付けられている値域が少ないクラスと対応付けられている値域の範囲であることを特徴とする請求項9に記載の画像フィルタ装置。
In the conversion table, the pixel value is divided into a plurality of value ranges, and each divided value range is associated with a class.
The image filter device according to claim 9, wherein the predetermined range is a range of a value range associated with a class having a smaller value range than other classes.
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、
それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれており、
上記複数の変換テーブルは互いに、オフセット加算処理が行われるクラスと対応付けられている画素値の範囲が異なることを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means is for selecting a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates.
Each of the above candidates includes a plurality of conversion tables that associate pixel values with classes,
The image filter device according to claim 1, wherein the plurality of conversion tables have different pixel value ranges associated with classes for which offset addition processing is performed.
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、
それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、
上記複数の変換テーブルは互いに、各クラスと対応付けられている値域の数が異なることを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means is for selecting a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates.
Each of the above candidates includes a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the conversion tables includes pixel values divided into a plurality of value ranges, and each divided value range and class Are associated with each other,
The image filter device according to claim 1, wherein the plurality of conversion tables have different number of value ranges associated with each class.
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、
それぞれの上記候補には、画素値とクラスとを対応付けた3つ以上の変換テーブルが含まれており、
上記3つ以上の変換テーブルには、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、他の変換テーブルよりも広い変換テーブルと、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、上記広い変換テーブルにおける画素値の範囲よりも狭い変換テーブルと、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域である変換テーブルと、
が含まれていることを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means is for selecting a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates.
Each of the above candidates includes three or more conversion tables in which pixel values are associated with classes,
The above three or more conversion tables include
A conversion table in which the range of pixel values corresponding to the class for which offset addition processing is performed is wider than other conversion tables,
A conversion table in which the pixel value range corresponding to the class for which the offset addition processing is performed is narrower than the pixel value range in the wide conversion table;
A conversion table in which the range of pixel values corresponding to the class for which the offset addition processing is performed is the both ends of the range of pixel values and a range close to the range,
The image filter device according to claim 1, further comprising:
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、
それぞれの上記候補には、画素値とクラスとを対応付けた3つ以上の変換テーブルが含まれており、
上記3つ以上の変換テーブルには、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の中央を含む第1変換テーブルと、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域を含む第2変換テーブルと、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、上記第1変換テーブルおよび第2変換テーブルにおける画素値の範囲以外の範囲を含む1つ以上の変換テーブルと、
が含まれていることを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means is for selecting a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates.
Each of the above candidates includes three or more conversion tables in which pixel values are associated with classes,
The above three or more conversion tables include
A first conversion table in which the range of pixel values corresponding to the class for which the offset addition processing is performed includes the center of the range of pixel values;
A second conversion table in which the range of pixel values corresponding to the class to which the offset addition processing is performed includes both ends of the range of pixel values and a range close to the range;
One or more conversion tables in which the pixel value range corresponding to the class for which the offset addition processing is performed includes a range other than the pixel value range in the first conversion table and the second conversion table;
The image filter device according to claim 1, further comprising:
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、
それぞれの上記候補には、画素値とクラスとを対応付けた3つ以上の変換テーブルが含まれており、
上記3つ以上の変換テーブルのいずれかを示す符号化データの符号長が、
オフセット加算処理が行われるクラスと対応する画素値の範囲が画素値の値域の中央を含む変換テーブルを示す場合に最も短く、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の両端およびその付近を含む変換テーブルを示す場合に最も長くなる、符号化データを用いるものであることを特徴とする請求項14に記載の画像フィルタ装置。
The class classification method selection means is for selecting a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates.
Each of the above candidates includes three or more conversion tables in which pixel values are associated with classes,
The code length of the encoded data indicating any of the three or more conversion tables is
The shortest when the pixel value range corresponding to the class for which the offset addition process is performed indicates a conversion table including the center of the pixel value range,
The range of pixel values corresponding to the class for which the offset addition processing is performed uses encoded data that is the longest when a conversion table including both ends of the pixel value range and the vicinity thereof is used. The image filter device according to claim 14.
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであって、
それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該複数の変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、
上記クラス分類方法選択手段は、前記画素値が色差を示すものである場合には、前記画素値が輝度を示すものである場合よりも、多くの数の値域に区分した変換テーブルを含むクラス分類方法を選択することを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates,
Each of the candidates includes a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the plurality of conversion tables has pixel values divided into a plurality of value ranges, Is associated with a class,
The class classification method selection means includes a class classification including a conversion table divided into a larger number of value ranges when the pixel values indicate color differences than when the pixel values indicate luminance. The image filter device according to claim 1, wherein a method is selected.
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであって、
それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該複数の変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、
上記クラス分類方法選択手段は、前記画素値が色差を示すものである場合、オフセット加算処理が行われないクラスと対応する画素値の範囲が、画素値の値域の両端およびこれに近接する値域である変換テーブルを含むクラス分類方法を選択することを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates,
Each of the candidates includes a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the plurality of conversion tables has pixel values divided into a plurality of value ranges, Is associated with a class,
In the class classification method selection unit, when the pixel value indicates a color difference, the pixel value range corresponding to the class for which the offset addition processing is not performed is the range of the pixel value range and the range close thereto. 2. The image filter apparatus according to claim 1, wherein a class classification method including a certain conversion table is selected.
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであって、
それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該複数の変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、
上記クラス分類方法選択手段は、前記画素値が色差を示すものである場合、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の中央を含む第1変換テーブルと、
オフセット加算処理が行われるクラスと対応する画素値の範囲が、画素値の値域の中央を含まない第3変換テーブルと、
を含むとともに、上記第1変換テーブルにおけるオフセット加算処理が行われるクラスと対応する画素値の範囲が、上記第3変換テーブルにおけるオフセット加算処理が行われるクラスと対応する画素値の範囲よりも狭いクラス分類方法を選択することを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means selects a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates,
Each of the candidates includes a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the plurality of conversion tables has pixel values divided into a plurality of value ranges, Is associated with a class,
The class classification method selection means, when the pixel value indicates a color difference,
A first conversion table in which the range of pixel values corresponding to the class for which the offset addition processing is performed includes the center of the range of pixel values;
A third conversion table in which the range of pixel values corresponding to the class for which offset addition processing is performed does not include the center of the range of pixel values;
And a range of pixel values corresponding to a class for which offset addition processing is performed in the first conversion table is narrower than a range of pixel values corresponding to the class for which offset addition processing is performed in the third conversion table 2. The image filter device according to claim 1, wherein a classification method is selected.
上記クラス分類方法選択手段は、対象画素の画素値の大きさに基づいてクラス分類を行うクラス分類方法を複数の候補から選択するものであり、
それぞれの上記候補には、画素値とクラスとを対応付けた複数の変換テーブルが含まれるとともに、該複数の変換テーブルのそれぞれは、画素値が複数の値域に区分され、区分されたそれぞれの値域とクラスとが対応付けられており、
上記複数の変換テーブルには、
画素値の値域の中で連続していない複数の範囲が、オフセット加算処理が行われるクラスと対応する画素値の範囲となる変換テーブル
が含まれていることを特徴とする請求項1に記載の画像フィルタ装置。
The class classification method selection means is for selecting a class classification method for performing class classification based on the size of the pixel value of the target pixel from a plurality of candidates.
Each of the candidates includes a plurality of conversion tables in which pixel values and classes are associated with each other, and each of the plurality of conversion tables has pixel values divided into a plurality of value ranges, Is associated with a class,
The plurality of conversion tables include
2. The conversion table according to claim 1, wherein a plurality of non-contiguous ranges in the pixel value range includes a conversion table in which the pixel value ranges corresponding to the class on which the offset addition processing is performed. Image filter device.
複数の単位領域から構成される入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、
上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、
上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、
上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、
上記画素の画素値の上限値、下限値、およびこれらに近接する画素値の画素について、上記オフセット決定手段が決定したオフセットを加算後の画素値が、上記上限値を上回るか、または上記下限値を下回らないように、加算するオフセットを修正するオフセット修正手段と、
上記オフセット決定手段が決定したオフセットまたは上記オフセット修正手段が修正したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備えていることを特徴とする画像フィルタ装置。
An image filter device that adds an offset selected from a plurality of offsets to each pixel value of an input image composed of a plurality of unit regions,
Class classification method selection means for selecting a class classification method, which is a method for determining which of the plurality of classes the pixels included in the unit area are to be classified, from a plurality of candidates;
Class classification means for classifying the pixels according to the class classification method selected by the class classification method selection means;
An offset determining unit that determines an offset to be added to the pixel value of the pixel classified by the class classification unit for each unit region according to the class into which the pixel is classified;
The pixel value after adding the offset determined by the offset determination means for the upper limit value, the lower limit value, and the pixel value adjacent to the upper limit value, the lower limit value, or the lower limit value. Offset correcting means for correcting the offset to be added so as not to fall below
An image filter device comprising: a filter unit that adds the offset determined by the offset determination unit or the offset corrected by the offset correction unit to a pixel value of a pixel included in the unit region.
符号化データから復号した予測残差に、生成した予測画像を加算して復号画像を生成する画像復号装置であって、
上記予測残差に上記予測画像を加算した加算画像に対し、単位領域毎にオフセットを加算するオフセット加算手段と、
上記オフセット加算手段がオフセットを加算した画像を復号画像として出力する出力手段と、を備え、
上記オフセット加算手段には、
上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、
上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、
上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、
上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、が備えられていることを特徴とする画像復号装置。
An image decoding device that generates a decoded image by adding a generated prediction image to a prediction residual decoded from encoded data,
An offset addition means for adding an offset for each unit region to the addition image obtained by adding the prediction image to the prediction residual;
Output means for outputting an image obtained by adding the offset by the offset adding means as a decoded image;
The offset adding means includes
Class classification method selection means for selecting a class classification method, which is a method for determining which of the plurality of classes the pixels included in the unit area are to be classified, from a plurality of candidates;
Class classification means for classifying the pixels according to the class classification method selected by the class classification method selection means;
An offset determining unit that determines an offset to be added to the pixel value of the pixel classified by the class classification unit for each unit region according to the class into which the pixel is classified;
An image decoding apparatus, comprising: a filter unit that adds the offset determined by the offset determination unit to a pixel value of a pixel included in the unit region.
生成した予測画像と原画像との差分である予測残差を符号化することによって符号化データを生成する画像符号化装置であって、
原画像を符号化し、復号した復号画像に対し、単位領域毎にオフセットを加算するオフセット加算手段と、
上記オフセット加算手段がオフセットを加算した画像から上記予測画像を生成する予測画像生成手段と、
上記予測画像生成手段が生成した予測画像と原画像との差分である予測残差を符号化する符号化手段と、を備え、
上記オフセット加算手段には、
上記単位領域に含まれる画素を、複数のクラスの何れに分類するかを決定する方法であるクラス分類方法を、複数の候補の中から選択するクラス分類方法選択手段と、
上記クラス分類方法選択手段が選択したクラス分類方法に従って、上記画素のクラス分類を行うクラス分類手段と、
上記クラス分類手段がクラス分類した画素の画素値に加算するオフセットを、当該画素が分類されたクラスに応じて、上記単位領域毎に決定するオフセット決定手段と、
上記オフセット決定手段が決定したオフセットを、上記単位領域に含まれる画素の画素値に加算するフィルタ手段と、が備えられていることを特徴とする画像符号化装置。
An image encoding device that generates encoded data by encoding a prediction residual that is a difference between a generated predicted image and an original image,
Offset addition means for adding an offset for each unit region to the decoded image obtained by encoding the original image;
Predicted image generation means for generating the predicted image from an image obtained by adding the offset by the offset adding means;
Encoding means for encoding a prediction residual, which is a difference between the predicted image generated by the predicted image generation means and the original image,
The offset adding means includes
Class classification method selection means for selecting a class classification method, which is a method for determining which of the plurality of classes the pixels included in the unit area are to be classified, from a plurality of candidates;
Class classification means for classifying the pixels according to the class classification method selected by the class classification method selection means;
An offset determining unit that determines an offset to be added to the pixel value of the pixel classified by the class classification unit for each unit region according to the class into which the pixel is classified;
An image coding apparatus comprising: a filter unit that adds the offset determined by the offset determination unit to a pixel value of a pixel included in the unit region.
画像復号装置において復号される、予測画像と原画像との差分である予測残差が符号化された符号化データのデータ構造であって、
画素値データと、
上記画素値データが示す画素値に加算するオフセットを決定するためのクラス分類方法を選択するためのクラス分類方法選択データと、を含み、
上記画像復号装置は、上記クラス分類方法選択データが示すクラス分類方法に従って、対象画素のクラスを分類し、該クラスに対応するオフセットを対象画素に加算して、復号画像を生成することを特徴とする符号化データのデータ構造。
A data structure of encoded data obtained by encoding a prediction residual, which is a difference between a predicted image and an original image, decoded by an image decoding device,
Pixel value data,
Class classification method selection data for selecting a class classification method for determining an offset to be added to the pixel value indicated by the pixel value data, and
The image decoding apparatus classifies a class of a target pixel according to a class classification method indicated by the class classification method selection data, and adds a offset corresponding to the class to the target pixel to generate a decoded image. Data structure of encoded data to be performed.
入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、
上記画素値毎に、上記複数のオフセットの中から当該画素値に対し加算するオフセットを選択する方法であるオフセット選択方法を、複数の候補の中から決定するオフセット選択方法決定手段と、
上記オフセット選択方法決定手段が決定したオフセット選択方法に従って、上記複数のオフセットの中からオフセットを選択するオフセット選択手段と、
上記オフセット選択手段が選択したオフセットを、上記画素値に加算するフィルタ手段と、を備えていることを特徴とする画像フィルタ装置。
An image filter device that adds an offset selected from a plurality of offsets to each pixel value of an input image,
An offset selection method determining means for determining an offset selection method, which is a method for selecting an offset to be added to the pixel value from the plurality of offsets, for each pixel value;
An offset selection means for selecting an offset from the plurality of offsets according to the offset selection method determined by the offset selection method determination means;
An image filter device comprising: a filter unit that adds the offset selected by the offset selection unit to the pixel value.
JP2012009448A 2011-11-04 2012-01-19 Image filtering device, image decoding device, image encoding device and data structure Pending JP2013138395A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012009448A JP2013138395A (en) 2011-11-04 2012-01-19 Image filtering device, image decoding device, image encoding device and data structure

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP2011242842 2011-11-04
JP2011242842 2011-11-04
JP2011264046 2011-12-01
JP2011264046 2011-12-01
JP2012009448A JP2013138395A (en) 2011-11-04 2012-01-19 Image filtering device, image decoding device, image encoding device and data structure

Publications (1)

Publication Number Publication Date
JP2013138395A true JP2013138395A (en) 2013-07-11

Family

ID=48913760

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012009448A Pending JP2013138395A (en) 2011-11-04 2012-01-19 Image filtering device, image decoding device, image encoding device and data structure

Country Status (1)

Country Link
JP (1) JP2013138395A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013150328A (en) * 2012-01-20 2013-08-01 Sony Corp Flexible band offset mode in sample adaptive offset within hevc
JP2014533028A (en) * 2011-11-07 2014-12-08 キヤノン株式会社 Method and apparatus for providing a compensation offset to a set of image reconstruction samples
WO2015163046A1 (en) * 2014-04-23 2015-10-29 ソニー株式会社 Image processing device and image processing method
JP2015216626A (en) * 2014-04-23 2015-12-03 ソニー株式会社 Image processing device and image processing method
JP2016527793A (en) * 2013-07-15 2016-09-08 聯發科技股▲ふん▼有限公司Mediatek Inc. Method of sample adaptive offset processing for video coding
JP2017507571A (en) * 2014-01-30 2017-03-16 クアルコム,インコーポレイテッド Low complexity sample adaptive offset coding
CN113965764A (en) * 2020-07-21 2022-01-21 Oppo广东移动通信有限公司 Image encoding method, image decoding method and related device

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017225144A (en) * 2011-11-07 2017-12-21 キヤノン株式会社 Encoder for encoding information for executing sample adaptive off-set processing, encoding method, program for making encoding method be executed, and storage medium
US10085042B2 (en) 2011-11-07 2018-09-25 Canon Kabushiki Kaisha Method, device and program for encoding and decoding a sequence of images using area-by-area loop filtering
JP2020022183A (en) * 2011-11-07 2020-02-06 キヤノン株式会社 Encoding method of encoding information for execution of processing on sample adaptive offset
JP2021040333A (en) * 2011-11-07 2021-03-11 キヤノン株式会社 Coding method for coding information for executing processing of sample adaptive offset
US9774886B2 (en) 2011-11-07 2017-09-26 Canon Kabushiki Kaisha Method and device for providing compensation offsets for a set of reconstructed samples of an image
JP2019036982A (en) * 2011-11-07 2019-03-07 キヤノン株式会社 Encoding method for encoding information for performing processing of sample adaptive offset and processing method
JP7077385B2 (en) 2011-11-07 2022-05-30 キヤノン株式会社 A coding method that encodes information for performing sample adaptive offset processing
US9794596B2 (en) 2011-11-07 2017-10-17 Canon Kabushiki Kaisha Method and device for optimizing encoding/decoding of compensation offsets for a set of reconstructed samples of an image
US9848208B2 (en) 2011-11-07 2017-12-19 Canon Kabushiki Kaisha Method and device for optimizing encoding/decoding of compensation offsets for a set of reconstructed samples of an image
JP2014533028A (en) * 2011-11-07 2014-12-08 キヤノン株式会社 Method and apparatus for providing a compensation offset to a set of image reconstruction samples
JP2014075844A (en) * 2012-01-20 2014-04-24 Sony Corp Flexible band offset mode in sample adaptive offset in hevc
JP2014075843A (en) * 2012-01-20 2014-04-24 Sony Corp Flexible band offset mode in sample adaptive offset in hevc
JP2013150328A (en) * 2012-01-20 2013-08-01 Sony Corp Flexible band offset mode in sample adaptive offset within hevc
JP2014099883A (en) * 2012-01-20 2014-05-29 Sony Corp Flexible band offset mode in sample adaptive offset within hevc
JP2016527793A (en) * 2013-07-15 2016-09-08 聯發科技股▲ふん▼有限公司Mediatek Inc. Method of sample adaptive offset processing for video coding
US10659817B2 (en) 2013-07-15 2020-05-19 Hfi Innovation Inc. Method of sample adaptive offset processing for video coding
JP2017507571A (en) * 2014-01-30 2017-03-16 クアルコム,インコーポレイテッド Low complexity sample adaptive offset coding
WO2015163046A1 (en) * 2014-04-23 2015-10-29 ソニー株式会社 Image processing device and image processing method
US10666975B2 (en) 2014-04-23 2020-05-26 Sony Corporation Image processing apparatus and image processing method
US10477207B2 (en) 2014-04-23 2019-11-12 Sony Corporation Image processing apparatus and image processing method
JP2015216626A (en) * 2014-04-23 2015-12-03 ソニー株式会社 Image processing device and image processing method
CN113965764A (en) * 2020-07-21 2022-01-21 Oppo广东移动通信有限公司 Image encoding method, image decoding method and related device
CN113965764B (en) * 2020-07-21 2023-04-07 Oppo广东移动通信有限公司 Image encoding method, image decoding method and related device

Similar Documents

Publication Publication Date Title
US11765350B2 (en) Offset decoding device, offset coding device, image filtering device
JP2013236358A (en) Image filter device, image decoding device, image encoding device, and data structure
JP2013138395A (en) Image filtering device, image decoding device, image encoding device and data structure
WO2013046990A1 (en) Offset decoding apparatus, offset encoding apparatus, image filter apparatus, and data structure
JP2013251827A (en) Image filter device, image decoding device, image encoding device, and data structure