WO2013046990A1 - Offset decoding apparatus, offset encoding apparatus, image filter apparatus, and data structure - Google Patents

Offset decoding apparatus, offset encoding apparatus, image filter apparatus, and data structure Download PDF

Info

Publication number
WO2013046990A1
WO2013046990A1 PCT/JP2012/070859 JP2012070859W WO2013046990A1 WO 2013046990 A1 WO2013046990 A1 WO 2013046990A1 JP 2012070859 W JP2012070859 W JP 2012070859W WO 2013046990 A1 WO2013046990 A1 WO 2013046990A1
Authority
WO
WIPO (PCT)
Prior art keywords
offset
unit
value
pixel
image
Prior art date
Application number
PCT/JP2012/070859
Other languages
French (fr)
Japanese (ja)
Inventor
将伸 八杉
知宏 猪飼
山本 智幸
Original Assignee
シャープ株式会社
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 シャープ株式会社 filed Critical シャープ株式会社
Publication of WO2013046990A1 publication Critical patent/WO2013046990A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

An adaptive offset filter (60) adds an offset to each of the pixel values of an input image constituted by a plurality of unit areas. If the size of a unit area for which an offset is determined is smaller than a predetermined size, the adaptive offset filter (60) determines, from among selectable offsets the number of which is limited, an offset to be added to the pixel values of the pixels included in the unit area, and adds the determined offset thereto.

Description

オフセット復号装置、オフセット符号化装置、画像フィルタ装置、および、データ構造Offset decoding apparatus, offset encoding apparatus, image filter apparatus, and data structure
 本発明は、画像のフィルタリングを行う画像フィルタ装置に関する。また、画像フィルタによって参照されるオフセットを復号するオフセット復号装置、および、画像フィルタによってよって参照されるオフセットを符号化するオフセット符号化装置に関する。また、符号化データのデータ構造に関する。 The present invention relates to an image filter device that performs image filtering. The present invention also relates to an offset decoding apparatus that decodes an offset referred to by an image filter, and an offset encoding apparatus that encodes an offset referred to by 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 used in AVC, a method used in KTA software, which is a joint development codec in VCEG (Video Coding Expert Group), and a method used in TMuC (Test Model Under Consulation) software, which is the successor codec And a method employed in HM (HEVC TestModel) software.
 このような符号化方式において、動画像を構成する画像(ピクチャ)は、画像を分割することにより得られるスライス、スライスを分割することにより得られる最大符号化単位(LCU:Largest Coding Unit、ツリーブロックとも呼ばれる)、最大符号化単位を分割することにより得られる符号化単位(CU:Coding Unit、符号化ノードとも呼ばれる)、および、符号化単位を分割することより得られるブロックおよびパーティションからなる階層構造により管理され、多くの場合、ブロックを最小単位として符号化される。 In such an encoding method, an image (picture) constituting a moving image is a slice obtained by dividing the image, a maximum coding unit obtained by dividing the slice (LCU: Largegest Coding Unit, tree block) Hierarchical structure consisting of coding units (CU: Coding 単 位 Unit, also called coding node) 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 predicted image is usually generated based on a local decoded image obtained by encoding / decoding an input image, and difference data between the predicted image and the input image is encoded. It becomes. 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, predicted images in a corresponding frame are sequentially generated based on a locally decoded image in the same frame. 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および非特許文献2には、復号画像のブロック歪みを低減させるデブロッキングフィルタの後段であって、適応的に決定されたフィルタ係数を用いたフィルタ処理を行う適応的ループフィルタ(「適応フィルタ」とも呼ぶ)の前段に導入された適応的オフセットフィルタ(「適応オフセットフィルタ」とも呼ぶ)が開示されている。この適応オフセットフィルタは、デブロッキングフィルタから出力される画像の各画素値に対して、適応的に設定されたオフセットを加算するというものである。 Non-Patent Document 1 and Non-Patent Document 2 describe an adaptive loop filter (“", which 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 an “adaptive offset filter”) introduced before the “adaptive filter” is disclosed. This adaptive offset filter adds an adaptively set offset to each pixel value of an image output from the deblocking filter.
 このような適応オフセットフィルタを備えることによって、ブロック歪みをより効果的に抑制することができる。 It is possible to more effectively suppress block distortion by providing such an adaptive offset filter.
 しかしながら、適応オフセットフィルタは、オフセットの種類(タイプ、クラス)が多いため、大きなメモリサイズが必要となってしまう。 However, since the adaptive offset filter has many types of offset (type, class), a large memory size is required.
 本発明は、上記の問題に鑑みてなされたものであり、メモリサイズの増大を抑制しつつ、ブロック歪みを低減することのできる画像フィルタ装置等を実現することにある。 The present invention has been made in view of the above problems, and is to realize an image filter device and the like that can reduce block distortion while suppressing an increase in memory size.
 上記課題を解決するために、本発明に係る画像フィルタ装置は、複数の単位領域から構成される入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、各単位領域に含まれる画素の画素値に加算するオフセットを該単位領域ごとに決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、当該単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備え、上記オフセット決定手段は、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも選択できるオフセット数が制限されたオフセットの集合の中から当該単位領域に含まれる画素の画素値に加算するオフセットを決定することを特徴としている。 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. The offset determining means for determining the offset to be added to the pixel value of the pixel included in each unit area for each unit area, and the offset determined by the offset determining means as the pixel value of the pixel included in the unit area Filter means for adding, wherein the offset determining means can select when the size of the unit area for which the offset is determined is smaller than a predetermined size than when the size of the unit area is equal to or larger than the predetermined size Determines the offset to be added to the pixel value of the pixel included in the unit area from the set of offsets with a limited number of offsets It is characterized in Rukoto.
 上記の構成によれば、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも制限されたオフセットの集合の中から、加算するオフセットが決定される。 According to the above configuration, when the size of the unit area for which the offset is determined is smaller than a predetermined size, from the set of offsets that are more limited than when the size of the unit area is equal to or larger than the predetermined size, The offset to be added is determined.
 単位領域のサイズが小さい場合、その中に含まれる画素数は少なくなり、また、その画素同士は、近似した値を持っている可能性が高い。よって、単位領域のサイズが小さい場合は、選択可能なオフセット数を制限したとしても、オフセット適用後の画像に与える影響は小さい。また、選択可能なオフセット数を制限することで、必要なメモリの容量を減らすことができる。 When the size of the unit area is small, the number of pixels included in the unit area is small, and the pixels are likely to have approximate values. Therefore, when the size of the unit area is small, even if the number of selectable offsets is limited, the influence on the image after the offset application is small. Further, by limiting the number of offsets that can be selected, the required memory capacity can be reduced.
 したがって、上記の構成によれば、オフセット適用後の画像に与える影響を低くしつつ、メモリの使用量を削減することができる。また、選択可能なオフセット数が少なくなることで、符号量が削減でき、符号化効率が向上する。 Therefore, according to the above configuration, it is possible to reduce the amount of memory used while reducing the effect on the image after the offset application. Also, since the number of selectable offsets is reduced, the amount of codes can be reduced, and the coding efficiency is 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 to each pixel value of an input image composed of a plurality of unit regions, and includes pixels included in each unit region. Offset determining means for determining the offset to be added to the pixel value for each unit region, and filter means for adding the offset determined by the offset determining means to the pixel value of the pixel included in the unit region, The filter means is characterized in that, when the size of the unit area for which the offset is determined is smaller than a predetermined size, an offset with coarser accuracy is added than when the size of the unit area is equal to or larger than the predetermined size. Yes.
 上記の構成によれば、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも精度が粗いオフセットが加算される。 According to the above configuration, when the size of the unit area for which the offset is to be determined is smaller than a predetermined size, an offset having a coarser accuracy is added than when the size of the unit area is equal to or larger than the predetermined size.
 単位領域のサイズが小さい場合、その中に含まれる画素数は少なくなり、また、その画素同士は、近似した値を持っている可能性が高い。よって、単位領域のサイズが小さい場合は、オフセットの精度を粗くしても、量子化誤差に与える影響が小さい。したがって、オフセット適用後の画像に与える影響も小さい。また、オフセットの精度を粗くすることで、必要なメモリの容量を減らすことができる。 When the size of the unit area is small, the number of pixels included in the unit area is small, and the pixels are likely to have approximate values. Therefore, when the size of the unit region is small, the influence on the quantization error is small even if the offset accuracy is rough. Therefore, the influence on the image after applying the offset is small. In addition, it is possible to reduce the required memory capacity by increasing the accuracy of the offset.
 したがって、上記の構成によれば、オフセット適用後の画像に与える影響を低くしつつ、メモリの使用量を削減することができる。また、オフセットの精度が粗くなることで、符号量が削減でき、符号化効率が向上する。 Therefore, according to the above configuration, it is possible to reduce the amount of memory used while reducing the effect on the image after the offset application. Further, since the offset accuracy becomes coarse, the amount of codes can be reduced, and the coding efficiency is improved.
 上記課題を解決するために、本発明に係る画像フィルタ装置は、複数の単位領域から構成される入力画像の各画素値に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、各単位領域に含まれる画素の画素値に加算するオフセットの種類を該単位領域ごとに決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットの種類に応じたオフセットを、当該単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備え、上記オフセット決定手段は、オフセットを加算する対象画素について、画素値が最大値および最小値の付近にある画素に対しては、オフセットの種類をバンドオフセット(BO)に決定し、それ以外の値域の画素に対してはエッジオフセット(EO)に決定することを特徴としている。 In order to solve the above problems, an image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample : Adaptive Offset) to each pixel value of an input image composed of a plurality of unit regions. , An offset determining unit that determines for each unit region the type of offset to be added to the pixel value of the pixel included in each unit region, and an offset according to the type of offset determined by the offset determining unit in the unit region Filter means for adding to the pixel values of the included pixels, the offset determining means for the target pixel to which the offset is to be added, for the pixels whose pixel values are near the maximum value and the minimum value, The type is determined to be band offset (BO), and the edge offset (EO) is determined for pixels in other ranges. It is characterized.
 上記の構成によれば、適応オフセットを施す場合に、画素値が、最大値および最小値の付近の画素に対しては、バンドオフセットが適用され、これ以外の値域の画素についてはエッジオフセットが適用される。 According to the above configuration, when adaptive offset is applied, a band offset is applied to pixels in the vicinity of the maximum and minimum pixel values, and an edge offset is applied to pixels in other value ranges. Is done.
 高画素値域および低画素値域では、エッジよりも画素値の方が誤差に影響を及ぼし易いという傾向があるので、上記の構成により、誤差補正の効率が高まり、符号化効率を向上させることができる。 In the high pixel value region and the low pixel value region, the pixel value tends to affect the error more easily than the edge. Therefore, the above configuration increases the error correction efficiency and improves the encoding efficiency. .
 また、1つのタイプでバンドオフセットとエッジオフセットとを併用すれば、適応オフセットのタイプ数を減らすことができ、メモリの使用量および処理量を削減することができる。 Also, if band offset and edge offset are used together in one type, the number of types of adaptive offset can be reduced, and the amount of memory used and the amount of processing can be reduced.
 なお、上記の構成において、バンドオフセットとは、処理対象の画素の画素値の大きさに応じて、当該処理対象画素の画素値に複数のオフセットの何れかを加算するオフセット処理のことをいう(以下同様)。また、上記の構成において、エッジオフセットとは、処理対象の画素の画素値と当該処理対象の画素の周辺の画素の画素値との差分に応じて、当該処理対象画素の画素値に複数のオフセットの何れかを加算するオフセット処理のことをいう(以下同様)。 In the above configuration, the band offset refers to an offset process in which one of a plurality of offsets is added to the pixel value of the processing target pixel according to the size of the pixel value of the processing target pixel ( The same applies below). In the above configuration, the edge offset is a plurality of offsets in the pixel value of the processing target pixel according to the difference between the pixel value of the processing target pixel and the pixel values of the pixels around the processing target pixel. This is offset processing for adding any of the above (same below).
 上記課題を解決するために、本発明に係る画像フィルタ装置は、入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、エッジオフセット(EO)を適用するときのクラスを決定するために行うエッジの判定を、対象画素の水平方向に存在する画素のみを参照して行うクラス分類手段と、エッジオフセット(EO)を適用する場合、上記クラス分類手段が分類したクラスに対応するオフセットを加算するフィルタ手段と、を備えていることを特徴としている。 In order to solve the above-described problems, an image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample Adaptive Offset) to an input image, and a class for applying an edge offset (EO). Class classification means for performing edge determination to determine only the pixels existing in the horizontal direction of the target pixel, and when applying edge offset (EO), the class classification means classifies the class. And a filter means for adding a corresponding offset.
 上記の構成によれば、エッジの判定に、水平方向の画素しか参照しないので、上方向の画素も参照する場合と比較して、必要なメモリ量を削減することができる。また、上方向の境界判定が不要となるので、処理量も削減することができる。 According to the above configuration, since only the pixels in the horizontal direction are referred to for edge determination, the required memory amount can be reduced as compared with the case of referring to the pixels in the upward direction. In addition, since the upper boundary determination is not necessary, the processing amount can also be reduced.
 上記課題を解決するために、本発明に係る画像フィルタ装置は、入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、色差を示す画素値が、最大値および最小値の中央の値である中央値付近のクラスの分割幅を、その他の値域よりも細分化して、バンドオフセット(BO)を適用するときのクラスを決定するクラス分類手段と、バンドオフセット(BO)を適用する場合、上記クラス分類手段が分類したクラスに対応するオフセットを加算するフィルタ手段と、を備えていることを特徴としている。 In order to solve the above problems, an image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample : Adaptive Offset) to an input image, and the pixel value indicating a color difference has a maximum value and a minimum value. Class classification means for determining a class when band offset (BO) is applied by subdividing the division width of the class around the median value, which is the median value, than other value ranges, and band offset (BO) Is applied, a filter means for adding an offset corresponding to the class classified by the class classification means is provided.
 上記の構成によれば、色差を示す画素値が、最大値および最小値の中央の値である中央値付近のクラスの分割幅を、その他の値域よりも細分化して、バンドオフセット(BO)を適用するときのクラスを決定する。 According to the above configuration, the pixel value indicating the color difference is subdivided from the division value of the class around the median value that is the median value of the maximum value and the minimum value, and the band offset (BO) is reduced. Determine the class to apply.
 色差の画素値が中央値のとき、当該画素は無彩色となる。無彩色の誤差は、人の目に付き易く、主観画質が低下する。そこで、上記の構成のように、中央値近辺のクラス幅を細分化すれば、中央値近辺の画素に対し、細かくオフセットを設定することができる。これにより、主観画質を向上させることができる。 When the pixel value of the color difference is the median value, the pixel is achromatic. Achromatic errors are easily noticeable by humans, and the subjective image quality deteriorates. Therefore, if the class width near the median is subdivided as in the above configuration, the offset can be set finely for the pixels near the median. Thereby, subjective image quality can be improved.
 上記課題を解決するために、本発明に係る画像フィルタ装置は、入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、色差を示す画素値が、最大値および最小値の中央の値である中央値付近の画素に対し、その他の値域の画素よりも精度が高いオフセットを加算するフィルタ手段を備えていることを特徴としている。 In order to solve the above problems, an image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample : Adaptive Offset) to an input image, and the pixel value indicating a color difference has a maximum value and a minimum value. It is characterized by comprising filter means for adding an offset with higher accuracy to the pixels near the median value, which is the median value, than the pixels in other value ranges.
 上記の構成によれば、色差を示す画素値が、最大値および最小値の中央の値である中央値付近の画素に対し、その他の値域の画素よりも精度が高いオフセットを加算する。 According to the above configuration, the pixel value indicating the color difference adds an offset with higher accuracy than the pixels in the other value ranges to the pixels in the vicinity of the median value that is the median value of the maximum value and the minimum value.
 色差の画素値が中央値のとき、当該画素は無彩色となる。無彩色の誤差は、人の目に付き易く、主観画質が低下する。そこで、上記の構成のように、中央値近辺では、加算するオフセットの精度を向上させれば、中央値近辺の画素に対し、細かくオフセットを加算することができる。これにより、主観画質を向上させることができる。 When the pixel value of the color difference is the median value, the pixel is achromatic. Achromatic errors are easily noticeable by humans, and the subjective image quality deteriorates. Therefore, as in the above configuration, if the accuracy of the offset to be added is improved in the vicinity of the median value, the offset can be finely added to the pixels in the vicinity of the median value. Thereby, subjective image quality can be improved.
 上記課題を解決するために、本発明に係るオフセット復号装置は、入力画像の各画素値にオフセットを加算する画像フィルタによって参照される各オフセットを復号するオフセット復号装置であって、各オフセット残差を、符号化データから復号するオフセット残差復号手段と、各オフセットの予測値を、復号済みのオフセット、または予め定められた値から導出する予測値導出手段と、各オフセットを、上記予測値導出手段によって導出された予測値、および上記オフセット残差復号手段によって復号されたオフセット残差から算出するオフセット算出手段と、を備えていることを特徴としている。 In order to solve the above problem, an offset decoding apparatus according to the present invention is an offset decoding apparatus that decodes each offset referenced by an image filter that adds an offset to each pixel value of an input image, and each offset residual Offset residual decoding means for decoding the encoded data from the encoded data, prediction value deriving means for deriving the predicted value of each offset from a decoded offset or a predetermined value, and each offset for deriving the predicted value And an offset calculating means for calculating from the predicted value derived by the means and the offset residual decoded by the offset residual decoding means.
 上記の構成によれば、残差からオフセットを復号するので、オフセットをそのまま符号化する場合よりも、符号量を少なくすることができる。また、残差を求めるための予測値を復号済みのオフセットまたは予め定められた値から導出するので、復号済みのオフセットのみを用いることにより、差分データの符号量が、そのまま符号化するときよりも大きくなってしまうことを防止することができる。 According to the above configuration, since the offset is decoded from the residual, it is possible to reduce the code amount as compared with the case where the offset is encoded as it is. In addition, since the prediction value for obtaining the residual is derived from the decoded offset or a predetermined value, by using only the decoded offset, the code amount of the difference data is made as compared with the case of encoding as it is. It can be prevented from becoming large.
 なお、予め定められた値としては、例えば「0」を挙げることができる。 For example, “0” can be given as a predetermined value.
 上記課題を解決するために、本発明に係るオフセット符号化装置は、入力画像の各画素値にオフセットを加算する画像フィルタによって参照される各オフセットを符号化するオフセット符号化装置であって、各オフセットの予測値を、符号化済みのオフセット、または予め定められた値から導出する予測値導出手段と、各オフセットと上記予測値導出手段によって導出された予測値とからオフセット残差を算出するオフセット残差算出手段と、上記オフセット残差算出手段によって算出されたオフセット残差を符号化するオフセット残差符号化手段と、を備えていることを特徴としている。 In order to solve the above problems, an offset encoding apparatus according to the present invention is an offset encoding apparatus that encodes each offset referenced by an image filter that adds an offset to each pixel value of an input image, An offset for calculating an offset residual from each offset and the predicted value derived by the predicted value deriving means, and a predicted value deriving means for deriving the predicted value of the offset from an encoded offset or a predetermined value The apparatus is characterized by comprising: a residual calculation means; and an offset residual encoding means for encoding the offset residual calculated by the offset residual calculation means.
 上記の構成によれば、残差からオフセットを復号するので、オフセットをそのまま符号化する場合よりも、符号量を少なくすることができる。また、残差を求めるための予測値を復号済みのオフセットまたは予め定められた値から導出するので、復号済みのオフセットのみを用いることにより、差分データの符号量が、そのまま符号化するときよりも大きくなってしまうことを防止することができる。 According to the above configuration, since the offset is decoded from the residual, it is possible to reduce the code amount as compared with the case where the offset is encoded as it is. In addition, since the prediction value for obtaining the residual is derived from the decoded offset or a predetermined value, by using only the decoded offset, the code amount of the difference data is made as compared with the case of encoding as it is. It can be prevented from becoming large.
 上記課題を解決するために、本発明に係る符号化データのデータ構造は、複数の単位領域から構成される入力画像の各画素値にオフセットを加算する画像フィルタによって参照される符号化データのデータ構造であって、予測値を、復号済みのオフセットおよび予め定められた値のいずれから導出するかを示す予測値導出情報を含み、上記画像フィルタは、上記符号化データに含まれる予測値導出情報を参照して、予測値を導出し、オフセットを復号する、ことを特徴としている。 In order to solve the above problems, the data structure of encoded data according to the present invention is encoded data data referred to by an image filter that adds an offset to each pixel value of an input image composed of a plurality of unit areas. A prediction value derivation information indicating whether the prediction value is derived from a decoded offset or a predetermined value, and the image filter includes prediction value derivation information included in the encoded data The prediction value is derived and the offset is decoded with reference to FIG.
 上記の構成によれば、予測値を、復号済みのオフセットとするか、または予め定められた値とするかを、予測値導出情報により決定できる。 According to the above configuration, whether the predicted value is a decoded offset or a predetermined value can be determined from the predicted value derivation information.
 以上のように、本発明に係る画像フィルタ装置は、各単位領域に含まれる画素の画素値に加算するオフセットを該単位領域ごとに決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、当該単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備え、上記オフセット決定手段は、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも選択できるオフセット数が制限されたオフセットの集合の中から当該単位領域に含まれる画素の画素値に加算するオフセットを決定する構成である。 As described above, the image filter device according to the present invention includes an offset determination unit that determines an offset to be added to the pixel value of a pixel included in each unit region for each unit region, and an offset determined by the offset determination unit. Filter means for adding to the pixel values of the pixels included in the unit area, and the offset determining means, when the size of the unit area for which the offset is determined is smaller than a predetermined size, the size of the unit area In this configuration, the offset to be added to the pixel value of the pixel included in the unit area is determined from the set of offsets in which the number of offsets that can be selected is limited as compared with the case where is larger than a predetermined size.
 これにより、オフセット適用後の画像に与える影響を低くしつつ、メモリの使用量を削減することができるという効果を奏する。また、選択可能なオフセット数が少なくなることで、符号量が削減でき、符号化効率が向上するという効果を奏する。 This has the effect of reducing the amount of memory used while reducing the effect on the image after applying the offset. In addition, since the number of selectable offsets is reduced, the amount of codes can be reduced, and the encoding efficiency is improved.
 また、本発明に係るオフセット復号装置は、各オフセット残差を、符号化データから復号するオフセット残差復号手段と、各オフセットの予測値を、復号済みのオフセット、または予め定められた値から導出する予測値導出手段と、各オフセットを、上記予測値導出手段によって導出された予測値、および上記オフセット残差復号手段によって復号されたオフセット残差から算出するオフセット算出手段と、を備えている構成である。 Also, the offset decoding apparatus according to the present invention derives an offset residual decoding means for decoding each offset residual from encoded data, and a predicted value of each offset from a decoded offset or a predetermined value. A prediction value deriving unit that performs the calculation, and an offset calculation unit that calculates each offset from the prediction value derived by the prediction value deriving unit and the offset residual decoded by the offset residual decoding unit. It is.
 これにより、残差からオフセットを復号するので、オフセットをそのまま符号化する場合よりも、符号量を少なくすることができるという効果を奏する。また、残差を求めるための予測値を復号済みのオフセットまたは予め定められた値から導出するので、復号済みのオフセットのみを用いることにより、差分データの符号量が、そのまま符号化するときよりも大きくなってしまうことを防止することができるという効果を奏する。 Thereby, since the offset is decoded from the residual, the code amount can be reduced as compared with the case where the offset is encoded as it is. In addition, since the prediction value for obtaining the residual is derived from the decoded offset or a predetermined value, by using only the decoded offset, the code amount of the difference data is made as compared with the case of encoding as it is. There exists an effect that it can prevent becoming large.
 また、本発明に係るオフセット符号化装置は、各オフセットの予測値を、符号化済みのオフセット、または予め定められた値から導出する予測値導出手段と、各オフセットと上記予測値導出手段によって導出された予測値とからオフセット残差を算出するオフセット残差算出手段と、上記オフセット残差算出手段によって算出されたオフセット残差を符号化するオフセット残差符号化手段と、を備えている構成である。 In addition, the offset encoding apparatus according to the present invention derives a predicted value of each offset from a coded offset or a predetermined value, a predicted value deriving unit, and each offset and the predicted value deriving unit. An offset residual calculating unit that calculates an offset residual from the predicted value, and an offset residual encoding unit that encodes the offset residual calculated by the offset residual calculating unit. is there.
 これにより、残差からオフセットを復号するので、オフセットをそのまま符号化する場合よりも、符号量を少なくすることができるという効果を奏する。また、残差を求めるための予測値を復号済みのオフセットまたは予め定められた値から導出するので、復号済みのオフセットのみを用いることにより、差分データの符号量が、そのまま符号化するときよりも大きくなってしまうことを防止することができるという効果を奏する。 Thereby, since the offset is decoded from the residual, the code amount can be reduced as compared with the case where the offset is encoded as it is. In addition, since the prediction value for obtaining the residual is derived from the decoded offset or a predetermined value, by using only the decoded offset, the code amount of the difference data is made as compared with the case of encoding as it is. There exists an effect that it can prevent becoming large.
本発明の実施の形態に係る適応オフセットフィルタの構成を示すブロック図である。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情報の構成を示す図である。FIG. 6 is a diagram illustrating a data configuration of encoded data generated by the video encoding device according to the embodiment and decoded by the video decoding device, where (a) to (d) are 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. 上記実施形態に係る符号化データのオフセット情報OIのシンタクスを示す図である。It is a figure which shows the syntax of the offset information OI of the coding data which concerns on the said embodiment. 上記実施形態に係るオフセット単位の分割の態様を示す図であり、(a)はsao_curr_depth=0の場合を示す図であり、(b)はsao_curr_depth=1の場合を示す図であり、(c)はsao_curr_depth=2の場合を示す図であり、(d)はsao_curr_depth=3の場合を示す図であり、(e)はsao_curr_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_curr_depth = 0, (b) is a figure which shows the case where sao_curr_depth = 1, (c) (A) is a figure which shows the case where sao_curr_depth = 2, (d) is a figure which shows the case where sao_curr_depth = 3, (e) is a figure which shows the case where sao_curr_depth = 4. 上記実施形態に係る動画像復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the moving image decoding apparatus which concerns on the said embodiment. 上記実施形態を説明するための図であって、(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 flowchart which shows the flow of a process by the adaptive offset filter process part which concerns on the said embodiment. 上記実施の形態に係るオフセット情報復号部が用いる変換テーブルを示す図である。It is a figure which shows the conversion table which the offset information decoding part which concerns on the said embodiment uses. 上記実施形態に係る適応オフセットフィルタによるオフセット処理を説明するための図であって、(a)~(d)は、それぞれ、sao_type_idx=1~4のときに参照される画素を示す図である。FIG. 4 is a diagram for explaining offset processing by an adaptive offset filter according to the embodiment, and FIGS. 4A to 4D are diagrams illustrating pixels referred to when sao_type_idx = 1 to 4, respectively. FIG. 上記実施の形態に係る適応オフセットフィルタによるオフセット処理を説明するための図であって、(a)は、処理対象画素xの画素値pix[x]と画素aまたはbの画素値との大小関係を示すグラフ、およびその大小関係に応じた関数Signの値を示す図であり、(b)は、処理対象画素xの画素値と、画素aおよびbの画素値との大小関係を示すグラフ、およびその大小関係に応じたEgdeTypeの値を示す図であり、(c)は、(b)に示した各グラフと、class_idxとの対応を示す図であり、(d)~(f)は、EgdeTypeから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 (B) is a graph 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, and a graph showing the value of the function Sign according to the magnitude relationship. And (c) is a diagram showing the correspondence between each graph shown in (b) and class_idx, and (d) to (f) are shown in FIG. It is a figure which shows the conversion table showing the conversion from EggeType 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)は処理対象のQAOUの階層の深度が閾値よりも小さい場合のクラス分類を概略的に示す図であり、(b)は処理対象のQAOUの階層の深度が閾値以上の場合のクラス分類を概略的に示す図である。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 roughly the class classification | category when the depth of the hierarchy of QAOU of a process target is smaller than a threshold value. Yes, (b) is a diagram schematically showing class classification when the depth of the hierarchy of the QAOU to be processed is greater than or equal to a threshold value. 上記実施の形態において、バンドオフセットが指定された場合のクラス分類の一例を示す図であり、(a)は、処理対象のQAOUの階層の深度が閾値よりも小さい場合のクラス分類の一例を示す図であり、(b)は処理対象のQAOUの階層の深度が閾値以上の場合のクラス分類の一例を示す図である。In the said embodiment, it is a figure which shows an example of the class classification in case the band offset is designated, (a) shows an example of the class classification in case the depth of the hierarchy of QAOU of a process target is smaller than a threshold value. (B) is a figure which shows an example of the class classification | category when the depth of the hierarchy of QAOU of a process target is more than a threshold value. 上記実施形態に係る動画像符号化装置の構成を示すブロック図である。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. 上記実施形態に係る動画像符号化装置の備える適応オフセットフィルタのオフセット情報選択部による処理の流れを示すフローチャートである。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. 上記実施形態において、対象の処理単位に含まれる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. 上記実施の形態において、QAOUインデックスが「x」の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 "x". 上記実施形態に係る動画像符号化装置の備える適応オフセットフィルタのオフセット情報選択部による処理を説明するための図であって、(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. 本発明に係る実施の形態において、画素値によってEOとBOとを切り換える構成を説明するための図であり、(a)は、画素値によってEOとBOとを切り換える構成の概要を説明するための図であり、(b)は、具体的な切り換えの値を説明するための図であり、(c)は、オフセット情報格納部621に格納されるリストメモリの内容を示す図である。FIG. 6 is a diagram for explaining a configuration for switching between EO and BO according to pixel values in the embodiment according to the present invention, and (a) is a diagram for explaining an outline of a configuration for switching between EO and BO according to pixel values. (B) is a diagram for explaining specific switching values, and (c) is a diagram showing the contents of the list memory stored in the offset information storage unit 621. 本発明に係る実施の形態において、EOのタイプを水平方向に限定する場合を説明するための図であり、(a)は効果の概要を説明するための図であり、(b)は水平方向の画素の位置を説明するための図であり、(c)は(b)とは異なる状態を説明するための図であり、(d)は(c)の効果を説明するための図である。In embodiment which concerns on this invention, it is a figure for demonstrating the case where the type of EO is limited to a horizontal direction, (a) is a figure for demonstrating the outline | summary of an effect, (b) is a horizontal direction. It is a figure for demonstrating the position of the pixel of (b), (c) is a figure for demonstrating the state different from (b), (d) is a figure for demonstrating the effect of (c). . 上記実施の形態において、EOのタイプを水平方向に限定する場合を説明するための図であり、(a)および(b)は参照する画素が非対称の位置にある場合を示す図であり、(c)は水平エッジの概要を示す図である。In the said embodiment, it is a figure for demonstrating the case where the type of EO is limited to a horizontal direction, (a) And (b) is a figure which shows the case where the pixel to refer exists in an asymmetrical position, ( c) is a diagram showing an outline of a horizontal edge. 本発明に係る実施の形態において、オフセットの精度を向上させる場合についての概要を示す図である。In embodiment which concerns on this invention, it is a figure which shows the outline | summary about the case where the precision of offset is improved. 上記実施の形態において、クラス分類を細分化する場合の概要を示す図であり、(a)は変換テーブルを示す図であり、(b)~(d)はクラス分割を説明するための図である。FIG. 4 is a diagram showing an outline when classifying is subdivided in the above embodiment, (a) is a diagram showing a conversion table, and (b) to (d) are diagrams for explaining class division. is there. 本発明に係る実施の形態において、色差に応じてクラス分類を行う場合を説明するための図であり、(a)は無彩色の画素値を考慮したクラス分類を説明するための図であり、(b)は無彩色の画素値を挟む2つの値域で非対称なクラス分類を説明するための図であり、(c)および(d)は色彩チャネル(CrまたはCb)毎に異なるクラス分類を説明するための図であり、(e)はBOのクラス分類を1つにする場合を説明するための図である。In the embodiment according to the present invention, it is a diagram for explaining the case of performing the class classification according to the color difference, (a) is a diagram for explaining the class classification in consideration of the achromatic pixel value, (B) is a figure for demonstrating a class classification asymmetrical in two range which pinches | interposes an achromatic color pixel value, (c) and (d) explain a class classification different for every color channel (Cr or Cb). (E) is a figure for demonstrating the case where the class classification of BO is made into one. 本発明に係る実施の形態において、オフセット情報復号部の構成を示すブロック図である。In the embodiment according to the present invention, it is a block diagram showing a configuration of an offset information decoding unit. 上記実施の形態において、分類される画素がないクラスがある場合の概要を示す図である。In the said embodiment, it is a figure which shows the outline | summary in case there exists a class without the pixel classified. 上記実施の形態において、予測候補フラグを用いる場合のシンタクスを示す図である。In the said embodiment, it is a figure which shows the syntax in the case of using a prediction candidate flag. 動画像復号装置および動画像符号化装置が、動画像の送受信に利用できることを説明するための図であり、(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 information decoding part which concerns on the said embodiment. (a)は、上記実施形態に係る使用オフセットタイプ選択部の構成を示すブロック図であり、(b)は、別の使用オフセットタイプ選択部の構成を示すブロック図である。(A) is a block diagram which shows the structure of the use offset type selection part which concerns on the said embodiment, (b) is a block diagram which shows the structure of another use offset type selection part. 上記実施形態に係るクラス分類部の構成を示すブロック図である。It is a block diagram which shows the structure of the class classification | category part which concerns on the said embodiment. 上記実施形態に係るオフセット情報およびQAOU情報のシンタクスを示す図であり、(a)は、オフセット情報のシンタクスを示す図であり、(b)は、QAOU情報のシンタクスを示す図であり、(c)は、(a)および(b)に示すシンタクスを呼び出す適応オフセットフィルタ全体のシンタクスを示す図である。It is a figure which shows the syntax of offset information and QAOU information which concerns on the said embodiment, (a) is a figure which shows the syntax of offset information, (b) is a figure which shows the syntax of QAOU information, (c () Is a diagram showing the syntax of the entire adaptive offset filter that calls the syntax shown in (a) and (b).
 〔実施の形態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は、例示的に、シーケンス、およびシーケンスを構成する複数のピクチャを含む。 FIG. 2 is a diagram showing a data structure of encoded data # 1. The encoded data # 1 exemplarily includes a sequence and a plurality of pictures constituting the sequence.
 符号化データ#1におけるピクチャレイヤ以下の階層の構造を図2に示す。図2の(a)~(d)は、それぞれ、ピクチャPICTを規定するピクチャレイヤ、スライスSを規定するスライスレイヤ、ツリーブロック(Tree block)TBLKを規定するツリーブロックレイヤ、ツリーブロックTBLKに含まれる符号化単位(Coding Unit;CU)を規定するCUレイヤを示す図である。 FIG. 2 shows the hierarchical structure below the picture layer in the encoded data # 1. 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 | union 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に含まれるデータであって、添え字を付している他のデータについても同様である。 In the following description, if 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 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: Picture Parameter Set) 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 a coding parameter group that the moving image decoding apparatus 1 refers to 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に含まれる構成としてもよい。 Further, the slice header SH includes a filter parameter FP that is referred to by an adaptive filter provided 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 for each process of intra prediction or inter prediction and conversion.
 ツリーブロックTBLKの上記ユニットは、再帰的な4分木分割により分割されている。この再帰的な4分木分割により得られる木構造のことを以下、符号化ツリー(coding tree)と称する。 The above unit of the tree block TBLK is divided by recursive quadtree partitioning. 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 that 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, coding unit information (hereinafter referred to as CU information) CU1 to CUNL is information corresponding to each coding 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画素の何れかをとり得る。 Also, the size that each coding node can take depends on the size designation information of the coding node and the maximum hierarchy depth (maximum hierarchical depth) 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 encoding 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 the block structure, the 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’である。 Further, 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 explaining the specific contents of the data included in the CU information CU, the tree structure of the data included in the CU will be described. The coding node is the root of a prediction tree (PT) and a transformation 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つがある。 There are roughly 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または複数の変換ブロックを含む。 Also, 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分木分割によるものとがある。 The division in the transformation tree includes the allocation of an area having the same size as the encoding node as the transformation block and the recursive quadtree division similar to the above-described division of the tree block.
 変換処理は、この変換ブロックごとに行われる。以下、変換の単位である変換ブロックのことを、変換単位(transform unit;TU)とも称する。 Conversion processing is performed for each conversion block. Hereinafter, the transform block which 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を含んでいる。 PT information PTI is information regarding 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についての予測画像生成方法として、イントラ予測を用いるのか、または、インター予測を用いるのかを指定する情報である。 Prediction type information PType is information that specifies whether intra prediction or inter prediction is used as a prediction image generation method for the target PU.
 予測情報PInfoは、予測タイプ情報PTypeが何れの予測方法を指定するのかに応じて、イントラ予測情報、または、インター予測情報より構成される。以下では、イントラ予測が適用されるPUをイントラPUとも呼称し、インター予測が適用されるPUをインターPUとも呼称する。 The prediction information PInfo is composed of 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の詳細については後述する。 Also, 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のことをブロックと称することもある。 TT information TTI is information related to 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は、基本的には四分木の各ノードに対して符号化されるが、変換サイズに関する制約(最大変換サイズ、最小変換サイズ、四分木の最大階層深度)に応じて省略されて推定される場合もある。 TT division information SP_TT is information for determining the shape and size of each TU included in the target CU and the position in the target CU. For example, the TT division information SP_TT can be generated from information (split_transform_unit_flag) indicating whether or not a target node is to be 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 quantization prediction residual QD is encoded data generated by the moving image encoding apparatus 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: Perform orthogonal transform (DCT transform (Discrete Cosine Transform) or DST transform (Discrete sine Transform)) on the prediction residual obtained by subtracting the predicted image from the encoding target image;
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 coding apparatus 2 quantizes the transform coefficient (QP = 2 qp / 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 an encoding parameter that is referred to when the video decoding device 1 generates an inter predicted 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”を含んでいる。“sao_split_flag”は、より具体的には、後述する引数(sao_curr_depth、ys、xs)によって指定されるものであり、“sao_split_flag[sao_curr_depth][ys][xs]”とも表記する。 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. More specifically, “sao_split_flag” is specified by arguments (sao_curr_depth, ys, xs) described later, and is also expressed as “sao_split_flag [sao_curr_depth] [ys] [xs]”.
 あるQAOUに含まれる“sao_split_flag”が、該QAOUがさらに分割されるものであることを示している場合(すなわち、当該QAOUがリーフではない場合)には、図2(e)に示すように、該QAOUに関するQAOU情報には、該QAOUに含まれる複数のQAOUの各々に関するQAOU情報が含まれる。 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. The QAOU information related to the QAOU includes QAOU information related to 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 “sao_split_flag” included in a certain QAOU indicates that the QAOU is not further divided (that is, when the QAOU is a leaf), it is shown in FIG. Thus, 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.
 次に、オフセット情報OIについて、図3を参照して説明する。図3(a)は、オフセット情報OI(図3(a)において“sao_offset_param()”と表記)のシンタクスを示す図である。 Next, offset information OI will be described with reference to FIG. FIG. 3A is a diagram illustrating the syntax of the offset information OI (denoted as “sao_offset_param ()” in FIG. 3A).
 図3(a)に示すように、オフセット情報OIには、パラメータ“sao_type_idx[sao_curr_depth][ys][xs]”が含まれている。また、パラメータ“sao_type_idx[sao_curr_depth][ys][xs]”が「0」でない場合、オフセット情報OIには、パラメータ“sao_offset[sao_curr_depth][ys][xs][i]”が含まれている。 As shown in FIG. 3A, the offset information OI includes a parameter “sao_type_idx [sao_curr_depth] [ys] [xs]”. When the parameter “sao_type_idx [sao_curr_depth] [ys] [xs]” is not “0”, the offset information OI includes the parameter “sao_offset [sao_curr_depth] [ys] [xs] [i]”.
 (sao_curr_depth、ys、xs)
 “sao_type_idx”および“sao_offset”の引数である“sao_curr_depth”は、QAOUの分割深度を表すパラメータであり、“ys”および“xs”は、それぞれ、QAOU(または後述するQAOMU)のy方向の位置およびx方向の位置を表すためのパラメータである。
(Sao_curr_depth, ys, xs)
“Sao_type_idx” and “sao_offset” arguments “sao_curr_depth” are parameters indicating the QAOU division depth, and “ys” and “xs” are the position of the QAOU (or QAOMU described later) in the y direction and It is a parameter for representing the position in the x direction.
 “sao_curr_depth”の値に応じたQAOUの分割の態様について、図4を参照して説明する。図4は、“sao_curr_depth”の値に応じたQAOUの分割の態様を示す図であり、(a)は“sao_curr_depth”=0の場合の分割の態様を示し、(b)は“sao_curr_depth”=1の場合の分割の態様を示し、(c)は“sao_curr_depth”=2の場合の分割の態様を示し、(d)は“sao_curr_depth”=3の場合の分割の態様を示し、(e)は“sao_curr_depth”=4の場合の分割の態様を示している。図4(a)~(e)に示すように、各QAOUは、“sao_curr_depth”、および(xs、ys)によって指定される。 The mode of QAOU division according to the value of “sao_curr_depth” will be described with reference to FIG. FIG. 4 is a diagram illustrating a QAOU division mode according to the value of “sao_curr_depth”. FIG. 4A illustrates a division mode when “sao_curr_depth” = 0, and FIG. 4B illustrates “sao_curr_depth” = 1. (C) shows a division mode when “sao_curr_depth” = 2, (d) shows a division mode when “sao_curr_depth” = 3, and (e) shows “ The division mode when sao_curr_depth ”= 4 is shown. As shown in FIGS. 4A to 4E, each QAOU is specified by “sao_curr_depth” and (xs, ys).
 また、図4(a)に示すように、“sao_curr_depth”=0であるとき、“xs”および“ys”はそれぞれ「0」であり、図4(b)に示すように、“sao_curr_depth”=1であるとき、“xs”および“ys”はそれぞれ「0」および「1」の何れかの値をとり得る。また、図4(c)に示すように、“sao_curr_depth”=2であるとき、“xs”および“ys”はそれぞれ「0」、「1」、「2」および「3」の何れかの値をとり得る。一般に、与えられた“sao_curr_depth”に対して、“xs”および“ys”は、それぞれ0~2דsao_curr_depth”-1の値をとり得る。 As shown in FIG. 4A, when “sao_curr_depth” = 0, “xs” and “ys” are each “0”, and as shown in FIG. 4B, “sao_curr_depth” = When it is 1, “xs” and “ys” can take values of “0” and “1”, respectively. Further, as shown in FIG. 4C, when “sao_curr_depth” = 2, “xs” and “ys” are values of “0”, “1”, “2”, and “3”, respectively. Can take. In general, for a given “sao_curr_depth”, “xs” and “ys” can take values of 0 to 2 × “sao_curr_depth” −1.
 図3(b)は、以上で説明したようなQAOU情報(図3(b)において“sao_split_param()”と表記)のシンタクスを示す図である。図3(b)のシンタクスで示すように、分割深度“sao_curr_depth”が所定の“saoMaxDepth”で設定される最大値よりも小さければ、パラメータ“sao_split_flag”によって、QAOUがさらに分割されるかどうかが選択される。分割される場合には、次の階層深度の“sao_split_param()”が再帰的に呼び出される。分割深度が最大値に達した(“sao_curr_depth”が“saoMaxDepth”より小さくない)場合には、“sao_split_flag[sao_curr_depth][ys][xs]”には「0」が設定され、それ以上の分割は行われない。 FIG. 3B is a diagram showing the syntax of the QAOU information (described as “sao_split_param ()” in FIG. 3B) as described above. As shown in the syntax of FIG. 3B, if the division depth “sao_curr_depth” is smaller than the maximum value set by the predetermined “saoMaxDepth”, whether or not the QAOU is further divided is selected by the parameter “sao_split_flag” Is done. When splitting, “sao_split_param ()” of the next hierarchical depth is recursively called. When the division depth reaches the maximum value ("sao_curr_depth" is not smaller than "saoMaxDepth"), "sao_split_flag [sao_curr_depth] [ys] [xs]" is set to "0", and further divisions Not done.
  (sao_type_idx)
 “sao_type_idx[sao_curr_depth][ys][xs]”は、上述のオフセットタイプ指定情報OTIに対応するものであり、各QAOUについてのオフセットタイプを指定するためのパラメータである。以下では、“sao_type_idx”のことを単にオフセットタイプと呼称することもある。
(Sao_type_idx)
“Sao_type_idx [sao_curr_depth] [ys] [xs]” corresponds to the above-described offset type designation information OTI, and is a parameter for designating an offset type for each QAOU. Hereinafter, “sao_type_idx” may be simply referred to as an offset type.
 本実施形態において、“sao_type_idx[sao_curr_depth][ys][xs]”は、「0」から「6」までの整数値をとる。“sao_type_idx[sao_curr_depth][ys][xs]”=0は、対象QAOUにおけるオフセットフィルタ前画像(例えば、後述するデブロック済復号画像P_DB)に対して、オフセットフィルタ処理を行わないことを示す。また、“sao_type_idx[sao_curr_depth][ys][xs]”=1~4は、対象QAOUにおけるオフセットフィルタ前画像に対して、エッジオフセット処理(EO)を行うことを示し、“sao_type_idx[sao_curr_depth][ys][xs]”=5または6は、対象QAOUにおけるオフセットフィルタ前画像に対して、バンドオフセット処理(BO)を行うことを示している。なお、バンドオフセット処理とは、処理対象の画素の画素値の大きさに応じて、当該処理対象画素の画素値に複数のオフセットの何れかを加算する処理のことをいう。また、エッジオフセット処理とは、処理対象の画素の画素値と当該処理対象の画素の周辺の画素の画素値との差分に応じて、当該処理対象画素の画素値に複数のオフセットの何れかを加算する処理のことをいう。エッジオフセット処理およびバンドオフセット処理の具体的内容については後述する。 In this embodiment, “sao_type_idx [sao_curr_depth] [ys] [xs]” takes an integer value from “0” to “6”. “Sao_type_idx [sao_curr_depth] [ys] [xs]” = 0 indicates that the offset filter processing is not performed on the pre-offset filter image (for example, a deblocked decoded image P_DB described later) in the target QAOU. “Sao_type_idx [sao_curr_depth] [ys] [xs]” = 1 to 4 indicates that edge offset processing (EO) is performed on the pre-offset filter image in the target QAOU, and “sao_type_idx [sao_curr_depth] [ys ] [xs] ”= 5 or 6 indicates that band offset processing (BO) is performed on the pre-offset filter image in the target QAOU. 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 the pixel value of the processing target pixel. In addition, the edge offset processing means that any one of a plurality of offsets is added to the pixel value of the processing target pixel according to the difference between the pixel value of the processing target pixel and the pixel values of the pixels around the processing target pixel. Refers to the process of adding. Specific contents of the edge offset process and the band offset process will be described later.
  (sao_offset)
 “sao_offset[sao_curr_depth][ys][xs][i]”は、本実施形態に係る適応オフセットフィルタによるオフセットフィルタ処理において、対象QAOUに含まれる各画素に加算されるオフセットの具体的な値を表すパラメータである。本実施形態では、“sao_offset”のことを単にオフセットと呼称することもある。
(Sao_offset)
“Sao_offset [sao_curr_depth] [ys] [xs] [i]” represents a specific value of the offset added to each pixel included in the target QAOU in the offset filter processing by the adaptive offset filter according to the present embodiment. It is a parameter. In the present embodiment, “sao_offset” may be simply referred to as an offset.
 “sao_offset[sao_curr_depth][ys][xs][i]”は、引数“sao_curr_depth”、“ys”および“xs”に加えて、インデックス“i”によって指定される。ここで、インデックス“i”は、クラスを指定するためのインデックスであり、“class_idx”とも表記する。インデックス“i”は、“sao_type_idx[sao_curr_depth][ys][xs]”の値が「1~4」の何れかである場合(すなわち、エッジオフセットの場合)、“i”=0~4の何れかの整数値をとる。また、“sao_type_idx[sao_curr_depth][ys][xs]”の値が「5または6」である場合(すなわち、バンドオフセットの場合)、“i”=0~16の何れかの整数値をとる。なお、後述するように、何れの場合も“i”=0は、オフセットを加算しないことを表している。 “Sao_offset [sao_curr_depth] [ys] [xs] [i]” is specified by the index “i” in addition to the arguments “sao_curr_depth”, “ys” and “xs”. Here, the index “i” is an index for designating a class, and is also expressed as “class_idx”. Index “i” is “sao_type_idx [sao_curr_depth] [ys] [xs]” when the value is “1 to 4” (that is, an edge offset), and “i” = 0-4 Takes an integer value. Further, when the value of “sao_type_idx [sao_curr_depth] [ys] [xs]” is “5 or 6” (that is, in the case of a band offset), “i” is an integer value of 0 to 16. As will be described later, in any case, “i” = 0 represents that no offset is added.
 後述するように、本実施形態に係る適応オフセットフィルタは、対象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.
 また、図3に示したDescriptor(記述子)“ue(v)”は、この記述子に関連付けられたシンタクスは符号なしの数値であり、値が可変長符号化されることを示しており、“se(v)”は、この記述子に関連付けられたシンタクスは符号付きの数値であり、符号と絶対値に分けて可変長符号化されることを意味し、“ae(v)”は、この記述子に関連づけられたシンタクスが算術符号化を用いて可変長符号化されることを意味している。また、“|”は、いずれかの符号化方法が選択的に用いられることを示している。 Further, the 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)” means that the syntax associated with this descriptor is a signed numerical value, which means that the variable length coding is performed by dividing it into a sign and an absolute value, and “ae (v)” This means that the syntax associated with this descriptor is variable length coded using arithmetic coding. “|” Indicates that any encoding method is selectively used.
 図35には、オフセット情報およびQAOU情報のシンタクスの別の例を示す。 FIG. 35 shows another example of the syntax of offset information and QAOU information.
 図35(a)は、オフセット情報のシンタクスである。図3(a)と同様の構成となっているが、“sao_offset_param()”の引数および、“sao_split_flag”、“sao_type_idx”、“sao_offset”の配列の添字に、色成分を意味する値である“component”が追加されている。これにより、輝度および色差などの色成分毎に異なるQAOU分割を行い、かつ、異なるオフセットを適用することができる。 FIG. 35 (a) shows the syntax of offset information. Although the configuration is the same as that of FIG. 3A, the argument “sao_offset_param ()” and the subscripts of the arrays “sao_split_flag”, “sao_type_idx”, and “sao_offset” are values that represent color components. component ”has been added. Thereby, different QAOU division can be performed for each color component such as luminance and color difference, and different offsets can be applied.
 図35(b)は、QAOU情報のシンタクスである。図35(a)と同じく、図3(b)に引数として色成分“component”を追加したシンタクスである。 FIG. 35 (b) shows the syntax of QAOU information. Similar to FIG. 35A, the syntax is obtained by adding the color component “component” as an argument to FIG. 3B.
 図35(c)は、図35(a)および図35(b)のシンタクスを呼び出す、適応オフセットフィルタ全体のシンタクスである。パラメータ“sao_flag”は適応オフセットフィルタを適用するか否か選択するフラグであり、当該フラグが真である場合のみ、後続の適応オフセットフィルタに関するパラメータが用いられる。当該フラグが真である場合、各色成分に対して、シンタクス“sao_split_param()”および“sao_offset_param()”が最上位階層を指定して呼び出される。最上位階層であるため、各シンタクスに与えられる引数は、sao_curr_depth=0、ys=0、xs=0 である。また、“component”の値は、輝度(Y)の場合は0、色差(Cb)の場合は1、色差(Cr)の場合は2として、各色成分を区別している。なお、componentの値は、処理対象の色成分が区別できれば他の値でもよい。 FIG. 35 (c) shows the syntax of the entire adaptive offset filter that calls the syntaxes of FIGS. 35 (a) and 35 (b). The parameter “sao_flag” is a flag for selecting whether or not to apply the adaptive offset filter. Only when the flag is true, the parameter related to the subsequent adaptive offset filter is used. When the flag is true, the syntax “sao_split_param ()” and “sao_offset_param ()” are called for each color component, specifying the highest layer. Since it is the highest hierarchy, the arguments given to each syntax are sao_curr_depth = 0, ys = 0, and xs = 0. The value of “component” is 0 for luminance (Y), 1 for color difference (Cb), and 2 for color difference (Cr) to distinguish each color component. The value of component may be another value as long as the color component to be processed can be distinguished.
 なお、色差(Cb)および色差(Cr)については、各々に対応するフラグ“sao_flag_cb”、“sao_flag_cr”を用いて、適応オフセットフィルタを適用するか否かを選択し、適用しない場合には当該色成分に対応するQAOU情報およびオフセット情報を格納しない。 For color difference (Cb) and color difference (Cr), select whether or not to apply an adaptive offset filter using the corresponding flags “sao_flag_cb” and “sao_flag_cr”. QAOU information and offset information corresponding to the component are not stored.
 上記の図35のシンタクスでは引数“component”が追加されているため、上記図3を用いた説明において、引数[sao_curr_depth][ys][xs]を[sao_curr_depth][ys][xs][component]に置き換えて処理する。以降の説明でも同様である。 Since the argument “component” is added to the syntax shown in FIG. 35, the argument [sao_curr_depth] [ys] [xs] is changed to [sao_curr_depth] [ys] [xs] [component] in the description using FIG. Replace with and process. The same applies to the following description.
 (動画像復号装置1)
 次に、本実施形態に係る動画像復号装置1について、図1および図5~図13を参照して説明する。動画像復号装置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 moving picture decoding apparatus 1 according to the present embodiment will be described with reference to FIG. 1 and FIGS. The moving picture decoding apparatus 1 includes H. 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を復号することによって動画像#2を生成するための装置である。 FIG. 5 is a block diagram showing a configuration of the moving picture decoding apparatus 1. As illustrated in FIG. 5, the video decoding device 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 # 2 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からQAOU情報を抽出し、抽出したQAOU情報を適応オフセットフィルタ60に供給する。 The variable length code decoding unit 13 decodes the prediction parameter PP related to 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 size of the partition 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 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 related to each inter prediction partition from the motion vector residual MVD related to that partition and the restored motion vector mv ′ related to another partition. 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 generation unit 16 generates a motion compensation image mc related to 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 subjected to 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 decoded image P that has already been decoded. It is an image obtained by applying. 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) weighting between the motion compensated image mc1 and the motion compensated image mc2 An inter predicted image Pred_Inter is generated by adding an offset value to the average.
 イントラ予測画像生成部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, the prediction mode decoded from the encoded data # 1 is referred to, and the prediction mode is assigned to the target partition in, for example, raster scan order. Subsequently, a predicted image Pred_Intra is generated from the decoded image P 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 the adaptive filter 50 with intra coding mode information IEM, which is information indicating the size of the target partition and the prediction mode assigned to the target partition.
 予測方式決定部18は、CU情報に基づいて、各パーティションがインター予測を行うべきインター予測パーティションであるのか、イントラ予測を行うべきイントラ予測パーティションであるのかを決定する。そして、前者の場合には、インター予測画像生成部16にて生成されたインター予測画像Pred_Interを予測画像Predとして加算器20に供給し、後者の場合には、イントラ予測画像生成部17にて生成されたイントラ予測画像Pred_Intraを予測画像Predとして加算器20に供給する。 The prediction method determination unit 18 determines whether each partition is an inter prediction partition for performing inter prediction or an intra prediction partition for performing intra prediction based on the CU information. 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係数を逆DCT(Discrete Cosine Transform)変換し、(3)逆DCT変換によって得られた予測残差Dを加算器20に供給する。なお、量子化予測残差QDを逆量子化する際に、逆量子化・逆変換部19は、可変長符号復号部13から供給された量子化パラメータ差分Δqpから量子化ステップQPを導出する。量子化パラメータqpは、直前に逆量子化/逆DCT変換したツリーブロックに関する量子化パラメータqp’に量子化パラメータ差分Δqpを加算することによって導出でき、量子化ステップQPは、量子化ステップqpからQP=2pq/6によって導出できる。また、逆量子化・逆変換部19による予測残差Dの生成は、ブロック(変換単位)を単位として行われる。 The inverse quantization / inverse transform unit 19 (1) inversely quantizes the quantized prediction residual QD, (2) performs inverse DCT (Discrete Cosine Transform) transform on the DCT coefficient obtained by the inverse quantization, and (3) The prediction residual D obtained by the inverse DCT transform is supplied to the 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 just undergone inverse quantization / inverse DCT transformation, and the quantization step QP is performed from the quantization step qp to QP. = 2 pq / 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 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 transformation unit 19.
 デブロッキングフィルタ41は、復号画像Pにおけるブロック境界、またはCU境界を介して互いに隣接する画素の画素値の差が予め定められた閾値よりも小さい場合に、復号画像Pにおける当該ブロック境界、または当該CU境界に対してデブロッキング処理を施すことによって、当該ブロック境界、または当該CU境界付近の画像の平滑化を行う。デブロッキングフィルタ41によりデブロッキング処理が施された画像は、デブロック済復号画像P_DBとして、適応オフセットフィルタ60に出力される。 The deblocking filter 41 determines that the block boundary in the decoded image P or the block boundary in the decoded image P when the difference between the pixel values of pixels adjacent to each other via the block boundary in the decoded image P or the CU boundary is smaller than a predetermined threshold value. By performing deblocking processing on the CU boundary, an image near the block boundary or the vicinity of 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を生成する。適応フィルタ50によりフィルタ処理が施された画像は、フィルタ済復号画像P_FLとして外部に出力されると共に、可変長符号復号部13によって符号化データから復号されたPOC指定情報と関連付けてバッファメモリ15に格納される。 The adaptive filter 50 performs a filtering process using the filter parameter FP decoded from the encoded data # 1 on the offset filtered decoded image P_OF supplied from the adaptive offset filter 60, thereby obtaining a filtered decoded image P_FL. Is generated. The image that has been filtered by the adaptive filter 50 is output to the outside as a filtered decoded image P_FL, and is associated with the POC designation information decoded from the encoded data by the variable length code decoding unit 13 in the buffer memory 15. Stored.
 (適応オフセットフィルタ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.
 また、図1に示すように、適応オフセットフィルタ情報復号部61は、オフセット情報復号部611、およびQAOU構造復号部612を含む構成である。 Further, 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[sao_curr_depth][ys][xs][component]”および“sao_offset[sao_curr_depth][ys][xs][i]”の各値を、それぞれの引数(sao_curr_depth、ys、xs)および(sao_curr_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, each value of “sao_type_idx [sao_curr_depth] [ys] [xs] [component]” and “sao_offset [sao_curr_depth] [ys] [xs] [i]” obtained by decoding the offset information OI is respectively Are supplied to the offset information storage unit 621 in association with the arguments (sao_curr_depth, ys, xs) and (sao_curr_depth, ys, xs, i).
 より詳細には、オフセット情報復号部611は、符号化データ#1からコードを復号し、復号したコードを“sao_type_idx”の値に変換して、引数に関連付けてオフセット情報格納部621に供給する。ここで、オフセット情報復号部611は、コードの復号方法、およびコードから“sao_type_idx”の値への変換を、処理対象のQAOUの階層の深度によって変更している。このQAOUの階層の深度などの条件をパラメータ条件と呼ぶ。一般のパラメータ条件に応じたオフセット情報の復号については、図32、図33を用いて後述する。 More specifically, the offset information decoding unit 611 decodes the code from the encoded data # 1, converts the decoded code into a value of “sao_type_idx”, 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 and the conversion from the code to the value of “sao_type_idx” according to the depth of the QAOU hierarchy to be processed. Conditions such as the depth of the QAOU hierarchy are called parameter conditions. Decoding of offset information according to general parameter conditions will be described later with reference to FIGS. 32 and 33.
 コードの復号方法は、処理対象のQAOUの階層の深度が閾値よりも小さい場合と処理対象のQAOUの階層の深度が閾値以上の場合とで、異なる最大値を用いて行うものであってもよいし、処理対象のQAOUの階層の深度が閾値以上の場合のみ最大値を用いるものであってもよい。また、処理対象のQAOUの階層の深度が閾値よりも小さい場合と処理対象のQAOUの階層の深度が閾値以上の場合とで、異なるバイナリゼーションを用いて行うものであってもよい。さらに、処理対象のQAOUの階層の深度が閾値よりも小さい場合と処理対象のQAOUの階層の深度が閾値以上の場合とで、異なるコンテキストを用いるものであってもよい。 The code decoding method may be performed using different maximum values when the depth of the QAOU hierarchy to be processed is smaller than the threshold and when the depth of the QAOU hierarchy to be processed is greater than or equal to the threshold. However, the maximum value may be used only when the depth of the QAOU hierarchy to be processed is equal to or greater than a threshold value. Further, different binarization may be used when the depth of the QAOU hierarchy to be processed is smaller than the threshold and when the depth of the QAOU hierarchy to be processed is greater than or equal to the threshold. Further, different contexts may be used depending on whether the depth of the QAOU hierarchy to be processed is smaller than the threshold value and the depth of the QAOU hierarchy to be processed is greater than or equal to the threshold value.
 例えば、処理対象のQAOUの階層の深度が閾値よりも小さい場合には、可変長符号化(ue(v))でコードを復号し、処理対象のQAOUの階層の深度が閾値以上の場合には、オフセットタイプの数に応じたtruncated符号化(te(v))で、コードを復号してもよい。また、オフセットタイプ数が、2のべき乗であれば、固定長符号化で、コードを復号してもよい。オフセットタイプ数が4つであれば、2bitで表現可能であるので、2bitで固定長符号化とすることができる。 For example, when the depth of the QAOU layer to be processed is smaller than the threshold, the code is decoded by variable length coding (ue (v)), and when the depth of the QAOU layer to be processed is equal to or greater than the threshold The code may be decoded by truncated coding (te (v)) according to the number of offset types. If the number of offset types is a power of 2, the code may be decoded by fixed length coding. If the number of offset types is four, it can be expressed in 2 bits, and can be fixed-length encoded in 2 bits.
 また、オフセット情報復号部611は、復号したコードから“sao_type_idx”の値への変換を、図8に示すような変換テーブル801および変換テーブル802を用いて行う。図8(a)の変換テーブル801では、2通りの変換パターンを示している。この2通りの変換パターンは、処理対象のQAOUの階層の深度によって、使い分けられる。すなわち、オフセット情報復号部611は、処理対象のQAOUの階層の深度が、閾値よりも小さい場合は、変換テーブル801Aを用い、処理対象のQAOUの階層の深度が、閾値以上の場合は、変換テーブル801Bを用いる。 Also, the offset information decoding unit 611 converts the decoded code into the value “sao_type_idx” using the conversion table 801 and the conversion table 802 as shown in FIG. The conversion table 801 in FIG. 8A shows two conversion patterns. These two types of conversion patterns are properly used depending on the depth of the QAOU hierarchy to be processed. That is, the offset information decoding unit 611 uses the conversion table 801A when the depth of the QAOU hierarchy to be processed is smaller than the threshold value, and uses the conversion table when the depth of the QAOU hierarchy to be processed is equal to or greater than the threshold value. 801B is used.
 図8(a)の変換テーブル801Aでは、コード「1」に対しオフセットタイプ「EO_0」(“sao_type_idx”=1)が対応付けられており、コード「2」に対しオフセットタイプ「EO_1」(“sao_type_idx”=2)が対応付けられており、コード「3」に対しオフセットタイプ「EO_2」(“sao_type_idx”=3)が対応付けられている。以下、コード4~6についても同様である。 In the conversion table 801A of FIG. 8A, 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) is associated, and 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.
 また、図8(a)の変換テーブル801Bでは、コード「1」に対しオフセットタイプ「EO_0」(“sao_type_idx”=1)が対応付けられており、コード「2」に対しオフセットタイプ「BO_0」(“sao_type_idx”=5)が対応付けられており、コード「3」に対しオフセットタイプ「BO_1」(“sao_type_idx”=6)が対応付けられている。そして、変換テーブル801Bでは、コード4~6は用いられていない。 Also, in the conversion table 801B of FIG. 8A, 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 “BO — 0” ( “Sao_type_idx” = 5) is associated, and the offset type “BO_1” (“sao_type_idx” = 6) is associated with the code “3”. In the conversion table 801B, the codes 4 to 6 are not used.
 このように、変換テーブル801Aでは、適応オフセット(SAO)に用いるオフセットタイプの全てが含まれているのに対し、変換テーブル801Bでは、適応オフセット(SAO)に用いるオフセットタイプのうち、一部のオフセットタイプしか含まれていない。よって、処理対象のQAOUの階層の深度が、閾値以上の場合には、一部のオフセットタイプしか用いることができないことになる。 As described above, the conversion table 801A includes all the offset types used for the adaptive offset (SAO), whereas the conversion table 801B includes a part of the offset types used for the adaptive offset (SAO). Only type is included. Therefore, if the depth of the QAOU hierarchy to be processed is greater than or equal to the threshold value, only some offset types can be used.
 これは、深い階層では、QAOUの面積が小さくなるため、QAOU内の画素値の特性が一様に近くなり、多くのタイプを用いなくとも、適切なオフセットを導出できるためである。また、これにより、用いるオフセットタイプ数を減らすことができるので、必要なメモリ量を減らすことができるとともに、オフセットタイプを示す符号化データのデータ長等を短くすることにより、符号化効率を向上させることができる。 This is because, in a deep hierarchy, since the area of the QAOU is small, the characteristics of the pixel values in the QAOU are nearly uniform, and an appropriate offset can be derived without using many types. In addition, since the number of offset types to be used can be reduced, the required amount of memory can be reduced and the encoding efficiency can be improved by shortening the data length of the encoded data indicating the offset type. be able to.
 なお、変換テーブル801Bにおけるコードとオフセットタイプとの対応付けが、変換テーブル801Aにおけるコードとオフセットタイプとの対応付けの順序と同じなのであれば、変換テーブル801Aのみを用いる構成であってもよい。 Note that if the correspondence between the code and the offset type in the conversion table 801B is the same as the correspondence order of the code and the offset type in the conversion table 801A, only the conversion table 801A may be used.
 図8(b)の変換テーブル802は、変換テーブル801Bに代えて用いることができる、変換テーブル801Bと同様な変換テーブルの種々の例を示している。いずれの変換テーブルも、変換テーブル801B同様にタイプの種類が制限されている。また、空欄は該当するコードが用いられないことを示す。 8B shows various examples of conversion tables similar to the conversion table 801B that can be used in place of the conversion table 801B. As with the conversion table 801B, the type of each conversion table is limited. A blank indicates that the corresponding code is not used.
 変換テーブル802Aは、エッジオフセットのみを用いる例でありバンドオフセットを含まない。エッジオフセットのオフセット数は通常4個であり、バンドオフセットのオフセット数は通常16個である。このように、エッジオフセットのオフセット数はバンドオフセットのオフセット数と比べ少ない。このため、バンドオフセットの使用を制限することにより、オフセットの保持に用いるメモリ量を削減することができる。特に、階層が深い場合、オフセットが増加するためメモリ量が大きくなる。また、階層が深い場合には、バンドオフセットの選択率が低下する。そのため、階層をパラメータ条件として、階層が深い場合にエッジオフセットのみを備える変換テーブル802Aを用い、階層が浅い場合には、エッジオフセットとバンドオフセットを備える変換テーブル(例えば801A)を用いることによって、符号化効率を低下させることなくメモリ量の削減が可能となる。また、符号化装置において不要な選択肢のコスト計算を省くことができるため処理量を低減することができる。 The conversion table 802A is an example using only an edge offset and does not include a band offset. The number of edge offsets is usually four, and the number of band offsets is usually sixteen. Thus, the number of edge offsets is smaller than the number of band offsets. For this reason, by limiting the use of the band offset, the amount of memory used for holding the offset can be reduced. In particular, when the hierarchy is deep, the amount of memory increases because the offset increases. In addition, when the hierarchy is deep, the selectivity of the band offset decreases. Therefore, by using the conversion table 802A having only the edge offset when the hierarchy is deep and using the conversion table (for example, 801A) having the edge offset and the band offset when the hierarchy is shallow, using the conversion table 802A as the parameter condition, The amount of memory can be reduced without reducing the efficiency. Further, since it is possible to omit the cost calculation of unnecessary options in the encoding device, the processing amount can be reduced.
 変換テーブル802Bは、バンドオフセットのみを用いる例でありエッジオフセットを含まない。バンドオフセットはエッジオフセットに比べ、演算量が小さいこと、対象画素の周囲の画素を用いないため参照画素を保持するためのラインメモリなどが不要である、という特徴を有する。そのため、パラメータ条件に応じて、変換テーブル802Bを用いることで、上記による効果を得ることができる。変換テーブル802Cは、1つのバンドオフセット「BO_0」(“sao_type_idx”=5)のみを用いる例である。 The conversion table 802B is an example using only a band offset and does not include an edge offset. The band offset is characterized in that the amount of calculation is smaller than that of the edge offset, and a line memory or the like for holding the reference pixel is unnecessary because the pixels around the target pixel are not used. Therefore, the above-described effects can be obtained by using the conversion table 802B according to the parameter conditions. The conversion table 802C is an example in which only one band offset “BO — 0” (“sao_type_idx” = 5) is used.
 また、変換テーブル802Dは、変換テーブル801Bと同様に1つのエッジオフセットと2つのバンドオフセットを用いる例である。具体的には、オフセットタイプ「EO_0」(“sao_type_idx”=1)および「BO_0」(“sao_type_idx”=5)、「BO_1」(“sao_type_idx”=6)を用い、バンドオフセットタイプに優先的に短いコード(小さいコード番号)を対応付けた例である。階層が浅い場合は、階層が深い場合に比べバンドオフセットの選択率が高くなるため、階層をパラメータ条件として、階層が浅い場合に変換テーブル802Dを用い、使用頻度の高いタイプに短いコードに対応付けることで、符号化効率を向上させることができる。 Also, the conversion table 802D is an example using one edge offset and two band offsets as in the conversion table 801B. Specifically, the offset type “EO — 0” (“sao_type_idx” = 1), “BO — 0” (“sao_type_idx” = 5), “BO — 1” (“sao_type_idx” = 6) is used, and the band offset type is preferentially short. This is an example in which codes (small code numbers) are associated. When the hierarchy is shallow, the band offset selection rate is higher than when the hierarchy is deep. Therefore, with the hierarchy as a parameter condition, the conversion table 802D is used when the hierarchy is shallow, and a frequently used type is associated with a short code. Thus, encoding efficiency can be improved.
 なお、図8に例示した以外にも、パラメータ条件に応じて、コードとオフセットタイプとの対応付けを変更することが可能である。変換テーブル801Aのいずれのエッジオフセットともバンドオフセットとも異なるオフセットタイプを、階層深度などの条件に応じて単独あるいは他のオフセットタイプとともに使用できる。その具体例としては、後述の別の実施形態において説明する、EOとBOの特徴を併せ持つオフセットタイプや、従来のエッジオフセット「EO_0」と異なる水平サンプル位置でエッジを検出するエッジオフセットや、従来のバンドオフセット「BO_0」および「BO_1」とは異なるバンド割り当てによるバンドオフセットが挙げられる。 In addition to the example illustrated in FIG. 8, it is possible to change the association between the code and the offset type according to the parameter condition. An offset type different from any edge offset and band offset of the conversion table 801A can be used alone or in combination with other offset types depending on conditions such as hierarchical depth. Specific examples thereof include an offset type having both EO and BO characteristics, an edge offset that detects an edge at a horizontal sample position different from the conventional edge offset “EO_0”, A band offset by band allocation different from the band offsets “BO — 0” and “BO — 1” can be mentioned.
 QAOU構造復号部612は、QAOU情報に含まれている“sao_split_flag[sao_curr_depth][ys][xs]”を復号することによって、QAOUの分割構造を決定し、決定されたQAOUの分割構造を表すQAOU構造情報を、オフセット情報格納部621に供給する。 The QAOU structure decoding unit 612 determines the QAOU partition structure by decoding “sao_split_flag [sao_curr_depth] [ys] [xs]” included in the QAOU information, and indicates the determined QAOU partition structure. The structure information is supplied to the offset information storage unit 621.
 また、次に示すようなオフセット属性設定部613を備えていてもよい。オフセット属性設定部613は、オフセットのシフト値を決定する。符号化データのオフセットは、画素ビット深度(PIC_DEPTHとも呼称する)よりも精度の低いオフセットのビット深度(SAO_DEPTHとも呼称する)で符号化される。すなわち、符号化データ中のオフセットは、量子化されている。シフト値とは、逆量子化を行うために必要なビットシフト量を示す。また、オフセット属性設定部613は、オフセットのビット深度とオフセットの値域とを決定する。ここでは、オフセットのビット深度は、オフセット属性設定部613に入力される図示されない画素ビット深度(PIC_DEPTHとも呼称する)から決定される。画素ビット深度とは、適応オフセットフィルタ60の入力画像を構成する画素値の値域をビット幅で示すものであり、画素ビット深度がNビットのとき、画素値は0から2N-1の範囲を取る。 Further, an offset attribute setting unit 613 as shown below may be provided. The offset attribute setting unit 613 determines an offset shift value. The offset of the encoded data is encoded with an offset bit depth (also referred to as SAO_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. The shift value indicates a bit shift amount necessary for performing inverse quantization. Also, the offset attribute setting unit 613 determines the offset bit depth and the offset value range. Here, the bit depth of the offset is determined from a pixel bit depth (also referred to as PIC_DEPTH) (not shown) input to the offset attribute setting unit 613. The pixel bit depth indicates the range of pixel values constituting the input image of the adaptive offset filter 60 in terms of bit width. When the pixel bit depth is N bits, the pixel value ranges from 0 to 2N−1. .
 SAOのビット深度およびシフト値は、以下の式を用いるが、後述するように、パラメータ条件に応じて他の値を用いても良い。 The SAO bit depth and shift value use the following equations, but other values may be used according to the parameter conditions, as will be described later.
 SAO_DEPTH = MIN(PIC_DEPTH、10)
 シフト値 = PIC_DEPTH―MIN(PIC_DEPTH、10)
 また、量子化オフセットの値域を以下の式で決定する。
SAO_DEPTH = MIN (PIC_DEPTH, 10)
Shift value = PIC_DEPTH-MIN (PIC_DEPTH, 10)
The quantization offset value range is determined by the following equation.
 また、図1に示すように、適応オフセットフィルタ処理部62は、オフセット情報格納部621、QAOU制御部622、オフセットタイプ導出部623、クラス分類部624、オフセット導出部625、およびオフセット加算部626を含む構成である。 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 derivation unit 625, and an offset addition unit 626. It is the composition which includes.
 オフセット情報格納部621は、QAOU構造情報、“sao_type_idx[sao_curr_depth][ys][xs]”、および“sao_offset[sao_curr_depth][ys][xs][i]”に基づいて、各QAOUについて指定されたオフセットタイプ、および該オフセットタイプにおいて選択可能な各クラスに関するオフセットの具体的な値を管理および格納するものであり、マップメモリおよびリストメモリを備えた構成である。 The offset information storage unit 621 is designated for each QAOU based on the QAOU structure information, “sao_type_idx [sao_curr_depth] [ys] [xs]”, and “sao_offset [sao_curr_depth] [ys] [xs] [i]”. It manages and stores an offset type and a specific value of an offset relating to each class selectable in the offset type, and has a map memory and a list memory.
 マップメモリ、およびリストメモリについて、図6を参照して説明する。図6は、マップメモリおよびリストメモリに格納される例を示す図であり、図6(a)はマップメモリに格納されるQAOUインデックスの一例を説明するための図であり、図6(b)はリストメモリに格納される情報の一例を説明するための図である。 The map memory and list memory will be described with reference to FIG. FIG. 6 is a diagram illustrating an example stored in the map memory and the list memory. FIG. 6A is a diagram for explaining an example of the QAOU index stored in the map memory, and FIG. FIG. 4 is a diagram for explaining an example of information stored in a list memory.
 マップメモリ601には、分割深度に応じて定まる各オフセット最小単位(QAOMU:Quad Adaptive Offset Minimum Unitとも呼称する)に割り付けられた後述するQAOUインデックスが格納されている。図6(a)では、対象の処理単位(例えばLCU)を構成する分割深度3の各QAOMUと各QAOMUに割り付けられたQAOUインデックスとを示している。なお、図6(a)では、QAOUの分割深度を考慮せずに、簡易的にインデックス0~9をQAOUに割り付けている。また、図6(a)に示す例においては、QAOUインデックス=Iによって指定されるQAOUをQAOUIと表記している。また、図6(a)における細線はQAOMUの境界を示しており、太線はQAOUの境界を示している。 The map memory 601 stores a QAOU index, which will be described later, assigned to each offset minimum unit (also referred to as QAOMU: Quad-Adaptive-Offset-Minimum Unit) determined according to the division depth. FIG. 6A shows each QAOMU having a division depth of 3 that constitutes a target processing unit (for example, LCU) and the QAOU index assigned to each QAOMU. In FIG. 6A, indexes 0 to 9 are simply assigned to QAOUs without considering the QAOU division depth. In the example shown in FIG. 6A, the QAOU specified by QAOU index = I is expressed as QAOUI. Further, the thin line in FIG. 6A indicates the QAOMU boundary, and the thick line indicates the QAOU boundary.
 図6(a)に示すように、QAOU0は、4つのQAOMUから構成されており、これら4つのQAOMUには、QAOUインデックスとして0が割り付けられている。一方、QAOU3は、1つのQAOMUから構成されており、このQAOMUには、QAOUインデックスとして3が割り付けられている。このように、マップメモリには、各QAOMUに割り付けられたQAOUインデックスが格納されている。 As shown in FIG. 6A, QAOU0 is composed of four QAOMUs, and 0 is assigned to these four QAOMUs as QAOU indexes. 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. .
 具体的に、図6(b)を参照して説明する。図6(b)では、QAOUインデックス0~9の各々に関連付けられたオフセットタイプおよび各オフセットタイプにおいて選択可能な各クラスに関するオフセットを示している。図6(b)における「xxx」は、互いに異なり得る具体的な数値を表している。 Specifically, description will be made with reference to FIG. FIG. 6B 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. 6B represents specific numerical values that may be different from each other.
 また、図6(b)における「BO_1」は、“sao_type_idx”=5によって指定されるオフセットタイプを表している。また、「EO_1」は、“sao_type_idx”=1によって指定されるオフセットタイプを表している。このように、“sao_type_idx”=1、2、3、4によって指定されるオフセットタイプであるエッジオフセットをそれぞれ「EO_1、2、3、4」とも表記し、“sao_type_idx”=5、6によって指定されるオフセットタイプであるバンドオフセットをそれぞれ「BO_1、2」とも表記する。 In addition, “BO_1” in FIG. 6B represents an offset type specified by “sao_type_idx” = 5. “EO_1” represents an offset type designated by “sao_type_idx” = 1. In this way, the edge offset that is the offset type specified by “sao_type_idx” = 1, 2, 3, 4 is also expressed as “EO_1, 2, 3, 4”, and “sao_type_idx” = 5,6. The band offsets that are offset types are also referred to as “BO_1, 2”.
 図6(b)に示すように、オフセットタイプがバンドオフセットである場合、該オフセットタイプに関してリストメモリに格納されるオフセットは、オフセット1~オフセット16の合計16個である。ここで、オフセット1~オフセット16は、“sao_type_idx[sao_curr_depth][ys][xs]”の値が「5」または「6」である場合の、“sao_offset[sao_curr_depth][ys][xs][1]”~“sao_offset[sao_curr_depth][ys][xs][16]”によってそれぞれ指定される値のことを指す。 As shown in FIG. 6B, when the offset type is a band offset, the offset stored in the list memory with respect to the offset type is 16 offsets 1 to 16 in total. Here, the offset 1 to the offset 16 are “sao_offset [sao_curr_depth] [ys] [xs] [1] when the value of“ sao_type_idx [sao_curr_depth] [ys] [xs] ”is“ 5 ”or“ 6 ”. ] ”To“ sao_offset [sao_curr_depth] [ys] [xs] [16] ”.
 一方、オフセットタイプがエッジオフセットである場合、該オフセットタイプに関してリストメモリに格納されるオフセットは、オフセット1~4の合計4個である。ここで、オフセット1~4は、“sao_type_idx[sao_curr_depth][ys][xs]”の値が「1、2、3、4」の何れかである場合の、“sao_offset[sao_curr_depth][ys][xs][1]”~“sao_offset[sao_curr_depth][ys][xs][4]”によってそれぞれ指定される値のことを指す。なお、エッジオフセットの場合、オフセット5~16にはなにも格納されない。 On the other hand, when the offset type is an edge offset, the offset stored in the list memory for the offset type is a total of four offsets 1 to 4. Here, the offsets 1 to 4 are “sao_type_idx [sao_curr_depth] [ys] [xs]” when the value is “1, 2, 3, 4” or “sao_offset [sao_curr_depth] [ys] [ys] [ xs] [1] ”to“ sao_offset [sao_curr_depth] [ys] [xs] [4] ”. In the case of an edge offset, nothing is stored in the offsets 5 to 16.
 なお、各QAOMUには、QAOMU番号が付されており、このQAOMU番号によって各QAOMUは互いに識別可能である。以下では、QAOMU番号がNQであるQAOMUをQAOMUNQとも表記する。 Each QAOMU is assigned a QAOMU number, and the QAOMU numbers can be distinguished from each other by the QAOMU number. Hereinafter, a QAOMU whose QAOMU number is N Q will also be referred to as QAOMUN Q.
 また、本実施形態では、処理対象のQAOUの階層によって、オフセットの精度を異ならせるものであってもよい。オフセットの精度に応じて、逆量子化に用いるシフト値も異なる。この場合も、オフセットの精度及びシフト値は、画素ビット深度PIC_DEPTHを用いて導出する。 In the present embodiment, the accuracy of the offset may be varied depending on the QAOU hierarchy to be processed. Depending on the accuracy of the offset, the shift value used for inverse quantization also differs. In this case as well, the offset accuracy and shift value are derived using the pixel bit depth PIC_DEPTH.
 オフセットの精度の例としては、例えば、QAOUの階層の深度が閾値より小さい場合のオフセットの精度、シフト値を、
 SAO_DEPTH = MIN(PIC_DEPTH、10)
 シフト値 = PIC_DEPTH―MIN(PIC_DEPTH、10)
として、QAOUの階層の深度が閾値以上である場合のオフセットの精度を、
 SAO_DEPTH = MIN(PIC_DEPTH、8)
 シフト値 = PIC_DEPTH―MIN(PIC_DEPTH、8)
のようにすれば、オフセットの精度を異なるものとすることができる。
As an example of the accuracy of the offset, for example, the accuracy of the offset and the shift value when the depth of the QAOU hierarchy is smaller than the threshold,
SAO_DEPTH = MIN (PIC_DEPTH, 10)
Shift value = PIC_DEPTH-MIN (PIC_DEPTH, 10)
The accuracy of the offset when the depth of the QAOU hierarchy is greater than or equal to the threshold value,
SAO_DEPTH = MIN (PIC_DEPTH, 8)
Shift value = PIC_DEPTH-MIN (PIC_DEPTH, 8)
In this way, the offset accuracy can be made different.
 一般に、オフセットの精度(オフセットのビット深度、SAO_DEPTH)と、入力画像を構成する画素値の値域をビット幅で表現した画素ビット深度(PIC_DEPTH)とは、量子化誤差の観点で互いに密接な関係がある。適応オフセットフィルタ60の出力画像のビット深度は、画素ビット深度PIC_DEPTHであり、SAO_DEPTHは画素に加えるオフセットのビット深度である。したがって、画素ビット深度を超える精度のオフセットを用いても、当該オフセットは出力過程で捨てられてしまい、SAO_DEPTHをPIC_DEPTHを超えて設定しても意味がない。逆に、SAO_DEPTHがPIC_DEPTHよりも小さい場合には、入力画像をフィルタにより補正可能な精度(PIC_DEPTH)よりも粗い補正しか行うことができないため、フィルタ効果は減少する。 In general, the accuracy of offset (offset bit depth, SAO_DEPTH) and the pixel bit depth (PIC_DEPTH) in which the range of pixel values constituting an input image is expressed in bit width are closely related to each other in terms of quantization error. is there. The bit depth of the output image of the adaptive offset filter 60 is the pixel bit depth PIC_DEPTH, and SAO_DEPTH is the bit depth of the offset added to the pixel. Therefore, even if an offset with an accuracy exceeding the pixel bit depth is used, the offset is discarded in the output process, and it does not make sense to set SAO_DEPTH to exceed PIC_DEPTH. On the other hand, when SAO_DEPTH is smaller than PIC_DEPTH, only the correction that is coarser than the accuracy (PIC_DEPTH) that can correct the input image by the filter can be performed, so that the filter effect is reduced.
 したがって、量子化されたオフセットを一定のビット幅で表現できるオフセット値域に制限することで、オフセット情報格納部621で量子化されたオフセットを格納するためのビット幅を制限することができる。これにより、制限しない場合と比較して、メモリサイズ削減の効果を得ることができる。一方で、過度にオフセット値域を狭くすることは、オフセットが復号画像の歪みを補正する効果を小さくしてしまい、オフセット加算処理によっても復号画像の歪みを除去することができず、符号化効率が低下してしまう。 Therefore, by limiting the quantized offset to an offset value range that can be expressed with a constant bit width, the bit width for storing the offset quantized by the offset information storage unit 621 can be limited. Thereby, compared with the case where it does not restrict | limit, the effect of memory size reduction can be acquired. On the other hand, if the offset value range is excessively narrowed, the offset reduces the effect of correcting the distortion of the decoded image, and the distortion of the decoded image cannot be removed even by the offset addition process. It will decline.
 そこで、符号化効率が低下しないようにオフセット値域を最適な範囲を設定することにより、メモリの使用量を削減しつつ、フィルタの効果を維持することできる。 Therefore, by setting an optimum range of the offset value range so that the encoding efficiency does not decrease, it is possible to maintain the filter effect while reducing the amount of memory used.
 そして、オフセット値域の値を表す最大のビット長をCLIP_BITとし、CLIP_BIT=SAO_DEPTH-Kの計算により、オフセット値域を-2CLIP_BIT-1~2CLIP_BIT-1-1と定めた場合に、発明者の実験によれば、K=4とすると、オフセット値域によりオフセットの範囲を制限しても符号化効率の低下がないことが発見された。 When the maximum bit length representing the value of the offset value range is CLIP_BIT and the offset value range is defined as -2 CLIP_BIT-1 to 2 CLIP_BIT-1 -1 by CLIP_BIT = SAO_DEPTH-K, the inventor's experiment According to the above, it has been found that when K = 4, there is no reduction in coding efficiency even if the offset range is limited by the offset value range.
 そして、画素ビット深度=8の場合、オフセットのビット深度SAO_DEPTHも8であり、CLIP_BIT=8-K=4となる。1つのオフセットが4ビットで格納できることは、8ビットのバイトを単位として扱うソフトウェア等で、1バイトに1つのオフセットをパッキングして格納することが可能であり、簡易にメモリサイズの削減が可能となる。 When the pixel bit depth = 8, the offset bit depth SAO_DEPTH is 8 and CLIP_BIT = 8−K = 4. The fact that one offset can be stored in 4 bits means that one offset can be packed and stored in one byte by software that handles 8 bit bytes as a unit, and the memory size can be reduced easily. Become.
 そして、設定されるオフセットの精度が、処理対象のQAOUの階層によって異なる場合、オフセット情報格納部621は、処理対象のQAOUの階層の深度に応じてオフセット格納領域の単位サイズを切り換えて確保している。 If the accuracy of the set offset varies depending on the QAOU hierarchy to be processed, the offset information storage unit 621 switches and secures the unit size of the offset storage area according to the depth of the QAOU hierarchy to be processed. Yes.
 具体的には、処理対象のQAOUの階層の深度が閾値より小さい場合のオフセットの精度がnビット(例えば、n=8または6)、処理対象のQAOUの階層の深度が閾値以上の場合のオフセットの精度がnビット(n>n、例えば、n=n-2)に設定されているとき、オフセット情報格納部621は、処理対象のQAOUの階層の深度が閾値より小さい場合のオフセットを格納する領域をnビット単位で確保し、処理対象のQAOUの階層の深度が閾値以上の場合のオフセットを格納する領域をnビット単位で確保している。 Specifically, when the depth of the QAOU hierarchy to be processed is smaller than the threshold, the offset accuracy is n A bits (for example, n A = 8 or 6), and the depth of the QAOU hierarchy to be processed is greater than or equal to the threshold. Is set to n B bits (n A > n B , for example, n B = n A −2), the offset information storage unit 621 determines that the depth of the processing target QAOU is greater than the threshold value. An area for storing an offset when it is small is secured in n A bit units, and an area for storing an offset when the depth of the QAOU hierarchy to be processed is equal to or greater than a threshold is secured in n B bit units.
 なお、処理対象のQAOUの階層の深度が閾値以上の場合は、オフセット情報格納部621に対して、オフセットの読み書きを行うときに、書き込み時は(n-n)ビット切り下げ、読み出し時は(n-n)ビット切り上げて入出力を行う構成が好ましい。この構成によれば、他のモジュールにおいてオフセットの精度の差を考慮して処理を行う必要がなくなるためである。 When the depth of the QAOU layer to be processed is equal to or greater than the threshold, when performing offset read / write to the offset information storage unit 621, (n A −n B ) bits are rounded down and read A configuration in which (n A −n B ) bits are rounded up and input / output is preferable. This is because it is not necessary to perform processing in consideration of the difference in offset accuracy in other modules.
 また、オフセット情報格納部621は、処理対象のQAOUの階層の深度に応じて、必要なクラス数が変わる場合、必要なクラス数に合わせて、確保するリストメモリの領域を切り換える。例えば、後述するように、処理対象のQAOUの階層の深度が閾値より小さい場合は16クラスに分類され、処理対象のQAOUの階層の深度が閾値以上となる場合は8クラスに分類されるバンドオフセットの場合を考える。この場合、処理対象のQAOUの階層の深度が閾値以上となる場合のクラスの確保に必要なメモリの容量は、処理対象のQAOUの階層の深度が閾値より小さい場合の半分となる。そこで、オフセット情報格納部621は、処理対象のQAOUの階層の深度が閾値以上となる場合に確保するリストメモリの大きさを、処理対象のQAOUの階層の深度が閾値より小さい場合の半分に切り換える。 Also, the offset information storage unit 621 switches the area of the list memory to be secured according to the required number of classes when the required number of classes changes according to the depth of the QAOU hierarchy to be processed. For example, as will be described later, the band offset is classified into 16 classes when the depth of the QAOU hierarchy to be processed is smaller than the threshold, and is classified into 8 classes when the depth of the QAOU hierarchy to be processed is equal to or greater than the threshold. Consider the case. In this case, the memory capacity necessary for securing the class when the depth of the QAOU hierarchy to be processed is equal to or greater than the threshold is half that when the depth of the QAOU hierarchy to be processed is smaller than the threshold. Therefore, the offset information storage unit 621 switches the size of the list memory to be secured when the depth of the QAOU hierarchy to be processed is equal to or greater than the threshold to half that when the depth of the QAOU hierarchy to be processed is smaller than the threshold. .
 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 derives an offset type specified by the QAOMU number supplied from the QAOU control unit 622 with reference to the map memory and the list memory of the offset information storage unit 621. Further, the derived offset type is supplied to the class classification unit 624.
 クラス分類部624は、対象QAOUに含まれる各画素を、オフセットタイプ導出部623から供給されるオフセットタイプにおいて選択可能な複数のクラスの何れかに分類する。また、当該オフセットタイプと、各画素が分類されたクラスを示すクラスインデックスとをオフセット導出部625に供給する。なお、クラス分類部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 625. The specific classification process performed by the class classification unit 624 will be described later, and will not be described here.
 オフセット導出部625は、オフセット情報格納部621のリストメモリを参照し、対象QAOUに含まれる各画素について、クラス分類部624から供給されるオフセットタイプおよびクラスインデックスによって指定されるオフセットを導出する。さらにオフセット属性設定部613によって設定されたシフト値だけ、オフセットを左側へビットシフトするオフセット逆シフト部(不図示)を備える。オフセット逆シフト部は、オフセットのビット深度と画素ビット深度とを合わせるように、該オフセットの逆量子化を行う。このような逆量子化を行うことで、後述するオフセット加算部626の加算処理において、同一のビット深度にて、画素値とオフセットの加算を行うことが可能である。各画素について逆量子化したオフセットは、オフセット加算部626に供給される。 The offset deriving unit 625 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. Further, an offset reverse shift unit (not shown) that shifts the offset to the left by the shift value set by the offset attribute setting unit 613 is provided. The offset inverse shift unit performs inverse quantization of the offset 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 adding process of the offset adding unit 626 described later. The offset obtained by inverse quantization for each pixel is supplied to the offset adding unit 626.
 オフセット加算部626は、対象QAOUにおけるデブロック済復号画像P_DBの各画素に対して、オフセット導出部625から供給されるオフセットを加算する。オフセット加算部626は、デブロック済復号画像P_DBに含まれる全てのQAOUに対して処理を行って得られる画像をオフセットフィルタ済復号画像P_OFとして出力する。 The offset adding unit 626 adds the offset supplied from the offset deriving unit 625 to each pixel of the deblocked decoded image P_DB in the target QAOU. The offset addition unit 626 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.
 次に、適応オフセットフィルタ処理部62における処理の流れについて、図7を参照して説明する。図7は、適応オフセットフィルタ処理部62による処理の流れを示すフローチャートである。 Next, the flow of processing in the adaptive offset filter processing unit 62 will be described with reference to FIG. FIG. 7 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番号を供給する。QAOU制御部622による制御に基づき、オフセットタイプ導出部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. Based on the control by the QAOU control unit 622, 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 the 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は、対象QAOMUに含まれる各画素の画素番号をループ変数とする第2のループを開始する。ここで、画素番号とは、対象QAOMUに含まれる画素を互いに識別するためのものであって、例えば、対象QAOMUに含まれる各画素に対して、所定のスキャン順に付されたものである。また、そのような画素番号に代えて、対象QAOMUに含まれる各画素のx座標およびy座標をループ変数としてもよい。
(Step S104)
Subsequently, the QAOU control unit 622 starts a second loop using the pixel number of each pixel included in the target QAOMU as a 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.
 (ステップS105)
 続いて、クラス分類部624は、QAOU制御部622による制御に基づき、処理対象の画素を、オフセットタイプ導出部623から供給されるオフセットタイプにおいて選択可能な複数のクラスの何れかに分類する。また、当該オフセットタイプと、処理対象の画素が分類されたクラスを示すクラスインデックスとをオフセット導出部625に供給する。
(Step S105)
Subsequently, the class classification unit 624 classifies the pixel to be processed into any of a plurality of classes that can be selected in the offset type supplied from the offset type deriving unit 623 based on the control by the QAOU control unit 622. 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 625.
 (ステップS106)
 続いて、オフセット導出部625は、QAOU制御部622による制御に基づき、処理対象の画素に対して加算すべきオフセットをオフセット情報格納部621から読み出す。すなわち、クラス分類部624から供給されるオフセットタイプおよびクラスインデックスによって指定されるオフセットを読み出す。
(Step S106)
Subsequently, the offset deriving unit 625 reads the offset to be added to the pixel to be processed from the offset information storage unit 621 based on the control by the QAOU control unit 622. That is, the offset specified by the offset type and class index supplied from the class classification unit 624 is read.
 (ステップS107)
 続いて、オフセット加算部626は、QAOU制御部622による制御に基づき、デブロック済復号画像P_DBの処理対象画素の画素値に対して、オフセット導出部625から供給されるオフセットを加算する。
(Step S107)
Subsequently, based on the control by the QAOU control unit 622, the offset addition unit 626 adds the offset supplied from the offset deriving unit 625 to the pixel value of the processing target pixel of the deblocked decoded image P_DB.
 (ステップS108)
 本ステップは、第2のループの終端である。
(Step S108)
This step is the end of the second loop.
 (ステップS109)
 本ステップは、第1のループの終端である。
(Step S109)
This step is the end of the first loop.
 なお、ステップS103にて、オフセットタイプ導出部623が読み出したオフセットタイプが「0」(“sao_type_idx”=0)であるとき、QAOU制御部622は、処理対象のQAOMUの各画素に対してオフセットを加算しないようオフセット加算部626を制御する。 In step S103, when the offset type read by the offset type deriving unit 623 is “0” (“sao_type_idx” = 0), the QAOU control unit 622 sets an offset for each pixel of the QAOMU to be processed. The offset adder 626 is controlled not to add.
 また、ステップS105にて、対象画素がクラス0(“class_idx”=0)に分類された場合、該対象画素に対しては、オフセットを加算しないようオフセット加算部626を制御する。 In step S105, when the target pixel is classified into class 0 (“class_idx” = 0), the offset adding unit 626 is controlled so that no offset is added to the target pixel.
 次に、クラス分類部624による分類処理について、図9~13を参照して説明する。なお、以下では、QAOUの階層の深度などの条件をパラメータ条件とする場合を説明するが、一般のパラメータ条件に応じたクラス分類部の構成については図34を用いて後述する。 Next, the classification process by the class classification unit 624 will be described with reference to FIGS. In the following, the case where conditions such as the depth of the QAOU hierarchy are used as parameter conditions will be described, but the configuration of the class classification unit corresponding to general parameter conditions will be described later with reference to FIG.
 図9は、適応オフセットフィルタ60によるオフセット処理を説明するための図であり、(a)は“sao_type_idx”=1のときに参照される画素を示し、(b)は“sao_type_idx”=2のときに参照される画素を示し、(c)は“sao_type_idx”=3のときに参照される画素を示し、(d)は“sao_type_idx”=4のときに参照される画素を示している。 FIGS. 9A and 9B are diagrams for explaining offset processing by the adaptive offset filter 60. FIG. 9A shows pixels referred to when “sao_type_idx” = 1, and FIG. 9B shows when “sao_type_idx” = 2. (C) shows a pixel referred to when “sao_type_idx” = 3, and (d) shows a pixel referred to when “sao_type_idx” = 4.
 図10は、適応オフセットフィルタ60によるオフセット処理を説明するための図であって、(a)は、処理対象画素xの画素値pix[x]と画素aまたはbの画素値との大小関係を示すグラフ、およびその大小関係に応じた関数Signの値を示し、(b)は、処理対象画素xの画素値と、画素aおよびbの画素値との大小関係を示すグラフ、およびその大小関係に応じたEgdeTypeの値を示し、(c)は、(b)に示した各グラフと、class_idxとの対応を示し、(d)~(f)は、EgdeTypeからclass_idxへの変換を表す変換テーブルを示している。 FIG. 10 is a diagram for explaining the offset processing by the adaptive offset filter 60. FIG. 10A shows the magnitude relationship between the pixel value pix [x] of the processing target pixel x and the pixel value of the pixel a or b. (B) is a graph showing the magnitude relationship between the pixel value of the processing target pixel x and the pixel values of the pixels a and b, and the magnitude relationship thereof. (C) shows the correspondence between each graph shown in (b) and class_idx, and (d) to (f) show conversion tables representing conversion from EgdeType to class_idx. Is shown.
 図11は、適応オフセットフィルタ60によるオフセット処理を説明するための図であって、(a)は“sao_type_idx”=5であるときのクラス分類を概略的に示し、(b)は“sao_type_idx”=6であるときのクラス分類を概略的に示している。 FIG. 11 is a diagram for explaining offset processing by the adaptive offset filter 60. FIG. 11A schematically shows the class classification when “sao_type_idx” = 5, and FIG. 11B shows “sao_type_idx” = FIG. 6 schematically shows the class classification when the number is 6. FIG.
 図12は、適応オフセットフィルタ60によるオフセット処理を説明するための図であって、(a)は処理対象のQAOUの階層の深度が閾値よりも小さい場合のクラス分類を概略的に示し、(b)は処理対象のQAOUの階層の深度が閾値以上の場合のクラス分類を概略的に示している。 FIG. 12 is a diagram for explaining offset processing by the adaptive offset filter 60. FIG. 12A schematically shows class classification when the depth of the QAOU hierarchy to be processed is smaller than a threshold, and (b) ) Schematically shows the class classification when the depth of the QAOU hierarchy to be processed is greater than or equal to a threshold value.
 図13は、バンドオフセットが指定された場合のクラス分類の一例を示す図であり、(a)は、処理対象のQAOUの階層の深度が閾値よりも小さい場合のクラス分類の一例を示し、(b)は処理対象のQAOUの階層の深度が閾値以上の場合のクラス分類の一例を示している。 FIG. 13 is a diagram illustrating an example of class classification when a band offset is specified. FIG. 13A illustrates an example of class classification when the depth of the QAOU hierarchy to be processed is smaller than a threshold. b) shows an example of class classification when the depth of the QAOU to be processed is greater than or equal to a threshold value.
  (オフセットタイプ=1~4(エッジオフセット)のとき)
 オフセットタイプ導出部623から供給されるオフセットタイプが1~4の何れかであるとき、クラス分類部624は、処理対象の画素の近傍にエッジが存在するか否か、およびエッジが存在する場合にはエッジの種類を判定し、判定した結果に応じて、当該処理対象の画素を、複数のクラスの何れかに分類する。
(When the offset type is 1 to 4 (edge offset))
When the offset type supplied from the offset type deriving unit 623 is any one of 1 to 4, the class classification unit 624 determines whether or not an edge exists in the vicinity of the pixel to be processed and if an edge exists. Determines the type of edge, and classifies the pixel to be processed into one of a plurality of classes according to the determination result.
 より具体的には、まず、クラス分類部624は、処理対象画素xの画素値pix[x]と、該処理対象画素に隣接するか、または頂点を共有する2つの画素a、bの画素値pix[a]、pix[b]との差分の符号
  Sign(pix[x]-pix[a])、および
  Sign(pix[x]-pix[b])
を算出する。ここで、Sign(z)は、
  Sign(z)=+1 (z>0のとき)
  Sign(z)=0  (z=0のとき)
  Sign(z)=-1 (z<0のとき)
の各値をとる関数である。また、何れの画素を画素aおよび画素bとして用いるかは、具体的にはオフセットタイプに依存し、以下のように定められる。
More specifically, first, the class classification unit 624 determines the pixel value pix [x] of the processing target pixel x and the pixel values of two pixels a and b that are adjacent to the processing target pixel or share a vertex. Sign of difference from pix [a] and pix [b] Sign (pix [x] −pix [a]), and Sign (pix [x] −pix [b])
Is calculated. 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. Further, which pixel is used as the pixel a and the pixel b depends specifically on the offset type and is determined as follows.
 ・オフセットタイプ=1(“sao_type_idx”=1)のとき
 図9(a)に示すように、処理対象画素xの左側に隣接する画素を画素aとし、処理対象画素の右側に隣接する画素を画素bとする。
When offset type = 1 (“sao_type_idx” = 1) As shown in FIG. 9A, a pixel adjacent to the left side of the processing target pixel x is defined as a pixel a, and a pixel adjacent to the right side of the processing target pixel is defined as a pixel Let b.
 ・オフセットタイプ=2(“sao_type_idx”=2)のとき
 図9(b)に示すように、処理対象画素xの上側に隣接する画素を画素aとし、処理対象画素の下側に隣接する画素を画素bとする。
When offset type = 2 (“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 Let it be pixel b.
 ・オフセットタイプ=3(“sao_type_idx”=3)のとき
 図9(c)に示すように、処理対象画素xの左上の頂点を共有する画素を画素aとし、処理対象画素の右下の頂点を共有する画素を画素bとする。
When offset type = 3 (“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 lower right vertex of the processing target pixel is defined as the pixel a. Let the pixel to share be the pixel b.
 ・オフセットタイプ=4(“sao_type_idx”=4)のとき
 図9(d)に示すように、処理対象画素xの左下の頂点を共有する画素を画素aとし、処理対象画素の右上の頂点を共有する画素を画素bとする。
When offset type = 4 (“sao_type_idx” = 4) As shown in FIG. 9D, the pixel that shares the lower left vertex of the processing target pixel x is defined as pixel a, and the upper right vertex of the processing target pixel is shared A pixel to be processed is a pixel b.
 よって、図10(a)に示すように、画素値pix[x]と画素aまたはbの画素値との大小関係において、画素値pix[x]の方が、画素aまたはbの画素値よりも小さい場合はSign(pix[x]-pix[a])=-1、同じ場合はSign(pix[x]-pix[a])=0、大きい場合はSign(pix[x]-pix[a])=1となる。なお、図10(a)においてpix[x]が付されている黒丸は、処理対象画素xの画素値を示すものであり、pix[x]が付されていない黒丸は、処理対象画素aまたはbの画素値を示すものである。また、図10(a)における上下方向は、画素値の大小を示している。 Therefore, as shown in FIG. 10A, in the magnitude relationship between the pixel value pix [x] and the pixel value of the pixel a or b, the pixel value pix [x] is more than the pixel value of the pixel a or b. Is smaller, Sign (pix [x] −pix [a]) = − 1, the same is Sign (pix [x] −pix [a]) = 0, and the larger is Sign (pix [x] −pix [a]). a]) = 1. In FIG. 10A, a black circle with pix [x] indicates a pixel value of the processing target pixel x, and a black circle without pix [x] indicates the processing target pixel a or The pixel value of b is shown. Further, the vertical direction in FIG. 10A indicates the magnitude of the pixel value.
 続いて、クラス分類部624は、Sign(pix[x]-pix[a])、およびSign(pix[x]-pix[b])に基づいて、以下の数式(1-1)によってEgdeTypeを導出する。 Subsequently, the class classification unit 624 calculates EgdeType by the following formula (1-1) based on Sign (pix [x] −pix [a]) and Sign (pix [x] −pix [b]). To derive.
  EgdeType=Sign(pix[x]-pix[a])+Sign(pix[x]-pix[b])+2   ・・・(1-1)
 これにより、図10(b)に示すように、画素値pix[x]に対し、画素aおよびbのいずれの画素値も大きい場合は、EgdeType=0となる。また、画素値pix[x]に対し、画素aおよびbのうち、一方の画素値が大きく、他方の画素値が同じ場合は、EgdeType=1となる。また、画素値pix[x]に対し、画素aおよびbのうち、一方の画素値が小さく、他方の画素値が同じ場合は、EgdeType=3となる。
また、画素値pix[x]に対し、画素aおよびbのいずれの画素値も小さい場合は、EgdeType=4となる。また、画素値pix[x]に対し、画素aおよびbのうち、一方の画素値が小さく、他方の画素値が大きい場合、または、画素値pix[x]に対し、画素aおよびbのいずれの画素値も同じ場合は、EgdeType=2となる。
EgdeType = Sign (pix [x] −pix [a]) + Sign (pix [x] −pix [b]) + 2 (1-1)
As a result, as shown in FIG. 10B, when both the pixel values of the pixels a and b are larger than the pixel value pix [x], EgdeType = 0. Further, if one of the pixels a and b is larger than the pixel value pix [x] and the other pixel value is the same, EgdeType = 1. Further, when one of the pixels a and b is smaller than the pixel value pix [x] and the other pixel value is the same, EgdeType = 3.
Further, when both the pixel values of the pixels a and b are smaller than the pixel value pix [x], EgdeType = 4. Further, when one of the pixels a and b is small and the other pixel value is large with respect to the pixel value pix [x], or any of the pixels a and b with respect to the pixel value pix [x]. If the pixel values of are also the same, EgdeType = 2.
 なお、図10(b)において、各グラフの中心の黒丸は、処理対象画素xの画素値を示しており、両端の黒丸は、画素aおよびbの画素値を示している。また、図10(b)における上下方向は、画素値の大小を示している。 In FIG. 10B, the black circle at the center of each graph indicates the pixel value of the processing target pixel x, and the black circles at both ends indicate the pixel values of the pixels a and b. Further, the vertical direction in FIG. 10B indicates the magnitude of the pixel value.
 続いて、クラス分類部624は、導出したEgdeTypeに基づいて、処理対象画素xが属するべきクラスのクラスインデックス(class_idx)を以下のように導出する。 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 EgdeType as follows.
  class_idx=EoTbl[EdgeType]
ここで、EoTbl[EdgeType]は、EdgeTypeからclass_idxを導出するために用いられる変換テーブルである。当該変換テーブルEoTblの具体例を図10(d)~(f)に示す。
class_idx = EoTbl [EdgeType]
Here, EoTbl [EdgeType] is a conversion table used to derive class_idx from EdgeType. Specific examples of the conversion table EoTbl are shown in FIGS.
 図10(d)に示す変換テーブル1001Xは、処理対象のQAOUの階層の深度によって用いる変換テーブルを変更しない場合の変換テーブルである。 The conversion table 1001X shown in FIG. 10 (d) is a conversion table when the conversion table used is not changed according to the depth of the QAOU hierarchy to be processed.
 また、図10(e)に示す変換テーブル1001Aと図10(f)に示す変換テーブル1001Bとは、処理対象のQAOUの階層の深度によって用いる変換テーブルを変更する場合の変換テーブルである。処理対象のQAOUの階層の深度が閾値よりも小さい場合は変換テーブル1001Aを用い、処理対象のQAOUの階層の深度が閾値以上の場合は変換テーブル1001Bを用いる。 Also, the conversion table 1001A shown in FIG. 10 (e) and the conversion table 1001B shown in FIG. 10 (f) are conversion tables for changing the conversion table used according to the depth of the QAOU to be processed. When the depth of the QAOU hierarchy to be processed is smaller than the threshold, the conversion table 1001A is used, and when the depth of the QAOU hierarchy to be processed is equal to or larger than the threshold, the conversion table 1001B is used.
 処理対象のQAOUの階層の深度によって用いる変換テーブルを変更しない場合、変換テーブル1001Xに示すように、クラス分類部624は、処理対象画素x、画素aおよび画素bから成る領域にエッジが存在しない場合(以下、平坦な場合とも呼ぶ)、すなわち、EdgeType=2の場合、処理対象画素xをクラス0(“class_idx”=0)に分類する。また、EdgeType=0、1、3、4をそれぞれclass_idx=1、2、3、4に分類する。 When the conversion table to be used is not changed depending on the depth of the QAOU hierarchy to be processed, as shown in the conversion table 1001X, the class classification unit 624 does not have an edge in the region including the processing target pixel x, the pixel a, and the pixel b. (Hereinafter also referred to as a flat case), that is, when EdgeType = 2, the processing target pixel x is classified into class 0 (“class_idx” = 0). Also, EdgeType = 0, 1, 3, 4 are classified into class_idx = 1, 2, 3, 4 respectively.
 また、処理対象のQAOUの階層の深度によって用いる変換テーブルを変更しない場合で、処理対象のQAOUの階層の深度が閾値より小さいとき、変換テーブル1001Aに示すように、クラス分類部624は、処理対象画素x、画素aおよび画素bから成る領域にエッジが存在しない場合(以下、平坦な場合とも呼ぶ)、すなわち、EdgeType=2の場合、処理対象画素xをクラス0(“class_idx”=0)に分類する。また、EdgeType=0、1、3、4をそれぞれclass_idx=1、3、4、2に分類する。また、処理対象のQAOUの階層の深度が閾値以上のとき、変換テーブル1001Bに示すように、クラス分類部624は、処理対象画素x、画素aおよび画素bから成る領域にエッジが存在しない場合(以下、平坦な場合とも呼ぶ)、すなわち、EdgeType=2の場合、処理対象画素xをクラス0(“class_idx”=0)に分類する。また、EdgeType=0、1をclass_idx=1に、EdgeType=3、4をclass_idx=2に分類する。よって、変換テーブル1001Bでは、複数のEdgeTypeに対し、1つのclass_idxが対応している。 In addition, when the conversion table to be used is not changed depending on the depth of the QAOU hierarchy to be processed, and when the depth of the QAOU hierarchy to be processed is smaller than the threshold, the class classification unit 624 performs processing as shown in the conversion table 1001A. When an edge does not exist in the area composed of the pixel x, the pixel a, and the pixel b (hereinafter also referred to as a flat case), that is, when EdgeType = 2, the processing target pixel x is set to class 0 (“class_idx” = 0). Classify. Further, EdgeType = 0, 1, 3, and 4 are classified into class_idx = 1, 3, 4, and 2, respectively. In addition, when the depth of the QAOU hierarchy to be processed is equal to or greater than the threshold, the class classification unit 624 does not have an edge in the region including the processing target pixel x, the pixel a, and the pixel b as shown in the conversion table 1001B ( Hereinafter, it is also referred to as a flat case), that is, when EdgeType = 2, the processing target pixel x is classified into class 0 (“class_idx” = 0). Also, EdgeType = 0 and 1 are classified as class_idx = 1, and EdgeType = 3 and 4 are classified as class_idx = 2. Therefore, in the conversion table 1001B, one class_idx corresponds to a plurality of EdgeTypes.
 なお、変換テーブル1001Aについては、変換テーブル1001Xと同じでもよいように考えられる。しかしながら、変換テーブル1001Aを変換テーブル1001Xと同じにすると、変換Sテーブル1001Bとの間で、同じEdgeTypeに対し、異なるclass_idxが割り当てられることになり、階層によって処理が変わってしまうことになる。例えば、EdgeType=3のときに、階層の深度が閾値より小さい場合は、class_idx=4、階層の深度が閾値以上の場合は、class_idx=2となり、階層によって処理が変わってしまうことになる。 Note that the conversion table 1001A may be the same as the conversion table 1001X. However, if the conversion table 1001A is the same as the conversion table 1001X, a different class_idx is assigned to the same EdgeType with the conversion S table 1001B, and processing changes depending on the hierarchy. For example, when EdgeType = 3, if the hierarchy depth is smaller than the threshold, class_idx = 4, and if the hierarchy depth is greater than or equal to the threshold, class_idx = 2, the process changes depending on the hierarchy.
 そこで、変換テーブル1001Aを図10(e)に示すようにすることで、変換テーブル1001Bとの間、すなわち階層間によって、処理が変わらないようにしている。 Therefore, by making the conversion table 1001A as shown in FIG. 10E, the processing is not changed between the conversion table 1001B, that is, between hierarchies.
  (オフセットタイプ=5~6(バンドオフセット)のとき)
 オフセットタイプ導出部623から供給されるオフセットタイプが5または6であるとき、クラス分類部624は、処理対象画素xの画素値pix[x]に応じて、当該処理対象画素の画素値を複数のクラスの何れかに分類する。
(When the offset type is 5 to 6 (band offset))
When the offset type supplied from the offset type deriving unit 623 is 5 or 6, the class classification unit 624 sets a plurality of pixel values of the processing target pixel according to the pixel value pix [x] of the processing target pixel x. Classify one of the classes.
 ・オフセットタイプ=5(sao_type_idx=5)のとき
 クラス分類部624は、処理対象画素xの画素値pix[x]が、
  (max×1/4)≦pix[x]≦(max×3/4)
を満たしている場合に、当該処理対象画素をクラス0以外のクラスに分類する。すなわち、処理対象画素の画素値が、図11(a)における斜線の範囲内である場合に、当該処理対象画素をクラス0以外のクラスに分類する。なお、上記maxは、処理対象画素xの画素値の取り得る最大値を表しており、例えば、max=255である。また、max=255であるとき、上記の条件は、8≦(pix[x]/8)≦23と表現することもできるし、4≦(pix[x]/16)≦11と表現することもできる。
When the offset type = 5 (sao_type_idx = 5) The class classification unit 624 determines that the pixel value pix [x] of the processing target pixel x is
(Max × 1/4) ≦ pix [x] ≦ (max × 3/4)
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. The above max represents the maximum value that the pixel value of the processing target pixel x can take, for example, max = 255. When max = 255, the above condition can be expressed as 8 ≦ (pix [x] / 8) ≦ 23, or expressed as 4 ≦ (pix [x] / 16) ≦ 11. You can also.
 ・オフセットタイプ=6(sao_type_idx=6)のとき
 クラス分類部624は、処理対象画素xの画素値pix[x]が、
  pix[x]≦(max×1/4)または(max×3/4)≦pix[x]
を満たしている場合に、当該処理対象画素をクラス0以外のクラスに分類する。すなわち、処理対象画素の画素値が、図11(b)における斜線の範囲内である場合に、当該処理対象画素をクラス0以外のクラスに分類する。なお、上記maxは、処理対象画素xの画素値の取り得る最大値を表しており、例えば、max=255である。また、max=255であるとき、上記の条件は、(pix[x]/8)≦7または24≦(pix[x]/8)と表現することもできるし、(pix[x]/16)≦3または12≦(pix[x]/16)と表現することもできる。
When the offset type = 6 (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] ≦ (max × 1/4) or (max × 3/4) ≦ pix [x]
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. The above max represents the maximum value that the pixel value of the processing target pixel x can take, for example, max = 255. Further, when max = 255, the above condition can be expressed as (pix [x] / 8) ≦ 7 or 24 ≦ (pix [x] / 8), or (pix [x] / 16 ) ≦ 3 or 12 ≦ (pix [x] / 16).
 クラス分類部624によるクラス分類処理をより具体的に説明すれば以下の通りである。 The class classification process by the class classification unit 624 will be described in more detail as follows.
 オフセットタイプが5~6の何れかであるとき、クラス分類部624は、処理対象画素xが属するべきクラスのクラスインデックス(class_idx)を、処理対象のQAOUの階層の深度に応じて、以下のように導出する。
・処理対象のQAOUの階層の深度が閾値よりも小さい場合
  class_idx=EoTbl[sao_type_idx][pix[x]/>>BoRefBit32]
・処理対象のQAOUの階層の深度が閾値以上の場合
  class_idx=EoTbl[sao_type_idx][pix[x]/>>BoRefBit16]
ここで、BoTbl[sao_type_idx][pix[x]/>>BoRefBit32]、およびBoTbl[sao_type_idx][pix[x]/>>BoRefBit16]は、処理対象画素xの画素値pix[x]とsao_type_idxとから、class_idxを導出するために用いられる変換テーブルである。BoRefBit32とBoRefBit16は、画像ビット深度をPIC_DEPTHとする場合に、各々PIC_DEPTH-5、PIC_DEPTH-4で導出される値であり、画素値を32段階もしくは16段階の値に量子化したものである。量子化された画素値はpixquantとも記述する。BoRefBit32およびBoRefBit16で右シフトすることは、1<<BoRefBit32および1<<BoRefBit16で除算することに対応する。この量子化幅は画素値のビット深度が8ビットの場合にはそれぞれ、1<<(8-5)=8、1<<(8-4)=16である。以下、量子化幅が8の場合を説明する。また、この量子化幅をクラスの幅と呼ぶ。
When the offset type is any one of 5 to 6, the class classification unit 624 sets the class index (class_idx) of the class to which the processing target pixel x should belong according to the depth of the processing target QAOU as follows. To derive.
When the depth of the QAOU hierarchy to be processed is smaller than the threshold: class_idx = EoTbl [sao_type_idx] [pix [x] / >> BoRefBit32]
When the depth of the QAOU hierarchy to be processed is greater than or equal to the threshold value: class_idx = EoTbl [sao_type_idx] [pix [x] / >> BoRefBit16]
Here, BoTbl [sao_type_idx] [pix [x] / >> BoRefBit32] and BoTbl [sao_type_idx] [pix [x] / >> BoRefBit16] are derived from the pixel values pix [x] and sao_type_id of the processing target pixel x. , Class_idx is a conversion table used for deriving. BoRefBit32 and BoRefBit16 are values derived by PIC_DEPTH-5 and PIC_DEPTH-4, respectively, when the image bit depth is set to PIC_DEPTH, and the pixel values are quantized to 32 or 16 values. The quantized pixel value is also described as pixquant. Shifting right by BoRefBit32 and BoRefBit16 corresponds to dividing by 1 << BoRefBit32 and 1 << BoRefBit16. This quantization width is 1 << (8-5) = 8 and 1 << (8-4) = 16, respectively, when the bit depth of the pixel value is 8 bits. Hereinafter, a case where the quantization width is 8 will be described. This quantization width is called a class width.
 クラス分類部624は、処理対象のQAOUの階層の深度に応じて分類するクラスの幅を変えて、クラスの分類を行う。例えば、図12(a)に示すように、処理対象のQAOUの階層の深度が閾値よりも小さい場合、クラス分類部624は、クラスの幅を「8」として画素値を32個に分類して、クラス分類を行う。また、図12(b)に示すように、処理対象のQAOUの階層の深度が閾値以上の場合、クラス分類部624は、クラスの幅を「16」として画素値を16個に分類し、クラス分類を行う。 The class classification unit 624 performs class classification by changing the width of the class to be classified according to the depth of the QAOU hierarchy to be processed. For example, as shown in FIG. 12A, when the depth of the QAOU hierarchy to be processed is smaller than the threshold, the class classification unit 624 classifies the pixel width into 32 with the class width set to “8”. , Classify. Also, as shown in FIG. 12B, when the depth of the QAOU hierarchy to be processed is equal to or greater than the threshold, the class classification unit 624 classifies the pixel value into 16 with a class width of “16”, and class Perform classification.
 次に、変換テーブルEoTblの具体例を図13に示す。図13の(a)、(b)それぞれにおいて「BO_1」は、“sao_type_index”=5であることを示しており、「BO_2」は、“sao_type_index”=6であることを示している。また、図13(a)に示す変換テーブル1301は、処理対象のQAOUの階層の深度が閾値よりも小さい場合に用いられる変換テーブルであり、図13(b)に示す変換テーブル1302は、処理対象のQAOUの階層の深度が閾値以上の場合に用いられる変換テーブルである。 Next, a specific example of the conversion table EoTbl is shown in FIG. In each of FIGS. 13A and 13B, “BO_1” indicates that “sao_type_index” = 5, and “BO_2” indicates that “sao_type_index” = 6. Also, the conversion table 1301 shown in FIG. 13A is a conversion table used when the depth of the QAOU hierarchy to be processed is smaller than the threshold, and the conversion table 1302 shown in FIG. This is a conversion table used when the depth of the QAOU hierarchy is greater than or equal to a threshold value.
 処理対象のQAOUの階層の深度が閾値よりも小さい場合で、“sao_type_index”=5のとき、図13(a)に示すように、 クラス分類部624は、画素値pix[x]が8≦(pix[x]/8)≦23を満たす処理対象画素xについて、pix[x]の大きさに応じて、クラスインデックス1から16までの何れかのクラスに分類する。 In the case where the depth of the QAOU hierarchy to be processed is smaller than the threshold value and “sao_type_index” = 5, as shown in FIG. 13A, the eyelid class classification unit 624 has a pixel value pix [x] of 8 ≦ ( The processing target pixel x satisfying pix [x] / 8) ≦ 23 is classified into any one of class indices 1 to 16 according to the size of pix [x].
 また、“sao_type_index”=6のとき、クラス分類部624は、画素値pix[x]がpix[x]/8)≦7または24≦(pix[x]/8)を満たす処理対象画素xについて、pix[x]の大きさに応じて、クラスインデックス1から16までの何れかのクラスに分類する。 When “sao_type_index” = 6, the class classification unit 624 determines the pixel x to be processed that satisfies the pixel value pix [x] that satisfies pix [x] / 8) ≦ 7 or 24 ≦ (pix [x] / 8). , Pix [x] is classified into any one of class indexes 1 to 16 according to the size of pix [x].
 また、処理対象のQAOUの階層の深度が閾値以上の場合で、“sao_type_index”=5のとき、図13(b)に示すように、 クラス分類部624は、画素値pix[x]が4≦(pix[x]/16)≦11を満たす処理対象画素xについて、pix[x]の大きさに応じて、クラスインデックス1から8までの何れかのクラスに分類する。 Also, when the depth of the QAOU hierarchy to be processed is equal to or greater than the threshold value and “sao_type_index” = 5, as shown in FIG. 13B, the eyelid class classification unit 624 has a pixel value pix [x] of 4 ≦ A pixel x to be processed that satisfies (pix [x] / 16) ≦ 11 is classified into one of class indexes 1 to 8 according to the size of pix [x].
 また、“sao_type_index”=6のとき、クラス分類部624は、画素値pix[x]がpix[x]/16)≦3または12≦(pix[x]/16)を満たす処理対象画素xについて、pix[x]の大きさに応じて、クラスインデックス1から8までの何れかのクラスに分類する。
(オフセット情報復号部611の構成)
 図32は、適応オフセットのパラメータの種類(パラメータ条件)に応じて、使用するオフセットタイプを変更する、かつ/もしくは、適応オフセットのパラメータ条件に応じて、クラスの分類数を変更するオフセット情報復号部611のブロック図である。オフセット情報復号部611は、適応的オフセットタイプ復号部6111、使用オフセットタイプ選択部6112、オフセットタイプ復号部6113、適応的オフセット復号部6114、使用オフセット数選択部6115、オフセット復号部6116から構成される。なお、パラメータ条件とは、画素値から算出される値以外のパラメータであり、上記で説明した階層、オフセットタイプの他、後述の付記事項にて説明するブロックサイズ(QAOUサイズ)、色成分(コンポーネント)、QPがある。
In addition, when “sao_type_index” = 6, the class classification unit 624 determines the pixel x to be processed that satisfies the pixel value pix [x] pix [x] / 16) ≦ 3 or 12 ≦ (pix [x] / 16). , Pix [x] is classified into any one of class indexes 1 to 8 according to the size of pix [x].
(Configuration of Offset Information Decoding Unit 611)
FIG. 32 shows an offset information decoding unit that changes an offset type to be used according to the type (parameter condition) of an 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. The offset information decoding unit 611 includes an adaptive offset type decoding unit 6111, a used offset type selection unit 6112, an offset type decoding unit 6113, an adaptive offset decoding unit 6114, a used offset number selection unit 6115, and an offset decoding unit 6116. . The parameter condition is a parameter other than a value calculated from the pixel value. In addition to the hierarchy and offset type described above, the block size (QAOU size) and color components (components) described in the appendix described later are included. ), QP.
 適応的オフセットタイプ復号部6111は、符号化データ中のQAOU情報から、パラメータ条件に応じて適応的にオフセットタイプを復号する手段であり、使用オフセットタイプ選択部6112とオフセットタイプ復号部6113を備える。 The adaptive offset type decoding unit 6111 is means for adaptively decoding 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.
 使用オフセットタイプ選択部6112は、パラメータ条件に応じて使用するオフセットタイプを選択する手段である。パラメータ条件の一つは、上述したように階層である。階層が浅い場合に使用するオフセットタイプの数は、階層が深い場合に使用するオフセットの数よりも小さい。使用オフセットタイプ選択部6112は、パラメータ条件に応じて図8で説明したような変換テーブルをオフセットタイプ復号部6113に入力する。また使用可能なオフセットタイプの最大数をオフセットタイプ復号部6113に入力する。 The used offset type selection unit 6112 is means for selecting an offset type to be used according to the parameter condition. One of the parameter conditions is a hierarchy as described above. The number of offset types used when the hierarchy is shallow is smaller than the number of offsets used when the hierarchy is deep. The used offset type selection unit 6112 inputs the conversion table as described in FIG. 8 to the offset type decoding unit 6113 according to the parameter condition. Further, the maximum number of usable offset types is input to the offset type decoding unit 6113.
 オフセットタイプ復号部6113は、入力された変換テーブルと最大数に応じて符号化データからオフセットタイプを復号する。オフセットタイプの最大数をNとすると、コードの取り得る範囲が0からN-1までのN個に制限されることから、コードの符号化に要するビット数を低減することができる。例えば、最大数が2m-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. Assuming that the maximum number of offset types is N, the range of codes that can be taken is limited to N from 0 to N−1. Therefore, the number of bits required for code encoding 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 a maximum value of N-1 or Truncated Rice encoding can be used.
 適応的オフセット復号部6114は、符号化データ中のQAOU情報から、パラメータ条件に応じて適応的にオフセットを復号する手段であり、使用オフセット数選択部6115とオフセット復号部6116とを備える。使用オフセット数選択部6115は、パラメータ条件に応じて、使用するオフセット数の最大値とオフセットの精度を選択する手段である。パラメータ条件の一つは階層であり、階層が浅い場合に使用するオフセットの数は、階層が深い場合に使用するオフセットの数よりも大きい。例えば、階層が浅い場合には図13(a)のようにオフセット数を16個、階層が深い場合には図13(b)のようにオフセット数を8個とすることができる。また、上述したように、階層に応じて、オフセットの精度(ビット深度)を変更することも可能である。使用オフセット数選択部6115は、オフセット最大数とオフセット精度とをオフセット復号部6116に入力する。オフセット復号部6116は、オフセットの最大数とオフセットの精度とに応じてオフセットを復号する。オフセットの数を少なくする場合には、オフセットの符号量が低減する。また、オフセットタイプと同様、オフセットにおいても各オフセットの精度が決まれば、オフセットを符号化するコードの取り得る範囲も制限されることから、コードの符号化に要するビット数を低減することができる。 The adaptive offset decoding unit 6114 is means for adaptively decoding an offset from the 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. 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 hierarchy, and the number of offsets used when the hierarchy is shallow is larger than the number of offsets used when the hierarchy is deep. For example, when the hierarchy is shallow, the number of offsets can be 16 as shown in FIG. 13A, and when the hierarchy is deep, the number of offsets can be 8 as shown in FIG. 13B. Further, as described above, the offset accuracy (bit depth) can be changed according to the hierarchy. The used offset number selection unit 6115 inputs the maximum offset number and the offset accuracy to the offset decoding unit 6116. The offset decoding unit 6116 decodes the offset according to the maximum number of offsets and the offset accuracy. When the number of offsets is reduced, the code amount of the offset is reduced. Similarly to the offset type, if the accuracy of each offset is determined, the range that can be taken by the code that encodes the offset is also limited, so that the number of bits required for encoding the code can be reduced.
 図33(a)は、使用オフセットタイプ選択部6112の構成を示すブロック図である。 FIG. 33A is a block diagram showing the configuration of the used offset type selection unit 6112.
 使用オフセットタイプ選択部6112は、オフセットタイプ変換テーブル選択部6117、第1オフセットタイプ変換テーブル格納部6118、第2オフセットタイプ変換テーブル格納部6119を備える。 The used offset type selection unit 6112 includes an offset type conversion table selection unit 6117, a first offset type conversion table storage unit 6118, and a second offset type conversion table storage unit 6119.
 オフセットタイプ変換テーブル選択部6117は、パラメータ条件に応じて第1オフセットタイプ変換テーブル格納部6118が備える変換テーブルもしくは、第2オフセットタイプ変換テーブル格納部6119が備える変換テーブルを選択する。上述した例では、801Aが、第1オフセットタイプ変換テーブル格納部6118が備える変換テーブルであり、801Bが、第2オフセットタイプ変換テーブル格納部6119が備える変換テーブルに対応する。 The offset type conversion table selection unit 6117 selects the conversion table provided in the first offset type conversion table storage unit 6118 or the conversion table provided in the second offset type conversion table storage unit 6119 according to the parameter condition. In the example described above, 801A corresponds to the conversion table included in the first offset type conversion table storage unit 6118, and 801B corresponds to the conversion table included in the second offset type conversion table storage unit 6119.
 図33(b)は、使用オフセットタイプ選択部の別の構成を示すブロック図である。 FIG. 33 (b) is a block diagram showing another configuration of the used offset type selection unit.
 使用オフセットタイプ選択部6112´は、オフセットタイプ変換テーブル選択部6117´、エッジオフセットタイプ及びバンドオフセットタイプ変換テーブル格納部6118´、水平エッジオフセットタイプ及びバンドオフセットタイプ変換テーブル格納部6119´を備える。 The used offset type selection unit 6112 ′ includes an offset type conversion table selection unit 6117 ′, an edge offset type and band offset type conversion table storage unit 6118 ′, and a horizontal edge offset type and band offset type conversion table storage unit 6119 ′.
 (クラス分類部624の構成)
 図34は、クラス分類部624の構成を示すブロック図である。
(Configuration of class classification unit 624)
FIG. 34 is a block diagram illustrating a configuration of the class classification unit 624.
 クラス分類部624は、適応的エッジオフセットクラス分類部6241、使用エッジオフセットクラス選択部6242、エッジオフセットクラス分類部6243、適応的バンドオフセットクラス分類部6244、使用バンドオフセットクラス・クラス幅選択部6245、バンドオフセットクラス分類部6246から構成される。 The class classification unit 624 includes an adaptive edge offset class classification unit 6241, a used edge offset class selection unit 6242, an edge offset class classification unit 6243, an adaptive band offset class classification unit 6244, a used band offset class / class width selection unit 6245, The band offset class classification unit 6246 is configured.
 クラス分類部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とを備える。使用エッジオフセットクラス選択部6242は、使用するクラスの種類を選択する。使用エッジオフセットクラス選択部6242は、画素値の分類方法をエッジオフセットクラス分類部6243に入力する。具体的には、画素値を分類する場合に一時的に導出される中間値EdgeTypeの導出方法と、EdgeTypeからclass_idxを導出するために用いられる変換テーブルとを入力する。中間値EdgeTypeの導出方法の例は図10(a)、図10(b)を用いて説明したものであり、これを基本エッジ分類方法と呼ぶ。図22で後述するようなエッジ分類方法を用いることもできる。パラメータ条件の一つは、上述したように階層であり、階層が浅い場合に使用するクラスを、階層が深い場合に使用するクラスよりも大きい数となるように選択する。EdgeTypeからclass_idxを導出するために用いられる変換テーブルは、1001Aや1001Bが例になる。また、色成分(コンポーネント)に応じて、エッジ導出方法を切り替える方法も適当である。この場合、輝度では、水平、垂直、斜め方向のエッジ分類方法を用いる基本エッジ分類方法を用い、色差では、ラインメモリを削減するためにエッジ分類で用いる参照画素の範囲を、対象画素からみて水平方向に限定した水平エッジ分類方法を用いることが適当である。エッジオフセットクラス分類部6243は与えられた分類方法と、EdgeTypeからclass_idxを導出するために用いられる変換テーブルに基づいて画素を分類する。 The adaptive edge offset class classification unit 6241 is a unit that adaptively classifies pixels into classes according to parameter conditions, and includes a used edge offset class selection unit 6242 and an edge offset class classification unit 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 the pixel value classification method to the edge offset class classification unit 6243. Specifically, a method of deriving an intermediate value EdgeType that is temporarily derived when classifying pixel values and a conversion table used to derive class_idx from EdgeType are input. An example of a method for deriving the intermediate value EdgeType has been described with reference to FIGS. 10A and 10B, and this is called a basic edge classification method. An edge classification method as will be described later with reference to FIG. 22 can also be used. One of the parameter conditions is the hierarchy as described above, and the class used when the hierarchy is shallow is selected so as to be larger than the class used when the hierarchy is deep. 1001A and 1001B are examples of conversion tables used to derive class_idx from EdgeType. A method of switching the edge derivation method according to the color component (component) is also appropriate. In this case, for luminance, a basic edge classification method using horizontal, vertical, and diagonal edge classification methods is used, and for color difference, the range of reference pixels used for edge classification to reduce line memory is horizontal when viewed from the target pixel. It is appropriate to use a horizontal edge classification method limited to the direction. The edge offset class classification unit 6243 classifies pixels based on a given classification method and a conversion table used to derive class_idx from EdgeType.
 適応的バンドオフセットクラス分類部6244は、パラメータ条件に応じて適応的に、画素をクラスに分類する手段であり、使用バンドオフセットクラス・クラス幅選択部6245とバンドオフセットクラス分類部6246とを備える。使用バンドオフセットクラス・クラス幅選択部6245は、画素値の分類方法をバンドオフセットクラス分類部6246に入力する。具体的には、画素値を中間値に分類する場合に用いられる量子化幅であるクラス幅と、中間値からclass_idxを導出するために用いられる変換テーブルとを入力する。パラメータ条件の一つは、既に説明したように階層であり、階層が浅い場合に使用するクラスの幅は、階層が深い場合に使用するクラスの幅よりも小さい。バンドオフセットクラス分類部6246は、入力されたクラス幅と、中間値からclass_idxを導出するために用いられる変換テーブルとに応じて画素値をクラスに分類する。入力であるクラス幅は、クラス幅自体ではなく、クラス幅に対応する整数でも構わない。例えば1<<BoRefBit32をクラス幅とする場合、その2を底とする対数である画素の量子化に用いるビット数BoRefBit32や、画素のビット深度から画素を量子化に用いるビット数を求めるための値、例えば、BoRefBit32=PIC_DEPTH-5であれば5を、クラス幅の代わりに用いても構わない。 The adaptive band offset class classification unit 6244 is means for adaptively classifying pixels into classes according to parameter conditions, and includes a used band offset class / class width selection unit 6245 and a band offset class classification unit 6246. The used band offset class / class width selection unit 6245 inputs the pixel value classification method to the band offset class classification unit 6246. Specifically, a class width, which is a quantization width used when classifying pixel values into intermediate values, and a conversion table used to derive class_idx from the intermediate values are input. One of the parameter conditions is the hierarchy as described above, and the width of the class used when the hierarchy is shallow is smaller than the width of the class used when the hierarchy is deep. The band offset class classification unit 6246 classifies the pixel values into classes according to the input class width and the conversion table used to derive class_idx from the intermediate value. The class width as input may be an integer corresponding to the class width, not the class width itself. For example, when 1 << BoRefBit32 is used as the class width, the number of bits used to quantize the pixel that is the logarithm of base 2 is BoRefBit32, and a value for obtaining the number of bits used for quantizing the pixel from the bit depth of the pixel For example, if BoRefBit32 = PIC_DEPTH-5, 5 may be used instead of the class width.
 このように、パラメータ条件に応じて適応的に符号化データを復号し、画素のクラス分類を行う。 In this way, the coded data is adaptively decoded according to the parameter conditions, and the pixel classification is performed.
 以上のように、本実施形態では、処理対象のQAOUの階層の深度に応じて、クラスの分類数を変更している。より詳細には、処理対象のQAOUの階層の深度が大きい場合に、小さい場合と比較してより少ないクラス数に分類している。 As described above, in this embodiment, the number of class classifications is changed according to the depth of the QAOU hierarchy to be processed. More specifically, when the depth of the QAOU to be processed is large, it is classified into a smaller number of classes compared to the case where the depth is small.
 一般に、必要なメモリ量は、メモリ量=オフセットのデータ長×クラス数×QAOU数であるので、クラス数を減らすことにより、メモリの使用量を削減することができる。 Generally, the required amount of memory is memory amount = offset data length × number of classes × number of QAOUs. Therefore, the memory usage can be reduced by reducing the number of classes.
 また、深い階層では、QAOUの面積が小さくなるとともに、QAOU内の画素値の特性が一様に近くなるので、クラス数を減らしてもオフセットの効果は、あまり変わらない。 Also, in the deep hierarchy, the area of the QAOU becomes smaller and the characteristics of the pixel values in the QAOU become nearly uniform, so the effect of offset does not change much even if the number of classes is reduced.
 また、本実施形態では、処理対象のQAOUの階層の深度に応じて、オフセットの精度を変更している。より詳細には、処理対象のQAOUの階層の深度が大きい場合に、小さい場合と比較してオフセットの精度を下げている。これにより、処理対象のQAOUの階層の深度が大きい場合の符号量を減らしている。 In this embodiment, the accuracy of the offset is changed according to the depth of the QAOU hierarchy to be processed. More specifically, when the depth of the QAOU to be processed is large, the offset accuracy is lowered as compared with the case where the depth is small. This reduces the amount of code when the depth of the QAOU hierarchy to be processed is large.
 深い階層のQAOUでは、含まれる画素数が少なくなるため、QAOU全体でみた量子化誤差が上位の階層と比較して小さくなる。よって、深い階層において、オフセットの精度を下げても、オフセットの効果はあまり変わらない。 In a deep hierarchy QAOU, since the number of pixels included is small, the quantization error seen in the entire QAOU is smaller than that of the upper hierarchy. Therefore, even if the offset accuracy is lowered in a deep hierarchy, the effect of the offset does not change much.
 (動画像符号化装置2)
 次に、符号化対象画像を符号化することによって符号化データ#1を生成する動画像符号化装置2について、図14~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, a moving picture encoding apparatus 2 that generates encoded data # 1 by encoding an 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.
 図14は、本実施形態に係る動画像符号化装置2の構成を示すブロック図である。図14に示すように、動画像符号化装置2は、変換・量子化部21、可変長符号符号化部22、逆量子化・逆変換部23、バッファメモリ24、イントラ予測画像生成部25、インター予測画像生成部26、動きベクトル検出部27、予測方式制御部28、動きベクトル冗長性削除部29、加算器31、減算器32、デブロッキングフィルタ33、適応フィルタ70、および適応オフセットフィルタ80を含む構成である。動画像符号化装置2は、動画像#10(符号化対象画像)を符号化することによって、符号化データ#1を生成する装置である。 FIG. 14 is a block diagram showing a configuration of the video encoding device 2 according to the present embodiment. As illustrated in FIG. 14, 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)し、(2)DCT変換により得られたDCT係数を量子化し、(3)量子化により得られた量子化予測残差QDを可変長符号符号化部22および逆量子化・逆変換部23に供給する。なお、変換・量子化部21は、(1)量子化の際に用いる量子化ステップQPを、ツリーブロック毎に選択し、(2)選択した量子化ステップQPの大きさを示す量子化パラメータ差分Δqpを可変長符号符号化部22に供給し、(3)選択した量子化ステップQPを逆量子化・逆変換部23に供給する。ここで、量子化パラメータ差分Δqpとは、DCT変換/量子化するツリーブロックに関する量子化パラメータqp(QP=2pq/6)の値から、直前にDCT変換/量子化したツリーブロックに関する量子化パラメータqp’の値を減算して得られる差分値のことを指す。 The transform / quantization unit 21 performs (1) DCT transform (Discrete Cosine Transform) on the prediction residual D obtained by subtracting the predicted image Pred from the encoding target image, and (2) DCT coefficients obtained by the DCT transform. (3) The quantized prediction residual QD obtained by the quantization is supplied to the variable-length code encoding unit 22 and the inverse quantization / inverse transform 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 is the quantization parameter related to the tree block DCT transformed / quantized immediately before from the value of the quantization parameter qp (QP = 2 pq / 6 ) related to the tree block to be DCT transformed / quantized. It refers to the difference value obtained by subtracting the value of qp ′.
 可変長符号符号化部22は、(1)変換・量子化部21から供給された量子化予測残差QD並びにΔqp、(2)後述する予測方式制御部28から供給された量子化パラメータPP、および、(3)後述する適応フィルタ70から供給されたフィルタセット番号、フィルタ係数群、領域指定情報、並びにオンオフ情報を可変長符号化することによって、符号化データ#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, and (2) a quantization parameter PP supplied from a prediction scheme control unit 28 described later, (3) The encoded data # 1 is generated by variable-length encoding the 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係数を逆DCT(Discrete Cosine Transform)変換し、(3)逆DCT変換によって得られた予測残差Dを加算器31に供給する。量子化予測残差QDを逆量子化する際には、変換・量子化部21から供給された量子化ステップQPを利用する。なお、逆量子化・逆変換部23から出力される予測残差Dは、変換・量子化部21に入力される予測残差Dに量子化誤差が加えられたものであるが、ここでは簡単のために共通の呼称を用いる。 The inverse quantization / inverse transform unit 23 (1) inversely quantizes the quantized prediction residual QD, (2) performs inverse DCT (Discrete Cosine Transform) transformation on the DCT coefficient obtained by the inverse quantization, and (3) The prediction residual D obtained by the inverse DCT transform 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
 イントラ予測画像生成部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 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に供給する。 Further, the intra predicted image generation unit 25 specifies 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 the adaptive filter 70 with intra coding mode information IEM that is information indicating the size of the target partition and the prediction mode assigned to the target partition.
 動きベクトル検出部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 related to 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 obtained by performing the deblocking process by the deblocking filter 33, the adaptive offset process by the adaptive offset filter 80, and the adaptive filter 70 on the decoded image that has already been decoded. It is an image obtained by performing adaptive filter processing. 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 prediction 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 generation unit 26 generates a motion compensation image mc related to 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変換/量子化される。一方、予測方式制御部28にて選択された予測画像Predを、逆量子化・逆変換部23にて生成された予測残差Dに加算することによって、加算器31にて局所復号画像Pが生成される。加算器31にて生成された局所復号画像Pは、デブロッキングフィルタ33、適応オフセットフィルタ80および適応フィルタ70を経由したのち、フィルタ済復号画像P_FLとしてバッファメモリ24に格納され、インター予測における参照画像として利用される。 The prediction residual D is generated by the subtractor 32 by subtracting the prediction image Pred selected by the prediction method control unit 28 from the encoding target image. The prediction residual D generated by the subtractor 32 is DCT 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 deleting unit 29 deletes the redundancy in the motion vector mv detected by the motion vector detecting 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 whether the block boundary in the decoded image P or the block boundary in the decoded image P or the block boundary in the decoded image P or the block boundary in the decoded image P is smaller than a predetermined threshold value. By performing deblocking processing on the CU boundary, an image near the block boundary or the vicinity of the CU boundary is smoothed. 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について、図15を参照して説明する。図15は、適応オフセットフィルタ80の構成を示すブロック図である。図15に示すように、適応オフセットフィルタ80は、適応オフセットフィルタ情報設定部81および適応オフセットフィルタ処理部82を含む構成である。
(Adaptive offset filter 80)
Next, the adaptive offset filter 80 will be described with reference to FIG. FIG. 15 is a block diagram showing a configuration of the adaptive offset filter 80. As shown in FIG. 15, the adaptive offset filter 80 includes an adaptive offset filter information setting unit 81 and an adaptive offset filter processing unit 82.
 また、図15に示すように、適応オフセットフィルタ情報設定部81は、オフセット算出部811、オフセットシフト部816、オフセットクリップ部812、オフセット情報選択部813、およびオフセット属性設定部815を含む構成である。 As shown in FIG. 15, the adaptive offset filter information setting unit 81 includes an offset calculation unit 811, an offset shift unit 816, an offset clip unit 812, an offset information selection unit 813, and an offset attribute setting unit 815. .
 (オフセット算出部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における処理の流れについて、図16を参照して説明する。図16は、オフセット算出部811による処理の流れを示すフローチャートである。 Next, the flow of processing in the offset calculation unit 811 will be described with reference to FIG. FIG. 16 is a flowchart showing the flow of processing by the offset calculation unit 811.
 (ステップS201)
 まず、オフセット算出部811は、処理対象とする対象QAOMUのQAOMU番号をループ変数とする第1のループを開始する。QAOMU番号は、例えば、図18に示すように、各QAOUに対し、互いに識別可能に付されている番号である。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. For example, as shown in FIG. 18, the QAOMU number is a number assigned to each QAOU so that they can be distinguished from each other. 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 division depths.
 例えば、図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. 18, (a) shows a QAOMU number assigned to a QAOMU having a division depth of 0, and (b) shows a QAOMU number assigned to a QAOMU having a division depth of 1. (C) shows a QAOMU number assigned to a QAOMU having a division depth of 2, and (d) shows a QAOMU number assigned to a QAOMU having a division depth of 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のループを開始する。当該第2のループは、オフセットタイプ1からオフセットタイプ6までのループである。
(Step S202)
Subsequently, the offset calculation unit 811 starts a second loop using the offset type that can be selected for the target QAOMU as a loop variable. The second loop is a loop from offset type 1 to offset type 6.
 (ステップ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は、対象画素を複数のクラスの何れかに分類する。より具体的には、処理対象のQAOMUに階層に応じて選択可能なクラスの何れかに分類する。例えば、処理対象のQAOMUの階層の深度が閾値よりも小さい場合で、第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, the QAOMU to be processed is classified into one of classes that can be selected according to the hierarchy. For example, when the depth of the QAOMU hierarchy to be processed is smaller than the threshold value and the offset type as the second loop variable is 1 to 4, the target pixel is classified into one 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[part_idx][sao_type_index][class_idx]”を算出する。ここで、“part_idx”は、QAOUインデックスを表す。 Also, with respect to the target QAOMU, a classification count “count [part_idx] [sao_type_index] [class_idx]”, which is the number of times the pixel has been classified, 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 in the target pixel, and Org (x, y) represents the pixel value of the encoding target image # 10 in the target pixel. ing.
 (ステップ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[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 the offset “offset [part_idx] [sao_type_idx] [class_idx]” for the target QAOMU, the target offset type, and the target class using the following expression.
  offset[part_idx][sao_type_idx][class_idx] = Σ(P_DB(x、y)-Org(x、y))/count[part_idx][sao_type_idx][class_idx]
ここで、記号Σは、“part_idx”によって指定される対象QAOMU、および“sao_type_idx”によって指定される対象オフセットタイプにおいて、“class_idx”によって指定される対象クラスに分類された画素についての和をとることを示している。
offset [part_idx] [sao_type_idx] [class_idx] = Σ (P_DB (x, y) -Org (x, y)) / count [part_idx] [sao_type_idx] [class_idx]
Here, the symbol Σ is the sum for the 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”. Is shown.
 (ステップ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に対して、全てのオフセットタイプおよび全てのクラスについてのオフセットを算出する。例えば、図18(a)~(e)に示す例の場合、オフセット算出部811は、処理対象のQAOMUの階層の深度の閾値を「3」とした場合、すなわち、階層0~2までと、階層3、4とで、クラス数を変更した場合、
  ((分割深度0のQAOMUの総数)+(分割深度1のQAOMUの総数)+(分割深度2のQAOMUの総数))×((EOのオフセットタイプ数)×(分割深度0~2のときのEOのクラス数)+(BOのオフセットタイプ数)×(分割深度0~2のときのBOのクラス数))+((分割深度3のQAOMUの総数)+(分割深度4のQAOMUの総数))×((EOのオフセットタイプ数)×(分割深度3、4のときのEOのクラス数)+(BOのオフセットタイプ数)×(分割深度3、4のときのBOのクラス数))=(1+4+16)×((4×4)+(2×16))+(64+256)×((4×2)+(2×8))=8688(個)
のオフセットを算出することになる。
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. For example, in the case of the example shown in FIGS. 18A to 18E, the offset calculation unit 811 sets the threshold value of the depth of the QAOMU layer to be processed to “3”, that is, the layers 0 to 2. If the number of classes is changed at levels 3 and 4,
((Total number of QAOMUs with division depth 0) + (total number of QAOMUs with division depth 1) + (total number of QAOMUs with division depth 2)) × (number of EO offset types) × (division depth 0 to 2 EO class number) + (BO offset type number) × (BO class number at division depth 0-2)) + (Total number of QAOMUs at division depth 3) + (Total number of QAOMUs at division depth 4) ) × ((number of EO offset types) × (number of EO classes at division depths 3 and 4) + (number of BO offset types) × (number of BO classes at division depths 3 and 4)) = (1 + 4 + 16) × ((4 × 4) + (2 × 16)) + (64 + 256) × ((4 × 2) + (2 × 8)) = 8688 (pieces)
Is calculated.
 なお、処理対象のQAOMUの階層の深度によって、分類するクラス数を変更しない場合では、
  ((分割深度0のQAOMUの総数)+...+(分割深度4のQAOMUの総数))×((EOのオフセットタイプ数)×(EOのクラス数)+(BOのオフセットタイプ数)×(BOのクラス数))=(1+4+16+64+256)×((4×4)+(2×16))=16368(個)
のオフセットを算出することになる。
In the case where the number of classes to be classified is not changed according to the depth of the QAOMU hierarchy to be processed,
((Total number of QAOMUs with division depth 0) + ... + (total number of QAOMUs with division depth 4)) × ((number of EO offset types) × (number of EO classes) + (number of offset types of BO) × (Number of BO classes)) = (1 + 4 + 16 + 64 + 256) × ((4 × 4) + (2 × 16)) = 16368 (pieces)
Is calculated.
 オフセット算出部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 clips each offset supplied from the offset calculation unit 811 to a value from −8 to 7, for example, to express each offset with 4 bits. 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. Moreover, since the amount of offset codes included in the encoded data # 1 can be reduced, the encoding efficiency can be improved. Moreover, since an excessive offset is suppressed, an appropriate image quality is ensured.
 (クリップ処理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 value depending on the offset type.
 例えば、オフセットタイプがエッジオフセットである場合には、オフセットのビット数を8ビットとし、オフセットタイプがバンドオフセットである場合には、オフセットのビット数を4ビットとする。より一般的には、オフセットタイプがエッジオフセットである場合のオフセットのビット数をNビットとし、オフセットタイプがバンドオフセットである場合のオフセットのビット数をMビットとしたとき、N>Mが満たされるようにオフセットのビット数を定める。 For example, when the offset type is an edge offset, 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, N> M is satisfied when the number of offset bits when the offset type is edge offset is N bits and the number of offset bits when the offset type is band offset is M bits. The number of offset bits is determined as follows.
 このようにオフセットタイプに応じて、オフセットのビット数を異ならせることによって、各オフセットを格納するためのメモリに過度なメモリサイズを要求することなく、符号化効率の向上を図ることができる。 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.
 なお、オフセットの取り得る値を制限するための閾値thが2m-1より大きく、2m以下であるとき、当該オフセットを符号化するための符号化方式として、mビットの固定長符号化を用いることができる。より具体的には、最大値とthとするTruncated unary符号化や、Truncated Rice符号化を用いることができる。 When the threshold th for limiting the value that can be taken by the offset is greater than 2 m-1 and less than or equal to 2 m , m-bit fixed-length encoding is used as an encoding method for encoding the offset. Can be used. More specifically, Truncated unary encoding with the maximum value and th, or Truncated Rice encoding can be used.
 また、上記クリップ処理1および2を組み合わせて得られるクリップ処理も本実施形態に含まれる。また、適応オフセットフィルタ80は、オフセットクリップ部812を備えない構成としてもよい。 Further, 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は、オフセットの精度に合わせ、処理対象のQAOUの階層の深度に応じて、クリップ範囲を切り換える。具体的に、オフセットの精度が、処理対象のQAOUの階層の深度が閾値よりも小さい場合はnビット、処理対象のQAOUの階層の深度が閾値以上の場合はnビットのときを考える。このとき、オフセットクリップ部812は、処理対象のQAOUの階層の深度が閾値よりも小さければ、クリップ範囲を-2nA/2~2nA/2-1とする。また、処理対象のQAOUの階層の深度が閾値以上であれば、クリップ範囲を-2nA/2~2nA/2-1とした上で、下位の(n-n)ビットを「0」とする。これにより、オフセットクリップ部812によって、クリップ処理されたオフセットを用いて処理を行うオフセット情報選択部813に対し、オフセットの精度を考慮せずに処理を行わせることができる。 Also, the offset clip unit 812 switches the clip range according to the depth of the QAOU hierarchy to be processed in accordance with the offset accuracy. Specifically, it is assumed that the accuracy of the offset is n A bits when the depth of the QAOU hierarchy to be processed is smaller than the threshold, and n B bits when the depth of the QAOU hierarchy to be processed is equal to or greater than the threshold. At this time, if the depth of the QAOU layer to be processed is smaller than the threshold, the offset clip unit 812 sets the clip range to −2 nA / 2 to 2 nA / 2 −1. If the depth of the QAOU layer to be processed is equal to or greater than the threshold, the clip range is set to −2 nA / 2 to 2 nA / 2 −1, and the lower (n A −n B ) bits are set to “0”. " Thereby, the offset clip unit 812 can cause the offset information selection unit 813 that performs processing using the clipped offset to perform processing without considering the offset accuracy.
 (オフセット情報選択部813)
 オフセット情報選択部813は、RDコスト(Rate-Distortion cost)がより小さくなるオフセットタイプ、クラス、オフセットの組み合わせ、および、それに対応するQAOU分割構造を決定し、決定したオフセットタイプ、クラス、オフセットおよび、それに対応するQAOM分割構造を示す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 QAOM 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の処理について図17、19、20を参照してより具体的に説明すれば以下の通りである。図17は、オフセット情報選択部813による処理の流れを示すフローチャートである。 The processing of the offset information selection unit 813 will be described in more detail with reference to FIGS. FIG. 17 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のループは、オフセットタイプ1からオフセットタイプ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. The second loop is a loop from offset type 1 to offset type 6.
 (ステップS303)
 続いて、オフセット情報選択部813は、対象オフセットタイプについて、対象QAOMUにおけるオフセットフィルタ済復号画像P_OFと符号化対象画像#10との二乗誤差を対算出する。
(Step S303)
Subsequently, the offset information selection unit 813 calculates the 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の具体的な処理例を、図19、20を参照して説明すれば以下の通りである。 A specific processing example of the offset information selection unit 813 in this step will be described with reference to FIGS.
 図19は、QAOUインデックスが「x」のQAOUについて、オフセットタイプそれぞれについての2乗誤差を算出する概要を示す図である。図19に示すように、オフセット情報選択部813は、全てのQAOMUについて、オフセットタイプそれぞれについての2乗誤差を算出する。そして、算出した2乗誤差が最小となるオフセットタイプを当該QAOUのオフセットタイプとする。これにより、全てのQAOMU(QAOMU番号0~340)について、オフセットタイプが決定する。 FIG. 19 is a diagram showing an outline of calculating a square error for each offset type for a QAOU with a QAOU index “x”. As illustrated in FIG. 19, 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. As a result, the offset type is determined for all QAOMUs (QAOMU numbers 0 to 340).
 次に、オフセット情報選択部813は、分割深度を0としたときのRDコストと分割深度を1とした場合のRDコストを計算する(図20(a))。図20(a)では、分割深度1のRDコストが分割深度0のRDコストよりも小さいものとする(図20(b))。 Next, the offset information selection unit 813 calculates the RD cost when the division depth is 0 and the RD cost when the division depth is 1 (FIG. 20A). In FIG. 20A, it is assumed that the RD cost at the division depth 1 is smaller than the RD cost at the division depth 0 (FIG. 20B).
 続いて、オフセット情報選択部813は、分割深度を2とした場合のRDコストを計算する(図20(c))。 Subsequently, the offset information selection unit 813 calculates the RD cost when the division depth is set to 2 (FIG. 20 (c)).
 続いて、オフセット情報選択部813は、分割深度1のQAOMUのRDコストと該分割深度1のQAOMUに含まれる分割深度2のQAOMUのRDコストとを比較し、分割深度2のQAOMUのRDコストの方が小さい場合には、該分割深度1のQAOMUを分割深度2のQAOMUに更新する(図20(d))。この処理を最大の分割深度に到達するまで繰り返す。これによって、RDコストがより小さくなるQAOU分割構造が決定される。 Subsequently, the offset information selection unit 813 compares the RD cost of the QAOMU with the division depth 1 with the RD cost of the QAOMU with the division depth 2 included in the QAOMU with the division depth 1, and determines the RD cost of the QAOMU with the division depth 2 If it is smaller, the QAOMU with the division depth 1 is updated to the QAOMU with the division depth 2 (FIG. 20 (d)). This process is repeated until the maximum division depth is reached. As a result, a QAOU partition structure with a smaller RD cost is determined.
 (適応オフセットフィルタ処理部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とのクリップを用いて画素値を補正する。下限値c1および上限値c2の例としては、例えば、c1=16、c2=235を挙げることができる。 Also, a configuration using an adaptive clip type may be used. 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 using a clip of the lower limit value c1 and the upper limit value c2 without using an offset. Examples of the lower limit value c1 and the upper limit value c2 include c1 = 16 and c2 = 235.
 適応クリップタイプを用いることにより、オフセットの符号化処理や多数のオフセットを保持するメモリが不要となる。なお、クリップの下限値および上限値を、固定値でなく適応的に与える場合には、下限値と上限値とを符号化すればよい。この場合は、それぞれ適当な固定値からの差分、たとえば下限値は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 the 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)
 また、上述したように、「QAOUの階層の深度に応じて」とは、「QAOUのサイズに応じて」ということもできる。すなわち、QAOUのサイズに応じてSAOのタイプ数、クラス数やオフセット精度を異ならせてもよい。
(Appendix 1)
Further, as described above, “according to the depth of the QAOU hierarchy” can also be referred to as “according to the size of the QAOU”. That is, the number of SAO types, the number of classes, and the offset accuracy may be varied according to the size of the QAOU.
 例えば、QAOUのサイズがN×N画素未満である場合は、SAOのタイプ数、クラス数、およびオフセット精度のうち、1または複数を、QAOUのサイズがN×N画素以上である場合よりも制限する構成であってもよい。Nの具体例としては、例えばN=64(LCUのサイズ)を挙げることができる。 For example, when the QAOU size is less than N × N pixels, one or more of the number of SAO types, the number of classes, and the offset accuracy are more limited than when the QAOU size is N × N pixels or more. It may be configured to. Specific examples of N include N = 64 (LCU size).
 また、SAOのタイプ数の制限としては、例えば、EOを水平および垂直タイプに制限する、BOを1種類にする(変換テーブル802C)、EOのみを用いてBOを用いない(変換テーブル802A)、水平タイプのEOおよびBOのいずれかだけを用いる(変換テーブル801B、変換テーブル802D)、などを挙げることができる。オフセット情報復号部611においては括弧内に示す変換テーブルを用いる。なお、SAOのクラス数の制限、およびオフセット精度の制限については、上述した実施形態と同様の方法で行うことができる。 The number of SAO types is limited, for example, by limiting EO to horizontal and vertical types, using only one type of BO (conversion table 802C), using only EO and not using BO (conversion table 802A), Only one of horizontal type EO and BO can be used (conversion table 801B, conversion table 802D). The offset information decoding unit 611 uses a conversion table shown in parentheses. Note that the limitation on the number of SAO classes and the limitation on offset accuracy can be performed in the same manner as in the above-described embodiment.
 このように、SAOのタイプの種類、タイプ数、クラス数、およびオフセット精度を制限することにより、メモリの使用量削減や、処理負荷の軽減を行うことができる。特に、タイプの種類をBOに制限する場合や、EOを水平および垂直タイプに制限する場合には、符号化装置、および復号装置のクラス分類部の処理負荷を軽減することができる。また、タイプ数を制限する場合には、最適なタイプを選択するためのコスト計算を省くことができることから、符号化装置の処理負荷を軽減することができる。タイプの種類をEOに制限すること、クラス数およびオフセット精度を制限することによりオフセットを蓄積するメモリの使用量削減ができる。また、タイプの種類を水平タイプのEOおよびBOに制限することにより、クラス分類に用いる参照画素を保持するラインメモリなどの一時的メモリを削減することができ、また、参照画素の復号を待つ間の遅延を短くすることができる。なお、メモリの使用量の削減には、BOのクラス数を制限する方が、EOのクラス数を制限するよりも効果的である。 Thus, by limiting the type of SAO type, the number of types, the number of classes, and the offset accuracy, it is possible to reduce the amount of memory used and the processing load. In particular, when the type type is limited to BO, or when EO is limited to horizontal and vertical types, the processing load on the class classification unit of the encoding device and the decoding device can be reduced. Further, when the number of types is limited, the cost calculation for selecting the optimum type can be omitted, so that the processing load on the encoding device can be reduced. Limiting the type of type to EO and limiting the number of classes and offset accuracy can reduce the amount of memory used to store offset. In addition, by limiting the type types to horizontal type EO and BO, temporary memory such as a line memory holding reference pixels used for class classification can be reduced, and while waiting for decoding of reference pixels The delay can be shortened. In order to reduce the amount of memory used, it is more effective to limit the number of BO classes than to limit the number of EO classes.
 このような制限は、図32~図34に示す手段の構成により、パラメータ条件をQAOUNのサイズとした場合に、パラメータ条件に応じて適応的にオフセット情報復号部611、クラス分類部624の動作を変更することで実現できる。 Such a limitation is that the operations of the offset information decoding unit 611 and the class classification unit 624 are adaptively performed according to the parameter condition when the parameter condition is set to the size of QAOUN by the configuration of the means shown in FIGS. It can be realized by changing.
 (付記事項2)
 また、輝度値に対してオフセットを加えるQAOU(以下、輝度ユニットとも言う)のサイズと、色差に対してオフセットを加えるQAOU(以下、色差ユニットとも言う)のサイズとを異ならせ、色差ユニットでは、輝度ユニットよりも、SAOのタイプの種類、タイプ数、クラス数、オフセット精度、および分割の最大階層を制限する構成であってもよい。
(Appendix 2)
Further, the size of a QAOU (hereinafter also referred to as a luminance unit) for adding an offset to the luminance value is different from the size of a QAOU (hereinafter also referred to as a color difference unit) for adding an offset to the color difference. The configuration may be such that the type of SAO, the number of types, the number of classes, the offset accuracy, and the maximum division hierarchy are limited rather than the luminance unit.
 例えば、YUV形式の画像フォーマットにおける4:2:0形式等、輝度と色差とで解像度が異なり、色差の解像度が輝度よりも低いデータ形式であれば、色差の分割の細かさは輝度ほどには必要なくなる。そこで、色差ユニットについて、SAOのタイプの種類、タイプ数、クラス数、オフセット精度、および分割の最大階層を制限することにより、メモリの使用量削減や、処理負荷の軽減を行うことができる。なお、色差ユニットの最大階層の制限は、例えば、SAOのツリー構造の最大深度を、輝度ユニットよりも浅くすることにより可能である。 For example, if the resolution differs between luminance and color difference, such as 4: 2: 0 format in the YUV format image format, and the color difference resolution is lower than the luminance, the fineness of the color difference division is as low as the luminance. No longer needed. Therefore, by limiting the types of SAO types, the number of types, the number of classes, the offset accuracy, and the maximum division hierarchy for the color difference unit, it is possible to reduce the amount of memory used and the processing load. Note that the restriction on the maximum hierarchy of the color difference units can be achieved, for example, by making the maximum depth of the SAO tree structure shallower than that of the luminance unit.
 このような制限は、図32~図34に示す手段の構成により、パラメータ条件をQAOUNのサイズとした場合に、パラメータ条件に応じて適応的にオフセット情報復号部611、クラス分類部624の動作を変更することで実現できる。 Such a limitation is that the operations of the offset information decoding unit 611 and the class classification unit 624 are adaptively performed according to the parameter condition when the parameter condition is set to the size of QAOUN by the configuration of the means shown in FIGS. It can be realized by changing.
 特に、輝度と色差のどちらにもSAO処理を行う場合には、色成分毎にクラス分類に用いる参照画素を保持するラインメモリなどの一時的メモリを備える必要がある。輝度成分は色差成分に比べ重要度が低いことから、パラメータ条件を色差成分として、タイプの種類を水平タイプのEOおよびBOに制限することにより、色差成分でのラインメモリを削減することができる。この場合、オフセット情報復号部611では、変換テーブル801B、変換テーブル802Dなどの変換テーブルを用いる。 In particular, when performing SAO processing for both luminance and color difference, it is necessary to provide a temporary memory such as a line memory that holds reference pixels used for class classification for each color component. Since the luminance component is less important than the color difference component, it is possible to reduce the line memory of the color difference component by limiting the type type to the horizontal type EO and BO with the parameter condition as the color difference component. In this case, the offset information decoding unit 611 uses conversion tables such as a conversion table 801B and a conversion table 802D.
 また、パラメータ条件を色差成分として、輝度成分に比べオフセットの精度を小さくすることも特に有効である。例えば、輝度成分のオフセットの精度を
 SAO_DEPTH = MIN(PIC_DEPTH、AY)
 シフト値 = PIC_DEPTH―MIN(PIC_DEPTH、AY)
として、色差成分の場合には、オフセットの精度、シフト値を、
 SAO_DEPTH = MIN(PIC_DEPTH、THC)
 シフト値 = PIC_DEPTH―MIN(PIC_DEPTH、AC)
のように求める場合に、精度を制御する変数AY、ACとしてAY>ACを用いることが適当である。例えば、AY=10もしくは9、AC=8とする。この場合、輝度成分のオフセットの精度は、色差成分よりも大きいものとなる。シフト値については輝度成分のシフト値が、色差成分よりも小さい値となる。
It is also particularly effective to set the parameter condition as a color difference component and reduce the offset accuracy compared to the luminance component. For example, the accuracy of luminance component offset is SAO_DEPTH = MIN (PIC_DEPTH, AY)
Shift value = PIC_DEPTH-MIN (PIC_DEPTH, AY)
In the case of color difference components, the offset accuracy and shift value are
SAO_DEPTH = MIN (PIC_DEPTH, THC)
Shift value = PIC_DEPTH-MIN (PIC_DEPTH, AC)
In this case, it is appropriate to use AY> AC as the variables AY and AC for controlling accuracy. For example, AY = 10 or 9, and AC = 8. In this case, the accuracy of the luminance component offset is larger than that of the color difference component. Regarding the shift value, the shift value of the luminance component is smaller than the color difference component.
 (付記事項3)
 また、CUの量子化パラメータQPの値(QP値)が閾値以上の場合に、SAOのタイプの種類、タイプ数、クラス数、オフセット精度、および分割の最大階層を制限する構成であってもよい。QP値は、ピクチャの初期のQP値を用いてもよいし、SAOの処理対象QAOUがLCUやCUの境界に沿っている場合には、QAOUの左上座標もしくは中心座標に対応する位置のCUのQP値を用いてもよい。
(Appendix 3)
Further, when the value of the CU quantization parameter QP (QP value) is equal to or greater than a threshold value, the type of SAO type, the number of types, the number of classes, the offset accuracy, and the maximum division hierarchy may be limited. . As the QP value, the initial QP value of the picture may be used. When the SAO processing target QAOU is along the boundary of the LCU or CU, the CU value at the position corresponding to the upper left coordinate or the center coordinate of the QAOU is used. A QP value may be used.
 QP値は、その値が高いほど予測画像の画質は低くなり、詳細な分類およびオフセットの補正が困難となるため、SAOのタイプの種類、タイプ数、クラス数、オフセット精度、および分割の最大階層を制限しても、画質に与える影響が小さい。そこで、QP値が閾値以上の場合に、SAOのタイプ数、クラス数、オフセット精度、および分割の最大階層を制限する構成にすれば、画質に影響を与えることなく、メモリの使用量削減や、処理負荷の軽減を行うことができる。 The higher the QP value, the lower the image quality of the predicted image, and it becomes difficult to perform detailed classification and offset correction. Therefore, the type of SAO, the number of types, the number of classes, the offset accuracy, and the maximum hierarchy of division Even if it is limited, the effect on the image quality is small. Therefore, when the QP value is equal to or greater than the threshold, if the configuration is such that the number of SAO types, the number of classes, the offset accuracy, and the maximum hierarchy of division are limited, the memory usage can be reduced without affecting the image quality, Processing load can be reduced.
 このような制限は、図32~図34に示す手段の構成により、パラメータ条件をQPとした場合に、パラメータ条件に応じて適応的にオフセット情報復号部611、クラス分類部624の動作を変更することで実現できる。 Such a limitation is that the operations of the offset information decoding unit 611 and the class classification unit 624 are adaptively changed according to the parameter condition when the parameter condition is QP by the configuration of the means shown in FIGS. This can be achieved.
 (付記事項4)
 また、特定タイプのピクチャ、例えばBピクチャや非参照ピクチャ(IDRピクチャ)では、SAOのタイプの種類、タイプ数、クラス数、オフセット精度、および分割の最大階層を制限する構成であってもよい。
(Appendix 4)
In addition, for a specific type of picture, such as a B picture or a non-reference picture (IDR picture), the type of SAO type, the number of types, the number of classes, the offset accuracy, and the maximum hierarchy of division may be limited.
 IピクチャやPピクチャでは、そのピクチャの画質が、後のピクチャに大きな影響を与えるためSAOの精度を高く保つ必要がある。一方で、これ以外のピクチャでは、後のピクチャに大きな影響を与えることはないので、これらのピクチャ(Bピクチャ、IDRピクチャ)について、SAOのタイプの種類、タイプ数、クラス数、オフセット精度、および分割の最大階層を制限してもよい。これにより、メモリの使用量削減や、処理負荷の軽減を行うことができる。 In the case of an I picture or a P picture, the picture quality of the picture has a great influence on the subsequent pictures, so it is necessary to keep the accuracy of the SAO high. On the other hand, since the pictures other than this do not greatly affect the subsequent pictures, the type of SAO, the number of types, the number of classes, the offset accuracy, and the like for these pictures (B picture, IDR picture) and The maximum hierarchy of division may be limited. As a result, the memory usage can be reduced and the processing load can be reduced.
 このような制限は、図32~図34に示す手段の構成により、パラメータ条件をピクチャの種類とした場合に、パラメータ条件に応じて適応的にオフセット情報復号部611、クラス分類部624の動作を変更することで実現できる。 Such a limitation is that the operations of the offset information decoding unit 611 and the class classification unit 624 are adaptively performed according to the parameter condition when the parameter condition is a picture type by the configuration of the means shown in FIGS. It can be realized by changing.
 (付記事項5)
 また、画面上におけるQAOUの位置に応じて、SAOのタイプ数、クラス数、オフセット精度、および分割の最大階層を制限する構成であってもよい。
(Appendix 5)
Further, the configuration may be such that the number of SAO types, the number of classes, the offset accuracy, and the maximum division hierarchy are limited according to the position of the QAOU on the screen.
 例えば、画面の周縁では、SAOのタイプ数、クラス数、オフセット精度、および分割の最大階層を制限してもよい。 For example, at the edge of the screen, the number of SAO types, the number of classes, the offset accuracy, and the maximum division hierarchy may be limited.
 画面の中央付近は、ユーザが注目しやすいため、画質を下げると、そのまま主観画質が低下してしまうが、画面の周縁において画質を下げても、主観画質は画面中央付近ほどは低下しない。 Since the area near the center of the screen is easy for the user to pay attention to, if the image quality is lowered, the subjective image quality is lowered as it is, but even if the image quality is lowered at the periphery of the screen, the subjective image quality is not lowered as much as the area near the center of the screen.
 また、画面端を超えるサンプル点が必要となるSAOタイプを用いなければ、境界判定処理を軽減することができる。 Boundary determination processing can be reduced if the SAO type that requires sample points exceeding the screen edge is not used.
 このような制限は、図32~図34に示す手段の構成により、パラメータ条件をQAOUの位置とした場合に、パラメータ条件に応じて適応的にオフセット情報復号部611、クラス分類部624の動作を変更することで実現できる。 Such a limitation is that the operations of the offset information decoding unit 611 and the class classification unit 624 are adaptively performed according to the parameter condition when the parameter condition is set to the position of QAOU by the configuration of the means shown in FIGS. It can be realized by changing.
 〔実施の形態2〕
 本発明の他の実施の形態について図21に基づいて説明すれば、以下のとおりである。本実施形態において、上記実施形態と異なるのは、画素値に応じて、EOとBOとを切り換える点である。
[Embodiment 2]
The following will describe another embodiment of the present invention with reference to FIG. The present embodiment is different from the above embodiment in that EO and BO are switched according to the pixel value.
 本願発明者等は、画素において、中間階調域では、BOよりもEOの方が効果が高く、その他の値域(低画素値域・高画素値域)ではBOの方が効果が高いという特性を発見した。そこで、本実施形態では、低画素値域、および高画素値域ではBOを用い、中間階調域はEOを用いている。 The inventors of the present application have found that EO is more effective than BO in the middle gradation range, and that BO is more effective in other value ranges (low pixel value range / high pixel value range). did. Therefore, in the present embodiment, BO is used in the low pixel value region and the high pixel value region, and EO is used in the intermediate gradation region.
 具体的に、図21を参照して説明する。図21は、画素値によってEOとBOとを切り換える構成を説明するための図であり、(a)は、画素値によってEOとBOとを切り換える構成の概要を説明するための図であり、(b)は、具体的な切り換えの値を説明するための図であり、(c)は、オフセット情報格納部621に格納されるリストメモリの内容を示す図である。 Specific description will be given with reference to FIG. FIG. 21 is a diagram for explaining a configuration for switching between EO and BO according to pixel values, and (a) is a diagram for explaining an outline of a configuration for switching between EO and BO according to pixel values. (b) is a diagram for explaining specific switching values, and (c) is a diagram showing the contents of the list memory stored in the offset information storage unit 621.
 図21(a)に示すように、本実施形態では、画素値(輝度値)が0近辺、および255近辺では、BOを用い、それ以外の値域ではEOを用いる。すなわち、画素値によってSAOタイプを分類し、画素値が0近辺、および255近辺では、画素値に応じたオフセットを加算し、それ以外の地域では、エッジの種類に応じたオフセットを加算する。 As shown in FIG. 21 (a), in this embodiment, when the pixel value (luminance value) is near 0 and around 255, BO is used, and EO is used in other value ranges. That is, the SAO type is classified according to the pixel value, and when the pixel value is around 0 and around 255, an offset corresponding to the pixel value is added, and in other regions, an offset corresponding to the edge type is added.
 本願発明者等の実験の結果、EOとBOとは、用いられる画素値の範囲にそれぞれ偏りがみられた。すなわち、EOは中間階調域に多いということがわかった。これは、低画素値域および高画素値域では、誤差への影響は、エッジの種類よりも画素値の方が大きい傾向があるということを意味している。 As a result of experiments by the inventors of the present application, EO and BO were found to be biased in the range of pixel values used. That is, it was found that EO is often in the intermediate gradation range. This means that in the low pixel value range and the high pixel value range, the influence on the error tends to be larger in the pixel value than in the edge type.
 そこで、本実施形態では、EOとBOとを、画素値域に応じて決定し、1つのSAOタイプでEOおよびBOの両者における誤差補正効果が高い部分を利用する構成としている。これにより、符号化効率を向上させることができる。また、SAOタイプ数や総クラス数を減少させることができるので、メモリの使用量の削減、および処理負荷を軽減することができる。 Therefore, in the present embodiment, EO and BO are determined according to the pixel value range, and a single SAO type uses a portion having a high error correction effect in both EO and BO. Thereby, encoding efficiency can be improved. In addition, since the number of SAO types and the total number of classes can be reduced, it is possible to reduce the amount of memory used and the processing load.
 次に、本実施の形態について、より詳細に説明する。まず、本実施の形態では、上記実施の形態1と異なり、“sao_type_idx”について1~4までを用い、これらを次のように定義する。
・“sao_type_idx”=1:(BO_EO_0) 実施の形態1のEO_0+BOに相当
・“sao_type_idx”=2:(BO_EO_1) 実施の形態1のEO_1+BOに相当
・“sao_type_idx”=3:(BO_EO_2) 実施の形態1のEO_2+BOに相当
・“sao_type_idx”=4:(BO_EO_3) 実施の形態1のEO_3+BOに相当
 また、実施の形態1におけるEO_0~3、および BO_0,1は用いない。
Next, this embodiment will be described in more detail. First, unlike the first embodiment, the present embodiment uses 1 to 4 for “sao_type_idx” and defines them as follows.
“Sao_type_idx” = 1: (BO_EO_0) Corresponds to EO_0 + BO of the first embodiment “sao_type_idx” = 2: (BO_EO_1) Corresponds to EO_1 + BO of the first embodiment “sao_type_idx” = 3: (BO_EO_2) Embodiment “Sao_type_idx” = 4: (BO_EO_3) Corresponding to EO_3 + BO of the first embodiment Also, EO_0 to 3 and BO_0, 1 of the first embodiment are not used.
 そして、クラス分類部624は、図21(b)に示すように、図13の変換テーブル1301におけるBoTbl[BO_1]を用いてクラス分類を行う。そして、画素値がmaxの1/4以下、およびmaxの3/4以上であれば、変換テーブル1301を用いて、クラス分類を行う。 And the class classification | category part 624 performs a class classification | category using BoTbl [BO_1] in the conversion table 1301 of FIG. 13, as shown in FIG.21 (b). If the pixel value is ¼ or less of max and ¾ or more of max, classification is performed using the conversion table 1301.
 また、画素値が、maxの1/4と3/4との間であれば、上記実施の形態1に説明したEO_0~3に応じてエッジタイプを判定し、クラス分類を行う。 If the pixel value is between 1/4 and 3/4 of max, the edge type is determined according to EO_0 to 3 described in the first embodiment, and class classification is performed.
 これにより、クラス分類部624は、BOとEOとを画素値によって切り換えてクラスを分類することができる。 Thereby, the class classification unit 624 can classify the class by switching between BO and EO according to the pixel value.
 また、オフセット算出部811は、上記実施の形態1で説明したオフセットの算出方法と同様の方法でオフセットを算出する。ただし、本実施の形態では、オフセットタイプの種類数が4つなので、この点を異ならせて算出する。 Also, the offset calculation unit 811 calculates the offset by the same method as the offset calculation method described in the first embodiment. However, in the present embodiment, since the number of types of offset types is four, this point is calculated differently.
 また、オフセット情報格納部621に格納されるリストメモリ2101は、図21(c)に示すように、QAOUインデックスとオフセットタイプと該オフセットタイプにおいて選択可能な各クラスに関するオフセットの具体的な値とが互いに関連付けられて格納されている。 Further, as shown in FIG. 21C, the list memory 2101 stored in the offset information storage unit 621 has a QAOU index, an offset type, and a specific offset value for each class that can be selected in the offset type. Stored in association with each other.
 なお、EOとBOとの特徴を併せ持つオフセットタイプを用いる場合に、まず、EOを用いてクラス分類を行い、特定のクラス(エッジが平坦なクラス)について、BOを用いてさらにクラス分類する構成であってもよい。また、実施の形態1に記載したEOおよびBOをそのまま併用する構成であってもよい。さらに、上記実施の形態1に記載した条件(QAOUの階層の深度が閾値より小さいか否か)によって、EOとBOとの特徴を併せ持つオフセットタイプを設けるか否かを変更して、タイプ数やクラス数を削減する構成であってもよい。 In the case of using an offset type having both characteristics of EO and BO, first, classification is performed using EO, and a specific class (a class having a flat edge) is further classified using BO. There may be. Moreover, the structure which uses EO and BO described in Embodiment 1 together as it is may be sufficient. Further, according to the condition described in the first embodiment (whether or not the depth of the QAOU hierarchy is smaller than a threshold value), whether or not to provide an offset type having the characteristics of EO and BO is changed. It may be configured to reduce the number of classes.
 〔実施の形態3〕
 本発明の他の実施の形態について図22、23、33に基づいて説明すれば、以下のとおりである。本実施形態において、上記実施形態と異なるのは、EOのクラス分類において、エッジの判定に用いる画素を、判定対象の画素の水平方向に存在する画素のみに限定する点である。
[Embodiment 3]
The following will describe another embodiment of the present invention with reference to FIGS. The present embodiment is different from the above embodiment in that, in the EO classification, the pixels used for edge determination are limited to only the pixels existing in the horizontal direction of the determination target pixel.
 上記実施の形態では、対象画素の上または下方向に存在する画素についても、エッジの判定に用いられていた。そのため、対象画素の上方向に存在する画素(オフセット処理済みの画素)については、当該画素のオフセット処理前の画素値を保持しておくラインバッファが必要となっていた。 In the above embodiment, pixels that exist above or below the target pixel are also used for edge determination. For this reason, a line buffer that holds the pixel value of the pixel before the offset processing is necessary for the pixel that exists in the upper direction of the target pixel (pixel that has undergone the offset processing).
 そこで、エッジの判定に用いる画素を、対象画素の水平方向に存在する画素に限定すれば、上方向への参照がなくなるため、ラインバッファ分のメモリの使用量を削減することができる。また、上方向の境界判定(画面端など)が不要となるので、処理量も削減できる。 Therefore, if the pixels used for the edge determination are limited to the pixels existing in the horizontal direction of the target pixel, there is no need to refer to the upper direction, and the amount of memory used for the line buffer can be reduced. In addition, since the upper boundary determination (such as the screen edge) is unnecessary, the processing amount can be reduced.
 また、水平方向に存在する画素のみを用いる場合、前回までの処理結果を流用することが可能となるため、さらに処理量を削減することができる。図22(a)を参照して説明する。図22(a)は、水平方向に存在する画素を示しており、x0~x3は、それぞれの画素の画素値である。 In addition, when only the pixels existing in the horizontal direction are used, the processing result up to the previous time can be used, so that the processing amount can be further reduced. This will be described with reference to FIG. FIG. 22A shows pixels existing in the horizontal direction, and x0 to x3 are pixel values of the respective pixels.
 まず、画素値x1の画素について、両隣との差分は、以下の通りである。
s1=sign(x1-x0)-sign(x2-x1)
 次に、画素値x2の画素について、両隣との差分を算出すると、以下の通りとなる。
s2=sign(x2-x1)-sign(x3-x2)
 ここで、s1、s2はx1、x2におけるエッジのクラス分類に用いられる値である。
First, with respect to a pixel having a pixel value x1, the difference from both sides is as follows.
s1 = sign (x1-x0) -sign (x2-x1)
Next, the difference between both sides of the pixel having the pixel value x2 is calculated as follows.
s2 = sign (x2-x1) -sign (x3-x2)
Here, s1 and s2 are values used for classifying the edge at x1 and x2.
 このように、s2を算出する場合に、s1で用いたsign(x2-x1)を再利用している。よって、この分だけ、処理量を減らすことができる。 Thus, when calculating s2, the sign (x2-x1) used in s1 is reused. Therefore, the processing amount can be reduced by this amount.
 次に、本実施形態の詳細について説明する。本実施形態では、EOのタイプを2種類にしている。すなわち、“sao_type_idx”=1,2の場合のみを、エッジオフセット(EO)としている。そして、“sao_type_idx”=1(EO_0)のときは、対象画素の左右の画素と比較してエッジの種類を導出し(図22(b))、“sao_type_idx”=2(EO´_0)のときは、対象画素の左右で、2画素離れた位置にある画素と比較してエッジの種類を導出する(図22(c))。 Next, details of this embodiment will be described. In this embodiment, there are two types of EO. That is, only when “sao_type_idx” = 1, 2 is set as an edge offset (EO). When “sao_type_idx” = 1 (EO_0), the edge type is derived as compared with the left and right pixels of the target pixel (FIG. 22B), and when “sao_type_idx” = 2 (EO′_0) Derives the type of edge compared to the pixel located two pixels away from the left and right of the target pixel (FIG. 22C).
 なお、“sao_type_idx”=3、4の場合はバンドオフセット(BO)となる。これは、上記実施の形態1において、“sao_type_idx”=5、6の場合をそれぞれ3、4と読み替えればよい。 In addition, when “sao_type_idx” = 3, 4 is a band offset (BO). This may be read as “3, 4” in the case of “sao_type_idx” = 5, 6 in the first embodiment.
 上記“sao_type_idx”=2の場合に、対象画素の両隣からさらに1画素分離れた画素を用いてエッジの種類を判定するのは、水平に対して角度の浅いエッジの検出を容易にするためである。図22(d)に示すように、対象画素の両隣の画素を比較対象とした場合、画素値の差分が小さく、エッジとは判定されない場合がある。このような場合であっても、さらに1画素分隣の画素との差分をとれば、水平に対して角度の浅いエッジを検出することが可能となる。 In the case of “sao_type_idx” = 2, the edge type is determined using a pixel further separated by 1 pixel from both sides of the target pixel in order to facilitate detection of an edge having a shallow angle with respect to the horizontal. is there. As shown in FIG. 22D, when the pixels adjacent to the target pixel are set as comparison targets, the difference between the pixel values may be small and may not be determined as an edge. Even in such a case, it is possible to detect an edge having a shallow angle with respect to the horizontal by taking a difference from the adjacent pixel by one pixel.
 また、対象画素の両隣ではなく、左側は隣の画素、右側は1画素さらに隣の画素(図23(a))との差分を用いてもよいし、この逆(図23(b))を用いてもよい。これは、参照画素が画面の端に当たる場合に特に有効である。 Further, instead of using both sides of the target pixel, the left side may be the adjacent pixel, the right side may be the difference of one pixel and the adjacent pixel (FIG. 23A), or vice versa (FIG. 23B). It may be used. This is particularly effective when the reference pixel hits the edge of the screen.
 さらに、水平方向の画素のみを用いる場合を限定する構成であってもよい。例えば、Bピクチャや非参照ピクチャなどの他のピクチャへの影響が小さいピクチャの場合のみ、水平方向のみの画素を参照し、これ以外の場合は、上記実施の形態1と同様とする構成であってもよい。また、画面端やスライス境界付近などでは、水平方向のみの画素を参照し、これ以外は、上記実施の形態1と同様とする構成であってもよい。このようにすれば、メモリの使用量を削減できるとともに、処理量の削減も可能となる。また、上方向の参照を行わないので、画面端やスライス境界付近での境界の判定処理も軽減できる。 Furthermore, the configuration may be such that only the horizontal pixels are used. For example, only the picture in the horizontal direction is referred to only in the case of a picture that has little influence on other pictures such as a B picture and a non-reference picture, and in other cases, the configuration is the same as in the first embodiment. May be. Also, in the vicinity of the screen edge or near the slice boundary, pixels in the horizontal direction are referred to, and other configurations may be the same as in the first embodiment. In this way, the amount of memory used can be reduced and the amount of processing can also be reduced. Further, since no upward reference is performed, the boundary determination process near the screen edge or slice boundary can be reduced.
 また、ピクチャやブロック単位で、フラグで明示的に指定する構成であってもよい。
例えば、水平エッジ(図23(c)))が多い場合には、上記実施の形態1に記載した方法で処理を行うようにすれば、性能が低下することを防止することができる。
Further, it may be configured to be explicitly specified by a flag in units of pictures or blocks.
For example, when there are many horizontal edges (FIG. 23 (c)), if the process is performed by the method described in the first embodiment, it is possible to prevent the performance from being deteriorated.
 また、上記実施の形態1に記載した条件(QAOUの階層の深度が閾値よりも小さいか否か)によって、水平方向に存在する画素のみを用いる構成とするか否かを変更してもよい。さらに、上記実施の形態2に記載したような、BOとEOとを併用する場合に限り、EOについては、水平方向に存在する画素のみを用いる構成としてもよい。 Also, whether or not to use only the pixels that exist in the horizontal direction may be changed according to the condition described in the first embodiment (whether the depth of the QAOU hierarchy is smaller than a threshold). Furthermore, only in the case where BO and EO are used in combination as described in the second embodiment, EO may be configured to use only pixels that exist in the horizontal direction.
 また、水平方向に存在する画素との差分が、閾値よりも大きい(または小さい)か否かによって、エッジの種類を導出してもよい。具体的には、以下の式にしたがって、クラスを分類してもよい。 Further, the type of edge may be derived depending on whether or not the difference from the pixel existing in the horizontal direction is larger (or smaller) than the threshold value. Specifically, classes may be classified according to the following formula.
  Sign(z)=+1 (z>thのとき)
  Sign(z)=0  (-th≦z≦thのとき)
  Sign(z)=-1 (z<-thのとき)
 ここで、thは、予め定められた値を有する閾値である。
Sign (z) = + 1 (when z> th)
Sign (z) = 0 (when −th ≦ z ≦ th)
Sign (z) =-1 (when z <-th)
Here, th is a threshold value having a predetermined value.
 また、色差を表す画素値の場合は、エッジオフセットにおいて、水平方向に存在する画素のみを用いる構成としてもよい。 In the case of a pixel value representing a color difference, only a pixel that exists in the horizontal direction may be used in the edge offset.
 水平に限定する効果は、水平エッジ分類方法が1つのみである場合、例えば、図22(b)のみの場合だけでも得ることができる。上記のように、複数の異なる水平エッジ分類方法を組み合わせる場合には、1つの水平エッジ分類方法、例えば図22(b)を用いる場合よりも、より細かいエッジの分類が可能である。なお、複数の水平エッジ分類方法を用いる場合の組み合わせは、図22(b)、(c)のように、対象画素と参照画素の距離を変更して2つの例を用いる場合に限らず、エッジの種類を導出する場合に用いる閾値を2つ用いる構成でも良い。例えば、上記閾値thが0である場合と1である場合の2つの水平エッジ分類方法を備えてもよい。 The effect of limiting to the horizontal can be obtained when there is only one horizontal edge classification method, for example, only in the case of FIG. As described above, when a plurality of different horizontal edge classification methods are combined, finer edge classification is possible than when one horizontal edge classification method, for example, FIG. 22B is used. Note that the combination in the case of using a plurality of horizontal edge classification methods is not limited to the case of using two examples by changing the distance between the target pixel and the reference pixel, as shown in FIGS. 22B and 22C. A configuration in which two threshold values used in deriving the type of the above are also possible. For example, two horizontal edge classification methods for the case where the threshold th is 0 and 1 may be provided.
 水平方向の画素のみを用いる場合を限定する構成は、実施形態1の図32~図34に示す手段の構成により、パラメータ条件に応じて適応的にオフセット情報復号部611、クラス分類部624の動作を変更することで実現できる。例えば、図32のオフセット情報復号部611において、パラメータ条件に応じて、使用オフセットタイプ選択部6112で選択するオフセットタイプの種類を水平エッジ分類方法のみに限定し、オフセットタイプ復号部6113では限定された種類のオフセットタイプを復号する。 The configuration for limiting the use of only the pixels in the horizontal direction is the operation of the offset information decoding unit 611 and the class classification unit 624 adaptively according to the parameter conditions by the configuration of the means shown in FIGS. 32 to 34 of the first embodiment. It can be realized by changing. For example, in the offset information decoding unit 611 in FIG. 32, the type of offset type selected by the used offset type selection unit 6112 is limited only to the horizontal edge classification method according to the parameter condition, and is limited by the offset type decoding unit 6113. Decodes the type offset type.
 図33(b)で示すように、オフセットタイプ変換テーブル選択部6117は、パラメータ条件に応じてエッジオフセットタイプ及びバンドオフセットタイプ格納部6118´が備える変換テーブルもしくは、水平エッジオフセットタイプ及びバンドオフセットタイプ変換テーブル格納部6119´が備える変換テーブルを選択する。一つの例では、色成分が輝度の場合に、エッジオフセットタイプ及びバンドオフセットタイプ格納部6118´が備える変換テーブルを選択し、色差の場合に、水平エッジオフセットタイプ及びバンドオフセットタイプ変換テーブル格納部6119´が備える変換テーブルを選択する。 As shown in FIG. 33 (b), the offset type conversion table selection unit 6117 is a conversion table provided in the edge offset type and band offset type storage unit 6118 ′ or horizontal edge offset type and band offset type conversion according to the parameter conditions. A conversion table provided in the table storage unit 6119 ′ is selected. In one example, when the color component is luminance, the conversion table provided in the edge offset type and band offset type storage unit 6118 ′ is selected, and in the case of color difference, the horizontal edge offset type and band offset type conversion table storage unit 6119 is selected. A conversion table included in 'is selected.
 クラス分類部624では、内部の使用オフセットタイプ選択部6112において、パラメータ条件に応じて水平エッジ分類方法のみに限定するようなエッジ分類方法を選択し、エッジオフセットクラス分類部6243において画素を分類する。一つの例では、色成分が輝度の場合においては、基本エッジ分類方法を選択し、色成分が色差の場合には、水平エッジ分類方法を選択する。 In the class classification unit 624, the internal use offset type selection unit 6112 selects an edge classification method limited to only the horizontal edge classification method according to the parameter condition, and the edge offset class classification unit 6243 classifies the pixels. In one example, the basic edge classification method is selected when the color component is luminance, and the horizontal edge classification method is selected when the color component is color difference.
 〔実施の形態4〕
 本発明の他の実施の形態について図24~26に基づいて説明すれば、以下のとおりである。本実施形態において、上記実施形態と異なるのは、色差の画素値の中央付近において、オフセット精度を向上させるか、またはクラスの分割を細かくしている点である。
[Embodiment 4]
The following will describe another embodiment of the present invention with reference to FIGS. This embodiment is different from the above embodiment in that the offset accuracy is improved or the class is divided finely in the vicinity of the center of the color difference pixel value.
 画像において、無彩色付近の誤差は主観画質において目立ちやすいという特性がある。各色差の画素値において、無彩色とは、値域の中央であり、ビット深度が8ビットの場合であれば、画素値128の画素の色である。そこで、本実施形態では、BOの場合に、色差の画素値128近辺について、オフセット精度を上げるか、またはより小さなクラス幅を用いてクラス分割を細かくしている。なお、以下では、色差の画素値について無彩色付近の値域を、無彩色値域と呼ぶ。 In the image, the error near the achromatic color has a characteristic that it is easily noticeable in the subjective image quality. In the pixel value of each color difference, the achromatic color is the center of the range, and if the bit depth is 8 bits, it is the color of the pixel having a pixel value of 128. Therefore, in the present embodiment, in the case of BO, the offset accuracy is increased or the class division is made finer by using a smaller class width around the pixel value 128 of the color difference. In the following, a value range near the achromatic color for the pixel value of the color difference is referred to as an achromatic color value range.
 これにより、無彩色値域のオフセット精度を上げることができるので、無彩色値域でのオフセット補正の性能が向上する。よって、無彩色値域での原画像との誤差が減少し、主観画質を向上させることができる。また、無彩色値域において、クラスの分割を他の値域よりも細かく分割することにより、無彩色値域でのオフセット補正をより精密に行うことができる。これにより、原画像との誤差を減少させることができ、主観画質を向上させることができる。 This makes it possible to increase the offset accuracy in the achromatic color value range, thereby improving the offset correction performance in the achromatic color value range. Therefore, an error from the original image in the achromatic color range is reduced, and the subjective image quality can be improved. Further, in the achromatic color value range, the class can be divided more finely than the other value ranges, so that the offset correction in the achromatic color value range can be performed more precisely. Thereby, an error from the original image can be reduced, and the subjective image quality can be improved.
 なお、本実施の形態では、無彩色値域のオフセット精度の向上、およびクラス分割の細分化を行っているが、これに限らず、主観画質に影響しそうな範囲の値に対して、クラス分割を細分化したり、オフセット精度を向上させたりすれば、主観画質を向上させることができる。また、輝度の画素値においても、主観画質上、画質劣化が目立ちやすい画素値域に対して、同様にオフセット精度を上げたり、クラス分割を細分化したりする構成でも同様の効果を奏することができる。 In the present embodiment, the offset accuracy of the achromatic color range is improved and the class division is subdivided, but this is not limiting, and class division is performed for values in a range that is likely to affect subjective image quality. Subjective image quality can be improved by subdividing or improving the offset accuracy. In addition, with respect to the pixel value of luminance, the same effect can be obtained by a configuration in which the offset accuracy is similarly increased or the class division is subdivided in a pixel value range in which image quality degradation is conspicuous in terms of subjective image quality.
 まず、オフセットの精度を向上させる場合について、図24を参照して説明する。図24は、オフセットの精度を向上させる場合についての概要を示す図である。図24に示すように、オフセットの精度を向上させる場合、色差の画素値128付近のオフセットの精度を高精度にし、これ以外の値域のオフセットの精度を低精度とする。 First, the case where the offset accuracy is improved will be described with reference to FIG. FIG. 24 is a diagram showing an outline of a case where the offset accuracy is improved. As shown in FIG. 24, when improving the accuracy of the offset, the accuracy of the offset in the vicinity of the pixel value 128 of the color difference is made high, and the accuracy of the offset in other value ranges is made low.
 また、オフセット情報格納部621は、オフセットが高精度の値域のオフセットについては、nビット(例えばn=8)の格納領域を確保し、オフセットが低精度の値域のオフセットについては、nビット(例えばn=6)の格納領域を確保している。なお、記憶領域に余裕があればnビット統一してもよい。この場合は、実装が容易となる。 Further, the offset information storage unit 621 secures a storage area of n B bits (for example, n B = 8) for the offset of the high-precision range, and n A for the offset of the low-precision range. A storage area for bits (for example, n A = 6) is secured. If there is a margin in the storage area, n B bits may be unified. In this case, mounting becomes easy.
 また、オフセットクリップ部812は、オフセットが高精度の値域と低精度の値域とで、クリップ範囲を切り換える。例えば、オフセットが低精度の値域については、クリップ範囲を、-2nA/2~2nA/2-1とし、オフセットが高精度の値域については、クリップ範囲を、-2nB/2~2nB/2-1とする。 Further, the offset clip unit 812 switches the clip range between a value range where the offset is high accuracy and a value range where the offset is low accuracy. For example, for a value range with a low offset, the clip range is -2 nA / 2 to 2 nA / 2 -1, and for a value range with a high offset, the clip range is -2 nB / 2 to 2 nB. / 2 −1.
 次に、クラス分類を細分化する場合について、図25を参照して説明する。図25はクラス分類を細分化する場合の概要を示す図であり、(a)は変換テーブルを示し、(b)~(d)はクラス分割を説明するための図である。 Next, the case of subdividing the class classification will be described with reference to FIG. FIG. 25 is a diagram showing an outline when class classification is subdivided, (a) shows a conversion table, and (b) to (d) are diagrams for explaining class division.
 そして、クラス分類を細分化する場合は、オフセット情報格納部621における色差用のリストメモリにおいて、“sao_type_idx”=5に相当するオフセット格納領域を、クラス分類数に応じて確保する。 When class classification is subdivided, an offset storage area corresponding to “sao_type_idx” = 5 is secured in the color difference list memory in the offset information storage unit 621 according to the number of class classifications.
 また、クラス分類部624において、BOの場合に、画素値からクラスを導出する際に、対象画素の画素値が無彩色値域かどうかを含めて判定する。具体的には、例えば図25(a)に示す変換テーブル2501のいずれかを用いて、クラス分類を行う。 In the case of BO, the class classification unit 624 determines whether the pixel value of the target pixel is in the achromatic value range when deriving the class from the pixel value. Specifically, class classification is performed using, for example, one of the conversion tables 2501 shown in FIG.
 変換テーブル2501では、“class_idx = BoTbl[sao_type_idx][pix[x]/4]”により、クラス分類を行っており、図13の変換テーブル1301、1302よりも、より細かい画素値に対してクラスが割り当てられている。 In the conversion table 2501, class classification is performed by “class_idx = BoTbl [sao_type_idx] [pix [x] / 4]”, and a class is obtained for a pixel value that is finer than the conversion tables 1301 and 1302 in FIG. Assigned.
 また、変換テーブル2501の「BoTbl[BO_0][pix/4](a)」では、クラスを16個に分け、無彩色値域を細分化し、中間階調域(pix/4=16~21,42~47)を粗くした例を示している(図25(b))。また、「BoTbl[BO_0][pix/4](b)」では、クラスを16個に分けるとともに、オフセット有りの値域を狭め、クラス数とクラス幅の最大値を維持しつつ無彩色値域を細分化した例を示している(図25(c))。また、「BoTbl[BO_0][pix/4](c)」では、クラスを18個に分け、無彩色付近の値域を細分化するとともに、クラス幅の最大値も維持した例を示している(図25(d))。また、この他にも例を挙げれば、中間階調域のクラス幅を無彩色値域のクラス幅よりも相対的に大きくし、全体のクラス数を減らすことで、無彩色値域の補正精度を従来通り保ったまま、オフセット格納領域を削減することができる。これは、中間階調域におけるオフセット補正の使用頻度が、無彩色領域よりも低いことから可能である。 In “BoTbl [BO — 0] [pix / 4] (a)” of the conversion table 2501, the class is divided into 16 parts, the achromatic color range is subdivided, and the intermediate gradation range (pix / 4 = 16 to 21, 42). To 47) is shown as an example (FIG. 25B). In “BoTbl [BO — 0] [pix / 4] (b)”, the class is divided into 16 classes, the range with offset is narrowed, and the achromatic color range is subdivided while maintaining the maximum number of classes and class width. An example is shown (FIG. 25 (c)). In addition, “BoTbl [BO — 0] [pix / 4] (c)” shows an example in which the class is divided into 18 parts, the value range near the achromatic color is subdivided, and the maximum value of the class width is also maintained ( FIG. 25 (d)). As another example, the correction accuracy of the achromatic color range can be improved by making the class width of the intermediate gradation range relatively larger than the class width of the achromatic color range and reducing the total number of classes. The offset storage area can be reduced while keeping the street. This is possible because the frequency of use of offset correction in the intermediate gradation region is lower than that in the achromatic region.
 また、オフセットの精度向上と、無彩色値域におけるクラス分類の細分化とを併用した構成であってもよい。 Further, a configuration in which the offset accuracy is improved and the classification of the class classification in the achromatic color value range is used in combination.
 また、輝度を示す画素値と色差を示す画素値とで、オフセットの精度を異ならせる構成、すなわち、色差を示す画素値に対するオフセットの精度を、輝度を示す画素値に対するオフセットの精度より粗くする構成であってもよい。 Further, a configuration in which the offset accuracy differs between the pixel value indicating luminance and the pixel value indicating color difference, that is, a configuration in which the offset accuracy for the pixel value indicating the color difference is coarser than the offset accuracy for the pixel value indicating the luminance. It may be.
 (付記事項6)
 また、オフセットの加算を、無彩色(=色差の画素値128)に近づける方向に行う構成であってもよい。すなわち、オフセット加算部626は、画素値が128以上と128未満とで、加算するオフセットの符号を逆にして扱ってもよい。例えば、オフセットa のとき、x´=x+a(x<128),x´=x-a(x≧128)としてもよい。
(Appendix 6)
Further, the offset may be added in a direction to approach an achromatic color (= color difference pixel value 128). That is, the offset addition unit 626 may handle the pixel values of 128 or more and less than 128 with the signs of the offsets to be added reversed. For example, when the offset is a, x ′ = x + a (x <128) and x ′ = x−a (x ≧ 128) may be used.
 また、オフセット加算後の画素値が128をまたぐような場合、128でクリップする構成であってもよい。例えば、画素値が「126(緑の側)」で、オフセットが「3」のときに、そのままオフセットを加算して、x=126+3=129とせずに、x=clip(126+3,0,128)=128としてもよい。ここで、clip(x,y,z)は、xの値をy≦x≦zに制限する処理を示す。 Further, when the pixel value after the offset addition exceeds 128, a configuration of clipping at 128 may be used. For example, when the pixel value is “126 (green side)” and the offset is “3”, the offset is added as it is, and not x = 126 + 3 = 129, but x = clip (126 + 3, 0, 128) = 128 may be used. Here, clip (x, y, z) indicates a process of limiting the value of x to y ≦ x ≦ z.
 また、例えば、画素値が「129(赤の側)」で、オフセットが「-4」のときも、そのままオフセットを加算して、x=129+(-4)=125とせずに、x=clip(129+(-4),128,255)=128としてもよい。 Further, for example, when the pixel value is “129 (red side)” and the offset is “−4”, the offset is added as it is, and x = clip is not obtained without setting x = 129 + (− 4) = 125. (129 + (− 4), 128, 255) = 128 may be set.
 (付記事項7)
 また、色差において、中間階調域とその他の値域とに分けてオフセットを加算する構成であってもよい。例えば、図26(a)に示すように、無彩色の画素値を考慮してクラス分類を行ってもよい。図26(a)に示す例では、“sao_type_idx”=5(BO_0)の場合、中間階調域にクラスが割り当てられ、“sao_type_idx”=6(BO_1)の場合、中間階調域以外の値域にクラスが割り当てられている。
(Appendix 7)
In addition, in the color difference, the offset may be added to the intermediate gradation range and other value ranges. For example, as shown in FIG. 26A, class classification may be performed in consideration of achromatic pixel values. In the example shown in FIG. 26A, when “sao_type_idx” = 5 (BO_0), a class is assigned to an intermediate gradation range, and when “sao_type_idx” = 6 (BO_1), a value range other than the intermediate gradation range is assigned. A class is assigned.
 また、図26(b)に示すように、無彩色の画素値を挟む2つの値域で非対称にクラス分類されていてもよい。図26(b)に示す例では、図26(a)に示す例とクラスの幅は同じで区切りの位置が変更されている。 Also, as shown in FIG. 26 (b), classification may be performed asymmetrically in two value ranges sandwiching achromatic pixel values. In the example shown in FIG. 26B, the class width is the same as in the example shown in FIG.
 また、図26(c)、(d)に示すように、色差のチャネル(CrおよびCb)ごとに、異なるクラス分類を用いてもよい。図26(c)、(d)に示す例では、色差(Cr)と色差(Cb)とでクラスの幅が異なっている。クラス幅の変更は、変換テーブル2501のようにクラス数を細分化することで可能である。 Further, as shown in FIGS. 26C and 26D, different class classifications may be used for each color difference channel (Cr and Cb). In the example shown in FIGS. 26C and 26D, the class width differs between the color difference (Cr) and the color difference (Cb). The class width can be changed by subdividing the number of classes as in the conversion table 2501.
 また、図26(e)に示すように、色差では、BOのタイプを1つにしてクラス分類を行う構成であってもよい。 Also, as shown in FIG. 26 (e), the color difference may be configured to classify with one BO type.
 〔実施の形態5〕
 本発明の他の実施の形態について図27~29に基づいて説明すれば、以下のとおりである。本実施形態において、上記実施形態と異なるのは、オフセットの値そのものではなく、オフセットの予測差分を符号化する点、すなわち、オフセットの値と当該オフセットの値の予測値とを用いて算出されるオフセット残差を符号化する点、およびオフセット予測値に「0」を設ける点である。
[Embodiment 5]
The following will describe another embodiment of the present invention with reference to FIGS. In the present embodiment, the difference from the above embodiment is that the offset prediction difference is encoded, not the offset value itself, that is, using the offset value and the predicted value of the offset value. The offset residual is encoded and the offset prediction value is set to “0”.
 一般的にSAOでは、領域分類を示すクラスに応じてオフセットを符号化する。当該クラスに分類される画素が無い(クラスが空である)場合には「0」が符号化される。通常、近傍クラスおよび近傍領域のオフセットは近い値を有するため、既に復号したオフセット値を予測値とし差分を符号化すれば、符号量を削減することが可能である。しかしながら、クラスが空である場合には、逆に符号量が増加してしまう。 Generally, in SAO, an offset is encoded according to a class indicating an area classification. If there is no pixel classified into the class (the class is empty), “0” is encoded. Normally, the offsets of the neighborhood class and the neighborhood region have close values. Therefore, if the difference is encoded using the already-decoded offset value as a predicted value, the amount of codes can be reduced. However, if the class is empty, the code amount increases.
 そこで、本実施形態では、オフセットの予測値に「0」を含め、「0」を含む複数の予測値候補から1つの予測値を選択し、予測差分を符号化することによりオフセットの符号量を低減している。 Therefore, in the present embodiment, the offset prediction value includes “0”, selects one prediction value from a plurality of prediction value candidates including “0”, and encodes the prediction difference to reduce the code amount of the offset. Reduced.
 これにより、クラスが空であっても、当該クラスに分類される画素が有り、オフセットが符号化される場合であっても、適した予測値を割り当てることができるため、予測符号化により符号量を削減することができる。 As a result, even if the class is empty, even if there are pixels classified into the class and an offset is encoded, an appropriate prediction value can be assigned. Can be reduced.
 本実施形態に係るオフセット情報復号部611´の構成について、図27を参照して説明する。オフセット情報復号部611´は、図1のオフセット情報復号部611の代わりに設けられているものであり、オフセット残差復号部651、オフセット復元部652、予測値導出部653を含む構成である。また、予測値導出部653は、予測候補フラグ復号部661、固定予測値算出部662、符号化予測値算出部663、および予測値候補選択部664を含む構成である。 The configuration of the offset information decoding unit 611 ′ according to this embodiment will be described with reference to FIG. The offset information decoding unit 611 ′ is provided in place of the offset information decoding unit 611 in FIG. 1 and includes an offset residual decoding unit 651, an offset restoration unit 652, and a predicted value derivation unit 653. The predicted value derivation unit 653 includes a prediction candidate flag decoding unit 661, a fixed prediction value calculation unit 662, an encoded prediction value calculation unit 663, and a prediction value candidate selection unit 664.
 オフセット残差復号部651は、符号化データ#1に含まれるQAOU情報からオフセット残差を復号し、復号したオフセット残差をオフセット復元部652へ供給する。 The offset residual decoding unit 651 decodes the offset residual from the QAOU information included in the encoded data # 1, and supplies the decoded offset residual to the offset restoration unit 652.
 予測値導出部653は、オフセットの予測値を導出する。予測候補フラグ復号部661は、予測候補フラグをQAOU情報から復号し、復号した予測候補フラグを予測値候補選択部664に供給する。なお、予測候補フラグ復号部661は、以前に復号されたオフセット値が「0」である場合には、候補選択フラグを復号しない構成であってもよい。”
 固定予測値算出部662は、当該クラスに分類される画素が無い場合に符号化されるオフセットである固定値(ここでは「0」)を予測値として算出し、予測値候補選択部664に供給する。
The predicted value deriving unit 653 derives a predicted offset value. The prediction candidate flag decoding unit 661 decodes the prediction candidate flag from the QAOU information, and supplies the decoded prediction candidate flag to the prediction value candidate selection unit 664. Note that the prediction candidate flag decoding unit 661 may be configured not to decode the candidate selection flag when the previously decoded offset value is “0”. ”
The fixed prediction value calculation unit 662 calculates a fixed value (here, “0”) that is an offset that is encoded when there is no pixel classified into the class as a prediction value, and supplies the prediction value candidate selection unit 664 with the prediction value. To do.
 符号化予測値算出部663は、既に復号されたオフセットをオフセット情報格納部621から読み出し予測値を算出し、予測値候補選択部664に供給する。 The encoded predicted value calculation unit 663 reads the offset that has already been decoded from the offset information storage unit 621, calculates a predicted value, and supplies the predicted value to the predicted value candidate selection unit 664.
 予測値候補選択部664は、予測候補フラグに応じて、固定予測値算出部662から供給された予測値および符号化予測値算出部663から供給された予測値から、オフセット復元部652に供給する予測値を選択する。 The prediction value candidate selection unit 664 supplies the offset restoration unit 652 with the prediction value supplied from the fixed prediction value calculation unit 662 and the prediction value supplied from the encoded prediction value calculation unit 663 according to the prediction candidate flag. Select the predicted value.
 オフセット復元部652は、予測値候補選択部664から供給された予測値(pred)とオフセット残差復号部651から供給されたオフセット残差(sao_offset)とから、次の式にしたがって、オフセット(Offset)を復元する。
“Offset”=“pred”+“sao_offset”
 ここで、分類される画素がないクラス(空のクラス)がある場合に、符号量が増えてしまう理由について、図28を参照して説明する。図28は、空のクラスがある場合の概要を示す図である。図28に示すように、空でないクラスには、当該クラスのオフセットが符号化されている。そして、クラス毎に、前回のオフセットを予測値として該予測値とオフセットとの差分が符号化される。しかしながら、空のクラスがあると、予測値が「0」となり、差分値が大きくなってしまう。これにより、符号量が増大してしまう。
The offset restoration unit 652 calculates an offset (Offset) from the prediction value (pred) supplied from the prediction value candidate selection unit 664 and the offset residual (sao_offset) supplied from the offset residual decoding unit 651 according to the following equation. ).
“Offset” = “pred” + “sao_offset”
Here, the reason why the code amount increases when there is a class (empty class) having no pixel to be classified will be described with reference to FIG. FIG. 28 is a diagram showing an outline when there is an empty class. As shown in FIG. 28, a non-empty class is encoded with the offset of the class. Then, for each class, the difference between the predicted value and the offset is encoded using the previous offset as the predicted value. However, if there is an empty class, the predicted value becomes “0” and the difference value becomes large. As a result, the code amount increases.
 そこで、本実施形態では、予測候補フラグにより、予測値を「0」と「直前の(0以外の)オフセット」とから選択できるようにしている。 Therefore, in the present embodiment, the prediction value can be selected from “0” and “previous (other than 0) offset” by the prediction candidate flag.
 予測候補フラグを用いる場合のシンタクスについて、図29を参照して説明する。図29は、予測候補フラグを用いる場合のシンタクス2901を示す図である。図29に示すように、予測候補フラグ“sao_pred_flag”を追加し、“sao_pred_flag”=0であれば直前に復号した(0でない)オフセットを予測値offsetpとし、“sao_pred_flag”=1か、または最初のオフセットであれば、予測値offsetp=0とする。なお、シンタクス2901において、“sao_offset_delta”は予測値からの差分dを表し、“sao_offset[sao_curr_depth][ys][xs]”=“offsetp +d”となる。 The syntax when the prediction candidate flag is used will be described with reference to FIG. FIG. 29 is a diagram illustrating the syntax 2901 when the prediction candidate flag is used. As shown in FIG. 29, a prediction candidate flag “sao_pred_flag” is added, and if “sao_pred_flag” = 0, the immediately decoded (non-zero) offset is set as the prediction value offsetp, and “sao_pred_flag” = 1 or the first If it is an offset, the predicted value offsetp = 0. In the syntax 2901, “sao_offset_delta” represents the difference d from the predicted value, and “sao_offset [sao_curr_depth] [ys] [xs]” = “offsetp + d”.
 なお、オフセットタイプに応じて、予測候補フラグを用いない構成としてもよい。例えば、EOの場合は、予測候補フラグを用いず、BOの場合は、予測候補フラグを用いる構成にしてもよい。これは、BOでは、画素値の分布次第で、空のクラスがしばしば発生するためである。 In addition, it is good also as a structure which does not use a prediction candidate flag according to an offset type. For example, the prediction candidate flag may not be used in the case of EO, and the prediction candidate flag may be used in the case of BO. This is because an empty class often occurs in BO depending on the distribution of pixel values.
 また、オフセットタイプに応じて、予測符号化自体を行うか否か決定する構成であってもよい。例えば、EOの場合は、予測符号化を行い、BOの場合は予測符号化を行わない構成であってもよい。 Further, it may be configured to determine whether or not to perform predictive encoding itself according to the offset type. For example, in the case of EO, prediction encoding may be performed, and in the case of BO, prediction encoding may not be performed.
 (付記事項8)
 また、上記実施の形態1~5において、イントラ予測モードを用いて、LCU単位で、エッジオフセットのクラスを推定したり、制限したり、並べ替えを行ったりしてもよい。
(Appendix 8)
Further, in the first to fifth embodiments, the edge offset class may be estimated, limited, or rearranged for each LCU using the intra prediction mode.
 SAOのEOタイプとして選択されるエッジ方向は、イントラ予測モードと相関があると考えられる。このため、SAOのQAOUと対応する位置にあるCUのイントラ予測モードを参照すれば、EOクラスの選択に利用することができる。 The edge direction selected as the SAO EO type is considered to be correlated with the intra prediction mode. For this reason, if the intra prediction mode of the CU at the position corresponding to the SAO QAOU is referred to, it can be used to select the EO class.
 例えば、イントラ予測モードにより、EOクラスを推定して決定したり、EOクラスの候補を制限したり、あるいは、EOクラスの順序(インデックス)を、選択される可能性が高い順に並べ替えたりすることができる。 For example, EO class is estimated and determined by intra prediction mode, EO class candidates are limited, or the order (index) of EO classes is rearranged in the order of high possibility of selection. Can do.
 これは、SAOの各階層のブQAOUのサイズがCUと同じサイズの場合、例えばSAOのQAOUの最大サイズがLCUサイズに等しくなるように画像が分割される場合であれば、特に容易に実現可能である。 This can be realized particularly easily if the size of the QAOU in each layer of SAO is the same size as the CU, for example if the image is divided so that the maximum size of the SAO QAOU is equal to the LCU size. It is.
 (応用例)
 上述した動画像復号装置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を、動画像の送信および受信に利用できることを、図30を参照して説明する。 First, it will be described with reference to FIG. 30 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.
 図30(a)は、動画像符号化装置2を搭載した送信装置Aの構成を示したブロック図である。図30(a)に示すように、送信装置Aは、動画像を符号化することによって符号化データを得る符号化部A1と、符号化部A1が得た符号化データで搬送波を変調することによって変調信号を得る変調部A2と、変調部A2が得た変調信号を送信する送信部A3と、を備えている。上述した動画像符号化装置2は、この符号化部A1として利用される。 FIG. 30 (a) is a block diagram showing a configuration of a transmission apparatus A in which the moving picture encoding apparatus 2 is mounted. As shown in FIG. 30 (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を更に備えていてもよい。図30(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. 30A 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.
 図30(b)は、動画像復号装置1を搭載した受信装置Bの構成を示したブロック図である。図30(b)に示すように、受信装置Bは、変調信号を受信する受信部B1と、受信部B1が受信した変調信号を復調することによって符号化データを得る復調部B2と、復調部B2が得た符号化データを復号することによって動画像を得る復号部B3と、を備えている。上述した動画像復号装置1は、この復号部B3として利用される。 FIG. 30B is a block diagram illustrating a configuration of the receiving device B on which the moving image decoding device 1 is mounted. As illustrated in FIG. 30B, 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を更に備えていてもよい。図30(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. 30B 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 terrestrial digital broadcast broadcasting station (such as broadcasting equipment) / receiving station (such as a television receiver) 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 etc.) / Client (television receiver, personal computer, smart phone etc.) such as VOD (Video On Demand) service and video sharing service using the Internet is a transmitting device for transmitting and receiving modulated signals by communication. This is an example of the A / reception device B (usually, either wireless or wired is used as a transmission medium in a LAN, and wired is used as a transmission medium 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の双方として機能する。 In addition to the function of decoding the encoded data downloaded from the server and displaying it on the display, the video sharing service client has a function of encoding a moving image captured by the camera and uploading it to the server. That is, the client of the video sharing service functions as both the transmission device A and the reception device B.
 次に、上述した動画像復号装置1および動画像符号化装置2を、動画像の記録および再生に利用できることを、図31を参照して説明する。 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.
 図31(a)は、上述した動画像復号装置1を搭載した記録装置Cの構成を示したブロック図である。図31(a)に示すように、記録装置Cは、動画像を符号化することによって符号化データを得る符号化部C1と、符号化部C1が得た符号化データを記録媒体Mに書き込む書込部C2と、を備えている。上述した動画像符号化装置2は、この符号化部C1として利用される。 FIG. 31A is a block diagram showing a configuration of a recording apparatus C equipped with the moving picture decoding apparatus 1 described above. As shown in FIG. 31 (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を更に備えていてもよい。図31(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. 31A 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 device 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).
 図31(b)は、上述した動画像復号装置1を搭載した再生装置Dの構成を示したブロックである。図31(b)に示すように、再生装置Dは、記録媒体Mに書き込まれた符号化データを読み出す読出部D1と、読出部D1が読み出した符号化データを復号することによって動画像を得る復号部D2と、を備えている。上述した動画像復号装置1は、この復号部D2として利用される。 FIG. 31 (b) is a block diagram showing the configuration of the playback device D on which the above-described moving image decoding device 1 is mounted. As shown in FIG. 31 (b), the playback device D obtains a moving image by decoding the read data D1 read by the read unit D1 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を更に備えていてもよい。図31(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. 31B illustrates a configuration in which the playback apparatus D includes all of these, but a part of the configuration 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 magnetic tapes and cassette tapes, magnetic disks such as floppy (registered trademark) disks / hard disks, and CD-ROMs (compact disc read-only memory) / MO discs (magneto-optical discs). ) / MD (Mini Disc) / DVD (digital versatile disc) / CD-R (CD recordable) and other optical discs, IC cards (including memory cards) / optical cards, etc., 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, the Internet, an intranet, an extranet, a LAN (local area network), an ISDN (integrated services network), a VAN (value-added network), a CATV (community antenna network / cable network), a 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, IEEE (institute-of-electrical-and-electronic-engineers) 1394, USB, power line carrier, cable TV line, telephone line, ADSL (asymmetric-digital-subscriber-loop) line, etc. wired such as IrDA (infrared-data association) or remote control , Bluetooth (registered trademark), IEEE802.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.
 (その他)
 本発明は、以下のように記載することもできる。本発明に係る画像フィルタ装置は、複数の単位領域から構成される入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、各単位領域に含まれる画素の画素値に加算するオフセットを該単位領域ごとに決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットを、当該単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備え、上記オフセット決定手段は、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも選択できるオフセット数が制限されたオフセットの集合の中から当該単位領域に含まれる画素の画素値に加算するオフセットを決定することを特徴としている。
(Other)
The present invention can also be described as follows. 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, and is included in each unit region. Offset determining means for determining an offset to be added to the pixel value of each pixel for each unit area; and filter means for adding the offset determined by the offset determining means to the pixel value of the pixel included in the unit area. When the size of the unit area for which the offset is to be determined is smaller than a predetermined size, the offset determining means has an offset with a limited number of offsets that can be selected as compared with the case where the size of the unit area is equal to or larger than the predetermined size. An offset to be added to a pixel value of a pixel included in the unit area is determined from the set.
 上記の構成によれば、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも制限されたオフセットの集合の中から、加算するオフセットが決定される。 According to the above configuration, when the size of the unit area for which the offset is determined is smaller than a predetermined size, from the set of offsets that are more limited than when the size of the unit area is equal to or larger than the predetermined size, The offset to be added is determined.
 単位領域のサイズが小さい場合、その中に含まれる画素数は少なくなり、また、その画素同士は、近似した値を持っている可能性が高い。よって、単位領域のサイズが小さい場合は、選択可能なオフセット数を制限したとしても、オフセット適用後の画像に与える影響は小さい。また、選択可能なオフセット数を制限することで、必要なメモリの容量を減らすことができる。 When the size of the unit area is small, the number of pixels included in the unit area is small, and the pixels are likely to have approximate values. Therefore, when the size of the unit area is small, even if the number of selectable offsets is limited, the influence on the image after the offset application is small. Further, by limiting the number of offsets that can be selected, the required memory capacity can be reduced.
 したがって、上記の構成によれば、オフセット適用後の画像に与える影響を低くしつつ、メモリの使用量を削減することができる。また、選択可能なオフセット数が少なくなることで、符号量が削減でき、符号化効率が向上する。 Therefore, according to the above configuration, it is possible to reduce the amount of memory used while reducing the effect on the image after the offset application. Also, since the number of selectable offsets is reduced, the amount of codes can be reduced, and the coding efficiency is 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 to each pixel value of an input image composed of a plurality of unit regions, and includes pixels included in each unit region. Offset determining means for determining the offset to be added to the pixel value for each unit region, and filter means for adding the offset determined by the offset determining means to the pixel value of the pixel included in the unit region, The filter means is characterized in that, when the size of the unit area for which the offset is determined is smaller than a predetermined size, an offset with coarser accuracy is added than when the size of the unit area is equal to or larger than the predetermined size. Yes.
 上記の構成によれば、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも精度が粗いオフセットが加算される。 According to the above configuration, when the size of the unit area for which the offset is to be determined is smaller than a predetermined size, an offset having a coarser accuracy is added than when the size of the unit area is equal to or larger than the predetermined size.
 単位領域のサイズが小さい場合、その中に含まれる画素数は少なくなり、また、その画素同士は、近似した値を持っている可能性が高い。よって、単位領域のサイズが小さい場合は、オフセットの精度を粗くしても、量子化誤差に与える影響が小さい。したがって、オフセット適用後の画像に与える影響も小さい。また、オフセットの精度を粗くすることで、必要なメモリの容量を減らすことができる。 When the size of the unit area is small, the number of pixels included in the unit area is small, and the pixels are likely to have approximate values. Therefore, when the size of the unit region is small, the influence on the quantization error is small even if the offset accuracy is rough. Therefore, the influence on the image after applying the offset is small. In addition, it is possible to reduce the required memory capacity by increasing the accuracy of the offset.
 したがって、上記の構成によれば、オフセット適用後の画像に与える影響を低くしつつ、メモリの使用量を削減することができる。また、オフセットの精度が粗くなることで、符号量が削減でき、符号化効率が向上する。 Therefore, according to the above configuration, it is possible to reduce the amount of memory used while reducing the effect on the image after the offset application. Further, since the offset accuracy becomes coarse, the amount of codes can be reduced, and the coding efficiency is improved.
 上記課題を解決するために、本発明に係る画像フィルタ装置は、複数の単位領域から構成される入力画像の各画素値に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、各単位領域に含まれる画素の画素値に加算するオフセットの種類を該単位領域ごとに決定するオフセット決定手段と、上記オフセット決定手段が決定したオフセットの種類に応じたオフセットを、当該単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備え、上記オフセット決定手段は、オフセットを加算する対象画素について、画素値が最大値および最小値の付近にある画素に対しては、オフセットの種類をバンドオフセット(BO)に決定し、それ以外の値域の画素に対してはエッジオフセット(EO)に決定することを特徴としている。 In order to solve the above problems, an image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample : Adaptive Offset) to each pixel value of an input image composed of a plurality of unit regions. , An offset determining unit that determines for each unit region the type of offset to be added to the pixel value of the pixel included in each unit region, and an offset according to the type of offset determined by the offset determining unit in the unit region Filter means for adding to the pixel values of the included pixels, the offset determining means for the target pixel to which the offset is to be added, for the pixels whose pixel values are near the maximum value and the minimum value, The type is determined to be band offset (BO), and the edge offset (EO) is determined for pixels in other ranges. It is characterized.
 上記の構成によれば、適応オフセットを施す場合に、画素値が、最大値および最小値の付近の画素に対しては、バンドオフセットが適用され、これ以外の値域の画素についてはエッジオフセットが適用される。 According to the above configuration, when adaptive offset is applied, a band offset is applied to pixels in the vicinity of the maximum and minimum pixel values, and an edge offset is applied to pixels in other value ranges. Is done.
 高画素値域および低画素値域では、エッジよりも画素値の方が誤差に影響を及ぼし易いという傾向があるので、上記の構成により、誤差補正の効率が高まり、符号化効率を向上させることができる。 In the high pixel value region and the low pixel value region, the pixel value tends to affect the error more easily than the edge. Therefore, the above configuration increases the error correction efficiency and improves the encoding efficiency. .
 また、1つのタイプでバンドオフセットとエッジオフセットとを併用すれば、適応オフセットのタイプ数を減らすことができ、メモリの使用量および処理量を削減することができる。 Also, if band offset and edge offset are used together in one type, the number of types of adaptive offset can be reduced, and the amount of memory used and the amount of processing can be reduced.
 なお、上記の構成において、バンドオフセットとは、処理対象の画素の画素値の大きさに応じて、当該処理対象画素の画素値に複数のオフセットの何れかを加算するオフセット処理のことをいう(以下同様)。また、上記の構成において、エッジオフセットとは、処理対象の画素の画素値と当該処理対象の画素の周辺の画素の画素値との差分に応じて、当該処理対象画素の画素値に複数のオフセットの何れかを加算するオフセット処理のことをいう(以下同様)。 In the above configuration, the band offset refers to an offset process in which one of a plurality of offsets is added to the pixel value of the processing target pixel according to the size of the pixel value of the processing target pixel ( The same applies below). In the above configuration, the edge offset is a plurality of offsets in the pixel value of the processing target pixel according to the difference between the pixel value of the processing target pixel and the pixel values of the pixels around the processing target pixel. This is offset processing for adding any of the above (same below).
 本発明に係る画像フィルタ装置では、上記オフセット決定手段は、画素値が最小値から最大値の4分の1までと、最大値の4分の3から最大値までの値域の画素については、バンドオフセットに決定し、これ以外の値域についてはエッジオフセットに決定するものであってもよい。 In the image filter device according to the present invention, the offset determining means performs band detection for pixels in a range of pixel values from the minimum value to a quarter of the maximum value and from a range of the maximum value from a quarter to the maximum value. The offset may be determined, and the value range other than this may be determined as the edge offset.
 上記の構成によれば、バンドオフセットが適用される画素とエッジオフセットが適用される画素とを明確に分けることができる。 According to the above configuration, the pixel to which the band offset is applied and the pixel to which the edge offset is applied can be clearly separated.
 上記課題を解決するために、本発明に係る画像フィルタ装置は、入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、エッジオフセット(EO)を適用するときのクラスを決定するために行うエッジの判定を、対象画素の水平方向に存在する画素のみを参照して行うクラス分類手段と、エッジオフセット(EO)を適用する場合、上記クラス分類手段が分類したクラスに対応するオフセットを加算するフィルタ手段と、を備えていることを特徴としている。 In order to solve the above-described problems, an image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample Adaptive Offset) to an input image, and a class for applying an edge offset (EO). Class classification means for performing edge determination to determine only the pixels existing in the horizontal direction of the target pixel, and when applying edge offset (EO), the class classification means classifies the class. And a filter means for adding a corresponding offset.
 上記の構成によれば、エッジの判定に、水平方向の画素しか参照しないので、上方向の画素も参照する場合と比較して、必要なメモリ量を削減することができる。また、上方向の境界判定が不要となるので、処理量も削減することができる。 According to the above configuration, since only the pixels in the horizontal direction are referred to for edge determination, the required memory amount can be reduced as compared with the case of referring to the pixels in the upward direction. In addition, since the upper boundary determination is not necessary, the processing amount can also be reduced.
 本発明に係る画像フィルタ装置では、上記クラス分類手段は、対象画素から水平方向に2画素離れた位置にある画素を参照してエッジの判定を行うものであってもよい。 In the image filter device according to the present invention, the class classification unit may perform edge determination with reference to a pixel located at a position two pixels away from the target pixel in the horizontal direction.
 上記の構成によれば、対象画素から2画素離れた画素を参照するので、エッジの角度が浅い場合であっても、エッジを検出することができる。 According to the above configuration, since a pixel two pixels away from the target pixel is referred to, the edge can be detected even when the edge angle is shallow.
 上記課題を解決するために、本発明に係る画像フィルタ装置は、入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、色差を示す画素値が、最大値および最小値の中央の値である中央値付近のクラスの分割幅を、その他の値域よりも細分化して、バンドオフセット(BO)を適用するときのクラスを決定するクラス分類手段と、バンドオフセット(BO)を適用する場合、上記クラス分類手段が分類したクラスに対応するオフセットを加算するフィルタ手段と、を備えていることを特徴としている。 In order to solve the above problems, an image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample : Adaptive Offset) to an input image, and the pixel value indicating a color difference has a maximum value and a minimum value. Class classification means for determining a class when band offset (BO) is applied by subdividing the division width of the class around the median value, which is the median value, than other value ranges, and band offset (BO) Is applied, a filter means for adding an offset corresponding to the class classified by the class classification means is provided.
 上記の構成によれば、色差を示す画素値が、最大値および最小値の中央の値である中央値付近のクラスの分割幅を、その他の値域よりも細分化して、バンドオフセット(BO)を適用するときのクラスを決定する。 According to the above configuration, the pixel value indicating the color difference is subdivided from the division value of the class around the median value that is the median value of the maximum value and the minimum value, and the band offset (BO) is reduced. Determine the class to apply.
 色差の画素値が中央値のとき、当該画素は無彩色となる。無彩色の誤差は、人の目に付き易く、主観画質が低下する。そこで、上記の構成のように、中央値近辺のクラス幅を細分化すれば、中央値近辺の画素に対し、細かくオフセットを設定することができる。これにより、主観画質を向上させることができる。 When the pixel value of the color difference is the median value, the pixel is achromatic. Achromatic errors are easily noticeable by humans, and the subjective image quality deteriorates. Therefore, if the class width near the median is subdivided as in the above configuration, the offset can be set finely for the pixels near the median. Thereby, subjective image quality can be improved.
 本発明に係る画像フィルタ装置では、上記フィルタ手段は、オフセット加算前の画素値と加算後の画素値との間に、上記中央値が存在する場合、オフセット加算後の画素値を上記中央値とするものであってもよい。 In the image filter device according to the present invention, when the median value exists between the pixel value before the offset addition and the pixel value after the addition, the filter means uses the pixel value after the offset addition as the median value. You may do.
 上記の構成によれば、中央値を超えてオフセットが加算されることはなくなる。色差の画素値が中央値の画素は無彩色であり、中央値を挟んだ両側では、人の目で知覚できる色が変わってしまう。そこで、上記の構成によれば、オフセットが加算されたことにより、人が知覚する色が変わってしまうことを防止することができる。 に よ According to the above configuration, the offset is not added beyond the median value. A pixel whose color difference has a median value is an achromatic color, and colors that can be perceived by human eyes change on both sides of the median value. Therefore, according to the above configuration, it is possible to prevent the color perceived by a person from being changed due to the addition of the offset.
 上記課題を解決するために、本発明に係る画像フィルタ装置は、入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、色差を示す画素値が、最大値および最小値の中央の値である中央値付近の画素に対し、その他の値域の画素よりも精度が高いオフセットを加算するフィルタ手段を備えていることを特徴としている。 In order to solve the above problems, an image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample : Adaptive Offset) to an input image, and the pixel value indicating a color difference has a maximum value and a minimum value. It is characterized by comprising filter means for adding an offset with higher accuracy to the pixels near the median value, which is the median value, than the pixels in other value ranges.
 上記の構成によれば、色差を示す画素値が、最大値および最小値の中央の値である中央値付近の画素に対し、その他の値域の画素よりも精度が高いオフセットを加算する。 According to the above configuration, the pixel value indicating the color difference adds an offset with higher accuracy than the pixels in the other value ranges to the pixels in the vicinity of the median value that is the median value of the maximum value and the minimum value.
 色差の画素値が中央値のとき、当該画素は無彩色となる。無彩色の誤差は、人の目に付き易く、主観画質が低下する。そこで、上記の構成のように、中央値近辺では、加算するオフセットの精度を向上させれば、中央値近辺の画素に対し、細かくオフセットを加算することができる。これにより、主観画質を向上させることができる。 When the pixel value of the color difference is the median value, the pixel is achromatic. Achromatic errors are easily noticeable by humans, and the subjective image quality deteriorates. Therefore, as in the above configuration, if the accuracy of the offset to be added is improved in the vicinity of the median value, the offset can be finely added to the pixels in the vicinity of the median value. Thereby, subjective image quality can be improved.
 上記課題を解決するために、本発明に係るオフセット復号装置は、入力画像の各画素値にオフセットを加算する画像フィルタによって参照される各オフセットを復号するオフセット復号装置であって、各オフセット残差を、符号化データから復号するオフセット残差復号手段と、各オフセットの予測値を、復号済みのオフセット、または予め定められた値から導出する予測値導出手段と、各オフセットを、上記予測値導出手段によって導出された予測値、および上記オフセット残差復号手段によって復号されたオフセット残差から算出するオフセット算出手段と、を備えていることを特徴としている。 In order to solve the above problem, an offset decoding apparatus according to the present invention is an offset decoding apparatus that decodes each offset referenced by an image filter that adds an offset to each pixel value of an input image, and each offset residual Offset residual decoding means for decoding the encoded data from the encoded data, prediction value deriving means for deriving the predicted value of each offset from a decoded offset or a predetermined value, and each offset for deriving the predicted value And an offset calculating means for calculating from the predicted value derived by the means and the offset residual decoded by the offset residual decoding means.
 上記の構成によれば、残差からオフセットを復号するので、オフセットをそのまま符号化する場合よりも、符号量を少なくすることができる。また、残差を求めるための予測値を復号済みのオフセットまたは予め定められた値から導出するので、復号済みのオフセットのみを用いることにより、差分データの符号量が、そのまま符号化するときよりも大きくなってしまうことを防止することができる。 According to the above configuration, since the offset is decoded from the residual, it is possible to reduce the code amount as compared with the case where the offset is encoded as it is. In addition, since the prediction value for obtaining the residual is derived from the decoded offset or a predetermined value, by using only the decoded offset, the code amount of the difference data is made as compared with the case of encoding as it is. It can be prevented from becoming large.
 なお、予め定められた値としては、例えば「0」を挙げることができる。 For example, “0” can be given as a predetermined value.
 上記課題を解決するために、本発明に係るオフセット符号化装置は、入力画像の各画素値にオフセットを加算する画像フィルタによって参照される各オフセットを符号化するオフセット符号化装置であって、各オフセットの予測値を、符号化済みのオフセット、または予め定められた値から導出する予測値導出手段と、各オフセットと上記予測値導出手段によって導出された予測値とからオフセット残差を算出するオフセット残差算出手段と、上記オフセット残差算出手段によって算出されたオフセット残差を符号化するオフセット残差符号化手段と、を備えていることを特徴としている。 In order to solve the above problems, an offset encoding apparatus according to the present invention is an offset encoding apparatus that encodes each offset referenced by an image filter that adds an offset to each pixel value of an input image, An offset for calculating an offset residual from each offset and the predicted value derived by the predicted value deriving means, and a predicted value deriving means for deriving the predicted value of the offset from an encoded offset or a predetermined value The apparatus is characterized by comprising: a residual calculation means; and an offset residual encoding means for encoding the offset residual calculated by the offset residual calculation means.
 上記の構成によれば、残差からオフセットを復号するので、オフセットをそのまま符号化する場合よりも、符号量を少なくすることができる。また、残差を求めるための予測値を復号済みのオフセットまたは予め定められた値から導出するので、復号済みのオフセットのみを用いることにより、差分データの符号量が、そのまま符号化するときよりも大きくなってしまうことを防止することができる。 According to the above configuration, since the offset is decoded from the residual, it is possible to reduce the code amount as compared with the case where the offset is encoded as it is. In addition, since the prediction value for obtaining the residual is derived from the decoded offset or a predetermined value, by using only the decoded offset, the code amount of the difference data is made as compared with the case of encoding as it is. It can be prevented from becoming large.
 上記課題を解決するために、本発明に係る符号化データのデータ構造は、複数の単位領域から構成される入力画像の各画素値にオフセットを加算する画像フィルタによって参照される符号化データのデータ構造であって、予測値を、復号済みのオフセットおよび予め定められた値のいずれから導出するかを示す予測値導出情報を含み、上記画像フィルタは、上記符号化データに含まれる予測値導出情報を参照して、予測値を導出し、オフセットを復号する、ことを特徴としている。 In order to solve the above problems, the data structure of encoded data according to the present invention is encoded data data referred to by an image filter that adds an offset to each pixel value of an input image composed of a plurality of unit areas. A prediction value derivation information indicating whether the prediction value is derived from a decoded offset or a predetermined value, and the image filter includes prediction value derivation information included in the encoded data The prediction value is derived and the offset is decoded with reference to FIG.
 上記の構成によれば、予測値を、復号済みのオフセットとするか、または予め定められた値とするかを、予測値導出情報により決定できる。 According to the above configuration, whether the predicted value is a decoded offset or a predetermined value can be determined from the predicted value derivation information.
 本発明は上述した各実施の形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 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   動画像符号化装置(オフセット符号化装置)
 60   適応オフセットフィルタ(画像フィルタ装置)
 80   適応オフセットフィルタ(画像フィルタ装置)
623   オフセットタイプ導出部(オフセット決定手段)
624   クラス分類部(クラス分類手段)
625   オフセット導出部(オフセット算出手段)
626   オフセット加算部(フィルタ手段)
651   オフセット残差復号部(オフセット残差復号手段)
653   予測値導出部(予備値導出手段)
1 Video decoding device (offset decoding device)
2 Video encoding device (offset encoding device)
60 Adaptive offset filter (image filter device)
80 Adaptive offset filter (image filter device)
623 Offset type deriving unit (offset determining means)
624 class classification unit (class classification means)
625 Offset deriving unit (offset calculating means)
626 Offset adder (filter means)
651 Offset residual decoding unit (offset residual decoding means)
653 Predicted value deriving unit (preliminary value deriving means)

Claims (12)

  1.  複数の単位領域から構成される入力画像の各画素値に、複数のオフセットの中から選択したオフセットを加算する画像フィルタ装置であって、
     各単位領域に含まれる画素の画素値に加算するオフセットを該単位領域ごとに決定するオフセット決定手段と、
     上記オフセット決定手段が決定したオフセットを、当該単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備え、
     上記オフセット決定手段は、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも選択できるオフセット数が制限されたオフセットの集合の中から当該単位領域に含まれる画素の画素値に加算するオフセットを決定することを特徴とする画像フィルタ装置。
    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,
    Offset determining means for determining, for each unit region, an offset to be added to the pixel value of the pixel included in each unit region;
    Filter means for adding the offset determined by the offset determination means to the pixel value of the pixel included in the unit region,
    The offset determining means is a set of offsets in which the number of offsets that can be selected is limited when the size of the unit area for which the offset is determined is smaller than a predetermined size, compared to when the size of the unit area is equal to or larger than the predetermined size. An image filter device that determines an offset to be added to a pixel value of a pixel included in the unit area from among the image filter devices.
  2.  複数の単位領域から構成される入力画像の各画素値にオフセットを加算する画像フィルタ装置であって、
     各単位領域に含まれる画素の画素値に加算するオフセットを該単位領域ごとに決定するオフセット決定手段と、
     上記オフセット決定手段が決定したオフセットを、当該単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備え、
     上記フィルタ手段は、オフセットの決定対象となる単位領域のサイズが所定の大きさよりも小さい場合、単位領域のサイズが所定の大きさ以上の場合よりも精度を粗くしたオフセットを加算することを特徴とする画像フィルタ装置。
    An image filter device that adds an offset to each pixel value of an input image composed of a plurality of unit regions,
    Offset determining means for determining, for each unit region, an offset to be added to the pixel value of the pixel included in each unit region;
    Filter means for adding the offset determined by the offset determination means to the pixel value of the pixel included in the unit region,
    When the size of the unit area for which the offset is determined is smaller than a predetermined size, the filter means adds an offset having a coarser accuracy than when the size of the unit area is equal to or larger than the predetermined size. Image filter device.
  3.  複数の単位領域から構成される入力画像の各画素値に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、
     各単位領域に含まれる画素の画素値に加算するオフセットの種類を該単位領域ごとに決定するオフセット決定手段と、
     上記オフセット決定手段が決定したオフセットの種類に応じたオフセットを、当該単位領域に含まれる画素の画素値に加算するフィルタ手段と、を備え、
     上記オフセット決定手段は、オフセットを加算する対象画素について、画素値が最大値および最小値の付近にある画素に対しては、オフセットの種類をバンドオフセット(BO)に決定し、それ以外の値域の画素に対してはエッジオフセット(EO)に決定することを特徴とする画像フィルタ装置。
    An image filter device that applies an adaptive offset (SAO: Sample Adaptive Offset) to each pixel value of an input image composed of a plurality of unit regions,
    Offset determining means for determining, for each unit region, the type of offset to be added to the pixel value of the pixel included in each unit region;
    Filter means for adding an offset according to the type of offset determined by the offset determination means to the pixel value of the pixel included in the unit region;
    The offset determination means determines the offset type to be a band offset (BO) for pixels whose pixel values are near the maximum value and the minimum value for the target pixel to which the offset is added, An image filter device, wherein an edge offset (EO) is determined for a pixel.
  4.  上記オフセット決定手段は、画素値が最小値から最大値の4分の1までと、最大値の4分の3から最大値までの値域の画素については、バンドオフセットに決定し、これ以外の値域についてはエッジオフセットに決定することを特徴とする請求項3に記載の画像フィルタ装置。 The offset determination means determines a band offset for pixels in the range of pixel values from the minimum value to one-fourth of the maximum value and from the third-fourth of the maximum value to the maximum value, and other value ranges The image filter device according to claim 3, wherein the edge offset is determined as an edge offset.
  5.  入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、
     エッジオフセット(EO)を適用するときのクラスを決定するために行うエッジの判定を、対象画素の水平方向に存在する画素のみを参照して行うクラス分類手段と、
     エッジオフセット(EO)を適用する場合、上記クラス分類手段が分類したクラスに対応するオフセットを加算するフィルタ手段と、を備えていることを特徴とする画像フィルタ装置。
    An image filter device for applying an adaptive offset (SAO: Sample Adaptive Offset) to an input image,
    Class classification means for performing edge determination to determine a class when applying an edge offset (EO) with reference to only pixels existing in the horizontal direction of the target pixel;
    An image filter device comprising: filter means for adding an offset corresponding to the class classified by the class classification means when applying edge offset (EO).
  6.  上記クラス分類手段は、対象画素から水平方向に2画素離れた位置にある画素を参照してエッジの判定を行うことを特徴とする請求項5に記載の画像フィルタ装置。 6. The image filter device according to claim 5, wherein the class classification means determines an edge with reference to a pixel located at a position two pixels away from the target pixel in the horizontal direction.
  7.  入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、
     色差を示す画素値が、最大値および最小値の中央の値である中央値付近のクラスの分割幅を、その他の値域よりも細分化して、バンドオフセット(BO)を適用するときのクラスを決定するクラス分類手段と、
     バンドオフセット(BO)を適用する場合、上記クラス分類手段が分類したクラスに対応するオフセットを加算するフィルタ手段と、を備えていることを特徴とする画像フィルタ装置。
    An image filter device for applying an adaptive offset (SAO: Sample Adaptive Offset) to an input image,
    The division value of the class around the median, where the pixel value indicating the color difference is the median of the maximum value and the minimum value, is subdivided from the other range, and the class for applying the band offset (BO) is determined. Classifying means to
    An image filter device comprising: a filter unit that adds an offset corresponding to a class classified by the class classification unit when a band offset (BO) is applied.
  8.  上記フィルタ手段は、オフセット加算前の画素値と加算後の画素値との間に、上記中央値が存在する場合、オフセット加算後の画素値を上記中央値とすることを特徴とする請求項7に記載の画像フィルタ装置。 8. The filter unit according to claim 7, wherein when the median value exists between a pixel value before offset addition and a pixel value after addition, the pixel value after offset addition is used as the median value. The image filter device described in 1.
  9.  入力画像に、適応オフセット(SAO:Sample Adaptive Offset)を施す画像フィルタ装置であって、
     色差を示す画素値が、最大値および最小値の中央の値である中央値付近の画素に対し、その他の値域の画素よりも精度が高いオフセットを加算するフィルタ手段を備えていることを特徴とする画像フィルタ装置。
    An image filter device for applying an adaptive offset (SAO: Sample Adaptive Offset) to an input image,
    The pixel value indicating the color difference is provided with filter means for adding an offset with higher accuracy than a pixel in the other value range to a pixel in the vicinity of the median value that is the median value of the maximum value and the minimum value. Image filter device.
  10.  入力画像の各画素値にオフセットを加算する画像フィルタによって参照される各オフセットを復号するオフセット復号装置であって、
     各オフセット残差を、符号化データから復号するオフセット残差復号手段と、
     各オフセットの予測値を、復号済みのオフセット、または予め定められた値から導出する予測値導出手段と、
     各オフセットを、上記予測値導出手段によって導出された予測値、および上記オフセット残差復号手段によって復号されたオフセット残差から算出するオフセット算出手段と、を備えていることを特徴とするオフセット復号装置。
    An offset decoding device that decodes each offset referenced by an image filter that adds an offset to each pixel value of an input image,
    Offset residual decoding means for decoding each offset residual from the encoded data;
    Predicted value deriving means for deriving the predicted value of each offset from a decoded offset or a predetermined value;
    An offset decoding apparatus comprising: an offset calculating unit that calculates each offset from a predicted value derived by the predicted value deriving unit and an offset residual decoded by the offset residual decoding unit .
  11.  入力画像の各画素値にオフセットを加算する画像フィルタによって参照される各オフセットを符号化するオフセット符号化装置であって、
     各オフセットの予測値を、符号化済みのオフセット、または予め定められた値から導出する予測値導出手段と、
     各オフセットと上記予測値導出手段によって導出された予測値とからオフセット残差を算出するオフセット残差算出手段と、
     上記オフセット残差算出手段によって算出されたオフセット残差を符号化するオフセット残差符号化手段と、を備えていることを特徴とするオフセット符号化装置。
    An offset encoding device that encodes each offset referenced by an image filter that adds an offset to each pixel value of an input image,
    A predicted value deriving unit for deriving a predicted value of each offset from an encoded offset or a predetermined value;
    Offset residual calculating means for calculating an offset residual from each offset and the predicted value derived by the predicted value deriving means;
    An offset encoding apparatus comprising: an offset residual encoding unit that encodes the offset residual calculated by the offset residual calculation unit.
  12.  複数の単位領域から構成される入力画像の各画素値にオフセットを加算する画像フィルタによって参照される符号化データのデータ構造であって、
     予測値を、復号済みのオフセットおよび予め定められた値のいずれから導出するかを示す予測値導出情報を含み、
     上記画像フィルタは、上記符号化データに含まれる予測値導出情報を参照して、予測値を導出し、オフセットを復号する、ことを特徴とする符号化データのデータ構造。
    A data structure of encoded data referred to by an image filter that adds an offset to each pixel value of an input image composed of a plurality of unit regions,
    Including predicted value derivation information indicating whether the predicted value is derived from a decoded offset or a predetermined value;
    A data structure of encoded data, wherein the image filter refers to predicted value derivation information included in the encoded data, derives a predicted value, and decodes an offset.
PCT/JP2012/070859 2011-09-29 2012-08-16 Offset decoding apparatus, offset encoding apparatus, image filter apparatus, and data structure WO2013046990A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011-215476 2011-09-29
JP2011215476 2011-09-29

Publications (1)

Publication Number Publication Date
WO2013046990A1 true WO2013046990A1 (en) 2013-04-04

Family

ID=47995041

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/070859 WO2013046990A1 (en) 2011-09-29 2012-08-16 Offset decoding apparatus, offset encoding apparatus, image filter apparatus, and data structure

Country Status (1)

Country Link
WO (1) WO2013046990A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013154026A1 (en) * 2012-04-13 2013-10-17 ソニー株式会社 Image processing apparatus and method
WO2015083796A1 (en) * 2013-12-04 2015-06-11 三菱電機株式会社 Image encoding device
WO2015163047A1 (en) * 2014-04-23 2015-10-29 ソニー株式会社 Image processing device and image processing method
WO2015163046A1 (en) * 2014-04-23 2015-10-29 ソニー株式会社 Image processing device and image processing method
CN105230020A (en) * 2013-07-15 2016-01-06 联发科技股份有限公司 For the method for the sampling self adaptation migration processing of Video coding
JP2018137752A (en) * 2011-11-07 2018-08-30 キヤノン株式会社 Method and device for decoding compensation offset for set of sample of reconstituted image
US11330282B2 (en) 2018-01-05 2022-05-10 Socionext Inc. Encoding and decoding with signaling of SAO parameters

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHIH-MING FU ET AL.: "CE13: Sample Adaptive Offset with LCU-Independent Decoding", JOINT COLLABORATIVE TEAM ON VIDEO CODING (JCT-VC) OF ITU-T SG16 WP3 AND ISO/IEC JTC1/ SC29/WG11 5TH MEETING, 16 March 2011 (2011-03-16), GENEVA, CH *
CHIH-MING FU ET AL.: "CE8 Subset3: Picture Quadtree Adaptive Offset", JOINT COLLABORATIVE TEAM ON VIDEO CODING (JCT-VC) OF ITU-T SG16 WP3 AND ISO/IEC JTC1/SC29/WG11 4TH MEETING, 20 January 2011 (2011-01-20), DAEGU, KR *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018139426A (en) * 2011-11-07 2018-09-06 キヤノン株式会社 Method and device for decoding compensation offset for set of reconstructed sample of image
JP2018137752A (en) * 2011-11-07 2018-08-30 キヤノン株式会社 Method and device for decoding compensation offset for set of sample of reconstituted image
WO2013154026A1 (en) * 2012-04-13 2013-10-17 ソニー株式会社 Image processing apparatus and method
US10659817B2 (en) 2013-07-15 2020-05-19 Hfi Innovation Inc. Method of sample adaptive offset processing for video coding
JP2016527793A (en) * 2013-07-15 2016-09-08 聯發科技股▲ふん▼有限公司Mediatek Inc. Method of sample adaptive offset processing for video coding
CN105230020A (en) * 2013-07-15 2016-01-06 联发科技股份有限公司 For the method for the sampling self adaptation migration processing of Video coding
JP5951144B2 (en) * 2013-12-04 2016-07-13 三菱電機株式会社 Image encoding device
WO2015083796A1 (en) * 2013-12-04 2015-06-11 三菱電機株式会社 Image encoding device
JP2015216626A (en) * 2014-04-23 2015-12-03 ソニー株式会社 Image processing device and image processing method
CN106165417A (en) * 2014-04-23 2016-11-23 索尼公司 Image processing equipment and image processing method
WO2015163046A1 (en) * 2014-04-23 2015-10-29 ソニー株式会社 Image processing device and image processing method
WO2015163047A1 (en) * 2014-04-23 2015-10-29 ソニー株式会社 Image processing device and image processing method
US10477207B2 (en) 2014-04-23 2019-11-12 Sony Corporation Image processing apparatus and image processing method
US10666975B2 (en) 2014-04-23 2020-05-26 Sony Corporation Image processing apparatus and image processing method
US11330282B2 (en) 2018-01-05 2022-05-10 Socionext Inc. Encoding and decoding with signaling of SAO parameters

Similar Documents

Publication Publication Date Title
JP6496802B2 (en) Image filter device, filter method, and moving image decoding device
WO2013046990A1 (en) Offset decoding apparatus, offset encoding apparatus, image filter apparatus, and data structure
JP2013236358A (en) Image filter device, image decoding device, image encoding device, and data structure
JP7368145B2 (en) Image encoding device and image decoding device
JP2013138395A (en) Image filtering device, image decoding device, image encoding device and data structure
CN113196776A (en) Predictive image generation device, moving image decoding device, moving image encoding device, and predictive image generation method
WO2012081706A1 (en) Image filter device, filter device, decoder, encoder, and data structure
JP2013251827A (en) Image filter device, image decoding device, image encoding device, and data structure
CN117917074A (en) Codec enhancement in cross-component sample adaptive offset

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12836215

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12836215

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP