JPWO2011121843A1 - Image encoding and image decoding method - Google Patents

Image encoding and image decoding method Download PDF

Info

Publication number
JPWO2011121843A1
JPWO2011121843A1 JP2012508020A JP2012508020A JPWO2011121843A1 JP WO2011121843 A1 JPWO2011121843 A1 JP WO2011121843A1 JP 2012508020 A JP2012508020 A JP 2012508020A JP 2012508020 A JP2012508020 A JP 2012508020A JP WO2011121843 A1 JPWO2011121843 A1 JP WO2011121843A1
Authority
JP
Japan
Prior art keywords
block
flag
blocks
decoding
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012508020A
Other languages
Japanese (ja)
Inventor
竹島 秀則
秀則 竹島
浅野 渉
渉 浅野
昭行 谷沢
昭行 谷沢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Publication of JPWO2011121843A1 publication Critical patent/JPWO2011121843A1/en
Pending legal-status Critical Current

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/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • 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/17Methods 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 an image region, e.g. an object
    • H04N19/176Methods 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 an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

ブロック単位での分割情報を示すフラグを含むビットストリームを取得するステップと、前記階層の深さNよりも深さが小さい階層に属する上位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す上位フラグを復号し取得するステップと、前記階層の深さNに属する下位ブロックのうち、第1の下位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す第1の下位フラグを復号し取得するステップと、既に取得している前記上位フラグ及び複数の前記第1の下位フラグが特定の組み合わせである場合に、前記階層の深さNに属する第2の下位ブロックの四分木の分割情報を示す第2の下位フラグとして予め定めた第1の値を設定し、前記特定の組み合わせではない場合に、前記第2の下位フラグを復号し取得するステップと、前記上位フラグと、第1及び第2の下位フラグに従って、前記ブロックの復号画像信号を生成するステップと、を具備する。A step of obtaining a bitstream including a flag indicating division information in block units, and division of the quadrature tree of the upper block assigned to a higher block belonging to a hierarchy having a depth smaller than the depth N of the hierarchy A step of decoding and obtaining a high-order flag indicating information; and first information indicating quadrant tree division information of the high-order block given to the first low-order block among the low-order blocks belonging to the depth N of the hierarchy And a second lower block belonging to the depth N of the hierarchy when the upper flag and the plurality of first lower flags already acquired are in a specific combination A first value set in advance is set as a second lower flag indicating division information of the quadtree, and the second lower flag is decoded and acquired when it is not the specific combination A step that, with the upper flag, in accordance with the first and second lower flags comprises the steps of: generating a decoded image signal of the block.

Description

本実施形態は、符号化及び復号化方法に関する。   The present embodiment relates to an encoding and decoding method.

動画像の符号化技術の1つとしてH.264(例えば非特許文献1)が知られている。H.264は復号化(デコード)の方法を定めた規格である。H.264では、フレーム内およびフレーム間予測の残差(予測誤差)は予め定められた直交変換により変換し、その変換係数を量子化したうえで符号化する。直交変換のサイズは符号化モードにより4x4画素ブロック、8x8画素ブロックの2種類のいずれかが使用される。直交変換の係数は、量子化によりゼロになることが多い。そこでH.264では、符号量を減らすために、すべての変換係数がゼロであるかを表す1ビットのフラグを符号化し、すべての変換係数がゼロである場合には変換係数の符号化をスキップする。このフラグは、0がすべての係数がゼロであることを表し、1が少なくとも1つの非ゼロの係数があることを表す。   One of the video encoding techniques is H.264. H.264 (for example, Non-Patent Document 1) is known. H. H.264 is a standard that defines a decoding method. H. In H.264, a residual (prediction error) in intra-frame and inter-frame prediction is converted by a predetermined orthogonal transform, and the transform coefficient is quantized and encoded. As the size of the orthogonal transform, either a 4 × 4 pixel block or an 8 × 8 pixel block is used depending on the encoding mode. The coefficient of the orthogonal transform often becomes zero due to quantization. So H. In H.264, in order to reduce the code amount, a 1-bit flag indicating whether all transform coefficients are zero is encoded, and when all transform coefficients are zero, encoding of the transform coefficients is skipped. This flag indicates that 0 indicates that all coefficients are zero, and 1 indicates that there is at least one non-zero coefficient.

H.264では、4x4画素ブロック内の変換数に対するフラグをCBF(coded block flag)と呼び、8x8画素以上のブロックに対するフラグについてはCBP(coded block pattern)と呼ぶ。CBFについては、符号化モードにより、すべての変換係数がゼロであるか否かを表す場合と、変換係数の最初の変換係数(DC成分)以外の係数がすべてゼロであるか否かを表す場合がある。また、4つの4x4画素ブロックは8x8画素のブロックが分割されたものとして扱われ、4つの4x4画素ブロックの変換係数がすべて0である場合には、8x8画素のブロックに対するフラグ(CBP)を0とする。また、16x16画素のブロックに対してもCBPは符号化され、このCBPは、4つの8x8画素の輝度信号(Luminance)ブロック、その16x16画素のブロックに対応する2つの色差信号(Chrominance)ブロックのすべての変換係数がゼロであるか否かを表す。これらのことからわかるように、変換係数が0であるか否かという情報(CBPおよびCBF)は階層的に符号化されている。   H. In H.264, a flag for the number of conversions in a 4 × 4 pixel block is called a CBF (coded block flag), and a flag for a block of 8 × 8 pixels or more is called a CBP (coded block pattern). For CBF, depending on the encoding mode, whether all transform coefficients are zero or not, and whether all coefficients other than the first transform coefficient (DC component) of the transform coefficient are zero There is. In addition, four 4x4 pixel blocks are treated as if an 8x8 pixel block was divided, and when the conversion coefficients of the four 4x4 pixel blocks are all 0, the flag (CBP) for the 8x8 pixel block is set to 0. To do. Also, CBP is encoded for a block of 16 × 16 pixels, and this CBP is composed of four 8 × 8 pixel luminance signal (Luminance) blocks and all two color difference signal (Chrominance) blocks corresponding to the block of 16 × 16 pixels. Represents whether or not the conversion coefficient is zero. As can be seen from these, information (CBP and CBF) indicating whether or not the transform coefficient is 0 is hierarchically encoded.

ITU-T (Telecommunication Standardization Sector of International Telecommunication Union) Recommendation H.264, “Advanced video coding for generic audiovisual services”’, 2003.ITU-T (Telecommunication Standardization Sector of International Telecommunication Union) Recommendation H.264, “Advanced video coding for generic audiovisual services” ’, 2003.

符号化モードによっては、CBPおよびCBFの符号化において、CBPが0であるなら必ずCBFが0であるというモードが存在する。H.264では、これらの符号化モードにおいても、CBPが1、すべてのCBFが0という情報を符号化できる。このようなCBPとCBFの組み合わせに符号を割り当てることは冗長である。この冗長性を排除すれば、圧縮率を向上できる。   Depending on the encoding mode, there exists a mode in which CBF is always 0 if CBP is 0 in encoding of CBP and CBF. H. In H.264, even in these encoding modes, information that CBP is 1 and all CBFs are 0 can be encoded. It is redundant to assign a code to such a combination of CBP and CBF. If this redundancy is eliminated, the compression rate can be improved.

なお、H.264におけるCBFとCBPの符号化でなくても、CBPを階層的に符号化する場合には同様の冗長性が生じる。また、H.264のインター予測ではスキップ予測であるか否かをあらわすモード情報を1ビットで符号化する。今後のH.264の拡張を考えると、このスキップフラグを階層的に符号化する場合についても同様の冗長性が生じると考えられる。階層的なスキップフラグの符号化における冗長性については、H.264におけるCBPおよびCBFの冗長性に対する本発明の解決手段と同じ手段で解決できる。   H. Even when the CBF and CBP are not encoded in H.264, the same redundancy occurs when the CBP is encoded hierarchically. H. In the H.264 inter prediction, mode information indicating whether or not the skip prediction is performed is encoded by 1 bit. Future H.D. Considering the extension of H.264, it is considered that the same redundancy occurs when the skip flag is encoded hierarchically. For redundancy in hierarchical skip flag encoding, see H.C. It can be solved by the same means as the solution of the present invention for CBP and CBF redundancy in H.264.

本発明の目的は、階層的なCBPやCBF、スキップフラグの符号化時の冗長性を排除した圧縮データを得ること、及び圧縮データを復号化することにある。   An object of the present invention is to obtain compressed data that eliminates redundancy during encoding of hierarchical CBP, CBF, and skip flag, and to decode the compressed data.

実施形態の画像復号化方法は、入力画像信号を、階層の深さNに応じたブロックサイズに分割されたブロックを復号する動画像復号化方法において、ブロック単位での分割情報を示すフラグを含むビットストリームを取得するステップと、前記階層の深さNよりも深さが小さい階層に属する上位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す上位フラグを復号し取得するステップと、前記階層の深さNに属する下位ブロックのうち、第1の下位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す第1の下位フラグを復号し取得するステップと、既に取得している前記上位フラグ及び複数の前記第1の下位フラグが特定の組み合わせである場合に、前記階層の深さNに属する第2の下位ブロックの四分木の分割情報を示す第2の下位フラグとして予め定めた第1の値を設定し、前記特定の組み合わせではない場合に、前記第2の下位フラグを復号し取得するステップと、前記上位フラグと、第1及び第2の下位フラグに従って、前記ブロックの復号画像信号を生成するステップと、を具備する。   An image decoding method according to an embodiment includes a flag indicating division information in units of blocks in a moving image decoding method for decoding a block obtained by dividing an input image signal into block sizes corresponding to a hierarchical depth N. A step of acquiring a bitstream, and a step of decoding and acquiring a higher flag indicating division information of a quadtree of the upper block, which is assigned to a higher block belonging to a hierarchy having a depth smaller than the depth N of the hierarchy Decoding and obtaining a first lower flag indicating division information of the quadtree of the upper block given to the first lower block among the lower blocks belonging to the depth N of the hierarchy; A quadtree of a second lower block belonging to the depth N of the hierarchy when the upper flag and the plurality of first lower flags already acquired are in a specific combination A first value set in advance as a second lower flag indicating division information is set, and when the combination is not the specific combination, the step of decoding and obtaining the second lower flag, the upper flag, Generating a decoded image signal of the block according to the first and second lower flags.

また、実施形態の画像復号化方法は、入力画像信号を、階層の深さNに応じたブロックサイズに分割されたブロックに符号化処理を行う動画像符号化方法において、ブロック単位での分割情報を示すフラグを符号化するステップと、前記階層の深さNよりも深さが小さい階層に属する上位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す上位フラグを取得するステップと、前記階層の深さNに属する下位ブロックのうち、第1の下位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す第1の下位フラグを取得するステップと、既に取得している前記上位フラグ及び複数の前記第1の下位フラグが特定の組み合わせである場合に、前記階層の深さNに属する第2の下位ブロックの四分木の分割情報を示す第2の下位フラグとして予め定めた第1の値を設定し、前記特定の組み合わせではない場合に、前記第2の下位フラグを取得するステップと、前記上位フラグと、第1及び第2の下位フラグに従って、前記ブロックの局部復号画像信号を生成するステップと、を具備する。   In addition, the image decoding method according to the embodiment is a moving image encoding method in which an input image signal is encoded into blocks divided into block sizes corresponding to the depth N of the hierarchy. And a step of obtaining an upper flag indicating division information of a quadtree of the upper block given to an upper block belonging to a hierarchy having a depth smaller than the depth N of the hierarchy. And obtaining a first lower flag indicating division information of the quadtree of the upper block, which is assigned to the first lower block among the lower blocks belonging to the depth N of the hierarchy, and has already been acquired The quadrant tree division information of the second lower block belonging to the depth N of the hierarchy when the upper flag and the plurality of first lower flags are in a specific combination. A first value that is set in advance as a low-order flag of the first, and when the combination is not the specific combination, the step of obtaining the second low-order flag, the high-order flag, and the first and second low-order flags And generating a locally decoded image signal of the block.

本発明によれば、階層的なCBPやCBF、スキップフラグの符号化時の冗長性を排除した符号化手段により圧縮されたデータが与えられたときに、復号化する画像復号化方法を提供することができる。   According to the present invention, there is provided an image decoding method for decoding when data compressed by an encoding unit that eliminates redundancy in encoding of hierarchical CBP, CBF, and skip flag is given. be able to.

符号化又は復号化の対象となる画素ブロックと符号化処理方向を表す図。The figure showing the pixel block used as the object of an encoding or decoding, and an encoding process direction. 本実施の形態の階層的CBP(下位が4ビットの場合)を示す図。The figure which shows hierarchical CBP (when a low-order is 4 bits) of this Embodiment. 図2に対応する単純な階層的CBPを示す図。FIG. 3 shows a simple hierarchical CBP corresponding to FIG. 2. 本実施の形態の階層的CBP(下位が2ビットの場合)を示す図。The figure which shows hierarchical CBP (when a low-order is 2 bits) of this Embodiment. 本実施の形態のブロック単位のCBPの符号化の動作の一例を示すフローチャート。The flowchart which shows an example of the operation | movement of CBP encoding of the block unit of this Embodiment. 図5の動作を実行する符号化装置のブロック図。FIG. 6 is a block diagram of an encoding device that performs the operation of FIG. 5. 本実施の形態のブロック単位のCBPの復号化の動作の一例を示すフローチャート。The flowchart which shows an example of the operation | movement of a CBP decoding of the block unit of this Embodiment. 図7の動作を実行する符号化装置のブロック図。The block diagram of the encoding apparatus which performs the operation | movement of FIG. 本実施の形態の階層的CBPの復号化方法の一例を示す図。The figure which shows an example of the decoding method of hierarchical CBP of this Embodiment. 図9の別の一例を示す図。The figure which shows another example of FIG. 図9の条件分岐を反転させた復号化方法の一例を示す図。The figure which shows an example of the decoding method which reversed the conditional branch of FIG. 8x8画素のブロックに対応するCBPが非0の場合に、4x4画素ブロックのCBFを復号化方法の一例を示す図。The figure which shows an example of the decoding method of CBF of a 4x4 pixel block, when CBP corresponding to a block of 8x8 pixel is non-zero. 上位ブロックのサイズが64x64画素、下位ブロックのサイズが32x32画素であり、かつ、下位が4ビットの階層的CBPを復号化方法の一例を示す図。The figure which shows an example of the decoding method of hierarchical CBP whose size of a high-order block is 64x64 pixels, the size of a low-order block is 32x32 pixels, and a low-order is 4 bits. 図13の別の一例を示す図。The figure which shows another example of FIG. 16x16の画素ブロックに対する1ビットの輝度CBPが与えられた場合に、4x4、8x8、16x8、8x16、16x16の変換についてのcbpを得るシンタックスの一例を示す図。The figure which shows an example of the syntax which obtains cbp about the conversion of 4x4, 8x8, 16x8, 8x16, 16x16, when the 1-bit brightness | luminance CBP with respect to a 16x16 pixel block is given. 単純な階層的スキップフラグを示す図。The figure which shows a simple hierarchical skip flag. 図16に対応する本実施の形態の階層的スキップフラグを示す図。The figure which shows the hierarchical skip flag of this Embodiment corresponding to FIG. 本実施の形態のブロック単位のスキップフラグの復号化の動作の一例を示す図。The figure which shows an example of the operation | movement of decoding of the skip flag of the block unit of this Embodiment. 図18の動作を実現するシンタックスの一例を示す図。The figure which shows an example of the syntax which implement | achieves the operation | movement of FIG. 四分木分割に基づいた再帰的ブロック分割の一例を示す図。The figure which shows an example of the recursive block division | segmentation based on quadtree division | segmentation. 四分木分割に基づいた再帰的ブロック分割の一例を示す図。The figure which shows an example of the recursive block division | segmentation based on quadtree division | segmentation. 四分木分割に基づいた再帰的ブロック分割の一例を示す図。The figure which shows an example of the recursive block division | segmentation based on quadtree division | segmentation. 四分木分割に基づいた再帰的ブロック分割におけるコーデットブロックフラグのシンタクス構造の一例を示す図。The figure which shows an example of the syntax structure of the codet block flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割におけるコーデットブロックフラグの冗長度を削減するシンタクス構造の一例を示す図。The figure which shows an example of the syntax structure which reduces the redundancy of the code block block flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割におけるコーデットブロックフラグの冗長度を削減するシンタクス構造の一例を示す図。The figure which shows an example of the syntax structure which reduces the redundancy of the code block block flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割におけるコーデットブロックフラグの冗長度を削減するシンタクス構造の一例を示す図。The figure which shows an example of the syntax structure which reduces the redundancy of the code block block flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割における上位コーデットブロックフラグと下位コーデットブロックフラグの符号長の一例を示す図。The figure which shows an example of the code length of the high-order coded block flag and the low-order coded block flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割における上位コーデットブロックフラグと下位コーデットブロックフラグの符号長の一例を示す図。The figure which shows an example of the code length of the high-order coded block flag and the low-order coded block flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割における上位コーデットブロックフラグと下位コーデットブロックフラグの符号長の一例を示す図。The figure which shows an example of the code length of the high-order coded block flag and the low-order coded block flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割における上位コーデットブロックフラグと下位コーデットブロックフラグの符号長の一例を示す図。The figure which shows an example of the code length of the high-order coded block flag and the low-order coded block flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割におけるスキップフラグの冗長度を削減するシンタクス構造の一例を示す図。The figure which shows an example of the syntax structure which reduces the redundancy of the skip flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割におけるスキップフラグの冗長度を削減するシンタクス構造の一例を示す図。The figure which shows an example of the syntax structure which reduces the redundancy of the skip flag in the recursive block division based on quadtree division. 四分木分割に基づいた再帰的ブロック分割におけるスキップフラグの冗長度を削減するシンタクス構造の一例を示す図。The figure which shows an example of the syntax structure which reduces the redundancy of the skip flag in the recursive block division based on quadtree division. コーデットブロックフラグのシンタクス構造とスキップフラグのシンタクス構造とを組み合わせたシンタクス構造の一例を示す図。The figure which shows an example of the syntax structure which combined the syntax structure of the codet block flag, and the syntax structure of the skip flag. 本実施の形態の階層的なスキップフラグの符号化の動作の一例を示すフローチャート。The flowchart which shows an example of the operation | movement of a hierarchical skip flag encoding of this Embodiment.

以下、図面を参照しながら本発明の実施の形態に係る画像復号化方法、画像符号化方法、および装置について詳細に説明する。なお、以下の実施の形態では、同一の番号を付した部分については同様の動作を行うものとして、重ねての説明を省略する。
まず、H.264で復号化可能なデータを生成する符号化手段について簡単に説明しておく。この符号化手段は、例えば、図1に示すような、フレーム内予測(Intra予測)またはフレーム間予測(Inter予測)、離散コサイン変換(DCT;Discrete Cosine Transform)の近似である整数精度の直交変換およびその逆変換、係数の量子化および逆量子化、コンテキスト適応2値算術符号(CABAC; Context-based Adaptive Binary Arithmetic Code)あるいは可変長符号化(CAVLC;Context-adaptive Variable Length Coding)と呼ばれるエントロピー符号を組み合わせた手段により、H.264で復号化可能なデータを生成できる。
Hereinafter, an image decoding method, an image encoding method, and an apparatus according to embodiments of the present invention will be described in detail with reference to the drawings. Note that, in the following embodiments, the same numbered parts are assumed to perform the same operation, and repeated description is omitted.
First, H. An encoding means for generating data that can be decoded by H.264 will be briefly described. This encoding means, for example, as shown in FIG. 1, is an integer-precision orthogonal transform that is an approximation of intra-frame prediction (Intra prediction), inter-frame prediction (Inter prediction), or discrete cosine transform (DCT). And its inverse transform, coefficient quantization and inverse quantization, entropy code called Context-based Adaptive Binary Arithmetic Code (CABAC) or variable length coding (CAVLC) By means of a combination of H.264 data that can be decoded can be generated.

本実施の形態では、符号化においては上位のCBPが1である場合に、下位のCBP(4x4画素の場合はCBF)がすべて0であるという冗長な組み合わせに符号を割り当てないことを考える。本実施の形態の画像復号化方法はそのような圧縮データの復号化を目的とする。また、上位のスキップフラグが0である場合に、下位のスキップフラグがすべて1となるという冗長な組み合わせへの符号の割り当てを避けた符号化を行うものとする。本実施の形態の画像復号化方法はそのような圧縮データの復号化を行う。   In the present embodiment, it is considered that no code is assigned to a redundant combination in which all the lower CBPs (CBF in the case of 4 × 4 pixels) are 0 when the upper CBP is 1 in encoding. The image decoding method of the present embodiment aims to decode such compressed data. In addition, when the upper skip flag is 0, encoding is performed while avoiding the assignment of codes to redundant combinations in which the lower skip flags are all 1. The image decoding method according to the present embodiment decodes such compressed data.

(階層的CBPの冗長性削減、エンコーダ)
以下、残差信号の有無を表す情報をコーデットパターンデータと呼ぶこととする。H.264の規格書においては、コーデットパターンデータのうち、複数の8x8画素あるいは16x16画素ブロックに対するフラグをまとめたデータがCBP、1つの4x4画素ブロックに対するフラグがCBFに対応する。コーデットパターンデータのうち、上位の1ブロックに対応するコーデットパターンデータをupper_flag、その上位の1ブロックに属するi番目の下位のコーデットパターンデータをlower_flags[i]と呼ぶことにする。例えば、上記非特許文献1において、Luminance信号に対する8x8画素ブロックのCBPおよび4x4画素ブロックのCBFの場合、upper_flagおよびlower_flags[i]は、それぞれCodedBlockPatternLuma内の1ビット、およびi番目の4x4画素ブロックの残差信号に対するcoded_block_flagに対応する。
(Reduce redundancy of hierarchical CBP, encoder)
Hereinafter, information indicating the presence / absence of a residual signal will be referred to as coded pattern data. H. In the H.264 standard, among the coded pattern data, data that summarizes flags for a plurality of 8 × 8 pixel or 16 × 16 pixel blocks corresponds to CBP, and a flag for one 4 × 4 pixel block corresponds to CBF. Of the coded pattern data, the coded pattern data corresponding to the upper one block is called upper_flag, and the i-th lower coded pattern data belonging to the upper one block is called lower_flags [i]. For example, in Non-Patent Document 1, in the case of CBP of 8 × 8 pixel block and CBF of 4 × 4 pixel block for the Luminance signal, upper_flag and lower_flags [i] are 1 bit in CodedBlockPatternLuma and the remaining of the i-th 4 × 4 pixel block, respectively. Corresponds to coded_block_flag for the difference signal.

MPEG−1/2/4の圧縮ビデオ復号規格やH.264など多くの規格に定められた復号化の過程では、画像をブロック単位で区切ったうえで、ブロック単位での復号化処理を行う。そこで、以下の説明では、ブロック単位での符号化(エンコード)の過程の一例、およびブロック単位での復号化(デコード)の過程の一例について説明する。画面全体の処理は、ブロック単位の処理を区切られたブロックの数だけ繰り返すことで行える。   MPEG-1 / 2/4 compressed video decoding standard and H.264 standard. In the decoding process defined in many standards such as H.264, the image is divided in units of blocks, and then the decoding process is performed in units of blocks. Therefore, in the following description, an example of a process of encoding (encoding) in units of blocks and an example of a process of decoding (decoding) in units of blocks will be described. The processing of the entire screen can be performed by repeating the processing for each block by the number of divided blocks.

本発明の実施の形態では、コーデットパターンデータを階層的に符号化する際に、特定のパターンに対応する符号量を減らすことで圧縮率を向上させる手段を提供し、およびそのような手段で生成されたビットストリームを復号化する。特定のパターンの具体的な例(下位が4ビットの場合)を図2に示し、図2に対応した単純な階層的コーデットパターンデータの例(下位が4ビットの場合)を図3に示す(なお、図3は上記非特許文献1のH.264で使われている)。   In the embodiment of the present invention, when coded pattern data is hierarchically encoded, a means for improving the compression ratio by reducing the amount of code corresponding to a specific pattern is provided, and generated by such means. Decoded bitstream is decoded. A specific example of a specific pattern (when the lower order is 4 bits) is shown in FIG. 2, and an example of simple hierarchical code pattern data corresponding to FIG. 2 (when the lower order is 4 bits) is shown in FIG. 3 is used in H.264 of Non-Patent Document 1).

図3では、下位コーデットパターンデータ(lower−flags)が0001の場合に、符号化データは0001になる。これに対し、図2の本発明の実施の形態では、下位コーデットパターンデータ(lower−flags)が0001の場合には最後の1ビットを符号せず、符号化データを000とする。復号化においては、上位コーデットパターンデータが1であり、かつ、4ビットの下位コーデットパターンのうち、最後の1ビットを除いた3ビットが000であることがわかれば、最後の1ビットは1であることがわかる。すなわち、符号化において1ビット分符号化する必要、および、符号化されたデータの復号化において1ビット分復号化する必要がなくなる場合がある。   In FIG. 3, when the low-order code pattern data (lower-flags) is 0001, the encoded data is 0001. On the other hand, in the embodiment of the present invention shown in FIG. 2, when the lower-order code pattern data (lower-flags) is 0001, the last 1 bit is not encoded and the encoded data is 000. In decoding, if it is found that the upper code pattern data is 1 and 3 bits excluding the last 1 bit in the 4-bit lower code pattern are 000, the last 1 bit is 1. I know that there is. That is, there is a case where it is not necessary to encode 1 bit in encoding, and it is not necessary to decode 1 bit in decoding encoded data.

なお、図2では下位のコーデットパターンデータを4ビットとしているが、特に4ビットである必要はなく、例えば図4に示す2ビットであってもよい。2ビットの場合には、上位コーデットパターンデータが1であり、かつ、2ビットの下位コーデットパターンのうち、最初の1ビットが0であることがわかれば、最後の1ビットは1であることがわかる。したがって、この場合も、符号化において1ビット分符号化する必要、および、符号化されたデータの復号化において1ビット分復号化する必要がなくなる場合がある。   In FIG. 2, the low-order code pattern data is 4 bits. However, it is not particularly necessary to be 4 bits. For example, 2 bits shown in FIG. 4 may be used. In the case of 2 bits, if it is found that the upper code pattern data is 1 and the first 1 bit is 0 in the 2-bit lower code pattern, the last 1 bit may be 1. Recognize. Therefore, in this case as well, there is a case where it is not necessary to encode one bit in encoding and it is not necessary to decode one bit in decoding encoded data.

次に、ブロック単位のCBPの符号化の過程を示すフローチャートを図5、符号化に利用する装置の一例を図6に示す。コーデットパターンデータの符号化は、例えば、次の方法により行える。なお、以下の説明では、コーデットパターンデータ以外の部分の符号化であるステップ3、ステップ11も含めて説明する。   Next, FIG. 5 shows a flowchart showing the process of encoding CBP in block units, and FIG. 6 shows an example of an apparatus used for encoding. The coding pattern data can be encoded by the following method, for example. In the following description, step 3 and step 11 which are encoding of portions other than the codet pattern data will be described.

ステップ1.(S501)画像入力部601が画像ブロックを読み込む。ここで読み込むブロックは、典型的には、ステップ5における上位コーデットパターンデータに対応したブロックと同じか、それより大きなサイズ(例えば、16x16画素)を持つものとする。   Step 1. (S501) The image input unit 601 reads an image block. The block to be read here is typically assumed to have the same size or larger size (for example, 16 × 16 pixels) than the block corresponding to the higher-order code pattern data in step 5.

ステップ2.(S502)演算ユニット602がS501で読みこんだブロックに対して符号化すべき予測モードをプログラム用メモリ605から読み込む。なお、この予測モードは予め決めておく場合もあるし、複数の予測モードのそれぞれでステップS503以降を行い最も良いモードを選択する場合もある。他にも予測モードを設定する変形例はたくさんある。   Step 2. (S502) The calculation unit 602 reads from the program memory 605 the prediction mode to be encoded for the block read in S501. The prediction mode may be determined in advance, or the best mode may be selected by performing step S503 and subsequent steps in each of a plurality of prediction modes. There are many other variations for setting the prediction mode.

ステップ3.演算ユニット602は予測モードを符号化して、符号化データ出力部604はビットストリームに出力する。   Step 3. The arithmetic unit 602 encodes the prediction mode, and the encoded data output unit 604 outputs it to the bit stream.

ステップ4.(S503)演算ユニット602は予測モードとすでに復号可能となったデータを利用してブロック予測を行い、入力画像ブロックと予測画像ブロックの差である予測残差を求める。   Step 4. (S503) The arithmetic unit 602 performs block prediction using the prediction mode and data that has already been decoded, and obtains a prediction residual that is the difference between the input image block and the predicted image block.

ステップ5.(S504)演算ユニット602は、予測残差にブロック変換(例えば、あらかじめトレーニングデータにより生成したKLTの基底や、DCTの基底を利用した直交変換)および量子化を施す。ここで変換を行うブロックは、ステップ1のブロックよりも小さなサイズ(例えば、4x4画素)を持つものとする。次に、演算ユニット602は量子化された変換係数の中に非0の係数が存在するか否かをあらわす情報をブロック単位で算出する。典型的には、この情報は、ブロック内に非0の係数が存在する場合には1、ブロック内の係数がすべて0の場合には0という、ブロックごとに1ビットのフラグ情報になる。この情報を下位のコーデットパターンデータ(下位CBPやCBF)と呼ぶ。次に、下位のコーデットパターンデータの集合(例えば、4つの下位のコーデットパターンデータ)がすべて0か否かという情報を表す、より大きなブロックに対するコーデットパターンデータである上位のコーデットパターンデータ(上位CBP)を求める。典型的には、上位のコーデットパターンデータは、下位のコーデットパターンデータがすべて0であれば0、下位のコーデットパターンデータに1つでも非0の情報があれば1という、ブロックごとに1ビットのフラグ情報になる。ここで、上位コーデットパターンデータに対応するブロックのサイズは、下位コーデットパターンデータよりも大きなサイズ(例えば8x8画素)を持つものとする。   Step 5. (S504) The arithmetic unit 602 performs block transform (for example, KLT base generated by training data in advance or orthogonal transform using DCT base) and quantization on the prediction residual. Here, it is assumed that the block to be converted has a smaller size (for example, 4 × 4 pixels) than the block in Step 1. Next, the arithmetic unit 602 calculates information representing whether or not non-zero coefficients exist in the quantized transform coefficients in units of blocks. Typically, this information is 1-bit flag information for each block, which is 1 when a non-zero coefficient exists in the block and 0 when all the coefficients in the block are 0. This information is referred to as lower-order code pattern data (lower-order CBP or CBF). Next, higher-order code pattern data (upper CBP), which is code pattern data for a larger block, represents information indicating whether or not a set of lower-order code pattern data (for example, four lower-order code pattern data) is all zero. Ask for. Typically, the high-order code pattern data is 1 bit for each block, 0 if the low-order code pattern data is all 0, and 1 if there is any non-zero information in the low-order code pattern data. It becomes flag information. Here, it is assumed that the size of the block corresponding to the high-order code pattern data is larger than the low-order code pattern data (for example, 8 × 8 pixels).

ステップ6.(S505)演算ユニット602が上位のコーデットパターンデータを符号化して、符号化データ出力部604がビットストリームに出力する。   Step 6. (S505) The arithmetic unit 602 encodes the high-order code pattern data, and the encoded data output unit 604 outputs it to the bit stream.

ステップ7.(S506)演算ユニット602は、上位のコーデットパターンデータが0である場合にはステップ8〜10を飛ばし、そうでないのならステップ8を実行する。   Step 7. (S506) The arithmetic unit 602 skips Steps 8 to 10 when the higher-order code pattern data is 0, and executes Step 8 otherwise.

ステップ8.(S507)ステップ8〜10は下位のコーデットパターンデータを1ビットずつ符号化していく過程である。このステップでは次の条件分岐を実行する。演算ユニット602は、すでに符号化された下位のコーデットパターンデータが特定のパターンデータである場合(典型的には、最後の1ビットの下位のコーデットパターンデータを符号化する場合であって、かつ、符号化済みの下位のコーデットパターンデータがすべて0である場合)には、次のビットストリームに出力するステップ9を飛ばし、そうでなければステップ9を実行する。   Step 8. (S507) Steps 8 to 10 are processes in which the low-order code pattern data is encoded bit by bit. In this step, the next conditional branch is executed. The arithmetic unit 602 is a case where the already encoded lower-order code pattern data is specific pattern data (typically, the last one-bit lower-order code pattern data is encoded, and If all the encoded lower-order code pattern data is 0), step 9 for outputting to the next bit stream is skipped; otherwise, step 9 is executed.

ステップ9.(S508)次に、演算ユニット602は符号化すべき下位のコーデットパターンデータを符号化して、符号化データ出力部604はビットストリームに出力する。   Step 9. (S508) Next, the arithmetic unit 602 encodes lower-order code pattern data to be encoded, and the encoded data output unit 604 outputs it to the bit stream.

ステップ10.(S509)演算ユニット602は、下位のコーデットパターンデータをすべて符号化していればステップ11に進め、そうでなければステップ8に戻る。S507からS509のループはビット数に応じて回る回数が決まり、例えば4ビットであれば4回だけ回すことになる。   Step 10. (S509) The arithmetic unit 602 proceeds to step 11 if all the lower-order code pattern data have been encoded, and returns to step 8 if not. In the loop from S507 to S509, the number of times of rotation is determined according to the number of bits.

ステップ11.符号化データ出力部604は、コーデットパターンデータが非0のブロックについて、量子化された変換係数を符号化してビットストリームに出力する。   Step 11. The encoded data output unit 604 encodes the quantized transform coefficient for a block having non-zero coded pattern data, and outputs the result to a bit stream.

なお、ステップ3はS501やS502より前にあってもよい。エンコーダは、例えば、符号化すべき予測モードを切り替えながらステップ2〜11を繰り返し試したうえで、符号化効率が良い予測モードを選択することで、圧縮率を向上させることができる。ただし、デコード可能なビットストリームを出力するために、このような繰り返しは必須ではなく、別の基準で予測モードを決めてもよい。   Step 3 may be before S501 or S502. The encoder can improve the compression rate by, for example, repeatedly trying steps 2 to 11 while switching the prediction mode to be encoded and then selecting a prediction mode with good encoding efficiency. However, in order to output a decodable bitstream, such repetition is not essential, and the prediction mode may be determined based on another criterion.

次に、符号化装置について図6を参照して説明する。
本実施の形態の符号化装置は、画像入力部601、演算ユニット602、データ用メモリ603、符号化データ出力部604、プログラム用メモリ605を含む。
Next, the encoding apparatus will be described with reference to FIG.
The encoding apparatus according to the present embodiment includes an image input unit 601, an arithmetic unit 602, a data memory 603, an encoded data output unit 604, and a program memory 605.

画像入力部601は画像ブロックを読み込む。演算ユニット602は、画像入力部601が読み込んだ画像ブロックに対し、データ用メモリ603およびプログラム用メモリ605を参照して符号化を行う。データ用メモリ603は、一時記憶装置であり、例えば現在処理しているフレームの前フレームを一時的に記憶する。データ用メモリ603は例えばRAMである。プログラム用メモリ605は、符号化のためのプログラムを記憶している。プログラム用メモリ605は例えばROMまたはRAMである。符号化データ出力部604は、符号化されたデータをビットストリームに出力する。   The image input unit 601 reads an image block. The arithmetic unit 602 encodes the image block read by the image input unit 601 with reference to the data memory 603 and the program memory 605. The data memory 603 is a temporary storage device, and temporarily stores, for example, a frame before the currently processed frame. The data memory 603 is a RAM, for example. The program memory 605 stores a program for encoding. The program memory 605 is, for example, a ROM or a RAM. The encoded data output unit 604 outputs the encoded data to a bit stream.

(階層的CBPの冗長性削減、デコーダ)
以上の方法で生成されたビットストリームを復号化(ブロック単位のCBPの復号化)する方法のフローチャートの一例を図7に、復号化を実行するための装置の一例を図8に示す。コーデットパターンデータの復号化は、例えば、次のステップ1〜10の方法により行える。
(Reduce redundancy of hierarchical CBP, decoder)
FIG. 7 shows an example of a flowchart of a method for decoding the bit stream generated by the above method (decoding of CBP in units of blocks), and FIG. 8 shows an example of an apparatus for executing the decoding. The decoding of the coded pattern data can be performed by the following methods 1 to 10, for example.

ステップ1.(S701)符号化データ入力部801が入力データとしてビットストリームを入力する。ビットストリームは、ブロック単位での予測情報、ブロック単位での予測残差信号の有無を表すコーデットパターンデータ、およびブロック単位での予測残差信号をエントロピー符号化した画像データを含む。   Step 1. (S701) The encoded data input unit 801 inputs a bit stream as input data. The bit stream includes prediction information in units of blocks, coded pattern data indicating the presence / absence of a prediction residual signal in units of blocks, and image data obtained by entropy encoding the prediction residual signal in units of blocks.

ステップ2.(S702)次に演算ユニット802が、取得すべきデータが上位のコーデットパターンデータ(例えば、上位のCBP)であるかどうかを判定し、上位のコーデットパターンデータであると判定された場合にはステップ3へ、そうでなければステップ4へ飛ぶ。   Step 2. (S702) Next, the arithmetic unit 802 determines whether the data to be acquired is higher-order code pattern data (for example, higher-order CBP), and if it is determined that the data is higher-order code pattern data, step S702 If not, jump to step 4.

ステップ3.(S703)演算ユニット802が上位のコーデットパターンデータをエントロピー復号により取得する。ステップ9へ飛ぶ。   Step 3. (S703) The arithmetic unit 802 obtains higher-order code pattern data by entropy decoding. Jump to step 9.

ステップ4.(S704)次に演算ユニット802が、取得すべきデータが上位コーデットパターンデータに属するコーデットパターンデータである下位のコーデットパターンデータ(例えば、下位のCBPあるいは下位のCBF)であるかどうかを判定し、下位のコーデットパターンデータであると判定された場合にはステップ6へ、そうでなければステップ5へ飛ぶ。   Step 4. (S704) Next, the arithmetic unit 802 determines whether the data to be acquired is low-order code pattern data (for example, low-order CBP or low-order CBF) that is code pattern data belonging to the high-order code pattern data. If it is determined that the code pattern data is lower order, the process jumps to step 6; otherwise, the process jumps to step 5.

ステップ5.(S705)次に演算ユニット802が取得すべき(コーデットパターンデータ以外の)データを取得しステップ9へ飛ぶ。   Step 5. (S705) Next, the data to be acquired by the arithmetic unit 802 (other than the coded pattern data) is acquired and the process jumps to Step 9.

ステップ6.(S706)演算ユニット802が、すでに取得された下位のコーデットパターンデータが予め定められたパターンであるかどうかを判定し、予め定められたパターンである場合にはステップ7へ飛び、そうでなければステップ8へ飛ぶ。例えば、図2の例においては、予め定められたパターンとは、下位のコーデットパターンデータが4ビットであり、かつ、すでに下位のコーデットパターンデータが3ビット取得されていて次に取得すべきデータが4ビット目のコーデットパターンデータであり、かつ、すでに取得された3ビットが000であるパターンを指す。   Step 6. (S706) The arithmetic unit 802 determines whether the already acquired lower-order code pattern data is a predetermined pattern. If it is a predetermined pattern, the operation unit 802 jumps to step 7, otherwise. Jump to step 8. For example, in the example of FIG. 2, the predetermined pattern is that the lower-order code pattern data is 4 bits, and the lower-order code pattern data has already been acquired in 3 bits, and the next data to be acquired is It is the 4th bit code pattern data, and indicates the pattern in which 3 bits already acquired is 000.

ステップ7.(S707)次に演算ユニット802が、取得すべき下位のコーデットパターンデータとして、予め定められた固定値を設定し、設定後ステップ9へ飛ぶ。例えば、図2の例では、次に取得すべき4ビット目のコーデットパターンデータとして1を設定する。   Step 7. (S707) Next, the arithmetic unit 802 sets a predetermined fixed value as lower-order code pattern data to be acquired, and jumps to step 9 after the setting. For example, in the example of FIG. 2, 1 is set as the fourth bit code pattern data to be acquired next.

ステップ8.(S708)次に演算ユニット802が、取得すべき下位のコーデットパターンデータをエントロピー復号により取得する。   Step 8. (S708) Next, the arithmetic unit 802 acquires lower-order codet pattern data to be acquired by entropy decoding.

ステップ9.(S709)演算ユニット802がブロック情報の取得が完了しているかどうかを判定し、取得が完了していればステップ10へ飛び、そうでなければステップ2へ飛ぶ。ブロック情報は、復号された、ブロック単位での予測情報およびブロック単位での予測残差信号を示す。すなわち、このフローでは明示されていないが、ビットストリームに含まれる情報がブロック単位での予測情報である場合にはビットストリームを復号化しブロック単位での予測情報を得るステップがあり、ビットストリームに含まれる情報がブロック単位での予測残差信号である場合にはビットストリームを復号化しブロック単位での予測残差信号を得るステップがある。   Step 9. (S709) The arithmetic unit 802 determines whether or not the acquisition of the block information has been completed. If the acquisition has been completed, the process jumps to Step 10, and if not, the process jumps to Step 2. Block information indicates decoded prediction information in units of blocks and prediction residual signals in units of blocks. That is, although not explicitly shown in this flow, when the information included in the bitstream is prediction information in units of blocks, there is a step of decoding the bitstream to obtain prediction information in units of blocks, which is included in the bitstream. If the information to be recorded is a prediction residual signal in units of blocks, there is a step of obtaining a prediction residual signal in units of blocks by decoding the bitstream.

ステップ10.(S710)演算ユニット802が取得されたブロック情報に基づきブロック画像信号を復元し、画像出力部804が復元された画像を出力する。   Step 10. (S710) The arithmetic unit 802 restores the block image signal based on the acquired block information, and the image output unit 804 outputs the restored image.

次に、復号化装置について図8を参照して説明する。
本実施の形態の復号化装置は、符号化データ入力部801、演算ユニット802、データ用メモリ803、画像出力部804、プログラム用メモリ805を含む。
Next, the decoding apparatus will be described with reference to FIG.
The decoding apparatus according to the present embodiment includes an encoded data input unit 801, an arithmetic unit 802, a data memory 803, an image output unit 804, and a program memory 805.

符号化データ入力部801は入力データとしてビットストリームを入力する。演算ユニット802は、符号化データ入力部801が入力したビットストリームに含まれるブロックを、ブロックの切れ目を判断しながら、データ用メモリ603およびプログラム用メモリ605を参照して復号化を行う。データ用メモリ803は、一時記憶装置であり、例えば符号化データ入力部801が入力したビットストリームを一時的に記憶する。プログラム用メモリ805は、復号化のためのプログラムを記憶していて、例えば下記図9または図10に示す擬似プログラムに対応するプログラムを格納している。   The encoded data input unit 801 inputs a bit stream as input data. The arithmetic unit 802 decodes the blocks included in the bit stream input by the encoded data input unit 801 with reference to the data memory 603 and the program memory 605 while determining the block breaks. The data memory 803 is a temporary storage device, and temporarily stores, for example, the bit stream input by the encoded data input unit 801. The program memory 805 stores a program for decoding and stores, for example, a program corresponding to the pseudo program shown in FIG. 9 or FIG.

次に、下位のコーデットパターンデータが4ビットの階層的CBPの場合の復号化方法のシンタックスの一例を図9に、下位のコーデットパターンデータがnum_lower_blocksビットの階層的CBPの場合の復号化方法のシンタックスの一例を図10に示す。図9、図10において、ae(v)とされた行はエントロピー復号(例えばCABAC)により1ビットの情報を取得することを表し、そうでない行はその行を実行することを表す。「(upper_flag is already decoded)」は、上位のコーデットパターンデータがすでにupper_flagとして取得されていることを表す。「(other decoding processes, optional)」は、もし他のシンタックス処理が必要であれば、そのシンタックス処理を実行することを表す。なお、コーデットパターンデータが特定の組み合わせであるかを判定する条件分岐判定は反転させることが可能である。図9の条件分岐判定を反転させた例を図11に示す。他の図についても同様である。   Next, FIG. 9 shows an example of the syntax of the decoding method when the lower-order code pattern data is a 4-bit hierarchical CBP. FIG. 9 shows the decoding method when the lower-order code pattern data is a num_lower_blocks-bit hierarchical CBP. An example of the syntax is shown in FIG. 9 and 10, a line indicated as ae (v) indicates that 1-bit information is acquired by entropy decoding (for example, CABAC), and a line that does not indicate that the line is executed. “(Upper_flag is already decoded)” indicates that the higher-order code pattern data has already been acquired as upper_flag. “(Other decoding processes, optional)” indicates that if other syntax processing is necessary, the syntax processing is executed. It should be noted that the conditional branch determination for determining whether the coded pattern data is a specific combination can be reversed. An example in which the conditional branch determination in FIG. 9 is reversed is shown in FIG. The same applies to other figures.

(CBPとCBF)
H.264では、4x4画素のブロックに対応したコーデットパターンデータであるcoded_block_flagは、第1のcoded_block_flag、第1のcoded_block_flagが非0の場合には第1の変換係数、第2のcoded_block_flag、第2のcoded_block_flagが非0の場合には第2の変換係数、というように、変換係数とあわせて復号化される。この場合、上位のコーデットパターンデータとして8x8画素のブロックに対応するCBP、下位のコーデットパターンデータとして8x8画素のブロックを構成する各4x4画素のブロックに対応したCBFを考えると、シンタックスは図12のように表せる。図12は、8x8画素のブロックに対応するCBPが非0の場合に、4x4画素ブロックのCBFを復号化する方法の一例を示す。
(CBP and CBF)
H. In H.264, coded_block_flag, which is coded pattern data corresponding to a block of 4 × 4 pixels, is the first coded_block_flag, and when the first coded_block_flag is non-zero, the first conversion coefficient, the second coded_block_flag, and the second coded_block are In the case of non-zero, the second transform coefficient is decoded together with the transform coefficient. In this case, considering the CBP corresponding to the 8 × 8 pixel block as the upper code pattern data and the CBF corresponding to each 4 × 4 pixel block constituting the 8 × 8 pixel block as the lower code pattern data, the syntax is as shown in FIG. It can be expressed as follows. FIG. 12 shows an example of a method for decoding a CBF of a 4 × 4 pixel block when the CBP corresponding to the block of 8 × 8 pixels is non-zero.

図12において、引数blockIndexは、処理中の4x4画素ブロックがそれを含む8x8画素のブロック内で先頭のブロックを0としたときのインデックスを表し、(decode residual coefficients coeffLevel[i])は変換係数を復号化することを表す。また、最初の4x4画素ブロックを復号化する前に、nonzero_coded_block_flag_foundには0を設定しておくものとする。8x8画素のブロックを構成する4x4画素ブロックは4つあるから、blockIndexが3であり、かつ、他のcoded_block_flagが0である場合には、coded_block_flagを復号化せずに1とすることができる。そうでない場合には、coded_block_flagを復号化する必要がある。なお、図12には含まれていないが、予測モードによっては常にcoded_block_flagを復号化する必要があるため、図12の関数を呼び出す前に、常にcoded_block_flagを復号化する必要があるかを、判定しておく必要がある。常にcoded_block_flagを復号化する必要がある予測モードとしては、例えば、H.264のIntra16x16予測があげられる。このモードでは、輝度ブロックに対応したCBPの表現として、16x16画素ブロックを構成する4つの8x8ブロックに対する4ビットのCBPについて、すべてのビットが0であるかすべてのビットが1であるかの2通りしか用意されていない。この場合、上位のCBPが1かつ下位のCBFがすべて0という符号を用意しておかなければ、16x16画素内の任意の8x8画素ブロックにおいて、8x8画素ブロック内のCBFがすべて0になるというコーデットパターンデータを表現できない。したがって、H.264のIntra16x16予測では、常にcoded_block_flagを復号化する必要がある。   In FIG. 12, an argument blockIndex represents an index when a 4 × 4 pixel block being processed has a leading block of 0 in an 8 × 8 pixel block including the block, and (decode residual coefficients coeffLevel [i]) represents a conversion coefficient. It represents decoding. Also, before decoding the first 4 × 4 pixel block, 0 is set to nonzero_coded_block_flag_found. Since there are four 4 × 4 pixel blocks constituting an 8 × 8 pixel block, when blockIndex is 3 and other coded_block_flag is 0, coded_block_flag can be set to 1 without decoding. Otherwise, the coded_block_flag needs to be decoded. Although not included in FIG. 12, since it is necessary to always decode coded_block_flag depending on the prediction mode, it is determined whether it is necessary to always decode coded_block_flag before calling the function of FIG. It is necessary to keep. As a prediction mode in which coded_block_flag must always be decoded, for example, H.264 H.264 Intra16 × 16 prediction. In this mode, CBP corresponding to the luminance block is expressed in two ways, with all bits being 0 or all bits being 1 for 4-bit CBP for four 8x8 blocks constituting a 16x16 pixel block. Only available. In this case, unless a sign that the upper CBP is 1 and the lower CBF is all 0 is prepared, a coded pattern in which all CBFs in an 8x8 pixel block are 0 in an arbitrary 8x8 pixel block in 16x16 pixels. The data cannot be represented. Therefore, H.H. In H.264 Intra16 × 16 prediction, it is necessary to always decode coded_block_flag.

(上位CBPと下位CBP)
H.264では、上位のコーデットパターンデータを持つブロック(マクロブロック)のサイズは16x16画素である。しかし、符号化効率を考えると、例えばマクロブロックのサイズを32x32画素や64x64画素に拡張するという拡張も考えられる。これを拡張マクロブロックと呼ぶことにする。拡張マクロブロックでは、例えば、32x32画素の拡張マクロブロックを構成する16x16画素のブロックは、輝度ブロックのみを考えれば4個、輝度ブロック4つに加えてCb、Crの色差ブロックまで考えれば12個存在することになる。CBPは0となることが多く、0のフラグを12個も符号化することは避けたい。そこでマクロブロックの拡張として、32x32画素の拡張マクロブロックを構成するCBPがすべて0であるか、1つ以上の非0のビットを持つCBPであるかというコーデットパターンデータを符号化することが考えられる。この実施例では、32x32画素の拡張マクロブロックに対するコーデットパターンデータをcoded_block_pattern_32と呼ぶことにする。coded_block_pattern_32は1ビットのフラグ情報である。さらに大きな拡張マクロブロックとして、64x64画素のレベル2拡張マクロブロックを考えるなら、レベル2拡張マクロブロックを構成する32x32画素のCBPであるcoded_block_pattern_32がすべて0であるか、1つ以上の非0のビットを持つCBPであるかを符号化することが考えられる。この実施例では、64x64画素の拡張マクロブロックに対するコーデットパターンデータをcoded_block_pattern_64と呼ぶこととし、その64x64画素ブロックを構成する4つの32x32画素ブロックについては、インデックスを付与してcoded_block_pattern_32[0]〜coded_block_pattern_32[3]と呼ぶことにする。
(Upper CBP and Lower CBP)
H. In H.264, the size of a block (macroblock) having higher-order code pattern data is 16 × 16 pixels. However, considering the encoding efficiency, for example, an extension of expanding the macroblock size to 32 × 32 pixels or 64 × 64 pixels is also conceivable. This is called an extended macroblock. In the extended macroblock, for example, there are four 16 × 16 pixel blocks constituting the extended macroblock of 32 × 32 pixels if only the luminance block is considered, and if there are four luminance blocks and Cb and Cr color difference blocks, there are 12 blocks. Will do. CBP is often 0, and it is desirable to avoid coding 12 flags of 0. Thus, as an extension of the macroblock, it is conceivable to code the coded pattern data indicating whether the CBPs constituting the extended macroblock of 32 × 32 pixels are all 0 or CBP having one or more non-zero bits. . In this embodiment, the coded pattern data for an extended macroblock of 32 × 32 pixels is called coded_block_pattern_32. coded_block_pattern_32 is 1-bit flag information. If a level 2 extended macroblock of 64 × 64 pixels is considered as a larger extended macroblock, coded_block_pattern_32 which is a 32 × 32 pixel CBP constituting the level 2 extended macroblock is all 0, or one or more non-zero bits are set. It is conceivable to encode whether the CBP is possessed. In this embodiment, the coded pattern data for an extended macroblock of 64 × 64 pixels is called coded_block_pattern_64, and the four 32 × 32 pixel blocks constituting the 64 × 64 pixel block are indexed and coded_block_pattern_32 [0] to coded_block_pattern_32 [3 ].

coded_block_pattern_64およびcoded_block_pattern_32をデコードする処理の流れの一例を図13、別の一例を図14に示す。双方の図は、上位ブロックのサイズが64x64画素、下位ブロックのサイズが32x32画素であり、かつ、下位が4ビットの階層的CBPを復号化する方法の一例を示す。   FIG. 13 shows an example of the flow of processing for decoding coded_block_pattern_64 and coded_block_pattern_32, and FIG. 14 shows another example. Both figures show an example of a method of decoding a hierarchical CBP in which the size of the upper block is 64 × 64 pixels, the size of the lower block is 32 × 32 pixels, and the lower block is 4 bits.

「(other decoding processes, optional)」は、もし他のシンタックス処理が必要であれば、そのシンタックス処理を実行することを表す。図13は、coded_block_pattern_64とcoded_block_pattern_32が符号化されたデータを復号化する場合の一例を表している。図13では、まずcoded_block_pattern_64を復号化し、それが0でない場合にはcoded_block_pattern_32の各要素を復号化している。この際、coded_block_pattern_32[3]については、coded_block_pattern_32[0]〜coded_block_pattern_32[2]のうち1つ以上が非0であれば復号化するが、coded_block_pattern_32[0]〜coded_block_pattern_32[2]のすべてが0である場合にはcoded_block_pattern_32[3]を1とする。図14は、図13におけるcoded_block_pattern_64とcoded_block_pattern_32が別の関数として表現された場合の一例を表している。図14において、macroblock_cluster_residual_64x64()は64x64画素のレベル2拡張マクロブロックの残差を復号化するための関数であり、macroblock_cluster_residual_32x32()は32x32画素の拡張マクロブロックの残差を復号化するための関数である。図13に対し、図14では、coded_block_pattern_64の復号化がmacroblock_cluster_residual_64x64()で行われ、coded_block_pattern_32の各要素の復号化はmacroblock_cluster_residual_32x32()で行われている点が異なる。coded_block_pattern_32[0]〜coded_block_pattern_32[2]のすべてが0である場合に、coded_block_pattern_32[3]を復号化せず固定値1とする点は図13と同じである。   “(Other decoding processes, optional)” indicates that if other syntax processing is necessary, the syntax processing is executed. FIG. 13 illustrates an example of decoding data in which coded_block_pattern_64 and coded_block_pattern_32 are encoded. In FIG. 13, first, coded_block_pattern_64 is decoded, and when it is not 0, each element of coded_block_pattern_32 is decoded. At this time, coded_block_pattern_32 [3] is decoded if at least one of coded_block_pattern_32 [0] to coded_block_pattern_32 [2] is non-zero, but coded_block_pattern_32 [0] to coded_block_patch_block0p32_pat_32_3 is all In this case, coded_block_pattern_32 [3] is set to 1. FIG. 14 shows an example in which coded_block_pattern_64 and coded_block_pattern_32 in FIG. 13 are expressed as different functions. In FIG. 14, macroblock_cluster_residual_64x64 () is a function for decoding the residual of the level 2 extended macroblock of 64x64 pixels, and macroblock_cluster_residual_32x32 () is a function for decoding the residual of the extended macroblock of 32x32 pixels. is there. 13, in FIG. 14, decoding of coded_block_pattern_64 is performed by macroblock_cluster_residual_64x64 (), and decoding of each element of coded_block_pattern_32 is performed by macroblock_cluster_residual_32 × 32 (32 points). 13 is the same as FIG. 13 in that when all of coded_block_pattern_32 [0] to coded_block_pattern_32 [2] are 0, coded_block_pattern_32 [3] is not decoded and is set to a fixed value 1.

(階層的CBPの具体例)
シンタックスの一例として、16x16画素のブロックに対して1ビットの輝度CBPが符号化および復号化され、輝度CBPが1の場合にのみ、16x16画素のブロック内に属する各ブロックについて、変換係数の有無をCBPとして符号化および復号化される例を、図15のシンタックスにしたがって説明する。図15は、16x16の画素ブロックに対する1ビットの輝度CBPが与えられた場合に、4x4、8x8、16x8、8x16、16x16の変換についてのcbpを得るシンタックスの一例を示す。
(Specific example of hierarchical CBP)
As an example of syntax, if a 1-bit luminance CBP is encoded and decoded for a 16 × 16 pixel block and the luminance CBP is 1, the presence / absence of a transform coefficient for each block belonging to the 16 × 16 pixel block An example of encoding and decoding as a CBP will be described with reference to the syntax of FIG. FIG. 15 shows an example of a syntax for obtaining cbp for 4 × 4, 8 × 8, 16 × 8, 8 × 16, and 16 × 16 conversion when a 1-bit luminance CBP for a 16 × 16 pixel block is given.

変換のサイズとして、4x4、8x8、16x8、8x16、16x16の5通りを考える。変換タイプ「cur_transform_type」は、4x4に対応する0、8x8に対応する1、16x8/8x16/16x16のいずれかに対応する2の3値を取るものとする。「cur_transform_type」が2の場合、変換サイズは、予測ブロックのサイズが16x8であれば16x8、8x16であれば8x16、それ以外であれば16x16とする。変換サイズが4x4および8x8の場合には、4つの8x8ブロックに対する4ビットのCBPが必要である。変換サイズが16x8および8x16の場合には、それぞれ、2つの16x8ブロックおよび2つの8x16ブロックに対する2ビットのCBPが必要である。変換サイズが16x16の場合には、1ビットのCBPが必要である。   As conversion sizes, 5 types of 4 × 4, 8 × 8, 16 × 8, 8 × 16, and 16 × 16 are considered. The conversion type “cur_transform_type” is assumed to take three values of 0 corresponding to one of 0 corresponding to 4 × 4, 1 corresponding to 8 × 8, and 16 × 8/8 × 16/16 × 16. When “cur_transform_type” is 2, the transform size is 16 × 8 if the predicted block size is 16 × 8, 8 × 16 if 8 × 16, and 16 × 16 otherwise. For transform sizes 4x4 and 8x8, a 4 bit CBP for 4 8x8 blocks is required. For transform sizes of 16x8 and 8x16, a 2-bit CBP is required for two 16x8 blocks and two 8x16 blocks, respectively. When the conversion size is 16 × 16, 1-bit CBP is required.

この場合、図15に示すように、cur_transform_typeが0または1の場合には図2に対応した読み込みを行い、cur_transform_typeが2かつ変換サイズが16x8/8x16の場合には図4に対応した読み込みを行い、cur_transform_typeが2かつ変換サイズが16x16の場合には与えられたCBPをそのまま利用することで、本発明を利用できることになる。なお、図15において、「cbp_luma_1bit」は1ビットの輝度CBPを表し、「MbPartWidth(mb_type)」および「MbPartHeight(mb_type)」は予測ブロックのサイズを表し、cbpは16x16輝度ブロックを4つの8x8ブロックに分割した場合の、各8x8輝度ブロックに対応した4ビットのcbpを表す。図15のシンタックスでは、16x8/8x16/16x16の場合について、cbpを8x8ブロックにあわせて4ビットとしているが、これらの場合にcbpを8x8ブロックにあわせる必要はなく、それぞれ2ビット、2ビット、1ビットのcbpとして読み込んでもよい。   In this case, as shown in FIG. 15, when cur_transform_type is 0 or 1, reading corresponding to FIG. 2 is performed, and when cur_transform_type is 2 and the conversion size is 16 × 8/8 × 16, reading corresponding to FIG. 4 is performed. When cur_transform_type is 2 and the transform size is 16x16, the present invention can be used by using the given CBP as it is. In FIG. 15, “cbp_luma — 1 bit” represents 1-bit luminance CBP, “MbPartWidth (mb_type)” and “MbPartHeight (mb_type)” represent prediction block sizes, and cbp represents 16 × 16 luminance blocks in four 8 × 8 blocks. When divided, 4 bits of cbp corresponding to each 8 × 8 luminance block are represented. In the syntax of FIG. 15, in the case of 16 × 8/8 × 16/16 × 16, cbp is set to 4 bits in accordance with the 8 × 8 block. However, in these cases, it is not necessary to adjust cbp to the 8 × 8 block, and 2 bits, 2 bits, It may be read as 1-bit cbp.

(四分木分割による再帰構造をもった階層ブロックにおけるCBF符号化)
本実施形態の変更例として、H.264のブロック構造をMxMサイズ(Mは2のべき乗)のブロックに階層的に分割することを考える。この際、上位ブロックサイズを2Nx2N、下位ブロックサイズをNxN(Nは2のべき乗)で表現する。図20A、図20Bに2Nx2NサイズとNxNサイズの符号化ブロックを示す。上位ブロックサイズを分割する際には、分割を示す1ビットのフラグを用いて分割の有無を表現する。CBFについても同様に、上位ブロックに上位CBFが存在し、下記ブロックには0から3で示される4つのNxNブロック毎に4つの下位CBFが存在する。ここで上位CBFが1で有りかつ下位CBFが全て0の場合は、上位CBFが0である場合と同じ表現となるため冗長である。このようなCBFの符号化を考えた場合、上位CBFは、上位ブロックを分割するかどうかを示す情報と等価となる。
(CBF coding in hierarchical blocks with recursive structure by quadtree partitioning)
As a modification of the present embodiment, H. Suppose that the H.264 block structure is hierarchically divided into blocks of MxM size (M is a power of 2). At this time, the upper block size is expressed by 2N × 2N, and the lower block size is expressed by N × N (N is a power of 2). 20A and 20B show 2Nx2N size and NxN size encoded blocks. When the upper block size is divided, the presence / absence of division is expressed using a 1-bit flag indicating division. Similarly, for the CBF, an upper block CBF exists in the upper block, and in the following block, four lower CBFs exist for every four NxN blocks indicated by 0 to 3. Here, when the upper CBF is 1 and the lower CBFs are all 0, the expression is the same as when the upper CBF is 0, which is redundant. When considering such CBF encoding, the upper CBF is equivalent to information indicating whether to divide the upper block.

NxNを更に分割する場合においても、上記関係を用いて再帰的に表現することが可能である。例えば、上位ブロックと下位ブロックを再帰的に組み合わせた時の階層的な四分木分割の一例を図20Cに示す。図20Bでは下位ブロックとなっていたブロック2が、図20Cでは更に四分木分割されている。この場合、図20Cのブロック2には上位ブロックとしてのCBFが存在するとともに、ブロック2を四分木分割しているので下位ブロックの4つのCBFも存在することになる。ここでは、ブロック2の下位ブロックの番号を0’、1’、2’、3’として上位ブロックと区別している。   Even when NxN is further divided, it can be recursively expressed using the above relationship. For example, FIG. 20C shows an example of hierarchical quadtree partitioning when the upper block and the lower block are recursively combined. Block 2 which was a lower block in FIG. 20B is further divided into quadtrees in FIG. 20C. In this case, CBF as an upper block exists in block 2 in FIG. 20C, and four CBFs in the lower block also exist because block 2 is divided into quadtrees. Here, the lower block number of the block 2 is distinguished from the upper block as 0 ', 1', 2 ', 3'.

つまり、上位ブロックと下位ブロックの構成は、階層の深さによって変化する。例えば、階層の深さ(layer)で表現される上位ブロックは、(layer+1)の階層では4つの下位ブロックを持つことになる。同様に(layer+1)の階層で表現される上位ブロックは、(layer+2)の階層では4つの下位ブロックを持つことになる。CBFについても同様の階層化による四分木分割が可能である。   That is, the configuration of the upper block and the lower block changes depending on the depth of the hierarchy. For example, an upper block expressed by a layer depth (layer) has four lower blocks in the layer (layer + 1). Similarly, the upper block expressed in the (layer + 1) hierarchy has four lower blocks in the (layer + 2) hierarchy. Quad tree division by similar hierarchization is also possible for CBF.

このような階層的なブロック分割に対応するシンタクスの一例として、階層構造を再帰的に表現したときのCBFの関係を図21に示す。図中に示されるtransform_unit()は、図中太字で表されている、上位ブロックの非0の変換係数の有無を表すupper_coded_block_flagと、下位ブロックの非0の変換係数の有無を表すlower_coded_block_flagを符号化するシンタクス構造を示している。図中のcurrBlockPosは、当該ブロックの位置を示す情報であり、layerは、階層構造の深さを示す。例えば、currBlockPos0は図20Bにおけるブロック0を示し、currBlockPos3は図20Bにおけるブロック3を示している。layerの一例として、図20Aで2Nx2Nサイズが64x64の例を示すと、NxNサイズは32x32となり、layerは1となる。更にNxNを分割する場合、N/2xN/2サイズは16x16となり、layerは2となる。   As an example of syntax corresponding to such hierarchical block division, the relationship of CBF when a hierarchical structure is recursively expressed is shown in FIG. Transform_unit () shown in the figure encodes upper_coded_block_flag that indicates the presence / absence of non-zero transform coefficients in the upper block and lower_coded_block_flag that represents the presence / absence of non-zero transform coefficients in the lower block, which are shown in bold in the figure. Shows the syntax structure. In the figure, currBlockPos is information indicating the position of the block, and layer indicates the depth of the hierarchical structure. For example, currBlockPos0 indicates block 0 in FIG. 20B, and currBlockPos3 indicates block 3 in FIG. 20B. As an example of the layer, in FIG. 20A, when the 2N × 2N size is 64 × 64, the N × N size is 32 × 32 and the layer is 1. Further, when NxN is divided, the N / 2xN / 2 size is 16x16, and the layer is 2.

currLowerAvailableは、当該ブロックが下位CBFを保持することができるかどうかを示す内部変数である。言い換えれば、当該ブロックが、分割可能かどうかを示している。例えば、予め定めた最小分割ブロックサイズよりも当該ブロックを分割したときのブロックサイズが小さくなる場合、下位CBFを持つことができないためcurrLowerAvailableは0となる。一方、当該ブロックを更に分割することが可能である場合currLowerAvailableは1となる。   currLowerAvailable is an internal variable indicating whether or not the block can hold a lower CBF. In other words, it indicates whether or not the block can be divided. For example, if the block size when the block is divided is smaller than a predetermined minimum divided block size, currLowerAvailable is 0 because the lower CBF cannot be provided. On the other hand, currLowerAvailable is 1 when the block can be further divided.

upper_coded_block_flagは、上位ブロックの非0の変換係数の有無を示すフラグであり、言い換えれば上位ブロックを分割するかどうかを表している。分割する場合は1、分割しない場合は0となる。upper_coded_block_flagが1である場合、上位ブロックに非0の変換係数が存在するため、更に下位CBFを持つことが可能となる。関数calculateBlockPos()は、当該ブロックを四分木分割した際、i(iは0から最大3まで)で示される分割後のブロックの位置を返す関数である。currBlockPos0から3は、最大4つまでの分割後のブロックの位置を示す。   upper_coded_block_flag is a flag indicating the presence or absence of a non-zero transform coefficient in the upper block, in other words, whether or not the upper block is divided. It is 1 when dividing, and 0 when not dividing. When upper_coded_block_flag is 1, since there is a non-zero conversion coefficient in the upper block, it is possible to have a lower CBF. The function calculateBlockPos () is a function that returns the position of the block after division indicated by i (i is from 0 to a maximum of 3) when the block is divided into quadtrees. currBlockPos0 to 3 indicate the positions of blocks after division up to four.

lower_coded_block_flagは、下位ブロックの非0の変換係数の有無を示すシンタクス要素であり、当該下位ブロックに非0の変換係数が存在する場合は1を、存在しない場合は0となる。codedBlockFlagは階層構造毎にlower_coded_block_flagを保持する内部変数であり、下位ブロックに該当する当該ブロックからlayerが0で示される上位ブロックまでのlower_coded_block_flagが保持されている。   The lower_coded_block_flag is a syntax element indicating the presence / absence of a non-zero transform coefficient in a lower block, and is 1 when a non-zero transform coefficient exists in the lower block, and 0 when not present. CodedBlockFlag is an internal variable that holds lower_coded_block_flag for each hierarchical structure, and holds lower_coded_block_flag from the block corresponding to the lower block to the upper block indicated by layer = 0.

residual_block()は、CBF以外の変換係数に関連する情報を符号化する関数である。なお、本関数は非0の変換係数が存在する時だけ(lower_coded_block_flagが1のときだけ)呼び出される。更に、本関数はtransform_unit()以外の関数で呼び出される構成としてもよい。   residual_block () is a function that encodes information related to transform coefficients other than CBF. This function is called only when a non-zero conversion coefficient exists (only when lower_coded_block_flag is 1). Further, this function may be called by a function other than transform_unit ().

図21で示される再帰構造を持ったシンタクス構造を考えた場合、上位CBPが1である場合に、下位のCBP(4x4画素の場合はCBF)がすべて0であるという冗長な組み合わせが存在する。   Considering the syntax structure having the recursive structure shown in FIG. 21, when the upper CBP is 1, there is a redundant combination in which the lower CBP (CBF in the case of 4 × 4 pixels) is all 0.

(四分木分割による再帰構造をもった階層ブロックにおけるCBFの冗長度削減)
図21で説明した再帰構造を持つCBFのシンタクス構造時にも発生する下位CBFの冗長性を削減したシンタクス構造の一例が図22に示されている。図22では、transform_unit()関数に、DecodedSkipFlagが引数として追加されている。DecodedSkipFlagは、当該ブロックにおいてlower_coded_block_flagを符号化又は復号するかどうかを示す1ビットの内部変数である。上位CBFが存在した場合(上位ブロックのupper_coded_block_flagが1の場合)で且つ、4つの下位CBFの内の最初の3つのlower_coded_block_flagが全て0である場合、DecodedSkipFlagが1となる。そうでない場合は、DecodedSkipFlagは0に設定される。
(Reduce CBF redundancy in hierarchical blocks with a recursive structure by quadtree partitioning)
FIG. 22 shows an example of a syntax structure in which the redundancy of the lower CBF that occurs even in the case of the CBF syntax structure having the recursive structure described in FIG. 21 is reduced. In FIG. 22, “DecodedSkipFlag” is added as an argument to the transform_unit () function. “DecodedSkipFlag” is a 1-bit internal variable indicating whether or not lower_coded_block_flag is encoded or decoded in the block. If the upper CBF exists (when the upper block upper_coded_block_flag is 1) and the first three lower_coded_block_flags of the four lower CBFs are all 0, the DecodedSkipFlag is 1. Otherwise, DecodedSkipFlag is set to 0.

逆にいえば、DecodedSkipFlagが1の場合、下位ブロックの最初から3番目までのCBFが0であるため、4番目に相当する下位ブロックのCBF(lower_coded_block_flag)は自動的に1に設定される。ここでは、最初の3つのlower_coded_block_flagが全て0である場合を説明したが、符号化及び復号の際に最後に処理されるブロック以外が全て0である場合にDecodedSkipFlagが1とすることも容易に実現可能である。このようなシンタクス構造をもつことで、四分木分割されたシンタクス構造における下位CBFの冗長性を削減することが可能となる。   Conversely, when the decoded skip flag is 1, the CBFs from the first to the third of the lower blocks are 0, so the CBF (lower_coded_block_flag) of the lower block corresponding to the fourth is automatically set to 1. Here, the case where the first three lower_coded_block_flags are all 0 has been described. However, when the blocks other than the last block to be processed at the time of encoding and decoding are all 0, it is also easily realized that the Decoded Skip Flag is 1. Is possible. By having such a syntax structure, it becomes possible to reduce the redundancy of the lower CBF in the syntax structure divided by the quadtree.

(シンタクス要素の分割)
なお、本実施の形態に関わるシンタクス要素のupper_coded_block_flagとlower_coded_block_flagを別々の関数として分けることも可能である。この例が図23A及び図23Bに記述されている。
(Syntax element division)
It should be noted that the upper_coded_block_flag and lower_coded_block_flag of the syntax elements according to the present embodiment can be separated as separate functions. An example of this is described in FIGS. 23A and 23B.

図23Aでは、upper_coded_block_flagのみを再帰的に符号化するシンタクス構造である。図中に示される(・・・)は、CBF以外の様々なシンタクス要素、関数が記述されてもよいことを意味している。upper_coded_block_flagが0となる場合に、transform_unit_tree()関数が呼ばれる。一方、図23Bにtransform_unit_tree()関数が示されている。transform_unit_tree()関数は、lower_coded_block_flagのみを符号化する関数である。以上のように上位ブロックと下位ブロックを分割しても、分割しない図22と同一の機能を実現できる。   FIG. 23A shows a syntax structure that recursively encodes only the upper_coded_block_flag. (...) shown in the figure means that various syntax elements and functions other than CBF may be described. When upper_coded_block_flag becomes 0, the transform_unit_tree () function is called. On the other hand, FIG. 23B shows a transform_unit_tree () function. The transform_unit_tree () function is a function that encodes only the lower_coded_block_flag. As described above, even if the upper block and the lower block are divided, the same function as that of FIG.

(CBF符号化例1:冗長度有り)
図20Bの場合で、4つの下位ブロックと上位ブロックのCBFの符号長を図21のシンタクスに従って算出した場合の符号量は、図3で示されている。下位CBFの組み合わせ(lower_codes)が0001の場合に、符号化データは0001となり、4ビットが必要となる。これに対し、図22のシンタクスに従って算出した場合の符号量は、図2で示されている。下位CBF(lower_codes)が0001の場合には最後の1ビットを符号せず、符号化データを000とする。これにより、冗長な最後の1ビットの符号量を削減できる。
(CBF coding example 1: with redundancy)
In the case of FIG. 20B, the code amount when the code lengths of the CBFs of the four lower blocks and the upper block are calculated according to the syntax of FIG. 21 is shown in FIG. When the combination of the lower CBF (lower_codes) is 0001, the encoded data is 0001 and 4 bits are required. On the other hand, the code amount when calculated according to the syntax of FIG. 22 is shown in FIG. When the lower CBF (lower_codes) is 0001, the last 1 bit is not encoded and the encoded data is 000. As a result, the redundant last 1-bit code amount can be reduced.

次に図20Bの場合に、図21のシンタクス構造を用いてCBFを符号化・復号化した場合の、各ブロックの符号長を図24Aに示す。本図を用いて符号化・復号化の流れを説明する。ここで、図20Bでは、ブロック3のみが非0の変換係数を有し、それ以外のブロックは非0の変換係数を持たない場合を考える。   Next, in the case of FIG. 20B, FIG. 24A shows the code length of each block when the CBF is encoded / decoded using the syntax structure of FIG. The flow of encoding / decoding will be described with reference to FIG. Here, in FIG. 20B, consider a case where only block 3 has a non-zero transform coefficient, and the other blocks do not have a non-zero transform coefficient.

先ず、図20Aの2Nx2Nの上位ブロック0”に対してtransform_unit()が呼ばれる。ここで上位ブロックは4つの下位ブロックに分割されているため、upper_coded_block_flagは1として符号化される。次に図20Bのブロック0に対してtransform_unit()が呼び出される。ここでNxNのブロック0は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。更に当該ブロックは非ゼロの変換係数を持たないため、lower_coded_block_flagは0として符号化・復号化される。   First, transform_unit () is called for the 2N × 2N upper block 0 ″ of FIG. 20A. Since the upper block is divided into four lower blocks, upper_coded_block_flag is encoded as 1. Next, FIG. 20B is encoded. Transform_unit () is called for block 0. Since NxN block 0 is not divided into lower blocks, upper_coded_block_flag is encoded and decoded as 0. Further, the block has non-zero transform coefficients. Therefore, lower_coded_block_flag is encoded / decoded as 0.

次にブロック1に対してtransform_unit()が呼び出される。ここでNxNのブロック1は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。更に当該ブロックは非ゼロの変換係数を持たないため、lower_coded_block_flagは0として符号化・復号化される。ブロック2についても同様の符号化・復号化処理が施される。最後にブロック3に対してtransform_unit()が呼び出される。ここでNxNのブロック3は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。当該ブロックは非ゼロの変換係数を持つため、lower_coded_block_flagは1として符号化・復号化される。   Next, transform_unit () is called for block 1. Here, since N × N block 1 is not divided into lower blocks, upper_coded_block_flag is encoded and decoded as 0. Further, since the block does not have a non-zero transform coefficient, lower_coded_block_flag is encoded / decoded as 0. A similar encoding / decoding process is performed on the block 2 as well. Finally, transform_unit () is called for block 3. Here, since the N × N block 3 is not divided into lower blocks, the upper_coded_block_flag is encoded and decoded as 0. Since the block has a non-zero transform coefficient, lower_coded_block_flag is encoded and decoded as 1.

以上の処理を経て、符号化・復号化されたCBFの情報は5ビットのupper_coded_block_flagと4ビットのlower_coded_block_flagとなり9ビットの符号長となる。   Through the above processing, the encoded / decoded CBF information becomes a 5-bit upper_coded_block_flag and a 4-bit lower_coded_block_flag, and has a 9-bit code length.

(CBF符号化例1:冗長度削減手法)
次に図20Bの場合に、図22のシンタクス構造を用いてCBFを符号化・復号化した場合の、各ブロックの符号長を図24Bに示す。本図を用いて符号化・復号化の流れを説明する。ここでは、先ほどと同様に、ブロック3のみが非0の変換係数を有し、それ以外のブロックは非0の変換係数を持たない場合を考える。
(CBF coding example 1: redundancy reduction method)
Next, in the case of FIG. 20B, FIG. 24B shows the code length of each block when the CBF is encoded / decoded using the syntax structure of FIG. The flow of encoding / decoding will be described with reference to FIG. Here, as before, only the block 3 has a non-zero transform coefficient, and the other blocks have no non-zero transform coefficient.

ブロック0”及びブロック0からブロック2までは前述と同一の処理が施される。なお、このとき、DecodeSkipFlagは0である。最後にブロック3に対してtransform_unit()が呼び出される。ここで、ブロック0、ブロック1、ブロック2の3つの下位ブロックのCBFが全て0となるため、DecodeSkipFlagが1に設定される。ブロック3は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。DecodeSkipFlagが1であるため、lower_coded_block_flagは符号化・復号化されず、内部的に1が設定される。   The same processing as described above is performed for block 0 ″ and block 0 to block 2. Note that DecodeSkipFlag is 0. Finally, transform_unit () is called for block 3. Here, block Since the CBFs of the three lower blocks of 0, block 1 and block 2 are all 0, DecodeSkipFlag is set to 1. Since block 3 is not divided into lower blocks, upper_coded_block_flag is encoded and decoded as 0 Since DecodeSkipFlag is 1, lower_coded_block_flag is not encoded / decoded and is set to 1 internally.

以上の処理を経て、符号化・復号化されたCBFの情報は5ビットのupper_coded_block_flagと3ビットのlower_coded_block_flagとなり8ビットの符号長となる。これにより、1ビットの無駄な符号を削減できる。   Through the above processing, the encoded / decoded CBF information becomes a 5-bit upper_coded_block_flag and a 3-bit lower_coded_block_flag, and has a code length of 8 bits. Thereby, a 1-bit useless code can be reduced.

(CBF符号化例2:冗長度有り)
次に図20Cの場合に、図21のシンタクス構造を用いてCBFを符号化・復号化した場合の、各ブロックの符号長を図24Cに示す。本図を用いて符号化・復号化の流れを説明する。ここで、図20Cでは、ブロック3’のみが非0の変換係数を有し、それ以外のブロックは非0の変換係数を持たない場合を考える。
(CBF encoding example 2: with redundancy)
Next, in the case of FIG. 20C, the code length of each block when the CBF is encoded / decoded using the syntax structure of FIG. 21 is shown in FIG. 24C. The flow of encoding / decoding will be described with reference to FIG. Here, in FIG. 20C, a case is considered in which only block 3 ′ has a non-zero transform coefficient, and other blocks do not have a non-zero transform coefficient.

ブロック0”、ブロック0及びブロック1は、図24Aの説明と同一の処理が施される。続いてブロック2に対してtransform_unit()が呼び出される。ここでブロック2は4つの下位ブロックに分割されているため、upper_coded_block_flagは1として符号化・復号化される。続いてブロック2の下位ブロックであるブロック0’に対してtransform_unit()が呼び出される。ここでN/2xN/2のブロック0’は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。更に当該ブロックは非ゼロの変換係数を持たないため、lower_coded_block_flagは0として符号化・復号化される。   Block 0 ″, block 0, and block 1 are subjected to the same processing as described in FIG. 24A. Subsequently, transform_unit () is called for block 2. Here, block 2 is divided into four lower blocks. Therefore, upper_coded_block_flag is encoded and decoded as 1. Subsequently, transform_unit () is called for block 0 ′ which is a lower block of block 2. Here, N / 2 × N / 2 block 0 ′ is called. Since it is not divided into lower blocks, upper_coded_block_flag is encoded / decoded as 0. Furthermore, since the block does not have a non-zero transform coefficient, lower_coded_block_flag is encoded / decoded as 0.

次にブロック1’に対してtransform_unit()が呼び出される。ここでN/2xN/2のブロック1’は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。更に当該ブロックは非ゼロの変換係数を持たないため、lower_coded_block_flagは0として符号化・復号化される。ブロック2’についても同様の符号化・復号化処理が施される。続いてブロック3’に対してtransform_unit()が呼び出される。ここでN/2xN/2のブロック3’は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。当該ブロックは非ゼロの変換係数を持つため、lower_coded_block_flagは1として符号化・復号化される。   Next, transform_unit () is called for block 1 '. Here, since N / 2 × N / 2 block 1 ′ is not divided into lower blocks, upper_coded_block_flag is encoded / decoded as 0. Further, since the block does not have a non-zero transform coefficient, lower_coded_block_flag is encoded / decoded as 0. A similar encoding / decoding process is performed on the block 2 '. Subsequently, transform_unit () is called for the block 3 '. Here, since the N / 2 × N / 2 block 3 ′ is not divided into lower blocks, the upper_coded_block_flag is encoded and decoded as 0. Since the block has a non-zero transform coefficient, lower_coded_block_flag is encoded and decoded as 1.

引き続き、ブロック3に対してtransform_unit()が呼び出される。ここでNxNのブロック3は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。更に当該ブロックは非ゼロの変換係数を持たないため、lower_coded_block_flagは0として符号化・復号化される。   Subsequently, transform_unit () is called for block 3. Here, since the N × N block 3 is not divided into lower blocks, the upper_coded_block_flag is encoded and decoded as 0. Further, since the block does not have a non-zero transform coefficient, lower_coded_block_flag is encoded / decoded as 0.

以上の処理を経て、符号化・復号化されたCBFの情報は9ビットのupper_coded_block_flagと7ビットのlower_coded_block_flagとなり16ビットの符号長となる。   Through the above processing, the encoded / decoded CBF information is 9 bits upper_coded_block_flag and 7 bits lower_coded_block_flag, and has a 16-bit code length.

(CBF符号化例2:冗長度削減手法)
次に図20Cの場合に、図22のシンタクス構造を用いてCBFを符号化・復号化した場合の、各ブロックの符号長を図24Dに示す。本図を用いて符号化・復号化の流れを説明する。ここでは、先ほどと同様に、ブロック3’のみが非0の変換係数を有し、それ以外のブロックは非0の変換係数を持たない場合を考える。
(CBF coding example 2: redundancy reduction method)
Next, in the case of FIG. 20C, the code length of each block when CBF is encoded / decoded using the syntax structure of FIG. 22 is shown in FIG. 24D. The flow of encoding / decoding will be described with reference to FIG. Here, as before, only the block 3 ′ has a non-zero transform coefficient, and the other blocks have no non-zero transform coefficient.

ブロック0”、ブロック0からブロック1、及びブロック0’からブロック2’までは前述と同一の処理が施される。なお、このとき、DecodeSkipFlagは0である。続いてブロック3’に対してtransform_unit()が呼び出される。ここで、ブロック0’、ブロック1’、ブロック2’の3つの下位ブロックのCBFが全て0となるため、DecodeSkipFlagが1に設定される。ブロック3’は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。更にDecodeSkipFlagが1であるため、lower_coded_block_flagは符号化・復号化されず、内部的に1が設定される。   Block 0 ", block 0 to block 1, and block 0 'to block 2' are subjected to the same processing as described above. At this time, DecodeSkipFlag is 0. Subsequently, transform_unit is applied to block 3 '. Here, since the CBFs of the three lower blocks of block 0 ′, block 1 ′, and block 2 ′ are all 0, DecodeSkipFlag is set to 1. Block 3 ′ is divided into lower blocks. Therefore, upper_coded_block_flag is encoded / decoded as 0. Furthermore, since DecodeSkipFlag is 1, lower_coded_block_flag is not encoded / decoded and is set to 1 internally.

引き続き、ブロック3に対してtransform_unit()が呼び出される。ここでNxNのブロック3は下位ブロックに分割されていないため、upper_coded_block_flagは0として符号化・復号化される。更に当該ブロックは非ゼロの変換係数を持たないため、lower_coded_block_flagは0として符号化・復号化される。   Subsequently, transform_unit () is called for block 3. Here, since the N × N block 3 is not divided into lower blocks, the upper_coded_block_flag is encoded and decoded as 0. Further, since the block does not have a non-zero transform coefficient, lower_coded_block_flag is encoded / decoded as 0.

以上の処理を経て、符号化・復号化されたCBFの情報は9ビットのupper_coded_block_flagと6ビットのlower_coded_block_flagとなり15ビットの符号長となる。これにより、1ビットの無駄な符号を削減できる。   Through the above processing, the encoded / decoded CBF information is 9 bits of upper_coded_block_flag and 6 bits of lower_coded_block_flag, and has a code length of 15 bits. Thereby, a 1-bit useless code can be reduced.

(図22に準じた符号化フローチャート)
図22のシンタクス構造に基づいて、本実施の形態を図5のフローチャート及び図6の符号化装置に沿って説明する。コーデットパターンデータの符号化は、例えば、次の方法により行える。なお、以下の説明では、コーデットパターンデータ以外の部分の符号化であるステップ3、ステップ11も含めて説明する。
(Encoding flowchart according to FIG. 22)
Based on the syntax structure of FIG. 22, the present embodiment will be described along the flowchart of FIG. 5 and the encoding device of FIG. The coding pattern data can be encoded by the following method, for example. In the following description, step 3 and step 11 which are encoding of portions other than the codet pattern data will be described.

ステップ1.(S501)画像入力部601が画像ブロックを読み込む。ここで読み込むブロックは、典型的には、ステップ5における上位コーデットパターンデータに対応したブロックと同じか、それより大きなサイズ(例えば、64x64画素)を持つものとする。   Step 1. (S501) The image input unit 601 reads an image block. The block read here is typically assumed to have the same size or larger size (for example, 64 × 64 pixels) than the block corresponding to the higher-order code pattern data in step 5.

ステップ2.(S502)演算ユニット602がS501で読みこんだブロックに対して符号化すべき予測モードをプログラム用メモリ605から読み込む。なお、この予測モードは予め決めておく場合もあるし、複数の予測モードのそれぞれでステップS503以降を行い最も良いモードを選択する場合もある。他にも予測モードを設定する変形例はたくさんある。   Step 2. (S502) The calculation unit 602 reads from the program memory 605 the prediction mode to be encoded for the block read in S501. The prediction mode may be determined in advance, or the best mode may be selected by performing step S503 and subsequent steps in each of a plurality of prediction modes. There are many other variations for setting the prediction mode.

ステップ3.演算ユニット602は予測モードを符号化して、符号化データ出力部604はビットストリームに出力する。   Step 3. The arithmetic unit 602 encodes the prediction mode, and the encoded data output unit 604 outputs it to the bit stream.

ステップ4.(S503)演算ユニット602は予測モードとすでに復号可能となったデータを利用してブロック予測を行い、入力画像ブロックと予測画像ブロックの差である予測残差を求める。   Step 4. (S503) The arithmetic unit 602 performs block prediction using the prediction mode and data that has already been decoded, and obtains a prediction residual that is the difference between the input image block and the predicted image block.

ステップ5.(S504)演算ユニット602は、予測残差にブロック変換(例えば、あらかじめトレーニングデータにより生成したKLTの基底や、DCTの基底を利用した直交変換)および量子化を施す。ここで変換を行うブロックは、ステップ1のブロックよりも小さなサイズ(例えば、4x4画素)を持つものとする。次に、演算ユニット602は量子化された変換係数の中に非0の係数が存在するか否かをあらわす情報をブロック単位で算出する。典型的には、この情報は、ブロック内に非0の係数が存在する場合には1、ブロック内の係数がすべて0の場合には0という、ブロックごとに1ビットのフラグ情報になる。この情報を下位のコーデットパターンデータ(下位CBPやCBF)と呼ぶ。次に、下位のコーデットパターンデータの集合(例えば、4つの下位のコーデットパターンデータ)がすべて0か否かという情報を表す、より大きなブロックに対するコーデットパターンデータである上位のコーデットパターンデータ(上位CBP)を求める。典型的には、上位のコーデットパターンデータは、下位のコーデットパターンデータがすべて0であれば0、下位のコーデットパターンデータに1つでも非0の情報があれば1という、ブロックごとに1ビットのフラグ情報になる。ここで、上位コーデットパターンデータに対応するブロックのサイズは、下位コーデットパターンデータよりも大きなサイズ(例えば8x8画素)を持つものとする。この処理を階層的に行って最下位のCBPから最上位のCBPまでを設定する。例えば最下位のブロックを4x4画素、最上位のブロックを64x64画素とした場合、階層の深さが0(64x64画素ブロック)から5(4x4画素ブロック)までで表現される。   Step 5. (S504) The arithmetic unit 602 performs block transform (for example, KLT base generated by training data in advance or orthogonal transform using DCT base) and quantization on the prediction residual. Here, it is assumed that the block to be converted has a smaller size (for example, 4 × 4 pixels) than the block in Step 1. Next, the arithmetic unit 602 calculates information representing whether or not non-zero coefficients exist in the quantized transform coefficients in units of blocks. Typically, this information is 1-bit flag information for each block, which is 1 when a non-zero coefficient exists in the block and 0 when all the coefficients in the block are 0. This information is referred to as lower-order code pattern data (lower-order CBP or CBF). Next, higher-order code pattern data (upper CBP), which is code pattern data for a larger block, represents information indicating whether or not a set of lower-order code pattern data (for example, four lower-order code pattern data) is all zero. Ask for. Typically, the high-order code pattern data is 1 bit for each block, 0 if the low-order code pattern data is all 0, and 1 if there is any non-zero information in the low-order code pattern data. It becomes flag information. Here, it is assumed that the size of the block corresponding to the high-order code pattern data is larger than the low-order code pattern data (for example, 8 × 8 pixels). This process is performed hierarchically to set from the lowest CBP to the highest CBP. For example, when the lowest block is 4 × 4 pixels and the highest block is 64 × 64 pixels, the hierarchical depth is expressed from 0 (64 × 64 pixel block) to 5 (4 × 4 pixel block).

ステップ6.(S505)演算ユニット602が上位のコーデットパターンデータを符号化して、符号化データ出力部604がビットストリームに出力する。   Step 6. (S505) The arithmetic unit 602 encodes the high-order code pattern data, and the encoded data output unit 604 outputs it to the bit stream.

ステップ7.(S506)演算ユニット602は、上位のコーデットパターンデータが0である場合にはステップ8〜10を飛ばし、そうでないのならステップ8を実行する。   Step 7. (S506) The arithmetic unit 602 skips Steps 8 to 10 when the higher-order code pattern data is 0, and executes Step 8 otherwise.

ステップ8.(S507)ステップ8〜10は下位のコーデットパターンデータを1ビットずつ符号化していく過程である。このステップでは次の条件分岐を実行する。演算ユニット602は、すでに符号化された下位のコーデットパターンデータが特定のパターンデータである場合(典型的には、最後の1ビットの下位のコーデットパターンデータを符号化する場合であって、かつ、符号化済みの下位のコーデットパターンデータがすべて0である場合)には、次のビットストリームに出力するステップ9を飛ばし、そうでなければステップ9を実行する。   Step 8. (S507) Steps 8 to 10 are processes in which the low-order code pattern data is encoded bit by bit. In this step, the next conditional branch is executed. The arithmetic unit 602 is a case where the already encoded lower-order code pattern data is specific pattern data (typically, the last one-bit lower-order code pattern data is encoded, and If all the encoded lower-order code pattern data is 0), step 9 for outputting to the next bit stream is skipped; otherwise, step 9 is executed.

ステップ9.(S508)次に、演算ユニット602は符号化すべき下位のコーデットパターンデータを符号化して、符号化データ出力部604はビットストリームに出力する。   Step 9. (S508) Next, the arithmetic unit 602 encodes lower-order code pattern data to be encoded, and the encoded data output unit 604 outputs it to the bit stream.

ステップ10.(S509)演算ユニット602は、下位のコーデットパターンデータをすべて符号化していればステップ11に進め、そうでなければステップ8に戻る。S507からS509のループはビット数に応じて回る回数が決まり、例えば4ビットであれば4回だけ回すことになる。また、このステップ7〜10は、上位ブロックが分割されなくなるまで(ステップ10の判定がYesになるまで)、階層に応じて再帰的に繰り返される。   Step 10. (S509) The arithmetic unit 602 proceeds to step 11 if all the lower-order code pattern data have been encoded, and returns to step 8 if not. In the loop from S507 to S509, the number of times of rotation is determined according to the number of bits. In addition, steps 7 to 10 are recursively repeated according to the hierarchy until the upper block is not divided (until the determination in step 10 is Yes).

ステップ11.符号化データ出力部604は、コーデットパターンデータが非0のブロックについて、量子化された変換係数を符号化してビットストリームに出力する。   Step 11. The encoded data output unit 604 encodes the quantized transform coefficient for a block having non-zero coded pattern data, and outputs the result to a bit stream.

なお、ステップ3はS501やS502より前にあってもよい。エンコーダは、例えば、符号化すべき予測モードを切り替えながらステップ2〜11を繰り返し試したうえで、符号化効率が良い予測モードを選択することで、圧縮率を向上させることができる。ただし、デコード可能なビットストリームを出力するために、このような繰り返しは必須ではなく、別の基準で予測モードを決めてもよい。   Step 3 may be before S501 or S502. The encoder can improve the compression rate by, for example, repeatedly trying steps 2 to 11 while switching the prediction mode to be encoded and then selecting a prediction mode with good encoding efficiency. However, in order to output a decodable bitstream, such repetition is not essential, and the prediction mode may be determined based on another criterion.

(図22に準じた復号フローチャート)
次に本実施の形態で説明した図22のシンタクス構造を図7のフローチャート及び図8の復号装置に沿って説明する。
(Decoding flowchart according to FIG. 22)
Next, the syntax structure of FIG. 22 described in the present embodiment will be described along the flowchart of FIG. 7 and the decoding device of FIG.

以上の方法で生成されたビットストリームを復号化(ブロック単位のCBPの復号化)する方法のフローチャートの一例を図7に、復号化を実行するための装置の一例を図8に示す。コーデットパターンデータの復号化は、例えば、次のステップ1〜10の方法により行える。   FIG. 7 shows an example of a flowchart of a method for decoding the bit stream generated by the above method (decoding of CBP in units of blocks), and FIG. 8 shows an example of an apparatus for executing the decoding. The decoding of the coded pattern data can be performed by the following methods 1 to 10, for example.

ステップ1.(S701)符号化データ入力部801が入力データとしてビットストリームを入力する。ビットストリームは、ブロック単位での予測情報、ブロック単位での予測残差信号の有無を表すコーデットパターンデータ、およびブロック単位での予測残差信号をエントロピー符号化した画像データを含む。   Step 1. (S701) The encoded data input unit 801 inputs a bit stream as input data. The bit stream includes prediction information in units of blocks, coded pattern data indicating the presence / absence of a prediction residual signal in units of blocks, and image data obtained by entropy encoding the prediction residual signal in units of blocks.

ステップ2.(S702)次に演算ユニット802が、取得すべきデータが上位のコーデットパターンデータ(例えば、上位のCBP)であるかどうかを判定し、上位のコーデットパターンデータであると判定された場合にはステップ3へ、そうでなければステップ4へ飛ぶ。   Step 2. (S702) Next, the arithmetic unit 802 determines whether the data to be acquired is higher-order code pattern data (for example, higher-order CBP), and if it is determined that the data is higher-order code pattern data, step S702 If not, jump to step 4.

ステップ3.(S703)演算ユニット802が上位のコーデットパターンデータをエントロピー復号により取得する。ステップ9へ飛ぶ。   Step 3. (S703) The arithmetic unit 802 obtains higher-order code pattern data by entropy decoding. Jump to step 9.

ステップ4.(S704)次に演算ユニット802が、取得すべきデータが上位コーデットパターンデータに属するコーデットパターンデータである下位のコーデットパターンデータ(例えば、下位のCBPあるいは下位のCBF)であるかどうかを判定し、下位のコーデットパターンデータであると判定された場合にはステップ6へ、そうでなければステップ5へ飛ぶ。   Step 4. (S704) Next, the arithmetic unit 802 determines whether the data to be acquired is low-order code pattern data (for example, low-order CBP or low-order CBF) that is code pattern data belonging to the high-order code pattern data. If it is determined that the code pattern data is lower order, the process jumps to step 6; otherwise, the process jumps to step 5.

ステップ5.(S705)次に演算ユニット802が取得すべき(コーデットパターンデータ以外の)データを取得しステップ9へ飛ぶ。   Step 5. (S705) Next, the data to be acquired by the arithmetic unit 802 (other than the coded pattern data) is acquired and the process jumps to Step 9.

ステップ6.(S706)演算ユニット802が、すでに取得された下位のコーデットパターンデータが予め定められたパターンであるかどうかを判定し、予め定められたパターンである場合にはステップ7へ飛び、そうでなければステップ8へ飛ぶ。例えば、図2の例においては、予め定められたパターンとは、下位のコーデットパターンデータが4ビットであり、かつ、すでに下位のコーデットパターンデータが3ビット取得されていて次に取得すべきデータが4ビット目のコーデットパターンデータであり、かつ、すでに取得された3ビットが000であるパターンを指す。   Step 6. (S706) The arithmetic unit 802 determines whether the already acquired lower-order code pattern data is a predetermined pattern. If it is a predetermined pattern, the operation unit 802 jumps to step 7, otherwise. Jump to step 8. For example, in the example of FIG. 2, the predetermined pattern is that the lower-order code pattern data is 4 bits, and the lower-order code pattern data has already been acquired in 3 bits, and the next data to be acquired is It is the 4th bit code pattern data, and indicates the pattern in which 3 bits already acquired is 000.

ステップ7.(S707)次に演算ユニット802が、取得すべき下位のコーデットパターンデータとして、予め定められた固定値を設定し、設定後ステップ9へ飛ぶ。例えば、図2の例では、次に取得すべき4ビット目のコーデットパターンデータとして1を設定する。   Step 7. (S707) Next, the arithmetic unit 802 sets a predetermined fixed value as lower-order code pattern data to be acquired, and jumps to step 9 after the setting. For example, in the example of FIG. 2, 1 is set as the fourth bit code pattern data to be acquired next.

ステップ8.(S708)次に演算ユニット802が、取得すべき下位のコーデットパターンデータをエントロピー復号により取得する。   Step 8. (S708) Next, the arithmetic unit 802 acquires lower-order codet pattern data to be acquired by entropy decoding.

ステップ9.(S709)演算ユニット802がブロック情報の取得が完了しているかどうかを判定し、取得が完了していればステップ10へ飛び、そうでなければステップ2へ飛ぶ。ブロック情報は、復号された、ブロック単位での予測情報およびブロック単位での予測残差信号を示す。すなわち、このフローでは明示されていないが、ビットストリームに含まれる情報がブロック単位での予測情報である場合にはビットストリームを復号化しブロック単位での予測情報を得るステップがあり、ビットストリームに含まれる情報がブロック単位での予測残差信号である場合にはビットストリームを復号化しブロック単位での予測残差信号を得るステップがある。   Step 9. (S709) The arithmetic unit 802 determines whether or not the acquisition of the block information has been completed. If the acquisition has been completed, the process jumps to Step 10, and if not, the process jumps to Step 2. Block information indicates decoded prediction information in units of blocks and prediction residual signals in units of blocks. That is, although not explicitly shown in this flow, when the information included in the bitstream is prediction information in units of blocks, there is a step of decoding the bitstream to obtain prediction information in units of blocks, which is included in the bitstream. If the information to be received is a prediction residual signal in units of blocks, there is a step of obtaining a prediction residual signal in units of blocks by decoding the bit stream.

ステップ10.(S710)演算ユニット802が取得されたブロック情報に基づきブロック画像信号を復元し、画像出力部804が復元された画像を出力する。   Step 10. (S710) The arithmetic unit 802 restores the block image signal based on the acquired block information, and the image output unit 804 outputs the restored image.

このステップ2〜9は、上位ブロックが分割されなくなるまで(ステップ9の判定がYesになるまで)、階層に応じて再帰的に繰り返される。   Steps 2 to 9 are recursively repeated depending on the hierarchy until the upper block is not divided (until the determination in step 9 is Yes).

本実施の形態に関わる復号化装置については図8と同一の構成であるため、説明を省略する。   The decoding apparatus according to this embodiment has the same configuration as that in FIG.

(ダイレクトモード)
H.264の多くのフレーム間符号化モードでは、すでに復号化した情報から求められる動き予測に対する動きの予測誤差、および予測で得られたブロックと画像ブロックとの予測残差の2つの情報を符号化および復号化する。しかし、動きの予測誤差を符号化および復号化せず予測残差のみを符号化および復号化するダイレクトモード、すでに復号化した情報から求められる動き予測のみを利用したスキップモードという2つの特殊なモードが用意されている。なお、H.264ではBスライスと呼ばれるデータに対してのみダイレクトモードが用意されているが、Pスライスと呼ばれるデータについても同じ定義でのダイレクトモードが実現できるため、本実施の形態ではスライスの種類については特に限定しない。
(Direct mode)
H. In many inter-frame coding modes of H.264, two pieces of information such as a motion prediction error for motion prediction obtained from already decoded information and a prediction residual between a block and an image block obtained by the prediction are encoded and Decrypt. However, there are two special modes: a direct mode that encodes and decodes only a prediction residual without encoding and decoding motion prediction errors, and a skip mode that uses only motion prediction obtained from already decoded information Is prepared. H. In H.264, a direct mode is prepared only for data called a B slice, but since a direct mode with the same definition can be realized for data called a P slice, the type of slice is particularly limited in this embodiment. do not do.

スキップモードとダイレクトモードという2つのモードを比較すると、スキップモードはダイレクトモードの予測残差が存在しないモードであると考えられる。H.264では予測残差が存在しないダイレクトモードを符号化することも可能であるが、そのような場合にはスキップモードで符号化し、復号化時にダイレクトモードでは常に予測残差が存在すると解釈してもよく、予測残差が存在しないダイレクトモードは冗長なモードであることがわかる。したがって、拡張マクロブロックにおける階層的なコーデットブロックデータをデコードする際には、ダイレクトモードとして符号化されたブロックと同一サイズのコーデットブロックデータに限り、コーデットブロックデータをエントロピー復号化により取得せずに、予測残差の存在を表す固定値(1)を設定できる。換言すれば、ブロック単位での予測情報がダイレクトモードである場合に、上位コーデットパターンデータを前記ビットストリームから復号化せずに予め定めた値を設定する。なお、ダイレクトモードにおける下位のブロック(例えば、64x64画素のレベル2拡張マクロブロックでダイレクトモードと記録されている場合にそのブロックを構成する4つの32x32画素の拡張マクロブロック)については、予測残差の存在の有無は不明であって、コーデットブロックデータを符号化および復号化する必要がある。   Comparing two modes, the skip mode and the direct mode, the skip mode is considered to be a mode in which no prediction residual exists in the direct mode. H. In H.264, it is possible to encode a direct mode in which no prediction residual exists, but in such a case, it is encoded in the skip mode, and it is interpreted that there is always a prediction residual in the direct mode at the time of decoding. It can be seen that the direct mode without the prediction residual is a redundant mode. Therefore, when decoding the hierarchical coded block data in the extended macroblock, only the coded block data having the same size as the block coded as the direct mode is acquired without entropy decoding. A fixed value (1) representing the presence of the prediction residual can be set. In other words, when the prediction information in units of blocks is in the direct mode, a predetermined value is set without decoding higher-order code pattern data from the bitstream. For the lower-level blocks in the direct mode (for example, four 32 × 32 pixel extended macroblocks constituting the block when the level 2 extended macroblock of 64 × 64 pixels is recorded as the direct mode), the prediction residual Presence / absence of existence is unknown, and it is necessary to encode and decode the coded block data.

(スキップフラグ)
今までの説明ではコーデットブロックデータの無駄を減らす手段について述べてきた。同じ手段で、スキップモードをあらわすスキップフラグについても冗長な情報を減らすことができる。スキップモードは、ブロックがスキップである場合に1、そうでない場合に0となるフラグである。スキップ予測が可能なブロックのサイズとして2種以上のサイズが用意されている場合には、スキップフラグを階層的に符号化する必要がある。この場合、図16(単純な階層的スキップフラグの一例)のように実装することになるが、これは今まで述べてきたCBPとCBFの例を論理反転させた表になっており、従来のコーデットブロックデータが冗長であった理由と同じ理由で冗長である。したがって、図17(本実施の形態の階層的スキップフラグの一例)に示すように、下位のスキップフラグとして4つのフラグが符号化および復号化される場合、上位のスキップフラグが0、下位のスキップフラグのうち第1、第2、第3のスキップフラグが1であるなら、第4の下位のスキップフラグを符号化および復号化せずに、0という固定値を利用できる。
(Skip flag)
The explanation so far has described means for reducing the waste of code block data. With the same means, redundant information can be reduced for the skip flag indicating the skip mode. The skip mode is a flag that becomes 1 when the block is skipped and 0 when it is not. When two or more sizes are prepared as the sizes of blocks that can be skip-predicted, it is necessary to encode the skip flag hierarchically. In this case, it is implemented as shown in FIG. 16 (an example of a simple hierarchical skip flag). This is a table obtained by logically inverting the examples of CBP and CBF described so far. It is redundant for the same reason that the coded block data is redundant. Therefore, as shown in FIG. 17 (an example of a hierarchical skip flag according to the present embodiment), when four flags are encoded and decoded as the lower skip flags, the upper skip flag is 0 and the lower skip is performed. If the first, second, and third skip flags among the flags are 1, a fixed value of 0 can be used without encoding and decoding the fourth lower skip flag.

階層的なスキップフラグを符号化する方法の流れを表す図を図28に示す。符号化は、次の流れで行われる。   FIG. 28 illustrates a flow of a method for encoding a hierarchical skip flag. Encoding is performed in the following flow.

ステップ1.(S2801)画像入力部601が画像ブロックを読み込む。   Step 1. (S2801) The image input unit 601 reads an image block.

ステップ2.(S2802)演算ユニット602がS501で読みこんだブロックに対して符号化すべき予測モードをプログラム用メモリ605から読み込む。予測モードは、スキップフラグ(Skip)の情報を含む。なお、この予測モードは予め決めておく場合もあるし、複数の予測モードのそれぞれでステップS503以降を行い最も良いモードを選択する場合もある。他にも予測モードを設定する変形例はたくさんある。   Step 2. (S2802) The calculation unit 602 reads from the program memory 605 the prediction mode to be encoded for the block read in S501. The prediction mode includes information on a skip flag (Skip). The prediction mode may be determined in advance, or the best mode may be selected by performing step S503 and subsequent steps in each of a plurality of prediction modes. There are many other variations for setting the prediction mode.

ステップ3.(S2803)演算ユニット602は上位のスキップフラグを符号化して、符号化データ出力部604はビットストリームに出力する。   Step 3. (S2803) The arithmetic unit 602 encodes the upper skip flag, and the encoded data output unit 604 outputs it to the bit stream.

ステップ4.(S2804)このステップは次の条件分岐を実行する。演算ユニット602は、上位のスキップフラグが1であれば、ステップ5〜9を飛ばす。そうでなければステップ5を実行する。   Step 4. (S2804) This step executes the next conditional branch. If the upper skip flag is 1, the arithmetic unit 602 skips steps 5 to 9. Otherwise, step 5 is executed.

ステップ5.(S2805)演算ユニット602は、スキップフラグ以外の、上位の予測モードを符号化して、符号化データ出力部604からビットストリームに出力する。   Step 5. (S2805) The arithmetic unit 602 encodes a higher-order prediction mode other than the skip flag, and outputs it from the encoded data output unit 604 to a bit stream.

ステップ6.(S2806)ステップ6〜8は下位のスキップフラグのうち1ビットを符号化する過程である。このステップでは次の条件分岐を実行する。演算ユニット602は、すでに符号化された下位のスキップフラグが特定のパターンデータである場合(典型的には、最後の1ビットの下位のスキップフラグを符号化する場合であって、かつ、符号化済みの下位のスキップフラグがすべて1である場合)には、次のビットストリームに出力するステップ7を飛ばし、そうでなければステップ7を実行する。   Step 6. (S2806) Steps 6 to 8 are processes for encoding one bit of the lower skip flags. In this step, the next conditional branch is executed. The arithmetic unit 602 uses the encoding of the low-order skip flag that has already been encoded as the specific pattern data (typically, the encoding of the low-order skip flag of the last 1 bit and the encoding If all the skipped lower flags are 1), step 7 to be output to the next bit stream is skipped; otherwise, step 7 is executed.

ステップ7.(S2807)演算ユニット602は符号化すべき下位のスキップフラグを符号化して、符号化データ出力部604からビットストリームに出力する。   Step 7. (S2807) The arithmetic unit 602 encodes the low-order skip flag to be encoded, and outputs it from the encoded data output unit 604 to the bit stream.

ステップ8.(S2808)演算ユニット602は、スキップフラグ以外の、下位の予測モードを符号化して、符号化データ出力部604からビットストリームに出力する。また、演算ユニット602は、残差情報があるなら、残差情報を符号化して、符号化データ出力部604からビットストリームに出力する。   Step 8. (S2808) The arithmetic unit 602 encodes a lower prediction mode other than the skip flag, and outputs it from the encoded data output unit 604 to a bit stream. Also, if there is residual information, the arithmetic unit 602 encodes the residual information and outputs it from the encoded data output unit 604 to a bit stream.

ステップ9.(S2809)演算ユニット602は、(下位のスキップフラグを含めた)下位のブロックをすべて符号化していればブロックの符号化を終了する。そうでなければ、次の下位のブロックを符号化するために、ステップ6に戻る。S2806からS2809のループは上位のブロックに属する下位のブロックの数に応じて回る回数が決まり、例えば下位のブロックが4つに分割されているなら4回だけ回すことになる。   Step 9. (S2809) The arithmetic unit 602 ends the encoding of the block if all the lower blocks (including the lower skip flag) have been encoded. Otherwise, go back to step 6 to encode the next lower block. In the loop from S2806 to S2809, the number of rotations is determined according to the number of lower blocks belonging to the upper block. For example, if the lower block is divided into four blocks, the loop is performed only four times.

エンコーダは、例えば、符号化すべき予測モードを切り替えながらステップ2〜9を繰り返し試したうえで、符号化効率が良い予測モードを選択することで、圧縮率を向上させることができる。ただし、デコード可能なビットストリームを出力するために、このような繰り返しは必須ではなく、別の基準で予測モードを決めてもよい。   The encoder can improve the compression rate by, for example, repeatedly trying steps 2 to 9 while switching the prediction mode to be encoded and then selecting a prediction mode with good encoding efficiency. However, in order to output a decodable bitstream, such repetition is not essential, and the prediction mode may be determined based on another criterion.

階層的なスキップフラグの復号化の流れは図7とほとんど同じである。図7に対応する、ブロック単位のスキップフラグの復号化の流れの一例を図18に示す。図18の流れは、S702〜S708におけるCBPが、S1802〜S1808におけるスキップフラグ(図18ではskipと表記)に置き換わる点が図7と異なる。対応するシンタックスは、例えば、図19のようになる。図19は、階層的なスキップフラグに対する本実施の形態を利用したフラグ削減の一例である。   The flow of decoding the hierarchical skip flag is almost the same as in FIG. FIG. 18 shows an example of the decoding flow of the block-by-block skip flag corresponding to FIG. The flow in FIG. 18 is different from FIG. 7 in that the CBP in S702 to S708 is replaced with a skip flag in S1802 to S1808 (indicated as “skip” in FIG. 18). The corresponding syntax is, for example, as shown in FIG. FIG. 19 is an example of flag reduction using this embodiment for hierarchical skip flags.

(四分木分割による再帰構造をもった階層ブロックにおけるスキップフラグ符号化)
図20Aから図20Cまでで説明したような四分木分割による再帰構造においても、前述の通り、スキップフラグ或いはダイレクトモードの冗長度を削減可能である。図25にこの場合のシンタクス構造の一例を示す。図25に示されるcoding_unit()は、予測モードなどに関連する情報を符号化する関数である。本関数の基本構造は、図22とほぼ同じである。上位ブロックのスキップフラグをupper_skip_flag、4つの下位ブロックのスキップフラグをlower_skip_flagと表現している。ここで、図22の説明時と同様、上位スキップフラグは、当該ブロックを分割するかどうかを示す情報と等価である。currLowerAvailableは、当該ブロックを分割することが可能かどうかを示す内部変数である。例えば、予め定めた最小分割ブロックサイズよりも当該ブロックを分割したときのブロックサイズが小さくなる場合、下位ブロックがスキップモードを取ることができないためcurrLowerAvailableは0となる。一方、当該ブロックを更に分割することが可能である場合currLowerAvailableは1となる。
(Skip flag coding in hierarchical blocks with recursive structure by quadtree partitioning)
Also in the recursive structure by quadtree partitioning as described in FIGS. 20A to 20C, the redundancy of the skip flag or the direct mode can be reduced as described above. FIG. 25 shows an example of the syntax structure in this case. Coding_unit () shown in FIG. 25 is a function that encodes information related to the prediction mode and the like. The basic structure of this function is almost the same as in FIG. The skip flag of the upper block is expressed as upper_skip_flag, and the skip flag of the four lower blocks is expressed as lower_skip_flag. Here, as in the description of FIG. 22, the upper skip flag is equivalent to information indicating whether or not to divide the block. currLowerAvailable is an internal variable indicating whether or not the block can be divided. For example, when the block size when the block is divided is smaller than a predetermined minimum divided block size, currLowerAvailable is 0 because the lower block cannot take the skip mode. On the other hand, currLowerAvailable is 1 when the block can be further divided.

upper_skip_flagは、上位ブロックがスキップモードかどうかを示すフラグであり、言い換えれば上位ブロックを分割するかどうかを表している。分割する場合は1、分割しない場合は0となる。   upper_skip_flag is a flag indicating whether the upper block is in the skip mode, in other words, whether the upper block is divided. It is 1 when dividing, and 0 when not dividing.

AvailableSkipは、当該ブロックがスキップモードを選択できるかどうかを示す1ビットの内部変数である。当該スライスがイントラ予測のみで構成されるI−sliceである場合に、スキップモードのフラグを符号化することは無駄であり、符号量増に繋がるため、上記場合AvailableSkipは0に設定される。それ以外の場合には1に設定される。つまり、DecodedSkipFlagが0且つAvailableSkipが1の場合のみlower_skip_flagが符号化される。   “AvailableSkip” is a 1-bit internal variable indicating whether or not the block can select the skip mode. When the slice is an I-slice configured only by intra prediction, encoding the skip mode flag is useless and leads to an increase in the amount of codes. In this case, AvailableSkip is set to 0. Otherwise, it is set to 1. That is, lower_skip_flag is encoded only when DecodedSkipFlag is 0 and AvailableSkip is 1.

DecodedSkipFlagは、当該ブロックにおいてlower_skip_flagを符号化又は復号するかどうかを示す1ビットの内部変数である。上位スキップフラグが存在した場合(上位ブロックのupper_skip_flagが1の場合)で且つ、4つの下位スキップフラグの内の最初の3つのlower_skip_flagが全て0である場合、DecodedSkipFlagが1となる。そうでない場合は、DecodedSkipFlagは0に設定される。逆にいえば、DecodedSkipFlagが1の場合、下位ブロックの最初から3番目までのスキップフラグが0であるため、4番目に相当する下位ブロックのスキップフラグ(lower_skip_flag)は自動的に1に設定される。   “DecodedSkipFlag” is a 1-bit internal variable indicating whether lower_skip_flag is encoded or decoded in the block. When the upper skip flag exists (when upper_skip_flag of the upper block is 1), and when the first three lower_skip_flags of the four lower skip flags are all 0, DecodedSkipFlag is 1. Otherwise, DecodedSkipFlag is set to 0. Conversely, when the Skipped Skip Flag is 1, the skip flag from the first to the third of the lower block is 0, so the skip flag (lower_skip_flag) of the lower block corresponding to the fourth is automatically set to 1. .

(シンタクス分割例)
このようなシンタクス構造をもつことで、四分木分割されたシンタクス構造における下位スキップフラグの冗長性を削減することが可能となる。なお、本実施の形態に関わるシンタクス要素のupper_skip_flagとlower_skip_flagを別々の関数として分けることも可能である。この例が図26A及び図26Bに記述されている。
(Example of syntax division)
By having such a syntax structure, it becomes possible to reduce the redundancy of the low-order skip flag in the syntax structure divided by the quadtree. Note that the syntax elements upper_skip_flag and lower_skip_flag according to the present embodiment can be separated as separate functions. An example of this is described in FIGS. 26A and 26B.

図26Aでは、upper_skip_flagのみを再帰的に符号化するシンタクス構造である。upper_skip_flagが0となる場合に、prediction_unit()関数が呼ばれる。一方、図26Bにprediction_unit()関数が示されている。prediction_unit()関数は、lower_skip_flagのみを符号化する関数である。以上のように上位ブロックと下位ブロックを分割しても、分割しない図25と同一の機能を実現できる。   FIG. 26A shows a syntax structure that recursively encodes only the upper_skip_flag. When upper_skip_flag becomes 0, the prediction_unit () function is called. On the other hand, the prediction_unit () function is shown in FIG. 26B. The prediction_unit () function is a function that encodes only the lower_skip_flag. As described above, even when the upper block and the lower block are divided, the same function as that of FIG. 25 can be realized.

(コーデットブロックフラグとスキップフラグの組み合わせ例)
実施の形態で説明した、図22に示されるコーデットブロックフラグのシンタクス構造と図26に示されるスキップフラグのシンタクス構造を組み合わせることも可能である。図27にこれら2つを組み合わせた場合のシンタクス構造を示す。coding_unit()関数内部で、prediction_unit()関数とtransform_unit()関数が呼ばれる構成とすることで、コーデットブロックフラグとスキップフラグの冗長性をそれぞれ削減できる。尚、図中に示されるDecodeSkipTransFlagは、図22で説明したDecodeSkipFlagと同じ機能を有するが、スキップフラグの冗長度削減時のフラグの名称が被るため、異なるインデックスを与えている。
(Combination example of coded block flag and skip flag)
It is also possible to combine the syntax structure of the code block flag shown in FIG. 22 and the syntax structure of the skip flag shown in FIG. 26 described in the embodiment. FIG. 27 shows a syntax structure when these two are combined. With the configuration in which the prediction_unit () function and the transform_unit () function are called inside the coding_unit () function, the redundancy of the coded block flag and the skip flag can be reduced. Note that DecodeSkipTransFlag shown in the figure has the same function as DecodeSkipFlag described in FIG. 22, but is given a different index because it has the same name as the flag when the redundancy of the skip flag is reduced.

(発明の効果)
以上に述べたように、本実施の形態を用いると、階層的なCBPやCBF、およびスキップフラグについて、その冗長性の排除により、圧縮率の高い符号化手段、およびその符号化手段により圧縮されたデータの復号化手段を提供できる。なお、本実施の形態での手段および方法は従来の冗長性を排除するものであって、新しい符号化モードやフラグの追加は行っていない。したがって、従来の符号化方法に対して本実施の形態に記載の方法でフラグの符号化を行うという変更のみを加えた符号化手段を用いるなら、符号量が減ることはあっても増えることはないと期待できる。
(Effect of the invention)
As described above, when this embodiment is used, hierarchical CBP, CBF, and skip flag are compressed by encoding means having a high compression ratio and the encoding means by eliminating redundancy. Data decoding means can be provided. Note that the means and method in the present embodiment eliminate conventional redundancy and do not add new encoding modes or flags. Therefore, if an encoding unit is used in which only a change of performing flag encoding by the method described in this embodiment is used with respect to the conventional encoding method, the amount of code may be reduced, but increased. I can expect that.

上述の実施形態の中で示した処理手順に示された指示は、ソフトウェアであるプログラムに基づいて実行されることが可能である。汎用の計算機システムが、このプログラムを予め記憶しておき、このプログラムを読み込むことにより、上述した実施形態の画像復号化方法および画像符号化方法による効果と同様な効果を得ることも可能である。上述の実施形態で記述された指示は、コンピュータに実行させることのできるプログラムとして、磁気ディスク(フレキシブルディスク、ハードディスクなど)、光ディスク(CD−ROM、CD−R、CD−RW、DVD−ROM、DVD±R、DVD±RWなど)、半導体メモリ、又はこれに類する記録媒体に記録される。コンピュータまたは組み込みシステムが読み取り可能な記憶媒体であれば、その記憶形式は何れの形態であってもよい。コンピュータは、この記録媒体からプログラムを読み込み、このプログラムに基づいてプログラムに記述されている指示をCPUで実行させれば、上述した実施形態の画像復号化方法および画像符号化方法と同様な動作を実現することができる。もちろん、コンピュータがプログラムを取得する場合又は読み込む場合はネットワークを通じて取得又は読み込んでもよい。
また、記憶媒体からコンピュータや組み込みシステムにインストールされたプログラムの指示に基づきコンピュータ上で稼働しているOS(オペレーティングシステム)や、データベース管理ソフト、ネットワーク等のMW(ミドルウェア)等が本実施形態を実現するための各処理の一部を実行してもよい。
さらに、本願発明における記憶媒体は、コンピュータあるいは組み込みシステムと独立した媒体に限らず、LANやインターネット等により伝達されたプログラムをダウンロードして記憶または一時記憶した記憶媒体も含まれる。
また、記憶媒体は1つに限られず、複数の媒体から本実施形態における処理が実行される場合も、本発明における記憶媒体に含まれ、媒体の構成は何れの構成であってもよい。
The instructions shown in the processing procedure shown in the above-described embodiment can be executed based on a program that is software. A general-purpose computer system stores this program in advance and reads this program, so that it is possible to obtain the same effects as those obtained by the image decoding method and the image encoding method of the above-described embodiment. The instructions described in the above-described embodiments are, as programs that can be executed by a computer, magnetic disks (flexible disks, hard disks, etc.), optical disks (CD-ROM, CD-R, CD-RW, DVD-ROM, DVD). ± R, DVD ± RW, etc.), semiconductor memory, or a similar recording medium. As long as the computer or embedded system can read the storage medium, the storage format may be any form. If the computer reads the program from the recording medium and causes the CPU to execute instructions described in the program based on the program, the computer performs the same operation as the image decoding method and the image encoding method of the above-described embodiment. Can be realized. Of course, when the computer acquires or reads the program, it may be acquired or read through a network.
In addition, the OS (operating system), database management software, MW (middleware) such as a network, etc. running on the computer based on the instructions of the program installed in the computer or embedded system from the storage medium realize this embodiment. A part of each process for performing may be executed.
Furthermore, the storage medium in the present invention is not limited to a medium independent of a computer or an embedded system, but also includes a storage medium in which a program transmitted via a LAN or the Internet is downloaded and stored or temporarily stored.
Also, the number of storage media is not limited to one, and the processing in the present embodiment is executed from a plurality of media, and the configuration of the media is included in the storage media in the present invention.

なお、本願発明におけるコンピュータまたは組み込みシステムは、記憶媒体に記憶されたプログラムに基づき、本実施形態における各処理を実行するためのものであって、パソコン、マイコン等の1つからなる装置、複数の装置がネットワーク接続されたシステム等の何れの構成であってもよい。
また、本願発明の実施形態におけるコンピュータとは、パソコンに限らず、情報処理機器に含まれる演算処理装置、マイコン等も含み、プログラムによって本発明の実施形態における機能を実現することが可能な機器、装置を総称している。
The computer or the embedded system in the present invention is for executing each process in the present embodiment based on a program stored in a storage medium, and includes a single device such as a personal computer or a microcomputer, Any configuration such as a system in which apparatuses are connected to a network may be used.
Further, the computer in the embodiment of the present invention is not limited to a personal computer, but includes an arithmetic processing device, a microcomputer, and the like included in an information processing device, and a device capable of realizing the functions in the embodiment of the present invention by a program, The device is a general term.

なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせてもよい。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, constituent elements over different embodiments may be appropriately combined.

601…画像入力部、602、802…演算ユニット、603、803…データ用メモリ、604…符号化データ出力部、605、805…プログラム用メモリ、801…符号化データ入力部、804…画像出力部。 601: Image input unit, 602, 802 ... Arithmetic unit, 603, 803 ... Data memory, 604 ... Encoded data output unit, 605, 805 ... Program memory, 801 ... Encoded data input unit, 804 ... Image output unit .

Claims (10)

入力画像信号を、階層の深さNに応じたブロックサイズに分割されたブロックを復号する動画像復号化方法において、
ブロック単位での分割情報を示すフラグを含むビットストリームを取得するステップと、
前記階層の深さNよりも深さが小さい階層に属する上位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す上位フラグを復号し取得するステップと、
前記階層の深さNに属する下位ブロックのうち、第1の下位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す第1の下位フラグを復号し取得するステップと、
既に取得している前記上位フラグ及び複数の前記第1の下位フラグが特定の組み合わせである場合に、前記階層の深さNに属する第2の下位ブロックの四分木の分割情報を示す第2の下位フラグとして予め定めた第1の値を設定し、前記特定の組み合わせではない場合に、前記第2の下位フラグを復号し取得するステップと、
前記上位フラグと、第1及び第2の下位フラグに従って、前記ブロックの復号画像信号を生成するステップと、
を具備する動画像復号化方法。
In a moving image decoding method for decoding a block obtained by dividing an input image signal into block sizes corresponding to a depth N of a hierarchy,
Obtaining a bitstream including a flag indicating division information in units of blocks;
Decoding and obtaining an upper flag indicating division information of a quadtree of the upper block given to an upper block belonging to a hierarchy having a depth smaller than the depth N of the hierarchy;
Decoding and obtaining a first lower flag indicating division information of the quadrature tree of the upper block given to the first lower block among the lower blocks belonging to the depth N of the hierarchy;
Second information indicating the quadtree division information of the second lower block belonging to the depth N of the hierarchy when the upper flag and the plurality of first lower flags already acquired are in a specific combination. Setting a predetermined first value as a lower flag of the first and decoding and obtaining the second lower flag if it is not the specific combination;
Generating a decoded image signal of the block according to the upper flag and first and second lower flags;
A video decoding method comprising:
前記フラグは、予測残差信号の有無を表すコーデットブロックフラグであることを、特徴とする請求項1記載の動画像復号化方法。   2. The moving picture decoding method according to claim 1, wherein the flag is a coded block flag indicating presence / absence of a prediction residual signal. 前記フラグは、画面間予測で使われるスキップモードかどうかを表すスキップフラグであることを、特徴とする請求項1記載の動画像復号化方法。   The moving image decoding method according to claim 1, wherein the flag is a skip flag indicating whether or not the skip mode is used in inter-screen prediction. 前記特定の組み合わせは、前記上位フラグが前記第1の値であり、前記上位ブロックに包含される複数の前記下位ブロックのうち、前記第2の下位ブロックを除いた全ての下位ブロックの前記第1のフラグが前記第1の値とは異なる第2の値であることを、特徴とする請求項1記載の動画像復号化方法。   In the specific combination, the higher flag is the first value, and the first of all the lower blocks excluding the second lower block among the plurality of lower blocks included in the upper block. The moving picture decoding method according to claim 1, wherein the flag is a second value different from the first value. 入力画像信号を、階層の深さNに応じたブロックサイズに分割されたブロックに符号化処理を行う動画像符号化方法において、
ブロック単位での分割情報を示すフラグを符号化するステップと、
前記階層の深さNよりも深さが小さい階層に属する上位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す上位フラグを取得するステップと、
前記階層の深さNに属する下位ブロックのうち、第1の下位ブロックに付与された、前記上位ブロックの四分木の分割情報を示す第1の下位フラグを取得するステップと、
既に取得している前記上位フラグ及び複数の前記第1の下位フラグが特定の組み合わせである場合に、前記階層の深さNに属する第2の下位ブロックの四分木の分割情報を示す第2の下位フラグとして予め定めた第1の値を設定し、前記特定の組み合わせではない場合に、前記第2の下位フラグを取得するステップと、
前記上位フラグと、第1及び第2の下位フラグに従って、前記ブロックの局部復号画像信号を生成するステップと、
を具備する動画像符号化方法。
In a moving image encoding method for performing an encoding process on an input image signal into blocks divided into block sizes according to the depth N of the hierarchy,
Encoding a flag indicating division information in units of blocks;
Obtaining an upper flag indicating division information of a quadtree of the upper block given to an upper block belonging to a hierarchy having a depth smaller than the depth N of the hierarchy;
Obtaining a first lower flag indicating division information of a quadtree of the upper block given to a first lower block among lower blocks belonging to the depth N of the hierarchy;
Second information indicating the quadtree division information of the second lower block belonging to the depth N of the hierarchy when the upper flag and the plurality of first lower flags already acquired are in a specific combination. Setting a predetermined first value as a lower flag of the first and acquiring the second lower flag when it is not the specific combination;
Generating a locally decoded image signal of the block according to the upper flag and first and second lower flags;
A video encoding method comprising:
前記フラグは、予測残差信号の有無を表すコーデットブロックフラグであることを、特徴とする請求項5記載の動画像符号化方法。   6. The moving picture coding method according to claim 5, wherein the flag is a coded block flag indicating presence / absence of a prediction residual signal. 前記フラグは、画面間予測で使われるスキップモードかどうかを表すスキップフラグであることを、特徴とする請求項5記載の動画像符号化方法。   6. The moving picture encoding method according to claim 5, wherein the flag is a skip flag indicating whether or not the skip mode is used in inter-picture prediction. 記特定の組み合わせは、前記上位フラグが前記第1の値であり、前記上位ブロックに包含される複数の前記下位ブロックのうち、前記第2の下位ブロックを除いた全ての下位ブロックの前記第1のフラグが前記第1の値とは異なる第2の値であることを特徴とする請求項5記載の動画像符号化方法。   In the specific combination, the upper flag is the first value, and among the plurality of lower blocks included in the upper block, the first blocks of all the lower blocks excluding the second lower block are included. The moving image encoding method according to claim 5, wherein the flag is a second value different from the first value. ブロック単位での予測情報、ブロック単位での予測残差信号の有無を表すコーデットパターンデータ、およびブロック単位での予測残差信号をエントロピー符号化した画像データを含むビットストリームを入力するステップと、
前記ビットストリームに含まれる情報が上位コーデットパターンデータである場合に、前記ビットストリームを復号化し上位コーデットパターンデータを取得するステップと、
前記ビットストリームに含まれる情報が前記上位コーデットパターンデータに属するコーデットパターンデータである下位コーデットパターンデータであり、かつ、すでに取得した前記上位コーデットパターンデータと該下位コーデットパターンデータの組み合わせが特定の組み合わせである場合に下位コーデットパターンデータとして予め定めたデータを設定し、前記特定の組み合わせでない場合に前記ビットストリームを復号化し次の下位コーデットパターンデータを取得するステップと、
前記コーデットパターンデータによりブロック単位での予測残差信号の有無を判別するステップと、
前記ビットストリームに含まれる情報がブロック単位での予測情報である場合には、前記ビットストリームを復号化しブロック単位での予測情報を得るステップと、
前記ビットストリームに含まれる情報がブロック単位での予測残差信号である場合には、前記ビットストリームを復号化しブロック単位での予測残差信号を得るステップと、
前記ブロック単位での予測情報、および前記ブロック単位での予測残差信号を利用して、画像信号を復号化するステップと、を具備することを特徴とする画像復号化方法。
Inputting a bitstream including prediction information in block units, coded pattern data indicating the presence or absence of a prediction residual signal in block units, and image data obtained by entropy encoding the prediction residual signal in block units;
When the information included in the bitstream is higher-order code pattern data, decoding the bitstream to obtain higher-order code pattern data;
The information included in the bit stream is lower code pattern data that is code pattern data belonging to the higher code pattern data, and the combination of the already acquired higher code pattern data and the lower code pattern data is a specific combination. Setting predetermined data as lower-order code pattern data in some cases, and decoding the bitstream if not the specific combination to obtain next lower-order code pattern data;
Determining the presence or absence of a prediction residual signal in block units based on the coded pattern data;
If the information included in the bitstream is prediction information in units of blocks, decoding the bitstream to obtain prediction information in units of blocks;
When the information included in the bitstream is a prediction residual signal in units of blocks, decoding the bitstream to obtain a prediction residual signal in units of blocks;
And a step of decoding an image signal using the prediction information in units of blocks and the prediction residual signal in units of blocks.
ブロック単位での予測情報、およびブロック単位での予測残差信号をエントロピー符号化した画像データを含むビットストリームを入力するステップと、
前記ビットストリームに含まれる予測情報が複数のブロックのスキップ予測を表す上位スキップデータである場合に、前記ビットストリームを復号化し上位スキップデータを取得するステップと、
前記ビットストリームに含まれる予測情報が前記上位スキップデータに属するスキップデータである下位スキップデータであり、かつ、すでに取得した前記上位スキップデータと該下位スキップデータの組み合わせが特定の組み合わせである場合に次の下位スキップデータとして予め定めたデータを設定し、前記特定の組み合わせでない場合に前記ビットストリームを復号化し次の下位スキップデータを取得するステップと、
前記ブロック単位での予測情報、および前記ブロック単位での予測残差信号を利用して、画像信号を復号化するステップと、を具備することを特徴とする画像復号化方法。
Inputting a bitstream including prediction information in units of blocks and image data obtained by entropy encoding a prediction residual signal in units of blocks;
When the prediction information included in the bitstream is higher skip data representing skip prediction of a plurality of blocks, decoding the bitstream to obtain higher skip data;
When the prediction information included in the bitstream is lower skip data that is skip data belonging to the upper skip data, and the combination of the acquired upper skip data and the lower skip data is a specific combination Setting predetermined data as lower skip data, and decoding the bitstream if not the specific combination to obtain the next lower skip data;
And a step of decoding an image signal using the prediction information in units of blocks and the prediction residual signal in units of blocks.
JP2012508020A 2010-03-30 2010-11-26 Image encoding and image decoding method Pending JPWO2011121843A1 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
PCT/JP2010/055640 WO2011121715A1 (en) 2010-03-30 2010-03-30 Image decoding method
JPPCT/JP2010/055640 2010-03-30
PCT/JP2010/071155 WO2011121843A1 (en) 2010-03-30 2010-11-26 Image coding and image decoding method

Publications (1)

Publication Number Publication Date
JPWO2011121843A1 true JPWO2011121843A1 (en) 2013-07-04

Family

ID=44711509

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012508020A Pending JPWO2011121843A1 (en) 2010-03-30 2010-11-26 Image encoding and image decoding method

Country Status (4)

Country Link
JP (1) JPWO2011121843A1 (en)
KR (1) KR20120043014A (en)
CN (1) CN102484716A (en)
WO (2) WO2011121715A1 (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107105259B (en) * 2011-03-10 2021-12-28 夏普株式会社 Image decoding device and method, and recording medium
KR20130049524A (en) * 2011-11-04 2013-05-14 오수미 Method for generating intra prediction block
US10390016B2 (en) 2011-11-04 2019-08-20 Infobridge Pte. Ltd. Apparatus of encoding an image
CN103118250B (en) * 2011-11-16 2017-09-26 中兴通讯股份有限公司 A kind of decoding method and device of frame in division symbolizing
CN104137545B (en) * 2012-01-19 2018-06-05 寰发股份有限公司 The coding of encoding block flag and the coding/decoding method of video bit stream and device
WO2013107027A1 (en) * 2012-01-19 2013-07-25 Mediatek Singapore Pte. Ltd. Methods and apparatuses of cbf coding in hevc
US9462275B2 (en) * 2012-01-30 2016-10-04 Qualcomm Incorporated Residual quad tree (RQT) coding for video coding
US9307264B2 (en) * 2012-06-22 2016-04-05 Sharp Kabushiki Kaisha Arithmetic decoding device, arithmetic coding device, image decoding apparatus, and image coding apparatus
CN104321970B (en) * 2012-06-26 2018-01-19 英特尔公司 Interlayer coding unit quaternary tree model prediction
CN104604225B (en) * 2012-09-10 2018-01-26 太阳专利托管公司 Method for encoding images, picture decoding method, picture coding device, picture decoding apparatus and image encoding/decoding device
US9307257B2 (en) * 2013-09-25 2016-04-05 Mitsubishi Electric Research Laboratories, Inc. Method for improving compression efficiency of distributed source coding using intra-band information
US9014499B2 (en) * 2013-09-25 2015-04-21 Mitsubishi Electric Research Laboratories, Inc. Distributed source coding using prediction modes obtained from side information
CN103826115B (en) * 2014-03-21 2016-03-02 华为技术有限公司 The coding and decoding processing method of Iamge Segmentation mode and device
JP6341756B2 (en) * 2014-05-26 2018-06-13 キヤノン株式会社 Image processing apparatus and image processing apparatus control method
CN111373447A (en) * 2017-11-22 2020-07-03 松下电器(美国)知识产权公司 Three-dimensional data encoding method, three-dimensional data decoding method, three-dimensional data encoding device, and three-dimensional data decoding device
CN114697653B (en) * 2018-03-05 2023-11-14 松下电器(美国)知识产权公司 Encoding device, decoding device, and storage medium
CN113711600B (en) * 2019-04-26 2024-06-21 松下电器(美国)知识产权公司 Encoding device, decoding device, encoding method, and decoding method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003324731A (en) * 2002-04-26 2003-11-14 Sony Corp Encoder, decoder, image processing apparatus, method and program for them
JP2009510962A (en) * 2005-10-03 2009-03-12 ノキア コーポレイション Adaptive variable length code for independent variables
JP2009531997A (en) * 2006-03-27 2009-09-03 クゥアルコム・インコーポレイテッド Method and system for encoding and decoding information related to video compression
WO2010039733A2 (en) * 2008-10-03 2010-04-08 Qualcomm Incorporated Video coding with large macroblocks

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101258756A (en) * 2005-07-21 2008-09-03 诺基亚公司 Variable length codes for scalable video coding
US20070230564A1 (en) * 2006-03-29 2007-10-04 Qualcomm Incorporated Video processing with scalability

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003324731A (en) * 2002-04-26 2003-11-14 Sony Corp Encoder, decoder, image processing apparatus, method and program for them
JP2009510962A (en) * 2005-10-03 2009-03-12 ノキア コーポレイション Adaptive variable length code for independent variables
JP2009531997A (en) * 2006-03-27 2009-09-03 クゥアルコム・インコーポレイテッド Method and system for encoding and decoding information related to video compression
WO2010039733A2 (en) * 2008-10-03 2010-04-08 Qualcomm Incorporated Video coding with large macroblocks
JP2012504910A (en) * 2008-10-03 2012-02-23 クゥアルコム・インコーポレイテッド Video coding using large macro blocks

Also Published As

Publication number Publication date
KR20120043014A (en) 2012-05-03
WO2011121843A1 (en) 2011-10-06
CN102484716A (en) 2012-05-30
WO2011121715A1 (en) 2011-10-06

Similar Documents

Publication Publication Date Title
WO2011121843A1 (en) Image coding and image decoding method
US11750841B2 (en) Methods and apparatuses for coding transform blocks
JP6542400B2 (en) Coefficient group and coefficient coding for coefficient scanning
JP6461355B2 (en) Apparatus, method, and program for encoding or decoding image
JP6162150B2 (en) Residual quadtree (RQT) coding for video coding
JP5869108B2 (en) Memory efficient context modeling
KR101446287B1 (en) Video coding method and computer readable redording meduimusing quadtree
JP6339083B2 (en) Coded block flag (CBF) coding for 4: 2: 2 sample format in video coding
JP5869008B2 (en) Conversion in video coding
US9706214B2 (en) Image and video decoding implementations
US10972758B2 (en) Multi-type-tree framework for transform in video coding
JP2023040199A (en) Integrated conversion type notification and transform type dependent transform coefficient level coding
KR101975254B1 (en) Method and apparatus for parallel entropy encoding/decoding
TWI789668B (en) Determining a parametrization for context-adaptive binary arithmetic coding
JP2020526145A (en) Improving compulsory segmentation of boundaries
GB2534612A (en) Palette predictor initializer when encoding or decoding self-contained coding structures
JP2024003218A (en) Decoding device and program

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130618

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20131015